Merge branch 'feature/config-customization' into develop

This commit is contained in:
Julia Radzhabova 2021-11-10 19:13:28 +03:00
commit b757e3cbc4
58 changed files with 637 additions and 278 deletions

View file

@ -145,12 +145,43 @@
reviewDisplay: 'original', // original for viewer, markup for editor
trackChanges: undefined // true/false - open editor with track changes mode on/off,
},
layout: { // hide elements, but don't disable feature
toolbar: {
file: { // menu file
close: false / true, // close menu button
settings: false / true, // advanced settings
info: false / true // document info
} / false / true,
layout: false / true, // layout tab
references: false / true, // de references tab
collaboration: false / true // collaboration tab
protect: false / true, // protect tab
plugins: false / true // plugins tab
},
header: {
users: false/true // users list button
},
leftMenu: {
navigation: false/true
} / false / true, // use instead of customization.leftMenu
rightMenu: false/true, // use instead of customization.rightMenu
statusBar: {
textLang: false/true // text language button in de/pe
docLang: false/true // document language button in de/pe
}
},
features: { // disable feature
spellcheck: {
mode: false/true // init value
change: false/true // hide/show feature
} / false / true // if false/true - use as init value. use instead of customization.spellcheck parameter
},
chat: true,
comments: true,
zoom: 100,
compactToolbar: false,
leftMenu: true,
rightMenu: true,
leftMenu: true, // must be deprecated. use layout.leftMenu instead
rightMenu: true, // must be deprecated. use layout.rightMenu instead
hideRightMenu: false, // hide or show right panel on first loading
toolbar: true,
statusBar: true,
@ -163,7 +194,7 @@
toolbarNoTabs: false,
toolbarHideFileName: false,
reviewDisplay: 'original', // must be deprecated. use customization.review.reviewDisplay instead
spellcheck: true,
spellcheck: true, // must be deprecated. use customization.features.spellcheck instead
compatibleFeatures: false,
unit: 'cm' // cm, pt, inch,
mentionShare : true // customize tooltip for mention,

View file

