Ok, so I stumbled across this today: I'm trying to replicate the DIVReplace sample and it looks like that after you call the editor.destroy() the code doesn't load back up any post editor.replace settings.
So, for example, I changed the config.js to create a new toolbar called TEST:
then, in Divreplace.html, I changed the replaceDiv function to read like this:
When you load the page, the first time you click a div the editor comes up properly, and loads the correct toolbar. But when you click another DIV you get the Full toolbar instead. Its as if after the editor.destroy() it isn't loading or applying config again? Not sure.
The toolbar isn't the main issue for me, because I could just do that in the config, but I am trying to add a command and a new button to the editor after I call the replace. If there is some way to do this in the config, please let me know and I'll just move the code there. But, since it might be a bug - or unexpected behavior - I figured I'd report it.
Thanks
So, for example, I changed the config.js to create a new toolbar called TEST:
config.toolbar_TEST = [['Undo']];
then, in Divreplace.html, I changed the replaceDiv function to read like this:
function replaceDiv( div ) { if ( editor ) editor.destroy(); editor = CKEDITOR.replace( div ); editor.config.toolbar = 'TEST'; }
When you load the page, the first time you click a div the editor comes up properly, and loads the correct toolbar. But when you click another DIV you get the Full toolbar instead. Its as if after the editor.destroy() it isn't loading or applying config again? Not sure.
The toolbar isn't the main issue for me, because I could just do that in the config, but I am trying to add a command and a new button to the editor after I call the replace. If there is some way to do this in the config, please let me know and I'll just move the code there. But, since it might be a bug - or unexpected behavior - I figured I'd report it.
Thanks
Re: CKEditor - DivReplace and configs, possible bug
I created this plugin and config:
Basically, I want a toolbar button that calls destroy on the box. Again, this is with the Div replace method from the sample.
The issue now is that this works, but causes an error in firebug and I'm not sure why. Here's the trace:
Re: CKEditor - DivReplace and configs, possible bug
Thank you for your idea!!!
I can solve it by adding the plugin!
You can't register the plugin more than once, that's why you got the error from the firebug.
Now you know how to do it!:p
Thanks again man!