Commit Graph

880 Commits

Author SHA1 Message Date
acrefoot cff1714209 Relatively aggressive version of autoscroll-forever
(imported from commit f84e7bbbb3eaec1a5c8df93dffe3771a6fdbcd5f)
2013-12-13 11:50:11 -05:00
acrefoot 59bbe33954 Cinch up whitespace during some cases. This is for when enable_autoscroll_past_unread is set
basically this tries to turn scroll-the-world into not-scroll-the-world
This is not very good--maybe Allen has a better idea. The best solution would be to
turn off scroll-the-world. Look for it after the tables->divs change happens.

(imported from commit ae0b6976bca57986f95022f2470bc7117eda7fa3)
2013-12-13 11:50:11 -05:00
acrefoot 1bd420f12c Show auto-scroll forever setting in /#settings
(imported from commit fa66cbe52836f230e551f25c47bd755b705387d2)
2013-12-13 11:50:11 -05:00
Tim Abbott 6958b63c58 Improve processing for get_updates during tutorial.
Previously, we would slowly accumulate duplicate copies of events that
happened while the user was in the tutorial at a rate of 1 copy per 5
seconds.

(imported from commit 3e3c58aca4b1ba3bfdd1c93f47330a0f4cf4b60f)
2013-12-13 11:16:17 -05:00
Tim Abbott d6aa8ecaff Only send get_updates_xhr error if we don't have a timeout either.
(imported from commit b77c6c67917f8d2bc5d59fb46f3a5ffa4a0ac443)
2013-12-12 17:36:38 -05:00
Tim Abbott 7159564881 Cancel existing get_updates requests before making a new one.
(imported from commit fdc1223acb0cbd92cc6e0cd83230db97b67ff5b4)
2013-12-12 16:03:46 -05:00
Tim Abbott 2aad7baac0 Restart get_updates if it is ever not running while sending a message.
(imported from commit 12d74c1193dd978e171d2e2aaf236ad71bebe6a3)
2013-12-12 16:03:45 -05:00
Tim Abbott 7a397480e5 Log a blueslip message when unsuspending.
(imported from commit 8a8509ea47f3c9c6e56f98795acc958507564ff9)
2013-12-12 16:03:45 -05:00
Steve Howell da69fc19de Fix width checks for skinny mode.
We now use window.innerWidth to check for CUSTOMER7's skinny
mode, which empirically seems to be more consistent with
CSS's max-width @media settings.

I tested under FF, Safari, and Chrome.

(imported from commit d440998634633c11b471fe732104be252c979cd4)
2013-12-12 15:41:17 -05:00
Steve Howell 009d1ed88a DRY up check for feature_flags.left_side_userlist.
(imported from commit d7cbb1eee0e83ddf811451e10dd6dcd03c86ffd0)
2013-12-12 15:41:16 -05:00
Steve Howell b53513a5e7 Uncondense messages that have recently become "short."
It's possible for a message to be considered "long" at one point,
and then if you narrow to it later, it should be considered "short",
because either the screen's wider or taller.  This commit makes
sure that we remove the "condensed" flag from short messages,
and it also fixes the "More..." click handler's assumption that
could-be-condensed will always be true for condensed messages.

(imported from commit 77e4a1ad299c09f12e5609a972d5668472bd4a81)
2013-12-12 15:38:38 -05:00
Steve Howell 7427fb8d98 Cache message heights for ui.condense_and_collapse().
Cache the height of messages to speed up ui.condense_and_collapse()
to make narrows work more quickly.  The height of the message
determines whether it is auto-condensed or not.  We clear specific
cache entries when messages get edited, and we reset the entire
cache when the window width changes.

(imported from commit 7c12070a3eb3e2e1a2dfeb8d9109f3404a46c032)
2013-12-12 15:38:38 -05:00
Steve Howell e1727844d7 Only condense/collapse when messages are visible.
Trying to condense messages when they are not yet visible just
leads to wasted effort and wrong results.

This commit makes it so that current_msg_list always points to a
visible list, so the code related to message rendering knows when
to call ui.condense_and_collapse().  For activating narrows, we
now let rendering handle the condense/collapse case.

The home view situation is a little trickier, because we render
new messages in the home view even when we're inside inside of a narrow,
presumably to make it fast to switch into the home view.  When
we actually go back to the home view, we need to sweep for messages
that might need to be condensed, since they have been originally
rendered while the home view was not visible.

(imported from commit 4da2d278a4353e9e0c2b98cbf8c9dd03b06cd59b)
2013-12-12 15:38:38 -05:00
Jessica McKellar b6e46986f0 Remove unused message_tour.js.
(imported from commit e25a9315377ad11d47ad78a5d466df40e306f713)
2013-12-12 11:47:09 -05:00
Jessica McKellar 14cbcfce3b Disable Dropbox integration feature flag for us.
(imported from commit 1496be96e0011f23f5a714e0eaf36f477a830577)
2013-12-12 11:47:09 -05:00
Steve Howell c7abaff9e9 Avoid duplicate streams in the Administration page.
Before this change, you could open the Administration page
for a 2nd time, and there would be two copies of each stream.
The simple fix is to remove any existing rows before populating
the table.

(imported from commit 957306d9c6418e59b5b288dad08864547ca63e53)
2013-12-10 17:12:16 -05:00
Kevin Mehall a59760883d Fix JS error when sending a PM outside your current narrow
This is the "Tried to call a Dict method with an undefined key" error
because it tried to look up stream information for `undefined`.

(imported from commit 0187f185f3e424a0c9ea940d9b32f07376ac8952)
2013-12-10 15:35:11 -05:00
Allen Rabinovich c51a2355ee Make white background permanent
(imported from commit a9164b8f800cbc992ec72e9125a5adb08bb97615)
2013-12-10 11:30:28 -07:00
acrefoot 8e0cf79f91 better out-of-view message for replies to muted streams
(imported from commit 8aa9b69428a7dc30d726f8e57c353e1c0e652c53)
2013-12-09 20:09:11 -05:00
acrefoot 6460ecdc18 Show @-mentioned messages even for muted streams
(imported from commit 8a32599869c9f510d9c42f4c17b16d1e662e7669)
2013-12-09 20:09:11 -05:00
acrefoot 068fac2d7e Change out-of-view message for replies to muted topics
(imported from commit 79a42cbaac1294c03789c467c6774ff7bf990e74)
2013-12-09 20:09:11 -05:00
acrefoot 06c689738e Show @-mentioned messages even for muted topics
This addresses Trac #1929

(imported from commit 1b30ee7ae602e83f5977ffd4f32e478f719683d1)
2013-12-09 20:09:11 -05:00
acrefoot 3542b63bb7 show notification for @-mentions in muted topics and muted streams
(imported from commit 7c6303a083f1f7d364920462e42360b71d7159b5)
2013-12-09 20:09:11 -05:00
Tim Abbott 40c95c971c Increase restart_get_updates timeout.
(imported from commit 858b5ef8a470b3e68bd9601f001e34510f8ebec8)
2013-12-09 13:45:39 -05:00
Jessica McKellar 81b493ba0b Change pointer semantic to better support side bar users.
There are now 2 cases for narrowing:

1. We narrowed, but only backwards in time (ie no unread were
read). In this case, try to go back to exactly where we were before
narrowing. This behavior is unchanged.

2. We read some unread messages in a narrow. Instead of going back to
where we were before the narrow, go to our first unread message (or
the bottom of the feed, if there are no unread messages). This is new.

This means that after catching up through the sidebar, on returning
home you'll be at the bottom of your feed.

Searching for the first unread message in a message list with 40,000
messages only takes 17ms according to:

function timeit() {
    var t0 = new Date().getTime();
    _.find(current_msg_list.all(), unread.message_unread);
    var t1 = new Date().getTime();
    console.log('Find first unread: ' + (t1 - t0) + ' ms');
}

(imported from commit 87c467578a2cced0aa976d8ae2924371b85d2445)
2013-12-09 10:41:26 -05:00
Jessica McKellar 7c9e7e57b9 Remove message_list:get_messages, which is redundant with all().
(imported from commit 100eb775b89c54c45f70cf903018bdaefa99d3f6)
2013-12-09 10:41:26 -05:00
Jessica McKellar d4fae47430 Don't nudge pointer after unnarrowing.
This is in preparation for changing the pointer semantics later in the
branch.

(imported from commit 705ac2a48d7f36531d7683c5cf585cc89188a210)
2013-12-09 10:41:26 -05:00
Zev Benjamin 6f0477f491 Increase number of names shown in group PM list from 2 to 3
(imported from commit eff308fb1405290488f74d9064fd859d33c99558)
2013-12-06 17:54:05 -05:00
Steve Howell e4f917aa9c Remove "Invite coworkers" link from left sidebar for CUSTOMER7.
(imported from commit 3955b7e10a639fef67948bc49b2f535acd5bc765)
2013-12-06 17:17:26 -05:00
Steve Howell 1c5d642672 Show Group PMs in CUSTOMER7's left sidebar.
(imported from commit ee8068e1cb0408a6bc42381333d05d4d09689d35)
2013-12-06 17:17:26 -05:00
Steve Howell f607b24ee5 Make size_blocks work for > 2 blocks.
This changes the algorithm slightly for the 2-block case, because
I simplified the logic to just divvy up the space naively based
on the relative size of the blocks.

