aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreal <eal@waifu.club>2017-10-19 23:39:21 +0300
committereal <eal@waifu.club>2017-10-19 23:39:21 +0300
commitba9b04a8bacc62be0264c4fdd3dbcf34f12f7e4b (patch)
treea0a6aa412584e98a6ceaa7b243900077ad7eadf4 /src
parent447ec911766a9c5b6d5512a9e054fdbbe39df92a (diff)
Use the API endpoint for emoji completion.
Diffstat (limited to 'src')
-rw-r--r--src/main.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.js b/src/main.js
index bac4d0f7..b994e154 100644
--- a/src/main.js
+++ b/src/main.js
@@ -103,12 +103,11 @@ window.fetch('/static/terms-of-service.html')
store.dispatch('setOption', { name: 'tos', value: html })
})
-window.fetch('/static/emoji.txt')
- .then((res) => res.text())
- .then((csv) => {
- const emoji = csv.split('\n').map((row) => {
- const values = row.split(', ')
- return { shortcode: values[0], image_url: values[1] }
+window.fetch('/api/pleroma/emoji.json')
+ .then((res) => res.json())
+ .then((values) => {
+ const emoji = Object.keys(values).map((key) => {
+ return { shortcode: key, image_url: values[key] }
})
store.dispatch('setOption', { name: 'emoji', value: emoji })
})