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([
'