redmine_drafts
redmine_drafts copied to clipboard
Redmine CKEditor
With the plugin redmine ckeditor installed, drafts don't work :(
https://github.com/tarsolya/jquery-ckeditor-observer/blob/master/jquery.ckeditor.observer.js
I think this is the solution: Change the javascript function jquery.observe-form.js
/*
- Add a jQuery method to observe a whole form each N seconds
- adapted from: http://blessednotes.wordpress.com/2009/07/28/jquery-form-changes-observer/ / $.fn.observe = function( time, callback ){ return this.each(function(){ var form = this, changed = false; / observe for changes / $(form.elements).change(function(){ changed = true; }); $(form).find('input,textarea').keyup(function(){ changed = true; }); / call callback if needed */ setInterval(function(){ if( typeof(CKEDITOR) !== "undefined" ) { for(var instanceName in CKEDITOR.instances) { if(CKEDITOR.instances[instanceName].checkDirty()) { $('textarea#' + instanceName).val(CKEDITOR.instances[instanceName].getData()); changed = true; CKEDITOR.instances[instanceName].resetDirty(); }; } } if (changed) callback.call(form); changed = false; }, time * 1000); }); };