From 936fbfe9a55bedf5004d0fc3470ebbeceb1aa070 Mon Sep 17 00:00:00 2001 From: Matteo Manzinello Date: Fri, 3 May 2019 13:03:42 +0200 Subject: [PATCH] gulp --- dist/mailgo.js | 5 +++++ dist/mailgo.min.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/mailgo.js b/dist/mailgo.js index fd11641..f494db1 100644 --- a/dist/mailgo.js +++ b/dist/mailgo.js @@ -82,3 +82,8 @@ mailgos.forEach((mailgo, index) => { false ); }); + +function validateEmail(email) { + var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + return re.test(email); +} diff --git a/dist/mailgo.min.js b/dist/mailgo.min.js index 57c5f93..cf703c6 100644 --- a/dist/mailgo.min.js +++ b/dist/mailgo.min.js @@ -1 +1 @@ -let mailgos=document.querySelectorAll('a[href^="mailto:"]:not(.no-mailgo)'),styles="\n .mailgo-modal-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgba(10,10,10,.86);\n opacity: 0.8;\n }\n .mailgo-modal {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: none;\n }\n .mailgo-modal.is-active {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .mailgo-modal-content {\n z-index: 1000;\n background-color: #fff;\n border-radius: 6px;\n box-shadow: 0 2px 3px rgba(10,10,10,.1), 0 0 0 1px rgba(10,10,10,.1);\n color: #4a4a4a;\n display: block;\n padding: 1.25rem;\n }\n",styleSheet=document.createElement("style");styleSheet.type="text/css",styleSheet.innerText=styles,document.head.appendChild(styleSheet),console.log("mailgo is WIP!"),mailgos.forEach((e,n)=>{let t=document.createElement("div");t.className="mailgo-modal",t.setAttribute("data-index",n);let l=document.createElement("div");l.className="mailgo-modal-background",t.appendChild(l);let a=document.createElement("div");a.className="mailgo-modal-content",t.appendChild(a);let o=document.createTextNode("mailgo");a.appendChild(o),e.parentNode.insertBefore(t,e.nextSibling),e.addEventListener("click",n=>{n.preventDefault(),e.nextElementSibling.classList.add("is-active")},!1),l.addEventListener("click",n=>{e.nextElementSibling.classList.remove("is-active")},!1)}); \ No newline at end of file +let mailgos=document.querySelectorAll('a[href^="mailto:"]:not(.no-mailgo)'),styles="\n .mailgo-modal-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgba(10,10,10,.86);\n opacity: 0.8;\n }\n .mailgo-modal {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: none;\n }\n .mailgo-modal.is-active {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .mailgo-modal-content {\n z-index: 1000;\n background-color: #fff;\n border-radius: 6px;\n box-shadow: 0 2px 3px rgba(10,10,10,.1), 0 0 0 1px rgba(10,10,10,.1);\n color: #4a4a4a;\n display: block;\n padding: 1.25rem;\n }\n",styleSheet=document.createElement("style");function validateEmail(e){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}styleSheet.type="text/css",styleSheet.innerText=styles,document.head.appendChild(styleSheet),console.log("mailgo is WIP!"),mailgos.forEach((e,t)=>{let n=document.createElement("div");n.className="mailgo-modal",n.setAttribute("data-index",t);let a=document.createElement("div");a.className="mailgo-modal-background",n.appendChild(a);let l=document.createElement("div");l.className="mailgo-modal-content",n.appendChild(l);let o=document.createTextNode("mailgo");l.appendChild(o),e.parentNode.insertBefore(n,e.nextSibling),e.addEventListener("click",t=>{t.preventDefault(),e.nextElementSibling.classList.add("is-active")},!1),a.addEventListener("click",t=>{e.nextElementSibling.classList.remove("is-active")},!1)}); \ No newline at end of file