diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index a8e0aad6be..c32cb019a9 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -211,6 +211,11 @@ add_action( 'wp_footer', 'wp_print_footer_scripts' ); add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); +// Login actions +add_action( 'login_head', 'wp_enqueue_scripts', 1 ); +add_action( 'login_head', 'wp_print_head_scripts', 9 ); +add_action( 'login_footer', 'wp_print_footer_scripts' ); + // Feed Generator Tags foreach ( array( 'rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head' ) as $action ) { add_action( $action, 'the_generator' ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 9a37af0664..6f1c09015c 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -239,6 +239,22 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.1' ); $scripts->add_data( 'imgareaselect', 'group', 1 ); + $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20101027' ); + $scripts->add_data( 'password-strength-meter', 'group', 1 ); + $scripts->localize( 'password-strength-meter', 'pwsL10n', array( + 'empty' => __('Strength indicator'), + 'short' => __('Very weak'), + 'bad' => __('Weak'), + /* translators: password strength */ + 'good' => _x('Medium', 'password strength'), + 'strong' => __('Strong'), + 'mismatch' => __('Mismatch'), + 'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};' + ) ); + + $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20100925' ); + $scripts->add_data( 'user-profile', 'group', 1 ); + if ( is_admin() ) { $scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' ); $scripts->add_data( 'ajaxcat', 'group', 1 ); @@ -262,22 +278,6 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' ); $scripts->add_data( 'admin-custom-fields', 'group', 1 ); - $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20101027' ); - $scripts->add_data( 'password-strength-meter', 'group', 1 ); - $scripts->localize( 'password-strength-meter', 'pwsL10n', array( - 'empty' => __('Strength indicator'), - 'short' => __('Very weak'), - 'bad' => __('Weak'), - /* translators: password strength */ - 'good' => _x('Medium', 'password strength'), - 'strong' => __('Strong'), - 'mismatch' => __('Mismatch'), - 'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};' - ) ); - - $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20100925' ); - $scripts->add_data( 'user-profile', 'group', 1 ); - $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'list-table', 'jquery-ui-resizable', 'quicktags'), '20100818' ); $scripts->add_data( 'admin-comments', 'group', 1 ); $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( diff --git a/wp-login.php b/wp-login.php index 979b7955d8..9a31e84447 100644 --- a/wp-login.php +++ b/wp-login.php @@ -134,7 +134,7 @@ if(typeof wpOnload=='function')wpOnload(); } ?>

- + __('Strength indicator'), - 'short' => __('Very weak'), - 'bad' => __('Weak'), - /* translators: password strength */ - 'good' => _x('Medium', 'password strength'), - 'strong' => __('Strong'), - 'mismatch' => __('Mismatch'), - 'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};' - ) ); - - wp_print_scripts( array('user-profile') ); -} - // // Main // @@ -468,9 +445,10 @@ case 'rp' : exit; } - login_header(__('Reset Password'), '

' . __('Enter your new password below.') . '

', $errors ); + wp_enqueue_script('utils'); + wp_enqueue_script('user-profile'); - load_password_strength_meter(); + login_header(__('Reset Password'), '

' . __('Enter your new password below.') . '

', $errors ); ?>