From 5b9b912625a58cef7da2cd6f99edb64563c7fad1 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 27 Dec 2022 13:47:19 +0300 Subject: [PATCH 1/2] Fix border size for shapes --- apps/documenteditor/main/app/view/ShapeSettings.js | 2 +- apps/documenteditor/main/app/view/TextArtSettings.js | 2 +- apps/presentationeditor/main/app/view/ShapeSettings.js | 2 +- apps/presentationeditor/main/app/view/TextArtSettings.js | 2 +- apps/spreadsheeteditor/main/app/view/ShapeSettings.js | 2 +- apps/spreadsheeteditor/main/app/view/TextArtSettings.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 2a2ca84c4..52f81af38 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -1113,7 +1113,7 @@ define([ if (w!==null) w = this._mm2pt(w); var _selectedItem = (w===null) ? w : _.find(this.cmbBorderSize.store.models, function(item) { - if ( witem.attributes.value-0.00001) { + if ( witem.attributes.value-0.0001) { return true; } }); diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js index a6a66bea6..ad8f8a59e 100644 --- a/apps/documenteditor/main/app/view/TextArtSettings.js +++ b/apps/documenteditor/main/app/view/TextArtSettings.js @@ -773,7 +773,7 @@ define([ if (w!==null) w = this._mm2pt(w); var _selectedItem = (w===null) ? w : _.find(this.cmbBorderSize.store.models, function(item) { - if ( witem.attributes.value-0.00001) { + if ( witem.attributes.value-0.0001) { return true; } }); diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index 13b6529bb..e1cdbb06a 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -1043,7 +1043,7 @@ define([ if (w!==null) w = this._mm2pt(w); var _selectedItem = (w===null) ? w : _.find(this.cmbBorderSize.store.models, function(item) { - if ( witem.attributes.value-0.00001) { + if ( witem.attributes.value-0.0001) { return true; } }); diff --git a/apps/presentationeditor/main/app/view/TextArtSettings.js b/apps/presentationeditor/main/app/view/TextArtSettings.js index 848e77b94..c3a3a7197 100644 --- a/apps/presentationeditor/main/app/view/TextArtSettings.js +++ b/apps/presentationeditor/main/app/view/TextArtSettings.js @@ -976,7 +976,7 @@ define([ if (w!==null) w = this._mm2pt(w); var _selectedItem = (w===null) ? w : _.find(this.cmbBorderSize.store.models, function(item) { - if ( witem.attributes.value-0.00001) { + if ( witem.attributes.value-0.0001) { return true; } }); diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index 5361fab57..c036ade37 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -1039,7 +1039,7 @@ define([ if (w!==null) w = this._mm2pt(w); var _selectedItem = (w===null) ? w : _.find(this.cmbBorderSize.store.models, function(item) { - if ( witem.attributes.value-0.00001) { + if ( witem.attributes.value-0.0001) { return true; } }); diff --git a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js index ef15aebd6..29ca2d396 100644 --- a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js @@ -973,7 +973,7 @@ define([ if (w!==null) w = this._mm2pt(w); var _selectedItem = (w===null) ? w : _.find(this.cmbBorderSize.store.models, function(item) { - if ( witem.attributes.value-0.00001) { + if ( witem.attributes.value-0.0001) { return true; } }); From e64d33dd964a280965ea8debbcebd06063261b7c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 27 Dec 2022 14:27:09 +0300 Subject: [PATCH 2/2] For Bug 59171 --- apps/common/main/lib/view/ReviewChanges.js | 2 +- .../main/app/controller/DocumentHolder.js | 2 +- .../main/app/controller/LeftMenu.js | 29 +++++++++--------- .../main/app/controller/Toolbar.js | 3 +- apps/documenteditor/main/app/view/LeftMenu.js | 2 +- .../main/app/controller/DocumentHolder.js | 2 +- .../main/app/controller/LeftMenu.js | 30 +++++++++---------- .../main/app/controller/Toolbar.js | 6 ++-- .../main/app/view/LeftMenu.js | 2 +- .../main/app/controller/DocumentHolder.js | 2 +- .../main/app/controller/LeftMenu.js | 30 +++++++++---------- .../main/app/controller/Toolbar.js | 11 ++++--- .../main/app/view/LeftMenu.js | 2 +- 13 files changed, 65 insertions(+), 58 deletions(-) diff --git a/apps/common/main/lib/view/ReviewChanges.js b/apps/common/main/lib/view/ReviewChanges.js index 4c4c1239f..1ae301987 100644 --- a/apps/common/main/lib/view/ReviewChanges.js +++ b/apps/common/main/lib/view/ReviewChanges.js @@ -584,7 +584,7 @@ define([ } me.btnSharing && me.btnSharing.updateHint(me.tipSharing); me.btnHistory && me.btnHistory.updateHint(me.tipHistory); - me.btnChat && me.btnChat.updateHint(me.txtChat + Common.Utils.String.platformKey('Alt+Q')); + me.btnChat && me.btnChat.updateHint(me.txtChat + (!Common.Utils.isMac ? Common.Utils.String.platformKey('Alt+Q') : '')); if (me.btnCoAuthMode) { me.btnCoAuthMode.setMenu( diff --git a/apps/documenteditor/main/app/controller/DocumentHolder.js b/apps/documenteditor/main/app/controller/DocumentHolder.js index 84bcb1c79..2c63f2802 100644 --- a/apps/documenteditor/main/app/controller/DocumentHolder.js +++ b/apps/documenteditor/main/app/controller/DocumentHolder.js @@ -148,7 +148,7 @@ define([ }; var keymap = {}; - me.hkComments = 'alt+h'; + me.hkComments = Common.Utils.isMac ? 'command+alt+a' : 'alt+h'; keymap[me.hkComments] = function() { if (me.api.can_AddQuotedComment()!==false) { me.addComment(); diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 108f88eb0..9ea36235f 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -130,21 +130,22 @@ define([ isCommentsOnly: false } }; - Common.util.Shortcuts.delegateShortcuts({ - shortcuts: { - 'command+shift+s,ctrl+shift+s': _.bind(this.onShortcut, this, 'save'), - 'command+f,ctrl+f': _.bind(this.onShortcut, this, 'search'), - 'ctrl+h': _.bind(this.onShortcut, this, 'replace'), - 'alt+f': _.bind(this.onShortcut, this, 'file'), - 'esc': _.bind(this.onShortcut, this, 'escape'), - /** coauthoring begin **/ - 'alt+q': _.bind(this.onShortcut, this, 'chat'), - 'command+shift+h,ctrl+shift+h': _.bind(this.onShortcut, this, 'comments'), - /** coauthoring end **/ - 'f1': _.bind(this.onShortcut, this, 'help') - } - }); + var keymap = { + 'command+shift+s,ctrl+shift+s': _.bind(this.onShortcut, this, 'save'), + 'command+f,ctrl+f': _.bind(this.onShortcut, this, 'search'), + 'ctrl+h': _.bind(this.onShortcut, this, 'replace'), + 'esc': _.bind(this.onShortcut, this, 'escape'), + /** coauthoring begin **/ + 'command+shift+h,ctrl+shift+h': _.bind(this.onShortcut, this, 'comments'), + /** coauthoring end **/ + 'f1': _.bind(this.onShortcut, this, 'help') + }; + if (!Common.Utils.isMac) { + keymap['alt+f'] = _.bind(this.onShortcut, this, 'file'); + keymap['alt+q'] = _.bind(this.onShortcut, this, 'chat'); + } + Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap}); Common.util.Shortcuts.suspendEvents(); }, diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index af4cfc27c..6c4c87f42 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -3166,7 +3166,8 @@ define([ toolbar.onCollaborativeChanges(); } } - disable ? Common.util.Shortcuts.suspendEvents('alt+h') : Common.util.Shortcuts.resumeEvents('alt+h'); + var hkComments = Common.Utils.isMac ? 'command+alt+a' : 'alt+h'; + disable ? Common.util.Shortcuts.suspendEvents(hkComments) : Common.util.Shortcuts.resumeEvents(hkComments); }, onSelectRecepientsClick: function(menu, item, e) { diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 2595719d3..2590c79b0 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -126,7 +126,7 @@ define([ this.btnChat = new Common.UI.Button({ el: $markup.elementById('#left-btn-chat'), - hint: this.tipChat + Common.Utils.String.platformKey('Alt+Q'), + hint: this.tipChat + (!Common.Utils.isMac ? Common.Utils.String.platformKey('Alt+Q') : ''), enableToggle: true, disabled: true, toggleGroup: 'leftMenuGroup' diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index c909e3ff4..44162d1c0 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -130,7 +130,7 @@ define([ // Hotkeys // --------------------- var keymap = {}; - me.hkComments = 'alt+h'; + me.hkComments = Common.Utils.isMac ? 'command+alt+a' : 'alt+h'; keymap[me.hkComments] = function() { if (me.api.can_AddQuotedComment()!==false && me.documentHolder.slidesCount>0) { me.addComment(); diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index a0a351eb2..8088fc0a5 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -118,21 +118,21 @@ define([ this.leftMenu.btnThumbs.on('toggle', _.bind(this.onShowTumbnails, this)); this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this)); - Common.util.Shortcuts.delegateShortcuts({ - shortcuts: { - 'command+shift+s,ctrl+shift+s': _.bind(this.onShortcut, this, 'save'), - 'command+f,ctrl+f': _.bind(this.onShortcut, this, 'search'), - 'ctrl+h': _.bind(this.onShortcut, this, 'replace'), - 'alt+f': _.bind(this.onShortcut, this, 'file'), - 'esc': _.bind(this.onShortcut, this, 'escape'), - /** coauthoring begin **/ - 'alt+q': _.bind(this.onShortcut, this, 'chat'), - 'command+shift+h,ctrl+shift+h': _.bind(this.onShortcut, this, 'comments'), - /** coauthoring end **/ - 'f1': _.bind(this.onShortcut, this, 'help') - } - }); - + var keymap = { + 'command+shift+s,ctrl+shift+s': _.bind(this.onShortcut, this, 'save'), + 'command+f,ctrl+f': _.bind(this.onShortcut, this, 'search'), + 'ctrl+h': _.bind(this.onShortcut, this, 'replace'), + 'esc': _.bind(this.onShortcut, this, 'escape'), + /** coauthoring begin **/ + 'command+shift+h,ctrl+shift+h': _.bind(this.onShortcut, this, 'comments'), + /** coauthoring end **/ + 'f1': _.bind(this.onShortcut, this, 'help') + }; + if (!Common.Utils.isMac) { + keymap['alt+f'] = _.bind(this.onShortcut, this, 'file'); + keymap['alt+q'] = _.bind(this.onShortcut, this, 'chat'); + } + Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap}); Common.util.Shortcuts.suspendEvents(); }, diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index e26f624e0..4522f0fb1 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -2623,12 +2623,14 @@ define([ if (toolbar.btnsAddSlide) // toolbar buttons are rendered this.toolbar.lockToolbar(Common.enumLock.menuFileOpen, disable, {array: toolbar.btnsAddSlide.concat(toolbar.btnChangeSlide, toolbar.btnPreview)}); + + var hkComments = Common.Utils.isMac ? 'command+alt+a' : 'alt+h'; if(disable) { mask = $("
").appendTo(toolbar.$el.find('.toolbar')); - Common.util.Shortcuts.suspendEvents('command+k, ctrl+k, alt+h, command+f5, ctrl+f5'); + Common.util.Shortcuts.suspendEvents('command+k, ctrl+k, command+f5, ctrl+f5, ' + hkComments); } else { mask.remove(); - Common.util.Shortcuts.resumeEvents('command+k, ctrl+k, alt+h, command+f5, ctrl+f5'); + Common.util.Shortcuts.resumeEvents('command+k, ctrl+k, command+f5, ctrl+f5, ' + hkComments); } }, diff --git a/apps/presentationeditor/main/app/view/LeftMenu.js b/apps/presentationeditor/main/app/view/LeftMenu.js index 1a47d30d8..7afd3fa6f 100644 --- a/apps/presentationeditor/main/app/view/LeftMenu.js +++ b/apps/presentationeditor/main/app/view/LeftMenu.js @@ -134,7 +134,7 @@ define([ this.btnChat = new Common.UI.Button({ el: $markup.elementById('#left-btn-chat'), - hint: this.tipChat + Common.Utils.String.platformKey('Alt+Q'), + hint: this.tipChat + (!Common.Utils.isMac ? Common.Utils.String.platformKey('Alt+Q') : ''), enableToggle: true, disabled: true, toggleGroup: 'leftMenuGroup' diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 4e4575def..316b1fceb 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -134,7 +134,7 @@ define([ }); var keymap = {}; - this.hkComments = 'alt+h'; + this.hkComments = Common.Utils.isMac ? 'command+alt+a' : 'alt+h'; keymap[this.hkComments] = function() { me.onAddComment(); return false; diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 188023360..8ba7e5ae5 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -111,21 +111,21 @@ define([ this.leftMenu = this.createView('LeftMenu').render(); this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this)); - Common.util.Shortcuts.delegateShortcuts({ - shortcuts: { - 'command+shift+s,ctrl+shift+s': _.bind(this.onShortcut, this, 'save'), - 'command+f,ctrl+f': _.bind(this.onShortcut, this, 'search'), - 'ctrl+h': _.bind(this.onShortcut, this, 'replace'), - 'alt+f': _.bind(this.onShortcut, this, 'file'), - 'esc': _.bind(this.onShortcut, this, 'escape'), - /** coauthoring begin **/ - 'alt+q': _.bind(this.onShortcut, this, 'chat'), - 'command+shift+h,ctrl+shift+h': _.bind(this.onShortcut, this, 'comments'), - /** coauthoring end **/ - 'f1': _.bind(this.onShortcut, this, 'help') - } - }); - + var keymap = { + 'command+shift+s,ctrl+shift+s': _.bind(this.onShortcut, this, 'save'), + 'command+f,ctrl+f': _.bind(this.onShortcut, this, 'search'), + 'ctrl+h': _.bind(this.onShortcut, this, 'replace'), + 'esc': _.bind(this.onShortcut, this, 'escape'), + /** coauthoring begin **/ + 'command+shift+h,ctrl+shift+h': _.bind(this.onShortcut, this, 'comments'), + /** coauthoring end **/ + 'f1': _.bind(this.onShortcut, this, 'help') + }; + if (!Common.Utils.isMac) { + keymap['alt+f'] = _.bind(this.onShortcut, this, 'file'); + keymap['alt+q'] = _.bind(this.onShortcut, this, 'chat'); + } + Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap}); Common.util.Shortcuts.suspendEvents(); var me = this; diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 049b65d5c..b298c69f5 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2548,9 +2548,10 @@ define([ clear: [Common.enumLock.editFormula, Common.enumLock.editText] }); + var hkComments = Common.Utils.isMac ? 'command+alt+a' : 'alt+h'; var is_cell_edited = (state == Asc.c_oAscCellEditorState.editStart); - (is_cell_edited) ? Common.util.Shortcuts.suspendEvents('command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, alt+h, command+1, ctrl+1') : - Common.util.Shortcuts.resumeEvents('command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, alt+h, command+1, ctrl+1'); + (is_cell_edited) ? Common.util.Shortcuts.suspendEvents('command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+1, ctrl+1, ' + hkComments) : + Common.util.Shortcuts.resumeEvents('command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+1, ctrl+1, ' + hkComments); if (is_cell_edited) { toolbar.listStyles.suspendEvents(); @@ -4463,12 +4464,14 @@ define([ toolbar.$el.find('.toolbar').toggleClass('masked', disable); this.toolbar.lockToolbar(Common.enumLock.menuFileOpen, disable); + + var hkComments = Common.Utils.isMac ? 'command+alt+a' : 'alt+h'; if(disable) { mask = $("
").appendTo(toolbar.$el.find('.toolbar')); - Common.util.Shortcuts.suspendEvents('command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+alt+h, ctrl+alt+h, command+1, ctrl+1'); + Common.util.Shortcuts.suspendEvents('command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+1, ctrl+1, ' + hkComments); } else { mask.remove(); - Common.util.Shortcuts.resumeEvents('command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+alt+h, ctrl+alt+h, command+1, ctrl+1'); + Common.util.Shortcuts.resumeEvents('command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+1, ctrl+1, ' + hkComments); } }, diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index bb9966d06..993ee7217 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -116,7 +116,7 @@ define([ this.btnChat = new Common.UI.Button({ el: $markup.elementById('#left-btn-chat'), - hint: this.tipChat + Common.Utils.String.platformKey('Alt+Q'), + hint: this.tipChat + (!Common.Utils.isMac ? Common.Utils.String.platformKey('Alt+Q') : ''), enableToggle: true, disabled: true, toggleGroup: 'leftMenuGroup'