The forum operates in read-only mode. Please head to StackOverflow for support.
CKEDITOR.instances[__INSTANCE_NAME__].updateElement();
CKEDITOR.instances[__INSTANCE_NAME__].getData();
(function() { var a = { modes: { wysiwyg: 1, source: 1 }, exec: function(editor) { //editor.setData('You clicked save'); CKEDITOR.config.AjaxSave_Callback(editor); } }, b = 'AjaxSave'; CKEDITOR.plugins.add(b, { init: function(c) { var d = c.addCommand(b, a); d.modes = { wysiwyg: true }; c.ui.addButton('AjaxSave', { label: c.lang.save, command: b, icon: this.path + 'images/pencil.png' }); } }); })(); CKEDITOR.config.AjaxSave_Callback = null;
function replaceDiv(div) { if (editor) editor.destroy(); editor = CKEDITOR.replace(div); editor.saveCallback = function(instance) { alert(instance.getData()); } }
// Listener... editorInstance.on( 'customSave', function( evt ) { AjaxSave_Callback( evt.data ); } ); // Your command... editorInstance.addCommand( 'customSave', { exec : function( editor ) { editor.fire( 'customSave', editor.getData() ); } //... } );
CKEDITOR.plugins.add('mysave',{ init:function(a){ var cmd = a.addCommand('mysave',{exec:CKsaveAjax}) a.ui.addButton('MySave',{ label:'Save', command:'mysave', icon:this.path+"images/save.png" }) } }) function CKsaveAjax(e){ var theForm = e.element.$.form; if (typeof(theForm.onsubmit) == 'function'){ theForm.onsubmit(); return false; } else{ theForm.submit(); } }
config.extraPlugins = "mysave"
Re: Need custom save event. Plugin documentation?
updateElement()
getData()
Re: Need custom save event. Plugin documentation?
plugin.js
(function() { var a = { modes: { wysiwyg: 1, source: 1 }, exec: function(editor) { //editor.setData('You clicked save'); CKEDITOR.config.AjaxSave_Callback(editor); } }, b = 'AjaxSave'; CKEDITOR.plugins.add(b, { init: function(c) { var d = c.addCommand(b, a); d.modes = { wysiwyg: true }; c.ui.addButton('AjaxSave', { label: c.lang.save, command: b, icon: this.path + 'images/pencil.png' }); } }); })(); CKEDITOR.config.AjaxSave_Callback = null;Re: Need custom save event. Plugin documentation?
function replaceDiv(div) { if (editor) editor.destroy(); editor = CKEDITOR.replace(div); editor.saveCallback = function(instance) { alert(instance.getData()); } }Re: Need custom save event. Plugin documentation?
// Listener... editorInstance.on( 'customSave', function( evt ) { AjaxSave_Callback( evt.data ); } ); // Your command... editorInstance.addCommand( 'customSave', { exec : function( editor ) { editor.fire( 'customSave', editor.getData() ); } //... } );Re: Need custom save event. Plugin documentation?
CKEDITOR.plugins.add('mysave',{ init:function(a){ var cmd = a.addCommand('mysave',{exec:CKsaveAjax}) a.ui.addButton('MySave',{ label:'Save', command:'mysave', icon:this.path+"images/save.png" }) } }) function CKsaveAjax(e){ var theForm = e.element.$.form; if (typeof(theForm.onsubmit) == 'function'){ theForm.onsubmit(); return false; } else{ theForm.submit(); } }>>>this code is actually from the fckeditor "fck_othercommands.js" (commandclasses)