Files: 7b8459c024b593664fa22d32c9b9bcccfe02a2fa / modules / main.js
864 bytesRaw
1 | var h = require('hyperscript') |
2 | var ui = require('../ui') |
3 | var u = require('../util') |
4 | var pull = require('pull-stream') |
5 | var Scroller = require('pull-scroll') |
6 | |
7 | exports.screen_view = function (path, sbot) { |
8 | if(path === '/') { |
9 | var content = h('div.column') |
10 | var div = h('div.column', {style: {'overflow':'auto'}}, |
11 | u.decorate(exports.message_compose, {type: 'post'}, function (d, e, v) { |
12 | return d(e, v, sbot) |
13 | }), |
14 | content |
15 | ) |
16 | var render = ui.createRenderers(exports.message_render, sbot) |
17 | |
18 | pull( |
19 | sbot.createLogStream({old: false}), |
20 | Scroller(div, content, render, true, false) |
21 | ) |
22 | |
23 | pull( |
24 | u.next(sbot.createLogStream, {reverse: true, limit: 100, live: false}), |
25 | Scroller(div, content, render, false, false) |
26 | ) |
27 | |
28 | return div |
29 | } |
30 | } |
31 | |
32 | exports.message_render = [] |
33 | exports.message_compose = [] |
34 | |
35 | |
36 | |
37 | |
38 | |
39 | |
40 | |
41 |
Built with git-ssb-web