Current section

Files

Jump to
combo priv static html.min.js
Raw

priv/static/html.min.js

var Combo=Combo||{};Combo.HTML=(()=>{var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var g=(a,i)=>{for(var r in i)c(a,r,{get:i[r],enumerable:!0})},h=(a,i,r,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of m(i))!v.call(a,t)&&t!==r&&c(a,t,{get:()=>i[t],enumerable:!(d=p(i,t))||d.enumerable});return a};var w=a=>h(c({},"__esModule",{value:!0}),a);var y={};g(y,{default:()=>E,init:()=>b});function b(){var a=i();function i(){if(typeof window.CustomEvent=="function")return window.CustomEvent;function t(e,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var u=document.createEvent("CustomEvent");return u.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),u}return t.prototype=window.Event.prototype,t}function r(t,e){var n=document.createElement("input");return n.type="hidden",n.name=t,n.value=e,n}function d(t,e){var n=t.getAttribute("data-to"),u=r("_method",t.getAttribute("data-method")),s=r("_csrf_token",t.getAttribute("data-csrf")),o=document.createElement("form"),l=document.createElement("input"),f=t.getAttribute("target");o.method=t.getAttribute("data-method")==="get"?"get":"post",o.action=n,o.style.display="none",f?o.target=f:e&&(o.target="_blank"),o.appendChild(s),o.appendChild(u),document.body.appendChild(o),l.type="submit",o.appendChild(l),l.click()}window.addEventListener("click",function(t){var e=t.target;if(!t.defaultPrevented)for(;e&&e.getAttribute;){var n=new a("combo.link.click",{bubbles:!0,cancelable:!0});if(!e.dispatchEvent(n))return t.preventDefault(),t.stopImmediatePropagation(),!1;if(e.getAttribute("data-method")&&e.getAttribute("data-to"))return d(e,t.metaKey||t.shiftKey),t.preventDefault(),!1;e=e.parentNode}},!1),window.addEventListener("combo.link.click",function(t){var e=t.target.getAttribute("data-confirm");e&&!window.confirm(e)&&t.preventDefault()},!1)}var E={init:b};return w(y);})();
//# sourceMappingURL=html.min.js.map