From 04bcfca0f0fd0f4c02d4b5d06d8a1b7d4b9a8668 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 15 Apr 2024 22:41:32 +0300 Subject: [PATCH 01/14] Bug 67442: open right pane --- .../main/app/controller/RightMenu.js | 8 ++++++++ apps/documenteditor/main/app/controller/Toolbar.js | 8 ++++++++ apps/documenteditor/main/app/view/Toolbar.js | 6 ++++-- apps/documenteditor/main/locale/en.json | 1 + .../main/app/controller/RightMenu.js | 8 ++++++++ .../main/app/controller/Toolbar.js | 8 ++++++++ apps/presentationeditor/main/app/view/Toolbar.js | 6 ++++-- apps/presentationeditor/main/locale/en.json | 1 + .../main/app/controller/RightMenu.js | 8 ++++++++ .../main/app/controller/Toolbar.js | 8 +++++++- apps/spreadsheeteditor/main/app/view/Toolbar.js | 14 +++++++++++--- apps/spreadsheeteditor/main/locale/en.json | 2 ++ .../main/resources/less/toolbar.less | 4 ++-- 13 files changed, 72 insertions(+), 10 deletions(-) diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 3c4f664644..2638ede9d5 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -565,6 +565,14 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.rightmenu); }, + onRightMenuOpen: function(type) { + if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; + + this.rightmenu.SetActivePane(type, true); + this._settings[type].panel.ChangeSettings.call(this._settings[type].panel); + this.rightmenu.updateScroller(); + }, + addNewPlugin: function (button, $button, $panel) { this.rightmenu.insertButton(button, $button); this.rightmenu.insertPanel($panel); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 2006cf62f1..2d576f1434 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -369,6 +369,7 @@ define([ toolbar.mnuHighlightColorPicker.on('select', _.bind(this.onSelectHighlightColor, this)); toolbar.mnuHighlightTransparent.on('click', _.bind(this.onHighlightTransparentClick, this)); toolbar.mnuLineSpace.on('item:toggle', _.bind(this.onLineSpaceToggle, this)); + toolbar.mnuLineSpace.on('item:click', _.bind(this.onLineSpaceClick, this)); toolbar.mnuNonPrinting.on('item:toggle', _.bind(this.onMenuNonPrintingToggle, this)); toolbar.btnShowHidenChars.on('toggle', _.bind(this.onNonPrintingToggle, this)); toolbar.mnuTablePicker.on('select', _.bind(this.onTablePickerSelect, this)); @@ -1645,6 +1646,13 @@ define([ } }, + onLineSpaceClick: function(menu, item) { + if (item.value==='options') { + this.getApplication().getController('RightMenu').onRightMenuOpen(Common.Utils.documentSettingsType.Paragraph); + Common.NotificationCenter.trigger('edit:complete', this.toolbar); + } + }, + onMenuNonPrintingToggle: function(menu, item, state, e) { var me = this; if (item.value === 'characters') { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index d325611c57..d6d01f8832 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -540,7 +540,8 @@ define([ {caption: '1.5', value: 1.5, checkable: true, toggleGroup: 'linesize'}, {caption: '2.0', value: 2.0, checkable: true, toggleGroup: 'linesize'}, {caption: '2.5', value: 2.5, checkable: true, toggleGroup: 'linesize'}, - {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'} + {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'}, + {caption: this.textLineSpaceOptions, value: 'options'} ] }), dataHint: '1', @@ -3573,7 +3574,8 @@ define([ capBtnSelect: 'Select', capBtnHand: 'Hand', tipSelectTool: 'Select tool', - tipHandTool: 'Hand tool' + tipHandTool: 'Hand tool', + textLineSpaceOptions: 'Line spacing options' } })(), DE.Views.Toolbar || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 566a34bd90..ac8a5963be 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -3494,6 +3494,7 @@ "DE.Views.Toolbar.txtScheme7": "Equity", "DE.Views.Toolbar.txtScheme8": "Flow", "DE.Views.Toolbar.txtScheme9": "Foundry", + "DE.Views.Toolbar.textLineSpaceOptions": "Line spacing options", "DE.Views.ViewTab.textAlwaysShowToolbar": "Always Show Toolbar", "DE.Views.ViewTab.textDarkDocument": "Dark Document", "DE.Views.ViewTab.textFitToPage": "Fit To Page", diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index 3863242fb1..a86c274e7c 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -449,6 +449,14 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.rightmenu); }, + onRightMenuOpen: function(type) { + if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; + + this.rightmenu.SetActivePane(type, true); + this._settings[type].panel.ChangeSettings.call(this._settings[type].panel); + this.rightmenu.updateScroller(); + }, + addNewPlugin: function (button, $button, $panel) { this.rightmenu.insertButton(button, $button); this.rightmenu.insertPanel($panel); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index f956d3ac66..081278f8e3 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -353,6 +353,7 @@ define([ toolbar.mnuHighlightColorPicker.on('select', _.bind(this.onSelectHighlightColor, this)); toolbar.mnuHighlightTransparent.on('click', _.bind(this.onHighlightTransparentClick, this)); toolbar.btnLineSpace.menu.on('item:toggle', _.bind(this.onLineSpaceToggle, this)); + toolbar.btnLineSpace.menu.on('item:click', _.bind(this.onLineSpaceClick, this)); toolbar.btnColumns.menu.on('item:click', _.bind(this.onColumnsSelect, this)); toolbar.btnColumns.menu.on('show:before', _.bind(this.onBeforeColumns, this)); toolbar.btnShapeAlign.menu.on('item:click', _.bind(this.onShapeAlign, this)); @@ -1571,6 +1572,13 @@ define([ } }, + onLineSpaceClick: function(menu, item) { + if (item.value==='options') { + this.getApplication().getController('RightMenu').onRightMenuOpen(Common.Utils.documentSettingsType.Paragraph); + Common.NotificationCenter.trigger('edit:complete', this.toolbar); + } + }, + onColumnsSelect: function(menu, item) { if (_.isUndefined(item.value)) return; diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 27622a0c50..58b6486712 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -695,7 +695,8 @@ define([ {caption: '1.5', value: 1.5, checkable: true, toggleGroup: 'linesize'}, {caption: '2.0', value: 2.0, checkable: true, toggleGroup: 'linesize'}, {caption: '2.5', value: 2.5, checkable: true, toggleGroup: 'linesize'}, - {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'} + {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'}, + {caption: this.textLineSpaceOptions, value: 'options'} ] }), dataHint: '1', @@ -2391,7 +2392,8 @@ define([ textYen: 'Yen Sign', capBtnInsHeaderFooter: 'Header & Footer', tipEditHeaderFooter: 'Edit header or footer', - tipReplace: 'Replace' + tipReplace: 'Replace', + textLineSpaceOptions: 'Line spacing options' } }()), PE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index b796d5766b..c4ad331144 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -2732,6 +2732,7 @@ "PE.Views.Toolbar.txtScheme9": "Foundry", "PE.Views.Toolbar.txtSlideAlign": "Align to Slide", "PE.Views.Toolbar.txtUngroup": "Ungroup", + "PE.Views.Toolbar.textLineSpaceOptions": "Line spacing options", "PE.Views.Transitions.strDelay": "Delay", "PE.Views.Transitions.strDuration": "Duration", "PE.Views.Transitions.strStartOnClick": "Start On Click", diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 050bd5e463..60092ca47c 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -530,6 +530,14 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.rightmenu); }, + onRightMenuOpen: function(type) { + if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; + + this.rightmenu.SetActivePane(type, true); + this._settings[type].panel.ChangeSettings.call(this._settings[type].panel); + this.rightmenu.updateScroller(); + }, + addNewPlugin: function (button, $button, $panel) { this.rightmenu.insertButton(button, $button); this.rightmenu.insertPanel($panel); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index ffaab4c261..80975c6a17 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -856,7 +856,8 @@ define([ Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.component.Analytics.trackEvent('ToolBar', 'Borders'); - } + } else if (item.value==='options') + this.getApplication().getController('RightMenu').onRightMenuOpen(Common.Utils.documentSettingsType.Cell); }, onBordersWidth: function(menu, item, state) { @@ -964,6 +965,11 @@ define([ onTextOrientationMenu: function(menu, item) { var angle = 0; + if (item.value==='options') { + this.getApplication().getController('RightMenu').onRightMenuOpen(Common.Utils.documentSettingsType.Cell); + return; + } + switch (item.value) { case 'countcw': angle = 45; break; case 'clockwise': angle = -45; break; diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 2fcf3e8160..90f53d0c44 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1162,6 +1162,7 @@ define([ iconCls : 'toolbar__icon btn-text-orient-ccw', lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set.coAuthText, _set.wsLockFormat, _set.userProtected], menu : new Common.UI.Menu({ + cls: 'shifted-right', items: [ { caption : me.textHorizontal, @@ -1210,7 +1211,9 @@ define([ checkmark : false, toggleGroup : 'textorientgroup', value : 'rotatedown' - } + }, + {caption: '--'}, + {caption: this.textCellAlign, value: 'options'} ] }), dataHint : '1', @@ -2530,6 +2533,7 @@ define([ // set menus if (this.btnBorders && this.btnBorders.rendered) { this.btnBorders.setMenu( new Common.UI.Menu({ + cls: 'shifted-right', items: [ { caption : this.textOutBorders, @@ -2661,7 +2665,9 @@ define([ ] }) }) - ] + ].concat(this.mode.isEditOle ? [] : [ + {caption: this.textMoreBorders, value: 'options'} + ]) })); this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({ el: $('#id-toolbar-menu-bordercolor'), @@ -3766,7 +3772,9 @@ define([ textFillRight: 'Right', textSeries: 'Series', txtFillNum: 'Fill', - tipReplace: 'Replace' + tipReplace: 'Replace', + textCellAlign: 'Format cell alignment', + textMoreBorders: 'More borders' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index f94b39346a..c331e69305 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -4278,6 +4278,8 @@ "SSE.Views.Toolbar.txtTime": "Time", "SSE.Views.Toolbar.txtUnmerge": "Unmerge cells", "SSE.Views.Toolbar.txtYen": "¥ Yen", + "SSE.Views.Toolbar.textCellAlign": "Format cell alignment", + "SSE.Views.Toolbar.textMoreBorders": "More borders", "SSE.Views.Top10FilterDialog.textType": "Show", "SSE.Views.Top10FilterDialog.txtBottom": "Bottom", "SSE.Views.Top10FilterDialog.txtBy": "by", diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index 60c6950ae3..8c1d1c7e66 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -252,13 +252,13 @@ background-image: none; width: 12px; height: 12px; - margin: 2px 9px 0 -11px; + margin: 2px 8px 0 -20px; border-style: solid; border-width: 3px; border-color: #000; .rtl & { - margin: 2px -11px 0 9px; + margin: 2px -20px 0 8px; } } } From f2d3a65c8686c1cd86c81eeb74ac14e399b2c800 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 16 Apr 2024 18:33:02 +0300 Subject: [PATCH 02/14] Fix settings in the right pane --- apps/documenteditor/main/app/controller/RightMenu.js | 2 +- apps/presentationeditor/main/app/controller/RightMenu.js | 2 +- apps/spreadsheeteditor/main/app/controller/RightMenu.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 2638ede9d5..531c7c82b8 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -569,7 +569,7 @@ define([ if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; this.rightmenu.SetActivePane(type, true); - this._settings[type].panel.ChangeSettings.call(this._settings[type].panel); + this._settings[type].panel.ChangeSettings.call(this._settings[type].panel, this._settings[type].props); this.rightmenu.updateScroller(); }, diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index a86c274e7c..3802cc3a05 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -453,7 +453,7 @@ define([ if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; this.rightmenu.SetActivePane(type, true); - this._settings[type].panel.ChangeSettings.call(this._settings[type].panel); + this._settings[type].panel.ChangeSettings.call(this._settings[type].panel, this._settings[type].props); this.rightmenu.updateScroller(); }, diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 60092ca47c..45e78468b9 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -534,7 +534,7 @@ define([ if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; this.rightmenu.SetActivePane(type, true); - this._settings[type].panel.ChangeSettings.call(this._settings[type].panel); + this._settings[type].panel.ChangeSettings.call(this._settings[type].panel, this._settings[type].props); this.rightmenu.updateScroller(); }, From 49d3b64408fedd8fa4ae7bcee285a42113109e6a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 16 Apr 2024 19:24:06 +0300 Subject: [PATCH 03/14] [DE] Fix open right menu --- apps/documenteditor/main/app/controller/RightMenu.js | 8 ++++++++ apps/documenteditor/main/app/controller/ViewTab.js | 5 +++++ apps/documenteditor/main/app/view/RightMenu.js | 1 + 3 files changed, 14 insertions(+) diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 531c7c82b8..ed8a8afd3b 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -560,6 +560,8 @@ define([ !status && Common.NotificationCenter.trigger('forms:close-help', 'key'); !status && Common.NotificationCenter.trigger('forms:close-help', 'group-key'); !status && Common.NotificationCenter.trigger('forms:close-help', 'settings'); + + !view && this.rightmenu.fireEvent('view:hide', [this, !status]); } Common.NotificationCenter.trigger('layout:changed', 'main'); Common.NotificationCenter.trigger('edit:complete', this.rightmenu); @@ -568,11 +570,17 @@ define([ onRightMenuOpen: function(type) { if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; + this.tryToShowRightMenu(); this.rightmenu.SetActivePane(type, true); this._settings[type].panel.ChangeSettings.call(this._settings[type].panel, this._settings[type].props); this.rightmenu.updateScroller(); }, + tryToShowRightMenu: function() { + if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) + this.onRightMenuHide(null, true); + }, + addNewPlugin: function (button, $button, $panel) { this.rightmenu.insertButton(button, $button); this.rightmenu.insertPanel($panel); diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index 8ae0c3be15..623eae7f55 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -102,6 +102,11 @@ define([ 'view:hide': _.bind(function (leftmenu, state) { this.view.chLeftMenu.setValue(!state, true); }, this) + }, + 'RightMenu': { + 'view:hide': _.bind(function (leftmenu, state) { + this.view.chRightMenu.setValue(!state, true); + }, this) } }); }, diff --git a/apps/documenteditor/main/app/view/RightMenu.js b/apps/documenteditor/main/app/view/RightMenu.js index b76d1f4d75..cfc6fba0ec 100644 --- a/apps/documenteditor/main/app/view/RightMenu.js +++ b/apps/documenteditor/main/app/view/RightMenu.js @@ -281,6 +281,7 @@ define([ }, setMode: function(mode) { + this.mode = mode; this.mergeSettings && this.mergeSettings.setMode(mode); this.imageSettings && this.imageSettings.setMode(mode); this.shapeSettings && this.shapeSettings.setMode(mode); From d2fad484d10bc28cece5bd36496db65bd2a53e3b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 16 Apr 2024 19:40:10 +0300 Subject: [PATCH 04/14] [PE][SSE] Fix open right pane --- apps/documenteditor/main/app/controller/RightMenu.js | 2 +- apps/presentationeditor/main/app/controller/RightMenu.js | 7 +++++++ apps/presentationeditor/main/app/controller/ViewTab.js | 5 +++++ apps/presentationeditor/main/app/view/RightMenu.js | 1 + apps/spreadsheeteditor/main/app/controller/RightMenu.js | 7 +++++++ apps/spreadsheeteditor/main/app/controller/ViewTab.js | 5 +++++ 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index ed8a8afd3b..af0d09a3ad 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -577,7 +577,7 @@ define([ }, tryToShowRightMenu: function() { - if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) + if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.rightmenu.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) this.onRightMenuHide(null, true); }, diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index 3802cc3a05..cbd8e7a77a 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -441,6 +441,7 @@ define([ this.onFocusObject(selectedElements, false, !Common.Utils.InternalSettings.get("pe-hide-right-settings")); this._lastVisibleSettings = undefined; } + !view && this.rightmenu.fireEvent('view:hide', [this, !status]); Common.localStorage.setBool('pe-hidden-rightmenu', !status); Common.Utils.InternalSettings.set("pe-hidden-rightmenu", !status); } @@ -452,11 +453,17 @@ define([ onRightMenuOpen: function(type) { if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; + this.tryToShowRightMenu(); this.rightmenu.SetActivePane(type, true); this._settings[type].panel.ChangeSettings.call(this._settings[type].panel, this._settings[type].props); this.rightmenu.updateScroller(); }, + tryToShowRightMenu: function() { + if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.rightmenu.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) + this.onRightMenuHide(null, true); + }, + addNewPlugin: function (button, $button, $panel) { this.rightmenu.insertButton(button, $button); this.rightmenu.insertPanel($panel); diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 66b7cde4c1..cd3a27d4de 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -135,6 +135,11 @@ define([ 'view:hide': _.bind(function (leftmenu, state) { this.view.chLeftMenu.setValue(!state, true); }, this) + }, + 'RightMenu': { + 'view:hide': _.bind(function (leftmenu, state) { + this.view.chRightMenu.setValue(!state, true); + }, this) } }); }, diff --git a/apps/presentationeditor/main/app/view/RightMenu.js b/apps/presentationeditor/main/app/view/RightMenu.js index 9b04ac9963..4d171a8a18 100644 --- a/apps/presentationeditor/main/app/view/RightMenu.js +++ b/apps/presentationeditor/main/app/view/RightMenu.js @@ -244,6 +244,7 @@ define([ }, setMode: function(mode) { + this.mode = mode; this.imageSettings && this.imageSettings.setMode(mode); this.shapeSettings && this.shapeSettings.setMode(mode); this.slideSettings && this.slideSettings.setMode(mode); diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 45e78468b9..abd0810c3f 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -523,6 +523,7 @@ define([ this.onSelectionChanged(this.api.asc_getCellInfo()); this._lastVisibleSettings = undefined; } + !view && this.rightmenu.fireEvent('view:hide', [this, !status]); Common.localStorage.setBool('sse-hidden-rightmenu', !status); } @@ -533,11 +534,17 @@ define([ onRightMenuOpen: function(type) { if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; + this.tryToShowRightMenu(); this.rightmenu.SetActivePane(type, true); this._settings[type].panel.ChangeSettings.call(this._settings[type].panel, this._settings[type].props); this.rightmenu.updateScroller(); }, + tryToShowRightMenu: function() { + if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.rightmenu.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) + this.onRightMenuHide(null, true); + }, + addNewPlugin: function (button, $button, $panel) { this.rightmenu.insertButton(button, $button); this.rightmenu.insertPanel($panel); diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index f396597fe4..71b6c670ae 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -117,6 +117,11 @@ define([ 'view:hide': _.bind(function (leftmenu, state) { this.view.chLeftMenu.setValue(!state, true); }, this) + }, + 'RightMenu': { + 'view:hide': _.bind(function (leftmenu, state) { + this.view.chRightMenu.setValue(!state, true); + }, this) } }); Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this)); From b11f37d4b87a13673dff36789d5c0a1ac4794df0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 16 Apr 2024 20:41:05 +0300 Subject: [PATCH 05/14] Fix opening right pane --- apps/documenteditor/main/app/view/Toolbar.js | 5 +++-- apps/presentationeditor/main/app/view/Toolbar.js | 5 +++-- apps/spreadsheeteditor/main/app/view/Toolbar.js | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index d6d01f8832..25e780ef8f 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -540,9 +540,10 @@ define([ {caption: '1.5', value: 1.5, checkable: true, toggleGroup: 'linesize'}, {caption: '2.0', value: 2.0, checkable: true, toggleGroup: 'linesize'}, {caption: '2.5', value: 2.5, checkable: true, toggleGroup: 'linesize'}, - {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'}, + {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'} + ].concat(config.canBrandingExt && config.customization && config.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [ {caption: this.textLineSpaceOptions, value: 'options'} - ] + ]) }), dataHint: '1', dataHintDirection: 'top', diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 58b6486712..5270eb5595 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -695,9 +695,10 @@ define([ {caption: '1.5', value: 1.5, checkable: true, toggleGroup: 'linesize'}, {caption: '2.0', value: 2.0, checkable: true, toggleGroup: 'linesize'}, {caption: '2.5', value: 2.5, checkable: true, toggleGroup: 'linesize'}, - {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'}, + {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'} + ].concat(config.canBrandingExt && config.customization && config.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [ {caption: this.textLineSpaceOptions, value: 'options'} - ] + ]) }), dataHint: '1', dataHintDirection: 'bottom', diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 90f53d0c44..ab3203b9ec 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1211,10 +1211,11 @@ define([ checkmark : false, toggleGroup : 'textorientgroup', value : 'rotatedown' - }, + } + ].concat(config.canBrandingExt && config.customization && config.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [ {caption: '--'}, {caption: this.textCellAlign, value: 'options'} - ] + ]) }), dataHint : '1', dataHintDirection: 'top' @@ -2665,7 +2666,7 @@ define([ ] }) }) - ].concat(this.mode.isEditOle ? [] : [ + ].concat(this.mode.isEditOle || this.mode.canBrandingExt && this.mode.customization && this.mode.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [ {caption: this.textMoreBorders, value: 'options'} ]) })); From cf01535c93304158b580cab8bd216941dac98cf1 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 16 Apr 2024 21:19:30 +0300 Subject: [PATCH 06/14] [SSE] Open right pane from fill button --- apps/common/main/lib/component/ColorButton.js | 8 ++++---- apps/documenteditor/main/app/view/FormSettings.js | 2 +- apps/documenteditor/main/app/view/FormsTab.js | 2 +- apps/documenteditor/main/app/view/ListSettingsDialog.js | 2 +- apps/documenteditor/main/app/view/RoleEditDlg.js | 2 +- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 5 +++++ .../spreadsheeteditor/main/app/view/FormatRulesEditDlg.js | 2 +- apps/spreadsheeteditor/main/app/view/Toolbar.js | 7 ++++++- 8 files changed, 20 insertions(+), 10 deletions(-) diff --git a/apps/common/main/lib/component/ColorButton.js b/apps/common/main/lib/component/ColorButton.js index e79dba52b0..51aca2d68f 100644 --- a/apps/common/main/lib/component/ColorButton.js +++ b/apps/common/main/lib/component/ColorButton.js @@ -119,7 +119,7 @@ define([ id: id, cls: 'color-menu ' + (options.eyeDropper ? 'shifted-right' : 'shifted-left'), additionalAlign: options.additionalAlign, - items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([ + items: (options.additionalItemsBefore ? options.additionalItemsBefore : []).concat(auto).concat([ { template: _.template('
') }, {caption: '--'} ]).concat(eyedropper).concat([ @@ -127,14 +127,14 @@ define([ id: id + '-color-new', template: _.template('' + this.textNewColor + '') } - ]) + ]).concat(options.additionalItemsAfter ? options.additionalItemsAfter : []) }); this.initInnerMenu(); var me = this; menu.on('show:after', function(menu) { me.colorPicker && _.delay(function() { me.colorPicker.showLastSelected(); - !(options.additionalItems || options.auto) && me.colorPicker.focus(); + !(options.additionalItemsBefore || options.auto) && me.colorPicker.focus(); }, 10); }); return menu; @@ -145,7 +145,7 @@ define([ initInnerMenu: function() { if (!this.colorPicker || typeof this.menu !== 'object') return; - var index = (this.options.additionalItems || []).length + (this.options.auto ? 2 : 0); + var index = (this.options.additionalItemsBefore || []).length + (this.options.auto ? 2 : 0); this.colorPicker.outerMenu = {menu: this.menu, index: index}; this.menu.setInnerMenu([{menu: this.colorPicker, index: index}]); }, diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 3f5f5183d6..730a43535e 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -1723,7 +1723,7 @@ define([ if (!this.btnColor) { this.btnColor = new Common.UI.ColorButton({ parentEl: (this.$el || $(this.el)).findById('#form-color-btn'), - additionalItems: [ + additionalItemsBefore: [ this.mnuNoBorder = new Common.UI.MenuItem({ style: Common.UI.isRTL() ? 'padding-right:20px;' : 'padding-left:20px;', caption: this.textNoBorder, diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index d99e5476de..cd7c8cce77 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -503,7 +503,7 @@ define([ // lock: [ _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart], // caption : this.textHighlight, // menu : true, - // additionalItems: [ this.mnuNoFormsColor = new Common.UI.MenuItem({ + // additionalItemsBefore: [ this.mnuNoFormsColor = new Common.UI.MenuItem({ // id: 'id-toolbar-menu-no-highlight-form', // caption: this.textNoHighlight, // checkable: true, diff --git a/apps/documenteditor/main/app/view/ListSettingsDialog.js b/apps/documenteditor/main/app/view/ListSettingsDialog.js index 7972fb5677..ea686c4010 100644 --- a/apps/documenteditor/main/app/view/ListSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ListSettingsDialog.js @@ -301,7 +301,7 @@ define([ hint : this.txtColor, menu: true, takeFocusOnClose: true, - additionalItems: [{ + additionalItemsBefore: [{ id: 'id-dlg-bullet-text-color', caption: this.txtLikeText, checkable: true, diff --git a/apps/documenteditor/main/app/view/RoleEditDlg.js b/apps/documenteditor/main/app/view/RoleEditDlg.js index 6ce04c6fab..57029a3826 100644 --- a/apps/documenteditor/main/app/view/RoleEditDlg.js +++ b/apps/documenteditor/main/app/view/RoleEditDlg.js @@ -104,7 +104,7 @@ define([ this.btnColor = new Common.UI.ColorButton({ parentEl: $window.find('#id-dlg-role-color'), - additionalItems: [ this.mnuNoFormsColor = new Common.UI.MenuItem({ + additionalItemsBefore: [ this.mnuNoFormsColor = new Common.UI.MenuItem({ id: 'id-dlg-role-menu-no-highlight', caption: this.textNoHighlight, checkable: true, diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 80975c6a17..c385714933 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -404,6 +404,7 @@ define([ toolbar.btnBackColor.on('color:select', _.bind(this.onBackColorSelect, this)); toolbar.btnBackColor.on('eyedropper:start', _.bind(this.onEyedropperStart, this)); toolbar.btnBackColor.on('eyedropper:end', _.bind(this.onEyedropperEnd, this)); + toolbar.mnuFormatCellFill && toolbar.mnuFormatCellFill.on('click', _.bind(this.onFormatCellFill, this)); this.mode.isEdit && Common.NotificationCenter.on('eyedropper:start', _.bind(this.eyedropperStart, this)); toolbar.btnBorders.on('click', _.bind(this.onBorders, this)); if (toolbar.btnBorders.rendered) { @@ -781,6 +782,10 @@ define([ Common.component.Analytics.trackEvent('ToolBar', 'Background Color'); }, + onFormatCellFill: function(picker, color) { + this.getApplication().getController('RightMenu').onRightMenuOpen(Common.Utils.documentSettingsType.Cell); + }, + onNewBorderColor: function(picker, color) { this.toolbar.btnBorders.menu.hide(); this.toolbar.btnBorders.toggle(false, true); diff --git a/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js b/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js index 3c8e7abe94..d5179e0b20 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js @@ -664,7 +664,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template', var combo = new Common.UI.ComboBoxDataView({ el: $('#format-rules-combo-icon-' + (i+1)), additionalAlign: this.menuAddAlign, - additionalItems: [{ caption: this.txtNoCellIcon, checkable: true, allowDepress: false, toggleGroup: 'no-cell-icons-' + (i+1) }], + additionalItemsBefore: [{ caption: this.txtNoCellIcon, checkable: true, allowDepress: false, toggleGroup: 'no-cell-icons-' + (i+1) }], cls: 'move-focus', menuStyle: 'min-width: 105px;', dataViewStyle: 'width: 217px; margin: 0 5px;', diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index ab3203b9ec..e12def3c4c 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1011,6 +1011,10 @@ define([ transparent: true, menu: true, eyeDropper: true, + additionalItemsAfter: config.canBrandingExt && config.customization && config.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [ + me.mnuFormatCellFill = new Common.UI.MenuItem({ + caption: me.textFormatCellFill + })], dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: '0, -16' @@ -3775,7 +3779,8 @@ define([ txtFillNum: 'Fill', tipReplace: 'Replace', textCellAlign: 'Format cell alignment', - textMoreBorders: 'More borders' + textMoreBorders: 'More borders', + textFormatCellFill: 'Format cell fill' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file From 9dd423ceed05a734dfccedb844510e52c299933a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Apr 2024 17:30:31 +0300 Subject: [PATCH 07/14] [DE] Add/remove spacing from toolbar --- .../main/app/controller/Toolbar.js | 26 ++++++++++++++++++- apps/documenteditor/main/app/view/Toolbar.js | 12 +++++++-- apps/documenteditor/main/locale/en.json | 4 +++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 2d576f1434..5a0370aa9a 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -104,6 +104,7 @@ define([ type_fontsize: undefined, in_equation: false, in_chart: false, + in_para: undefined, linenum_apply: Asc.c_oAscSectionApplyType.All, suppress_num: undefined }; @@ -370,11 +371,12 @@ define([ toolbar.mnuHighlightTransparent.on('click', _.bind(this.onHighlightTransparentClick, this)); toolbar.mnuLineSpace.on('item:toggle', _.bind(this.onLineSpaceToggle, this)); toolbar.mnuLineSpace.on('item:click', _.bind(this.onLineSpaceClick, this)); + toolbar.mnuLineSpace.on('show:after', _.bind(this.onLineSpaceShow, this)); toolbar.mnuNonPrinting.on('item:toggle', _.bind(this.onMenuNonPrintingToggle, this)); toolbar.btnShowHidenChars.on('toggle', _.bind(this.onNonPrintingToggle, this)); toolbar.mnuTablePicker.on('select', _.bind(this.onTablePickerSelect, this)); toolbar.mnuInsertTable.on('item:click', _.bind(this.onInsertTableClick, this)); - toolbar.mnuInsertTable.on('show:after', _.bind(this.onInsertTableShow, this)); + toolbar.mnuInsertTable.on('show:after', _.bind(this.onInsertTableShow, this)); toolbar.mnuInsertImage.on('item:click', _.bind(this.onInsertImageClick, this)); toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this)); toolbar.btnInsertText.menu.on('item:click', _.bind(this.onMenuInsertTextClick, this)); @@ -902,6 +904,11 @@ define([ this.toolbar.lockToolbar(Common.enumLock.inImage, in_image, {array: [toolbar.btnColumns]}); this.toolbar.lockToolbar(Common.enumLock.inImagePara, in_image && in_para, {array: [toolbar.btnLineNumbers]}); + if (in_para !== this._state.in_para) { + toolbar.mnuLineSpaceOptions && toolbar.mnuLineSpaceOptions.setVisible(in_para); + this._state.in_para = in_para; + } + if (toolbar.listStylesAdditionalMenuItem && (frame_pr===undefined) !== toolbar.listStylesAdditionalMenuItem.isDisabled()) toolbar.listStylesAdditionalMenuItem.setDisabled(frame_pr===undefined); @@ -1650,6 +1657,23 @@ define([ if (item.value==='options') { this.getApplication().getController('RightMenu').onRightMenuOpen(Common.Utils.documentSettingsType.Paragraph); Common.NotificationCenter.trigger('edit:complete', this.toolbar); + } else if (item.value==='before') { + item.options.action === 'add' ? this.api.asc_addSpaceBeforeParagraph() : this.api.asc_removeSpaceBeforeParagraph(); + } else if (item.value==='after') { + item.options.action === 'add' ? this.api.asc_addSpaceAfterParagraph() : this.api.asc_removeSpaceAfterParagraph(); + } + }, + + onLineSpaceShow: function(menu) { + if (this.api) { + var toolbar = this.toolbar, + before = this.api.asc_haveSpaceBeforeParagraph(), + after = this.api.asc_haveSpaceAfterParagraph(); + toolbar.mnuLineSpaceBefore.setCaption(before ? toolbar.textRemSpaceBefore : toolbar.textAddSpaceBefore); + toolbar.mnuLineSpaceBefore.options.action = before ? 'remove' : 'add'; + toolbar.mnuLineSpaceAfter.setCaption(after ? toolbar.textRemSpaceAfter : toolbar.textAddSpaceAfter); + toolbar.mnuLineSpaceAfter.options.action = after ? 'remove' : 'add'; + } }, diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 25e780ef8f..8aa755adff 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -542,7 +542,11 @@ define([ {caption: '2.5', value: 2.5, checkable: true, toggleGroup: 'linesize'}, {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'} ].concat(config.canBrandingExt && config.customization && config.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [ - {caption: this.textLineSpaceOptions, value: 'options'} + me.mnuLineSpaceOptions = new Common.UI.MenuItem({caption: this.textLineSpaceOptions, value: 'options'}) + ]).concat([ + {caption: '--'}, + me.mnuLineSpaceBefore = new Common.UI.MenuItem({caption: this.textAddSpaceBefore, value: 'before', action: 'add'}), + me.mnuLineSpaceAfter = new Common.UI.MenuItem({caption: this.textAddSpaceAfter, value: 'after', action: 'add'}) ]) }), dataHint: '1', @@ -3576,7 +3580,11 @@ define([ capBtnHand: 'Hand', tipSelectTool: 'Select tool', tipHandTool: 'Hand tool', - textLineSpaceOptions: 'Line spacing options' + textLineSpaceOptions: 'Line spacing options', + textAddSpaceBefore: 'Add space before paragraph', + textAddSpaceAfter: 'Add space after paragraph', + textRemSpaceBefore: 'Remove space before paragraph', + textRemSpaceAfter: 'Remove space after paragraph' } })(), DE.Views.Toolbar || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index ac8a5963be..64d7b4fff8 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -3495,6 +3495,10 @@ "DE.Views.Toolbar.txtScheme8": "Flow", "DE.Views.Toolbar.txtScheme9": "Foundry", "DE.Views.Toolbar.textLineSpaceOptions": "Line spacing options", + "DE.Views.Toolbar.textAddSpaceBefore": "Add space before paragraph", + "DE.Views.Toolbar.textAddSpaceAfter": "Add space after paragraph", + "DE.Views.Toolbar.textRemSpaceBefore": "Remove space before paragraph", + "DE.Views.Toolbar.textRemSpaceAfter": "Remove space after paragraph", "DE.Views.ViewTab.textAlwaysShowToolbar": "Always Show Toolbar", "DE.Views.ViewTab.textDarkDocument": "Dark Document", "DE.Views.ViewTab.textFitToPage": "Fit To Page", From 95978589f295a4d91d4d2505607e267dd72a9e88 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Apr 2024 17:39:05 +0300 Subject: [PATCH 08/14] [PE] Fix line spacing options --- apps/presentationeditor/main/app/controller/Toolbar.js | 10 +++++++++- apps/presentationeditor/main/app/view/Toolbar.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 081278f8e3..cf9c206e06 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -112,7 +112,8 @@ define([ clrhighlight: undefined, can_copycut: undefined, needCallApiBullets: undefined, - isLockedSlideHeaderAppyToAll: false + isLockedSlideHeaderAppyToAll: false, + in_para: undefined }; this._isAddingShape = false; this.slideSizeArr = [ @@ -810,6 +811,7 @@ define([ no_drawing_objects = this.api.asc_getSelectedDrawingObjectsCount()<1, in_equation = false, in_chart = false, + in_para = false, layout_index = -1, no_columns = false, in_smartart = false, @@ -822,6 +824,7 @@ define([ paragraph_locked = pr.get_Locked(); no_paragraph = false; no_text = false; + in_para = true; } else if (type == Asc.c_oAscTypeSelectElement.Slide) { slide_deleted = pr.get_LockDelete(); slide_layout_lock = pr.get_LockLayout(); @@ -865,6 +868,11 @@ define([ this._state.in_chart = in_chart; } + if (in_para !== this._state.in_para) { + this.toolbar.mnuLineSpaceOptions && this.toolbar.mnuLineSpaceOptions.setVisible(in_para); + this._state.in_para = in_para; + } + if (this._state.prcontrolsdisable !== paragraph_locked) { if (this._state.activated) this._state.prcontrolsdisable = paragraph_locked; if (paragraph_locked!==undefined) diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 5270eb5595..e8bb575604 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -697,7 +697,7 @@ define([ {caption: '2.5', value: 2.5, checkable: true, toggleGroup: 'linesize'}, {caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'} ].concat(config.canBrandingExt && config.customization && config.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [ - {caption: this.textLineSpaceOptions, value: 'options'} + me.mnuLineSpaceOptions = new Common.UI.MenuItem({caption: me.textLineSpaceOptions, value: 'options'}) ]) }), dataHint: '1', From 5a7782ad63353814a020108baffc4381173b40a6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Apr 2024 18:14:05 +0300 Subject: [PATCH 09/14] Add translation --- apps/spreadsheeteditor/main/locale/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index c331e69305..ed9876f35e 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -4280,6 +4280,7 @@ "SSE.Views.Toolbar.txtYen": "¥ Yen", "SSE.Views.Toolbar.textCellAlign": "Format cell alignment", "SSE.Views.Toolbar.textMoreBorders": "More borders", + "SSE.Views.Toolbar.textFormatCellFill": "Format cell fill", "SSE.Views.Top10FilterDialog.textType": "Show", "SSE.Views.Top10FilterDialog.txtBottom": "Bottom", "SSE.Views.Top10FilterDialog.txtBy": "by", From 1b7823de69ecfd21daa60ee96afe8aeb220d2108 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Apr 2024 21:13:52 +0300 Subject: [PATCH 10/14] [DE] Lock line space button when no paragraph object --- apps/documenteditor/main/app/controller/Toolbar.js | 8 +------- apps/documenteditor/main/app/view/Toolbar.js | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 5a0370aa9a..13c23d53f7 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -104,7 +104,6 @@ define([ type_fontsize: undefined, in_equation: false, in_chart: false, - in_para: undefined, linenum_apply: Asc.c_oAscSectionApplyType.All, suppress_num: undefined }; @@ -900,15 +899,10 @@ define([ this.toolbar.lockToolbar(Common.enumLock.chartLock, in_chart && image_locked, {array: [toolbar.btnInsertChart]}); this.toolbar.lockToolbar(Common.enumLock.cantAddEquation, !can_add_image&&!in_equation, {array: [toolbar.btnInsertEquation]}); - this.toolbar.lockToolbar(Common.enumLock.noParagraphSelected, !in_para, {array: [toolbar.btnInsertSymbol, toolbar.btnInsDateTime]}); + this.toolbar.lockToolbar(Common.enumLock.noParagraphSelected, !in_para, {array: [toolbar.btnInsertSymbol, toolbar.btnInsDateTime, toolbar.btnLineSpace]}); this.toolbar.lockToolbar(Common.enumLock.inImage, in_image, {array: [toolbar.btnColumns]}); this.toolbar.lockToolbar(Common.enumLock.inImagePara, in_image && in_para, {array: [toolbar.btnLineNumbers]}); - if (in_para !== this._state.in_para) { - toolbar.mnuLineSpaceOptions && toolbar.mnuLineSpaceOptions.setVisible(in_para); - this._state.in_para = in_para; - } - if (toolbar.listStylesAdditionalMenuItem && (frame_pr===undefined) !== toolbar.listStylesAdditionalMenuItem.isDisabled()) toolbar.listStylesAdditionalMenuItem.setDisabled(frame_pr===undefined); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 8aa755adff..4ab46aafd0 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -531,7 +531,7 @@ define([ id: 'id-toolbar-btn-linespace', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-linespace', - lock: [_set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode], + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode], menu: new Common.UI.Menu({ style: 'min-width: 60px;', items: [ From 59adda25fb2b6ecb9d92fbb2414f1ca67b27bb71 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 19 Apr 2024 17:43:41 +0300 Subject: [PATCH 11/14] [PE] Lock line space button when no paragraph object --- apps/presentationeditor/main/app/controller/Toolbar.js | 8 ++------ apps/presentationeditor/main/app/view/Toolbar.js | 5 +++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index cf9c206e06..6ea1a7c2ac 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -112,8 +112,7 @@ define([ clrhighlight: undefined, can_copycut: undefined, needCallApiBullets: undefined, - isLockedSlideHeaderAppyToAll: false, - in_para: undefined + isLockedSlideHeaderAppyToAll: false }; this._isAddingShape = false; this.slideSizeArr = [ @@ -868,10 +867,7 @@ define([ this._state.in_chart = in_chart; } - if (in_para !== this._state.in_para) { - this.toolbar.mnuLineSpaceOptions && this.toolbar.mnuLineSpaceOptions.setVisible(in_para); - this._state.in_para = in_para; - } + this.toolbar.lockToolbar(Common.enumLock.noParagraphObject, !in_para, {array: [me.toolbar.btnLineSpace]}); if (this._state.prcontrolsdisable !== paragraph_locked) { if (this._state.activated) this._state.prcontrolsdisable = paragraph_locked; diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index e8bb575604..50c2b66178 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -101,7 +101,8 @@ define([ noAnimationDuration: 'no-animation-duration', timingLock: 'timing-lock', copyLock: 'can-copy', - fileMenuOpened: 'file-menu-opened' + fileMenuOpened: 'file-menu-opened', + noParagraphObject: 'no-paragraph-obj', }; for (var key in enumLock) { if (enumLock.hasOwnProperty(key)) { @@ -686,7 +687,7 @@ define([ id: 'id-toolbar-btn-linespace', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-linespace', - lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], + lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.noParagraphObject], menu: new Common.UI.Menu({ style: 'min-width: 60px;', items: [ From 375a546032c6e35a3fda3e16025cc7902a54e314 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 19 Apr 2024 18:00:08 +0300 Subject: [PATCH 12/14] [DE] Add spacing and indents to toolbar --- .../main/app/controller/PageLayout.js | 131 +++++++++++++++--- .../main/app/template/Toolbar.template | 33 +++++ apps/documenteditor/main/app/view/Toolbar.js | 116 +++++++++++++++- apps/documenteditor/main/locale/en.json | 5 + 4 files changed, 267 insertions(+), 18 deletions(-) diff --git a/apps/documenteditor/main/app/controller/PageLayout.js b/apps/documenteditor/main/app/controller/PageLayout.js index 2c3dd02682..eb6db7d7e7 100644 --- a/apps/documenteditor/main/app/controller/PageLayout.js +++ b/apps/documenteditor/main/app/controller/PageLayout.js @@ -56,39 +56,52 @@ define([ onLaunch: function (view) { this.toolbar = view; this.editMode = true; - this._state = {}; + this._state = { + LeftIndent: null, + RightIndent: null, + LineSpacingBefore: null, + LineSpacingAfter: null + }; return this; }, onAppReady: function (config) { - var me = this; + var me = this, + toolbar = me.toolbar; - me.toolbar.btnImgAlign.menu.on('item:click', me.onClickMenuAlign.bind(me)); - me.toolbar.btnImgAlign.menu.on('show:before', me.onBeforeShapeAlign.bind(me)); - me.toolbar.btnImgWrapping.menu.on('item:click', me.onClickMenuWrapping.bind(me)); - me.toolbar.btnImgGroup.menu.on('item:click', me.onClickMenuGroup.bind(me)); - me.toolbar.btnImgForward.menu.on('item:click', me.onClickMenuForward.bind(me)); - me.toolbar.btnImgBackward.menu.on('item:click', me.onClickMenuForward.bind(me)); + toolbar.btnImgAlign.menu.on('item:click', me.onClickMenuAlign.bind(me)); + toolbar.btnImgAlign.menu.on('show:before', me.onBeforeShapeAlign.bind(me)); + toolbar.btnImgWrapping.menu.on('item:click', me.onClickMenuWrapping.bind(me)); + toolbar.btnImgGroup.menu.on('item:click', me.onClickMenuGroup.bind(me)); + toolbar.btnImgForward.menu.on('item:click', me.onClickMenuForward.bind(me)); + toolbar.btnImgBackward.menu.on('item:click', me.onClickMenuForward.bind(me)); - me.toolbar.btnImgForward.on('click', me.onClickMenuForward.bind(me, 'forward')); - me.toolbar.btnImgBackward.on('click', me.onClickMenuForward.bind(me, 'backward')); + toolbar.btnImgForward.on('click', me.onClickMenuForward.bind(me, 'forward')); + toolbar.btnImgBackward.on('click', me.onClickMenuForward.bind(me, 'backward')); - me.toolbar.btnsPageBreak.forEach( function(btn) { + toolbar.btnsPageBreak.forEach( function(btn) { var _menu_section_break = btn.menu.items[2].menu; _menu_section_break.on('item:click', function (menu, item, e) { - me.toolbar.fireEvent('insert:break', [item.value]); + toolbar.fireEvent('insert:break', [item.value]); }); btn.menu.on('item:click', function (menu, item, e) { if ( !(item.value == 'section') ) - me.toolbar.fireEvent('insert:break', [item.value]); + toolbar.fireEvent('insert:break', [item.value]); }); btn.on('click', function(e) { - me.toolbar.fireEvent('insert:break', ['page']); + toolbar.fireEvent('insert:break', ['page']); }); }); - + toolbar.numSpacingBefore.on('change', me.onNumSpacingBeforeChange.bind(me)); + toolbar.numSpacingAfter.on('change', me.onNumSpacingAfterChange.bind(me)); + toolbar.numSpacingBefore.on('inputleave', function(){ toolbar.fireEvent('editcomplete', toolbar);}); + toolbar.numSpacingAfter.on('inputleave', function(){ toolbar.fireEvent('editcomplete', toolbar);}); + toolbar.numIndentsLeft.on('change', me.onNumIndentsLeftChange.bind(me)); + toolbar.numIndentsRight.on('change', me.onNumIndentsRightChange.bind(me)); + toolbar.numIndentsLeft.on('inputleave', function(){ toolbar.fireEvent('editcomplete', toolbar);}); + toolbar.numIndentsRight.on('inputleave', function(){ toolbar.fireEvent('editcomplete', toolbar);}); }, setApi: function (api) { @@ -128,7 +141,9 @@ define([ canGroupUngroup = false, wrapping, content_locked = false, - no_object = true; + no_object = true, + in_para = false, + paraProps; for (var i in objects) { type = objects[i].get_ObjectType(); @@ -161,7 +176,9 @@ define([ } _imgOriginalProps = props; - break; + } else if (type === Asc.c_oAscTypeSelectElement.Paragraph) { + in_para = true; + paraProps = objects[i].get_ObjectValue() } } me.toolbar.lockToolbar(Common.enumLock.noObjectSelected, no_object, {array: [me.toolbar.btnImgAlign, me.toolbar.btnImgGroup, me.toolbar.btnImgWrapping, me.toolbar.btnImgForward, me.toolbar.btnImgBackward]}); @@ -172,6 +189,8 @@ define([ me.toolbar.lockToolbar(Common.enumLock.cantGroup, !canGroupUngroup, {array: [me.toolbar.btnImgGroup]}); me.toolbar.lockToolbar(Common.enumLock.cantWrap, disable.wrapping, {array: [me.toolbar.btnImgWrapping]}); me.toolbar.lockToolbar(Common.enumLock.cantArrange, disable.arrange, {array: [me.toolbar.btnImgForward, me.toolbar.btnImgBackward]}); + me.toolbar.lockToolbar(Common.enumLock.noParagraphSelected, !in_para, {array: [me.toolbar.numIndentsLeft, me.toolbar.numIndentsRight, me.toolbar.lblIndentsLeft, me.toolbar.lblIndentsRight]}); + me.ChangeSettingsPara(paraProps); }, onApiCoAuthoringDisconnect: function() { @@ -253,6 +272,84 @@ define([ this.api.ImgApply(props); this.toolbar.fireEvent('editcomplete', this.toolbar); + }, + + onNumSpacingBeforeChange: function(field, newValue, oldValue, eOpts){ + if (this.api) { + var num = field.getNumberValue(); + this._state.LineSpacingBefore = (num<0) ? -1 : Common.Utils.Metric.fnRecalcToMM(num); + this.api.put_LineSpacingBeforeAfter(0, this._state.LineSpacingBefore); + } + }, + + onNumSpacingAfterChange: function(field, newValue, oldValue, eOpts){ + if (this.api){ + var num = field.getNumberValue(); + this._state.LineSpacingAfter = (num<0) ? -1 : Common.Utils.Metric.fnRecalcToMM(num); + this.api.put_LineSpacingBeforeAfter(1, this._state.LineSpacingAfter); + } + }, + + onNumIndentsLeftChange: function(field, newValue, oldValue, eOpts){ + var left = Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()); + if (this._state.FirstLine<0) { + left = left-this._state.FirstLine; + } + var props = new Asc.asc_CParagraphProperty(); + props.put_Ind(new Asc.asc_CParagraphInd()); + props.get_Ind().put_Left(left); + if (this.api) + this.api.paraApply(props); + }, + + onNumIndentsRightChange: function(field, newValue, oldValue, eOpts){ + var props = new Asc.asc_CParagraphProperty(); + props.put_Ind(new Asc.asc_CParagraphInd()); + props.get_Ind().put_Right(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue())); + if (this.api) + this.api.paraApply(props); + }, + + ChangeSettingsPara: function(prop) { + var left = 0, + right = 0, + before = 0, + after = 0; + if (prop) { + var indents = prop.get_Ind(), + first = (indents !== null) ? indents.get_FirstLine() : null; + left = (indents !== null) ? indents.get_Left() : null; + if (first<0 && left !== null) + left = left + first; + + right = (indents !== null) ? indents.get_Right() : null; + + before = prop.get_Spacing().get_Before(); + after = prop.get_Spacing().get_After(); + } + if ( Math.abs(this._state.LeftIndent-left)>0.001 || + (this._state.LeftIndent===null || left===null)&&(this._state.LeftIndent!==left)) { + this.toolbar.numIndentsLeft.setValue(left!==null ? Common.Utils.Metric.fnRecalcFromMM(left) : '', true); + this._state.LeftIndent=left; + } + if ( Math.abs(this._state.RightIndent-right)>0.001 || + (this._state.RightIndent===null || right===null)&&(this._state.RightIndent!==right)) { + this.toolbar.numIndentsRight.setValue(right!==null ? Common.Utils.Metric.fnRecalcFromMM(right) : '', true); + this._state.RightIndent=right; + } + if ( Math.abs(this._state.LineSpacingBefore-before)>0.001 || + (this._state.LineSpacingBefore===null || before===null)&&(this._state.LineSpacingBefore!==before)) { + + this.toolbar.numSpacingBefore.setValue((before !== null) ? ((before<0) ? before : Common.Utils.Metric.fnRecalcFromMM(before) ) : '', true); + this._state.LineSpacingBefore=before; + } + + if ( Math.abs(this._state.LineSpacingAfter-after)>0.001 || + (this._state.LineSpacingAfter===null || after===null)&&(this._state.LineSpacingAfter!==after)) { + + this.toolbar.numSpacingAfter.setValue((after !== null) ? ((after<0) ? after : Common.Utils.Metric.fnRecalcFromMM(after) ) : '', true); + this._state.LineSpacingAfter=after; + } } } })()); diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template index 5292a0ceec..8a13bc9cfa 100644 --- a/apps/documenteditor/main/app/template/Toolbar.template +++ b/apps/documenteditor/main/app/template/Toolbar.template @@ -140,6 +140,39 @@
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 4ab46aafd0..e596e14cfd 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -50,6 +50,7 @@ define([ 'common/main/lib/collection/Fonts', 'common/main/lib/component/Button', 'common/main/lib/component/ComboBox', + 'common/main/lib/component/Label', 'common/main/lib/component/DataView', 'common/main/lib/component/ColorPalette', 'common/main/lib/component/ThemeColorPalette', @@ -158,6 +159,7 @@ define([ this.paragraphControls = []; this.toolbarControls = []; this.textOnlyControls = []; + this.spinners = []; this._state = { hasCollaborativeChanges: undefined, previewmode: false @@ -555,6 +557,98 @@ define([ }); this.paragraphControls.push(this.btnLineSpace); + this.numIndentsLeft = new Common.UI.MetricSpinner({ + step: .1, + width: 70, + defaultUnit : "cm", + defaultValue : 0, + value: '0 cm', + maxValue: 55.87, + minValue: -55.87, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode], + dataHint: '1', + dataHintDirection: 'top', + dataHintOffset: 'small' + }); + this.paragraphControls.push(this.numIndentsLeft); + this.spinners.push({cmp: this.numIndentsLeft, step: .1}); + + this.lblIndentsLeft = new Common.UI.Label({ + caption: this.textIndLeft, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode] + }); + this.paragraphControls.push(this.lblIndentsLeft); + + this.numIndentsRight = new Common.UI.MetricSpinner({ + step: .1, + width: 70, + defaultUnit : "cm", + defaultValue : 0, + value: '0 cm', + maxValue: 55.87, + minValue: -55.87, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode], + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big' + }); + this.paragraphControls.push(this.numIndentsRight); + this.spinners.push({cmp: this.numIndentsRight, step: .1}); + + this.lblIndentsRight = new Common.UI.Label({ + caption: this.textIndRight, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode] + }); + this.paragraphControls.push(this.lblIndentsRight); + + this.numSpacingBefore = new Common.UI.MetricSpinner({ + step: .01, + width: 70, + defaultUnit : "cm", + defaultValue : 0, + value: '0 cm', + maxValue: 55.87, + minValue: 0, + allowAuto : true, + autoText : this.txtAutoText, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode], + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big' + }); + this.paragraphControls.push(this.numSpacingBefore); + this.spinners.push({cmp: this.numSpacingBefore, step: .01}); + + this.lblSpacingBefore = new Common.UI.Label({ + caption: this.textSpaceBefore, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode] + }); + this.paragraphControls.push(this.lblSpacingBefore); + + this.numSpacingAfter = new Common.UI.MetricSpinner({ + step: .01, + width: 70, + defaultUnit : "cm", + defaultValue : 0, + value: '0 cm', + maxValue: 55.87, + minValue: 0, + allowAuto : true, + autoText : this.txtAutoText, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode], + dataHint: '1', + dataHintDirection: 'top', + dataHintOffset: 'small' + }); + this.paragraphControls.push(this.numSpacingAfter); + this.spinners.push({cmp: this.numSpacingAfter, step: .01}); + + this.lblSpacingAfter = new Common.UI.Label({ + caption: this.textSpaceAfter, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.fixedForm, _set.viewMode] + }); + this.paragraphControls.push(this.lblSpacingAfter); + this.btnShowHidenChars = new Common.UI.Button({ id: 'id-toolbar-btn-hidenchars', cls: 'btn-toolbar', @@ -1941,6 +2035,14 @@ define([ _injectComponent('#slot-img-wrapping', this.btnImgWrapping); _injectComponent('#slot-btn-watermark', this.btnWatermark); _injectComponent('#slot-btn-hyphenation', this.btnHyphenation); + _injectComponent('#slot-spin-ind-left', this.numIndentsLeft); + _injectComponent('#slot-spin-ind-right', this.numIndentsRight); + _injectComponent('#slot-lbl-ind-left', this.lblIndentsLeft); + _injectComponent('#slot-lbl-ind-right', this.lblIndentsRight); + _injectComponent('#slot-spin-space-before', this.numSpacingBefore); + _injectComponent('#slot-spin-space-after', this.numSpacingAfter); + _injectComponent('#slot-lbl-space-before', this.lblSpacingBefore); + _injectComponent('#slot-lbl-space-after', this.lblSpacingAfter); this.btnsPageBreak = Common.Utils.injectButtons($host.find('.btn-slot.btn-pagebreak'), '', 'toolbar__icon btn-pagebreak', this.capBtnInsPagebreak, [Common.enumLock.paragraphLock, Common.enumLock.headerLock, Common.enumLock.richEditLock, Common.enumLock.plainEditLock, Common.enumLock.inEquation, Common.enumLock.richDelLock, @@ -2986,6 +3088,13 @@ define([ if (checked) mnu.setChecked(checked); } } + if (this.spinners) { + for (var i=0; i Date: Fri, 19 Apr 2024 19:48:30 +0300 Subject: [PATCH 13/14] [DE] Bug 67442: add paragraph settings to Layout tab --- .../main/app/template/Toolbar.template | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template index 8a13bc9cfa..8a5a57f083 100644 --- a/apps/documenteditor/main/app/template/Toolbar.template +++ b/apps/documenteditor/main/app/template/Toolbar.template @@ -141,34 +141,22 @@
-
- -
-
- -
-
-
-
+
+
-
+
+
-
- -
-
- -
-
-
-
+
+
-
+
+
From dc05f5a81abe7b872aed422f286e81feb4bfdd79 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 19 Apr 2024 21:37:26 +0300 Subject: [PATCH 14/14] [SSE] Bug 67442: open cell settings from context menu --- .../main/app/controller/DocumentHolder.js | 9 ++++++++- .../main/app/view/DocumentHolder.js | 19 +++++++++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 1 + 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index a030a052d9..32fab60531 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -279,6 +279,7 @@ define([ view.menuSignatureEditSetup.on('click', _.bind(me.onSignatureClick, me)); view.menuImgOriginalSize.on('click', _.bind(me.onOriginalSizeClick, me)); view.menuImgReplace.menu.on('item:click', _.bind(me.onImgReplace, me)); + view.pmiCellFormat.on('click', _.bind(me.onCellFormat, me)); view.pmiNumFormat.menu.on('item:click', _.bind(me.onNumberFormatSelect, me)); view.pmiNumFormat.menu.on('show:after', _.bind(me.onNumberFormatOpenAfter, me)); view.pmiAdvancedNumFormat.on('click', _.bind(me.onCustomNumberFormat, me)); @@ -375,6 +376,7 @@ define([ ? Common.util.Shortcuts.suspendEvents(this.hkComments) : Common.util.Shortcuts.resumeEvents(this.hkComments); /** coauthoring end **/ + this.documentHolder.setMode(permissions); }, setApi: function(api) { @@ -2868,7 +2870,7 @@ define([ documentHolder.pmiFilterCells.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && !inPivot); documentHolder.pmiReapply.setVisible((iscellmenu||isallmenu) && !iscelledit && !diagramOrMergeEditor && !inPivot); documentHolder.pmiCondFormat.setVisible(!iscelledit && !diagramOrMergeEditor); - documentHolder.ssMenu.items[12].setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit); + documentHolder.pmiCellSeparator.setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit); documentHolder.pmiInsFunction.setVisible(iscellmenu && !iscelledit && !inPivot); documentHolder.pmiAddNamedRange.setVisible(iscellmenu && !iscelledit && !internaleditor); @@ -2980,6 +2982,7 @@ define([ documentHolder.pmiEntriesList.setVisible(!iscelledit && !inPivot); documentHolder.pmiNumFormat.setVisible(!iscelledit); + documentHolder.pmiCellFormat.setVisible(!iscelledit && !(this.permissions.canBrandingExt && this.permissions.customization && this.permissions.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu'))); documentHolder.pmiAdvancedNumFormat.options.numformatinfo = documentHolder.pmiNumFormat.menu.options.numformatinfo = xfs.asc_getNumFormatInfo(); documentHolder.pmiAdvancedNumFormat.options.numformat = xfs.asc_getNumFormat(); @@ -5150,6 +5153,10 @@ define([ this._state.fillSeriesItemClick = false; }, + onCellFormat: function() { + this.getApplication().getController('RightMenu').onRightMenuOpen(Common.Utils.documentSettingsType.Cell); + }, + getUserName: function(id){ var usersStore = SSE.getCollection('Common.Collections.Users'); if (usersStore){ diff --git a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js index e3ab18c4f3..c0d0324230 100644 --- a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js @@ -77,6 +77,11 @@ define([ return this; }, + setMode: function(m) { + this.mode = m; + return this; + }, + focus: function() { var me = this; _.defer(function(){ @@ -698,6 +703,10 @@ define([ caption : '--' }); + me.pmiCellSeparator = new Common.UI.MenuItem({ + caption : '--' + }); + me.pmiAddNamedRange = new Common.UI.MenuItem({ id : 'id-context-menu-item-add-named-range', caption : me.txtAddNamedRange @@ -821,6 +830,10 @@ define([ }) }); + me.pmiCellFormat = new Common.UI.MenuItem({ + caption : me.txtCellFormat + }); + me.pmiCondFormat = new Common.UI.MenuItem({ caption : me.txtCondFormat }); @@ -847,7 +860,7 @@ define([ me.pmiDeleteCells, me.pmiDeleteTable, me.pmiClear, - {caption: '--'}, + me.pmiCellSeparator, me.pmiSparklines, me.pmiSortCells, me.pmiFilterCells, @@ -876,6 +889,7 @@ define([ me.pmiAddCommentSeparator, me.pmiAddComment, me.pmiCellMenuSeparator, + me.pmiCellFormat, me.pmiNumFormat, me.pmiCondFormat, me.pmiEntriesList, @@ -1909,7 +1923,8 @@ define([ textLinearTrend: 'Linear trend', textGrowthTrend: 'Growth trend', textFlashFill: 'Flash fill', - textSeries: 'Series' + textSeries: 'Series', + txtCellFormat: 'Format cells' }, SSE.Views.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index ed9876f35e..768e71dc45 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2492,6 +2492,7 @@ "SSE.Views.DocumentHolder.txtWidth": "Width", "SSE.Views.DocumentHolder.unicodeText": "Unicode", "SSE.Views.DocumentHolder.vertAlignText": "Vertical alignment", + "SSE.Views.DocumentHolder.txtCellFormat": "Format cells", "SSE.Views.ExternalLinksDlg.closeButtonText": "Close", "SSE.Views.ExternalLinksDlg.textChange": "Change source", "SSE.Views.ExternalLinksDlg.textDelete": "Break links",