Ticket #25870: 25870.all.diff
File 25870.all.diff, 1.6 KB (added by , 11 years ago) |
---|
-
src/wp-admin/js/about.js
1 /* global pwsL10n:false */ 1 2 (function($){ 2 3 var password = 'Gosh, WordPress is grand.', 3 4 $input = $('#pass'), … … 4 5 shouldAnimate = true, 5 6 timesForAnimation = [280, 300, 305, 310, 315, 325, 330, 345, 360, 370, 380, 400, 450, 500, 600], 6 7 resultsCache = {}, 7 indicatorString = $('#pass-strength-result').text(); 8 $result = $( '#pass-strength-result' ), 9 indicatorString = $result.text(); 8 10 9 11 function updateResult(){ 10 12 var strength; … … 16 18 strength = resultsCache[ $input.val() ]; 17 19 } 18 20 19 $('#pass-strength-result').removeClass('short bad good strong'); 21 $result.removeClass( 'short bad good strong' ); 22 20 23 switch ( strength ) { 21 24 case 2: 22 $ ('#pass-strength-result').addClass('bad').html( pwsL10n['bad']);25 $result.addClass( 'bad' ).html( pwsL10n.bad ); 23 26 break; 24 27 case 3: 25 $ ('#pass-strength-result').addClass('good').html( pwsL10n['good']);28 $result.addClass( 'good' ).html( pwsL10n.good ); 26 29 break; 27 30 case 4: 28 $ ('#pass-strength-result').addClass('strong').html( pwsL10n['strong']);31 $result.addClass( 'strong' ).html( pwsL10n.strong ); 29 32 break; 30 33 default: 31 $ ('#pass-strength-result').addClass('short').html( pwsL10n['short'] );34 $result.addClass( 'short' ).html( pwsL10n[ 'short' ] ); 32 35 } 33 36 } 37 34 38 function resetMeter(){ 35 39 $input.val(''); 36 40 $('#pass-strength-result').text(indicatorString);