WordPress.org

Make WordPress Core

Changeset 15782


Ignore:
Timestamp:
10/12/2010 09:37:01 PM (11 years ago)
Author:
scribu
Message:

first pass at strength indicator on password reset. see #5919

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/login.css

    r15643 r15782  
    1 *{margin:0;padding:0;}body{padding-top:30px;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog{position:absolute;top:0;left:0;border-bottom:#c6c6c6 1px solid;background:#d9d9d9;background:-moz-linear-gradient(bottom,#d7d7d7,#e4e4e4);background:-webkit-gradient(linear,left bottom,left top,from(#d7d7d7),to(#e4e4e4));height:30px;width:100%;}#backtoblog a{text-decoration:none;display:block;padding:8px 0 0 15px;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}body form .input{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;}
     1*{margin:0;padding:0;}body{padding-top:30px;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog{position:absolute;top:0;left:0;border-bottom:#c6c6c6 1px solid;background:#d9d9d9;background:-moz-linear-gradient(bottom,#d7d7d7,#e4e4e4);background:-webkit-gradient(linear,left bottom,left top,from(#d7d7d7),to(#e4e4e4));height:30px;width:100%;}#backtoblog a{text-decoration:none;display:block;padding:8px 0 0 15px;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}body form .input{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;}#pass-strength-result{font-weight:bold;border-style:solid;border-width:1px;margin:12px 0 6px;padding:6px 5px;text-align:center;}
  • trunk/wp-admin/css/login.dev.css

    r15643 r15782  
    136136    clear: both;
    137137}
     138
     139#pass-strength-result {
     140    font-weight: bold;
     141    border-style: solid;
     142    border-width: 1px;
     143    margin: 12px 0 6px;
     144    padding: 6px 5px;
     145    text-align: center;
     146}
     147
  • trunk/wp-includes/script-loader.php

    r15780 r15782  
    478478    $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20100424' );
    479479    $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
    480     $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20100922' );
     480    $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20101012' );
    481481    $styles->add( 'plugin-install', "/wp-admin/css/plugin-install$suffix.css", array(), '20100402' );
    482482    $styles->add( 'theme-install', "/wp-admin/css/theme-install$suffix.css", array(), '20100523' );
  • trunk/wp-login.php

    r15781 r15782  
    335335}
    336336
     337// TODO: Eliminate duplicated code from wp_default_scripts()
     338function load_password_strength_meter() {
     339    if ( !$guessurl = site_url() )
     340        $guessurl = wp_guess_url();
     341
     342    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
     343
     344    wp_enqueue_script( 'user-profile', $guessurl . "/wp-admin/js/user-profile$suffix.js", array('jquery'), '20100331' );
     345    wp_localize_script( 'user-profile', 'pwsL10n', array(
     346        'empty' => __('Strength indicator'),
     347        'short' => __('Very weak'),
     348        'bad' => __('Weak'),
     349        /* translators: password strength */
     350        'good' => _x('Medium', 'password strength'),
     351        'strong' => __('Strong'),
     352        'mismatch' => __('Mismatch'),
     353        'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'
     354    ) );
     355
     356    wp_print_scripts( array('user-profile') );
     357}
     358
    337359//
    338360// Main
     
    446468    }
    447469
    448     login_header(__('Reset Password'), '<p class="message reset-pass">' . __('Reset your password') . '</p>', $errors );
     470    login_header(__('Reset Password'), '<p class="message reset-pass">' . __('Enter your new password below.') . '</p>', $errors );
     471
     472    load_password_strength_meter();
    449473
    450474?>
    451475<form name="resetpassform" id="resetpassform" action="<?php echo site_url('wp-login.php?action=resetpass&key=' . urlencode($_GET['key']) . '&login=' . urlencode($_GET['login']), 'login_post') ?>" method="post">
     476    <input type="hidden" id="user_login" value="<?php echo esc_attr( $_GET['login'] ); ?>" autocomplete="off" />
     477
    452478    <p>
    453         <label><?php _e('New Password') ?><br />
    454         <input type="password" name="pass1" id="user_pass" class="input" size="20" value="" autocomplete="off" /></label>
     479        <label><?php _e('New password') ?><br />
     480        <input type="password" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" /></label>
    455481    </p>
    456482    <p>
    457         <label><?php _e('New Password Again') ?><br />
    458         <input type="password" name="pass2" id="user_pass" class="input" size="20" value="" autocomplete="off" /></label>
     483        <label><?php _e('Confirm new password') ?><br />
     484        <input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" /></label>
    459485    </p>
     486
     487    <div id="pass-strength-result" class="hide-if-no-js"><?php _e('Strength indicator'); ?></div>
     488    <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).'); ?></p>
    460489
    461490    <br class="clear" />
Note: See TracChangeset for help on using the changeset viewer.