@abtasty/modal
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -1,1 +0,1 @@ | ||
!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,"'")+"'"):""}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=""";break;case 38:i="&";break;case 60:i="<";break;case 62:i=">";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]()})}(); | ||
!function(){"use strict";function t(){u.style.display="none","video"===s&&(u.innerHTML=u.innerHTML)}function e(){return u.querySelector(h)?(u.querySelector(h).addEventListener("click",t),u.querySelector(v).addEventListener("click",t),0):setTimeout(e,50)}function a(){u.style.display="block","on"===DATA.actionTracking&&ABTastyEvent(DATA.actionTrackingName,null,TEST_ID),e(),y||(localStorage.setItem(f,g),sessionStorage.setItem(f,g))}function o(t){void 0===t&&(t=!1);var e={modalSize:DATA.size,modalTitle:DATA.modalTitle,modalContent:DATA.modalContent||t.outerHTML,closeButtonPosition:!!DATA.closeButtonPosition&&DATA.closeButtonPosition,modalTypeMedia:!!t,link:DATA.url};if(u.className="abtasty-modal abtasty-modal--"+s,u.dataset.testId=TEST_ID,u.innerHTML=d(e),document.body.appendChild(u),i=u.querySelector(".abtasty-modal__area"),DATA.closeButtonColor){u.querySelector(v).style.color=DATA.closeButtonColor}}function n(){!function(){if(m){var t=new Image;t.src=DATA.imgUrl,t.className="abtasty-modal__media",t.onload=function(){o(this),i.style.width=this.width+"px",i.style.height=this.height+"px"}}else if(c){var e=document.createElement("iframe"),a=DATA.size.split(" x "),n=a[0]+"px",r=a[1]+"px",l=function(t){var e,a=t.indexOf("youtu")>-1,o=t.indexOf("vimeo")>-1;return a?e="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/)[2]+"?rel=0":o&&(e="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]),e}(DATA.videoLink);e.width=n,e.height=r,e.src=l,e.frameBorder=0,e.allowfullscreen=!0,o(e),i.style.width=n,i.style.height=r}else o()}(),"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,h+", "+v):function(){var t=Number(DATA.cookieTime),e=localStorage.getItem(f);return!(e&&-1!==t&&!y&&!p)||(0===t?!sessionStorage.getItem(f):e<g-24*t*60*60*1e3)}()&&b[DATA.trigger]()}!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 i,r,l=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,"'")+"'"):""}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=""";break;case 38:i="&";break;case 60:i="<";break;case 62:i=">";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}({}),d=function(t){var e,a="";try{var o={},n=t||{};(function(t,o,n,i,r,d){a=(a+="<abtasty-modal__underlay></abtasty-modal__underlay>")+"<div"+l.attr("class",l.classes(["abtasty-modal__area abtasty-modal__area--"+(d?"media":""+i)],[!0]),!1,!0)+">",a=a+"<div"+l.attr("class",l.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"'+l.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">')+l.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){l.rethrow(t,void 0,void 0,o[void 0])}return a},s=DATA.modalType,m="image"===s&&DATA.imgUrl,c="video"===s&&DATA.videoLink,u=document.createElement("abtasty-modal"),f="AB Tasty Modal "+s+" "+TEST_ID,y=void 0!==window.ABTastyEditor,p=!!sessionStorage.getItem("ABTastyPreview"),h="abtasty-modal__underlay",v=".abtasty-modal__close",g=Date.now(),b={pageLoad:a,exitIntent:function(){var t=parseFloat(DATA.exitIntentDelay)||0,e=0,o=0;document.addEventListener("mousemove",function(t){o=t.clientY}),document.addEventListener("mouseleave",function n(i){i.clientY<=50&&(o=0,clearInterval(e),e=setTimeout(function(){0===o&&(a(),document.removeEventListener("mouseleave",n))},1e3*t))},!1)},reengage:function(){var t=["mousemove","keydown","scroll"];t.forEach(function(e){document.addEventListener(e,function e(){clearTimeout(r),r=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)}(n)}(); |
{ | ||
"name": "@abtasty/modal", | ||
"description": "Widget for AB Tasty", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"icon": "icon.png", | ||
@@ -26,8 +26,9 @@ "form": "form.html", | ||
"cssnano": "^3.10.0", | ||
"eslint": "^4.6.1", | ||
"eslint-config-google": "^0.9.1", | ||
"eslint": "^4.11.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"postcss-cssnext": "^3.0.2", | ||
"rollup": "^0.49.3", | ||
"rollup-plugin-buble": "^0.15.0", | ||
"rollup-plugin-commonjs": "^8.2.1", | ||
"rollup": "^0.51.5", | ||
"rollup-plugin-buble": "^0.17.0", | ||
"rollup-plugin-commonjs": "^8.2.6", | ||
"rollup-plugin-eslint": "^4.0.0", | ||
@@ -34,0 +35,0 @@ "rollup-plugin-node-resolve": "^3.0.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19654
32
0
16