(imported from commit 9498edd916f65e07fb64d138276691d0d5cc0e55)
2013-12-06 17:17:26 -05:00
Steve Howell 90d97a39c6 Extract ui.confine_to_range().
(imported from commit d95fd01e9783d01908a1155e260bac52339eb6ca)
2013-12-06 17:17:26 -05:00
Steve Howell c1dcf38b0a Use size_blocks() in ui.left_userlist_get_new_heights().
This is a functional change.  Before this change, the stream
list and user list were allowed to take equal space in the left
sidebar; now, we take the size of each list in deciding which
proportion each block gets.

(imported from commit febedcb0518353825e18a6ebe60d1883b98bc78d)
2013-12-06 17:17:25 -05:00
Steve Howell c2034c210c Extract ui.size_blocks().
This is just moving code, nothing fancy.

(imported from commit a753aa36fc976409e79e5a3c11ffdf59197b32f6)
2013-12-06 17:17:25 -05:00
Steve Howell f519fa907c Don't let CUSTOMER7 share the love when in narrow mode.
I don't think share-the-love is turned on for CUSTOMER7 in the
first place, but even if it is, we should hide it when they go
into narrow mode, to make room for streams and users.

(imported from commit 2e80eec0f2ddee06753f48248dca5ac4745db6f1)
2013-12-06 17:17:25 -05:00
Steve Howell 6354b712fc Limit jQuery calls in ui.left_userlist_get_new_heights().
Calling $('#foo') is expensive, so if you need it twice, you
should store it in a variable.  I did this for stream_filters
and user_presences, and added the expectOne() call for them as
well.

(imported from commit 69e689e28b1248a93ef426a89c14033d2fb36104)
2013-12-06 17:17:24 -05:00
Steve Howell 2f6d722d9b Extract ui.set_user_list_heights().
This is a simple extraction--just moving code, nothing fancy.

(imported from commit 6c3717db43728b1ef73b17dd923eec4f7d6f6e4c)
2013-12-06 17:17:24 -05:00
Steve Howell 755f2e043e Turn on left_side_userlist on staging.
(imported from commit 650dd2e8231a8923dad0d66fb065e6638a9937c8)
2013-12-06 17:17:23 -05:00
Waseem Daher 0181ec3ef8 Expand scope of "clicking notification causes narrow" experiment.
(imported from commit aa260386c6cf1be9d9c0122bc9daf971650560d0)
2013-12-06 16:37:22 -05:00
Tim Abbott 458c066925 Add reporting for how long narrowing takes in the wild.
I'd also like to add a database table to actually store the values
that we get out of this and our send message requests for future
inspection, but for now, grepping logs+statsd is good enough.

(imported from commit 99ef179651850217fe6e82c5e928d122ca91101e)
2013-12-06 10:28:01 -05:00
Steve Howell f923c15ba8 Change signature of ui.process_condensing().
I renamed ui.process_condensing() to ui.condense_and_collapse(),
and, more importantly, it now takes a list of elements, not a single
element, which allows us to do some computations outside the loop.

(imported from commit d5984088030c2a0d4ec8b258c7fcec3e84caf2b1)
2013-12-05 16:42:07 -05:00
Steve Howell 983f29eac4 Inline ui.could_be_condensed().
This sets us up for the next commit, where we will change
process_condensing to loop over several elements, and we will
not need to recompute height_cutoff every time.

(imported from commit 1cc5b44598b85d1e301bc84492e4dc38f41ec16e)
2013-12-05 16:42:06 -05:00
Leo Franchi 2452a5c0b2 Broadcast an event right before and after doing the WebSocket handshake
(imported from commit 29b80c3b72a2f98c25b59dca3d1597cc5e5f2605)
2013-12-05 16:21:59 -05:00
Zev Benjamin e7b31fd6ad Re-enable use_socket on staging
(imported from commit f96c892409ce554109d4bfef9bd1d364db344e8b)
2013-12-05 15:53:50 -05:00
Zev Benjamin 3bd3991d1b socket: Also cancel ACK timeouts on reconnect
We know we'll never get them and we don't want to trigger additional
reconnects.

(imported from commit c8f932cda378cacf0242aa57bbc829d2f51de2e1)
2013-12-05 15:53:50 -05:00
Zev Benjamin 682a1c92e0 socket: Catch INVALID_STATE_ERR on send
(imported from commit 190652bce7e433c6a237ac99c0c222902bb24f55)
2013-12-05 15:53:50 -05:00
Zev Benjamin cd9a44f35b socket: Cancel pending auth requests on reconnect
(imported from commit 02ea7c1592ef48e2596a0dfd4830c2307a3e7df4)
2013-12-05 15:53:50 -05:00
Zev Benjamin 6eeee0a4f3 socket: Ensure the SockJS object is closed when reconnecting
Without an explicit close, we will continue to get messages on the old
connection, even once we replace the _sockjs property.  This leads to
"impossible" situations, such as receiving ACKs after reconnecting.

(imported from commit f8927fdf0551610e5b9d1db29bba00e160e76b6d)
2013-12-05 15:53:50 -05:00
Allen Rabinovich 30de0b3e77 Add a method for switching to full width and a feature flag to enable full width on staging.
(imported from commit bc7b3a5c8c17ca84e192a63711663cd605425b7f)
2013-12-05 12:41:25 -07:00
Tim Abbott 07cbbfdfda Upgrade slow send restart of get_updates requests to blueslip.error.
Now that this is no longer a known problem with our product, we want
to hear about it when it happens.

I worry a bit that a 2s fuse may be too aggressive for the case of
customers in Europe, but it might be OK.

(imported from commit d1bd6b85cd8dffab9c0d0fd410de5331736b00af)
2013-12-05 14:37:01 -05:00
Steve Howell 70b0e73a24 Support sender:me and pm-with:me search syntax.
We convert sender:me to sender:steve@zulip.com at parsing time,
so users will see the canonicalization in the search bar.  Likewise
for pm-with.

(imported from commit aa9951f13d4633cfef85f03e5486d607fdef414f)
2013-12-05 13:49:04 -05:00
Steve Howell 686c039c81 Turn on topic zooming for everyone.
(imported from commit ca9664d1b838b09615380f48802384fbb33111fa)
2013-12-05 11:38:59 -05:00
Waseem Daher 052b8a3b59 Push experimental background colors out to MIT.
(imported from commit e7420e55b616f2e885a74391b9b3e4452d9bb25d)
2013-12-05 11:16:57 -05:00
Waseem Daher 010475d49f Enable experimental background color for staging.
(imported from commit 833b25ae48e44bc7749463b7dd26418d6e25703a)
2013-12-04 14:15:23 -05:00
Allen Rabinovich 9f226e4cd2 Add a background switcher function.
(imported from commit a9bd0403637c5da04d93c0ff5e1dd0272238f0a6)
2013-12-04 11:07:12 -07:00
acrefoot 1a21db1170 Fix problem with presence list popovers persisting
This addresses Trac #2090

(imported from commit e98a3dae8e946ec7fdb027d3619ae2b0ddbdbf51)
2013-12-04 11:32:59 -05:00
Steve Howell a4c92093a0 Move #users_presence span.arrow click handler in file.
This is purely cosmetic, to keep similar click handlers near
each other.

(imported from commit 6238905462c7a2edae879cad3ee8822f9a854a1d)
2013-12-03 18:39:44 -05:00
Steve Howell d5b0093d0f Remove unused last_sidebar_elem vars.
(imported from commit ec54c62dd0db68956184ec2ed6f07594e023ef64)
2013-12-03 18:39:44 -05:00
Steve Howell 51fe87fcd6 Kill off dead code: show_user_sidebar_popover().
This code isn't really so much dead; it was never even born. :)

(imported from commit 0351b611dae7c0868cc5c3e2c76c010601c1e8ba)
2013-12-03 18:39:44 -05:00
Jeff Arnold ec56e946a7 Only manually update fading if the compose box is staying open
(compose.start() and compose.cancel() both update the fading themselves)

(imported from commit 63ce2f54106c8cce2306b0c1f3ce56e06f24235f)
2013-12-03 16:58:50 -05:00
Jeff Arnold 2cd7c35875 Make c/C compose to a new destination instead of being identical to r/R
R means "I want to send a PM, you can guess the destination"
r means "I want send a stream message, you can guess the destination"
C means "I want to send a PM and specify the destination"
c means "I want to send a stream message and specify the destination"

(imported from commit 4c93cc3029892c21accadd9624da70ee818dec68)
2013-12-03 16:58:50 -05:00
Tim Abbott 6808b5b5fe Disable scrollTop blueslip error for now.
I think we've got plenty of data of user agent strings for when this
warning triggers at this point.

