Files: cc06e263225583cc9a1c6958063f600fb97d8968 / modules_basic / public.js
1058 bytesRaw
1 | var h = require('hyperscript') |
2 | var u = require('../util') |
3 | var pull = require('pull-stream') |
4 | var Scroller = require('pull-scroll') |
5 | |
6 | var plugs = require('../plugs') |
7 | var message_render = plugs.first(exports.message_render = []) |
8 | var message_compose = plugs.first(exports.message_compose = []) |
9 | var sbot_log = plugs.first(exports.sbot_log = []) |
10 | |
11 | exports.builtin_tabs = function () { |
12 | return ['/public'] |
13 | } |
14 | |
15 | exports.screen_view = function (path, sbot) { |
16 | if(path === '/public') { |
17 | |
18 | var content = h('div.column.scroller__content') |
19 | var div = h('div.column.scroller', |
20 | {style: {'overflow':'auto'}}, |
21 | h('div.scroller__wrapper', |
22 | message_compose({type: 'post'}, {placeholder: 'Write a public message'}), |
23 | content |
24 | ) |
25 | ) |
26 | |
27 | pull( |
28 | u.next(sbot_log, {old: false, limit: 100}), |
29 | Scroller(div, content, message_render, true, false) |
30 | ) |
31 | |
32 | pull( |
33 | u.next(sbot_log, {reverse: true, limit: 100, live: false}), |
34 | Scroller(div, content, message_render, false, false) |
35 | ) |
36 | |
37 | return div |
38 | } |
39 | } |
40 | |
41 | |
42 | |
43 | |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |
50 | |
51 | |
52 | |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 | |
60 | |
61 | |
62 |
Built with git-ssb-web