Ticket #6682: 6682.patch
| File 6682.patch, 2.3 KB (added by , 18 years ago) |
|---|
-
wp-includes/js/autosave.js
1 1 var autosaveLast = ''; 2 2 var autosavePeriodical; 3 3 var autosaveOldMessage = ''; 4 var autosaveDelayURL = null; 5 var previewwin; 4 6 5 7 jQuery(function($) { 6 8 autosaveLast = $('#post #title').val()+$('#post #content').val(); … … 8 10 9 11 //Disable autosave after the form has been submitted 10 12 $("#post").submit(function() { $.cancel(autosavePeriodical); }); 13 14 // Autosave when the preview button is clicked. 15 $('#previewview a').click(function(e) { 16 autosave(); 17 autosaveDelayURL = this.href; 18 previewwin = window.open('','_blank'); 19 20 e.preventDefault(); 21 return false; 22 }); 11 23 }); 12 24 13 25 function autosave_parse_response(response) { … … 96 108 getpermalinknonce: jQuery('#getpermalinknonce').val() 97 109 }, function(permalink) { 98 110 jQuery('#previewview').html('<a target="_blank" href="'+permalink+'" tabindex="4">'+previewText+'</a>'); 111 112 // Autosave when the preview button is clicked. 113 jQuery('#previewview a').click(function(e) { 114 autosave(); 115 autosaveDelayURL = this.href; 116 previewwin = window.open('','_blank'); 117 118 e.preventDefault(); 119 return false; 120 }); 99 121 }); 100 122 } 101 123 } … … 125 147 126 148 function autosave_enable_buttons() { 127 149 jQuery("#submitpost :button:disabled, #submitpost :submit:disabled").attr('disabled', ''); 150 if ( autosaveDelayURL ) { 151 previewwin.location = autosaveDelayURL; 152 autosaveDelayURL = null; 153 } 128 154 } 129 155 130 156 function autosave_disable_buttons() { -
wp-includes/script-loader.php
46 46 'broken' => __('An unidentified error has occurred.') 47 47 ) ); 48 48 49 $scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080 508' );49 $scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080622' ); 50 50 51 51 $scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080411' ); 52 52 $scripts->localize( 'wp-lists', 'wpListL10n', array(