Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redmine CKEditor #24

Open
LuisSerrano opened this issue Mar 5, 2014 · 2 comments
Open

Redmine CKEditor #24

LuisSerrano opened this issue Mar 5, 2014 · 2 comments

Comments

@LuisSerrano
Copy link

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

@LuisSerrano
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant