Commit Graph

5 Commits

Author SHA1 Message Date
Harshit Bansal 16885ef0a7 emoji_picker: Correctly restore the title attribute of base element.
Bootstrap's `fixTitle()` function removes the base element's original
title attribute. This commit fixes some weird behaviors by restoring
the original title of the element on which the popover is based off.
2017-09-16 08:17:41 -07:00
Vaida Plankyte b2c0ff68c2 frontend: Add hotkey information to title/inline text.
This should make many Zulip hotkeys significantly more discoverable.
2017-08-23 17:12:09 -07:00
Aditya Bansal a204407983 message_reactions.handlebars: Upgrade font-awesome icon style. 2017-06-08 14:07:27 -07:00
adnrs96 71063e806b Clean message_reactions handlebar to use 4 space indents. 2017-02-16 14:45:08 -08:00
Arpith Siromoney 9c64a08cad Add frontend support for emoji reactions.
This commit replaces the placeholder "clipboard" button with a reaction button.
This is done on any message that can't be edited. Also, on messages sent by
the user the actions popover (toggled by the down chevron icon) contains
an option to add a reaction.

When clicked, a popover with a search bar and a list of emojis is displayed.
If the right sidebar is collapsed (the viewport is small), the popover is placed
to the left of the button.
Focus is set to the search bar. Typing in the search bar filters emojis.

Emojis with which the user has reacted to this message are highlighted.
Clicking them sends an API request to remove that reaction.
Clicking on non-highlighted emojis sends an API request to add a reaction.
When the popover loses focus it is closed.

The frontend listens for reaction events. When an add-reaction event is
received, the emoji is displayed at the bottom of the message with a
count initialized to 1. If there was an existing reaction to the message with
the same emoji, the count is incremented.

Old messages fetched from the server contain reactions.
They are displayed (along with title and count) at the bottom
of each message.

When clicking the emoji reaction at the bottom of the message, if the
user has already reacted with that emoji to this message, the reaction
is removed and the count is decremented. Otherwise, a reaction is added
and the count is incremented.

Hovering over the emoji reaction at the bottom of the message displays
a list of users who have reacted with this emoji along with the
emoji name.

Hovering over the emoji reactions at the bottom of the message displays
a button to add a reaction.

Fixes #541.
2016-12-30 21:42:54 -08:00