sync/templates/contact.pug

48 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-02-14 00:15:22 +00:00
mixin email(e, k)
button.btn.btn-xs.btn-default(onclick="showEmail(this, '"+e+"', '"+k+"')") Show Email
2014-02-14 00:15:22 +00:00
doctype html
html(lang="en")
head
include head
+head()
2014-02-14 00:15:22 +00:00
body
#wrap
nav.navbar.navbar-inverse.navbar-fixed-top(role="navigation")
include nav
+navheader()
2014-02-14 00:15:22 +00:00
#nav-collapsible.collapse.navbar-collapse
ul.nav.navbar-nav
+navdefaultlinks("/contact")
+navloginlogout("/contact")
2014-02-14 00:15:22 +00:00
section#mainpage
.container
.col-md-8.col-md-offset-2
h1 Contact
h3 Email
2016-11-02 05:44:26 +00:00
if contacts.length == 0
p No contacts listed.
else
each contact in contacts
strong= contact.name
p.text-muted= contact.title
+email(contact.email, contact.emkey)
br
hr
2014-02-14 00:15:22 +00:00
include footer
+footer()
2014-02-14 00:15:22 +00:00
script(type="text/javascript").
function showEmail(btn, email, key) {
email = unescape(email);
key = unescape(key);
var dest = new Array(email.length);
for (var i = 0; i < email.length; i++) {
dest[i] = String.fromCharCode(email.charCodeAt(i) ^ key.charCodeAt(i % key.length));
}
email = dest.join("");
$("<a/>").attr("href", "mailto:" + email)
.text(email)
.insertBefore(btn);
$(btn).remove();
}