diff --git a/dist/mailgo.min.js b/dist/mailgo.min.js
index 40b9d79..b46e8c8 100644
--- a/dist/mailgo.min.js
+++ b/dist/mailgo.min.js
@@ -1 +1 @@
-"use strict";var _this=void 0,mailgoVersion="0.8.1";!function(){function o(){var t=ct("div");t.style.display="none",t.id="mailgo",t.classList.add("m-modal");var e=ct("div");e.className="m-modal-back",t.ch(e);var o=ct("div");o.className="m-modal-content",t.ch(o),(_=ct("strong")).id="m-title",_.className="m-title",o.ch(_);var a=ct("div");a.id="m-details",a.className="m-details",(P=ct("p")).id="m-cc";var n=ct("span");n.className="w-500";var i=st("cc ");n.ch(i),(F=ct("span")).id="m-cc-value",P.ch(n),P.ch(F),a.ch(P),(B=ct("p")).id="m-bcc";var c=ct("span");c.className="w-500";var s=st("bcc ");c.ch(s),(G=ct("span")).id="m-bcc-value",B.ch(c),B.ch(G),a.ch(B),(O=ct("p")).id="m-subject";var r=ct("span");r.className="w-500";var d=st("subject ");r.ch(d),(V=ct("span")).id="m-subject-value",O.ch(r),O.ch(V),a.ch(O),(Z=ct("p")).id="m-body";var l=ct("span");l.className="w-500";var m=st("body ");l.ch(m),($=ct("span")).id="m-body-value",Z.ch(l),Z.ch($),a.ch(Z),o.ch(a),(q=ct("a")).id="m-gmail",q.href=at,q.classList.add("m-open"),q.classList.add("m-gmail");var p=st("open in ");q.ch(p);var b=ct("span");b.className="w-500";var h=st("Gmail");b.ch(h),q.ch(b),o.ch(q),(J=ct("a")).id="m-outlook",J.href=at,J.classList.add("m-open"),J.classList.add("m-outlook");var u=st("open in ");J.ch(u);var f=ct("span");f.className="w-500";var g=st("Outlook");f.ch(g),J.ch(f),o.ch(J),(K=ct("a")).id="m-open",K.href=at,K.classList.add("m-open"),K.classList.add("m-default");var v=ct("span");v.className="w-500";var w=st("open");v.ch(w);var x=st(" default");K.ch(v),K.ch(x),o.ch(K),(et=ct("a")).id="m-copy",et.href=at,et.classList.add("m-copy"),et.classList.add("w-500");var y=st("copy");et.ch(y),o.ch(et),o.ch(it()),document.body.ch(t),e.addEventListener("click",nt);var k=ct("div");k.style.display="none",k.id="mailgo-tel",k.classList.add("m-modal");var L=ct("div");L.className="m-modal-back",k.ch(L);var z=ct("div");z.className="m-modal-content",k.ch(z),(D=ct("strong")).id="m-tel-title",D.className="m-title",z.ch(D),(Q=ct("a")).id="m-tg",Q.href=at,Q.classList.add("m-open"),Q.classList.add("m-tg"),Q.style.display="none";var C=st("open in ");Q.ch(C);var A=ct("span");A.className="w-500";var E=st("Telegram");A.ch(E),Q.ch(A),z.ch(Q),(X=ct("a")).id="m-wa",X.href=at,X.classList.add("m-open"),X.classList.add("m-wa");var N=st("open in ");X.ch(N);var j=ct("span");j.className="w-500";var R=st("WhatsApp");j.ch(R),X.ch(j),z.ch(X),(Y=ct("a")).id="m-skype",Y.href=at,Y.classList.add("m-open"),Y.classList.add("m-skype");var U=st("open in ");Y.ch(U);var I=ct("span");I.className="w-500";var S=st("Skype");I.ch(S),Y.ch(I),z.ch(Y),(tt=ct("a")).id="m-call",tt.href=at,tt.classList.add("m-open"),tt.classList.add("m-default");var T=ct("span");T.className="w-500";var M=st("call");T.ch(M);var H=st(" as default");tt.ch(T),tt.ch(H),z.ch(tt),(ot=ct("a")).id="m-tel-copy",ot.href=at,ot.classList.add("m-copy"),ot.classList.add("w-500");var W=st("copy");ot.ch(W),z.ch(ot),z.ch(it()),document.body.ch(k),L.addEventListener("click",nt)}function a(t,e){var o=0"),h?(P.style.display="block",F.innerHTML=h.split(",").join("
")):P.style.display="none",u?(B.style.display="block",G.innerHTML=u.split(",").join("
")):B.style.display="none",f?(O.style.display="block",V.textContent=f):O.style.display="none",g?(Z.style.display="block",$.textContent=g):Z.style.display="none",q.addEventListener("click",y),J.addEventListener("click",k),b=I(p),K.addEventListener("click",L),et.addEventListener("click",function(){return N(p)})}o===l&&(a.href&&a.href.toLowerCase().startsWith(s)?v=decodeURIComponent(a.href.split("?")[0].split(s)[1].trim()):a.href&&a.href.toLowerCase().startsWith(r)?v=decodeURIComponent(a.href.split("?")[0].split(r)[1].trim()):a.hasAttribute("data-tel")&&(v=a.getAttribute("data-tel"),a.getAttribute("data-msg")),a.hasAttribute("data-telegram")&&(w=a.getAttribute("data-telegram")),a.hasAttribute("data-skype")&&(x=a.getAttribute("data-skype")),D.innerHTML=v,X.addEventListener("click",A),w&&(M("m-tg","block"),Q.addEventListener("click",z)),Y.addEventListener("click",C),tt.addEventListener("click",E),ot.addEventListener("click",function(){return N(v)})),R(o),document.addEventListener("keydown",j)}function n(t,e){var o=1()[\]\\.,;:\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(t)}var t=function(t){return window.location.href=c+atob(t)},I=function(t){return btoa(t)},S=function(t){return document.getElementById(t)},T=function(t){return S(t).style.display},M=function(t,e){return S(t).style.display=e},H=function(t){for(var e=[];t;){if(e.push(t),"HTML"===t.tagName)return e.push(document),e.push(window),e;t=t.parentElement}},W=function(t){return t.every(e)},rt=function(t){var e=ct("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.ch(e);var o=0"),h?(P.style.display="block",F.innerHTML=h.split(",").join("
")):P.style.display="none",u?(B.style.display="block",G.innerHTML=u.split(",").join("
")):B.style.display="none",f?(O.style.display="block",V.textContent=f):O.style.display="none",g?(Z.style.display="block",$.textContent=g):Z.style.display="none",q.addEventListener("click",C),J.addEventListener("click",y),b=I(p),K.addEventListener("click",k),ae.addEventListener("click",function(){return N(p)})}t===c&&(o.href&&o.href.toLowerCase().startsWith(l)?v=decodeURIComponent(o.href.split("?")[0].split(l)[1].trim()):o.href&&o.href.toLowerCase().startsWith(s)?v=decodeURIComponent(o.href.split("?")[0].split(s)[1].trim()):o.hasAttribute("data-tel")&&(v=o.getAttribute("data-tel"),o.getAttribute("data-msg")),o.hasAttribute("data-telegram")&&(w=o.getAttribute("data-telegram")),o.hasAttribute("data-skype")&&(x=o.getAttribute("data-skype")),D.innerHTML=v,X.addEventListener("click",A),w&&(M("m-tg","block"),Q.addEventListener("click",L)),Y.addEventListener("click",z),ee.addEventListener("click",E),te.addEventListener("click",function(){return N(v)})),R(t),document.addEventListener("keydown",j)}function n(e,a){var t=1()[\]\\.,;:\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)}var _,D,P,B,O,Z,F,G,V,$,q,J,K,Q,X,Y,ee,ae,te,d="mailto:",l="tel:",s="callto:",r="mail",c="tel",oe="javascript:void(0);",m="",p="",b="",h="",u="",f="",g="",v="",w="",x="",C=function(){var e="https://mail.google.com/mail/u/0/?view=cm&source=mailto&to="+encodeURIComponent(p);h&&(e=e.concat("&cc="+encodeURIComponent(h))),u&&(e=e.concat("&bcc="+encodeURIComponent(u))),f&&(e=e.concat("&subject="+f)),g&&(e=e.concat("&body="+g)),window.open(e,"_blank"),ne()},y=function(){var e="https://outlook.live.com/owa/?path=/mail/action/compose&to="+encodeURIComponent(p);f&&(e=e.concat("&subject="+f)),g&&(e=e.concat("&body="+g)),window.open(e,"_blank"),ne()},k=function(){e(b),ne()},L=function(){var e="https://t.me/"+w;window.open(e,"_blank"),ne()},z=function(){var e="skype:"+(""!==x?x:v);window.open(e,"_blank"),ne()},A=function(){var e="https://wa.me/"+v;window.open(e,"_blank"),ne()},E=function(){var e="tel:"+v;window.open(e),ne()},N=function(e){var a;se(e),(a=U(r)?ae:te).textContent="copied",setTimeout(function(){a.textContent="copy",ne()},999)},j=function(e){if(U(r))switch(e.keyCode){case 27:ne();break;case 71:C();break;case 79:y();break;case 32:case 13:k();break;case 67:N(p);break;default:return}else if(U(c))switch(e.keyCode){case 27:ne();break;case 84:L();break;case 87:A();break;case 32:case 13:E();break;case 67:N(v);break;default:return}},R=function(e){var a=0"),U?(c.style.display="block",s.innerHTML=U.split(",").join("
")):c.style.display="none",M?(r.style.display="block",m.innerHTML=M.split(",").join("
")):r.style.display="none",I?(l.style.display="block",p.textContent=I):l.style.display="none",T?(d.style.display="block",u.textContent=T):d.style.display="none",b.addEventListener("click",P),f.addEventListener("click",W),R=oe(S),h.addEventListener("click",D),y.addEventListener("click",(function(){return $(S)}))}o===A&&(a.href&&a.href.toLowerCase().startsWith(z)?_=decodeURIComponent(a.href.split("?")[0].split(z)[1].trim()):a.href&&a.href.toLowerCase().startsWith(C)?_=decodeURIComponent(a.href.split("?")[0].split(C)[1].trim()):a.hasAttribute("data-tel")&&(_=a.getAttribute("data-tel"),a.getAttribute("data-msg")),a.hasAttribute("data-telegram")&&(O=a.getAttribute("data-telegram")),a.hasAttribute("data-skype")&&(H=a.getAttribute("data-skype")),i.innerHTML=_,v.addEventListener("click",F),O&&(ie("m-tg","block"),g.addEventListener("click",B)),x.addEventListener("click",Z),w.addEventListener("click",G),k.addEventListener("click",(function(){return $(_)}))),J(o),document.addEventListener("keydown",q)}function o(e,t){var o=1()[\]\\.,;:\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)}HTMLElement.prototype.ch=function(e){return(void 0).appendChild(e)};var te=function(e){return window.location.href=L+atob(e)},oe=function(e){return btoa(e)},ae=function(e){return document.getElementById(e)},ne=function(e){return ae(e).style.display},ie=function(e,t){return ae(e).style.display=t},ce=function(e){for(var t=[];e;){if(t.push(e),"HTML"===e.tagName)return t.push(document),t.push(window),t;e=e.parentElement}},re=function(e){return e.every(ee)},le=function(e){var t=X("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.ch(t);var o=0"),I?(l.style.display="block",m.innerHTML=I.split(",").join("
")):l.style.display="none",M?(r.style.display="block",p.innerHTML=M.split(",").join("
")):r.style.display="none",_?(s.style.display="block",u.textContent=_):s.style.display="none",T?(c.style.display="block",b.textContent=T):c.style.display="none",f.addEventListener("click",H),h.addEventListener("click",D),U=ae(R),g.addEventListener("click",B),C.addEventListener("click",(function(){return q(R)}))}a===E&&(o.href&&o.href.toLowerCase().startsWith(z)?O=decodeURIComponent(o.href.split("?")[0].split(z)[1].trim()):o.href&&o.href.toLowerCase().startsWith(j)?O=decodeURIComponent(o.href.split("?")[0].split(j)[1].trim()):o.hasAttribute("data-tel")&&(O=o.getAttribute("data-tel"),o.getAttribute("data-msg")),o.hasAttribute("data-telegram")&&(P=o.getAttribute("data-telegram")),o.hasAttribute("data-skype")&&(W=o.getAttribute("data-skype")),d.innerHTML=O,x.addEventListener("click",G),P&&(ie("m-tg","block"),v.addEventListener("click",Z)),w.addEventListener("click",F),y.addEventListener("click",$),k.addEventListener("click",(function(){return q(O)}))),K(a),document.addEventListener("keydown",J)}function a(e,t){var a=1()[\]\\.,;:\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)}var i,d,l,r,s,c,m,p,u,b,f,h,g,v,x,w,y,C,k,L="mailto:",z="tel:",j="callto:",A="mail",E="tel",N="javascript:void(0);",S="",R="",U="",I="",M="",_="",T="",O="",P="",W="",H=function(){var e="https://mail.google.com/mail/u/0/?view=cm&source=mailto&to="+encodeURIComponent(R);I&&(e=e.concat("&cc="+encodeURIComponent(I))),M&&(e=e.concat("&bcc="+encodeURIComponent(M))),_&&(e=e.concat("&subject="+_)),T&&(e=e.concat("&body="+T)),window.open(e,"_blank"),Q()},D=function(){var e="https://outlook.live.com/owa/?path=/mail/action/compose&to="+encodeURIComponent(R);_&&(e=e.concat("&subject="+_)),T&&(e=e.concat("&body="+T)),window.open(e,"_blank"),Q()},B=function(){te(U),Q()},Z=function(){var e="https://t.me/"+P;window.open(e,"_blank"),Q()},F=function(){var e="skype:"+(""!==W?W:O);window.open(e,"_blank"),Q()},G=function(){var e="https://wa.me/"+O;window.open(e,"_blank"),Q()},$=function(){var e="tel:"+O;window.open(e),Q()},q=function(e){var t;re(e),(t=V(A)?C:k).textContent="copied",setTimeout((function(){t.textContent="copy",Q()}),999)},J=function(e){if(V(A))switch(e.keyCode){case 27:Q();break;case 71:H();break;case 79:D();break;case 32:case 13:B();break;case 67:q(R);break;default:return}else if(V(E))switch(e.keyCode){case 27:Q();break;case 84:Z();break;case 87:G();break;case 32:case 13:$();break;case 67:q(O);break;default:return}},K=function(e){var t=0 document.createTextNode(element);
- // append child
- HTMLElement.prototype.ch = element => this.appendChild(element);
-
// decrypt email
const mailToEncoded = encoded =>
(window.location.href = MAILTO + atob(encoded));
@@ -830,7 +827,7 @@ const mailgoVersion = "MAILGO_VERSION";
el.setAttribute("readonly", "");
el.style.position = "absolute";
el.style.left = "-9999px";
- document.body.ch(el);
+ document.body.appendChild(el);
let selected =
document.getSelection().rangeCount > 0
? document.getSelection().getRangeAt(0)
@@ -853,8 +850,8 @@ const mailgoVersion = "MAILGO_VERSION";
mailgoCSS.id = "mailgo-style";
mailgoCSS.type = "text/css";
let mailgoCSSContent = createTextNode(`MAILGO_STYLE`);
- mailgoCSS.ch(mailgoCSSContent);
- document.head.ch(mailgoCSS);
+ mailgoCSS.appendChild(mailgoCSSContent);
+ document.head.appendChild(mailgoCSS);
// DOMContentLoaded -> mailgoInit (creates the modals)
document.addEventListener("DOMContentLoaded", mailgoInit);