diff --git a/wp-includes/js/wp-auth-check.js b/wp-includes/js/wp-auth-check.js index e0c16ca652..e58a27dab9 100644 --- a/wp-includes/js/wp-auth-check.js +++ b/wp-includes/js/wp-auth-check.js @@ -4,7 +4,10 @@ var wrap, next; function show() { - var parent = $('#wp-auth-check'), form = $('#wp-auth-check-form'), noframe = wrap.find('.wp-auth-fallback-expired'), frame, loaded = false; + var parent = $('#wp-auth-check'), + form = $('#wp-auth-check-form'), + noframe = wrap.find('.wp-auth-fallback-expired'), + frame, loaded = false; if ( form.length ) { // Add unload confirmation to counter (frame-busting) JS redirects @@ -68,10 +71,10 @@ $(window).off( 'beforeunload.wp-auth-check' ); // When on the Edit Post screen, speed up heartbeat after the user logs in to quickly refresh nonces - if ( typeof adminpage != 'undefined' && ( adminpage == 'post-php' || adminpage == 'post-new-php' ) && - typeof wp != 'undefined' && wp.heartbeat ) { + if ( typeof adminpage !== 'undefined' && ( adminpage === 'post-php' || adminpage === 'post-new-php' ) && + typeof wp !== 'undefined' && wp.heartbeat ) { - wp.heartbeat.interval( 'fast', 1 ); + wp.heartbeat.connectNow(); } wrap.fadeOut( 200, function() { @@ -88,14 +91,16 @@ $( document ).on( 'heartbeat-tick.wp-auth-check', function( e, data ) { if ( 'wp-auth-check' in data ) { schedule(); - if ( ! data['wp-auth-check'] && wrap.hasClass('hidden') ) + if ( ! data['wp-auth-check'] && wrap.hasClass('hidden') ) { show(); - else if ( data['wp-auth-check'] && ! wrap.hasClass('hidden') ) + } else if ( data['wp-auth-check'] && ! wrap.hasClass('hidden') ) { hide(); + } } }).on( 'heartbeat-send.wp-auth-check', function( e, data ) { - if ( ( new Date() ).getTime() > next ) + if ( ( new Date() ).getTime() > next ) { data['wp-auth-check'] = true; + } }).ready( function() { schedule(); wrap = $('#wp-auth-check-wrap'); diff --git a/wp-includes/js/wp-auth-check.min.js b/wp-includes/js/wp-auth-check.min.js index 99aebd4b98..e3e1268a3d 100644 --- a/wp-includes/js/wp-auth-check.min.js +++ b/wp-includes/js/wp-auth-check.min.js @@ -1 +1 @@ -!function(a){function b(){var b,d=a("#wp-auth-check"),f=a("#wp-auth-check-form"),g=e.find(".wp-auth-fallback-expired"),h=!1;f.length&&(a(window).on("beforeunload.wp-auth-check",function(a){a.originalEvent.returnValue=window.authcheckL10n.beforeunload}),b=a('