Make WordPress Core

Ticket #38185: 38185.3.patch

File 38185.3.patch, 4.1 KB (added by mariovalney, 9 years ago)

Making things simple

  • wp-admin/css/list-tables.css

    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 { 
    549549        content: "\f142";
    550550}
    551551
     552tr .locked-indicator {
     553        display: none;
     554}
     555
    552556tr.wp-locked .locked-indicator {
    553557        margin-left: 6px;
    554558        height: 20px;
    555559        width: 16px;
     560        display: block;
    556561}
    557562
    558563tr.wp-locked .locked-indicator:before {
  • wp-admin/edit.php

    diff --git a/wp-admin/edit.php b/wp-admin/edit.php
    index 120140a..4e03a4d 100644
    a b if ( $doaction ) { 
    173173                         *
    174174                         * @param string $sendback The redirect URL.
    175175                         * @param string $doaction The action being taken.
    176                          * @param array  $post_ids The post IDs to take the action on. 
     176                         * @param array  $post_ids The post IDs to take the action on.
    177177                         */
    178178                        $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $post_ids );
    179179                        break;
    $wp_list_table->prepare_items(); 
    192192
    193193wp_enqueue_script('inline-edit-post');
    194194wp_enqueue_script('heartbeat');
     195wp_localize_script( 'inline-edit-post', '_wpInlineEditPostStrings', array(
     196        'was_unlocked'  => sprintf( __( 'One %s is not being edited anymore' ), mb_strtolower( $post_type_object->labels->singular_name ) ),
     197        'were_unlocked' => sprintf( __( '%s are not being edited anymore' ), mb_strtolower( $post_type_object->labels->name ) ),
     198        'was_locked'    => sprintf( __( 'One %s is being edited' ), mb_strtolower( $post_type_object->labels->singular_name ) ),
     199        'were_locked'   => sprintf( __( '%s are being edited' ), mb_strtolower( $post_type_object->labels->name ) ),
     200) );
    195201
    196202$title = $post_type_object->labels->name;
    197203
  • wp-admin/includes/class-wp-posts-list-table.php

    diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php
    index 506dded..f614f70 100644
    a b class WP_Posts_List_Table extends WP_List_Table { 
    829829                                printf( __( 'Select %s' ), _draft_or_post_title() );
    830830                        ?></label>
    831831                        <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>
    833837                <?php endif;
    834838        }
    835839
  • wp-admin/js/inline-edit-post.js

    diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js
    index 3a65805..7c0ca6f 100644
    a b $( document ).ready( function(){ inlineEditPost.init(); } ); 
    330330
    331331// Show/hide locks on posts
    332332$( 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 = 0, locked_announcements = 0;
    334334
    335335        $('#the-list tr').each( function(i, el) {
    336336                var key = el.id, row = $(el), lock_data, avatar;
    $( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) { 
    346346                                        row.find('.column-title .locked-avatar').empty().append( avatar );
    347347                                }
    348348                                row.addClass('wp-locked');
     349                                locked_announcements++;
    349350                        }
    350351                } else if ( row.hasClass('wp-locked') ) {
    351352                        // Make room for the CSS animation
    352353                        row.removeClass('wp-locked').delay(1000).find('.locked-info span').empty();
     354                        unlocked_announcements++;
    353355                }
    354356        });
     357
     358        // Make announcements
     359        if ( locked_announcements > 1 ) {
     360                wp.a11y.speak( locked_announcements + " " + _wpInlineEditPostStrings.were_locked );
     361        } else if ( locked_announcements == 1 ) {
     362                wp.a11y.speak( _wpInlineEditPostStrings.was_locked );
     363        }
     364
     365        if ( unlocked_announcements > 1 ) {
     366                wp.a11y.speak( unlocked_announcements + " " + _wpInlineEditPostStrings.were_unlocked );
     367        } else if ( unlocked_announcements == 1 ) {
     368                wp.a11y.speak( _wpInlineEditPostStrings.was_unlocked );
     369        }
    355370}).on( 'heartbeat-send.wp-check-locked-posts', function( e, data ) {
    356371        var check = [];
    357372