git ssb

10+

Matt McKegg / patchwork



Commit a3fbd9b6bf6f2ae57ee70d0f41caf0bb7b08cb02

npm test up to date, standard js conformant

Edward Dalley committed on 3/29/2018, 9:25:07 AM
Parent: d7819e0e2cbfaa22f19fa158b7a5d6414f5206a6

Files changed

modules/app/html/search.jschanged
modules/channel/html/preview.jschanged
modules/channel/obs/suggest.jschanged
modules/page/html/render/channels.jschanged
modules/page/html/render/message.jschanged
modules/page/html/render/public.jschanged
modules/sheet/profiles.jschanged
overrides/patchcore/message/html/action/reply.jschanged
package.jsonchanged
modules/app/html/search.jsView
@@ -49,9 +49,9 @@
4949 function doSearch () {
5050 var value = searchBox.value.trim()
5151 if (value.startsWith('/') || value.startsWith('?') || value.startsWith('@') || value.startsWith('#') || value.startsWith('%')) {
5252 if (value.startsWith('@') && value.length < 30) {
53- // probably not a key
53+ // probably not a key
5454 } else if (value.length > 2) {
5555 setView(value)
5656 }
5757 } else if (value.trim()) {
modules/channel/html/preview.jsView
@@ -1,7 +1,6 @@
11 var nest = require('depnest')
22 var h = require('mutant/h')
3-var map = require('mutant/map')
43 var when = require('mutant/when')
54 var computed = require('mutant/computed')
65 var send = require('mutant/send')
76
modules/channel/obs/suggest.jsView
@@ -75,5 +75,5 @@
7575 }
7676
7777 function matches (text, startsWith) {
7878 return text.slice(0, startsWith.length).localeCompare(startsWith, 'default', {sensitivity: 'base'}) === 0
79-}
79+}
modules/page/html/render/channels.jsView
@@ -1,6 +1,6 @@
11 var nest = require('depnest')
2-var { h, send, when, computed, map } = require('mutant')
2+var { h, when, computed, map } = require('mutant')
33
44 exports.needs = nest({
55 'message.async.publish': 'first',
66 'keys.sync.id': 'first',
@@ -13,9 +13,8 @@
1313
1414 exports.gives = nest('page.html.render')
1515
1616 exports.create = function (api) {
17- const i18n = api.intl.sync.i18n
1817 return nest('page.html.render', function page (path) {
1918 if (path !== '/channels') return
2019
2120 var id = api.keys.sync.id()
@@ -41,22 +40,6 @@
4140 ])
4241 }, {maxTime: 5, idle: true})
4342 ])
4443 ])
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- }
6144 })
6245 }
modules/page/html/render/message.jsView
@@ -68,9 +68,8 @@
6868
6969 // what happens in private stays in private!
7070 meta.recps.set(value.content.recps)
7171
72- var author = value.author
7372 var root = api.message.sync.root({key: id, value}) || id
7473 var isReply = id !== root
7574 var thread = api.feed.obs.thread(id, {branch: isReply})
7675
modules/page/html/render/public.jsView
@@ -267,9 +267,9 @@
267267 function noVisibleNewPostsWarning () {
268268 const explanation = i18n('You may not be able to see new content until you follow some users or pubs.')
269269
270270 const shownWhen = computed([loading, contact.isNotFollowingAnybody],
271- (isLoading, isNotFollowingAnybody) => !isLoading && isNotFollowingAnybody
271+ (isLoading, isNotFollowingAnybody) => !isLoading && isNotFollowingAnybody
272272 )
273273
274274 return api.feed.html.followWarning(shownWhen, explanation)
275275 }
@@ -283,31 +283,15 @@
283283 // should be sufficient to get the user to join a pub. However, pubs have been buggy and not followed back on occassion.
284284 // Additionally, someone onboarded on a local network might follow someone on the network, but not be followed back by
285285 // them, so we begin to show this warning if the user has followed someone, but has no followers.
286286 const shownWhen = computed([loading, contact.hasNoFollowers, contact.isNotFollowingAnybody],
287- (isLoading, hasNoFollowers, isNotFollowingAnybody) =>
288- !isLoading && (hasNoFollowers && !isNotFollowingAnybody)
287+ (isLoading, hasNoFollowers, isNotFollowingAnybody) =>
288+ !isLoading && (hasNoFollowers && !isNotFollowingAnybody)
289289 )
290290
291291 return api.feed.html.followerWarning(shownWhen, explanation)
292292 }
293293
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-
310294 function disconnect (id) {
311295 onceTrue(api.sbot.obs.connection, (sbot) => {
312296 sbot.patchwork.disconnect(id)
313297 })
modules/sheet/profiles.jsView
@@ -1,5 +1,5 @@
1-var {h, when, map, computed, Value, lookup} = require('mutant')
1+var {h, map, computed, Value, lookup} = require('mutant')
22 var nest = require('depnest')
33 var catchLinks = require('../../lib/catch-links')
44
55 exports.needs = nest({
@@ -78,9 +78,8 @@
7878 })
7979 })
8080
8181 function renderContactBlock (profiles) {
82- var yourId = api.keys.sync.id()
8382 profiles = api.profile.obs.rank(profiles)
8483 return [
8584 h('div', {
8685 classList: 'ProfileList'
overrides/patchcore/message/html/action/reply.jsView
@@ -19,9 +19,9 @@
1919
2020 function handleEvent (ev) {
2121 var {api, msg} = this
2222 var el = getMessageElement(ev.target)
23-
23+
2424 // HACK: if this is the last message in the list, reply to the root message
2525 if (el && !el.nextElementSibling) {
2626 api.app.navigate(api.message.sync.root(msg), 'reply')
2727 ev.preventDefault()
@@ -34,5 +34,5 @@
3434 return el
3535 }
3636 el = el.parentNode
3737 }
38-}
38+}
package.jsonView
@@ -73,8 +73,9 @@
7373 "ssb-private": "0.1.4",
7474 "ssb-query": "^1.0.0",
7575 "ssb-ref": "^2.9.0",
7676 "ssb-sort": "^1.0.0",
77+ "standard": "^11.0.1",
7778 "statistics": "^3.3.0",
7879 "stream-to-pull-stream": "^1.7.2",
7980 "suggest-box": "^2.2.3",
8081 "text-node-searcher": "^1.1.1",

Built with git-ssb-web