(imported from commit 8bf6601a325b8e35f5127914a447bd522439c531)
2013-12-03 14:32:44 -05:00
Steve Howell 80ec6ff8bc Remove transitional show_huddles flag.
(imported from commit 37f6cdb4f62076faa1e977ec9b0a53cc461f0d11)
2013-12-03 10:45:01 -05:00
Steve Howell fa5681d93b Turn on clicking_notification_causes_narrow for CUSTOMER4.
(imported from commit edf7a341fb66a3783fe933424eeb8dea65cf2954)
2013-12-03 10:45:01 -05:00
Steve Howell 36a7944d2a Give topic zooming to CUSTOMER4.
(imported from commit 7f509f3d32b61708c64bfe2d5982485d8488a44e)
2013-12-03 10:45:00 -05:00
Jessica McKellar c46e5fd0f1 Feature flag the digest emails setting to staging.
(imported from commit 1239ce31281850dccf8f65d0c7156bd2c86ca3a7)
2013-12-02 18:58:04 -05:00
Jessica McKellar c1058355f6 Add a digest emails checkbox to your settings page.
(imported from commit cf1dbae6ca30d2489a77e822c34941a986b93bbd)
2013-12-02 18:58:03 -05:00
Tim Abbott 55acdb546e Add @-everyone to the composebox autocomplete.
(imported from commit 32476a92d4df06b566eeb701bab119c395d9d4bd)
2013-12-02 16:03:21 -05:00
Tim Abbott ef906c3cd3 Fix traceback when unnarrowing before home message list has loaded.
If we load a browser window in a narrowed view and then un-narrow
before the home message list has loaded, we end up attempting to
select message ID -1 from home_msg_list even though it is empty,
triggering a traceback.

(imported from commit eb8b686f6e9c1fa518028e5755ac6196781e92d7)
2013-12-02 16:03:21 -05:00
Steve Howell 00946f97df Log more data for "Cannot select id -1".
Show the incoming id and the length of this._items.

(imported from commit 106dda862918a4f40481a5692cbfee1738218150)
2013-12-02 15:45:40 -05:00
Steve Howell 45a23712ff Select first unread msg when narrowing from user sidebars.
(imported from commit a57508fb2084559c968b23ec4643b7484cbba6cb)
2013-12-02 15:43:34 -05:00
Waseem Daher ebfcdfd35e Disable user-visible UI for editing messages, for MIT.
This doesn't actually prevent a user from making the API call into our
servers to actually go and edit a message, so this isn't a bulletproof
solution for realms where messages ABSOLUTELY MUST NOT be edited.

(imported from commit 5bf043a201e2952189b45f93b8c5ca7648f6aee7)
2013-11-30 18:32:14 -05:00
Waseem Daher aeaac45fd0 Hide right-sidebar user/group PM list from MIT.
(imported from commit 2e3ba1ffd3a33450580a164c0aa1ced23eee37c2)
2013-11-30 18:31:05 -05:00
Waseem Daher 57b6ba4250 Revert "Respect enter-to-send in edit box"
I love press-enter-to-send but find this behavior confusing when
I'm in an edit box -- if we're going to respect it, we should
do so obviously (with a checkbox visible).

This reverts commit 6e3fc6495b7012aa12728a78b8bdd95701bb21e1.

(imported from commit d1ae16110f5504e879e315037c85c211ba3bca9a)
2013-11-28 13:51:45 -08:00
Steve Howell c6a5e8de34 Give MIT topic zooming.
(imported from commit f68db6e21d91f5eb9a57c10b5abdbea9c039fd4e)
2013-11-27 19:17:09 -05:00
Steve Howell 15d520ae1d Turn on topic zooming for three realms.
Turn on topic zooming for three realms with users who
requested to see more than five topics (tracked on #1248).

(imported from commit 56c73926a9f3c1006451a3e4a01b7661807908b5)
2013-11-27 18:34:22 -05:00
Steve Howell c53845a69c Add unit tests for stream_list.
(imported from commit 1d04a2e6115f29b7949466260ec2ba3126b882e6)
2013-11-27 15:09:20 -05:00
Tim Abbott 53059bb10c Fix lint issues with recent pointer bug fix.
(imported from commit d2a9725e8449609fdd29d2c727730934eb4de763)
2013-11-27 10:58:13 -05:00
Jeff Arnold 56fb3dd877 When closing the compose box, hide it first for perceived speed
(imported from commit 598585365141681a5573ad4fe9905be34ac92dd6)
2013-11-27 10:45:22 -05:00
Jeff Arnold 22d0ee55f6 autosize_textarea() is slow, so avoid it while the user is waiting
We need to resize the textarea when it is changed via .val().  By
clearing and resizing the compose box when it is closed, we can
avoid calling autosize_textarea() when the user opens the compose box.

This saves at least 15ms on every compose and might also be a cause
of longer delays.

(imported from commit fe6e092efcd1c4b95a868ee66653448f99af84c0)
2013-11-27 10:45:22 -05:00
Jeff Arnold 3a41184533 Revert "Make c/C compose to a new destination instead of being identical to r/R"
This reverts commit 755c92aed79ab79089b2e35d2c100582f012736a.

(imported from commit b7790fc63a2cea0a8e294c3f0a881ed6f06ed061)
2013-11-27 10:43:10 -05:00
Jeff Arnold c0a8fc459a Make c/C compose to a new destination instead of being identical to r/R
R means "I want to send a PM, you can guess the destination"
r means "I want send a stream message, you can guess the destination"
C means "I want to send a PM and specify the destination"
c means "I want to send a stream message and specify the destination"

(imported from commit 755c92aed79ab79089b2e35d2c100582f012736a)
2013-11-27 10:35:37 -05:00
Tim Abbott 09481aab69 Don't throw blueslip errors when trying to scroll to a negative offset.
(imported from commit 1edd0ced20016f817e0380c4fc341ca44cc51426)
2013-11-27 10:17:55 -05:00
Tim Abbott 3d9ad287fa Fix weird scrolling bug in Chrome on OSX.
We encountered a strange bug in Chrome on OSX where the initial call
to set scrollTop when the browser window loads did not do anything,
until we first scrolled to some other location on the page.  This
patch "fixes" that by automatically scrolling somewhere else before
scrolling to the target place on the page.

(imported from commit 96be6a0016e9e5fd78380613c9587f38406604df)
2013-11-27 10:12:27 -05:00
Steve Howell eb9f7a04b7 Rewrite topic zoom to fix bugs and make cleaner.
In the first cut at topic zoom, I was re-rendering the
streams list, but this created glitches with orphaned
list items.  The reproducible bug was that unread counts
on unshown streams weren't updating.

In the new approach, I keep the elements more permanent, and
I just hide and show them as needed, either through jQuery
show/hide or permanent CSS selectors.

I got rid of toggle_zoom(), so that we just explicitly zoom
in and zoom out in all situations.  In particular, when we
narrow, it's more clear now that only stay zoomed in when
we're narrowing to the same stream as before (including topic
narrows within that stream).

When you zoom in, the number of topics is no longer limited
to 30, since that was kind of arbitrary anyway.  (In practice,
the number of topics is usually well under 30, anyway, due to
the way we track them on the client.)

(imported from commit 5b6c143dee9ba9fe557d8cc36335ff28efb4b0de)
2013-11-26 18:19:49 -05:00
Steve Howell 90bb398784 Revert "[staging] Double-clicking on stream row toggles its zoom level."
This reverts commit 6fdb3cacd68635f313f2a8a81edf2d6101cce2cb.

(imported from commit 6e95bd8caa1b7e327f91a8b7aded72b787d1420a)
2013-11-26 18:19:48 -05:00
Steve Howell c710a54a99 Avoid flicker when narrowing to non-stream view.
(imported from commit a69fd4fe582d56e89990f97a3d3099ea1225315c)
2013-11-26 11:09:38 -05:00
Steve Howell b3e0c93ca6 Zoom out topics when going to Home view.
(imported from commit 04c5ae70d28bd3b41f2311d22f80f95c458f06a2)
2013-11-26 11:09:37 -05:00
Steve Howell 78e936fc36 [staging] Add "Show more topics..." link to topic lists.
This link lets you zoom in to more topics.  We only show it if
there are topics that we had to hide to respect the max-5 limit
along with other rules of when you show topics.

This is feature flagged to staging only.

(imported from commit 9915004ec2eb3df7416fe45c0e60cebcd7fecfea)
2013-11-26 10:34:09 -05:00
Steve Howell 41eded47d2 Add link to show all streams when you are zoomed in.
When your left sidebar is zoomed to show just one stream,
there is a link to to show all streams again.

(imported from commit 92f39b042168c443cbb9f524bf892557ef492551)
2013-11-26 10:34:09 -05:00
Steve Howell fd9d48f6df [staging] Double-clicking on stream row toggles its zoom level.
If you double-click on a stream that you've narrowed to, it
will either zoom in or zoom out the left sidebar view.  Zooming
in shows just that stream; zooming out shows all streams.

This is feature flagged to staging only.

(imported from commit 6fdb3cacd68635f313f2a8a81edf2d6101cce2cb)
2013-11-26 10:34:09 -05:00
Steve Howell 44f575c812 Add topic-zooming hooks.
This commit doesn't actually add the final UI to zoom/unzoom
topics, because I want to keep those in separate commits, in
case we change how to enable the feature.  But this commit
adds a toggle_zoom() function that zooms/unzooms topics.

