Bump path-parse from 1.0.6 to 1.0.7
[KisSync.git] / templates / contact.pug
blob67f2cd37e1ee637043b4a7e8671f34e011b4f38f
1 extends layout.pug
3 mixin email(e, k)
4   button.btn.btn-xs.btn-default(onclick="showEmail(this, '"+e+"', '"+k+"')") Show Email
6 block content
7   .col-md-8.col-md-offset-2
8     h1 Contact
9     h3 Email
10     if contacts.length == 0
11       p No contacts listed.
12     else
13       each contact in contacts
14         strong= contact.name
15         p.text-muted= contact.title
16         +email(contact.email, contact.emkey)
17         br
18         hr
20 append footer
21   script(type="text/javascript").
22     function showEmail(btn, email, key) {
23       email = unescape(email);
24       key = unescape(key);
25       var dest = new Array(email.length);
26       for (var i = 0; i < email.length; i++) {
27         dest[i] = String.fromCharCode(email.charCodeAt(i) ^ key.charCodeAt(i % key.length));
28       }
29       email = dest.join("");
30       $("<a/>").attr("href", "mailto:" + email)
31         .text(email)
32         .insertBefore(btn);
33       $(btn).remove();
34     }