git ssb

16+

Dominic / patchbay



Commit ec173768e1fa3502173c3eec73ec2d7ea6c71742

Merge remote-tracking branch 'origin/dns'

Dominic Tarr committed on 11/28/2016, 11:15:03 PM
Parent: 23c609fe1f8d646c4994bb804762cd3aefaad28c
Parent: 043f0016a782ff805a586313f336b144a0ed3e3e

Files changed

modules_extra/index.jschanged
modules_extra/dns.jsadded
modules_extra/index.jsView
@@ -2,8 +2,9 @@
22 "audio-mp3.js": require('./audio-mp3.js'),
33 "channel.js": require('./channel.js'),
44 "emoji.js": require('./emoji.js'),
55 "suggest-emoji.js": require('./suggest-emoji.js'),
6 + "dns.js": require('./dns.js'),
67 "git.js": require('./git.js'),
78 "notifications.js": require('./notifications.js'),
89 "meta-image.js": require('./meta-image.js'),
910 "music-release-cc.js": require('./music-release-cc.js'),
modules_extra/dns.jsView
@@ -1,0 +1,28 @@
1 +var h = require('hyperscript')
2 +
3 +function array(obj) {
4 + return !obj ? [] : Array.isArray(obj) ? obj : [obj]
5 +}
6 +
7 +function idLink(id) {
8 + return h('a', {href: '#'+id}, id.substring(0, 10)+'…')
9 +}
10 +
11 +exports.message_content = function (msg, sbot) {
12 + var c = msg.value.content
13 +
14 + if(c.type === 'ssb-dns') {
15 + var record = c.record || {}
16 + return h('div',
17 + h('p',
18 + h('ins', {title: 'name'}, record.name), ' ',
19 + h('em', {title: 'ttl'}, record.ttl), ' ',
20 + h('span', {title: 'class'}, record.class), ' ',
21 + h('span', {title: 'type'}, record.type),
22 + h('pre', {title: 'data'},
23 + JSON.stringify(record.data || record.value, null, 2)),
24 + !c.branch ? null : h('div', h('span',
25 + 'replaces: ', array(c.branch).map(idLink)))
26 + ))
27 + }
28 +}

Built with git-ssb-web