From 536879700017e2cfca9a34b86df678c92eb784b5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 1 Apr 2024 22:18:22 +0300 Subject: [PATCH 001/163] [PE] Bug 67159 --- .../main/app/controller/DocumentHolder.js | 8 +++++++- .../main/app/view/HyperlinkSettingsDialog.js | 8 ++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index 2d0e281a31..23ead890d6 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -75,6 +75,11 @@ var c_paragraphSpecial = { HANGING: 2 }; +var c_oHyperlinkType = { + InternalLink:0, + WebLink: 1 +}; + define([ 'core', 'presentationeditor/main/app/view/DocumentHolder' @@ -1110,7 +1115,7 @@ define([ } }, - onDialogAddHyperlink: function() { + onDialogAddHyperlink: function(isButton) { var win, props, text; var me = this; if (me.api && me.mode.isEdit && !me._isDisabled && !PE.getController('LeftMenu').leftMenu.menuFile.isVisible()){ @@ -1139,6 +1144,7 @@ define([ api: me.api, appOptions: me.mode, handler: handlerDlg, + type: isButton ? c_oHyperlinkType.InternalLink : undefined, slides: _arr }); diff --git a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js index 456f2cdae8..184837611d 100644 --- a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js @@ -41,11 +41,6 @@ if (Common === undefined) var Common = {}; -var c_oHyperlinkType = { - InternalLink:0, - WebLink: 1 -}; - define([ 'common/main/lib/util/utils', 'common/main/lib/component/InputField', @@ -99,6 +94,7 @@ define([ this.options.tpl = _.template(this.template)(this.options); this.slides = this.options.slides; this.api = this.options.api; + this.type = options.type; this.urlType = AscCommon.c_oAscUrlType.Invalid; this.appOptions = this.options.appOptions; @@ -203,7 +199,7 @@ define([ if (props) { var me = this; - var type = me.parseUrl(props.get_Value()); + var type = (me.type!==undefined) ? me.type : me.parseUrl(props.get_Value()); (type == c_oHyperlinkType.WebLink) ? me.btnExternal.toggle(true) : me.btnInternal.toggle(true); me.ShowHideElem(type, props.get_Value()); From c712c9d24198e9404fdff6f84422f804fa2543d7 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Tue, 9 Apr 2024 22:36:58 +0300 Subject: [PATCH 002/163] [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 a6a4d449ec354250a746640fef3aa432c7178da3 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Wed, 10 Apr 2024 13:57:10 +0300 Subject: [PATCH 003/163] [all] lock "rtl ui" option for non-rtl languages --- apps/documenteditor/main/app/controller/Main.js | 2 +- apps/pdfeditor/main/app/controller/Main.js | 2 +- apps/presentationeditor/main/app/controller/Main.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 80a399fe48..4512cf2cb0 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -461,7 +461,7 @@ define([ this.appOptions.canFeatureContentControl = true; this.appOptions.canFeatureForms = !!this.api.asc_isSupportFeature("forms"); this.appOptions.isPDFForm = !!window.isPDFForm; - this.appOptions.uiRtl = !(Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.uiRtlSupported()) && !Common.Utils.isIE; + this.appOptions.uiRtl = Common.Locale.isCurrentLanguageRtl() && !(Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.uiRtlSupported()) && !Common.Utils.isIE; this.appOptions.disableNetworkFunctionality = !!(window["AscDesktopEditor"] && window["AscDesktopEditor"]["isSupportNetworkFunctionality"] && false === window["AscDesktopEditor"]["isSupportNetworkFunctionality"]()); this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false)); this.appOptions.canSaveDocumentToBinary = this.editorConfig.canSaveDocumentToBinary; diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index fe505f3555..b23067c602 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -399,7 +399,7 @@ define([ this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage; this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings; this.appOptions.compatibleFeatures = true; - this.appOptions.uiRtl = !(Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.uiRtlSupported()) && !Common.Utils.isIE; + this.appOptions.uiRtl = Common.Locale.isCurrentLanguageRtl() && !(Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.uiRtlSupported()) && !Common.Utils.isIE; this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false)); this.appOptions.canSaveDocumentToBinary = this.editorConfig.canSaveDocumentToBinary; this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this)); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 7f2af98de0..3c5c9ffa88 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -411,7 +411,7 @@ define([ this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures; this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings; this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false)); - this.appOptions.uiRtl = !(Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.uiRtlSupported()) && !Common.Utils.isIE; + this.appOptions.uiRtl = Common.Locale.isCurrentLanguageRtl() && !(Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.uiRtlSupported()) && !Common.Utils.isIE; this.appOptions.canSaveDocumentToBinary = this.editorConfig.canSaveDocumentToBinary; this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this)); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index ec159506f6..0b43d954df 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -463,7 +463,7 @@ define([ this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink; this.appOptions.canFeaturePivot = true; this.appOptions.canFeatureViews = true; - this.appOptions.uiRtl = !(Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.uiRtlSupported()) && !Common.Utils.isIE; + this.appOptions.uiRtl = Common.Locale.isCurrentLanguageRtl() && !(Common.Controllers.Desktop.isActive() && Common.Controllers.Desktop.uiRtlSupported()) && !Common.Utils.isIE; this.appOptions.canRequestReferenceData = this.editorConfig.canRequestReferenceData; this.appOptions.canRequestOpen = this.editorConfig.canRequestOpen; this.appOptions.canRequestReferenceSource = this.editorConfig.canRequestReferenceSource; From 992aff5b68e0c4f807121062f464437f0fff56a8 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Thu, 11 Apr 2024 11:06:12 +0300 Subject: [PATCH 004/163] [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 6731193a9be9be4db9d36c526d0611375570d88d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 11 Apr 2024 22:02:41 +0300 Subject: [PATCH 005/163] [SSE] For bug 67084 --- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 4 ++-- apps/spreadsheeteditor/main/app/view/PrintSettings.js | 4 ++-- apps/spreadsheeteditor/main/app/view/Toolbar.js | 8 ++++---- .../mobile/src/store/spreadsheetSettings.js | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index ca430a6299..1c4cce7009 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -2599,10 +2599,10 @@ define([ {value:'110|220', displayValue:['Envelope DL', '11', '22', 'cm'], caption: 'Envelope DL'}, {value:'279.4|431.8', displayValue:['Tabloid', '27,94', '43,18', 'cm'], caption: 'Tabloid'}, {value:'297|420', displayValue:['A3', '29,7', '42', 'cm'], caption: 'A3'}, - {value:'304.8|457.1', displayValue:['Tabloid Oversize', '30,48', '45,71', 'cm'], caption: 'Tabloid Oversize'}, + {value:'296.9|457.2', displayValue:['Tabloid Oversize', '29,69', '45,72', 'cm'], caption: 'Tabloid Oversize'}, {value:'196.8|273', displayValue:['ROC 16K', '19,68', '27,3', 'cm'], caption: 'ROC 16K'}, {value:'119.9|234.9', displayValue:['Envelope Choukei 3', '11,99', '23,49', 'cm'], caption: 'Envelope Choukei 3'}, - {value:'330.2|482.5', displayValue:['Super B/A3', '33,02', '48,25', 'cm'], caption: 'Super B/A3'} + {value:'305|487', displayValue:['Super B/A3', '30,5', '48,7', 'cm'], caption: 'Super B/A3'} ], dataHint: '2', dataHintDirection: 'bottom', diff --git a/apps/spreadsheeteditor/main/app/view/PrintSettings.js b/apps/spreadsheeteditor/main/app/view/PrintSettings.js index 53ab1b9e8d..65bea46c1d 100644 --- a/apps/spreadsheeteditor/main/app/view/PrintSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PrintSettings.js @@ -161,10 +161,10 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template', {value:'110|220', displayValue:'Envelope DL (11 cm x 22 cm)', caption: 'Envelope DL'}, {value:'279.4|431.8', displayValue:'Tabloid (27,94 cm x 43,18 cm)', caption: 'Tabloid'}, {value:'297|420', displayValue:'A3 (29,7 cm x 42 cm)', caption: 'A3'}, - {value:'304.8|457.1', displayValue:'Tabloid Oversize (30,48 cm x 45,71 cm)', caption: 'Tabloid Oversize'}, + {value:'296.9|457.2', displayValue:'Tabloid Oversize (29,69 cm x 45,72 cm)', caption: 'Tabloid Oversize'}, {value:'196.8|273', displayValue:'ROC 16K (19,68 cm x 27,3 cm)', caption: 'ROC 16K'}, {value:'119.9|234.9', displayValue:'Envelope Choukei 3 (11,99 cm x 23,49 cm)', caption: 'Envelope Choukei 3'}, - {value:'330.2|482.5', displayValue:'Super B/A3 (33,02 cm x 48,25 cm)', caption: 'Super B/A3'} + {value:'305|487', displayValue:'Super B/A3 (30,5 cm x 48,7 cm)', caption: 'Super B/A3'} ] }); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 2fcf3e8160..d0043ac3de 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1974,11 +1974,11 @@ define([ }, { caption: 'Tabloid Oversize', - subtitle: '30,48cm x 45,71cm', + subtitle: '29,69cm x 45,72cm', template: pageSizeTemplate, checkable: true, toggleGroup: 'menuPageSize', - value: [304.8, 457.1] + value: [296.9, 457.2] }, { caption: 'ROC 16K', @@ -1998,11 +1998,11 @@ define([ }, { caption: 'Super B/A3', - subtitle: '33,02cm x 48,25cm', + subtitle: '30,5cm x 48,7cm', template: pageSizeTemplate, checkable: true, toggleGroup: 'menuPageSize', - value: [330.2, 482.5] + value: [305, 487] } ] }), diff --git a/apps/spreadsheeteditor/mobile/src/store/spreadsheetSettings.js b/apps/spreadsheeteditor/mobile/src/store/spreadsheetSettings.js index 9d2757b448..fa71f306fb 100644 --- a/apps/spreadsheeteditor/mobile/src/store/spreadsheetSettings.js +++ b/apps/spreadsheeteditor/mobile/src/store/spreadsheetSettings.js @@ -46,10 +46,10 @@ export class storeSpreadsheetSettings { { caption: 'Envelope DL', subtitle: '11 ' + txtCm + ' x 22 ' + txtCm, value: [110, 220] }, { caption: 'Tabloid', subtitle: '27,94 ' + txtCm + ' x 43,18 ' + txtCm, value: [279.4, 431.8] }, { caption: 'A3', subtitle: '29,7 ' + txtCm + ' x 42 ' + txtCm, value: [297, 420] }, - { caption: 'Tabloid Oversize', subtitle: '30,48 ' + txtCm + ' x 45,71 ' + txtCm, value: [304.8, 457.1] }, + { caption: 'Tabloid Oversize', subtitle: '29,69 ' + txtCm + ' x 45,72 ' + txtCm, value: [296.9, 457.2] }, { caption: 'ROC 16K', subtitle: '19,68 ' + txtCm + ' x 27,3 ' + txtCm, value: [196.8, 273] }, { caption: 'Envelope Choukei 3', subtitle: '11,99 ' + txtCm + ' x 23,49 ' + txtCm, value: [119.9, 234.9] }, - { caption: 'Super B/A3', subtitle: '33,02 ' + txtCm + ' x 48,25 ' + txtCm, value: [330.2, 482.5] }, + { caption: 'Super B/A3', subtitle: '30,5 ' + txtCm + ' x 48,7 ' + txtCm, value: [305, 487] }, { caption: 'A0', subtitle: '84,1 ' + txtCm + ' x 118,9 ' + txtCm, value: [841, 1189] }, { caption: 'A1', subtitle: '59,4 ' + txtCm + ' x 84,1 ' + txtCm, value: [594, 841] }, { caption: 'A2', subtitle: '42 ' + txtCm + ' x 59,4 ' + txtCm, value: [420, 594] }, From cff28f817013ea5067a22694acb521e36ec3c03d Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Fri, 12 Apr 2024 11:48:47 +0300 Subject: [PATCH 006/163] [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 007/163] [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 cafba9bb41d609069dd16a5ae76f8afd80b627bf Mon Sep 17 00:00:00 2001 From: Alexei Koshelev Date: Tue, 16 Apr 2024 02:56:24 +0300 Subject: [PATCH 008/163] [common] Fix border header listview --- apps/common/main/resources/less/listview.less | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/common/main/resources/less/listview.less b/apps/common/main/resources/less/listview.less index 6ad07bf020..d1574a15fd 100644 --- a/apps/common/main/resources/less/listview.less +++ b/apps/common/main/resources/less/listview.less @@ -105,11 +105,13 @@ padding: 3px 6px; position: absolute; left: 1px; - left: @scaled-one-px-value; + left: calc(@scaled-one-px-value + 0.05px); top: 1px; - top: @scaled-one-px-value; + top: calc(@scaled-one-px-value + 0.05px); width: calc(100% - 2px); width: calc(100% - @scaled-two-px-value); + border-top-left-radius: 1px; + border-top-right-radius: 1px; display: flex; align-items: center; From 2ecc9404538121c20322d4766f428232020ba634 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Tue, 16 Apr 2024 14:25:11 +0300 Subject: [PATCH 009/163] [common] Add rtl option blocking for non-rtl languages --- apps/common/mobile/utils/htmlutils.js | 12 +++++- .../src/view/settings/ApplicationSettings.jsx | 40 +++++++++++-------- .../src/view/settings/ApplicationSettings.jsx | 40 +++++++++++-------- .../src/view/settings/ApplicationSettings.jsx | 40 +++++++++++-------- 4 files changed, 80 insertions(+), 52 deletions(-) diff --git a/apps/common/mobile/utils/htmlutils.js b/apps/common/mobile/utils/htmlutils.js index d7b448e1d6..c82345f340 100644 --- a/apps/common/mobile/utils/htmlutils.js +++ b/apps/common/mobile/utils/htmlutils.js @@ -24,8 +24,18 @@ function isLocalStorageAvailable() { } } +if(!window.lang) { + window.lang = (/(?:&|^)lang=([^&]+)&?/i).exec(window.location.search.substring(1)); + window.lang = window.lang ? window.lang[1] : ''; +} + +window.lang && (window.lang = window.lang.split(/[\-\_]/)[0].toLowerCase()); + if(isLocalStorageAvailable()) { - if(localStorage.getItem('mobile-mode-direction') === 'rtl') { + const modeDirection = localStorage.getItem('mobile-mode-direction'); + + if(modeDirection === 'rtl' || (window.lang === 'ar' && !modeDirection)) { + !modeDirection && localStorage.setItem('mobile-mode-direction', 'rtl'); load_stylesheet('./css/framework7-rtl.css'); document.body.classList.add('rtl'); } else { diff --git a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx index 80ed1e26a5..c47af649e3 100644 --- a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx @@ -25,6 +25,8 @@ const PageApplicationSettings = props => { // set mode const appOptions = props.storeAppOptions; + const currentLang = appOptions.lang; + const isRtlLang = currentLang && /^(ar)$/i.test(currentLang); const colorTheme = storeThemes.colorTheme; const themes = storeThemes.themes; const typeTheme = colorTheme.type; @@ -112,23 +114,27 @@ const PageApplicationSettings = props => { }}> } - - -
- {t("Settings.textRtlInterface")} - Beta -
- { - storeApplicationSettings.changeDirectionMode(newDirectionMode); - props.changeDirectionMode(newDirectionMode); - }} - /> -
-
- -

{t('Settings.textExplanationChangeDirection')}

-
+ {isRtlLang && + <> + + +
+ {t("Settings.textRtlInterface")} + Beta +
+ { + storeApplicationSettings.changeDirectionMode(newDirectionMode); + props.changeDirectionMode(newDirectionMode); + }} + /> +
+
+ +

{t('Settings.textExplanationChangeDirection')}

+
+ + } ); }; diff --git a/apps/presentationeditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/presentationeditor/mobile/src/view/settings/ApplicationSettings.jsx index 23012d14a5..cc6a2fb22d 100644 --- a/apps/presentationeditor/mobile/src/view/settings/ApplicationSettings.jsx +++ b/apps/presentationeditor/mobile/src/view/settings/ApplicationSettings.jsx @@ -19,6 +19,8 @@ const PageApplicationSettings = props => { // set mode const appOptions = props.storeAppOptions; + const currentLang = appOptions.lang; + const isRtlLang = currentLang && /^(ar)$/i.test(currentLang); const storeThemes = props.storeThemes; const colorTheme = storeThemes.colorTheme; const themes = storeThemes.themes; @@ -66,23 +68,27 @@ const PageApplicationSettings = props => { setMacrosSettings: props.setMacrosSettings }}> - - -
- {t("View.Settings.textRtlInterface")} - Beta -
- { - storeApplicationSettings.changeDirectionMode(newDirectionMode); - props.changeDirectionMode(newDirectionMode); - }} - /> -
-
- -

{t('View.Settings.textExplanationChangeDirection')}

-
+ {isRtlLang && + <> + + +
+ {t("View.Settings.textRtlInterface")} + Beta +
+ { + storeApplicationSettings.changeDirectionMode(newDirectionMode); + props.changeDirectionMode(newDirectionMode); + }} + /> +
+
+ +

{t('View.Settings.textExplanationChangeDirection')}

+
+ + } ); }; diff --git a/apps/spreadsheeteditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/spreadsheeteditor/mobile/src/view/settings/ApplicationSettings.jsx index cccb47d17f..dc13c3be71 100644 --- a/apps/spreadsheeteditor/mobile/src/view/settings/ApplicationSettings.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/settings/ApplicationSettings.jsx @@ -31,6 +31,8 @@ const PageApplicationSettings = props => { // set mode const appOptions = props.storeAppOptions; const storeThemes = props.storeThemes; + const currentLang = appOptions.lang; + const isRtlLang = currentLang && /^(ar)$/i.test(currentLang); const colorTheme = storeThemes.colorTheme; const themes = storeThemes.themes; const isConfigSelectTheme = storeThemes.isConfigSelectTheme; @@ -109,23 +111,27 @@ const PageApplicationSettings = props => { onChangeMacrosSettings: props.onChangeMacrosSettings }}> - - -
- {t("View.Settings.textRtlInterface")} - Beta -
- { - storeApplicationSettings.changeDirectionMode(newDirectionMode); - props.changeDirectionMode(newDirectionMode); - }} - /> -
-
- -

{t('View.Settings.textExplanationChangeDirection')}

-
+ {isRtlLang && + <> + + +
+ {t("View.Settings.textRtlInterface")} + Beta +
+ { + storeApplicationSettings.changeDirectionMode(newDirectionMode); + props.changeDirectionMode(newDirectionMode); + }} + /> +
+
+ +

{t('View.Settings.textExplanationChangeDirection')}

+
+ + } ); }; From ea0e56ebadd4c4a9e05f3384fea9be72e69153be Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 16 Apr 2024 21:33:48 +0300 Subject: [PATCH 010/163] [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 aea3758a4a032a9f0508323dd987e4fd8571f5d3 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Thu, 18 Apr 2024 13:09:59 +0300 Subject: [PATCH 011/163] [DE mobile] refactoring --- apps/common/mobile/utils/htmlutils.js | 20 +++++++++++-------- apps/documenteditor/mobile/src/index_dev.html | 9 ++++----- .../src/view/settings/ApplicationSettings.jsx | 4 +--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/apps/common/mobile/utils/htmlutils.js b/apps/common/mobile/utils/htmlutils.js index c82345f340..d9ec028990 100644 --- a/apps/common/mobile/utils/htmlutils.js +++ b/apps/common/mobile/utils/htmlutils.js @@ -24,18 +24,22 @@ function isLocalStorageAvailable() { } } -if(!window.lang) { - window.lang = (/(?:&|^)lang=([^&]+)&?/i).exec(window.location.search.substring(1)); - window.lang = window.lang ? window.lang[1] : ''; +{ + let lang = (/(?:&|^)lang=([^&]+)&?/i).exec(window.location.search.substring(1)); + lang = ((lang && lang[1]) || window.Common.Locale.defaultLang).split(/[\-\_]/)[0]; + Common.Locale.currentLang = lang; + Common.Locale.isCurrentLangRtl = lang.lastIndexOf('ar', 0) === 0; } -window.lang && (window.lang = window.lang.split(/[\-\_]/)[0].toLowerCase()); - if(isLocalStorageAvailable()) { - const modeDirection = localStorage.getItem('mobile-mode-direction'); + let modeDirection = localStorage.getItem('mobile-mode-direction'); - if(modeDirection === 'rtl' || (window.lang === 'ar' && !modeDirection)) { - !modeDirection && localStorage.setItem('mobile-mode-direction', 'rtl'); + if( !modeDirection && Common.Locale.isCurrentLangRtl ) { + localStorage.setItem('mobile-mode-direction', 'rtl'); + modeDirection = 'rtl'; + } + + if(modeDirection === 'rtl') { load_stylesheet('./css/framework7-rtl.css'); document.body.classList.add('rtl'); } else { diff --git a/apps/documenteditor/mobile/src/index_dev.html b/apps/documenteditor/mobile/src/index_dev.html index 83d28bd8ab..9fdd8137a0 100644 --- a/apps/documenteditor/mobile/src/index_dev.html +++ b/apps/documenteditor/mobile/src/index_dev.html @@ -23,6 +23,9 @@ + <% if ( htmlWebpackPlugin.options.skeleton.htmlscript ) { %> diff --git a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx index c47af649e3..32175a75d8 100644 --- a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx @@ -25,8 +25,6 @@ const PageApplicationSettings = props => { // set mode const appOptions = props.storeAppOptions; - const currentLang = appOptions.lang; - const isRtlLang = currentLang && /^(ar)$/i.test(currentLang); const colorTheme = storeThemes.colorTheme; const themes = storeThemes.themes; const typeTheme = colorTheme.type; @@ -114,7 +112,7 @@ const PageApplicationSettings = props => { }}> } - {isRtlLang && + {Common.Locale.isCurrentLangRtl && <> From 2325cb840c38149bb8c3910f103cfb73f6388309 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Thu, 18 Apr 2024 18:09:02 +0300 Subject: [PATCH 012/163] [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 c9d88e57f0ffc3fac0cd4cba1da81007da449a73 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Fri, 19 Apr 2024 21:14:59 +0300 Subject: [PATCH 013/163] [SSE] Change copy move dialog --- .../main/app/controller/Statusbar.js | 15 ++-- .../main/app/view/Statusbar.js | 71 ++++++++++++------- apps/spreadsheeteditor/main/locale/en.json | 11 +-- 3 files changed, 58 insertions(+), 39 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js index 09b2b2b34b..3cee33fff2 100644 --- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js @@ -314,11 +314,8 @@ define([ case 'ren': this.renameWorksheet(); break; - case 'copy': - this.moveWorksheet(arrIndex, false); - break; - case 'move': - this.moveWorksheet(arrIndex, true); + case 'move-copy': + this.moveWorksheet(arrIndex); break; case 'hide': setTimeout(function () { @@ -501,12 +498,12 @@ define([ } (new SSE.Views.Statusbar.CopyDialog({ - title : cut ? me.statusbar.itemMove : me.statusbar.itemCopy, - ismove : cut, + title : me.statusbar.itemMoveOrCopy, names : items, - handler : function(btn, i) { + isDesktopApp: true,//me.statusbar.mode.isDesktopApp, + handler : function(btn, i, copy) { if (btn == 'ok') { - if (cut) { + if (!copy) { me.api.asc_moveWorksheet(i == -255 ? wc : i, arrIndex); } else { var arrNames = []; diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index ee12d092ff..1690d47b95 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -341,8 +341,7 @@ define([ {caption: this.itemInsert, value: 'ins'}, {caption: this.itemDelete, value: 'del'}, {caption: this.itemRename, value: 'ren'}, - {caption: this.itemCopy, value: 'copy'}, - {caption: this.itemMove, value: 'move'}, + {caption: this.itemMoveOrCopy, value: 'move-copy'}, {caption: this.itemHide, value: 'hide'}, { caption: this.itemHidden, @@ -532,8 +531,8 @@ define([ var me = this; this.tabbar.empty(true); - this.tabMenu.items[6].menu.removeAll(); - this.tabMenu.items[6].hide(); + this.tabMenu.items[5].menu.removeAll(); + this.tabMenu.items[5].hide(); this.btnAddWorksheet.setDisabled(true); this.sheetListMenu.removeAll(); @@ -564,13 +563,13 @@ define([ if (hidentems.length) { hidentems.forEach(function(item){ - me.tabMenu.items[6].menu.addItem(new Common.UI.MenuItem({ + me.tabMenu.items[5].menu.addItem(new Common.UI.MenuItem({ style: 'white-space: pre-wrap', caption: item.label, value: item.sheetindex })); }); - this.tabMenu.items[6].show(); + this.tabMenu.items[5].show(); } this.tabbar.add(items); @@ -737,22 +736,21 @@ define([ this.tabMenu.items[2].setDisabled(issheetlocked || isdocprotected); this.tabMenu.items[3].setDisabled(issheetlocked || isdocprotected); this.tabMenu.items[4].setDisabled(issheetlocked || isdocprotected); - this.tabMenu.items[5].setDisabled(issheetlocked || isdocprotected); - this.tabMenu.items[6].setDisabled(isdoclocked || isdocprotected); - this.tabMenu.items[7].setDisabled(select.length>1); - this.tabMenu.items[8].setDisabled(issheetlocked || isdocprotected); + this.tabMenu.items[5].setDisabled(isdoclocked || isdocprotected); + this.tabMenu.items[6].setDisabled(select.length>1); + this.tabMenu.items[7].setDisabled(issheetlocked || isdocprotected); - this.tabMenu.items[7].setVisible(!this.mode.isEditOle && this.mode.canProtect); - this.tabMenu.items[7].setCaption(this.api.asc_isProtectedSheet() ? this.itemUnProtect : this.itemProtect); + this.tabMenu.items[6].setVisible(!this.mode.isEditOle && this.mode.canProtect); + this.tabMenu.items[6].setCaption(this.api.asc_isProtectedSheet() ? this.itemUnProtect : this.itemProtect); if (select.length === 1) { - this.tabMenu.items[11].hide(); + this.tabMenu.items[10].hide(); } else { - this.tabMenu.items[11].show(); + this.tabMenu.items[10].show(); } + this.tabMenu.items[9].setDisabled(issheetlocked || isdocprotected); this.tabMenu.items[10].setDisabled(issheetlocked || isdocprotected); - this.tabMenu.items[11].setDisabled(issheetlocked || isdocprotected); this.api.asc_closeCellEditor(); this.api.asc_enableKeyEvents(false); @@ -1061,8 +1059,7 @@ define([ itemInsert : 'Insert', itemDelete : 'Delete', itemRename : 'Rename', - itemCopy : 'Copy', - itemMove : 'Move', + itemMoveOrCopy : 'Move or copy', itemHide : 'Hide', itemHidden : 'Hidden', itemTabColor : 'Tab Color', @@ -1212,15 +1209,23 @@ define([ }, template: '
' + + '<% if (isDesktopApp) { %>' + '
' + - '' + + '' + '
' + - '
' + + '
' + + '<% } %>' + + '
' + + '' + + '
' + + '
' + + '
' + '
', initialize : function(options) { _.extend(this.options, options || {}, { - label: options.ismove ? this.textMoveBefore : this.textCopyBefore + labelSpreadsheet: this.textSpreadsheet, + labelMoveBefore: this.textMoveBefore }); this.options.tpl = _.template(this.template)(this.options); @@ -1233,6 +1238,14 @@ define([ var $window = this.getChild(); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); + this.cmbSpreadsheet = new Common.UI.ComboBox({ + el: $('#status-cmb-spreadsheet', this.$window), + menuStyle: 'min-width: 100%;', + cls: 'input-group-nr', + data: [], + editable: false + }); + var pages = []; this.options.names.forEach(function(item){ pages.push(new Common.UI.DataViewModel(item)); @@ -1240,7 +1253,7 @@ define([ if (pages.length) { pages.push(new Common.UI.DataViewModel({ - value : this.options.ismove ? this.itemMoveToEnd : this.itemCopyToEnd, + value : this.itemMoveToEnd, inindex : -255 })); } @@ -1257,6 +1270,12 @@ define([ this.listNames.on('entervalue', _.bind(this.onPrimary, this)); this.listNames.on('item:dblclick', _.bind(this.onPrimary, this)); + this.chCreateCopy = new Common.UI.CheckBox({ + el: $('#status-ch-create-copy', $window), + labelText: this.textCreateCopy, + value: false + }); + this.mask = $('.modals-mask'); this.mask.on('mousedown',_.bind(this.onUpdateFocus, this)); }, @@ -1288,7 +1307,7 @@ define([ if (this.options.handler) { this.options.handler.call(this, - event.currentTarget.attributes['result'].value, active.get('inindex')); + event.currentTarget.attributes['result'].value, active.get('inindex'), this.chCreateCopy.getValue()==='checked'); } this.close(); @@ -1296,7 +1315,7 @@ define([ onPrimary: function() { if (this.options.handler) { - this.options.handler.call(this, 'ok', this.listNames.getSelectedRec().get('inindex')); + this.options.handler.call(this, 'ok', this.listNames.getSelectedRec().get('inindex'), this.chCreateCopy.getValue()==='checked'); } this.close(); @@ -1308,10 +1327,10 @@ define([ }, 100, this); }, - itemCopyToEnd : '(Copy to end)', itemMoveToEnd : '(Move to end)', - textCopyBefore : 'Copy before sheet', - textMoveBefore : 'Move before sheet' + textMoveBefore : 'Move before sheet', + textCreateCopy : 'Create a copy', + textSpreadsheet : 'Spreadsheet' }, CopyDialog||{})); } diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index f94b39346a..b13a450e3b 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -3807,14 +3807,16 @@ "SSE.Views.Spellcheck.txtDictionaryLanguage": "Dictionary language", "SSE.Views.Spellcheck.txtNextTip": "Go to the next word", "SSE.Views.Spellcheck.txtSpelling": "Spelling", - "SSE.Views.Statusbar.CopyDialog.itemCopyToEnd": "(Copy to end)", + "del_SSE.Views.Statusbar.CopyDialog.itemCopyToEnd": "(Copy to end)", "SSE.Views.Statusbar.CopyDialog.itemMoveToEnd": "(Move to end)", - "SSE.Views.Statusbar.CopyDialog.textCopyBefore": "Paste before sheet", + "del_SSE.Views.Statusbar.CopyDialog.textCopyBefore": "Paste before sheet", "SSE.Views.Statusbar.CopyDialog.textMoveBefore": "Move before sheet", + "SSE.Views.Statusbar.CopyDialog.textCreateCopy": "Create a copy", + "SSE.Views.Statusbar.CopyDialog.textSpreadsheet": "Spreadsheet", "SSE.Views.Statusbar.filteredRecordsText": "{0} of {1} records filtered", "SSE.Views.Statusbar.filteredText": "Filter mode", "SSE.Views.Statusbar.itemAverage": "Average", - "SSE.Views.Statusbar.itemCopy": "Copy", + "del_SSE.Views.Statusbar.itemCopy": "Copy", "SSE.Views.Statusbar.itemCount": "Count", "SSE.Views.Statusbar.itemDelete": "Delete", "SSE.Views.Statusbar.itemHidden": "Hidden", @@ -3822,7 +3824,7 @@ "SSE.Views.Statusbar.itemInsert": "Insert", "SSE.Views.Statusbar.itemMaximum": "Maximum", "SSE.Views.Statusbar.itemMinimum": "Minimum", - "SSE.Views.Statusbar.itemMove": "Move", + "del_SSE.Views.Statusbar.itemMove": "Move", "SSE.Views.Statusbar.itemProtect": "Protect", "SSE.Views.Statusbar.itemRename": "Rename", "SSE.Views.Statusbar.itemStatus": "Saving status", @@ -3852,6 +3854,7 @@ "SSE.Views.Statusbar.tipZoomOut": "Zoom out", "SSE.Views.Statusbar.ungroupSheets": "Ungroup sheets", "SSE.Views.Statusbar.zoomText": "Zoom {0}%", + "SSE.Views.Statusbar.itemMoveOrCopy": "Move or copy", "SSE.Views.TableOptionsDialog.errorAutoFilterDataRange": "The operation could not be done for the selected range of cells.
Select a uniform data range different from the existing one and try again.", "SSE.Views.TableOptionsDialog.errorFTChangeTableRangeError": "Operation could not be completed for the selected cell range.
Select a range so that the first table row was on the same row
and the resulting table overlapped the current one.", "SSE.Views.TableOptionsDialog.errorFTRangeIncludedOtherTables": "Operation could not be completed for the selected cell range.
Select a range which does not include other tables.", From 42ec931e1d09d77a77aebb6140f16db96cdcdb5e Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Sat, 20 Apr 2024 14:33:06 +0300 Subject: [PATCH 014/163] [DE PE SSE mobile] Fix Bug 66088 --- apps/documenteditor/mobile/src/view/add/Add.jsx | 1 - .../mobile/src/view/add/AddingPage.jsx | 10 +++++++++- .../mobile/src/view/add/Add.jsx | 1 - .../mobile/src/view/add/AddingPage.jsx | 13 +++++++++++-- .../spreadsheeteditor/mobile/src/view/add/Add.jsx | 1 - .../mobile/src/view/add/AddingPage.jsx | 15 ++++++++++++--- 6 files changed, 32 insertions(+), 9 deletions(-) diff --git a/apps/documenteditor/mobile/src/view/add/Add.jsx b/apps/documenteditor/mobile/src/view/add/Add.jsx index 5bfdd48011..7284631c2e 100644 --- a/apps/documenteditor/mobile/src/view/add/Add.jsx +++ b/apps/documenteditor/mobile/src/view/add/Add.jsx @@ -15,7 +15,6 @@ const routes = [ { path: '/adding-page/', component: AddingPage, - keepAlive: true }, // Image { diff --git a/apps/documenteditor/mobile/src/view/add/AddingPage.jsx b/apps/documenteditor/mobile/src/view/add/AddingPage.jsx index 09151c44ef..e66c79fe4c 100644 --- a/apps/documenteditor/mobile/src/view/add/AddingPage.jsx +++ b/apps/documenteditor/mobile/src/view/add/AddingPage.jsx @@ -49,9 +49,11 @@ const AddLayoutContent = ({ tabs }) => { ) }; -const AddingPage = inject("storeFocusObjects", "storeTableSettings")(observer(props => { +const AddingPage = inject("storeFocusObjects", "storeTableSettings", "storeApplicationSettings")(observer(props => { const mainContext = useContext(MainContext); const showPanels = mainContext.showPanels; + const storeApplicationSettings = props.storeApplicationSettings; + const directionMode = storeApplicationSettings.directionMode; const storeFocusObjects = props.storeFocusObjects; const storeTableSettings = props.storeTableSettings; const { t } = useTranslation(); @@ -65,6 +67,12 @@ const AddingPage = inject("storeFocusObjects", "storeTableSettings")(observer(pr f7.tab.show('#add-other', false); }, []); + useEffect(() => { + if(directionMode === 'rtl') { + tabs.reverse(); + } + }, [directionMode]) + let needDisable = false, canAddTable = true, canAddImage = true, diff --git a/apps/presentationeditor/mobile/src/view/add/Add.jsx b/apps/presentationeditor/mobile/src/view/add/Add.jsx index 219acdd181..fdf6f193ae 100644 --- a/apps/presentationeditor/mobile/src/view/add/Add.jsx +++ b/apps/presentationeditor/mobile/src/view/add/Add.jsx @@ -15,7 +15,6 @@ const routes = [ { path: '/adding-page/', component: AddingPage, - keepAlive: true }, // Image { diff --git a/apps/presentationeditor/mobile/src/view/add/AddingPage.jsx b/apps/presentationeditor/mobile/src/view/add/AddingPage.jsx index 27215a97db..44ec47d308 100644 --- a/apps/presentationeditor/mobile/src/view/add/AddingPage.jsx +++ b/apps/presentationeditor/mobile/src/view/add/AddingPage.jsx @@ -1,6 +1,7 @@ import React, { useContext, useEffect } from 'react'; import { Page, Navbar, NavRight, NavTitle, Link, Icon, Tabs, Tab, f7 } from 'framework7-react'; import { useTranslation } from 'react-i18next'; +import { observer, inject } from "mobx-react"; import { Device } from '../../../../../common/mobile/utils/device'; import AddSlideController from "../../controller/add/AddSlide"; import AddShapeController from "../../controller/add/AddShape"; @@ -39,10 +40,12 @@ const AddLayoutContent = ({ tabs }) => { ) }; -const AddingPage = () => { +const AddingPage = inject("storeApplicationSettings")(observer(props => { const { t } = useTranslation(); const _t = t('View.Add', {returnObjects: true}); const api = Common.EditorApi.get(); + const storeApplicationSettings = props.storeApplicationSettings; + const directionMode = storeApplicationSettings.directionMode; const countPages = api.getCountPages(); const mainContext = useContext(MainContext); const showPanels = mainContext.showPanels; @@ -51,6 +54,12 @@ const AddingPage = () => { useEffect(() => { f7.tab.show('#add-other', false); }, []); + + useEffect(() => { + if(directionMode === 'rtl') { + tabs.reverse(); + } + }, [directionMode]) if (!showPanels && countPages) { tabs.push({ @@ -105,6 +114,6 @@ const AddingPage = () => { ) -}; +})); export default AddingPage; \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx b/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx index 3d506e7578..dfcc6b8ae5 100644 --- a/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx @@ -16,7 +16,6 @@ const routes = [ { path: '/adding-page/', component: AddingPage, - keepAlive: true }, // Functions { diff --git a/apps/spreadsheeteditor/mobile/src/view/add/AddingPage.jsx b/apps/spreadsheeteditor/mobile/src/view/add/AddingPage.jsx index f31e2f8811..c83d3ce284 100644 --- a/apps/spreadsheeteditor/mobile/src/view/add/AddingPage.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/add/AddingPage.jsx @@ -1,5 +1,6 @@ -import React, { useContext } from 'react'; +import React, { useContext, useEffect } from 'react'; import { Page, Navbar, NavTitle, NavRight, Link, Icon, Tabs, Tab, f7 } from 'framework7-react'; +import { observer, inject } from "mobx-react"; import { useTranslation } from 'react-i18next'; import { AddChartController } from "../../controller/add/AddChart"; import { AddFunctionController } from "../../controller/add/AddFunction"; @@ -43,15 +44,23 @@ const AddLayoutContent = ({ tabs }) => { ) }; -const AddingPage = () => { +const AddingPage = inject("storeApplicationSettings")(observer(props => { const { t } = useTranslation(); const _t = t('View.Add', {returnObjects: true}); const mainContext = useContext(MainContext); const addingContext = useContext(AddingContext); + const storeApplicationSettings = props.storeApplicationSettings; + const directionMode = storeApplicationSettings.directionMode; // const wsLock = mainContext.wsLock; const wsProps = mainContext.wsProps; const showPanels = addingContext.showPanels; const tabs = []; + + useEffect(() => { + if(directionMode === 'rtl') { + tabs.reverse(); + } + }, [directionMode]) if(!wsProps.Objects) { if(!showPanels) { @@ -125,6 +134,6 @@ const AddingPage = () => { ) -}; +})); export default AddingPage; \ No newline at end of file From 3973951711c35d3fa93defd74625bb6ef1ded12c Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Sat, 20 Apr 2024 16:35:52 +0300 Subject: [PATCH 015/163] [DE mobile] Fix Bug 65883 --- apps/common/mobile/resources/less/common-material.less | 10 ++++++++++ apps/common/mobile/resources/less/material/icons.less | 5 +++++ apps/documenteditor/mobile/src/view/DropdownList.jsx | 6 +++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/common/mobile/resources/less/common-material.less b/apps/common/mobile/resources/less/common-material.less index f1386fbc3a..c0dda2bc99 100644 --- a/apps/common/mobile/resources/less/common-material.less +++ b/apps/common/mobile/resources/less/common-material.less @@ -749,4 +749,14 @@ background-color: @brand-secondary; margin-left: 8px; } + + .dropdown-list { + .icon-radio { + display: none; + } + + input[type="radio"]:checked + .icon-radio { + display: inline-block; + } + } } diff --git a/apps/common/mobile/resources/less/material/icons.less b/apps/common/mobile/resources/less/material/icons.less index c513fc5b56..9bfe0a0823 100644 --- a/apps/common/mobile/resources/less/material/icons.less +++ b/apps/common/mobile/resources/less/material/icons.less @@ -36,6 +36,11 @@ height: 24px; .encoded-svg-mask('', @text-secondary); } + &.icon-radio { + width: 24px; + height: 24px; + .encoded-svg-mask('', @brandColor); + } } .navbar { i.icon { diff --git a/apps/documenteditor/mobile/src/view/DropdownList.jsx b/apps/documenteditor/mobile/src/view/DropdownList.jsx index 712c34bbc0..d1126f7aa2 100644 --- a/apps/documenteditor/mobile/src/view/DropdownList.jsx +++ b/apps/documenteditor/mobile/src/view/DropdownList.jsx @@ -106,15 +106,15 @@ const PageDropdownList = props => { {props.isComboBox ? <> - - + + {t('Edit.textChooseAnItem')} : null} {listItems.length && listItems.map((item, index) => ( - props.onChangeItemList(item.value)}> + props.onChangeItemList(item.value)}> ))} From efa1890e6cc4c1e36d2eac662677e98a835b2881 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 22 Apr 2024 17:06:14 +0300 Subject: [PATCH 016/163] FIx Bug 67601 --- apps/pdfeditor/main/app/view/FileMenuPanels.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index 9166051981..e7db50772b 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -2503,6 +2503,7 @@ define([ parentEl: $markup.findById('#print-prev-page'), cls: 'btn-prev-page', iconCls: 'arrow', + scaling: false, dataHint: '2', dataHintDirection: 'top' }); @@ -2511,6 +2512,7 @@ define([ parentEl: $markup.findById('#print-next-page'), cls: 'btn-next-page', iconCls: 'arrow', + scaling: false, dataHint: '2', dataHintDirection: 'top' }); From 6cb833bfd77c62057a95c96ede6572b1e8b31e0a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 22 Apr 2024 17:16:20 +0300 Subject: [PATCH 017/163] Fix Bug 64185 --- apps/common/main/lib/component/ColorButton.js | 4 ++-- apps/pdfeditor/main/app/view/Toolbar.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/common/main/lib/component/ColorButton.js b/apps/common/main/lib/component/ColorButton.js index 998a0d8ba6..a8bdc7e230 100644 --- a/apps/common/main/lib/component/ColorButton.js +++ b/apps/common/main/lib/component/ColorButton.js @@ -42,11 +42,11 @@ define([ render: function(parentEl) { Common.UI.Button.prototype.render.call(this, parentEl); - if (/huge/.test(this.options.cls) && this.options.split === true ) { + if (/huge/.test(this.options.cls) && this.options.split === true && !this.options.hideColorLine) { var btnEl = $('button', this.cmpEl), btnMenuEl = $(btnEl[1]); btnMenuEl && btnMenuEl.append( $('
')); - } else + } else if (!this.options.hideColorLine) $('button:first-child', this.cmpEl).append( $('
')); this.colorEl = this.cmpEl.find('.btn-color-value-line'); diff --git a/apps/pdfeditor/main/app/view/Toolbar.js b/apps/pdfeditor/main/app/view/Toolbar.js index 53ad7fa4d4..c64ce1c57c 100644 --- a/apps/pdfeditor/main/app/view/Toolbar.js +++ b/apps/pdfeditor/main/app/view/Toolbar.js @@ -818,10 +818,11 @@ define([ allowDepress: true, split: true, menu: true, + hideColorLine: true, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -16', - penOptions: {color: '000000'}, + penOptions: {color: 'D43230'}, type: AscPDF.ANNOTATIONS_TYPES.Strikeout }); @@ -834,10 +835,11 @@ define([ allowDepress: true, split: true, menu: true, + hideColorLine: true, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -16', - penOptions: {color: '000000'}, + penOptions: {color: '3D8A44'}, type: AscPDF.ANNOTATIONS_TYPES.Underline }); From 1e16c5c9c595d390181613d867ea58f4f920f62a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 22 Apr 2024 19:42:33 +0300 Subject: [PATCH 018/163] [DE][DE embed] Fix Bug 67561: open docxf/oform as pdf-form --- apps/api/documents/api.js | 11 +++++--- apps/documenteditor/embed/index.html | 3 +++ apps/documenteditor/embed/index.html.deploy | 3 +++ apps/documenteditor/embed/index_loader.html | 3 +++ .../embed/index_loader.html.deploy | 3 +++ .../embed/js/ApplicationController.js | 27 +++++++++++++++++-- apps/documenteditor/embed/locale/en.json | 2 ++ .../main/app/controller/Main.js | 4 +-- .../main/app/controller/Toolbar.js | 2 +- 9 files changed, 48 insertions(+), 10 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index c84bf703a6..842ac755be 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -1076,15 +1076,18 @@ if (config.frameEditorId) params += "&frameEditorId=" + config.frameEditorId; - var type = config.document ? /^(?:(pdf))$/.exec(config.document.fileType) : null; - if (!(type && typeof type[1] === 'string') && (config.editorConfig && config.editorConfig.mode == 'view' || + var type = config.document ? /^(?:(pdf)|(oform|docxf))$/.exec(config.document.fileType) : null, + isPdf = type && typeof type[1] === 'string', + oldForm = type && typeof type[2] === 'string'; + + if (!(isPdf || oldForm) && (config.editorConfig && config.editorConfig.mode == 'view' || config.document && config.document.permissions && (config.document.permissions.edit === false && !config.document.permissions.review ))) params += "&mode=view"; - if (type && typeof type[1] === 'string' && (config.document && config.document.permissions && config.document.permissions.edit === false || config.editorConfig && config.editorConfig.mode == 'view')) + if ((isPdf || oldForm) && (config.document && config.document.permissions && config.document.permissions.edit === false || config.editorConfig && config.editorConfig.mode == 'view')) params += "&mode=fillforms"; if (config.document) { - config.document.isForm = (type && typeof type[1] === 'string') ? config.document.isForm : false; + config.document.isForm = isPdf ? config.document.isForm : oldForm; (config.document.isForm===true || config.document.isForm===false) && (params += "&isForm=" + config.document.isForm); } diff --git a/apps/documenteditor/embed/index.html b/apps/documenteditor/embed/index.html index 8325c4c732..edaeadc6cd 100644 --- a/apps/documenteditor/embed/index.html +++ b/apps/documenteditor/embed/index.html @@ -251,6 +251,9 @@