| [ XREF Home ] [ Index ] |
PHP Cross Reference of WordPress TrunkProvided by Yoast |
[Summary view] [Print] [Text view]
1 (function($){ 2 3 function check_pass_strength() { 4 var pass1 = $('#pass1').val(), user = $('#user_login').val(), pass2 = $('#pass2').val(), strength; 5 6 $('#pass-strength-result').removeClass('short bad good strong'); 7 if ( ! pass1 ) { 8 $('#pass-strength-result').html( pwsL10n.empty ); 9 return; 10 } 11 12 strength = passwordStrength(pass1, user, pass2); 13 14 switch ( strength ) { 15 case 2: 16 $('#pass-strength-result').addClass('bad').html( pwsL10n['bad'] ); 17 break; 18 case 3: 19 $('#pass-strength-result').addClass('good').html( pwsL10n['good'] ); 20 break; 21 case 4: 22 $('#pass-strength-result').addClass('strong').html( pwsL10n['strong'] ); 23 break; 24 case 5: 25 $('#pass-strength-result').addClass('short').html( pwsL10n['mismatch'] ); 26 break; 27 default: 28 $('#pass-strength-result').addClass('short').html( pwsL10n['short'] ); 29 } 30 } 31 32 $(document).ready(function() { 33 $('#pass1').val('').keyup( check_pass_strength ); 34 $('#pass2').val('').keyup( check_pass_strength ); 35 $('#pass-strength-result').show(); 36 $('.color-palette').click(function(){$(this).siblings('input[name="admin_color"]').prop('checked', true)}); 37 $('#first_name, #last_name, #nickname').blur(function(){ 38 var select = $('#display_name'), current = select.find('option:selected').attr('id'), dub = [], 39 inputs = { 40 display_nickname : $('#nickname').val(), 41 display_username : $('#user_login').val(), 42 display_firstname : $('#first_name').val(), 43 display_lastname : $('#last_name').val() 44 }; 45 46 if ( inputs.display_firstname && inputs.display_lastname ) { 47 inputs['display_firstlast'] = inputs.display_firstname + ' ' + inputs.display_lastname; 48 inputs['display_lastfirst'] = inputs.display_lastname + ' ' + inputs.display_firstname; 49 } 50 51 $('option', select).remove(); 52 $.each(inputs, function( id, value ) { 53 var selected; 54 55 if ( inputs[id].length && $.inArray( value, dub ) == -1 ) { 56 dub.push(value); 57 selected = id == current ? 'selected="selected"' : ''; 58 select.append('<option id="' + id + '" ' + selected + '">' + value + '</option>'); 59 } 60 }); 61 }); 62 }); 63 64 })(jQuery);
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jun 1 08:30:02 2011 |
Cross-referenced by PHPXref 0.7 Provided by Yoast and awesome WordPress Hosting |