astro-mail/public/assets/js/jquery.blockUI.js

2 lines
8.9 KiB
JavaScript
Executable File

!function(){"use strict";function e(e){e.fn._fadeIn=e.fn.fadeIn;var t=e.noop||function(){},o=/MSIE/.test(navigator.userAgent),i=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent);document.documentMode;var l=e.isFunction(document.createElement("div").style.setExpression);e.blockUI=function(e){a(window,e)},e.unblockUI=function(e){d(window,e)},e.growlUI=function(t,o,i,l){var n=e('<div class="growlUI"></div>');t&&n.append("<h1>"+t+"</h1>"),o&&n.append("<h2>"+o+"</h2>"),void 0===i&&(i=3e3);var s=function(t){t=t||{},e.blockUI({message:n,fadeIn:void 0!==t.fadeIn?t.fadeIn:700,fadeOut:void 0!==t.fadeOut?t.fadeOut:1e3,timeout:void 0!==t.timeout?t.timeout:i,centerY:!1,showOverlay:!1,onUnblock:l,css:e.blockUI.defaults.growlCSS})};s(),n.css("opacity"),n.mouseover(function(){s({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(t){if(this[0]===window)return e.blockUI(t),this;var o=e.extend({},e.blockUI.defaults,t||{});return this.each(function(){var t=e(this);o.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,a(this,t)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){d(this,t)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,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:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.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:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var n=null,s=[];function a(a,c){var u,p,h,$,k,y,v=a==window,g=c&&void 0!==c.message?c.message:void 0;if(!((c=e.extend({},e.blockUI.defaults,c||{})).ignoreIfBlocked&&e(a).data("blockUI.isBlocked"))){if(c.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,c.overlayCSS||{}),u=e.extend({},e.blockUI.defaults.css,c.css||{}),c.onOverlayClick&&(c.overlayCSS.cursor="pointer"),p=e.extend({},e.blockUI.defaults.themedCSS,c.themedCSS||{}),g=void 0===g?c.message:g,v&&n&&d(window,{fadeOut:0}),g&&"string"!=typeof g&&(g.parentNode||g.jquery)){var m,I,U,x,w,_,C,S=g.jquery?g[0]:g,O={};e(a).data("blockUI.history",O),O.el=S,O.parent=S.parentNode,O.display=S.style.display,O.position=S.style.position,O.parent&&O.parent.removeChild(S)}e(a).data("blockUI.onUnblock",c.onUnblock);var E=c.baseZ;h=o||c.forceIframe?e('<iframe class="blockUI" style="z-index:'+E+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+c.iframeSrc+'"></iframe>'):e('<div class="blockUI" style="display:none"></div>'),$=c.theme?e('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+E+++';display:none"></div>'):e('<div class="blockUI blockOverlay" style="z-index:'+E+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),c.theme&&v?(y='<div class="blockUI '+c.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(E+10)+';display:none;position:fixed">',c.title&&(y+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(c.title||"&nbsp;")+"</div>"),y+='<div class="ui-widget-content ui-dialog-content"></div>',y+="</div>"):c.theme?(y='<div class="blockUI '+c.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(E+10)+';display:none;position:absolute">',c.title&&(y+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(c.title||"&nbsp;")+"</div>"),y+='<div class="ui-widget-content ui-dialog-content"></div>',y+="</div>"):y=v?'<div class="blockUI '+c.blockMsgClass+' blockPage" style="z-index:'+(E+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+c.blockMsgClass+' blockElement" style="z-index:'+(E+10)+';display:none;position:absolute"></div>',k=e(y),g&&(c.theme?(k.css(p),k.addClass("ui-widget-content")):k.css(u)),c.theme||$.css(c.overlayCSS),$.css("position",v?"fixed":"absolute"),(o||c.forceIframe)&&h.css("opacity",0);var M=[h,$,k],T=v?e("body"):e(a);e.each(M,function(){this.appendTo(T)}),c.theme&&c.draggable&&e.fn.draggable&&k.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var B=l&&(!e.support.boxModel||e("object,embed",v?null:a).length>0);if(i||B){if(v&&c.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(i||!e.support.boxModel)&&!v)var H=b(a,"borderTopWidth"),j=b(a,"borderLeftWidth"),z=H?"(0 - "+H+")":0,W=j?"(0 - "+j+")":0;e.each(M,function(e,t){var o=t[0].style;if(o.position="absolute",e<2)v?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+c.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),v?o.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),W&&o.setExpression("left",W),z&&o.setExpression("top",z);else if(c.centerY)v&&o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),o.marginTop=0;else if(!c.centerY&&v){var i=c.css&&c.css.top?parseInt(c.css.top,10):0;o.setExpression("top","((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+i+') + "px"')}})}if(g&&(c.theme?k.find(".ui-widget-content").append(g):k.append(g),(g.jquery||g.nodeType)&&e(g).show()),(o||c.forceIframe)&&c.showOverlay&&h.show(),c.fadeIn){var N=c.onBlock?c.onBlock:t,q=c.showOverlay&&!g?N:t,Y=g?N:t;c.showOverlay&&$._fadeIn(c.fadeIn,q),g&&k._fadeIn(c.fadeIn,Y)}else c.showOverlay&&$.show(),g&&k.show(),c.onBlock&&c.onBlock.bind(k)();if(r(1,a,c),v?(n=k[0],s=e(c.focusableElements,n),c.focusInput&&setTimeout(f,20)):(m=k[0],I=c.centerX,U=c.centerY,x=m.parentNode,w=m.style,_=(x.offsetWidth-m.offsetWidth)/2-b(x,"borderLeftWidth"),C=(x.offsetHeight-m.offsetHeight)/2-b(x,"borderTopWidth"),I&&(w.left=_>0?_+"px":"0"),U&&(w.top=C>0?C+"px":"0")),c.timeout){var A=setTimeout(function(){v?e.unblockUI(c):e(a).unblock(c)},c.timeout);e(a).data("blockUI.timeout",A)}}}function d(t,o){var i,l,a=t==window,d=e(t),u=d.data("blockUI.history"),f=d.data("blockUI.timeout");f&&(clearTimeout(f),d.removeData("blockUI.timeout")),r(0,t,o=e.extend({},e.blockUI.defaults,o||{})),null===o.onUnblock&&(o.onUnblock=d.data("blockUI.onUnblock"),d.removeData("blockUI.onUnblock")),l=a?e("body").children().filter(".blockUI").add("body > .blockUI"):d.find(">.blockUI"),o.cursorReset&&(l.length>1&&(l[1].style.cursor=o.cursorReset),l.length>2&&(l[2].style.cursor=o.cursorReset)),a&&(n=s=null),o.fadeOut?(i=l.length,l.stop().fadeOut(o.fadeOut,function(){0==--i&&c(l,u,o,t)})):c(l,u,o,t)}function c(t,o,i,l){var n=e(l);if(!n.data("blockUI.isBlocked")){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.el.style.cursor="default",o.parent&&o.parent.appendChild(o.el),n.removeData("blockUI.history")),n.data("blockUI.static")&&n.css("position","static"),"function"==typeof i.onUnblock&&i.onUnblock(l,i);var s=e(document.body),a=s.width(),d=s[0].style.width;s.width(a-1).width(a),s[0].style.width=d}}function r(t,o,i){var l=o==window,s=e(o);if((t||(!l||n)&&(l||s.data("blockUI.isBlocked")))&&(s.data("blockUI.isBlocked",t),l&&i.bindEvents&&(!t||i.showOverlay))){var a="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(a,i,u):e(document).unbind(a,u)}}function u(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&n&&t.data.constrainTabKey){var o=s,i=!t.shiftKey&&t.target===o[o.length-1],l=t.shiftKey&&t.target===o[0];if(i||l)return setTimeout(function(){f(l)},10),!1}var a=t.data,d=e(t.target);return d.hasClass("blockOverlay")&&a.onOverlayClick&&a.onOverlayClick(t),d.parents("div."+a.blockMsgClass).length>0||0===d.parents().children().filter("div.blockUI").length}function f(e){if(s){var t=s[!0===e?s.length-1:0];t&&t.focus()}}function b(t,o){return parseInt(e.css(t,o),10)||0}}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}();