Hi. English is not my primary language, so please be carefull.
I have CKEditor, with toolbar items that i have added. In first time, i was one instance of editor, an i used a custom toolbar. It worked.
But, the DIV when i use editor is very small and i prefer have a big one. So, my idea is to have a small, without toolbar, and a big, with it. The big editor is inserted in a jQuery UI Dialog. It work but i haven't my custom items in big editor.
So, my code :
- In the page, i have a textarea named editor1 (it's original :p)
- i instance an editor with "editeur1 = charger ('editor1',false)"
- "charger" function define for false a empty toolbar, and for true, a custom toolbar. For both, the next lines are :
Like i have found in samples. Next, i create an other editor :
- i clone the editor1's textarea.
- i create an jQuery UI dialog and i append clone of first textarea in.
- i make a charger() for editor2, with true for toolbar full.
Note that the problem is the same if i set the full toolbar for both editors. The editor1 has so a good full toolbar but the editor2 has not.
Note that if i don't start the editor1 (if i commente the function who instance it), editor2 has a good full toolbar.
Note that "pluginsLoaded" event is called only for editor1, but it changes statics property, so, i don't understand why the problem is.
AnyOne has an idea ?
Thanks
I have CKEditor, with toolbar items that i have added. In first time, i was one instance of editor, an i used a custom toolbar. It worked.
But, the DIV when i use editor is very small and i prefer have a big one. So, my idea is to have a small, without toolbar, and a big, with it. The big editor is inserted in a jQuery UI Dialog. It work but i haven't my custom items in big editor.
So, my code :
- In the page, i have a textarea named editor1 (it's original :p)
- i instance an editor with "editeur1 = charger ('editor1',false)"
- "charger" function define for false a empty toolbar, and for true, a custom toolbar. For both, the next lines are :
editor.on( 'pluginsLoaded', function( ev )
{
// If our custom dialog has not been registered, do that now.
if ( !CKEDITOR.dialog.exists( '*****' ) )
{
var href = document.location.href.split( '/' );
href.pop();
href.push( 'api_dialog', '****.js' );
href = href.join( '/' );
CKEDITOR.dialog.add( '*****', href );
}
....
Like i have found in samples. Next, i create an other editor :
- i clone the editor1's textarea.
- i create an jQuery UI dialog and i append clone of first textarea in.
- i make a charger() for editor2, with true for toolbar full.
Note that the problem is the same if i set the full toolbar for both editors. The editor1 has so a good full toolbar but the editor2 has not.
Note that if i don't start the editor1 (if i commente the function who instance it), editor2 has a good full toolbar.
Note that "pluginsLoaded" event is called only for editor1, but it changes statics property, so, i don't understand why the problem is.
AnyOne has an idea ?
Thanks
Re: Two instances of CKEditor but not loading plugins for se
The second time the "pluginsLoaded" event is fired even before your charger() function returns.
This post explains what's going on and the solution: http://alfonsoml.blogspot.com/2009/11/c ... -fast.html
Re: Two instances of CKEditor but not loading plugins for se
function charger (name,toolBarDisplay) {
var editor = CKEDITOR.replace( name, ....); // This is toolbar definition
editor.on( 'pluginsLoaded', function( ev ) { }); // I do the CKEDITOR.dialog.add
editor.on('instanceReady', function (ev) { }); // I do editor.addCommand() and editor.ui.addButton()
Not work
Re: Two instances of CKEditor but not loading plugins for se
I have added alert() for plugin loaded and instance ready : for the second instance, toolbar is already here befor alert() called. So, it's hard ^^
Re: Two instances of CKEditor but not loading plugins for se
Hooooow,
i have instanceCreated Event, and for the second, all the editor is loaded before the alert() is called. So, it's so normal that there is a problem. But i haven't the solution
Re: Two instances of CKEditor but not loading plugins for se
Re: Two instances of CKEditor but not loading plugins for se
Re: Two instances of CKEditor but not loading plugins for se
Thanks