Commit 2b4ebdef authored by Julia Radzhabova's avatar Julia Radzhabova

Changed branding permissions. Use canBranding from license to hiding panels.

parent cd86b759
......@@ -108,7 +108,8 @@
comments: false,
leftMenu: true,
rightMenu: true,
toolbar: true
toolbar: true,
header: true
},
plugins: {
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',
......
......@@ -61,10 +61,14 @@ define([
var mapCustomizationElements = {
about: 'button#left-btn-about',
feedback: 'button#left-btn-support',
goback: '#fm-btn-back > a, #header-back > div',
goback: '#fm-btn-back > a, #header-back > div'
};
var mapCustomizationExtElements = {
toolbar: '#viewport #toolbar',
leftMenu: '#viewport #left-menu',
rightMenu: '#viewport #right-menu'
leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings',
rightMenu: '#viewport #right-menu',
header: '#viewport #header'
};
Common.localStorage.setId('text');
......@@ -965,12 +969,14 @@ define([
this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
this.appOptions.canBranding = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
this.appOptions.canBranding = (licType!==Asc.c_oLicenseResult.Error) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
this.getApplication().getController('Viewport').getView('Common.Views.Header').setBranding(this.editorConfig.customization);
params.asc_getTrial() && this.getApplication().getController('Viewport').getView('Common.Views.Header').setDeveloperMode(true);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
this.applyModeCommonElements();
this.applyModeEditorElements();
......@@ -1403,6 +1409,8 @@ define([
if (!this.appOptions.isDesktopApp)
this.appOptions.customization.about = true;
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt)
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
}
Common.NotificationCenter.trigger('layout:changed', 'main');
......
......@@ -1195,7 +1195,7 @@ define([
]
})
);
if (this.mode.isDesktopApp)
if (this.mode.isDesktopApp || this.mode.canBrandingExt && this.mode.customization && this.mode.customization.header===false)
this.mnuitemHideTitleBar.hide();
this.btnMarkers.setMenu(
......
......@@ -59,10 +59,14 @@ define([
var mapCustomizationElements = {
about: 'button#left-btn-about',
feedback: 'button#left-btn-support',
goback: '#fm-btn-back > a, #header-back > div',
goback: '#fm-btn-back > a, #header-back > div'
};
var mapCustomizationExtElements = {
toolbar: '#viewport #toolbar',
leftMenu: '#viewport #left-menu',
rightMenu: '#viewport #right-menu'
leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings',
rightMenu: '#viewport #right-menu',
header: '#viewport #header'
};
Common.localStorage.setId('presentation');
......@@ -744,12 +748,14 @@ define([
this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
this.appOptions.canBranding = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
this.appOptions.canBranding = (licType!==Asc.c_oLicenseResult.Error) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
this.getApplication().getController('Viewport').getView('Common.Views.Header').setBranding(this.editorConfig.customization);
params.asc_getTrial() && this.getApplication().getController('Viewport').getView('Common.Views.Header').setDeveloperMode(true);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
this.applyModeCommonElements();
this.applyModeEditorElements();
......@@ -1170,6 +1176,8 @@ define([
if (!this.appOptions.isDesktopApp)
this.appOptions.customization.about = true;
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt)
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
}
Common.NotificationCenter.trigger('layout:changed', 'main');
......
......@@ -1282,10 +1282,10 @@ define([
}
}
if (mode.isDesktopApp) {
if (mode.isDesktopApp)
$('.toolbar-group-native').hide();
if (mode.isDesktopApp || mode.canBrandingExt && mode.customization && mode.customization.header===false)
this.mnuitemHideTitleBar.hide();
}
this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
},
......
......@@ -65,10 +65,14 @@ define([
var mapCustomizationElements = {
about: 'button#left-btn-about',
feedback: 'button#left-btn-support',
goback: '#fm-btn-back > a, #header-back > div',
goback: '#fm-btn-back > a, #header-back > div'
};
var mapCustomizationExtElements = {
toolbar: '#viewport #toolbar',
leftMenu: '#viewport #left-menu',
rightMenu: '#viewport #right-menu'
leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings',
rightMenu: '#viewport #right-menu',
header: '#viewport #header'
};
Common.localStorage.setId('table');
......@@ -761,10 +765,12 @@ define([
this.appOptions.canComments = this.appOptions.canLicense && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canBranding = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
this.appOptions.canBranding = (licType!==Asc.c_oLicenseResult.Error) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
this.headerView.setBranding(this.editorConfig.customization);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
params.asc_getTrial() && this.headerView.setDeveloperMode(true);
}
......@@ -1297,6 +1303,8 @@ define([
if (!this.appOptions.isDesktopApp)
this.appOptions.customization.about = true;
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt)
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
}
this.stackLongActions.pop({id: InitApplication, type: Asc.c_oAscAsyncActionType.BlockInteraction});
......
......@@ -1650,10 +1650,10 @@ define([
}
}
if (mode.isDesktopApp) {
if (mode.isDesktopApp)
$('.toolbar-group-native').hide();
if (mode.isDesktopApp || mode.canBrandingExt && mode.customization && mode.customization.header===false)
this.mnuitemHideTitleBar.hide();
}
this.lockToolbar(SSE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment