I am in a situation where I do not control the creation of one or many YUI Rich Text Editors; it is done in someone else's library.
For the purposes of this discussion:
- patching code-- monkey or otherwise-- is not an option.
- removing (
editor.destroy()
) the editor that's already there and adding my own is also not an option. The code that creates the editor does Other Things to it and refers to the reference etc-- I need to modify the current editor.
By creation I mean:
var myEditor = new YAHOO.widget.Editor(control, {
// toolbar config would go here if I controled this code
});
myEditor.render();
The problem is that I would like these editors to have a different toolbar configuration to what they have. To be precise, I would like to remove a bunch of buttons (The default is a bit bloated).
I managed to get the editor with the EditorInfo
tool, but I couldn't really do anything with it. There is apparently a variable on the Editor that allows you to get the Toolbar
instance but when I tried it all I got was null
.
So, is there a way to modify a YUI Rich Text Editor after render()
has been called to remove toolbar buttons?