JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.3.2
[ckeditor.git] / _source / plugins / colorbutton / plugin.js
index 2a14bb0..305c44d 100644 (file)
@@ -40,12 +40,15 @@ CKEDITOR.plugins.add( 'colorbutton',
                                                block.autoSize = true;\r
                                                block.element.addClass( 'cke_colorblock' );\r
                                                block.element.setHtml( renderColors( panel, type ) );\r
+                                               // The block should not have scrollbars (#5933, #6056)\r
+                                               block.element.getDocument().getBody().setStyle( 'overflow', 'hidden' );\r
 \r
                                                var keys = block.keys;\r
-                                               keys[ 39 ]      = 'next';                                       // ARROW-RIGHT\r
+                                               var rtl = editor.lang.dir == 'rtl';\r
+                                               keys[ rtl ? 37 : 39 ]   = 'next';                                       // ARROW-RIGHT\r
                                                keys[ 40 ]      = 'next';                                       // ARROW-DOWN\r
                                                keys[ 9 ]       = 'next';                                       // TAB\r
-                                               keys[ 37 ]      = 'prev';                                       // ARROW-LEFT\r
+                                               keys[ rtl ? 39 : 37 ]   = 'prev';                                       // ARROW-LEFT\r
                                                keys[ 38 ]      = 'prev';                                       // ARROW-UP\r
                                                keys[ CKEDITOR.SHIFT + 9 ]      = 'prev';       // SHIFT + TAB\r
                                                keys[ 32 ]      = 'click';                                      // SPACE\r
@@ -140,8 +143,9 @@ CKEDITOR.plugins.add( 'colorbutton',
 \r
                                // The data can be only a color code (without #) or colorName + color code\r
                                // If only a color code is provided, then the colorName is the color with the hash\r
+                               // Convert the color from RGB to RRGGBB for better compatibility with IE and <font>. See #5676\r
                                if (!parts[1])\r
-                                       colorName = '#' + colorName;\r
+                                       colorName = '#' + colorName.replace( /^(.)(.)(.)$/, '$1$1$2$2$3$3' );\r
 \r
                                var colorLabel = editor.lang.colors[ colorCode ] || colorCode;\r
                                output.push(\r