Commit c04df255a162f470df63b251a7d6310b79215082
add blob navigate handler back in, allow blob id in search
Matt McKegg committed on 4/20/2018, 10:05:41 AMParent: 44e159185766b6bf908bd2c7a87bf77e7975e221
Files changed
main-window.js | changed |
modules/app/html/search.js | changed |
main-window.js | ||
---|---|---|
@@ -228,13 +228,19 @@ | ||
228 | 228 | } |
229 | 229 | |
230 | 230 | function getExternalHandler (href, cb) { |
231 | 231 | var link = ref.parseLink(href) |
232 | - if (link && ref.isMsg(link.link)) { | |
233 | - api.sbot.async.get(link.link, function (err, value) { | |
234 | - if (err) return cb(err) | |
235 | - cb(null, api.app.sync.externalHandler({key: link.link, value, query: link.query})) | |
236 | - }) | |
232 | + if (link) { | |
233 | + if (ref.isMsg(link.link)) { | |
234 | + api.sbot.async.get(link.link, function (err, value) { | |
235 | + if (err) return cb(err) | |
236 | + cb(null, api.app.sync.externalHandler({key: link.link, value, query: link.query})) | |
237 | + }) | |
238 | + } else if (ref.isBlob(link.link)) { | |
239 | + cb(null, function (href) { | |
240 | + electron.shell.openExternal(api.blob.sync.url(href)) | |
241 | + }) | |
242 | + } | |
237 | 243 | } else { |
238 | 244 | cb() |
239 | 245 | } |
240 | 246 | } |
modules/app/html/search.js | ||
---|---|---|
@@ -47,9 +47,9 @@ | ||
47 | 47 | return searchBox |
48 | 48 | |
49 | 49 | function doSearch () { |
50 | 50 | var value = searchBox.value.trim() |
51 | - if (value.startsWith('/') || value.startsWith('?') || value.startsWith('@') || value.startsWith('#') || value.startsWith('%')) { | |
51 | + if (value.startsWith('/') || value.startsWith('?') || value.startsWith('@') || value.startsWith('#') || value.startsWith('%') || value.startsWith('&')) { | |
52 | 52 | if (value.startsWith('@') && value.length < 30) { |
53 | 53 | // probably not a key |
54 | 54 | } else if (value.length > 2) { |
55 | 55 | setView(value) |
Built with git-ssb-web