Make WordPress Core

Changeset 33033


Ignore:
Timestamp:
07/01/2015 06:12:04 PM (9 years ago)
Author:
markjaquith
Message:

Slow down on calling zxcvbn if it isn't loaded.

see #32589

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/user-profile.js

    r33031 r33033  
    1717        ;
    1818
    19         var generatePassword = function() {
    20             pw_field.val( pw_field.data( 'pw' ) );
    21             pw_field.trigger( 'propertychange' );
    22             pw_field.attr( 'type', 'text' ).focus();
    23             pw_field[0].setSelectionRange(100, 100);
     19        var generatePassword = window.generatePassword = function() {
     20            if ( typeof zxcvbn !== 'function' ) {
     21                setTimeout( generatePassword, 50 );
     22            } else {
     23                pw_field.val( pw_field.data( 'pw' ) );
     24                pw_field.trigger( 'propertychange' );
     25                pw_field.attr( 'type', 'text' ).focus();
     26                pw_field[0].setSelectionRange(100, 100);
     27            }
    2428        };
    2529
  • trunk/src/wp-admin/user-new.php

    r33023 r33033  
    403403            <div class="wp-pwd hide-if-js">
    404404                <?php $initial_password = wp_generate_password( 24 ); ?>
    405                 <input type="password" name="pass1" id="pass1" class="regular-text" value="<?php echo esc_attr( $initial_password ); ?>" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" />
     405                <input type="password" name="pass1" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" />
    406406                <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0">
    407407                    <span class="dashicons dashicons-visibility"></span>
Note: See TracChangeset for help on using the changeset viewer.