Make WordPress Core


Ignore:
Timestamp:
06/17/2016 08:46:08 PM (8 years ago)
Author:
afercia
Message:

Accessibility: Theme Installer, make the "Upload Theme" button... a button.

UI controls that "do something" on a page shouldn't be links. This link behaves
like a toggle to expand the uploader panel and should be a button element with
an aria-expanded attribute. Also:

  • improves consistency with the Plugin uploader
  • keeps the themes list visible when the uploader is open
  • displays a notice when JavaScript is off
  • adds some hide-if-no-js CSS classes
  • removes the themes.router.navigate() "upload" route: seems unnecessary and breaks history

Fixes #35457.

File:
1 edited

Legend:

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

    r37714 r37742  
    128128    $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
    129129    if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
    130         echo ' <a href="#" class="upload-view-toggle page-title-action">' . __( 'Upload Theme' ) . '</a>';
     130        echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>';
    131131    }
    132132    ?></h1>
     133    <div class="error hide-if-js">
     134        <p><?php _e( 'The Theme Installer screen requires JavaScript.' ); ?></p>
     135    </div>
    133136
    134137    <div class="upload-theme">
     
    136139    </div>
    137140
    138     <h2 class="screen-reader-text"><?php _e( 'Filter themes list' ); ?></h2>
    139 
    140     <div class="wp-filter">
     141    <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Filter themes list' ); ?></h2>
     142
     143    <div class="wp-filter hide-if-no-js">
    141144        <div class="filter-count">
    142145            <span class="count theme-count"></span>
     
    202205        </div>
    203206    </div>
    204     <h2 class="screen-reader-text"><?php _e( 'Themes list' ); ?></h2>
     207    <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Themes list' ); ?></h2>
    205208    <div class="theme-browser content-filterable"></div>
    206209    <div class="theme-install-overlay wp-full-overlay expanded"></div>
Note: See TracChangeset for help on using the changeset viewer.