diff --git a/static/js/obfuscate_email.js b/static/js/obfuscate_email.js new file mode 100644 index 0000000..f5bc692 --- /dev/null +++ b/static/js/obfuscate_email.js @@ -0,0 +1,25 @@ +function obfuscateEmail(item) { + let href = item.href; + let innerHTML = item.innerHTML; + item.onmouseover = (_this) => { + const elt = _this.target; + const b64email = elt.href.match('[^/]*$').pop(); + elt.href = 'mailto:' + atob(b64email); + elt.innerHTML = 'E-mail: ' + atob(b64email); + } + item.onmouseout = (_this) => { + _this.target.href = href; + _this.target.innerHTML = innerHTML; + } + +} + +function init() { + const elts = [] + const query = document.getElementsByClassName("obfuscated_email") + for (let i = 0; i < query.length; i++) { + obfuscateEmail(query[i]); + } +} + +window.onload = init diff --git a/templates/base.html b/templates/base.html index 9d2b9a6..6781b59 100644 --- a/templates/base.html +++ b/templates/base.html @@ -80,6 +80,7 @@ } }); + diff --git a/templates/partials/basics.html b/templates/partials/basics.html index 292f369..ffde66f 100644 --- a/templates/partials/basics.html +++ b/templates/partials/basics.html @@ -1,86 +1,43 @@ {% set basics = page.resume.basics %} {% if basics %} - + {% if basics.summary %} +
+
+
{{ basics.summary | replace("\r\n", "
") | replace("\n", "
") | replace("\r", "
") }}
+
+
+ {% endif %} {% endif %}