Commit Graph

880 Commits

Author SHA1 Message Date
Tim Abbott c8d57fcafb Split out message_flags.js.
(imported from commit 52afa76fa71141630e325e558cb9c6955d8c03d5)
2014-01-31 14:59:03 -05:00
Tim Abbott 55a88f049c Remove unused within_viewport.
(imported from commit d528e022a0d088052bb0bac5c29864688dae59ca)
2014-01-31 14:59:03 -05:00
Jessica McKellar ec88b3abaf Give admins the ability to unsubscribe people from streams.
(imported from commit 7ec130a233a2976ad0be6f8a7b59c33ce0e0cf3f)
2014-01-31 11:23:14 -05:00
Jessica McKellar c4c5ac210e Convert stream member list to a handlebars template.
We had been concatenating strings.

(imported from commit 2d50d3f750a450029d39553ea9cd99ef824a149b)
2014-01-31 11:23:13 -05:00
Tim Abbott 6e5e5596fd Remove deferred installation of scroll handler.
This is no longer required, now that we're no longer scrolling the
main body of the page.

(imported from commit c2aa0d403c8fd0679b3110fe8e7684d46a7557fa)
2014-01-31 11:15:14 -05:00
Leo Franchi 2fac412119 Get next local id correctly when all message list is empty
(imported from commit 07208222ea682251927ef13c684e9e89277233bf)
2014-01-30 18:08:48 -05:00
Leo Franchi 01e948ac97 Allow unnarrowing to an empty message list in unread-messages-read case
(imported from commit f377dbce61fe2fc2051bc286f7215e8112f92736)
2014-01-30 18:08:48 -05:00
Leo Franchi 1056078415 Truncate local ids when loading older messages if messages could be local only
(imported from commit b32ae8f3554632aa84ed2dd039a612bb0fa644e2)
2014-01-30 18:08:48 -05:00
Tim Abbott e505583f52 Split out new module people.js for tracking people.
(imported from commit fb9b769819ade25d1d3d6e452e68c7ee8651cfdd)
2014-01-30 17:32:58 -05:00
Tim Abbott d0ae8795c3 Clean up obsolete fields in get_events_params.
Both pointer and last are fields that were removed when we changed the
protocol to use events like a year ago.

This conveniently allows us to stop exporting get_updates_params to
other modules.

(imported from commit 13651ee240ce6e1bafb241b185e5ef653c348cdf)
2014-01-30 17:23:53 -05:00
Tim Abbott 2fb9baafb4 Start running get_events immediately on page load.
Previously, we waited until we'd fully loaded the home view to start
calling get_events, which:
(A) didn't make sense non-message related events
(B) resulted in our throwing "get_updates not started" errors when
users sent a message before the home view was fully loaded.

This commit only fixes problem (B); to fix problem (A) we will need to
change the event capture code to only capture some events.

(imported from commit 2aacd6bdfd1e7d7707e3a724f1fde7da4a556538)
2014-01-30 17:23:53 -05:00
Tim Abbott f27edcd50a Move initial call to get_events to server_events.home_view_loaded.
Note that this makes the event fire after the home view has messages
loaded all the way to current; previously it only waited for the first
batch of messages to load.

(imported from commit a5c408ea0136c761f4cc77e8be4977b13acc6d77)
2014-01-30 17:23:52 -05:00
Tim Abbott 1eb294ed11 Rename get_updates to get_events in the frontend.
We did this rename on the backend ages ago.

(imported from commit 11bdf6aa08d932fe2586de282f6174e3dba7267a)
2014-01-30 17:23:52 -05:00
Steve Howell e60f148a3e Clean up double negatives in message_matches_search_term
(imported from commit 677bb3a76d3404f9899498777e7f1169947422c7)
2014-01-30 17:19:50 -05:00
Steve Howell 189743e813 Extract message_matches_search_term in filter.js.
This diff really just moves code; it's a trivial function extraction.

(imported from commit 8ff82b089e49645a6c6034152a9fc9cd83da0737)
2014-01-30 16:46:51 -05:00
Steve Howell 3a412b35e1 Use _.all() in Filter._build_predicate.
By using _.all() instead of a for loop, we avoid a tiny bit of
confusing between "break" being for a switch statement and being for
the loop.

(imported from commit cd6e7ff788b50f4dadce93e7f0efcb381bc59270)
2014-01-30 16:45:47 -05:00
Steve Howell 15b0f9dcc7 Use operator/operand in narrow.collect_single().
(This is part of converting away from tuples.)

