From 0434a5eed8ae74df2bf6c1a7d912af408cca5690 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 17 Feb 2022 11:48:07 +0300 Subject: [PATCH 1/2] [DE] Forms: add separators for text field settings --- .../main/app/template/FormSettings.template | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/documenteditor/main/app/template/FormSettings.template b/apps/documenteditor/main/app/template/FormSettings.template index 19920e183..2c2950bd1 100644 --- a/apps/documenteditor/main/app/template/FormSettings.template +++ b/apps/documenteditor/main/app/template/FormSettings.template @@ -72,6 +72,11 @@
+ + +
+ +
@@ -89,6 +94,11 @@
+ + +
+ + From aefae658116e6f00e8bac611ce3149a7112eea4e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 17 Feb 2022 12:40:10 +0300 Subject: [PATCH 2/2] FeaturesManager: change license for some settings --- .../main/lib/controller/LayoutManager.js | 18 ++++++++++-------- .../documenteditor/main/app/controller/Main.js | 4 ++-- .../main/app/controller/Main.js | 4 ++-- .../main/app/controller/Main.js | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/apps/common/main/lib/controller/LayoutManager.js b/apps/common/main/lib/controller/LayoutManager.js index f5197981d..8a31ae069 100644 --- a/apps/common/main/lib/controller/LayoutManager.js +++ b/apps/common/main/lib/controller/LayoutManager.js @@ -105,17 +105,19 @@ Common.UI.LayoutManager = new(function() { * } */ Common.UI.FeaturesManager = new(function() { - var _config; - var _init = function(config) { + var _config, + _licensed; + var _init = function(config, licensed) { _config = config; + _licensed = licensed; }; - var _canChange = function(name) { - return !(_config && typeof _config[name] === 'object' && _config[name] && _config[name].change===false); + var _canChange = function(name, force) { + return !((_licensed || force) && _config && typeof _config[name] === 'object' && _config[name] && _config[name].change===false); }; - var _getInitValue2 = function(name, defValue) { - if (_config && _config[name] !== undefined ) { + var _getInitValue2 = function(name, defValue, force) { + if ((_licensed || force) && _config && _config[name] !== undefined ) { if (typeof _config[name] === 'object' && _config[name]) { // object and not null if (_config[name].mode!==undefined) return _config[name].mode; @@ -126,8 +128,8 @@ Common.UI.FeaturesManager = new(function() { return defValue; }; - var _getInitValue = function(name) { - if (_config && _config[name] !== undefined ) { + var _getInitValue = function(name, force) { + if ((_licensed || force) && _config && _config[name] !== undefined ) { if (typeof _config[name] === 'object' && _config[name]) { // object and not null if (_config[name].mode!==undefined) return _config[name].mode; diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index d137d0c24..92e50bca3 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1148,7 +1148,7 @@ define([ me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true); // spellcheck - value = Common.UI.FeaturesManager.getInitValue('spellcheck'); + value = Common.UI.FeaturesManager.getInitValue('spellcheck', true); value = (value !== undefined) ? value : !(this.appOptions.customization && this.appOptions.customization.spellcheck===false); if (this.appOptions.customization && this.appOptions.customization.spellcheck!==undefined) console.log("Obsolete: The 'spellcheck' parameter of the 'customization' section is deprecated. Please use 'spellcheck' parameter in the 'customization.features' section instead."); @@ -1518,7 +1518,7 @@ define([ this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions, this.api); this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout); - this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features); + this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); if (this.appOptions.canComments) Common.NotificationCenter.on('comments:cleardummy', _.bind(this.onClearDummyComment, this)); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index fb233c49e..ed6371244 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -788,7 +788,7 @@ define([ (zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100)); // spellcheck - value = Common.UI.FeaturesManager.getInitValue('spellcheck'); + value = Common.UI.FeaturesManager.getInitValue('spellcheck', true); value = (value !== undefined) ? value : !(this.appOptions.customization && this.appOptions.customization.spellcheck===false); if (this.appOptions.customization && this.appOptions.customization.spellcheck!==undefined) console.log("Obsolete: The 'spellcheck' parameter of the 'customization' section is deprecated. Please use 'spellcheck' parameter in the 'customization.features' section instead."); @@ -1174,7 +1174,7 @@ define([ this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout); - this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features); + this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 574c767e9..1284538bd 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1279,7 +1279,7 @@ define([ this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout); - this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features); + this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); } this.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isOffline;