@ -99,7 +99,8 @@ define([
'<% if (typeof items[i] == "object") { %>' +
'<li class="ribtab' +
'<% if (items[i].haspanel===false) print(" x-lone") %>' +
'<% if (items[i].extcls) print(\' \' + items[i].extcls) %>">' +
'<% if (items[i].extcls) print(\' \' + items[i].extcls) %>"' +
'<% if (typeof items[i].layoutname == "string") print(" data-layout-name=" + \' \' + items[i].layoutname) + \' \' %>>' +
'<a data-tab="<%= items[i].action %>" data-title="<%= items[i].caption %>" data-hint="0" data-hint-direction="bottom" data-hint-offset="small"><%= items[i].caption %></a>' +
'</li>' +
'<% } %>' +
@ -316,7 +317,7 @@ define([
return config.tabs[index].action;
}
var _tabTemplate = _.template('<li class="ribtab" style="display: none;"><a data-tab="<%= action %>" data-title="<%= caption %>" data-hint="0" data-hint-direction="bottom" data-hint-offset="small"><%= caption %></a></li>');
var _tabTemplate = _.template('<li class="ribtab" style="display: none;" <% if (typeof layoutname == "string") print(" data-layout-name=" + \' \' + layoutname) + \' \' %>><a data-tab="<%= action %>" data-title="<%= caption %>" data-hint="0" data-hint-direction="bottom" data-hint-offset="small"><%= caption %></a></li>');
config.tabs[after + 1] = tab;
var _after_action = _get_tab_action(after);

View file

@ -138,7 +138,7 @@
define([
'common/main/lib/component/BaseView',
'common/main/lib/component/CheckBox',
'common/main/lib/component/FocusManager'
'common/main/lib/controller/FocusManager'
], function () {
'use strict';

View file

@ -0,0 +1,144 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2021
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* LayoutManager.js
*
* Created by Julia Radzhabova on 06.10.2021
* Copyright (c) 2021 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
if (Common.UI === undefined) {
Common.UI = {};
}
Common.UI.LayoutManager = new(function() {
var _config;
var _init = function(config) {
_config = config;
};
var _applyCustomization = function(config, el, prefix) {
!config && (config = _config);
if (!config) return;
for (var name in config) {
if(config.hasOwnProperty(name)) {
if(typeof config[name] === 'object')
_applyCustomization(config[name], el, name + '-');
else if (config[name] === false) {
var selector = '[data-layout-name=' + (prefix || '') + name + ']',
cmp = el ? el.find(selector) : $(selector);
cmp && cmp.hide && cmp.hide();
}
}
}
};
var _isElementVisible = function(value, config, prefix) {
!config && (config = _config);
if (!config) return true;
var res = true;
for (var name in config) {
if(config.hasOwnProperty(name)) {
if(typeof config[name] === 'object')
res = _isElementVisible(value, config[name], (prefix || '') + name + '-');
else {
if (value === (prefix || '') + name) { // checked value is in config
res = config[name];
}
}
if (res===false) return res;
}
}
return res;
};
return {
init: _init,
applyCustomization: _applyCustomization,
isElementVisible: _isElementVisible
}
})();
/**
* features: {
* feature: { //can be object or init value
* mode: <init value> // value1 / value2 ...
* change: false/true // hide/show feature
* } / value1 / value2 ...
* }
*/
Common.UI.FeaturesManager = new(function() {
var _config;
var _init = function(config) {
_config = config;
};
var _canChange = function(name) {
return !(_config && typeof _config[name] === 'object' && _config[name] && _config[name].change===false);
};
var _getInitValue2 = function(name, defValue) {
if (_config && _config[name] !== undefined ) {
if (typeof _config[name] === 'object' && _config[name]) { // object and not null
if (_config[name].mode!==undefined)
return _config[name].mode;
} else
return _config[name];
}
return defValue;
};
var _getInitValue = function(name) {
if (_config && _config[name] !== undefined ) {
if (typeof _config[name] === 'object' && _config[name]) { // object and not null
if (_config[name].mode!==undefined)
return _config[name].mode;
} else
return _config[name];
}
};
return {
init: _init,
canChange: _canChange,
getInitValue: _getInitValue
}
})();

View file

@ -63,7 +63,7 @@ define([
var appOptions = me.getApplication().getController('Main').appOptions;
if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption};
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption, layoutname: 'toolbar-plugins'};
me.$toolbarPanelPlugins = me.panelPlugins.getPanel();
toolbar.addTab(tab, me.$toolbarPanelPlugins, 10); // TODO: clear plugins list in left panel
@ -219,7 +219,7 @@ define([
});
this.api.asc_pluginsRegister('', arr);
if (storePlugins.hasVisible())
Common.NotificationCenter.trigger('tab:visible', 'plugins', true);
Common.NotificationCenter.trigger('tab:visible', 'plugins', Common.UI.LayoutManager.isElementVisible('toolbar-plugins'));
Common.Gateway.pluginsReady();
},

View file

@ -585,13 +585,15 @@ define([
}
},
onTurnSpelling: function (state) {
onTurnSpelling: function (state, suspend) {
state = (state == 'on');
this.view.turnSpelling(state);
this.view && this.view.turnSpelling(state);
Common.localStorage.setItem(this.view.appPrefix + "settings-spellcheck", state ? 1 : 0);
this.api.asc_setSpellCheck(state);
Common.Utils.InternalSettings.set(this.view.appPrefix + "settings-spellcheck", state);
if (Common.UI.FeaturesManager.canChange('spellcheck') && !suspend) {
Common.localStorage.setItem(this.view.appPrefix + "settings-spellcheck", state ? 1 : 0);
this.api.asc_setSpellCheck(state);
Common.Utils.InternalSettings.set(this.view.appPrefix + "settings-spellcheck", state);
}
},
onReviewViewClick: function(menu, item, e) {
@ -802,9 +804,6 @@ define([
onAppReady: function (config) {
var me = this;
if ( me.view && Common.localStorage.getBool(me.view.appPrefix + "settings-spellcheck", !(config.customization && config.customization.spellcheck===false)))
me.view.turnSpelling(true);
if ( config.canReview ) {
(new Promise(function (resolve) {
resolve();

View file

@ -82,7 +82,7 @@ define([
'<div class="btn-slot" id="slot-hbtn-print"></div>' +
'<div class="btn-slot" id="slot-hbtn-download"></div>' +
'</div>' +
'<div class="hedset">' +
'<div class="hedset" data-layout-name="header-users">' +
// '<span class="btn-slot text" id="slot-btn-users"></span>' +
'<section id="tlb-box-users" class="box-cousers dropdown"">' +
'<div class="btn-users" data-hint="0" data-hint-direction="bottom" data-hint-offset="big">' +

View file

@ -207,7 +207,7 @@ define([
})
);
}
Common.NotificationCenter.trigger('tab:visible', 'protect', true);
Common.NotificationCenter.trigger('tab:visible', 'protect', Common.UI.LayoutManager.isElementVisible('toolbar-protect'));
}
setEvents.call(me);

View file

@ -646,7 +646,7 @@ define([
if (!me.btnHistory && separator_last)
me.$el.find(separator_last).hide();
Common.NotificationCenter.trigger('tab:visible', 'review', config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments);
Common.NotificationCenter.trigger('tab:visible', 'review', (config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments) && Common.UI.LayoutManager.isElementVisible('toolbar-collaboration'));
setEvents.call(me);
});
@ -736,7 +736,8 @@ define([
enableToggle: true,
dataHint: '0',
dataHintDirection: 'top',
dataHintOffset: 'small'
dataHintOffset: 'small',
visible: Common.UI.FeaturesManager.canChange('spellcheck')
});
this.btnsSpelling.push(button);
@ -786,7 +787,7 @@ define([
},
turnSpelling: function (state) {
this.btnsSpelling.forEach(function(button) {
this.btnsSpelling && this.btnsSpelling.forEach(function(button) {
if ( button && button.pressed != state ) {
button.toggle(state, true);
}

View file

@ -503,9 +503,11 @@ define([
this.api.asc_setAutoSaveGap(value);
}
value = Common.localStorage.getBool("de-settings-spellcheck", true);
Common.Utils.InternalSettings.set("de-settings-spellcheck", value);
this.api.asc_setSpellCheck(value);
if (Common.UI.FeaturesManager.canChange('spellcheck')) {
value = Common.localStorage.getBool("de-settings-spellcheck", true);
Common.Utils.InternalSettings.set("de-settings-spellcheck", value);
this.api.asc_setSpellCheck(value);
}
value = parseInt(Common.localStorage.getItem("de-settings-paste-button"));
Common.Utils.InternalSettings.set("de-settings-paste-button", value);

View file

@ -53,7 +53,9 @@ define([
'common/main/lib/util/LocalStorage',
'documenteditor/main/app/collection/ShapeGroups',
'documenteditor/main/app/collection/EquationGroups',
'common/main/lib/component/HintManager'
'common/main/lib/controller/FocusManager',
'common/main/lib/controller/HintManager',
'common/main/lib/controller/LayoutManager'
], function () {
'use strict';
@ -1117,9 +1119,17 @@ define([
value = Common.localStorage.getItem("de-show-tableline");
me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true);
value = Common.localStorage.getBool("de-settings-spellcheck", !(this.appOptions.customization && this.appOptions.customization.spellcheck===false));
Common.Utils.InternalSettings.set("de-settings-spellcheck", value);
// spellcheck
value = Common.UI.FeaturesManager.getInitValue('spellcheck');
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.");
if (Common.UI.FeaturesManager.canChange('spellcheck')) { // get from local storage
value = Common.localStorage.getBool("de-settings-spellcheck", value);
Common.Utils.InternalSettings.set("de-settings-spellcheck", value);
}
me.api.asc_setSpellCheck(value);
Common.NotificationCenter.trigger('spelling:turn', value ? 'on' : 'off', true); // only toggle buttons
value = Common.localStorage.getBool("de-settings-compatible", false);
Common.Utils.InternalSettings.set("de-settings-compatible", value);
@ -1471,6 +1481,8 @@ define([
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);
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);
if (this.appOptions.canComments)
Common.NotificationCenter.on('comments:cleardummy', _.bind(this.onClearDummyComment, this));
@ -2059,6 +2071,13 @@ define([
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt) {
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
Common.UI.LayoutManager.applyCustomization();
if (this.appOptions.customization && (typeof (this.appOptions.customization) == 'object')) {
if (this.appOptions.customization.leftMenu!==undefined)
console.warn("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead.");
if (this.appOptions.customization.rightMenu!==undefined)
console.warn("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead.");
}
promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization();
}
}

View file

@ -112,6 +112,13 @@ define([
me.btnSpelling.render( me.statusbar.$layout.find('#btn-doc-spell') );
me.btnDocLang = review.getButton('doclang', 'statusbar');
me.btnDocLang.render( me.statusbar.$layout.find('#btn-doc-lang') );
var isVisible = (Common.UI.LayoutManager.isElementVisible('statusBar-textLang') || Common.UI.LayoutManager.isElementVisible('statusBar-docLang'))
&& Common.UI.FeaturesManager.canChange('spellcheck');
me.btnDocLang.$el.find('+.separator.space')[isVisible?'show':'hide']();
isVisible = Common.UI.LayoutManager.isElementVisible('statusBar-textLang') || Common.UI.LayoutManager.isElementVisible('statusBar-docLang')
|| Common.UI.FeaturesManager.canChange('spellcheck');
me.statusbar.$el.find('.el-lang')[isVisible?'show':'hide']();
} else {
me.statusbar.$el.find('.el-edit, .el-review').hide();
}

View file

@ -3191,11 +3191,11 @@ define([
me.toolbar.render(_.extend({isCompactView: compactview}, config));
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration, layoutname: 'toolbar-collaboration'};
var $panel = me.application.getController('Common.Controllers.ReviewChanges').createToolbarPanel();
if ( $panel ) {
me.toolbar.addTab(tab, $panel, 5);
me.toolbar.setVisible('review', config.isEdit || config.canCoAuthoring && config.canComments); // use config.canViewReview in review controller. set visible review tab in view mode only when asc_HaveRevisionsChanges
me.toolbar.setVisible('review', (config.isEdit || config.canCoAuthoring && config.canComments) && Common.UI.LayoutManager.isElementVisible('toolbar-collaboration') ); // use config.canViewReview in review controller. set visible review tab in view mode only when asc_HaveRevisionsChanges
}
if ( config.isEdit ) {
@ -3217,7 +3217,7 @@ define([
if ( config.isDesktopApp ) {
if ( config.canProtect ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
tab = {action: 'protect', caption: me.toolbar.textTabProtect, layoutname: 'toolbar-protect'};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
if ($panel) me.toolbar.addTab(tab, $panel, 6);

View file

@ -1,6 +1,6 @@
<div class="panel-menu">
<li class="fm-first-item"></li>
<li id="fm-btn-return" class="fm-btn"></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-edit" class="fm-btn"></li>
@ -14,11 +14,11 @@
<li id="fm-btn-recent" class="fm-btn"></li>
<li id="fm-btn-create" class="fm-btn"></li>
<li class="devider"></li>
<li id="fm-btn-info" class="fm-btn"></li>
<li id="fm-btn-info" class="fm-btn" data-layout-name="toolbar-file-info"></li>
<li id="fm-btn-rights" class="fm-btn"></li>
<li id="fm-btn-history" class="fm-btn"></li>
<li class="devider" class="fm-btn"></li>
<li id="fm-btn-settings" class="fm-btn"></li>
<li id="fm-btn-settings" class="fm-btn" data-layout-name="toolbar-file-settings"></li>
<li class="devider"></li>
<li id="fm-btn-help" class="fm-btn"></li>
<li class="devider"></li>

View file

@ -6,7 +6,7 @@
<button id="left-btn-chat" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target="left-panel-chat"><i class="icon toolbar__icon btn-menu-chat">&nbsp;</i></button>
<!-- /** coauthoring end **/ -->
<button id="left-btn-plugins" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-plugin">&nbsp;</i></button>
<button id="left-btn-navigation" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-navigation">&nbsp;</i></button>
<button id="left-btn-navigation" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target="" data-layout-name="leftMenu-navigation"><i class="icon toolbar__icon btn-menu-navigation">&nbsp;</i></button>
<button id="left-btn-thumbnails" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-thumbs">&nbsp;</i></button>
<button id="left-btn-support" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-support">&nbsp;</i></button>
<button id="left-btn-about" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-about">&nbsp;</i></button>

View file

@ -12,10 +12,11 @@
</div>
<div class="status-group" style="">
<div class="separator short el-edit"></div>
<span id="btn-cnt-lang" class="el-edit"></span>
<span id="btn-doc-lang" class="el-edit"></span>
<span id="btn-cnt-lang" class="el-edit" data-layout-name="statusBar-textLang"></span>
<span id="btn-doc-lang" class="el-edit" data-layout-name="statusBar-docLang"></span>
<div class="separator short el-edit space"></div>
<span id="btn-doc-spell" class="el-edit"></span>
<div class="separator short el-edit"></div>
<div class="separator short el-edit el-lang"></div>
<div id="btn-doc-review" class="el-edit el-review" style="display: inline-block;"></div>
<div class="separator short el-edit el-review"></div>
<button id="btn-zoom-topage" type="button" class="btn small btn-toolbar" data-hint="0" data-hint-direction="top" data-hint-offset="small"><span class="icon toolbar__icon btn-ic-zoomtopage">&nbsp;</span></button>

View file

@ -124,7 +124,7 @@
<span class="btn-slot text x-huge" id="slot-btn-controls"></span>
</div>
</section>
<section class="panel" data-tab="layout">
<section class="panel" data-tab="layout" data-layout-name="toolbar-layout">
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-pagemargins"></span>
<span class="btn-slot text x-huge" id="slot-btn-pageorient"></span>
@ -146,7 +146,7 @@
<span class="btn-slot text x-huge" id="slot-btn-watermark"></span>
</div>
</section>
<section class="panel" data-tab="links">
<section class="panel" data-tab="links" data-layout-name="toolbar-references">
<div class="group">
<span class="btn-slot text x-huge btn-contents"></span>
<span class="btn-slot text x-huge" id="slot-btn-contents-update"></span>

View file

@ -7,10 +7,10 @@
<div id="toolbar" class="layout-item hint-section"></div>
<div class="layout-item middle">
<div id="viewport-hbox-layout" class="layout-ct hbox">
<div id="left-menu" class="layout-item hint-section" style="width: 40px;"></div>
<div id="left-menu" class="layout-item hint-section" data-layout-name="leftMenu" style="width: 40px;"></div>
<div id="about-menu-panel" class="left-menu-full-ct" style="display:none;"></div>
<div id="editor-container" class="layout-item"><div id="editor_sdk"></div></div>
<div id="right-menu" class="layout-item hint-section"></div>
<div id="right-menu" class="layout-item hint-section" data-layout-name="rightMenu"></div>
<div id="left-panel-history" class="layout-item"></div>
</div>
</div>

View file

@ -84,6 +84,16 @@ define([
render: function () {
var $markup = $(this.template());
this.miClose = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-return'),
action : 'back',
caption : this.btnCloseMenuCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.miSave = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-save'),
action : 'save',
@ -199,6 +209,16 @@ define([
dataHintOffset: [2, 14]
});
this.miInfo = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-info'),
action : 'info',
caption : this.btnInfoCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.miAccess = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-rights'),
action : 'rights',
@ -223,6 +243,16 @@ define([
delete this.options.miHistory;
}
this.miSettings = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-settings'),
action : 'opts',
caption : this.btnSettingsCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.miHelp = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-help'),
action : 'help',
@ -233,17 +263,19 @@ define([
dataHintOffset: [2, 14]
});
this.miBack = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-back'),
action : 'exit',
caption : this.btnBackCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.items = [];
this.items.push(
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-return'),
action : 'back',
caption : this.btnCloseMenuCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}),
this.miClose,
this.miSave,
this.miEdit,
this.miDownload,
@ -254,37 +286,12 @@ define([
this.miProtect,
this.miRecent,
this.miNew,
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-info'),
action : 'info',
caption : this.btnInfoCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}),
this.miInfo,
this.miAccess,
this.miHistory,
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-settings'),
action : 'opts',
caption : this.btnSettingsCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}),
this.miSettings,
this.miHelp,
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-back'),
// el : _get_el('fm-btn-back'),
action : 'exit',
caption : this.btnBackCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
})
this.miBack
);
this.rendered = true;
@ -350,6 +357,14 @@ define([
if (!this.mode) return;
var lastSeparator,
separatorVisible = false;
var isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-close');
this.miClose[isVisible?'show':'hide']();
this.miClose.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miClose.$el.find('+.devider'));
this.miDownload[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide']();
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']();
@ -359,22 +374,45 @@ define([
this.miPrint[this.mode.canPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miProtect[this.mode.canProtect ?'show':'hide']();
var isVisible = this.mode.canDownload || this.mode.canDownloadOrigin || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect ||
!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp;
this.miProtect.$el.find('+.devider')[isVisible && !this.mode.isDisconnected?'show':'hide']();
separatorVisible = (this.mode.canDownload || this.mode.canDownloadOrigin || this.mode.isEdit || 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'));
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
this.miNew[this.mode.canCreateNew?'show':'hide']();
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
separatorVisible = this.mode.canCreateNew;
this.miNew.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miNew.$el.find('+.devider'));
this.miAccess[(!this.mode.isOffline && this.document&&this.document.info &&
(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings)))?'show':'hide']();
isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-info');
separatorVisible = isVisible;
this.miInfo[isVisible?'show':'hide']();
isVisible = !this.mode.isOffline && this.document&&this.document.info &&
(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings));
separatorVisible = separatorVisible || isVisible;
this.miAccess[isVisible?'show':'hide']();
isVisible = this.mode.canUseHistory&&!this.mode.isDisconnected;
separatorVisible = separatorVisible || isVisible;
this.miHistory[isVisible?'show':'hide']();
this.miHistory.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miHistory.$el.find('+.devider'));
this.miHelp[this.mode.canHelp ?'show':'hide']();
this.miHelp.$el.prev()[this.mode.canHelp ?'show':'hide']();
isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-settings');
this.miSettings[isVisible?'show':'hide']();
this.miSettings.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miSettings.$el.find('+.devider'));
isVisible = this.mode.canHelp;
this.miHelp[isVisible ?'show':'hide']();
this.miHelp.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miHelp.$el.find('+.devider'));
isVisible = this.mode.canBack;
this.miBack[isVisible ?'show':'hide']();
lastSeparator && !isVisible && lastSeparator.hide();
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
this.$el.find('#fm-btn-back').hide().prev().hide();
if (!this.customizationDone) {
this.customizationDone = true;
Common.Utils.applyCustomization(this.mode.customization, {goback: '#fm-btn-back > a'});
@ -415,8 +453,6 @@ define([
this.panels['help'] = ((new DE.Views.FileMenuPanels.Help({menu: this})).render());
this.panels['help'].setLangConfig(this.mode.lang);
}
this.miHistory[this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide']();
},
setMode: function(mode, delay) {

View file

@ -222,10 +222,10 @@ define([
'<td class="left"><label><%= scope.strReviewHover %></label></td>',
'<td class="right"><span id="fms-cmb-review-hover"></span></td>',
'</tr>','<tr class="divider view-review"></tr>',
'<tr class="edit">',
'<tr class="edit spellcheck">',
'<td class="left"><label><%= scope.txtSpellCheck %></label></td>',
'<td class="right"><div id="fms-chb-spell-check"></div></td>',
'</tr>','<tr class="divider edit"></tr>',
'</tr>','<tr class="divider edit spellcheck"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.txtProofing %></label></td>',
'<td class="right"><button type="button" class="btn btn-text-default" id="fms-btn-auto-correct" style="width:auto; display: inline-block;padding-right: 10px;padding-left: 10px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.txtAutoCorrect %></button></div></td>',
@ -612,6 +612,7 @@ define([
$('tr.coauth.changes-mode', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.coauth.changes-show', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide']();
$('tr.view-review', this.el)[mode.canViewReview ? 'show' : 'hide']();
$('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide']();
$('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide']();
/** coauthoring end **/
@ -671,7 +672,8 @@ define([
if (this.mode.canForcesave)
this.chForcesave.setValue(Common.Utils.InternalSettings.get("de-settings-forcesave"));
this.chSpell.setValue(Common.Utils.InternalSettings.get("de-settings-spellcheck"));
if (Common.UI.FeaturesManager.canChange('spellcheck'))
this.chSpell.setValue(Common.Utils.InternalSettings.get("de-settings-spellcheck"));
this.chAlignGuides.setValue(Common.Utils.InternalSettings.get("de-settings-showsnaplines"));
this.chCompatible.setValue(Common.Utils.InternalSettings.get("de-settings-compatible"));
@ -721,7 +723,8 @@ define([
Common.localStorage.setItem("de-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
if (this.mode.canForcesave)
Common.localStorage.setItem("de-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-spellcheck", this.chSpell.isChecked() ? 1 : 0);
if (Common.UI.FeaturesManager.canChange('spellcheck'))
Common.localStorage.setItem("de-settings-spellcheck", this.chSpell.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-compatible", this.chCompatible.isChecked() ? 1 : 0);
Common.Utils.InternalSettings.set("de-settings-compatible", this.chCompatible.isChecked() ? 1 : 0);
Common.Utils.InternalSettings.set("de-settings-showsnaplines", this.chAlignGuides.isChecked());

View file

@ -207,7 +207,6 @@ define([
cls : 'btn-toolbar',
caption : 'English (United States)',
hintAnchor : 'top-left',
style : 'margin-left: 6px;',
disabled: true,
dataHint : '0',
dataHintDirection: 'top',

View file

@ -109,11 +109,11 @@ define([
Common.UI.Mixtbar.prototype.initialize.call(this, {
template: _.template(template),
tabs: [
{caption: me.textTabFile, action: 'file', extcls: 'canedit', haspanel:false},
{caption: me.textTabFile, action: 'file', extcls: 'canedit', layoutname: 'toolbar-file', haspanel:false},
{caption: me.textTabHome, action: 'home', extcls: 'canedit'},
{caption: me.textTabInsert, action: 'ins', extcls: 'canedit'},
{caption: me.textTabLayout, action: 'layout', extcls: 'canedit'},
{caption: me.textTabLinks, action: 'links', extcls: 'canedit'}
{caption: me.textTabLayout, action: 'layout', extcls: 'canedit', layoutname: 'toolbar-layout'},
{caption: me.textTabLinks, action: 'links', extcls: 'canedit', layoutname: 'toolbar-references'}
]
}
);
@ -1398,7 +1398,7 @@ define([
Common.UI.Mixtbar.prototype.initialize.call(this, {
template: _.template(template_view),
tabs: [
{caption: me.textTabFile, action: 'file', haspanel: false}
{caption: me.textTabFile, action: 'file', layoutname: 'toolbar-file', haspanel: false}
]
}
);

View file

@ -43,7 +43,7 @@
border: none;
background: #e2e2e2;
background: var(--canvas-background, #e2e2e2);
z-index: 1001;
z-index: 1002;
}
.loadmask > .brendpanel {

View file

@ -21,7 +21,7 @@
border: none;
background: #e2e2e2;
background: var(--canvas-background, #e2e2e2);
z-index: 1001;
z-index: 1002;
}
.loadmask > .brendpanel {

View file

@ -23,7 +23,7 @@
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 1001;
z-index: 1002;
}
.loader-page {
width: 100%;

View file

@ -24,7 +24,7 @@
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 1001;
z-index: 1002;
}
.loader-page {

View file

@ -30,21 +30,12 @@
text-align: center;
}
#btn-doc-lang {
margin-right: 9px;
}
#btn-doc-spell {
margin-right: 5px;
}
#btn-zoom-topage {
margin-right: 9px;
margin-left: 6px;
margin-right: 8px;
}
#btn-zoom-towidth {
margin-right: 9px;
margin-right: 8px;
}
.status-group {
@ -58,12 +49,17 @@
}
.separator {
margin: 0px 3px 0 4px;
margin: 0px 6px;
&.short {
height: 25px;
margin-top: -2px;
}
&.space {
margin: 0px 2px;
border: none;
}
}
#btn-cnt-lang {

View file

@ -368,9 +368,11 @@ define([
this.api.asc_setAutoSaveGap(value);
}
value = Common.localStorage.getBool("pe-settings-spellcheck", true);
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
this.api.asc_setSpellCheck(value);
if (Common.UI.FeaturesManager.canChange('spellcheck')) {
value = Common.localStorage.getBool("pe-settings-spellcheck", true);
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
this.api.asc_setSpellCheck(value);
}
value = parseInt(Common.localStorage.getItem("pe-settings-paste-button"));
Common.Utils.InternalSettings.set("pe-settings-paste-button", value);

View file

@ -54,7 +54,9 @@ define([
'presentationeditor/main/app/collection/ShapeGroups',
'presentationeditor/main/app/collection/SlideLayouts',
'presentationeditor/main/app/collection/EquationGroups',
'common/main/lib/component/HintManager'
'common/main/lib/controller/FocusManager',
'common/main/lib/controller/HintManager',
'common/main/lib/controller/LayoutManager'
], function () { 'use strict';
PE.Controllers.Main = Backbone.Controller.extend(_.extend((function() {
@ -774,9 +776,17 @@ define([
var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : -1);
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
value = Common.localStorage.getBool("pe-settings-spellcheck", !(this.appOptions.customization && this.appOptions.customization.spellcheck===false));
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
// spellcheck
value = Common.UI.FeaturesManager.getInitValue('spellcheck');
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.");
if (Common.UI.FeaturesManager.canChange('spellcheck')) { // get from local storage
value = Common.localStorage.getBool("pe-settings-spellcheck", value);
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
}
me.api.asc_setSpellCheck(value);
Common.NotificationCenter.trigger('spelling:turn', value ? 'on' : 'off', true); // only toggle buttons
value = Common.localStorage.getBool('pe-hidden-notes', this.appOptions.customization && this.appOptions.customization.hideNotes===true);
me.api.asc_ShowNotes(!value);
@ -1146,6 +1156,8 @@ define([
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.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.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
@ -1696,6 +1708,13 @@ define([
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt) {
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
Common.UI.LayoutManager.applyCustomization();
if (this.appOptions.customization && (typeof (this.appOptions.customization) == 'object')) {
if (this.appOptions.customization.leftMenu!==undefined)
console.log("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead.");
if (this.appOptions.customization.rightMenu!==undefined)
console.log("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead.");
}
promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization();
}
}

View file

@ -107,6 +107,12 @@ define([
me.btnDocLang = review.getButton('doclang', 'statusbar');
me.btnDocLang.render( me.statusbar.$el.find('#btn-doc-lang') );
var isVisible = (Common.UI.LayoutManager.isElementVisible('statusBar-textLang') || Common.UI.LayoutManager.isElementVisible('statusBar-docLang'))
&& Common.UI.FeaturesManager.canChange('spellcheck');
me.btnDocLang.$el.find('+.separator.space')[isVisible?'show':'hide']();
isVisible = Common.UI.LayoutManager.isElementVisible('statusBar-textLang') || Common.UI.LayoutManager.isElementVisible('statusBar-docLang')
|| Common.UI.FeaturesManager.canChange('spellcheck');
me.statusbar.$el.find('.el-lang')[isVisible?'show':'hide']();
} else {
me.statusbar.$el.find('.el-edit, .el-review').hide();
}

View file

@ -2479,11 +2479,11 @@ define([
}
me.toolbar.render(_.extend({compactview: compactview}, config));
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration, layoutname: 'toolbar-collaboration'};
var $panel = me.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
if ( $panel ) {
me.toolbar.addTab(tab, $panel, 4);
me.toolbar.setVisible('review', config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments);
me.toolbar.setVisible('review', (config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments) && Common.UI.LayoutManager.isElementVisible('toolbar-collaboration'));
}
if ( config.isEdit ) {
@ -2510,7 +2510,7 @@ define([
if ( config.isDesktopApp ) {
if ( config.canProtect ) { // don't add protect panel to toolbar
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
tab = {action: 'protect', caption: me.toolbar.textTabProtect, layoutname: 'toolbar-protect'};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
if ($panel)
me.toolbar.addTab(tab, $panel, 4);

View file

@ -1,6 +1,6 @@
<div class="panel-menu">
<li class="fm-first-item"></li>
<li id="fm-btn-return" class="fm-btn"></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-edit" class="fm-btn"></li>
@ -14,11 +14,11 @@
<li id="fm-btn-recent" class="fm-btn"></li>
<li id="fm-btn-create" class="fm-btn"></li>
<li class="devider"></li>
<li id="fm-btn-info" class="fm-btn"></li>
<li id="fm-btn-info" class="fm-btn" data-layout-name="toolbar-file-info"></li>
<li id="fm-btn-rights" class="fm-btn"></li>
<li id="fm-btn-history" class="fm-btn"></li>
<li class="devider" class="fm-btn"></li>
<li id="fm-btn-settings" class="fm-btn"></li>
<li id="fm-btn-settings" class="fm-btn" data-layout-name="toolbar-file-settings"></li>
<li class="devider"></li>
<li id="fm-btn-help" class="fm-btn"></li>
<li class="devider"></li>

View file

@ -27,10 +27,11 @@
<label id="status-label-action" class="status-label"></label>
</div>
<div class="status-group" style="">
<span id="btn-cnt-lang" class="el-edit"></span>
<span id="btn-doc-lang" class="el-edit"></span>
<span id="btn-cnt-lang" class="el-edit" data-layout-name="statusBar-textLang"></span>
<span id="btn-doc-lang" class="el-edit" data-layout-name="statusBar-docLang"></span>
<div class="separator short el-edit space"></div>
<span id="btn-doc-spell" class="el-edit"></span>
<div class="separator short el-edit"></div>
<div class="separator short el-edit el-lang"></div>
<button id="btn-zoom-topage" type="button" class="btn small btn-toolbar" data-hint="0" data-hint-direction="top" data-hint-offset="small"><i class="icon toolbar__icon btn-ic-zoomtoslide"></i></button>
<button id="btn-zoom-towidth" type="button" class="btn small btn-toolbar" data-hint="0" data-hint-direction="top" data-hint-offset="small"><i class="icon toolbar__icon btn-ic-zoomtowidth"></i></button>
<button id="btn-zoom-down" type="button" class="btn small btn-toolbar"><i class="icon toolbar__icon btn-zoomdown"></i></button>

View file

@ -8,10 +8,10 @@
<div id="toolbar" class="layout-item hint-section"></div>
<div class="layout-item middle">
<div id="viewport-hbox-layout" class="layout-ct hbox">
<div id="left-menu" class="layout-item hint-section" style="width: 40px;"></div>
<div id="left-menu" class="layout-item hint-section" data-layout-name="leftMenu" style="width: 40px;"></div>
<div id="about-menu-panel" class="left-menu-full-ct" style="display:none;"></div>
<div id="editor-container" class="layout-item"><div id="editor_sdk"></div></div>
<div id="right-menu" class="layout-item hint-section"></div>
<div id="right-menu" class="layout-item hint-section" data-layout-name="rightMenu"></div>
<div id="left-panel-history" class="layout-item"></div>
</div>
</div>

View file

@ -87,6 +87,16 @@ define([
render: function () {
var $markup = $(this.template());
this.miClose = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-return'),
action : 'back',
caption : this.btnCloseMenuCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.miSave = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-save'),
action : 'save',
@ -200,6 +210,16 @@ define([
dataHintOffset: [2, 14]
});
this.miInfo = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-info'),
action : 'info',
caption : this.btnInfoCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.miAccess = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-rights'),
action : 'rights',
@ -220,6 +240,16 @@ define([
dataHintOffset: [2, 14]
});
this.miSettings = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-settings'),
action : 'opts',
caption : this.btnSettingsCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.miHistory = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-history'),
action : 'history',
@ -234,17 +264,19 @@ define([
delete this.options.miHistory;
}
this.miBack = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-back'),
action : 'exit',
caption : this.btnBackCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.items = [];
this.items.push(
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-return'),
action : 'back',
caption : this.btnCloseMenuCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}),
this.miClose,
this.miSave,
this.miEdit,
this.miDownload,
@ -255,36 +287,12 @@ define([
this.miProtect,
this.miRecent,
this.miNew,
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-info'),
action : 'info',
caption : this.btnInfoCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}),
this.miInfo,
this.miAccess,
this.miHistory,
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-settings'),
action : 'opts',
caption : this.btnSettingsCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}),
this.miSettings,
this.miHelp,
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-back'),
action : 'exit',
caption : this.btnBackCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
})
this.miBack
);
this.rendered = true;
@ -350,6 +358,14 @@ define([
if (!this.mode) return;
var lastSeparator,
separatorVisible = false;
var isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-close');
this.miClose[isVisible?'show':'hide']();
this.miClose.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miClose.$el.find('+.devider'));
this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide']();
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']();
@ -359,26 +375,50 @@ define([
this.miPrint[this.mode.canPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miProtect[this.mode.canProtect ?'show':'hide']();
var isVisible = this.mode.canDownload || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect ||
!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp;
this.miProtect.$el.find('+.devider')[isVisible && !this.mode.isDisconnected?'show':'hide']();
separatorVisible = (this.mode.canDownload || this.mode.isEdit || 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'));
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
this.miNew[this.mode.canCreateNew?'show':'hide']();
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
separatorVisible = this.mode.canCreateNew;
this.miNew.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miNew.$el.find('+.devider'));
this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings)))?'show':'hide']();
isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-info');
separatorVisible = isVisible;
this.miInfo[isVisible?'show':'hide']();
isVisible = !this.mode.isOffline && this.document&&this.document.info &&
(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings));
separatorVisible = separatorVisible || isVisible;
this.miAccess[isVisible?'show':'hide']();
isVisible = this.mode.canUseHistory&&!this.mode.isDisconnected;
separatorVisible = separatorVisible || isVisible;
this.miHistory[isVisible?'show':'hide']();
this.miHistory.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miHistory.$el.find('+.devider'));
isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-settings');
this.miSettings[isVisible?'show':'hide']();
this.miSettings.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miSettings.$el.find('+.devider'));
isVisible = this.mode.canHelp;
this.miHelp[isVisible ?'show':'hide']();
this.miHelp.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miHelp.$el.find('+.devider'));
isVisible = this.mode.canBack;
this.miBack[isVisible ?'show':'hide']();
lastSeparator && !isVisible && lastSeparator.hide();
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
this.$el.find('#fm-btn-back').hide().prev().hide();
if (!this.customizationDone) {
this.customizationDone = true;
Common.Utils.applyCustomization(this.mode.customization, {goback: '#fm-btn-back > a'});
}
this.miHelp[this.mode.canHelp ?'show':'hide']();
this.miHelp.$el.prev()[this.mode.canHelp ?'show':'hide']();
this.panels['opts'].setMode(this.mode);
this.panels['info'].setMode(this.mode);
!this.mode.isDisconnected && this.panels['info'].updateInfo(this.document);
@ -413,8 +453,6 @@ define([
this.panels['help'] = ((new PE.Views.FileMenuPanels.Help({menu: this})).render());
this.panels['help'].setLangConfig(this.mode.lang);
}
this.miHistory[this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide']();
},
setMode: function(mode, delay) {

View file

@ -200,10 +200,10 @@ define([
template: _.template([
'<div class="flex-settings">',
'<table style="margin: 30px 0 0;"><tbody>',
'<tr class="edit">',
'<tr class="edit spellcheck">',
'<td class="left"><label><%= scope.txtSpellCheck %></label></td>',
'<td class="right"><div id="fms-chb-spell-check"></div></td>',
'</tr>','<tr class="divider edit"></tr>',
'</tr>','<tr class="divider edit spellcheck"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.txtProofing %></label></td>',
'<td class="right"><button type="button" class="btn btn-text-default" id="fms-btn-auto-correct" style="width:auto; display: inline-block;padding-right: 10px;padding-left: 10px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.txtAutoCorrect %></button></div></td>',
@ -524,6 +524,7 @@ define([
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide']();
/** coauthoring end **/
$('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show']();
$('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide']();
if ( !Common.UI.Themes.available() ) {
$('tr.themes, tr.themes + tr.divider', this.el).hide();
@ -536,7 +537,8 @@ define([
},
updateSettings: function() {
this.chSpell.setValue(Common.Utils.InternalSettings.get("pe-settings-spellcheck"));
if (Common.UI.FeaturesManager.canChange('spellcheck'))
this.chSpell.setValue(Common.Utils.InternalSettings.get("pe-settings-spellcheck"));
this.chInputMode.setValue(Common.Utils.InternalSettings.get("pe-settings-inputmode"));
@ -596,7 +598,8 @@ define([
applySettings: function() {
Common.UI.Themes.setTheme(this.cmbTheme.getValue());
Common.localStorage.setItem("pe-settings-spellcheck", this.chSpell.isChecked() ? 1 : 0);
if (Common.UI.FeaturesManager.canChange('spellcheck'))
Common.localStorage.setItem("pe-settings-spellcheck", this.chSpell.isChecked() ? 1 : 0);
Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0);
Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue());
Common.Utils.InternalSettings.set("pe-settings-zoom", Common.localStorage.getItem("pe-settings-zoom"));

View file

@ -269,7 +269,6 @@ define([
caption : 'English (United States)',
hint: this.tipSetLang,
hintAnchor : 'top-left',
style : 'margin-left: 6px;',
disabled: true,
dataHint : '0',
dataHintDirection: 'top',

View file

@ -131,7 +131,7 @@ define([
Common.UI.Mixtbar.prototype.initialize.call(this, {
template: _.template(template),
tabs: [
{caption: me.textTabFile, action: 'file', extcls: 'canedit', haspanel:false},
{caption: me.textTabFile, action: 'file', extcls: 'canedit', layoutname: 'toolbar-file', haspanel:false},
{caption: me.textTabHome, action: 'home', extcls: 'canedit'},
{caption: me.textTabInsert, action: 'ins', extcls: 'canedit'},
{caption: me.textTabTransitions, action: 'transit', extcls: 'canedit'}
@ -1089,7 +1089,7 @@ define([
Common.UI.Mixtbar.prototype.initialize.call(this, {
template: _.template(template_view),
tabs: [
{caption: me.textTabFile, action: 'file', haspanel:false}
{caption: me.textTabFile, action: 'file', layoutname: 'toolbar-file', haspanel:false}
]
}
);

View file

@ -33,7 +33,7 @@
border: none;
background: #f0f0f0;
background: var(--canvas-background, #f0f0f0);
z-index: 1001;
z-index: 1002;
}
.loadmask > .brendpanel {

View file

@ -21,7 +21,7 @@
border: none;
background: #f0f0f0;
background: var(--canvas-background, #f0f0f0);
z-index: 1001;
z-index: 1002;
}
.loadmask > .brendpanel {

View file

@ -21,7 +21,7 @@
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 1001;
z-index: 1002;
}
.loader-page {
width: 100%;

View file

@ -24,7 +24,7 @@
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 1001;
z-index: 1002;
}
.loader-page {

View file

@ -33,20 +33,11 @@
}
#btn-zoom-topage {
margin-right: 9px;
margin-left: 6px;
margin-right: 8px;
}
#btn-zoom-towidth {
margin-right: 9px;
}
#btn-doc-lang {
margin-right: 9px;
}
#btn-doc-spell {
margin-right: 5px;
margin-right: 8px;
}
.status-group {
@ -60,10 +51,16 @@
}
.separator {
margin: -2px 3px 0 4px;
margin: 0 6px;
&.short {
height: 25px;
margin-top: -2px;
}
&.space {
margin: 0px 2px;
border: none;
}
}

View file

@ -239,8 +239,8 @@ define([
this.leftMenu.btnComments.hide();
}
if (this.mode.isEdit) {
this.leftMenu.btnSpellcheck.show();
if (this.mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck')) {
Common.UI.LayoutManager.isElementVisible('leftMenu-spellcheck') && this.leftMenu.btnSpellcheck.show();
this.leftMenu.setOptionsPanel('spellcheck', this.getApplication().getController('Spellcheck').getView('Spellcheck'));
}
if (this.mode.canUseHistory)
@ -482,7 +482,7 @@ define([
},
applySpellcheckSettings: function(menu) {
if (this.mode.isEdit && this.api) {
if (this.mode.isEdit && this.api && Common.UI.FeaturesManager.canChange('spellcheck')) {
var value = Common.localStorage.getBool("sse-spellcheck-ignore-uppercase-words");
this.api.asc_ignoreUppercase(value);
value = Common.localStorage.getBool("sse-spellcheck-ignore-numbers-words");

View file

@ -57,7 +57,9 @@ define([
'spreadsheeteditor/main/app/collection/EquationGroups',
'spreadsheeteditor/main/app/collection/ConditionalFormatIcons',
'spreadsheeteditor/main/app/controller/FormulaDialog',
'common/main/lib/component/HintManager'
'common/main/lib/controller/FocusManager',
'common/main/lib/controller/HintManager',
'common/main/lib/controller/LayoutManager'
], function () {
'use strict';
@ -857,14 +859,17 @@ define([
this.api.asc_setAutoSaveGap(Common.Utils.InternalSettings.get("sse-settings-autosave"));
/** coauthoring end **/
/** spellcheck settings begin **/
var ignoreUppercase = Common.localStorage.getBool("sse-spellcheck-ignore-uppercase-words", true);
Common.Utils.InternalSettings.set("sse-spellcheck-ignore-uppercase-words", ignoreUppercase);
this.api.asc_ignoreUppercase(ignoreUppercase);
var ignoreNumbers = Common.localStorage.getBool("sse-spellcheck-ignore-numbers-words", true);
Common.Utils.InternalSettings.set("sse-spellcheck-ignore-numbers-words", ignoreNumbers);
this.api.asc_ignoreNumbers(ignoreNumbers);
/** spellcheck settings end **/
// spellcheck
if (Common.UI.FeaturesManager.canChange('spellcheck')) { // get from local storage
/** spellcheck settings begin **/
var ignoreUppercase = Common.localStorage.getBool("sse-spellcheck-ignore-uppercase-words", true);
Common.Utils.InternalSettings.set("sse-spellcheck-ignore-uppercase-words", ignoreUppercase);
this.api.asc_ignoreUppercase(ignoreUppercase);
var ignoreNumbers = Common.localStorage.getBool("sse-spellcheck-ignore-numbers-words", true);
Common.Utils.InternalSettings.set("sse-spellcheck-ignore-numbers-words", ignoreNumbers);
this.api.asc_ignoreNumbers(ignoreNumbers);
/** spellcheck settings end **/
}
me.api.asc_registerCallback('asc_onStartAction', _.bind(me.onLongActionBegin, me));
me.api.asc_registerCallback('asc_onConfirmAction', _.bind(me.onConfirmAction, me));
@ -916,7 +921,7 @@ define([
this.formulaInput = celleditorController.getView('CellEditor').$el.find('textarea');
if (me.appOptions.isEdit) {
spellcheckController.setApi(me.api).setMode(me.appOptions);
Common.UI.FeaturesManager.canChange('spellcheck') && spellcheckController.setApi(me.api).setMode(me.appOptions);
if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true
me.appOptions.forcesave = Common.localStorage.getBool("sse-settings-forcesave", me.appOptions.canForcesave);
@ -1257,6 +1262,8 @@ define([
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge) {
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.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isOffline;
@ -2051,6 +2058,13 @@ define([
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt) {
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
Common.UI.LayoutManager.applyCustomization();
if (this.appOptions.customization && (typeof (this.appOptions.customization) == 'object')) {
if (this.appOptions.customization.leftMenu!==undefined)
console.log("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead.");
if (this.appOptions.customization.rightMenu!==undefined)
console.log("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead.");
}
promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization();
}
}

View file

@ -3714,11 +3714,11 @@ define([
me.toolbar.render(_.extend({isCompactView: compactview}, config));
if ( !config.isEditDiagram && !config.isEditMailMerge ) {
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration, layoutname: 'toolbar-collaboration'};
var $panel = me.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
if ($panel) {
me.toolbar.addTab(tab, $panel, 6);
me.toolbar.setVisible('review', config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments);
me.toolbar.setVisible('review', (config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments) && Common.UI.LayoutManager.isElementVisible('toolbar-collaboration'));
}
}
@ -3777,7 +3777,7 @@ define([
me.toolbar.btnCopy.$el.removeClass('split');
}
var tab = {action: 'protect', caption: me.toolbar.textTabProtect};
var tab = {action: 'protect', caption: me.toolbar.textTabProtect, layoutname: 'toolbar-protect'};
var $panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
if ($panel) {
config.canProtect && $panel.append($('<div class="separator long"></div>'));

View file

@ -1,6 +1,6 @@
<div class="panel-menu">
<li class="fm-first-item"></li>
<li id="fm-btn-return" class="fm-btn"></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-edit" class="fm-btn"></li>
@ -14,11 +14,11 @@
<li id="fm-btn-recent" class="fm-btn"></li>
<li id="fm-btn-create" class="fm-btn"></li>
<li class="devider"></li>
<li id="fm-btn-info" class="fm-btn"></li>
<li id="fm-btn-info" class="fm-btn" data-layout-name="toolbar-file-info"></li>
<li id="fm-btn-rights" class="fm-btn"></li>
<li id="fm-btn-history" class="fm-btn"></li>
<li class="devider" class="fm-btn"></li>
<li id="fm-btn-settings" class="fm-btn"></li>
<li id="fm-btn-settings" class="fm-btn" data-layout-name="toolbar-file-settings"></li>
<li class="devider"></li>
<li id="fm-btn-help" class="fm-btn"></li>
<li class="devider"></li>

View file

@ -6,7 +6,7 @@
<button id="left-btn-chat" class="btn btn-category" content-target="left-panel-chat" data-hint="0" data-hint-direction="right" data-hint-offset="big"><i class="icon toolbar__icon btn-menu-chat">&nbsp;</i></button>
<!-- /** coauthoring end **/ -->
<button id="left-btn-plugins" class="btn btn-category" content-target="" data-hint="0" data-hint-direction="right" data-hint-offset="big"><i class="icon toolbar__icon btn-menu-plugin">&nbsp;</i></button>
<button id="left-btn-spellcheck" class="btn btn-category" content-target="" data-hint="0" data-hint-direction="right" data-hint-offset="big"><i class="icon toolbar__icon btn-ic-docspell">&nbsp;</i></button>
<button id="left-btn-spellcheck" class="btn btn-category" content-target="" data-hint="0" data-hint-direction="right" data-hint-offset="big" data-layout-name="leftMenu-spellcheck"><i class="icon toolbar__icon btn-ic-docspell">&nbsp;</i></button>
<button id="left-btn-support" class="btn btn-category" content-target="" data-hint="0" data-hint-direction="right" data-hint-offset="big"><i class="icon toolbar__icon btn-menu-support">&nbsp;</i></button>
<button id="left-btn-about" class="btn btn-category" content-target="" data-hint="0" data-hint-direction="right" data-hint-offset="big"><i class="icon toolbar__icon btn-menu-about">&nbsp;</i></button>
</div>

View file

@ -7,7 +7,7 @@
<div id="toolbar" class="layout-item hint-section"></div>
<div class="layout-item">
<div id="viewport-hbox-layout" class="layout-ct hbox">
<div id="left-menu" class="layout-item hint-section" style="width: 40px;"></div>
<div id="left-menu" class="layout-item hint-section" data-layout-name="leftMenu" style="width: 40px;"></div>
<div id="about-menu-panel" class="left-menu-full-ct" style="display:none;"></div>
<div class="layout-item">
<div class="layout-ct vbox">
@ -15,7 +15,7 @@
<div id="editor_sdk" class="layout-item" style="min-height: 100px;"></div>
</div>
</div>
<div id="right-menu" class="layout-item hint-section"></div>
<div id="right-menu" class="layout-item hint-section" data-layout-name="rightMenu"></div>
<div id="left-panel-history" class="layout-item hint-section"></div>
</div>
</div>

View file

@ -74,6 +74,16 @@ define([
render: function () {
var $markup = $(this.template());
this.miClose = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-return'),
action : 'back',
caption : this.btnCloseMenuCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.miSave = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-save'),
action : 'save',
@ -187,6 +197,16 @@ define([
dataHintOffset: [2, 14]
});
this.miInfo = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-info'),
action : 'info',
caption : this.btnInfoCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.miAccess = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-rights'),
action : 'rights',
@ -227,17 +247,19 @@ define([
dataHintOffset: [2, 14]
});
this.miBack = new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-back'),
action : 'exit',
caption : this.btnBackCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
});
this.items = [];
this.items.push(
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-return'),
action : 'back',
caption : this.btnCloseMenuCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}),
this.miClose,
this.miSave,
this.miEdit,
this.miDownload,
@ -248,28 +270,12 @@ define([
this.miProtect,
this.miRecent,
this.miNew,
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-info'),
action : 'info',
caption : this.btnInfoCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
}),
this.miInfo,
this.miAccess,
this.miHistory,
this.miSettings,
this.miHelp,
new Common.UI.MenuItem({
el : $markup.elementById('#fm-btn-back'),
action : 'exit',
caption : this.btnBackCaption,
canFocused: false,
dataHint: 1,
dataHintDirection: 'left-top',
dataHintOffset: [2, 14]
})
this.miBack
);
this.rendered = true;
@ -336,6 +342,14 @@ define([
if (!this.mode) return;
var lastSeparator,
separatorVisible = false;
var isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-close');
this.miClose[isVisible?'show':'hide']();
this.miClose.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miClose.$el.find('+.devider'));
this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide']();
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']();
@ -345,26 +359,50 @@ define([
this.miPrint[this.mode.canPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miProtect[this.mode.canProtect ?'show':'hide']();
var isVisible = this.mode.canDownload || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect ||
!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp;
this.miProtect.$el.find('+.devider')[isVisible && !this.mode.isDisconnected?'show':'hide']();
separatorVisible = (this.mode.canDownload || this.mode.isEdit || 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'));
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
this.miNew[this.mode.canCreateNew?'show':'hide']();
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
separatorVisible = this.mode.canCreateNew;
this.miNew.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miNew.$el.find('+.devider'));
this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings)))?'show':'hide']();
isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-info');
separatorVisible = isVisible;
this.miInfo[isVisible?'show':'hide']();
isVisible = !this.mode.isOffline && this.document&&this.document.info &&
(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings));
separatorVisible = separatorVisible || isVisible;
this.miAccess[isVisible?'show':'hide']();
isVisible = this.mode.canUseHistory&&!this.mode.isDisconnected;
separatorVisible = separatorVisible || isVisible;
this.miHistory[isVisible?'show':'hide']();
this.miHistory.$el.find('+.devider')[separatorVisible?'show':'hide']();
separatorVisible && (lastSeparator = this.miHistory.$el.find('+.devider'));
isVisible = Common.UI.LayoutManager.isElementVisible('toolbar-file-settings');
this.miSettings[isVisible?'show':'hide']();
this.miSettings.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miSettings.$el.find('+.devider'));
isVisible = this.mode.canHelp;
this.miHelp[isVisible ?'show':'hide']();
this.miHelp.$el.find('+.devider')[isVisible?'show':'hide']();
isVisible && (lastSeparator = this.miHelp.$el.find('+.devider'));
isVisible = this.mode.canBack;
this.miBack[isVisible ?'show':'hide']();
lastSeparator && !isVisible && lastSeparator.hide();
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
this.$el.find('#fm-btn-back').hide().prev().hide();
if (!this.customizationDone) {
this.customizationDone = true;
Common.Utils.applyCustomization(this.mode.customization, {goback: '#fm-btn-back > a'});
}
this.miHelp[this.mode.canHelp ?'show':'hide']();
this.miHelp.$el.prev()[this.mode.canHelp ?'show':'hide']();
this.panels['opts'].setMode(this.mode);
this.panels['info'].setMode(this.mode);
!this.mode.isDisconnected && this.panels['info'].updateInfo(this.document);
@ -400,8 +438,6 @@ define([
this.panels['help'].setLangConfig(this.mode.lang);
}
this.miHistory[this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide']();
if ( this.mode.disableEditing != undefined ) {
this.panels['opts'].SetDisabled(this.mode.disableEditing);
delete this.mode.disableEditing;

View file

@ -1491,18 +1491,18 @@ define([
template: _.template([
'<table class="main" style="margin: 30px 0;"><tbody>',
'<tr>',
'<tr class="spellcheck">',
'<td class="left" style="padding-bottom: 8px;"><label><%= scope.strDictionaryLanguage %></label></td>',
'<td class="right" style="padding-bottom: 8px;"><span id="fms-cmb-dictionary-language"></span></td>',
'</tr>',
'<tr>',
'<tr class="spellcheck">',
'<td class="left" style="padding-bottom: 8px;"></td>',
'<td class="right" style="padding-bottom: 8px;"><span id="fms-chb-ignore-uppercase-words"></span></td>',
'</tr>',
'<tr>',
'<tr class="spellcheck">',
'<td class="left"></td>',
'<td class="right"><span id="fms-chb-ignore-numbers-words"></span></td>',
'</tr>','<tr class="divider"></tr>',
'</tr>','<tr class="divider spellcheck"></tr>',
'<tr>',
'<td class="left"><label><%= scope.txtProofing %></label></td>',
'<td class="right"><button type="button" class="btn btn-text-default" id="fms-btn-auto-correct" style="width:auto; display: inline-block;padding-right: 10px;padding-left: 10px;" data-hint="3" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtAutoCorrect %></button></div></td>',
@ -1584,6 +1584,7 @@ define([
setMode: function(mode) {
this.mode = mode;
$('tr.spellcheck', this.el)[Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide']();
},
setApi: function(api) {
@ -1591,6 +1592,8 @@ define([
},
updateSettings: function() {
if (!Common.UI.FeaturesManager.canChange('spellcheck')) return;
var arrLang = SSE.getController('Spellcheck').loadLanguages(),
allLangs = arrLang[0],
langs = arrLang[1],
@ -1627,6 +1630,8 @@ define([
},
applySettings: function() {
if (!Common.UI.FeaturesManager.canChange('spellcheck')) return;
var value = this.chIgnoreUppercase.isChecked();
Common.localStorage.setBool("sse-spellcheck-ignore-uppercase-words", value);
Common.Utils.InternalSettings.set("sse-spellcheck-ignore-uppercase-words", value);

View file

@ -353,10 +353,10 @@ define([
Common.UI.Mixtbar.prototype.initialize.call(this, {
template: _.template(template),
tabs: [
{ caption: me.textTabFile, action: 'file', extcls: 'canedit', haspanel:false},
{ caption: me.textTabFile, action: 'file', extcls: 'canedit', layoutname: 'toolbar-file', haspanel:false},
{ caption: me.textTabHome, action: 'home', extcls: 'canedit'},
{ caption: me.textTabInsert, action: 'ins', extcls: 'canedit'},
{caption: me.textTabLayout, action: 'layout', extcls: 'canedit'},
{caption: me.textTabLayout, action: 'layout', extcls: 'canedit', layoutname: 'toolbar-layout'},
{caption: me.textTabFormula, action: 'formula', extcls: 'canedit'},
{caption: me.textTabData, action: 'data', extcls: 'canedit'},
undefined, undefined, undefined,
@ -1616,7 +1616,7 @@ define([
Common.UI.Mixtbar.prototype.initialize.call(this, {
template: _.template(template_view),
tabs: [
{caption: me.textTabFile, action: 'file', haspanel:false}
{caption: me.textTabFile, action: 'file', layoutname: 'toolbar-file', haspanel:false}
]
}
);

View file

@ -41,7 +41,7 @@
border: none;
background: #e2e2e2;
background: var(--canvas-background, #e2e2e2);
z-index: 1001;
z-index: 1002;
}
.loadmask > .brendpanel {

View file

@ -20,7 +20,7 @@
border: none;
background: #e2e2e2;
background: var(--canvas-background, #e2e2e2);
z-index: 1001;
z-index: 1002;
}
.loadmask > .brendpanel {

View file

@ -20,7 +20,7 @@
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 1001;
z-index: 1002;
}
.loader-page {
width: 100%;

View file

@ -23,7 +23,7 @@
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 1001;
z-index: 1002;
}
.loader-page {