From 2eda10c7f670d597fc2ee78f43e0316640a1e699 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Tue, 17 May 2022 18:55:18 +0300 Subject: [PATCH] [DE PE SSE] Fix bug 55786 --- apps/common/main/lib/controller/HintManager.js | 9 +++++++-- apps/documenteditor/main/app/controller/Main.js | 3 +++ .../main/app/view/FileMenuPanels.js | 17 +++++++++++++++++ apps/documenteditor/main/locale/en.json | 2 ++ .../main/app/controller/Main.js | 3 +++ .../main/app/view/FileMenuPanels.js | 17 +++++++++++++++++ apps/presentationeditor/main/locale/en.json | 2 ++ .../main/app/controller/Main.js | 3 +++ .../main/app/view/FileMenuPanels.js | 16 ++++++++++++++++ apps/spreadsheeteditor/main/locale/en.json | 2 ++ 10 files changed, 72 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/controller/HintManager.js b/apps/common/main/lib/controller/HintManager.js index 9f135fda1..08b9b5240 100644 --- a/apps/common/main/lib/controller/HintManager.js +++ b/apps/common/main/lib/controller/HintManager.js @@ -117,7 +117,8 @@ Common.UI.HintManager = new(function() { _inputTimer, _isDocReady = false, _isEditDiagram = false, - _usedTitles = []; + _usedTitles = [], + _appPrefix; var _api; @@ -436,6 +437,10 @@ Common.UI.HintManager = new(function() { var _init = function(api) { _api = api; + + var filter = Common.localStorage.getKeysFilter(); + _appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; + Common.NotificationCenter.on({ 'app:ready': function (mode) { var lang = mode.lang ? mode.lang.toLowerCase() : 'en'; @@ -594,7 +599,7 @@ Common.UI.HintManager = new(function() { } } - _needShow = (!e.shiftKey && e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0); + _needShow = (Common.Utils.InternalSettings.get(_appPrefix + "settings-use-alt-key") && !e.shiftKey && e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0); if (e.altKey && e.keyCode !== 115) { e.preventDefault(); } diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index d0db04c58..478a53072 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1221,6 +1221,9 @@ define([ Common.Utils.InternalSettings.set("de-settings-inputmode", value); me.api.SetTextBoxInputMode(value); + value = Common.localStorage.getBool("de-settings-use-alt-key", true); + Common.Utils.InternalSettings.set("de-settings-use-alt-key", value); + /** coauthoring begin **/ me._state.fastCoauth = Common.Utils.InternalSettings.get("de-settings-coauthmode"); me.api.asc_SetFastCollaborative(me._state.fastCoauth); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 1100abf9b..e03640684 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -341,6 +341,9 @@ define([ '', '
', '', + '', + '
', + '', '', '', '', @@ -400,6 +403,14 @@ define([ dataHintOffset: 'small' }); + this.chUseAltKey = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-use-alt-key'), + labelText: Common.Utils.isMac ? this.txtUseOptionKey : this.txtUseAltKey, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + /** coauthoring begin **/ this.chLiveComment = new Common.UI.CheckBox({ el: $markup.findById('#fms-chb-live-comment'), @@ -776,6 +787,8 @@ define([ updateSettings: function() { this.chInputMode.setValue(Common.Utils.InternalSettings.get("de-settings-inputmode")); + this.chUseAltKey.setValue(Common.Utils.InternalSettings.get("de-settings-use-alt-key")); + var value = Common.Utils.InternalSettings.get("de-settings-zoom"); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100); var item = this.cmbZoom.store.findWhere({value: value}); @@ -858,6 +871,8 @@ define([ if (!this.chDarkMode.isDisabled() && (this.chDarkMode.isChecked() !== Common.UI.Themes.isContentThemeDark())) Common.UI.Themes.toggleContentTheme(); Common.localStorage.setItem("de-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); + Common.localStorage.setItem("de-settings-use-alt-key", this.chUseAltKey.isChecked() ? 1 : 0); + Common.Utils.InternalSettings.set("de-settings-use-alt-key", Common.localStorage.getBool("de-settings-use-alt-key")); Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("de-settings-zoom", Common.localStorage.getItem("de-settings-zoom")); @@ -996,6 +1011,8 @@ define([ txtShowTrackChanges: 'Show track changes', txtWorkspace: 'Workspace', txtHieroglyphs: 'Hieroglyphs', + txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', + txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', strShowComments: 'Show comments in text', strShowResolvedComments: 'Show resolved comments', txtFastTip: 'Real-time co-editing. All changes are saved automatically', diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 7880d6e7e..226c2665b 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1785,6 +1785,8 @@ "DE.Views.FileMenuPanels.Settings.txtFitPage": "Fit to Page", "DE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit to Width", "DE.Views.FileMenuPanels.Settings.txtHieroglyphs": "Hieroglyphs", + "DE.Views.FileMenuPanels.Settings.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", + "DE.Views.FileMenuPanels.Settings.txtUseOptionKey": "Use Option key to navigate the user interface using the keyboard", "DE.Views.FileMenuPanels.Settings.txtInch": "Inch", "DE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input", "DE.Views.FileMenuPanels.Settings.txtLast": "View Last", diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 9f12663c8..564c0271f 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -847,6 +847,9 @@ define([ Common.Utils.InternalSettings.set("pe-settings-inputmode", value); me.api.SetTextBoxInputMode(value); + value = Common.localStorage.getBool("pe-settings-use-alt-key", true); + Common.Utils.InternalSettings.set("pe-settings-use-alt-key", value); + /** coauthoring begin **/ me._state.fastCoauth = Common.Utils.InternalSettings.get("pe-settings-coauthmode"); me.api.asc_SetFastCollaborative(me._state.fastCoauth); diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index a620192a0..770749a44 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -266,6 +266,9 @@ define([ '', '
', '', + '', + '
', + '', '', '', @@ -349,6 +352,14 @@ define([ dataHintOffset: 'small' }); + this.chUseAltKey = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-use-alt-key'), + labelText: Common.Utils.isMac ? this.txtUseOptionKey : this.txtUseAltKey, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.cmbZoom = new Common.UI.ComboBox({ el : $markup.findById('#fms-cmb-zoom'), style : 'width: 160px;', @@ -616,6 +627,8 @@ define([ this.chInputMode.setValue(Common.Utils.InternalSettings.get("pe-settings-inputmode")); + this.chUseAltKey.setValue(Common.Utils.InternalSettings.get("pe-settings-use-alt-key")); + var value = Common.Utils.InternalSettings.get("pe-settings-zoom"); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : -1); var item = this.cmbZoom.store.findWhere({value: value}); @@ -678,6 +691,8 @@ define([ Common.localStorage.setBool("pe-spellcheck-ignore-numbers-words", this.chIgnoreNumbers.isChecked()); } Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); + Common.localStorage.setItem("pe-settings-use-alt-key", this.chUseAltKey.isChecked() ? 1 : 0); + Common.Utils.InternalSettings.set("pe-settings-use-alt-key", Common.localStorage.getBool("pe-settings-use-alt-key")); Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("pe-settings-zoom", Common.localStorage.getItem("pe-settings-zoom")); /** coauthoring begin **/ @@ -773,6 +788,8 @@ define([ txtCollaboration: 'Collaboration', txtWorkspace: 'Workspace', txtHieroglyphs: 'Hieroglyphs', + txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', + txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', txtFastTip: 'Real-time co-editing. All changes are saved automatically', txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE', diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 1fdbb3cf9..614907c39 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1645,6 +1645,8 @@ "PE.Views.FileMenuPanels.Settings.txtFitSlide": "Fit to Slide", "PE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit to Width", "PE.Views.FileMenuPanels.Settings.txtHieroglyphs": "Hieroglyphs", + "PE.Views.FileMenuPanels.Settings.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", + "PE.Views.FileMenuPanels.Settings.txtUseOptionKey": "Use Option key to navigate the user interface using the keyboard", "PE.Views.FileMenuPanels.Settings.txtInch": "Inch", "PE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input", "PE.Views.FileMenuPanels.Settings.txtLast": "View Last", diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 3cbd72ca0..dceebf095 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -866,6 +866,9 @@ define([ var zf = (value!==null) ? parseInt(value)/100 : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom)/100 : 1); this.api.asc_setZoom(zf>0 ? zf : 1); + value = Common.localStorage.getBool("sse-settings-use-alt-key", true); + Common.Utils.InternalSettings.set("sse-settings-use-alt-key", value); + /** coauthoring begin **/ this.isLiveCommenting = Common.localStorage.getBool("sse-settings-livecomment", true); Common.Utils.InternalSettings.set("sse-settings-livecomment", this.isLiveCommenting); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 12be34634..aae5722aa 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -242,6 +242,9 @@ define([ //'', '
', '', + '', + '
', + '', '', '', '', @@ -363,6 +366,14 @@ define([ dataHintOffset: 'small' }); + this.chUseAltKey = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-use-alt-key'), + labelText: Common.Utils.isMac ? this.txtUseOptionKey : this.txtUseAltKey, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.rbCoAuthModeFast = new Common.UI.RadioBox({ el : $markup.findById('#fms-rb-coauth-mode-fast'), name : 'coauth-mode', @@ -774,6 +785,7 @@ define([ value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100); var item = this.cmbZoom.store.findWhere({value: value}); this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100)); + this.chUseAltKey.setValue(Common.Utils.InternalSettings.get("sse-settings-use-alt-key")); /** coauthoring begin **/ this.chLiveComment.setValue(Common.Utils.InternalSettings.get("sse-settings-livecomment")); @@ -904,6 +916,8 @@ define([ applySettings: function() { Common.UI.Themes.setTheme(this.cmbTheme.getValue()); + Common.localStorage.setItem("sse-settings-use-alt-key", this.chUseAltKey.isChecked() ? 1 : 0); + Common.Utils.InternalSettings.set("sse-settings-use-alt-key", Common.localStorage.getBool("sse-settings-use-alt-key")); Common.localStorage.setItem("sse-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("sse-settings-zoom", Common.localStorage.getItem("sse-settings-zoom")); /** coauthoring begin **/ @@ -1129,6 +1143,8 @@ define([ strShowResolvedComments: 'Show resolved comments', txtWorkspace: 'Workspace', strReferenceStyle: 'R1C1 reference style', + txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', + txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', txtRegion: 'Region', txtProofing: 'Proofing', strDictionaryLanguage: 'Dictionary language', diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index ce6ccab97..d17607c69 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2094,6 +2094,8 @@ "SSE.Views.FileMenuPanels.MainSettingsGeneral.strPasteButton": "Show the Paste Options button when the content is pasted", "del_SSE.Views.FileMenuPanels.MainSettingsGeneral.strR1C1": "Turn on R1C1 style", "SSE.Views.FileMenuPanels.MainSettingsGeneral.strReferenceStyle": "R1C1 reference style", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtUseOptionKey": "Use Option key to navigate the user interface using the keyboard", "SSE.Views.FileMenuPanels.MainSettingsGeneral.strRegSettings": "Regional Settings", "SSE.Views.FileMenuPanels.MainSettingsGeneral.strRegSettingsEx": "Example: ", "del_SSE.Views.FileMenuPanels.MainSettingsGeneral.strResolvedComment": "Turn on display of the resolved comments",