diff --git a/apps/spreadsheeteditor/main/app/template/TableSettings.template b/apps/spreadsheeteditor/main/app/template/TableSettings.template index 69a221e9d..0e5a32083 100644 --- a/apps/spreadsheeteditor/main/app/template/TableSettings.template +++ b/apps/spreadsheeteditor/main/app/template/TableSettings.template @@ -62,21 +62,26 @@ - + -
- - - -
+ + +
+ + + + + + + \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/template/TableSettingsAdvanced.template b/apps/spreadsheeteditor/main/app/template/TableSettingsAdvanced.template new file mode 100644 index 000000000..8f96f547a --- /dev/null +++ b/apps/spreadsheeteditor/main/app/template/TableSettingsAdvanced.template @@ -0,0 +1,23 @@ +
+
+ + + + + + + + + + +
+ +
+
+ + +
+ +
+
+
\ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/TableSettings.js b/apps/spreadsheeteditor/main/app/view/TableSettings.js index dc32e228e..f9430b7e9 100644 --- a/apps/spreadsheeteditor/main/app/view/TableSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TableSettings.js @@ -47,7 +47,8 @@ define([ 'common/main/lib/component/Button', 'common/main/lib/component/CheckBox', 'common/main/lib/component/ComboDataView', - 'spreadsheeteditor/main/app/view/TableOptionsDialog' + 'spreadsheeteditor/main/app/view/TableOptionsDialog', + 'spreadsheeteditor/main/app/view/TableSettingsAdvanced' ], function (menuTemplate, $, _, Backbone) { 'use strict'; @@ -168,6 +169,8 @@ define([ el.html(this.template({ scope: this })); + + this.linkAdvanced = $('#table-advanced-link'); }, setApi: function(o) { @@ -283,9 +286,34 @@ define([ this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this)); this.lockedControls.push(this.btnEdit); + $(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this)); + this._initSettings = false; }, + openAdvancedSettings: function(e) { + if (this.linkAdvanced.hasClass('disabled')) return; + + var me = this; + var win; + if (me.api && !this._locked){ + (new SSE.Views.TableSettingsAdvanced( + { + tableProps: me._originalProps, + api: me.api, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + // me.api.asc_setGraphicObjectProps(value.tableProps); + } + } + + Common.NotificationCenter.trigger('edit:complete', me); + } + })).show(); + } + }, + ChangeSettings: function(props) { if (this._initSettings) this.createDelayedControls(); @@ -472,6 +500,7 @@ define([ _.each(this.lockedControls, function(item) { item.setDisabled(disable); }); + this.linkAdvanced.toggleClass('disabled', disable); } }, @@ -506,7 +535,8 @@ define([ textExistName : 'ERROR! Range with such a name already exists', textIsLocked : 'This element is being edited by another user.', notcriticalErrorTitle : 'Warning', - textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.' + textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.', + textAdvanced: 'Show advanced settings' }, SSE.Views.TableSettings || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/TableSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/TableSettingsAdvanced.js new file mode 100644 index 000000000..b49a875ee --- /dev/null +++ b/apps/spreadsheeteditor/main/app/view/TableSettingsAdvanced.js @@ -0,0 +1,133 @@ +/* + * + * (c) Copyright Ascensio System Limited 2010-2017 + * + * 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 Lubanas st. 125a-25, Riga, Latvia, + * EU, LV-1021. + * + * 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 + * +*/ +/** + * TableSettingsAdvanced.js + * + * Created by Julia Radzhabova on 1/19/17 + * Copyright (c) 2017 Ascensio System SIA. All rights reserved. + * + */ + +define([ 'text!spreadsheeteditor/main/app/template/TableSettingsAdvanced.template', + 'common/main/lib/view/AdvancedSettingsWindow', + 'common/main/lib/component/InputField' +], function (contentTemplate) { + 'use strict'; + + SSE.Views.TableSettingsAdvanced = Common.Views.AdvancedSettingsWindow.extend(_.extend({ + options: { + contentWidth: 300, + height: 342, + toggleGroup: 'table-adv-settings-group', + properties: null, + storageName: 'sse-table-settings-adv-category' + }, + + initialize : function(options) { + _.extend(this.options, { + title: this.textTitle, + items: [ + {panelId: 'id-adv-table-alttext', panelCaption: this.textAlt} + ], + contentTemplate: _.template(contentTemplate)({ + scope: this + }) + }, options); + Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); + + this._originalProps = this.options.tableProps; + this._changedProps = null; + }, + + render: function() { + Common.Views.AdvancedSettingsWindow.prototype.render.call(this); + + var me = this; + + // Alt Text + + this.inputAltTitle = new Common.UI.InputField({ + el : $('#table-advanced-alt-title'), + allowBlank : true, + validateOnBlur: false, + style : 'width: 100%;' + }).on('changed:after', function() { + me.isAltTitleChanged = true; + }); + + this.textareaAltDescription = this.$window.find('textarea'); + this.textareaAltDescription.keydown(function (event) { + if (event.keyCode == Common.UI.Keys.RETURN) { + event.stopPropagation(); + } + me.isAltDescChanged = true; + }); + + this.afterRender(); + }, + + afterRender: function() { + this._setDefaults(this._originalProps); + if (this.storageName) { + var value = Common.localStorage.getItem(this.storageName); + this.setActiveCategory((value!==null) ? parseInt(value) : 0); + } + }, + + _setDefaults: function(props) { + if (props ){ + // var value = props.asc_getTitle(); + // this.inputAltTitle.setValue(value ? value : ''); + // + // value = props.asc_getDescription(); + // this.textareaAltDescription.val(value ? value : ''); + } + }, + + getSettings: function() { + return { tableProps: { + altTitle: (this.isAltTitleChanged) ? this.inputAltTitle.getValue() : undefined, + altDescription: (this.isAltDescChanged) ? this.textareaAltDescription.val(): undefined + }} ; + }, + + textTitle: 'Table - Advanced Settings', + cancelButtonText: 'Cancel', + okButtonText: 'Ok', + textAlt: 'Alternative Text', + textAltTitle: 'Title', + textAltDescription: 'Description', + textAltTip: 'The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.' + + }, SSE.Views.TableSettingsAdvanced || {})); +}); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 52c52f42d..dc25078cd 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1446,6 +1446,14 @@ "SSE.Views.TableSettings.textTableName": "Table Name", "SSE.Views.TableSettings.textTemplate": "Select From Template", "SSE.Views.TableSettings.textTotal": "Total", + "SSE.Views.TableSettings.textAdvanced": "Show advanced settings", + "SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text", + "SSE.Views.TableSettingsAdvanced.textAltTitle": "Title", + "SSE.Views.TableSettingsAdvanced.textAltDescription": "Description", + "SSE.Views.TableSettingsAdvanced.textAltTip": "The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.", + "SSE.Views.TableSettingsAdvanced.textTitle": "Table - Advanced Settings", + "SSE.Views.TableSettingsAdvanced.cancelButtonText": "Cancel", + "SSE.Views.TableSettingsAdvanced.okButtonText": "Ok", "SSE.Views.TextArtSettings.strBackground": "Background color", "SSE.Views.TextArtSettings.strColor": "Color", "SSE.Views.TextArtSettings.strFill": "Fill",