Zooming is minimally invasive, because we don't really introduce
many extra elements to the UI; instead, we just make the list of
streams be a list of length one (i.e. the active stream).  This
gives us a lot of stuff for free, basically, like unread counts, etc.

(imported from commit 814c1361b6210d1591b4174bed1d6e0c98a3f255)
2013-11-26 10:34:08 -05:00
Steve Howell 1080b4239d Move sidebar click handlers into stream_list.js.
(imported from commit b284508b3abd2edc3fa4edf432307eee8f034b58)
2013-11-26 10:34:08 -05:00
Steve Howell 60a8e6e769 Make sure click handlers are called from sidebar menu.
This is a subtle change, to make sure that list items
from stream_filters always go through click handlers, which
ensures, e.g., consistent behavior on opening the compose box.

(imported from commit cd734901def8959c8c8a29c164c7a60730ae0915)
2013-11-26 10:34:08 -05:00
Steve Howell d39141039b Remove dead code related to streamlist_expand class.
(imported from commit b4dd57fdd77b74f9fe570b2267a6f96ec12937d6)
2013-11-26 10:34:08 -05:00
Steve Howell 01f141e2b6 Show more topics in search suggestions.
Search suggestions were limiting you to the last 10 topics
in a stream, not the last 10 *matching* topics in a stream.
This was just a bug, where the slice() call was supposed to
come after the filter() call.

(imported from commit 7ad8f8409315d8ca389aa5bb085275a60f6e08c0)
2013-11-25 16:26:22 -05:00
Tim Abbott 3378fc74c7 Enable conversation narrows (but not single-message narrows) for everyone.
(imported from commit 48123d77f9f9dc5d858718888dedf763328a9774)
2013-11-25 14:00:28 -05:00
Tim Abbott 8952d8d428 Add 'narrow to this conversation and time' narrowing.
(imported from commit 3bc5ea09d333c2caa37557419d54d48bbbb5a639)
2013-11-25 14:00:28 -05:00
Tim Abbott 40b6761e37 Fix short-circuiting of filters with certain narrow keywords.
(imported from commit 663646bb6eea921c1f8f845ede94fb5284d4543a)
2013-11-25 14:00:28 -05:00
Tim Abbott be2d546ffe Fix narrowing links in message popovers.
This should make it possible to either open these using middle-click
or copy the links for e.g. putting in a bug tracker ticket.

(imported from commit 0c531453cdd7197f932079c245700948b416a3d5)
2013-11-25 14:00:28 -05:00
Kevin Mehall 8bf8798e0c Remove problematic unused variable in "outside narrow" notification.
`$(message.content)` breaks on /me messages because they are not
wrapped in `<p>` so the message content is interpreted as a selector.

The message text is no longer used, so this line  can simply be removed.

(imported from commit ee8d48c1f5fc489cc577cc466f629891ea65d55f)
2013-11-25 13:41:37 -05:00
Leo Franchi baf2b5a275 Only scroll to a stream once the streams have loaded
(imported from commit 535c7900eae025a5ffc6d7167b8a56c20b1076d0)
2013-11-25 11:47:00 -05:00
acrefoot 36e9f512c4 remove unnecessary comment
(imported from commit aaeaf0f9a0a97ae81b62315c0bfd88752615cfd6)
2013-11-22 17:12:52 -05:00
acrefoot 4cd1d69ea0 Add the ability to unsubscribe all users from a stream
This resolves Trac #2022

(imported from commit 23d5129a6bec40c33eaf71953cd41ec387646a39)
2013-11-22 17:12:51 -05:00
Waseem Daher 5403a2d9b0 Experiment: Clicking desktop notification jumps you to the message in a narrow.
This seems to only work in Chrome and Safari.
Firefox (at least my version) simply doesn't fire an onclick
event, and our desktop app has its own native code that decides
what to do when a notification is clicked.

(imported from commit 30bacec4726b9e6c022dd2c74f83d37747260dba)
2013-11-22 16:33:41 -05:00
Steve Howell a74d503d51 Turn on single message narrowing for everybody.
(imported from commit b860ce0d48157462b432d9b915edca67a8e03556)
2013-11-22 15:33:23 -05:00
Steve Howell 688cc4963c Rename sort_narrow_list() to build_stream_list().
(imported from commit 533dbe4171b859077c496f656f8c2476107b318c)
2013-11-22 14:52:04 -05:00
Steve Howell 9a68022516 Extract build_subject_list().
(imported from commit 7ce2ec353c465e05e3e4dea3ce9be1651db2d86c)
2013-11-22 14:52:03 -05:00
Tim Abbott 0d7e65ea77 Don't try to cleanup expired events queues.
(imported from commit 45329bd32442f4a706a853939b70b50469d408e4)
2013-11-22 12:36:30 -05:00
Steve Howell 837b066f49 Turn on huddle list for everybody.
(imported from commit 812106231b192d8b0c0ab7b0e54e25677df56245)
2013-11-22 10:35:35 -05:00
Jessica McKellar 10c5517414 In Safari, have shift-tab on edit message buttons do the right thing.
Safari doesn't let you (shift-)tab to buttons, so we have to support
this ourselves in several cases.

(imported from commit 1b8ae28d6950fd9686b442948d71ab300c7328dd)
2013-11-21 17:40:04 -05:00
Allen Rabinovich e10549a310 Lighten the message controls and show them on hover
(imported from commit 09953116ebef779ea99327ff7c76428e908e2e31)
2013-11-21 11:05:07 -08:00
Tim Abbott 654b384980 Disable use_socket for now.
(imported from commit e5b40075b3a418a17ad23e538400db0ccdeebf3f)
2013-11-21 13:50:54 -05:00
Tim Abbott d385b35547 Improve copy for new webathena error.
(imported from commit 497f19220d1ab460b6bc0fa4f6bad2dd72733098)
2013-11-21 11:21:10 -05:00
Waseem Daher ce29c4dd34 Prefill the existing topic when editing a message topic.
This is a behavior that basically only administrators can trigger
today, with the exception of the fact that anyone can edit a no-topic
message.

(imported from commit d50eded79ddf3438d87e3dc6a8641fbfb034d50c)
2013-11-21 10:38:36 -05:00
Tim Abbott bfd01454f8 Don't allow Zephyr users to send messages when not linked to webathena.
(imported from commit 03362a52e958aa1913ffb8bfa22ba57fa1697d7c)
2013-11-20 18:54:26 -05:00
Tim Abbott 511856eba2 Cleanup event queues when browser windows reload.
(imported from commit ec06517ecc64af1724115bc94a0996a2822e2292)
2013-11-20 18:34:16 -05:00
Zev Benjamin 0ad0e18c49 socket: Correctly reference the socket object inside event handlers
(imported from commit d5954007764f5e5e30b15d1af8e9b3c43a3ebde9)
2013-11-19 18:19:15 -05:00
Jessica McKellar 7b7dd7d8ca Give notifying on sends not in view to everyone.
(imported from commit cae30d82e3647c3b710c568e47cc217457d3ab03)
2013-11-19 17:19:27 -05:00
Jessica McKellar 657e1f1f9a Don't show the out of view banner for messages further down.
This makes the notification slightly more conservative as we do our
initial roll out. In particular, it avoids cases like being notified
when you are almost at the bottom of your feed for a message in your
narrow.

(imported from commit 9c834b1c344d8c429de92fb3512f32494fc02379)
2013-11-19 17:17:33 -05:00
acrefoot dbd236b514 Autocomplete emails on streams subscriptions input
This resolves Trac #1867

(imported from commit 80ee6cc3a6b7ccacd8bd1bde71f1da8e3804ab79)
2013-11-19 16:43:37 -05:00
Steve Howell 8339a40acd Prevent stale avatars from showing in new messages.
When you upload a 2nd avatar to Zulip, the URL doesn't actually
change, so even new messages can show the old avatar, if your
browser is caching.  We work against the cache by having the
"stamp" argument, which we vary at reload time and also when
we upload the new avatar.  The browser still benefits from
cached images as new messages come in.

(imported from commit 84869c8d7f251c9f2498026a5e9e3b2451784879)
2013-11-19 16:04:41 -05:00
Steve Howell 2c2d18bc7a Allow search hotkey to work from outside the home tab.
(imported from commit 9b8944ce57a6b7466e7b115258e2501afd7cb5b1)
2013-11-19 15:12:35 -05:00
Jessica McKellar d1619b3f3c Use a more accurate "is admin?" check.
UserProfile.show_admin was intended to be a check for users that have
administrative rights in other realms, which we've harmlessly but
erroneously been using to check if they are an admin in their realm.

Use the more straightforward check instead, with a more intuitive
name.

