Skip to content

Commit a87f492

Browse files
committed
Document emoji autocompletion and make it configurable
Signed-off-by: Jonas Meurer <[email protected]>
1 parent 3975e1a commit a87f492

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

l10n/messages.pot

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,5 @@ msgstr ""
134134
msgid "Undo changes"
135135
msgstr ""
136136

137-
msgid "Write message, @ to mention someone …"
137+
msgid "Write message, @ to mention someone, : for emoji autocompletion …"
138138
msgstr ""

src/components/RichContenteditable/RichContenteditable.vue

+16-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
### General description
2525

26-
This component displays contenteditable div with automated @ autocompletion [at].
26+
This component displays contenteditable div with automated `@` [at] autocompletion and `:` [colon] emoji autocompletion.
2727
Note you need to register the [tooltip directive](https://nextcloud-vue-components.netlify.app/#/Directives) in your entry file.
2828

2929
### Examples
@@ -36,7 +36,7 @@ Note you need to register the [tooltip directive](https://nextcloud-vue-componen
3636
:auto-complete="autoComplete"
3737
:maxlength="100"
3838
:user-data="userData"
39-
placeholder="Try mentioning the user Test01"
39+
placeholder="Try mentioning user @Test01 or inserting emoji :smile"
4040
@submit="onSubmit" />
4141
<br>
4242

@@ -46,7 +46,7 @@ Note you need to register the [tooltip directive](https://nextcloud-vue-componen
4646
:maxlength="400"
4747
:multiline="true"
4848
:user-data="userData"
49-
placeholder="Try mentioning the user Test01"
49+
placeholder="Try mentioning user @Test01 or inserting emoji :smile"
5050
@submit="onSubmit" />
5151
<br>
5252
<br>
@@ -167,7 +167,7 @@ export default {
167167

168168
placeholder: {
169169
type: String,
170-
default: t('Write message, @ to mention someone …'),
170+
default: t('Write message, @ to mention someone, : for emoji autocompletion …'),
171171
},
172172

173173
autoComplete: {
@@ -214,6 +214,14 @@ export default {
214214
type: Number,
215215
default: null,
216216
},
217+
218+
/**
219+
* Enable or disable emoji autocompletion
220+
*/
221+
emojiAutocomplete: {
222+
type: Boolean,
223+
default: true,
224+
},
217225
},
218226

219227
data() {
@@ -336,8 +344,10 @@ export default {
336344
this.autocompleteTribute = new Tribute(this.autocompleteOptions)
337345
this.autocompleteTribute.attach(this.$el)
338346

339-
this.emojiTribute = new Tribute(this.emojiOptions)
340-
this.emojiTribute.attach(this.$el)
347+
if (this.emojiAutocomplete) {
348+
this.emojiTribute = new Tribute(this.emojiOptions)
349+
this.emojiTribute.attach(this.$el)
350+
}
341351

342352
// Update default value
343353
this.updateContent(this.value)

0 commit comments

Comments
 (0)