JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.2
[ckeditor.git] / _source / plugins / table / dialogs / table.js
index 4675a0c..38652d4 100644 (file)
@@ -43,6 +43,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        }\r
                                        else if ( ranges.length > 0 )\r
                                        {\r
+                                               // Webkit could report the following range on cell selection (#4948):\r
+                                               // <table><tr><td>[&nbsp;</td></tr></table>]\r
+                                               if ( CKEDITOR.env.webkit )\r
+                                                       ranges[ 0 ].shrink( CKEDITOR.NODE_ELEMENT );\r
+\r
                                                var rangeRoot = ranges[0].getCommonAncestor( true );\r
                                                selectedTable = rangeRoot.getAscendant( 'table', true );\r
                                        }\r
@@ -339,7 +344,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,6 +380,18 @@ 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
@@ -388,7 +405,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                {\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
@@ -417,6 +435,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
@@ -426,8 +456,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
@@ -542,6 +573,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                        {\r
                                                                                if ( this.getValue() )\r
                                                                                        selectedTable.setAttribute( 'summary', this.getValue() );\r
+                                                                               else\r
+                                                                                       selectedTable.removeAttribute( 'summary' );\r
                                                                        }\r
                                                                }\r
                                                        ]\r