diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-10-14 18:00:03 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-10-14 18:00:03 -1000 |
commit | 5b924278be5b8a04c95c2e112fbf5827b0244697 (patch) | |
tree | f0fcac666ae3cb88f65889420dc20bef7e2ae7a2 /lib | |
parent | 1b5f9989da716b8083b240036f0e56e9501e090d (diff) | |
download | patchfoo-5b924278be5b8a04c95c2e112fbf5827b0244697.tar.gz patchfoo-5b924278be5b8a04c95c2e112fbf5827b0244697.zip |
Add channel to advanced search
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.js | 7 | ||||
-rw-r--r-- | lib/serve.js | 9 |
2 files changed, 14 insertions, 2 deletions
@@ -119,7 +119,12 @@ App.prototype.search = function (opts) { App.prototype.advancedSearch = function (opts) { return pull( - opts.dest ? + opts.channel ? + this.sbot.backlinks.read({ + dest: '#' + opts.channel, + reverse: true, + }) + : opts.dest ? this.sbot.links({ values: true, dest: opts.dest, diff --git a/lib/serve.js b/lib/serve.js index 07cbbbb..eab40c9 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -490,7 +490,7 @@ Serve.prototype.advsearch = function (ext) { if (q.source) q.source = u.extractFeedIds(q.source)[0] if (q.dest) q.dest = u.extractFeedIds(q.dest)[0] - var hasQuery = q.text || q.source || q.dest + var hasQuery = q.text || q.source || q.dest || q.channel pull( cat([ @@ -516,6 +516,13 @@ Serve.prototype.advsearch = function (ext) { value: q.dest || ''})) ]), ph('tr', [ + ph('td', 'channel'), + ph('td', ['#', ph('input', {name: 'channel', placeholder: 'channel', + class: 'id-input', + value: q.channel || ''}) + ]) + ]), + ph('tr', [ ph('td', {colspan: 2}, [ ph('input', {type: 'submit', value: 'search'}) ]) |