Commit Graph

3231 Commits

Author SHA1 Message Date
Steve Howell 2718bd0b5d Extract presence.js to track presence info.
Most of this code was simply moved from activity.js with some
minor renaming of functions like set_presence_info -> set_info.

Some functions were slightly nontrivial extractions:

    is_not_offline:
        came from activity.huddle_fraction_present

    get_status/get_mobile:
        simple getters

    set_user_status:
        partial extraction from activity.set_user_status

    last_active_date:
        pulled out of admin.js code

We also fixed activity.filter_and_sort to take user_ids.
2017-04-04 15:57:10 -07:00
Harshit Bansal 0605a9fb0f templates: Rename `admin-alias-list.handlebars`.
Rename `admin-alias-list.handlebars` to
`admin-realm-domains-list.handlebars`.

Fixes: #3145.
2017-04-04 15:48:03 -07:00
Harshit Bansal 885ec07192 frontend: `realm_alias` to `realm_domain` migration.
* Change the classes and ids of different widgets and modals
and make suitable changes in `admin.js`.

* Remove any other occurrences of `alias` or `realm_alias`
from admin.js.
2017-04-04 15:48:03 -07:00
Harshit Bansal 711a3f8037 actions.py: Rename remaining occurrences of `alias' to `realm_domain`. 2017-04-04 15:48:03 -07:00
Maxim Averin 08690132fe Decrease maximum number of search suggestions.
This fixes an issue with the menu going below the bottom of screen
with non-tiny windows, and it was rare that anyone benefitted from the
extra suggestions.

Fixes: #4133.
2017-04-04 13:02:10 -07:00
Brock Whittaker 51f68fce79 Remove `overflow: hidden` constraint on .settings-section.
This `overflow: hidden` constraint would make it so that modals
embedded in the sections would have their edges cut off. This fixes
that and doesn’t seem to cause any other regressions.

Fixes #4208.
2017-04-04 12:18:18 -07:00
Kamal Marhubi 8d787ed887 style: Increase messagebox inter-paragraph spacing
The default is too tight for easily distinguishing paragraphs. This
change increases it slightly, while keeping the last paragraph's
margin at the original value.
2017-04-03 17:28:42 -07:00
Yago González 8f8efb4664 frontend: Show KaTeX errors not related to syntax. 2017-04-03 17:01:50 -07:00
Steve Howell 4da74b3cde Remove duplicate copy of get_full_name(). 2017-04-03 16:34:16 -07:00
Tim Abbott 943a3b1cff alerts: Fix "Try Now" retry get_events button.
This has apparently been broken since we renamed get_updates to
get_events.
2017-04-03 16:22:05 -07:00
Brock Whittaker 34f9ccb87c alerts: Change sidebar alerts to be at top of the screen.
This changes the alerts to be individual boxes that slide down from
the top of the screen for a better UI experience.
2017-04-03 16:22:05 -07:00
Steve Howell 2d52463b61 Extract ui_report.js.
This moves the implementations of error/report/message from
ui.js to ui_report.js.  They had been shimmed before, so calling
modules still use the same names to call the functions, but we
no longer need the shims.
2017-04-03 07:13:25 -07:00
Brock Whittaker 28a63da02f Fix the grid labels to have a min-width of 200px.
The labels should respect their original width of 200px but overflow
if the language or content is too long.
2017-04-02 14:36:26 -07:00
Brock Whittaker 5546f037a7 admin: Remove 200px width limitation on .grid label.
This removes the 200px width limitation that was part of a previous
style guide for the settings/administration pages. It force-wraps
lines that shouldn't be wrapped and no longer serves its original
purpose.

Fixes: #4312.
2017-03-30 13:30:45 -07:00
Sampriti Panda 32e76c2c60 drafts: Move snapshot_message from compose to drafts
Previously drafts called compose.snapshot_message which would then
get the message object from compose.create_message_object. This method often
checked for the validity of stream/user recipients which would often cause tracebacks.

The new method in drafts.snapshot message just gets the data from the fields and
stores them in the draft model without any additional checking.
2017-03-30 10:20:37 -07:00
Rohitt Vashishtha 4659f97649 sidebar: Make icon clickable for '< All Streams' in left sidebar. 2017-03-30 10:12:19 -07:00
Rishi Gupta daed1fc2aa user_info_popover_content: Fix padding issues.
Removes 1px padding around edge of avatar added by bootstrap.
Removes column of whitespace to right of avatar.
2017-03-29 11:36:51 -07:00
Rishi Gupta 07592a6692 user_info_popover_content: Change wording to match search autocomplete.
The new wording is also more active, and shorter.
2017-03-29 11:36:51 -07:00
Rishi Gupta 4063ab6cf7 user_info_popover_content: Reorder actions into sections. 2017-03-29 11:36:51 -07:00
Amy Liu 6f061beb46 hotspots: Add backend support for tutorial hotspots.
This commit adds the backend support for a new style of tutorial which
allows for highlighting of multiple areas of the page with hotspots that
disappear when clicked by the user.
2017-03-29 11:34:32 -07:00
JPJPJPOPOP f7d2889c1d drafts.js: Prevent delete from triggering in the back of draft overlay.
Fixes #4340.
2017-03-27 18:13:57 -07:00
Yago González 2f5addc174 i18n: Add missed strings. 2017-03-27 14:30:28 -07:00
Yago González 58880b6695 frontend: Remove unnecessary punctuation. 2017-03-27 14:30:28 -07:00
Brock Whittaker 45a5932236 Merge ./static/images/landing-page/assets into parent folder.
There appears to be an issue in which on production the
./landing-page/assets folder is excluded from the build process,
so move it to the parent folder to fix the assets to appear in
production.
2017-03-27 14:08:45 -07:00
Jonathan Pan 5556d2341c hotkey.js: Add hotkey for drafts.
* 'd' in message view opens drafts.

This also adds hotkeys within the drafts UI:
* Up/down arrow keys navigate the drafts.
* Pressing enter edits the selected draft.
* Pressing backspace deletes the selected draft.

Some variable names tweaked by tabbott.
2017-03-27 14:05:00 -07:00
Harshit Bansal d17b759fa2 admin: Display last active time of users in admin users table.
Fixes: #2097.
2017-03-27 13:39:47 -07:00
Tim Abbott d565990c68 reload: catch exceptions trying to preserve state. 2017-03-27 13:36:31 -07:00
Tim Abbott 2eacc7317d reload: Remove cleanup_before_reload logic.
Zulip's logic for garbage-collecting data structures before reloading
was a fix for a Chrome memory leak that lasted across reloads a few
years ago.  That memory leak is probably now fixed, and thus logic is
causing lots of JavaScript tracebacks that are probably not useful.

So, let's try removing this cleanup logic (everything but the
still-useful deletion of the event queue).
2017-03-27 13:23:10 -07:00
Steve Howell 24ee369d43 Improve error message in message_list.select_id(). 2017-03-27 10:26:30 -07:00
Steve Howell 6314f60edc Keep compose open if left arrow does not cause message edit.
If somebody hits the left arrow to edit a message, but there are
no messages available to edit, then leave them in the compose box.
2017-03-27 10:15:05 -07:00
Steve Howell 293c89ba94 message edit: Only enable left-arrow-editing for content.
We no longer let the left arrow put you into the message edit
UI for a message where you can only edit topics, since that is
just confusing to most users.

This change also improves error handling a bit, and it removes
an unnecessary call to rows.id().

Finally, it moves some logic out of message_list.js, so that we
don't have a circular dependency for this codepath.

Fixes #4259
2017-03-27 10:02:19 -07:00
Steve Howell c0a6038a95 css: Enforce one selector per line.
While it's sometimes nice to put a few selectors on the same line,
it is generally better to have a consistent way of formatting our
selectors, and most of our code up until now lists them vertically.
This change fixes the linter to enforce one selector per line, and
it cleans up the places in the CSS where we had multiple selectors
on the same line.

The advantages of one-per-line are as followers:
    * cleaner diffs
    * easier to see when multiple areas of the app may have the
      same format
    * less likely to go over 80 cols
    * makes it more clear where we have deep nesting in the
      individual selectors
    * makes it easier for our linting tools to enforce
      whitespace violations

This also fixed an old bug where we had ".landing_page h2, h4", which
sets "h4" styles outside of the landing page.
2017-03-26 16:57:33 -07:00
Steve Howell 3d76088f59 tools: Make CSS style more consistent with opening brace.
We now always put the opening brace of a CSS section on
the same line as the last selector (with a space in front).
2017-03-26 16:57:33 -07:00
Steve Howell cf6545a71f reactions: Only warn for unknown user ids.
If we get reactions for deactivated users, or otherwise missing
users, we only issue a blueslip warning now.  The function
get_message_reactions() was indirectly causing blueslip errors
before this fix, but we can downgrade to warnings now that this
function has better unit tests around it.

We eventually want to track deactivated users on the client.

Fixes #4289
2017-03-26 11:51:36 -07:00
Steve Howell 3da047e10e Add people.is_known_user_id(). 2017-03-26 11:39:06 -07:00
Steve Howell 80addd902c Extract local vars in get_message_reactions(). 2017-03-26 11:39:05 -07:00
Tim Abbott 5672618b82 css: Extract popovers.css. 2017-03-25 20:14:17 -07:00
Cynthia Lin f41883ce8d subs.js: Refactor row data functions to return objects. 2017-03-25 18:35:21 -07:00
Cynthia Lin 6e2d180a34 hotkeys: Add hotkey `n` for opening New streams modal in Streams menu. 2017-03-25 18:35:21 -07:00
Cynthia Lin ca460fad1f hotkeys: Add hotkey `V` for viewing selected stream in Streams menu. 2017-03-25 18:35:21 -07:00
Cynthia Lin a027e9318d hotkeys: Move cursor to Filter streams input if at top of Streams menu.
Fixes #4227
2017-03-25 18:35:21 -07:00
Cynthia Lin b800cb05c0 hotkeys: Add left/right arrow keys to toggle views in Streams menu.
Fixes #4228
2017-03-25 18:35:21 -07:00
Cynthia Lin fb89d8a2bf subs.js: Refactor modal row functions. 2017-03-25 18:35:21 -07:00
Cynthia Lin 69c32daffa hotkeys: Add `U` hotkey for unsubscribing/subscribing in Streams menu.
Fixes #4229
2017-03-25 18:35:21 -07:00
Cynthia Lin d17131dcb4 hotkeys: Rename subs.arrow_keys() to subs.switch_rows(). 2017-03-25 18:35:21 -07:00
Aditya Bansal 42265fe035 Fix '@' in userprofile popover to use font-awesome icon. 2017-03-25 18:30:58 -07:00
Aditya Bansal 91962aa6ab font-awesome: Fix font-awesome 4.7.0 upgrade in a hacky way.
What actually has been done below is to just copy the css class defination
from the latest font-awesome css to be here and since the rest of the stuff
in /third/fontawesome was updated in ee0b16b1ef
we should be able to use this safely until we update all font-awesome class
usage in templates.

Fixes #4302.
2017-03-25 18:30:40 -07:00
K.Kanakhin 234a1f8e61 retention-period: Add retention period to front-end admin organization settings.
- Add message retention period field to organization settings form.
- Add css for retention period field.
- Add convertor to not negative int or to None.
- Add retention period setting processing to back-end.
- Fix tests.

Modified by tabbott to hide the setting, since it doesn't work yet.
The goal of merging this setting code now is to avoid unnecessary
merge conflicts in the future.

Part of #106.
2017-03-25 17:57:18 -07:00
Joshua Pan 16b2313165 muting_ui.js: Remove any popups when unmuting. 2017-03-25 12:49:14 -07:00
Joshua Pan 76e84288d9 Add M hotkey to toggle mute/unmute topics.
Get rid of current_msg_list.selected_message() redundancy.
2017-03-25 09:42:49 -07:00
Joshua Pan dc9f83005f Add toggle_mute to muting_ui.js. 2017-03-25 09:42:49 -07:00
Joshua Pan 32837804d8 Extract stream_popover.topic_ops to muting_ui.js. 2017-03-25 09:42:49 -07:00
Brock Whittaker efd72d3338 Modify lightbox to only display valid images and YT Videos.
This modifies the lightbox to only display images inside the
".message_inline_image" class, rather than all images inside the
message body, which currently includes things like the bot icon.
2017-03-25 09:19:26 -07:00
Steve Howell b3e4aa4c44 reactions: Downgrade blueslip error to a warning.
When we get a server error for adding/removing a reaction, we
no longer make a blueslip error, since it is somewhat common for
users to retry actions before the server sends an event.  The
code comment that is part of this commit explains this further.

Fixes #4290.
2017-03-24 18:24:15 -07:00
wizsid11 95789eb879 Add Slack webhook.
Adds a new webhook integration for Slack to receive messages
from one's Slack team's public channels.
Contains negative tests for broken, missing or invalid data.

Allows two different option for integration:
1. Receive notification on a single stream with different topics
for each of Slack's public channels.
2. Receive notification on different streams for each of Slack's
public channels.

Steps to choose between the two options is described in the documentation.

Fixes #3569.
2017-03-23 23:32:38 -07:00
Tomasz Kolek be0a2cb20b Add basecamp3 webhook integration.
Fixes: #3949.
2017-03-23 23:28:53 -07:00
Tim Abbott 69323d12c9 Fix click message_content covering bottom half of avatar.
This causes clicks to correctly hit the avatar an open the profile
popover.

Fixes #4251.
2017-03-23 15:22:06 -07:00
Aditya Bansal 17a4c5d0d8 Fix horizontal scroll for super long lines in bullet lists.
Fixes: #4245.
2017-03-23 15:19:28 -07:00
Moritz Neeb 9866805937 docs: fix a typo in hashchange.js 2017-03-23 15:16:02 -07:00
Joshua Pan f40b43a491 hotkeys: Add hotkey `G` an alias for End.
Fixes #4195.
2017-03-23 11:38:36 -07:00
Tim Abbott 5d030e9173 casper: Add test for the reload hashchange logic. 2017-03-22 23:06:08 -07:00
Tim Abbott 04db0b5df0 reload: Fix passing data to next browser session.
Apparently, Django's CSRF protection mechanism changed at some point,
and now we get a different CSRF token every time the webapp is loaded.
This, in turn, caused our reload logic to avoid losing state to be
completely ineffective, since the CSRF check in reload.initialize
always failed.

We fix this in a secure fashion by passing the reload instructions
from the browser to its reloaded self via localstorage, keyed by a
randomly generated token.  The token randomization is primarily
relevant for handling several Zulip tabs in the same browser, but also
servers to make it very difficult for an attacker to ever trigger this
code path by redirecting a browser to `/#reload` URLs.

