git ssb

16+

cel / patchfoo



Commit 5b924278be5b8a04c95c2e112fbf5827b0244697

Add channel to advanced search

cel committed on 10/15/2017, 4:00:03 AM
Parent: 1b5f9989da716b8083b240036f0e56e9501e090d

Files changed

lib/app.jschanged
lib/serve.jschanged
lib/app.jsView
@@ -118,9 +118,14 @@
118118 }
119119
120120 App.prototype.advancedSearch = function (opts) {
121121 return pull(
122- opts.dest ?
122 + opts.channel ?
123 + this.sbot.backlinks.read({
124 + dest: '#' + opts.channel,
125 + reverse: true,
126 + })
127 + : opts.dest ?
123128 this.sbot.links({
124129 values: true,
125130 dest: opts.dest,
126131 source: opts.source || undefined,
lib/serve.jsView
@@ -489,9 +489,9 @@
489489 var q = this.query || {}
490490
491491 if (q.source) q.source = u.extractFeedIds(q.source)[0]
492492 if (q.dest) q.dest = u.extractFeedIds(q.dest)[0]
493- var hasQuery = q.text || q.source || q.dest
493 + var hasQuery = q.text || q.source || q.dest || q.channel
494494
495495 pull(
496496 cat([
497497 ph('section', {}, [
@@ -515,8 +515,15 @@
515515 class: 'id-input',
516516 value: q.dest || ''}))
517517 ]),
518518 ph('tr', [
519 + ph('td', 'channel'),
520 + ph('td', ['#', ph('input', {name: 'channel', placeholder: 'channel',
521 + class: 'id-input',
522 + value: q.channel || ''})
523 + ])
524 + ]),
525 + ph('tr', [
519526 ph('td', {colspan: 2}, [
520527 ph('input', {type: 'submit', value: 'search'})
521528 ])
522529 ]),

Built with git-ssb-web