Print a file

This commit is contained in:
jendib 2014-02-02 01:19:17 +01:00
parent 42f23ed0d7
commit 12c3c4750f
5 changed files with 29 additions and 0 deletions

View File

@ -1,2 +1,3 @@
- Automatic backup system using Quartz (server)
- Handle error while uploading a file
- Download all files as zip (docs & share)

View File

@ -55,6 +55,17 @@ App.controller('FileView', function($modal, $state, $stateParams) {
window.open('api/file/' + $stateParams.fileId + '/data');
};
/**
* Print the file.
*/
$scope.printFile = function() {
var popup = window.open('api/file/' + $stateParams.fileId + '/data', '_blank');
popup.onload = function () {
popup.print();
popup.close();
}
};
/**
* Close the file preview.
*/

View File

@ -55,6 +55,17 @@ App.controller('FileView', function($modal, $state, $stateParams) {
window.open('api/file/' + $stateParams.fileId + '/data?share=' + $stateParams.shareId);
};
/**
* Print the file.
*/
$scope.printFile = function() {
var popup = window.open('api/file/' + $stateParams.fileId + '/data', '_blank');
popup.onload = function () {
popup.print();
popup.close();
}
};
/**
* Close the file preview.
*/

View File

@ -11,6 +11,9 @@
</div>
<div class="btn-group pull-right">
<button type="button" class="btn btn-default" ng-click="printFile()">
<span class="glyphicon glyphicon-print"></span>
</button>
<button type="button" class="btn btn-default" ng-click="openFile()">
<span class="glyphicon glyphicon-download-alt"></span>
</button>

View File

@ -11,6 +11,9 @@
</div>
<div class="btn-group pull-right">
<button type="button" class="btn btn-default" ng-click="printFile()">
<span class="glyphicon glyphicon-print"></span>
</button>
<button type="button" class="btn btn-default" ng-click="openFile()">
<span class="glyphicon glyphicon-download-alt"></span>
</button>