Adding a palette
simeon.mattes - June 18, 2009 - 07:09
| Project: | BUEditor |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi there,
I have used bueditor for quite long with a great success. Though I have a problem every time I have to use more advanced buttons, e.g. color palette. For this example I had to create my own palette which I don't think is so great but for basic colors, it works. I attach the code, which though needs improvement. The only thing that somebody has to do is to replace the old bueditor>library>default_buttons_functions.js with the attached one, and call the "create_palette()" function.
I know that I must not change the modules, but I don't have a so advanced level in drupal. I would be obliged for any suggestions.
| Attachment | Size |
|---|---|
| default_buttons_functions.js.txt | 20.65 KB |

#1
function set_color(id)
{
var sel = BUE.active.getSelection();
BUE.dialog.close();
BUE.active.replaceSelection('<span style="color:#'+id+'>'+sel+</span>');
}
BUE.active.replaceSelection('<span style="color:#'+id+' " >'+sel+</span>');
#2
Why have you done this?