Fixes #3411.
Fixes #3687.
2017-03-22 22:46:54 -07:00
Tim Abbott 64acf84ab1 reload: Save narrow when event queues expire.
Along with the issues with our reload data passing system that are
fixed in the next commit, this is responsible for #3411.
2017-03-22 22:28:35 -07:00
Tim Abbott ee4b948873 bankruptcy: Fix narrow being lost on declaring bankruptcy.
This was actually being done in 2 ways: via not saving the narrow in
the reload and second through calling `change_tab_to('#home')`.  The
code is so ancient that it seems unlikely that this behavior was still
intentional.

Fixes part of #3687 (the remainder is fixed in a few commits).
2017-03-22 22:28:18 -07:00
Tim Abbott 37ac0e6e6d server_events: Remove obsolete 'tool old' handler.
This error predates the transition to an event queue system and hasn't
been possible for years.
2017-03-22 21:16:39 -07:00
Tim Abbott 61e6ed8c31 bankruptcy: Fix clicking outside bankruptcy modal.
Previously, this would leave the unread UI disabled forever, showing 0
unread counts for anything, which was a super confusing failure mode.
2017-03-22 20:50:44 -07:00
Tim Abbott 977e7b0fdc unread: Move bankruptcy code out of click_handlers.js. 2017-03-22 20:49:05 -07:00
Tim Abbott 1f89058023 Fix broken size for message actions popover.
This fixes a regression introduced in
23a5f56023 where the `.popover-inner`
CSS wasn't scoped properly.
2017-03-22 16:44:23 -07:00
Tim Abbott ccb38a1e9c compose: Fix missing opts argument to show_box.
This fixes a regression in the recent compose.get_focus_area
refactoring that I did.
2017-03-22 16:32:53 -07:00
hackerkid 97bd9d5186 Fix positioning of message-info-popover. 2017-03-22 16:04:38 -07:00
hackerkid ed72ee476f Make user_popover use user_info_popover template. 2017-03-22 16:04:38 -07:00
hackerkid b2fc8d6fa2 Rename message_info_popover* templates to user_info_popover*. 2017-03-22 16:04:38 -07:00
hackerkid 23a5f56023 Add sender avatar in message popover. 2017-03-22 16:04:38 -07:00
hackerkid 3ac8f52a73 Remove title of message info popup. 2017-03-22 16:04:38 -07:00
hackerkid 32bc5893d0 Remove arrow from message info popover by providing template.
Provide custom template (user_info_popover.handlebars) to message info popover.
2017-03-22 16:04:38 -07:00
Tim Abbott 2a5269baa9 docs: Document the frontend hashchange system. 2017-03-22 15:21:36 -07:00
hollywoodno d6716838ad bugdown: Remove trailing whitespace on fence code blocks.
This fixes fenced code blocks that are copy-pasted from certain
clients having trailing whitespace anoyingly often.

