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

@abtasty/modal

Package Overview
Dependencies
Maintainers
7
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.1.0 to 1.2.0

2

dist/main.js

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

!function(){"use strict";function t(t,e){var a=function(a){var o=a.target;if(!o.matches(_)&&!o.matches(T))for(;o;){if(o!==document&&o.matches(t)){e();break}o=o.parentNode}};document.body.addEventListener("click",a)}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};if(v.className="abtasty-modal abtasty-modal--"+y,v.dataset.testId=TEST_ID,v.innerHTML=f(e),document.body.appendChild(v),m=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;if(e){t="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#\&\?]*).*/)[2]+"?rel=0"}else if(a){var o=t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2];t="//player.vimeo.com/video/"+o}return t}function n(){if(p){var t=new Image;t.src=DATA.imgUrl,t.className="abtasty-modal__media",t.onload=function(){e(this),m.style.width=this.width+"px",m.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),m.style.width=i,m.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(b);return!(t&&e&&t!=-1&&!g)||(0==t?!sessionStorage.getItem(b):e<Date.now()-24*t*60*60*1e3)}function s(){if(!g){var t=Date.now();localStorage.setItem(b,t),sessionStorage.setItem(b,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",o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t)),a.appendChild(o),e}("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;box-shadow:0 0 10px #666;-moz-box-shadow:#666 0 0 10px;-webkit-box-shadow:#666 0 0 10px;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 m,c,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){var 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),l=0;l<t.length;l++)(a=n(t[l]))&&(r&&e[l]&&(a=d(a)),o=o+i+a,i=" ");return o}function o(t){var e="",a="";for(var o in t)o&&t[o]&&m.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)m.call(t,a)&&(e=e+a+":"+t[a]+";");return e}return t+="",";"!==t[t.length-1]?t+";":t}function r(t,e,a,o){return e!==!1&&null!=e&&(e||"class"!==t&&"style"!==t)?e===!0?" "+(o?t:t+'="'+t+'"'):("function"==typeof e.toJSON&&(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),a||e.indexOf('"')===-1)?(a&&(e=d(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"&#39;")+"'"):""}function l(t,e){var a="";for(var o in t)if(m.call(t,o)){var l=t[o];if("class"===o){l=n(l),a=r(o,l,!1,e)+a;continue}"style"===o&&(l=i(l)),a+=r(o,l,!1,e)}return a}function d(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 s(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){s(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 m=Object.prototype.hasOwnProperty;t.merge=e,t.classes=n,t.style=i,t.attr=r,t.attrs=l;var c=/["&<>]/;return t.escape=d,t.rethrow=s,t}({}),f=function(t){var e,a="";try{var o={},n=t||{};(function(t,o,n,i,r,l){a+="<abtasty-modal__underlay></abtasty-modal__underlay>",a=a+"<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+='<h2 class="abtasty-modal__title">',a=a+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"),b="AB Tasty Modal "+y+" "+TEST_ID,g=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(c),c=setTimeout(function(){r(),t.forEach(function(t){return document.removeEventListener(t,e)})},1e3*DATA.timer)},!1)})},timer:function(){setTimeout(r,1e3*DATA.timer)}};!function(){n(),"click"===DATA.trigger?t(DATA.selector,r):d()&&A[DATA.trigger]()}()}();
!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),m=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),m.style.width=this.width+"px",m.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),m.style.width=i,m.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(b);return!(t&&e&&-1!=t&&!g)||(0==t?!sessionStorage.getItem(b):e<Date.now()-24*t*60*60*1e3)}function s(){if(!g){var t=Date.now();localStorage.setItem(b,t),sessionStorage.setItem(b,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;box-shadow:0 0 10px #666;-moz-box-shadow:#666 0 0 10px;-webkit-box-shadow:#666 0 0 10px;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 m,c,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=m.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 m=/["&<>]/;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"),b="AB Tasty Modal "+y+" "+TEST_ID,g=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(c),c=setTimeout(function(){r(),t.forEach(function(t){return document.removeEventListener(t,e)})},1e3*DATA.timer)},!1)})},timer:function(){setTimeout(r,1e3*DATA.timer)}};n(),"click"===DATA.trigger?t(DATA.selector,r,_+", "+T):d()&&A[DATA.trigger]()}();
{
"name": "@abtasty/modal",
"description": "Widget for AB Tasty",
"version": "1.1.0",
"version": "1.2.0",
"icon": "icon.png",

@@ -27,17 +27,17 @@ "form": "form.html",

"cssnano": "^3.10.0",
"eslint": "^3.16.0",
"eslint-config-google": "^0.7.1",
"postcss-cssnext": "^2.9.0",
"rollup": "^0.41.4",
"eslint": "^4.6.1",
"eslint-config-google": "^0.9.1",
"postcss-cssnext": "^3.0.2",
"rollup": "^0.49.3",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-commonjs": "^7.0.0",
"rollup-plugin-eslint": "^3.0.0",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-postcss": "^0.2.0",
"rollup-plugin-pug": "^0.1.3",
"rollup-plugin-replace": "^1.1.1",
"rollup-plugin-uglify": "^1.0.1",
"rollup-watch": "^3.2.2"
"rollup-plugin-commonjs": "^8.2.1",
"rollup-plugin-eslint": "^4.0.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-postcss": "^0.5.5",
"rollup-plugin-pug": "^0.1.6",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.3.1"
},
"dependencies": {}
}

Sorry, the diff of this file is not supported yet

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