[DE] Ограничения для light-версии (сокращенная версия тулбара + скрыты чат, комментарии, плагины, рецензирование).

This commit is contained in:
Julia Radzhabova 2016-06-30 11:56:15 +03:00
parent 2993bbd38d
commit 2d1b5ea522
6 changed files with 19 additions and 15 deletions

View file

@ -158,11 +158,11 @@ define([
createDelayedElements: function() { createDelayedElements: function() {
/** coauthoring begin **/ /** coauthoring begin **/
if ( this.mode.canCoAuthoring ) { if ( this.mode.canCoAuthoring ) {
this.leftMenu.btnComments[this.mode.isEdit&&this.mode.canComments ? 'show' : 'hide'](); this.leftMenu.btnComments[(this.mode.isEdit && this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide']();
if (this.mode.canComments) if (this.mode.canComments)
this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments')); this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments'));
this.leftMenu.btnChat[this.mode.canChat ? 'show' : 'hide'](); this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide']();
if (this.mode.canChat) if (this.mode.canChat)
this.leftMenu.setOptionsPanel('chat', this.getApplication().getController('Common.Controllers.Chat').getView('Common.Views.Chat')); this.leftMenu.setOptionsPanel('chat', this.getApplication().getController('Common.Controllers.Chat').getView('Common.Views.Chat'));
} else { } else {
@ -574,13 +574,13 @@ define([
break; break;
/** coauthoring begin **/ /** coauthoring begin **/
case 'chat': case 'chat':
if (this.mode.canCoAuthoring && this.mode.canChat) { if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion) {
Common.UI.Menu.Manager.hideAll(); Common.UI.Menu.Manager.hideAll();
this.leftMenu.showMenu('chat'); this.leftMenu.showMenu('chat');
} }
return false; return false;
case 'comments': case 'comments':
if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments) { if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments && !this.mode.isLightVersion) {
Common.UI.Menu.Manager.hideAll(); Common.UI.Menu.Manager.hideAll();
this.leftMenu.showMenu('comments'); this.leftMenu.showMenu('comments');
this.getApplication().getController('Common.Controllers.Comments').onAfterShow(); this.getApplication().getController('Common.Controllers.Comments').onAfterShow();

View file

@ -829,9 +829,11 @@ define([
application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization}); application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
application.getController('Common.Controllers.ExternalMergeEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization}); application.getController('Common.Controllers.ExternalMergeEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
pluginsController.setApi(this.api); if (!me.appOptions.isLightVersion) {
this.updatePluginsList(this.plugins); pluginsController.setApi(me.api);
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.updatePluginsList, this)); me.updatePluginsList(me.plugins);
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
}
documentHolderController.setApi(me.api); documentHolderController.setApi(me.api);
documentHolderController.createDelayedElements(); documentHolderController.createDelayedElements();
@ -930,6 +932,7 @@ define([
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.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

@ -181,10 +181,10 @@ define([
}); });
value = Common.localStorage.getItem("de-track-changes-tip"); value = Common.localStorage.getItem("de-track-changes-tip");
this.showTrackChangesTip = !(value && parseInt(value) == 1); this.showTrackChangesTip = !(value && parseInt(value) == 1) && !this.statusbar.mode.isLightVersion;
value = Common.localStorage.getItem("de-new-changes"); value = Common.localStorage.getItem("de-new-changes");
this.showNewChangesTip = !(value && parseInt(value) == 1); this.showNewChangesTip = !(value && parseInt(value) == 1) && !this.statusbar.mode.isLightVersion;
if (this.statusbar.mode.isReviewOnly) { if (this.statusbar.mode.isReviewOnly) {
var iconEl = $('.btn-icon', this.statusbar.btnReview.cmpEl); var iconEl = $('.btn-icon', this.statusbar.btnReview.cmpEl);
@ -207,7 +207,7 @@ define([
var iconEl = $('.btn-icon', this.statusbar.btnReview.cmpEl); var iconEl = $('.btn-icon', this.statusbar.btnReview.cmpEl);
(this.api.asc_HaveRevisionsChanges()) ? iconEl.removeClass(this.statusbar.btnReviewCls).addClass('btn-ic-changes') : iconEl.removeClass('btn-ic-changes').addClass(this.statusbar.btnReviewCls); (this.api.asc_HaveRevisionsChanges()) ? iconEl.removeClass(this.statusbar.btnReviewCls).addClass('btn-ic-changes') : iconEl.removeClass('btn-ic-changes').addClass(this.statusbar.btnReviewCls);
if (value!==null && parseInt(value) == 1) { if (value!==null && parseInt(value) == 1) {
this.changeReviewStatus(true); this.changeReviewStatus(!this.statusbar.mode.isLightVersion);
// show tooltip "track changes in this document" and change icon // show tooltip "track changes in this document" and change icon
if (this.showTrackChangesTip && !statusbarIsHidden){ if (this.showTrackChangesTip && !statusbarIsHidden){
this.statusbar.btnReview.updateHint(''); this.statusbar.btnReview.updateHint('');
@ -300,7 +300,7 @@ define([
if (this.api) { if (this.api) {
this.api.asc_SetTrackRevisions(state); this.api.asc_SetTrackRevisions(state);
} }
this.showHideReviewChangesPanel(state); this.showHideReviewChangesPanel(state && !this.statusbar.mode.isLightVersion);
}, },
showHideReviewChangesPanel: function(state) { showHideReviewChangesPanel: function(state) {

View file

@ -380,7 +380,7 @@ define([
setMode: function(mode) { setMode: function(mode) {
this.mode = mode; this.mode = mode;
this.$el.find('.el-edit')[mode.isEdit?'show':'hide'](); this.$el.find('.el-edit')[mode.isEdit?'show':'hide']();
this.$el.find('.el-review')[mode.canReview?'show':'hide'](); this.$el.find('.el-review')[(mode.canReview && !mode.isLightVersion)?'show':'hide']();
this.lblChangeRights[(!this.mode.isOffline && !this.mode.isReviewOnly && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide'](); this.lblChangeRights[(!this.mode.isOffline && !this.mode.isReviewOnly && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide']();
this.panelUsers[(!this.mode.isOffline && !this.mode.isReviewOnly && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide'](); this.panelUsers[(!this.mode.isOffline && !this.mode.isReviewOnly && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide']();
}, },

View file

@ -1237,7 +1237,7 @@ define([
return this; return this;
}, },
render: function () { render: function (mode) {
var me = this; var me = this;
/** /**
@ -1247,7 +1247,7 @@ define([
this.trigger('render:before', this); this.trigger('render:before', this);
var value = Common.localStorage.getItem("de-compact-toolbar"); var value = Common.localStorage.getItem("de-compact-toolbar");
var valueCompact = (value !== null && parseInt(value) == 1); var valueCompact = (mode.isLightVersion || value !== null && parseInt(value) == 1);
value = Common.localStorage.getItem("de-hidden-title"); value = Common.localStorage.getItem("de-hidden-title");
var valueTitle = (value !== null && parseInt(value) == 1); var valueTitle = (value !== null && parseInt(value) == 1);
@ -1258,6 +1258,7 @@ define([
value = Common.localStorage.getItem("de-hidden-rulers"); value = Common.localStorage.getItem("de-hidden-rulers");
var valueRulers = (value !== null && parseInt(value) == 1); var valueRulers = (value !== null && parseInt(value) == 1);
this.mnuitemCompactToolbar.setVisible(!mode.isLightVersion);
this.mnuitemCompactToolbar.setChecked(valueCompact, true); this.mnuitemCompactToolbar.setChecked(valueCompact, true);
this.mnuitemHideTitleBar.setChecked(valueTitle, true); this.mnuitemHideTitleBar.setChecked(valueTitle, true);
this.mnuitemHideStatusBar.setChecked(valueStatus, true); this.mnuitemHideStatusBar.setChecked(valueStatus, true);

View file

@ -140,7 +140,7 @@ define([
rightMenuView = DE.getController('RightMenu').getView('RightMenu'), rightMenuView = DE.getController('RightMenu').getView('RightMenu'),
statusBarView = DE.getController('Statusbar').getView('Statusbar'); statusBarView = DE.getController('Statusbar').getView('Statusbar');
me._toolbar = toolbarView.render(); me._toolbar = toolbarView.render(this.mode);
me._rightMenu = rightMenuView.render(this.mode); me._rightMenu = rightMenuView.render(this.mode);
var value = Common.localStorage.getItem('de-hidden-status'); var value = Common.localStorage.getItem('de-hidden-status');