Make WordPress Core

Ticket #33305: 33305.2.patch

File 33305.2.patch, 25.2 KB (added by afercia, 9 years ago)
  • src/wp-admin/about.php

     
    139139                                                                        'height'    => 550
    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>';
    145145                                                        }
  • src/wp-admin/css/common.css

     
    28372837        display: none;
    28382838}
    28392839
    2840 body.about-php .tb-close-icon,
    2841 body.plugin-install-php .tb-close-icon,
    2842 body.import-php .tb-close-icon,
    2843 body.plugins-php .tb-close-icon,
    2844 body.update-core-php .tb-close-icon,
    2845 body.index-php .tb-close-icon {
     2840/* only on these screens */
     2841.about-php #TB_closeWindowButton,
     2842.plugin-install-php #TB_closeWindowButton,
     2843.import-php #TB_closeWindowButton,
     2844.plugins-php #TB_closeWindowButton,
     2845.update-core-php #TB_closeWindowButton,
     2846.index-php #TB_closeWindowButton {
    28462847        left: auto;
    28472848        right: -30px;
    28482849        color: #eee;
    2849         -webkit-transition: color .1s ease-in-out, background .1s ease-in-out;
    2850         transition: color .1s ease-in-out, background .1s ease-in-out;
    28512850}
    28522851
     2852
     2853body.about-php #TB_closeWindowButton:hover,
    28532854body.about-php #TB_closeWindowButton:focus,
    2854 body.about-php #TB_closeWindowButton:focus .tb-close-icon,
    2855 body.about-php .tb-close-icon:focus,
    2856 body.about-php .tb-close-icon:hover,
     2855body.plugin-install-php #TB_closeWindowButton:hover,
    28572856body.plugin-install-php #TB_closeWindowButton:focus,
    2858 body.plugin-install-php #TB_closeWindowButton:focus .tb-close-icon,
    2859 body.plugin-install-php .tb-close-icon:focus,
    2860 body.plugin-install-php .tb-close-icon:hover,
     2857body.import-php #TB_closeWindowButton:hover,
    28612858body.import-php #TB_closeWindowButton:focus,
    2862 body.import-php #TB_closeWindowButton:focus .tb-close-icon,
    2863 body.import-php .tb-close-icon:focus,
    2864 body.import-php .tb-close-icon:hover,
     2859body.plugins-php #TB_closeWindowButton:hover,
    28652860body.plugins-php #TB_closeWindowButton:focus,
    2866 body.plugins-php #TB_closeWindowButton:focus .tb-close-icon,
    2867 body.plugins-php .tb-close-icon:focus,
    2868 body.plugins-php .tb-close-icon:hover,
     2861body.update-core-php #TB_closeWindowButton:hover,
    28692862body.update-core-php #TB_closeWindowButton:focus,
    2870 body.update-core-php #TB_closeWindowButton:focus .tb-close-icon,
    2871 body.update-core-php .tb-close-icon:focus,
    2872 body.update-core-php .tb-close-icon:hover,
    2873 body.index-php #TB_closeWindowButton:focus,
    2874 body.index-php #TB_closeWindowButton:focus .tb-close-icon,
    2875 body.index-php .tb-close-icon:focus,
    2876 body.index-php .tb-close-icon:hover {
     2863body.index-php #TB_closeWindowButton:hover,
     2864body.index-php #TB_closeWindowButton:focus {
    28772865        color: #00a0d2;
    28782866        outline: none;
    28792867        -webkit-box-shadow: none;
     
    28802868        box-shadow: none;
    28812869}
    28822870
    2883 body.about-php .tb-close-icon:before,
    2884 body.plugin-install-php .tb-close-icon:before,
    2885 body.import-php .tb-close-icon:before,
    2886 body.plugins-php .tb-close-icon:before,
    2887 body.update-core-php .tb-close-icon:before,
    2888 body.index-php .tb-close-icon:before {
     2871body.about-php .tb-close-icon,
     2872body.plugin-install-php .tb-close-icon,
     2873body.import-php .tb-close-icon,
     2874body.plugins-php .tb-close-icon,
     2875body.update-core-php .tb-close-icon,
     2876body.index-php .tb-close-icon {
     2877        display: none;
     2878}
     2879
     2880body.about-php #TB_closeWindowButton:after,
     2881body.plugin-install-php #TB_closeWindowButton:after,
     2882body.import-php #TB_closeWindowButton:after,
     2883body.plugins-php #TB_closeWindowButton:after,
     2884body.update-core-php #TB_closeWindowButton:after,
     2885body.index-php #TB_closeWindowButton:after {
    28892886        content: "\f335";
    2890         font-size: 32px;
     2887        font: normal 32px/29px 'dashicons';
     2888        speak: none;
     2889        -webkit-font-smoothing: antialiased;
     2890        -moz-osx-font-smoothing: grayscale;
    28912891}
    28922892
    28932893/* move plugin install close icon to top on narrow screens */
    28942894@media screen and ( max-width: 830px ) {
    2895         body.about-php .tb-close-icon,
    2896         body.plugin-install-php .tb-close-icon,
    2897         body.import-php .tb-close-icon,
    2898         body.plugins-php .tb-close-icon,
    2899         body.update-core-php .tb-close-icon,
    2900         body.index-php .tb-close-icon {
     2895        body.about-php #TB_closeWindowButton,
     2896        body.plugin-install-php #TB_closeWindowButton,
     2897        body.import-php #TB_closeWindowButton,
     2898        body.plugins-php #TB_closeWindowButton,
     2899        body.update-core-php #TB_closeWindowButton,
     2900        body.index-php #TB_closeWindowButton {
    29012901                right: 0;
    29022902                top: -30px;
    29032903        }
  • src/wp-admin/import.php

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

     
    476476                                                                '&amp;TB_iframe=true&amp;width=600&amp;height=550' );
    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'] ) ) {
    482482                                $plugin_icon_url = $plugin['icons']['svg'];
     
    505505                        <div class="plugin-card-top">
    506506                                <div class="name column-name">
    507507                                        <h3>
    508                                                 <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox">
     508                                                <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox open-plugin-details-modal">
    509509                                                <?php echo $title; ?>
    510510                                                <img src="<?php echo esc_attr( $plugin_icon_url ) ?>" class="plugin-icon" alt="">
    511511                                                </a>
  • src/wp-admin/includes/class-wp-plugins-list-table.php

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

     
    12081208
    12091209                $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';
    12101210                echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
    1211                         '&nbsp;<a href="' . $ilink . '" class="thickbox" aria-label="' .
     1211                        '&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
    12121212                        /* translators: %s: plugin name */
    12131213                        esc_attr( sprintf( __( 'Install %s' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>';
    12141214
  • src/wp-admin/includes/update.php

     
    339339
    340340                if ( ! current_user_can( 'update_plugins' ) ) {
    341341                        /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number */
    342                         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">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="View %3$s version %4$s details">View version %4$s details</a>.' ),
    343343                                $plugin_name,
    344344                                esc_url( $details_url ),
    345345                                esc_attr( $plugin_name ),
     
    347347                        );
    348348                } elseif ( empty( $r->package ) ) {
    349349                        /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number */
    350                         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
     350                        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="View %3$s version %4$s details">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
    351351                                $plugin_name,
    352352                                esc_url( $details_url ),
    353353                                esc_attr( $plugin_name ),
     
    355355                        );
    356356                } else {
    357357                        /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number, 5: update URL */
    358                         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="update %3$s now">update now</a>.' ),
     358                        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="View %3$s version %4$s details">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="update %3$s now">update now</a>.' ),
    359359                                $plugin_name,
    360360                                esc_url( $details_url ),
    361361                                esc_attr( $plugin_name ),
     
    461461        echo '<tr class="plugin-update-tr' . $active . '" id="' . esc_attr( $theme->get_stylesheet() . '-update' ) . '" data-slug="' . esc_attr( $theme->get_stylesheet() ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
    462462        if ( ! current_user_can('update_themes') ) {
    463463                /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
    464                 printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>.'),
     464                printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="View %3$s version %4$s details">View version %4$s details</a>.'),
    465465                        $theme['Name'],
    466466                        esc_url( $details_url ),
    467467                        esc_attr( $theme['Name'] ),
     
    469469                );
    470470        } elseif ( empty( $r['package'] ) ) {
    471471                /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
    472                 printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
     472                printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="View %3$s version %4$s details">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
    473473                        $theme['Name'],
    474474                        esc_url( $details_url ),
    475475                        esc_attr( $theme['Name'] ),
     
    477477                );
    478478        } else {
    479479                /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number, 5: update URL */
    480                 printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="update %3$s now">update now</a>.' ),
     480                printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox open-plugin-details-modal" aria-label="View %3$s version %4$s details">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="update %3$s now">update now</a>.' ),
    481481                        $theme['Name'],
    482482                        esc_url( $details_url ),
    483483                        esc_attr( $theme['Name'] ),
  • src/wp-admin/js/plugin-install.js

     
    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;
    1118
     19                tbWindow = $( '#TB_window' );
     20
    1221                if ( tbWindow.length ) {
    1322                        tbWindow.width( W ).height( H );
    1423                        $( '#TB_iframeContent' ).width( W ).height( H );
     
    3847                tb_position();
    3948        });
    4049
    41         $( '.plugin-card, .plugins .plugin-version-author-uri' ).on( 'click', 'a.thickbox', function( e ) {
     50        $( 'body' ).on( 'thickbox:iframe:loaded', tbWindow, function() {
     51                iframeLoaded();
     52        });
     53
     54        function iframeLoaded() {
     55                var $iframe = tbWindow.find( '#TB_iframeContent' );
     56
     57                // Iframe has loaded now, remove the ARIA busy state.
     58                $iframe.attr( 'aria-busy', 'false' );
     59
     60                // Get the iframe body.
     61                $iframeBody = $iframe.contents().find( 'body' );
     62
     63                /*
     64                 * Get the tabbable elements and handle the keydown event on first load.
     65                 */
     66                handleTabbables();
     67
     68                // Set initial focus on the "Close" button.
     69                $firstTabbable.focus();
     70
     71                /*
     72                 * When the "Install" button is disabled (e.g. the Plugin is already installed)
     73                 * then we can't predict where the last focusable element is. We need to get
     74                 * the tabbable elements and handle the keydown event again and again,
     75                 * each time the active tab panel changes.
     76                 */
     77                $( '#plugin-information-tabs a', $iframeBody ).on( 'click', function() {
     78                        handleTabbables();
     79                });
     80
     81                // Close the modal when pressing Escape.
     82                $iframeBody.on( 'keydown', function( event ) {
     83                        if ( 27 !== event.which ) {
     84                                return;
     85                        }
     86
     87                        tb_remove();
     88                        // Set focus back to the element that opened the modal dialog.
     89                        focusedBefore.focus();
     90                });
     91
     92                // Set focus back also when activating the Close button.
     93                $firstTabbable.on( 'click', function() {
     94                        focusedBefore.focus();
     95                });
     96        }
     97
     98        /*
     99         * Get the tabbable elements and detach/attach the keydown event.
     100         * Called after the iframe has fully loaded so we have all the elements we need.
     101         * Called again each time a Tab gets clicked.
     102         * @todo Consider to implement a WordPress general utility for this and don't use jQuery UI.
     103         */
     104        function handleTabbables() {
     105                var $firstAndLast;
     106                // Get all the tabbable elements.
     107                $tabbables = $( ':tabbable', $iframeBody );
     108                // Our first tabbable element is always the "Close" button.
     109                $firstTabbable = tbWindow.find( '#TB_closeWindowButton' );
     110                // Get the last tabbable element.
     111                $lastTabbable = $tabbables.last();
     112                // Make a jQuery collection.
     113                $firstAndLast = $firstTabbable.add( $lastTabbable );
     114                // Detach any previously attached keydown event.
     115                $firstAndLast.off( 'keydown.wp-plugin-details' );
     116                // Attach again the keydown event on the first and last focusable elements.
     117                $firstAndLast.on( 'keydown.wp-plugin-details', function( event ) {
     118                        constrainTabbing( event );
     119                });
     120        }
     121
     122        // Constrain tabbing within the plugin modal dialog.
     123        function constrainTabbing( event ) {
     124                if ( 9 !== event.which ) {
     125                        return;
     126                }
     127
     128                if ( $lastTabbable[0] === event.target && ! event.shiftKey ) {
     129                        event.preventDefault();
     130                        $firstTabbable.focus();
     131                } else if ( $firstTabbable[0] === event.target && event.shiftKey ) {
     132                        event.preventDefault();
     133                        $lastTabbable.focus();
     134                }
     135        }
     136
     137        // Open the Plugin details modal.
     138        $( '.thickbox.open-plugin-details-modal' ).on( 'click', function( e ) {
    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 = document.activeElement;
     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                tbWindow.find( '#TB_title' ).css({ 'background-color': '#23282d', 'color': '#cfcfcf' });
     154                tbWindow.find( '#TB_ajaxWindowTitle' ).html( '<strong>' + plugininstallL10n.plugin_information + '</strong>&nbsp;' + $( this ).data( 'title' ) );
     155                // Set title and ARIA busy state on the iframe.
     156                tbWindow.find( '#TB_iframeContent' ).attr({
     157                        'title': plugininstallL10n.plugin_information + ' ' + $( this ).data( 'title' ),
     158                        'aria-busy': 'true'
     159                });
    51160        });
    52161
    53162        /* Plugin install related JS */
  • src/wp-admin/update-core.php

     
    284284                $details_name = sprintf( '<span class="screen-reader-text">%1$s</span>', esc_attr( $plugin_data->Name ) );
    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                ?>
    290290                <tr>
  • src/wp-includes/js/thickbox/thickbox.css

     
    4343        float: right;
    4444}
    4545
    46 #TB_closeAjaxWindow {
    47         float: right;
     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;
    4859}
    4960
    50 #TB_closeAjaxWindow a {
    51         text-decoration: none;
    52 }
    53 
    5461#TB_ajaxWindowTitle {
    5562        float: left;
    5663        font-weight: 600;
     
    115122}
    116123
    117124.tb-close-icon {
     125        display: block;
    118126        color: #666;
    119127        text-align: center;
    120128        line-height: 29px;
     
    133141        -moz-osx-font-smoothing: grayscale;
    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}
  • src/wp-includes/js/thickbox/thickbox.js

     
    4141
    4242function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
    4343
     44        var $closeBtn;
     45
    4446        try {
    4547                if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
    4648                        jQuery("body","html").css({height: "100%", width: "100%"});
     
    137139
    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);
    143145
     
    202204                                        urlNoQuery = url.split('TB_');
    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
    211213                                        if(jQuery("#TB_window").css("visibility") != "visible"){
     
    259261                        });
    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
    264276        }
  • src/wp-includes/script-loader.php

     
    576576                        'saved' => __( 'Changes saved.' ),
    577577                ) );
    578578
    579                 $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), false, 1 );
     579                $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'jquery-ui-core', 'thickbox' ), false, 1 );
    580580                did_action( 'init' ) && $scripts->localize( 'plugin-install', 'plugininstallL10n', array(
    581                         'plugin_information' => __('Plugin Information:'),
     581                        'plugin_information' => __( 'Plugin:' ),
     582+                       'plugin_modal_label' => __( 'Plugin details' ),
    582583                        'ays' => __('Are you sure you want to install this plugin?')
    583584                ) );
    584585