git ssb

16+

Dominic / patchbay



Commit a985a4d720c6d68c96dba230b7c58072d5663d71

start shifting network to mutant hyperscript

mix irving committed on 1/11/2017, 3:14:40 AM
Parent: abc981ed003091aaeb68aab6d203e6356ea262a8

Files changed

modules_extra/network.jschanged
modules_extra/network.jsView
@@ -1,6 +1,6 @@
11 var isVisible = require('is-visible').isVisible
2-var h = require('hyperscript')
2 +var h = require('../h')
33
44 //var avatar = plugs.first(exports.avatar = [])
55 //var sbot_gossip_peers = plugs.first(exports.sbot_gossip_peers = [])
66 //var sbot_gossip_connect = plugs.first(exports.sbot_gossip_connect = [])
@@ -104,16 +104,11 @@
104104
105105 exports.create = function (api) {
106106
107107 return {
108- menu_items: function () {
109- return h('a', {href: '#/network'}, '/network')
110- },
108 + menu_items: () => h('a', {href: '#/network'}, '/network'),
109 + builtin_tabs: () => ['/network'],
111110
112- builtin_tabs: function () {
113- return ['/network']
114- },
115-
116111 screen_view: function (path) {
117112
118113 if(path !== '/network') return
119114
@@ -135,11 +130,11 @@
135130 || types[getType(b)] - types[getType(a)]
136131 || b.stateChange - a.stateChange
137132 )
138133 }).forEach(function (peer) {
139- ol.appendChild(h('div',
134 + ol.appendChild(h('div', [
140135 api.avatar(peer.key, 'thumbnail'),
141- h('div',
136 + h('div', [
142137 peer.state || 'not connected',
143138 ' ',
144139 getType(peer),
145140 ' ',
@@ -149,18 +144,20 @@
149144 (peer.ping && peer.ping.skew) ? duration(peer.ping.skew.mean) : '',
150145 h('label',
151146 {title: new Date(peer.stateChange).toString()},
152147 peer.stateChange && ('(' + human(new Date(peer.stateChange))) + ')')
153- ),
154- 'source:'+peer.source,
155- h('pre', legacyToMultiServer(peer)),
156- h('button', 'connect', {onclick: function () {
157- api.sbot_gossip_connect(peer, function (err) {
148 + ]),
149 + 'source:'+peer.source,
150 + h('pre', legacyToMultiServer(peer)),
151 + h('button', {
152 + 'ev-click': () => {
153 + api.sbot_gossip_connect(peer, (err) => {
158154 if(err) console.error(err)
159155 else console.log('connected to', peer)
160156 })
161- }})
162- )
157 + }},
158 + 'connect'
159 + )])
163160 )
164161 })
165162
166163 setTimeout(poll, 5000)

Built with git-ssb-web