</div>
</div>
<div class="col-md-2">
- <button type="button"
- ng-click="testPrint()"
- class="btn btn-default btn-lg pull-right btn-success">
- [% l('Print') %]</button>
+ <div class="input-group pull-right">
+ <div class="input-group-btn">
+ <button type="button"
+ ng-click="testPrint()"
+ class="btn btn-default btn-success">
+ [% l('Print') %]</button>
+ <button type="button"
+ ng-click="testPrint(true)"
+ class="btn btn-default btn-info">
+ [% l('Print with Dialog') %]</button>
+ </div>
+ </div>
</div>
</div>
<style>p { color: blue }</style>
<h2>[% l('Test HTML Print') %]</h2>
<br/>
- <img src=\'/opac/images/main_logo.png\' width=\'140\' height=\'24\'/>
+ <img src=\'http://[% ctx.hostname %]/opac/images/main_logo.png\' width=\'140\' height=\'24\'/>
<p>[% l('Welcome, Stranger!') %]</p>
<p>{{value1}}</p>
<p>{{value2}}</p>
// for testing
$scope.setContentType = function(type) { $scope.contentType = type }
- $scope.testPrint = function() {
+ $scope.testPrint = function(withDialog) {
if ($scope.contentType == 'text/plain') {
- egPrintStore.print($scope.context, $scope.contentType, $scope.textPrintContent);
+ egPrintStore.print(
+ $scope.context,
+ $scope.contentType,
+ $scope.textPrintContent,
+ withDialog
+ );
} else {
egPrintStore.print(
$scope.context,
value1 : 'Value One',
value2 : 'Value Two',
date_value : '2015-02-04T14:04:34-0400'
- }
+ },
+ withDialog
);
}
}
// print the provided content
// supported values for contentType are 'text/html' and 'text/plain'
- service.print = function(context, contentType, content, printScope) {
+ service.print = function(
+ context, contentType, content, printScope, withDialog) {
if (contentType == 'text/html') {
content = service.interpolateHtmlTemplate(content, printScope);
config : conf[context],
content : content,
contentType : contentType,
+ showDialog : withDialog
});
});
}