(imported from commit d81050c7dbbb19e59c5e31750be303a4630e1456)
2013-11-19 14:31:02 -05:00
Jessica McKellar 2c841042ae Allow admins to rename any topic.
(imported from commit 5b557e8244e5196c9aa0ee29d4efb00986434528)
2013-11-19 14:31:02 -05:00
Zev Benjamin 39c9ac79ae socket: Resend messages on reconnect when the server never received them
(imported from commit 1810a76adf663e40c2d5292b48eb98553b47181d)
2013-11-19 11:06:14 -05:00
Zev Benjamin 36ecaea338 socket: Reconnect if we don't get an ACK for a request
(imported from commit ec7698f50c6bc21482539e11e574d9444bc6c35e)
2013-11-19 11:06:14 -05:00
Zev Benjamin 15a837d12e [manual] socket: Send explicit ACKs
There will be browser errors on staging when this is deployed due to the socket
protocol changing.

(imported from commit f1eda5b5c2ec9c60c23b3ca96277a61debadf5bb)
2013-11-19 11:06:14 -05:00
Zev Benjamin beb7f519a9 socket: Try to reconnect on unsuspend
(imported from commit f4d630ccc4c2dc622f6e9b7cbbb1f318a7f4b430)
2013-11-19 11:06:13 -05:00
Zev Benjamin 5d93cf9ea5 Trigger an event when we detect that we've unsuspended
(imported from commit a26414a3083af1267bf30c165cf721ab9f5a80be)
2013-11-19 11:06:13 -05:00
Zev Benjamin 17cc606eee Socket: Reconnect if we miss server heartbeats
(imported from commit 52bd5ebdbec6e89f54dc67ad19a538dce910fe47)
2013-11-19 11:06:13 -05:00
Zev Benjamin 1562ba7439 socket: Clean up reconnection logic
(imported from commit 3060803452bbb29417388cf612669785237f84f9)
2013-11-19 11:06:13 -05:00
Zev Benjamin 2df532313a socket: Rename _timeout_id to _reconnect_timeout_id
(imported from commit a1f5c86adf9397bc4147cbc4875e036ba6844160)
2013-11-19 11:06:13 -05:00
Steve Howell f783d24892 Make sure user list shows when you open it with the toggle button.
If you don't call ui.resize_page_components(), then the user
list will have zero height.  Now we call it.

(imported from commit ca2e295319550509360e4d2278489f9a328335ff)
2013-11-19 10:56:25 -05:00
Steve Howell 197ddd6edb Turn off left side userlist on staging.
(imported from commit 2c137eaaadbe94ec4f9e3cd9a02766f962641785)
2013-11-19 09:22:40 -05:00
acrefoot e2c388c49c Attempt 2: Notifications in the composebox
This moves the notify-not-in-view notifications into the composebox area.
It also tries to be a bit smarter about what action it links and what it displays.

(imported from commit 1c79bd0d9ef972059a006b17501a09b72e961ee3)
2013-11-18 16:09:34 -05:00
Waseem Daher 35dd1153ea Don't use a spinner in the "Create bot" form.
Just disabling the button with a status message is probably
sufficient.

(imported from commit dd46e5ac3d2224d84dc32d057469c434007001fa)
2013-11-16 13:03:56 -06:00
Tim Abbott 6497f330ea Fix missing table headers on admin page.
(imported from commit e5c97838e1b5b11c90384d8c49aa2087fd8fc219)
2013-11-16 11:35:26 -05:00
Tim Abbott b55e406f93 Display deactivated users at the bottom of the admin users page.
(imported from commit 1a5d5d64fffc9ed7633d468b975dd56c28f85ccf)
2013-11-16 11:35:26 -05:00
Tim Abbott c1ddc0908f Admin: Put bots in a separate table.
(imported from commit 21330e28b486e10aff6af5f48280ea675cbd5697)
2013-11-16 11:35:26 -05:00
Tim Abbott 37bff5974c Add reactivate button after deactivating a user.
(imported from commit e2ae5692d0ba5237cf5a42c29ed44d9782128110)
2013-11-16 11:35:25 -05:00
Steve Howell f5093ddc50 Clean up admin_user_list.handlebars.
The inactive flag wasn't really supported, and the
activation_toggle_button class was misleading, since
we don't yet toggle in both directions.

(imported from commit 0c8511021dd580c86df4e80092a6dd49e32773f9)
2013-11-16 11:35:25 -05:00
Steve Howell edeb3263c1 Add bots to admin page (and sort humans/bots by name).
(imported from commit 8a13702b427155b5f4f5102d79ef434e98035600)
2013-11-16 11:35:25 -05:00
Steve Howell aa87335c7f Remove dead code in admin.js.
We had people_list-related code left over from before we
started using realm_people_dict.

(imported from commit f77c441269f07db2a8998c2184de81f9d0c053d6)
2013-11-16 11:35:25 -05:00
Jeff Arnold d0622e796c Simplify the UI by removing the user's own name and avatar
(imported from commit 60d6ff1d677e3efe31e68df2c4387ddd2bd8084d)
2013-11-15 18:48:51 -05:00
Leo Franchi 593485e753 Expose hooks for file upload UI control for desktop app
(imported from commit c196363a411e0a9c499d9bb694ab539f2ab0e365)
2013-11-15 14:42:31 -05:00
Leo Franchi 7f2936a985 Allow enterprise customers to disable name changes
(imported from commit 1f2039f3e88a4ec0cc48dba75f714563c1de4af8)
2013-11-15 11:26:10 -05:00
Zev Benjamin 878916d301 blueslip: Fix formating of log date strings
We weren't padding the parts of the time or date.

(imported from commit 6ce68670f603b58592904ddc1f4be820dda135c3)
2013-11-15 11:00:56 -05:00
Steve Howell 53e3435a77 [customer] Enable single message narrowing for CUSTOMER10.
(imported from commit 2734315a3b7bd0a872048406b886d197c3c3cad6)
2013-11-15 10:46:15 -05:00
Steve Howell 788943887a Resize GROUP PMs more aggressively.
(imported from commit fbef79f2bb544648fcf4ea26e25354a7ed6912df)
2013-11-14 20:33:50 -05:00
Steve Howell 2074573fe2 Make sure GROUP PMs show up without needing a resize.
(imported from commit 6c6d79fdd5dfe15e508c430baef5043d9d1d2c93)
2013-11-14 16:30:57 -05:00
Zev Benjamin 4d7b351b07 Ensure that restarting get_events does spawn more than one get_events request
Aborting a xhr actually calls the error callback, which was
restarting the get_events loop, and we were also restarting it
manually in restart_get_updates.

(imported from commit dcdb4a27539ce35ecd83c2ade5b4edca3fb848e1)
2013-11-14 14:44:37 -05:00
Steve Howell d3579c57ec Avoid scrolling the main page by accident with mousewheel.
If you used the mousewheel in certain page sub-elements, scrolling
to the bottom would sometimes turn into scrolling the main page.
We had code to make that not happen, but it was sensitive to
integer rounding, so I added a one pixel fudge factor.

(imported from commit 5ed1f4e717e5f9ce3316383812dee27913afdd49)
2013-11-14 14:29:31 -05:00
Steve Howell 3a7113312c Give some room to GROUP PMs when lots of users.
When GROUP PMs are in the right sidebar, and when there are
lots of users, we set max heights so that both USERS and
GROUP PMs show up.

(imported from commit 4a5a16a8cf03d853769b3a690ac5b0338a2c8461)
2013-11-14 14:29:30 -05:00
Steve Howell b7d8f5d43f Move groups (not just users) from right to left sidebar.
When a user squishes the browser window enough to move users
to the left sidebar, we need to move user groups as well.  More
importantly, when they widen again, we move both of them back
in a way that users stay on top of groups.

(imported from commit d80722b58190d42a2dfc5247bfffaa7708cde21a)
2013-11-14 14:29:30 -05:00
Steve Howell a2df5f18e9 Add expectOne() checks for sidebar logic.
(imported from commit b9e729fd37f291d9e3f17edf77117d71fd129f7c)
2013-11-14 14:29:29 -05:00
Allen Rabinovich ca4e6a0ff8 Updates to stream list
(imported from commit 426a8035e9661598f9bbfa6ae83883ca3ac6106e)
2013-11-13 14:59:07 -08:00
acrefoot 9e50781131 Random javascript shortenings
(imported from commit 68a34d67ac38e34035a3e3986518824bf5a96fc5)
2013-11-13 16:41:36 -05:00
Tim Abbott c70adde1cd Send users whose sessions have expired to the login page.
(imported from commit 9ffdc414b9a0874d2cd6f7a4f91596b82390ab38)
2013-11-13 15:35:45 -05:00
Tim Abbott 3dadb5b76a Update comments to rename Local Server => Enterprise.
(imported from commit 82bf89aa1148a78ce11ead203a0bc16243d1fca8)
2013-11-12 15:57:02 -05:00
Tim Abbott 5293cdebe8 Rename LOCAL_SERVER to ENTERPRISE.
(imported from commit 7edf353eefe6c9e7aac74b7bbc37b923cac1b913)
2013-11-12 15:57:01 -05:00
Zev Benjamin 3f0fa363f9 Add explanatory comment
Leo and I were looking over this code and I couldn't remember what it
was doing.  So after I re-derived its purpose, we figured that an
explanatory comment was in order.

