JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2
[ckeditor.git] / _source / plugins / table / dialogs / table.js
index 215a373..87e55df 100644 (file)
@@ -154,7 +154,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        // Should we make all first cells in a row TH?\r
                                        if ( !this.hasColumnHeaders && ( headers == 'col' || headers == 'both' ) )\r
                                        {\r
-                                               for( row = 0 ; row < table.$.rows.length ; row++ )\r
+                                               for ( row = 0 ; row < table.$.rows.length ; row++ )\r
                                                {\r
                                                        newCell = new CKEDITOR.dom.element( table.$.rows[ row ].cells[ 0 ] );\r
                                                        newCell.renameNode( 'th' );\r
@@ -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 :-)\r
                                        if ( ( this.hasColumnHeaders ) && !( headers == 'col' || headers == 'both' ) )\r
                                        {\r
-                                               for( i = 0 ; i < table.$.rows.length ; i++ )\r
+                                               for ( i = 0 ; i < table.$.rows.length ; i++ )\r
                                                {\r
                                                        row = new CKEDITOR.dom.element( table.$.rows[i] );\r
                                                        if ( row.getParent().getName() == 'tbody' )\r
@@ -192,7 +192,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        else\r
                                                table.removeStyle( 'width' );\r
 \r
-                                       if( !table.getAttribute( 'style' ) )\r
+                                       if ( !table.getAttribute( 'style' ) )\r
                                                table.removeAttribute( 'style' );\r
                                }\r
 \r
@@ -339,7 +339,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                        label : editor.lang.table.align,\r
                                                                                        items :\r
                                                                                        [\r
-                                                                                               [ editor.lang.table.alignNotSet , ''],\r
+                                                                                               [ editor.lang.common.notSet , ''],\r
                                                                                                [ editor.lang.table.alignLeft , 'left'],\r
                                                                                                [ editor.lang.table.alignCenter , 'center'],\r
                                                                                                [ editor.lang.table.alignRight , 'right']\r
@@ -375,18 +375,33 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                        label : editor.lang.table.width,\r
                                                                                                        'default' : 200,\r
                                                                                                        validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidWidth ),\r
+\r
+                                                                                                       // Extra labelling of width unit type.\r
+                                                                                                       onLoad : function()\r
+                                                                                                       {\r
+                                                                                                               var widthType = this.getDialog().getContentElement( 'info', 'cmbWidthType' ),\r
+                                                                                                                       labelElement = widthType.getElement(),\r
+                                                                                                                       inputElement = this.getInputElement(),\r
+                                                                                                                       ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );\r
+\r
+                                                                                                               inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );\r
+                                                                                                       },\r
+\r
                                                                                                        setup : function( selectedTable )\r
                                                                                                        {\r
                                                                                                                var widthMatch = widthPattern.exec( selectedTable.$.style.width );\r
                                                                                                                if ( widthMatch )\r
                                                                                                                        this.setValue( widthMatch[1] );\r
+                                                                                                               else\r
+                                                                                                                       this.setValue( '' );\r
                                                                                                        },\r
                                                                                                        commit : commitValue\r
                                                                                                },\r
                                                                                                {\r
                                                                                                        id : 'cmbWidthType',\r
                                                                                                        type : 'select',\r
-                                                                                                       label : '&nbsp;',\r
+                                                                                                       label : editor.lang.table.widthUnit,\r
+                                                                                                       labelStyle: 'visibility:hidden',\r
                                                                                                        'default' : 'pixels',\r
                                                                                                        items :\r
                                                                                                        [\r
@@ -415,6 +430,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                        label : editor.lang.table.height,\r
                                                                                                        'default' : '',\r
                                                                                                        validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidHeight ),\r
+\r
+                                                                                                       // Extra labelling of height unit type.\r
+                                                                                                       onLoad : function()\r
+                                                                                                       {\r
+                                                                                                               var heightType = this.getDialog().getContentElement( 'info', 'htmlHeightType' ),\r
+                                                                                                                       labelElement = heightType.getElement(),\r
+                                                                                                                       inputElement = this.getInputElement(),\r
+                                                                                                                       ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );\r
+\r
+                                                                                                               inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );\r
+                                                                                                       },\r
+\r
                                                                                                        setup : function( selectedTable )\r
                                                                                                        {\r
                                                                                                                var heightMatch = heightPattern.exec( selectedTable.$.style.height );\r
@@ -424,8 +451,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                        commit : commitValue\r
                                                                                                },\r
                                                                                                {\r
+                                                                                                       id : 'htmlHeightType',\r
                                                                                                        type : 'html',\r
-                                                                                                       html : '<br />' + editor.lang.table.widthPx\r
+                                                                                                       html : '<div><br />' + editor.lang.table.widthPx + '</div>'\r
                                                                                                }\r
                                                                                        ]\r
                                                                                },\r