(imported from commit ba3083f8b3242fee1d532d7666aee68af89d8ddc)
2014-01-30 16:15:16 -05:00
Steve Howell 796ebfd007 Do not return raw operators from narrow.operators().
Even in the case where we are running embedded narrows,
we want narrow.operators() to return new-style operators
that you get with Filter objects, so that callees do
not need to support the legacy tuple format.

(imported from commit a6649881a926a2304e9f7cc8ca53b406e2c8828e)
2014-01-30 16:15:14 -05:00
Steve Howell de7708ed6e Handle id:<msg id> searches with multiple terms.
If you do a search like id:5 topic:foo and message #5
does not have the topic "foo", we now return zero results.

(imported from commit 8121fac1dbd79024c51af1f310d831dab9242e36)
2014-01-30 15:57:32 -05:00
Zev Benjamin a2d989b318 Fix typo
(imported from commit dc7ef302a70291063c3ef339f72b6a91e8129dc1)
2014-01-30 15:57:32 -05:00
Zev Benjamin 50e1cb7ab3 socket: Specify reasons everywhere we close the SockJS object
(imported from commit 7314fa975b9408caba2c5f1374c8259d67784ad0)
2014-01-30 15:57:32 -05:00
Zev Benjamin 3df1097c95 socket: Wrap module in an anonymous function call
This is so we can have some class variables.

(imported from commit 6311444bb2739daebc6c5da2b7ea7eabdd88689d)
2014-01-30 15:57:31 -05:00
Zev Benjamin 9020f37141 socket: Add comment about the close() call in _try_to_reconnect()
(imported from commit 87e32adcb9eeb066b6f3ecd85550d00263e0a4e9)
2014-01-30 15:57:30 -05:00
Zev Benjamin b8444daddd socket: Pass wait_time as an option to _try_to_reconnect
(imported from commit 15a88c6da084f4834258868bc08b2cd983899820)
2014-01-30 15:57:29 -05:00
Zev Benjamin 1ed176b5ef socket: Log the reason the SockJS connection was lost
(imported from commit 069067f9f979e7255f97f4943d6513076b2706bd)
2014-01-30 15:57:29 -05:00
Steve Howell b3a551f402 Stop using raw operators in narrow.activate().
Have narrow.activate() user filter.operators() to produce
operators that have operand/operator fields, so that its callees
don't need to be backward compatible with the tuple format.

(imported from commit e408e33074d1be2d112bb3cdc081ec3616c908ee)
2014-01-30 15:57:28 -05:00
Tim Abbott a7b1b29bf0 Move get_updates into a module.
(imported from commit 9a6c0ab1e76dd96abad8626bc5b1fdbd234b2645)
2014-01-30 15:57:28 -05:00
Tim Abbott 33690d1dc6 Clean up argument to get_updates_success.
(imported from commit 2583c79f83e1e3e540a00ba8afae5a07dff70845)
2014-01-30 15:57:28 -05:00
Jason Michalski 90995889fc Fix scroll when muting and unmuting streams
(imported from commit 9bd22cd12dfa50cf8fd9d87eb659a4543c5c78c4)
2014-01-30 01:48:15 -05:00
Jason Michalski bf57839e85 Remove scrollTop workaround for hash changes
Now that we are not scrolling the document we can remove the workaround
to prevent browsers from scrolling on hash changes.

(imported from commit 67fdaa4980d4d54d80ca9c259bbee567b8eeb917)
2014-01-30 01:48:15 -05:00
Jason Michalski 21c2aea755 Fix scroll position on narrow and unnarrow
Change the offset to hold of the selected message as an offset from the
top of the screen. Then use the current offset and scrollTop to compute
the new scrollTop.

(imported from commit 718e95d3435c0f84cbb7663a9bb2bc2789314203)
2014-01-30 01:48:15 -05:00
Jason Michalski b0c5e2dbd0 Fix scroll on opening subscriptions details
Move the animated scroll from body to the app div.

(imported from commit 2d2062d7a917616a60f414a633dd2f827ae840a0)
2014-01-30 01:48:15 -05:00
Jason Michalski 9cc1dc242c Move the mouse handlers from window to app
(imported from commit 0331496a578c47f73b6c9e81d8a79e26e8d7a9a3)
2014-01-30 01:48:15 -05:00
Jason Michalski 198648447f Change viewport to use the app div not the document for size
Now that we are scrolling the app we should have viewport respect this
CSS change.

