summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-09-25 19:40:41 +0300
committerLauri Ojansivu <x@xet7.org>2017-09-25 19:40:41 +0300
commita62c8eb5a02b838e0eed809032cba31f64a122c0 (patch)
treeef18ea8164bf5bec859fbd6d794c0d6e0cc06530 /client/components
parentf0b7f349289a6bf573563b6408cc9f66da18a292 (diff)
downloadwekan-a62c8eb5a02b838e0eed809032cba31f64a122c0.tar.gz
wekan-a62c8eb5a02b838e0eed809032cba31f64a122c0.tar.bz2
wekan-a62c8eb5a02b838e0eed809032cba31f64a122c0.zip
Add emojis back, because removing them broke local dev Sandstorm.
Thanks to xet7 ! Opens #1248, opens #743, opens #643, opens #323
Diffstat (limited to 'client/components')
-rw-r--r--client/components/main/editor.jade5
-rwxr-xr-xclient/components/main/editor.js19
2 files changed, 22 insertions, 2 deletions
diff --git a/client/components/main/editor.jade b/client/components/main/editor.jade
index 31f533e6..f10d64a1 100644
--- a/client/components/main/editor.jade
+++ b/client/components/main/editor.jade
@@ -9,5 +9,6 @@ template(name="editor")
template(name="viewer")
.viewer
+mentions
- +markdown
- {{> UI.contentBlock }}
+ +emoji
+ +markdown
+ {{> UI.contentBlock }}
diff --git a/client/components/main/editor.js b/client/components/main/editor.js
index ea24f518..5987b772 100755
--- a/client/components/main/editor.js
+++ b/client/components/main/editor.js
@@ -4,6 +4,25 @@ Template.editor.onRendered(() => {
autosize($textarea);
$textarea.escapeableTextComplete([
+ // Emoji
+ {
+ match: /\B:([\-+\w]*)$/,
+ search(term, callback) {
+ callback(Emoji.values.map((emoji) => {
+ return emoji.includes(term) ? emoji : null;
+ }).filter(Boolean));
+ },
+ template(value) {
+ const imgSrc = Emoji.baseImagePath + value;
+ const image = `<img src="${imgSrc}.png" />`;
+ return image + value;
+ },
+ replace(value) {
+ return `:${value}:`;
+ },
+ index: 1,
+ },
+
// User mentions
{
match: /\B@([\w.]*)$/,