Changeset 33465
- Timestamp:
- 07/28/2015 09:10:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/user-profile.js
r33450 r33465 28 28 function bindPass1() { 29 29 var passStrength = $('#pass-strength-result')[0]; 30 var currentPass = $pass1.val(); 30 31 31 32 $pass1Wrap = $pass1.parent(); … … 51 52 52 53 $pass1.on( 'input propertychange', function () { 53 setTimeout( function () { 54 $pass1Text.val( $pass1.val() ); 55 $pass1.add( $pass1Text ).removeClass( 'short bad good strong' ); 56 57 if ( passStrength.className ) { 58 $pass1.add( $pass1Text ).addClass( passStrength.className ); 59 if ( 'short' === passStrength.className || 'bad' === passStrength.className ) { 60 if ( ! $weakCheckbox.prop( 'checked' ) ) { 61 $submitButtons.prop( 'disabled', true ); 62 } 63 $weakRow.show(); 64 } else { 65 $submitButtons.prop( 'disabled', false ); 66 $weakRow.hide(); 67 } 68 } 69 }, 1 ); 54 if ( $pass1.val() === currentPass ) { 55 return; 56 } 57 58 currentPass = $pass1.val(); 59 $pass1Text.val( currentPass ); 60 $pass1.add( $pass1Text ).removeClass( 'short bad good strong' ); 61 62 if ( passStrength.className ) { 63 $pass1.add( $pass1Text ).addClass( passStrength.className ); 64 if ( 'short' === passStrength.className || 'bad' === passStrength.className ) { 65 if ( ! $weakCheckbox.prop( 'checked' ) ) { 66 $submitButtons.prop( 'disabled', true ); 67 } 68 $weakRow.show(); 69 } else { 70 $submitButtons.prop( 'disabled', false ); 71 $weakRow.hide(); 72 } 73 } 70 74 } ); 71 75 }
Note: See TracChangeset
for help on using the changeset viewer.