git ssb

10+

Matt McKegg / patchwork



Commit c04df255a162f470df63b251a7d6310b79215082

add blob navigate handler back in, allow blob id in search

Matt McKegg committed on 4/20/2018, 10:05:41 AM
Parent: 44e159185766b6bf908bd2c7a87bf77e7975e221

Files changed

main-window.jschanged
modules/app/html/search.jschanged
main-window.jsView
@@ -228,13 +228,19 @@
228228 }
229229
230230 function getExternalHandler (href, cb) {
231231 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+ }
237243 } else {
238244 cb()
239245 }
240246 }
modules/app/html/search.jsView
@@ -47,9 +47,9 @@
4747 return searchBox
4848
4949 function doSearch () {
5050 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('&')) {
5252 if (value.startsWith('@') && value.length < 30) {
5353 // probably not a key
5454 } else if (value.length > 2) {
5555 setView(value)

Built with git-ssb-web