Files: 3c5dd43a2f6adbcaaad339b0a31e11f7d87eec1f / index.js
1469 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | window.addEventListener('error', function onError(e) { |
4 | document.body.appendChild(h('div.error', |
5 | h('h1', e.message), |
6 | h('big', h('code', e.filename + ':' + e.lineno)), |
7 | h('pre', e.error ? (e.error.stack || e.error.toString()) : e.toString()))) |
8 | }) |
9 | |
10 | var u = require('./util') |
11 | var pull = require('pull-stream') |
12 | var combine = require('depject') |
13 | var fs = require('fs') |
14 | var path = require('path') |
15 | var SbotApi = require('./sbot-api') |
16 | |
17 | var modules = require('./modules') |
18 | |
19 | var renderers = [] |
20 | var app = [] |
21 | //var App = require('./plugs').first(app) |
22 | |
23 | var u = require('./util') |
24 | |
25 | //modules.unshift(SbotApi()) |
26 | //modules.unshift({app: app}) |
27 | |
28 | //var indexes = fs.readdirSync(path.join(__dirname, 'modules')) |
29 | //var i = indexes.indexOf('index.js') |
30 | //indexes.splice(i, 1) |
31 | |
32 | //var sv = [], screen_view = require('./plugs').first(sv) |
33 | //modules['main.js' ] = { |
34 | // screen_view: sv, |
35 | // app: function () { |
36 | // return h('div.row', |
37 | // screen_view('/public'), |
38 | // screen_view('/private') |
39 | // ) |
40 | // } |
41 | //} |
42 | |
43 | modules['app.js'] = {app: []} |
44 | |
45 | modules['sbot-api.js'] = SbotApi() |
46 | |
47 | modules['tabs.js'] |
48 | |
49 | combine(modules) //, ['app', 'sbot'].concat(indexes) ) |
50 | |
51 | if(process.title === 'node') { |
52 | console.log(require('depject/graph')(modules)) |
53 | process.exit(0) |
54 | } |
55 | |
56 | document.head.appendChild( |
57 | h('style', fs.readFileSync('./style.css', 'utf8') |
58 | )) |
59 | |
60 | console.log(modules['app.js']) |
61 | document.body.appendChild(h('div.screen.column', modules['app.js'].app[0]())) |
62 | |
63 |
Built with git-ssb-web