git ssb

16+

Dominic / patchbay



Tree: c2ad0e976a7bf704bd9348e463c24a5a2edb2f01

Files: c2ad0e976a7bf704bd9348e463c24a5a2edb2f01 / modules / message-link.js

340 bytesRaw
1var h = require('hyperscript')
2
3exports.message_link = function (el, id, sbot) {
4 if(el) return el
5
6 var link = h('a', {href: '#'+id}, id.substring(0, 10)+'...')
7
8 sbot.get(id, function (err, value) {
9 if(err) return
10 if(value.content.text)
11 link.textContent = value.content.text.substring(0, 40)+'...'
12 })
13
14 return link
15}
16
17

Built with git-ssb-web