# Discourse Retort

**URL:** https://meta.discourse.org/t/discourse-retort/35903
**Category:** Plugin
**Tags:** end-of-life
**Created:** [11월 22, 2015, 11:53오전 UTC](https://meta.discourse.org/t/discourse-retort/35903 "2015-11-22T11:53:58Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![rewphus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rewphus/32/115836_2.png) [@rewphus](https://meta.discourse.org/u/rewphus)
#### Post date: [3월 8, 2016, 3:30오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/41 "2016-03-08T15:30:21Z")

</div>

I’m wondering if this might be caused by a conflict with my own customizations, but is anybody else seeing the following in console after replying?

`Uncaught TypeError: Cannot read property 'length' of undefined`

Which points to:

```plaintext
api.decorateWidget('post-contents:after-cooked', function (dec) {
        var post = dec.getModel();
        Discourse.Retort = Discourse.Retort || { widgets: {} };
        Discourse.Retort.widgets[post.id] = dec.widget;

      if (post.retorts.length === 0) {
          return;
        }

```

And then it appears that it doesn’t properly close the submit-panel

 ![](https://global.discourse-cdn.com/meta/original/3X/e/d/edd1b77861a44fa27fbdaa25b9848c7bd6422e35.png)

This is on v1.5.0.beta11 +277. If nobody else is seeing it, it must be a conflict with my own plugins.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [3월 8, 2016, 5:46오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/42 "2016-03-08T17:46:31Z")

</div>

> [@rewphus](#):
>
> If nobody else is seeing it, it must be a conflict with my own plugins.

You know there’s a _really_ easy way to test that, right? 😉

---

<div class="post-metadata">

### Author: ![nickmorin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nickmorin/32/84127_2.png) [@nickmorin](https://meta.discourse.org/u/nickmorin)
#### Post date: [3월 9, 2016, 12:57오전 UTC](https://meta.discourse.org/t/discourse-retort/35903/43 "2016-03-09T00:57:04Z")

</div>

Just installed - this plugin is working great! 👏 🙌 👍

Thank you @gdpelican and @cpradio for all your hard work! 🙂

---

<div class="post-metadata">

### Author: ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)
#### Post date: [3월 9, 2016, 9:43오전 UTC](https://meta.discourse.org/t/discourse-retort/35903/44 "2016-03-09T09:43:40Z")

</div>

> [@rewphus](#):
>
> I’m wondering if this might be caused by a conflict with my own customizations, but is anybody else seeing the following in console after replying?

Thanks for the report, I’ve fixed this in the latest. 🌴!

---

<div class="post-metadata">

### Author: ![romdos](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/romdos/32/54307_2.png) [@romdos](https://meta.discourse.org/u/romdos)
#### Post date: [3월 11, 2016, 9:45오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/45 "2016-03-11T21:45:52Z")

</div>

Hoping there will soon be a way to remove reactions. I added a couple of [issues about this](https://github.com/gdpelican/retort/issues).

---

<div class="post-metadata">

### Author: ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)
#### Post date: [3월 18, 2016, 10:21오전 UTC](https://meta.discourse.org/t/discourse-retort/35903/46 "2016-03-18T10:21:37Z")

</div>

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.

 ![](https://global.discourse-cdn.com/meta/original/3X/0/c/0c0ac73f01f40c23485975d7d936cb70f5a51831.gif)

---

<div class="post-metadata">

### Author: ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)
#### Post date: [3월 18, 2016, 11:20오전 UTC](https://meta.discourse.org/t/discourse-retort/35903/47 "2016-03-18T11:20:14Z")

</div>

Great! I love it. You’re making very good stuff man

---

<div class="post-metadata">

### Author: ![stevenpslade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stevenpslade/32/53550_2.png) [@stevenpslade](https://meta.discourse.org/u/stevenpslade)
#### Post date: [3월 24, 2016, 5:24오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/48 "2016-03-24T17:24:47Z")

</div>

@gdpelican I noticed in your plugin you have:

`import PostMenuComponent from 'discourse/components/post-menu';`

However, I believe post menu has moved from a component to a widget. With that said though, it still seems to work, why?

EDIT: I see you are using that for priorToApi…and then for current version creating a retort widget?

---

<div class="post-metadata">

### Author: ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)
#### Post date: [3월 24, 2016, 9:01오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/49 "2016-03-24T21:01:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ivanrlio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivanrlio/32/48497_2.png) [@ivanrlio](https://meta.discourse.org/u/ivanrlio)
#### Post date: [5월 4, 2016, 10:28오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/53 "2016-05-04T22:28:33Z")

</div>

Hey @gdpelican,

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:  
 ![](https://global.discourse-cdn.com/meta/original/3X/2/2/228b726bb1de79c518ebf697efa2e220051d3c86.png)

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.

---

<div class="post-metadata">

### Author: ![Overmind](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overmind/32/55446_2.png) [@Overmind](https://meta.discourse.org/u/Overmind)
#### Post date: [5월 5, 2016, 5:47오전 UTC](https://meta.discourse.org/t/discourse-retort/35903/54 "2016-05-05T05:47:46Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)
#### Post date: [5월 5, 2016, 9:10오전 UTC](https://meta.discourse.org/t/discourse-retort/35903/55 "2016-05-05T09:10:21Z")

</div>

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](https://meta.discourse.org/t/babble-a-chat-plugin/31753) when it arises. At some point I’ll dig up a rainy afternoon to make it happen though. (PRs also welcome!)

---

<div class="post-metadata">

### Author: ![ivanrlio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivanrlio/32/48497_2.png) [@ivanrlio](https://meta.discourse.org/u/ivanrlio)
#### Post date: [5월 5, 2016, 4:17오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/56 "2016-05-05T16:17:25Z")

</div>

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,

 ![](https://global.discourse-cdn.com/meta/original/3X/4/d/4d80251b733a51b6ad4a64cf16da1ecf66c07840.png)

…and doesn’t affect the composer emojis,

 ![](https://global.discourse-cdn.com/meta/original/3X/1/b/1b4bcce51880fc7540e1c20ca44cc1e98fb44260.png)

Let me know if you’d like to tinker with it, and I’ll put it up on my Github.

---

<div class="post-metadata">

### Author: ![Overmind](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overmind/32/55446_2.png) [@Overmind](https://meta.discourse.org/u/Overmind)
#### Post date: [5월 5, 2016, 4:53오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/57 "2016-05-05T16:53:55Z")

</div>

I would, let me know when you upload it and I’ll mess around with it on a development board.

---

<div class="post-metadata">

### Author: ![ivanrlio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivanrlio/32/48497_2.png) [@ivanrlio](https://meta.discourse.org/u/ivanrlio)
#### Post date: [5월 5, 2016, 6:05오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/58 "2016-05-05T18:05:32Z")

</div>

Here it is, [GitHub - ivanrlio/retort · GitHub](https://github.com/ivanrlio/retort) .

Hope this is what you were looking for.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [5월 8, 2016, 10:23오전 UTC](https://meta.discourse.org/t/discourse-retort/35903/59 "2016-05-08T10:23:21Z")

</div>

Wouldn’t the best thing be to make a pull request for this feature to be added as an optional setting in the canonical Retort plugin?

---

<div class="post-metadata">

### Author: ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)
#### Post date: [5월 9, 2016, 9:34오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/61 "2016-05-09T21:34:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![stevenpslade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stevenpslade/32/53550_2.png) [@stevenpslade](https://meta.discourse.org/u/stevenpslade)
#### Post date: [5월 18, 2016, 5:11오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/62 "2016-05-18T17:11:44Z")

</div>

> [@ivanrlio](#):
>
> 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.

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.

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [6월 17, 2016, 5:48오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/63 "2016-06-17T17:48:49Z")

</div>

i haven’t read the threads and sorry if this is a duplicate, but any way to limit the emoji’s to few common ones for everyone?

btw, thanks for the plugin. lots of times you want to react to a post, but you don’t want to give a heart. and this is really helpful.

---

<div class="post-metadata">

### Author: ![ivanrlio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivanrlio/32/48497_2.png) [@ivanrlio](https://meta.discourse.org/u/ivanrlio)
#### Post date: [6월 28, 2016, 9:24오후 UTC](https://meta.discourse.org/t/discourse-retort/35903/64 "2016-06-28T21:24:36Z")

</div>

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.

[이전 페이지](https://meta.discourse.org/t/discourse-retort/35903.md?page=2)

[다음 페이지](https://meta.discourse.org/t/discourse-retort/35903.md?page=4)
