primo commit
This commit is contained in:
35
media/fef/js/Modal.min.js
vendored
Normal file
35
media/fef/js/Modal.min.js
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
Akeeba Frontend Framework (FEF)
|
||||
|
||||
@package fef
|
||||
@copyright (c) 2017-2022 Nicholas K. Dionysopoulos / Akeeba Ltd
|
||||
@license GNU General Public License version 3, or later
|
||||
jsModal - A pure JavaScript modal dialog engine v1.0d
|
||||
http://jsmodal.com/
|
||||
|
||||
Author: Henry Rune Tang Kai <henry@henrys.se>
|
||||
|
||||
(c) Copyright 2013 Henry Tang Kai.
|
||||
|
||||
License: http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
Date: 2013-7-11
|
||||
|
||||
Modified by Akeeba Ltd:
|
||||
- [Oct 2016] Prefix "akeeba-modal-" instead of generic "modal-" to avoid conflicts with 3PD software e.g. Bootstrap.
|
||||
- [Oct 2016] Remove support for AJAX content. We use our own AJAX handlers which work around 3PD plugins corrupting content.
|
||||
? [Oct 2016] Added method show() which just calls open() for backwards compatibility reasons.
|
||||
? [Oct 2016] Added parameter "inherit" where you can give a query selector for an element whose content will be inherited by the modal.
|
||||
? [Oct 2016] open() returns the Modal object so that we can interact with it through external code.
|
||||
? [Nov 2016] Added parameter "iframe" where you can give a URL to load inside an IFRAME.
|
||||
*/
|
||||
window.akeeba=window.akeeba||{};
|
||||
"undefined"==typeof akeeba.Modal&&(akeeba.Modal=function(){var e={},b={},f=document.createElement("div"),d=document.createElement("div"),k=document.createElement("div"),h=document.createElement("div"),m=document.createElement("div"),n=null,l,v;e.show=function(a){try{console.log("Using akeeba.Modal.show() is deprecated. Use .open() instead.")}catch(c){}return e.open(a)};e.open=function(a){b.width=a.width||"auto";b.height=a.height||"auto";b.lock=a.lock||!1;b.hideClose=a.hideClose||!1;b.draggable=a.draggable||
|
||||
!1;b.closeAfter=a.closeAfter||0;b.closeCallback=a.closeCallback||!1;b.openCallback=a.openCallback||!1;b.hideOverlay=a.hideOverlay||!1;l=function(){e.center({})};h.innerHTML="";var c=null;if(a.content)h.innerHTML=a.content;else if(a.inherit){if(c=a.inherit,"string"==typeof a.inherit&&(c=window.document.querySelector(a.inherit)),null!=c&&c.innerHTML)for(n=c;0<n.childNodes.length;)h.appendChild(n.childNodes[0])}else a.iframe&&(c=window.document.createElement("iframe"),c.setAttribute("src",a.iframe),
|
||||
c.setAttribute("width",a.width),c.setAttribute("height",a.height),c.setAttribute("frameborder",0),c.setAttribute("marginheight",0),c.setAttribute("marginwidth",0),h.appendChild(c));d.style.width=b.width;d.style.height=b.height;e.center({});if(b.lock||b.hideClose)m.style.visibility="hidden";b.hideOverlay||(f.style.visibility="visible");d.style.visibility="visible";document.onkeypress=function(g){27===g.keyCode&&!0!==b.lock&&e.close()};m.onclick=function(){if(b.hideClose)return!1;e.close()};f.onclick=
|
||||
function(){if(b.lock)return!1;e.close()};window.addEventListener?(window.addEventListener("resize",l,!1),window.addEventListener("load",l,!1)):window.attachEvent&&(window.attachEvent("onresize",l),window.attachEvent("onload",l));b.draggable?(k.style.cursor="move",k.onmousedown=function(g){e.drag(g);return!1}):k.onmousedown=function(){return!1};0<b.closeAfter&&(v=window.setTimeout(function(){e.close()},1E3*b.closeAfter));b.openCallback&&b.openCallback();return this};e.drag=function(a){var c=void 0!==
|
||||
window.event?window.event.clientX:a.clientX,g=void 0!==window.event?window.event.clientY:a.clientY,r=c-d.offsetLeft,p=g-d.offsetTop;document.onmousemove=function(q){c=void 0!==window.event?window.event.clientX:q.clientX;g=void 0!==window.event?window.event.clientY:q.clientY;d.style.left=0<c-r?c-r+"px":0;d.style.top=0<g-p?g-p+"px":0;document.onmouseup=function(){window.document.onmousemove=null}}};e.close=function(){if(!function(a){var c;if(""===a||0===a||"0"===a||null===a||!1===a||"undefined"===typeof a)return!0;
|
||||
if("object"==typeof a){for(c in a)return!1;return!0}return!1}(n)){for(;0<h.childNodes.length;)n.appendChild(h.childNodes[0]);n=null}h.innerHTML="";f.setAttribute("style","");f.style.cssText="";f.style.visibility="hidden";d.setAttribute("style","");d.style.cssText="";d.style.visibility="hidden";k.style.cursor="default";m.setAttribute("style","");m.style.cssText="";v&&window.clearTimeout(v);b.closeCallback&&b.closeCallback();window.removeEventListener?window.removeEventListener("resize",l,!1):window.detachEvent&&
|
||||
window.detachEvent("onresize",l)};e.center=function(a){var c=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),g=Math.max(d.clientWidth,d.offsetWidth),r=Math.max(d.clientHeight,d.offsetHeight),p=0,q=0,t=0,u=0;"number"===typeof window.innerWidth?(p=window.innerWidth,q=window.innerHeight):document.documentElement&&document.documentElement.clientWidth&&(p=document.documentElement.clientWidth,q=document.documentElement.clientHeight);"number"===typeof window.pageYOffset?(u=window.pageYOffset,
|
||||
t=window.pageXOffset):document.body&&document.body.scrollLeft?(u=document.body.scrollTop,t=document.body.scrollLeft):document.documentElement&&document.documentElement.scrollLeft&&(u=document.documentElement.scrollTop,t=document.documentElement.scrollLeft);a.horizontalOnly||(d.style.top=u+q/2-r/2+"px");d.style.left=t+p/2-g/2+"px";f.style.height=c+"px";f.style.width="100%"};f.setAttribute("id","akeeba-modal-overlay");d.setAttribute("id","akeeba-modal-container");k.setAttribute("id","akeeba-modal-header");
|
||||
h.setAttribute("id","akeeba-modal-content");m.setAttribute("id","akeeba-modal-close");k.appendChild(m);d.appendChild(k);d.appendChild(h);f.style.visibility="hidden";d.style.visibility="hidden";window.addEventListener?window.addEventListener("load",function(){document.body.appendChild(f);document.body.appendChild(d)},!1):window.attachEvent&&window.attachEvent("onload",function(){document.body.appendChild(f);document.body.appendChild(d)});return e}()); //# sourceMappingURL=Modal.map
|
||||
Reference in New Issue
Block a user