Make WordPress Core

Changeset 31594


Ignore:
Timestamp:
03/01/2015 07:10:58 PM (10 years ago)
Author:
azaozz
Message:

Add wp.a11y.speak() for audible alerts/updates in screen readers. Props afercia, GrahamArmfield (for the idea), iseulde. Fixes #31368.

Location:
trunk/src
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r31533 r31594  
    119119<div class="wp-full-overlay expanded">
    120120    <form id="customize-controls" class="wrap wp-full-overlay-sidebar">
    121         <div id="screen-reader-messages" role="status" aria-live="polite" aria-relevant="all" aria-atomic="true" class="screen-reader-text"></div>
    122 
    123121        <div id="customize-header-actions" class="wp-full-overlay-header">
    124122            <?php
  • trunk/src/wp-admin/js/customize-widgets.js

    r31570 r31594  
    686686                    if ( isMoveUp ) {
    687687                        self.moveUp();
    688                         $( '#screen-reader-messages' ).text( l10n.widgetMovedUp );
     688                        wp.a11y.speak( l10n.widgetMovedUp );
    689689                    } else {
    690690                        self.moveDown();
    691                         $( '#screen-reader-messages' ).text( l10n.widgetMovedDown );
     691                        wp.a11y.speak( l10n.widgetMovedDown );
    692692                    }
    693693
  • trunk/src/wp-admin/js/updates.js

    r31470 r31594  
    108108        $message.addClass( 'updating-message' );
    109109        $message.text( wp.updates.l10n.updating );
     110        wp.a11y.speak( wp.updates.l10n.updatingMsg );
    110111
    111112        if ( wp.updates.updateLock ) {
     
    154155        $message.removeClass( 'updating-message' ).addClass( 'updated-message' );
    155156        $message.text( wp.updates.l10n.updated );
     157        wp.a11y.speak( wp.updates.l10n.updatedMsg );
    156158
    157159        wp.updates.decrementCount( 'plugin' );
     
    174176        $message.removeClass( 'updating-message' );
    175177        $message.text( wp.updates.l10n.updateFailed );
     178        wp.a11y.speak( wp.updates.l10n.updateFailed );
    176179    };
    177180
     
    199202        $message.addClass( 'updating-message' );
    200203        $message.text( wp.updates.l10n.installing );
     204        wp.a11y.speak( wp.updates.l10n.installingMsg );
    201205
    202206        if ( wp.updates.updateLock ) {
     
    235239        $message.removeClass( 'updating-message' ).addClass( 'updated-message button-disabled' );
    236240        $message.text( wp.updates.l10n.installed );
     241        wp.a11y.speak( wp.updates.l10n.installedMsg );
    237242    };
    238243
  • trunk/src/wp-includes/script-loader.php

    r31588 r31594  
    8282        'warnDelete' => __("You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete.")
    8383    ) );
     84
     85    $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 );
    8486
    8587    $scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", array(), '1.6.1', 1 );
     
    381383    $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r7', 1 );
    382384
    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 );
    384386    $scripts->add( 'customize-loader',   "/wp-includes/js/customize-loader$suffix.js",   array( 'customize-base' ), false, 1 );
    385387    $scripts->add( 'customize-preview',  "/wp-includes/js/customize-preview$suffix.js",  array( 'customize-base' ), false, 1 );
     
    533535        ) );
    534536
    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' ) );
    536538        did_action( 'init' ) && $scripts->localize( 'updates', '_wpUpdatesSettings', array(
    537539            'ajax_nonce' => wp_create_nonce( 'updates' ),
     
    544546                'installed'     => __( 'Installed!' ),
    545547                'installFailed' => __( 'Installation failed' ),
     548                'updatingMsg'   => __( 'Updating... please wait.' ),
     549                'installingMsg' => __( 'Installing... please wait.' ),
     550                'updatedMsg'    => __( 'Update completed successfully.' ),
     551                'installedMsg'  => __( 'Installation completed successfully.' ),
    546552            )
    547553        ) );
Note: See TracChangeset for help on using the changeset viewer.