(imported from commit ce984362e2b504b40f3d3586777bd73691ad5ea7)
2013-11-12 15:32:09 -05:00
Zev Benjamin 279b52b0f8 socket: Don't generate an error for duplicate responses
(imported from commit abb789f9a3ab97160420bee5955a9033142c31f4)
2013-11-12 15:24:30 -05:00
Steve Howell 56c39728ba Support /me syntax.
If a user types "/me runs to the store", we put "runs to the store"
in bold after their name.

(imported from commit fbc11e99244e1c8fa1c03e4753e706957fcd449e)
2013-11-12 10:49:10 -05:00
Kevin Mehall 59757b37e2 Get user API key without password when SSO is the only login option
(imported from commit 195ff68cc54cd2e7d200702c699bb3a258d3e868)
2013-11-12 10:37:33 -05:00
Kevin Mehall 4a6b7cb20b Disable password change when SSO is the only login option
(imported from commit fd1a14237e2d6ea574331ed178bfc0db5beb18c6)
2013-11-12 10:37:33 -05:00
Steve Howell b2109722be Enable show_huddles for CUSTOMER4.
(imported from commit 27c2174a002cc1cef58ec53cd1c0c00d3fc7d6b4)
2013-11-09 09:35:38 -05:00
Steve Howell d311ab0283 Avoid stack trace when hitting "i" to close message menu.
The function show_actions_popover() actually toggles the
message action menu open and closed.  I renamed the method
to toggle_actions_popover(), and I check to make sure the
menu is open before trying to focus its first item.

(imported from commit b2c32b6c4e0be6066cd1d41463457b7e991df0ec)
2013-11-08 12:28:22 -05:00
Steve Howell 62089aeff6 Make sure unread counts stick for huddles.
Every time we re-render the huddles section, we need to
update the unread count.  We do this is in very similar
fashion to how we update individual users.

(imported from commit 2419365bc602ddaebc609090e119c0dcfad35bb7)
2013-11-08 12:11:28 -05:00
Steve Howell 038460bd26 Select the first menu item when using the "i" hotkey.
If you use the "i" hotkey to open the message menu, focus
the first item in the menu.

(imported from commit 54069710134c64368220ab0cf9144c3dc1a4304d)
2013-11-08 10:44:21 -05:00
Steve Howell bb3eca70c7 Allow enter key to submit an alert word.
This fixes a mild regression in 6bd2a0315ff56a20027074d65ccaa094bd35e63f,
which fixed a bigger bug.  That change added the event parameter to
add_alert_word(); this change updates one of the callers to now
supply it.

(imported from commit c6375abb8bd22d12c538cd7439462aae4665ee38)
2013-11-08 10:36:37 -05:00
Steve Howell 52ec258122 [staging only] Show Recent Group PMs in right sidebar.
Show up to 10 of your recent group PM conversations in the right
sidebar.  Clicking on the links narrows to the huddle and opens the
compose box for the huddle.  The green circles have opacity
proportional to the number of users present in the huddle.

This is feature flagged to staging only.

Some of this code was written by Allen before commits were squashed.

Known issue: unread counts disappear on certain refresh events.

(imported from commit 3b44665150ba20594d8b0295cb30df03601c1d52)
2013-11-07 16:54:13 -05:00
Steve Howell 7bde1f7716 Add activity.short_huddle_name().
(imported from commit e3f0389298631fd06169dbc9559691470ac19d00)
2013-11-07 16:54:13 -05:00
Steve Howell 9adcba1e6d Add activity.huddle_fraction_present().
Add a method that lets us know what percentage of a huddle is
present.  (We can use this later to set the opacity of huddles
in the UI.)

(imported from commit 8a2383951807d7bfbf9d730a8980d977cf23b379)
2013-11-07 16:54:13 -05:00
Tim Abbott 1a97f194e9 compose: restart the get_updates loop 2s after sending a message.
This should substantially mitigate the get_updates failures that we've
been seeing, since users will experience a 2s-slow send, not a 0-60
second slow send.

We should revert this once we resolve the root problem.

(imported from commit b665d0dfe674e1113bdd62cef50e3d9c52758e4c)
2013-11-07 15:30:05 -05:00
Zev Benjamin b715e15d3d Fix blueslip not outputting to the console
(imported from commit ffb96548b8262881ae731b627b510f208b3b93dc)
2013-11-07 14:23:16 -05:00
Jessica McKellar 07959dc6d9 alert words: fix accidental use of a global variable.
The global in question was `event`, set to:

MouseEvent {dataTransfer: null,
            toElement: button.btn btn-mini add-alert-word,
            fromElement: null, y: 442, x: 763…}

in Chrome. This does seem to be the correct event.

In Chrome, this global variable existed, so the code path didn't error
out. In Firefox, the global variable didn't exist, causing adding
alert words to fail.

(imported from commit 6bd2a0315ff56a20027074d65ccaa094bd35e63f)
2013-11-07 11:50:01 -05:00
Zev Benjamin 24ae5998e5 socket: Request the status of pending requests on reconnect
This will hopefully help with the send dialog being stuck on
"sending" as well as allowing us to not show errors to the user on
reconnect.

(imported from commit 31ee889853f348e486863073dc130cdfb4e1338d)
2013-11-07 11:43:34 -05:00
Zev Benjamin 87fc182645 socket: Move `req_id` parameter to top level of protocol payload
(imported from commit 271d84a0b44a2623bec290f64a83a0423698a1ef)
2013-11-07 11:43:34 -05:00
Zev Benjamin 4595143023 socket: Switch to client ids from connection ids
Clients can only have one connection at a time, anyway, so we can
just keep track of a client id, instead.  This makes reconnections
easier.

It's a little funny to use queue ids for the client id, but we know
they should exist by the time the client is connecting and they are
guaranteed to already be unique and authenticatable.  We will also
eventually be integrating the event system and the socket code closer
anyway.

(imported from commit 1f60e06fb16d31d6c121deafd493fb304d19a6c2)
2013-11-07 11:43:34 -05:00
Zev Benjamin b5c68371d0 socket: Don't even create the socket on prod
(imported from commit 1990d86618ae715c072b6b81672afd6f0e8f48fe)
2013-11-07 11:31:06 -05:00
Kevin Mehall ed31b110e3 Revert "Fix duplicated summary blocks when scrolling up."
This is unnecessary without summarization and has a performance
impact on scrolling.

This reverts commit 6270a33ff0fe98fc901b687ca533ef0ea127d052.

(imported from commit ac328a9fe344adfaf1cc1822cd58bc9178ae1a33)
2013-11-07 11:04:27 -05:00
Kevin Mehall d93c7545f6 Revert rendering window changes related to summarization
This reverts commit c10d9c1a0d23891acce88bf8d79866c08cb75681.
This reverts commit 9259a246946cd968a8725c38ff5ef2d4b4793717.

(imported from commit 50e9e0136c2487cc63d75ae2b78df0c70a1b0be1)
2013-11-07 11:04:27 -05:00
Tim Abbott d246189d98 Fix report_send_time check.
(imported from commit eeb2dd9cb0861a5eeea6254ab9d6a3d818fb2ebd)
2013-11-07 09:54:41 -05:00
Tim Abbott 4aa7ce3bd2 Also display the time until new work is scheduled after rendering.
(imported from commit 33562f105d5dd6ed81ca60d0517277d908ec2ffd)
2013-11-06 15:35:49 -05:00
Tim Abbott f670fdc717 logging: Also log the end-to-end receive time for messages we sent.
This is the amount of time between when it is sent, and when it is
rendered into the user's home view.

(imported from commit 468c28e77ba16c7256c359e90ab5aacf9d497585)
2013-11-06 15:35:49 -05:00
Tim Abbott 387dcc0da2 Rename send_times_data to send_times_log.
(imported from commit 4491f6028084ab8f7e230d2e49aec497a9112981)
2013-11-06 15:35:49 -05:00
Tim Abbott 66cb29e60e Don't do second-stage fading if the compose box was closed in between.
(imported from commit 4c8ad3befe845db9a640e73925bd0928d6943178)
2013-11-06 15:35:48 -05:00
Jessica McKellar fdb5863687 Allow alert words to be multi-word.
(imported from commit ccf8a387a25d079cf43ed335f6dc9debd70db75d)
2013-11-06 11:43:34 -05:00
Steve Howell 4fb4e04501 Add activity.full_huddle_name().
(imported from commit 304e47ac88d7497fcde49f448912a2e063dd0bd1)
2013-11-05 15:34:29 -05:00
Steve Howell 6d511486cb Add activity.process_loaded_messages() and get_huddles().
Activity.js now has the capability to track huddles that
come through in loaded messages and return them in reverse
chronological order by their most recent message.  Right
now this only connected to a unit test, not any production
code.

(imported from commit 59957086fa2e454e5711472df091f178217aed2b)
2013-11-05 15:34:28 -05:00
Steve Howell a4ff7320fb Remove unused presence_description "away" entry.
(imported from commit 46f377399335ca9757ee52ecd21d6679b52635ed)
2013-11-05 15:34:28 -05:00
Steve Howell 617b0a95d2 Short circuit MIT case earlier in update_users().
This can be squashed with the prior commit, which inlined this
MIT check into update_users() while trying to avoid other
complications.  After inlining the code, it's clear that we
don't need to call the sort_users() line of code for MIT users,
so I moved the MIT guard condition up.

