git ssb

16+

Dominic / patchbay



Tree: 010c28ba45ecc8a029b813a3cd9e7edc8e098059

Files: 010c28ba45ecc8a029b813a3cd9e7edc8e098059 / modules_extra / git-ssb.js

1226 bytesRaw
1var h = require('hyperscript')
2var u = require('../util')
3var pull = require('pull-stream')
4var Scroller = require('pull-scroll')
5
6exports.needs = {
7 message_render: 'first',
8 message_compose: 'first',
9 sbot_log: 'first'
10}
11
12exports.gives = {
13 menu_items: true, screen_view: true
14}
15
16exports.create = function (api) {
17 return {
18 menu_items: function () {
19 return h('a', {href: '#/git-ssb'}, '/git-ssb')
20 },
21
22 screen_view: function (path, sbot) {
23 if(path === '/git-ssb') {
24
25 var content = h('div.column.scroller__content')
26 var div = h('div.column.scroller',
27 {style: {'overflow':'auto'}},
28 h('div.scroller__wrapper', content)
29 )
30
31 pull(
32 u.next(api.sbot_log, {old: false, limit: 100}),
33 Scroller(div, content, api.message_render, true, false)
34 )
35
36 pull(
37 u.next(api.sbot_log, {reverse: true, limit: 100, live: false}),
38 pull.filter(function(msg) { return msg.value.content.type }),
39 pull.filter(function(msg) {
40 return msg.value.content.type.match(/^git/)
41 }),
42 Scroller(div, content, api.message_render, false, false)
43 )
44
45 return div
46 }
47 }
48 }
49}
50

Built with git-ssb-web