diff --git a/wp-admin/css/list-tables.css b/wp-admin/css/list-tables.css
index 67ef22e..b4139e8 100644
a
|
b
|
th.asc a:focus span.sorting-indicator:before { |
549 | 549 | content: "\f142"; |
550 | 550 | } |
551 | 551 | |
| 552 | tr .locked-indicator { |
| 553 | display: none; |
| 554 | } |
| 555 | |
552 | 556 | tr.wp-locked .locked-indicator { |
553 | 557 | margin-left: 6px; |
554 | 558 | height: 20px; |
555 | 559 | width: 16px; |
| 560 | display: block; |
556 | 561 | } |
557 | 562 | |
558 | 563 | tr.wp-locked .locked-indicator:before { |
diff --git a/wp-admin/edit.php b/wp-admin/edit.php
index 120140a..28ed53e 100644
a
|
b
|
if ( $doaction ) { |
190 | 190 | |
191 | 191 | $wp_list_table->prepare_items(); |
192 | 192 | |
| 193 | |
193 | 194 | wp_enqueue_script('inline-edit-post'); |
194 | 195 | wp_enqueue_script('heartbeat'); |
| 196 | wp_localize_script( 'inline-edit-post', '_wpInlineEditPostStrings', array( |
| 197 | 'last_separator' => __( 'and' ), |
| 198 | 'was_unlocked' => __( 'is not being edited anymore' ), |
| 199 | 'were_unlocked' => __( 'are not being edited anymore' ), |
| 200 | 'was_locked' => __( 'is being edited' ), |
| 201 | 'were_locked' => __( 'are being edited' ), |
| 202 | ) ); |
195 | 203 | |
196 | 204 | $title = $post_type_object->labels->name; |
197 | 205 | |
diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php
index 506dded..cd62ef8 100644
a
|
b
|
class WP_Posts_List_Table extends WP_List_Table { |
829 | 829 | printf( __( 'Select %s' ), _draft_or_post_title() ); |
830 | 830 | ?></label> |
831 | 831 | <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" /> |
832 | | <div class="locked-indicator"></div> |
| 832 | <div class="locked-indicator"> |
| 833 | <span class="screen-reader-text"><?php |
| 834 | printf( __( '%s is currently being edited' ), _draft_or_post_title() ); |
| 835 | ?></span> |
| 836 | </div> |
833 | 837 | <?php endif; |
834 | 838 | } |
835 | 839 | |
diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js
index 3a65805..47628f7 100644
a
|
b
|
$( document ).ready( function(){ inlineEditPost.init(); } ); |
330 | 330 | |
331 | 331 | // Show/hide locks on posts |
332 | 332 | $( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) { |
333 | | var locked = data['wp-check-locked-posts'] || {}; |
| 333 | var locked = data['wp-check-locked-posts'] || {}, unlocked_announcements = [], locked_announcements = []; |
334 | 334 | |
335 | 335 | $('#the-list tr').each( function(i, el) { |
336 | | var key = el.id, row = $(el), lock_data, avatar; |
| 336 | var key = el.id, row = $(el), lock_data, avatar, title; |
337 | 337 | |
338 | 338 | if ( locked.hasOwnProperty( key ) ) { |
339 | 339 | if ( ! row.hasClass('wp-locked') ) { |
… |
… |
$( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) { |
346 | 346 | row.find('.column-title .locked-avatar').empty().append( avatar ); |
347 | 347 | } |
348 | 348 | row.addClass('wp-locked'); |
| 349 | |
| 350 | // Add announcement |
| 351 | title = row.find('.column-title .row-title').text(); |
| 352 | locked_announcements.push( title ); |
349 | 353 | } |
350 | 354 | } else if ( row.hasClass('wp-locked') ) { |
351 | 355 | // Make room for the CSS animation |
352 | 356 | row.removeClass('wp-locked').delay(1000).find('.locked-info span').empty(); |
| 357 | |
| 358 | // Add announcement |
| 359 | title = row.find('.column-title .row-title').text(); |
| 360 | unlocked_announcements.push( title ); |
353 | 361 | } |
354 | 362 | }); |
| 363 | |
| 364 | // Make announcements |
| 365 | if ( locked_announcements.length > 1 ) { |
| 366 | locked_announcements = locked_announcements.slice(0, -1).join(', ') + ' ' + _wpInlineEditPostStrings.last_separator + ' ' + locked_announcements.slice(-1); |
| 367 | wp.a11y.speak( locked_announcements + " " + _wpInlineEditPostStrings.were_locked ); |
| 368 | } else if ( locked_announcements.length == 1 ) { |
| 369 | wp.a11y.speak( locked_announcements + " " + _wpInlineEditPostStrings.was_locked ); |
| 370 | } |
| 371 | |
| 372 | if ( unlocked_announcements.length > 1 ) { |
| 373 | unlocked_announcements = unlocked_announcements.slice(0, -1).join(', ') + ' ' + _wpInlineEditPostStrings.last_separator + ' ' + unlocked_announcements.slice(-1); |
| 374 | wp.a11y.speak( unlocked_announcements + " " + _wpInlineEditPostStrings.were_unlocked ); |
| 375 | } else if ( unlocked_announcements.length == 1 ) { |
| 376 | wp.a11y.speak( unlocked_announcements + " " + _wpInlineEditPostStrings.was_unlocked ); |
| 377 | } |
| 378 | |
355 | 379 | }).on( 'heartbeat-send.wp-check-locked-posts', function( e, data ) { |
356 | 380 | var check = []; |
357 | 381 | |