mylloon.fr/static/js/mail_obfuscation.js

21 lines
489 B
JavaScript
Raw Normal View History

2024-05-03 12:49:50 +02:00
window.addEventListener("load", () => {
Array.from(document.getElementsByClassName("at")).forEach((elem) => {
2024-06-02 18:44:57 +02:00
const a = elem.parentElement;
const span = elem.previousElementSibling;
2024-06-02 18:19:58 +02:00
// Replace (at) by @
elem.outerHTML = "@";
// Correct text
2024-06-02 18:44:57 +02:00
const data = span.getAttribute("title");
if (data.length > 0) {
a.innerHTML = data;
} else {
a.style = "hyphens: none;";
}
2024-05-29 20:51:04 +02:00
// Change link
2024-06-02 18:44:57 +02:00
a.setAttribute("href", a.textContent);
2024-05-03 12:49:50 +02:00
});
});