Merge pull request #1576 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2022-02-17 12:51:35 +03:00 committed by GitHub
commit 52b9578299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 13 deletions

View file

@ -105,17 +105,19 @@ Common.UI.LayoutManager = new(function() {
* }
*/
Common.UI.FeaturesManager = new(function() {
var _config;
var _init = function(config) {
var _config,
_licensed;
var _init = function(config, licensed) {
_config = config;
_licensed = licensed;
};
var _canChange = function(name) {
return !(_config && typeof _config[name] === 'object' && _config[name] && _config[name].change===false);
var _canChange = function(name, force) {
return !((_licensed || force) && _config && typeof _config[name] === 'object' && _config[name] && _config[name].change===false);
};
var _getInitValue2 = function(name, defValue) {
if (_config && _config[name] !== undefined ) {
var _getInitValue2 = function(name, defValue, force) {
if ((_licensed || force) && _config && _config[name] !== undefined ) {
if (typeof _config[name] === 'object' && _config[name]) { // object and not null
if (_config[name].mode!==undefined)
return _config[name].mode;
@ -126,8 +128,8 @@ Common.UI.FeaturesManager = new(function() {
return defValue;
};
var _getInitValue = function(name) {
if (_config && _config[name] !== undefined ) {
var _getInitValue = function(name, force) {
if ((_licensed || force) && _config && _config[name] !== undefined ) {
if (typeof _config[name] === 'object' && _config[name]) { // object and not null
if (_config[name].mode!==undefined)
return _config[name].mode;

View file

@ -1148,7 +1148,7 @@ define([
me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true);
// spellcheck
value = Common.UI.FeaturesManager.getInitValue('spellcheck');
value = Common.UI.FeaturesManager.getInitValue('spellcheck', true);
value = (value !== undefined) ? value : !(this.appOptions.customization && this.appOptions.customization.spellcheck===false);
if (this.appOptions.customization && this.appOptions.customization.spellcheck!==undefined)
console.log("Obsolete: The 'spellcheck' parameter of the 'customization' section is deprecated. Please use 'spellcheck' parameter in the 'customization.features' section instead.");
@ -1518,7 +1518,7 @@ define([
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions, this.api);
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout);
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features);
this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt);
if (this.appOptions.canComments)
Common.NotificationCenter.on('comments:cleardummy', _.bind(this.onClearDummyComment, this));

View file

@ -72,6 +72,11 @@
<div id="form-chb-multiline"></div>
</td>
</tr>
<tr class="form-textfield">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr class="form-textfield">
<td class="padding-small">
<div id="form-chb-max-chars" style="display: inline-block;margin-top: 4px;"></div>
@ -89,6 +94,11 @@
<div id="form-spin-width" style="display: inline-block; float: right;"></div>
</td>
</tr>
<tr class="form-textfield">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr class="form-image">
<td class="padding-small">
<label class="input-label"><%= scope.textScale %></label>

View file

@ -788,7 +788,7 @@ define([
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
// spellcheck
value = Common.UI.FeaturesManager.getInitValue('spellcheck');
value = Common.UI.FeaturesManager.getInitValue('spellcheck', true);
value = (value !== undefined) ? value : !(this.appOptions.customization && this.appOptions.customization.spellcheck===false);
if (this.appOptions.customization && this.appOptions.customization.spellcheck!==undefined)
console.log("Obsolete: The 'spellcheck' parameter of the 'customization' section is deprecated. Please use 'spellcheck' parameter in the 'customization.features' section instead.");
@ -1174,7 +1174,7 @@ define([
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions);
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout);
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features);
this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt);
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);

View file

@ -1279,7 +1279,7 @@ define([
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions);
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout);
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features);
this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt);
}
this.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isOffline;