For Bug 59171

This commit is contained in:
Julia Radzhabova 2022-12-27 14:27:09 +03:00
parent 5b9b912625
commit e64d33dd96
13 changed files with 65 additions and 58 deletions

View file

@ -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(

View file

@ -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();

View file

@ -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();
},

View file

@ -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) {

View file

@ -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'

View file

@ -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();

View file

@ -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();
},

View file

@ -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 = $("<div class='toolbar-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);
}
},

View file

@ -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'

View file

@ -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;

View file

@ -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;

View file

@ -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 = $("<div class='toolbar-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);
}
},

View file

@ -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'