Commit Graph

5144 Commits

Author SHA1 Message Date
Cynthia Lin
053c4a2250 popovers: Add guest avatar marker to user profile popover. 2018-12-30 11:07:00 -08:00
Cynthia Lin
4d97909764 popovers: Add guest avatar marker to user info popover. 2018-12-30 11:07:00 -08:00
Vishnu Ks
806fa1a834 billing: Make card change use create_ajax_request. 2018-12-30 08:00:23 +05:30
Vishnu Ks
41fbc699ad billing: Make invoice upgrade use create_ajax_request. 2018-12-30 08:00:23 +05:30
Vishnu Ks
938438364f billing: Use form.serializeArray in create_ajax_request. 2018-12-30 08:00:23 +05:30
Vishnu Ks
b655cfe379 billing: Extract autopay ajax request code as function. 2018-12-30 08:00:23 +05:30
Vishnu Ks
93b1795ed1 billing: Don't pass csrf token in Ajax requests.
The Ajax request will automatically fetch the value
from input[name='csrfmiddlewaretoken'] and set the
headers. This is done in csrf.js.
2018-12-30 08:00:23 +05:30
Tim Abbott
25793aefa7 hotkey: Fix using pageup/pagedown inside message edit.
Our logic for doing pageup/pagedown calculation inside compose was
written too tightly, and ended up breaking the keys inside message
editing.

Fix this by using generic selectors that don't hardcode compose.
2018-12-29 15:59:28 -08:00
Vaibhav
93914d8cd8 markdown: Parse '/me' for multi-line messages.
Previously, messages with more than one line did not parse '/me' at
the beginning of the message.  Since there's a reasonable way to
render multi-line messages, this commit adds support for doing so.

This change does potentially break with the expected behavior of other
slash commands, but it seems worth providing useful functionality over
a blind focus on consistency.

Fixes #11025.
2018-12-29 15:32:50 -08:00
Vishnu Ks
96bb27fa84 signup: Fix bug in import settings when subdomain is root.
If branch for showing the profile details would
not have executed if the subdomain was root ("").
The check was changed to check for select input
instead of checking for subdomain.
2018-12-29 15:01:09 -08:00
Archit Kaushik
830dd68e45 message_list: Hide the message control icons when editing.
This avoids a bunch of potential confusion around users trying to
interact with these UI in situations that don't make sense.

(E.g. showing a menu to start editing the message when the menu is
already open).

Fixes #3802.
2018-12-29 14:37:56 -08:00
Steve Howell
053a41d816 subject -> topic: Fix notifications.js. 2018-12-29 14:34:06 -08:00
Steve Howell
56a893cd94 subject -> topic: Fix hash_util.js.
This includes using a more modern URL for topic links.
(We already supported "../topic/..." urls.)
2018-12-29 14:34:06 -08:00
Steve Howell
95e213df87 subject -> topic: Fix message_list_view.js. 2018-12-29 14:34:06 -08:00
Steve Howell
4fec91d5b1 subject -> topic: Fix message_events.js. 2018-12-29 14:34:06 -08:00
Steve Howell
3fc8597119 popovers: Avoid passing message to actions popover template.
We instead get the specific fields from message
that we use.  This is particularly helpful
for subject -> topic migration; we no longer
have to account for "subject" fields in
client-side templates.
2018-12-29 14:19:18 -08:00
Steve Howell
1903cc8ac7 refactor: Use message/topic in muting_ui.toggle_mute(). 2018-12-29 14:15:43 -08:00
Steve Howell
411743e6dd narrow: Use get_message_topic() helper. 2018-12-29 14:15:43 -08:00
Steve Howell
dc5321fed3 message_edit: Add util.get_edit_event_topic(). 2018-12-29 14:14:43 -08:00
Steve Howell
9b4f804fd1 message_edit: Add util.get_edit_event_orig_topic().
This extracts this bit of parsing logic for message_edit events.
2018-12-29 14:14:40 -08:00
Steve Howell
bcc92744c2 compose fade: Use "topic" internally. 2018-12-29 11:40:59 -08:00
Steve Howell
773e85309c topics: Make util more flexible about subject/topic. 2018-12-29 11:40:57 -08:00
Steve Howell
4e0969bb49 Rename util.set_topic -> set_message_topic(). 2018-12-29 11:38:39 -08:00
Steve Howell
4b2181ffa2 Rename util.get_topic -> get_message_topic().
The specific name will help us when we fully cut
over to "topic" on message objects.
2018-12-29 11:38:39 -08:00
Steve Howell
2fdb44803d filter: Eliminate a few "subject" references.
This continues the effort to isolate "subject" references
to util calls.

Also, we fix a comment.

