JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1
[ckeditor.git] / _source / plugins / colorbutton / plugin.js
index 747716e..b49e5f8 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -31,7 +31,7 @@ CKEDITOR.plugins.add( 'colorbutton',
 \r
                                        panel :\r
                                        {\r
-                                               css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ]\r
+                                               css : editor.skin.editor.css\r
                                        },\r
 \r
                                        onBlock : function( panel, blockName )\r
@@ -61,8 +61,21 @@ CKEDITOR.plugins.add( 'colorbutton',
                                {\r
                                        if ( color == '?' )\r
                                        {\r
-                                               // TODO : Implement the colors dialog.\r
-                                               // editor.openDialog( '' );\r
+                                               var applyColorStyle = arguments.callee;\r
+                                               function onColorDialogClose( evt )\r
+                                               {\r
+                                                       this.removeListener( 'ok', onColorDialogClose );\r
+                                                       this.removeListener( 'cancel', onColorDialogClose );\r
+\r
+                                                       evt.name == 'ok' && applyColorStyle( this.getContentElement( 'picker', 'selectedColor' ).getValue(), type );\r
+                                               }\r
+\r
+                                               editor.openDialog( 'colordialog', function()\r
+                                               {\r
+                                                       this.on( 'ok', onColorDialogClose );\r
+                                                       this.on( 'cancel', onColorDialogClose );\r
+                                               } );\r
+\r
                                                return;\r
                                        }\r
 \r
@@ -148,7 +161,7 @@ CKEDITOR.plugins.add( 'colorbutton',
  * @example\r
  * config.colorButton_enableMore = false;\r
  */\r
-CKEDITOR.config.colorButton_enableMore = false;\r
+CKEDITOR.config.colorButton_enableMore = true;\r
 \r
 /**\r
  * Defines the colors to be displayed in the color selectors. It's a string\r