7 lines
132 KiB
JavaScript
7 lines
132 KiB
JavaScript
|
"use strict";var KTApp=function(){var t={},e=function(t){var e=t.data("theme")?"tooltip-"+t.data("theme"):"",a="auto"==t.data("width")?"tooltop-auto-width":"",n=t.data("trigger")?t.data("trigger"):"hover";$(t).tooltip({trigger:n,template:'<div class="tooltip '+e+" "+a+'" role="tooltip"> <div class="arrow"></div> <div class="tooltip-inner"></div> </div>'})},a=function(){$('[data-toggle="tooltip"]').each((function(){e($(this))}))},n=function(t){var e=t.data("skin")?"popover-"+t.data("skin"):"",a=t.data("trigger")?t.data("trigger"):"hover";t.popover({trigger:a,template:' <div class="popover '+e+'" role="tooltip"> <div class="arrow"></div> <h3 class="popover-header"></h3> <div class="popover-body"></div> </div>'})},i=function(){$('[data-toggle="popover"]').each((function(){n($(this))}))},o=function(t,e){t=$(t),new KTCard(t[0],e)},l=function(){$('[data-card="true"]').each((function(){var t=$(this);!0!==t.data("data-card-initialized")&&(o(t,{}),t.data("data-card-initialized",!0))}))};return{init:function(e){e&&(t=e),KTApp.initComponents()},initComponents:function(){$('[data-scroll="true"]').each((function(){var t=$(this);KTUtil.scrollInit(this,{mobileNativeScroll:!0,handleWindowResize:!0,rememberPosition:"true"==t.data("remember-position")})})),a(),i(),$("body").on("click","[data-close=alert]",(function(){$(this).closest(".alert").hide()})),$(".custom-file-input").on("change",(function(){var t=$(this).val();$(this).next(".custom-file-label").addClass("selected").html(t)})),l(),"undefined"!=typeof Sticky&&new Sticky('[data-sticky="true"]'),$("body").on("show.bs.dropdown",(function(t){var e=$(t.target).find("[data-attach='body']");if(0!==e.length){var a=$(t.target).find(".dropdown-menu").detach();e.data("dropdown-menu",a),$("body").append(a),a.css("display","block"),a.position({my:"right top",at:"right bottom",of:$(t.relatedTarget)})}})),$("body").on("hide.bs.dropdown",(function(t){var e=$(t.target).find("[data-attach='body']");if(0!==e.length){var a=e.data("dropdown-menu");$(t.target).append(a.detach()),a.hide()}}))},initTooltips:function(){a()},initTooltip:function(t){e(t)},initPopovers:function(){i()},initPopover:function(t){n(t)},initCard:function(t,e){o(t,e)},initCards:function(){l()},initSticky:function(){initSticky()},initAbsoluteDropdown:function(t){!function(t){var e;t&&$("body").on("show.bs.dropdown",t,(function(t){e=$(t.target).find(".dropdown-menu"),$("body").append(e.detach()),e.css("display","block"),e.position({my:"right top",at:"right bottom",of:$(t.relatedTarget)})})).on("hide.bs.dropdown",t,(function(t){$(t.target).append(e.detach()),e.hide()}))}(t)},block:function(t,e){var a,n=$(t),i='<span class="spinner '+((e=$.extend(!0,{opacity:.05,overlayColor:"#000000",type:"",size:"",state:"primary",centerX:!0,centerY:!0,message:"",shadow:!0,width:"auto"},e)).type?"spinner-"+e.type:"")+" "+(e.state?"spinner-"+e.state:"")+" "+(e.size?"spinner-"+e.size:"")+'"></span';if(e.message&&e.message.length>0){var o="blockui "+(!1===e.shadow?"blockui":"");a='<div class="'+o+'"><span>'+e.message+"</span>"+i+"</div>";n=document.createElement("div");$("body").prepend(n),KTUtil.addClass(n,o),n.innerHTML=a,e.width=KTUtil.actualWidth(n)+10,KTUtil.remove(n),"body"==t&&(a='<div class="'+o+'" style="margin-left:-'+e.width/2+'px;"><span>'+e.message+"</span><span>"+i+"</span></div>")}else a=i;var l={message:a,centerY:e.centerY,centerX:e.centerX,css:{top:"30%",left:"50%",border:"0",padding:"0",backgroundColor:"none",width:e.width},overlayCSS:{backgroundColor:e.overlayColor,opacity:e.opacity,cursor:"wait",zIndex:"body"==t?1100:10},onUnblock:function(){n&&n[0]&&(KTUtil.css(n[0],"position",""),KTUtil.css(n[0],"zoom",""))}};"body"==t?(l.css.top="50%",$.blockUI(l)):(n=$(t)).block(l)},unblock:function(t){t&&"body"!=t?$(t).unblock():$.unblockUI()},blockPage:function(t){return KTApp.block("body",t)},unblockPage:function(){return KTApp.unblock("body")},getSettings:function(){return t}}}();"undefined"!=typeof module&&void 0!==module.exports&&(mod
|
||
|
/**
|
||
|
* ChildNode.remove() polyfill
|
||
|
* https://gomakethings.com/removing-an-element-from-the-dom-the-es6-way/
|
||
|
* @author Chris Ferdinandi
|
||
|
* @license MIT
|
||
|
*/,function(t){for(var e=0;e<t.length;e++)window[t[e]]&&!("remove"in window[t[e]].prototype)&&(window[t[e]].prototype.remove=function(){this.parentNode.removeChild(this)})}(["Element","CharacterData","DocumentType"]),function(){for(var t=0,e=["webkit","moz"],a=0;a<e.length&&!window.requestAnimationFrame;++a)window.requestAnimationFrame=window[e[a]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[a]+"CancelAnimationFrame"]||window[e[a]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e){var a=(new Date).getTime(),n=Math.max(0,16-(a-t)),i=window.setTimeout((function(){e(a+n)}),n);return t=a+n,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}(),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(t){t.hasOwnProperty("prepend")||Object.defineProperty(t,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=Array.prototype.slice.call(arguments),e=document.createDocumentFragment();t.forEach((function(t){var a=t instanceof Node;e.appendChild(a?t:document.createTextNode(String(t)))})),this.insertBefore(e,this.firstChild)}})})),null==Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var t=this.attributes,e=t.length,a=new Array(e),n=0;n<e;n++)a[n]=t[n].name;return a}),window.KTUtilElementDataStore={},window.KTUtilElementDataStoreID=0,window.KTUtilDelegatedEventHandlers={};var KTUtil=function(){var t=[],e={sm:544,md:768,lg:992,xl:1200},a=function(){window.addEventListener("resize",(function(){KTUtil.throttle(undefined,(function(){!function(){for(var e=0;e<t.length;e++)t[e].call()}()}),200)}))};return{init:function(t){t&&t.breakpoints&&(e=t.breakpoints),a()},addResizeHandler:function(e){t.push(e)},removeResizeHandler:function(e){for(var a=0;a<t.length;a++)e===t[a]&&delete t[a]},runResizeHandlers:function(){_runResizeHandlers()},resize:function(){if("function"==typeof Event)window.dispatchEvent(new Event("resize"));else{var t=window.document.createEvent("UIEvents");t.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(t)}},getURLParam:function(t){var e,a,n=window.location.search.substring(1).split("&");for(e=0;e<n.length;e++)if((a=n[e].split("="))[0]==t)return unescape(a[1]);return null},isMobileDevice:function(){var t=this.getViewPort().width<this.getBreakpoint("lg");return!1===t&&(t=null!=navigator.userAgent.match(/iPad/i)),t},isDesktopDevice:function(){return!KTUtil.isMobileDevice()},getViewPort:function(){var t=window,e="inner";return"innerWidth"in window||(e="client",t=document.documentElement||document.body),{width:t[e+"Width"],height:t[e+"Height"]}},isInResponsiveRange:function(t){var e=this.getViewPort().width;return"general"==t||("desktop"==t&&e>=this.getBreakpoint("lg")+1||("tablet"==t&&e>=this.getBreakpoint("md")+1&&e<this.getBreakpoint("lg")||("mobile"==t&&e<=this.getBreakpoint("md")||("desktop-and-tablet"==t&&e>=this.getBreakpoint("md")+1||("tablet-and-mobile"==t&&e<=this.getBreakpoint("lg")||"minimal-desktop-and-below"==t&&e<=this.getBreakpoint("xl"))))))},isBreakpointUp:function(t){return this.getViewPort().width>=this.getBreakpoint(t)},isBreakpointDown:function(t){return this.getViewPort().width<this.getBreakpoint(t)},getUniqueID:function(t){return t+Math.floor(Math.random()*(new Date).getTime())},getBreakpoint:function(t){return e[t]},isset:function(t,e){var a;if(-1!==(e=e||"").indexOf("["))throw new Error("Unsupported object path notation.");e=e.split(".");do{if(void 0===t)return!1;if(a=e.shift(),!t.hasOwnProperty(a))return!1;t=t[a]}while(e.length);return!0},getHighestZindex:function(t){for(var e,a;t&&t!==document;){if(("absolute"===(e=KTUtil.css(t,"position"))||"relative"===e||"fixed"===e)&&(a=parseInt(KTUtil.css(t,"z-index")),!isNaN(a)&&0!==a))return a;t=t.parentNode}return null},hasFixedPositionedParent:function(t){for(;t&&t!==document;){if("fixed"===KTUtil.css(t,"position"))return!0;t=t.parentNode}return!1},sleep:function(t){for(var e=(new Date).getTime(),a=0;a<1e7&&!((new Date).getTime()-e>t);a++);},getRandom
|