Commit 68ba02c5 authored by Julia Radzhabova's avatar Julia Radzhabova

[PE][SSE] Limitations for light version (compact toolbar + hide chat/comments).

parent 2d1b5ea5
......@@ -155,11 +155,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 {
......@@ -454,13 +454,13 @@ define([
break;
/** coauthoring begin **/
case 'chat':
if (this.mode.canCoAuthoring && this.mode.canChat && (!previewPanel || !previewPanel.isVisible())){
if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion && (!previewPanel || !previewPanel.isVisible())){
Common.UI.Menu.Manager.hideAll();
this.leftMenu.showMenu('chat');
}
return false;
case 'comments':
if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) {
if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments && !this.mode.isLightVersion && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) {
Common.UI.Menu.Manager.hideAll();
this.leftMenu.showMenu('comments');
this.getApplication().getController('Common.Controllers.Comments').onAfterShow();
......
......@@ -712,6 +712,7 @@ define([
/** coauthoring end **/
this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
this.appOptions.isLightVersion = params.asc_getIsLight();
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
......
......@@ -213,7 +213,9 @@ define([
});
me.slideOnlyControls.push(me.btnChangeSlide);
me.listenTo(PE.getCollection('SlideLayouts'), 'reset', function() {
me.mnuChangeSlidePicker._needRecalcSlideLayout = me.mnuAddSlidePicker._needRecalcSlideLayout = true;
me.mnuAddSlidePicker._needRecalcSlideLayout = true;
if (me.mnuChangeSlidePicker)
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
});
me.btnPreview = new Common.UI.Button({
......@@ -1145,7 +1147,7 @@ define([
});
},
render: function () {
render: function (mode) {
var me = this,
el = $(this.el);
......@@ -1156,7 +1158,7 @@ define([
this.trigger('render:before', this);
var value = Common.localStorage.getItem('pe-compact-toolbar');
var valueCompact = (value!==null && parseInt(value) == 1);
var valueCompact = (mode.isLightVersion || value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem('pe-hidden-title');
var valueTitle = (value!==null && parseInt(value) == 1);
......@@ -1167,6 +1169,7 @@ define([
value = Common.localStorage.getItem("pe-hidden-rulers");
var valueRulers = (value !== null && parseInt(value) == 1);
me.mnuitemCompactToolbar.setVisible(!mode.isLightVersion);
me.mnuitemCompactToolbar.setChecked(valueCompact);
me.mnuitemHideTitleBar.setChecked(valueTitle);
me.mnuitemHideStatusBar.setChecked(valueStatus);
......
......@@ -131,7 +131,7 @@ define([
rightMenuView = PE.getController('RightMenu').getView('RightMenu'),
statusBarView = PE.getController('Statusbar').getView('Statusbar');
me._toolbar = toolbarView.render();
me._toolbar = toolbarView.render(this.mode);
me._rightMenu = rightMenuView.render();
var value = Common.localStorage.getItem('pe-hidden-status');
......
......@@ -163,11 +163,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 {
......@@ -621,13 +621,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();
......
......@@ -727,6 +727,7 @@ define([
/** coauthoring end **/
this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
this.appOptions.isLightVersion = params.asc_getIsLight();
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);
......
......@@ -1567,7 +1567,7 @@ define([
});
},
render: function (isEditDiagram, isEditMailMerge) {
render: function (mode) {
var me = this,
el = $(this.el);
......@@ -1579,8 +1579,9 @@ define([
JSON.parse(Common.localStorage.getItem('sse-hidden-title')) && (options.title = true);
JSON.parse(Common.localStorage.getItem('sse-hidden-formula')) && (options.formula = true);
JSON.parse(Common.localStorage.getItem('sse-hidden-headings')) && (options.headings = true);
var isCompactView = !!JSON.parse(Common.localStorage.getItem('sse-toolbar-compact'));
var isCompactView = mode.isLightVersion || !!JSON.parse(Common.localStorage.getItem('sse-toolbar-compact'));
me.mnuitemCompactToolbar.setVisible(!mode.isLightVersion);
me.mnuitemCompactToolbar.setChecked(isCompactView);
me.mnuitemHideTitleBar.setChecked(!!options.title);
me.mnuitemHideFormulaBar.setChecked(!!options.formula);
......@@ -1589,12 +1590,12 @@ define([
this.trigger('render:before', this);
el.html(this.template({
isEditDiagram: isEditDiagram,
isEditMailMerge: isEditMailMerge,
isEditDiagram: mode.isEditDiagram,
isEditMailMerge: mode.isEditMailMerge,
isCompactView: isCompactView
}));
me.rendererComponents(isEditDiagram ? 'diagram' : (isEditMailMerge ? 'merge' : isCompactView ? 'short' : 'full'));
me.rendererComponents(mode.isEditDiagram ? 'diagram' : (mode.isEditMailMerge ? 'merge' : isCompactView ? 'short' : 'full'));
this.trigger('render:after', this);
......
......@@ -146,14 +146,9 @@ define([
var me = this,
toolbarView = SSE.getController('Toolbar').getView('Toolbar'),
rightMenuView = SSE.getController('RightMenu').getView('RightMenu');
// statusBarView = SSE.getController('Statusbar').getView('Statusbar');
//
me._toolbar = toolbarView.render(this.mode.isEditDiagram, this.mode.isEditMailMerge);
me._toolbar = toolbarView.render(this.mode);
me._rightMenu = rightMenuView.render();
//
// var value = Common.localStorage.getItem('de-hidden-status');
// if (value !== null && parseInt(value) == 1)
// statusBarView.setVisible(false);
},
setMode: function(mode, delay) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment