diff options
Diffstat (limited to 'wp-includes/js/autosave.js')
-rw-r--r-- | wp-includes/js/autosave.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index 8ee0c08..c9e5fb1 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -10,8 +10,7 @@ jQuery(function($) { $("#post").submit(function() { $.cancel(autosavePeriodical); }); }); -// called when autosaving pre-existing post -function autosave_saved(response) { +function autosave_parse_response(response) { var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response var message = ''; @@ -41,13 +40,18 @@ function autosave_saved(response) { } if ( message ) { jQuery('#autosave').html(message); } // update autosave message else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); } - autosave_enable_buttons(); // re-enable disabled form buttons return res; } +// called when autosaving pre-existing post +function autosave_saved(response) { + autosave_parse_response(response); // parse the ajax response + autosave_enable_buttons(); // re-enable disabled form buttons +} + // called when autosaving new post function autosave_saved_new(response) { - var res = autosave_saved(response); // parse the ajax response do the above + var res = autosave_parse_response(response); // parse the ajax response // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID if ( res && res.responses.length && !res.errors ) { var tempID = jQuery('#post_ID').val(); @@ -58,6 +62,7 @@ function autosave_saved_new(response) { this.href = this.href.replace(tempID, postID); }); } + autosave_enable_buttons(); // re-enable disabled form buttons } function autosave_update_post_ID( postID ) { @@ -175,8 +180,10 @@ var autosave = function() { post_data["comment_status"] = 'open'; if ( jQuery("#ping_status").attr("checked") ) post_data["ping_status"] = 'open'; - if( jQuery("#excerpt")) + if ( jQuery("#excerpt") ) post_data["excerpt"] = jQuery("#excerpt").val(); + if ( jQuery("#post_author") ) + post_data["post_author"] = jQuery("#post_author").val(); // Don't run while the TinyMCE spellcheck is on. Why? Who knows. if ( rich && tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) { |