needim / wdt-emoji-bundle

Slack like emoji picker with apple/ios, twitter/twemoji, google, emojione, facebook, messenger emoji support
http://ned.im/wdt-emoji-bundle
MIT License
419 stars 87 forks source link

Can we combine the two datasets? #20

Open Redsandro opened 7 years ago

Redsandro commented 7 years ago

We have a long string of emoji data in emoji.min.js and again but different in defaults.emojiData. Can we have just one? Where does the latter come from? Did you create the latter one yourself, or could it be a dependency?


I think you could deprecate the dependency on js-emoji and use emojiData to define images in the layout.

E.g. in stead of

self.emoji.replace_colons(':smile:');

use separate function for something like

(self.emojiData.filter(function(el){el.short_name == 'smile'})[0] || {}).image;

it returns the image (or undefined)

needim commented 7 years ago

Yep, you are right. I created a new object because I wanted performance gain for the loops. (mainly for this function: wdtEmojiBundle.fillPickerPopup())

It would be nice to have just one object, maybe we can find a better way. And this bundle uses sheets instead of single images.