Ticket #23312: 23312-7.patch
File 23312-7.patch, 10.0 KB (added by , 12 years ago) |
---|
-
wp-admin/css/wp-admin.css
2425 2425 2426 2426 .fixed .column-date, 2427 2427 .fixed .column-parent, 2428 .fixed .column-links { 2428 .fixed .column-links, 2429 .fixed .column-author, 2430 .fixed .column-format { 2429 2431 width: 10%; 2430 2432 } 2431 2433 2432 2434 .fixed .column-response, 2433 .fixed .column-author,2434 2435 .fixed .column-categories, 2435 2436 .fixed .column-tags, 2436 2437 .fixed .column-rel, … … 2529 2530 } 2530 2531 2531 2532 tr.wp-locked .locked-indicator { 2532 background: url('../images/lock 16.png') no-repeat;2533 margin: -2px 0 0 8px;2533 background: url('../images/lock.png') no-repeat; 2534 margin: -2px 0 0 6px; 2534 2535 height: 16px; 2535 2536 width: 16px; 2536 2537 } … … 2538 2539 tr.wp-locked .check-column label, 2539 2540 tr.wp-locked .check-column input[type="checkbox"], 2540 2541 tr.wp-locked .row-actions .inline, 2541 tr.wp-locked .row-actions .trash, 2542 .lock-holder { 2542 tr.wp-locked .row-actions .trash { 2543 2543 display: none; 2544 2544 } 2545 2545 2546 tr.wp-locked .lock-holder { 2547 display: inline; 2546 tr.wp-locked .lock-holder-avatar { 2547 float: left; 2548 margin: 2px 6px 0 0; 2548 2549 } 2549 2550 2550 2551 .fixed .column-comments .sorting-indicator { … … 9034 9035 background-size: 18px 100px; 9035 9036 } 9036 9037 9038 tr.wp-locked .locked-indicator { 9039 background-image: url('../images/lock-2x.png'); 9040 background-size: 16px 16px; 9041 } 9042 9037 9043 th .comment-grey-bubble { 9038 9044 background-image: url('../images/comment-grey-bubble-2x.png'); 9039 9045 background-size: 12px 12px; -
wp-admin/edit.php
145 145 $wp_list_table->prepare_items(); 146 146 147 147 wp_enqueue_script('inline-edit-post'); 148 wp_enqueue_script('edit-post');149 148 150 149 $title = $post_type_object->labels->name; 151 150 -
wp-admin/images/lock-2x.png
Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
-
wp-admin/images/lock.png
Property changes on: wp-admin/images/lock-2x.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
-
wp-admin/includes/class-wp-posts-list-table.php
Property changes on: wp-admin/images/lock.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
540 540 } 541 541 542 542 $pad = str_repeat( '— ', $level ); 543 echo "<td $attributes><strong>"; 543 echo "<td $attributes>"; 544 545 if ( $lock_holder && $can_edit_post && $post->post_status != 'trash' ) { 546 $locked_avatar = get_avatar( $lock_holder->ID, 32 ); 547 $locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) ); 548 } else { 549 $locked_avatar = $locked_text = ''; 550 } 551 552 echo '<span class="lock-holder-avatar">' . $locked_avatar . '</span> <strong>'; 553 544 554 if ( $can_edit_post && $post->post_status != 'trash' ) { 545 555 echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . $pad . $title . '</a>'; 546 556 } else { … … 551 561 if ( isset( $parent_name ) ) 552 562 echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ); 553 563 554 echo "</strong>\n";564 echo '</strong> <span class="lock-holder">' . $locked_text . '</span>'; 555 565 556 if ( $lock_holder && $can_edit_post && $post->post_status != 'trash' ) {557 printf( '<span class="lock-holder">%s</span>',558 esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) ) );559 }560 561 566 if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) 562 567 the_excerpt(); 563 568 -
wp-admin/includes/misc.php
566 566 * 567 567 * @since 3.6 568 568 */ 569 function wp_check_locked_posts( $response, $data ) {569 function wp_check_locked_posts( $response, $data, $screen_id ) { 570 570 $checked = array(); 571 571 572 if ( array_key_exists( 'wp-check-locked', $data ) && is_array( $data['wp-check-locked'] ) ) {572 if ( 'edit-post' == $screen_id && array_key_exists( 'wp-check-locked', $data ) && is_array( $data['wp-check-locked'] ) ) { 573 573 foreach ( $data['wp-check-locked'] as $key ) { 574 574 $post_id = (int) substr( $key, 5 ); 575 575 576 if ( current_user_can( 'edit_post', $post_id ) && ( $user_id = wp_check_post_lock( $post_id ) ) ) { 577 if ( $user = get_userdata( $user_id ) ) 578 $checked[$key] = sprintf( __( '%s is currently editing' ), $user->display_name ); 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(); 578 579 if ( ( $avatar = get_avatar( $user->ID, 32 ) ) && preg_match( "|src='([^']+)'|", $avatar, $matches ) ) 580 $send['avatar_src'] = $matches[1]; 581 582 $send['text'] = sprintf( __( '%s is currently editing' ), $user->display_name ); 583 $checked[$key] = $send; 579 584 } 580 585 } 581 586 } … … 585 590 586 591 return $response; 587 592 } 588 add_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 2);593 add_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 3 ); 589 594 590 595 /** 591 596 * Check lock status on the New/Edit Post screen and refresh the lock -
wp-admin/js/edit-post.js
1 (function($){2 $( document ).on( 'heartbeat-tick.wp-check-locked', function( e, data ) {3 var locked = data['wp-check-locked'] || {};4 5 $('#the-list tr').each( function(i, el) {6 var key = el.id, row = $(el);7 8 if ( locked.hasOwnProperty( key ) ) {9 if ( ! row.hasClass('wp-locked') )10 row.addClass('wp-locked').find('.column-title strong').after( $('<span class="lock-holder" />').text(locked[key]) );11 row.find('.check-column checkbox').prop('checked', false);12 } else if ( row.hasClass('wp-locked') ) {13 row.removeClass('wp-locked').find('.column-title span.lock-holder').remove();14 }15 });16 }).on( 'heartbeat-send.wp-check-locked', function( e, data ) {17 var check = [];18 19 $('#the-list tr').each( function(i, el) {20 check.push( el.id );21 });22 23 data['wp-check-locked'] = check;24 });25 }(jQuery)); -
wp-admin/js/inline-edit-post.js
290 290 } 291 291 }; 292 292 293 $(document).ready(function(){inlineEditPost.init();}); 294 })(jQuery); 293 $( document ).ready( function(){ inlineEditPost.init(); } ); 294 295 // Show/hide locks on posts 296 $( document ).on( 'heartbeat-tick.wp-check-locked', function( e, data ) { 297 var locked = data['wp-check-locked'] || {}; 298 299 $('#the-list tr').each( function(i, el) { 300 var key = el.id, row = $(el), lock_data, avatar; 301 302 if ( locked.hasOwnProperty( key ) ) { 303 if ( ! row.hasClass('wp-locked') ) { 304 lock_data = locked[key]; 305 row.addClass('wp-locked').find('.column-title .lock-holder').text( lock_data.text ); 306 row.find('.check-column checkbox').prop('checked', false); 307 308 if ( lock_data.avatar_src && /^https?:\/\/[a-z0-9]+?\.gravatar\.com\/avatar/.test( lock_data.avatar_src ) ) { 309 avatar = $('<img class="avatar avatar-32 photo" width="32" height="32" />').attr( 'src', lock_data.avatar_src.replace(/&/g, '&') ); 310 row.find('.column-title .lock-holder-avatar').empty().append( avatar ); 311 } 312 } 313 } else if ( row.hasClass('wp-locked') ) { 314 row.removeClass('wp-locked').find('.column-title .lock-holder').empty(); 315 row.find('.column-title .lock-holder-avatar').empty(); 316 } 317 }); 318 }).on( 'heartbeat-send.wp-check-locked', function( e, data ) { 319 var check = []; 320 321 $('#the-list tr').each( function(i, el) { 322 check.push( el.id ); 323 }); 324 325 data['wp-check-locked'] = check; 326 }); 327 328 }(jQuery)); -
wp-includes/script-loader.php
419 419 // @todo: Core no longer uses theme-preview.js. Remove? 420 420 $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), false, 1 ); 421 421 422 $scripts->add( 'edit-post', "/wp-admin/js/edit-post$suffix.js", array( 'heartbeat' ), false, 1 ); 423 424 $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), false, 1 ); 422 $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest', 'heartbeat' ), false, 1 ); 425 423 did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( 426 424 'error' => __('Error while saving the changes.'), 427 425 'ntdeltitle' => __('Remove From Bulk Edit'),