Permalink
Browse files

Remove Emoji support, so MAC addresses etc show correctly.

Thanks to xet7 ! Closes #1248, closes #323
  • Loading branch information...
xet7 committed Feb 12, 2018
1 parent 69e4ad4 commit 056843d66c361594d5d4478cfe86e2e405333b91
@@ -66,7 +66,6 @@ mquandalle:mousetrap-bindglobal
mquandalle:perfect-scrollbar
peerlibrary:blaze-components@=0.15.1
perak:markdown
seriousm:emoji-continued
templates:tabs
verron:autosize
simple:json-routes
@@ -134,7 +134,6 @@ 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
@@ -9,6 +9,5 @@ template(name="editor")
template(name="viewer")
.viewer
+mentions
+emoji
+markdown
{{> UI.contentBlock }}
+markdown
{{> UI.contentBlock }}
@@ -4,25 +4,6 @@ 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.]*)$/,
@@ -47,7 +28,7 @@ Template.editor.onRendered(() => {
import sanitizeXss from 'xss';
// XXX I believe we should compute a HTML rendered field on the server that
// would handle markdown, emoji and user mentions. We can simply have two
// would handle markdown and user mentions. We can simply have two
// fields, one source, and one compiled version (in HTML) and send only the
// compiled version to most users -- who don't need to edit.
// In the meantime, all the transformation are done on the client using the
@@ -270,11 +270,6 @@ kbd
.grabbing
cursor: grabbing
.emoji
height: 18px
width: 18px
vertical-align: text-bottom
// Implement a thiner close icon as suggested in
// https://github.com/FortAwesome/Font-Awesome/issues/1540#issuecomment-68689950
.fa.fa-times-thin:before

This file was deleted.

Oops, something went wrong.
@@ -90,9 +90,6 @@ Template.keyboardShortcuts.helpers({
}, {
keys: ['@'],
action: 'shortcut-autocomplete-members',
}, {
keys: [':'],
action: 'shortcut-autocomplete-emoji',
}, {
keys: ['SPACE'],
action: 'shortcut-assign-self',

16 comments on commit 056843d

@AlexanderZobkov

This comment has been minimized.

AlexanderZobkov replied Feb 13, 2018

Hello @xet7

Does this commit remove support for emoji from everywhere (Description, titles, etc) in Wekan?
We use emoji heavily to mark cards with "badges": priority, type and etc.
Unfortunately,

  • labels are not so visually distinguishable as badged inform of emoji icons.
  • And custom fields are not ready yet.

Emoji removal would be catastrophic and make cards visually distinguishable. Usage of markdown inline images is not user-friendly and complicates a process.

Could you please return emoji support?

@xet7

This comment has been minimized.

Member

xet7 replied Feb 13, 2018

@AlexanderZobkov

Only if these conditions are met:

  • there is a way to have MAC addresses, URLs, clock times, etc work also as in #1248
  • you pay me for Commercial Support for all development hours of the fix, not only the fixed amount mentioned at https://wekan.team
  • or you develop the fix and add as pull request to Wekan devel branch

I have tried to remove emoji support for a long time, to fix this bug of all my clock times at Wekan board displaying broken.

@xet7

This comment has been minimized.

Member

xet7 replied Feb 14, 2018

@AlexanderZobkov

I do recommend that you:

  1. Make backup of your Wekan database
  2. Connect to Wekan's MongoDB database with MongoDB CLI or GUI like Robo3T
  3. Google search for query syntax that replaces in all texts in cards collection: emoji text => Unicode emoji with markdown that sets for example color and size of emoji, you can see example markdown formatting at https://wekan.github.io/
@xet7

This comment has been minimized.

Member

xet7 replied Feb 14, 2018

@AlexanderZobkov

Another way to make replacementes is to:

  1. Export Wekan board to JSON file
  2. Use text editor or some programming language to replace texts in that JSON textfile
  3. Import board JSON back to Wekan
@AlexanderZobkov

This comment has been minimized.

AlexanderZobkov replied Feb 16, 2018

@xet7

Unfortunately, Unicode emoji are not displayed in the same way and correctly in popular browsers.
Could this be somehow fixed with a special font used?
Also how to significantly increase size of unicode emoji? '#' helps but not to much.

https://unicode.org/emoji/charts/full-emoji-list.html

Chrome
image

Firefox
image

@xet7

This comment has been minimized.

Member

xet7 replied Feb 16, 2018

@AlexanderZobkov

If you really want it to look same as before, you use search-replace in MongoDB database the old emoji codes with adding image url like at https://wekan.github.io/ I added cat image, so you download all prevoious emojis from https://github.com/SeriousM/meteor-emoji/tree/master/img and host them on your website. That way you can also add bigger images.

You could also use html/css to make unicode text bigger.

I don't know are there good free fonts with good common emojis.

@xet7

This comment has been minimized.

Member

xet7 replied Feb 16, 2018

I'm thinking, that if I would add back emoji support, what character to use? The : character is not good, it breaks clock times etc. If there is double of them like :: then it could break C++ code. Any suggestions?

@xet7

This comment has been minimized.

Member

xet7 replied Feb 16, 2018

If there were for four characters like :::: then probably that would not brake anything.

@AlexanderZobkov

This comment has been minimized.

AlexanderZobkov replied Feb 17, 2018

IMHO, Usage of double/quadro/triple ': or any other symbol as marker seems a dirty workaround and not reliable.
A reliable approach would be to keep a text span as is if a reference to emoji (like :00:12: ,00:as:fe:12: ) could not be resolved to a valid picture. Probably Wekan could be switched to another emoji library or previously used could be reconfigured to a desired behavior?

As demonstrated in #323, emojione:emojione seems implements the desired behavior.

@xet7

This comment has been minimized.

Member

xet7 replied Feb 17, 2018

@AlexanderZobkov

Emojione has smaller emojis and still breaks URLs.

I could try requiring space before : so it would be " :", that would probably not break in middle of URLs

@ocdtrekkie

This comment has been minimized.

Contributor

ocdtrekkie replied Feb 17, 2018

@AlexanderZobkov The problem is, the old text-to-emoji method is a "dirty workaround" and it breaks super critical things. Consider that with previous versions of Wekan... a kanban board has issues rendering time. Kinda a big flaw. URLs and the like are all far more important to render accurately.

IMHO, the old way of replacing emojis which harkens back to old forum software, isn't something many new pieces of software support today, and with more and more mobile keyboards and even desktop software having access to proper Unicode-based emoji, that's really where people have moved.

@ocdtrekkie

This comment has been minimized.

Contributor

ocdtrekkie replied Feb 17, 2018

It seems your primary issue is with moving to Unicode emoji is that they are different in some browsers, but that is... a reality of being on the Internet. If your emojis are distinct enough from each other, they should be discernable even if displayed a little different.

I feel this issue may be crossing into https://xkcd.com/1172/ territory, though that's just a personal opinion.

@xet7

This comment has been minimized.

Member

xet7 replied Feb 17, 2018

Yes, because copy-pasting text with unicode emoji is so easy. I really don't know good reason to have that slowdown broken emoji fuctionality back.

@xet7

This comment has been minimized.

Member

xet7 replied Feb 17, 2018

@ocdtrekkie

Thanks for your support !

@AlexanderZobkov

This comment has been minimized.

AlexanderZobkov replied Feb 18, 2018

@ocdtrekkie
Unicode emoji could be a good alternative. However, it has several issues:

  1. The primary issue with unicode emoji is that they look different from browser to browser. And may not display at all, as unicode emoji depends on a browser and fonts installed.
  2. Display size is too small. Potentially displayed size could be increased with with css/html tags when inserting in a card.

When Wekan is used for personal Kanban purposes, these issues could be worked around and not so critical.

However, when Wekan is used by a group of people (technical and non-technical) these issues become critical and renders impossible to use unicode emoji:
Issue 1) - practically impossible to force everyone to use this or that browser or install fonts.
Issue 2) - practically impossible to force everyone to study css/html and use it.

@ocdtrekkie

This comment has been minimized.

Contributor

ocdtrekkie replied Feb 18, 2018

Most Unicode emoji are reasonably universal in both support and appearance. If you aren't using emoji released in the last six months, all modern operating systems and browsers should support them just fine. Scalability is definitely something that works far better with Unicode-based things than image replacement plugins.

Please sign in to comment.