Commit 4cc0d31d81a81e1f7fa95ad23f2a988b0c941e6d
linting !
mix irving committed on 2/26/2017, 2:05:45 AMParent: 0a1c7842563bee8ca52221c858cfe7309da160da
Files changed
.gitignore | changed |
junk/next-stepper.js | changed |
main/html/scroller.js | changed |
message/html/compose.js | changed |
message/html/layout/default.js | changed |
package.json | changed |
router/html/page/private.js | changed |
router/html/page/public.js | changed |
junk/next-stepper.js | ||
---|---|---|
@@ -55,5 +55,4 @@ | ||
55 | 55 | for (var k in obj) _obj[k] = obj[k] |
56 | 56 | return _obj |
57 | 57 | } |
58 | 58 | |
59 | - |
main/html/scroller.js | ||
---|---|---|
@@ -3,11 +3,11 @@ | ||
3 | 3 | |
4 | 4 | exports.gives = nest('main.html.scroller') |
5 | 5 | |
6 | 6 | exports.create = function (api) { |
7 | - return nest('main.html.scroller', build_scroller) | |
7 | + return nest('main.html.scroller', Scroller) | |
8 | 8 | |
9 | - function build_scroller ({ prepend = [], append = [] } = {}) { | |
9 | + function Scroller ({ prepend = [], append = [] } = {}) { | |
10 | 10 | const content = h('section.content') |
11 | 11 | |
12 | 12 | const container = h('Scroller', { style: { overflow: 'auto' } }, [ |
13 | 13 | h('div.wrapper', [ |
message/html/compose.js | ||
---|---|---|
@@ -18,9 +18,9 @@ | ||
18 | 18 | exports.gives = nest('message.html.compose') |
19 | 19 | |
20 | 20 | exports.create = function (api) { |
21 | 21 | return nest('message.html.compose', compose) |
22 | - | |
22 | + | |
23 | 23 | function compose ({ shrink = true, meta, prepublish, placeholder = 'Write a message' }, cb) { |
24 | 24 | var files = [] |
25 | 25 | var filesById = {} |
26 | 26 | var focused = Value(false) |
message/html/layout/default.js | ||
---|---|---|
@@ -14,11 +14,11 @@ | ||
14 | 14 | |
15 | 15 | exports.gives = nest('message.html.layout') |
16 | 16 | |
17 | 17 | exports.create = (api) => { |
18 | - return nest('message.html.layout', message_layout) | |
18 | + return nest('message.html.layout', messageLayout) | |
19 | 19 | |
20 | - function message_layout (msg, opts) { | |
20 | + function messageLayout (msg, opts) { | |
21 | 21 | if (!(opts.layout === undefined || opts.layout === 'default')) return |
22 | 22 | |
23 | 23 | return h('Message', [ |
24 | 24 | h('section.avatar', {}, api.about.html.image(msg.value.author)), |
package.json | ||
---|---|---|
@@ -3,11 +3,11 @@ | ||
3 | 3 | "version": "0.0.1", |
4 | 4 | "description": "patchbay 2? building on patchcore", |
5 | 5 | "main": "index.js", |
6 | 6 | "scripts": { |
7 | + "lint": "standard", | |
7 | 8 | "rebuild": "npm rebuild --runtime=electron --target=$(electron -v) --abi=$(electron --abi) --disturl=https://atom.io/download/atom-shell", |
8 | - "start": "electro index.js", | |
9 | - "test": "echo \"Error: no test specified\" && exit 1" | |
9 | + "start": "electro index.js" | |
10 | 10 | }, |
11 | 11 | "repository": { |
12 | 12 | "type": "git", |
13 | 13 | "url": "git+https://github.com/ssbc/picknmix.git" |
@@ -40,6 +40,9 @@ | ||
40 | 40 | "setimmediate": "^1.0.5", |
41 | 41 | "ssb-mentions": "^0.1.1", |
42 | 42 | "suggest-box": "^2.2.3", |
43 | 43 | "xtend": "^4.0.1" |
44 | + }, | |
45 | + "devDependencies": { | |
46 | + "standard": "^8.6.0" | |
44 | 47 | } |
45 | 48 | } |
router/html/page/private.js | ||
---|---|---|
@@ -1,5 +1,4 @@ | ||
1 | -const { h } = require('mutant') | |
2 | 1 | const nest = require('depnest') |
3 | 2 | const pull = require('pull-stream') |
4 | 3 | const Scroller = require('pull-scroll') |
5 | 4 | const next = require('../../../junk/next-stepper') |
@@ -12,25 +11,25 @@ | ||
12 | 11 | 'keys.sync.id': 'first', |
13 | 12 | 'main.html.scroller': 'first', |
14 | 13 | 'message.html': { |
15 | 14 | compose: 'first', |
16 | - render: 'first', | |
17 | - }, | |
15 | + render: 'first' | |
16 | + } | |
18 | 17 | }) |
19 | 18 | |
20 | 19 | exports.create = function (api) { |
21 | 20 | return nest('router.html.page', privatePage) |
22 | - | |
21 | + | |
23 | 22 | function privatePage (path) { |
24 | 23 | if (path !== '/private') return |
25 | 24 | |
26 | 25 | const id = api.keys.sync.id() |
27 | 26 | |
28 | 27 | const composer = api.message.html.compose({ |
29 | - meta: { type: 'post' }, | |
28 | + meta: { type: 'post' }, | |
30 | 29 | prepublish: meta => { |
31 | 30 | meta.recps = [id, ...meta.mentions] |
32 | - .filter(m => ref.isFeed(typeof m === 'string' ? m : m.link)) | |
31 | + .filter(m => ref.isFeed(typeof m === 'string' ? m : m.link)) | |
33 | 32 | return meta |
34 | 33 | }, |
35 | 34 | placeholder: 'Write a private message. \n\n@mention users in the first message to start a private thread.'} |
36 | 35 | ) |
router/html/page/public.js | ||
---|---|---|
@@ -1,5 +1,4 @@ | ||
1 | -const { h } = require('mutant') | |
2 | 1 | const nest = require('depnest') |
3 | 2 | const pull = require('pull-stream') |
4 | 3 | const Scroller = require('pull-scroll') |
5 | 4 | const next = require('../../../junk/next-stepper') |
@@ -9,20 +8,23 @@ | ||
9 | 8 | exports.needs = nest({ |
10 | 9 | 'feed.pull.public': 'first', |
11 | 10 | 'message.html': { |
12 | 11 | compose: 'first', |
13 | - render: 'first', | |
12 | + render: 'first' | |
14 | 13 | }, |
15 | 14 | 'main.html.scroller': 'first' |
16 | 15 | }) |
17 | 16 | |
18 | 17 | exports.create = function (api) { |
19 | 18 | return nest('router.html.page', publicPage) |
20 | - | |
19 | + | |
21 | 20 | function publicPage (path) { |
22 | 21 | if (path !== '/public') return |
23 | 22 | |
24 | - const composer = api.message.html.compose({ meta: { type: 'post' }, placeholder: 'Write a public message'}) | |
23 | + const composer = api.message.html.compose({ | |
24 | + meta: { type: 'post' }, | |
25 | + placeholder: 'Write a public message' | |
26 | + }) | |
25 | 27 | const { container, content } = api.main.html.scroller({ prepend: composer }) |
26 | 28 | |
27 | 29 | pull( |
28 | 30 | next(api.feed.pull.public, {old: false, limit: 100}), |
Built with git-ssb-web