Files: 735a21fa879fddd250e0fe6224dbb269061f32d6 / modules_basic / avatar.js
752 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 | } |
15 | |
16 | exports.create = function (api) { |
17 | |
18 | var exports = {} |
19 | exports.avatar = function (author, classes) { |
20 | return exports.avatar_image_name_link(author, classes) |
21 | } |
22 | |
23 | exports.avatar_image_name_link = function (author, classes) { |
24 | return api.avatar_link(author, [ |
25 | api.avatar_image(author, classes), |
26 | api.avatar_name(author) |
27 | ]) |
28 | } |
29 | |
30 | exports.avatar_image_link = function (author, classes) { |
31 | return api.avatar_link(author, api.avatar_image(author, classes)) |
32 | } |
33 | |
34 | return exports |
35 | } |
36 | |
37 | |
38 |
Built with git-ssb-web