Make WordPress Core

Ticket #34613: 34613.patch

File 34613.patch, 3.7 KB (added by garusky, 10 years ago)
  • src/wp-admin/includes/class-wp-terms-list-table.php

     
    588588        ?>
    589589
    590590                <p class="inline-edit-save submit">
    591                         <a href="#inline-edit" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></a>
    592                         <a href="#inline-edit" class="save button-primary alignright"><?php echo $tax->labels->update_item; ?></a>
     591                        <button type="button" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></button>
     592                        <button type="button" class="save button-primary alignright"><?php echo $tax->labels->update_item; ?></button>
    593593                        <span class="spinner"></span>
    594594                        <span class="error" style="display:none;"></span>
    595595                        <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
  • src/wp-admin/js/inline-edit-tax.js

     
    11/* global inlineEditL10n, ajaxurl */
     2window.wp = window.wp || {};
    23
    34var inlineEditTax;
    4 (function($) {
     5( function( $, wp ) {
    56inlineEditTax = {
    67
    78        init : function() {
     
    2223                        }
    2324                });
    2425
    25                 $( 'a.cancel', row ).click( function() {
     26                $( '.cancel', row ).click( function() {
    2627                        return inlineEditTax.revert();
    2728                });
    28                 $( 'a.save', row ).click( function() {
     29                $( '.save', row ).click( function() {
    2930                        return inlineEditTax.save(this);
    3031                });
    3132                $( 'input, select', row ).keydown( function( e ) {
     
    117118                                                // Update the value in the Parent dropdown.
    118119                                                $( '#parent' ).find( 'option[value=' + option_value + ']' ).text( row.find( '.row-title' ).text() );
    119120
    120                                                 row.hide().fadeIn();
     121                                                row.hide().fadeIn( 400, function() {
     122                                                        // Move focus back to the taxonomy title.
     123                                                        wp.a11y.speak( inlineEditL10n.saved );
     124                                                        row.find( '.row-title' ).focus();
     125                                                });
     126
    121127                                        } else {
    122128                                                $('#edit-'+id+' .inline-edit-save .error').html(r).show();
     129                                                wp.a11y.speak( r );
    123130                                        }
    124131                                } else {
    125132                                        $('#edit-'+id+' .inline-edit-save .error').html(inlineEditL10n.error).show();
     133                                        wp.a11y.speak( inlineEditL10n.error );
    126134                                }
    127135                        }
    128136                );
     
    136144                        $( 'table.widefat .spinner' ).removeClass( 'is-active' );
    137145                        $('#'+id).siblings('tr.hidden').addBack().remove();
    138146                        id = id.substr( id.lastIndexOf('-') + 1 );
    139                         $(this.what+id).show();
     147                        // Show the taxonomy listing and move focus back to the taxonomy title.
     148                        $( this.what+id ).show().find( '.row-title' ).focus();
    140149                }
    141150
    142151                return false;
     
    149158};
    150159
    151160$(document).ready(function(){inlineEditTax.init();});
    152 })(jQuery);
     161})( jQuery, window.wp);
  • src/wp-includes/script-loader.php

     
    562562                        'comma' => trim( _x( ',', 'tag delimiter' ) ),
    563563                ) );
    564564
    565                 $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), false, 1 );
     565                $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
    566566                did_action( 'init' ) && $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
    567                         'error' => __('Error while saving the changes.')
     567                        'error' => __('Error while saving the changes.'),
     568                        'saved' => __( 'Changes saved' ),
    568569                ) );
    569570
    570571                $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), false, 1 );