Ticket #31368: 31368.3.patch
| File 31368.3.patch, 5.7 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 && wp.a11y.speak( l10n.widgetMovedUp ); 689 689 } else { 690 690 self.moveDown(); 691 $( '#screen-reader-messages' ).text( l10n.widgetMovedDown );691 wp.a11y && 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 && 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 && 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 && 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 && 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 && 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 var $container; 6 7 /** 8 * Update the ARIA live notification area text node. 9 * 10 * @since 4.2.0 11 * 12 * @param {string} message 13 */ 14 function speak( message ) { 15 // For easier testing the messages will also be logged in the console when wp.a11y.debug is set to true. 16 if ( wp.a11y.debug ) { 17 window.console && window.console.log( 'WP speak: ' + message ); 18 } 19 20 // Make messages available to screen readers. 21 $container.text( message ); 22 }; 23 24 /** 25 * Initialize wp.a11y and define ARIA live notification area. 26 * 27 * @since 4.2.0 28 */ 29 $( document ).ready( function() { 30 $container = $( '#wp-a11y-speak' ); 31 32 if ( ! $container.length ) { 33 $container = $( '<div>', { 34 id: 'wp-a11y-speak', 35 role: 'status', 36 'aria-live': 'polite', 37 'aria-relevant': 'all', 38 'aria-atomic': 'true', 39 'class': 'screen-reader-text' 40 }); 41 42 $( document.body ).prepend( $container ); 43 } 44 }); 45 46 // Export 47 wp.a11y = wp.a11y || {}; 48 wp.a11y.speak = speak; 49 50 } ( window.wp, jQuery ) ); -
src/wp-includes/script-loader.php
Property changes on: src/wp-includes/js/wp-a11y.js ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
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 ); … … 549 551 'installing' => __( 'Installing...' ), 550 552 'installed' => __( 'Installed!' ), 551 553 'installFailed' => __( 'Installation failed' ), 554 'updatingMsg' => __( 'Updating... please wait.' ), 555 'installingMsg' => __( 'Installing... please wait.' ), 556 'updatedMsg' => __( 'Update completed successfully.' ), 557 'installedMsg' => __( 'Installation completed successfully.' ), 552 558 ) 553 559 ) ); 554 560