Make WordPress Core

Ticket #33305: 33305.4.patch

File 33305.4.patch, 24.0 KB (added by azaozz, 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

     
    28142814        display: none;
    28152815}
    28162816
    2817 body.about-php .tb-close-icon,
    2818 body.plugin-install-php .tb-close-icon,
    2819 body.import-php .tb-close-icon,
    2820 body.plugins-php .tb-close-icon,
    2821 body.update-core-php .tb-close-icon,
    2822 body.index-php .tb-close-icon {
     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 {
    28232824        left: auto;
    28242825        right: -30px;
    28252826        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;
    28282827}
    28292828
     2829
     2830body.about-php #TB_closeWindowButton:hover,
    28302831body.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,
     2832body.plugin-install-php #TB_closeWindowButton:hover,
    28342833body.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,
     2834body.import-php #TB_closeWindowButton:hover,
    28382835body.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,
     2836body.plugins-php #TB_closeWindowButton:hover,
    28422837body.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,
     2838body.update-core-php #TB_closeWindowButton:hover,
    28462839body.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 {
     2840body.index-php #TB_closeWindowButton:hover,
     2841body.index-php #TB_closeWindowButton:focus {
    28542842        color: #00a0d2;
    28552843        outline: none;
    28562844        -webkit-box-shadow: none;
     
    28572845        box-shadow: none;
    28582846}
    28592847
    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 {
     2848body.about-php .tb-close-icon,
     2849body.plugin-install-php .tb-close-icon,
     2850body.import-php .tb-close-icon,
     2851body.plugins-php .tb-close-icon,
     2852body.update-core-php .tb-close-icon,
     2853body.index-php .tb-close-icon {
     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;
    28802880        }
  • src/wp-admin/import.php

     
    101101                        if ( empty($action) ) {
    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 {
    107107                                        $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'];
     
    504504                        <div class="plugin-card-top">
    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="">
    510510                                                </a>
  • src/wp-admin/includes/class-wp-plugins-list-table.php

     
    742742
    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' ) ),
    748748                                                        esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),
  • src/wp-admin/includes/dashboard.php

     
    12451245
    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>';
    12511251
  • src/wp-admin/includes/update.php

     
    339339
    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 ),
    345345                                /* translators: 1: plugin name, 2: version number */
     
    348348                        );
    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 ),
    354354                                /* translators: 1: plugin name, 2: version number */
     
    357357                        );
    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 ),
    363363                                /* translators: 1: plugin name, 2: version number */
     
    478478                );
    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 ),
    484484                        /* translators: 1: theme name, 2: version number */
  • 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        /*
     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
    53157        /* 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        }
     
    273285function tb_remove() {
    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();
    279294        if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
  • src/wp-includes/script-loader.php

     
    580580                        'saved' => __( 'Changes saved.' ),
    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                ) );
    588589