WordPress.org

Make WordPress Core

Ticket #28577: 28577.6.patch

File 28577.6.patch, 5.5 KB (added by johnbillion, 3 years ago)
  • src/wp-admin/includes/upgrade.php

     
    21932193} 
    21942194endif; 
    21952195 
     2196/** 
     2197 * Output the input fields for the language selection form on the installation screen. 
     2198 * 
     2199 * @since 4.0.0 
     2200 * 
     2201 * @see wp_get_available_translations_from_api() 
     2202 *  
     2203 * @param array $languages Array of available languages (populated via the Translations API). 
     2204 */ 
    21962205function wp_install_language_form( $languages ) { 
    2197         echo "<fieldset>\n"; 
    2198         echo "<legend class='screen-reader-text'>Select a default language</legend>\n"; 
    2199         echo '<input type="radio" checked="checked" class="screen-reader-input language-chooser-input" name="language" id="language_default" value="">'; 
    2200         echo '<label for="language_default" lang="en">English (United States)</label>'; 
     2206        echo "<label class='screen-reader-text' for='language'>Select a default language</label>\n"; 
     2207        echo "<select size='10' name='language' id='language'>\n"; 
     2208        echo '<option value="" lang="en" selected="selected">English (United States)</option>'; 
    22012209        echo "\n"; 
    22022210 
    22032211        if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && ( 'en_US' !== WPLANG ) ) { 
    22042212                if ( isset( $languages[ WPLANG ] ) ) { 
    22052213                        $language = $languages[ WPLANG ]; 
    2206                         echo '<input type="radio" name="language" checked="checked" class="' . esc_attr( $language['language'] ) . ' screen-reader-input" id="language_wplang" value="' . esc_attr( $language['language'] ) . '">'; 
    2207                         echo '<label for="language_wplang" lang="' . esc_attr( $language['iso'][1] ) . '">' . esc_html( $language['native_name'] ) . "</label>\n"; 
     2214                        echo '<option value="' . esc_attr( $language['language'] ) . '" lang="' . esc_attr( $language['iso'][1] ) . '" class="language_' . esc_attr( $language['language'] ) . '" selected="selected">' . esc_html( $language['native_name'] ) . "</option>\n"; 
    22082215                } 
    22092216        } 
    22102217 
    22112218        foreach ( $languages as $language ) { 
    2212                 echo '<input type="radio" name="language" class="' . esc_attr( $language['language'] ) . ' screen-reader-input language-chooser-input" id="language_'. esc_attr( $language['language'] ) .'" value="' . esc_attr( $language['language'] ) . '">'; 
    2213                 echo '<label for="language_' . esc_attr( $language['language'] ) . '" lang="' . esc_attr( $language['iso'][1] ) . '">' . esc_html( $language['native_name'] ) . "</label>\n"; 
     2219                echo '<option value="' . esc_attr( $language['language'] ) . '" lang="' . esc_attr( $language['iso'][1] ) . '" class="language_' . esc_attr( $language['language'] ) . '">' . esc_html( $language['native_name'] ) . "</option>\n"; 
    22142220        } 
    2215         echo "</fieldset>\n"; 
     2221        echo "</select>\n"; 
    22162222        echo '<p class="step"><span class="spinner"></span><input type="submit" class="button button-primary button-hero" value="&raquo;" /></p>'; 
    22172223} 
    22182224 
  • src/wp-admin/js/language-chooser.js

     
    1 (function($){ 
    2         if ( $('body').hasClass('language-chooser') === false ) { 
    3                 return; 
    4         } 
    51 
    6         var mouseDown = 0, 
    7                 $fieldset = $('fieldset'); 
    8  
    9         // simple way to check if mousebutton is depressed while accounting for multiple mouse buttons being used independently 
    10         document.body.onmousedown = function() { 
    11                 ++mouseDown; 
    12         }; 
    13         document.body.onmouseup = function() { 
    14                 --mouseDown; 
    15         }; 
    16  
    17         /* 
    18                 we can't rely upon the focusout event 
    19                 since clicking on a label triggers it 
    20         */ 
    21         function maybeRemoveFieldsetFocus(){ 
    22                 if (mouseDown) { 
    23                         setTimeout( maybeRemoveFieldsetFocus, 50); 
    24                         return; 
    25                 } 
    26                 if ( $(':focus').hasClass('language-chooser-input') !== true ) { 
    27                         $fieldset.removeClass('focus'); 
    28                 } 
    29         } 
    30  
    31         $fieldset.focusin( function() { 
    32                 $(this).addClass('focus'); 
    33         }); 
    34  
    35         $fieldset.focusout( function() { 
    36                 setTimeout( maybeRemoveFieldsetFocus, 50); 
    37         }); 
    38  
    39         $('form').submit(function(){ 
    40                 $(this).find('.step .spinner').css('visibility','visible'); 
    41         }); 
    42  
    43 })(jQuery); 
     2/* nothing here currently */ 
  • src/wp-admin/css/install.css

     
    320320        max-width: 300px; 
    321321} 
    322322 
    323 .language-chooser fieldset { 
    324         margin: 1px; 
     323.language-chooser select { 
    325324        padding: 8px; 
     325        width: 100%; 
    326326        display: block; 
    327327        border: 1px solid #ddd; 
    328         -webkit-border-radius: 0; 
    329         border-radius: 0; /* Reset mobile webkit's default element styling */ 
    330         -webkit-transition: .05s border-color ease-in-out; 
    331         transition: .05s border-color ease-in-out; 
    332         outline: 0; 
    333         -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.07); 
    334         box-shadow: inset 0 1px 2px rgba(0,0,0,0.07); 
    335328        background-color: #fff; 
    336329        color: #333; 
    337330        font-size: 16px; 
    338         font-family: inherit; 
    339         font-weight: inherit; 
    340         overflow-y: scroll; 
    341         height: 250px; 
    342 } 
    343  
    344 .language-chooser fieldset.focus { 
    345         border-color: #5b9dd9; 
    346         -webkit-box-shadow: 0 0 2px rgba(30,140,190,0.8); 
    347         box-shadow: 0 0 2px rgba(30,140,190,0.8); 
     331        font-family: Arial, sans-serif; 
     332        font-weight: normal; 
    348333} 
    349334 
    350335.wp-core-ui.language-chooser .button.button-hero { 
     
    356341        text-align: right; 
    357342} 
    358343 
    359 .language-chooser input:checked + label{ 
    360           color:white; 
    361           background: #777; 
    362 } 
    363  
    364 .language-chooser .focus input:checked + label{ 
    365           background: #0074A2; 
    366 } 
    367  
    368 .language-chooser label:hover { 
    369           background: #eee; 
    370 } 
    371  
    372 .language-chooser label{ 
    373         display:block; 
    374 } 
    375  
    376344.screen-reader-input, 
    377345.screen-reader-text { 
    378346        position: absolute;