Merge pull request #1334 from ONLYOFFICE/feature/config-customization

Feature/config customization
This commit is contained in:
Julia Radzhabova 2021-11-19 00:07:06 +03:00 committed by GitHub
commit 3152b56a72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 24 additions and 15 deletions

View file

@ -151,6 +151,7 @@
close: false / true, // close menu button
settings: false / true, // advanced settings
info: false / true // document info
save: false/true // save button
} / false / true,
home: {
mailmerge: false/true // mail merge button
@ -160,9 +161,11 @@
collaboration: false / true // collaboration tab
protect: false / true, // protect tab
plugins: false / true // plugins tab
save: false/true // save button on toolbar in
},
header: {
users: false/true // users list button
save: false/true // save button
},
leftMenu: {
navigation: false/true,
@ -172,6 +175,7 @@
statusBar: {
textLang: false/true // text language button in de/pe
docLang: false/true // document language button in de/pe
actionStatus: false/true // status of operation
}
},
features: { // disable feature

View file

@ -118,7 +118,7 @@ define([
var templateTitleBox = '<section id="box-document-title">' +
'<div class="extra"></div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-dt-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-save" data-layout-name="header-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-print"></div>' +
'<div class="btn-slot" id="slot-btn-dt-undo"></div>' +
'<div class="btn-slot" id="slot-btn-dt-redo"></div>' +

View file

@ -2,7 +2,7 @@
<li class="fm-first-item"></li>
<li id="fm-btn-return" class="fm-btn" data-layout-name="toolbar-file-close"></li>
<li class="devider"></li>
<li id="fm-btn-save" class="fm-btn"></li>
<li id="fm-btn-save" class="fm-btn" data-layout-name="toolbar-file-save"></li>
<li id="fm-btn-edit" class="fm-btn"></li>
<li id="fm-btn-download" class="fm-btn"></li>
<li id="fm-btn-save-copy" class="fm-btn"></li>

View file

@ -8,7 +8,7 @@
</div>
</div>
<div class="status-group" style="width:100%; text-align:center;">
<label id="label-action" class="status-label"></label>
<label id="label-action" class="status-label" data-layout-name="statusBar-actionStatus"></label>
</div>
<div class="status-group" style="">
<div class="separator short el-edit"></div>

View file

@ -11,7 +11,7 @@
<span class="btn-slot" id="slot-btn-print"></span>
</div>
<div class="elset">
<span class="btn-slot" id="slot-btn-save"></span>
<span class="btn-slot" id="slot-btn-save" data-layout-name="toolbar-save"></span>
</div>
</div>
<div class="separator long"></div>

View file

@ -369,12 +369,12 @@ define([
var isBCSupport = window["AscDesktopEditor"] ? window["AscDesktopEditor"]["isBlockchainSupport"]() : false;
this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) && !isBCSupport ?'show':'hide']();
this.miSaveAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide']();
this.miSave[this.mode.isEdit?'show':'hide']();
this.miSave[this.mode.isEdit && Common.UI.LayoutManager.isElementVisible('toolbar-file-save') ?'show':'hide']();
this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide']();
this.miPrint[this.mode.canPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miProtect[this.mode.canProtect ?'show':'hide']();
separatorVisible = (this.mode.canDownload || this.mode.canDownloadOrigin || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect ||
separatorVisible = (this.mode.canDownload || this.mode.canDownloadOrigin || this.mode.isEdit && Common.UI.LayoutManager.isElementVisible('toolbar-file-save') || this.mode.canPrint || this.mode.canProtect ||
!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp) && !this.mode.isDisconnected;
this.miProtect.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miProtect.$el.find('+.devider'));

View file

@ -2,7 +2,7 @@
<li class="fm-first-item"></li>
<li id="fm-btn-return" class="fm-btn" data-layout-name="toolbar-file-close"></li>
<li class="devider"></li>
<li id="fm-btn-save" class="fm-btn"></li>
<li id="fm-btn-save" class="fm-btn" data-layout-name="toolbar-file-save"></li>
<li id="fm-btn-edit" class="fm-btn"></li>
<li id="fm-btn-download" class="fm-btn"></li>
<li id="fm-btn-save-copy" class="fm-btn"></li>

View file

@ -24,7 +24,7 @@
<div class="separator short" style="margin-left: 10px;"></div>
</div>
<div class="status-group" style="width:100%; text-align:center;">
<label id="status-label-action" class="status-label"></label>
<label id="status-label-action" class="status-label" data-layout-name="statusBar-actionStatus"></label>
</div>
<div class="status-group" style="">
<span id="btn-cnt-lang" class="el-edit" data-layout-name="statusBar-textLang"></span>

View file

@ -11,7 +11,7 @@
<span class="btn-slot" id="slot-btn-print"></span>
</div>
<div class="elset">
<span class="btn-slot" id="slot-btn-save"></span>
<span class="btn-slot" id="slot-btn-save" data-layout-name="toolbar-save"></span>
</div>
</div>
<div class="separator long"></div>

View file

@ -370,12 +370,12 @@ define([
var isBCSupport = window["AscDesktopEditor"] ? window["AscDesktopEditor"]["isBlockchainSupport"]() : false;
this.miSaveCopyAs[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) && !isBCSupport ?'show':'hide']();
this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide']();
this.miSave[this.mode.isEdit?'show':'hide']();
this.miSave[this.mode.isEdit && Common.UI.LayoutManager.isElementVisible('toolbar-file-save') ?'show':'hide']();
this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide']();
this.miPrint[this.mode.canPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miProtect[this.mode.canProtect ?'show':'hide']();
separatorVisible = (this.mode.canDownload || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect ||
separatorVisible = (this.mode.canDownload || this.mode.isEdit && Common.UI.LayoutManager.isElementVisible('toolbar-file-save') || this.mode.canPrint || this.mode.canProtect ||
!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp) && !this.mode.isDisconnected;
this.miProtect.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miProtect.$el.find('+.devider'));

View file

@ -254,6 +254,11 @@ define([
this.statusbar.$el.css('z-index', '');
this.statusbar.tabMenu.on('item:click', _.bind(this.onTabMenu, this));
this.statusbar.btnAddWorksheet.on('click', _.bind(this.onAddWorksheetClick, this));
if (!Common.UI.LayoutManager.isElementVisible('statusBar-actionStatus')) {
this.statusbar.customizeStatusBarMenu.items[0].setVisible(false);
this.statusbar.customizeStatusBarMenu.items[1].setVisible(false);
this.statusbar.boxAction.addClass('hide');
}
Common.NotificationCenter.on('window:resize', _.bind(this.onWindowResize, this));
Common.NotificationCenter.on('cells:range', _.bind(this.onRangeDialogMode, this));

View file

@ -2,7 +2,7 @@
<li class="fm-first-item"></li>
<li id="fm-btn-return" class="fm-btn" data-layout-name="toolbar-file-close"></li>
<li class="devider"></li>
<li id="fm-btn-save" class="fm-btn"></li>
<li id="fm-btn-save" class="fm-btn" data-layout-name="toolbar-file-save"></li>
<li id="fm-btn-edit" class="fm-btn"></li>
<li id="fm-btn-download" class="fm-btn"></li>
<li id="fm-btn-save-copy" class="fm-btn"></li>

View file

@ -11,7 +11,7 @@
<span class="btn-slot" id="slot-btn-print"></span>
</div>
<div class="elset">
<span class="btn-slot" id="slot-btn-save"></span>
<span class="btn-slot" id="slot-btn-save" data-layout-name="toolbar-save"></span>
</div>
</div>
<div class="separator long"></div>

View file

@ -354,12 +354,12 @@ define([
var isBCSupport = window["AscDesktopEditor"] ? window["AscDesktopEditor"]["isBlockchainSupport"]() : false;
this.miSaveCopyAs[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) && !isBCSupport ?'show':'hide']();
this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide']();
this.miSave[this.mode.isEdit?'show':'hide']();
this.miSave[this.mode.isEdit && Common.UI.LayoutManager.isElementVisible('toolbar-file-save') ?'show':'hide']();
this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide']();
this.miPrint[this.mode.canPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miProtect[this.mode.canProtect ?'show':'hide']();
separatorVisible = (this.mode.canDownload || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect ||
separatorVisible = (this.mode.canDownload || this.mode.isEdit && Common.UI.LayoutManager.isElementVisible('toolbar-file-save') || this.mode.canPrint || this.mode.canProtect ||
!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp) && !this.mode.isDisconnected;
this.miProtect.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miProtect.$el.find('+.devider'));