aggiunto listener al load
This commit is contained in:
parent
80aa99c919
commit
a1ff8f5fdc
@ -81,6 +81,7 @@ let styles = `
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
function mailgoInit() {
|
||||||
// ottengo tutti i mailto contenuti nella pagina
|
// ottengo tutti i mailto contenuti nella pagina
|
||||||
let mailgos = document.querySelectorAll('a[href^="mailto:"]:not(.no-mailgo)');
|
let mailgos = document.querySelectorAll('a[href^="mailto:"]:not(.no-mailgo)');
|
||||||
|
|
||||||
@ -136,7 +137,8 @@ mailgos.forEach(function(mailgo, index) {
|
|||||||
|
|
||||||
// Gmail
|
// Gmail
|
||||||
let gmail = document.createElement("a");
|
let gmail = document.createElement("a");
|
||||||
gmail.href = "https://mail.google.com/mail?extsrc=mailto&url=" + mailgo.href;
|
gmail.href =
|
||||||
|
"https://mail.google.com/mail?extsrc=mailto&url=" + mailgo.href;
|
||||||
gmail.classList.add("mailgo-open");
|
gmail.classList.add("mailgo-open");
|
||||||
gmail.classList.add("gmail");
|
gmail.classList.add("gmail");
|
||||||
let gmailContent = document.createTextNode("open in ");
|
let gmailContent = document.createTextNode("open in ");
|
||||||
@ -224,6 +226,9 @@ mailgos.forEach(function(mailgo, index) {
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("load", mailgoInit);
|
||||||
|
|
||||||
function validateEmail(email) {
|
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,}))$/;
|
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,}))$/;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user