emoji-picker icon indicating copy to clipboard operation
emoji-picker copied to clipboard

Add option to replace the unicode equivalent with the image instead

Open mrparkerlol opened this issue 7 years ago • 2 comments

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

mrparkerlol avatar Dec 10 '17 06:12 mrparkerlol

+1

moslem-hadi avatar Jan 02 '18 07:01 moslem-hadi

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:">

deveshgoyal avatar Feb 09 '18 09:02 deveshgoyal