Make WordPress Core


Ignore:
Timestamp:
07/13/2015 10:21:39 PM (9 years ago)
Author:
obenland
Message:

Passwords: New UI for install screen.

Also synchronises the use of pw_weak as an input name and removes trailing
periods from checkbox labels.

Props MikeHansenMe, adamsilverstein, obenland.
See #32589.

File:
1 edited

Legend:

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

    r32715 r33246  
    7272    <title><?php _e( 'WordPress &rsaquo; Installation' ); ?></title>
    7373    <?php
    74     wp_admin_css( 'install', true );
     74        wp_admin_css( 'install', true );
     75        wp_admin_css( 'dashicons', true );
    7576    ?>
    7677</head>
     
    129130        </tr>
    130131        <?php if ( ! $user_table ) : ?>
    131         <tr>
     132        <tr class="form-field form-required user-pass1-wrap">
    132133            <th scope="row">
    133                 <label for="pass1"><?php _e('Password, twice'); ?></label>
    134                 <p><?php _e('A password will be automatically generated for you if you leave this blank.'); ?></p>
     134                <label for="pass1">
     135                    <?php _e( 'Password' ); ?>
     136                    <span class="description hide-if-js"><?php _e( '(required)' ); ?></span>
     137                </label>
    135138            </th>
    136139            <td>
    137                 <input name="admin_password" type="password" id="pass1" size="25" value="" />
    138                 <p><input name="admin_password2" type="password" id="pass2" size="25" value="" /></p>
    139                 <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
    140                 <p><?php echo wp_get_password_hint(); ?></p>
     140                <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>
     141                <div class="wp-pwd hide-if-js">
     142                    <?php $initial_password = wp_generate_password( 24 ); ?>
     143                    <input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" />
     144                    <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0">
     145                        <span class="dashicons dashicons-visibility"></span>
     146                        <span class="text">hide</span>
     147                    </button>
     148                    <div id="pass-strength-result"></div>
     149                </div>
     150                <p><span class="description hide-if-no-js"><?php _e( 'A password reset link will be sent to you via email.' ); ?></span></p>
     151            </td>
     152        </tr>
     153        <tr class="form-field form-required user-pass2-wrap hide-if-js">
     154            <th scope="row">
     155                <label for="pass2"><?php _e( 'Repeat Password' ); ?>
     156                    <span class="description"><?php _e( '(required)' ); ?></span>
     157                </label>
     158            </th>
     159            <td>
     160                <input name="admin_password2" type="password" id="pass2" autocomplete="off" />
     161            </td>
     162        </tr>
     163        <tr class="pw-weak">
     164            <th scope="row"><?php _e( 'Confirm Password' ); ?></th>
     165            <td>
     166                <label>
     167                    <input type="checkbox" name="pw_weak" class="pw-checkbox" />
     168                    <?php _e( 'Confirm use of weak password' ); ?>
     169                </label>
    141170            </td>
    142171        </tr>
     
    149178        <tr>
    150179            <th scope="row"><?php _e( 'Privacy' ); ?></th>
    151             <td colspan="2"><label><input type="checkbox" name="blog_public" id="blog_public" value="1" <?php checked( $blog_public ); ?> /> <?php _e( 'Allow search engines to index this site.' ); ?></label></td>
     180            <td colspan="2"><label><input type="checkbox" name="blog_public" id="blog_public" value="1" <?php checked( $blog_public ); ?> /> <?php _e( 'Allow search engines to index this site' ); ?></label></td>
    152181        </tr>
    153182    </table>
    154     <p class="step"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Install WordPress' ); ?>" class="button button-large" /></p>
     183    <p class="step"><?php submit_button( __( 'Install WordPress' ), 'large', 'Submit', false, array( 'id' => 'submit' ) ); ?></p>
    155184    <input type="hidden" name="language" value="<?php echo isset( $_REQUEST['language'] ) ? esc_attr( $_REQUEST['language'] ) : ''; ?>" />
    156185</form>
     
    324353<?php wp_print_scripts( 'user-profile' ); ?>
    325354<?php wp_print_scripts( 'language-chooser' ); ?>
     355<script type="text/javascript">
     356jQuery( function( $ ) {
     357    $( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' );
     358} );
     359</script>
    326360</body>
    327361</html>
Note: See TracChangeset for help on using the changeset viewer.