From 28322d75f832e79a4baacfb67477b5939330b7de Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 11 Jan 2022 22:59:57 +0300 Subject: [PATCH 1/8] Use customization.layout section for hide statusBar, toolbar (instead of customizaton.statusBar, customizaton.toolbar parameters) --- apps/api/documents/api.js | 8 ++++---- apps/documenteditor/main/app/controller/Main.js | 4 ++++ apps/documenteditor/main/app/controller/Viewport.js | 6 +++--- apps/documenteditor/main/app/template/Viewport.template | 4 ++-- apps/presentationeditor/main/app/controller/Main.js | 4 ++++ apps/presentationeditor/main/app/controller/Viewport.js | 6 +++--- .../main/app/template/Viewport.template | 4 ++-- apps/spreadsheeteditor/main/app/controller/Main.js | 4 ++++ apps/spreadsheeteditor/main/app/controller/Viewport.js | 6 ++++-- .../spreadsheeteditor/main/app/template/Viewport.template | 4 ++-- 10 files changed, 32 insertions(+), 18 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 19f32f884..4eaf9b218 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -165,7 +165,7 @@ navigation: false/true // navigation button in de } / false / true, // view tab save: false/true // save button on toolbar in - }, + } / false / true, // use instead of customization.toolbar, header: { users: false/true // users list button save: false/true // save button @@ -179,7 +179,7 @@ textLang: false/true // text language button in de/pe docLang: false/true // document language button in de/pe actionStatus: false/true // status of operation - } + } / false / true, // use instead of customization.statusBar }, features: { // disable feature spellcheck: { @@ -194,8 +194,8 @@ leftMenu: true, // must be deprecated. use layout.leftMenu instead rightMenu: true, // must be deprecated. use layout.rightMenu instead hideRightMenu: false, // hide or show right panel on first loading - toolbar: true, - statusBar: true, + toolbar: true, // must be deprecated. use layout.toolbar instead + statusBar: true, // must be deprecated. use layout.statusBar instead autosave: true, forcesave: false, commentAuthorOnly: false, // must be deprecated. use permissions.editCommentAuthorOnly and permissions.deleteCommentAuthorOnly instead diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index fac43e2b1..38b419858 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2084,6 +2084,10 @@ define([ console.log("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead."); if (this.appOptions.customization.rightMenu!==undefined) console.log("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.statusBar!==undefined) + console.log("Obsolete: The 'statusBar' parameter of the 'customization' section is deprecated. Please use 'statusBar' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.toolbar!==undefined) + console.log("Obsolete: The 'toolbar' parameter of the 'customization' section is deprecated. Please use 'toolbar' parameter in the 'customization.layout' section instead."); } promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization(); } diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index a375cc8ed..469e35668 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -171,7 +171,7 @@ define([ var _intvars = Common.Utils.InternalSettings; var $filemenu = $('.toolbar-fullview-panel'); - $filemenu.css('top', _intvars.get('toolbar-height-tabs')); + $filemenu.css('top', Common.UI.LayoutManager.isElementVisible('toolbar') ? _intvars.get('toolbar-height-tabs') : 0); me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); @@ -205,7 +205,7 @@ define([ _intvars.set('toolbar-height-compact', _tabs_new_height); _intvars.set('toolbar-height-normal', _tabs_new_height + _intvars.get('toolbar-height-controls')); - $filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height')); + $filemenu.css('top', (Common.UI.LayoutManager.isElementVisible('toolbar') ? _tabs_new_height : 0) + _intvars.get('document-title-height')); toolbar = me.getApplication().getController('Toolbar').getView(); toolbar.btnCollabChanges = me.header.btnSave; @@ -246,7 +246,7 @@ define([ value: 'statusbar' }); - if ( config.canBrandingExt && config.customization && config.customization.statusBar === false ) + if ( config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) me.header.mnuitemHideStatusBar.hide(); me.header.mnuitemHideRulers = new Common.UI.MenuItem({ diff --git a/apps/documenteditor/main/app/template/Viewport.template b/apps/documenteditor/main/app/template/Viewport.template index c407ba7a5..d18c97b98 100644 --- a/apps/documenteditor/main/app/template/Viewport.template +++ b/apps/documenteditor/main/app/template/Viewport.template @@ -4,7 +4,7 @@
-
+
@@ -14,6 +14,6 @@
-
+
diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index aa78778e4..72428694d 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1720,6 +1720,10 @@ define([ console.log("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead."); if (this.appOptions.customization.rightMenu!==undefined) console.log("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.statusBar!==undefined) + console.log("Obsolete: The 'statusBar' parameter of the 'customization' section is deprecated. Please use 'statusBar' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.toolbar!==undefined) + console.log("Obsolete: The 'toolbar' parameter of the 'customization' section is deprecated. Please use 'toolbar' parameter in the 'customization.layout' section instead."); } promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization(); } diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 4cecb100f..b79d21b1d 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -181,7 +181,7 @@ define([ var _intvars = Common.Utils.InternalSettings; var $filemenu = $('.toolbar-fullview-panel'); - $filemenu.css('top', _intvars.get('toolbar-height-tabs')); + $filemenu.css('top', Common.UI.LayoutManager.isElementVisible('toolbar') ? _intvars.get('toolbar-height-tabs') : 0); me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); @@ -206,7 +206,7 @@ define([ _intvars.set('toolbar-height-compact', _tabs_new_height); _intvars.set('toolbar-height-normal', _tabs_new_height + _intvars.get('toolbar-height-controls')); - $filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height')); + $filemenu.css('top', (Common.UI.LayoutManager.isElementVisible('toolbar') ? _tabs_new_height : 0) + _intvars.get('document-title-height')); toolbar = me.getApplication().getController('Toolbar').getView('Toolbar'); toolbar.btnCollabChanges = me.header.btnSave; @@ -255,7 +255,7 @@ define([ value: 'statusbar' }); - if ( config.canBrandingExt && config.customization && config.customization.statusBar === false ) + if ( config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) me.header.mnuitemHideStatusBar.hide(); me.header.mnuitemHideRulers = new Common.UI.MenuItem({ diff --git a/apps/presentationeditor/main/app/template/Viewport.template b/apps/presentationeditor/main/app/template/Viewport.template index 8f80302b9..14dff927e 100644 --- a/apps/presentationeditor/main/app/template/Viewport.template +++ b/apps/presentationeditor/main/app/template/Viewport.template @@ -5,7 +5,7 @@
-
+
@@ -15,6 +15,6 @@
-
+
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 48e5cf103..15e20d05f 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2090,6 +2090,10 @@ define([ console.log("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead."); if (this.appOptions.customization.rightMenu!==undefined) console.log("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.statusBar!==undefined) + console.log("Obsolete: The 'statusBar' parameter of the 'customization' section is deprecated. Please use 'statusBar' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.toolbar!==undefined) + console.log("Obsolete: The 'toolbar' parameter of the 'customization' section is deprecated. Please use 'toolbar' parameter in the 'customization.layout' section instead."); } promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization(); } diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 551281f55..171cbf229 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -152,7 +152,7 @@ define([ var _intvars = Common.Utils.InternalSettings; var $filemenu = $('.toolbar-fullview-panel'); - $filemenu.css('top', _intvars.get('toolbar-height-tabs')); + $filemenu.css('top', Common.UI.LayoutManager.isElementVisible('toolbar') ? _intvars.get('toolbar-height-tabs') : 0); me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); @@ -180,7 +180,7 @@ define([ _intvars.set('toolbar-height-compact', _tabs_new_height); _intvars.set('toolbar-height-normal', _tabs_new_height + _intvars.get('toolbar-height-controls')); - $filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height')); + $filemenu.css('top', (Common.UI.LayoutManager.isElementVisible('toolbar') ? _tabs_new_height : 0) + _intvars.get('document-title-height')); } if ( config.customization ) { @@ -225,6 +225,8 @@ define([ checkable: true, value: 'statusbar' }); + if ( config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) + me.header.mnuitemCompactStatusBar.hide(); me.header.mnuitemHideFormulaBar = new Common.UI.MenuItem({ caption : me.textHideFBar, diff --git a/apps/spreadsheeteditor/main/app/template/Viewport.template b/apps/spreadsheeteditor/main/app/template/Viewport.template index 3104c7962..9f4c6db7a 100644 --- a/apps/spreadsheeteditor/main/app/template/Viewport.template +++ b/apps/spreadsheeteditor/main/app/template/Viewport.template @@ -4,7 +4,7 @@
-
+
@@ -19,6 +19,6 @@
-
+
From c2d5af84c8eca97ff63b8b576fc9596a9b928795 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Wed, 12 Jan 2022 01:32:04 +0300 Subject: [PATCH 2/8] [DE] Fix disabling of dark document button in view tab --- apps/documenteditor/main/app/controller/Toolbar.js | 2 ++ apps/documenteditor/main/app/view/ViewTab.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index da2f99dc2..1f066fe0e 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2910,6 +2910,7 @@ define([ this.toolbar.btnRedo.setDisabled(this._state.can_redo!==true); this.toolbar.btnCopy.setDisabled(this._state.can_copycut!==true); this.toolbar.btnPrint.setDisabled(!this.toolbar.mode.canPrint); + this.toolbar.btnDarkDocument && this.toolbar.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme()); if (!this._state.mmdisable) { this.toolbar.btnMailRecepients.setDisabled(false); this.toolbar.mnuMailRecepients.items[2].setVisible(this.toolbar.mode.fileChoiceUrl || this.toolbar.mode.canRequestMailMergeRecipients); @@ -3240,6 +3241,7 @@ define([ var viewtab = me.getApplication().getController('ViewTab'); viewtab.setApi(me.api).setConfig({toolbar: me, mode: config}); Array.prototype.push.apply(me.toolbar.toolbarControls, viewtab.getView('ViewTab').getButtons()); + me.toolbar.btnDarkDocument = viewtab.getView('ViewTab').btnDarkDocument; } if ( config.isEdit && config.canFeatureContentControl && config.canFeatureForms || config.isRestrictedEdit && config.canFillForms ) { if (config.isFormCreator) { diff --git a/apps/documenteditor/main/app/view/ViewTab.js b/apps/documenteditor/main/app/view/ViewTab.js index ce54da4e9..1460cdac1 100644 --- a/apps/documenteditor/main/app/view/ViewTab.js +++ b/apps/documenteditor/main/app/view/ViewTab.js @@ -178,7 +178,6 @@ define([ dataHintDirection: 'bottom', dataHintOffset: 'small' }); - this.lockedControls.push(this.btnDarkDocument); this.chStatusbar = new Common.UI.CheckBox({ el: $host.findById('#slot-chk-statusbar'), @@ -235,6 +234,7 @@ define([ button.setDisabled(state); } }, this); + this.btnDarkDocument && this.btnDarkDocument.setDisabled(state); }, turnNavigation: function (state) { From b0326651d7a1e892e6f6c9568fb561aec48a85a5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 12 Jan 2022 16:54:46 +0300 Subject: [PATCH 3/8] [DE] Add separators for wrapping menu --- .../main/app/controller/PageLayout.js | 14 ++++---- .../main/app/view/DocumentHolder.js | 32 ++++++++++--------- apps/documenteditor/main/app/view/Toolbar.js | 8 +++-- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/apps/documenteditor/main/app/controller/PageLayout.js b/apps/documenteditor/main/app/controller/PageLayout.js index 222538d4a..06c3a6bdd 100644 --- a/apps/documenteditor/main/app/controller/PageLayout.js +++ b/apps/documenteditor/main/app/controller/PageLayout.js @@ -107,12 +107,12 @@ define([ switch ( type ) { case Asc.c_oAscWrapStyle2.Inline: menu.items[0].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Square: menu.items[1].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Tight: menu.items[2].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Through: menu.items[3].setChecked(true); break; - case Asc.c_oAscWrapStyle2.TopAndBottom: menu.items[4].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Behind: menu.items[6].setChecked(true); break; - case Asc.c_oAscWrapStyle2.InFront: menu.items[5].setChecked(true); break; + case Asc.c_oAscWrapStyle2.Square: menu.items[2].setChecked(true); break; + case Asc.c_oAscWrapStyle2.Tight: menu.items[3].setChecked(true); break; + case Asc.c_oAscWrapStyle2.Through: menu.items[4].setChecked(true); break; + case Asc.c_oAscWrapStyle2.TopAndBottom: menu.items[5].setChecked(true); break; + case Asc.c_oAscWrapStyle2.Behind: menu.items[8].setChecked(true); break; + case Asc.c_oAscWrapStyle2.InFront: menu.items[7].setChecked(true); break; default: for (var i in menu.items) { menu.items[i].setChecked( false ); @@ -140,7 +140,7 @@ define([ _.each(me.toolbar.btnImgWrapping.menu.items, function(item) { item.setDisabled(notflow); }); - me.toolbar.btnImgWrapping.menu.items[8].setDisabled(!me.api.CanChangeWrapPolygon()); + me.toolbar.btnImgWrapping.menu.items[10].setDisabled(!me.api.CanChangeWrapPolygon()); var control_props = me.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null, lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked, diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index a9b03c443..79bd02b9c 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -1637,22 +1637,22 @@ define([ this.menuImageWrap.menu.items[0].setChecked(true); break; case Asc.c_oAscWrapStyle2.Square: - this.menuImageWrap.menu.items[1].setChecked(true); - break; - case Asc.c_oAscWrapStyle2.Tight: this.menuImageWrap.menu.items[2].setChecked(true); break; - case Asc.c_oAscWrapStyle2.Through: + case Asc.c_oAscWrapStyle2.Tight: this.menuImageWrap.menu.items[3].setChecked(true); break; - case Asc.c_oAscWrapStyle2.TopAndBottom: + case Asc.c_oAscWrapStyle2.Through: this.menuImageWrap.menu.items[4].setChecked(true); break; + case Asc.c_oAscWrapStyle2.TopAndBottom: + this.menuImageWrap.menu.items[5].setChecked(true); + break; case Asc.c_oAscWrapStyle2.Behind: - this.menuImageWrap.menu.items[6].setChecked(true); + this.menuImageWrap.menu.items[8].setChecked(true); break; case Asc.c_oAscWrapStyle2.InFront: - this.menuImageWrap.menu.items[5].setChecked(true); + this.menuImageWrap.menu.items[7].setChecked(true); break; } }, @@ -2329,6 +2329,7 @@ define([ checkmark : false, checkable : true }).on('click', onItemClick), + { caption: '--' }, new Common.UI.MenuItem({ caption : me.txtSquare, iconCls : 'menu__icon wrap-square', @@ -2361,6 +2362,7 @@ define([ checkmark : false, checkable : true }).on('click', onItemClick), + { caption: '--' }, new Common.UI.MenuItem({ caption : me.txtInFront, iconCls : 'menu__icon wrap-infront', @@ -2616,7 +2618,7 @@ define([ var cls = 'menu__icon '; if (notflow) { - for (var i = 0; i < 6; i++) { + for (var i = 0; i < 8; i++) { me.menuImageWrap.menu.items[i].setChecked(false); } cls += 'wrap-inline'; @@ -2627,31 +2629,31 @@ define([ cls += 'wrap-inline'; break; case Asc.c_oAscWrapStyle2.Square: - me.menuImageWrap.menu.items[1].setChecked(true); + me.menuImageWrap.menu.items[2].setChecked(true); cls += 'wrap-square'; break; case Asc.c_oAscWrapStyle2.Tight: - me.menuImageWrap.menu.items[2].setChecked(true); + me.menuImageWrap.menu.items[3].setChecked(true); cls += 'wrap-tight'; break; case Asc.c_oAscWrapStyle2.Through: - me.menuImageWrap.menu.items[3].setChecked(true); + me.menuImageWrap.menu.items[4].setChecked(true); cls += 'wrap-through'; break; case Asc.c_oAscWrapStyle2.TopAndBottom: - me.menuImageWrap.menu.items[4].setChecked(true); + me.menuImageWrap.menu.items[5].setChecked(true); cls += 'wrap-topandbottom'; break; case Asc.c_oAscWrapStyle2.Behind: - me.menuImageWrap.menu.items[6].setChecked(true); + me.menuImageWrap.menu.items[8].setChecked(true); cls += 'wrap-behind'; break; case Asc.c_oAscWrapStyle2.InFront: - me.menuImageWrap.menu.items[5].setChecked(true); + me.menuImageWrap.menu.items[7].setChecked(true); cls += 'wrap-infront'; break; default: - for (var i = 0; i < 6; i++) { + for (var i = 0; i < 8; i++) { me.menuImageWrap.menu.items[i].setChecked(false); } cls += 'wrap-infront'; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 5e6b1d1df..078b3242e 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1720,7 +1720,9 @@ define([ wrapType : Asc.c_oAscWrapStyle2.Inline, checkmark : false, checkable : true - }, { + }, + { caption: '--' }, + { caption : _holder_view.txtSquare, iconCls : 'menu__icon wrap-square', toggleGroup : 'imgwrapping', @@ -1748,7 +1750,9 @@ define([ wrapType : Asc.c_oAscWrapStyle2.TopAndBottom, checkmark : false, checkable : true - }, { + }, + { caption: '--' }, + { caption : _holder_view.txtInFront, iconCls : 'menu__icon wrap-infront', toggleGroup : 'imgwrapping', From dde8ebb346ba4f16ab22e83017b8978ebc9042c4 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Wed, 12 Jan 2022 17:41:48 +0300 Subject: [PATCH 4/8] [DE PE SSE] Fix hide statusbar for customization in view tab --- apps/documenteditor/main/app/controller/ViewTab.js | 12 +++++++++++- .../main/app/template/Toolbar.template | 8 ++++---- apps/documenteditor/main/app/view/ViewTab.js | 2 ++ .../main/app/controller/ViewTab.js | 6 +++++- .../main/app/template/Toolbar.template | 4 ++-- .../spreadsheeteditor/main/app/controller/ViewTab.js | 6 +++++- .../main/app/template/Toolbar.template | 4 ++-- 7 files changed, 31 insertions(+), 11 deletions(-) diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index 4f8128f23..0e544b79b 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -72,12 +72,22 @@ define([ }, setConfig: function(config) { + var mode = config.mode; this.toolbar = config.toolbar; this.view = this.createView('ViewTab', { toolbar: this.toolbar.toolbar, - mode: config.mode, + mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); + if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { + this.view.chStatusbar.$el.remove(); + var slotChkRulers = this.view.chRulers.$el, + groupRulers = slotChkRulers.closest('.group'), + groupToolbar = this.view.chToolbar.$el.closest('.group'); + groupToolbar.find('.elset')[1].append(slotChkRulers[0]); + groupRulers.remove(); + this.view.cmpEl.find('.separator-rulers').remove(); + } this.addListeners({ 'ViewTab': { 'zoom:topage': _.bind(this.onBtnZoomTo, this, 'topage'), diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template index a20d3042e..a9b069198 100644 --- a/apps/documenteditor/main/app/template/Toolbar.template +++ b/apps/documenteditor/main/app/template/Toolbar.template @@ -202,14 +202,14 @@
-
- -
+
+ +
-
+
diff --git a/apps/documenteditor/main/app/view/ViewTab.js b/apps/documenteditor/main/app/view/ViewTab.js index 1460cdac1..ed1636b24 100644 --- a/apps/documenteditor/main/app/view/ViewTab.js +++ b/apps/documenteditor/main/app/view/ViewTab.js @@ -211,6 +211,8 @@ define([ dataHintOffset: 'small' }); this.lockedControls.push(this.chRulers); + + this.cmpEl = $host; }, render: function (el) { diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index bfd39f5fc..9fedc8a61 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -74,12 +74,16 @@ define([ }, setConfig: function(config) { + var mode = config.mode; this.toolbar = config.toolbar; this.view = this.createView('ViewTab', { toolbar: this.toolbar.toolbar, - mode: config.mode, + mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); + if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { + this.view.chStatusbar.$el.remove(); + } this.addListeners({ 'ViewTab': { 'zoom:toslide': _.bind(this.onBtnZoomTo, this, 'toslide'), diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index 6842594d2..9a2166506 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -211,10 +211,10 @@
- +
- +
diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index bac0719d4..09d045e0b 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -78,11 +78,15 @@ define([ setConfig: function(config) { this.toolbar = config.toolbar; + var mode = config.mode; this.view = this.createView('ViewTab', { toolbar: this.toolbar.toolbar, - mode: config.mode, + mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); + if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { + this.view.chStatusbar.$el.remove(); + } this.addListeners({ 'ViewTab': { 'zoom:selected': _.bind(this.onSelectedZoomValue, this), diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index 79469b15a..059112936 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -294,10 +294,10 @@
- +
- +
From 27ae2f37a51f72fb85936f85c53b553ba7f3b767 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 13 Jan 2022 00:45:29 +0300 Subject: [PATCH 5/8] [SSE embedded] Fix loader --- apps/spreadsheeteditor/embed/index.html | 2 +- apps/spreadsheeteditor/embed/index.html.deploy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/embed/index.html b/apps/spreadsheeteditor/embed/index.html index 15dc7afa4..94cf225af 100644 --- a/apps/spreadsheeteditor/embed/index.html +++ b/apps/spreadsheeteditor/embed/index.html @@ -74,7 +74,7 @@ font-size: 0; border: 1px solid #dfdfdf; white-space: nowrap; - padding-top: 48px; + padding-top: 28px; } .loadmask > .placeholder > .columns { diff --git a/apps/spreadsheeteditor/embed/index.html.deploy b/apps/spreadsheeteditor/embed/index.html.deploy index c7d4f973a..eb9dbabea 100644 --- a/apps/spreadsheeteditor/embed/index.html.deploy +++ b/apps/spreadsheeteditor/embed/index.html.deploy @@ -71,7 +71,7 @@ font-size: 0; border: 1px solid #dfdfdf; white-space: nowrap; - padding-top: 48px; + padding-top: 28px; } .loadmask > .placeholder > .columns { From b4d1d247ed19b4d4d22097b84fda81ccab89c7d7 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 13 Jan 2022 12:01:19 +0300 Subject: [PATCH 6/8] [all] refactoring --- .../mobile/src/controller/Error.jsx | 17 +++++++++++------ .../mobile/src/controller/Error.jsx | 17 +++++++++++------ .../mobile/src/controller/Error.jsx | 16 ++++++++++------ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Error.jsx b/apps/documenteditor/mobile/src/controller/Error.jsx index 7a9f49a26..16eca5427 100644 --- a/apps/documenteditor/mobile/src/controller/Error.jsx +++ b/apps/documenteditor/mobile/src/controller/Error.jsx @@ -4,20 +4,25 @@ import { f7 } from 'framework7-react'; import { useTranslation } from 'react-i18next'; const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocument}) => { - const {t} = useTranslation(); - const _t = t("Error", { returnObjects: true }); - useEffect(() => { - Common.Notifications.on('engineCreated', (api) => { - api.asc_registerCallback('asc_onError', onError); - }); + const on_engine_created = k => { k.asc_registerCallback('asc_onError', onError); }; + + const api = Common.EditorApi.get(); + if ( !api ) Common.Notifications.on('engineCreated', on_engine_created); + else on_engine_created(api); + return () => { const api = Common.EditorApi.get(); if ( api ) api.asc_unregisterCallback('asc_onError', onError); + + Common.Notifications.off('engineCreated', on_engine_created); } }); const onError = (id, level, errData) => { + const {t} = useTranslation(); + const _t = t("Error", { returnObjects: true }); + if (id === Asc.c_oAscError.ID.LoadingScriptError) { f7.notification.create({ title: _t.criticalErrorTitle, diff --git a/apps/presentationeditor/mobile/src/controller/Error.jsx b/apps/presentationeditor/mobile/src/controller/Error.jsx index e2784d2c7..839dd126b 100644 --- a/apps/presentationeditor/mobile/src/controller/Error.jsx +++ b/apps/presentationeditor/mobile/src/controller/Error.jsx @@ -4,20 +4,25 @@ import { f7 } from 'framework7-react'; import { useTranslation } from 'react-i18next'; const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocument}) => { - const {t} = useTranslation(); - const _t = t("Error", { returnObjects: true }); - useEffect(() => { - Common.Notifications.on('engineCreated', (api) => { - api.asc_registerCallback('asc_onError', onError); - }); + const on_engine_created = k => { k.asc_registerCallback('asc_onError', onError); }; + + const api = Common.EditorApi.get(); + if ( !api ) Common.Notifications.on('engineCreated', on_engine_created); + else on_engine_created(api); + return () => { const api = Common.EditorApi.get(); if ( api ) api.asc_unregisterCallback('asc_onError', onError); + + Common.Notifications.off('engineCreated', on_engine_created); } }); const onError = (id, level, errData) => { + const {t} = useTranslation(); + const _t = t("Error", { returnObjects: true }); + if (id === Asc.c_oAscError.ID.LoadingScriptError) { f7.notification.create({ title: _t.criticalErrorTitle, diff --git a/apps/spreadsheeteditor/mobile/src/controller/Error.jsx b/apps/spreadsheeteditor/mobile/src/controller/Error.jsx index 9b5c0deee..94f05d1c3 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Error.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Error.jsx @@ -4,20 +4,24 @@ import { f7 } from 'framework7-react'; import { useTranslation } from 'react-i18next'; const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocument}) => { - const {t} = useTranslation(); - const _t = t("Error", { returnObjects: true }); - useEffect(() => { - Common.Notifications.on('engineCreated', (api) => { - api.asc_registerCallback('asc_onError', onError); - }); + const on_engine_created = k => { k.asc_registerCallback('asc_onError', onError); }; + + const api = Common.EditorApi.get(); + if ( !api ) Common.Notifications.on('engineCreated', on_engine_created); + else on_engine_created(api); + return () => { const api = Common.EditorApi.get(); if ( api ) api.asc_unregisterCallback('asc_onError', onError); + + Common.Notifications.off('engineCreated', on_engine_created); } }); const onError = (id, level, errData) => { + const {t} = useTranslation(); + const _t = t("Error", { returnObjects: true }); const api = Common.EditorApi.get(); if (id === Asc.c_oAscError.ID.LoadingScriptError) { From ffffa133a26b810d1dc640843877cee5606b4181 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 13 Jan 2022 14:31:49 +0300 Subject: [PATCH 7/8] [PE] Fix Bug 54786 --- .../main/lib/component/ComboDataView.js | 1 + .../main/resources/less/combo-dataview.less | 19 ++++++++---- .../main/resources/less/animation.less | 30 ++++++++----------- .../main/resources/less/app.less | 1 - .../main/resources/less/transitions.less | 26 ---------------- 5 files changed, 26 insertions(+), 51 deletions(-) delete mode 100644 apps/presentationeditor/main/resources/less/transitions.less diff --git a/apps/common/main/lib/component/ComboDataView.js b/apps/common/main/lib/component/ComboDataView.js index ee482b9e7..7bd9bdc5b 100644 --- a/apps/common/main/lib/component/ComboDataView.js +++ b/apps/common/main/lib/component/ComboDataView.js @@ -255,6 +255,7 @@ define([ var picker = this.menuPicker; if (picker) { var record = picker.getSelectedRec(); + this.itemMarginLeft = undefined; this.fillComboView(record || picker.store.at(0), !!record, true); picker.onResize(); diff --git a/apps/common/main/resources/less/combo-dataview.less b/apps/common/main/resources/less/combo-dataview.less index 079dcbe92..6e865d76a 100644 --- a/apps/common/main/resources/less/combo-dataview.less +++ b/apps/common/main/resources/less/combo-dataview.less @@ -378,10 +378,20 @@ height: @combo-dataview-height-calc; } - .item { + .item, .menu-picker-container .dataview .group-items-container .item { padding: 0px; - margin: @combo-dataview-item-margins 0 0 @combo-dataview-item-margins; + margin: @combo-dataview-item-margins; .box-shadow(none); + + &:hover { + .box-shadow(0 0 0 2px @border-preview-hover-ie); + .box-shadow(0 0 0 @scaled-two-px-value @border-preview-hover); + } + + &.selected { + .box-shadow(0 0 0 2px @border-preview-select-ie); + .box-shadow(0 0 0 @scaled-two-px-value @border-preview-select); + } } .menu-picker-container { @@ -391,8 +401,6 @@ } .group-items-container .item { - box-shadow: none; - margin: @scaled-two-px-value 0 0 @scaled-two-px-value; &:last-child { margin-bottom: @combo-dataview-item-margins; } @@ -424,11 +432,10 @@ width: @x-huge-btn-icon-size; height: @x-huge-btn-icon-size; min-width: 0; - margin-top: -2px; } .caption{ - line-height: 18px; + line-height: 12px; font-size: 11px; text-overflow: ellipsis; overflow: hidden; diff --git a/apps/presentationeditor/main/resources/less/animation.less b/apps/presentationeditor/main/resources/less/animation.less index 2c4aff4ff..58d5be4ad 100644 --- a/apps/presentationeditor/main/resources/less/animation.less +++ b/apps/presentationeditor/main/resources/less/animation.less @@ -4,22 +4,6 @@ } } -.a-table{ - display: table; - width: 100%; -} -.a-tr{ - display: table-row; - height: 20px; - border-top: 2px solid transparent; - &.bottom { - border-top: 4px solid transparent; - } - .a-td - { - display: table-cell; - } -} .combo-animation { .menu-picker-container .dataview { @@ -38,15 +22,25 @@ font-weight: bold; } - .group-items-container { + .grouped-data .group-items-container { float: left; position: relative; .item { box-shadow: none; - margin: @scaled-two-px-value 0 0 @scaled-two-px-value; + margin: @scaled-two-px-value; &:last-child { margin-bottom: @scaled-two-px-value; } + + &:hover { + .box-shadow(0 0 0 2px @border-preview-hover-ie); + .box-shadow(0 0 0 @scaled-two-px-value @border-preview-hover); + } + + &.selected { + .box-shadow(0 0 0 2px @border-preview-select-ie); + .box-shadow(0 0 0 @scaled-two-px-value @border-preview-select); + } } } } \ No newline at end of file diff --git a/apps/presentationeditor/main/resources/less/app.less b/apps/presentationeditor/main/resources/less/app.less index 8d5db8d30..b681f127c 100644 --- a/apps/presentationeditor/main/resources/less/app.less +++ b/apps/presentationeditor/main/resources/less/app.less @@ -132,7 +132,6 @@ @import "rightmenu.less"; @import "advanced-settings.less"; @import "document-preview.less"; -@import "transitions.less"; @import "animation.less"; @import "sprites/iconssmall@1x"; diff --git a/apps/presentationeditor/main/resources/less/transitions.less b/apps/presentationeditor/main/resources/less/transitions.less deleted file mode 100644 index 1623fd2ef..000000000 --- a/apps/presentationeditor/main/resources/less/transitions.less +++ /dev/null @@ -1,26 +0,0 @@ -.combo-transitions { - .btn_item { - color: @text-normal-ie; - color: @text-normal; - display: inline-flex; - flex-direction: column; - align-items: center; - - .icon:not(svg) { - width: @x-huge-btn-icon-size; - height: @x-huge-btn-icon-size; - min-width: 0; - margin-top: -2px; - } - - .caption{ - line-height: normal; - font-size: 11px; - text-overflow: ellipsis; - overflow: hidden; - width: 100%; - text-align: center; - padding: 0 2px; - } - } -} \ No newline at end of file From 15ab72745be4c2e0483fa149c55f90b24fd918d2 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 13 Jan 2022 14:38:22 +0300 Subject: [PATCH 8/8] [PE] Fix Bug 54786 --- apps/presentationeditor/main/app/view/Animation.js | 4 ++-- apps/presentationeditor/main/app/view/Transitions.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index 6a9e273a3..cb1d31d83 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -161,7 +161,7 @@ define([ this._arrEffectName = [{group:'none', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'animation-none', displayValue: this.textNone}].concat(Common.define.effectData.getEffectData()); _.forEach(this._arrEffectName,function (elm){elm.tip = elm.displayValue;}); this._arrEffectOptions = []; - var itemWidth = 87, + var itemWidth = 88, itemHeight = 40; this.listEffectsMore = new Common.UI.MenuItem({ caption: this.textMoreEffects @@ -415,7 +415,7 @@ define([ ] })); - var itemWidth = 87, + var itemWidth = 88, itemHeight = 40; var onShowBefore = function(menu) { var picker = new Common.UI.DataView({ diff --git a/apps/presentationeditor/main/app/view/Transitions.js b/apps/presentationeditor/main/app/view/Transitions.js index 400693162..338bdb1c6 100644 --- a/apps/presentationeditor/main/app/view/Transitions.js +++ b/apps/presentationeditor/main/app/view/Transitions.js @@ -136,7 +136,7 @@ define([ item.tip = item.title; }); - var itemWidth = 87, + var itemWidth = 88, itemHeight = 40; this.listEffects = new Common.UI.ComboDataView({ cls: 'combo-transitions',