git ssb

16+

Dominic / patchbay



Tree: 9f8921f929fe859d284f7af21d0870b8473d44e5

Files: 9f8921f929fe859d284f7af21d0870b8473d44e5 / modules_extra / git-ssb.js

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

Built with git-ssb-web