Ticket #28577: 28577.6.patch
File 28577.6.patch, 5.5 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/upgrade.php
2193 2193 } 2194 2194 endif; 2195 2195 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 */ 2196 2205 function 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>'; 2201 2209 echo "\n"; 2202 2210 2203 2211 if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && ( 'en_US' !== WPLANG ) ) { 2204 2212 if ( isset( $languages[ WPLANG ] ) ) { 2205 2213 $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"; 2208 2215 } 2209 2216 } 2210 2217 2211 2218 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"; 2214 2220 } 2215 echo "</ fieldset>\n";2221 echo "</select>\n"; 2216 2222 echo '<p class="step"><span class="spinner"></span><input type="submit" class="button button-primary button-hero" value="»" /></p>'; 2217 2223 } 2218 2224 -
src/wp-admin/js/language-chooser.js
1 (function($){2 if ( $('body').hasClass('language-chooser') === false ) {3 return;4 }5 1 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
320 320 max-width: 300px; 321 321 } 322 322 323 .language-chooser fieldset { 324 margin: 1px; 323 .language-chooser select { 325 324 padding: 8px; 325 width: 100%; 326 326 display: block; 327 327 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);335 328 background-color: #fff; 336 329 color: #333; 337 330 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; 348 333 } 349 334 350 335 .wp-core-ui.language-chooser .button.button-hero { … … 356 341 text-align: right; 357 342 } 358 343 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 376 344 .screen-reader-input, 377 345 .screen-reader-text { 378 346 position: absolute;