Commit daf066c6 authored by Julia Radzhabova's avatar Julia Radzhabova

Change editor config: added "autosave" parameter to customization - initial option for autosaving.

Used if the user didn't change autosave or co-editing mode in the advanced settings.
parent 39493539
......@@ -111,7 +111,8 @@
leftMenu: true,
rightMenu: true,
toolbar: true,
header: true
header: true,
autosave: true
},
plugins: {
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',
......
......@@ -824,6 +824,10 @@ define([
/** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("de-settings-coauthmode");
if (value===null && Common.localStorage.getItem("de-settings-autosave")===null &&
me.appOptions.customization && me.appOptions.customization.autosave===false) {
value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null
}
me._state.fastCoauth = (value===null || parseInt(value) == 1);
me.api.asc_SetFastCollaborative(me._state.fastCoauth);
......@@ -873,6 +877,8 @@ define([
if (me.appOptions.isEdit) {
value = Common.localStorage.getItem("de-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);
......
......@@ -333,6 +333,9 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("de-settings-coauthmode");
if (value===null && Common.localStorage.getItem("de-settings-autosave")===null &&
this.mode.customization && this.mode.customization.autosave===false)
value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
......@@ -356,6 +359,8 @@ define([
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("de-settings-autosave");
if (value===null && this.mode.customization && this.mode.customization.autosave===false)
value = 0;
this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("de-settings-spellcheck");
......
......@@ -612,6 +612,10 @@ define([
/** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("pe-settings-coauthmode");
if (value===null && Common.localStorage.getItem("pe-settings-autosave")===null &&
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 = false;
......@@ -654,6 +658,8 @@ define([
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);
......
......@@ -275,6 +275,9 @@ define([
/** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode");
if (value===null && Common.localStorage.getItem("pe-settings-autosave")===null &&
this.mode.customization && this.mode.customization.autosave===false)
value = 0; // use customization.autosave only when pe-settings-coauthmode and pe-settings-autosave are null
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
......@@ -288,6 +291,8 @@ define([
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("pe-settings-autosave");
if (value===null && this.mode.customization && this.mode.customization.autosave===false)
value = 0;
this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("pe-settings-showsnaplines");
......
......@@ -580,6 +580,10 @@ define([
if (this.appOptions.isEdit && this.appOptions.canLicense && !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 = false;
......@@ -638,6 +642,8 @@ define([
if (me.appOptions.isEdit) {
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;
......
......@@ -670,6 +670,9 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("sse-settings-coauthmode");
if (value===null && Common.localStorage.getItem("sse-settings-autosave")===null &&
this.mode.customization && this.mode.customization.autosave===false)
value = 0; // use customization.autosave only when sse-settings-coauthmode and sse-settings-autosave are null
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
......@@ -687,6 +690,8 @@ define([
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("sse-settings-autosave");
if (value===null && this.mode.customization && this.mode.customization.autosave===false)
value = 0;
this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("sse-settings-func-locale");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment