2013-05-08 18:58:55 -04:00
|
|
|
(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" 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();return}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","").find(".wp-auth-check-close").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));
|