seismic failures.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dcc35f621e
commit
29bafc4bac
File diff suppressed because one or more lines are too long
|
@ -143,6 +143,9 @@ function wp_default_scripts( &$scripts ) {
|
|||
$scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.7.1' );
|
||||
$scripts->add_data( 'jquery-ui-dialog', 'group', 1 );
|
||||
|
||||
$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
|
||||
$scripts->add_data( 'jquery-ui-effects', 'group', 1 );
|
||||
|
||||
// deprecated, not used in core, most functionality is included in jQuery 1.3
|
||||
$scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '2.02m');
|
||||
$scripts->add_data( 'jquery-form', 'group', 1 );
|
||||
|
|
36
wp-login.php
36
wp-login.php
|
@ -45,8 +45,21 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
|
|||
add_filter( 'pre_option_blog_public', create_function( '$a', 'return 0;' ) );
|
||||
add_action( 'login_head', 'noindex' );
|
||||
|
||||
// Print scripts
|
||||
add_action( 'login_head', 'wp_print_scripts' );
|
||||
|
||||
if ( empty($wp_error) )
|
||||
$wp_error = new WP_Error();
|
||||
|
||||
// Shake it!
|
||||
$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
|
||||
$shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );
|
||||
|
||||
if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) {
|
||||
wp_enqueue_script( 'jquery-ui-effects' );
|
||||
add_action( 'login_head', 'wp_shake_js', 12 );
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
|
||||
|
@ -108,6 +121,17 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
|
|||
}
|
||||
} // End of login_header()
|
||||
|
||||
function wp_shake_js() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery( document ).ready(function(){
|
||||
jQuery( '#h1' ).focus();
|
||||
jQuery( '#loginform, #registerform, #lostpasswordform' ).effect('shake', {times: 3}, 40, function(){try{wp_attempt_focus();} catch(e){}});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles sending password retrieval email to user.
|
||||
*
|
||||
|
@ -588,15 +612,21 @@ default:
|
|||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<?php if ( $user_login || $interim_login ) { ?>
|
||||
function wp_attempt_focus(){
|
||||
setTimeout( function(){ try{
|
||||
<?php if ( $user_login || $interim_login ) { ?>
|
||||
d = document.getElementById('user_pass');
|
||||
<?php } else { ?>
|
||||
d = document.getElementById('user_login');
|
||||
<?php } ?>
|
||||
d.value = '';
|
||||
d.focus();
|
||||
} catch(e){}
|
||||
}, 200);
|
||||
<?php } else { ?>
|
||||
try{document.getElementById('user_login').focus();}catch(e){}
|
||||
}
|
||||
|
||||
<?php if ( !$error ) { ?>
|
||||
wp_attempt_focus();
|
||||
<?php } ?>
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue