Commit Graph

2838 Commits

Author SHA1 Message Date
Steve Howell a17deb144a Use data-stream-id in topics popover. 2017-03-05 15:44:44 -08:00
Steve Howell 8e2e406404 refactor: Extract stream_popover.js.
This module handles the popovers in the stream list--one for
stream actions and another for topic-specific actions.

The extraction was mostly straightforward, but I did move some
of the code related to the color picker to be more consistent
with how I organized the other click handlers.
2017-03-05 15:44:43 -08:00
Steve Howell ba49962f9a refactor: Extract stream_popover_sub().
Part of this change moved a click handler from subs.js to
popover.js.
2017-03-05 15:44:43 -08:00
Steve Howell 6630b84dc0 Remove data-stream-name from subscription_settings. 2017-03-05 15:44:43 -08:00
Steve Howell 58b018858e refactor: Pass in sub to ajaxUnsubscribe(). 2017-03-05 15:44:43 -08:00
Steve Howell 761a0beb7e refactor: Rename variable in show_settings_for(). 2017-03-05 15:44:43 -08:00
Steve Howell e703b0bfdb refactor: Remove stream_name param in update_stream_color(). 2017-03-05 15:44:43 -08:00
Steve Howell f8819256b0 Use stream_id in update_subscription_properties(). 2017-03-05 15:44:43 -08:00
Steve Howell 95cdc744d9 refactor: Simplify code for renaming streams. 2017-03-05 11:55:09 -08:00
Steve Howell c5757ac8fe refactor: Change params for subs.mark_subscribed().
We pass in sub instead of stream_name, to support callers that
already do lookups by stream id.

And then we make the second optional argument be subscribers, since
that is all we were using from the old `attrs` argument.
2017-03-05 11:55:09 -08:00
Steve Howell 2f8ecad295 Remove unused get_stream_name(). 2017-03-05 11:55:09 -08:00
Steve Howell 4f1108cc27 refactor: Pass in a sub to remove_user_from_stream(). 2017-03-05 11:55:09 -08:00
Steve Howell 190b2ab1d3 refactor: Pass in a sub to invite_users_to_stream(). 2017-03-05 11:55:09 -08:00
Steve Howell 8a4dee4a80 bug fix: Handle bad streams for compose-invite feature.
We now handle missing subs more gracefully when you click on the
link to invite somebody you at-mentioned in a stream message.
2017-03-05 11:55:09 -08:00
Steve Howell 6183a0d8b2 bug fix: Handle invalid streams in would_receive_message(). 2017-03-05 11:55:09 -08:00
Steve Howell 4b98ec0a12 bug fix: Handle errors in at-mention typeaheads.
If a stream doesn't exist, prevent executing code that leads
to needless warnings.
2017-03-05 11:55:09 -08:00
Steve Howell 434f228135 refactor: Avoid nesting in the compose invite handler.
We exit early now if email is undefined, rather than
having a big if statement.
2017-03-05 11:55:09 -08:00
Steve Howell 24631a7405 refactor: Pass in a sub to subs.toggle_pin_to_top_stream(). 2017-03-05 11:55:09 -08:00
Steve Howell 32c2dc63f1 refactor: Pass in a sub to subs.toggle_home(). 2017-03-05 11:55:09 -08:00
Steve Howell 3a93a7310e refactor: Pass in a sub to set_stream_property().
This helps us localize the legacy need to pass stream names
(vs. ids) to the back end to set stream properties.
2017-03-05 11:55:09 -08:00
Steve Howell 1904871d77 refactor: Start to deprecate get_stream_name().
When possible, we should use get_sub_from_target() instead of
get_stream_name(), not only because it often saves a lookup later,
but it also makes it easier to audit the code for name vs. id
bugs.  (When you rename a stream, there can be races where you
use the old stream name instead of the more durable stream_id).

This commit handles the easy cases where the caller directly
wanted the sub, not the name.
2017-03-05 11:55:09 -08:00
Steve Howell df6d644788 refactor: Extract get_sub_for_target(). 2017-03-05 11:55:09 -08:00
Steve Howell a4376efd0f refactor: De-dup code using subs.sub_or_unsub(). 2017-03-05 11:55:09 -08:00
Steve Howell 67e558f905 refactor: Pass in a full sub to sub_or_unsub(). 2017-03-05 11:55:09 -08:00
Steve Howell c38bbea6b9 Add tests for subs.sub_or_unsub(). 2017-03-05 11:55:09 -08:00
Tim Abbott 60b6a56da8 deps: Upgrade handlebars to latest version.
Fixes #3939.
2017-03-04 22:05:23 -08:00
Rafid Aslam 33129059f4 deps: Upgrade and move `handlebars` from `static/third` to `npm`.
- Remove `handlebars.runtime.js` from static/third and fetch it from npm
- Upgrade `handlebars` to 3.0.3.

I change the test since there is a patch about line, written in
handlebars'
v2.0.0-beta.1 release note:
"Lines containing only block statements and whitespace are now removed."

