From 0acbad6fa04e36f6146345af6623b09ccee06e5f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 9 Jul 2020 14:53:22 +0300 Subject: [PATCH 01/23] [SSE] Add View tab --- apps/common/main/lib/component/Mixtbar.js | 2 + apps/spreadsheeteditor/main/app.js | 2 + .../main/app/controller/Toolbar.js | 4 + .../main/app/controller/ViewTab.js | 121 ++++++++ .../main/app/template/Toolbar.template | 42 +++ .../main/app/view/Toolbar.js | 7 +- .../main/app/view/ViewTab.js | 287 ++++++++++++++++++ apps/spreadsheeteditor/main/app_dev.js | 2 + .../main/resources/less/toolbar.less | 5 + 9 files changed, 470 insertions(+), 2 deletions(-) create mode 100644 apps/spreadsheeteditor/main/app/controller/ViewTab.js create mode 100644 apps/spreadsheeteditor/main/app/view/ViewTab.js diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 74b785c60..0081cad91 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -94,11 +94,13 @@ define([ '' + '' + '' + diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js index f274e5365..98f81f10a 100644 --- a/apps/spreadsheeteditor/main/app.js +++ b/apps/spreadsheeteditor/main/app.js @@ -158,6 +158,7 @@ require([ 'Main', 'PivotTable', 'DataTab', + 'ViewTab', 'Common.Controllers.Fonts', 'Common.Controllers.Chat', 'Common.Controllers.Comments', @@ -181,6 +182,7 @@ require([ 'spreadsheeteditor/main/app/controller/Print', 'spreadsheeteditor/main/app/controller/PivotTable', 'spreadsheeteditor/main/app/controller/DataTab', + 'spreadsheeteditor/main/app/controller/ViewTab', 'spreadsheeteditor/main/app/view/FileMenuPanels', 'spreadsheeteditor/main/app/view/ParagraphSettings', 'spreadsheeteditor/main/app/view/ImageSettings', diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 856454690..6b916879a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -3304,6 +3304,10 @@ define([ me.toolbar.addTab(tab, $panel, 7); } } + + var viewtab = me.getApplication().getController('ViewTab'); + viewtab.setApi(me.api).setConfig({toolbar: me}); + } } }, diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js new file mode 100644 index 000000000..92c2d8bad --- /dev/null +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -0,0 +1,121 @@ +/* + * + * (c) Copyright Ascensio System SIA 2010-2020 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +/** + * ViewTab.js + * + * Created by Julia Radzhabova on 08.07.2020 + * Copyright (c) 2020 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'core', + 'spreadsheeteditor/main/app/view/ViewTab' +], function () { + 'use strict'; + + SSE.Controllers.ViewTab = Backbone.Controller.extend(_.extend({ + models : [], + collections : [ + ], + views : [ + 'ViewTab' + ], + sdkViewName : '#id_main', + + initialize: function () { + }, + onLaunch: function () { + }, + + setApi: function (api) { + if (api) { + this.api = api; + this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this)); + this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); + Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); + } + return this; + }, + + setConfig: function(config) { + this.toolbar = config.toolbar; + this.view = this.createView('ViewTab', { + toolbar: this.toolbar.toolbar + }); + this.addListeners({ + 'ViewTab': { + 'viewtab:freeze': this.onFreeze + } + }); + }, + + SetDisabled: function(state) { + this.view && this.view.SetDisabled(state); + }, + + getView: function(name) { + return !name && this.view ? + this.view : Backbone.Controller.prototype.getView.call(this, name); + }, + + onCoAuthoringDisconnect: function() { + this.SetDisabled(true); + }, + + onSelectionChanged: function(info) { + if (!this.toolbar.editMode || !this.view) return; + }, + + onFreeze: function() { + var me = this; + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + }, + + onWorksheetLocked: function(index,locked) { + if (index == this.api.asc_getActiveWorksheetIndex()) { + Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)}); + } + }, + + onApiSheetChanged: function() { + if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge) return; + + var currentSheet = this.api.asc_getActiveWorksheetIndex(); + this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet)); + } + + }, SSE.Controllers.ViewTab || {})); +}); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index cb7050e5f..312b2bc1c 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -225,6 +225,48 @@ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
\ 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 86434fc0d..c7d70c6c3 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -323,7 +323,9 @@ define([ { caption: me.textTabInsert, action: 'ins', extcls: 'canedit'}, {caption: me.textTabLayout, action: 'layout', extcls: 'canedit'}, {caption: me.textTabFormula, action: 'formula', extcls: 'canedit'}, - {caption: me.textTabData, action: 'data', extcls: 'canedit'} + {caption: me.textTabData, action: 'data', extcls: 'canedit'}, + undefined, undefined, undefined, + {caption: me.textTabView, action: 'view', extcls: 'canedit'} ]} ); @@ -2422,6 +2424,7 @@ define([ tipPrintTitles: 'Print titles', capBtnInsSlicer: 'Slicer', tipInsertSlicer: 'Insert slicer', - textVertical: 'Vertical Text' + textVertical: 'Vertical Text', + textTabView: 'View' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js new file mode 100644 index 000000000..785c957d0 --- /dev/null +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -0,0 +1,287 @@ +/* + * + * (c) Copyright Ascensio System SIA 2010-2020 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +/** + * ViewTab.js + * + * Created by Julia Radzhabova on 08.07.2020 + * Copyright (c) 2020 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'common/main/lib/util/utils', + 'common/main/lib/component/BaseView', + 'common/main/lib/component/Layout' +], function () { + 'use strict'; + + SSE.Views.ViewTab = Common.UI.BaseView.extend(_.extend((function(){ + function setEvents() { + var me = this; + me.btnFreezePanes.on('click', function (btn, e) { + me.fireEvent('viewtab:freeze', [btn.pressed]); + }); + } + + return { + options: {}, + + initialize: function (options) { + Common.UI.BaseView.prototype.initialize.call(this); + this.toolbar = options.toolbar; + + this.lockedControls = []; + + var me = this, + $host = me.toolbar.$el, + _set = SSE.enumLock; + + this.btnSheetView = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-sheet-view'), + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-sheetview', + caption: me.capBtnSheetView, + lock : [_set.lostConnect, _set.coAuth], + menu: true + }); + this.lockedControls.push(this.btnSheetView); + + this.btnCreateView = new Common.UI.Button({ + id : 'id-toolbar-btn-createview', + cls : 'btn-toolbar', + iconCls : 'toolbar__icon btn-createview', + caption : this.textCreate, + lock : [_set.coAuth, _set.lostConnect] + }); + 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', + cls : 'btn-toolbar', + iconCls : 'toolbar__icon btn-closeview', + caption : this.textClose, + lock : [_set.coAuth, _set.lostConnect] + }); + 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-to-freeze', + caption: this.capBtnFreeze, + split: false, + enableToggle: true, + lock: [_set.lostConnect, _set.coAuth] + }); + this.lockedControls.push(this.btnFreezePanes); + + this.cmbZoom = new Common.UI.ComboBox({ + cls : 'input-group-nr', + menuStyle : 'min-width: 55px;', + hint : me.tipFontSize, + editable : false, + lock : [_set.coAuth, _set.lostConnect], + data : [ + { displayValue: "50%", value: 50 }, + { displayValue: "75%", value: 75 }, + { displayValue: "100%", value: 100 }, + { displayValue: "125%", value: 125 }, + { displayValue: "150%", value: 150 }, + { displayValue: "175%", value: 175 }, + { displayValue: "200%", value: 200 } + ] + }); + Common.Utils.injectComponent($host.find('#slot-field-zoom'), this.cmbZoom); + + this.chFormula = new Common.UI.CheckBox({ + el: $host.findById('#slot-chk-formula'), + labelText: this.textFormula, + lock : [_set.lostConnect, _set.coAuth] + }); + this.lockedControls.push(this.chFormula); + + this.chHeadings = new Common.UI.CheckBox({ + el: $host.findById('#slot-chk-heading'), + labelText: this.textHeadings, + lock : [_set.lostConnect, _set.coAuth] + }); + this.lockedControls.push(this.chHeadings); + + this.chGridlines = new Common.UI.CheckBox({ + el: $host.findById('#slot-chk-gridlines'), + labelText: this.textGridlines, + lock : [_set.lostConnect, _set.coAuth] + }); + this.lockedControls.push(this.chGridlines); + + $host.find('#slot-lbl-zoom').text(this.textZoom); + + Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); + }, + + render: function (el) { + return this; + }, + + onAppReady: function (config) { + var me = this; + (new Promise(function (accept, reject) { + accept(); + })).then(function(){ + me.btnSheetView.updateHint( me.tipSheetView ); + me.setButtonMenu(me.btnSheetView); + + me.btnCreateView.updateHint(me.tipCreate); + me.btnCloseView.updateHint(me.tipClose); + me.btnFreezePanes.updateHint(me.tipFreeze); + + setEvents.call(me); + }); + }, + + focusInner: function(menu, e) { + if (e.keyCode == Common.UI.Keys.UP) + menu.items[menu.items.length-1].cmpEl.find('> a').focus(); + else + menu.items[0].cmpEl.find('> a').focus(); + }, + + focusOuter: function(menu, e) { + menu.items[2].cmpEl.find('> a').focus(); + }, + + onBeforeKeyDown: function(menu, e) { + if (e.keyCode == Common.UI.Keys.RETURN) { + e.preventDefault(); + e.stopPropagation(); + var li = $(e.target).closest('li'); + (li.length>0) && li.click(); + Common.UI.Menu.Manager.hideAll(); + } else if (e.namespace!=="after.bs.dropdown" && (e.keyCode == Common.UI.Keys.DOWN || e.keyCode == Common.UI.Keys.UP)) { + var $items = $('> [role=menu] > li:not(.divider):not(.disabled):visible', menu.$el).find('> a'); + if (!$items.length) return; + var index = $items.index($items.filter(':focus')), + me = this; + if (menu._outerMenu && (e.keyCode == Common.UI.Keys.UP && index==0 || e.keyCode == Common.UI.Keys.DOWN && index==$items.length - 1) || + menu._innerMenu && (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) && index!==-1) { + e.preventDefault(); + e.stopPropagation(); + _.delay(function() { + menu._outerMenu ? me.focusOuter(menu._outerMenu, e) : me.focusInner(menu._innerMenu, e); + }, 10); + } + } + }, + + setButtonMenu: function(btn) { + var me = this, + arr = [{caption: me.textDefault, value: 'default'}]; + btn.setMenu(new Common.UI.Menu({ + items: [ + {template: _.template('
')}, + { caption: '--' }, + { + caption: me.textManager, + value: 'manager' + } + ] + })); + btn.menu.items[2].on('click', function (item, e) { + me.fireEvent('viewtab:manager'); + }); + btn.menu.on('show:after', function (menu, e) { + var internalMenu = menu._innerMenu; + internalMenu.scroller.update({alwaysVisibleY: true}); + _.delay(function() { + menu._innerMenu && menu._innerMenu.cmpEl.focus(); + }, 10); + }).on('keydown:before', _.bind(me.onBeforeKeyDown, this)); + + var menu = new Common.UI.Menu({ + maxHeight: 300, + cls: 'internal-menu', + items: arr + }); + menu.render(btn.menu.items[0].cmpEl.children(':first')); + menu.cmpEl.css({ + display : 'block', + position : 'relative', + left : 0, + top : 0 + }); + menu.cmpEl.attr({tabindex: "-1"}); + menu.on('item:click', function (menu, item, e) { + me.fireEvent('viewtab:openview', [{name: item.caption, value: item.value}]); + }).on('keydown:before', _.bind(me.onBeforeKeyDown, this)); + btn.menu._innerMenu = menu; + menu._outerMenu = btn.menu; + }, + + show: function () { + Common.UI.BaseView.prototype.show.call(this); + this.fireEvent('show', this); + }, + + getButtons: function(type) { + if (type===undefined) + return this.lockedControls; + return []; + }, + + SetDisabled: function (state) { + this.lockedControls && this.lockedControls.forEach(function(button) { + if ( button ) { + button.setDisabled(state); + } + }, this); + }, + + capBtnSheetView: 'Sheet View', + capBtnFreeze: 'Freeze Panes', + textZoom: 'Zoom', + tipSheetView: 'Sheet view', + textDefault: 'Default', + textManager: 'View manager', + tipFreeze: 'Freeze panes', + tipCreate: 'Create sheet view', + tipClose: 'Close sheet view', + textCreate: 'New', + textClose: 'Close', + textFormula: 'Formula bar', + textHeadings: 'Headings', + textGridlines: 'Gridlines' + } + }()), SSE.Views.ViewTab || {})); +}); diff --git a/apps/spreadsheeteditor/main/app_dev.js b/apps/spreadsheeteditor/main/app_dev.js index d3b10623a..2ca0622ca 100644 --- a/apps/spreadsheeteditor/main/app_dev.js +++ b/apps/spreadsheeteditor/main/app_dev.js @@ -148,6 +148,7 @@ require([ 'Main', 'PivotTable', 'DataTab', + 'ViewTab', 'Common.Controllers.Fonts', 'Common.Controllers.Chat', 'Common.Controllers.Comments', @@ -171,6 +172,7 @@ require([ 'spreadsheeteditor/main/app/controller/Print', 'spreadsheeteditor/main/app/controller/PivotTable', 'spreadsheeteditor/main/app/controller/DataTab', + 'spreadsheeteditor/main/app/controller/ViewTab', 'spreadsheeteditor/main/app/view/FileMenuPanels', 'spreadsheeteditor/main/app/view/ParagraphSettings', 'spreadsheeteditor/main/app/view/ImageSettings', diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index ebc025adc..4592a867d 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -161,3 +161,8 @@ width: 38px; height: 38px; } + +#slot-field-zoom { + float: left; + min-width: 45px; +} \ No newline at end of file From 30edbea008ddf4928ac9446e99e3223323ae9402 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 9 Jul 2020 19:04:54 +0300 Subject: [PATCH 02/23] [SSE] Apply view settings --- .../main/app/controller/ViewTab.js | 67 ++++++++++++++++--- .../main/app/controller/Viewport.js | 5 +- .../main/app/view/ViewTab.js | 17 ++++- 3 files changed, 76 insertions(+), 13 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 92c2d8bad..736fce2e5 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -62,8 +62,11 @@ define([ setApi: function (api) { if (api) { this.api = api; + this.api.asc_registerCallback('asc_onZoomChanged', this.onApiZoomChange.bind(this)); this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this)); - this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, this)); + // this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, 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_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); } @@ -77,9 +80,17 @@ define([ }); this.addListeners({ 'ViewTab': { - 'viewtab:freeze': this.onFreeze + 'viewtab:freeze': this.onFreeze, + 'viewtab:formula': this.onViewSettings, + 'viewtab:headings': this.onViewSettings, + 'viewtab:gridlines': this.onViewSettings, + 'viewtab:zoom': this.onZoom + }, + 'Statusbar': { + 'sheet:changed': this.onApiSheetChanged.bind(this) } }); + Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this)); }, SetDisabled: function(state) { @@ -99,22 +110,58 @@ define([ if (!this.toolbar.editMode || !this.view) return; }, - onFreeze: function() { - var me = this; - Common.NotificationCenter.trigger('edit:complete', me.toolbar); + onFreeze: function(state) { + if (this.api) { + this.api.asc_freezePane(); + } + Common.NotificationCenter.trigger('edit:complete', this.view); }, - onWorksheetLocked: function(index,locked) { - if (index == this.api.asc_getActiveWorksheetIndex()) { - Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)}); + onZoom: function(zoom) { + if (this.api) { + this.api.asc_setZoom(zoom/100); } + Common.NotificationCenter.trigger('edit:complete', this.view); }, + 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; + } + } + Common.NotificationCenter.trigger('edit:complete', this.view); + }, + + // onWorksheetLocked: function(index,locked) { + // if (index == this.api.asc_getActiveWorksheetIndex()) { + // Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)}); + // } + // }, + onApiSheetChanged: function() { if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge) return; - var currentSheet = this.api.asc_getActiveWorksheetIndex(); - this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet)); + var params = this.api.asc_getSheetViewSettings(); + this.view.chHeadings.setValue(!!params.asc_getShowRowColHeaders(), true); + this.view.chGridlines.setValue(!!params.asc_getShowGridLines(), true); + this.view.btnFreezePanes.toggle(!!params.asc_getIsFreezePane(), true); + + // var currentSheet = this.api.asc_getActiveWorksheetIndex(); + // this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet)); + }, + + onLayoutChanged: function(area) { + if (area=='celleditor' && arguments[1]) { + this.view.chFormula.setValue(arguments[1]=='showed', true); + } + }, + + onApiZoomChange: function(zf, type){ + var value = Math.floor((zf + .005) * 100); + this.view.cmbZoom.setValue(value, value + '%'); } }, SSE.Controllers.ViewTab || {})); diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 151f68b4c..d9bbf598a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -207,7 +207,7 @@ define([ }, this)); } - var mnuitemHideFormulaBar = new Common.UI.MenuItem({ + me.header.mnuitemHideFormulaBar = new Common.UI.MenuItem({ caption : me.textHideFBar, checked : Common.localStorage.getBool('sse-hidden-formula'), checkable : true, @@ -261,7 +261,7 @@ define([ style: 'min-width: 180px;', items: [ me.header.mnuitemCompactToolbar, - mnuitemHideFormulaBar, + me.header.mnuitemHideFormulaBar, {caption:'--'}, me.header.mnuitemHideHeadings, me.header.mnuitemHideGridlines, @@ -391,6 +391,7 @@ define([ case 'celleditor': if (arguments[1]) { this.boxSdk.css('border-top', arguments[1]=='hidden'?'none':''); + this.header.mnuitemHideFormulaBar.setChecked(arguments[1]=='hidden', true); } this.viewport.celayout.doLayout(); break; diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 785c957d0..f12de75f4 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -51,6 +51,19 @@ define([ me.btnFreezePanes.on('click', function (btn, e) { me.fireEvent('viewtab:freeze', [btn.pressed]); }); + this.chFormula.on('change', function (field, value) { + me.fireEvent('viewtab:formula', [0, value]); + }); + this.chHeadings.on('change', function (field, value) { + me.fireEvent('viewtab:headings', [1, value]); + }); + this.chGridlines.on('change', function (field, value) { + me.fireEvent('viewtab:gridlines', [2, value]); + }); + + this.cmbZoom.on('selected', function(combo, record) { + me.fireEvent('viewtab:zoom', [record.value]); + }); } return { @@ -108,6 +121,7 @@ define([ this.lockedControls.push(this.btnFreezePanes); this.cmbZoom = new Common.UI.ComboBox({ + el : $host.find('#slot-field-zoom'), cls : 'input-group-nr', menuStyle : 'min-width: 55px;', hint : me.tipFontSize, @@ -123,11 +137,12 @@ define([ { displayValue: "200%", value: 200 } ] }); - Common.Utils.injectComponent($host.find('#slot-field-zoom'), this.cmbZoom); + this.cmbZoom.setValue(100); 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] }); this.lockedControls.push(this.chFormula); From 026e17cc13270cfffc919c459cb178ee28dd5b0b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 9 Jul 2020 20:42:25 +0300 Subject: [PATCH 03/23] [SSE] Show sheet views --- .../main/app/controller/ViewTab.js | 28 ++++++++++++++++++- .../main/app/view/ViewTab.js | 10 ++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 736fce2e5..3b441f76b 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -84,7 +84,10 @@ define([ 'viewtab:formula': this.onViewSettings, 'viewtab:headings': this.onViewSettings, 'viewtab:gridlines': this.onViewSettings, - 'viewtab:zoom': this.onZoom + 'viewtab:zoom': this.onZoom, + 'viewtab:showview': this.onShowView, + 'viewtab:openview': this.onOpenView + // 'viewtab:manager': this.onOpenManager }, 'Statusbar': { 'sheet:changed': this.onApiSheetChanged.bind(this) @@ -135,6 +138,29 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.view); }, + onShowView: function() { + var views = this.api.asc_getNamedSheetViews(), + menu = this.view.btnSheetView.menu._innerMenu, + active = false; + + menu.removeItems(1, menu.items.length-1); + _.each(views, function(item, index) { + menu.addItem(new Common.UI.MenuItem({ + caption : item.asc_getName(), + checkable: true, + allowDepress: false, + checked : item.asc_getIsActive() + })); + if (item.asc_getIsActive()) + active = true; + }); + menu.items[0].setChecked(!active, true); + }, + + onOpenView: function(item) { + this.api && this.api.asc_setActiveNamedSheetView((item.value == 'default') ? null : item.name); + }, + // onWorksheetLocked: function(index,locked) { // if (index == this.api.asc_getActiveWorksheetIndex()) { // Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)}); diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index f12de75f4..0e4232b17 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -60,7 +60,6 @@ define([ this.chGridlines.on('change', function (field, value) { me.fireEvent('viewtab:gridlines', [2, value]); }); - this.cmbZoom.on('selected', function(combo, record) { me.fireEvent('viewtab:zoom', [record.value]); }); @@ -222,7 +221,7 @@ define([ setButtonMenu: function(btn) { var me = this, - arr = [{caption: me.textDefault, value: 'default'}]; + arr = [{caption: me.textDefault, value: 'default', checkable: true, allowDepress: false}]; btn.setMenu(new Common.UI.Menu({ items: [ {template: _.template('
')}, @@ -242,6 +241,8 @@ define([ _.delay(function() { menu._innerMenu && menu._innerMenu.cmpEl.focus(); }, 10); + }).on('show:before', function (menu, e) { + me.fireEvent('viewtab:showview'); }).on('keydown:before', _.bind(me.onBeforeKeyDown, this)); var menu = new Common.UI.Menu({ @@ -257,8 +258,9 @@ define([ top : 0 }); menu.cmpEl.attr({tabindex: "-1"}); - menu.on('item:click', function (menu, item, e) { - me.fireEvent('viewtab:openview', [{name: item.caption, value: item.value}]); + menu.on('item:toggle', function (menu, item, state, e) { + if (!!state) + me.fireEvent('viewtab:openview', [{name: item.caption, value: item.value}]); }).on('keydown:before', _.bind(me.onBeforeKeyDown, this)); btn.menu._innerMenu = menu; menu._outerMenu = btn.menu; From 205094da8643553cf468e183ca7a0f2abbca3cb0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 10:56:20 +0300 Subject: [PATCH 04/23] [SSE] Add/Close views --- apps/spreadsheeteditor/main/app/controller/ViewTab.js | 7 ++++++- apps/spreadsheeteditor/main/app/view/ViewTab.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 3b441f76b..00e5d842d 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -86,7 +86,8 @@ define([ 'viewtab:gridlines': this.onViewSettings, 'viewtab:zoom': this.onZoom, 'viewtab:showview': this.onShowView, - 'viewtab:openview': this.onOpenView + 'viewtab:openview': this.onOpenView, + 'viewtab:createview': this.onCreateView // 'viewtab:manager': this.onOpenManager }, 'Statusbar': { @@ -161,6 +162,10 @@ define([ this.api && this.api.asc_setActiveNamedSheetView((item.value == 'default') ? null : item.name); }, + onCreateView: function(item) { + this.api && this.api.asc_addNamedSheetView(); + }, + // onWorksheetLocked: function(index,locked) { // if (index == this.api.asc_getActiveWorksheetIndex()) { // Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)}); diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 0e4232b17..1617c409b 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -51,6 +51,12 @@ define([ me.btnFreezePanes.on('click', function (btn, e) { me.fireEvent('viewtab:freeze', [btn.pressed]); }); + me.btnCloseView.on('click', function (btn, e) { + me.fireEvent('viewtab:openview', [{name: 'default', value: 'default'}]); + }); + me.btnCreateView.on('click', function (btn, e) { + me.fireEvent('viewtab:createview'); + }); this.chFormula.on('change', function (field, value) { me.fireEvent('viewtab:formula', [0, value]); }); From e0dc3ed7a3be711869c4257e7fd6d431c360bec6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 11:43:31 +0300 Subject: [PATCH 05/23] [SSE] Create new view --- apps/spreadsheeteditor/main/app/controller/ViewTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 00e5d842d..950c4bda8 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -163,7 +163,7 @@ define([ }, onCreateView: function(item) { - this.api && this.api.asc_addNamedSheetView(); + this.api && this.api.asc_addNamedSheetView(null, true); }, // onWorksheetLocked: function(index,locked) { From 829b4ecd6b59648ed75ebbc9f0b90fd8b9ad63aa Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 13:11:19 +0300 Subject: [PATCH 06/23] [SSE] Add sheet view manager --- .../main/app/controller/ViewTab.js | 19 +- .../main/app/view/ViewManagerDlg.js | 315 ++++++++++++++++++ 2 files changed, 331 insertions(+), 3 deletions(-) create mode 100644 apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 950c4bda8..88febe2b4 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -41,7 +41,8 @@ define([ 'core', - 'spreadsheeteditor/main/app/view/ViewTab' + 'spreadsheeteditor/main/app/view/ViewTab', + 'spreadsheeteditor/main/app/view/ViewManagerDlg' ], function () { 'use strict'; @@ -87,8 +88,8 @@ define([ 'viewtab:zoom': this.onZoom, 'viewtab:showview': this.onShowView, 'viewtab:openview': this.onOpenView, - 'viewtab:createview': this.onCreateView - // 'viewtab:manager': this.onOpenManager + 'viewtab:createview': this.onCreateView, + 'viewtab:manager': this.onOpenManager }, 'Statusbar': { 'sheet:changed': this.onApiSheetChanged.bind(this) @@ -166,6 +167,18 @@ define([ this.api && this.api.asc_addNamedSheetView(null, true); }, + onOpenManager: function(item) { + var me = this; + (new SSE.Views.ViewManagerDlg({ + api: this.api, + handler: function(result) { + Common.NotificationCenter.trigger('edit:complete', me.view); + }, + views: this.api.asc_getNamedSheetViews() + })).on('close', function(win){ + }).show(); + }, + // onWorksheetLocked: function(index,locked) { // if (index == this.api.asc_getActiveWorksheetIndex()) { // Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)}); diff --git a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js new file mode 100644 index 000000000..a00f7e95d --- /dev/null +++ b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js @@ -0,0 +1,315 @@ +/* + * + * (c) Copyright Ascensio System SIA 2010-2020 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * +*/ +/** + * + * ViewManagerDlg.js + * + * Created by Julia.Radzhabova on 09.07.2020 + * Copyright (c) 2020 Ascensio System SIA. All rights reserved. + * + */ + +define([ 'common/main/lib/view/AdvancedSettingsWindow', + 'common/main/lib/component/ComboBox', + 'common/main/lib/component/ListView', + 'common/main/lib/component/InputField' +], function () { + 'use strict'; + + SSE.Views = SSE.Views || {}; + + SSE.Views.ViewManagerDlg = Common.Views.AdvancedSettingsWindow.extend(_.extend({ + options: { + alias: 'ViewManagerDlg', + contentWidth: 460, + height: 330, + buttons: null + }, + + initialize: function (options) { + var me = this; + _.extend(this.options, { + title: this.txtTitle, + template: [ + '
', + '
', + '
', + '
', + '', + '', + '', + '', + '', + '', + '', + '
', + '', + '
', + '
', + '', + '', + '', + '', + '
', + '
', + '
', + '
', + '
', + '
', + '' + ].join('') + }, options); + + this.api = options.api; + this.handler = options.handler; + this.views = options.views || []; + this.userTooltip = true; + this.currentView = undefined; + + this.wrapEvents = { + onRefreshNamedSheetViewList: _.bind(this.onRefreshNamedSheetViewList, this) + }; + + Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); + }, + render: function () { + Common.Views.AdvancedSettingsWindow.prototype.render.call(this); + var me = this; + + this.viewList = new Common.UI.ListView({ + el: $('#view-manager-list', this.$window), + store: new Common.UI.DataViewStore(), + simpleAddMode: true, + emptyText: this.textEmpty, + template: _.template(['
'].join('')), + itemTemplate: _.template([ + '
', + '
<%= name %>
', + '<% if (lock) { %>', + '
<%=lockuser%>
', + '<% } %>', + '
' + ].join('')) + }); + this.viewList.on('item:select', _.bind(this.onSelectItem, this)) + .on('item:keydown', _.bind(this.onKeyDown, this)) + .on('item:dblclick', _.bind(this.onDblClickItem, this)) + .on('entervalue', _.bind(this.onDblClickItem, this)); + + this.btnNew = new Common.UI.Button({ + el: $('#view-manager-btn-new') + }); + // this.btnNew.on('click', _.bind(this.onNew, this)); + + this.btnRename = new Common.UI.Button({ + el: $('#view-manager-btn-rename') + }); + // this.btnRename.on('click', _.bind(this.onRename, this)); + + this.btnDuplicate = new Common.UI.Button({ + el: $('#view-manager-btn-duplicate') + }); + // this.btnDuplicate.on('click', _.bind(this.onDuplicate, this)); + + this.btnDelete = new Common.UI.Button({ + el: $('#view-manager-btn-delete') + }); + this.btnDelete.on('click', _.bind(this.onDelete, this)); + + this.afterRender(); + }, + + afterRender: function() { + this._setDefaults(); + }, + + _setDefaults: function (props) { + this.refreshList(this.views, 0); + // this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); + }, + + onRefreshNamedSheetViewList: function() { + this.refreshList(this.api.asc_getNamedSheetViews(), this.currentView); + }, + + refreshList: function(views, selectedItem) { + if (views) { + this.views = views; + var arr = []; + for (var i=0; i0) { + if (selectedItem===undefined || selectedItem===null) selectedItem = 0; + if (_.isNumber(selectedItem)) { + if (selectedItem>val-1) selectedItem = val-1; + this.viewList.selectByIndex(selectedItem); + setTimeout(function() { + me.viewList.scrollToRecord(me.viewList.store.at(selectedItem)); + }, 50); + + } + // if (this.userTooltip===true && this.viewList.cmpEl.find('.lock-user').length>0) + // this.viewList.cmpEl.on('mouseover', _.bind(me.onMouseOverLock, me)).on('mouseout', _.bind(me.onMouseOutLock, me)); + } + + var me = this; + _.delay(function () { + me.viewList.cmpEl.find('.listview').focus(); + me.viewList.scroller.update({alwaysVisibleY: true}); + }, 100, this); + }, + + onMouseOverLock: function (evt, el, opt) { + if (this.userTooltip===true && $(evt.target).hasClass('lock-user')) { + var me = this, + tipdata = $(evt.target).tooltip({title: this.tipIsLocked,trigger:'manual'}).data('bs.tooltip'); + + this.userTooltip = tipdata.tip(); + this.userTooltip.css('z-index', parseInt(this.$window.css('z-index')) + 10); + tipdata.show(); + + setTimeout(function() { me.userTipHide(); }, 5000); + } + }, + + userTipHide: function () { + if (typeof this.userTooltip == 'object') { + this.userTooltip.remove(); + this.userTooltip = undefined; + this.viewList.cmpEl.off('mouseover').off('mouseout'); + } + }, + + onMouseOutLock: function (evt, el, opt) { + if (typeof this.userTooltip == 'object') this.userTipHide(); + }, + + onDelete: function () { + var rec = this.viewList.getSelectedRec(); + if (rec) { + this.api.asc_deleteNamedSheetViews([rec.get('view')]); + } + }, + + getSettings: function() { + return this.sort; + }, + + onPrimary: function() { + return true; + }, + + onDlgBtnClick: function(event) { + this.handler && this.handler.call(this, event.currentTarget.attributes['result'].value); + this.close(); + }, + + getUserName: function(id){ + var usersStore = SSE.getCollection('Common.Collections.Users'); + if (usersStore){ + var rec = usersStore.findUser(id); + if (rec) + return rec.get('username'); + } + return this.guestText; + }, + + onSelectItem: function(lisvView, itemView, record) { + this.userTipHide(); + var rawData = {}, + isViewSelect = _.isFunction(record.toJSON); + + if (isViewSelect){ + if (record.get('selected')) { + rawData = record.toJSON(); + } else {// record deselected + return; + } + this.currentView = _.indexOf(this.viewList.store.models, record); + // this.btnRename.setDisabled(rawData.lock); + // this.btnDelete.setDisabled(rawData.lock); + } + }, + + hide: function () { + this.userTipHide(); + Common.UI.Window.prototype.hide.call(this); + }, + + close: function () { + this.userTipHide(); + this.api.asc_unregisterCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); + + Common.UI.Window.prototype.close.call(this); + }, + + onKeyDown: function (lisvView, record, e) { + if (e.keyCode==Common.UI.Keys.DELETE && !this.btnDelete.isDisabled()) + this.onDelete(); + }, + + onDblClickItem: function (lisvView, record, e) { + }, + + txtTitle: 'Sheet View Manager', + textViews: 'Sheet views', + closeButtonText : 'Close', + textNew: 'New', + textRename: 'Rename', + textDuplicate: 'Duplicate', + textDelete: 'Delete', + textGoTo: 'Go to view...', + textEmpty: 'No views have been created yet.', + guestText: 'Guest', + tipIsLocked: 'This element is being edited by another user.' + + }, SSE.Views.ViewManagerDlg || {})); +}); \ No newline at end of file From 8b94b577d11b5573f5524c096e78667cc0909a9d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 13:23:18 +0300 Subject: [PATCH 07/23] [SSE] Fix deleting view --- apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js index a00f7e95d..e4ad1c8e1 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js @@ -158,7 +158,7 @@ define([ 'common/main/lib/view/AdvancedSettingsWindow', _setDefaults: function (props) { this.refreshList(this.views, 0); - // this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); + this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); }, onRefreshNamedSheetViewList: function() { From ed0860d4d1a6117bc48aedacc1b7228222c2949f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 14:26:05 +0300 Subject: [PATCH 08/23] [SSE] Edit view list --- apps/common/main/lib/view/EditNameDialog.js | 127 ++++++++++++++++++ .../main/app/view/ViewManagerDlg.js | 38 +++++- 2 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 apps/common/main/lib/view/EditNameDialog.js diff --git a/apps/common/main/lib/view/EditNameDialog.js b/apps/common/main/lib/view/EditNameDialog.js new file mode 100644 index 000000000..d4f6d4f51 --- /dev/null +++ b/apps/common/main/lib/view/EditNameDialog.js @@ -0,0 +1,127 @@ +/* + * + * (c) Copyright Ascensio System SIA 2010-2020 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * +*/ +/** + * EditNameDialog.js + * + * Created by Julia Radzhabova on 10.07.2020 + * Copyright (c) 2020 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'common/main/lib/component/Window', + 'common/main/lib/component/InputField' +], function () { 'use strict'; + + Common.Views.EditNameDialog = Common.UI.Window.extend(_.extend({ + options: { + width: 330, + header: false, + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] + }, + + initialize : function(options) { + _.extend(this.options, options || {}); + + this.template = [ + '
', + '
', + '', + '
', + '
', + '
' + ].join(''); + + this.options.tpl = _.template(this.template)(this.options); + + Common.UI.Window.prototype.initialize.call(this, this.options); + }, + + render: function() { + Common.UI.Window.prototype.render.call(this); + + var me = this; + me.inputLabel = new Common.UI.InputField({ + el : $('#id-dlg-label-caption'), + allowBlank : false, + blankError : me.options.error ? me.options.error : me.textLabelError, + style : 'width: 100%;', + validateOnBlur: false, + validation : function(value) { + return value ? true : ''; + } + }); + me.inputLabel.setValue(this.options.value || '' ); + + var $window = this.getChild(); + $window.find('.btn').on('click', _.bind(this.onBtnClick, this)); + }, + + show: function() { + Common.UI.Window.prototype.show.apply(this, arguments); + + var me = this; + _.delay(function(){ + me.getChild('input').focus(); + },50); + }, + + onPrimary: function(event) { + this._handleInput('ok'); + return false; + }, + + onBtnClick: function(event) { + this._handleInput(event.currentTarget.attributes['result'].value); + }, + + _handleInput: function(state) { + if (this.options.handler) { + if (state == 'ok') { + if (this.inputLabel.checkValidate() !== true) { + this.inputLabel.cmpEl.find('input').focus(); + return; + } + } + + this.options.handler.call(this, state, this.inputLabel.getValue()); + } + + this.close(); + }, + + textLabel: 'Label:', + textLabelError: 'Label must not be empty.' + }, Common.Views.EditNameDialog || {})); +}); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js index e4ad1c8e1..92886c9ad 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js @@ -39,7 +39,9 @@ * */ -define([ 'common/main/lib/view/AdvancedSettingsWindow', +define([ + 'common/main/lib/view/EditNameDialog', + 'common/main/lib/view/AdvancedSettingsWindow', 'common/main/lib/component/ComboBox', 'common/main/lib/component/ListView', 'common/main/lib/component/InputField' @@ -132,17 +134,17 @@ define([ 'common/main/lib/view/AdvancedSettingsWindow', this.btnNew = new Common.UI.Button({ el: $('#view-manager-btn-new') }); - // this.btnNew.on('click', _.bind(this.onNew, this)); + this.btnNew.on('click', _.bind(this.onNew, this, false)); this.btnRename = new Common.UI.Button({ el: $('#view-manager-btn-rename') }); - // this.btnRename.on('click', _.bind(this.onRename, this)); + this.btnRename.on('click', _.bind(this.onRename, this)); this.btnDuplicate = new Common.UI.Button({ el: $('#view-manager-btn-duplicate') }); - // this.btnDuplicate.on('click', _.bind(this.onDuplicate, this)); + this.btnDuplicate.on('click', _.bind(this.onNew, this, true)); this.btnDelete = new Common.UI.Button({ el: $('#view-manager-btn-delete') @@ -232,6 +234,12 @@ define([ 'common/main/lib/view/AdvancedSettingsWindow', if (typeof this.userTooltip == 'object') this.userTipHide(); }, + onNew: function (duplicate) { + var rec = duplicate ? this.viewList.getSelectedRec().get('view') : undefined; + this.currentView = this.viewList.store.length; + this.api.asc_addNamedSheetView(rec); + }, + onDelete: function () { var rec = this.viewList.getSelectedRec(); if (rec) { @@ -239,6 +247,24 @@ define([ 'common/main/lib/view/AdvancedSettingsWindow', } }, + onRename: function () { + var rec = this.viewList.getSelectedRec(); + if (rec) { + var me = this; + (new Common.Views.EditNameDialog({ + label: this.textRenameLabel, + error: this.textRenameError, + value: rec.get('name'), + handler: function(result, value) { + if (result == 'ok') { + rec.get('view').asc_setName(value); + } + } + })).show(); + this.api.asc_deleteNamedSheetViews([rec.get('view')]); + } + }, + getSettings: function() { return this.sort; }, @@ -309,7 +335,9 @@ define([ 'common/main/lib/view/AdvancedSettingsWindow', textGoTo: 'Go to view...', textEmpty: 'No views have been created yet.', guestText: 'Guest', - tipIsLocked: 'This element is being edited by another user.' + tipIsLocked: 'This element is being edited by another user.', + textRenameLabel: 'Rename view', + textRenameError: 'View name must not be empty.' }, SSE.Views.ViewManagerDlg || {})); }); \ No newline at end of file From 54a589a29beb95c41ce366757788495970a1c45c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 14:47:26 +0300 Subject: [PATCH 09/23] [SSE] Fix view settings --- .../main/app/controller/ViewTab.js | 7 +++++- .../main/app/view/ViewManagerDlg.js | 24 ++++--------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 88febe2b4..52b79e327 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -171,7 +171,12 @@ define([ var me = this; (new SSE.Views.ViewManagerDlg({ api: this.api, - handler: function(result) { + handler: function(result, value) { + if (result == 'ok' && value) { + if (me.api) { + me.api.asc_setActiveNamedSheetView(value); + } + } Common.NotificationCenter.trigger('edit:complete', me.view); }, views: this.api.asc_getNamedSheetViews() diff --git a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js index 92886c9ad..af713d68a 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js @@ -89,14 +89,13 @@ define([ '', '
', '' ].join('') }, options); this.api = options.api; - this.handler = options.handler; this.views = options.views || []; this.userTooltip = true; this.currentView = undefined; @@ -261,21 +260,12 @@ define([ } } })).show(); - this.api.asc_deleteNamedSheetViews([rec.get('view')]); } }, getSettings: function() { - return this.sort; - }, - - onPrimary: function() { - return true; - }, - - onDlgBtnClick: function(event) { - this.handler && this.handler.call(this, event.currentTarget.attributes['result'].value); - this.close(); + var rec = this.viewList.getSelectedRec(); + return rec ? rec.get('name') : null; }, getUserName: function(id){ @@ -305,16 +295,11 @@ define([ } }, - hide: function () { - this.userTipHide(); - Common.UI.Window.prototype.hide.call(this); - }, - close: function () { this.userTipHide(); this.api.asc_unregisterCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); - Common.UI.Window.prototype.close.call(this); + Common.Views.AdvancedSettingsWindow.prototype.close.call(this); }, onKeyDown: function (lisvView, record, e) { @@ -323,6 +308,7 @@ define([ }, onDblClickItem: function (lisvView, record, e) { + this.onPrimary(); }, txtTitle: 'Sheet View Manager', From ce19f6f1fc8603415d53f941313720cf77e283e1 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 15:42:39 +0300 Subject: [PATCH 10/23] [SSE] Move views to paid features --- .../main/app/controller/Main.js | 1 + .../main/app/controller/Toolbar.js | 2 +- .../main/app/controller/ViewTab.js | 3 +- .../main/app/template/Toolbar.template | 6 +- .../main/app/view/ViewTab.js | 85 +++++++++++-------- 5 files changed, 55 insertions(+), 42 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index dc64e7e64..36c65b014 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -356,6 +356,7 @@ define([ this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false)); this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink; this.appOptions.canFeaturePivot = !!this.api.asc_isSupportFeature("pivot-tables"); + this.appOptions.canFeatureViews = !!this.api.asc_isSupportFeature("sheet-views"); this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header'); this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '') diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 6b916879a..848d9085b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -3306,7 +3306,7 @@ define([ } var viewtab = me.getApplication().getController('ViewTab'); - viewtab.setApi(me.api).setConfig({toolbar: me}); + viewtab.setApi(me.api).setConfig({toolbar: me, mode: config}); } } diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 52b79e327..9b901fdf3 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -77,7 +77,8 @@ define([ setConfig: function(config) { this.toolbar = config.toolbar; this.view = this.createView('ViewTab', { - toolbar: this.toolbar.toolbar + toolbar: this.toolbar.toolbar, + mode: config.mode }); this.addListeners({ 'ViewTab': { diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index 312b2bc1c..b7b156a9d 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -226,10 +226,10 @@
-
+
-
+
@@ -237,7 +237,7 @@
-
+
diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 1617c409b..cb94ebea8 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -48,15 +48,18 @@ define([ SSE.Views.ViewTab = Common.UI.BaseView.extend(_.extend((function(){ function setEvents() { var me = this; + if ( me.appConfig.canFeatureViews ) { + me.btnCloseView.on('click', function (btn, e) { + me.fireEvent('viewtab:openview', [{name: 'default', value: 'default'}]); + }); + me.btnCreateView.on('click', function (btn, e) { + me.fireEvent('viewtab:createview'); + }); + } + me.btnFreezePanes.on('click', function (btn, e) { me.fireEvent('viewtab:freeze', [btn.pressed]); }); - me.btnCloseView.on('click', function (btn, e) { - me.fireEvent('viewtab:openview', [{name: 'default', value: 'default'}]); - }); - me.btnCreateView.on('click', function (btn, e) { - me.fireEvent('viewtab:createview'); - }); this.chFormula.on('change', function (field, value) { me.fireEvent('viewtab:formula', [0, value]); }); @@ -77,6 +80,7 @@ define([ initialize: function (options) { Common.UI.BaseView.prototype.initialize.call(this); this.toolbar = options.toolbar; + this.appConfig = options.mode; this.lockedControls = []; @@ -84,35 +88,37 @@ define([ $host = me.toolbar.$el, _set = SSE.enumLock; - this.btnSheetView = new Common.UI.Button({ - parentEl: $host.find('#slot-btn-sheet-view'), - cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-sheetview', - caption: me.capBtnSheetView, - lock : [_set.lostConnect, _set.coAuth], - menu: true - }); - this.lockedControls.push(this.btnSheetView); + if ( me.appConfig.canFeatureViews ) { + this.btnSheetView = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-sheet-view'), + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-sheetview', + caption: me.capBtnSheetView, + lock : [_set.lostConnect, _set.coAuth], + menu: true + }); + this.lockedControls.push(this.btnSheetView); - this.btnCreateView = new Common.UI.Button({ - id : 'id-toolbar-btn-createview', - cls : 'btn-toolbar', - iconCls : 'toolbar__icon btn-createview', - caption : this.textCreate, - lock : [_set.coAuth, _set.lostConnect] - }); - this.lockedControls.push(this.btnCreateView); - Common.Utils.injectComponent($host.find('#slot-createview'), this.btnCreateView); + this.btnCreateView = new Common.UI.Button({ + id : 'id-toolbar-btn-createview', + cls : 'btn-toolbar', + iconCls : 'toolbar__icon btn-createview', + caption : this.textCreate, + lock : [_set.coAuth, _set.lostConnect] + }); + 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', - cls : 'btn-toolbar', - iconCls : 'toolbar__icon btn-closeview', - caption : this.textClose, - lock : [_set.coAuth, _set.lostConnect] - }); - this.lockedControls.push(this.btnCloseView); - Common.Utils.injectComponent($host.find('#slot-closeview'), this.btnCloseView); + this.btnCloseView = new Common.UI.Button({ + id : 'id-toolbar-btn-closeview', + cls : 'btn-toolbar', + iconCls : 'toolbar__icon btn-closeview', + caption : this.textClose, + lock : [_set.coAuth, _set.lostConnect] + }); + 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'), @@ -180,11 +186,16 @@ define([ (new Promise(function (accept, reject) { accept(); })).then(function(){ - me.btnSheetView.updateHint( me.tipSheetView ); - me.setButtonMenu(me.btnSheetView); + if (!config.canFeatureViews) { + me.toolbar && me.toolbar.$el.find('.group.sheet-views').hide(); + me.toolbar && me.toolbar.$el.find('.separator.sheet-views').hide(); + } else { + me.btnSheetView.updateHint( me.tipSheetView ); + me.setButtonMenu(me.btnSheetView); - me.btnCreateView.updateHint(me.tipCreate); - me.btnCloseView.updateHint(me.tipClose); + me.btnCreateView.updateHint(me.tipCreate); + me.btnCloseView.updateHint(me.tipClose); + } me.btnFreezePanes.updateHint(me.tipFreeze); setEvents.call(me); From 1f49644924b88281062d9cf8a9ff949ad168f273 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 16:19:07 +0300 Subject: [PATCH 11/23] [SSE] Lock view settings --- apps/common/main/lib/view/Header.js | 6 ++++-- .../main/app/controller/Toolbar.js | 2 +- .../main/app/controller/ViewTab.js | 16 ++++++++-------- .../main/app/controller/Viewport.js | 19 +++++++++++++++++++ .../main/app/view/ViewTab.js | 6 +++--- 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 974274901..2c83638d6 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -719,9 +719,11 @@ define([ fakeMenuItem: function() { return { - conf: {checked: false}, + conf: {checked: false, disabled: false}, setChecked: function (val) { this.conf.checked = val; }, - isChecked: function () { return this.conf.checked; } + isChecked: function () { return this.conf.checked; }, + setDisabled: function (val) { this.conf.disabled = val; }, + isDisabled: function () { return this.conf.disabled; } }; }, diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 848d9085b..256bc6d85 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -3307,7 +3307,7 @@ define([ 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()); } } }, diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 9b901fdf3..168bec832 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -65,7 +65,7 @@ define([ this.api = api; this.api.asc_registerCallback('asc_onZoomChanged', this.onApiZoomChange.bind(this)); this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this)); - // this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, this)); + this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, 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_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); @@ -185,11 +185,11 @@ define([ }).show(); }, - // onWorksheetLocked: function(index,locked) { - // if (index == this.api.asc_getActiveWorksheetIndex()) { - // Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)}); - // } - // }, + onWorksheetLocked: function(index,locked) { + if (index == this.api.asc_getActiveWorksheetIndex()) { + Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: [this.view.chHeadings, this.view.chGridlines, this.view.btnFreezePanes]}); + } + }, onApiSheetChanged: function() { if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge) return; @@ -199,8 +199,8 @@ define([ this.view.chGridlines.setValue(!!params.asc_getShowGridLines(), true); this.view.btnFreezePanes.toggle(!!params.asc_getIsFreezePane(), true); - // var currentSheet = this.api.asc_getActiveWorksheetIndex(); - // this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet)); + var currentSheet = this.api.asc_getActiveWorksheetIndex(); + this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet)); }, onLayoutChanged: function(area) { diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index d9bbf598a..dd757f0e5 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -125,6 +125,7 @@ define([ 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)); @@ -218,6 +219,7 @@ define([ caption : me.textHideHeadings, checkable : true, checked : me.header.mnuitemHideHeadings.isChecked(), + disabled : me.header.mnuitemHideHeadings.isDisabled(), value : 'headings' }); @@ -225,6 +227,7 @@ define([ caption : me.textHideGridlines, checkable : true, checked : me.header.mnuitemHideGridlines.isChecked(), + disabled : me.header.mnuitemHideGridlines.isDisabled(), value : 'gridlines' }); @@ -232,6 +235,7 @@ define([ caption : me.textFreezePanes, checkable : true, checked : me.header.mnuitemFreezePanes.isChecked(), + disabled : me.header.mnuitemFreezePanes.isDisabled(), value : 'freezepanes' }); @@ -434,6 +438,21 @@ define([ 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()) { + me.header.mnuitemHideHeadings.setDisabled(locked); + me.header.mnuitemHideGridlines.setDisabled(locked); + me.header.mnuitemFreezePanes.setDisabled(locked); + } } }, diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index cb94ebea8..5ff557af0 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -127,7 +127,7 @@ define([ caption: this.capBtnFreeze, split: false, enableToggle: true, - lock: [_set.lostConnect, _set.coAuth] + lock: [_set.sheetLock, _set.lostConnect, _set.coAuth] }); this.lockedControls.push(this.btnFreezePanes); @@ -161,14 +161,14 @@ define([ this.chHeadings = new Common.UI.CheckBox({ el: $host.findById('#slot-chk-heading'), labelText: this.textHeadings, - lock : [_set.lostConnect, _set.coAuth] + lock : [_set.sheetLock, _set.lostConnect, _set.coAuth] }); this.lockedControls.push(this.chHeadings); this.chGridlines = new Common.UI.CheckBox({ el: $host.findById('#slot-chk-gridlines'), labelText: this.textGridlines, - lock : [_set.lostConnect, _set.coAuth] + lock : [_set.sheetLock, _set.lostConnect, _set.coAuth] }); this.lockedControls.push(this.chGridlines); From 0eaa3b53d5c54a8cb5f1e080c420f9b572c03cbf Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 10 Jul 2020 16:36:22 +0300 Subject: [PATCH 12/23] [SSE] Fix freeze settings in context menu --- apps/spreadsheeteditor/main/app/controller/DocumentHolder.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index e0b4360f4..139cd240e 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -1933,6 +1933,7 @@ define([ documentHolder.menuHyperlink.setDisabled(isCellLocked || inPivot); documentHolder.menuAddHyperlink.setDisabled(isCellLocked || inPivot); documentHolder.pmiInsFunction.setDisabled(isCellLocked || inPivot); + documentHolder.pmiFreezePanes.setDisabled(this.api.asc_isWorksheetLockedOrDeleted(this.api.asc_getActiveWorksheetIndex())); if (showMenu) this.showPopupMenu(documentHolder.ssMenu, {}, event); } else if (this.permissions.isEditDiagram && seltype == Asc.c_oAscSelectionType.RangeChartText) { From 10d1ea2e1ca42206f7cc19a4fec3d077047b2f2c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 15 Jul 2020 19:12:17 +0300 Subject: [PATCH 13/23] [SSE] Add sheet view locking --- .../main/app/controller/ViewTab.js | 29 +++++++- .../main/app/view/ViewManagerDlg.js | 68 +++++++++++++++---- 2 files changed, 82 insertions(+), 15 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 168bec832..89976d893 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -58,6 +58,7 @@ define([ initialize: function () { }, onLaunch: function () { + this._state = {}; }, setApi: function (api) { @@ -68,6 +69,7 @@ define([ this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, 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_onLockNamedSheetViewManager', this.onLockNamedSheetViewManager.bind(this)); this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); } @@ -97,6 +99,7 @@ define([ } }); Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this)); + Common.NotificationCenter.on('sheetview:locked', _.bind(this.onSheetViewLocked, this)); }, SetDisabled: function(state) { @@ -165,6 +168,10 @@ define([ }, onCreateView: function(item) { + if (this._state.viewlocked) { + Common.NotificationCenter.trigger('sheetview:locked'); + return; + } this.api && this.api.asc_addNamedSheetView(null, true); }, @@ -172,6 +179,7 @@ define([ var me = this; (new SSE.Views.ViewManagerDlg({ api: this.api, + locked: this._state.viewlocked, handler: function(result, value) { if (result == 'ok' && value) { if (me.api) { @@ -212,7 +220,26 @@ define([ onApiZoomChange: function(zf, type){ var value = Math.floor((zf + .005) * 100); this.view.cmbZoom.setValue(value, value + '%'); - } + }, + + onSheetViewLocked: function() { + var me = this; + if ($('.asc-window.modal.alert:visible').length < 1) { + Common.UI.warning({ + msg: this.errorEditView, + maxwidth: 500, + callback: _.bind(function(btn){ + Common.NotificationCenter.trigger('edit:complete', me.view); + }, this) + }); + } + }, + + onLockNamedSheetViewManager: function(state) { + this._state.viewlocked = state; + }, + + errorEditView: 'The existing sheet view cannot be edited and the new ones cannot be created at the moment as some of them are being edited.' }, SSE.Controllers.ViewTab || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js index af713d68a..f1120cbbd 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js @@ -95,13 +95,15 @@ define([ ].join('') }, options); - this.api = options.api; + this.api = options.api; this.views = options.views || []; + this.locked = options.locked || false; this.userTooltip = true; this.currentView = undefined; this.wrapEvents = { - onRefreshNamedSheetViewList: _.bind(this.onRefreshNamedSheetViewList, this) + onRefreshNamedSheetViewList: _.bind(this.onRefreshNamedSheetViewList, this), + onLockNamedSheetViewManager: _.bind(this.onLockNamedSheetViewManager, this) }; Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); @@ -117,7 +119,7 @@ define([ emptyText: this.textEmpty, template: _.template(['
'].join('')), itemTemplate: _.template([ - '
', + '
', '
<%= name %>
', '<% if (lock) { %>', '
<%=lockuser%>
', @@ -160,24 +162,30 @@ define([ _setDefaults: function (props) { this.refreshList(this.views, 0); this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); + this.api.asc_registerCallback('asc_onLockNamedSheetViewManager', this.wrapEvents.onLockNamedSheetViewManager); }, onRefreshNamedSheetViewList: function() { this.refreshList(this.api.asc_getNamedSheetViews(), this.currentView); }, + onLockNamedSheetViewManager: function(state) { + this.locked = state; + }, + refreshList: function(views, selectedItem) { if (views) { this.views = views; var arr = []; for (var i=0; i0) - // this.viewList.cmpEl.on('mouseover', _.bind(me.onMouseOverLock, me)).on('mouseout', _.bind(me.onMouseOutLock, me)); + if (this.userTooltip===true && this.viewList.cmpEl.find('.lock-user').length>0) + this.viewList.cmpEl.on('mouseover', _.bind(this.onMouseOverLock, this)).on('mouseout', _.bind(this.onMouseOutLock, this)); } var me = this; @@ -234,19 +242,48 @@ define([ }, onNew: function (duplicate) { + if (this.locked) { + Common.NotificationCenter.trigger('sheetview:locked'); + return; + } var rec = duplicate ? this.viewList.getSelectedRec().get('view') : undefined; this.currentView = this.viewList.store.length; this.api.asc_addNamedSheetView(rec); }, onDelete: function () { - var rec = this.viewList.getSelectedRec(); + var me = this, + rec = this.viewList.getSelectedRec(), + res; if (rec) { - this.api.asc_deleteNamedSheetViews([rec.get('view')]); + if (rec.get('active')) { + Common.UI.warning({ + msg: this.warnDeleteView.replace('%1', rec.get('name')), + buttons: ['yes', 'no'], + primary: 'yes', + callback: function(btn) { + if (btn == 'yes') { + res = me.api.asc_deleteNamedSheetViews([rec.get('view')]); + if (res) {// error when deleting + Common.UI.warning({msg: me.errorDeleteView.replace('%1', rec.get('name')), maxwidth: 500}); + } + } + } + }); + } else { + res = this.api.asc_deleteNamedSheetViews([rec.get('view')]); + if (res) {// error when deleting + Common.UI.warning({msg: this.errorDeleteView.replace('%1', rec.get('name')), maxwidth: 500}); + } + } } }, onRename: function () { + if (this.locked) { + Common.NotificationCenter.trigger('sheetview:locked'); + return; + } var rec = this.viewList.getSelectedRec(); if (rec) { var me = this; @@ -290,14 +327,15 @@ define([ return; } this.currentView = _.indexOf(this.viewList.store.models, record); - // this.btnRename.setDisabled(rawData.lock); - // this.btnDelete.setDisabled(rawData.lock); + this.btnRename.setDisabled(rawData.lock); + this.btnDelete.setDisabled(rawData.lock); } }, close: function () { this.userTipHide(); this.api.asc_unregisterCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); + this.api.asc_unregisterCallback('asc_onLockNamedSheetViewManager', this.wrapEvents.onLockNamedSheetViewManager); Common.Views.AdvancedSettingsWindow.prototype.close.call(this); }, @@ -323,7 +361,9 @@ define([ guestText: 'Guest', tipIsLocked: 'This element is being edited by another user.', textRenameLabel: 'Rename view', - textRenameError: 'View name must not be empty.' + textRenameError: 'View name must not be empty.', + warnDeleteView: "You are trying to delete the currently enabled view '%1'.
Close this view and delete it?", + errorDeleteView: "You cannot delete view '%1' because it is currently being used by other users." }, SSE.Views.ViewManagerDlg || {})); }); \ No newline at end of file From 9f309508f831891314d6fa9a9c1c199b46381ed6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 16 Jul 2020 18:04:34 +0300 Subject: [PATCH 14/23] [SSE] Show icon and tooltip for the active sheet view --- apps/common/main/lib/component/Tab.js | 20 +++++++++++++-- .../main/app/controller/Statusbar.js | 20 +++++++++++++++ .../main/app/view/Statusbar.js | 10 +++++--- .../main/resources/less/statusbar.less | 25 ++++++++++++++++++- 4 files changed, 69 insertions(+), 6 deletions(-) diff --git a/apps/common/main/lib/component/Tab.js b/apps/common/main/lib/component/Tab.js index 5d61c243a..e7c644aaa 100644 --- a/apps/common/main/lib/component/Tab.js +++ b/apps/common/main/lib/component/Tab.js @@ -51,9 +51,15 @@ define([ this.active = false; this.label = 'Tab'; this.cls = ''; + this.iconCls = ''; + this.iconVisible = false; + this.iconTitle = ''; this.index = -1; - this.template = _.template(['
  • ', - '<%- label %>', + this.template = _.template(['
  • ', + '', + '
    ', + '<%- label %>', + '
    ', '
  • '].join('')); this.initialize.call(this, opts); @@ -126,6 +132,16 @@ define([ setCaption: function(text) { this.$el.find('> span').text(text); + }, + + changeIconState: function(visible, title) { + if (this.iconCls.length) { + this.iconVisible = visible; + this.iconTitle = title || ''; + this[visible ? 'addClass' : 'removeClass']('icon-visible'); + if (title) + this.$el.find('.' + this.iconCls).attr('title', title); + } } }); diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js index 467c902b8..d93061354 100644 --- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js @@ -104,6 +104,8 @@ define([ this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this)); this.api.asc_registerCallback('asc_onFilterInfo', _.bind(this.onApiFilterInfo , this)); this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this)); + this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this)); + this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', _.bind(this.onRefreshNamedSheetViewList, this)); this.statusbar.setApi(api); }, @@ -710,6 +712,24 @@ define([ this.statusbar.tabMenu.hide(); }, + onRefreshNamedSheetViewList: function() { + var views = this.api.asc_getNamedSheetViews(), + active = false, + name=""; + for (var i=0; i 0 - || $(e.target).parent().hasClass('list-item') + || $(e.target).closest('.statusbar .list-item').length>0 || $('#status-tabs-scroll').find(el).length > 0 || $('#status-addtabs-box').find(el).length > 0) return; this.customizeStatusBarMenu.hide(); diff --git a/apps/spreadsheeteditor/main/resources/less/statusbar.less b/apps/spreadsheeteditor/main/resources/less/statusbar.less index f1afb8293..a3b21dc9b 100644 --- a/apps/spreadsheeteditor/main/resources/less/statusbar.less +++ b/apps/spreadsheeteditor/main/resources/less/statusbar.less @@ -229,6 +229,20 @@ } } + &.icon-visible { + > span { + padding-left: 25px; + > .toolbar__icon { + width: 20px; + height: 20px; + position: absolute; + top: 0; + left: 0; + margin: 3px; + } + } + } + &.disabled { opacity: 0.5; @@ -244,7 +258,6 @@ } &.mousemove { - > span { border-left: 2px solid @gray-deep; padding-left: 9px; @@ -257,6 +270,16 @@ padding-left: 10px; } } + &.icon-visible { + > span { + padding-left: 24px; + } + &.right { + > span { + padding-left: 25px; + } + } + } } } } From 45913675924737f70e83dd533df87d36b7ee2054 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 17 Jul 2020 11:10:27 +0300 Subject: [PATCH 15/23] [SSE] Fix rev. 30edbea008ddf4928ac9446e99e3223323ae9402 --- apps/spreadsheeteditor/main/app/controller/Viewport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index dd757f0e5..cea8131f2 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -395,7 +395,7 @@ define([ case 'celleditor': if (arguments[1]) { this.boxSdk.css('border-top', arguments[1]=='hidden'?'none':''); - this.header.mnuitemHideFormulaBar.setChecked(arguments[1]=='hidden', true); + this.header.mnuitemHideFormulaBar && this.header.mnuitemHideFormulaBar.setChecked(arguments[1]=='hidden', true); } this.viewport.celayout.doLayout(); break; From 262015dd14afcb8f0f67c47456ca609e9d59099f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 17 Jul 2020 11:13:50 +0300 Subject: [PATCH 16/23] Change component SynchronizeTip --- apps/common/main/lib/component/SynchronizeTip.js | 4 +++- apps/common/main/resources/less/synchronize-tip.less | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/SynchronizeTip.js b/apps/common/main/lib/component/SynchronizeTip.js index 9ddedf973..d012a2d97 100644 --- a/apps/common/main/lib/component/SynchronizeTip.js +++ b/apps/common/main/lib/component/SynchronizeTip.js @@ -111,7 +111,9 @@ define([ } else if (this.placement == 'top') this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'}); - else {// left or right + else if (this.placement == 'target') { + this.cmpEl.css({top : (showxy.top+5) + 'px', left: (showxy.left+5) + 'px'}); + } else {// left or right var top = showxy.top + this.target.height()/2, height = this.cmpEl.height(); if (top+height>innerHeight) diff --git a/apps/common/main/resources/less/synchronize-tip.less b/apps/common/main/resources/less/synchronize-tip.less index 921310553..205c3595e 100644 --- a/apps/common/main/resources/less/synchronize-tip.less +++ b/apps/common/main/resources/less/synchronize-tip.less @@ -23,6 +23,16 @@ } } + &.no-arrow { + .tip-arrow { + display: none; + } + + .asc-synchronizetip { + padding-right: 30px; + } + } + &.inc-index { z-index: @zindex-navbar + 4; } From 8197a5a0b267be789bef4dbbf0828a01ca854f70 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 17 Jul 2020 11:16:43 +0300 Subject: [PATCH 17/23] [SSE] Show tip when first opening sheet view mode --- .../main/app/controller/Statusbar.js | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js index d93061354..62462da3d 100644 --- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js @@ -727,13 +727,33 @@ define([ if (tab) { tab.changeIconState(active, name); } - + + if (active && !Common.localStorage.getBool("sse-hide-sheet-view-tip") && !Common.Utils.InternalSettings.get("sse-hide-sheet-view-tip")) { + Common.Utils.InternalSettings.set("sse-hide-sheet-view-tip", true); + var tip = new Common.UI.SynchronizeTip({ + target : $('#editor_sdk'), + extCls : 'no-arrow', + text : this.textSheetViewTip, + placement : 'target' + }); + tip.on({ + 'dontshowclick': function() { + Common.localStorage.setBool("sse-hide-sheet-view-tip", true); + this.close(); + }, + 'closeclick': function() { + this.close(); + } + }); + tip.show(); + } }, zoomText : 'Zoom {0}%', errorLastSheet : 'Workbook must have at least one visible worksheet.', errorRemoveSheet: 'Can\'t delete the worksheet.', warnDeleteSheet : 'The worksheet maybe has data. Proceed operation?', - strSheet : 'Sheet' + strSheet : 'Sheet', + textSheetViewTip: 'You are in Sheet View mode. Filters and sorting are visible only to you and those who are still in this view.' }, SSE.Controllers.Statusbar || {})); }); \ No newline at end of file From 323d50ef4c0b4f0c3c0b9c53deece42e638d73e3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 17 Jul 2020 16:54:23 +0300 Subject: [PATCH 18/23] [SSE] Add translation --- apps/spreadsheeteditor/main/locale/en.json | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 166c3607b..529dd1254 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1193,6 +1193,7 @@ "SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell.
    Are you sure you want to continue?", "SSE.Controllers.Toolbar.txtInsertCells": "Insert Cells", "SSE.Controllers.Toolbar.txtDeleteCells": "Delete Cells", + "SSE.Controllers.ViewTab.errorEditView": "The existing sheet view cannot be edited and the new ones cannot be created at the moment as some of them are being edited.", "SSE.Controllers.Viewport.textFreezePanes": "Freeze Panes", "SSE.Controllers.Viewport.textHideFBar": "Hide Formula Bar", "SSE.Controllers.Viewport.textHideGridlines": "Hide Gridlines", @@ -2810,6 +2811,7 @@ "SSE.Views.Toolbar.textVertical": "Vertical Text", "SSE.Views.Toolbar.capBtnInsSlicer": "Slicer", "SSE.Views.Toolbar.tipInsertSlicer": "Insert slicer", + "SSE.Views.Toolbar.textTabView": "View", "SSE.Views.Top10FilterDialog.textType": "Show", "SSE.Views.Top10FilterDialog.txtBottom": "Bottom", "SSE.Views.Top10FilterDialog.txtItems": "Item", @@ -2846,5 +2848,34 @@ "SSE.Views.ValueFieldSettingsDialog.txtSum": "Sum", "SSE.Views.ValueFieldSettingsDialog.txtSummarize": "Summarize value field by", "SSE.Views.ValueFieldSettingsDialog.txtVar": "Var", - "SSE.Views.ValueFieldSettingsDialog.txtVarp": "Varp" + "SSE.Views.ValueFieldSettingsDialog.txtVarp": "Varp", + "SSE.Views.ViewManagerDlg.txtTitle": "Sheet View Manager", + "SSE.Views.ViewManagerDlg.textViews": "Sheet views", + "SSE.Views.ViewManagerDlg.closeButtonText": "Close", + "SSE.Views.ViewManagerDlg.textNew": "New", + "SSE.Views.ViewManagerDlg.textRename": "Rename", + "SSE.Views.ViewManagerDlg.textDuplicate": "Duplicate", + "SSE.Views.ViewManagerDlg.textDelete": "Delete", + "SSE.Views.ViewManagerDlg.textGoTo": "Go to view...", + "SSE.Views.ViewManagerDlg.textEmpty": "No views have been created yet.", + "SSE.Views.ViewManagerDlg.guestText": "Guest", + "SSE.Views.ViewManagerDlg.tipIsLocked": "This element is being edited by another user.", + "SSE.Views.ViewManagerDlg.textRenameLabel": "Rename view", + "SSE.Views.ViewManagerDlg.textRenameError": "View name must not be empty.", + "SSE.Views.ViewManagerDlg.warnDeleteView": "You are trying to delete the currently enabled view '%1'.
    Close this view and delete it?", + "SSE.Views.ViewManagerDlg.errorDeleteView": "You cannot delete view '%1' because it is currently being used by other users.", + "SSE.Views.ViewTab.capBtnSheetView": "Sheet View", + "SSE.Views.ViewTab.capBtnFreeze": "Freeze Panes", + "SSE.Views.ViewTab.textZoom": "Zoom", + "SSE.Views.ViewTab.tipSheetView": "Sheet view", + "SSE.Views.ViewTab.textDefault": "Default", + "SSE.Views.ViewTab.textManager": "View manager", + "SSE.Views.ViewTab.tipFreeze": "Freeze panes", + "SSE.Views.ViewTab.tipCreate": "Create sheet view", + "SSE.Views.ViewTab.tipClose": "Close sheet view", + "SSE.Views.ViewTab.textCreate": "New", + "SSE.Views.ViewTab.textClose": "Close", + "SSE.Views.ViewTab.textFormula": "Formula bar", + "SSE.Views.ViewTab.textHeadings": "Headings", + "SSE.Views.ViewTab.textGridlines": "Gridlines" } \ No newline at end of file From 1854345961fbc0e41a697084689648eb5b1b1f12 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 17 Jul 2020 18:38:38 +0300 Subject: [PATCH 19/23] [SSE] Fix sheet view mode tip --- .../main/app/controller/Statusbar.js | 50 +++++++++++-------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js index 62462da3d..02aca59c4 100644 --- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js @@ -104,7 +104,6 @@ define([ this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this)); this.api.asc_registerCallback('asc_onFilterInfo', _.bind(this.onApiFilterInfo , this)); this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this)); - this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this)); this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', _.bind(this.onRefreshNamedSheetViewList, this)); this.statusbar.setApi(api); @@ -710,12 +709,16 @@ define([ onApiActiveSheetChanged: function (index) { this.statusbar.tabMenu.hide(); + if (this._sheetViewTip && this._sheetViewTip.isVisible() && !this.api.asc_getActiveNamedSheetView(index)) { // hide tip when sheet in the default mode + this._sheetViewTip.hide(); + } }, onRefreshNamedSheetViewList: function() { var views = this.api.asc_getNamedSheetViews(), active = false, - name=""; + name="", + me = this; for (var i=0; i Date: Fri, 17 Jul 2020 19:46:51 +0300 Subject: [PATCH 20/23] [SSE] Fix VewTab icons --- apps/spreadsheeteditor/main/app/view/ViewTab.js | 8 ++++---- apps/spreadsheeteditor/main/resources/less/toolbar.less | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 5ff557af0..0420a1495 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -92,7 +92,7 @@ define([ this.btnSheetView = new Common.UI.Button({ parentEl: $host.find('#slot-btn-sheet-view'), cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-sheetview', + iconCls: 'toolbar__icon btn-sheet-view', caption: me.capBtnSheetView, lock : [_set.lostConnect, _set.coAuth], menu: true @@ -102,7 +102,7 @@ define([ this.btnCreateView = new Common.UI.Button({ id : 'id-toolbar-btn-createview', cls : 'btn-toolbar', - iconCls : 'toolbar__icon btn-createview', + iconCls : 'toolbar__icon btn-sheet-view-new', caption : this.textCreate, lock : [_set.coAuth, _set.lostConnect] }); @@ -112,7 +112,7 @@ define([ this.btnCloseView = new Common.UI.Button({ id : 'id-toolbar-btn-closeview', cls : 'btn-toolbar', - iconCls : 'toolbar__icon btn-closeview', + iconCls : 'toolbar__icon btn-sheet-view-close', caption : this.textClose, lock : [_set.coAuth, _set.lostConnect] }); @@ -123,7 +123,7 @@ define([ this.btnFreezePanes = new Common.UI.Button({ parentEl: $host.find('#slot-btn-freeze'), cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-to-freeze', + iconCls: 'toolbar__icon btn-freeze-panes', caption: this.capBtnFreeze, split: false, enableToggle: true, diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index 4592a867d..c532ae550 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -164,5 +164,5 @@ #slot-field-zoom { float: left; - min-width: 45px; + min-width: 46px; } \ No newline at end of file From fe480d05121e450a66d69bd4651dfe43fb835212 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 20 Jul 2020 18:44:35 +0300 Subject: [PATCH 21/23] [SSE] Add icons --- .../img/toolbar/1.25x/btn-sheet-view.png | Bin 0 -> 342 bytes .../resources/img/toolbar/1.5x/btn-sheet-view.png | Bin 0 -> 389 bytes .../img/toolbar/1.75x/btn-sheet-view.png | Bin 0 -> 473 bytes .../resources/img/toolbar/1x/btn-sheet-view.png | Bin 0 -> 296 bytes .../resources/img/toolbar/2x/btn-sheet-view.png | Bin 0 -> 588 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/btn-sheet-view.png create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/btn-sheet-view.png create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/btn-sheet-view.png create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/1x/btn-sheet-view.png create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/2x/btn-sheet-view.png diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/btn-sheet-view.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/btn-sheet-view.png new file mode 100644 index 0000000000000000000000000000000000000000..76dd2895acd1968467d6bf1a29b42b1466b5b57d GIT binary patch literal 342 zcmV-c0jd6pP)X1ONa4*k^BEWz_&4OF zjrRJ~;PT2X;;jP{3_MPN%fmsu39O{HTFNO^Qtc|}HCA1LmDCmzQ>r9(1fKOe7BL6q zBH<$F1^S3Cq)_`D+I}EN=n}o42jGY0%Dr=Dj{B5kFsQJBOzm{&zs>Abm#Z zptsO)Gyg71lH&U6iC5o;$Pcvx74^j9+i=3$Hy33QIZAC*&xxs&8Kr|!2+g_h_Ji8; z9MXk(DRLMn(Vxjy<`6H;r+o}V=w^&=9EZQ%>0+GE9ENVXToSs|WtcYCO;`2f?suZC ooL=9FAnE;1EM7YX1_qw^0}Vgw^HKdwKL7v#07*qoM6N<$f(oOWsQ>@~ literal 0 HcmV?d00001 diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/btn-sheet-view.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/btn-sheet-view.png new file mode 100644 index 0000000000000000000000000000000000000000..f9d9e25b3834f4b043624a526f2157f3f4e486e6 GIT binary patch literal 389 zcmV;00eb$4P) z-I|)3n!ZB3>nCA)D^MUk_u=(qwO;ISLW35aEbjP1RtXidx1eF<-oWoL!bV4sRZvMV zjbnh}ouZ8naP56Ef*RhrSV(cuT0EY?*4uL4$OvlCd+7iNttIYn^oCtv#T;U>xI+7- z;*KhzJvMrA!KCO#RYVh3rI>O};3Mrl=H7;Cd;nX_UdlBodvT^Ox|8lg&i6A|NU*2f z&H0{ysr%=H#Rx4^VG|g1*ntTwFPB>8!X`y8O?tV@4h?JQBxpZeDptdkuo=C^dDeco zRIG-%!2ae6>yUmYHjJQM_s_cf2kvrR^Y6qc(yseh;q|b`TkPoqppvmego z3W)(rXN)oQL=wt=m9q^h$=Mest-l97+g(;HO2WR}xufh+3B42<|F8TIRFJ%s=rl?R z{YNW3g;|9G1@clNMhgAMRHV51p%8`nH%q%-%62-~`Y0j`V3A+4$ z8tc^yGfJgGuFO>LF|wuNedoJmmqGX}&BtO(GzH^!) z8S1ylnwPVcK(( P00000NkvXXu0mjfM-b4R literal 0 HcmV?d00001 diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1x/btn-sheet-view.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1x/btn-sheet-view.png new file mode 100644 index 0000000000000000000000000000000000000000..142fdc3adde8b83a8bd67a885d984ad8931e277a GIT binary patch literal 296 zcmV+@0oVSCP)n=rRbDKrn=b@a|(*k=jd-Ks%q-cqG5E$VYD` zSIa3J$9KE`jIVqsnE+tt&bdzq+bnF>QA9*1UoCt&2^-i5<`%=mO0b;7rLe4nh|OM8 zxQgg#Te|;=3o?TUGnGI^7}I^GwVahwQhZ<1BqEX~U%XmAEu|1#n0hG- umHhf`itmk~W!Hb+rm#1LWK=$SGyMW8-L3fJVR8Hb0000;2^WFu#5GOpTV1pRA+@F!SS(-M-x{$B>^aXs=xqptz#GsP?NW4b@j(e#^;6=@M2s$mOn6M(9#;W< znFzW73=4^``YEGr6y$FP9p-?xo2TpIrV?ja-X+k8o+dcNg#CZ7gcfaawg6!+C^D zyx~_ume1-E+z44}bqQ{O{5siQ!tlH0q6B*tV?Hw*AW!s!@pmf{xMKL&ud1r5s;a8$ a|LY%N{fC`NeX=?L0000 Date: Fri, 18 Sep 2020 13:15:00 +0300 Subject: [PATCH 22/23] [SSE] Add error for locked views --- apps/spreadsheeteditor/main/app/controller/Main.js | 7 ++++++- apps/spreadsheeteditor/main/app/controller/ViewTab.js | 4 ++-- apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index f1c3e13c1..c706c69bf 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1534,6 +1534,10 @@ define([ config.msg = this.errorMoveSlicerError; break; + case Asc.c_oAscError.ID.LockedEditView: + config.msg = this.errorEditView; + break; + default: config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; @@ -2663,7 +2667,8 @@ define([ errorPasteSlicerError: 'Table slicers cannot be copied from one workbook to another.', errorFrmlMaxLength: 'You cannot add this formula as its length exceeded the allowed number of characters.
    Please edit it and try again.', errorFrmlMaxReference: 'You cannot enter this formula because it has too many values,
    cell references, and/or names.', - errorMoveSlicerError: 'Table slicers cannot be copied from one workbook to another.
    Try again by selecting the entire table and the slicers.' + errorMoveSlicerError: 'Table slicers cannot be copied from one workbook to another.
    Try again by selecting the entire table and the slicers.', + errorEditView: 'The existing sheet view cannot be edited and the new ones cannot be created at the moment as some of them are being edited.' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 89976d893..2084f3e79 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -235,8 +235,8 @@ define([ } }, - onLockNamedSheetViewManager: function(state) { - this._state.viewlocked = state; + onLockNamedSheetViewManager: function(index, state) { + // this._state.viewlocked = state; }, errorEditView: 'The existing sheet view cannot be edited and the new ones cannot be created at the moment as some of them are being edited.' diff --git a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js index f1120cbbd..882f56e1b 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js @@ -169,8 +169,8 @@ define([ this.refreshList(this.api.asc_getNamedSheetViews(), this.currentView); }, - onLockNamedSheetViewManager: function(state) { - this.locked = state; + onLockNamedSheetViewManager: function(index, state) { + // this.locked = state; }, refreshList: function(views, selectedItem) { From 83bfedde4723bf8edc30ef45c6a465f7c6f6d1be Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 21 Sep 2020 17:49:49 +0300 Subject: [PATCH 23/23] [SSE] Refactoring --- .../main/app/controller/ViewTab.js | 29 +--------------- .../main/app/view/ViewManagerDlg.js | 33 +++---------------- apps/spreadsheeteditor/main/locale/en.json | 3 +- 3 files changed, 7 insertions(+), 58 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 2084f3e79..8a38b83bb 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -69,7 +69,6 @@ define([ this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, 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_onLockNamedSheetViewManager', this.onLockNamedSheetViewManager.bind(this)); this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); } @@ -99,7 +98,6 @@ define([ } }); Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this)); - Common.NotificationCenter.on('sheetview:locked', _.bind(this.onSheetViewLocked, this)); }, SetDisabled: function(state) { @@ -168,10 +166,6 @@ define([ }, onCreateView: function(item) { - if (this._state.viewlocked) { - Common.NotificationCenter.trigger('sheetview:locked'); - return; - } this.api && this.api.asc_addNamedSheetView(null, true); }, @@ -179,7 +173,6 @@ define([ var me = this; (new SSE.Views.ViewManagerDlg({ api: this.api, - locked: this._state.viewlocked, handler: function(result, value) { if (result == 'ok' && value) { if (me.api) { @@ -220,26 +213,6 @@ define([ onApiZoomChange: function(zf, type){ var value = Math.floor((zf + .005) * 100); this.view.cmbZoom.setValue(value, value + '%'); - }, - - onSheetViewLocked: function() { - var me = this; - if ($('.asc-window.modal.alert:visible').length < 1) { - Common.UI.warning({ - msg: this.errorEditView, - maxwidth: 500, - callback: _.bind(function(btn){ - Common.NotificationCenter.trigger('edit:complete', me.view); - }, this) - }); - } - }, - - onLockNamedSheetViewManager: function(index, state) { - // this._state.viewlocked = state; - }, - - errorEditView: 'The existing sheet view cannot be edited and the new ones cannot be created at the moment as some of them are being edited.' - + } }, SSE.Controllers.ViewTab || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js index 882f56e1b..3c71202c2 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js @@ -97,13 +97,11 @@ define([ this.api = options.api; this.views = options.views || []; - this.locked = options.locked || false; this.userTooltip = true; this.currentView = undefined; this.wrapEvents = { - onRefreshNamedSheetViewList: _.bind(this.onRefreshNamedSheetViewList, this), - onLockNamedSheetViewManager: _.bind(this.onLockNamedSheetViewManager, this) + onRefreshNamedSheetViewList: _.bind(this.onRefreshNamedSheetViewList, this) }; Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); @@ -162,17 +160,12 @@ define([ _setDefaults: function (props) { this.refreshList(this.views, 0); this.api.asc_registerCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); - this.api.asc_registerCallback('asc_onLockNamedSheetViewManager', this.wrapEvents.onLockNamedSheetViewManager); }, onRefreshNamedSheetViewList: function() { this.refreshList(this.api.asc_getNamedSheetViews(), this.currentView); }, - onLockNamedSheetViewManager: function(index, state) { - // this.locked = state; - }, - refreshList: function(views, selectedItem) { if (views) { this.views = views; @@ -242,10 +235,6 @@ define([ }, onNew: function (duplicate) { - if (this.locked) { - Common.NotificationCenter.trigger('sheetview:locked'); - return; - } var rec = duplicate ? this.viewList.getSelectedRec().get('view') : undefined; this.currentView = this.viewList.store.length; this.api.asc_addNamedSheetView(rec); @@ -263,27 +252,17 @@ define([ primary: 'yes', callback: function(btn) { if (btn == 'yes') { - res = me.api.asc_deleteNamedSheetViews([rec.get('view')]); - if (res) {// error when deleting - Common.UI.warning({msg: me.errorDeleteView.replace('%1', rec.get('name')), maxwidth: 500}); - } + me.api.asc_deleteNamedSheetViews([rec.get('view')]); } } }); } else { - res = this.api.asc_deleteNamedSheetViews([rec.get('view')]); - if (res) {// error when deleting - Common.UI.warning({msg: this.errorDeleteView.replace('%1', rec.get('name')), maxwidth: 500}); - } + this.api.asc_deleteNamedSheetViews([rec.get('view')]); } } }, onRename: function () { - if (this.locked) { - Common.NotificationCenter.trigger('sheetview:locked'); - return; - } var rec = this.viewList.getSelectedRec(); if (rec) { var me = this; @@ -310,7 +289,7 @@ define([ if (usersStore){ var rec = usersStore.findUser(id); if (rec) - return rec.get('username'); + return Common.Utils.UserInfoParser.getParsedName(rec.get('username')); } return this.guestText; }, @@ -335,7 +314,6 @@ define([ close: function () { this.userTipHide(); this.api.asc_unregisterCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); - this.api.asc_unregisterCallback('asc_onLockNamedSheetViewManager', this.wrapEvents.onLockNamedSheetViewManager); Common.Views.AdvancedSettingsWindow.prototype.close.call(this); }, @@ -362,8 +340,7 @@ define([ tipIsLocked: 'This element is being edited by another user.', textRenameLabel: 'Rename view', textRenameError: 'View name must not be empty.', - warnDeleteView: "You are trying to delete the currently enabled view '%1'.
    Close this view and delete it?", - errorDeleteView: "You cannot delete view '%1' because it is currently being used by other users." + warnDeleteView: "You are trying to delete the currently enabled view '%1'.
    Close this view and delete it?" }, SSE.Views.ViewManagerDlg || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index fc4eaed47..0702dbc0d 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -850,6 +850,7 @@ "SSE.Controllers.Main.warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
    Contact your administrator to learn more.", "SSE.Controllers.Main.warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", + "SSE.Controllers.Main.errorEditView": "The existing sheet view cannot be edited and the new ones cannot be created at the moment as some of them are being edited.", "SSE.Controllers.Print.strAllSheets": "All Sheets", "SSE.Controllers.Print.textFirstCol": "First column", "SSE.Controllers.Print.textFirstRow": "First row", @@ -1215,7 +1216,6 @@ "SSE.Controllers.Toolbar.txtTable_TableStyleMedium": "Table Style Medium", "SSE.Controllers.Toolbar.warnLongOperation": "The operation you are about to perform might take rather much time to complete.
    Are you sure you want to continue?", "SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell.
    Are you sure you want to continue?", - "SSE.Controllers.ViewTab.errorEditView": "The existing sheet view cannot be edited and the new ones cannot be created at the moment as some of them are being edited.", "SSE.Controllers.Viewport.textFreezePanes": "Freeze Panes", "SSE.Controllers.Viewport.textFreezePanesShadow:": "Show Freezed Panes Shadow", "SSE.Controllers.Viewport.textHideFBar": "Hide Formula Bar", @@ -2941,7 +2941,6 @@ "SSE.Views.ViewManagerDlg.textRenameLabel": "Rename view", "SSE.Views.ViewManagerDlg.textRenameError": "View name must not be empty.", "SSE.Views.ViewManagerDlg.warnDeleteView": "You are trying to delete the currently enabled view '%1'.
    Close this view and delete it?", - "SSE.Views.ViewManagerDlg.errorDeleteView": "You cannot delete view '%1' because it is currently being used by other users.", "SSE.Views.ViewTab.capBtnSheetView": "Sheet View", "SSE.Views.ViewTab.capBtnFreeze": "Freeze Panes", "SSE.Views.ViewTab.textZoom": "Zoom",