Files: 3c2247fb3d903ae61e79bc60acac7876c3370fa4 / modules_basic / avatar.js
923 bytesRaw
1 | var h = require('hyperscript') |
2 | var u = require('../util') |
3 | |
4 | exports.needs = { |
5 | avatar_name: 'first', |
6 | avatar_image: 'first', |
7 | avatar_link: 'first' |
8 | } |
9 | |
10 | exports.gives = { |
11 | avatar: true, |
12 | avatar_image_name_link: true, |
13 | avatar_image_link: true, |
14 | avatar_name_link: true |
15 | } |
16 | |
17 | exports.create = function (api) { |
18 | return { |
19 | avatar, |
20 | avatar_image_name_link, |
21 | avatar_image_link, |
22 | avatar_name_link |
23 | } |
24 | |
25 | function avatar (author, classes) { |
26 | return exports.avatar_image_name_link(author, classes) |
27 | } |
28 | |
29 | function avatar_image_name_link (author, classes) { |
30 | return api.avatar_link(author, [ |
31 | api.avatar_image(author, classes), |
32 | api.avatar_name(author) |
33 | ]) |
34 | } |
35 | |
36 | function avatar_image_link (author, classes) { |
37 | return api.avatar_link(author, api.avatar_image(author, classes)) |
38 | } |
39 | |
40 | function avatar_name_link (author, classes) { |
41 | return api.avatar_link(author, api.avatar_name(author)) |
42 | } |
43 | } |
44 | |
45 | |
46 |
Built with git-ssb-web