mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
[VE] Add customize shortcuts
This commit is contained in:
@ -1128,6 +1128,8 @@ define([
|
||||
me.appOptions.isRestrictedEdit && me.api.asc_SetHighlightRequiredFields(true);
|
||||
|
||||
var timer_sl = setTimeout(function(){
|
||||
PDFE.getController('Common.Controllers.Shortcuts').setApi(me.api);
|
||||
|
||||
toolbarController.createDelayedElements();
|
||||
toolbarController.activateControls();
|
||||
documentHolderController.applyEditorMode();
|
||||
|
||||
@ -141,7 +141,8 @@ require([
|
||||
'ViewTab',
|
||||
// 'Search',
|
||||
'Common.Controllers.Chat',
|
||||
'Common.Controllers.Plugins'
|
||||
'Common.Controllers.Plugins',
|
||||
'Common.Controllers.Shortcuts'
|
||||
]
|
||||
});
|
||||
|
||||
@ -165,7 +166,8 @@ require([
|
||||
// 'visioeditor/main/app/controller/Search',
|
||||
'common/main/lib/util/utils',
|
||||
'common/main/lib/controller/Chat',
|
||||
'common/main/lib/controller/Plugins'
|
||||
'common/main/lib/controller/Plugins',
|
||||
'common/main/lib/controller/Shortcuts'
|
||||
], function() {
|
||||
app.postLaunchScripts = [
|
||||
'visioeditor/main/code'
|
||||
|
||||
@ -953,6 +953,8 @@ define([
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
|
||||
var timer_sl = setTimeout(function(){
|
||||
PDFE.getController('Common.Controllers.Shortcuts').setApi(me.api);
|
||||
|
||||
toolbarController.createDelayedElements();
|
||||
toolbarController.activateControls();
|
||||
documentHolderController.applyEditorMode();
|
||||
|
||||
@ -274,6 +274,10 @@ define([], function () {
|
||||
'<td><label><%= scope.strFontRender %></label></td>',
|
||||
'<td><span id="fms-cmb-font-render"></span></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td><label><%= scope.strKeyboardShortcuts %></label></td>',
|
||||
'<td colspan="2"><button type="button" class="btn btn-text-default" id="fms-btn-keyboard-shortcuts" style="width:auto; display: inline-block;padding-right: 10px;padding-left: 10px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.txtCustomize %></button></div></td>',
|
||||
'</tr>',
|
||||
// '<tr class="macros">',
|
||||
// '<td><label><%= scope.strMacrosSettings %></label></td>',
|
||||
// '<td><div><div id="fms-cmb-macros"></div></div></td>',
|
||||
@ -380,6 +384,11 @@ define([], function () {
|
||||
});
|
||||
this.cmbFontRender.on('selected', _.bind(this.onFontRenderSelected, this));
|
||||
|
||||
this.btnKeyboardMacros = new Common.UI.Button({
|
||||
el: $markup.findById('#fms-btn-keyboard-shortcuts')
|
||||
});
|
||||
this.btnKeyboardMacros.on('click', _.bind(this.onClickKeyboardShortcut, this));
|
||||
|
||||
// this.cmbMacros = new Common.UI.ComboBox({
|
||||
// el : $markup.findById('#fms-cmb-macros'),
|
||||
// style : 'width: 160px;',
|
||||
@ -608,6 +617,13 @@ define([], function () {
|
||||
this._fontRender = combo.getValue();
|
||||
},
|
||||
|
||||
onClickKeyboardShortcut: function() {
|
||||
const win = new Common.Views.ShortcutsDialog({
|
||||
api: this.api
|
||||
});
|
||||
win.show();
|
||||
},
|
||||
|
||||
customizeQuickAccess: function () {
|
||||
if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return;
|
||||
this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({
|
||||
@ -630,6 +646,8 @@ define([], function () {
|
||||
txtMac: 'as OS X',
|
||||
txtNative: 'Native',
|
||||
strFontRender: 'Font Hinting',
|
||||
strKeyboardShortcuts: 'Keyboard Shortcuts',
|
||||
txtCustomize: 'Customize',
|
||||
txtFitWidth: 'Fit to Width',
|
||||
txtCacheMode: 'Default cache mode',
|
||||
strMacrosSettings: 'Macros Settings',
|
||||
|
||||
@ -109,13 +109,19 @@ define([
|
||||
|
||||
this.btnChat = new Common.UI.Button({
|
||||
el: $markup.elementById('#left-btn-chat'),
|
||||
hint: this.tipChat + Common.Utils.String.platformKey('Alt+Q', ' (' + (Common.Utils.isMac ? Common.Utils.String.textCtrl + '+' : '') + '{0})'),
|
||||
hint: this.tipChat,
|
||||
enableToggle: true,
|
||||
disabled: true,
|
||||
iconCls: 'btn-menu-chat',
|
||||
toggleGroup: 'leftMenuGroup'
|
||||
});
|
||||
this.btnChat.on('click', this.onBtnMenuClick.bind(this));
|
||||
VE.getController('Common.Controllers.Shortcuts').updateShortcutHints({
|
||||
OpenChatPanel: {
|
||||
btn: this.btnChat,
|
||||
label: this.tipChat
|
||||
}
|
||||
});
|
||||
|
||||
this.btnChat.hide();
|
||||
|
||||
|
||||
@ -53,9 +53,17 @@ define([
|
||||
me.btnScrollNext.updateHint(me.tipNext);
|
||||
me.btnZoomToPage.updateHint(me.tipFitPage);
|
||||
me.btnZoomToWidth.updateHint(me.tipFitWidth);
|
||||
me.btnZoomDown.updateHint(me.tipZoomOut + Common.Utils.String.platformKey('Ctrl+-'));
|
||||
me.btnZoomUp.updateHint(me.tipZoomIn + Common.Utils.String.platformKey('Ctrl++'));
|
||||
me.cntSheetList.updateHint(me.tipListOfSheets);
|
||||
VE.getController('Common.Controllers.Shortcuts').updateShortcutHints({
|
||||
ZoomOut: {
|
||||
btn: me.btnZoomDown,
|
||||
label: me.tipZoomOut
|
||||
},
|
||||
ZoomIn: {
|
||||
btn: me.btnZoomUp,
|
||||
label: me.tipZoomIn
|
||||
}
|
||||
});
|
||||
|
||||
me.cntZoom.updateHint(me.tipZoomFactor);
|
||||
me.cntZoom.cmpEl.on({
|
||||
|
||||
@ -131,7 +131,8 @@ require([
|
||||
'ViewTab',
|
||||
// 'Search',
|
||||
'Common.Controllers.Chat',
|
||||
'Common.Controllers.Plugins'
|
||||
'Common.Controllers.Plugins',
|
||||
'Common.Controllers.Shortcuts'
|
||||
]
|
||||
});
|
||||
|
||||
@ -156,6 +157,7 @@ require([
|
||||
'common/main/lib/util/utils'
|
||||
,'common/main/lib/controller/Chat'
|
||||
,'common/main/lib/controller/Plugins'
|
||||
,'common/main/lib/controller/Shortcuts'
|
||||
], function() {
|
||||
app.postLaunchScripts = [
|
||||
'common/main/lib/controller/ScreenReaderFocus',
|
||||
@ -171,6 +173,8 @@ require([
|
||||
'common/main/lib/view/PluginPanel',
|
||||
'common/main/lib/view/DocumentHolderExt',
|
||||
'common/main/lib/view/CustomizeQuickAccessDialog',
|
||||
'common/main/lib/view/ShortcutsDialog',
|
||||
'common/main/lib/view/ShortcutEditDialog',
|
||||
|
||||
'visioeditor/main/app/view/FileMenuPanels',
|
||||
'visioeditor/main/app/view/DocumentHolderExt'
|
||||
|
||||
@ -12,6 +12,8 @@ require([
|
||||
'common/main/lib/view/TextInputDialog',
|
||||
'common/main/lib/view/DocumentHolderExt',
|
||||
'common/main/lib/view/CustomizeQuickAccessDialog',
|
||||
'common/main/lib/view/ShortcutsDialog',
|
||||
'common/main/lib/view/ShortcutEditDialog',
|
||||
|
||||
'visioeditor/main/app/view/FileMenuPanels',
|
||||
'visioeditor/main/app/view/DocumentHolderExt'
|
||||
|
||||
Reference in New Issue
Block a user