Changeset 24042
- Timestamp:
- 04/22/2013 03:08:51 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin.css
r24039 r24042 3400 3400 margin-left: -225px; 3401 3401 background: #fff; 3402 line-height: 1.5; 3402 3403 z-index: 1000005; 3403 3404 } … … 3426 3427 #notification-dialog .post-locked-avatar { 3427 3428 float: left; 3428 margin-right: 20px; 3429 } 3430 3431 #notification-dialog .currently-editing { 3432 margin-bottom: 20px; 3429 margin: 0 20px 20px 0; 3430 } 3431 3432 #notification-dialog .wp-tab-first { 3433 3433 outline: 0; 3434 3434 } 3435 3435 3436 #notification-dialog .locked-saving img { 3437 float: left; 3438 margin-right: 3px; 3439 } 3440 3441 #notification-dialog-wrap.saving .locked-saving, 3442 #notification-dialog-wrap.saved .locked-saved { 3443 display: inline; 3444 } 3436 3445 3437 3446 /*------------------------------------------------------------------------------ -
trunk/wp-admin/includes/misc.php
r23683 r24042 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 } … … 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 ) -
trunk/wp-admin/includes/post.php
r24021 r24042 1198 1198 return; 1199 1199 1200 if ( $user = wp_check_post_lock( $post->ID ) ) { 1201 $user = get_userdata( $user ); 1200 if ( ( $user_id = wp_check_post_lock( $post->ID ) ) && ( $user = get_userdata( $user_id ) ) ) { 1202 1201 $locked = apply_filters( 'show_post_locked_dialog', true, $post, $user ); 1203 1202 } else { … … 1230 1229 <div class="post-locked-avatar"><?php echo get_avatar( $user->ID, 64 ); ?></div> 1231 1230 <p class="currently-editing wp-tab-first" tabindex="0"><?php esc_html_e( sprintf( __( 'This content is currently locked. If you take over, %s will be blocked from continuing to edit.' ), $user->display_name ) ); ?></p> 1231 <?php do_action( 'post_lock_text', $post ); ?> 1232 1232 <p> 1233 1233 <a class="button" href="<?php echo esc_url( wp_get_referer() ); ?>"><?php _e('Go back'); ?></a> … … 1250 1250 <div class="post-taken-over"> 1251 1251 <div class="post-locked-avatar"></div> 1252 <p class="currently-editing wp-tab-first" tabindex="0"></p> 1252 <p class="wp-tab-first" tabindex="0"> 1253 <span class="currently-editing"></span><br> 1254 <span class="locked-saving hidden"><img src="images/wpspin_light-2x.gif" width="16" height="16" /> <?php _e('Saving revision...'); ?></span> 1255 <span class="locked-saved hidden"><?php _e('Your latest changes were saved as a revision.'); ?></span> 1256 </p> 1257 <?php do_action( 'post_lock_text', $post ); ?> 1253 1258 <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> 1254 1259 </div> -
trunk/wp-admin/js/post.js
r23981 r24042 278 278 279 279 if ( wrap.length && ! wrap.is(':visible') ) { 280 if ( typeof autosave == 'function' ) 280 if ( typeof autosave == 'function' ) { 281 $(document).on('autosave-disable-buttons.post-lock', function() { 282 wrap.addClass('saving'); 283 }).on('autosave-enable-buttons.post-lock', function() { 284 wrap.removeClass('saving').addClass('saved'); 285 window.onbeforeunload = null; 286 }); 287 288 // Save the latest changes and disable 281 289 autosave(); 290 autosave = function(){}; 291 } 282 292 283 293 if ( received.lock_error.avatar_src ) { … … 286 296 } 287 297 288 wrap.show().find('p.currently-editing').text( received.lock_error.text ).focus(); 298 wrap.show().find('.currently-editing').text( received.lock_error.text ); 299 wrap.find('.wp-tab-first').focus(); 289 300 } 290 301 } else if ( received.new_lock ) { -
trunk/wp-includes/js/autosave.js
r24021 r24042 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. … … 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.
Note: See TracChangeset
for help on using the changeset viewer.