Fixes part of #1709.
2017-03-04 21:49:02 -08:00
Raghav Jajodia c3dbce810e right-sidebar: Added clear-search button on user-list searchbar.
A clear-search option to clear the user-list searchbox has been added.
This feature was present in the main searchbar but absent elsewhere.
Fix a part of #3716.
2017-03-04 20:30:58 -08:00
Philip Skomorokhov 866a7b06b2 upload: Limit total size of files uploaded by a user to 1GB.
Fixes #3884.
2017-03-04 18:08:30 -08:00
Cynthia Lin 777b7d4cb7 user docs: Add user guide for *Manage your uploaded files* feature.
Fixes #3723
2017-03-04 17:50:49 -08:00
Raghav Jajodia cd2d798498 admin: Added realm option to prevent users from changing their email.
A realm option to prevent users from changing their email address is added.
Fixes #3777.
2017-03-04 17:32:48 -08:00
hackerkid 3fdad8b64a Align message info action lines vertically. 2017-03-04 16:26:41 -08:00
hackerkid 2f073d9999 Remove sender name from message info action lines. 2017-03-04 16:25:29 -08:00
hackerkid dafee5abe5 Remove timestamp from message info popover. 2017-03-04 16:25:29 -08:00
Steve Howell b611ecfa1e Make get_user_id blueslip errors clear again.
We had a theory that get_user_id() errors were often due to race
conditions related to reloads, so we would only report missing
user ids if subsequent lookups failed 5 seconds later.  It turns
out we still get the blueslip errors, and now we don't get
meaningful tracebacks.  This change makes it so that errors
get reported immediately again.
2017-03-04 07:50:47 -08:00
Brock Whittaker 9ba0db29e4 Change the content-wrapper to be absolutely positioned.
Now because it isn’t floating left it won’t slide down to a level below
the rest of the content when there are pixel rounding errors with
browser zoom.
2017-03-03 18:10:41 -08:00
Feorlen 6494b84193 Update WordPress webhook to say self-installed blogs are experimental.
Reword the doc to be clear that WordPress.com blogs are supported and
self-installed blogs are experimental. Change the screen captures to show
WordPress.com.

For more details, see:
original issue https://github.com/zulip/zulip/issues/3245
original PR https://github.com/zulip/zulip/pull/2691
2017-03-03 17:15:32 -08:00
Steve Howell b8caf45262 Improve error checking for peer_add/peer_remove events.
If we get invalid events related to stream subscribers, we now
exit earlier to prevent ugly tracebacks.  We may eventually
want to upgrade some of these warnings to errors, once we fix some
of our live-update bugs.  In particular, we don't yet live-update
users when streams go from private to public, so if you add/remove
subscribers to a newly-public stream that a user still thinks is
private, they will not be able to handle the event through no
fault of the codepath that happens during the add/remove.
2017-03-03 16:03:50 -08:00
Sourav Badami 4616ee7762 Enable display of emoji as their alt codes in reactions.
This currently only supports this in emoji reactions, not in actual
emoji in message bodies, but it's a great start for people who want a
text-only view.

Tweaked to update the text by tabbott.

Fixes #3169.
2017-03-03 15:19:34 -08:00
Steve Howell 024168d85d bug fix: Fix hotkeys for compose preview.
We have special code for closing a "compose preview", but
it should only apply to the enter key.  Before this fix, we
would do the "enter" logic for other hotkeys like "j".
2017-03-03 12:22:57 -08:00
Steve Howell a6e1ab4fec hotkeys: Limit calls to ui.home_tab_obscured().
If you are typing a key like "q" in the compose box, there is no
need to check if the home tab is obscured, because the effect of
"q" is not limited by the message pane being opened.
2017-03-03 12:22:57 -08:00
Steve Howell bd6107cc1d hotkeys: Alphabetize switch/case code blocks. 2017-03-03 12:22:57 -08:00
Steve Howell 3c948be436 hotkeys: Extract focus_in_empty_compose().
This saves a bit of unnecessary computation when you type
non-arrow keys, which is especially important in the compose
box for characters that seem ordinary, like "j" and "q", but
which have mappings in some cases.
2017-03-03 12:22:57 -08:00
Steve Howell 64e0e65bac hotkeys: Limit calls to tab_up_down().
If you are not hitting an arrow key, we should prevent doing the
complex logic in tab_up_down().
2017-03-03 12:22:57 -08:00
Steve Howell a2653e3ff5 hotkeys: Process "ignored" hotkeys more efficiently. 2017-03-03 12:22:57 -08:00
Umair Khan d934863d12 i18n: Sort frontend translations.
This commit uses the change done in #3897 to sort the frontend
translations.
2017-03-03 12:32:42 +05:00
Tim Abbott 9b11993fa7 settings: Fix need to reload when changing time format.
I noticed while reviewing #3807 that we still haven't fixed this;
because timestamps are primarily displayed in the message view, fixing
this is trivial.
2017-03-01 22:43:19 -08:00
Tim Abbott 342c436c68 Fix propagation of lightbox body clicks closing compose box.
Like most event handlers where one successfully did something
specific, this event handler should stop event propagation.

Fixes #3885.
2017-03-01 20:48:42 -08:00
Pranjay Patil 8b003aa48d alert-words: Fix broken alert word UI.
This fixes the alert word UI in settings by updating the CSS property
referenced in the alert_word_settings_item.handlebars file.

Fixes #3823
2017-03-01 11:54:17 -08:00
Brock Whittaker ddc30b6650 Fix vertical centering of unread message counts.
This fixes the vertical centering issue related to unread message
counts.

Fixes: #3862.
2017-03-01 11:47:49 -08:00