shafafiyat/static/assets/vendor/libs/block-ui/block-ui.js
2025-08-10 07:44:23 +03:30

2 lines
No EOL
10 KiB
JavaScript

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