From c712c9d24198e9404fdff6f84422f804fa2543d7 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Tue, 9 Apr 2024 22:36:58 +0300 Subject: [PATCH 1/7] [DE PE SSE] Add customize quick access button and dialog --- .../lib/view/CustomizeQuickAccessDialog.js | 147 ++++++++++++++++++ apps/common/main/lib/view/Header.js | 85 +++++++++- apps/common/main/resources/less/common.less | 9 ++ apps/common/main/resources/less/header.less | 9 +- .../main/app/view/FileMenuPanels.js | 22 ++- apps/documenteditor/main/locale/en.json | 1 + apps/presentationeditor/main/locale/en.json | 1 + apps/spreadsheeteditor/main/locale/en.json | 1 + 8 files changed, 271 insertions(+), 4 deletions(-) create mode 100644 apps/common/main/lib/view/CustomizeQuickAccessDialog.js diff --git a/apps/common/main/lib/view/CustomizeQuickAccessDialog.js b/apps/common/main/lib/view/CustomizeQuickAccessDialog.js new file mode 100644 index 0000000000..991c621d9e --- /dev/null +++ b/apps/common/main/lib/view/CustomizeQuickAccessDialog.js @@ -0,0 +1,147 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2023 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +/** + * CustomizeQuickAccessDialog.js + * + * Created by Julia Svinareva on 9/04/24 + * Copyright (c) 2018 Ascensio System SIA. All rights reserved. + * + */ + +if (Common === undefined) + var Common = {}; + +define([ + 'common/main/lib/component/Window' +], function () { 'use strict'; + + Common.Views.CustomizeQuickAccessDialog = Common.UI.Window.extend(_.extend({ + options: { + width: 296, + style: 'min-width: 296px;', + cls: 'modal-dlg quick-access-dlg', + buttons: ['ok', 'cancel'] + }, + + initialize : function(options) { + _.extend(this.options, { + title: this.textTitle + }, options || {}); + + this.template = [ + '
', + '', + '
', + '
', + '', + '
', + '
', + '
' + ].join(''); + + this.options.tpl = _.template(this.template)(this.options); + + Common.UI.Window.prototype.initialize.call(this, this.options); + }, + + render: function() { + Common.UI.Window.prototype.render.call(this); + this.focusedComponents = []; + + var $window = this.getChild(); + $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); + + this.chSave = new Common.UI.CheckBox({ + el: $('#quick-access-chb-save'), + labelText: this.textSave + }); + this.focusedComponents.push(this.chSave); + + this.chPrint = new Common.UI.CheckBox({ + el: $('#quick-access-chb-print'), + labelText: this.textPrint + }); + this.focusedComponents.push(this.chPrint); + + if (this.options.canQuickPrint) { + this.chQuickPrint = new Common.UI.CheckBox({ + el: $('#quick-access-chb-quick-print'), + labelText: this.textQuickPrint + }); + this.focusedComponents.push(this.chQuickPrint); + this.chQuickPrint.show(); + } + + this.chUndo = new Common.UI.CheckBox({ + el: $('#quick-access-chb-undo'), + labelText: this.textUndo + }); + this.focusedComponents.push(this.chUndo); + + this.chRedo = new Common.UI.CheckBox({ + el: $('#quick-access-chb-redo'), + labelText: this.textRedo + }); + this.focusedComponents.push(this.chRedo); + }, + + getFocusedComponents: function() { + return this.focusedComponents.concat(this.getFooterButtons()); + }, + + getDefaultFocusableComponent: function () { + return this.focusedComponents[0]; + }, + + onBtnClick: function(event) { + if (event.currentTarget.attributes['result'].value == 'ok') { + Common.NotificationCenter.trigger('quickaccess:changed', { + save: this.chSave.getValue() == 'checked', + print: this.chPrint.getValue() == 'checked', + quickPrint: this.chQuickPrint.getValue() == 'checked', + undo: this.chUndo.getValue() == 'checked', + redo: this.chRedo.getValue() == 'checked' + }); + } + + this.close(); + }, + + textTitle: 'Customize quick access', + textMsg: 'Check the commands that will be displayed on the Quick Access Toolbar', + textSave: 'Save', + textPrint: 'Print', + textQuickPrint: 'Quick Print', + textUndo: 'Undo', + textRedo: 'Redo' + }, Common.Views.CustomizeQuickAccessDialog || {})) +}); \ No newline at end of file diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 995ba56fb3..2f10f8ce62 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -149,6 +149,7 @@ define([ '
' + '
' + '
' + + '
' + '' + '
' + // '' + @@ -427,6 +428,77 @@ define([ }); } + if (me.btnQuickAccess) { + me.btnQuickAccess.updateHint(me.tipCustomizeQuickAccessToolbar); + var arr = []; + if (me.btnSave) { + arr.push({ + caption: me.tipSave, + value: 'save', + checkable: true, + checked: true + }); + } + if (me.btnPrint) { + arr.push({ + caption: me.tipPrint, + value: 'print', + checkable: true, + checked: true + }); + } + if (me.btnPrintQuick) { + arr.push({ + caption: me.tipPrintQuick, + value: 'print-quick', + checkable: true, + checked: true + }); + } + if (me.btnUndo) { + arr.push({ + caption: me.tipUndo, + value: 'undo', + checkable: true, + checked: true + }); + } + if (me.btnRedo) { + arr.push({ + caption: me.tipRedo, + value: 'redo', + checkable: true, + checked: true + }); + } + me.btnQuickAccess.setMenu(new Common.UI.Menu({ + cls: 'ppm-toolbar', + style: 'min-width: 110px;', + menuAlign: 'tl-bl', + items: arr + })); + me.btnQuickAccess.menu.on('item:click', function (menu, item) { + switch (item.value) { + case 'save': + me.btnSave[item.checked ? 'show' : 'hide'](); + break; + case 'print': + me.btnPrint[item.checked ? 'show' : 'hide'](); + break; + case 'print-quick': + me.btnPrintQuick[item.checked ? 'show' : 'hide'](); + break; + case 'undo': + me.btnUndo[item.checked ? 'show' : 'hide'](); + break; + case 'redo': + me.btnRedo[item.checked ? 'show' : 'hide'](); + break; + } + Common.NotificationCenter.trigger('edit:complete'); + }); + } + if ( !appConfig.twoLevelHeader ) { if ( me.btnDownload ) { me.btnDownload.updateHint(me.tipDownload); @@ -862,6 +934,16 @@ define([ [Common.enumLock.undoLock, Common.enumLock.fileMenuOpened]); me.btnRedo = createTitleButton('toolbar__icon icon--inverse btn-redo', $html.findById('#slot-btn-dt-redo'), true, undefined, undefined, 'Y', [Common.enumLock.redoLock, Common.enumLock.fileMenuOpened]); + me.btnQuickAccess = new Common.UI.Button({ + cls: 'btn-header no-caret', + iconCls: 'toolbar__icon icon--inverse btn-more', + menu: true, + enableToggle: true, + dataHint:'0', + dataHintDirection: config.isDesktopApp ? 'right' : 'left', + dataHintOffset: config.isDesktopApp ? '10, -18' : '10, 10' + }); + me.btnQuickAccess.render($html.find('#slot-btn-dt-quick-access')); return $html; } @@ -1157,7 +1239,8 @@ define([ textReviewDesc: 'Suggest changes', tipReview: 'Reviewing', textClose: 'Close file', - textStartFill: 'Start filling' + textStartFill: 'Start filling', + tipCustomizeQuickAccessToolbar: 'Customize Quick Access Toolbar' } }(), Common.Views.Header || {})) }); diff --git a/apps/common/main/resources/less/common.less b/apps/common/main/resources/less/common.less index b172bc5c5f..9d0a1eca4a 100644 --- a/apps/common/main/resources/less/common.less +++ b/apps/common/main/resources/less/common.less @@ -290,6 +290,15 @@ label { } } +.quick-access-dlg { + .padding-small { + padding-bottom: 8px; + } + .padding-medium { + padding-bottom: 12px; + } +} + .plugin-panel { display: none; &.active { diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 078a0f7035..6d2bef557d 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -527,12 +527,19 @@ color: @text-toolbar-header-ie; color: @text-toolbar-header; position: relative; - z-index: 1; + z-index: @zindex-navbar + 2; .btn-slot { display: inline-block; } + .btn { + &.active { + background-color: @highlight-header-button-hover-ie; + background-color: @highlight-header-button-hover; + } + } + svg.icon { fill: @icon-toolbar-header-ie; fill: @icon-toolbar-header; diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 2c9c6731c7..0b97450e2f 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -41,7 +41,8 @@ define([ 'common/main/lib/view/DocumentAccessDialog', - 'common/main/lib/view/AutoCorrectDialog' + 'common/main/lib/view/AutoCorrectDialog', + 'common/main/lib/view/CustomizeQuickAccessDialog' ], function () { 'use strict'; @@ -413,6 +414,9 @@ define([ '
', '', '', + '', + '', + '', '', '', '', @@ -765,6 +769,11 @@ define([ }); this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this)); + this.btnCustomizeQuickAccess = new Common.UI.Button({ + el: $markup.findById('#fms-btn-customize-quick-access') + }); + this.btnCustomizeQuickAccess.on('click', _.bind(this.customizeQuickAccess, this)); + this.cmbTheme = new Common.UI.ComboBox({ el : $markup.findById('#fms-cmb-theme'), style : 'width: 160px;', @@ -1079,6 +1088,14 @@ define([ this.dlgAutoCorrect.show(); }, + customizeQuickAccess: function () { + if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return; + this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({ + canQuickPrint: this.mode.canQuickPrint + }); + this.dlgQuickAccess.show(); + }, + strZoom: 'Default Zoom Value', /** coauthoring begin **/ strShowChanges: 'Real-time Collaboration Changes', @@ -1143,7 +1160,8 @@ define([ txtRestartEditor: 'Please restart document editor so that your workspace settings can take effect', txtLastUsed: 'Last used', textSmartSelection: 'Use smart paragraph selection', - txtScreenReader: 'Turn on screen reader support' + txtScreenReader: 'Turn on screen reader support', + txtCustomizeQuickAccess: 'Customize quick access' }, DE.Views.FileMenuPanels.Settings || {})); DE.Views.FileMenuPanels.CreateNew = Common.UI.BaseView.extend(_.extend({ diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 8aabbefc9d..af3f8b859f 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -554,6 +554,7 @@ "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", "Common.Views.Header.textStartFill": "Start filling", + "Common.Views.Header.tipCustomizeQuickAccessToolbar": "Customize Quick Access Toolbar", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index b796d5766b..9422f0ec03 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -637,6 +637,7 @@ "Common.Views.Header.tipViewUsers": "View users and manage document access rights", "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", + "Common.Views.Header.tipCustomizeQuickAccessToolbar": "Customize Quick Access Toolbar", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index d9dbd376c3..2a4d76c2a6 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -474,6 +474,7 @@ "Common.Views.Header.tipViewUsers": "View users and manage document access rights", "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", + "Common.Views.Header.tipCustomizeQuickAccessToolbar": "Customize Quick Access Toolbar", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", From 992aff5b68e0c4f807121062f464437f0fff56a8 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Thu, 11 Apr 2024 11:06:12 +0300 Subject: [PATCH 2/7] [DE PE SSE] Add customize quick access (2) --- .../lib/view/CustomizeQuickAccessDialog.js | 22 +++-- apps/common/main/lib/view/Header.js | 92 ++++++++++++++----- .../main/app/view/FileMenuPanels.js | 9 +- apps/documenteditor/main/locale/en.json | 9 ++ .../main/app/view/FileMenuPanels.js | 29 +++++- apps/presentationeditor/main/locale/en.json | 9 ++ .../main/app/view/FileMenuPanels.js | 29 +++++- apps/spreadsheeteditor/main/locale/en.json | 9 ++ 8 files changed, 173 insertions(+), 35 deletions(-) diff --git a/apps/common/main/lib/view/CustomizeQuickAccessDialog.js b/apps/common/main/lib/view/CustomizeQuickAccessDialog.js index 991c621d9e..5079d7792f 100644 --- a/apps/common/main/lib/view/CustomizeQuickAccessDialog.js +++ b/apps/common/main/lib/view/CustomizeQuickAccessDialog.js @@ -70,6 +70,9 @@ define([ this.options.tpl = _.template(this.template)(this.options); + this.props = this.options.props; + this.canQuickPrint = this.options.canQuickPrint; + Common.UI.Window.prototype.initialize.call(this, this.options); }, @@ -82,20 +85,23 @@ define([ this.chSave = new Common.UI.CheckBox({ el: $('#quick-access-chb-save'), - labelText: this.textSave + labelText: this.textSave, + value: this.props.save }); this.focusedComponents.push(this.chSave); this.chPrint = new Common.UI.CheckBox({ el: $('#quick-access-chb-print'), - labelText: this.textPrint + labelText: this.textPrint, + value: this.props.print }); this.focusedComponents.push(this.chPrint); - if (this.options.canQuickPrint) { + if (this.canQuickPrint) { this.chQuickPrint = new Common.UI.CheckBox({ el: $('#quick-access-chb-quick-print'), - labelText: this.textQuickPrint + labelText: this.textQuickPrint, + value: this.props.quickPrint }); this.focusedComponents.push(this.chQuickPrint); this.chQuickPrint.show(); @@ -103,13 +109,15 @@ define([ this.chUndo = new Common.UI.CheckBox({ el: $('#quick-access-chb-undo'), - labelText: this.textUndo + labelText: this.textUndo, + value: this.props.undo }); this.focusedComponents.push(this.chUndo); this.chRedo = new Common.UI.CheckBox({ el: $('#quick-access-chb-redo'), - labelText: this.textRedo + labelText: this.textRedo, + value: this.props.redo }); this.focusedComponents.push(this.chRedo); }, @@ -127,7 +135,7 @@ define([ Common.NotificationCenter.trigger('quickaccess:changed', { save: this.chSave.getValue() == 'checked', print: this.chPrint.getValue() == 'checked', - quickPrint: this.chQuickPrint.getValue() == 'checked', + quickPrint: this.chQuickPrint ? this.chQuickPrint.getValue() == 'checked' : undefined, undo: this.chUndo.getValue() == 'checked', redo: this.chRedo.getValue() == 'checked' }); diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 2f10f8ce62..33ab47dce3 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -435,40 +435,35 @@ define([ arr.push({ caption: me.tipSave, value: 'save', - checkable: true, - checked: true + checkable: true }); } if (me.btnPrint) { arr.push({ - caption: me.tipPrint, + caption: me.textPrint, value: 'print', - checkable: true, - checked: true + checkable: true }); } if (me.btnPrintQuick) { arr.push({ caption: me.tipPrintQuick, - value: 'print-quick', - checkable: true, - checked: true + value: 'quick-print', + checkable: true }); } if (me.btnUndo) { arr.push({ caption: me.tipUndo, value: 'undo', - checkable: true, - checked: true + checkable: true }); } if (me.btnRedo) { arr.push({ caption: me.tipRedo, value: 'redo', - checkable: true, - checked: true + checkable: true }); } me.btnQuickAccess.setMenu(new Common.UI.Menu({ @@ -477,26 +472,43 @@ define([ menuAlign: 'tl-bl', items: arr })); + me.btnQuickAccess.menu.on('show:before', function (menu) { + menu.items.forEach(function (item) { + if (item.value === 'save') { + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-save', true)); + } else if (item.value === 'print') { + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-print', true)); + } else if (item.value === 'quick-print') { + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-quick-print', true)); + } else if (item.value === 'undo') { + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-undo', true)); + } else if (item.value === 'redo') { + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-redo', true)); + } + }); + }); me.btnQuickAccess.menu.on('item:click', function (menu, item) { + var props = {}; switch (item.value) { case 'save': - me.btnSave[item.checked ? 'show' : 'hide'](); + props.save = item.checked; break; case 'print': - me.btnPrint[item.checked ? 'show' : 'hide'](); + props.print = item.checked; break; - case 'print-quick': - me.btnPrintQuick[item.checked ? 'show' : 'hide'](); + case 'quick-print': + props.quickPrint = item.checked; break; case 'undo': - me.btnUndo[item.checked ? 'show' : 'hide'](); + props.undo = item.checked; break; case 'redo': - me.btnRedo[item.checked ? 'show' : 'hide'](); + props.redo = item.checked; break; } - Common.NotificationCenter.trigger('edit:complete'); + me.onChangeQuickAccess(props); }); + Common.NotificationCenter.on('quickaccess:changed', me.onChangeQuickAccess.bind(me)); } if ( !appConfig.twoLevelHeader ) { @@ -678,6 +690,9 @@ define([ this.branding = this.options.customization; this.isModified = false; + var filter = Common.localStorage.getKeysFilter(); + this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; + me.btnGoBack = new Common.UI.Button({ id: 'btn-go-back', cls: 'btn-header', @@ -924,16 +939,22 @@ define([ if ( config.canPrint && config.twoLevelHeader ) { me.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-btn-dt-print'), true, undefined, undefined, 'P'); + !Common.localStorage.getBool(me.appPrefix + 'quick-access-print', true) && me.btnPrint.hide(); } - if ( config.canQuickPrint && config.twoLevelHeader ) + if ( config.canQuickPrint && config.twoLevelHeader ) { me.btnPrintQuick = createTitleButton('toolbar__icon icon--inverse btn-quick-print', $html.findById('#slot-btn-dt-print-quick'), true, undefined, undefined, 'Q'); - - if (!isPDFEditor && !(config.isPDFForm && config.canFillForms && config.isRestrictedEdit) || isPDFEditor && !config.isForm) + !Common.localStorage.getBool(me.appPrefix + 'quick-access-quick-print', true) && me.btnPrintQuick.hide(); + } + if (!isPDFEditor && !(config.isPDFForm && config.canFillForms && config.isRestrictedEdit) || isPDFEditor && !config.isForm) { me.btnSave = createTitleButton('toolbar__icon icon--inverse btn-save', $html.findById('#slot-btn-dt-save'), true, undefined, undefined, 'S'); + !Common.localStorage.getBool(me.appPrefix + 'quick-access-save', true) && me.btnSave.hide(); + } me.btnUndo = createTitleButton('toolbar__icon icon--inverse btn-undo', $html.findById('#slot-btn-dt-undo'), true, undefined, undefined, 'Z', [Common.enumLock.undoLock, Common.enumLock.fileMenuOpened]); + !Common.localStorage.getBool(me.appPrefix + 'quick-access-undo', true) && me.btnUndo.hide(); me.btnRedo = createTitleButton('toolbar__icon icon--inverse btn-redo', $html.findById('#slot-btn-dt-redo'), true, undefined, undefined, 'Y', [Common.enumLock.redoLock, Common.enumLock.fileMenuOpened]); + !Common.localStorage.getBool(me.appPrefix + 'quick-access-redo', true) && me.btnRedo.hide(); me.btnQuickAccess = new Common.UI.Button({ cls: 'btn-header no-caret', iconCls: 'toolbar__icon icon--inverse btn-more', @@ -1196,6 +1217,30 @@ define([ this.setDocumentCaption(this.documentCaption); }, + onChangeQuickAccess: function (props) { + if (props.save !== undefined) { + this.btnSave[props.save ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-save', props.save); + } + if (props.print !== undefined) { + this.btnPrint[props.print ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-print', props.print); + } + if (props.quickPrint !== undefined) { + this.btnPrintQuick[props.quickPrint ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-quick-print', props.quickPrint); + } + if (props.undo !== undefined) { + this.btnUndo[props.undo ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-undo', props.undo); + } + if (props.redo !== undefined) { + this.btnRedo[props.redo ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-redo', props.redo); + } + Common.NotificationCenter.trigger('edit:complete'); + }, + textBack: 'Go to Documents', txtRename: 'Rename', txtAccessRights: 'Change access rights', @@ -1240,7 +1285,8 @@ define([ tipReview: 'Reviewing', textClose: 'Close file', textStartFill: 'Start filling', - tipCustomizeQuickAccessToolbar: 'Customize Quick Access Toolbar' + tipCustomizeQuickAccessToolbar: 'Customize Quick Access Toolbar', + textPrint: 'Print' } }(), Common.Views.Header || {})) }); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 0b97450e2f..f50fcfc663 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1091,7 +1091,14 @@ define([ customizeQuickAccess: function () { if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return; this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({ - canQuickPrint: this.mode.canQuickPrint + canQuickPrint: this.mode.canQuickPrint, + props: { + save: Common.localStorage.getBool('de-quick-access-save', true), + print: Common.localStorage.getBool('de-quick-access-print', true), + quickPrint: Common.localStorage.getBool('de-quick-access-quick-print', true), + undo: Common.localStorage.getBool('de-quick-access-undo', true), + redo: Common.localStorage.getBool('de-quick-access-redo', true) + } }); this.dlgQuickAccess.show(); }, diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index af3f8b859f..576f5d0f56 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -555,6 +555,7 @@ "Common.Views.Header.txtRename": "Rename", "Common.Views.Header.textStartFill": "Start filling", "Common.Views.Header.tipCustomizeQuickAccessToolbar": "Customize Quick Access Toolbar", + "Common.Views.Header.textPrint": "Print", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", @@ -795,6 +796,13 @@ "Common.Views.UserNameDialog.textDontShow": "Don't ask me again", "Common.Views.UserNameDialog.textLabel": "Label:", "Common.Views.UserNameDialog.textLabelError": "Label must not be empty.", + "Common.Views.CustomizeQuickAccessDialog.textTitle": "Customize quick access", + "Common.Views.CustomizeQuickAccessDialog.textMsg": "Check the commands that will be displayed on the Quick Access Toolbar", + "Common.Views.CustomizeQuickAccessDialog.textSave": "Save", + "Common.Views.CustomizeQuickAccessDialog.textPrint": "Print", + "Common.Views.CustomizeQuickAccessDialog.textQuickPrint": "Quick Print", + "Common.Views.CustomizeQuickAccessDialog.textUndo": "Undo", + "Common.Views.CustomizeQuickAccessDialog.textRedo": "Redo", "DE.Controllers.DocProtection.txtIsProtectedComment": "Document is protected. You may only insert comments to this document.", "DE.Controllers.DocProtection.txtIsProtectedForms": "Document is protected. You may only fill in forms in this document.", "DE.Controllers.DocProtection.txtIsProtectedTrack": "Document is protected. You may edit this document, but all changes will be tracked.", @@ -2178,6 +2186,7 @@ "DE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification", "DE.Views.FileMenuPanels.Settings.txtWin": "as Windows", "DE.Views.FileMenuPanels.Settings.txtWorkspace": "Workspace", + "DE.Views.FileMenuPanels.Settings.txtCustomizeQuickAccess": "Customize quick access", "DE.Views.FileMenuPanels.ViewSaveAs.textDownloadAs": "Download as", "DE.Views.FileMenuPanels.ViewSaveCopy.textSaveCopyAs": "Save copy as", "DE.Views.FormSettings.textAlways": "Always", diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index cd5d0e0eb1..ebf09510e8 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -42,7 +42,8 @@ define([ 'common/main/lib/view/DocumentAccessDialog', 'common/main/lib/view/AutoCorrectDialog', - 'common/main/lib/component/CheckBox' + 'common/main/lib/component/CheckBox', + 'common/main/lib/view/CustomizeQuickAccessDialog' ], function () { 'use strict'; @@ -338,6 +339,9 @@ define([ '', '', '', + '', + '', + '', '', '', '', @@ -598,6 +602,11 @@ define([ }); this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this)); + this.btnCustomizeQuickAccess = new Common.UI.Button({ + el: $markup.findById('#fms-btn-customize-quick-access') + }); + this.btnCustomizeQuickAccess.on('click', _.bind(this.customizeQuickAccess, this)); + this.cmbTheme = new Common.UI.ComboBox({ el : $markup.findById('#fms-cmb-theme'), style : 'width: 160px;', @@ -851,6 +860,21 @@ define([ this.dlgAutoCorrect.show(); }, + customizeQuickAccess: function () { + if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return; + this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({ + canQuickPrint: this.mode.canQuickPrint, + props: { + save: Common.localStorage.getBool('pe-quick-access-save', true), + print: Common.localStorage.getBool('pe-quick-access-print', true), + quickPrint: Common.localStorage.getBool('pe-quick-access-quick-print', true), + undo: Common.localStorage.getBool('pe-quick-access-undo', true), + redo: Common.localStorage.getBool('pe-quick-access-redo', true) + } + }); + this.dlgQuickAccess.show(); + }, + strZoom: 'Default Zoom Value', okButtonText: 'Apply', txtFitSlide: 'Fit to Slide', @@ -905,7 +929,8 @@ define([ txtWorkspaceSettingChange: 'Workspace setting (RTL interface) change', txtRestartEditor: 'Please restart presentation editor so that your workspace settings can take effect', txtLastUsed: 'Last used', - txtScreenReader: 'Turn on screen reader support' + txtScreenReader: 'Turn on screen reader support', + txtCustomizeQuickAccess: 'Customize quick access' }, PE.Views.FileMenuPanels.Settings || {})); PE.Views.FileMenuPanels.CreateNew = Common.UI.BaseView.extend(_.extend({ diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 9422f0ec03..740b4d19ec 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -638,6 +638,7 @@ "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", "Common.Views.Header.tipCustomizeQuickAccessToolbar": "Customize Quick Access Toolbar", + "Common.Views.Header.textPrint": "Print", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", @@ -861,6 +862,13 @@ "Common.Views.UserNameDialog.textDontShow": "Don't ask me again", "Common.Views.UserNameDialog.textLabel": "Label:", "Common.Views.UserNameDialog.textLabelError": "Label must not be empty.", + "Common.Views.CustomizeQuickAccessDialog.textTitle": "Customize quick access", + "Common.Views.CustomizeQuickAccessDialog.textMsg": "Check the commands that will be displayed on the Quick Access Toolbar", + "Common.Views.CustomizeQuickAccessDialog.textSave": "Save", + "Common.Views.CustomizeQuickAccessDialog.textPrint": "Print", + "Common.Views.CustomizeQuickAccessDialog.textQuickPrint": "Quick Print", + "Common.Views.CustomizeQuickAccessDialog.textUndo": "Undo", + "Common.Views.CustomizeQuickAccessDialog.textRedo": "Redo", "PE.Controllers.LeftMenu.leavePageText": "All unsaved changes in this document will be lost.
Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.", "PE.Controllers.LeftMenu.newDocumentTitle": "Unnamed presentation", "PE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", @@ -2021,6 +2029,7 @@ "PE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification", "PE.Views.FileMenuPanels.Settings.txtWin": "as Windows", "PE.Views.FileMenuPanels.Settings.txtWorkspace": "Workspace", + "PE.Views.FileMenuPanels.Settings.txtCustomizeQuickAccess": "Customize quick access", "PE.Views.FileMenuPanels.ViewSaveAs.textDownloadAs": "Download as", "PE.Views.FileMenuPanels.ViewSaveCopy.textSaveCopyAs": "Save Copy As", "PE.Views.GridSettings.textCm": "cm", diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index ca430a6299..67892f8f3e 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -31,7 +31,8 @@ */ define([ 'common/main/lib/view/DocumentAccessDialog', - 'common/main/lib/view/AutoCorrectDialog' + 'common/main/lib/view/AutoCorrectDialog', + 'common/main/lib/view/CustomizeQuickAccessDialog' ], function () { 'use strict'; @@ -318,6 +319,9 @@ define([ '', '', '', + '', + '', + '', '', '', '', @@ -725,6 +729,11 @@ define([ dataHintOffset: 'small' }); + this.btnCustomizeQuickAccess = new Common.UI.Button({ + el: $markup.findById('#fms-btn-customize-quick-access') + }); + this.btnCustomizeQuickAccess.on('click', _.bind(this.customizeQuickAccess, this)); + this.cmbTheme = new Common.UI.ComboBox({ el : $markup.findById('#fms-cmb-theme'), style : 'width: 160px;', @@ -1166,6 +1175,21 @@ define([ } }, + customizeQuickAccess: function () { + if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return; + this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({ + canQuickPrint: this.mode.canQuickPrint, + props: { + save: Common.localStorage.getBool('sse-quick-access-save', true), + print: Common.localStorage.getBool('sse-quick-access-print', true), + quickPrint: Common.localStorage.getBool('sse-quick-access-quick-print', true), + undo: Common.localStorage.getBool('sse-quick-access-undo', true), + redo: Common.localStorage.getBool('sse-quick-access-redo', true) + } + }); + this.dlgQuickAccess.show(); + }, + strZoom: 'Default Zoom Value', okButtonText: 'Apply', txtWin: 'as Windows', @@ -1280,7 +1304,8 @@ define([ txtRestartEditor: 'Please restart spreadsheet editor so that your workspace settings can take effect', txtHy: 'Armenian', txtLastUsed: 'Last used', - txtScreenReader: 'Turn on screen reader support' + txtScreenReader: 'Turn on screen reader support', + txtCustomizeQuickAccess: 'Customize quick access' }, SSE.Views.FileMenuPanels.MainSettingsGeneral || {})); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 2a4d76c2a6..9e7f423a32 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -475,6 +475,7 @@ "Common.Views.Header.txtAccessRights": "Change access rights", "Common.Views.Header.txtRename": "Rename", "Common.Views.Header.tipCustomizeQuickAccessToolbar": "Customize Quick Access Toolbar", + "Common.Views.Header.textPrint": "Print", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", "Common.Views.History.textHideAll": "Hide detailed changes", @@ -720,6 +721,13 @@ "Common.Views.UserNameDialog.textDontShow": "Don't ask me again", "Common.Views.UserNameDialog.textLabel": "Label:", "Common.Views.UserNameDialog.textLabelError": "Label must not be empty.", + "Common.Views.CustomizeQuickAccessDialog.textTitle": "Customize quick access", + "Common.Views.CustomizeQuickAccessDialog.textMsg": "Check the commands that will be displayed on the Quick Access Toolbar", + "Common.Views.CustomizeQuickAccessDialog.textSave": "Save", + "Common.Views.CustomizeQuickAccessDialog.textPrint": "Print", + "Common.Views.CustomizeQuickAccessDialog.textQuickPrint": "Quick Print", + "Common.Views.CustomizeQuickAccessDialog.textUndo": "Undo", + "Common.Views.CustomizeQuickAccessDialog.textRedo": "Redo", "SSE.Controllers.DataTab.strSheet": "Sheet", "SSE.Controllers.DataTab.textAddExternalData": "The link to an external source has been added. You can update such links in the Data tab.", "SSE.Controllers.DataTab.textColumns": "Columns", @@ -2675,6 +2683,7 @@ "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWin": "as Windows", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWorkspace": "Workspace", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtZh": "Chinese", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtCustomizeQuickAccess": "Customize quick access", "SSE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Warning", "SSE.Views.FileMenuPanels.ProtectDoc.strEncrypt": "With password", "SSE.Views.FileMenuPanels.ProtectDoc.strProtect": "Protect Spreadsheet", From cff28f817013ea5067a22694acb521e36ec3c03d Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Fri, 12 Apr 2024 11:48:47 +0300 Subject: [PATCH 3/7] [DE PE SSE] Add customize quick access (3) --- apps/common/main/lib/view/Header.js | 63 +++++++++---------- apps/common/main/resources/less/header.less | 11 +--- .../main/app/view/FileMenuPanels.js | 5 +- apps/documenteditor/main/app/view/Toolbar.js | 4 +- .../main/app/view/FileMenuPanels.js | 5 +- .../main/app/view/Toolbar.js | 4 +- .../main/app/view/FileMenuPanels.js | 5 +- .../main/app/view/Toolbar.js | 4 +- 8 files changed, 51 insertions(+), 50 deletions(-) diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 33ab47dce3..6f7521e9e0 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -311,6 +311,30 @@ define([ } } + function onChangeQuickAccess(props) { + if (props.save !== undefined) { + this.btnSave[props.save ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-save', props.save); + } + if (props.print !== undefined) { + this.btnPrint[props.print ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-print', props.print); + } + if (props.quickPrint !== undefined) { + this.btnPrintQuick[props.quickPrint ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-quick-print', props.quickPrint); + } + if (props.undo !== undefined) { + this.btnUndo[props.undo ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-undo', props.undo); + } + if (props.redo !== undefined) { + this.btnRedo[props.redo ? 'show' : 'hide'](); + Common.localStorage.setBool(this.appPrefix + 'quick-access-redo', props.redo); + } + Common.NotificationCenter.trigger('edit:complete'); + } + function onAppReady(mode) { appConfig = mode; @@ -475,15 +499,15 @@ define([ me.btnQuickAccess.menu.on('show:before', function (menu) { menu.items.forEach(function (item) { if (item.value === 'save') { - item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-save', true)); + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-save', true), true); } else if (item.value === 'print') { - item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-print', true)); + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-print', true), true); } else if (item.value === 'quick-print') { - item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-quick-print', true)); + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-quick-print', true), true); } else if (item.value === 'undo') { - item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-undo', true)); + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-undo', true), true); } else if (item.value === 'redo') { - item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-redo', true)); + item.setChecked(Common.localStorage.getBool(me.appPrefix + 'quick-access-redo', true), true); } }); }); @@ -506,9 +530,9 @@ define([ props.redo = item.checked; break; } - me.onChangeQuickAccess(props); + onChangeQuickAccess.call(me, props); }); - Common.NotificationCenter.on('quickaccess:changed', me.onChangeQuickAccess.bind(me)); + Common.NotificationCenter.on('quickaccess:changed', onChangeQuickAccess.bind(me)); } if ( !appConfig.twoLevelHeader ) { @@ -959,7 +983,6 @@ define([ cls: 'btn-header no-caret', iconCls: 'toolbar__icon icon--inverse btn-more', menu: true, - enableToggle: true, dataHint:'0', dataHintDirection: config.isDesktopApp ? 'right' : 'left', dataHintOffset: config.isDesktopApp ? '10, -18' : '10, 10' @@ -1217,30 +1240,6 @@ define([ this.setDocumentCaption(this.documentCaption); }, - onChangeQuickAccess: function (props) { - if (props.save !== undefined) { - this.btnSave[props.save ? 'show' : 'hide'](); - Common.localStorage.setBool(this.appPrefix + 'quick-access-save', props.save); - } - if (props.print !== undefined) { - this.btnPrint[props.print ? 'show' : 'hide'](); - Common.localStorage.setBool(this.appPrefix + 'quick-access-print', props.print); - } - if (props.quickPrint !== undefined) { - this.btnPrintQuick[props.quickPrint ? 'show' : 'hide'](); - Common.localStorage.setBool(this.appPrefix + 'quick-access-quick-print', props.quickPrint); - } - if (props.undo !== undefined) { - this.btnUndo[props.undo ? 'show' : 'hide'](); - Common.localStorage.setBool(this.appPrefix + 'quick-access-undo', props.undo); - } - if (props.redo !== undefined) { - this.btnRedo[props.redo ? 'show' : 'hide'](); - Common.localStorage.setBool(this.appPrefix + 'quick-access-redo', props.redo); - } - Common.NotificationCenter.trigger('edit:complete'); - }, - textBack: 'Go to Documents', txtRename: 'Rename', txtAccessRights: 'Change access rights', diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 6d2bef557d..c131874f7a 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -256,7 +256,7 @@ } } - &:active { + &:active, &.active { &:not(.disabled) { background-color: @highlight-header-button-pressed-ie; background-color: @highlight-header-button-pressed; @@ -527,19 +527,12 @@ color: @text-toolbar-header-ie; color: @text-toolbar-header; position: relative; - z-index: @zindex-navbar + 2; + z-index: @zindex-navbar + 3; .btn-slot { display: inline-block; } - .btn { - &.active { - background-color: @highlight-header-button-hover-ie; - background-color: @highlight-header-button-hover; - } - } - svg.icon { fill: @icon-toolbar-header-ie; fill: @icon-toolbar-header; diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index f50fcfc663..1b9d8a998f 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -414,7 +414,7 @@ define([ '', '', '', - '', + '', '', '', '', @@ -893,6 +893,9 @@ define([ if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); } + if (mode.compactHeader) { + $('tr.quick-access', this.el).hide(); + } }, setApi: function(o) { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index bcc39f2e6a..2aea15704f 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -3082,6 +3082,7 @@ define([ if (this.synchTooltip === undefined) this.createSynchTip(); + this.synchTooltip.target = this.btnCollabChanges.$el.is(':visible') ? this.btnCollabChanges.$el : $('[data-layout-name=toolbar-file]', this.$el); this.synchTooltip.show(); } else { this.btnCollabChanges.updateHint(this.tipSynchronize + Common.Utils.String.platformKey('Ctrl+S')); @@ -3094,8 +3095,7 @@ define([ createSynchTip: function () { this.synchTooltip = new Common.UI.SynchronizeTip({ extCls: (this.mode.compactHeader) ? undefined : 'inc-index', - placement: this.mode.isDesktopApp ? 'bottom-right' : 'right-bottom', - target: this.btnCollabChanges.$el + placement: this.mode.isDesktopApp ? 'bottom-right' : 'right-bottom' }); this.synchTooltip.on('dontshowclick', function () { this.showSynchTip = false; diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index ebf09510e8..c4a9c49660 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -339,7 +339,7 @@ define([ '', '', '', - '', + '', '', '', '', @@ -711,6 +711,9 @@ define([ if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); } + if (mode.compactHeader) { + $('tr.quick-access', this.el).hide(); + } }, setApi: function(o) { diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 27622a0c50..8832f30687 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1938,6 +1938,7 @@ define([ if (this.synchTooltip === undefined) this.createSynchTip(); + this.synchTooltip.target = this.btnCollabChanges.$el.is(':visible') ? this.btnCollabChanges.$el : $('[data-layout-name=toolbar-file]', this.$el); this.synchTooltip.show(); } else { this.btnCollabChanges.updateHint(this.tipSynchronize + Common.Utils.String.platformKey('Ctrl+S')); @@ -1950,8 +1951,7 @@ define([ createSynchTip: function () { this.synchTooltip = new Common.UI.SynchronizeTip({ extCls: (this.mode.compactHeader) ? undefined : 'inc-index', - placement: this.mode.isDesktopApp ? 'bottom-right' : 'right-bottom', - target: this.btnCollabChanges.$el + placement: this.mode.isDesktopApp ? 'bottom-right' : 'right-bottom' }); this.synchTooltip.on('dontshowclick', function () { this.showSynchTip = false; diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 67892f8f3e..c7d6580b1e 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -319,7 +319,7 @@ define([ '', '', '', - '', + '', '', '', '', @@ -883,6 +883,9 @@ define([ } $('tr.spellcheck', this.el)[Common.UI.FeaturesManager.canChange('spellcheck') && mode.isEdit ? 'show' : 'hide'](); $('tr.ui-rtl', this.el)[mode.uiRtl ? 'show' : 'hide'](); + if (mode.compactHeader) { + $('tr.quick-access', this.el).hide(); + } }, setApi: function(api) { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 2fcf3e8160..c78e0219c7 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -3203,6 +3203,7 @@ define([ if (this.synchTooltip===undefined) this.createSynchTip(); + this.synchTooltip.target = this.btnCollabChanges.$el.is(':visible') ? this.btnCollabChanges.$el : $('[data-layout-name=toolbar-file]', this.$el); this.synchTooltip.show(); } else { this.btnCollabChanges.updateHint(this.tipSynchronize + Common.Utils.String.platformKey('Ctrl+S')); @@ -3215,8 +3216,7 @@ define([ createSynchTip: function () { this.synchTooltip = new Common.UI.SynchronizeTip({ extCls: (this.mode.compactHeader) ? undefined : 'inc-index', - placement: this.mode.isDesktopApp ? 'bottom-right' : 'right-bottom', - target: this.btnCollabChanges.$el + placement: this.mode.isDesktopApp ? 'bottom-right' : 'right-bottom' }); this.synchTooltip.on('dontshowclick', function() { this.showSynchTip = false; From eae525ed321c0fdc218269f0ab2b6b7ac38aa499 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Mon, 15 Apr 2024 18:48:09 +0300 Subject: [PATCH 4/7] [DE PE SSE] Fix customize quick access dialog --- .../lib/view/CustomizeQuickAccessDialog.js | 31 ++++++++++--------- .../main/app/view/FileMenuPanels.js | 4 ++- .../main/app/view/FileMenuPanels.js | 4 ++- .../main/app/view/FileMenuPanels.js | 4 ++- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/apps/common/main/lib/view/CustomizeQuickAccessDialog.js b/apps/common/main/lib/view/CustomizeQuickAccessDialog.js index 5079d7792f..0e786b9dcd 100644 --- a/apps/common/main/lib/view/CustomizeQuickAccessDialog.js +++ b/apps/common/main/lib/view/CustomizeQuickAccessDialog.js @@ -71,7 +71,6 @@ define([ this.options.tpl = _.template(this.template)(this.options); this.props = this.options.props; - this.canQuickPrint = this.options.canQuickPrint; Common.UI.Window.prototype.initialize.call(this, this.options); }, @@ -83,21 +82,25 @@ define([ var $window = this.getChild(); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - this.chSave = new Common.UI.CheckBox({ - el: $('#quick-access-chb-save'), - labelText: this.textSave, - value: this.props.save - }); - this.focusedComponents.push(this.chSave); + if (this.options.showSave) { + this.chSave = new Common.UI.CheckBox({ + el: $('#quick-access-chb-save'), + labelText: this.textSave, + value: this.props.save + }); + this.focusedComponents.push(this.chSave); + } - this.chPrint = new Common.UI.CheckBox({ - el: $('#quick-access-chb-print'), - labelText: this.textPrint, - value: this.props.print - }); - this.focusedComponents.push(this.chPrint); + if (this.options.showPrint) { + this.chPrint = new Common.UI.CheckBox({ + el: $('#quick-access-chb-print'), + labelText: this.textPrint, + value: this.props.print + }); + this.focusedComponents.push(this.chPrint); + } - if (this.canQuickPrint) { + if (this.options.showQuickPrint) { this.chQuickPrint = new Common.UI.CheckBox({ el: $('#quick-access-chb-quick-print'), labelText: this.textQuickPrint, diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 1b9d8a998f..b852702bb5 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1094,7 +1094,9 @@ define([ customizeQuickAccess: function () { if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return; this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({ - canQuickPrint: this.mode.canQuickPrint, + showSave: this.mode.showSaveButton, + showPrint: this.mode.canPrint && this.mode.twoLevelHeader, + showQuickPrint: this.mode.canQuickPrint && this.mode.twoLevelHeader, props: { save: Common.localStorage.getBool('de-quick-access-save', true), print: Common.localStorage.getBool('de-quick-access-print', true), diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index c4a9c49660..5d1e64847e 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -866,7 +866,9 @@ define([ customizeQuickAccess: function () { if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return; this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({ - canQuickPrint: this.mode.canQuickPrint, + showSave: this.mode.showSaveButton, + showPrint: this.mode.canPrint && this.mode.twoLevelHeader, + showQuickPrint: this.mode.canQuickPrint && this.mode.twoLevelHeader, props: { save: Common.localStorage.getBool('pe-quick-access-save', true), print: Common.localStorage.getBool('pe-quick-access-print', true), diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index c7d6580b1e..8d9ef79867 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1181,7 +1181,9 @@ define([ customizeQuickAccess: function () { if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return; this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({ - canQuickPrint: this.mode.canQuickPrint, + showSave: this.mode.showSaveButton, + showPrint: this.mode.canPrint && this.mode.twoLevelHeader, + showQuickPrint: this.mode.canQuickPrint && this.mode.twoLevelHeader, props: { save: Common.localStorage.getBool('sse-quick-access-save', true), print: Common.localStorage.getBool('sse-quick-access-print', true), From ea0e56ebadd4c4a9e05f3384fea9be72e69153be Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 16 Apr 2024 21:33:48 +0300 Subject: [PATCH 5/7] [desktop] send 'quickaccess:changed' message to native --- apps/common/main/lib/controller/Desktop.js | 8 ++++++++ apps/common/main/lib/view/Header.js | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index c81a099bbd..83a58fa520 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -463,6 +463,9 @@ define([ if (!!header.btnRedo) titlebuttons['redo'] = {btn: header.btnRedo}; + if (!!header.btnQuickAccess) + titlebuttons['quickaccess'] = {btn: header.btnQuickAccess}; + for (var i in titlebuttons) { titlebuttons[i].btn.options.signals = ['disabled']; titlebuttons[i].btn.on('disabled', _onTitleButtonDisabled.bind(this, i)); @@ -519,6 +522,10 @@ define([ console.log('open recent'); } + const _onChangeQuickAccess = function (props) { + native.execCommand("quickaccess:changed", JSON.stringify(props)); + } + const _extend_menu_file = function (args) { console.log('extend menu file') @@ -576,6 +583,7 @@ define([ } }, 'hints:show': _onHintsShow.bind(this), + 'quickaccess:changed': _onChangeQuickAccess.bind(this), }); webapp.addListeners({ diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index a3284dd4fa..106a1f030f 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -311,7 +311,7 @@ define([ } } - function onChangeQuickAccess(props) { + function onChangeQuickAccess(caller, props) { if (props.save !== undefined) { this.btnSave[props.save ? 'show' : 'hide'](); Common.localStorage.setBool(this.appPrefix + 'quick-access-save', props.save); @@ -333,6 +333,9 @@ define([ Common.localStorage.setBool(this.appPrefix + 'quick-access-redo', props.redo); } Common.NotificationCenter.trigger('edit:complete'); + + if ( caller && caller == 'header' ) + Common.NotificationCenter.trigger('quickaccess:changed', props); } function onAppReady(mode) { @@ -530,9 +533,9 @@ define([ props.redo = item.checked; break; } - onChangeQuickAccess.call(me, props); + onChangeQuickAccess.call(me, 'header', props); }); - Common.NotificationCenter.on('quickaccess:changed', onChangeQuickAccess.bind(me)); + Common.NotificationCenter.on('quickaccess:changed', onChangeQuickAccess.bind(me, 'settings')); } if ( !appConfig.twoLevelHeader ) { From 2325cb840c38149bb8c3910f103cfb73f6388309 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Thu, 18 Apr 2024 18:09:02 +0300 Subject: [PATCH 6/7] [DE PE SSE PDF] Remove show quick print button from settings --- apps/documenteditor/main/app/controller/Viewport.js | 10 +++++----- apps/documenteditor/main/app/view/FileMenuPanels.js | 12 ++++++------ apps/pdfeditor/main/app/controller/Viewport.js | 10 +++++----- apps/pdfeditor/main/app/view/FileMenuPanels.js | 12 ++++++------ .../main/app/controller/Viewport.js | 10 +++++----- .../main/app/view/FileMenuPanels.js | 12 ++++++------ .../main/app/controller/Viewport.js | 10 +++++----- .../main/app/view/FileMenuPanels.js | 12 ++++++------ 8 files changed, 44 insertions(+), 44 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index bd4bbb67c4..22568809e1 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -71,7 +71,7 @@ define([ 'FileMenu': { 'menu:hide': me.onFileMenu.bind(me, 'hide'), 'menu:show': me.onFileMenu.bind(me, 'show'), - 'settings:apply': me.applySettings.bind(me) + //'settings:apply': me.applySettings.bind(me) }, 'Toolbar': { 'render:before' : function (toolbar) { @@ -80,10 +80,10 @@ define([ if (!config.twoLevelHeader || config.compactHeader) toolbar.setExtra('left', me.header.getPanel('left', config)); - var value = Common.localStorage.getBool("de-settings-quick-print-button", true); + /*var value = Common.localStorage.getBool("de-settings-quick-print-button", true); Common.Utils.InternalSettings.set("de-settings-quick-print-button", value); if (me.header && me.header.btnPrintQuick) - me.header.btnPrintQuick[value ? 'show' : 'hide'](); + me.header.btnPrintQuick[value ? 'show' : 'hide']();*/ }, 'view:compact' : function (toolbar, state) { me.viewport.vlayout.getItem('toolbar').height = state ? @@ -261,12 +261,12 @@ define([ me.header.lockHeaderBtns( 'mode', _need_disable, Common.enumLock.fileMenuOpened ); }, - applySettings: function () { + /*applySettings: function () { var value = Common.localStorage.getBool("de-settings-quick-print-button", true); Common.Utils.InternalSettings.set("de-settings-quick-print-button", value); if (this.header && this.header.btnPrintQuick) this.header.btnPrintQuick[value ? 'show' : 'hide'](); - }, + },*/ onApiCoAuthoringDisconnect: function(enableDownload) { if (this.header) { diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index b852702bb5..ae0e622018 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -408,12 +408,12 @@ define([ '', '
Beta', '', - '', + /*'', '
', '', '
', '', - '', + '',*/ '', '', '', @@ -809,7 +809,7 @@ define([ dataHintOffset: 'small' }); - this.chQuickPrint = new Common.UI.CheckBox({ + /*this.chQuickPrint = new Common.UI.CheckBox({ el: $markup.findById('#fms-chb-quick-print'), labelText: '', dataHint: '2', @@ -819,7 +819,7 @@ define([ this.chQuickPrint.$el.parent().on('click', function (){ me.chQuickPrint.setValue(!me.chQuickPrint.isChecked()); - }); + });*/ this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply'); @@ -962,7 +962,7 @@ define([ this.cmbMacros.setValue(item ? item.get('value') : 0); this.chPaste.setValue(Common.Utils.InternalSettings.get("de-settings-paste-button")); - this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("de-settings-quick-print-button")); + //this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("de-settings-quick-print-button")); this.chSmartSelection.setValue(Common.Utils.InternalSettings.get("de-settings-smart-selection")); var data = []; @@ -1038,7 +1038,7 @@ define([ Common.localStorage.setItem("de-settings-smart-selection", this.chSmartSelection.isChecked() ? 1 : 0); var isRtlChanged = this.chRTL.$el.is(':visible') && Common.localStorage.getBool("ui-rtl", Common.Locale.isCurrentLanguageRtl()) !== this.chRTL.isChecked(); Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); - Common.localStorage.setBool("de-settings-quick-print-button", this.chQuickPrint.isChecked()); + //Common.localStorage.setBool("de-settings-quick-print-button", this.chQuickPrint.isChecked()); Common.localStorage.save(); diff --git a/apps/pdfeditor/main/app/controller/Viewport.js b/apps/pdfeditor/main/app/controller/Viewport.js index bdb12e03c9..0d9154a21a 100644 --- a/apps/pdfeditor/main/app/controller/Viewport.js +++ b/apps/pdfeditor/main/app/controller/Viewport.js @@ -71,7 +71,7 @@ define([ 'FileMenu': { 'menu:hide': me.onFileMenu.bind(me, 'hide'), 'menu:show': me.onFileMenu.bind(me, 'show'), - 'settings:apply': me.applySettings.bind(me) + //'settings:apply': me.applySettings.bind(me) }, 'Toolbar': { 'render:before' : function (toolbar) { @@ -80,10 +80,10 @@ define([ if (!config.twoLevelHeader || config.compactHeader) toolbar.setExtra('left', me.header.getPanel('left', config)); - var value = Common.localStorage.getBool("pdfe-settings-quick-print-button", true); + /*var value = Common.localStorage.getBool("pdfe-settings-quick-print-button", true); Common.Utils.InternalSettings.set("pdfe-settings-quick-print-button", value); if (me.header && me.header.btnPrintQuick) - me.header.btnPrintQuick[value ? 'show' : 'hide'](); + me.header.btnPrintQuick[value ? 'show' : 'hide']();*/ }, 'view:compact' : function (toolbar, state) { me.viewport.vlayout.getItem('toolbar').height = state ? @@ -245,12 +245,12 @@ define([ me.header.lockHeaderBtns( 'users', _need_disable ); }, - applySettings: function () { + /*applySettings: function () { var value = Common.localStorage.getBool("pdfe-settings-quick-print-button", true); Common.Utils.InternalSettings.set("pdfe-settings-quick-print-button", value); if (this.header && this.header.btnPrintQuick) this.header.btnPrintQuick[value ? 'show' : 'hide'](); - }, + },*/ onApiCoAuthoringDisconnect: function(enableDownload) { if (this.header) { diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index 3c1e0ad93b..eaa171fd74 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -349,12 +349,12 @@ define([ '', '
Beta', '', - '', + /*'', '
', '', '
', '', - '', + '',*/ '', '', '', @@ -604,7 +604,7 @@ define([ dataHintOffset: 'small' }); - this.chQuickPrint = new Common.UI.CheckBox({ + /*this.chQuickPrint = new Common.UI.CheckBox({ el: $markup.findById('#fms-chb-quick-print'), labelText: '', dataHint: '2', @@ -614,7 +614,7 @@ define([ this.chQuickPrint.$el.parent().on('click', function (){ me.chQuickPrint.setValue(!me.chQuickPrint.isChecked()); - }); + });*/ this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply'); @@ -732,7 +732,7 @@ define([ if (this.mode.canForcesave) this.chForcesave.setValue(Common.Utils.InternalSettings.get("pdfe-settings-forcesave")); - this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("pdfe-settings-quick-print-button")); + //this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("pdfe-settings-quick-print-button")); var data = []; for (var t in Common.UI.Themes.map()) { @@ -778,7 +778,7 @@ define([ var isRtlChanged = this.chRTL.$el.is(':visible') && Common.localStorage.getBool("ui-rtl", Common.Locale.isCurrentLanguageRtl()) !== this.chRTL.isChecked(); Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); - Common.localStorage.setBool("pdfe-settings-quick-print-button", this.chQuickPrint.isChecked()); + //Common.localStorage.setBool("pdfe-settings-quick-print-button", this.chQuickPrint.isChecked()); Common.localStorage.save(); diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index a88fb91402..25627696f3 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -72,7 +72,7 @@ define([ 'FileMenu': { 'menu:hide': me.onFileMenu.bind(me, 'hide'), 'menu:show': me.onFileMenu.bind(me, 'show'), - 'settings:apply': me.applySettings.bind(me) + //'settings:apply': me.applySettings.bind(me) }, 'Toolbar': { 'render:before' : function (toolbar) { @@ -80,10 +80,10 @@ define([ toolbar.setExtra('right', me.header.getPanel('right', config)); if (!config.twoLevelHeader || config.compactHeader) toolbar.setExtra('left', me.header.getPanel('left', config)); - var value = Common.localStorage.getBool("pe-settings-quick-print-button", true); + /*var value = Common.localStorage.getBool("pe-settings-quick-print-button", true); Common.Utils.InternalSettings.set("pe-settings-quick-print-button", value); if (me.header && me.header.btnPrintQuick) - me.header.btnPrintQuick[value ? 'show' : 'hide'](); + me.header.btnPrintQuick[value ? 'show' : 'hide']();*/ }, 'view:compact' : function (toolbar, state) { me.viewport.vlayout.getItem('toolbar').height = state ? @@ -310,12 +310,12 @@ define([ me.header.lockHeaderBtns( 'users', _need_disable ); }, - applySettings: function () { + /*applySettings: function () { var value = Common.localStorage.getBool("pe-settings-quick-print-button", true); Common.Utils.InternalSettings.set("pe-settings-quick-print-button", value); if (this.header && this.header.btnPrintQuick) this.header.btnPrintQuick[value ? 'show' : 'hide'](); - }, + },*/ onApiCoAuthoringDisconnect: function(enableDownload) { if (this.header) { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 5d1e64847e..6515c68dcd 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -333,12 +333,12 @@ define([ '', '
Beta', '', - '', + /*'', '
', '', '
', '', - '', + '',*/ '', '', '', @@ -633,7 +633,7 @@ define([ })).on('click', _.bind(me.applySettings, me)); }); - this.chQuickPrint = new Common.UI.CheckBox({ + /*this.chQuickPrint = new Common.UI.CheckBox({ el: $markup.findById('#fms-chb-quick-print'), labelText: '', dataHint: '2', @@ -642,7 +642,7 @@ define([ }); this.chQuickPrint.$el.parent().on('click', function (){ me.chQuickPrint.setValue(!me.chQuickPrint.isChecked()); - }); + });*/ this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply'); @@ -773,7 +773,7 @@ define([ this.chPaste.setValue(Common.Utils.InternalSettings.get("pe-settings-paste-button")); this.chRTL.setValue(Common.localStorage.getBool("ui-rtl", Common.Locale.isCurrentLanguageRtl())); - this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("pe-settings-quick-print-button")); + //this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("pe-settings-quick-print-button")); var data = []; for (var t in Common.UI.Themes.map()) { @@ -823,7 +823,7 @@ define([ Common.localStorage.setItem("pe-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); var isRtlChanged = this.chRTL.$el.is(':visible') && Common.localStorage.getBool("ui-rtl", Common.Locale.isCurrentLanguageRtl()) !== this.chRTL.isChecked(); Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); - Common.localStorage.setBool("pe-settings-quick-print-button", this.chQuickPrint.isChecked()); + //Common.localStorage.setBool("pe-settings-quick-print-button", this.chQuickPrint.isChecked()); Common.localStorage.save(); diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 66898109a9..2731cd842f 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -70,7 +70,7 @@ define([ 'FileMenu': { 'menu:hide': me.onFileMenu.bind(me, 'hide'), 'menu:show': me.onFileMenu.bind(me, 'show'), - 'settings:apply': me.applySettings.bind(me) + //'settings:apply': me.applySettings.bind(me) }, 'Statusbar': { 'view:compact': function (statusbar, state) { @@ -89,10 +89,10 @@ define([ if ( me.appConfig && me.appConfig.isEdit && !config.compactHeader && toolbar.btnCollabChanges ) toolbar.btnCollabChanges = me.header.btnSave; - var value = Common.localStorage.getBool("sse-settings-quick-print-button", true); + /*var value = Common.localStorage.getBool("sse-settings-quick-print-button", true); Common.Utils.InternalSettings.set("sse-settings-quick-print-button", value); if (me.header && me.header.btnPrintQuick) - me.header.btnPrintQuick[value ? 'show' : 'hide'](); + me.header.btnPrintQuick[value ? 'show' : 'hide']();*/ }, 'view:compact' : function (toolbar, state) { me.viewport.vlayout.getItem('toolbar').height = state ? @@ -283,12 +283,12 @@ define([ me.header.lockHeaderBtns( 'users', _need_disable ); }, - applySettings: function () { + /*applySettings: function () { var value = Common.localStorage.getBool("sse-settings-quick-print-button", true); Common.Utils.InternalSettings.set("sse-settings-quick-print-button", value); if (this.header && this.header.btnPrintQuick) this.header.btnPrintQuick[value ? 'show' : 'hide'](); - }, + },*/ onApiCoAuthoringDisconnect: function(enableDownload) { if (this.header) { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 8d9ef79867..998ef64a0a 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -313,12 +313,12 @@ define([ '', '
Beta', '', - '', + /*'', '
', '', '
', '', - '', + '',*/ '', '', '', @@ -801,7 +801,7 @@ define([ })).on('click', _.bind(me.applySettings, me)); }); - this.chQuickPrint = new Common.UI.CheckBox({ + /*this.chQuickPrint = new Common.UI.CheckBox({ el: $markup.findById('#fms-chb-quick-print'), labelText: '', dataHint: '2', @@ -810,7 +810,7 @@ define([ }); this.chQuickPrint.$el.parent().on('click', function (){ me.chQuickPrint.setValue(!me.chQuickPrint.isChecked()); - }); + });*/ this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply'); @@ -978,7 +978,7 @@ define([ this.chPaste.setValue(Common.Utils.InternalSettings.get("sse-settings-paste-button")); this.chRTL.setValue(Common.localStorage.getBool("ui-rtl", Common.Locale.isCurrentLanguageRtl())); - this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("sse-settings-quick-print-button")); + //this.chQuickPrint.setValue(Common.Utils.InternalSettings.get("sse-settings-quick-print-button")); var data = []; for (var t in Common.UI.Themes.map()) { @@ -1085,7 +1085,7 @@ define([ Common.localStorage.setItem("sse-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); var isRtlChanged = this.chRTL.$el.is(':visible') && Common.localStorage.getBool("ui-rtl", Common.Locale.isCurrentLanguageRtl()) !== this.chRTL.isChecked(); Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); - Common.localStorage.setBool("sse-settings-quick-print-button", this.chQuickPrint.isChecked()); + //Common.localStorage.setBool("sse-settings-quick-print-button", this.chQuickPrint.isChecked()); Common.localStorage.save(); if (this.menu) { From 1b235be84dfc256244c424cedd55cb4f406736a1 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Thu, 25 Apr 2024 12:46:18 +0300 Subject: [PATCH 7/7] [win-nix] fix button Home visibility --- apps/common/main/lib/controller/Desktop.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 83a58fa520..f507185d05 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -121,6 +121,12 @@ define([ if ( !$.isEmptyObject(titlebuttons) ) { var header = webapp.getController('Viewport').getView('Common.Views.Header'); if (header) { + if ( native.getViewportSettings ) { + const viewport = native.getViewportSettings(); + if ( viewport.widgetType == 'window' && titlebuttons.home ) + titlebuttons.home.btn.setVisible(true); + } + for (var i in titlebuttons) { opts.title.buttons.push(_serializeHeaderButton(i, titlebuttons[i])); } @@ -225,7 +231,7 @@ define([ icon: config.icon || undefined, hint: config.btn.options.hint, disabled: config.btn.isDisabled(), - visible: config.visible, + visible: config.btn.isVisible(), }; }; @@ -408,10 +414,15 @@ define([ var header = webapp.getController('Viewport').getView('Common.Views.Header'); { + let viewport; + if ( native.getViewportSettings ) { + viewport = native.getViewportSettings(); + } + header.btnHome = (new Common.UI.Button({ cls: 'btn-header', iconCls: 'toolbar__icon icon--inverse btn-home', - visible: false, + visible: viewport && viewport.widgetType == 'window', hint: Common.Locale.get('hintBtnHome', {name:"Common.Controllers.Desktop", default: 'Show Main window'}), dataHint:'0', dataHintDirection: 'right',