Skip to content

Commit

Permalink
Add emojis back, because removing them broke local dev Sandstorm.
Browse files Browse the repository at this point in the history
Thanks to xet7 ! Opens #1248, opens #743, opens #643, opens #323
  • Loading branch information
xet7 committed Sep 25, 2017
1 parent f0b7f34 commit a62c8eb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions .meteor/packages
Expand Up @@ -69,6 +69,7 @@ mquandalle:mousetrap-bindglobal
mquandalle:perfect-scrollbar
peerlibrary:blaze-components@=0.15.1
perak:markdown
seriousm:emoji-continued
templates:tabs
verron:autosize
simple:json-routes
Expand Down
1 change: 1 addition & 0 deletions .meteor/versions
Expand Up @@ -129,6 +129,7 @@ reactive-var@1.0.11
reload@1.1.11
retry@1.0.9
routepolicy@1.0.12
seriousm:emoji-continued@1.4.0
service-configuration@1.0.11
session@1.1.7
sha@1.0.9
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,11 @@
# v0.43 2017-09-25 Wekan release

This release fixes the following bugs:

* [Add emojis back, because removing them broke local dev Sandstorm](https://github.com/wekan/wekan/issues/1248).

Thanks to GitHub user xet7 for contributions.

# v0.42 2017-09-25 Wekan release

This release fixes the following bugs:
Expand Down
5 changes: 3 additions & 2 deletions client/components/main/editor.jade
Expand Up @@ -9,5 +9,6 @@ template(name="editor")
template(name="viewer")
.viewer
+mentions
+markdown
{{> UI.contentBlock }}
+emoji
+markdown
{{> UI.contentBlock }}
19 changes: 19 additions & 0 deletions client/components/main/editor.js
Expand Up @@ -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.]*)$/,
Expand Down

0 comments on commit a62c8eb

Please sign in to comment.