2017-08-23 05:09:48 +00:00
|
|
|
extends layout.pug
|
|
|
|
|
2014-02-14 00:15:22 +00:00
|
|
|
mixin email(e, k)
|
2016-07-07 08:11:56 +00:00
|
|
|
button.btn.btn-xs.btn-default(onclick="showEmail(this, '"+e+"', '"+k+"')") Show Email
|
2014-02-14 00:15:22 +00:00
|
|
|
|
2017-08-23 05:09:48 +00:00
|
|
|
block content
|
|
|
|
.col-md-8.col-md-offset-2
|
|
|
|
h1 Contact
|
|
|
|
h3 Email
|
|
|
|
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
|
|
|
|
|
|
|
|
append footer
|
|
|
|
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));
|
2014-02-14 00:15:22 +00:00
|
|
|
}
|
2017-08-23 05:09:48 +00:00
|
|
|
email = dest.join("");
|
|
|
|
$("<a/>").attr("href", "mailto:" + email)
|
|
|
|
.text(email)
|
|
|
|
.insertBefore(btn);
|
|
|
|
$(btn).remove();
|
|
|
|
}
|