Commit 918b8891edad601629ecd6444a989ea6b04d9e3f
implement split view. had to use regretable hack to all recursive plugins
Dominic Tarr committed on 7/20/2016, 12:27:00 PMParent: f954b2a3a7a0b07b66dd67f0b56ee1d6a9214e85
Files changed
modules/index.js | changed |
modules/_screen_view.js | added |
modules/split.js | added |
modules/index.js | ||
---|---|---|
@@ -1,5 +1,6 @@ | ||
1 | 1 | module.exports = { |
2 | + "_screen_view.js": require('./_screen_view.js'), | |
2 | 3 | "about.js": require('./about.js'), |
3 | 4 | "avatar-image.js": require('./avatar-image.js'), |
4 | 5 | "avatar-profile.js": require('./avatar-profile.js'), |
5 | 6 | "avatar.js": require('./avatar.js'), |
@@ -22,8 +23,9 @@ | ||
22 | 23 | "private.js": require('./private.js'), |
23 | 24 | "public.js": require('./public.js'), |
24 | 25 | "search-box.js": require('./search-box.js'), |
25 | 26 | "search.js": require('./search.js'), |
27 | + "split.js": require('./split.js'), | |
26 | 28 | "suggest-mentions.js": require('./suggest-mentions.js'), |
27 | 29 | "suggest.js": require('./suggest.js'), |
28 | 30 | "tabs.js": require('./tabs.js'), |
29 | 31 | "thread.js": require('./thread.js'), |
modules/_screen_view.js | ||
---|---|---|
@@ -1,0 +1,8 @@ | ||
1 | + | |
2 | +//this is just an UGLY HACK, because depject does not | |
3 | +//support recursion... | |
4 | + | |
5 | +var sv = require('../plugs').first(exports.screen_view = []) | |
6 | +exports._screen_view = function (value) { | |
7 | + return sv(value) | |
8 | +} |
modules/split.js | ||
---|---|---|
@@ -1,0 +1,17 @@ | ||
1 | +var h = require('hyperscript') | |
2 | + | |
3 | +var screen_view = | |
4 | + require('../plugs').first(exports._screen_view = []) | |
5 | + | |
6 | +exports.screen_view = function (path) { | |
7 | + var m = /^split\s*\((.*)\)$/.exec(path) | |
8 | + if(!m) | |
9 | + return | |
10 | + | |
11 | + return h('div.row', | |
12 | + m[1].split(',').map(function (e) { | |
13 | + return screen_view(e) | |
14 | + }).filter(Boolean) | |
15 | + ) | |
16 | +} | |
17 | + |
Built with git-ssb-web