(imported from commit fa5b52e14964ad595b34d40ce6c8450ea93726c5)
2013-11-05 15:34:27 -05:00
Steve Howell 7f3115fa53 Move set_presence_list from ui.js to activity.js.
Since ui.set_presence_list is only called from activity.js, I am
inlining the code into activity.update_users().  This also allows
us to move ui.presence_descriptions into activity.js, which
is the right home for presence-related things.

(imported from commit 0ff239275c544a86c14d517bc386d06726b81cd9)
2013-11-05 15:34:27 -05:00
Steve Howell 82fd0f2b52 Rename user_info -> presence_info inside activity.js.
The user_info var was mapping users to presence information, and
presence_info is a better name for it.  This change is partly tactical,
as it sets us up to inline ui.set_presence_list, which receives
user_list as presence_list and then has a completely different
variable called user_info.

By doing this pre-factoring, the next commit becomes just a pure
code move without more moving parts of renaming variables.

(imported from commit 4b015d19886b43d24905124eb37cd9dd317aa87b)
2013-11-05 15:34:26 -05:00
Kevin Mehall e82f11ed46 Fix a JS error introduced by the debug logging.
Narrow.activate was called without an options object in one
obscure location. I'm not sure how it's actually triggered,
since all searches seem to go through the typeahead path with
the "Search for x" option, but someone managed to do it.

(imported from commit 5e0e1bbe7570e5f6a654949547dc164e01125efa)
2013-11-05 15:07:24 -05:00
acrefoot e9bd56b5a0 Make topic edits propagate by default from message header form
(imported from commit 6adcce6ebf90b35e84316e9f079de4010a635f8b)
2013-11-05 12:46:59 -05:00
Tim Abbott 8853d86b17 Disable notifying on sending outside view for now.
It's somewhat buggy, and has thus been annoying our internal users, so
better to disable it until we can fix the bugs.

(imported from commit f981791d32d321b0cfe06b4a337e26ab48832bb3)
2013-11-04 18:32:34 -05:00
Tim Abbott 792b283dcd Report end-to-end sending times as experienced by clients.
This should help with determining the prevalence of slow sends as
experienced by users.

(imported from commit f00797679315c928af3c87ad8fdf0112f1dfa900)
2013-11-04 18:32:34 -05:00
Jeff Arnold 6483314f74 Only fade visible messages before rendering compose box
Partially addresses #1963

(imported from commit 0c941085ab6894e8e43015a116c49a5bdc674b5f)
2013-11-04 16:27:39 -05:00
Jeff Arnold a1c0590043 Eliminate useless code. You can't click into the box when it's closed.
(imported from commit 67268d7d156ffede2c9ab6a3ec94ab04c3876118)
2013-11-04 16:25:06 -05:00
Jessica McKellar 7e3035b2d9 Fix historical messages not getting their color updated on a color change.
Perhaps we should be checking based on an ID rather than the actual
text, but this fixes the proximal issue.

(imported from commit b125415c3a8356255b64c8e22733532491ea0065)
2013-11-04 10:44:55 -05:00
Jessica McKellar d43c01c911 Complete rebranding of 'in home view' to 'muting' the stream on the Streams page.
(imported from commit a56ef49eefedbcc1ae14ec8486dd3ca73bed1f43)
2013-11-04 10:29:38 -05:00
acrefoot 9af244a6bc fix narrowing bug introduced by composebox notifications
I switched narrow.by_subject and narrow.by_recipient to use the all_msg_list
instead of current_msg_list, since we wanted to be able to narrow to messages
specifically not in the current_msg_list. However, in searches which revealed
old messages outside the range of all_msg_list (which only has a single contiguous range),
this broke narrowing.

Let's use msg_metadata_cache instead.

(imported from commit 427f717484b4ae83d9bb4cc6e51ce17177d037fe)
2013-11-01 18:33:10 -04:00
Waseem Daher 4a29f1002d Disable summarization via feature flags.
(imported from commit 8176b5364ee0b9f4be7cfe9ce65f502dec116d15)
2013-11-01 13:59:41 -04:00
acrefoot 83d2fcaf58 above-composebox notifications only on zulip.com realm
(imported from commit edc86511adb168e648652ecea54f7ee4f16b47eb)
2013-11-01 12:34:39 -04:00
acrefoot 434b7ac120 Give Feedback in non-obvious cases for sent messages
Displays a notification above the composebox in cases where the message
is not visible (further down), or where it's outside the current narrow or search.

It also offers a link to the appropriate narrow when it makes sense, and offers
timetravel when appropriate. There is currently a bug with timetravel (and you can
see this when using the popover menu) that makes "narrow to messages around this time"
not work for muted messages.

This resolves Trac #1518.

(imported from commit 391ca0b9c07d91496f6585a4fd8e15723d1170e2)
2013-11-01 12:34:39 -04:00
Tim Abbott c5b0076ecf Rename humbug => zulip in audio files.
(imported from commit f297f1f9c8683d4e02e7a0c4ecf2182fc79b89f9)
2013-10-31 15:29:48 -04:00
Kevin Mehall 58f7138e07 Collect additional debug information for JS errors
(imported from commit 7c94ad118c2cd33e5b6eec4e27fd22dfa2d56909)
2013-10-31 13:18:43 -04:00
Jessica McKellar f1e90086f5 Remove the onboarding checklist.
Looking at the historical data, fewer than 50% of active users have
completed the checklist, which means that it is just persistent
clutter. We also have other better ways of encouraging people to send
traffic and get the apps now.

This commit removes both the frontend UI and backend work but leaves
the db row for now for the historical data.

(imported from commit e8f5780be37bbc75f794fb118e4dd41d8811f2bf)
2013-10-31 11:34:15 -04:00
Jessica McKellar 69481a0843 Remove 'All messages' sidebar link.
Nobody uses it, and it causes confusion. (How is it different from 'Home'?)

For now, leave in the ability to get to the narrow, although we may
ultimately want to do away with it as well.

(imported from commit 35b3f27e39c4de3391bc5571b32f7242a29f4cfa)
2013-10-31 10:38:49 -04:00
Zev Benjamin d5b7cfd21a Fix whitespace
(imported from commit 095ea8640a18560aae7bd5e045c4f68c96f96f73)
2013-10-30 15:52:35 -04:00
Zev Benjamin eb7fd1ba51 Add some front-end debugging changes
(imported from commit 21684b09100bc0a24372948a9417c973709c1be2)
2013-10-30 15:52:35 -04:00
Zev Benjamin 2e6b3131b5 blueslip: Add `debug()` method that logs to the in-memory log but not the console
(imported from commit 7ca312d89ad3ec26c955b846e98c94b2b84a397e)
2013-10-30 15:52:35 -04:00
Steve Howell 8449a74fdf Remove obsolete comments.
(imported from commit d360efebd5201129becd22cb547c6c1fd24ed918)
2013-10-29 10:59:42 -04:00
Steve Howell 7cf66b5bb8 Allow users to upload avatars on the Settings page.
We were using Gravatar for user avatars, but now users can
upload their avatars directly to Zulip, and we will store
their avatar for them.  This removes the old Gravatar-related
interface and polling code.

This commit does not attempt to update the avatars in
messages that have already been loaded, either for the user
making the change or other users.

(imported from commit 301dc48f96f83de0136c93de57055638c79e0961)
2013-10-29 10:59:41 -04:00
Steve Howell af6de2053e Give Notifications settings its own alert area.
(imported from commit 1d17b85f383862d1f37b5750af40aa8d9a1d8bf2)
2013-10-29 10:59:41 -04:00
Steve Howell 68942a8f3a Properly split up "Your Account" and "Notifications".
The "Your Account" and "Notifications" boxes on the Settings
page each had their own border and their own "Save changes"
button, but they were within the same form and sending to the
same back end point.

This commit creates a separate form and endpoint for each
of the two boxes.

(imported from commit 04d4d16938f20749a18d2c6887da3ed3cf21ef74)
2013-10-29 10:59:41 -04:00
Zev Benjamin 90d92814ca socket: Throttle reconnection attempts
Previously, if the user held down the enter button while the socket
was disconnected, the client would try to connect in a very tight
loop.  Now we throttle reconnection attempts to 1 per second.

(imported from commit 7b18260b992d5a34f3ea7925cf72b383f84bbabd)
2013-10-28 16:42:16 -04:00
Jeff Arnold 4b9981c333 Make clicking to the left or right of the compose box close it
Addresses #1819

(imported from commit 6d06283cb8a39107151ffc5ce5a85c1455e332f2)
2013-10-28 15:33:11 -04:00
Jeff Arnold 96b4103c80 On click, only focus the compose box if there's no selection
Addresses #4

(imported from commit 4a2400dd4ae95863f7408af1e3c0f058a516adb7)
2013-10-28 14:53:43 -04:00
Zev Benjamin 801305b8d1 Re-enable the use of sockjs in local dev instances
This reverts commit 0619867d7807f3bf48d317e7452026b1a497e0df.

