HamroKhanpin/hamrokhaanpaan/wp-content/__plugins/wp-optimize/js/jquery.blockUI.min.js
2024-04-29 13:12:44 +05:45

1 line
9.1 KiB
JavaScript

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