mylloon.fr/static/js/mail_obfuscation.js
Mylloon 0c6c88d181
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending approval
fix minifier
2024-06-02 18:58:36 +02:00

17 lines
511 B
JavaScript

window.addEventListener("load", () => {
Array.from(document.getElementsByClassName("at")).forEach((elem) => {
const a = elem.parentElement;
const span = elem.previousElementSibling;
// Replace (at) by @
elem.outerHTML = "@";
// Correct text
const data = span.getAttribute("title");
data.length > 0 ? (a.innerHTML = data) : (a.style = "hyphens: none;");
// Change link
const href = a.getAttribute("href");
a.setAttribute("href", href.replace(" at ", "@"));
});
});