When a message is being sent the submit icon is hidden and the working
icon is shown instead. However, the working icon was not placed at the
same position as the icon it replaced; the CSS rules for the submit icon
were modified in some previous commit, but the CSS rules for the working
icon were not appropriately updated. Now the CSS rules were rewritten so
both elements use the same placement rules; this fixes the issue and
should make it less likely to happen in the future if the placement is
modified again.
Also, now the size is explicitly set to ensure that both elements have
the same size; before it depended on other rules, and which rules
affected the size were different for each element due to being of
different types.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The server expects mentions to be in plain text, so the formatted
mentions have to be converted to "@" followed by the user name before
the message is sent to the server.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
CSS styles were directly copied from
"apps/comments/css/autocomplete.scss".
JavaScript code in the chat view
was slightly simplified from "apps/comments/js/commentstabview.js".
Currently mentions are not formatted when a message is being composed;
"@" followed by the user name is added to the message so it can be
directly sent without further processing. Formatted mentions will be
introduced in another commit.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Clicking on a message author shows the contacts menu (provided the
author is not the current user); in those cases the cursor should be a
pointer so the user knows that an interaction with those elements is
possible.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
A pointer cursor is now used on mentions to make the user aware of a
possible interaction. As the contacts menu is not shown for mentions of
the current user the default cursor is kept in that case.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The contacts menu expects its parent element to be its positioning
context, so the mention must have a relative position. Besides that, the
default CSS rules from the server set the position of the contacts menu
assuming that the parent element is an avatar, so the rules have to be
overriden to position it on the text.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The border-box sizing is set for apps in the server, but the CSS rules
for the icons of the contacts menu (also set in the server!) assume that
content-box sizing is used. Therefore the proper size should be forced
for the icons to be visible.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The contacts menu uses both the "bubble" and "contactsmenu-popover" CSS
classes, and the specific rules for ".bubble" elements used in Talk
should not affect the contacts menu.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
In some cases (like when LDAP is being used) a user can not be easily
identified through its user name (as it is just a hash), so formatted
mentions now show the display name in all cases (and if the server does
not provide a display name the "name" parameter of the template falls
back to the user name).
Note that the acceptance tests do not need to be updated, as the
display name of the mentioned user is the same as its user name.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The RichObjectStringParser was copied from the Notifications app and
adapted to be used in the chat (support for file references was removed,
"-" is taken into account too in parameter IDs, only local users are
taken into account, and if the display name of a mention is empty the
user ID is used instead).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The RichMessageHelper replaces the enrichable references in a plain text
message with their equivalent rich object string parameter; currently
only mentions are taken into account.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>