diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 305c48749..70c36c3a5 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -158,11 +158,11 @@ define([ createDelayedElements: function() { /** coauthoring begin **/ 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) 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) this.leftMenu.setOptionsPanel('chat', this.getApplication().getController('Common.Controllers.Chat').getView('Common.Views.Chat')); } else { @@ -574,13 +574,13 @@ define([ break; /** coauthoring begin **/ case 'chat': - if (this.mode.canCoAuthoring && this.mode.canChat) { + if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion) { Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('chat'); } return false; 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(); this.leftMenu.showMenu('comments'); this.getApplication().getController('Common.Controllers.Comments').onAfterShow(); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 2e79d0c1f..a3ff4be52 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -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.ExternalMergeEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization}); - pluginsController.setApi(this.api); - this.updatePluginsList(this.plugins); - this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.updatePluginsList, this)); + if (!me.appOptions.isLightVersion) { + pluginsController.setApi(me.api); + me.updatePluginsList(me.plugins); + me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me)); + } documentHolderController.setApi(me.api); documentHolderController.createDelayedElements(); @@ -930,6 +932,7 @@ define([ this.permissions.review = (this.permissions.review === undefined) ? (this.permissions.edit !== false) : this.permissions.review; this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable(); 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.isReviewOnly = (this.permissions.review === true) && (this.permissions.edit === false); this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; diff --git a/apps/documenteditor/main/app/controller/Statusbar.js b/apps/documenteditor/main/app/controller/Statusbar.js index dff936258..9c9c5a201 100644 --- a/apps/documenteditor/main/app/controller/Statusbar.js +++ b/apps/documenteditor/main/app/controller/Statusbar.js @@ -181,10 +181,10 @@ define([ }); 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"); - this.showNewChangesTip = !(value && parseInt(value) == 1); + this.showNewChangesTip = !(value && parseInt(value) == 1) && !this.statusbar.mode.isLightVersion; if (this.statusbar.mode.isReviewOnly) { var iconEl = $('.btn-icon', this.statusbar.btnReview.cmpEl); @@ -207,7 +207,7 @@ define([ 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); 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 if (this.showTrackChangesTip && !statusbarIsHidden){ this.statusbar.btnReview.updateHint(''); @@ -300,7 +300,7 @@ define([ if (this.api) { this.api.asc_SetTrackRevisions(state); } - this.showHideReviewChangesPanel(state); + this.showHideReviewChangesPanel(state && !this.statusbar.mode.isLightVersion); }, showHideReviewChangesPanel: function(state) { diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index d0eea1170..ce82c50ae 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -380,7 +380,7 @@ define([ setMode: function(mode) { this.mode = mode; 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.panelUsers[(!this.mode.isOffline && !this.mode.isReviewOnly && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide'](); }, diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index b72277cd4..414026965 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1237,7 +1237,7 @@ define([ return this; }, - render: function () { + render: function (mode) { var me = this; /** @@ -1247,7 +1247,7 @@ define([ this.trigger('render:before', this); 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"); var valueTitle = (value !== null && parseInt(value) == 1); @@ -1258,6 +1258,7 @@ define([ value = Common.localStorage.getItem("de-hidden-rulers"); var valueRulers = (value !== null && parseInt(value) == 1); + this.mnuitemCompactToolbar.setVisible(!mode.isLightVersion); this.mnuitemCompactToolbar.setChecked(valueCompact, true); this.mnuitemHideTitleBar.setChecked(valueTitle, true); this.mnuitemHideStatusBar.setChecked(valueStatus, true); diff --git a/apps/documenteditor/main/app/view/Viewport.js b/apps/documenteditor/main/app/view/Viewport.js index b116052bc..9ee9740dd 100644 --- a/apps/documenteditor/main/app/view/Viewport.js +++ b/apps/documenteditor/main/app/view/Viewport.js @@ -140,7 +140,7 @@ define([ rightMenuView = DE.getController('RightMenu').getView('RightMenu'), statusBarView = DE.getController('Statusbar').getView('Statusbar'); - me._toolbar = toolbarView.render(); + me._toolbar = toolbarView.render(this.mode); me._rightMenu = rightMenuView.render(this.mode); var value = Common.localStorage.getItem('de-hidden-status');