From c87816d34cd4f069580ecbd6158b5ea9d0ad0e05 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Sat, 27 Jul 2024 13:22:39 +0300 Subject: [PATCH] Refactoring --- apps/documenteditor/main/app/controller/Main.js | 8 +++----- apps/pdfeditor/main/app/controller/Main.js | 8 +++----- apps/presentationeditor/main/app/controller/Main.js | 8 +++----- apps/spreadsheeteditor/main/app/controller/Main.js | 8 +++----- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index a38d5c2fa4..b033053193 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1701,12 +1701,10 @@ define([ Common.UI.LayoutManager.init(this.editorConfig.customization ? this.editorConfig.customization.layout : null, this.appOptions.canBrandingExt, this.api); this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); - var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true), - warn = false; + var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true); if (Common.UI.FeaturesManager.canChange('tabStyle', true) && Common.localStorage.itemExists("de-settings-tab-style")) { // get from local storage value = Common.localStorage.getItem("de-settings-tab-style"); } else if (value === undefined && this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs) { - warn = true; value = 'line'; } Common.Utils.InternalSettings.set("settings-tab-style", value || 'tab'); @@ -1714,11 +1712,11 @@ define([ if (Common.UI.FeaturesManager.canChange('tabBackground', true) && Common.localStorage.itemExists("de-settings-tab-background")) { // get from local storage value = Common.localStorage.getItem("de-settings-tab-background"); } else if (value === undefined && this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs) { - warn = true; value = 'toolbar'; } Common.Utils.InternalSettings.set("settings-tab-background", value || 'header'); - warn && console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' and 'tabBackground' parameters in the 'customization.features' section instead."); + this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs && + console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' and 'tabBackground' parameters in the 'customization.features' section instead."); this.appOptions.canBranding = params.asc_getCustomization(); if (this.appOptions.canBranding) diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index a8ec1e581a..22f126d356 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -1297,12 +1297,10 @@ define([ Common.UI.LayoutManager.init(this.editorConfig.customization ? this.editorConfig.customization.layout : null, this.appOptions.canBrandingExt, this.api); this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); - var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true), - warn = false; + var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true); if (Common.UI.FeaturesManager.canChange('tabStyle', true) && Common.localStorage.itemExists("pdfe-settings-tab-style")) { // get from local storage value = Common.localStorage.getItem("pdfe-settings-tab-style"); } else if (value === undefined && this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs) { - warn = true; value = 'line'; } Common.Utils.InternalSettings.set("settings-tab-style", value || 'tab'); @@ -1310,11 +1308,11 @@ define([ if (Common.UI.FeaturesManager.canChange('tabBackground', true) && Common.localStorage.itemExists("pdfe-settings-tab-background")) { // get from local storage value = Common.localStorage.getItem("pdfe-settings-tab-background"); } else if (value === undefined && this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs) { - warn = true; value = 'toolbar'; } Common.Utils.InternalSettings.set("settings-tab-background", value || 'header'); - warn && console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' and 'tabBackground' parameters in the 'customization.features' section instead."); + this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs && + console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' and 'tabBackground' parameters in the 'customization.features' section instead."); this.appOptions.canBranding = params.asc_getCustomization(); if (this.appOptions.canBranding) diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 2b395d0c15..1c896f014b 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1325,12 +1325,10 @@ define([ Common.UI.LayoutManager.init(this.editorConfig.customization ? this.editorConfig.customization.layout : null, this.appOptions.canBrandingExt, this.api); this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); - var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true), - warn = false; + var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true); if (Common.UI.FeaturesManager.canChange('tabStyle', true) && Common.localStorage.itemExists("pe-settings-tab-style")) { // get from local storage value = Common.localStorage.getItem("pe-settings-tab-style"); } else if (value === undefined && this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs) { - warn = true; value = 'line'; } Common.Utils.InternalSettings.set("settings-tab-style", value || 'tab'); @@ -1338,11 +1336,11 @@ define([ if (Common.UI.FeaturesManager.canChange('tabBackground', true) && Common.localStorage.itemExists("pe-settings-tab-background")) { // get from local storage value = Common.localStorage.getItem("pe-settings-tab-background"); } else if (value === undefined && this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs) { - warn = true; value = 'toolbar'; } Common.Utils.InternalSettings.set("settings-tab-background", value || 'header'); - warn && console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' and 'tabBackground' parameters in the 'customization.features' section instead."); + this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs && + console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' and 'tabBackground' parameters in the 'customization.features' section instead."); this.appOptions.canBranding = params.asc_getCustomization(); if (this.appOptions.canBranding) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index ff872d479b..727f168d54 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1391,12 +1391,10 @@ define([ Common.UI.LayoutManager.init(this.editorConfig.customization ? this.editorConfig.customization.layout : null, this.appOptions.canBrandingExt, this.api); this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); - var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true), - warn = false; + var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true); if (Common.UI.FeaturesManager.canChange('tabStyle', true) && Common.localStorage.itemExists("sse-settings-tab-style")) { // get from local storage value = Common.localStorage.getItem("sse-settings-tab-style"); } else if (value === undefined && this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs) { - warn = true; value = 'line'; } Common.Utils.InternalSettings.set("settings-tab-style", value || 'tab'); @@ -1404,11 +1402,11 @@ define([ if (Common.UI.FeaturesManager.canChange('tabBackground', true) && Common.localStorage.itemExists("sse-settings-tab-background")) { // get from local storage value = Common.localStorage.getItem("sse-settings-tab-background"); } else if (value === undefined && this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs) { - warn = true; value = 'toolbar'; } Common.Utils.InternalSettings.set("settings-tab-background", value || 'header'); - warn && console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' and 'tabBackground' parameters in the 'customization.features' section instead."); + this.editorConfig.customization && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.toolbarNoTabs && + console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' and 'tabBackground' parameters in the 'customization.features' section instead."); this.appOptions.canBranding = params.asc_getCustomization(); if (this.appOptions.canBranding)