Merge pull request #1710 from ONLYOFFICE/feature/license-live-view

Feature/license live view
This commit is contained in:
Julia Radzhabova 2022-04-19 23:36:03 +03:00 committed by GitHub
commit ca5548dfc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 107 additions and 55 deletions

View file

@ -458,7 +458,7 @@ define([
default: value = (fast_coauth) ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges;
}
this.api.SetCollaborativeMarksShowType(value);
} else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
} else if (this.mode.canLiveView && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
fast_coauth = Common.localStorage.getBool("de-settings-view-coauthmode", false);
Common.Utils.InternalSettings.set("de-settings-coauthmode", fast_coauth);
this.api.asc_SetFastCollaborative(fast_coauth);

View file

@ -472,7 +472,11 @@ define([
docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys);
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
this.editorConfig.coEditing.mode || 'fast';
docInfo.put_CoEditingMode(coEditMode);
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
@ -842,6 +846,12 @@ define([
}
},
disableLiveViewing: function(disable) {
this.appOptions.canLiveView = !disable;
this.api.asc_SetFastCollaborative(!disable);
Common.Utils.InternalSettings.set("de-settings-coauthmode", !disable);
},
onRequestClose: function() {
var me = this;
if (this.api.isDocumentModified()) {
@ -1305,8 +1315,7 @@ define([
} else {
documentHolderController.getView().createDelayedElementsViewer();
Common.NotificationCenter.trigger('document:ready', 'main');
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
me.applyLicense();
me.applyLicense();
}
// TODO bug 43960
@ -1343,13 +1352,21 @@ define([
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType;
// need to check live view connections!!!
if (licType !== undefined && this.appOptions.canLiveView && (licType===Asc.c_oLicenseResult.ConnectionsLive || licType===Asc.c_oLicenseResult.ConnectionsLiveOS))
this._state.licenseType = licType;
if (this._isDocReady)
this.applyLicense();
},
applyLicense: function() {
if (this._state.licenseType) {
if (this.editorConfig.mode === 'view') {
if (this.appOptions.canLiveView && (this._state.licenseType===Asc.c_oLicenseResult.ConnectionsLive || this._state.licenseType===Asc.c_oLicenseResult.ConnectionsLiveOS)) {
// show warning or write to log if Common.Utils.InternalSettings.get("de-settings-coauthmode") was true ???
this.disableLiveViewing(true);
}
} else if (this._state.licenseType) {
var license = this._state.licenseType,
buttons = ['ok'],
primary = 'ok';
@ -1546,11 +1563,9 @@ define([
Common.NotificationCenter.on('comments:showdummy', _.bind(this.onShowDummyComment, this));
// change = true by default in editor
this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canLiveView = !!params.asc_getLiveViewerSupport() && (this.editorConfig.mode === 'view'); // viewer: change=false when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit &&
(this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) :
(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ;
this.appOptions.canLiveView && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
this.loadCoAuthSettings();
this.applyModeCommonElements();
@ -1597,14 +1612,16 @@ define([
Common.Utils.InternalSettings.set((fastCoauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", value);
} else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) {
fastCoauth = true;
} else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer
} else if (this.appOptions.canLiveView && !this.appOptions.isOffline) { // viewer
value = Common.localStorage.getItem("de-settings-view-coauthmode");
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'strict' by default for canLiveView=false or 'fast' by default for canLiveView=true
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 :
this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 :
this.appOptions.canLiveView ? 1 : 0;
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'fast' by default
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 : 1;
}
fastCoauth = (parseInt(value) == 1);
// don't show collaborative marks in live viewer
Common.Utils.InternalSettings.set("de-settings-showchanges-fast", 'none');
Common.Utils.InternalSettings.set("de-settings-showchanges-strict", 'none');
} else {
fastCoauth = false;
autosave = 0;

View file

@ -755,7 +755,7 @@ define([
$('tr.coauth', this.el)[mode.isEdit && mode.canCoAuthoring ? 'show' : 'hide']();
$('tr.coauth.changes-mode', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.coauth.changes-show', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide']();
$('tr.live-viewer', this.el)[!mode.isEdit && !mode.isRestrictedEdit && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.view-review', this.el)[mode.canViewReview ? 'show' : 'hide']();
$('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide']();
$('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide']();
@ -868,7 +868,7 @@ define([
this.mode.canChangeCoAuthoring && Common.localStorage.setItem("de-settings-coauthmode", this.rbCoAuthModeFast.getValue() ? 1 : 0 );
Common.localStorage.setItem(this.rbCoAuthModeFast.getValue() ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict",
this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all');
} else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
} else if (this.mode.canLiveView && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
Common.localStorage.setItem("de-settings-view-coauthmode", this.chLiveViewer.isChecked() ? 1 : 0);
}
/** coauthoring end **/

View file

@ -133,7 +133,10 @@ class MainController extends Component {
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
// docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
// var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
// this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
// this.editorConfig.coEditing.mode || 'fast';
// docInfo.put_CoEditingMode(coEditMode);
docInfo.put_CoEditingMode('strict'); // need to change!!!
let enable = !this.editorConfig.customization || (this.editorConfig.customization.macros !== false);

View file

@ -349,7 +349,7 @@ define([
Common.Utils.InternalSettings.set("pe-settings-coauthmode", fast_coauth);
this.api.asc_SetFastCollaborative(fast_coauth);
}
} else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
} else if (this.mode.canLiveView && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
fast_coauth = Common.localStorage.getBool("pe-settings-view-coauthmode", false);
Common.Utils.InternalSettings.set("pe-settings-coauthmode", fast_coauth);
this.api.asc_SetFastCollaborative(fast_coauth);

View file

@ -429,7 +429,11 @@ define([
docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys);
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
this.editorConfig.coEditing.mode || 'fast';
docInfo.put_CoEditingMode(coEditMode);
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
@ -929,8 +933,7 @@ define([
} else {
documentHolderController.getView('DocumentHolder').createDelayedElementsViewer();
Common.NotificationCenter.trigger('document:ready', 'main');
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
me.applyLicense();
me.applyLicense();
}
// TODO bug 43960
@ -964,13 +967,21 @@ define([
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType;
// need to check live view connections!!!
if (licType !== undefined && this.appOptions.canLiveView && (licType===Asc.c_oLicenseResult.ConnectionsLive || licType===Asc.c_oLicenseResult.ConnectionsLiveOS))
this._state.licenseType = licType;
if (this._isDocReady)
this.applyLicense();
},
applyLicense: function() {
if (this._state.licenseType) {
if (this.editorConfig.mode === 'view') {
if (this.appOptions.canLiveView && (this._state.licenseType===Asc.c_oLicenseResult.ConnectionsLive || this._state.licenseType===Asc.c_oLicenseResult.ConnectionsLiveOS)) {
// show warning or write to log if Common.Utils.InternalSettings.get("pe-settings-coauthmode") was true ???
this.disableLiveViewing(true);
}
} else if (this._state.licenseType) {
var license = this._state.licenseType,
buttons = ['ok'],
primary = 'ok';
@ -1092,6 +1103,12 @@ define([
}
},
disableLiveViewing: function(disable) {
this.appOptions.canLiveView = !disable;
this.api.asc_SetFastCollaborative(!disable);
Common.Utils.InternalSettings.set("pe-settings-coauthmode", !disable);
},
onOpenDocument: function(progress) {
var elem = document.getElementById('loadmask-text');
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
@ -1193,11 +1210,9 @@ define([
this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt);
// change = true by default in editor
this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canLiveView = !!params.asc_getLiveViewerSupport() && (this.editorConfig.mode === 'view'); // viewer: change=false when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit &&
(this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) :
(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ;
this.appOptions.canLiveView && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
this.loadCoAuthSettings();
this.applyModeCommonElements();
@ -1239,12 +1254,10 @@ define([
fastCoauth = (value===null || parseInt(value) == 1);
} else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) {
fastCoauth = true;
} else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer
} else if (this.appOptions.canLiveView && !this.appOptions.isOffline) { // viewer
value = Common.localStorage.getItem("pe-settings-view-coauthmode");
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'strict' by default for canLiveView=false or 'fast' by default for canLiveView=true
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 :
this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 :
this.appOptions.canLiveView ? 1 : 0;
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'fast' by default
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 : 1;
}
fastCoauth = (parseInt(value) == 1);
} else {

View file

@ -593,7 +593,7 @@ define([
/** coauthoring begin **/
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide']();
/** coauthoring end **/
$('tr.live-viewer', this.el)[!mode.isEdit && !mode.isRestrictedEdit && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show']();
$('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide']();
@ -683,7 +683,7 @@ define([
/** coauthoring begin **/
if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && this.mode.canChangeCoAuthoring) {
Common.localStorage.setItem("pe-settings-coauthmode", this.rbCoAuthModeFast.getValue());
} else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
} else if (this.mode.canLiveView && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
Common.localStorage.setItem("pe-settings-view-coauthmode", this.chLiveViewer.isChecked() ? 1 : 0);
}
/** coauthoring end **/

View file

@ -124,7 +124,10 @@ class MainController extends Component {
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
// docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
// var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
// this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
// this.editorConfig.coEditing.mode || 'fast';
// docInfo.put_CoEditingMode(coEditMode);
docInfo.put_CoEditingMode('strict'); // need to change!!!
let enable = !this.editorConfig.customization || (this.editorConfig.customization.macros !== false);

View file

@ -449,7 +449,7 @@ define([
Common.Utils.InternalSettings.set("sse-settings-coauthmode", fast_coauth);
this.api.asc_SetFastCollaborative(fast_coauth);
}
} else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
} else if (this.mode.canLiveView && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
fast_coauth = Common.localStorage.getBool("sse-settings-view-coauthmode", false);
Common.Utils.InternalSettings.set("sse-settings-coauthmode", fast_coauth);
this.api.asc_SetFastCollaborative(fast_coauth);

View file

@ -503,7 +503,11 @@ define([
docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys);
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
this.editorConfig.coEditing.mode || 'fast';
docInfo.put_CoEditingMode(coEditMode);
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
@ -998,8 +1002,7 @@ define([
} else {
documentHolderView.createDelayedElementsViewer();
Common.NotificationCenter.trigger('document:ready', 'main');
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
me.applyLicense();
me.applyLicense();
}
// TODO bug 43960
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.isEditOle) {
@ -1051,13 +1054,21 @@ define([
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType;
// need to check live view connections!!!
if (licType !== undefined && this.appOptions.canLiveView && (licType===Asc.c_oLicenseResult.ConnectionsLive || licType===Asc.c_oLicenseResult.ConnectionsLiveOS))
this._state.licenseType = licType;
if (this._isDocReady)
this.applyLicense();
},
applyLicense: function() {
if (this._state.licenseType) {
if (this.editorConfig.mode === 'view') {
if (this.appOptions.canLiveView && (this._state.licenseType===Asc.c_oLicenseResult.ConnectionsLive || this._state.licenseType===Asc.c_oLicenseResult.ConnectionsLiveOS)) {
// show warning or write to log if Common.Utils.InternalSettings.get("sse-settings-coauthmode") was true ???
this.disableLiveViewing(true);
}
} else if (this._state.licenseType) {
var license = this._state.licenseType,
buttons = ['ok'],
primary = 'ok';
@ -1184,6 +1195,12 @@ define([
}
},
disableLiveViewing: function(disable) {
this.appOptions.canLiveView = !disable;
this.api.asc_SetFastCollaborative(!disable);
Common.Utils.InternalSettings.set("sse-settings-coauthmode", !disable);
},
onOpenDocument: function(progress) {
var elem = document.getElementById('loadmask-text');
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
@ -1281,12 +1298,10 @@ define([
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments;
// change = true by default in editor
this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canLiveView = !!params.asc_getLiveViewerSupport() && (this.editorConfig.mode === 'view'); // viewer: change=false when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.appOptions.canCoAuthoring &&
!(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit &&
(this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) :
(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ;
!(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
this.appOptions.canLiveView && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) {
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
@ -1343,12 +1358,10 @@ define([
fastCoauth = (value===null || parseInt(value) == 1);
} else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) {
fastCoauth = true;
} else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer
} else if (this.appOptions.canLiveView && !this.appOptions.isOffline) { // viewer
value = Common.localStorage.getItem("sse-settings-view-coauthmode");
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'strict' by default for canLiveView=false or 'fast' by default for canLiveView=true
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 :
this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 :
this.appOptions.canLiveView ? 1 : 0;
if (!this.appOptions.canChangeCoAuthoring || value===null) { // Use coEditing.mode or 'fast' by default
value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='strict' ? 0 : 1;
}
fastCoauth = (parseInt(value) == 1);
} else {

View file

@ -756,7 +756,7 @@ define([
$('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 && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.live-viewer', this.el)[!mode.isEdit && !mode.isRestrictedEdit && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide']();
$('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show']();
if ( !Common.UI.Themes.available() ) {
@ -911,7 +911,7 @@ define([
Common.localStorage.setItem("sse-settings-resolvedcomment", this.chResolvedComment.isChecked() ? 1 : 0);
if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && this.mode.canChangeCoAuthoring)
Common.localStorage.setItem("sse-settings-coauthmode", this.rbCoAuthModeFast.getValue()? 1 : 0);
else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
else if (this.mode.canLiveView && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer
Common.localStorage.setItem("sse-settings-view-coauthmode", this.chLiveViewer.isChecked() ? 1 : 0);
}
/** coauthoring end **/

View file

@ -171,7 +171,10 @@ class MainController extends Component {
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
// docInfo.put_CoEditingMode(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' ? this.editorConfig.coEditing.mode || 'fast' : 'fast');
// var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
// this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
// this.editorConfig.coEditing.mode || 'fast';
// docInfo.put_CoEditingMode(coEditMode);
docInfo.put_CoEditingMode('strict'); // need to change!!!
const appOptions = this.props.storeAppOptions;