aboutsummaryrefslogtreecommitdiff
path: root/static/js/email.js
diff options
context:
space:
mode:
authorJieiku2023-08-17 12:16:18 -0700
committerJieiku2023-08-17 12:16:18 -0700
commit3e5d8a96e9eae21a799f327cd8a52adb891ebe66 (patch)
tree6a1377b5207e4e3555f65ca162014468c64d6985 /static/js/email.js
parent1d9be812c25508a5dc36afb9e80669b668a47190 (diff)
parent0983915e23793c28dd0bee149fd2ec05a7e96a94 (diff)
downloadabridge-3e5d8a96e9eae21a799f327cd8a52adb891ebe66.tar.gz
abridge-3e5d8a96e9eae21a799f327cd8a52adb891ebe66.tar.bz2
abridge-3e5d8a96e9eae21a799f327cd8a52adb891ebe66.zip
resolve merge conflicts
Diffstat (limited to 'static/js/email.js')
-rw-r--r--static/js/email.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/static/js/email.js b/static/js/email.js
new file mode 100644
index 0000000..01e338a
--- /dev/null
+++ b/static/js/email.js
@@ -0,0 +1,16 @@
+(function() {
+ // Find all the elements on the page that use class="m-protected"
+ var allElements = document.getElementsByClassName('m-protected');
+
+ // Loop through all the elements, and update them
+ for (var i = 0; i < allElements.length; i++) {
+ // fetch the hex-encoded string from the href property
+ var encoded = allElements[i].getAttribute('href');
+
+ // decode the email address
+ var decoded = atob(encoded.substring(1));
+
+ // Set the link to be a "mailto:" link
+ allElements[i].href = 'mailto:' + decoded;
+ }
+})();