From 6e83ac8ca87cade152480e14f7a7fbd43eb4af8e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 19 Jan 2017 12:41:35 +0300 Subject: [PATCH] [DE] Added alternative text for tables (for future use). --- .../template/TableSettingsAdvanced.template | 23 +++++++++++ .../main/app/view/TableSettingsAdvanced.js | 38 ++++++++++++++++++- apps/documenteditor/main/locale/en.json | 4 ++ 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/template/TableSettingsAdvanced.template b/apps/documenteditor/main/app/template/TableSettingsAdvanced.template index 22e7b08db..ad82ecbe2 100644 --- a/apps/documenteditor/main/app/template/TableSettingsAdvanced.template +++ b/apps/documenteditor/main/app/template/TableSettingsAdvanced.template @@ -327,4 +327,27 @@ + +
+
+ + + + + + + + + + +
+ +
+
+ + +
+ +
+
\ No newline at end of file diff --git a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js index 1a7ce395d..9ac7f14e4 100644 --- a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js @@ -67,7 +67,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat {panelId: 'id-adv-table-cell-props', panelCaption: this.textCellProps}, {panelId: 'id-adv-table-borders', panelCaption: this.textBordersBackgroung}, {panelId: 'id-adv-table-position', panelCaption: this.textTablePosition}, - {panelId: 'id-adv-table-wrap', panelCaption: this.textWrap} + {panelId: 'id-adv-table-wrap', panelCaption: this.textWrap}, + {panelId: 'id-adv-table-alttext', panelCaption: this.textAlt} ], contentTemplate: _.template(contentTemplate)({ scope: this @@ -1003,7 +1004,25 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this._btnsTableBorderPosition.push( _btn ); }, 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.btnsCategory[5].setVisible(false); this.AlignContainer = $('#tableadv-panel-align'); this.DistanceContainer = $('#tableadv-panel-distance'); @@ -1119,6 +1138,12 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this._changedProps.put_CellBorders(this.ChangedCellBorders); } + if (this.isAltTitleChanged) + this._changedProps.asc_putTitle(this.inputAltTitle.getValue()); + + if (this.isAltDescChanged) + this._changedProps.asc_putDescription(this.textareaAltDescription.val()); + return { tableProps: this._changedProps, borderProps: {borderSize: this.BorderSize, borderColor: this.btnBorderColor.color} }; }, @@ -1384,6 +1409,11 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this.ShowHideSpacing(this.chAllowSpacing.getValue()==='checked'); + // value = props.asc_getTitle(); + // this.inputAltTitle.setValue(value ? value : ''); + // + // value = props.asc_getDescription(); + // this.textareaAltDescription.val(value ? value : ''); } this._changedProps = new Asc.CTableProp(); this._changedProps.put_CellSelect(!this._allTable); @@ -2140,7 +2170,11 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat textTable: 'Table', textTableSize: 'Table Size', textTablePosition: 'Table Position', - textWrappingStyle: 'Wrapping Style' + textWrappingStyle: 'Wrapping Style', + 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.' }, DE.Views.TableSettingsAdvanced || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 2951c8b46..3c5d6a566 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1425,6 +1425,10 @@ "DE.Views.TableSettingsAdvanced.txtNoBorders": "No borders", "DE.Views.TableSettingsAdvanced.txtPercent": "Percent", "DE.Views.TableSettingsAdvanced.txtPt": "Point", + "DE.Views.TableSettingsAdvanced.textAlt": "Alternative Text", + "DE.Views.TableSettingsAdvanced.textAltTitle": "Title", + "DE.Views.TableSettingsAdvanced.textAltDescription": "Description", + "DE.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.", "DE.Views.TextArtSettings.strColor": "Color", "DE.Views.TextArtSettings.strFill": "Fill", "DE.Views.TextArtSettings.strSize": "Size",