Commit 428676644191b3fcf658e49167d835bb682488a2
standard check passes
Matt McKegg committed on 10/19/2017, 2:36:46 AMParent: cc390daa09626dec00f9649bd2685152e9466432
Files changed
contact/async.js | changed |
contact/obs.js | changed |
example/index.js | changed |
message/async/name.js | changed |
message/html/author.js | changed |
message/html/layout/default.js | changed |
message/html/layout/mini.js | changed |
message/html/render/vote.js | changed |
message/obs/likes.js | changed |
contact/async.js | ||
---|---|---|
@@ -1,7 +1,5 @@ | ||
1 | 1 … | var nest = require('depnest') |
2 | -var onceTrue = require('mutant/once-true') | |
3 | -var resolve = require('mutant/resolve') | |
4 | 2 … | var ref = require('ssb-ref') |
5 | 3 … | |
6 | 4 … | exports.needs = nest({ |
7 | 5 … | 'contact.obs.following': 'first', |
@@ -57,5 +55,4 @@ | ||
57 | 55 … | blocking: false |
58 | 56 … | }, cb) |
59 | 57 … | } |
60 | 58 … | } |
61 | - |
contact/obs.js | ||
---|---|---|
@@ -1,4 +1,6 @@ | ||
1 … | +'use strict' | |
2 … | + | |
1 | 3 … | var nest = require('depnest') |
2 | 4 … | var { Value, computed } = require('mutant') |
3 | 5 … | var pull = require('pull-stream') |
4 | 6 … | var ref = require('ssb-ref') |
@@ -71,17 +73,17 @@ | ||
71 | 73 … | if (ref.isFeed(source)) { |
72 | 74 … | update(source, item[source], cache) |
73 | 75 … | |
74 | 76 … | // generate reverse lookup |
75 | - for (var dest in item[source]) { | |
77 … | + for (let dest in item[source]) { | |
76 | 78 … | reverse[dest] = reverse[dest] || {} |
77 | 79 … | reverse[dest][source] = item[source][dest] |
78 | 80 … | } |
79 | 81 … | } |
80 | 82 … | } |
81 | 83 … | |
82 | 84 … | // populate reverse observable cache |
83 | - for (var dest in reverse) { | |
85 … | + for (let dest in reverse) { | |
84 | 86 … | update(dest, reverse[dest], reverseCache) |
85 | 87 … | } |
86 | 88 … | |
87 | 89 … | sync.set(true) |
example/index.js | ||
---|---|---|
@@ -1,8 +1,9 @@ | ||
1 | 1 … | const combine = require('depject') |
2 | 2 … | const apply = require('depject/apply') |
3 | 3 … | const h = require('mutant/h') |
4 | 4 … | const fs = require('fs') |
5 … | +const Path = require('path') | |
5 | 6 … | |
6 | 7 … | const modules = require('../') |
7 | 8 … | var api = entry(combine(modules)) |
8 | 9 … | |
@@ -12,9 +13,9 @@ | ||
12 | 13 … | // public: 'first' |
13 | 14 … | // } |
14 | 15 … | // })() |
15 | 16 … | |
16 | -require('insert-css')(fs.readFileSync(__dirname + '/styles.css', 'utf8')) | |
17 … | +require('insert-css')(fs.readFileSync(Path.join(__dirname, 'styles.css'), 'utf8')) | |
17 | 18 … | |
18 | 19 … | var app = h('div.App', [ |
19 | 20 … | api.feed.html.render(api.feed.pull.public) |
20 | 21 … | ]) |
message/async/name.js | ||
---|---|---|
@@ -49,10 +49,10 @@ | ||
49 | 49 … | } |
50 | 50 … | |
51 | 51 … | function titleFromMarkdown (text, max) { |
52 | 52 … | text = text.trim().split('\n', 3).join('\n') |
53 | - text = text.replace(/_|`|\*|\#|^\[@.*?\]|\[|\]|\(\S*?\)/g, '').trim() | |
54 | - text = text.replace(/\:$/, '') | |
53 … | + text = text.replace(/_|`|\*|#|^\[@.*?]|\[|]|\(\S*?\)/g, '').trim() | |
54 … | + text = text.replace(/:$/, '') | |
55 | 55 … | text = text.trim().split('\n', 1)[0].trim() |
56 | 56 … | if (text.length > max) { |
57 | 57 … | text = text.substring(0, max - 2) + '...' |
58 | 58 … | } |
message/html/author.js | ||
---|---|---|
@@ -5,11 +5,11 @@ | ||
5 | 5 … | |
6 | 6 … | exports.gives = nest('message.html.author') |
7 | 7 … | |
8 | 8 … | exports.create = function (api) { |
9 | - return nest('message.html.author', message_author) | |
9 … | + return nest('message.html.author', messageAuthor) | |
10 | 10 … | |
11 | - function message_author (msg) { | |
11 … | + function messageAuthor (msg) { | |
12 | 12 … | return h('div', {title: msg.value.author}, [ |
13 | 13 … | '@', api.about.obs.name(msg.value.author) |
14 | 14 … | ]) |
15 | 15 … | } |
message/html/layout/default.js | ||
---|---|---|
@@ -11,11 +11,11 @@ | ||
11 | 11 … | |
12 | 12 … | exports.gives = nest('message.html.layout') |
13 | 13 … | |
14 | 14 … | exports.create = (api) => { |
15 | - return nest('message.html.layout', message_layout) | |
15 … | + return nest('message.html.layout', messageLayout) | |
16 | 16 … | |
17 | - function message_layout (msg, opts) { | |
17 … | + function messageLayout (msg, opts) { | |
18 | 18 … | if (!(opts.layout === undefined || opts.layout === 'default')) return |
19 | 19 … | return h('div', { |
20 | 20 … | classList: 'Message' |
21 | 21 … | }, [ |
message/html/layout/mini.js | ||
---|---|---|
@@ -10,11 +10,11 @@ | ||
10 | 10 … | |
11 | 11 … | exports.gives = nest('message.html.layout') |
12 | 12 … | |
13 | 13 … | exports.create = (api) => { |
14 | - return nest('message.html.layout', message_layout) | |
14 … | + return nest('message.html.layout', messageLayout) | |
15 | 15 … | |
16 | - function message_layout (msg, opts) { | |
16 … | + function messageLayout (msg, opts) { | |
17 | 17 … | if (opts.layout !== 'mini') return |
18 | 18 … | return h('div', { |
19 | 19 … | classList: 'Message -mini' |
20 | 20 … | }, [ |
message/html/render/vote.js | ||
---|---|---|
@@ -1,5 +1,4 @@ | ||
1 | -var h = require('mutant/h') | |
2 | 1 … | var nest = require('depnest') |
3 | 2 … | var extend = require('xtend') |
4 | 3 … | |
5 | 4 … | exports.needs = nest({ |
message/obs/likes.js | ||
---|---|---|
@@ -1,9 +1,8 @@ | ||
1 | 1 … | var nest = require('depnest') |
2 | 2 … | var ref = require('ssb-ref') |
3 | 3 … | var MutantArray = require('mutant/array') |
4 | 4 … | var concat = require('mutant/concat') |
5 | -var watch = require('mutant/watch') | |
6 | 5 … | |
7 | 6 … | var { computed } = require('mutant') |
8 | 7 … | |
9 | 8 … | exports.needs = nest({ |
Built with git-ssb-web