emoji-picker
emoji-picker copied to clipboard
Add option to replace the unicode equivalent with the image instead
I am working on an application which will use emojis, and so far from what I can tell there is no option to use images instead of the unicode symbols.
The unicode symbols are ugly and I'd very much prefer using the images instead. Is it possible to do this currently or will this have to be added?
Thanks
+1
function unicodeToImage (input) {
if (!input) {
return '';
}
if (!Config.rx_colons) {
Config.init_unified();
}
return input.replace(Config.rx_codes, function(m) {
var $img;
if (m) {
$img = $.emojiarea.createIcon($.emojiarea.icons[":"+Config.reversemap[m]+":"]);
return $img;
} else {
return '';
}
});
};
usage :
unicodeToImage('😍')
output :
<img src="/static/chat/website/static/images/emoji/blank.gif" class="img" style="display:inline-block;width:25px;height:25px;background:url('/static/chat/website/static/images/emoji/emoji_spritesheet_0.png') -150px 0px no-repeat;background-size:675px 175px;" alt=":heart_eyes:">