Make WordPress Core

Changeset 36964


Ignore:
Timestamp:
03/10/2016 10:36:25 PM (9 years ago)
Author:
afercia
Message:

Accessibility: Improve accessibility for the Plugin details modal.

The plugin details modal can be invoked from several screens. There's now a new
.open-plugin-details-modal CSS class to be used in combination with the
.thickbox CSS class that adds everything needed for accessibility.

  • Adds an ARIA role dialog and an aria-label attribute to the modal
  • Adds a title attribute to the iframe inside the modal
  • Constrains tabbing within the modal
  • Restores focus back in a proper place when closing the modal

Also, improves a bit the native Thickbox implementation: it should probably be
replaced with some more modern tool but at least keyboard focus should be moved
inside the modal.

Fixes #33305.

Location:
trunk/src
Files:
12 edited

Legend:

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

    r36171 r36964  
    140140                                );
    141141
    142                                 $plugin_link = '<a href="' . esc_url( add_query_arg( $url_args, network_admin_url( 'plugin-install.php' ) ) ) . '" class="thickbox">WordPress REST API</a>';
     142                                $plugin_link = '<a href="' . esc_url( add_query_arg( $url_args, network_admin_url( 'plugin-install.php' ) ) ) . '" class="thickbox open-plugin-details-modal">WordPress REST API</a>';
    143143                            } else {
    144144                                $plugin_link = '<a href="https://wordpress.org/plugins/rest-api">WordPress REST API</a>';
  • trunk/src/wp-admin/css/common.css

    r36959 r36964  
    28152815}
    28162816
     2817/* only on these screens */
     2818.about-php #TB_closeWindowButton,
     2819.plugin-install-php #TB_closeWindowButton,
     2820.import-php #TB_closeWindowButton,
     2821.plugins-php #TB_closeWindowButton,
     2822.update-core-php #TB_closeWindowButton,
     2823.index-php #TB_closeWindowButton {
     2824    left: auto;
     2825    right: -30px;
     2826    color: #eee;
     2827}
     2828
     2829
     2830body.about-php #TB_closeWindowButton:hover,
     2831body.about-php #TB_closeWindowButton:focus,
     2832body.plugin-install-php #TB_closeWindowButton:hover,
     2833body.plugin-install-php #TB_closeWindowButton:focus,
     2834body.import-php #TB_closeWindowButton:hover,
     2835body.import-php #TB_closeWindowButton:focus,
     2836body.plugins-php #TB_closeWindowButton:hover,
     2837body.plugins-php #TB_closeWindowButton:focus,
     2838body.update-core-php #TB_closeWindowButton:hover,
     2839body.update-core-php #TB_closeWindowButton:focus,
     2840body.index-php #TB_closeWindowButton:hover,
     2841body.index-php #TB_closeWindowButton:focus {
     2842    color: #00a0d2;
     2843    outline: none;
     2844    -webkit-box-shadow: none;
     2845    box-shadow: none;
     2846}
     2847
    28172848body.about-php .tb-close-icon,
    28182849body.plugin-install-php .tb-close-icon,
     
    28212852body.update-core-php .tb-close-icon,
    28222853body.index-php .tb-close-icon {
    2823     left: auto;
    2824     right: -30px;
    2825     color: #eee;
    2826     -webkit-transition: color .1s ease-in-out, background .1s ease-in-out;
    2827     transition: color .1s ease-in-out, background .1s ease-in-out;
    2828 }
    2829 
    2830 body.about-php #TB_closeWindowButton:focus,
    2831 body.about-php #TB_closeWindowButton:focus .tb-close-icon,
    2832 body.about-php .tb-close-icon:focus,
    2833 body.about-php .tb-close-icon:hover,
    2834 body.plugin-install-php #TB_closeWindowButton:focus,
    2835 body.plugin-install-php #TB_closeWindowButton:focus .tb-close-icon,
    2836 body.plugin-install-php .tb-close-icon:focus,
    2837 body.plugin-install-php .tb-close-icon:hover,
    2838 body.import-php #TB_closeWindowButton:focus,
    2839 body.import-php #TB_closeWindowButton:focus .tb-close-icon,
    2840 body.import-php .tb-close-icon:focus,
    2841 body.import-php .tb-close-icon:hover,
    2842 body.plugins-php #TB_closeWindowButton:focus,
    2843 body.plugins-php #TB_closeWindowButton:focus .tb-close-icon,
    2844 body.plugins-php .tb-close-icon:focus,
    2845 body.plugins-php .tb-close-icon:hover,
    2846 body.update-core-php #TB_closeWindowButton:focus,
    2847 body.update-core-php #TB_closeWindowButton:focus .tb-close-icon,
    2848 body.update-core-php .tb-close-icon:focus,
    2849 body.update-core-php .tb-close-icon:hover,
    2850 body.index-php #TB_closeWindowButton:focus,
    2851 body.index-php #TB_closeWindowButton:focus .tb-close-icon,
    2852 body.index-php .tb-close-icon:focus,
    2853 body.index-php .tb-close-icon:hover {
    2854     color: #00a0d2;
    2855     outline: none;
    2856     -webkit-box-shadow: none;
    2857     box-shadow: none;
    2858 }
    2859 
    2860 body.about-php .tb-close-icon:before,
    2861 body.plugin-install-php .tb-close-icon:before,
    2862 body.import-php .tb-close-icon:before,
    2863 body.plugins-php .tb-close-icon:before,
    2864 body.update-core-php .tb-close-icon:before,
    2865 body.index-php .tb-close-icon:before {
     2854    display: none;
     2855}
     2856
     2857body.about-php #TB_closeWindowButton:after,
     2858body.plugin-install-php #TB_closeWindowButton:after,
     2859body.import-php #TB_closeWindowButton:after,
     2860body.plugins-php #TB_closeWindowButton:after,
     2861body.update-core-php #TB_closeWindowButton:after,
     2862body.index-php #TB_closeWindowButton:after {
    28662863    content: "\f335";
    2867     font-size: 32px;
     2864    font: normal 32px/29px 'dashicons';
     2865    speak: none;
     2866    -webkit-font-smoothing: antialiased;
     2867    -moz-osx-font-smoothing: grayscale;
    28682868}
    28692869
    28702870/* move plugin install close icon to top on narrow screens */
    28712871@media screen and ( max-width: 830px ) {
    2872     body.about-php .tb-close-icon,
    2873     body.plugin-install-php .tb-close-icon,
    2874     body.import-php .tb-close-icon,
    2875     body.plugins-php .tb-close-icon,
    2876     body.update-core-php .tb-close-icon,
    2877     body.index-php .tb-close-icon {
     2872    body.about-php #TB_closeWindowButton,
     2873    body.plugin-install-php #TB_closeWindowButton,
     2874    body.import-php #TB_closeWindowButton,
     2875    body.plugins-php #TB_closeWindowButton,
     2876    body.update-core-php #TB_closeWindowButton,
     2877    body.index-php #TB_closeWindowButton {
    28782878        right: 0;
    28792879        top: -30px;
  • trunk/src/wp-admin/import.php

    r36653 r36964  
    102102                if ( is_main_site() ) {
    103103                    $action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
    104                                         '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
     104                                        '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal" title="' .
    105105                                        esc_attr__('Install importer') . '">' . $data[0] . '</a>';
    106106                } else {
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r36581 r36964  
    477477
    478478            /* translators: 1: Plugin name and version. */
    479             $action_links[] = '<a href="' . esc_url( $details_link ) . '" class="thickbox" aria-label="' . esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '" data-title="' . esc_attr( $name ) . '">' . __( 'More Details' ) . '</a>';
     479            $action_links[] = '<a href="' . esc_url( $details_link ) . '" class="thickbox open-plugin-details-modal" aria-label="' . esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '" data-title="' . esc_attr( $name ) . '">' . __( 'More Details' ) . '</a>';
    480480
    481481            if ( !empty( $plugin['icons']['svg'] ) ) {
     
    505505                <div class="name column-name">
    506506                    <h3>
    507                         <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox">
     507                        <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox open-plugin-details-modal">
    508508                        <?php echo $title; ?>
    509509                        <img src="<?php echo esc_attr( $plugin_icon_url ) ?>" class="plugin-icon" alt="">
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r36830 r36964  
    743743                    // Details link using API info, if available
    744744                    if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) {
    745                         $plugin_meta[] = sprintf( '<a href="%s" class="thickbox" aria-label="%s" data-title="%s">%s</a>',
     745                        $plugin_meta[] = sprintf( '<a href="%s" class="thickbox open-plugin-details-modal" aria-label="%s" data-title="%s">%s</a>',
    746746                            esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] .
    747747                                '&TB_iframe=true&width=600&height=550' ) ),
  • trunk/src/wp-admin/includes/dashboard.php

    r36878 r36964  
    12461246        $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';
    12471247        echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
    1248             '&nbsp;<a href="' . $ilink . '" class="thickbox" aria-label="' .
     1248            '&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
    12491249            /* translators: %s: plugin name */
    12501250            esc_attr( sprintf( __( 'Install %s' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>';
  • trunk/src/wp-admin/includes/update.php

    r36850 r36964  
    340340        if ( ! current_user_can( 'update_plugins' ) ) {
    341341            /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number */
    342             printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>.' ),
     342            printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a>.' ),
    343343                $plugin_name,
    344344                esc_url( $details_url ),
     
    349349        } elseif ( empty( $r->package ) ) {
    350350            /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number */
    351             printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
     351            printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
    352352                $plugin_name,
    353353                esc_url( $details_url ),
     
    358358        } else {
    359359            /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number, 5: update URL, 6: accessibility text */
    360             printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="%6$s">update now</a>.' ),
     360            printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="%6$s">update now</a>.' ),
    361361                $plugin_name,
    362362                esc_url( $details_url ),
     
    470470    if ( ! current_user_can('update_themes') ) {
    471471        /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number */
    472         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>.'),
     472        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a>.'),
    473473            $theme_name,
    474474            esc_url( $details_url ),
     
    479479    } elseif ( empty( $r['package'] ) ) {
    480480        /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number */
    481         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
     481        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
    482482            $theme_name,
    483483            esc_url( $details_url ),
     
    488488    } else {
    489489        /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number, 5: update URL, 6: accessibility text */
    490         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="%6$s">update now</a>.' ),
     490        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="%6$s">update now</a>.' ),
    491491            $theme_name,
    492492            esc_url( $details_url ),
  • trunk/src/wp-admin/js/plugin-install.js

    r36286 r36964  
    1 /* global plugininstallL10n, tb_click */
     1/* global plugininstallL10n, tb_click, tb_remove */
    22
    33/* Plugin Browser Thickbox related JS*/
    44var tb_position;
    55jQuery( document ).ready( function( $ ) {
     6
     7    var tbWindow,
     8        $focusedBefore,
     9        $iframeBody,
     10        $tabbables,
     11        $firstTabbable,
     12        $lastTabbable;
     13
    614    tb_position = function() {
    7         var tbWindow = $( '#TB_window' ),
    8             width = $( window ).width(),
     15        var width = $( window ).width(),
    916            H = $( window ).height() - ( ( 792 < width ) ? 60 : 20 ),
    1017            W = ( 792 < width ) ? 772 : width - 20;
     18
     19        tbWindow = $( '#TB_window' );
    1120
    1221        if ( tbWindow.length ) {
     
    3948    });
    4049
    41     $( '.plugin-card, .plugins .plugin-version-author-uri' ).on( 'click', 'a.thickbox', function( e ) {
     50    /*
     51     * Custom events: when a Thickbox iframe has loaded and when the Thickbox
     52     * modal gets removed from the DOM.
     53     */
     54    $( 'body' )
     55        .on( 'thickbox:iframe:loaded', tbWindow, function() {
     56            iframeLoaded();
     57        })
     58        .on( 'thickbox:removed', function() {
     59            // Set focus back to the element that opened the modal dialog.
     60            // Note: IE 8 would need this wrapped in a fake setTimeout `0`.
     61            $focusedBefore.focus();
     62        });
     63
     64    function iframeLoaded() {
     65        var $iframe = tbWindow.find( '#TB_iframeContent' );
     66
     67        // Get the iframe body.
     68        $iframeBody = $iframe.contents().find( 'body' );
     69
     70        // Get the tabbable elements and handle the keydown event on first load.
     71        handleTabbables();
     72
     73        // Set initial focus on the "Close" button.
     74        $firstTabbable.focus();
     75
     76        /*
     77         * When the "Install" button is disabled (e.g. the Plugin is already installed)
     78         * then we can't predict where the last focusable element is. We need to get
     79         * the tabbable elements and handle the keydown event again and again,
     80         * each time the active tab panel changes.
     81         */
     82        $( '#plugin-information-tabs a', $iframeBody ).on( 'click', function() {
     83            handleTabbables();
     84        });
     85
     86        // Close the modal when pressing Escape.
     87        $iframeBody.on( 'keydown', function( event ) {
     88            if ( 27 !== event.which ) {
     89                return;
     90            }
     91            tb_remove();
     92        });
     93    }
     94
     95    /*
     96     * Get the tabbable elements and detach/attach the keydown event.
     97     * Called after the iframe has fully loaded so we have all the elements we need.
     98     * Called again each time a Tab gets clicked.
     99     * @todo Consider to implement a WordPress general utility for this and don't use jQuery UI.
     100     */
     101    function handleTabbables() {
     102        var $firstAndLast;
     103        // Get all the tabbable elements.
     104        $tabbables = $( ':tabbable', $iframeBody );
     105        // Our first tabbable element is always the "Close" button.
     106        $firstTabbable = tbWindow.find( '#TB_closeWindowButton' );
     107        // Get the last tabbable element.
     108        $lastTabbable = $tabbables.last();
     109        // Make a jQuery collection.
     110        $firstAndLast = $firstTabbable.add( $lastTabbable );
     111        // Detach any previously attached keydown event.
     112        $firstAndLast.off( 'keydown.wp-plugin-details' );
     113        // Attach again the keydown event on the first and last focusable elements.
     114        $firstAndLast.on( 'keydown.wp-plugin-details', function( event ) {
     115            constrainTabbing( event );
     116        });
     117    }
     118
     119    // Constrain tabbing within the plugin modal dialog.
     120    function constrainTabbing( event ) {
     121        if ( 9 !== event.which ) {
     122            return;
     123        }
     124
     125        if ( $lastTabbable[0] === event.target && ! event.shiftKey ) {
     126            event.preventDefault();
     127            $firstTabbable.focus();
     128        } else if ( $firstTabbable[0] === event.target && event.shiftKey ) {
     129            event.preventDefault();
     130            $lastTabbable.focus();
     131        }
     132    }
     133
     134    // Open the Plugin details modal.
     135    $( '.thickbox.open-plugin-details-modal' ).on( 'click', function( e ) {
     136        // The `data-title` attribute is used only in the Plugin screens.
     137        var title = $( this ).data( 'title' ) ? plugininstallL10n.plugin_information + ' ' + $( this ).data( 'title' ) : plugininstallL10n.plugin_modal_label;
     138
    42139        e.preventDefault();
    43140        e.stopPropagation();
    44141
     142        // Store the element that has focus before opening the modal dialog, i.e. the control which opens it.
     143        $focusedBefore = $( this );
     144
    45145        tb_click.call(this);
    46146
    47         $('#TB_title').css({'background-color':'#23282d','color':'#cfcfcf'});
    48         $('#TB_ajaxWindowTitle').html( '<strong>' + plugininstallL10n.plugin_information + '</strong>&nbsp;' + $(this).data( 'title' ) );
    49         $('#TB_iframeContent').attr( 'title', plugininstallL10n.plugin_information + ' ' + $(this).data( 'title' ) );
    50         $('#TB_closeWindowButton').focus();
     147        // Set ARIA role and ARIA label.
     148        tbWindow.attr({
     149            'role': 'dialog',
     150            'aria-label': plugininstallL10n.plugin_modal_label
     151        });
     152
     153        // Set title attribute on the iframe.
     154        tbWindow.find( '#TB_iframeContent' ).attr( 'title', title );
    51155    });
    52156
  • trunk/src/wp-admin/update-core.php

    r36477 r36964  
    285285        /* translators: 1: Plugin name 2: Plugin version */
    286286        $details_text = sprintf( __( 'View %1$s version %2$s details.' ), $details_name, $plugin_data->update->new_version );
    287         $details = sprintf( '<a href="%1$s" class="thickbox">%2$s</a>', esc_url( $details_url ), $details_text );
     287        $details = sprintf( '<a href="%1$s" class="thickbox open-plugin-details-modal">%2$s</a>', esc_url( $details_url ), $details_text );
    288288        $checkbox_id =  "checkbox_" . md5( $plugin_data->Name );
    289289        ?>
  • trunk/src/wp-includes/js/thickbox/thickbox.css

    r36904 r36964  
    4444}
    4545
    46 #TB_closeAjaxWindow {
    47     float: right;
    48 }
    49 
    50 #TB_closeAjaxWindow a {
    51     text-decoration: none;
     46#TB_closeWindowButton {
     47    position: absolute;
     48    left: auto;
     49    right: 0;
     50    width: 29px;
     51    height: 29px;
     52    border: 0;
     53    padding: 0;
     54    background: none;
     55    cursor: pointer;
     56    outline: none;
     57    -webkit-transition: color .1s ease-in-out, background .1s ease-in-out;
     58    transition: color .1s ease-in-out, background .1s ease-in-out;
    5259}
    5360
     
    116123
    117124.tb-close-icon {
     125    display: block;
    118126    color: #666;
    119127    text-align: center;
     
    134142}
    135143
    136 .tb-close-icon:hover {
     144#TB_closeWindowButton:hover .tb-close-icon,
     145#TB_closeWindowButton:focus .tb-close-icon {
    137146    color: #00a0d2;
    138147}
  • trunk/src/wp-includes/js/thickbox/thickbox.js

    r35418 r36964  
    4141
    4242function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
     43
     44    var $closeBtn;
    4345
    4446    try {
     
    138140            TB_WIDTH = imageWidth + 30;
    139141            TB_HEIGHT = imageHeight + 60;
    140             jQuery("#TB_window").append("<a href='' id='TB_ImageOff'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><div class='tb-close-icon'></div></a></div>");
     142            jQuery("#TB_window").append("<a href='' id='TB_ImageOff'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div>");
    141143
    142144            jQuery("#TB_closeWindowButton").click(tb_remove);
     
    203205                    jQuery("#TB_iframeContent").remove();
    204206                    if(params['modal'] != "true"){//iframe no modal
    205                         jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><div class='tb-close-icon'></div></a></div></div><iframe frameborder='0' hspace='0' allowTransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>");
     207                        jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div></div><iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>");
    206208                    }else{//iframe modal
    207209                    jQuery("#TB_overlay").unbind();
    208                         jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' allowTransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>"+thickboxL10n.noiframes+"</iframe>");
     210                        jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>"+thickboxL10n.noiframes+"</iframe>");
    209211                    }
    210212            }else{// not an iframe, ajax
     
    260262        }
    261263
     264        $closeBtn = jQuery( '#TB_closeWindowButton' );
     265        /*
     266         * If the native Close button icon is visible, move focus on the button
     267         * (e.g. in the Network Admin Themes screen).
     268         * In other admin screens is hidden and replaced by a different icon.
     269         */
     270        if ( $closeBtn.find( '.tb-close-icon' ).is( ':visible' ) ) {
     271            $closeBtn.focus();
     272        }
     273
    262274    } catch(e) {
    263275        //nothing here
     
    274286    jQuery("#TB_imageOff").unbind("click");
    275287    jQuery("#TB_closeWindowButton").unbind("click");
    276     jQuery("#TB_window").fadeOut("fast",function(){jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("tb_unload").unbind().remove();});
     288    jQuery( '#TB_window' ).fadeOut( 'fast', function() {
     289        jQuery( '#TB_window, #TB_overlay, #TB_HideSelect' ).trigger( 'tb_unload' ).unbind().remove();
     290        jQuery( 'body' ).trigger( 'thickbox:removed' );
     291    });
    277292    jQuery( 'body' ).removeClass( 'modal-open' );
    278293    jQuery("#TB_load").remove();
  • trunk/src/wp-includes/script-loader.php

    r36884 r36964  
    581581        ) );
    582582
    583         $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), false, 1 );
     583        $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'jquery-ui-core', 'thickbox' ), false, 1 );
    584584        did_action( 'init' ) && $scripts->localize( 'plugin-install', 'plugininstallL10n', array(
    585             'plugin_information' => __('Plugin Information:'),
     585            'plugin_information' => __( 'Plugin:' ),
     586            'plugin_modal_label' => __( 'Plugin details' ),
    586587            'ays' => __('Are you sure you want to install this plugin?')
    587588        ) );
Note: See TracChangeset for help on using the changeset viewer.