(imported from commit fda4f9f21d146dd63312fb1cb374eccd36a1261b)
2013-10-28 14:30:53 -04:00
Zev Benjamin 32da8ecff4 socket: Immediately try to reconnect when the client attempts to send
If the user has a flaky connection, we might be in the backoff state
of attempting a reconnect.  But when the user regains connectivity
and tries to send, we want to send the message as soon as possible.

(imported from commit 3c5c8e9c3104ff7923258f73c9ab700548518d16)
2013-10-28 14:25:36 -04:00
Zev Benjamin 01835dca0f socket: Remove old requests
(imported from commit 75bc776e539a2f036ed486e99a6635c38f56cdcb)
2013-10-28 14:25:36 -04:00
Zev Benjamin 7abbf096de socket: Add a little more logging for debugging
(imported from commit fa227971afc47f74b4784d1466cf58fff3b68113)
2013-10-28 14:25:36 -04:00
Waseem Daher 1e6f3bb4cd Move 'unshare the love' flag into feature_flags.
All local_server JS stuff should ideally be controlled from
feature-flags so it's easy to see at a glance what's been done.

(imported from commit 45b1cdae382679d3fa3b5f02f67e8ab749a89a51)
2013-10-25 18:48:46 -04:00
Waseem Daher a56fe810b2 Hide "Share the love" for local server.
We leave the HTML in because it's harmless. (We could do a more
thorough expunge, but I don't see the point).

(imported from commit d3d68b0b2df96a9f3de73903b043c18bc6f77563)
2013-10-25 18:08:47 -04:00
Steve Howell 356b400500 Remove obsolete stream_data.all_subs().
(imported from commit 7542638ad5132ca382e5e461a76c58d141db532d)
2013-10-25 13:50:34 -04:00
Steve Howell 392197da28 Fix recent Streams page regression.
The Streams page should only show active public realms, even though
a user might have info about a "retired" stream in their browser.
I regressed this in 69b83d769 for "retired" streams.  A retired
stream is a stream that no longer has subscribers.  The bug
scenario here was that you could create a stream, regret it,
unsubscribe yourself, and then the stream never went away from
the Streams page.

This diff tries to be a little more explicit about building the
list of streams for the Streams page.  Basically you have two
sources:

    * Get only the subscribed streams from the internal
      data structures.

    * Get the unsubscribed streams by calling the back end
      for all public streams, and subtract out the subscribed
      streams.

I tested the following scenarios:

    normal stream with me: in Streams
    normal stream without me: in Streams
    my invite-only: in Streams
    their invite-only with me: in Streams
    their invite-only without me: not in Streams
    retired stream: not in Streams (but message colors are good)

See the email "custom query to get public stream names" for some
related discussion.

(imported from commit bc9224e68797b26b795399941117faa9d6858b39)
2013-10-25 13:50:34 -04:00
Steve Howell 20c18d905d Rename internal subscribed_streams() to exports.subscribed_subs().
I want to make subscribed_streams() external, but it conflicts with
a legacy name in the same module (stream_data.js), so I have to rename
it in the same commit.  The new name conforms better to the current
naming convention, which generally has functions returning objects
use "sub" in the name.

(imported from commit 9f1ed60772c649359a413257e0998857eab3603f)
2013-10-25 13:50:33 -04:00
Zev Benjamin 77a1ed967b Make the socket accessible externally for debuggging
(imported from commit 8f78d09edc05f8eed5f1a2d87643bdd7b7d9bec6)
2013-10-24 17:40:43 -04:00
Kevin Mehall 0a3a22cb3d Support authenticated upload URLs.
Trac #1734

This is implemented by bouncing uploaded file links through a view
that checks authentication and redirects to an expiring S3 URL.

This makes file uploads return a domain-relative URI. The client converts
this to an absolute URI when it's in the composebox, then back to relative
when it's submitted to the server.

We need the relative URI because the same message may be viewed across
{staging,www,zephyr}.zulip.com, which have different cookies.

(imported from commit 33acb2abaa3002325f389d5198fb20ee1b30f5fa)
2013-10-24 17:01:06 -04:00
Leo Franchi 05564ec0e2 [schema] Add a config option for enabling/disabling push notifications
(imported from commit 5649188cd5e0e4edb6e71559ec7d7fc5e92efaf8)
2013-10-24 14:54:30 -04:00
Leo Franchi 196706cc64 Use POST with method=PATCH when sending a bot edit
(imported from commit e6ee1631f0b37e66da5979a5fa6e6860d7f4d0b3)
2013-10-24 10:22:06 -04:00
Tim Abbott 934f8521e5 Don't display subscribe/unsubscribe notices in home view.
When we add starring of historical messages, they'll get added to the
home view (since we don't filter them out), which isn't a big deal --
but we don't want to make an inaccurate claim that the user subscribed
to this stream and then unsubscribed.

This should most properly be handled by filtering server-side, but at
the moment our lack of an index on UserMessage.flags makes that
impractical from a performance perspective.

(imported from commit 00751a5f9fc20e9da5c09914c11d1579f9e7398e)
2013-10-23 18:51:46 -04:00
Tim Abbott 52829efe52 Add tools for collecting data on message sending times.
Usage, on the javascript console:
> feature_flags.collect_send_times = true;
> compose.send_many_messages("test", "test", 3)
> compose.send_times_data
  [47, 99, 48]

(imported from commit a2a22eea9bb1bbe24a79ec0453c099dabfc61c19)
2013-10-23 14:05:01 -04:00
Zev Benjamin 724b8e6b8a Temporarily disable sockjs in local dev instances
This is just until we hack up run-dev.py to also start the message
sender worker.

(imported from commit 0619867d7807f3bf48d317e7452026b1a497e0df)
2013-10-23 11:31:35 -04:00
Allen Rabinovich 3a5276aa4e Settings page changes
Bug fixes

Small fix to integrations and api links

(imported from commit 5944b175fbe0fdc4fdb5ecb3cab4e333127ca353)
2013-10-22 23:28:46 -07:00
Zev Benjamin 286803660f Optionally log message send times on the client
(imported from commit 900a513496b7796173a7685a55b110b63024f574)
2013-10-22 18:45:11 -04:00
Zev Benjamin ac87d92138 Send messages using SockJS on staging
(imported from commit 812d20b1eab76eeb0d8fb92029fdb38d5faa9cce)
2013-10-22 18:45:11 -04:00
Zev Benjamin 89bcabbb65 Disallow XHR streaming when running the test suite
There seems to be some sort of bug involving PhantomJS and XHR
streaming messages.  When successive pages are loaded that use XHR
streaming, PhantomJS seems to think the second one never finishes
loading and therefore hangs.

(imported from commit db93b4cab816f1fdc3f3f543c9394b1cba8abedb)
2013-10-22 18:45:11 -04:00
Zev Benjamin 3c73468ba8 Disable unsupported SockJS transports
Because our authentication system reads cookies from the initial
connection attempt, several SockJS transports can't be used.

(imported from commit 34b9571225d39072985b8223fb12c43c7235841f)
2013-10-22 18:45:11 -04:00
Zev Benjamin ca16644152 Add client-side SockJS wrapper
The wrapper handles our RPC protocol, authentication scheme, and
reconnections.

(imported from commit 1fed2d160582c235a32de80a80b3e451c13a7b1c)
2013-10-22 18:45:11 -04:00
Steve Howell ac7eace8fb Remove subs.reload_subscriptions().
(imported from commit 72d831101033fb7db4b024781bf597f63345be79)
2013-10-22 15:51:19 -04:00
Steve Howell f34b2e4f75 Don't repopulate subscriptions on a stream rename.
We want to deprecate reload_subscriptions(), which was kind
of a big hammer to use when only a single stream is being
renamed.  Now we call stream_list.rename_stream() to update
the sidebar.

(imported from commit a77d09c0433d9b605b7baa7d7c61183bc8c37ba9)
2013-10-22 15:51:19 -04:00
Steve Howell b55a2bfc58 Avoid reloading subscribers when opening Streams page.
For a large domain like HS, we were pulling back about 100k of
text with subscriber emails when we opened the Streams page.
This was unnecessary, as the subscribers aren't shown until
you expand the stream, and there's already an AJAX call.

(imported from commit 69b83d769030d87318acefc364ac6ff3a2ec3605)
2013-10-22 15:51:18 -04:00
Steve Howell db398d5e41 Send ids, not emails, of subscribers when loading the page.
(imported from commit 26bbf38664d246476df7062432fa20add7d4cb11)
2013-10-22 15:51:18 -04:00
Zev Benjamin c665139012 blueslip: Send the log back to the server when reporting errors
(imported from commit 013057a8ddc2ddb73b03b0de5c139052b22f5319)
2013-10-22 15:39:17 -04:00
Zev Benjamin 3276f8a4d0 blueslip: Record calls to log, info, warn, and error methods in an in-memory log
(imported from commit 556a92725c492de558269c0760a96783e2a3fc18)
2013-10-22 15:39:17 -04:00
Zev Benjamin 1c841e4454 blueslip: Refactor log, info, warn, and error methods
(imported from commit 4b1eb94a7de0c2b25bde19c3c3a88a13ecb4d1c0)
2013-10-22 15:39:17 -04:00