Files: 038a737d7b268452a2d1ca1cd1e3ade9b5e966ff / modules_basic / avatar-link.js
383 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | exports.needs = {signifier: 'first'} |
4 | |
5 | exports.gives = 'avatar_link' |
6 | |
7 | exports.create = function (api) { |
8 | return function (id, element) { |
9 | |
10 | var link = h('a.avatar', {href: "#"+id, title: id}, element) |
11 | |
12 | api.signifier(id, function (_, names) { |
13 | if(names.length) |
14 | link.title = names[0].name + '\n '+id |
15 | }) |
16 | |
17 | return link |
18 | } |
19 | } |
20 | |
21 | |
22 | |
23 |
Built with git-ssb-web