Changeset 12815
- Timestamp:
- 01/23/2010 11:07:56 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/script-loader.php
r12792 r12815 143 143 $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.7.1' ); 144 144 $scripts->add_data( 'jquery-ui-dialog', 'group', 1 ); 145 146 $scripts->add( 'jquery-ui-effects', '/wp-includes/js/jquery/ui.effects.js', array('jquery-ui-core'), '1.7.2' ); // Yes, this one is 1.7.2 — the others need to be updated 147 $scripts->add_data( 'jquery-ui-effects', 'group', 1 ); 145 148 146 149 // deprecated, not used in core, most functionality is included in jQuery 1.3 -
trunk/wp-login.php
r12814 r12815 46 46 add_action( 'login_head', 'noindex' ); 47 47 48 // Print scripts 49 add_action( 'login_head', 'wp_print_scripts' ); 50 48 51 if ( empty($wp_error) ) 49 52 $wp_error = new WP_Error(); 53 54 // Shake it! 55 $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' ); 56 $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); 57 58 if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) { 59 wp_enqueue_script( 'jquery-ui-effects' ); 60 add_action( 'login_head', 'wp_shake_js', 12 ); 61 } 62 50 63 ?> 51 64 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> … … 108 121 } 109 122 } // End of login_header() 123 124 function wp_shake_js() { 125 ?> 126 <script type="text/javascript"> 127 jQuery( document ).ready(function(){ 128 jQuery( '#h1' ).focus(); 129 jQuery( '#loginform, #registerform, #lostpasswordform' ).effect('shake', {times: 3}, 40, function(){try{wp_attempt_focus();} catch(e){}}); 130 }); 131 </script> 132 <?php 133 } 110 134 111 135 /** … … 589 613 590 614 <script type="text/javascript"> 615 function wp_attempt_focus(){ 616 setTimeout( function(){ try{ 591 617 <?php if ( $user_login || $interim_login ) { ?> 592 setTimeout( function(){ try{593 618 d = document.getElementById('user_pass'); 619 <?php } else { ?> 620 d = document.getElementById('user_login'); 621 <?php } ?> 594 622 d.value = ''; 595 623 d.focus(); 596 624 } catch(e){} 597 625 }, 200); 598 <?php } else { ?> 599 try{document.getElementById('user_login').focus();}catch(e){} 626 } 627 628 <?php if ( !$error ) { ?> 629 wp_attempt_focus(); 600 630 <?php } ?> 601 631 </script>
Note: See TracChangeset
for help on using the changeset viewer.