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.
This commit is contained in:
Julia Radzhabova 2016-11-17 14:13:33 +03:00
parent 39493539f7
commit daf066c656
7 changed files with 35 additions and 1 deletions

View file

@ -111,7 +111,8 @@
leftMenu: true, leftMenu: true,
rightMenu: true, rightMenu: true,
toolbar: true, toolbar: true,
header: true header: true,
autosave: true
}, },
plugins: { plugins: {
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}', autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',

View file

@ -824,6 +824,10 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("de-settings-coauthmode"); 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._state.fastCoauth = (value===null || parseInt(value) == 1);
me.api.asc_SetFastCollaborative(me._state.fastCoauth); me.api.asc_SetFastCollaborative(me._state.fastCoauth);
@ -873,6 +877,8 @@ define([
if (me.appOptions.isEdit) { if (me.appOptions.isEdit) {
value = Common.localStorage.getItem("de-settings-autosave"); 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); value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
me.api.asc_setAutoSaveGap(value); me.api.asc_setAutoSaveGap(value);

View file

@ -333,6 +333,9 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0)); this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("de-settings-coauthmode"); 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; 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)}); item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
@ -356,6 +359,8 @@ define([
this._oldUnits = this.cmbUnit.getValue(); this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("de-settings-autosave"); 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)); this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("de-settings-spellcheck"); value = Common.localStorage.getItem("de-settings-spellcheck");

View file

@ -612,6 +612,10 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("pe-settings-coauthmode"); 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); me._state.fastCoauth = (value===null || parseInt(value) == 1);
} else } else
me._state.fastCoauth = false; me._state.fastCoauth = false;
@ -654,6 +658,8 @@ define([
if (me.appOptions.isEdit) { if (me.appOptions.isEdit) {
value = Common.localStorage.getItem("pe-settings-autosave"); 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); value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
me.api.asc_setAutoSaveGap(value); me.api.asc_setAutoSaveGap(value);

View file

@ -275,6 +275,9 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode"); 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; 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)}); item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
@ -288,6 +291,8 @@ define([
this._oldUnits = this.cmbUnit.getValue(); this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("pe-settings-autosave"); 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)); this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("pe-settings-showsnaplines"); value = Common.localStorage.getItem("pe-settings-showsnaplines");

View file

@ -580,6 +580,10 @@ define([
if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("sse-settings-coauthmode"); 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); this._state.fastCoauth = (value===null || parseInt(value) == 1);
} else } else
this._state.fastCoauth = false; this._state.fastCoauth = false;
@ -638,6 +642,8 @@ define([
if (me.appOptions.isEdit) { if (me.appOptions.isEdit) {
if (me.appOptions.canAutosave) { if (me.appOptions.canAutosave) {
value = Common.localStorage.getItem("sse-settings-autosave"); 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); value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
} else { } else {
value = 0; value = 0;

View file

@ -670,6 +670,9 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0)); this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("sse-settings-coauthmode"); 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; 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)}); item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
@ -687,6 +690,8 @@ define([
this._oldUnits = this.cmbUnit.getValue(); this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("sse-settings-autosave"); 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)); this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("sse-settings-func-locale"); value = Common.localStorage.getItem("sse-settings-func-locale");