mervick / emojionearea

Emoji Picker Plugin for jQuery
https://jsfiddle.net/mervick/1v03Lqnu/765/
MIT License
953 stars 257 forks source link

Compatible with emoji-toolkit? #386

Open sebsobseb opened 4 years ago

sebsobseb commented 4 years ago

As mentioned on their GitHub, Emojione is archived and moved to a new repo: https://github.com/joypixels/emoji-toolkit

Is this lib still compatible with this new version?

mervick commented 4 years ago

It does not compatible with new version yet.

sebsobseb commented 4 years ago

@mervick are there any plans?

mervick commented 4 years ago

Yes, but it is not on first line. Currently I am making redesign of code and fixing many bugs

alexkozler commented 4 years ago

Is there any temporary workaround to make this load images from JoyPixels/emoji-toolkit other than downgrading to EmojiOne 3.x?

For instance, I use joypixels with a custom path to the emoji, and when emojiOneArea loads it ends up pulling in an old emojiOne library (from a CDN I presume) and setting the image sources for all the emoji to broken CDN links.

mervick commented 4 years ago

Try this: load joypixels on your page, and then

window.emojione = window.joypixels;

$("#emojionearea").emojioneArea({
  useInternalCDN: false
});
alexkozler commented 4 years ago

Unfortunately it still tries to load them from https://cdn.jsdelivr.net/emojione/assets/3.1/png/

$(document).ready(function () {
    joypixels.imagePathPNG = "https://mysite.com/emoji/32/";

    window.emojione = window.joypixels;
    $("#txtMsg").emojioneArea({
        useInternalCDN: false,
        pickerPosition: "bottom",
        recentEmojis: false,
        search: false,
        tones: false,
        autocomplete: false
    });
});
mervick commented 4 years ago

Change this line https://github.com/mervick/emojionearea/blob/dc73dc556fdc6e82c5d26847533b893ece255ce1/dist/emojionearea.js#L31 to

var emojione = window.joypixels; 

and make sure you don't call $.fn.emojioneArea() before joypixels is loaded

alexkozler commented 4 years ago

Thanks! I changed that, and then I also had to change this line: https://github.com/mervick/emojionearea/blob/dc73dc556fdc6e82c5d26847533b893ece255ce1/dist/emojionearea.js#L82

to

unicode = unicode.uc_full.toUpperCase();

Now it works fine with joypixels 5.0

alexkozler commented 4 years ago

Only other oddity is that this line no longer works in joypixels: https://github.com/mervick/emojionearea/blob/dc73dc556fdc6e82c5d26847533b893ece255ce1/dist/emojionearea.js#L680

Not sure what the equivalent of it is. Seems like its just trying to convert the unicode emoji into the text representation like "1f60b" and its failing because "jsEscapeMap" no longer exists. Oddly enough it throws exceptions but doesn't break any functionality.

I'm pretty amateur at JS or I'd try and fix it...

mervick commented 4 years ago

They removed unicode hash, so it require a lot of changes.

AlexanderKat commented 4 years ago

When will the new version be released?

mervick commented 4 years ago

@AlexanderKat, I am the only one active developer of this plugin and I have many tasks to do at my primary work, so I have no time to update this plugin any time soon