mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 08:55:16 +08:00
[PEF] Fix Bug 70647
This commit is contained in:
@ -431,13 +431,13 @@ define([
|
||||
/** coauthoring begin **/
|
||||
if (this.mode.isEdit && this.mode.canCoAuthoring && canPDFSave && !this.mode.isOffline) {
|
||||
if (this.mode.canChangeCoAuthoring) {
|
||||
// fast_coauth = Common.localStorage.getBool("pdfe-settings-coauthmode", true);
|
||||
fast_coauth = Common.Utils.InternalSettings.get("pdfe-settings-coauthmode");
|
||||
fast_coauth = Common.localStorage.getBool("pdfe-settings-coauthmode", false); // false by default!
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-coauthmode", fast_coauth);
|
||||
this.api.asc_SetFastCollaborative(fast_coauth);
|
||||
}
|
||||
|
||||
// value = Common.localStorage.getItem((fast_coauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict");
|
||||
value = Common.Utils.InternalSettings.get(fast_coauth ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict");
|
||||
value = Common.localStorage.getItem((fast_coauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict");
|
||||
Common.Utils.InternalSettings.set((fast_coauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict", value);
|
||||
switch(value) {
|
||||
case 'all': value = Asc.c_oAscCollaborativeMarksShowType.All; break;
|
||||
case 'none': value = Asc.c_oAscCollaborativeMarksShowType.None; break;
|
||||
@ -472,8 +472,8 @@ define([
|
||||
|
||||
if (this.mode.isEdit && canPDFSave) {
|
||||
if (this.mode.canChangeCoAuthoring || !fast_coauth) {// can change co-auth. mode or for strict mode
|
||||
// value = parseInt(Common.localStorage.getItem("pdfe-settings-autosave"));
|
||||
value = Common.Utils.InternalSettings.get("pdfe-settings-autosave");
|
||||
value = parseInt(Common.localStorage.getItem("pdfe-settings-autosave"));
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-autosave", value);
|
||||
this.api.asc_setAutoSaveGap(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1402,39 +1402,39 @@ define([
|
||||
},
|
||||
|
||||
loadCoAuthSettings: function() {
|
||||
var fastCoauth = true,
|
||||
autosave = 1,
|
||||
var fastCoauth = false,
|
||||
autosave_def = this.appOptions.isOffline ? 1 : 0,
|
||||
autosave = autosave_def,
|
||||
value,
|
||||
isEdit = this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit;
|
||||
if (isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
|
||||
if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use coEditing.mode or 'fast' by default
|
||||
value = (this.editorConfig.coEditing && this.editorConfig.coEditing.mode!==undefined) ? (this.editorConfig.coEditing.mode==='strict' ? 0 : 1) : null;
|
||||
if (value===null && this.appOptions.customization && this.appOptions.customization.autosave===false) {
|
||||
value = 0; // use customization.autosave only when coEditing.mode is null
|
||||
if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use coEditing.mode or 'strict' by default
|
||||
value = (this.editorConfig.coEditing && this.editorConfig.coEditing.mode!==undefined) ? (this.editorConfig.coEditing.mode==='fast' ? 1 : 0) : null;
|
||||
if (value===null && this.appOptions.customization && this.appOptions.customization.autosave) {
|
||||
value = 1; // use customization.autosave only when coEditing.mode is null
|
||||
}
|
||||
} else {
|
||||
value = Common.localStorage.getItem("pdfe-settings-coauthmode");
|
||||
if (value===null) {
|
||||
value = (this.editorConfig.coEditing && this.editorConfig.coEditing.mode!==undefined) ? (this.editorConfig.coEditing.mode==='strict' ? 0 : 1) : null;
|
||||
value = (this.editorConfig.coEditing && this.editorConfig.coEditing.mode!==undefined) ? (this.editorConfig.coEditing.mode==='fast' ? 1 : 0) : null;
|
||||
if (value===null && !Common.localStorage.itemExists("pdfe-settings-autosave") &&
|
||||
this.appOptions.customization && this.appOptions.customization.autosave===false) {
|
||||
value = 0; // use customization.autosave only when pdfe-settings-coauthmode and pdfe-settings-autosave are null
|
||||
this.appOptions.customization && this.appOptions.customization.autosave) {
|
||||
value = 1; // use customization.autosave only when pdfe-settings-coauthmode and pdfe-settings-autosave are null
|
||||
}
|
||||
}
|
||||
}
|
||||
fastCoauth = (value===null || parseInt(value) == 1);
|
||||
fastCoauth = value && parseInt(value) === 1;
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-showchanges-fast", Common.localStorage.getItem("pdfe-settings-showchanges-fast") || 'none');
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-showchanges-strict", Common.localStorage.getItem("pdfe-settings-showchanges-strict") || 'last');
|
||||
// in first version with co-editing set strict mode on start
|
||||
fastCoauth = false;
|
||||
} else if (!isEdit && (this.appOptions.isPDFFill || this.appOptions.isRestrictedEdit)) {
|
||||
fastCoauth = true;
|
||||
autosave = 1;
|
||||
} else if (this.appOptions.canLiveView && !this.appOptions.isOffline) { // viewer
|
||||
value = Common.localStorage.getItem("pdfe-settings-view-coauthmode");
|
||||
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'fast' by default
|
||||
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 : 1;
|
||||
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'strict' by default
|
||||
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0;
|
||||
}
|
||||
fastCoauth = (parseInt(value) == 1);
|
||||
fastCoauth = value && (parseInt(value) == 1);
|
||||
|
||||
// don't show collaborative marks in live viewer
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-showchanges-fast", 'none');
|
||||
@ -1446,11 +1446,9 @@ define([
|
||||
|
||||
if (isEdit) {
|
||||
value = Common.localStorage.getItem("pdfe-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);
|
||||
// in first version with co-editing set autosave=false on start (except offline files)
|
||||
!this.appOptions.isOffline && (autosave = 0);
|
||||
if (value === null && this.appOptions.customization && this.appOptions.customization.autosave===(!autosave_def))
|
||||
value = autosave_def ? 0 : 1;
|
||||
autosave = (!fastCoauth && value !== null) ? parseInt(value) : (this.appOptions.canCoAuthoring ? autosave_def : 0);
|
||||
}
|
||||
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-coauthmode", fastCoauth);
|
||||
@ -2301,11 +2299,11 @@ define([
|
||||
callback: _.bind(function(btn, dontshow){
|
||||
if (dontshow) Common.localStorage.setItem("pdfe-hide-try-undoredo", 1);
|
||||
if (btn == 'custom') {
|
||||
// Common.localStorage.setItem("pdfe-settings-coauthmode", 0);
|
||||
Common.localStorage.setItem("pdfe-settings-coauthmode", 0);
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-coauthmode", false);
|
||||
this.api.asc_SetFastCollaborative(false);
|
||||
this._state.fastCoauth = false;
|
||||
// Common.localStorage.setItem("pdfe-settings-showchanges-strict", 'last');
|
||||
Common.localStorage.setItem("pdfe-settings-showchanges-strict", 'last');
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-showchanges-strict", 'last');
|
||||
this.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.LastChanges);
|
||||
// this.getApplication().getController('Common.Controllers.ReviewChanges').applySettings();
|
||||
@ -2347,7 +2345,7 @@ define([
|
||||
if (this.appOptions.isPDFAnnotate || this.appOptions.isPDFEdit) {
|
||||
if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
|
||||
var oldval = this._state.fastCoauth;
|
||||
this._state.fastCoauth = Common.Utils.InternalSettings.get("pdfe-settings-coauthmode");
|
||||
this._state.fastCoauth = Common.localStorage.getBool("pdfe-settings-coauthmode");
|
||||
if (this._state.fastCoauth && !oldval)
|
||||
this.synchronizeChanges();
|
||||
}
|
||||
|
||||
@ -876,13 +876,9 @@ define([], function () {
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-livecomment", this.chLiveComment.isChecked());
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-resolvedcomment", this.chResolvedComment.isChecked());
|
||||
if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && canPDFSave) {
|
||||
// in first version with co-editing don't save co-editing mode to local storate
|
||||
// this.mode.canChangeCoAuthoring && Common.localStorage.setItem("pdfe-settings-coauthmode", this.rbCoAuthModeFast.getValue() ? 1 : 0 );
|
||||
// Common.localStorage.setItem(this.rbCoAuthModeFast.getValue() ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict",
|
||||
// this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all');
|
||||
this.mode.canChangeCoAuthoring && Common.Utils.InternalSettings.set("pdfe-settings-coauthmode", !!this.rbCoAuthModeFast.getValue());
|
||||
Common.Utils.InternalSettings.set(this.rbCoAuthModeFast.getValue() ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict",
|
||||
this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all');
|
||||
this.mode.canChangeCoAuthoring && Common.localStorage.setItem("pdfe-settings-coauthmode", this.rbCoAuthModeFast.getValue() ? 1 : 0 );
|
||||
Common.localStorage.setItem(this.rbCoAuthModeFast.getValue() ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict",
|
||||
this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all');
|
||||
} else if (this.mode.canLiveView && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
|
||||
Common.localStorage.setItem("pdfe-settings-view-coauthmode", this.chLiveViewer.isChecked() ? 1 : 0);
|
||||
}
|
||||
@ -890,10 +886,8 @@ define([], function () {
|
||||
Common.localStorage.setItem("pdfe-settings-fontrender", this.cmbFontRender.getValue());
|
||||
var item = this.cmbFontRender.store.findWhere({value: 'custom'});
|
||||
Common.localStorage.setItem("pdfe-settings-cachemode", item && !item.get('checked') ? 0 : 1);
|
||||
if (this.mode.isEdit && (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("pdfe-settings-coauthmode"))) {
|
||||
Common.Utils.InternalSettings.set("pdfe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
|
||||
this.mode.isOffline && Common.localStorage.setItem("pdfe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
|
||||
}
|
||||
if (this.mode.isEdit && (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("pdfe-settings-coauthmode")))
|
||||
Common.localStorage.setItem("pdfe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
|
||||
if (this.mode.canForcesave)
|
||||
Common.localStorage.setItem("pdfe-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user