(imported from commit dec5450563a6f5ac23499819ec382030e3a910dc)
2014-01-30 01:48:15 -05:00
Steve Howell 967d3c9c65 Use .operator to get operator for mixpanel.
(imported from commit 7c70a592b2efd769acab9b178c08a345785b889b)
2014-01-30 13:24:43 -05:00
Steve Howell 53027b71a4 Use operator/operand inside the Filter instance methods.
Avoid tuples in the methods inside Filter.prototype.

(imported from commit beed799e767d9645735a2bd4eefb5d431c04f17f)
2014-01-30 12:53:08 -05:00
Steve Howell b18307b667 Start using operator/operands internally in Filter class.
By having Filter.canonicalize_tuple() call filter_term(),
we make it so that Filter objects get operator/operand
fields in their terms when we initialize this.

This mostly caused test breakage for tests that were doing
assert.deepEqual; now we just check to make sure that the
field we need are there.

(imported from commit 63b2516dc72edeb11e76a1fa4442570b9c605baa)
2014-01-30 12:53:08 -05:00
Steve Howell 12626ead66 Populate terms with named fields in filter_term().
Consumers of Filter.parse() can now reference
search term parts like so: term.operand, term.operator

(Legacy code can still use term[0] and term[1].)

(imported from commit 06d0da65f13f1eb7e3ba8eac0e69448aab2735ab)
2014-01-30 12:53:08 -05:00
Steve Howell fdd57f5abe Extract filter_term() in filter.js
(imported from commit 142464bb02817108726f9c118459c38e55b96bbf)
2014-01-30 12:53:07 -05:00
Tim Abbott abbe0f781f Don't wait 1 second before syncing updates manually controlled flags.
(imported from commit 8526f5d77aee078b5bc282da093009e19f016a44)
2014-01-30 12:48:36 -05:00
Tim Abbott 20457d695d Fix starring/unstarring of messages.
This got broken in the local echo refactoring -- we accidentally
switched the update_starred function to be a toggle, which meant that
the message would be marked as starred and then unmarked as starred
moments later, due to the two update_starred calls for the initiating
browser (one from when the click happens, the second from when the
event returns from the server).

(imported from commit 8f83729fe5477cf052124c1c56ed9189b85b885c)
2014-01-30 12:48:36 -05:00
Jessica McKellar 7085dca1ce Fix the Admin page not working for newly-knighted users.
Previously, while you'd get the event saying you'd been knighted,
which would make the Administration tab visible, clicking on the tab
would error out because the admin page HTML was never sent over on
page load (since you weren't an admin at that point).

(imported from commit 90ad351533515bebece630d67baf4b142d320754)
2014-01-29 12:41:22 -05:00
Jessica McKellar 20f2baa614 admin: Show a lock icon next to private streams.
(imported from commit 26829016cf219b55aef0ef45187667b0a9bd86fd)
2014-01-29 12:41:21 -05:00
Leo Franchi e716a75d22 Properly render at-all and at-everyone mentions locally
(imported from commit 9533b83dba6a61f6c09da755fca54e8a24ad61e6)
2014-01-28 17:37:10 -05:00
Leo Franchi 1666403850 Find message objects in any lists when updating, as update might come from server
(imported from commit fa70180c9a228bff39efd846d465d0f1fa9bb4e7)
2014-01-28 17:31:02 -05:00
Jason Michalski c573efd437 Ignore stream description update events for unknown streams
Clients can receive description updates for streams which are not in
stream_data. We should ignore the updates and warn that this has
occurred.

(imported from commit 3cd5a98a133012ae27ea0f43b03cc9d8e459e49c)
2014-01-28 17:12:15 -05:00
Leo Franchi 91fb4f6b8c Fix clicking on link to message when sending outside this narrow
(imported from commit 6eeeb3b4c06021be21f48c8c5f2869904cd13b09)
2014-01-28 16:03:11 -05:00
Leo Franchi ffb816391c Use our own fenced code preprocessor, fixing output mismatches
(imported from commit 3d4abb1043349e30adf265342ee7c946a99b3ce2)
2014-01-28 15:35:32 -05:00
Leo Franchi daecc7993a Add a fenced code parser in javascript
(imported from commit 42b1dc18ca34cbbdf3cda6e833adde631a9d88f5)
2014-01-28 15:35:32 -05:00
Leo Franchi dd7d31c7a6 Allow an empty home view when unnarrowing
(imported from commit 69f1a84b23ae8942db58851a1a1c6723c26df560)
2014-01-28 15:35:31 -05:00