X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ftable%2Fdialogs%2Ftable.js;h=6ad826cb50626c725a3d2527b35b5bb2d28923be;hb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;hp=215a373d4bfbf29834e47fa761f0c4b8e5264ed5;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/plugins/table/dialogs/table.js b/_source/plugins/table/dialogs/table.js index 215a373..6ad826c 100644 --- a/_source/plugins/table/dialogs/table.js +++ b/_source/plugins/table/dialogs/table.js @@ -154,7 +154,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Should we make all first cells in a row TH? if ( !this.hasColumnHeaders && ( headers == 'col' || headers == 'both' ) ) { - for( row = 0 ; row < table.$.rows.length ; row++ ) + for ( row = 0 ; row < table.$.rows.length ; row++ ) { newCell = new CKEDITOR.dom.element( table.$.rows[ row ].cells[ 0 ] ); newCell.renameNode( 'th' ); @@ -165,7 +165,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Should we make all first TH-cells in a row make TD? If 'yes' we do it the other way round :-) if ( ( this.hasColumnHeaders ) && !( headers == 'col' || headers == 'both' ) ) { - for( i = 0 ; i < table.$.rows.length ; i++ ) + for ( i = 0 ; i < table.$.rows.length ; i++ ) { row = new CKEDITOR.dom.element( table.$.rows[i] ); if ( row.getParent().getName() == 'tbody' ) @@ -192,7 +192,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license else table.removeStyle( 'width' ); - if( !table.getAttribute( 'style' ) ) + if ( !table.getAttribute( 'style' ) ) table.removeAttribute( 'style' ); } @@ -339,7 +339,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license label : editor.lang.table.align, items : [ - [ editor.lang.table.alignNotSet , ''], + [ editor.lang.common.notSet , ''], [ editor.lang.table.alignLeft , 'left'], [ editor.lang.table.alignCenter , 'center'], [ editor.lang.table.alignRight , 'right'] @@ -375,18 +375,33 @@ For licensing, see LICENSE.html or http://ckeditor.com/license label : editor.lang.table.width, 'default' : 200, validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidWidth ), + + // Extra labelling of width unit type. + onLoad : function() + { + var widthType = this.getDialog().getContentElement( 'info', 'cmbWidthType' ), + labelElement = widthType.getElement(), + inputElement = this.getInputElement(), + ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' ); + + inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) ); + }, + setup : function( selectedTable ) { var widthMatch = widthPattern.exec( selectedTable.$.style.width ); if ( widthMatch ) this.setValue( widthMatch[1] ); + else + this.setValue( '' ); }, commit : commitValue }, { id : 'cmbWidthType', type : 'select', - label : ' ', + label : editor.lang.table.widthUnit, + labelStyle: 'visibility:hidden', 'default' : 'pixels', items : [ @@ -415,6 +430,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license label : editor.lang.table.height, 'default' : '', validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidHeight ), + + // Extra labelling of height unit type. + onLoad : function() + { + var heightType = this.getDialog().getContentElement( 'info', 'htmlHeightType' ), + labelElement = heightType.getElement(), + inputElement = this.getInputElement(), + ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' ); + + inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) ); + }, + setup : function( selectedTable ) { var heightMatch = heightPattern.exec( selectedTable.$.style.height ); @@ -424,8 +451,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license commit : commitValue }, { + id : 'htmlHeightType', type : 'html', - html : '
' + editor.lang.table.widthPx + html : '

' + editor.lang.table.widthPx + '
' } ] }, @@ -540,6 +568,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { if ( this.getValue() ) selectedTable.setAttribute( 'summary', this.getValue() ); + else + selectedTable.removeAttribute( 'summary' ); } } ]