'].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/common/main/lib/view/EditNameDialog.js b/apps/common/main/lib/view/EditNameDialog.js
new file mode 100644
index 0000000000..d4f6d4f514
--- /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/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js
index 4f00bebb7b..013d52043d 100644
--- a/apps/common/main/lib/view/Header.js
+++ b/apps/common/main/lib/view/Header.js
@@ -664,9 +664,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/common/main/resources/less/synchronize-tip.less b/apps/common/main/resources/less/synchronize-tip.less
index 9213105538..205c3595e2 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;
}
diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js
index f274e5365a..98f81f10a0 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/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
index 4a0b94ab24..a85e080f13 100644
--- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
+++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
@@ -1959,6 +1959,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) {
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index e1756ab83a..5017242a19 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -358,6 +358,7 @@ define([
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
this.appOptions.canFeaturePivot = true;
+ 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 : '');
@@ -1533,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;
@@ -2665,7 +2670,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/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js
index 779b1c9d02..9e257d3711 100644
--- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js
@@ -104,6 +104,7 @@ 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_onRefreshNamedSheetViewList', _.bind(this.onRefreshNamedSheetViewList, this));
this.statusbar.setApi(api);
},
@@ -711,12 +712,61 @@ 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="",
+ me = this;
+ for (var i=0; i-->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js
index 7ec57c21ca..697f6a861d 100644
--- a/apps/spreadsheeteditor/main/app/view/Statusbar.js
+++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js
@@ -489,11 +489,12 @@ define([
if (this.api) {
var wc = this.api.asc_getWorksheetsCount(), i = -1;
- var hidentems = [], items = [], tab, locked;
+ var hidentems = [], items = [], tab, locked, name;
var sindex = this.api.asc_getActiveWorksheetIndex();
while (++i < wc) {
locked = me.api.asc_isWorksheetLockedOrDeleted(i);
+ name = me.api.asc_getActiveNamedSheetView(i) || '';
tab = {
sheetindex : i,
index : items.length,
@@ -501,7 +502,10 @@ define([
label : me.api.asc_getWorksheetName(i),
// reorderable : !locked,
cls : locked ? 'coauth-locked':'',
- isLockTheDrag : locked
+ isLockTheDrag : locked,
+ iconCls : 'btn-sheet-view',
+ iconTitle : name,
+ iconVisible : name!==''
};
this.api.asc_isWorksheetHidden(i)? hidentems.push(tab) : items.push(tab);
@@ -765,7 +769,7 @@ define([
showCustomizeStatusBar: function (e) {
var el = $(e.target);
if ($('#status-zoom-box').find(el).length > 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/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js
index bfb0783e16..e65dee66ca 100644
--- a/apps/spreadsheeteditor/main/app/view/Toolbar.js
+++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js
@@ -325,7 +325,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'}
]}
);
@@ -2433,6 +2435,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/ViewManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js
new file mode 100644
index 0000000000..3c71202c23
--- /dev/null
+++ b/apps/spreadsheeteditor/main/app/view/ViewManagerDlg.js
@@ -0,0 +1,346 @@
+/*
+ *
+ * (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/EditNameDialog',
+ '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: [
+ '