Because CKEditor did not yet have a "change" event built in, we had to fake that on a best-effort basis:
onChange: function (element, callback) {
var editor = CKEDITOR.dom.element.get(element).getEditor();
if (editor) {
var changed = function () {
window.setTimeout(function () {
callback(editor.getData());
}, 0);
};
// @todo Make this more elegant once http://dev.ckeditor.com/ticket/9794
// is fixed.
editor.on('key', changed);
editor.on('paste', changed);
editor.on('afterCommandExec', changed);
}
return !!editor;
},
It was blocked on http://dev.ckeditor.com/ticket/9794. But, earlier today the solution for this was merged with CKEditor's dev branch, and consequently it will be available in CKEditor 4.2.
Hence the above code will need to be changed to:
onChange: function (element, callback) {
var editor = CKEDITOR.dom.element.get(element).getEditor();
if (editor) {
editor.on('change', function () {
callback(editor.getData());
});
}
return !!editor;
},