diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index cb91ef684..2cbd752b1 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -379,8 +379,10 @@
"Common.Views.Header.tipUndock": "Undock into separate window",
"Common.Views.Header.tipViewSettings": "View settings",
"Common.Views.Header.tipViewUsers": "View users and manage document access rights",
+ "Common.Views.Header.tipUsers": "View users",
"Common.Views.Header.txtAccessRights": "Change access rights",
"Common.Views.Header.txtRename": "Rename",
+ "Common.Views.Header.textShare": "Share",
"Common.Views.History.textCloseHistory": "Close History",
"Common.Views.History.textHide": "Collapse",
"Common.Views.History.textHideAll": "Hide detailed changes",
diff --git a/apps/presentationeditor/main/resources/less/variables.less b/apps/presentationeditor/main/resources/less/variables.less
index 7e1a0f43d..b1d1b743e 100644
--- a/apps/presentationeditor/main/resources/less/variables.less
+++ b/apps/presentationeditor/main/resources/less/variables.less
@@ -2,7 +2,8 @@
// -------------------------
@header-background-color-ie: @toolbar-header-presentation-ie;
@header-background-color: var(--toolbar-header-presentation);
-
+@toolbar-header-text-on-background-ie: @text-toolbar-header-on-background-presentation-ie;
+@toolbar-header-text-on-background: var(--text-toolbar-header-on-background-presentation);
// Grays
// -------------------------
diff --git a/apps/spreadsheeteditor/main/app/controller/CellEditor.js b/apps/spreadsheeteditor/main/app/controller/CellEditor.js
index ba3f04cc0..7462d143d 100644
--- a/apps/spreadsheeteditor/main/app/controller/CellEditor.js
+++ b/apps/spreadsheeteditor/main/app/controller/CellEditor.js
@@ -68,11 +68,11 @@ define([
'Viewport': {
'layout:resizedrag': _.bind(this.onLayoutResize, this)
},
- 'Common.Views.Header': {
- 'formulabar:hide': function (state) {
- this.editor.setVisible(!state);
- Common.localStorage.setBool('sse-hidden-formula', state);
- Common.NotificationCenter.trigger('layout:changed', 'celleditor', state?'hidden':'showed');
+ 'ViewTab': {
+ 'viewtab:formula': function (type, state) {
+ this.editor.setVisible(state);
+ Common.localStorage.setBool('sse-hidden-formula', !state);
+ Common.NotificationCenter.trigger('layout:changed', 'celleditor', !state?'hidden':'showed');
}.bind(this)
}
});
diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js
index 40139a084..1db7baf2f 100644
--- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js
+++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js
@@ -56,7 +56,6 @@ define([
'hide': _.bind(this.onHidePlugins, this)
},
'Common.Views.Header': {
- 'file:settings': _.bind(this.clickToolbarSettings,this),
'history:show': function () {
if ( !this.leftMenu.panelHistory.isVisible() )
this.clickMenuFileItem('header', 'history');
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index 15e20d05f..978fb6727 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -1406,14 +1406,12 @@ define([
Common.Utils.Metric.setCurrentMetric(value);
Common.Utils.InternalSettings.set("sse-settings-unit", value);
+ var toolbarController = application.getController('Toolbar');
+ toolbarController && toolbarController.setApi(me.api);
+
if (this.appOptions.isRestrictedEdit) {
- var toolbarController = application.getController('Toolbar');
- toolbarController && toolbarController.setApi(me.api);
application.getController('WBProtection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
} else if (this.appOptions.isEdit) { // set api events for toolbar in the Restricted Editing mode
- var toolbarController = application.getController('Toolbar');
- toolbarController && toolbarController.setApi(me.api);
-
var statusbarController = application.getController('Statusbar'),
rightmenuController = application.getController('RightMenu'),
fontsControllers = application.getController('Common.Controllers.Fonts');
@@ -2849,6 +2847,7 @@ define([
this.api.asc_coAuthoringDisconnect();
this.headerView.setCanRename(false);
this.headerView.getButton('users') && this.headerView.getButton('users').hide();
+ this.headerView.getButton('share') && this.headerView.getButton('share').setVisible(false);
this.getApplication().getController('LeftMenu').getView('LeftMenu').showHistory();
this.disableEditing(true);
this._renameDialog && this._renameDialog.close();
diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js
index 398db2c65..4ab02c01e 100644
--- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js
@@ -68,9 +68,6 @@ define([
'sheet:updateColors': _.bind(this.updateTabsColors, this),
'sheet:move': _.bind(this.moveWorksheet, this)
},
- 'Common.Views.Header': {
- 'statusbar:setcompact': _.bind(this.onChangeViewMode, this)
- },
'ViewTab': {
'statusbar:setcompact': _.bind(this.onChangeViewMode, this)
}
diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
index 165f750d9..6dfbfa076 100644
--- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
@@ -94,7 +94,6 @@ define([
'sheet:changed': _.bind(this.onApiSheetChanged, this)
},
'Common.Views.Header': {
- 'toolbar:setcompact': this.onChangeViewMode.bind(this),
'print': function (opts) {
var _main = this.getApplication().getController('Main');
_main.onPrint();
@@ -3811,12 +3810,19 @@ define([
me.toolbar.addTab(tab, $panel, 7);
Array.prototype.push.apply(me.toolbar.lockControls, wbtab.getView('WBProtection').getButtons());
}
-
- var viewtab = me.getApplication().getController('ViewTab');
- viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});
- Array.prototype.push.apply(me.toolbar.lockControls, viewtab.getView('ViewTab').getButtons());
}
}
+ if ( !config.isEditDiagram && !config.isEditMailMerge ) {
+ tab = {caption: me.toolbar.textTabView, action: 'view', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-view', dataHintTitle: 'W'};
+ var viewtab = me.getApplication().getController('ViewTab');
+ viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});
+ $panel = viewtab.createToolbarPanel();
+ if ($panel) {
+ me.toolbar.addTab(tab, $panel, 8);
+ me.toolbar.setVisible('view', Common.UI.LayoutManager.isElementVisible('toolbar-view'));
+ }
+ config.isEdit && Array.prototype.push.apply(me.toolbar.lockControls, viewtab.getView('ViewTab').getButtons());
+ }
},
onAppReady: function (config) {
diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js
index e30ce496b..1582e6050 100644
--- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js
+++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js
@@ -84,9 +84,7 @@ define([
mode: mode,
compactToolbar: this.toolbar.toolbar.isCompactView
});
- if (mode.canBrandingExt && mode.customization && mode.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
- this.view.chStatusbar.$el.remove();
- }
+
this.addListeners({
'ViewTab': {
'zoom:selected': _.bind(this.onSelectedZoomValue, this),
@@ -114,11 +112,6 @@ define([
'view:compact': _.bind(function (toolbar, state) {
this.view.chToolbar.setValue(!state, true);
}, this)
- },
- 'Common.Views.Header': {
- 'toolbar:freezeshadow': _.bind(function (isChecked) {
- this.view.btnFreezePanes.menu.items[4].setChecked(isChecked, true);
- }, this)
}
});
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
@@ -128,6 +121,10 @@ define([
this.view && this.view.SetDisabled(state);
},
+ createToolbarPanel: function() {
+ return this.view.getPanel();
+ },
+
getView: function(name) {
return !name && this.view ?
this.view : Backbone.Controller.prototype.getView.call(this, name);
@@ -154,7 +151,6 @@ define([
onFreezeShadow: function (checked) {
this.api.asc_setFrozenPaneBorderType(checked ? Asc.c_oAscFrozenPaneBorderType.shadow : Asc.c_oAscFrozenPaneBorderType.line);
Common.localStorage.setBool('sse-freeze-shadow', checked);
- this.view.fireEvent('freeze:shadow', [checked]);
Common.NotificationCenter.trigger('edit:complete', this.view);
},
@@ -191,10 +187,9 @@ define([
onViewSettings: function(type, value){
if (this.api) {
switch (type) {
- case 0: this.getApplication().getController('Viewport').header.fireEvent('formulabar:hide', [ value!=='checked']); break;
- case 1: this.api.asc_setDisplayHeadings(value=='checked'); break;
- case 2: this.api.asc_setDisplayGridlines( value=='checked'); break;
- case 3: this.api.asc_setShowZeros( value=='checked'); break;
+ case 1: this.api.asc_setDisplayHeadings(value); break;
+ case 2: this.api.asc_setDisplayGridlines(value); break;
+ case 3: this.api.asc_setShowZeros(value); break;
}
}
Common.NotificationCenter.trigger('edit:complete', this.view);
diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js
index 171cbf229..caf8cf4e6 100644
--- a/apps/spreadsheeteditor/main/app/controller/Viewport.js
+++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js
@@ -72,9 +72,7 @@ define([
'menu:show': me.onFileMenu.bind(me, 'show')
},
'Statusbar': {
- 'sheet:changed': me.onApiSheetChanged.bind(me),
'view:compact': function (statusbar, state) {
- me.header.mnuitemCompactStatusBar.setChecked(state, true);
me.viewport.vlayout.getItem('statusbar').height = state ? 25 : 50;
}
},
@@ -92,7 +90,6 @@ define([
},
'view:compact' : function (toolbar, state) {
- me.header.mnuitemCompactToolbar.setChecked(state, true);
me.viewport.vlayout.getItem('toolbar').height = state ?
Common.Utils.InternalSettings.get('toolbar-height-compact') : Common.Utils.InternalSettings.get('toolbar-height-normal');
},
@@ -118,26 +115,15 @@ define([
if ( me.header.btnSave )
me.header.btnSave.setDisabled(state);
}
- },
- 'ViewTab': {
- 'freeze:shadow': function (checked) {
- me.header.mnuitemFreezePanesShadow.setChecked(checked, true);
- }
}
});
Common.NotificationCenter.on('app:face', this.onAppShowed.bind(this));
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
- Common.NotificationCenter.on('cells:range', this.onCellsRange.bind(this));
},
setApi: function(api) {
this.api = api;
- this.api.asc_registerCallback('asc_onZoomChanged', this.onApiZoomChange.bind(this));
- this.api.asc_registerCallback('asc_onSheetsChanged', this.onApiSheetChanged.bind(this));
- this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', this.onApiSheetChanged.bind(this));
- this.api.asc_registerCallback('asc_onWorksheetLocked', this.onWorksheetLocked.bind(this));
- this.api.asc_registerCallback('asc_onEditCell', this.onApiEditCell.bind(this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',this.onApiCoAuthoringDisconnect.bind(this));
Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this));
},
@@ -193,161 +179,6 @@ define([
},
onAppReady: function (config) {
- var me = this;
- if ( me.header.btnOptions ) {
- var compactview = !config.isEdit;
- if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge ) {
- if ( Common.localStorage.itemExists("sse-compact-toolbar") ) {
- compactview = Common.localStorage.getBool("sse-compact-toolbar");
- } else
- if ( config.customization && config.customization.compactToolbar )
- compactview = true;
- }
-
- me.header.mnuitemCompactToolbar = new Common.UI.MenuItem({
- caption : me.header.textCompactView,
- checked : compactview,
- checkable : true,
- value : 'toolbar'
- });
- if (!config.isEdit && !config.isEditDiagram && !config.isEditMailMerge) {
- me.header.mnuitemCompactToolbar.hide();
- Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
- if ((action=='plugins' || action=='review') && visible) {
- me.header.mnuitemCompactToolbar.show();
- }
- }, this));
- }
-
- me.header.mnuitemCompactStatusBar = new Common.UI.MenuItem({
- caption: me.header.textHideStatusBar,
- checked: Common.localStorage.getBool("sse-compact-statusbar", true),
- checkable: true,
- value: 'statusbar'
- });
- if ( config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar'))
- me.header.mnuitemCompactStatusBar.hide();
-
- me.header.mnuitemHideFormulaBar = new Common.UI.MenuItem({
- caption : me.textHideFBar,
- checked : Common.localStorage.getBool('sse-hidden-formula'),
- checkable : true,
- value : 'formula'
- });
-
- me.header.mnuitemHideHeadings = new Common.UI.MenuItem({
- caption : me.textHideHeadings,
- checkable : true,
- checked : me.header.mnuitemHideHeadings.isChecked(),
- disabled : me.header.mnuitemHideHeadings.isDisabled(),
- value : 'headings'
- });
-
- me.header.mnuitemHideGridlines = new Common.UI.MenuItem({
- caption : me.textHideGridlines,
- checkable : true,
- checked : me.header.mnuitemHideGridlines.isChecked(),
- disabled : me.header.mnuitemHideGridlines.isDisabled(),
- value : 'gridlines'
- });
-
- me.header.mnuitemFreezePanes = new Common.UI.MenuItem({
- caption : me.textFreezePanes,
- checkable : true,
- checked : me.header.mnuitemFreezePanes.isChecked(),
- disabled : me.header.mnuitemFreezePanes.isDisabled(),
- value : 'freezepanes'
- });
-
- me.header.mnuitemFreezePanesShadow = new Common.UI.MenuItem({
- caption : me.textFreezePanesShadow,
- checkable : true,
- checked : Common.localStorage.getBool('sse-freeze-shadow', true),
- value : 'freezepanesshadow'
- });
-
- me.header.mnuZoom = new Common.UI.MenuItem({
- template: _.template([
- ''
- ].join('')),
- stopPropagation: true,
- value: me.header.mnuZoom.options.value
- });
-
- var mnuitemAdvSettings = new Common.UI.MenuItem({
- caption: me.header.textAdvSettings,
- value: 'advanced'
- });
-
- me.header.btnOptions.setMenu(new Common.UI.Menu({
- cls: 'pull-right',
- style: 'min-width: 180px;',
- items: [
- me.header.mnuitemCompactToolbar,
- me.header.mnuitemHideFormulaBar,
- me.header.mnuitemCompactStatusBar,
- {caption:'--'},
- me.header.mnuitemHideHeadings,
- me.header.mnuitemHideGridlines,
- {caption:'--'},
- me.header.mnuitemFreezePanes,
- me.header.mnuitemFreezePanesShadow,
- {caption:'--'},
- me.header.mnuZoom,
- {caption:'--'},
- mnuitemAdvSettings
- ]
- })
- );
-
- if (!config.isEdit) {
- var menu = me.header.btnOptions.menu;
- me.header.mnuitemHideHeadings.hide();
- me.header.mnuitemHideGridlines.hide();
- me.header.mnuitemFreezePanes.hide();
- menu.items[6].hide();
- if (!config.canViewComments) { // show advanced settings for editing and commenting mode
- // mnuitemAdvSettings.hide();
- // menu.items[9].hide();
- }
- }
-
- var _on_btn_zoom = function (btn) {
- if ( btn == 'up' ) {
- var _f = Math.floor(this.api.asc_getZoom() * 10)/10;
- _f += .1;
- if (_f > 0 && !(_f > 5.))
- this.api.asc_setZoom(_f);
- } else {
- _f = Math.ceil(this.api.asc_getZoom() * 10)/10;
- _f -= .1;
- if (!(_f < .5))
- this.api.asc_setZoom(_f);
- }
-
- Common.NotificationCenter.trigger('edit:complete', me.header);
- };
-
- (new Common.UI.Button({
- el : $('#hdr-menu-zoom-out', me.header.mnuZoom.$el),
- cls : 'btn-toolbar'
- })).on('click', _on_btn_zoom.bind(me, 'down'));
-
- (new Common.UI.Button({
- el : $('#hdr-menu-zoom-in', me.header.mnuZoom.$el),
- cls : 'btn-toolbar'
- })).on('click', _on_btn_zoom.bind(me, 'up'));
-
- me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this));
- }
},
// When our application is ready, lets get started
@@ -386,10 +217,6 @@ define([
this.boxFormula = $('#cell-editing-box');
this.boxSdk.css('border-left', 'none');
this.boxFormula.css('border-left', 'none');
-
- this.header.mnuitemHideHeadings = this.header.fakeMenuItem();
- this.header.mnuitemHideGridlines = this.header.fakeMenuItem();
- this.header.mnuitemFreezePanes = this.header.fakeMenuItem();
},
onLayoutChanged: function(area) {
@@ -432,7 +259,6 @@ define([
case 'celleditor':
if (arguments[1]) {
this.boxSdk.css('border-top', arguments[1]=='hidden'?'none':'');
- this.header.mnuitemHideFormulaBar && this.header.mnuitemHideFormulaBar.setChecked(arguments[1]=='hidden', true);
}
this.viewport.celayout.doLayout();
break;
@@ -451,79 +277,9 @@ define([
me.header.lockHeaderBtns( 'undo', _need_disable );
me.header.lockHeaderBtns( 'redo', _need_disable );
- me.header.lockHeaderBtns( 'opts', _need_disable );
me.header.lockHeaderBtns( 'users', _need_disable );
},
- onApiZoomChange: function(zf, type){
- switch (type) {
- case 1: // FitWidth
- case 2: // FitPage
- case 0:
- default: {
- this.header.mnuZoom.options.value = Math.floor((zf + .005) * 100);
- $('.menu-zoom .zoom', this.header.mnuZoom.$el).html(Math.floor((zf + .005) * 100) + '%');
- }
- }
- },
-
- onApiSheetChanged: function() {
- var me = this;
- var appConfig = me.viewport.mode;
- if ( !!appConfig && !appConfig.isEditDiagram && !appConfig.isEditMailMerge ) {
- var params = me.api.asc_getSheetViewSettings();
- me.header.mnuitemHideHeadings.setChecked(!params.asc_getShowRowColHeaders());
- me.header.mnuitemHideGridlines.setChecked(!params.asc_getShowGridLines());
- me.header.mnuitemFreezePanes.setChecked(params.asc_getIsFreezePane());
-
- var currentSheet = me.api.asc_getActiveWorksheetIndex();
- this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet));
- }
- },
-
- onWorksheetLocked: function(index,locked) {
- var me = this;
- var appConfig = me.viewport.mode;
- if ( !!appConfig && !appConfig.isEditDiagram && !appConfig.isEditMailMerge ) {
- if (index == this.api.asc_getActiveWorksheetIndex()) {
- locked = locked || me.viewmode;
- me.header.mnuitemHideHeadings.setDisabled(locked);
- me.header.mnuitemHideGridlines.setDisabled(locked);
- me.header.mnuitemFreezePanes.setDisabled(locked);
- }
- }
- },
-
- onApiEditCell: function(state) {
- if ( state == Asc.c_oAscCellEditorState.editStart )
- this.header.lockHeaderBtns('opts', true); else
- if ( state == Asc.c_oAscCellEditorState.editEnd )
- this.header.lockHeaderBtns('opts', false);
- },
-
- onCellsRange: function(status) {
- this.onApiEditCell(status != Asc.c_oAscSelectionDialogType.None ? Asc.c_oAscCellEditorState.editStart : Asc.c_oAscCellEditorState.editEnd);
- },
-
- onOptionsItemClick: function (menu, item, e) {
- var me = this;
-
- switch ( item.value ) {
- case 'toolbar': me.header.fireEvent('toolbar:setcompact', [menu, item.isChecked()]); break;
- case 'statusbar': me.header.fireEvent('statusbar:setcompact', [menu, item.isChecked()]); break;
- case 'formula': me.header.fireEvent('formulabar:hide', [item.isChecked()]); break;
- case 'headings': me.api.asc_setDisplayHeadings(!item.isChecked()); break;
- case 'gridlines': me.api.asc_setDisplayGridlines(!item.isChecked()); break;
- case 'freezepanes': me.api.asc_freezePane(); break;
- case 'freezepanesshadow':
- me.api.asc_setFrozenPaneBorderType(item.isChecked() ? Asc.c_oAscFrozenPaneBorderType.shadow : Asc.c_oAscFrozenPaneBorderType.line);
- Common.localStorage.setBool('sse-freeze-shadow', item.isChecked());
- me.header.fireEvent('toolbar:freezeshadow', [item.isChecked()]);
- break;
- case 'advanced': me.header.fireEvent('file:settings', me.header); break;
- }
- },
-
onApiCoAuthoringDisconnect: function(enableDownload) {
if (this.header) {
if (this.header.btnDownload && !enableDownload)
@@ -536,10 +292,6 @@ define([
},
SetDisabled: function (disabled) {
- this.viewmode = disabled;
- this.header.mnuitemHideHeadings.setDisabled(disabled);
- this.header.mnuitemHideGridlines.setDisabled(disabled);
- this.header.mnuitemFreezePanes.setDisabled(disabled);
},
textHideFBar: 'Hide Formula Bar',
diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template
index b4701806e..5e8545da9 100644
--- a/apps/spreadsheeteditor/main/app/template/Toolbar.template
+++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template
@@ -245,62 +245,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js
index 9098b469d..040fc3da2 100644
--- a/apps/spreadsheeteditor/main/app/view/Toolbar.js
+++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js
@@ -390,9 +390,8 @@ define([
{ caption: me.textTabInsert, action: 'ins', extcls: 'canedit', dataHintTitle: 'I'},
{caption: me.textTabLayout, action: 'layout', extcls: 'canedit', layoutname: 'toolbar-layout', dataHintTitle: 'L'},
{caption: me.textTabFormula, action: 'formula', extcls: 'canedit', dataHintTitle: 'O'},
- {caption: me.textTabData, action: 'data', extcls: 'canedit', dataHintTitle: 'D'},
- undefined, undefined, undefined,
- {caption: me.textTabView, action: 'view', extcls: 'canedit', layoutname: 'toolbar-view', dataHintTitle: 'W'}
+ {caption: me.textTabData, action: 'data', extcls: 'canedit', dataHintTitle: 'D'}
+ // undefined, undefined, undefined, undefined
]}
);
diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js
index a1e4145d4..768cba77c 100644
--- a/apps/spreadsheeteditor/main/app/view/ViewTab.js
+++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js
@@ -46,9 +46,66 @@ define([
'use strict';
SSE.Views.ViewTab = Common.UI.BaseView.extend(_.extend((function(){
+ var template = '
' +
+ '' +
+ '' +
+ '
' +
+ '' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '' +
+ '' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '' +
+ '' +
+ '' +
+ '
' +
+ '' +
+ '' +
+ '' +
+ '
' +
+ '' +
+ '' +
+ '' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '' +
+ '' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '';
+
function setEvents() {
var me = this;
- if ( me.appConfig.canFeatureViews ) {
+ if ( me.appConfig.canFeatureViews && me.appConfig.isEdit) {
me.btnCloseView.on('click', function (btn, e) {
me.fireEvent('viewtab:openview', [{name: 'default', value: 'default'}]);
});
@@ -57,7 +114,7 @@ define([
});
}
- me.btnFreezePanes.menu.on('item:click', function (menu, item, e) {
+ me.btnFreezePanes && me.btnFreezePanes.menu.on('item:click', function (menu, item, e) {
if (item.value === 'shadow') {
me.fireEvent('viewtab:freezeshadow', [item.checked]);
} else {
@@ -65,16 +122,16 @@ define([
}
});
this.chFormula.on('change', function (field, value) {
- me.fireEvent('viewtab:formula', [0, value]);
+ me.fireEvent('viewtab:formula', [0, value=='checked']);
});
- this.chHeadings.on('change', function (field, value) {
- me.fireEvent('viewtab:headings', [1, value]);
+ this.chHeadings && this.chHeadings.on('change', function (field, value) {
+ me.fireEvent('viewtab:headings', [1, value=='checked']);
});
- this.chGridlines.on('change', function (field, value) {
- me.fireEvent('viewtab:gridlines', [2, value]);
+ this.chGridlines && this.chGridlines.on('change', function (field, value) {
+ me.fireEvent('viewtab:gridlines', [2, value=='checked']);
});
- this.chZeros.on('change', function (field, value) {
- me.fireEvent('viewtab:zeros', [3, value]);
+ this.chZeros && this.chZeros.on('change', function (field, value) {
+ me.fireEvent('viewtab:zeros', [3, value=='checked']);
});
this.chToolbar.on('change', function (field, value) {
me.fireEvent('viewtab:showtoolbar', [field, value !== 'checked']);
@@ -105,12 +162,10 @@ define([
this.lockedControls = [];
var me = this,
- $host = me.toolbar.$el,
_set = Common.enumLock;
- if ( me.appConfig.canFeatureViews ) {
+ if ( me.appConfig.canFeatureViews && me.appConfig.isEdit ) {
this.btnSheetView = new Common.UI.Button({
- parentEl: $host.find('#slot-btn-sheet-view'),
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-sheet-view',
caption: me.capBtnSheetView,
@@ -133,7 +188,6 @@ define([
dataHintOffset: 'big'
});
this.lockedControls.push(this.btnCreateView);
- Common.Utils.injectComponent($host.find('#slot-createview'), this.btnCreateView);
this.btnCloseView = new Common.UI.Button({
id : 'id-toolbar-btn-closeview',
@@ -146,29 +200,55 @@ define([
dataHintOffset: 'big'
});
this.lockedControls.push(this.btnCloseView);
- Common.Utils.injectComponent($host.find('#slot-closeview'), this.btnCloseView);
}
- this.btnFreezePanes = new Common.UI.Button({
- parentEl: $host.find('#slot-btn-freeze'),
- cls: 'btn-toolbar x-huge icon-top',
- iconCls: 'toolbar__icon btn-freeze-panes',
- caption: this.capBtnFreeze,
- menu: true,
- lock: [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
- dataHint: '1',
- dataHintDirection: 'bottom',
- dataHintOffset: 'small'
- });
- this.lockedControls.push(this.btnFreezePanes);
+ if (me.appConfig.isEdit) {
+ this.btnFreezePanes = new Common.UI.Button({
+ cls: 'btn-toolbar x-huge icon-top',
+ iconCls: 'toolbar__icon btn-freeze-panes',
+ caption: this.capBtnFreeze,
+ menu: true,
+ lock: [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
+ dataHint: '1',
+ dataHintDirection: 'bottom',
+ dataHintOffset: 'small'
+ });
+ this.lockedControls.push(this.btnFreezePanes);
+
+ this.chHeadings = new Common.UI.CheckBox({
+ labelText: this.textHeadings,
+ lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
+ dataHint : '1',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+ this.lockedControls.push(this.chHeadings);
+
+ this.chGridlines = new Common.UI.CheckBox({
+ labelText: this.textGridlines,
+ lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
+ dataHint : '1',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+ this.lockedControls.push(this.chGridlines);
+
+ this.chZeros = new Common.UI.CheckBox({
+ labelText: this.textZeros,
+ lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
+ dataHint : '1',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+ this.lockedControls.push(this.chZeros);
+ }
this.cmbZoom = new Common.UI.ComboBox({
- el : $host.find('#slot-field-zoom'),
cls : 'input-group-nr',
menuStyle : 'min-width: 55px;',
hint : me.tipFontSize,
editable : true,
- lock : [_set.coAuth, _set.lostConnect, _set.editCell],
+ lock : [_set.lostConnect, _set.editCell],
data : [
{ displayValue: "50%", value: 50 },
{ displayValue: "75%", value: 75 },
@@ -185,52 +265,9 @@ define([
dataHintDirection: 'top',
dataHintOffset: 'small'
});
- this.cmbZoom.setValue(100);
this.lockedControls.push(this.cmbZoom);
- this.chFormula = new Common.UI.CheckBox({
- el: $host.findById('#slot-chk-formula'),
- labelText: this.textFormula,
- value: !Common.localStorage.getBool('sse-hidden-formula'),
- lock : [_set.lostConnect, _set.coAuth, _set.editCell],
- dataHint : '1',
- dataHintDirection: 'left',
- dataHintOffset: 'small'
- });
- this.lockedControls.push(this.chFormula);
-
- this.chHeadings = new Common.UI.CheckBox({
- el: $host.findById('#slot-chk-heading'),
- labelText: this.textHeadings,
- lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
- dataHint : '1',
- dataHintDirection: 'left',
- dataHintOffset: 'small'
- });
- this.lockedControls.push(this.chHeadings);
-
- this.chGridlines = new Common.UI.CheckBox({
- el: $host.findById('#slot-chk-gridlines'),
- labelText: this.textGridlines,
- lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
- dataHint : '1',
- dataHintDirection: 'left',
- dataHintOffset: 'small'
- });
- this.lockedControls.push(this.chGridlines);
-
- this.chZeros = new Common.UI.CheckBox({
- el: $host.findById('#slot-chk-zeros'),
- labelText: this.textZeros,
- lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
- dataHint : '1',
- dataHintDirection: 'left',
- dataHintOffset: 'small'
- });
- this.lockedControls.push(this.chZeros);
-
this.btnInterfaceTheme = new Common.UI.Button({
- parentEl: $host.find('#slot-btn-interface-theme'),
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon day',
caption: this.textInterfaceTheme,
@@ -241,11 +278,20 @@ define([
});
this.lockedControls.push(this.btnInterfaceTheme);
+ this.chFormula = new Common.UI.CheckBox({
+ labelText: this.textFormula,
+ value: !Common.localStorage.getBool('sse-hidden-formula'),
+ lock : [_set.lostConnect, _set.editCell],
+ dataHint : '1',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+ this.lockedControls.push(this.chFormula);
+
this.chStatusbar = new Common.UI.CheckBox({
- el: $host.findById('#slot-chk-statusbar'),
labelText: this.textCombineSheetAndStatusBars,
value : Common.localStorage.getBool('sse-compact-statusbar', true),
- lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
+ lock : [_set.lostConnect, _set.editCell],
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
@@ -253,31 +299,51 @@ define([
this.lockedControls.push(this.chStatusbar);
this.chToolbar = new Common.UI.CheckBox({
- el: $host.findById('#slot-chk-toolbar'),
labelText: this.textAlwaysShowToolbar,
value : !options.compactToolbar,
- lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
+ lock : [_set.lostConnect, _set.editCell],
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.lockedControls.push(this.chToolbar);
- $host.find('#slot-lbl-zoom').text(this.textZoom);
-
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
},
render: function (el) {
+ if ( el ) el.html( this.getPanel() );
+
return this;
},
+ getPanel: function () {
+ this.$el = $(_.template(template)( {} ));
+ var $host = this.$el;
+
+ this.btnSheetView && this.btnSheetView.render($host.find('#slot-btn-sheet-view'));
+ this.btnCreateView && this.btnCreateView.render($host.find('#slot-createview'));
+ this.btnCloseView && this.btnCloseView.render($host.find('#slot-closeview'));
+ this.btnFreezePanes && this.btnFreezePanes.render($host.find('#slot-btn-freeze'));
+ this.cmbZoom.render($host.find('#slot-field-zoom'));
+ this.cmbZoom.setValue(100);
+ $host.find('#slot-lbl-zoom').text(this.textZoom);
+ this.btnInterfaceTheme.render($host.find('#slot-btn-interface-theme'));
+ this.chFormula.render($host.find('#slot-chk-formula'));
+ this.chStatusbar.render($host.find('#slot-chk-statusbar'));
+ this.chToolbar.render($host.find('#slot-chk-toolbar'));
+ this.chHeadings && this.chHeadings.render($host.find('#slot-chk-heading'));
+ this.chGridlines && this.chGridlines.render($host.find('#slot-chk-gridlines'));
+ this.chZeros && this.chZeros.render($host.find('#slot-chk-zeros'));
+ return this.$el;
+ },
+
onAppReady: function (config) {
var me = this;
(new Promise(function (accept, reject) {
accept();
})).then(function(){
- if (!config.canFeatureViews) {
+ if (!(config.canFeatureViews && me.appConfig.isEdit)) {
me.toolbar && me.toolbar.$el.find('.group.sheet-views').hide();
me.toolbar && me.toolbar.$el.find('.separator.sheet-views').hide();
} else {
@@ -287,31 +353,49 @@ define([
me.btnCreateView.updateHint(me.tipCreate);
me.btnCloseView.updateHint(me.tipClose);
}
- me.btnFreezePanes.setMenu(new Common.UI.Menu({
- items: [
- {
- caption: me.toolbar && me.toolbar.api && !!me.toolbar.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? me.textUnFreeze : me.capBtnFreeze,
- value: undefined
- },
- {
- caption: me.textFreezeRow,
- value: Asc.c_oAscFrozenPaneAddType.firstRow
- },
- {
- caption: me.textFreezeCol,
- value: Asc.c_oAscFrozenPaneAddType.firstCol
- },
- { caption: '--' },
- {
- caption: me.textShowFrozenPanesShadow,
- value: 'shadow',
- checkable: true,
- checked: Common.localStorage.getBool('sse-freeze-shadow', true)
- }
- ]
- }));
- me.btnFreezePanes.updateHint(me.tipFreeze);
+ if (config.isEdit) {
+ me.btnFreezePanes.setMenu(new Common.UI.Menu({
+ items: [
+ {
+ caption: me.toolbar && me.toolbar.api && !!me.toolbar.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? me.textUnFreeze : me.capBtnFreeze,
+ value: undefined
+ },
+ {
+ caption: me.textFreezeRow,
+ value: Asc.c_oAscFrozenPaneAddType.firstRow
+ },
+ {
+ caption: me.textFreezeCol,
+ value: Asc.c_oAscFrozenPaneAddType.firstCol
+ },
+ { caption: '--' },
+ {
+ caption: me.textShowFrozenPanesShadow,
+ value: 'shadow',
+ checkable: true,
+ checked: Common.localStorage.getBool('sse-freeze-shadow', true)
+ }
+ ]
+ }));
+ me.btnFreezePanes.updateHint(me.tipFreeze);
+ } else {
+ me.toolbar && me.toolbar.$el.find('.group.sheet-freeze').hide();
+ me.toolbar && me.toolbar.$el.find('.separator.sheet-freeze').hide();
+ me.toolbar && me.toolbar.$el.find('.group.sheet-gridlines').hide();
+ }
+
+ if (config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
+ me.chStatusbar.$el.remove();
+ if (!config.isEdit) {
+ var slotChkFormula = me.chFormula.$el,
+ groupFormula = slotChkFormula.closest('.group'),
+ groupToolbar = me.chToolbar.$el.closest('.group');
+ groupToolbar.find('.elset')[1].append(slotChkFormula[0]);
+ groupFormula.remove();
+ me.$el.find('.separator-formula').remove();
+ }
+ }
var menuItems = [],
currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
for (var t in Common.UI.Themes.map()) {
diff --git a/apps/spreadsheeteditor/main/index.html b/apps/spreadsheeteditor/main/index.html
index 3adb261d6..15e5334a7 100644
--- a/apps/spreadsheeteditor/main/index.html
+++ b/apps/spreadsheeteditor/main/index.html
@@ -84,6 +84,16 @@
background: var(--highlight-header-button-hover, rgba(255,255,255,.2));
}
+ .loadmask > .brendpanel .circle {
+ vertical-align: middle;
+ width: 20px;
+ height: 20px;
+ border-radius: 20px;
+ margin: 0 10px;
+ background: rgba(255,255,255,.2);
+ background: var(--highlight-header-button-hover, rgba(255,255,255,.2));
+ }
+
.loadmask > .sktoolbar {
background: #f1f1f1;
background: var(--background-toolbar, #f1f1f1);
@@ -284,7 +294,7 @@