Log in or register to post comments
Last post
richardd's picture
Joined: 24/05/2011
Posts: 31
Grouped Color Button
A very simple plugin to group colors on the color palette, as requested by webhelio in the CKEditor 3.x forum.

Screenshots

groupedcolorbutton.zip

Installation

1. Extract the contents of the file into the "plugins" folder of CKEditor.
2. In the CKEditor configuration file (config.js) add the following code:

config.extraPlugins = 'groupedcolorbutton';


This plugin replaces the existing TextColor and BGColor buttons, so there should be no need to modify your toolbar configuration.

Customization

To customize the colors and groups displayed, modify the groupedColorButton_colors setting:

config.groupedColorButton_colors =
[
  {
    title: "Brand Colors",
    colors: "A70000,818181,000,BE671A"
  },
  {
    title: "Default Colors",
    colors: CKEDITOR.config.colorButton_colors
  }
];

Attachments: 

fredm's picture
Joined: 05/06/2012
Posts: 2
Re: Grouped Color Button
I cannot get it working. Has it to do with 'requires : [ 'panelbutton', 'floatpanel', 'styles' ],'
Does that mean some other plugins must be available?
leejacky's picture
Joined: 06/06/2012
Posts: 12
Re: Grouped Color Button
RichardD wrote:A very simple plugin to group colors on the color palette, as requested by webhelio in the CKEditor 3.x forum.

Screenshots

Grouped-Color-Button.png

License

Licensed under the terms of any of the following licenses at your choice: GPL, LGPL and MPL.

Download

Grouped Color Button v1:
groupedcolorbutton.zip

Installation

1. Extract the contents of the file into the "plugins" folder of CKEditor.
2. In the CKEditor configuration file (config.js) add the following code:

config.extraPlugins = 'groupedcolorbutton';


This plugin replaces the existing TextColor and BGColor buttons, so there should be no need to modify your toolbar configuration.

Customization

To customize the colors and groups displayed, modify the groupedColorButton_colors setting:

config.groupedColorButton_colors =
[
  {
    title: "Brand Colors",
    colors: "A70000,818181,000,BE671A"
  },
  {
    title: "Default Colors",
    colors: CKEDITOR.config.colorButton_colors
  }
];


is this plugin can work on wordpress or only on joomla and drupal ?
richardd's picture
Joined: 24/05/2011
Posts: 31
Re: Grouped Color Button
@FredM: The "requires" directive is the same as the original colorbutton plugin, so I can't see how that would cause a problem. What error message are you getting?
richardd's picture
Joined: 24/05/2011
Posts: 31
Re: Grouped Color Button
@leejacky: I haven't used WordPress, joomla or drupal, but the code is fairly closely based on the original colorbutton plugin, so it should work on any installation.
fredm's picture
Joined: 05/06/2012
Posts: 2
Re: Grouped Color Button
Not any error messages. Simply no grouped colors visible.
richardd's picture
Joined: 24/05/2011
Posts: 31
Re: Grouped Color Button
I've attached a simple stand-alone example for the plugin. You should be able to extract the attached file to a folder and open the "Grouped-Color-Button.html" file in any supported browser to test it.

(You might need to change your browser settings to allow script from local files before the sample will run.)

If you see the editor but you still don't see the grouped colors, can you let me know what browser and OS you're using?

Attachments: 

martin k.'s picture
Joined: 15/06/2012
Posts: 1
Re: Grouped Color Button
It works.

For those who can't get it to work: I think you need to implement Jquery (see the html file in the sample code)