Ticket #25603: 25603.17.diff
File 25603.17.diff, 2.4 KB (added by , 12 years ago) |
---|
-
src/wp-includes/script-loader.php
332 332 333 333 $scripts->add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 ); 334 334 335 $scripts->add( 'about', "/wp-admin/js/about$suffix.js", array( 'jquery', 'password-strength-meter' ), false, 1 );335 $scripts->add( 'about', "/wp-admin/js/about$suffix.js", array( 'jquery', 'password-strength-meter', 'underscore' ), false, 1 ); 336 336 337 337 $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 ); 338 338 -
src/wp-admin/js/about.js
2 2 var password = 'Gosh, WordPress is grand.', 3 3 $input = $('#pass'), 4 4 shouldAnimate = true, 5 timesForAnimation = [280, 300, 305, 310, 315, 325, 330, 345, 360, 370, 380, 400, 450, 500, 600], 6 resultsCache = {}, 5 7 indicatorString = $('#pass-strength-result').text(); 6 8 7 9 function updateResult(){ 8 var strength = wp.passwordStrength.meter($input.val(), [], $input.val());10 var strength; 9 11 12 if ( typeof( resultsCache[ $input.val() ]) === 'undefined') { 13 strength = wp.passwordStrength.meter($input.val(), [], $input.val()); 14 resultsCache[ $input.val() ] = strength; 15 } else { 16 strength = resultsCache[ $input.val() ]; 17 } 18 10 19 $('#pass-strength-result').removeClass('short bad good strong'); 11 20 switch ( strength ) { 12 21 case 2: … … 34 43 if ($input.val().length < password.length){ 35 44 $input.val( password.substr(0, $input.val().length + 1) ); 36 45 updateResult(); 46 47 // Look like real typing by changing the speed new letters are added each time 48 setTimeout(animate, _.shuffle(timesForAnimation )[0] ); 37 49 } else { 38 50 resetMeter(); 51 52 // When we reset, let's wait a bit longer than normal to start again 53 setTimeout(animate, 700); 39 54 } 40 // Look like real typing by changing the speed new letters are added each time 41 setTimeout(animate, 220 + Math.floor(Math.random() * ( 800 - 220)) ); 55 42 56 } 43 57 // 44 58 function begin(){