Ticket #6707: 6707.diff

File 6707.diff, 2.1 kB (added by mdawaffe, 7 months ago)
  • wp-includes/js/autosave.js

    old new  
    1111}); 
    1212 
    1313// called when autosaving pre-existing post 
    14 function autosave_saved(response) { 
     14function autosave_saved(response, keepDisabled) { 
    1515        var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response 
    1616        var message = ''; 
    1717 
     
    4141        } 
    4242        if ( message ) { jQuery('#autosave').html(message); } // update autosave message 
    4343        else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); } 
    44         autosave_enable_buttons(); // re-enable disabled form buttons 
     44        if ( !keepDisabled ) { 
     45                autosave_enable_buttons(); // re-enable disabled form buttons 
     46        } 
    4547        return res; 
    4648} 
    4749 
    4850// called when autosaving new post 
    4951function autosave_saved_new(response) { 
    50         var res = autosave_saved(response); // parse the ajax response do the above 
     52        var res = autosave_saved(response, true); // parse the ajax response do the above 
    5153        // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID 
    5254        if ( res && res.responses.length && !res.errors ) { 
    5355                var tempID = jQuery('#post_ID').val(); 
     
    5860                                this.href = this.href.replace(tempID, postID); 
    5961                        }); 
    6062        } 
     63        autosave_enable_buttons(); // re-enable disabled form buttons 
    6164} 
    6265 
    6366function autosave_update_post_ID( postID ) { 
  • wp-includes/script-loader.php

    old new  
    4747                        'broken' => __('An unidentified error has occurred.') 
    4848                ) ); 
    4949 
    50                 $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080416' ); 
     50                $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080422' ); 
    5151 
    5252                $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306'); 
    5353                $this->localize( 'wp-ajax', 'WPAjaxL10n', array(