Commit a3fbd9b6bf6f2ae57ee70d0f41caf0bb7b08cb02
npm test up to date, standard js conformant
Edward Dalley committed on 3/29/2018, 9:25:07 AMParent: d7819e0e2cbfaa22f19fa158b7a5d6414f5206a6
Files changed
modules/app/html/search.js | ||
---|---|---|
@@ -49,9 +49,9 @@ | ||
49 | 49 | function doSearch () { |
50 | 50 | var value = searchBox.value.trim() |
51 | 51 | if (value.startsWith('/') || value.startsWith('?') || value.startsWith('@') || value.startsWith('#') || value.startsWith('%')) { |
52 | 52 | if (value.startsWith('@') && value.length < 30) { |
53 | - // probably not a key | |
53 | + // probably not a key | |
54 | 54 | } else if (value.length > 2) { |
55 | 55 | setView(value) |
56 | 56 | } |
57 | 57 | } else if (value.trim()) { |
modules/channel/html/preview.js | ||
---|---|---|
@@ -1,7 +1,6 @@ | ||
1 | 1 | var nest = require('depnest') |
2 | 2 | var h = require('mutant/h') |
3 | -var map = require('mutant/map') | |
4 | 3 | var when = require('mutant/when') |
5 | 4 | var computed = require('mutant/computed') |
6 | 5 | var send = require('mutant/send') |
7 | 6 |
modules/channel/obs/suggest.js | ||
---|---|---|
@@ -75,5 +75,5 @@ | ||
75 | 75 | } |
76 | 76 | |
77 | 77 | function matches (text, startsWith) { |
78 | 78 | return text.slice(0, startsWith.length).localeCompare(startsWith, 'default', {sensitivity: 'base'}) === 0 |
79 | -} | |
79 | +} |
modules/page/html/render/channels.js | ||
---|---|---|
@@ -1,6 +1,6 @@ | ||
1 | 1 | var nest = require('depnest') |
2 | -var { h, send, when, computed, map } = require('mutant') | |
2 | +var { h, when, computed, map } = require('mutant') | |
3 | 3 | |
4 | 4 | exports.needs = nest({ |
5 | 5 | 'message.async.publish': 'first', |
6 | 6 | 'keys.sync.id': 'first', |
@@ -13,9 +13,8 @@ | ||
13 | 13 | |
14 | 14 | exports.gives = nest('page.html.render') |
15 | 15 | |
16 | 16 | exports.create = function (api) { |
17 | - const i18n = api.intl.sync.i18n | |
18 | 17 | return nest('page.html.render', function page (path) { |
19 | 18 | if (path !== '/channels') return |
20 | 19 | |
21 | 20 | var id = api.keys.sync.id() |
@@ -41,22 +40,6 @@ | ||
41 | 40 | ]) |
42 | 41 | }, {maxTime: 5, idle: true}) |
43 | 42 | ]) |
44 | 43 | ]) |
45 | - | |
46 | - function subscribe (id) { | |
47 | - api.message.async.publish({ | |
48 | - type: 'channel', | |
49 | - channel: id, | |
50 | - subscribed: true | |
51 | - }) | |
52 | - } | |
53 | - | |
54 | - function unsubscribe (id) { | |
55 | - api.message.async.publish({ | |
56 | - type: 'channel', | |
57 | - channel: id, | |
58 | - subscribed: false | |
59 | - }) | |
60 | - } | |
61 | 44 | }) |
62 | 45 | } |
modules/page/html/render/message.js | ||
---|---|---|
@@ -68,9 +68,8 @@ | ||
68 | 68 | |
69 | 69 | // what happens in private stays in private! |
70 | 70 | meta.recps.set(value.content.recps) |
71 | 71 | |
72 | - var author = value.author | |
73 | 72 | var root = api.message.sync.root({key: id, value}) || id |
74 | 73 | var isReply = id !== root |
75 | 74 | var thread = api.feed.obs.thread(id, {branch: isReply}) |
76 | 75 |
modules/page/html/render/public.js | ||
---|---|---|
@@ -267,9 +267,9 @@ | ||
267 | 267 | function noVisibleNewPostsWarning () { |
268 | 268 | const explanation = i18n('You may not be able to see new content until you follow some users or pubs.') |
269 | 269 | |
270 | 270 | const shownWhen = computed([loading, contact.isNotFollowingAnybody], |
271 | - (isLoading, isNotFollowingAnybody) => !isLoading && isNotFollowingAnybody | |
271 | + (isLoading, isNotFollowingAnybody) => !isLoading && isNotFollowingAnybody | |
272 | 272 | ) |
273 | 273 | |
274 | 274 | return api.feed.html.followWarning(shownWhen, explanation) |
275 | 275 | } |
@@ -283,31 +283,15 @@ | ||
283 | 283 | // should be sufficient to get the user to join a pub. However, pubs have been buggy and not followed back on occassion. |
284 | 284 | // Additionally, someone onboarded on a local network might follow someone on the network, but not be followed back by |
285 | 285 | // them, so we begin to show this warning if the user has followed someone, but has no followers. |
286 | 286 | const shownWhen = computed([loading, contact.hasNoFollowers, contact.isNotFollowingAnybody], |
287 | - (isLoading, hasNoFollowers, isNotFollowingAnybody) => | |
288 | - !isLoading && (hasNoFollowers && !isNotFollowingAnybody) | |
287 | + (isLoading, hasNoFollowers, isNotFollowingAnybody) => | |
288 | + !isLoading && (hasNoFollowers && !isNotFollowingAnybody) | |
289 | 289 | ) |
290 | 290 | |
291 | 291 | return api.feed.html.followerWarning(shownWhen, explanation) |
292 | 292 | } |
293 | 293 | |
294 | - function subscribe (id) { | |
295 | - api.message.async.publish({ | |
296 | - type: 'channel', | |
297 | - channel: id, | |
298 | - subscribed: true | |
299 | - }) | |
300 | - } | |
301 | - | |
302 | - function unsubscribe (id) { | |
303 | - api.message.async.publish({ | |
304 | - type: 'channel', | |
305 | - channel: id, | |
306 | - subscribed: false | |
307 | - }) | |
308 | - } | |
309 | - | |
310 | 294 | function disconnect (id) { |
311 | 295 | onceTrue(api.sbot.obs.connection, (sbot) => { |
312 | 296 | sbot.patchwork.disconnect(id) |
313 | 297 | }) |
modules/sheet/profiles.js | ||
---|---|---|
@@ -1,5 +1,5 @@ | ||
1 | -var {h, when, map, computed, Value, lookup} = require('mutant') | |
1 | +var {h, map, computed, Value, lookup} = require('mutant') | |
2 | 2 | var nest = require('depnest') |
3 | 3 | var catchLinks = require('../../lib/catch-links') |
4 | 4 | |
5 | 5 | exports.needs = nest({ |
@@ -78,9 +78,8 @@ | ||
78 | 78 | }) |
79 | 79 | }) |
80 | 80 | |
81 | 81 | function renderContactBlock (profiles) { |
82 | - var yourId = api.keys.sync.id() | |
83 | 82 | profiles = api.profile.obs.rank(profiles) |
84 | 83 | return [ |
85 | 84 | h('div', { |
86 | 85 | classList: 'ProfileList' |
overrides/patchcore/message/html/action/reply.js | ||
---|---|---|
@@ -19,9 +19,9 @@ | ||
19 | 19 | |
20 | 20 | function handleEvent (ev) { |
21 | 21 | var {api, msg} = this |
22 | 22 | var el = getMessageElement(ev.target) |
23 | - | |
23 | + | |
24 | 24 | // HACK: if this is the last message in the list, reply to the root message |
25 | 25 | if (el && !el.nextElementSibling) { |
26 | 26 | api.app.navigate(api.message.sync.root(msg), 'reply') |
27 | 27 | ev.preventDefault() |
@@ -34,5 +34,5 @@ | ||
34 | 34 | return el |
35 | 35 | } |
36 | 36 | el = el.parentNode |
37 | 37 | } |
38 | -} | |
38 | +} |
Built with git-ssb-web