Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@abtasty/modal

Package Overview
Dependencies
Maintainers
10
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abtasty/modal - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

2

dist/main.js

@@ -1,1 +0,1 @@

!function(){"use strict";function t(t,e,a){document.body.addEventListener("click",function(o){var n=o.target;if(!a||!n.matches(a))for(;n;){if(n!==document&&n.matches(t)){e();break}n=n.parentNode}})}function e(t){var e={modalSize:DATA.size,modalTitle:DATA.modalTitle,modalContent:DATA.modalContent||t.outerHTML,closeButtonPosition:!!DATA.closeButtonPosition&&DATA.closeButtonPosition,modalTypeMedia:!!t,link:DATA.url};v.className="abtasty-modal abtasty-modal--"+y,v.dataset.testId=TEST_ID,v.innerHTML=f(e),document.body.appendChild(v),c=v.querySelector(".abtasty-modal__area"),DATA.closeButtonColor&&(v.querySelector(T).style.color=DATA.closeButtonColor)}function a(){"on"===DATA.actionTracking&&ABTastyEvent(DATA.actionTrackingName,null,TEST_ID)}function o(t){var e=t.indexOf("youtu")>-1,a=t.indexOf("vimeo")>-1;return e?t="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#\&\?]*).*/)[2]+"?rel=0":a&&(t="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]),t}function n(){if(p){var t=new Image;t.src=DATA.imgUrl,t.className="abtasty-modal__media",t.onload=function(){e(this),c.style.width=this.width+"px",c.style.height=this.height+"px"}}else if(h){var a=document.createElement("iframe"),n=DATA.size.split(" x "),i=n[0]+"px",r=n[1]+"px",l=o(DATA.videoLink);a.width=i,a.height=r,a.src=l,a.frameBorder=0,a.allowfullscreen=!0,e(a),c.style.width=i,c.style.height=r}else e()}function i(){if(!v.querySelector(_))return setTimeout(i,50);v.querySelector(_).addEventListener("click",l),v.querySelector(T).addEventListener("click",l)}function r(){v.style.display="block",a(),i(),s()}function l(){v.style.display="none","video"===y&&(v.innerHTML=v.innerHTML)}function d(){var t=DATA.cookieTime,e=localStorage.getItem(g);return!(t&&e&&-1!=t&&!b)||(0==t?!sessionStorage.getItem(g):e<Date.now()-24*t*60*60*1e3)}function s(){if(!b){var t=Date.now();localStorage.setItem(g,t),sessionStorage.setItem(g,t)}}!function(t,e){if("undefined"==typeof document)return e;t=t||"";var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}("abtasty-modal{display:none;z-index:1000000}abtasty-modal,abtasty-modal__underlay{position:fixed;top:0;left:0;width:100%;height:100%}abtasty-modal__underlay{background-color:rgba(0,0,0,.5);cursor:pointer}.abtasty-modal__area{top:0;left:0;right:0;width:auto;margin:10px!important;max-height:70%;z-index:100;position:relative;background-color:#fff;border:3px solid #fff;text-align:left}.abtasty-modal__area--media{max-width:80%;margin:auto!important;top:20%;max-height:50%;border:none}.abtasty-modal__close{float:right!important;font-size:44px;font-weight:300;background:transparent;border:0;color:#bbb;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;line-height:32px!important;margin-right:5px;cursor:pointer}.abtasty-modal__area--media .abtasty-modal__close{position:absolute;right:0;color:#e6e6e6}.abtasty-modal__area--media .abtasty-modal__close--outside{top:-40px;right:-35px}.abtasty-modal__media,.abtasty-modal__media-link{max-width:100%;display:block}.abtasty-modal__text{padding:20px;font-family:Open Sans,sans-serif!important;color:#000}.abtasty-modal__title{text-align:left;width:auto;font-size:31px!important;font-weight:500;line-height:1.1;margin-bottom:10px}.abtasty-modal__text p{margin:0 0 10px!important;font-size:15px;font-weight:300}@media (min-width:630px){.abtasty-modal__area--medium{width:600px;margin:150px auto!important}}@media (min-width:330px){.abtasty-modal__area--small{width:300px;margin:150px auto!important}}@media (min-width:930px){.abtasty-modal__area--large{width:900px;margin:150px auto!important}}",void 0);var c,m,u=function(t){function e(t,a){if(1===arguments.length){for(var o=t[0],n=1;n<t.length;n++)o=e(o,t[n]);return o}for(var r in a)if("class"===r){l=t[r]||[];t[r]=(Array.isArray(l)?l:[l]).concat(a[r]||[])}else if("style"===r){var l=i(t[r]),d=i(a[r]);t[r]=l+d}else t[r]=a[r];return t}function a(t,e){for(var a,o="",i="",r=Array.isArray(e),d=0;d<t.length;d++)(a=n(t[d]))&&(r&&e[d]&&(a=l(a)),o=o+i+a,i=" ");return o}function o(t){var e="",a="";for(var o in t)o&&t[o]&&s.call(t,o)&&(e=e+a+o,a=" ");return e}function n(t,e){return Array.isArray(t)?a(t,e):t&&"object"==typeof t?o(t):t||""}function i(t){if(!t)return"";if("object"==typeof t){var e="";for(var a in t)s.call(t,a)&&(e=e+a+":"+t[a]+";");return e}return";"!==(t+="")[t.length-1]?t+";":t}function r(t,e,a,o){return!1!==e&&null!=e&&(e||"class"!==t&&"style"!==t)?!0===e?" "+(o?t:t+'="'+t+'"'):("function"==typeof e.toJSON&&(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),a||-1===e.indexOf('"'))?(a&&(e=l(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"&#39;")+"'"):""}function l(t){var e=""+t,a=c.exec(e);if(!a)return t;var o,n,i,r="";for(o=a.index,n=0;o<e.length;o++){switch(e.charCodeAt(o)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}n!==o&&(r+=e.substring(n,o)),n=o+1,r+=i}return n!==o?r+e.substring(n,o):r}function d(t,e,a,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&e||o))throw t.message+=" on line "+a,t;try{o=o||require("fs").readFileSync(e,"utf8")}catch(e){d(t,null,a)}var n=3,i=o.split("\n"),r=Math.max(a-n,0),l=Math.min(i.length,a+n),n=i.slice(r,l).map(function(t,e){var o=e+r+1;return(o==a?" > ":" ")+o+"| "+t}).join("\n");throw t.path=e,t.message=(e||"Pug")+":"+a+"\n"+n+"\n\n"+t.message,t}var s=Object.prototype.hasOwnProperty;t.merge=e,t.classes=n,t.style=i,t.attr=r,t.attrs=function(t,e){var a="";for(var o in t)if(s.call(t,o)){var l=t[o];if("class"===o){a=r(o,l=n(l),!1,e)+a;continue}"style"===o&&(l=i(l)),a+=r(o,l,!1,e)}return a};var c=/["&<>]/;return t.escape=l,t.rethrow=d,t}({}),f=function(t){var e,a="";try{var o={},n=t||{};(function(t,o,n,i,r,l){a=(a+="<abtasty-modal__underlay></abtasty-modal__underlay>")+"<div"+u.attr("class",u.classes(["abtasty-modal__area abtasty-modal__area--"+(l?"media":""+i)],[!0]),!1,!0)+">",a=a+"<div"+u.attr("class",u.classes(["abtasty-modal__close",t?"abtasty-modal__close--"+t:""],[!1,!0]),!1,!0)+">",a+="×</div>",a+='<div class="abtasty-modal__content">',l?o?(a=a+'<a class="abtasty-modal__media-link"'+u.attr("href",o,!0,!0)+">",a=a+(null==(e=n)?"":e)+"</a>"):a+=null==(e=n)?"":e:(a+='<div class="abtasty-modal__text">',a=(a+='<h2 class="abtasty-modal__title">')+u.escape(null==(e=r)?"":e)+"</h2>",a=a+(null==(e=n)?"":e)+"</div>"),a+="</div></div>"}).call(this,"closeButtonPosition"in n?n.closeButtonPosition:"undefined"!=typeof closeButtonPosition?closeButtonPosition:void 0,"link"in n?n.link:"undefined"!=typeof link?link:void 0,"modalContent"in n?n.modalContent:"undefined"!=typeof modalContent?modalContent:void 0,"modalSize"in n?n.modalSize:"undefined"!=typeof modalSize?modalSize:void 0,"modalTitle"in n?n.modalTitle:"undefined"!=typeof modalTitle?modalTitle:void 0,"modalTypeMedia"in n?n.modalTypeMedia:"undefined"!=typeof modalTypeMedia?modalTypeMedia:void 0)}catch(t){u.rethrow(t,void 0,void 0,o[void 0])}return a},y=DATA.modalType,p="image"===y&&DATA.imgUrl,h="video"===y&&DATA.videoLink,v=document.createElement("abtasty-modal"),g="AB Tasty Modal "+y+" "+TEST_ID,b=void 0!==window.ABTastyEditor,_="abtasty-modal__underlay",T=".abtasty-modal__close",A={pageLoad:r,exitIntent:function(){document.body.addEventListener("mouseleave",function t(e){e.clientY<=50&&(r(),document.body.removeEventListener("mouseleave",t))},!1)},reengage:function(){var t=["mousemove","keydown","scroll"];t.forEach(function(e){document.addEventListener(e,function e(){clearTimeout(m),m=setTimeout(function(){r(),t.forEach(function(t){return document.removeEventListener(t,e)})},1e3*DATA.timer)},!1)})},timer:function(){setTimeout(r,1e3*DATA.timer)}};!function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(function(){n(),"click"===DATA.trigger?t(DATA.selector,r,_+", "+T):d()&&A[DATA.trigger]()})}();
!function(){"use strict";function t(t){var e={modalSize:DATA.size,modalTitle:DATA.modalTitle,modalContent:DATA.modalContent||t.outerHTML,closeButtonPosition:!!DATA.closeButtonPosition&&DATA.closeButtonPosition,modalTypeMedia:!!t,link:DATA.url};if(c.className="abtasty-modal abtasty-modal--"+d,c.dataset.testId=TEST_ID,c.innerHTML=l(e),document.body.appendChild(c),n=c.querySelector(".abtasty-modal__area"),DATA.closeButtonColor){c.querySelector(h).style.color=DATA.closeButtonColor}}function e(){if(!c.querySelector(p))return setTimeout(e,50);c.querySelector(p).addEventListener("click",o),c.querySelector(h).addEventListener("click",o)}function a(){c.style.display="block","on"===DATA.actionTracking&&ABTastyEvent(DATA.actionTrackingName,null,TEST_ID),e(),function(){if(f)return;var t=Date.now();localStorage.setItem(u,t),sessionStorage.setItem(u,t)}()}function o(){c.style.display="none","video"===d&&(c.innerHTML=c.innerHTML)}!function(t,e){if("undefined"==typeof document)return e;t=t||"";var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}("abtasty-modal{display:none;z-index:1000000}abtasty-modal,abtasty-modal__underlay{position:fixed;top:0;left:0;width:100%;height:100%}abtasty-modal__underlay{background-color:rgba(0,0,0,.5);cursor:pointer}.abtasty-modal__area{top:0;left:0;right:0;width:auto;margin:10px!important;max-height:70%;z-index:100;position:relative;background-color:#fff;border:3px solid #fff;text-align:left}.abtasty-modal__area--media{max-width:80%;margin:auto!important;top:20%;max-height:50%;border:none}.abtasty-modal__close{float:right!important;font-size:44px;font-weight:300;background:transparent;border:0;color:#bbb;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;line-height:32px!important;margin-right:5px;cursor:pointer}.abtasty-modal__area--media .abtasty-modal__close{position:absolute;right:0;color:#e6e6e6}.abtasty-modal__area--media .abtasty-modal__close--outside{top:-40px;right:-35px}.abtasty-modal__media,.abtasty-modal__media-link{max-width:100%;display:block}.abtasty-modal__text{padding:20px;font-family:Open Sans,sans-serif!important;color:#000}.abtasty-modal__title{text-align:left;width:auto;font-size:31px!important;font-weight:500;line-height:1.1;margin-bottom:10px}.abtasty-modal__text p{margin:0 0 10px!important;font-size:15px;font-weight:300}@media (min-width:630px){.abtasty-modal__area--medium{width:600px;margin:150px auto!important}}@media (min-width:330px){.abtasty-modal__area--small{width:300px;margin:150px auto!important}}@media (min-width:930px){.abtasty-modal__area--large{width:900px;margin:150px auto!important}}",void 0);var n,i,r=function(t){function e(t,a){if(1===arguments.length){for(var n=t[0],i=1;i<t.length;i++)n=e(n,t[i]);return n}for(var r in a)if("class"===r){l=t[r]||[];t[r]=(Array.isArray(l)?l:[l]).concat(a[r]||[])}else if("style"===r){var l=o(t[r]),d=o(a[r]);t[r]=l+d}else t[r]=a[r];return t}function a(t,e){return Array.isArray(t)?function(t,e){for(var o,n="",r="",l=Array.isArray(e),d=0;d<t.length;d++)(o=a(t[d]))&&(l&&e[d]&&(o=i(o)),n=n+r+o,r=" ");return n}(t,e):t&&"object"==typeof t?function(t){var e="",a="";for(var o in t)o&&t[o]&&l.call(t,o)&&(e=e+a+o,a=" ");return e}(t):t||""}function o(t){if(!t)return"";if("object"==typeof t){var e="";for(var a in t)l.call(t,a)&&(e=e+a+":"+t[a]+";");return e}return";"!==(t+="")[t.length-1]?t+";":t}function n(t,e,a,o){return!1!==e&&null!=e&&(e||"class"!==t&&"style"!==t)?!0===e?" "+(o?t:t+'="'+t+'"'):("function"==typeof e.toJSON&&(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),a||-1===e.indexOf('"'))?(a&&(e=i(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"&#39;")+"'"):""}function i(t){var e=""+t,a=d.exec(e);if(!a)return t;var o,n,i,r="";for(o=a.index,n=0;o<e.length;o++){switch(e.charCodeAt(o)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}n!==o&&(r+=e.substring(n,o)),n=o+1,r+=i}return n!==o?r+e.substring(n,o):r}function r(t,e,a,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&e||o))throw t.message+=" on line "+a,t;try{o=o||require("fs").readFileSync(e,"utf8")}catch(e){r(t,null,a)}var n=3,i=o.split("\n"),l=Math.max(a-n,0),d=Math.min(i.length,a+n),n=i.slice(l,d).map(function(t,e){var o=e+l+1;return(o==a?" > ":" ")+o+"| "+t}).join("\n");throw t.path=e,t.message=(e||"Pug")+":"+a+"\n"+n+"\n\n"+t.message,t}var l=Object.prototype.hasOwnProperty;t.merge=e,t.classes=a,t.style=o,t.attr=n,t.attrs=function(t,e){var i="";for(var r in t)if(l.call(t,r)){var d=t[r];if("class"===r){i=n(r,d=a(d),!1,e)+i;continue}"style"===r&&(d=o(d)),i+=n(r,d,!1,e)}return i};var d=/["&<>]/;return t.escape=i,t.rethrow=r,t}({}),l=function(t){var e,a="";try{var o={},n=t||{};(function(t,o,n,i,l,d){a=(a+="<abtasty-modal__underlay></abtasty-modal__underlay>")+"<div"+r.attr("class",r.classes(["abtasty-modal__area abtasty-modal__area--"+(d?"media":""+i)],[!0]),!1,!0)+">",a=a+"<div"+r.attr("class",r.classes(["abtasty-modal__close",t?"abtasty-modal__close--"+t:""],[!1,!0]),!1,!0)+">",a+="×</div>",a+='<div class="abtasty-modal__content">',d?o?(a=a+'<a class="abtasty-modal__media-link"'+r.attr("href",o,!0,!0)+">",a=a+(null==(e=n)?"":e)+"</a>"):a+=null==(e=n)?"":e:(a+='<div class="abtasty-modal__text">',a=(a+='<h2 class="abtasty-modal__title">')+r.escape(null==(e=l)?"":e)+"</h2>",a=a+(null==(e=n)?"":e)+"</div>"),a+="</div></div>"}).call(this,"closeButtonPosition"in n?n.closeButtonPosition:"undefined"!=typeof closeButtonPosition?closeButtonPosition:void 0,"link"in n?n.link:"undefined"!=typeof link?link:void 0,"modalContent"in n?n.modalContent:"undefined"!=typeof modalContent?modalContent:void 0,"modalSize"in n?n.modalSize:"undefined"!=typeof modalSize?modalSize:void 0,"modalTitle"in n?n.modalTitle:"undefined"!=typeof modalTitle?modalTitle:void 0,"modalTypeMedia"in n?n.modalTypeMedia:"undefined"!=typeof modalTypeMedia?modalTypeMedia:void 0)}catch(t){r.rethrow(t,void 0,void 0,o[void 0])}return a},d=DATA.modalType,s="image"===d&&DATA.imgUrl,m="video"===d&&DATA.videoLink,c=document.createElement("abtasty-modal"),u="AB Tasty Modal "+d+" "+TEST_ID,f=void 0!==window.ABTastyEditor,y=!!sessionStorage.getItem("ABTastyPreview"),p="abtasty-modal__underlay",h=".abtasty-modal__close",v={pageLoad:a,exitIntent:function(){document.body.addEventListener("mouseleave",function t(e){e.clientY<=50&&(a(),document.body.removeEventListener("mouseleave",t))},!1)},reengage:function(){var t=["mousemove","keydown","scroll"];t.forEach(function(e){document.addEventListener(e,function e(){clearTimeout(i),i=setTimeout(function(){a(),t.forEach(function(t){return document.removeEventListener(t,e)})},1e3*DATA.timer)},!1)})},timer:function(){setTimeout(a,1e3*DATA.timer)}};!function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(function(){!function(){if(s){var e=new Image;e.src=DATA.imgUrl,e.className="abtasty-modal__media",e.onload=function(){t(this),n.style.width=this.width+"px",n.style.height=this.height+"px"}}else if(m){var a=document.createElement("iframe"),o=DATA.size.split(" x "),i=o[0]+"px",r=o[1]+"px",l=function(t){var e=t.indexOf("youtu")>-1,a=t.indexOf("vimeo")>-1;return e?t="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#\&\?]*).*/)[2]+"?rel=0":a&&(t="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]),t}(DATA.videoLink);a.width=i,a.height=r,a.src=l,a.frameBorder=0,a.allowfullscreen=!0,t(a),n.style.width=i,n.style.height=r}else t()}(),"click"===DATA.trigger?function(t,e,a){document.body.addEventListener("click",function(o){var n=o.target;if(!a||!n.matches(a))for(;n;){if(n!==document&&n.matches(t)){e();break}n=n.parentNode}})}(DATA.selector,a,p+", "+h):function(){var t=DATA.cookieTime,e=localStorage.getItem(u);return!(t&&e&&-1!=t&&!f&&!y)||(0==t?!sessionStorage.getItem(u):e<Date.now()-24*t*60*60*1e3)}()&&v[DATA.trigger]()})}();
{
"name": "@abtasty/modal",
"description": "Widget for AB Tasty",
"version": "1.2.3",
"version": "1.2.4",
"icon": "icon.png",

@@ -6,0 +6,0 @@ "form": "form.html",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc