mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-06 02:41:27 +01:00
98c3cf6e4b
git-svn-id: http://core.svn.wordpress.org/trunk@23809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
1.4 KiB
JavaScript
1 line
1.4 KiB
JavaScript
(function(d){var c;function a(){var g=d("#wp-auth-check"),h=d("#wp-auth-check-form"),e=c.find(".wp-auth-fallback-expired"),i,f=false;if(h.length){d(window).on("beforeunload.wp-auth-check",function(j){j.originalEvent.returnValue=window.authcheckL10n.beforeunload});i=d('<iframe id="wp-auth-check-frame" sandbox="allow-same-origin allow-forms allow-scripts" frameborder="0">').attr("title",e.text());i.load(function(l){var k,j;f=true;try{j=d(this).contents().find("body");k=j.height()}catch(l){c.addClass("fallback");h.remove();e.focus()}if(k){if(j&&j.hasClass("interim-login-success")){k+=35;g.find(".wp-auth-check-close").show();c.data("logged-in",1);setTimeout(function(){b()},3000)}g.css("max-height",k+60+"px")}}).attr("src",h.data("src"));d("#wp-auth-check-form").append(i)}c.removeClass("hidden");if(i){i.focus();setTimeout(function(){if(!f){c.addClass("fallback");h.remove();e.focus()}},5000)}else{e.focus()}}function b(){d(window).off("beforeunload.wp-auth-check");c.fadeOut(200,function(){c.addClass("hidden").css("display","");d("#wp-auth-check-frame").remove()})}d(document).on("heartbeat-tick.wp-auth-check",function(g,f){if(f["wp-auth-check"]&&c.hasClass("hidden")){a()}else{if(!f["wp-auth-check"]&&!c.hasClass("hidden")&&!c.data("logged-in")){b()}}}).on("heartbeat-send.wp-auth-check",function(g,f){f["wp-auth-check"]=1}).ready(function(){c=d("#wp-auth-check-wrap").data("logged-in",0);c.find(".wp-auth-check-close").on("click",function(f){b()})})}(jQuery)); |