I add a custom button at toolbar,for changed the toolbar;but when I clicked the button,the toolbar is changed,but a js error occured at firebug.
the source code is:
the js error is:
I found the code in source file:"cource/plugins/wysiwygarea/plugin.js" about line 1002, code is:
please help me !!! thanks eveyone!!
the source code is:
<script type="text/javascript">
function rich_text_editor_init_ckeditor(editid, toggleid, style) {
//get editor area
var $edit = $("#" + editid);
//the init function need only run once.
if ($edit.data("initialized") == "true") return;
$edit.data("initialized", "true");
//set a click event to textarea object,for create the ckeditor.
$("#" + editid).click(toggleCKEditor);
}
// create ckeditor
function toggleCKEditor() {
var editid = $(this).attr("id");
if (CKEDITOR.instances[editid] ) {
var editor = CKEDITOR.instances[editid];
if ( !editor )
return;
// Destroy the editor.
editor.destroy();
editor = null;
} else {
var config = {
toolbar:"Base"
on:
{
'pluginsLoaded': function(ev)
{
var thisEditor=ev.editor;
var thisEditorName=ev.editor.name;
thisEditor . addCommand( 'MoreButtonCmd', {
exec : function (e){
var cancelEvent = function(e2){
e2.cancel();
};
CKEDITOR.document.removeListener('selectionChange', cancelEvent);
if ( thisEditor )
thisEditor.destroy();
thisEditor = CKEDITOR.replace(thisEditorName,
{
toolbar :'Full'
});
},
canUndo : false
});
thisEditor.ui.addButton( 'MoreButton', {
label : 'MoreButtonCmd' ,
title : 'MoreButtonCmd',
command : 'MoreButtonCmd'
});
}
}};
var editor = CKEDITOR.replace( editid, config);
}
return false;
}
</script>
the js error is:
B.document is null B.document.$.designMode='off'; ....
I found the code in source file:"cource/plugins/wysiwygarea/plugin.js" about line 1002, code is:
function()
{
editor.document.$.designMode = 'on';
setTimeout( function()
{
editor.document.$.designMode = 'off';
if ( CKEDITOR.currentInstance == editor )
editor.document.getBody().focus();
}, 50 );
}
please help me !!! thanks eveyone!!

Re: An error occur after changed toolbar
How to auto fire the CKeditor's Clicked event?? thanks !