Files: 00b7dc676f3599b4be16806c7ce93abbd9c724c5 / modules / message-link.js
412 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | exports.message_link = function (el, id, sbot) { |
4 | console.log('MESSAGE_LINK', el, id) |
5 | if(el) return el |
6 | |
7 | var link = h('a', {href: '#'+id}, id.substring(0, 10)+'...') |
8 | |
9 | sbot.get(id, function (err, value) { |
10 | if(err) return |
11 | console.log('LINKED', value) |
12 | if(value.content.text) |
13 | link.textContent = value.content.text.substring(0, 40)+'...' |
14 | }) |
15 | |
16 | return link |
17 | } |
18 | |
19 | |
20 |
Built with git-ssb-web