Make WordPress Core

Changeset 12815


Ignore:
Timestamp:
01/23/2010 11:07:56 PM (13 years ago)
Author:
markjaquith
Message:

seismic failures.

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/script-loader.php

    r12792 r12815  
    143143    $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.7.1' );
    144144    $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 );
    145148
    146149    // deprecated, not used in core, most functionality is included in jQuery 1.3
  • trunk/wp-login.php

    r12814 r12815  
    4646    add_action( 'login_head', 'noindex' );
    4747
     48    // Print scripts
     49    add_action( 'login_head', 'wp_print_scripts' );
     50
    4851    if ( empty($wp_error) )
    4952        $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
    5063    ?>
    5164<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    108121    }
    109122} // End of login_header()
     123
     124function wp_shake_js() {
     125?>
     126<script type="text/javascript">
     127jQuery( 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}
    110134
    111135/**
     
    589613
    590614<script type="text/javascript">
     615function wp_attempt_focus(){
     616setTimeout( function(){ try{
    591617<?php if ( $user_login || $interim_login ) { ?>
    592 setTimeout( function(){ try{
    593618d = document.getElementById('user_pass');
     619<?php } else { ?>
     620d = document.getElementById('user_login'); 
     621<?php } ?>
    594622d.value = '';
    595623d.focus();
    596624} catch(e){}
    597625}, 200);
    598 <?php } else { ?>
    599 try{document.getElementById('user_login').focus();}catch(e){}
     626}
     627
     628<?php if ( !$error ) { ?>
     629wp_attempt_focus();
    600630<?php } ?>
    601631</script>
Note: See TracChangeset for help on using the changeset viewer.