/* * jQuery blockUI plugin * Version 2.42 (11-MAY-2012) * @requires jQuery v1.2.3 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2010 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Thanks to Amir-Hossein Sobhi for some excellent contributions! */ (function(){function A(G){if(/1\.(0|1|2)\.(0|1|2)/.test(G.fn.jquery)||/^1.1/.test(G.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later! You are using v"+G.fn.jquery);return}G.fn._fadeIn=G.fn.fadeIn;var M=function(){};var B=document.documentMode||0;var N=G.browser.msie&&((G.browser.version<8&&!B)||B<8);var J=G.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!B;G.blockUI=function(Q){K(window,Q)};G.unblockUI=function(Q){I(window,Q)};G.growlUI=function(Q,S,T,R){var U=G('
');if(Q){U.append("

"+Q+"

")}if(S){U.append("

"+S+"

")}if(T==undefined){T=3000}G.blockUI({message:U,fadeIn:700,fadeOut:1000,centerY:false,timeout:T,showOverlay:false,onUnblock:R,css:G.blockUI.defaults.growlCSS})};G.fn.block=function(Q){var R=G.extend({},G.blockUI.defaults,Q||{});this.each(function(){var S=G(this);if(R.ignoreIfBlocked&&S.data("blockUI.isBlocked")){return}S.unblock({fadeOut:0})});return this.each(function(){if(G.css(this,"position")=="static"){this.style.position="relative"}if(G.browser.msie){this.style.zoom=1}K(this,Q)})};G.fn.unblock=function(Q){return this.each(function(){I(this,Q)})};G.blockUI.version=2.42;G.blockUI.defaults={message:"

Please wait...

",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"40%",left:"35%",textAlign:"center",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:0,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:false};var O=null;var F=[];function K(n,e){var k,i;var S=(n==window);var j=(e&&e.message!==undefined?e.message:undefined);e=G.extend({},G.blockUI.defaults,e||{});if(e.ignoreIfBlocked&&G(n).data("blockUI.isBlocked")){return}e.overlayCSS=G.extend({},G.blockUI.defaults.overlayCSS,e.overlayCSS||{});k=G.extend({},G.blockUI.defaults.css,e.css||{});i=G.extend({},G.blockUI.defaults.themedCSS,e.themedCSS||{});j=j===undefined?e.message:j;if(S&&O){I(window,{fadeOut:0})}if(j&&typeof j!="string"&&(j.parentNode||j.jquery)){var X=j.jquery?j[0]:j;var Y={};G(n).data("blockUI.history",Y);Y.el=X;Y.parent=X.parentNode;Y.display=X.style.display;Y.position=X.style.position;if(Y.parent){Y.parent.removeChild(X)}}G(n).data("blockUI.onUnblock",e.onUnblock);var Q=e.baseZ;var b=(G.browser.msie||e.forceIframe)?G(''):G('');var f=e.theme?G(''):G('');var V,U;if(e.theme&&S){U=''}else{if(e.theme){U=''}else{if(S){U=''}else{U=''}}}V=G(U);if(j){if(e.theme){V.css(i);V.addClass("ui-widget-content")}else{V.css(k)}}if(!e.theme&&(!e.applyPlatformOpacityRules||!(G.browser.mozilla&&/Linux/.test(navigator.platform)))){f.css(e.overlayCSS)}f.css("position",S?"fixed":"absolute");if(G.browser.msie||e.forceIframe){b.css("opacity",0)}var m=[b,f,V],W=S?G("body"):G(n);G.each(m,function(){this.appendTo(W)});if(e.theme&&e.draggable&&G.fn.draggable){V.draggable({handle:".ui-dialog-titlebar",cancel:"li"})}var o=N&&(!G.boxModel||G("object,embed",S?null:n).length>0);if(J||o){if(S&&e.allowBodyStretch&&G.boxModel){G("html,body").css("height","100%")}if((J||!G.boxModel)&&!S){var Z=H(n,"borderTopWidth"),c=H(n,"borderLeftWidth");var d=Z?"(0 - "+Z+")":0;var T=c?"(0 - "+c+")":0}G.each([b,f,V],function(r,p){var l=p[0].style;l.position="absolute";if(r<2){S?l.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+e.quirksmodeOffsetHack+') + "px"'):l.setExpression("height",'this.parentNode.offsetHeight + "px"');S?l.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):l.setExpression("width",'this.parentNode.offsetWidth + "px"');if(T){l.setExpression("left",T)}if(d){l.setExpression("top",d)}}else{if(e.centerY){if(S){l.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}l.marginTop=0}else{if(!e.centerY&&S){var q=(e.css&&e.css.top)?parseInt(e.css.top):0;var t="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+q+') + "px"';l.setExpression("top",t)}}}})}if(j){if(e.theme){V.find(".ui-widget-content").append(j)}else{V.append(j)}if(j.jquery||j.nodeType){G(j).show()}}if((G.browser.msie||e.forceIframe)&&e.showOverlay){b.show()}if(e.fadeIn){var R=e.onBlock?e.onBlock:M;var a=(e.showOverlay&&!j)?R:M;var g=j?R:M;if(e.showOverlay){f._fadeIn(e.fadeIn,a)}if(j){V._fadeIn(e.fadeIn,g)}}else{if(e.showOverlay){f.show()}if(j){V.show()}if(e.onBlock){e.onBlock()}}P(1,n,e);if(S){O=V[0];F=G(":input:enabled:visible",O);if(e.focusInput){setTimeout(L,20)}}else{C(V[0],e.centerX,e.centerY)}if(e.timeout){var h=setTimeout(function(){S?G.unblockUI(e):G(n).unblock(e)},e.timeout);G(n).data("blockUI.timeout",h)}}function I(T,Q){var R=(T==window);var S=G(T);var W=S.data("blockUI.history");var U=S.data("blockUI.timeout");if(U){clearTimeout(U);S.removeData("blockUI.timeout")}Q=G.extend({},G.blockUI.defaults,Q||{});P(0,T,Q);if(Q.onUnblock===null){Q.onUnblock=S.data("blockUI.onUnblock");S.removeData("blockUI.onUnblock")}var V;if(R){V=G("body").children().filter(".blockUI").add("body > .blockUI")}else{V=G(".blockUI",T)}if(R){O=F=null}if(Q.fadeOut){V.fadeOut(Q.fadeOut);setTimeout(function(){E(V,W,Q,T)},Q.fadeOut)}else{E(V,W,Q,T)}}function E(T,S,Q,R){T.each(function(V,U){if(this.parentNode){this.parentNode.removeChild(this)}});if(S&&S.el){S.el.style.display=S.display;S.el.style.position=S.position;if(S.parent){S.parent.appendChild(S.el)}G(R).removeData("blockUI.history")}if(typeof Q.onUnblock=="function"){Q.onUnblock(R,Q)}}function P(V,T,Q){var R=T==window,S=G(T);if(!V&&(R&&!O||!R&&!S.data("blockUI.isBlocked"))){return}S.data("blockUI.isBlocked",V);if(!Q.bindEvents||(V&&!Q.showOverlay)){return}var U="mousedown mouseup keydown keypress";false?G(document).bind(U,Q,D):G(document).unbind(U,D)}function D(T){if(T.keyCode&&T.keyCode==9){if(O&&T.data.constrainTabKey){var U=F;var S=!T.shiftKey&&T.target===U[U.length-1];var R=T.shiftKey&&T.target===U[0];if(S||R){setTimeout(function(){L(R)},10);return false}}}var Q=T.data;if(G(T.target).parents("div."+Q.blockMsgClass).length>0){return true}return G(T.target).parents().children().filter("div.blockUI").length==0}function L(Q){if(!F){return}var R=F[Q===true?F.length-1:0];if(R){R.focus()}}function C(S,Q,R){var V=S.parentNode,U=S.style;var W=((V.offsetWidth-S.offsetWidth)/2)-H(V,"borderLeftWidth");var T=((V.offsetHeight-S.offsetHeight)/2)-H(V,"borderTopWidth");if(Q){U.left=W>0?(W+"px"):"0"}if(R){U.top=T>0?(T+"px"):"0"}}function H(Q,R){return parseInt(G.css(Q,R))||0}}if(typeof define==="function"&&define.amd&&define.amd.jQuery){define(["jquery"],A)}else{A(jQuery)}})();