Make WordPress Core

Changeset 15780 for trunk/wp-login.php


Ignore:
Timestamp:
10/12/2010 08:29:19 PM (16 years ago)
Author:
scribu
Message:

move password-strength-meter.js into user-profile.js. See #5919

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-login.php

    r15776 r15780  
    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( 'password-strength-meter', $guessurl . "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20100331' );
     345    wp_localize_script( 'password-strength-meter', '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('password-strength-meter') );
     357}
     358
    337359//
    338360// Main
     
    385407case 'lostpassword' :
    386408case 'retrievepassword' :
     409
    387410    if ( $http_post ) {
    388411        $errors = retrieve_password();
     
    446469
    447470    login_header(__('Reset Password'), '<p class="message reset-pass">' . __('Reset your password') . '</p>', $errors );
     471
     472    load_password_strength_meter();
     473
    448474?>
    449475<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">
     
    456482        <input type="password" name="pass2" id="user_pass" class="input" size="20" value="" autocomplete="off" /></label>
    457483    </p>
     484
     485    <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
     486    <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>
     487
    458488    <br class="clear" />
    459489    <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Reset Password'); ?>" tabindex="100" /></p>
Note: See TracChangeset for help on using the changeset viewer.