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