From 62803f0e1397f0fae403efcce70d348895094986 Mon Sep 17 00:00:00 2001 From: Alfred Egger Date: Wed, 12 Jun 2019 18:28:28 +0200 Subject: [PATCH] Make changes to fix printing --- appinfo/info.xml | 6 +++--- js/printer.tabview.js | 36 ++++++++++++++++-------------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 9983598..b7b47ae 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -24,9 +24,9 @@ files tools - https://github.com/westberliner/owncloud-checksum/ - https://github.com/westberliner/owncloud-checksum/issues - https://raw.githubusercontent.com/westberliner/owncloud-checksum/master/screenshots/checksum.gif + https://github.com/e.alfred/nextcloud-printer/ + https://github.com/westberliner/nextcloud-printer/issues + https://raw.githubusercontent.com/e-alfred/nextcloud-printer/master/screenshots/print.gif diff --git a/js/printer.tabview.js b/js/printer.tabview.js index 41b652b..32aeebb 100644 --- a/js/printer.tabview.js +++ b/js/printer.tabview.js @@ -32,21 +32,17 @@ this._renderSelectList(this.$el); this.delegateEvents({ - 'change #choose-algorithm': '_onChangeEvent' + 'change #choose-orientation': '_onChangeEvent' }); }, _renderSelectList: function($el) { - $el.html('
' - + '' + + '' + + '' + + '' + '
' ); }, @@ -68,7 +64,7 @@ /** * ajax callback for generating md5 hash */ - check: function(fileInfo, algorithmType) { + check: function(fileInfo, orientation) { // skip call if fileInfo is null if(null == fileInfo) { _self.updateDisplay({ @@ -80,7 +76,7 @@ } var url = OC.generateUrl('/apps/printer/printfile'), - data = {source: fileInfo.getFullPath(), type: algorithmType}, + data = {source: fileInfo.getFullPath(), type: orientation}, _self = this; $.ajax({ type: 'GET', @@ -89,7 +85,7 @@ data: data, async: true, success: function(data) { - _self.updateDisplay(data, algorithmType); + _self.updateDisplay(data, orientation); } }); @@ -98,11 +94,11 @@ /** * display message from ajax callback */ - updateDisplay: function(data, algorithmType) { + updateDisplay: function(data, orientation) { var msg = ''; if('success' == data.response) { - msg = algorithmType + ': ' + data.msg; + msg = orientation + ': ' + data.msg; } if('error' == data.response) { msg = data.msg; @@ -114,7 +110,7 @@ 'click #reload-checksum': '_onReloadEvent' }); - this.$el.find('.get-checksum').html(msg); + this.$el.find('.get-print').html(msg); }, @@ -122,14 +118,14 @@ * changeHandler */ _onChangeEvent: function(ev) { - var algorithmType = $(ev.currentTarget).val(); - if(algorithmType != '') { - this.$el.html('



' + t('printer', 'Printing document ...') + '

'); - this.check(this.getFileInfo(), algorithmType); + this.check(this.getFileInfo(), orientation); } },