From fc2bcf24bd12e4d5d6247792d351ca5f16d3561c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 2 Apr 2021 22:36:08 +0300 Subject: [PATCH] [PE][SSE] Add api parameters for co-authoring mode --- .../main/app/view/FileMenuPanels.js | 5 +- .../main/app/controller/LeftMenu.js | 17 ++-- .../main/app/controller/Main.js | 76 +++++++++++------ .../main/app/view/FileMenuPanels.js | 15 ++-- .../main/app/controller/LeftMenu.js | 17 ++-- .../main/app/controller/Main.js | 82 ++++++++++++------- .../main/app/view/FileMenuPanels.js | 15 ++-- 7 files changed, 142 insertions(+), 85 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 361bf86a3..62dd996f8 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -610,9 +610,6 @@ define([ applySettings: function() { Common.UI.Themes.setTheme(this.cmbTheme.getValue()); - - var fast_coauth = Common.Utils.InternalSettings.get("de-settings-coauthmode"); - Common.localStorage.setItem("de-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("de-settings-zoom", Common.localStorage.getItem("de-settings-zoom")); @@ -629,7 +626,7 @@ define([ var item = this.cmbFontRender.store.findWhere({value: 'custom'}); Common.localStorage.setItem("de-settings-cachemode", item && !item.get('checked') ? 0 : 1); Common.localStorage.setItem("de-settings-unit", this.cmbUnit.getValue()); - if (this.mode.canChangeCoAuthoring || !fast_coauth) + if (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("de-settings-coauthmode")) 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); diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index 4ecaeb2ba..c96ed5458 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -340,11 +340,14 @@ define([ Common.Utils.InternalSettings.set("pe-settings-inputmode", value); this.api.SetTextBoxInputMode(value); + var fast_coauth = Common.Utils.InternalSettings.get("pe-settings-coauthmode"); /** coauthoring begin **/ if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { - value = Common.localStorage.getBool("pe-settings-coauthmode", true); - Common.Utils.InternalSettings.set("pe-settings-coauthmode", value); - this.api.asc_SetFastCollaborative(value); + if (this.mode.canChangeCoAuthoring) { + fast_coauth = Common.localStorage.getBool("pe-settings-coauthmode", true); + Common.Utils.InternalSettings.set("pe-settings-coauthmode", fast_coauth); + this.api.asc_SetFastCollaborative(fast_coauth); + } } /** coauthoring end **/ @@ -357,9 +360,11 @@ define([ this.api.SetFontRenderingMode(parseInt(value)); if (this.mode.isEdit) { - value = parseInt(Common.localStorage.getItem("pe-settings-autosave")); - Common.Utils.InternalSettings.set("pe-settings-autosave", value); - this.api.asc_setAutoSaveGap(value); + if (this.mode.canChangeCoAuthoring || !fast_coauth) {// can change co-auth. mode or for strict mode + value = parseInt(Common.localStorage.getItem("pe-settings-autosave")); + Common.Utils.InternalSettings.set("pe-settings-autosave", value); + this.api.asc_setAutoSaveGap(value); + } value = Common.localStorage.getBool("pe-settings-spellcheck", true); Common.Utils.InternalSettings.set("pe-settings-spellcheck", value); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index f3468f5cd..ee0998ca7 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -774,22 +774,9 @@ define([ me.api.SetTextBoxInputMode(value); /** coauthoring begin **/ - if (me.appOptions.isEdit && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { - value = Common.localStorage.getItem("pe-settings-coauthmode"); - if (value===null && !Common.localStorage.itemExists("pe-settings-autosave") && - me.appOptions.customization && me.appOptions.customization.autosave===false) { - value = 0; // use customization.autosave only when pe-settings-coauthmode and pe-settings-autosave are null - } - me._state.fastCoauth = (value===null || parseInt(value) == 1); - } else { - me._state.fastCoauth = (!me.appOptions.isEdit && me.appOptions.isRestrictedEdit); - if (me._state.fastCoauth) { - me.api.asc_setAutoSaveGap(1); - Common.Utils.InternalSettings.set("pe-settings-autosave", 1); - } - } + me._state.fastCoauth = Common.Utils.InternalSettings.get("pe-settings-coauthmode"); me.api.asc_SetFastCollaborative(me._state.fastCoauth); - Common.Utils.InternalSettings.set("pe-settings-coauthmode", me._state.fastCoauth); + me.api.asc_setAutoSaveGap(Common.Utils.InternalSettings.get("pe-settings-autosave")); /** coauthoring end **/ Common.Utils.InternalSettings.set("pe-settings-showsnaplines", me.api.get_ShowSnapLines()); @@ -826,13 +813,6 @@ define([ application.getController('Viewport').getView('DocumentPreview').setApi(me.api).setMode(me.appOptions).on('editcomplete', _.bind(me.onEditComplete, me)); if (me.appOptions.isEdit) { - value = Common.localStorage.getItem("pe-settings-autosave"); - if (value===null && me.appOptions.customization && me.appOptions.customization.autosave===false) - value = 0; - value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0); - me.api.asc_setAutoSaveGap(value); - Common.Utils.InternalSettings.set("pe-settings-autosave", value); - if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true me.appOptions.forcesave = Common.localStorage.getBool("pe-settings-forcesave", me.appOptions.canForcesave); Common.Utils.InternalSettings.set("pe-settings-forcesave", me.appOptions.forcesave); @@ -1085,6 +1065,9 @@ 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.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && (this.permissions.changeCoAuthoring!==false); + + this.loadCoAuthSettings(); this.applyModeCommonElements(); this.applyModeEditorElements(); @@ -1100,6 +1083,46 @@ define([ this.api.asc_LoadDocument(); }, + loadCoAuthSettings: function() { + var fastCoauth = true, + autosave = 1, + value; + + if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { + if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use customization.modeCoAuthoring or 'fast' by default + value = (this.appOptions.customization && this.appOptions.customization.modeCoAuthoring!==undefined) ? (this.appOptions.customization.modeCoAuthoring==='strict' ? 0 : 1) : null; + if (value===null && this.appOptions.customization && this.appOptions.customization.autosave===false) { + value = 0; // use customization.autosave only when modeCoAuthoring are null + } + } else { + value = Common.localStorage.getItem("pe-settings-coauthmode"); + if (value===null) { + value = (this.appOptions.customization && this.appOptions.customization.modeCoAuthoring!==undefined) ? (this.appOptions.customization.modeCoAuthoring==='strict' ? 0 : 1) : null; + if (value===null && !Common.localStorage.itemExists("pe-settings-autosave") && + this.appOptions.customization && this.appOptions.customization.autosave===false) { + value = 0; // use customization.autosave only when de-settings-coauthmode and pe-settings-autosave are null + } + } + } + fastCoauth = (value===null || parseInt(value) == 1); + } else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) { + fastCoauth = true; + } else { + fastCoauth = false; + autosave = 0; + } + + if (this.appOptions.isEdit) { + value = Common.localStorage.getItem("pe-settings-autosave"); + if (value === null && this.appOptions.customization && this.appOptions.customization.autosave === false) + value = 0; + autosave = (!fastCoauth && value !== null) ? parseInt(value) : (this.appOptions.canCoAuthoring ? 1 : 0); + } + + Common.Utils.InternalSettings.set("pe-settings-coauthmode", fastCoauth); + Common.Utils.InternalSettings.set("pe-settings-autosave", autosave); + }, + applyModeCommonElements: function() { window.editor_elements_prepared = true; @@ -1888,10 +1911,10 @@ define([ if (!window.localStorage.getBool("pe-hide-try-undoredo")) Common.UI.info({ width: 500, - msg: this.textTryUndoRedo, + msg: this.appOptions.canChangeCoAuthoring ? this.textTryUndoRedo : this.textTryUndoRedoWarn, iconCls: 'info', - buttons: ['custom', 'cancel'], - primary: 'custom', + buttons: this.appOptions.canChangeCoAuthoring ? ['custom', 'cancel'] : ['ok'], + primary: this.appOptions.canChangeCoAuthoring ? 'custom' : 'ok', customButtonText: this.textStrict, dontshow: true, callback: _.bind(function(btn, dontshow){ @@ -2675,7 +2698,8 @@ define([ textLongName: 'Enter a name that is less than 128 characters.', textGuest: 'Guest', txtErrorLoadHistory: 'Loading history failed', - leavePageTextOnClose: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.' + leavePageTextOnClose: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.', + textTryUndoRedoWarn: 'The Undo/Redo functions are disabled for the Fast co-editing mode.' } })(), PE.Controllers.Main || {})) }); diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 02b0a296d..29e362480 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -217,7 +217,7 @@ define([ '', '', '', - '','', + '','', '', '', '
', @@ -460,15 +460,18 @@ define([ setMode: function(mode) { this.mode = mode; + + var fast_coauth = Common.Utils.InternalSettings.get("pe-settings-coauthmode"); + $('tr.edit', this.el)[mode.isEdit?'show':'hide'](); - $('tr.autosave', this.el)[mode.isEdit ? 'show' : 'hide'](); + $('tr.autosave', this.el)[mode.isEdit && (mode.canChangeCoAuthoring || !fast_coauth) ? 'show' : 'hide'](); if (this.mode.isDesktopApp && this.mode.isOffline) { this.chAutosave.setCaption(this.strAutoRecover); this.lblAutosave.text(this.textAutoRecover); } $('tr.forcesave', this.el)[mode.canForcesave ? 'show' : 'hide'](); /** coauthoring begin **/ - $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide'](); + $('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'](); @@ -535,13 +538,12 @@ define([ applySettings: function() { Common.UI.Themes.setTheme(this.cmbTheme.getValue()); - 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")); /** coauthoring begin **/ - if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { + if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && this.mode.canChangeCoAuthoring) { Common.localStorage.setItem("pe-settings-coauthmode", this.cmbCoAuthMode.getValue()); } /** coauthoring end **/ @@ -549,7 +551,8 @@ define([ var item = this.cmbFontRender.store.findWhere({value: 'custom'}); Common.localStorage.setItem("pe-settings-cachemode", item && !item.get('checked') ? 0 : 1); Common.localStorage.setItem("pe-settings-unit", this.cmbUnit.getValue()); - Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); + if (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("pe-settings-coauthmode")) + Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); if (this.mode.canForcesave) Common.localStorage.setItem("pe-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); Common.Utils.InternalSettings.set("pe-settings-showsnaplines", this.chAlignGuides.isChecked()); diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index c5743b13c..2357ad1e3 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -387,17 +387,22 @@ define([ Common.Utils.InternalSettings.set("sse-settings-r1c1", value); this.api.asc_setR1C1Mode(value); + var fast_coauth = Common.Utils.InternalSettings.get("sse-settings-coauthmode"); if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { - value = Common.localStorage.getBool("sse-settings-coauthmode", true); - Common.Utils.InternalSettings.set("sse-settings-coauthmode", value); - this.api.asc_SetFastCollaborative(value); + if (this.mode.canChangeCoAuthoring) { + fast_coauth = Common.localStorage.getBool("sse-settings-coauthmode", true); + Common.Utils.InternalSettings.set("sse-settings-coauthmode", fast_coauth); + this.api.asc_SetFastCollaborative(fast_coauth); + } } /** coauthoring end **/ if (this.mode.isEdit) { - value = parseInt(Common.localStorage.getItem("sse-settings-autosave")); - Common.Utils.InternalSettings.set("sse-settings-autosave", value); - this.api.asc_setAutoSaveGap(value); + if (this.mode.canChangeCoAuthoring || !fast_coauth) {// can change co-auth. mode or for strict mode + value = parseInt(Common.localStorage.getItem("sse-settings-autosave")); + Common.Utils.InternalSettings.set("sse-settings-autosave", value); + this.api.asc_setAutoSaveGap(value); + } value = parseInt(Common.localStorage.getItem("sse-settings-paste-button")); Common.Utils.InternalSettings.set("sse-settings-paste-button", value); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index cc4c2f296..62127299d 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -787,22 +787,9 @@ define([ Common.Utils.InternalSettings.set("sse-settings-resolvedcomment", value); this.isLiveCommenting ? this.api.asc_showComments(value) : this.api.asc_hideComments(); - if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { - value = Common.localStorage.getItem("sse-settings-coauthmode"); - if (value===null && Common.localStorage.getItem("sse-settings-autosave")===null && - this.appOptions.customization && this.appOptions.customization.autosave===false) { - value = 0; // use customization.autosave only when sse-settings-coauthmode and sse-settings-autosave are null - } - this._state.fastCoauth = (value===null || parseInt(value) == 1); - } else { - this._state.fastCoauth = (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit); - if (this._state.fastCoauth) { - this.api.asc_setAutoSaveGap(1); - Common.Utils.InternalSettings.set("sse-settings-autosave", 1); - } - } - this.api.asc_SetFastCollaborative(this._state.fastCoauth); - Common.Utils.InternalSettings.set("sse-settings-coauthmode", me._state.fastCoauth); + this._state.fastCoauth = Common.Utils.InternalSettings.get("sse-settings-coauthmode"); + this.api.asc_SetFastCollaborative(me._state.fastCoauth); + this.api.asc_setAutoSaveGap(Common.Utils.InternalSettings.get("sse-settings-autosave")); /** coauthoring end **/ /** spellcheck settings begin **/ @@ -866,17 +853,6 @@ define([ if (me.appOptions.isEdit) { spellcheckController.setApi(me.api).setMode(me.appOptions); - if (me.appOptions.canAutosave) { - value = Common.localStorage.getItem("sse-settings-autosave"); - if (value===null && me.appOptions.customization && me.appOptions.customization.autosave===false) - value = 0; - value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0); - } else { - value = 0; - } - me.api.asc_setAutoSaveGap(value); - Common.Utils.InternalSettings.set("sse-settings-autosave", value); - if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true me.appOptions.forcesave = Common.localStorage.getBool("sse-settings-forcesave", me.appOptions.canForcesave); Common.Utils.InternalSettings.set("sse-settings-forcesave", me.appOptions.forcesave); @@ -1148,11 +1124,14 @@ define([ this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false); this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments; + this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.appOptions.canCoAuthoring && (this.permissions.changeCoAuthoring!==false); + 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.loadCoAuthSettings(); this.applyModeCommonElements(); this.applyModeEditorElements(); @@ -1168,6 +1147,46 @@ define([ this.api.asc_LoadDocument(); }, + loadCoAuthSettings: function() { + var fastCoauth = true, + autosave = 1, + value; + + if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { + if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use customization.modeCoAuthoring or 'fast' by default + value = (this.appOptions.customization && this.appOptions.customization.modeCoAuthoring!==undefined) ? (this.appOptions.customization.modeCoAuthoring==='strict' ? 0 : 1) : null; + if (value===null && this.appOptions.customization && this.appOptions.customization.autosave===false) { + value = 0; // use customization.autosave only when modeCoAuthoring are null + } + } else { + value = Common.localStorage.getItem("sse-settings-coauthmode"); + if (value===null) { + value = (this.appOptions.customization && this.appOptions.customization.modeCoAuthoring!==undefined) ? (this.appOptions.customization.modeCoAuthoring==='strict' ? 0 : 1) : null; + if (value===null && !Common.localStorage.itemExists("sse-settings-autosave") && + this.appOptions.customization && this.appOptions.customization.autosave===false) { + value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null + } + } + } + fastCoauth = (value===null || parseInt(value) == 1); + } else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) { + fastCoauth = true; + } else { + fastCoauth = false; + autosave = 0; + } + + if (this.appOptions.isEdit && this.appOptions.canAutosave) { + value = Common.localStorage.getItem("sse-settings-autosave"); + if (value === null && this.appOptions.customization && this.appOptions.customization.autosave === false) + value = 0; + autosave = (!fastCoauth && value !== null) ? parseInt(value) : (this.appOptions.canCoAuthoring ? 1 : 0); + } + + Common.Utils.InternalSettings.set("sse-settings-coauthmode", fastCoauth); + Common.Utils.InternalSettings.set("sse-settings-autosave", autosave); + }, + applyModeCommonElements: function() { window.editor_elements_prepared = true; @@ -2277,10 +2296,10 @@ define([ if (!(val && parseInt(val) == 1)) Common.UI.info({ width: 500, - msg: this.textTryUndoRedo, + msg: this.appOptions.canChangeCoAuthoring ? this.textTryUndoRedo : this.textTryUndoRedoWarn, iconCls: 'info', - buttons: ['custom', 'cancel'], - primary: 'custom', + buttons: this.appOptions.canChangeCoAuthoring ? ['custom', 'cancel'] : ['ok'], + primary: this.appOptions.canChangeCoAuthoring ? 'custom' : 'ok', customButtonText: this.textStrict, dontshow: true, callback: _.bind(function(btn, dontshow){ @@ -2898,7 +2917,8 @@ define([ txtQuarters: 'Quarters', txtYears: 'Years', errorPivotGroup: 'Cannot group that selection.', - leavePageTextOnClose: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.' + leavePageTextOnClose: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.', + textTryUndoRedoWarn: 'The Undo/Redo functions are disabled for the Fast co-editing mode.' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 696551a03..020579857 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -694,7 +694,7 @@ define([ '', '', '', - '','', + '','', '', '', '
', @@ -1070,15 +1070,18 @@ define([ setMode: function(mode) { this.mode = mode; + + var fast_coauth = Common.Utils.InternalSettings.get("sse-settings-coauthmode"); + $('tr.edit', this.el)[mode.isEdit ? 'show' : 'hide'](); - $('tr.autosave', this.el)[mode.isEdit ? 'show' : 'hide'](); + $('tr.autosave', this.el)[mode.isEdit && (mode.canChangeCoAuthoring || !fast_coauth) ? 'show' : 'hide'](); if (this.mode.isDesktopApp && this.mode.isOffline) { this.chAutosave.setCaption(this.strAutoRecover); this.lblAutosave.text(this.textAutoRecover); } $('tr.forcesave', this.el)[mode.canForcesave ? 'show' : 'hide'](); $('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide'](); - $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring? 'show' : 'hide'](); + $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); if ( !Common.UI.Themes.available() ) { @@ -1181,13 +1184,12 @@ define([ applySettings: function() { Common.UI.Themes.setTheme(this.cmbTheme.getValue()); - Common.localStorage.setItem("sse-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("sse-settings-zoom", Common.localStorage.getItem("sse-settings-zoom")); /** coauthoring begin **/ Common.localStorage.setItem("sse-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0); Common.localStorage.setItem("sse-settings-resolvedcomment", this.chResolvedComment.isChecked() ? 1 : 0); - if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) + if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && this.mode.canChangeCoAuthoring) Common.localStorage.setItem("sse-settings-coauthmode", this.cmbCoAuthMode.getValue()); /** coauthoring end **/ Common.localStorage.setItem("sse-settings-r1c1", this.chR1C1Style.isChecked() ? 1 : 0); @@ -1195,7 +1197,8 @@ define([ var item = this.cmbFontRender.store.findWhere({value: 'custom'}); Common.localStorage.setItem("sse-settings-cachemode", item && !item.get('checked') ? 0 : 1); Common.localStorage.setItem("sse-settings-unit", this.cmbUnit.getValue()); - Common.localStorage.setItem("sse-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); + if (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("sse-settings-coauthmode")) + Common.localStorage.setItem("sse-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); if (this.mode.canForcesave) Common.localStorage.setItem("sse-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); Common.localStorage.setItem("sse-settings-func-locale", this.cmbFuncLocale.getValue());