git ssb

16+

Dominic / patchbay



Commit 7258163256643f323409a7aeaee7410a6a334de9

Merge remote-tracking branch 'ssb/more-petnames'

Dominic Tarr committed on 11/15/2016, 2:10:03 PM
Parent: 7c8e28be85762984790fb8433e8ceb84c5ccf8e5
Parent: b66d3b80c9607c7f76b89ae35e24a2a704d0d563

Files changed

modules_basic/names.jschanged
modules_basic/search-box.jschanged
modules_basic/suggest-mentions.jschanged
modules_core/tabs.jschanged
modules_extra/git.jschanged
style.csschanged
modules_basic/names.jsView
@@ -41,9 +41,9 @@
4141 value: {
4242 content: {
4343 type: "about",
4444 name: {"$prefix": ""},
45- about: {"$prefix": "@"} //better: match regexp.
45 + about: {"$prefix": ""}
4646 }
4747 }
4848 }
4949 }
@@ -82,11 +82,12 @@
8282 ts: {$max: 'ts'}
8383 }
8484 }
8585
86-function add_at(stream) {
86 +function add_sigil(stream) {
8787 return pull(stream, pull.map(function (e) {
88- if(!/^@/.test(e.name)) e.name = '@'+e.name
88 + if (e && e.id && e.name && e.id[0] !== e.name[0])
89 + e.name = e.id[0] + e.name
8990 return e
9091 })
9192 )
9293 }
@@ -95,9 +96,9 @@
9596 if(!err) {
9697 pull(
9798 many([
9899 sbot_links2({query: [filter, map, reduce]}),
99- add_at(sbot_query({query: [filter2, map2, reduce]}))
100 + add_sigil(sbot_query({query: [filter2, map2, reduce]}))
100101 ]),
101102 //reducing also ensures order by the lookup properties
102103 //in this case: [name, id]
103104 mfr.reduce(merge),
@@ -111,9 +112,9 @@
111112 )
112113
113114 pull(many([
114115 sbot_links2({query: [filter, map], old: false}),
115- add_at(sbot_query({query: [filter2, map2], old: false}))
116 + add_sigil(sbot_query({query: [filter2, map2], old: false}))
116117 ]),
117118 pull.drain(update))
118119 }
119120 }
modules_basic/search-box.jsView
@@ -71,9 +71,9 @@
7171 value: name,
7272 subtitle: chan.rank
7373 }
7474 }))
75- else if(/^@\w/.test(word)) {
75 + else if(/^[@%]\w/.test(word)) {
7676 signified(word, function (_, names) {
7777 cb(null, names.map(function (e) {
7878 return {
7979 title: e.name + ':'+e.id.substring(0, 10),
modules_basic/suggest-mentions.jsView
@@ -8,9 +8,9 @@
88 var blob_url = require('../plugs').first(exports.blob_url = [])
99 var signified = require('../plugs').first(exports.signified = [])
1010
1111 exports.suggest = cont.to(function (word, cb) {
12- if(!/^@\w/.test(word)) return cb()
12 + if(!/^[%&@]\w/.test(word)) return cb()
1313
1414
1515 signified(word, function (err, names) {
1616 if(err) cb(err)
modules_core/tabs.jsView
@@ -149,8 +149,14 @@
149149 case 51: // 3
150150 if (ev.shiftKey)
151151 search.activate('#', ev)
152152 return
153 +
154 + // navigate to a message
155 + case 53: // 5
156 + if (ev.shiftKey)
157 + search.activate('%', ev)
158 + return
153159 }
154160 })
155161
156162 // errors tab
modules_extra/git.jsView
@@ -78,8 +78,9 @@
7878 var text = document.createTextNode(id.substr(0, 10) + '…')
7979 getAvatar({links: sbot_links, get: sbot_get}, self_id, id,
8080 function (err, avatar) {
8181 if(err) return console.error(err)
82 + if (avatar.name[0] !== '%') avatar.name = '%' + avatar.name
8283 text.nodeValue = avatar.name
8384 })
8485 return text
8586 }
style.cssView
@@ -252,9 +252,9 @@
252252 }
253253
254254 .suggest-box ul {
255255 list-style-type: none;
256- padding-left: -2em;
256 + padding-left: 0;
257257 }
258258
259259 .suggest-box .selected {
260260 background: #eee;

Built with git-ssb-web