@abtasty/modal
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -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),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(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 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,"'")+"'"):""}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=""";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 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"),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(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]()}(); | ||
!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,"'")+"'"):""}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=""";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 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]()})}(); |
{ | ||
"name": "@abtasty/modal", | ||
"description": "Widget for AB Tasty", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"icon": "icon.png", | ||
@@ -40,3 +40,5 @@ "form": "form.html", | ||
}, | ||
"dependencies": {} | ||
"dependencies": { | ||
"@abtasty/widget-utils": "^1.10.0" | ||
} | ||
} |
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
18628
1
+ Added@abtasty/widget-utils@1.18.38(transitive)