aggiunta funzionalità di encrypt email (da testare)
This commit is contained in:
@@ -156,7 +156,17 @@ mailgoInit = () => {
|
||||
|
||||
// open default
|
||||
let open = document.createElement("a");
|
||||
open.href = mailtoHref;
|
||||
|
||||
open.href = "#mailgo-open";
|
||||
let encEmail = encryptEmail(mail);
|
||||
open.addEventListener(
|
||||
"click",
|
||||
() => {
|
||||
mailToEncoded(encEmail);
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
open.classList.add("mailgo-open");
|
||||
open.classList.add("mailgo-weight-500");
|
||||
let openContent = document.createTextNode("open");
|
||||
@@ -248,3 +258,14 @@ copyToClipboard = str => {
|
||||
document.getSelection().addRange(selected);
|
||||
}
|
||||
};
|
||||
|
||||
// decrypt email
|
||||
function mailToEncoded(encoded) {
|
||||
var address = atob(encoded);
|
||||
window.location.href = "mailto:" + address;
|
||||
}
|
||||
|
||||
// encrypt email
|
||||
function encryptEmail(email) {
|
||||
return btoa(email);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user