Commit 04e9d2965777ae8086c3cfd9b12f9de142c589bf
about module renders setting of profiles, etc
Dominic Tarr committed on 5/29/2016, 3:24:36 AMParent: 3796b03e7cca3a486a8bbe5974532f14242cea4b
Files changed
modules/about.js | added |
modules/about.js | ||
---|---|---|
@@ -1,0 +1,33 @@ | ||
1 | + | |
2 | +var h = require('hyperscript') | |
3 | + | |
4 | +function idLink (id) { | |
5 | + return h('a', {href:'#/'+id}, id) | |
6 | +} | |
7 | + | |
8 | +exports.message_content = function (msg, sbot) { | |
9 | + if(msg.value.content.type !== 'about') return | |
10 | + | |
11 | + if(!msg.value.content.image && !msg.value.content.name) | |
12 | + return | |
13 | + | |
14 | + var about = msg.value.content | |
15 | + var id = msg.value.content.about | |
16 | + return h('p', | |
17 | + about.about === msg.value.author | |
18 | + ? h('span', 'self-identifies') | |
19 | + : h('span', 'identifies', idLink(id)), | |
20 | + ' as ', | |
21 | + h('a', {href:"#/"+about.about}, | |
22 | + about.name || null, | |
23 | + about.image | |
24 | + ? h('img', {src:'http://localhost:7777/'+ encodeURIComponent(about.image.link)}) | |
25 | + : null | |
26 | + ) | |
27 | + ) | |
28 | + | |
29 | +} | |
30 | + | |
31 | + | |
32 | + | |
33 | + |
Built with git-ssb-web