Make WordPress Core

Changeset 26530


Ignore:
Timestamp:
12/02/2013 06:46:28 PM (13 years ago)
Author:
azaozz
Message:

Heartbeat: update wp-auth-check to use the new "connectNow()" method after a successful login, see #25073.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/wp-auth-check.js

    r26195 r26530  
    55
    66        function show() {
    7                 var parent = $('#wp-auth-check'), form = $('#wp-auth-check-form'), noframe = wrap.find('.wp-auth-fallback-expired'), frame, loaded = false;
     7                var parent = $('#wp-auth-check'),
     8                        form = $('#wp-auth-check-form'),
     9                        noframe = wrap.find('.wp-auth-fallback-expired'),
     10                        frame, loaded = false;
    811
    912                if ( form.length ) {
     
    6972
    7073                // When on the Edit Post screen, speed up heartbeat after the user logs in to quickly refresh nonces
    71                 if ( typeof adminpage != 'undefined' && ( adminpage == 'post-php' || adminpage == 'post-new-php' ) &&
    72                         typeof wp != 'undefined' && wp.heartbeat ) {
     74                if ( typeof adminpage !== 'undefined' && ( adminpage === 'post-php' || adminpage === 'post-new-php' ) &&
     75                        typeof wp !== 'undefined' && wp.heartbeat ) {
    7376
    74                         wp.heartbeat.interval( 'fast', 1 );
     77                        wp.heartbeat.connectNow();
    7578                }
    7679
     
    8992                if ( 'wp-auth-check' in data ) {
    9093                        schedule();
    91                         if ( ! data['wp-auth-check'] && wrap.hasClass('hidden') )
     94                        if ( ! data['wp-auth-check'] && wrap.hasClass('hidden') ) {
    9295                                show();
    93                         else if ( data['wp-auth-check'] && ! wrap.hasClass('hidden') )
     96                        } else if ( data['wp-auth-check'] && ! wrap.hasClass('hidden') ) {
    9497                                hide();
     98                        }
    9599                }
    96100        }).on( 'heartbeat-send.wp-auth-check', function( e, data ) {
    97                 if ( ( new Date() ).getTime() > next )
     101                if ( ( new Date() ).getTime() > next ) {
    98102                        data['wp-auth-check'] = true;
     103                }
    99104        }).ready( function() {
    100105                schedule();
Note: See TracChangeset for help on using the changeset viewer.