Fixes #3998.
2017-03-22 14:17:34 -07:00
Brock Whittaker 5ed482cf2c compose: Apply consistent styling for compose buttons.
This applies the consistent :hover effect for all compose buttons.

Fixes: #4239.
2017-03-22 13:15:44 -07:00
Tim Abbott 3d3f9bc58e devlogin: Link to the normal login page. 2017-03-22 13:03:45 -07:00
Brock Whittaker dbcd19bcfa streams: Add hotkey for content-editable enter.
When you enter, it should click the checkmark, which would save the
current input of the input section.
2017-03-22 12:21:21 -07:00
Brock Whittaker d21fe68e9e streams: Fix content-editable cursor shifting to beginning. 2017-03-22 12:21:08 -07:00
Raghav Jajodia 956106ae92 streams: Fix closing of content-editable area on escape key press.
Pressing Escape key while editing stream description now closes
the editing.
Fixes #4202.
2017-03-22 12:19:59 -07:00
Raghav Jajodia 9a339a7053 streams: Prevent cursor jump to the end of editing stream-descr.
This prevents the cursor to jump at the end of the content-editable
area when the user types in the middle.

Fixes #4202.
2017-03-22 12:19:59 -07:00
Raghav Jajodia 9707c74f33 message_edit: Added copy to clipboard button.
A copy-to-clipboard button is added over message-edit textarea.
Closes #3239.
2017-03-22 11:00:18 -07:00
Steve Howell 2991c19fea Extract typing indicator inbound timing logic.
We now track our inbound timing events using code in
typing_data.js.

