diff --git wp-admin/edit-form-advanced.php wp-admin/edit-form-advanced.php
index c7e8dc6..8af539c 100644
|
|
|
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); |
| 336 | 336 | wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); |
| 337 | 337 | ?> |
| 338 | 338 | |
| | 339 | <div id="lost-connection-notice" class="error hidden"> |
| | 340 | <p id="lost-connection-message"> |
| | 341 | <?php _e("You have lost your connection with the server, and saving has been disabled. This message will vanish once you've reconnected."); ?> |
| | 342 | </p> |
| | 343 | </div> |
| | 344 | |
| 339 | 345 | <div id="poststuff"> |
| 340 | 346 | |
| 341 | 347 | <?php |
diff --git wp-includes/js/autosave.js wp-includes/js/autosave.js
index 43b2b4e..8658f23 100644
|
|
|
function autosave_loading() { |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | function autosave_enable_buttons() { |
| 215 | | // delay that a bit to avoid some rare collisions while the DOM is being updated. |
| 216 | | setTimeout(function(){ |
| 217 | | jQuery(':button, :submit', '#submitpost').removeAttr('disabled'); |
| 218 | | jQuery('.spinner', '#submitpost').hide(); |
| 219 | | }, 500); |
| | 215 | if ( ! wp.heartbeat.connectionLost ) { |
| | 216 | // delay that a bit to avoid some rare collisions while the DOM is being updated. |
| | 217 | setTimeout(function(){ |
| | 218 | jQuery(':button, :submit', '#submitpost').removeAttr('disabled'); |
| | 219 | jQuery('.spinner', '#submitpost').hide(); |
| | 220 | }, 500); |
| | 221 | } |
| 220 | 222 | } |
| 221 | 223 | |
| 222 | 224 | function autosave_disable_buttons() { |
| … |
… |
autosave = function() { |
| 239 | 241 | var rich = (typeof tinymce != "undefined") && tinymce.activeEditor && !tinymce.activeEditor.isHidden(), |
| 240 | 242 | post_data, doAutoSave, ed, origStatus, successCallback; |
| 241 | 243 | |
| | 244 | // Disable buttons until we know the save completed. |
| 242 | 245 | autosave_disable_buttons(); |
| 243 | 246 | |
| 244 | 247 | post_data = wp.autosave.getPostData(); |
| … |
… |
wp.autosave.local = { |
| 664 | 667 | wp.autosave.local.init(); |
| 665 | 668 | |
| 666 | 669 | }(jQuery)); |
| | 670 | |
| | 671 | |
| | 672 | // When connection is lost, keep user from submitting changes. |
| | 673 | jQuery(document).on('heartbeat-connection-lost', function() { |
| | 674 | autosave_disable_buttons(); |
| | 675 | jQuery('#lost-connection-notice').show(); |
| | 676 | }); |
| | 677 | |
| | 678 | // When connection returns, make work all the things. |
| | 679 | jQuery(document).on('heartbeat-connection-restored', function() { |
| | 680 | autosave_enable_buttons(); |
| | 681 | jQuery('#lost-connection-notice').hide(); |
| | 682 | }); |
diff --git wp-includes/js/heartbeat.js wp-includes/js/heartbeat.js
index a382599..1060786 100644
|
|
|
window.wp = window.wp || {}; |
| 28 | 28 | |
| 29 | 29 | this.url = typeof ajaxurl != 'undefined' ? ajaxurl : 'wp-admin/admin-ajax.php'; |
| 30 | 30 | this.autostart = true; |
| | 31 | this.connectionLost = false; |
| 31 | 32 | |
| 32 | 33 | if ( typeof( window.heartbeatSettings != 'undefined' ) ) { |
| 33 | 34 | settings = $.extend( {}, window.heartbeatSettings ); |
| … |
… |
window.wp = window.wp || {}; |
| 171 | 172 | |
| 172 | 173 | // temp debug |
| 173 | 174 | if ( self.debug ) |
| 174 | | console.log('### blurred(), slow down...') |
| | 175 | console.log('### blurred(), slow down...'); |
| 175 | 176 | } |
| 176 | 177 | |
| 177 | 178 | function focused() { |
| … |
… |
window.wp = window.wp || {}; |
| 192 | 193 | |
| 193 | 194 | // temp debug |
| 194 | 195 | if ( self.debug ) |
| 195 | | console.log('### focused(), speed up... ') |
| | 196 | console.log('### focused(), speed up... '); |
| 196 | 197 | } |
| 197 | 198 | |
| 198 | 199 | function setFrameEvents() { |