Make WordPress Core


Ignore:
Timestamp:
04/04/2014 03:48:34 PM (13 years ago)
Author:
nacin
Message:

Header images: Accessibility and style improvements. Headers no longer jump around when chosen.

props mcsf, ehg.
see #21785.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-control.php

    r27945 r27947  
    775775                        <div class="placeholder random">
    776776                                <div class="inner">
    777                                         <span><span class="dashicons dashicons-randomize dice"></span>
     777                                        <button type="button"><span class="dashicons dashicons-randomize dice"></span>
    778778                                        <# if ( data.type === 'uploaded' ) { #>
    779779                                                <?php _e( 'Randomize uploaded headers' ); ?>
    … …  
    781781                                                <?php _e( 'Randomize suggested headers' ); ?>
    782782                                        <# } #>
    783                                         </span>
     783                                        </button>
    784784                                </div>
    785785                        </div>
    … …  
    788788
    789789                        <# if (data.type === 'uploaded') { #>
    790                         <div class="dashicons dashicons-no close"></div>
     790                                <div class="dashicons dashicons-no close"></div>
    791791                        <# } #>
    792792
    793                         <a href="#" class="choice thumbnail #>"
     793                        <button type="button" class="choice thumbnail"
    794794                                data-customize-image-value="{{{data.header.url}}}"
    795795                                data-customize-header-image-data="{{JSON.stringify(data.header)}}">
    796                                 <img src="{{{data.header.thumbnail_url}}}">
    797                         </a>
     796                                <span class="screen-reader-text"><?php _e( 'Set image' ); ?></span>
     797                                <img src="{{{data.header.thumbnail_url}}}" alt="{{{data.header.alt_text || data.header.description}}}">
     798                        </button>
    798799
    799800                        <# } #>
    … …  
    804805                                <# if (data.random) { #>
    805806
    806                         <div class="placeholder">
     807                        <div class="placeholder" tabindex="0">
    807808                                <div class="inner">
    808809                                        <span><span class="dashicons dashicons-randomize dice"></span>
    … …  
    818819                                <# } else { #>
    819820
    820                         <img src="{{{data.header.thumbnail_url}}}" />
     821                        <img src="{{{data.header.thumbnail_url}}}" alt="{{{data.header.alt_text || data.header.description}}}" tabindex="0"/>
    821822
    822823                                <# } #>
    823824                        <# } else { #>
    824825
    825                         <div class="placeholder">
     826                        <div class="placeholder" tabindex="0">
    826827                                <div class="inner">
    827828                                        <span>
    … …  
    854855
    855856                <div class="customize-control-content">
    856                         <p class="customizer-section-intro">
     857                        <p class="customizer-section-intro" tabindex="0">
    857858                                <?php
    858859                                // @todo translate (and look to custom-header.php for inspiration)
    … …  
    868869                        </p>
    869870                        <div class="current">
    870                                 <span class="customize-control-title">
     871                                <span class="customize-control-title" tabindex="0">
    871872                                        <?php _e( 'Current header' ); ?>
    872873                                </span>
    … …  
    876877                        <div class="actions">
    877878                                <?php /* translators: Hide as in hide header image via the Customizer */ ?>
    878                                 <a href="#" <?php echo $visibility ?> class="button remove"><?php _ex( 'Hide', 'custom header' ); ?></a>
     879                                <button type="button"<?php echo $visibility ?> class="button remove"><?php _ex( 'Hide image', 'custom header' ); ?></button>
    879880                                <?php /* translators: New as in add new header image via the Customizer */ ?>
    880                                 <a href="#" class="button new"><?php _ex( 'Add new', 'header image' ); ?></a>
     881                                <button type="button" class="button new"><?php _ex( 'Add new image', 'header image' ); ?></button>
    881882                                <div style="clear:both"></div>
    882883                        </div>
    883884                        <div class="choices">
    884                                 <span class="customize-control-title header-previously-uploaded">
     885                                <span class="customize-control-title header-previously-uploaded" tabindex="0">
    885886                                        <?php _ex( 'Previously uploaded', 'custom headers' ); ?>
    886887                                </span>
    … …  
    889890                                        </div>
    890891                                </div>
    891                                 <span class="customize-control-title header-default">
     892                                <span class="customize-control-title header-default" tabindex="0">
    892893                                        <?php _ex( 'Suggested', 'custom headers' ); ?>
    893894                                </span>
Note: See TracChangeset for help on using the changeset viewer.