redmine_drafts icon indicating copy to clipboard operation
redmine_drafts copied to clipboard

Redmine CKEditor

Open LuisSerrano opened this issue 10 years ago • 2 comments

With the plugin redmine ckeditor installed, drafts don't work :(

LuisSerrano avatar Mar 05 '14 15:03 LuisSerrano

https://github.com/tarsolya/jquery-ckeditor-observer/blob/master/jquery.ckeditor.observer.js

LuisSerrano avatar Mar 06 '14 07:03 LuisSerrano

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); }); };

LuisSerrano avatar Mar 06 '14 07:03 LuisSerrano