Merge pull request #2000 from ONLYOFFICE/fix/hints-mac

Fix/hints mac
This commit is contained in:
JuliaSvinareva 2022-10-11 17:18:35 +03:00 committed by GitHub
commit aacbfa787e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 14 deletions

View file

@ -457,7 +457,7 @@ Common.UI.HintManager = new(function() {
}; };
var _init = function(api) { var _init = function(api) {
if (Common.Utils.isIE) if (Common.Utils.isIE || Common.UI.isMac && Common.Utils.isGecko) // turn off hints on IE and FireFox (shortcut F6 selects link in address bar)
return; return;
_api = api; _api = api;
@ -480,7 +480,7 @@ Common.UI.HintManager = new(function() {
_clearHints(); _clearHints();
}); });
$(document).on('keyup', function(e) { $(document).on('keyup', function(e) {
if (e.keyCode == Common.UI.Keys.ALT && _needShow && !(window.SSE && window.SSE.getController('Statusbar').getIsDragDrop())) { if ((e.keyCode == Common.UI.Keys.ALT || e.keyCode === 91) && _needShow && !(window.SSE && window.SSE.getController('Statusbar').getIsDragDrop())) {
e.preventDefault(); e.preventDefault();
if (!_hintVisible) { if (!_hintVisible) {
$('input:focus').blur(); // to change value in inputField $('input:focus').blur(); // to change value in inputField
@ -622,10 +622,11 @@ Common.UI.HintManager = new(function() {
} }
} }
_needShow = (Common.Utils.InternalSettings.get(_appPrefix + "settings-show-alt-hints") && !e.shiftKey && e.keyCode == Common.UI.Keys.ALT && _needShow = (Common.Utils.InternalSettings.get(_appPrefix + "settings-show-alt-hints") && !e.shiftKey &&
(!Common.Utils.isMac && e.keyCode == Common.UI.Keys.ALT || Common.Utils.isMac && e.metaKey && e.keyCode === Common.UI.Keys.F6) &&
!Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0 && !Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0 &&
!(window.PE && $('#pe-preview').is(':visible'))); !(window.PE && $('#pe-preview').is(':visible')));
if (Common.Utils.InternalSettings.get(_appPrefix + "settings-show-alt-hints") && e.altKey && e.keyCode !== 115) { if (Common.Utils.InternalSettings.get(_appPrefix + "settings-show-alt-hints") && !Common.Utils.isMac && e.altKey && e.keyCode !== 115) {
e.preventDefault(); e.preventDefault();
} }
}); });
@ -663,7 +664,7 @@ Common.UI.HintManager = new(function() {
}; };
var _clearHints = function (isComplete) { var _clearHints = function (isComplete) {
if (Common.Utils.isIE) if (Common.Utils.isIE || Common.UI.isMac && Common.Utils.isGecko)
return; return;
_hintVisible && _hideHints(); _hintVisible && _hideHints();
if (_currentHints.length > 0) { if (_currentHints.length > 0) {

View file

@ -410,7 +410,7 @@ define([
dataHintDirection: 'left', dataHintDirection: 'left',
dataHintOffset: 'small' dataHintOffset: 'small'
}); });
Common.Utils.isIE && this.chUseAltKey.$el.parent().parent().hide(); (Common.Utils.isIE || Common.Utils.isMac && Common.Utils.isGecko) && this.chUseAltKey.$el.parent().parent().hide();
/** coauthoring begin **/ /** coauthoring begin **/
this.chLiveComment = new Common.UI.CheckBox({ this.chLiveComment = new Common.UI.CheckBox({
@ -1009,7 +1009,7 @@ define([
txtWorkspace: 'Workspace', txtWorkspace: 'Workspace',
txtHieroglyphs: 'Hieroglyphs', txtHieroglyphs: 'Hieroglyphs',
txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard',
txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', txtUseOptionKey: 'Use ⌘F6 to navigate the user interface using the keyboard',
strShowComments: 'Show comments in text', strShowComments: 'Show comments in text',
strShowResolvedComments: 'Show resolved comments', strShowResolvedComments: 'Show resolved comments',
txtFastTip: 'Real-time co-editing. All changes are saved automatically', txtFastTip: 'Real-time co-editing. All changes are saved automatically',

View file

@ -1852,7 +1852,7 @@
"DE.Views.FileMenuPanels.Settings.txtStopMacrosDesc": "Disable all macros without a notification", "DE.Views.FileMenuPanels.Settings.txtStopMacrosDesc": "Disable all macros without a notification",
"DE.Views.FileMenuPanels.Settings.txtStrictTip": "Use the \"Save\" button to sync the changes you and others make", "DE.Views.FileMenuPanels.Settings.txtStrictTip": "Use the \"Save\" button to sync the changes you and others make",
"DE.Views.FileMenuPanels.Settings.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", "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.txtUseOptionKey": "Use ⌘F6 to navigate the user interface using the keyboard",
"DE.Views.FileMenuPanels.Settings.txtWarnMacros": "Show Notification", "DE.Views.FileMenuPanels.Settings.txtWarnMacros": "Show Notification",
"DE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification", "DE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification",
"DE.Views.FileMenuPanels.Settings.txtWin": "as Windows", "DE.Views.FileMenuPanels.Settings.txtWin": "as Windows",

View file

@ -359,7 +359,7 @@ define([
dataHintDirection: 'left', dataHintDirection: 'left',
dataHintOffset: 'small' dataHintOffset: 'small'
}); });
Common.Utils.isIE && this.chUseAltKey.$el.parent().parent().hide(); (Common.Utils.isIE || Common.Utils.isMac && Common.Utils.isGecko) && this.chUseAltKey.$el.parent().parent().hide();
this.cmbZoom = new Common.UI.ComboBox({ this.cmbZoom = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-zoom'), el : $markup.findById('#fms-cmb-zoom'),
@ -787,7 +787,7 @@ define([
txtWorkspace: 'Workspace', txtWorkspace: 'Workspace',
txtHieroglyphs: 'Hieroglyphs', txtHieroglyphs: 'Hieroglyphs',
txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard',
txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', txtUseOptionKey: 'Use ⌘F6 to navigate the user interface using the keyboard',
txtFastTip: 'Real-time co-editing. All changes are saved automatically', txtFastTip: 'Real-time co-editing. All changes are saved automatically',
txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make',
strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE', strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE',

View file

@ -1718,7 +1718,7 @@
"PE.Views.FileMenuPanels.Settings.txtStopMacrosDesc": "Disable all macros without a notification", "PE.Views.FileMenuPanels.Settings.txtStopMacrosDesc": "Disable all macros without a notification",
"PE.Views.FileMenuPanels.Settings.txtStrictTip": "Use the \"Save\" button to sync the changes you and others make", "PE.Views.FileMenuPanels.Settings.txtStrictTip": "Use the \"Save\" button to sync the changes you and others make",
"PE.Views.FileMenuPanels.Settings.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", "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.txtUseOptionKey": "Use ⌘F6 to navigate the user interface using the keyboard",
"PE.Views.FileMenuPanels.Settings.txtWarnMacros": "Show Notification", "PE.Views.FileMenuPanels.Settings.txtWarnMacros": "Show Notification",
"PE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification", "PE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification",
"PE.Views.FileMenuPanels.Settings.txtWin": "as Windows", "PE.Views.FileMenuPanels.Settings.txtWin": "as Windows",

View file

@ -378,7 +378,7 @@ define([
dataHintDirection: 'left', dataHintDirection: 'left',
dataHintOffset: 'small' dataHintOffset: 'small'
}); });
Common.Utils.isIE && this.chUseAltKey.$el.parent().parent().hide(); (Common.Utils.isIE || Common.Utils.isMac && Common.Utils.isGecko) && this.chUseAltKey.$el.parent().parent().hide();
this.rbCoAuthModeFast = new Common.UI.RadioBox({ this.rbCoAuthModeFast = new Common.UI.RadioBox({
el : $markup.findById('#fms-rb-coauth-mode-fast'), el : $markup.findById('#fms-rb-coauth-mode-fast'),
@ -1159,7 +1159,7 @@ define([
txtWorkspace: 'Workspace', txtWorkspace: 'Workspace',
strReferenceStyle: 'R1C1 reference style', strReferenceStyle: 'R1C1 reference style',
txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard',
txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', txtUseOptionKey: 'Use ⌘F6 to navigate the user interface using the keyboard',
txtRegion: 'Region', txtRegion: 'Region',
txtProofing: 'Proofing', txtProofing: 'Proofing',
strDictionaryLanguage: 'Dictionary language', strDictionaryLanguage: 'Dictionary language',

View file

@ -2258,7 +2258,7 @@
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtTr": "Turkish", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtTr": "Turkish",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtUk": "Ukrainian", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtUk": "Ukrainian",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", "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.txtUseOptionKey": "Use ⌘F6 to navigate the user interface using the keyboard",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtVi": "Vietnamese", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtVi": "Vietnamese",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWarnMacros": "Show Notification", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWarnMacros": "Show Notification",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWarnMacrosDesc": "Disable all macros with a notification", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWarnMacrosDesc": "Disable all macros with a notification",