diff --git a/apps/documenteditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg b/apps/common/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg rename to apps/common/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg diff --git a/apps/documenteditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png diff --git a/apps/pdfeditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png b/apps/pdfeditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png deleted file mode 100644 index 1e3722ba11..0000000000 Binary files a/apps/pdfeditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png and /dev/null differ diff --git a/apps/pdfeditor/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png b/apps/pdfeditor/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png deleted file mode 100644 index 89a0851c57..0000000000 Binary files a/apps/pdfeditor/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png and /dev/null differ diff --git a/apps/pdfeditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png b/apps/pdfeditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png deleted file mode 100644 index 889b06d8e3..0000000000 Binary files a/apps/pdfeditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png and /dev/null differ diff --git a/apps/pdfeditor/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png b/apps/pdfeditor/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png deleted file mode 100644 index c7478cb15b..0000000000 Binary files a/apps/pdfeditor/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png and /dev/null differ diff --git a/apps/pdfeditor/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg b/apps/pdfeditor/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg deleted file mode 100644 index 5350e920f9..0000000000 --- a/apps/pdfeditor/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/pdfeditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png b/apps/pdfeditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png deleted file mode 100644 index 87ea9eb23b..0000000000 Binary files a/apps/pdfeditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png and /dev/null differ diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 6ba03a3caf..59dddc4d35 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -943,8 +943,6 @@ define([ value = Common.localStorage.getBool('pe-hidden-notes', this.appOptions.customization && this.appOptions.customization.hideNotes===true); me.api.asc_ShowNotes(!value); - me.api.asc_setViewerTargetType(this.appOptions.customization && this.appOptions.customization.pointerMode==='hand' ? 'hand' : 'select'); - function checkWarns() { if (!Common.Controllers.Desktop.isActive()) { var tips = []; diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index c5ee1eb8a4..3d3bbd8e11 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -67,6 +67,7 @@ define([ Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this)); Common.NotificationCenter.on('settings:unitschanged', _.bind(this.unitsChanged, this)); Common.NotificationCenter.on('tabstyle:changed', this.onTabStyleChange.bind(this)); + Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, setApi: function (api) { @@ -112,7 +113,9 @@ define([ 'gridlines:spacing': _.bind(this.onGridlinesSpacing, this), 'gridlines:custom': _.bind(this.onGridlinesCustom, this), 'gridlines:aftershow': _.bind(this.onGridlinesAfterShow, this), - 'macros:click': _.bind(this.onClickMacros, this) + 'macros:click': _.bind(this.onClickMacros, this), + 'pointer:select': _.bind(this.onPointerType, this, 'select'), + 'pointer:hand': _.bind(this.onPointerType, this, 'hand') }, 'Toolbar': { 'view:compact': _.bind(function (toolbar, state) { @@ -430,12 +433,32 @@ define([ this.changeViewMode(mode); }, + onPointerType: function (type) { + if (this.api) { + this.api.asc_setViewerTargetType(type); + Common.NotificationCenter.trigger('edit:complete', this.view); + } + }, + onTabStyleChange: function () { if (this.view && this.view.menuTabStyle) { _.each(this.view.menuTabStyle.items, function(item){ item.setChecked(Common.Utils.InternalSettings.get("settings-tab-style")===item.value, true); }); } + }, + + onAppReady: function (config) { + var me = this; + (new Promise(function (accept, reject) { + accept(); + })).then(function () { + if (me.view && me.view.btnHandTool) { + var hand = config && config.customization && config.customization.pointerMode==='hand'; + me.api && me.api.asc_setViewerTargetType(hand ? 'hand' : 'select'); + me.view[hand ? 'btnHandTool' : 'btnSelectTool'].toggle(true, true); + } + }); } }, PE.Controllers.ViewTab || {})); diff --git a/apps/presentationeditor/main/app/view/ViewTab.js b/apps/presentationeditor/main/app/view/ViewTab.js index c4c8e6992c..32dbed2968 100644 --- a/apps/presentationeditor/main/app/view/ViewTab.js +++ b/apps/presentationeditor/main/app/view/ViewTab.js @@ -51,6 +51,11 @@ define([ '' + '' + '
' + + '
' + + '' + + '' + + '
' + + '
' + '
' + '
' + '' + @@ -189,6 +194,12 @@ define([ me.btnMacros && me.btnMacros.on('click', function () { me.fireEvent('macros:click'); }); + me.btnSelectTool && me.btnSelectTool.on('toggle', _.bind(function(btn, state) { + state && me.fireEvent('pointer:select'); + }, me)); + me.btnHandTool && me.btnHandTool.on('toggle', _.bind(function(btn, state) { + state && me.fireEvent('pointer:hand'); + }, me)); }, initialize: function (options) { @@ -397,6 +408,36 @@ define([ }); this.lockedControls.push(this.btnMacros); } + if (!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit) { + this.btnSelectTool = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-select', + lock: [_set.disableOnStart], + caption: me.capBtnSelect, + toggleGroup: 'select-tools-tb', + enableToggle: true, + allowDepress: false, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnSelectTool); + + this.btnHandTool = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-big-hand-tool', + lock: [_set.disableOnStart], + caption: me.capBtnHand, + toggleGroup: 'select-tools-tb', + enableToggle: true, + allowDepress: false, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnHandTool); + } + Common.UI.LayoutManager.addControls(this.lockedControls); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -427,6 +468,8 @@ define([ this.chLeftMenu.render($host.find('#slot-chk-leftmenu')); this.chRightMenu.render($host.find('#slot-chk-rightmenu')); this.btnMacros && this.btnMacros.render($host.find('#slot-btn-macros')); + this.btnSelectTool && this.btnSelectTool.render($host.find('#slot-btn-select-tool')); + this.btnHandTool && this.btnHandTool.render($host.find('#slot-btn-hand-tool')); return this.$el; }, @@ -443,7 +486,8 @@ define([ me.btnGuides.updateHint(me.tipGuides); me.btnGridlines.updateHint(me.tipGridlines); me.btnMacros && me.btnMacros.updateHint(me.tipMacros); - + me.btnSelectTool && me.btnSelectTool.updateHint(me.tipSelectTool); + me.btnHandTool && me.btnHandTool.updateHint(me.tipHandTool); me.btnGuides.setMenu( new Common.UI.Menu({ cls: 'shifted-right', items: [ @@ -504,6 +548,9 @@ define([ me.$el.find('#slot-btn-slide-master').closest('.group').next().addBack().remove(); me.$el.find('#slot-btn-macros').closest('.group').prev().addBack().remove(); } + if (config.isEdit || config.isRestrictedEdit) { + me.$el.find('#slot-btn-hand-tool').closest('.group').next().addBack().remove(); + } if (Common.UI.Themes.available()) { function _add_tab_styles() { diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 66ec589749..f9a3ff527c 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -2952,5 +2952,9 @@ "PE.Views.ViewTab.tipSlideMaster": "Slide master", "PE.Views.Toolbar.textTabDesign": "Design", "PE.Views.ViewTab.textMacros": "Macros", - "PE.Views.ViewTab.tipMacros": "Macros" + "PE.Views.ViewTab.tipMacros": "Macros", + "PE.Views.ViewTab.capBtnHand": "Hand", + "PE.Views.ViewTab.capBtnSelect": "Select", + "PE.Views.ViewTab.tipSelectTool": "Select tool", + "PE.Views.ViewTab.tipHandTool": "Hand tool" }