Make WordPress Core

Changeset 33246


Ignore:
Timestamp:
07/13/2015 10:21:39 PM (7 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.

Location:
trunk/src
Files:
5 edited

Legend:

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

    r32051 r33246  
    122122    margin-bottom: 9px;
    123123    padding: 10px 20px 10px 0;
    124     border-bottom: 8px solid #fff;
    125124    font-size: 14px;
    126125    vertical-align: top
     
    172171.form-table.install-success td {
    173172    vertical-align: middle;
    174     padding: 16px 20px 10px 0;
     173    padding: 16px 20px 16px 0;
    175174}
    176175
     
    199198}
    200199
     200.wp-hide-pw > .dashicons {
     201    line-height: inherit;
     202}
     203
    201204#pass-strength-result {
    202205    background-color: #eee;
    203     border-color: #ddd !important;
    204     border-style: solid;
    205     border-width: 1px;
    206     margin: 5px 5px 5px 0;
    207     padding: 5px;
     206    border: 1px solid #ddd;
     207    -webkit-box-sizing: border-box;
     208    -moz-box-sizing: border-box;
     209    box-sizing: border-box;
     210    opacity: 0;
     211    padding: 3px 5px;
    208212    text-align: center;
    209     width: 200px;
    210     display: none;
     213    width: 218px;
     214}
     215
     216#pass-strength-result.short {
     217    background-color: #ffa0a0;
     218    border-color: #f04040;
     219    opacity: 1;
    211220}
    212221
    213222#pass-strength-result.bad {
    214223    background-color: #ffb78c;
    215     border-color: #ff853c !important;
     224    border-color: #ff853c;
     225    opacity: 1;
    216226}
    217227
    218228#pass-strength-result.good {
    219229    background-color: #ffec8b;
    220     border-color: #ffcc00 !important;
    221 }
    222 
    223 #pass-strength-result.short {
    224     background-color: #ffa0a0;
    225     border-color: #f04040 !important;
     230    border-color: #fc0;
     231    opacity: 1;
    226232}
    227233
    228234#pass-strength-result.strong {
    229235    background-color: #c3ff88;
    230     border-color: #8dff1c !important;
     236    border-color: #8dff1c;
     237    opacity: 1;
     238}
     239
     240[name="admin_password"].short {
     241    border-color: #f04040;
     242}
     243
     244[name="admin_password"].bad {
     245    border-color: #ff853c;
     246}
     247
     248[name="admin_password"].good {
     249    border-color: #fc0;
     250}
     251
     252[name="admin_password"].strong {
     253    border-color: #8dff1c;
     254}
     255
     256.pw-weak {
     257    display: none;
    231258}
    232259
     
    375402}
    376403
     404.button-secondary.hide-if-no-js,
     405.hide-if-no-js {
     406    display: none;
     407}
     408
    377409/**
    378410 * HiDPI Displays
  • 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>
  • trunk/src/wp-admin/user-edit.php

    r33137 r33246  
    484484    <th><?php _e( 'Confirm Password' ); ?></th>
    485485    <td>
    486         <label for="pw-weak">
    487             <input type="checkbox" name="pw-weak" class="pw-checkbox" id="pw-weak" />
     486        <label for="pw_weak">
     487            <input type="checkbox" name="pw_weak" class="pw-checkbox" id="pw-weak" />
    488488            <?php _e( 'Confirm use of weak password' ); ?>
    489489        </label>
  • trunk/src/wp-admin/user-new.php

    r33208 r33246  
    395395            <label for="pass1">
    396396                <?php _e( 'Password' ); ?>
    397                 <span class="description hide-if-js"><?php /* translators: password input field */_e( '(required)' ); ?></span>
     397                <span class="description hide-if-js"><?php _e( '(required)' ); ?></span>
    398398            </label>
    399399        </th>
     
    414414    </tr>
    415415    <tr class="form-field form-required user-pass2-wrap hide-if-js">
    416         <th scope="row"><label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php /* translators: password input field */_e('(required)'); ?></span></label></th>
     416        <th scope="row"><label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
    417417        <td>
    418418        <input name="pass2" type="password" id="pass2" autocomplete="off" />
     
    424424            <label for="pw-weak">
    425425                <input type="checkbox" name="pw-weak" class="pw-checkbox" id="pw-weak" />
    426                 <?php _e( 'Confirm use of weak password.' ); ?>
     426                <?php _e( 'Confirm use of weak password' ); ?>
    427427            </label>
    428428        </td>
  • trunk/src/wp-includes/pluggable.php

    r33233 r33246  
    21082108        $rnd_value .= sha1($rnd_value . $seed);
    21092109        $seed = md5($seed . $rnd_value);
    2110         if ( ! defined( 'WP_SETUP_CONFIG' ) )
    2111             set_transient('random_seed', $seed);
     2110        if ( ! defined( 'WP_SETUP_CONFIG' ) && ! defined( 'WP_INSTALLING' ) ) {
     2111            set_transient( 'random_seed', $seed );
     2112        }
    21122113    }
    21132114
Note: See TracChangeset for help on using the changeset viewer.