diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 2c6a6115c..3aee58441 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1464,7 +1464,7 @@ define([ var type = /^(?:(djvu))$/.exec(this.document.fileType); this.appOptions.canDownloadOrigin = this.permissions.download !== false && (type && typeof type[1] === 'string'); this.appOptions.canDownload = this.permissions.download !== false && (!type || typeof type[1] !== 'string'); - this.appOptions.canUseThumbnails = this.appOptions.canUseViwerNavigation = /^(?:(pdf|djvu|xps|oxps))$/.test(this.document.fileType); + this.appOptions.canUseSelectHandTools = this.appOptions.canUseThumbnails = this.appOptions.canUseViwerNavigation = /^(?:(pdf|djvu|xps|oxps))$/.test(this.document.fileType); this.appOptions.canDownloadForms = this.appOptions.canLicense && this.appOptions.canDownload; this.appOptions.fileKey = this.document.key; diff --git a/apps/documenteditor/main/app/controller/Statusbar.js b/apps/documenteditor/main/app/controller/Statusbar.js index 2418b501d..d1b865ae4 100644 --- a/apps/documenteditor/main/app/controller/Statusbar.js +++ b/apps/documenteditor/main/app/controller/Statusbar.js @@ -119,6 +119,9 @@ define([ } else { me.statusbar.$el.find('.el-edit, .el-review').hide(); } + if (cfg.canUseSelectHandTools) { + me.statusbar.$el.find('.hide-select-tools').removeClass('hide-select-tools'); + } }); Common.NotificationCenter.on('app:ready', me.onAppReady.bind(me)); @@ -131,6 +134,12 @@ define([ resolve(); })).then(function () { me.bindViewEvents(me.statusbar, me.events); + if (config.canUseSelectHandTools) { + me.statusbar.btnSelectTool.on('click', _.bind(me.onSelectTool, me, 'select')); + me.statusbar.btnHandTool.on('click', _.bind(me.onSelectTool, me, 'hand')); + me.statusbar.btnHandTool.toggle(true, true); + me.api.asc_setViewerTargetType('hand'); + } var statusbarIsHidden = Common.localStorage.getBool("de-hidden-status"); if ( config.canReview && !statusbarIsHidden ) { @@ -344,6 +353,12 @@ define([ this.disconnectTip = null; }, + onSelectTool: function (type, btn, e) { + if (this.api) { + this.api.asc_setViewerTargetType(type); + } + }, + zoomText : 'Zoom {0}%', textHasChanges : 'New changes have been tracked', textTrackChanges: 'The document is opened with the Track Changes mode enabled', diff --git a/apps/documenteditor/main/app/template/StatusBar.template b/apps/documenteditor/main/app/template/StatusBar.template index 9025b74a2..22702f8bc 100644 --- a/apps/documenteditor/main/app/template/StatusBar.template +++ b/apps/documenteditor/main/app/template/StatusBar.template @@ -19,6 +19,10 @@
+
+ + +
diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index 18a661d7b..5961dc957 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -79,6 +79,11 @@ define([ me.btnZoomDown.updateHint(me.tipZoomOut + Common.Utils.String.platformKey('Ctrl+-')); me.btnZoomUp.updateHint(me.tipZoomIn + Common.Utils.String.platformKey('Ctrl++')); + if (config.canUseSelectHandTools) { + me.btnSelectTool.updateHint(me.tipSelectTool); + me.btnHandTool.updateHint(me.tipHandTool); + } + if (me.btnLanguage && me.btnLanguage.cmpEl) { me.btnLanguage.updateHint(me.tipSetLang); me.langMenu.on('item:click', _.bind(_clickLanguage, this)); @@ -179,6 +184,18 @@ define([ textPageNumber: Common.Utils.String.format(this.pageIndexText, 1, 1) })); + this.btnSelectTool = new Common.UI.Button({ + hintAnchor: 'top', + toggleGroup: 'select-tools', + enableToggle: true + }); + + this.btnHandTool = new Common.UI.Button({ + hintAnchor: 'top', + toggleGroup: 'select-tools', + enableToggle: true + }); + this.btnZoomToPage = new Common.UI.Button({ hintAnchor: 'top', toggleGroup: 'status-zoom', @@ -292,6 +309,11 @@ define([ me.langMenu.prevTip = 'en'; } + if (config.canUseSelectHandTools) { + _btn_render(me.btnSelectTool, $('#btn-select-tool', me.$layout)); + _btn_render(me.btnHandTool, $('#btn-hand-tool', me.$layout)); + } + me.zoomMenu.render($('.cnt-zoom',me.$layout)); me.zoomMenu.cmpEl.attr({tabindex: -1}); @@ -394,7 +416,9 @@ define([ tipSetLang : 'Set Text Language', txtPageNumInvalid : 'Page number invalid', textTrackChanges : 'Track Changes', - textChangesPanel : 'Changes panel' + textChangesPanel : 'Changes panel', + tipSelectTool : 'Select tool', + tipHandTool : 'Hand tool' }, DE.Views.Statusbar || {})); } ); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index aaf79526c..08ed681e8 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -2384,6 +2384,8 @@ "DE.Views.Statusbar.tipZoomIn": "Zoom in", "DE.Views.Statusbar.tipZoomOut": "Zoom out", "DE.Views.Statusbar.txtPageNumInvalid": "Page number invalid", + "DE.Views.Statusbar.tipSelectTool": "Select tool", + "DE.Views.Statusbar.tipHandTool": "Hand tool", "DE.Views.StyleTitleDialog.textHeader": "Create New Style", "DE.Views.StyleTitleDialog.textNextStyle": "Next paragraph style", "DE.Views.StyleTitleDialog.textTitle": "Title", diff --git a/apps/documenteditor/main/resources/img/toolbar/1.25x/btn-hand-tool.png b/apps/documenteditor/main/resources/img/toolbar/1.25x/btn-hand-tool.png new file mode 100644 index 000000000..ff0088d29 Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/1.25x/btn-hand-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/1.25x/btn-select-tool.png b/apps/documenteditor/main/resources/img/toolbar/1.25x/btn-select-tool.png new file mode 100644 index 000000000..5b4605ba2 Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/1.25x/btn-select-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/1.5x/btn-hand-tool.png b/apps/documenteditor/main/resources/img/toolbar/1.5x/btn-hand-tool.png new file mode 100644 index 000000000..ec1cfccd5 Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/1.5x/btn-hand-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/1.5x/btn-select-tool.png b/apps/documenteditor/main/resources/img/toolbar/1.5x/btn-select-tool.png new file mode 100644 index 000000000..44314a2f0 Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/1.5x/btn-select-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/1.75x/btn-hand-tool.png b/apps/documenteditor/main/resources/img/toolbar/1.75x/btn-hand-tool.png new file mode 100644 index 000000000..0436e3111 Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/1.75x/btn-hand-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/1.75x/btn-select-tool.png b/apps/documenteditor/main/resources/img/toolbar/1.75x/btn-select-tool.png new file mode 100644 index 000000000..b749b840c Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/1.75x/btn-select-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/1x/btn-hand-tool.png b/apps/documenteditor/main/resources/img/toolbar/1x/btn-hand-tool.png new file mode 100644 index 000000000..52eb5d6b1 Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/1x/btn-hand-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/1x/btn-select-tool.png b/apps/documenteditor/main/resources/img/toolbar/1x/btn-select-tool.png new file mode 100644 index 000000000..375cb606b Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/1x/btn-select-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/2x/btn-hand-tool.png b/apps/documenteditor/main/resources/img/toolbar/2x/btn-hand-tool.png new file mode 100644 index 000000000..9e5517eee Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/2x/btn-hand-tool.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar/2x/btn-select-tool.png b/apps/documenteditor/main/resources/img/toolbar/2x/btn-select-tool.png new file mode 100644 index 000000000..b92b1e6c1 Binary files /dev/null and b/apps/documenteditor/main/resources/img/toolbar/2x/btn-select-tool.png differ diff --git a/apps/documenteditor/main/resources/less/statusbar.less b/apps/documenteditor/main/resources/less/statusbar.less index 73a76acb8..a20d7e158 100644 --- a/apps/documenteditor/main/resources/less/statusbar.less +++ b/apps/documenteditor/main/resources/less/statusbar.less @@ -164,4 +164,12 @@ } } } + + .hide-select-tools { + display: none; + } + + #btn-select-tool { + margin-right: 8px; + } }