Hi,
I need to override save plugin. I found in this group two ways:
1. (from batman42ca):
This ways works for me.
2. (from Kamiro):
This way doesn't work for me. I put this code in the same place like the first one, in the "instanceReady" event handling. Is this correct place for overriding a plugin?
Which way is preferred? In the new "User Guide", in the "Saving Content" part is written:
"Note, though, that since this is a special use case, some system administrators might reprogram this button to perform another function, like saving the data in the database with Ajax."
but any examples how to do that...
Regards,
Jacek
I need to override save plugin. I found in this group two ways:
1. (from batman42ca):
// create the editor
var ckEditor = CKEDITOR.replace( ...etc )
// wait until the editor has done initializing
ckEditor.on("instanceReady",function() {
// overwrite the default save function
ckEditor.addCommand( "save", {
modes : { wysiwyg:1, source:1 },
exec : function () {
// get the editor content
var theData = ckEditor.getData();
alert("insert your code here");
}
});This ways works for me.
2. (from Kamiro):
CKEDITOR.plugins.registered['save']=
{
init : function( editor )
{
var command = editor.addCommand( 'save',
{
modes : { wysiwyg:1, source:1 },
exec : function( editor ) {
var fo=editor.element.$.form;
editor.updateElement();
rxsubmit(fo);
}
}
);
editor.ui.addButton( 'Save',{label : 'My Save',command : 'save'});
}
}This way doesn't work for me. I put this code in the same place like the first one, in the "instanceReady" event handling. Is this correct place for overriding a plugin?
Which way is preferred? In the new "User Guide", in the "Saving Content" part is written:
"Note, though, that since this is a special use case, some system administrators might reprogram this button to perform another function, like saving the data in the database with Ajax."
but any examples how to do that...
Regards,
Jacek

Re: Overriding save plugin.
Re: Overriding save plugin.
Many thanks,
Jacek