Changeset 26266
- Timestamp:
- 11/19/2013 04:39:05 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/user-profile.js
r26137 r26266 1 /* global ajaxurl, pwsL10n, svgPainter */ 1 2 (function($){ 2 3 3 4 function check_pass_strength() { 4 var pass1 = $('#pass1').val(), user = $('#user_login').val(),pass2 = $('#pass2').val(), strength;5 var pass1 = $('#pass1').val(), pass2 = $('#pass2').val(), strength; 5 6 6 7 $('#pass-strength-result').removeClass('short bad good strong'); … … 14 15 switch ( strength ) { 15 16 case 2: 16 $('#pass-strength-result').addClass('bad').html( pwsL10n ['bad']);17 $('#pass-strength-result').addClass('bad').html( pwsL10n.bad ); 17 18 break; 18 19 case 3: 19 $('#pass-strength-result').addClass('good').html( pwsL10n ['good']);20 $('#pass-strength-result').addClass('good').html( pwsL10n.good ); 20 21 break; 21 22 case 4: 22 $('#pass-strength-result').addClass('strong').html( pwsL10n ['strong']);23 $('#pass-strength-result').addClass('strong').html( pwsL10n.strong ); 23 24 break; 24 25 case 5: 25 $('#pass-strength-result').addClass('short').html( pwsL10n ['mismatch']);26 $('#pass-strength-result').addClass('short').html( pwsL10n.mismatch ); 26 27 break; 27 28 default: … … 31 32 32 33 $(document).ready( function() { 33 var select = $('#display_name'); 34 var $colorpicker, $stylesheet, user_id, current_user_id, 35 select = $( '#display_name' ); 34 36 35 37 $('#pass1').val('').keyup( check_pass_strength ); … … 51 53 52 54 if ( inputs.display_firstname && inputs.display_lastname ) { 53 inputs ['display_firstlast']= inputs.display_firstname + ' ' + inputs.display_lastname;54 inputs ['display_lastfirst']= inputs.display_lastname + ' ' + inputs.display_firstname;55 inputs.display_firstlast = inputs.display_firstname + ' ' + inputs.display_lastname; 56 inputs.display_lastfirst = inputs.display_lastname + ' ' + inputs.display_firstname; 55 57 } 56 58 … … 60 62 61 63 $.each(inputs, function( id, value ) { 62 if ( ! value ) 64 if ( ! value ) { 63 65 return; 66 } 64 67 65 68 var val = value.replace(/<\/?[a-z][^>]*>/gi, ''); 66 69 67 if ( inputs[id].length && $.inArray( val, dub ) == -1 ) {70 if ( inputs[id].length && $.inArray( val, dub ) === -1 ) { 68 71 dub.push(val); 69 72 $('<option />', { … … 75 78 } 76 79 77 var $colorpicker = $( '#color-picker' ),78 $stylesheet = $( '#colors-css' ),79 user_id = $( 'input#user_id' ).val(),80 80 $colorpicker = $( '#color-picker' ); 81 $stylesheet = $( '#colors-css' ); 82 user_id = $( 'input#user_id' ).val(); 83 current_user_id = $( 'input[name="checkuser_id"]' ).val(); 81 84 82 85 // dropdown toggle … … 90 93 91 94 // update selected 92 $( this ).siblings( '.selected' ).removeClass( 'selected' ) 95 $( this ).siblings( '.selected' ).removeClass( 'selected' ); 93 96 $( this ).addClass( 'selected' ); 94 97 $( this ).find( 'input' ).prop( 'checked', true ); … … 100 103 101 104 // preview/save color scheme 102 if ( user_id == current_user_id ) {105 if ( user_id === current_user_id ) { 103 106 104 107 // repaint icons
Note: See TracChangeset
for help on using the changeset viewer.