Merge branch 'feature/normal-emoji-completion' into 'develop'
Add completion for normal emoji. Closes #15 See merge request pleroma/pleroma-fe!169
This commit is contained in:
commit
3ff39f9b39
4 changed files with 20 additions and 5 deletions
|
@ -64,14 +64,15 @@ const PostStatusForm = {
|
|||
img: profile_image_url_original
|
||||
}))
|
||||
} else if (firstchar === ':') {
|
||||
const matchedEmoji = filter(this.emoji, (emoji) => emoji.shortcode.match(this.textAtCaret.slice(1)))
|
||||
const matchedEmoji = filter(this.emoji.concat(this.customEmoji), (emoji) => emoji.shortcode.match(this.textAtCaret.slice(1)))
|
||||
if (matchedEmoji.length <= 0) {
|
||||
return false
|
||||
}
|
||||
return map(take(matchedEmoji, 5), ({shortcode, image_url}) => ({
|
||||
return map(take(matchedEmoji, 5), ({shortcode, image_url, utf}) => ({
|
||||
// eslint-disable-next-line camelcase
|
||||
screen_name: `:${shortcode}:`,
|
||||
name: '',
|
||||
utf: utf || '',
|
||||
img: image_url
|
||||
}))
|
||||
} else {
|
||||
|
@ -90,6 +91,9 @@ const PostStatusForm = {
|
|||
},
|
||||
emoji () {
|
||||
return this.$store.state.config.emoji || []
|
||||
},
|
||||
customEmoji () {
|
||||
return this.$store.state.config.customEmoji || []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
</div>
|
||||
<div style="position:relative;" v-if="candidates">
|
||||
<div class="autocomplete-panel base05-background">
|
||||
<div v-for="candidate in candidates" @click="replace(candidate.screen_name + ' ')" class="autocomplete base02">
|
||||
<img :src="candidate.img"></img>
|
||||
<div v-for="candidate in candidates" @click="replace(candidate.utf || (candidate.screen_name + ' '))" class="autocomplete base02">
|
||||
<span v-if="candidate.img"><img :src="candidate.img"></img></span>
|
||||
<span v-else>{{candidate.utf}}</span>
|
||||
<span>
|
||||
{{candidate.screen_name}}
|
||||
<small class="base02">{{candidate.name}}</small>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue