Changeset 6419
- Timestamp:
- 12/19/2007 09:53:10 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
wp-admin/profile.php (modified) (3 diffs)
-
wp-admin/wp-admin.css (modified) (1 diff)
-
wp-includes/script-loader.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/profile.php
r5689 r6419 1 1 <?php 2 2 require_once('admin.php'); 3 4 function profile_js ( ) { 5 ?> 6 <script type="text/javascript"> 7 function check_pass_strength ( ) { 8 9 var pass = jQuery('#pass1').val(); 10 var user = jQuery('#user_login').val(); 11 12 // get the result as an object, i'm tired of typing it 13 var res = jQuery('#pass-strength-result'); 14 15 var strength = passwordStrength(pass, user); 16 17 jQuery(res).removeClass('short bad good strong'); 18 19 if ( strength == 'Bad' ) { 20 jQuery(res).addClass('bad'); 21 jQuery(res).html( pwsL10n.bad ); 22 } 23 else if ( strength == 'Good' ) { 24 jQuery(res).addClass('good'); 25 jQuery(res).html( pwsL10n.good ); 26 } 27 else if ( strength == 'Strong' ) { 28 jQuery(res).addClass('strong'); 29 jQuery(res).html( pwsL10n.strong ); 30 } 31 else { 32 // this catches 'Too short' and the off chance anything else comes along 33 jQuery(res).addClass('short'); 34 jQuery(res).html( pwsL10n.short ); 35 } 36 37 } 38 39 jQuery(document).ready( function() { jQuery('#pass1').keyup( check_pass_strength ) } ); 40 </script> 41 <?php 42 } 43 44 add_action('admin_head', 'profile_js'); 45 46 wp_enqueue_script('jquery'); 47 wp_enqueue_script('password-strength-meter'); 3 48 4 49 $title = __('Profile'); … … 43 88 <legend><?php _e('Name'); ?></legend> 44 89 <p><label><?php _e('Username: (no editing)'); ?><br /> 45 <input type="text" name="user_login" value="<?php echo $profileuser->user_login; ?>" disabled="disabled" />90 <input type="text" name="user_login" id="user_login" value="<?php echo $profileuser->user_login; ?>" disabled="disabled" /> 46 91 </label></p> 47 92 … … 115 160 <input type="password" name="pass2" id="pass2" size="16" value="" /> 116 161 </label></p> 162 <p><strong><?php _e('Password Strength:'); ?></strong></p> 163 <div id="pass-strength-result"><?php _e('Too short'); ?></div> 164 <!--[if IE 6]><div id="pass-strength-iesucks"><?php _e("If you weren’t using this sucky IE6, there would be pretty colors... and cookies!"); ?></div><![endif]--> 165 <p><?php _e('Hint: Use upper and lower case characters, numbers and symbols like !"£$%^&( in your password.'); ?></p> 117 166 </fieldset> 118 167 <?php endif; ?> -
trunk/wp-admin/wp-admin.css
r6303 r6419 1357 1357 color: #036; 1358 1358 } 1359 1360 #pass-strength-result { 1361 padding: 3px 5px 3px 5px; 1362 margin-top: 3px; 1363 text-align: center; 1364 background-color: #e3e3e3; 1365 border: 1px solid #000000; 1366 } 1367 1368 #pass-strength-result.short { 1369 background-color: #e3e3e3; 1370 border: 1px solid #000000; 1371 } 1372 1373 #pass-strength-result.bad { 1374 background-color: #ffeff7; 1375 border: 1px solid #cc6699; 1376 } 1377 1378 #pass-strength-result.good { 1379 background-color: #effff4; 1380 border: 1px solid #66cc87; 1381 } 1382 1383 #pass-strength-result.strong { 1384 background-color: #59ef86; 1385 border: 1px solid #319f52; 1386 } 1387 1388 #pass-strength-iesucks { 1389 font-size: 8pt; 1390 text-align: center; 1391 } -
trunk/wp-includes/script-loader.php
r6312 r6419 118 118 $this->add( 'admin-categories', '/wp-admin/js/categories.js', array('wp-lists'), '20071031' ); 119 119 $this->add( 'admin-custom-fields', '/wp-admin/js/custom-fields.js', array('wp-lists'), '20070823' ); 120 $this->add( 'password-strength-meter', '/wp-admin/js/passwordStrengthMeter.js', array('jquery'), '20070405' ); 121 $this->localize( 'password-strength-meter', 'pwsL10n', array( 122 'short' => __('Too short'), 123 'bad' => __('Bad'), 124 'good' => __('Good'), 125 'strong' => __('Strong') 126 ) ); 120 127 $this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20071104' ); 121 128 $this->add( 'admin-posts', '/wp-admin/js/edit-posts.js', array('wp-lists'), '20071023' );
Note: See TracChangeset
for help on using the changeset viewer.