Update limitations for light version: disable co-authoring.

This commit is contained in:
Julia Radzhabova 2016-07-06 17:17:28 +03:00
parent 180c6fdc8f
commit 56b75be8c2
4 changed files with 19 additions and 16 deletions

View file

@ -80,14 +80,17 @@ define([
setMode: function(mode) { setMode: function(mode) {
this.mode = mode; this.mode = mode;
if (this.api && this.mode.canCoAuthoring) { if (this.api) {
if (this.mode.canChat) if (this.mode.canCoAuthoring && this.mode.canChat)
this.api.asc_registerCallback('asc_onCoAuthoringChatReceiveMessage', _.bind(this.onReceiveMessage, this)); this.api.asc_registerCallback('asc_onCoAuthoringChatReceiveMessage', _.bind(this.onReceiveMessage, this));
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this));
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
this.api.asc_coAuthoringGetUsers(); if ( !this.mode.isEditDiagram && !this.mode.isEditMailMerge ) {
if (this.mode.canChat) this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this));
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
this.api.asc_coAuthoringGetUsers();
}
if (this.mode.canCoAuthoring && this.mode.canChat)
this.api.asc_coAuthoringChatGetMessages(); this.api.asc_coAuthoringChatGetMessages();
} }
return this; return this;
@ -100,7 +103,7 @@ define([
}, },
onUsersChanged: function(users){ onUsersChanged: function(users){
if (!this.mode.canLicense) { if (!this.mode.canLicense || !this.mode.canCoAuthoring) {
var len = 0; var len = 0;
for (name in users) { for (name in users) {
if (undefined !== name) len++; if (undefined !== name) len++;

View file

@ -924,13 +924,13 @@ define([
}, },
onEditorPermissions: function(params) { onEditorPermissions: function(params) {
/** coauthoring begin **/
this.appOptions.canCoAuthoring = true;
/** coauthoring end **/
this.permissions.review = (this.permissions.review === undefined) ? (this.permissions.edit !== false) : this.permissions.review; this.permissions.review = (this.permissions.review === undefined) ? (this.permissions.edit !== false) : this.permissions.review;
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable(); this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false; this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
this.appOptions.isLightVersion = params.asc_getIsLight(); this.appOptions.isLightVersion = params.asc_getIsLight();
/** coauthoring begin **/
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
/** coauthoring end **/
this.appOptions.isOffline = this.api.asc_isOffline(); this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.isReviewOnly = (this.permissions.review === true) && (this.permissions.edit === false); this.appOptions.isReviewOnly = (this.permissions.review === true) && (this.permissions.edit === false);
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;

View file

@ -707,12 +707,12 @@ define([
}, },
onEditorPermissions: function(params) { onEditorPermissions: function(params) {
/** coauthoring begin **/
this.appOptions.canCoAuthoring = true;
/** coauthoring end **/
this.appOptions.isOffline = this.api.asc_isOffline(); this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false; this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
this.appOptions.isLightVersion = params.asc_getIsLight(); this.appOptions.isLightVersion = params.asc_getIsLight();
/** coauthoring begin **/
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
/** coauthoring end **/
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canEdit = this.permissions.edit !== false && // can edit this.appOptions.canEdit = this.permissions.edit !== false && // can edit
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined (this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined

View file

@ -733,12 +733,12 @@ define([
this.appOptions.canAutosave = true; this.appOptions.canAutosave = true;
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable(); this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
/** coauthoring begin **/
this.appOptions.canCoAuthoring = true;
/** coauthoring end **/
this.appOptions.isOffline = this.api.asc_isOffline(); this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false; this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
this.appOptions.isLightVersion = params.asc_getIsLight(); this.appOptions.isLightVersion = params.asc_getIsLight();
/** coauthoring begin **/
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
/** coauthoring end **/
this.appOptions.canComments = this.appOptions.canLicense && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canComments = this.appOptions.canLicense && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);