Show/hide tab style option

This commit is contained in:
Julia Radzhabova
2024-06-27 15:23:00 +03:00
parent f3e42ea2e0
commit 5e59480ecd
5 changed files with 27 additions and 16 deletions

View File

@ -205,6 +205,10 @@
change: false/true // hide/show feature in de/pe/sse
} / false / true // if false/true - use as init value in de/pe. use instead of customization.spellcheck parameter
roles: false/true // hide/show Roles manager, roles settings in right panel and roles in View form button in de
tabStyle: {
mode: 'tab'/'line'/'underline' // init value, 'tab' by default,
change: true/false // hide/show feature
} / 'tab'/'line'/'underline' // if string - use as init value
},
font: {
name: "Arial",
@ -225,8 +229,7 @@
showReviewChanges: false, // must be deprecated. use customization.review.showReviewChanges instead
help: true,
compactHeader: false,
toolbarNoTabs: false, // must be deprecated. use tabStyle='underline' instead
tabStyle: 'tab'/'line'/'underline' // tab by default
toolbarNoTabs: false, // must be deprecated. use features.tabStyle.mode='underline' instead
toolbarHideFileName: false,
reviewDisplay: 'original', // must be deprecated. use customization.review.reviewDisplay instead
spellcheck: true, // must be deprecated. use customization.features.spellcheck instead
@ -1104,8 +1107,13 @@
if (config.editorConfig && config.editorConfig.customization && !!config.editorConfig.customization.compactHeader)
params += "&compact=true";
if (config.editorConfig && config.editorConfig.customization && !!config.editorConfig.customization.tabStyle)
params += "&tabStyle=" + config.editorConfig.customization.tabStyle;
if (config.editorConfig && config.editorConfig.customization && config.editorConfig.customization.features && config.editorConfig.customization.features.tabStyle) {
if (typeof config.editorConfig.customization.features.tabStyle === 'object') {
params += "&tabStyle=" + (config.editorConfig.customization.features.tabStyle.mode || "tab") + (config.editorConfig.customization.features.tabStyle.change!==false ? "-ls" : "");
} else
params += "&tabStyle=" + config.editorConfig.customization.features.tabStyle + "-ls";
}
if (config.editorConfig && config.editorConfig.customization && (config.editorConfig.customization.toolbar===false))
params += "&toolbar=false";

View File

@ -1697,10 +1697,16 @@ define([
this.appOptions.fileKey = this.document.key;
var value = Common.localStorage.getItem("de-settings-tab-style");
if (value===null) {
value = this.appOptions.customization && (typeof (this.appOptions.customization) == 'object') ? (this.appOptions.customization.tabStyle ? this.appOptions.customization.tabStyle :
this.appOptions.customization.toolbarNoTabs ? 'underline' : 'tab' ) : 'tab';
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
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);
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.appOptions.customization && (typeof (this.appOptions.customization) == 'object') && this.appOptions.customization.toolbarNoTabs) {
console.log("Obsolete: The 'toolbarNoTabs' parameter of the 'customization' section is deprecated. Please use 'tabStyle' parameter in the 'customization.features' section instead.");
value = 'underline';
}
Common.Utils.InternalSettings.set("de-settings-tab-style", value || 'tab');
@ -1725,10 +1731,7 @@ define([
appHeader.setUserAvatar(this.appOptions.user.image);
this.appOptions.canRename && appHeader.setCanRename(true);
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);
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);
Common.UI.ExternalUsers.init(this.appOptions.canRequestUsers, this.api);
this.appOptions.user.image ? Common.UI.ExternalUsers.setImage(this.appOptions.user.id, this.appOptions.user.image) : Common.UI.ExternalUsers.get('info', this.appOptions.user.id);

View File

@ -226,7 +226,7 @@ define([
toggleGroup: 'interface-theme'
});
}
_add_tab_styles();
Common.UI.FeaturesManager.canChange('tabStyle', true) && _add_tab_styles();
}
Common.NotificationCenter.on('uitheme:countchanged', _fill_themes.bind(me));

View File

@ -339,8 +339,8 @@
isForm && document.body.classList.add('pdf-form');
(compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove();
if ( checkLocalStorage && localStorage.getItem("de-settings-tab-style") !== null ) {
tabStyle = localStorage.getItem("de-settings-tab-style");
if ( !tabStyle || /-ls$/.test(tabStyle)) {// try get tab style from localstorage
tabStyle = checkLocalStorage && localStorage.getItem("de-settings-tab-style") !== null ? localStorage.getItem("de-settings-tab-style") : tabStyle ? tabStyle.match(/(.*?)-ls/)[1] : 'tab';
}
if (compact || view) {

View File

@ -302,8 +302,8 @@
isForm && document.body.classList.add('pdf-form');
(compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove();
if ( checkLocalStorage && localStorage.getItem("de-settings-tab-style") !== null ) {
tabStyle = localStorage.getItem("de-settings-tab-style");
if ( !tabStyle || /-ls$/.test(tabStyle)) {// try get tab style from localstorage
tabStyle = checkLocalStorage && localStorage.getItem("de-settings-tab-style") !== null ? localStorage.getItem("de-settings-tab-style") : tabStyle ? tabStyle.match(/(.*?)-ls/)[1] : 'tab';
}
if (compact || view) {