Ticket #23312: 23312-3.patch
File 23312-3.patch, 4.0 KB (added by , 12 years ago) |
---|
-
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'); 148 149 149 150 $title = $post_type_object->labels->name; 150 151 -
wp-admin/includes/class-wp-posts-list-table.php
555 555 556 556 if ( $lock_holder && $can_edit_post && $post->post_status != 'trash' ) { 557 557 printf( '<span class="lock-holder">%s</span>', 558 esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) 558 esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) ) ); 559 559 } 560 560 561 561 if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) -
wp-admin/includes/misc.php
561 561 } 562 562 } 563 563 add_action('admin_head', '_ipad_meta'); 564 565 function wp_check_locked_posts( $response, $data ) { 566 $checked = array(); 567 568 if ( array_key_exists('wp-check-locked', $data) ) { 569 foreach ( $data['wp-check-locked'] as $key ) { 570 if ( $user_id = wp_check_post_lock( substr($key, 5) ) ) { 571 if ( $user = get_userdata($user_id) ) 572 $checked[$key] = sprintf( __( '%s is currently editing' ), $user->display_name ); 573 } 574 } 575 } 576 577 if ( !empty($checked) ) 578 $response['wp-check-locked'] = $checked; 579 580 return $response; 581 } 582 add_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 2 ); -
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 ) && ! row.hasClass('wp-locked') ) { 9 row.addClass('wp-locked').find('.column-title strong').after('<span class="lock-holder">'+ locked[key] +'</span>'); 10 } else if ( row.hasClass('wp-locked') ) { 11 row.removeClass('wp-locked').find('.column-title span.lock-holder').remove(); 12 } 13 }); 14 }).on( 'heartbeat-send.wp-check-locked', function( e, data ) { 15 var check = []; 16 17 $('#the-list tr').each( function(i, el) { 18 check.push( el.id ); 19 }); 20 data['wp-check-locked'] = check; 21 }); 22 }(jQuery)); -
wp-admin/js/edit-post.js
-
wp-includes/script-loader.php
Property changes on: wp-admin/js/edit-post.js ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
416 416 // @todo: Core no longer uses theme-preview.js. Remove? 417 417 $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), false, 1 ); 418 418 419 $scripts->add( 'edit-post', "/wp-admin/js/edit-post$suffix.js", array( 'heartbeat' ), false, 1 ); 420 419 421 $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), false, 1 ); 420 422 did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( 421 423 'error' => __('Error while saving the changes.'),