From 12c3c4750fe9172efce46c2fcf4828e2bb4223ef Mon Sep 17 00:00:00 2001 From: jendib Date: Sun, 2 Feb 2014 01:19:17 +0100 Subject: [PATCH] Print a file --- docs-parent/TODO | 1 + .../src/main/webapp/app/docs/controller/FileView.js | 11 +++++++++++ .../src/main/webapp/app/share/controller/FileView.js | 11 +++++++++++ docs-web/src/main/webapp/partial/docs/file.view.html | 3 +++ docs-web/src/main/webapp/partial/share/file.view.html | 3 +++ 5 files changed, 29 insertions(+) diff --git a/docs-parent/TODO b/docs-parent/TODO index 33d0be56..ea021c12 100644 --- a/docs-parent/TODO +++ b/docs-parent/TODO @@ -1,2 +1,3 @@ - Automatic backup system using Quartz (server) - Handle error while uploading a file +- Download all files as zip (docs & share) diff --git a/docs-web/src/main/webapp/app/docs/controller/FileView.js b/docs-web/src/main/webapp/app/docs/controller/FileView.js index b16073a8..8829c1d7 100644 --- a/docs-web/src/main/webapp/app/docs/controller/FileView.js +++ b/docs-web/src/main/webapp/app/docs/controller/FileView.js @@ -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. */ diff --git a/docs-web/src/main/webapp/app/share/controller/FileView.js b/docs-web/src/main/webapp/app/share/controller/FileView.js index 542f7897..834e8d60 100644 --- a/docs-web/src/main/webapp/app/share/controller/FileView.js +++ b/docs-web/src/main/webapp/app/share/controller/FileView.js @@ -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. */ diff --git a/docs-web/src/main/webapp/partial/docs/file.view.html b/docs-web/src/main/webapp/partial/docs/file.view.html index c820a909..e7dd1d36 100644 --- a/docs-web/src/main/webapp/partial/docs/file.view.html +++ b/docs-web/src/main/webapp/partial/docs/file.view.html @@ -11,6 +11,9 @@
+ diff --git a/docs-web/src/main/webapp/partial/share/file.view.html b/docs-web/src/main/webapp/partial/share/file.view.html index 009df8cb..761f5541 100644 --- a/docs-web/src/main/webapp/partial/share/file.view.html +++ b/docs-web/src/main/webapp/partial/share/file.view.html @@ -11,6 +11,9 @@
+