Ticket #6707: 6707.b.diff
| File 6707.b.diff, 1.5 kB (added by mdawaffe, 7 months ago) |
|---|
-
wp-includes/js/autosave.js
old new 10 10 $("#post").submit(function() { $.cancel(autosavePeriodical); }); 11 11 }); 12 12 13 // called when autosaving pre-existing post 14 function autosave_saved(response, keepDisabled) { 13 function autosave_parse_response(response) { 15 14 var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response 16 15 var message = ''; 17 16 … … 41 40 } 42 41 if ( message ) { jQuery('#autosave').html(message); } // update autosave message 43 42 else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); } 44 if ( !keepDisabled ) {45 autosave_enable_buttons(); // re-enable disabled form buttons46 }47 43 return res; 48 44 } 49 45 46 // called when autosaving pre-existing post 47 function autosave_saved(response) { 48 autosave_parse_response(response); // parse the ajax response 49 autosave_enable_buttons(); // re-enable disabled form buttons 50 } 51 50 52 // called when autosaving new post 51 53 function autosave_saved_new(response) { 52 var res = autosave_ saved(response, true); // parse the ajax response do the above54 var res = autosave_parse_response(response); // parse the ajax response 53 55 // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID 54 56 if ( res && res.responses.length && !res.errors ) { 55 57 var tempID = jQuery('#post_ID').val();
