Ticket #31368: 31368.4.patch
| File 31368.4.patch, 5.6 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/js/customize-widgets.js
685 685 686 686 if ( isMoveUp ) { 687 687 self.moveUp(); 688 $( '#screen-reader-messages' ).text( l10n.widgetMovedUp );688 wp.a11y.speak( l10n.widgetMovedUp ); 689 689 } else { 690 690 self.moveDown(); 691 $( '#screen-reader-messages' ).text( l10n.widgetMovedDown );691 wp.a11y.speak( l10n.widgetMovedDown ); 692 692 } 693 693 694 694 $( this ).focus(); // re-focus after the container was moved -
src/wp-admin/js/updates.js
107 107 108 108 $message.addClass( 'updating-message' ); 109 109 $message.text( wp.updates.l10n.updating ); 110 wp.a11y.speak( wp.updates.l10n.updatingMsg ); 110 111 111 112 if ( wp.updates.updateLock ) { 112 113 wp.updates.updateQueue.push( { … … 153 154 154 155 $message.removeClass( 'updating-message' ).addClass( 'updated-message' ); 155 156 $message.text( wp.updates.l10n.updated ); 157 wp.a11y.speak( wp.updates.l10n.updatedMsg ); 156 158 157 159 wp.updates.decrementCount( 'plugin' ); 158 160 }; … … 173 175 } 174 176 $message.removeClass( 'updating-message' ); 175 177 $message.text( wp.updates.l10n.updateFailed ); 178 wp.a11y.speak( wp.updates.l10n.updateFailed ); 176 179 }; 177 180 178 181 /** … … 198 201 199 202 $message.addClass( 'updating-message' ); 200 203 $message.text( wp.updates.l10n.installing ); 204 wp.a11y.speak( wp.updates.l10n.installingMsg ); 201 205 202 206 if ( wp.updates.updateLock ) { 203 207 wp.updates.updateQueue.push( { … … 234 238 235 239 $message.removeClass( 'updating-message' ).addClass( 'updated-message button-disabled' ); 236 240 $message.text( wp.updates.l10n.installed ); 241 wp.a11y.speak( wp.updates.l10n.installedMsg ); 237 242 }; 238 243 239 244 /** -
src/wp-includes/js/wp-a11y.js
1 window.wp = window.wp || {}; 2 3 ( function ( wp, $ ) { 4 'use strict'; 5 6 var $container; 7 8 /** 9 * Update the ARIA live notification area text node. 10 * 11 * @since 4.2.0 12 * 13 * @param {String} message 14 */ 15 function speak( message ) { 16 $container.text( message ); 17 } 18 19 /** 20 * Initialize wp.a11y and define ARIA live notification area. 21 * 22 * @since 4.2.0 23 */ 24 $( document ).ready( function() { 25 $container = $( '#wp-a11y-speak' ); 26 27 if ( ! $container.length ) { 28 $container = $( '<div>', { 29 id: 'wp-a11y-speak', 30 role: 'status', 31 'aria-live': 'polite', 32 'aria-relevant': 'all', 33 'aria-atomic': 'true', 34 'class': 'screen-reader-text' 35 } ); 36 37 $( document.body ).append( $container ); 38 } 39 } ); 40 41 wp.a11y = wp.a11y || {}; 42 wp.a11y.speak = speak; 43 44 } )( window.wp, window.jQuery ); -
src/wp-includes/script-loader.php
77 77 'secure' => (string) ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) ), 78 78 ) ); 79 79 80 $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array( 'jquery', 'hoverIntent', 'utils'), false, 1 );80 $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array( 'jquery', 'hoverIntent', 'utils', 'wp-a11y' ), false, 1 ); 81 81 did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array( 82 82 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete.") 83 83 ) ); 84 84 85 $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 ); 86 85 87 $scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", array(), '1.6.1', 1 ); 86 88 87 89 $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", array(), false, 1 ); … … 380 382 381 383 $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r7', 1 ); 382 384 383 $scripts->add( 'customize-base', "/wp-includes/js/customize-base$suffix.js", array( 'jquery', 'json2', 'underscore' ), false, 1 );385 $scripts->add( 'customize-base', "/wp-includes/js/customize-base$suffix.js", array( 'jquery', 'json2', 'underscore', 'wp-a11y' ), false, 1 ); 384 386 $scripts->add( 'customize-loader', "/wp-includes/js/customize-loader$suffix.js", array( 'customize-base' ), false, 1 ); 385 387 $scripts->add( 'customize-preview', "/wp-includes/js/customize-preview$suffix.js", array( 'customize-base' ), false, 1 ); 386 388 $scripts->add( 'customize-models', "/wp-includes/js/customize-models.js", array( 'underscore', 'backbone' ), false, 1 ); … … 532 534 'ays' => __('Are you sure you want to install this plugin?') 533 535 ) ); 534 536 535 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util' ) );537 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ) ); 536 538 did_action( 'init' ) && $scripts->localize( 'updates', '_wpUpdatesSettings', array( 537 539 'ajax_nonce' => wp_create_nonce( 'updates' ), 538 540 'l10n' => array( … … 543 545 'installing' => __( 'Installing...' ), 544 546 'installed' => __( 'Installed!' ), 545 547 'installFailed' => __( 'Installation failed' ), 548 'updatingMsg' => __( 'Updating... please wait.' ), 549 'installingMsg' => __( 'Installing... please wait.' ), 550 'updatedMsg' => __( 'Update completed successfully.' ), 551 'installedMsg' => __( 'Installation completed successfully.' ), 546 552 ) 547 553 ) ); 548 554