git ssb

3+

ev / decent



Commit 7c83a74b23178a661998f2cad6192e20e95076f2

fix emoji suggest - 3.5.1

Ev Bogue committed on 10/8/2017, 3:44:47 PM
Parent: 3e1586c0f4e42c877a6e5f48b192f15cfdbec400

Files changed

client/modules/emoji.jschanged
client/modules/index.jschanged
client/modules/suggest-mentions.jschanged
package.jsonchanged
client/modules/emoji.jsView
@@ -7,14 +7,23 @@
77
88 exports.gives = {
99 emoji_names: true,
1010 emoji_url: true,
11- suggest_mentions: true
11 + //suggest_mentions: true
1212 }
1313
1414 exports.create = function (api) {
15- return {
16- suggest_mentions: function (word) {
15 + return {
16 +
17 + emoji_names: function () {
18 + return emojiNames
19 + },
20 + emoji_url: function (emoji) {
21 + return emoji in emojis &&
22 + api.blob_url(emoji).replace(/\/blobs\/get/, '/img/emoji') + '.png'
23 + },
24 +
25 + /* suggest_mentions: function (word) {
1726 return function (cb) {
1827 if (word[0] !== ':' || word.length < 2) return cb()
1928 word = word.substr(1)
2029 if (word[word.length-1] === ':') word = word.substr(0, word.length-1)
@@ -28,15 +37,8 @@
2837 value: ':' + emoji + ':'
2938 }
3039 }))
3140 }
32- },
33- emoji_names: function () {
34- return emojiNames
35- },
36- emoji_url: function (emoji) {
37- return emoji in emojis &&
38- api.blob_url(emoji).replace(/\/blobs\/get/, '/img/emoji') + '.png'
39- }
41 + }*/
4042 }
4143 }
4244
client/modules/index.jsView
@@ -12,8 +12,9 @@
1212 "avatar-link.js": require('./avatar-link.js'),
1313 "avatar-name.js": require('./avatar-name.js'),
1414 "avatar-profile.js": require('./avatar-profile.js'),
1515 "avatar.js": require('./avatar.js'),
16 + "emoji.js": require('./emoji.js'),
1617 "compose.js": require('./compose.js'),
1718 "feed.js": require('./feed.js'),
1819 "follow.js": require('./follow.js'),
1920 "invite.js": require('./invite.js'),
@@ -34,9 +35,8 @@
3435 "suggest-mentions.js": require('./suggest-mentions.js'),
3536 "thread.js": require('./thread.js'),
3637 "timestamp.js": require('./timestamp.js'),
3738 "channel.js": require('./channel.js'),
38- "emoji.js": require('./emoji.js'),
3939 "nudge.js": require('./nudge.js'),
4040 "key.js": require('./key.js'),
4141 "notifications.js": require('./notifications.js'),
4242 "search.js": require('./search')
client/modules/suggest-mentions.jsView
@@ -6,8 +6,10 @@
66
77 exports.needs = {
88 sbot_links2: 'first',
99 blob_url: 'first',
10 + emoji_names: 'first',
11 + emoji_url: 'first',
1012 signified: 'first',
1113 builtin_tabs: 'map'
1214 }
1315
@@ -20,8 +22,26 @@
2022
2123 return {
2224 suggest_mentions: function (word) {
2325 return function (cb) {
26 + //emoji
27 +
28 + if (word[0] !== ':' || word.length < 2) return cb()
29 + word = word.substr(1)
30 + if (word[word.length-1] === ':') word = word.substr(0, word.length-1)
31 + cb(null, api.emoji_names().filter(function (name) {
32 + return name.substr(0, word.length) === word
33 + }).slice(0, 50).map(function (emoji) {
34 + return {
35 + image: api.emoji_url(emoji),
36 + title: emoji,
37 + subtitle: emoji,
38 + value: ':' + emoji + ':'
39 + }
40 + }))
41 +
42 +
43 + // names, repos, etc
2444 if(!/^[%&@]\w/.test(word)) return cb()
2545
2646 api.signified(word, function (err, names) {
2747 if(err) cb(err)
package.jsonView
@@ -1,7 +1,7 @@
11 {
22 "name": "decent",
3- "version": "3.5.0",
3 + "version": "3.5.1",
44 "description": "A decent(tralized) network for communication and development",
55 "scripts": {
66 "start": "node decent server",
77 "build": "node client/scripts/style.js && mkdir -p build && browserify client/index.js | indexhtmlify > build/index.html",

Built with git-ssb-web