After a fun little muck about with the new plugin api features, I’ve updated this to use the virtual dom, and allowed for adding / removing reactions via click.
Yep, there’s different versions for Discourses running before / after the plugin API was introduced. Although if I have another spike on this I may just take it out, as backwards compat isn’t a huge concern to me for this plugin, it leads to massive duplication, and testing on old Discourse versions wouldn’t be my idea of a good time.
I’ve noticed a bug, specifically, when attempting to add an emoticon whilst in mobile view, the retort-emoji is not added to the page dynamically like it is in desktop view. Additionally, there is an error message:
Would you know what could be causing this? Or has anyone else encountered this? Going to dig around but thought I’d also post here first in case someone has also experienced this.
Pretty nice plugin. With Facebook really pushing people to use emoji to react in different ways it’s become a popular request on forums that don’t have it. I know on some of my xenforo based ones we have something similar, glad to see a plugin here for it too.
Was there a way to limit the reactions to a few selected options rather than any emoji? Similar to how Facebook has a small selection of general ones?
It’s been requested a couple times, and is definitely top of the list for this plugin, although my hacking time is pretty limited these days, and will be mostly focused on Babble when it arises. At some point I’ll dig up a rainy afternoon to make it happen though. (PRs also welcome!)
I created a plugin that limits the number of emojis to four to to emulate Facebook’s limited (six) reactions.
For example, in my emoji library, I have,
const groups = [
{
name:"people",
fullname:"People",
tabicon:"grinning",
icons:[
"laughing",
"astonished",
"cry",
"rage"
]
}
];
// scrub groups
groups.forEach(group => {
group.icons = group.icons.reject(obj => !Discourse.Emoji.exists(obj));
});
// export so others can modify
Discourse.Emoji.groups = groups;
export default groups;
…which with some CSS looks like,
…and doesn’t affect the composer emojis,
Let me know if you’d like to tinker with it, and I’ll put it up on my Github.
Some things to be aware of when submitting that PR:
We’ll need to be able to control whether Retort uses a custom emoji set or not, probably via a site setting. I want to make sure folks can have the slack emoji experience if they want the slack emoji experience, or the facebook emoji experience if they want that.
Perhaps more importantly, we need to allow folks to specify which emojis they’re getting when they select the custom emoji option, rather than hard-coding them.
As an added bonus, supporting custom (user uploaded) emojis would be super cool here, as it would allow for super great control and flexibility over what people can react with.
Has anyone else figured out have retort behave the same way on mobile as it does on desktop? Right now when you react with an emoji, it only appears after refresh, which make it appear as though the button does nothing.
Hey @Pad_Pors. If you check my github repo, specifically, https://github.com/ivanrlio/retort/blob/master/assets/javascripts/discourse/lib/emoji/emoji-groups.js.es6, you can see that I only have 4 emojis listed. Since then, I’ve only added one more which is a thumbs-up to emulate the ‘Like’ on Facebook.