Finally, we use canonicalized operators in a switch
statement.
2018-12-29 11:38:39 -08:00
Steve Howell
8121d19122 minor: Change "subject" to "topic" in comments. 2018-12-29 11:38:39 -08:00
Steve Howell
76a73e00f4 unread: Use topic_name as var. 2018-12-29 11:38:39 -08:00
Hemanth V. Alluri
b928bb3b26 static: Replace an if-else block in popovers.js with a switch statement. 2018-12-29 11:24:10 -08:00
Steve Howell
015af605cf Use stream_id in web app for muting endpoints.
This is set up by the previous commit, which allows
stream_id as alternative for stream on the server side.
2018-12-27 20:26:30 -08:00
Rishi Gupta
b4a28f3147 billing: Rename seat_count to licenses where appropriate. 2018-12-22 13:30:15 -08:00
Rishi Gupta
7ab1406962 billing: Prepare for moving Plan to CustomerPlan.billing_schedule. 2018-12-22 13:30:15 -08:00
Vishnu Ks
8176d112fe billing: Add frontend for license-based billing system. 2018-12-22 13:30:15 -08:00
Vishnu Ks
d086efd33f billing: Deduplicate get_form_input in billing.js. 2018-12-22 13:30:15 -08:00
Steve Howell
72576b3a77 compose: Fix recent autocomplete regression.
As part of giving the stream/topic fields in the
compose box longer ids, I broke the autocomplete
code that handles re-focusing the cursor after
a user hits enter.  The worst symptom of this was
that we tried to send a message before compose
finished (although it wouldn't fully deliver the
message).

The new code should be a bit easier to grep for
if we rename these fields again, as we explicitly
use selector syntax.
2018-12-22 08:07:23 -08:00
Steve Howell
ca22302763 minor: Avoid ui_util.focus_on() call.
The helper is unnecessary at this point and obscures
greps for selectors.  We completely eliminate it in
the next commit.
2018-12-22 08:07:23 -08:00
Vishnu Ks
30a61d7505 billing: Fix plan input bug in upgrade. 2018-12-21 09:34:27 -08:00
Steve Howell
1656fd7729 Fix recent regression with mute undo.
The undo button was bound to the stream id
and topic for only the first call, when
the click handler was set.
2018-12-20 15:58:05 -08:00
Tim Abbott
ba77303ee4 message_list: Slightly optimize content editing logic.
Previously, we were searching the whole message_row object for emoji,
mentions, etc., which has a bunch of UI elements that can't contain
the syntax we want to modify.  This should be a slight improvement in
the performance of message post-processing, which runs a lot of times
and thus is fairly important.
2018-12-18 14:50:05 -08:00
varunvaruns9
c2ced75d5a message_list_view: Rerender names of user groups and streams on change.
Rerender the mentions for user groups and streams when
they are not in search.

Fixes part of #11026.
2018-12-18 14:44:11 -08:00
varunvaruns9
424127012f message_list_view: Add highlight for user group mentions.
Add green highlight to mentions of user groups the current user
is a member of.

Fixes part of #11026.
2018-12-18 14:43:32 -08:00
varunvaruns9
eca1ce7f1f message_list_view: Remove check for mention class.
This check caused us to only run the code inside that block if the
message mentioned the current user (since that's when the `mention`
class is added to the main message row).

While this was a useful performance optimization, it probably was a
small one, not worth it for the correctness cost.
2018-12-18 14:41:46 -08:00
varunvaruns9
8426785286 message_list_view: Fix mention text in search condition.
Use length property of find function to check if highlight
class was present because find return an object even if
highlight class was not present.
2018-12-18 12:55:03 -08:00
Joshua Pan
ad1df0ebeb settings: Add support for customizing the top-left logo.
This adds a new realm_logo field, which is a horizontal-format logo to
be displayed in the top-left corner of the webapp, and any other
places where we might want a wide-format branding of the organization.

Tweaked significantly by tabbott to rebase, fix styling, etc.

Fixing the styling of this feature's loading indicator caused me to
notice the loading indicator for the realm_icon feature was also ugly,
so I fixed that too.

Fixes #7995.
2018-12-18 12:44:52 -08:00
Tim Abbott
34f5218a0d ui_report: Add support for passing "".
I'm not really a fan of the "Failed:" pattern in some places, and this
lets us avoid it.
2018-12-18 12:33:42 -08:00
Vaibhav
7371fd2647 notifications: Refactor code using logic from message_viewport.
Logic for checking if the last message in the current table is visible was
already written in message_viewport.js; Code in notifications.js is changed
to reduce redundancy.
2018-12-18 11:53:08 -08:00
Steve Howell
f4f59a7557 presence: Rename presence.set_user_status() -> set_info_for_user(). 2018-12-18 11:01:10 -08:00
Steve Howell
ba69dcc74c presence: Rename activity.set_user_status().
We are trying to carve room for a more specific
"user_status" concept, which refers to statuses
that users specifically set, like "I'm away".

So we call this function "update_presence_info",
which reflects that it's more about actual
"presence"--i.e. the user really is present
in the browser, even though the actual human
may not want to be disturbed.
2018-12-18 11:01:06 -08:00
Steve Howell
2c719bdb3f buddy list: Exclude current user from searches.
The current user gets excluded from all non-empty
searches, even ones that match the user, since
it can look funny when the user's at the top of a
search, and you'd never need to search for yourself
(again, since the current user is at the top of
the buddy list).
2018-12-18 11:01:06 -08:00
Steve Howell
bf152b94b5 presence: Put current user back at the top of the buddy list.
We tried this out, reverted it, and then put it back.
2018-12-18 11:01:01 -08:00
Tim Abbott
bdb3da4504 eslint: Add key-spacing linter rule.
Apparently, we didn't have one of these, and thus had a moderate
number of generally very old violations in the codebase.  Fix this and
clear the ones that exist..
2018-12-18 10:41:06 -08:00