Ticket #23697: 23697-4.patch
File 23697-4.patch, 4.8 KB (added by , 11 years ago) |
---|
-
wp-admin/css/wp-admin.css
3424 3424 3425 3425 #notification-dialog .post-locked-avatar { 3426 3426 float: left; 3427 margin -right: 20px;3427 margin: 0 20px 20px 0; 3428 3428 } 3429 3429 3430 3430 #notification-dialog .currently-editing { 3431 margin-bottom: 20px;3432 3431 outline: 0; 3433 3432 } 3434 3433 3434 #notification-dialog .locked-saving img { 3435 float: left; 3436 margin-right: 3px; 3437 } 3435 3438 3439 #notification-dialog-wrap.saving .locked-saving, 3440 #notification-dialog-wrap.saved .locked-saved { 3441 display: block; 3442 } 3443 3436 3444 /*------------------------------------------------------------------------------ 3437 3445 11.1 - Custom Fields 3438 3446 ------------------------------------------------------------------------------*/ -
wp-admin/includes/misc.php
574 574 $post_id = (int) substr( $key, 5 ); 575 575 576 576 if ( current_user_can( 'edit_post', $post_id ) && ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) { 577 $send = array( );577 $send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) ); 578 578 579 579 if ( ( $avatar = get_avatar( $user->ID, 18 ) ) && preg_match( "|src='([^']+)'|", $avatar, $matches ) ) 580 580 $send['avatar_src'] = $matches[1]; 581 581 582 $send['text'] = sprintf( __( '%s is currently editing' ), $user->display_name );583 582 $checked[$key] = $send; 584 583 } 585 584 } … … 608 607 if ( !current_user_can('edit_post', $post_id) ) 609 608 return $response; 610 609 611 if ( $user_id = wp_check_post_lock( $post_id ) ) { 612 $user = get_userdata( $user_id ); 613 610 if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) { 614 611 $error = array( 615 612 'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ) 616 613 ); -
wp-admin/includes/post.php
1194 1194 if ( ! $post = get_post() ) 1195 1195 return; 1196 1196 1197 if ( $user = wp_check_post_lock( $post->ID ) ) { 1198 $user = get_userdata( $user ); 1197 if ( ( $user_id = wp_check_post_lock( $post->ID ) ) && ( $user = get_userdata( $user_id ) ) ) { 1199 1198 $locked = apply_filters( 'show_post_locked_dialog', true, $post, $user ); 1200 1199 } else { 1201 1200 $locked = false; … … 1247 1246 <div class="post-taken-over"> 1248 1247 <div class="post-locked-avatar"></div> 1249 1248 <p class="currently-editing wp-tab-first" tabindex="0"></p> 1249 <p class="locked-saving hidden"><img src="images/wpspin_light-2x.gif" width="16" height="16" /> <?php _e('Saving revision...'); ?></p> 1250 <p class="locked-saved hidden"><?php _e('Revision saved.'); ?></p> 1250 1251 <p><a class="button button-primary wp-tab-last" href="<?php echo esc_url( admin_url('edit.php') ); ?>"><?php _e('Go to All Posts'); ?></a></p> 1251 1252 </div> 1252 1253 <?php -
wp-admin/js/post.js
277 277 wrap = $('#notification-dialog-wrap'); 278 278 279 279 if ( wrap.length && ! wrap.is(':visible') ) { 280 if ( typeof autosave == 'function' ) 280 $(document).on('autosave-disable-buttons.post-lock', function() { 281 wrap.addClass('saving'); 282 }).on('autosave-enable-buttons.post-lock', function() { 283 wrap.removeClass('saving').addClass('saved'); 284 window.onbeforeunload = null; 285 }); 286 287 if ( typeof autosave == 'function' ) { 288 // Save the latest changes and disable 281 289 autosave(); 290 autosave = function(){}; 291 } 282 292 283 293 if ( received.lock_error.avatar_src ) { 284 294 avatar = $('<img class="avatar avatar-64 photo" width="64" height="64" />').attr( 'src', received.lock_error.avatar_src.replace(/&/g, '&') ); -
wp-includes/js/autosave.js
227 227 } 228 228 229 229 function autosave_enable_buttons() { 230 jQuery(document).trigger('autosave-enable-buttons'); 230 231 if ( ! wp.heartbeat.connectionLost ) { 231 232 // delay that a bit to avoid some rare collisions while the DOM is being updated. 232 233 setTimeout(function(){ … … 238 239 } 239 240 240 241 function autosave_disable_buttons() { 242 jQuery(document).trigger('autosave-disable-buttons'); 241 243 jQuery('#submitpost').find(':button, :submit').prop('disabled', true); 242 244 // Re-enable 5 sec later. Just gives autosave a head start to avoid collisions. 243 245 setTimeout( autosave_enable_buttons, 5000 );