This code may be a little more robust with variations on how
recipients are represented in events, although there are no known
bugs here.
2017-03-22 08:20:21 -07:00
Steve Howell 4fb8339954 Extract typing_events.js. 2017-03-22 07:29:42 -07:00
Steve Howell cde1861655 typing indicators: Validate PM emails. 2017-03-22 07:01:20 -07:00
Steve Howell 1ec392a18e Extract compose.get_invalid_recipient_emails(). 2017-03-22 07:01:20 -07:00
Steve Howell 84b31a5532 typing indicators: Limit to PM conversations.
We now only send outbound typing indicators if we are
composing a private message.
2017-03-22 07:01:20 -07:00
Steve Howell 642be6ad18 Revamp state tracking for outbound typing indicators.
This change moves most of the logic related to starting and
stopping outbound typing indicators to a new module called
typing_status.js that is heavily unit tested.

While this was in some sense a rewrite, the logic was mostly
inspired by the existing code.

This change does fix one known bug, which is that when we
were changing recipients before (while typing was active), we
were not stopping and starting typing indicators.  This was
a fairly minor bug, since usually users leave the compose
box to change recipients, and we would do stop/start under
that scenario.  Now we also handle the case where the user
does not leave the compose box to change recipients.
2017-03-22 07:01:20 -07:00
Steve Howell f89c9d6629 Avoid deprecated report_success() call.
We are moving to ui_report to break dependencies.
2017-03-22 06:53:21 -07:00
Tim Abbott 2076338eaa mark_subscribed: Add a blueslip check for color code path.
This code path might be unused, and it seems worth verifying, since if
it is, we can delete some extra complexity.
2017-03-21 23:36:47 -07:00
Tim Abbott 01904385a4 Fix thrashing color when resubscribing to a stream.
Previously, we would let the backend pick a color and send it to the
frontend; then the frontend would ignore that color and pick a
different color and send it to the backend, which would in turn resync
to us.

Fixes #3572.
Fixes #3858.
2017-03-21 23:35:50 -07:00
Tim Abbott 832aa398b0 subscription_settings: Move email address into toggled area. 2017-03-21 23:09:32 -07:00
Tim Abbott 1ad0d35966 subs: Clean up ancient collapsing logic. 2017-03-21 23:09:32 -07:00
Tim Abbott bfc67f6602 subs: Toggle notification settings on subscribe. 2017-03-21 23:09:32 -07:00
Tim Abbott dfddea77b7 subscriptions: Show stream settings after toggling checkbox.
Based on Aakash Tiyagi's work in #4026.

Fixes #3971.
2017-03-21 23:09:32 -07:00
Tim Abbott 9347fc4742 subs: Move show_stream_row earlier in file. 2017-03-21 23:09:29 -07:00
Tim Abbott a7610c8b7e subs: Clarify show_stream_row arguments. 2017-03-21 23:07:28 -07:00
Tim Abbott e70bf13bef subs: Extract setup_subscriptions_stream_hash. 2017-03-21 22:17:50 -07:00