Commit Graph

60 Commits

Author SHA1 Message Date
Waseem Daher a1c4aa6865 Modularize search.js.
(imported from commit 72f00f832846124d833071fdd46b026c99189512)
2012-11-14 15:29:18 -05:00
Keegan McAllister 122281553a Make csrf_token global
(imported from commit 734d9c886c3a77d2ba40bd449cb089a00807a656)
2012-11-14 13:35:24 -05:00
Jeff Arnold 5c7419307c Fix style mistakes we didn't catch the first time
(imported from commit ae1ca10ea8559702e4e73481715239ff456eca4b)
2012-11-11 13:24:44 -05:00
Jessica McKellar 3af5e246be Don't cache your personal gravatar across gravatar updates.
(imported from commit 06f82faaa350db8a64cebef24b738b5e93bebb98)
2012-11-09 12:44:09 -05:00
Jessica McKellar a2c6975ca2 Be case-insensitive about subjects when collapsing and narrowing.
(imported from commit 0baf20179c037c3eac82d8db20c6ec8062bb136a)
2012-11-07 14:51:51 -05:00
Jessica McKellar ed50c17582 check-all: add missing message mouseover globals.
(imported from commit c04770de18940bfff24598392c08f0ed1cec76d7)
2012-11-07 11:19:47 -05:00
Zev Benjamin 114339dc2a Remove some no-longer-extant globals in check-all.js
(imported from commit f83e19c891d438ed8a2ddd0e2849cd543562631b)
2012-11-06 16:40:52 -05:00
Jessica McKellar 4cad5f6e96 settings: Update name and gravatar without a reload.
(imported from commit 961c9f64d7c39b4345ece036062854e8d474d2c0)
2012-11-06 16:33:22 -05:00
Jessica McKellar c1cc9f0742 Don't re-focus on the search box after ending the search.
(imported from commit 35bffb245ad9dc58b394a1c5228b32db4830f2bd)
2012-11-02 11:04:16 -04:00
Waseem Daher 69b534c0ba Move composebox typeahead code into its own module.
This also cleans up the autocomplete source specifications,
making the three typeaheads all look fairly consistent.

(imported from commit e72655d715db74cfc9ab45b51e7e2ff9e8ea84c5)
2012-11-01 21:56:33 -04:00
Zev Benjamin 696a04743a Factor reload-related functionality into reload.js module
(imported from commit ef533f3416e8b406a03d28f67b45ca59523cef8e)
2012-10-29 17:38:44 -04:00
Waseem Daher 3c3877f1b5 Have Esc dismiss userinfo popover.
It's possible that the three places we can kill a popover
(body click, Esc, clicking on a new one) should be
refactored to use the same code.

(imported from commit ba7eab480fd2258abfb469c8f1155f29bc63f7f6)
2012-10-29 15:49:40 -04:00
Zev Benjamin cee3f87585 Use compose.finish() instead of manually calling ajaxSubmit() in multiple places
(imported from commit 3bbe4a03171d9eace413b576ae2c7ccf99141bf1)
2012-10-29 13:58:40 -04:00
Keegan McAllister 582cb799dd Get rid of the selected_message_class global
Instead we infer this from narrow.active(), with the ability to override during
the narrowing procedure.

(imported from commit fab9c6861f19aedf0ee8af094c1ef4e8a0a73d80)
2012-10-26 21:05:04 -04:00
Jessica McKellar 92593b7cc8 Add basic up/down search functionality, including across narrows.
(imported from commit c82acad95e97733b87d65287c685caf7533a774e)
2012-10-26 14:31:05 -04:00
Zev Benjamin bb64eb717f Make select_message and friends take an options argument
The select_and_show_by_id function is now subsumed by select_message_by_id.

(imported from commit 3dbe9cf9d253b64733f269b6dc78c144100927ca)
2012-10-22 16:06:38 -04:00
Zev Benjamin 88e09c6166 Only reload the page when the user is idle
Also, clean up reload-related function names a bit

(imported from commit 4c2e17c06d7567e71b92f6e1b04a44aeff419bff)
2012-10-19 15:53:05 -04:00
Keegan McAllister 95f8eea14b Module pattern for subs.js
(imported from commit adfe466ea892fbfe5f13a5f346e4fd00f194c42a)
2012-10-18 15:46:58 -04:00
Keegan McAllister 2a2c0187c5 Rename subscribe.js -> subs.js
(imported from commit c3ce92e31916548206ad5752da8911f22d23f106)
2012-10-18 15:42:08 -04:00
Keegan McAllister eb9140a0a2 Pseudo-module pattern for rows.js
It's actually simpler than a full module, due to lack of local state or functions.

(imported from commit b9180f1cdc26aed3f2e1f35dfae9ed4240b64446)
2012-10-18 15:11:25 -04:00
Keegan McAllister 01061e95e0 Rename dom_access -> rows
(imported from commit 66f6f88cf15f5be614440b826433d5c1cfd6803e)
2012-10-18 15:11:25 -04:00
Keegan McAllister e7661f7b2f Module pattern for compose.js
(imported from commit 8ea9d949b793285e8722bebcef30991d06e5673e)
2012-10-18 15:11:25 -04:00
Keegan McAllister c4bf81a312 Module pattern for narrow.js
(imported from commit f1df2e884216560cfe80f29a7e3eda5cea17cefe)
2012-10-18 14:41:24 -04:00
Keegan McAllister 1398641aa3 Module pattern for hotkey.js
(imported from commit 56616bc8eeaa594ca70bb92bf17a88f97027fd35)
2012-10-18 14:35:42 -04:00
Keegan McAllister 91209f9304 Get initial server generation from first get_updates result
Embedding this in index.html won't work anymore, because the Django FastCGI and
the Tornado servers might have been started at different times.

(imported from commit 187909d0593449cf2989857671f9ca526723e451)
2012-10-17 18:24:15 -04:00
Tim Abbott 5c50375e02 Display a message and disable compose while reloading.
(imported from commit f998d2e4053e7e2d676f7fe08ee274118dd9faba)
2012-10-17 14:59:49 -04:00
Tim Abbott 8a7779ad49 Tab should toggle stream/huddle even if you clicked the compose botton.
(imported from commit a705c7cd0d6067dc05da7a64f29fb3ef42838785)
2012-10-17 12:05:43 -04:00
Zev Benjamin fab64fd7b0 Make the client reload the page when it detects a server restart
If the client is not composing a message, we can just force a page
reload.  However, if he is composing a message, we must preserve that
message while still reloading as soon as possible.

We take the following approach: if the client has not completed the
composition after 5 minutes, do a compose-preserving reload
(described below).  If he sends the message before the timeout
expires, reload the page after a successful send.  If the send fails
(not due to server timeout), however, we do a compose-perserving
reload in case the error was due to the data format changing.  If the
send failed due to server timeout, we don't reload because the reload
will probably also fail.

In a compose-preserving reload, we redirect to an URI that has a
fragment indicating we are doing a reload and containing all the
necessary information for restoring the compose window to its
previous state.  On page load, we check the fragment to see if we
just did a compose-preserving reload, and, if we did, we restore the
compose window (or just try the send again in the case of send
failure).  The URI fragment looks like:

(imported from commit af4eeb3930c24118e088057d4da456748fbd2229)
2012-10-16 15:30:41 -04:00
Zev Benjamin 103bf321b4 Have client and server exchange a server generation number
This will allow the client to detect when the server has restarted.

(imported from commit 89e75916719d967beb2520be6263f79f897d9ec1)
2012-10-16 15:30:09 -04:00
Waseem Daher b76422d8d0 Cache the window selector as 'viewport' in an attempt to improve performance.
(imported from commit 3e01382260938737fbee663f6a9e94ad495ef21e)
2012-10-15 22:47:42 -04:00
Zev Benjamin 084608ebda Clear compose box when replying to a message
(imported from commit 1fe21a6d1a5f6f946e14583dc81ede961dbf57c9)
2012-10-15 15:45:15 -04:00
Zev Benjamin a85c1f62d2 Visually distinguish when a message is persistently vs. temporarily selected
(imported from commit d626b3460a3a3ad46bd9ebfb65d73a6c267c2251)
2012-10-15 13:25:39 -04:00
Zev Benjamin b42cf1d4c8 Fix persistent message selection across narrows
(imported from commit 958ce299108f8bbc8579e7446053d7fc9f018b81)
2012-10-15 13:25:39 -04:00
Zev Benjamin 35342481dc Scope subject autocomplete to the stream
(imported from commit 6e9972c93d5f56f29db37b522e20768b8fb641df)
2012-10-12 13:15:06 -04:00
Zev Benjamin adf75d48e1 Make pressing escape also un-narrow
(imported from commit 17d2cc3e8074af332f98588ad201ec342476d51f)
2012-10-11 14:30:51 -04:00
Tim Abbott ac3f4393ff Rename instance to subject.
(imported from commit 6b4693da03f106448c137cf81cf9801cac44f2b8)
2012-10-10 18:01:39 -04:00
Tim Abbott 413fdeb655 Rename class_name to stream_name.
(imported from commit e610f5de5edf756ef0a71c5361fcd507adbb1605)
2012-10-10 17:48:17 -04:00
Tim Abbott ef3b8a2ce5 Rename class_list to stream_list.
(imported from commit c9f5b10acdb20d3e923cf7f32bc5a3f37aa40705)
2012-10-10 17:48:17 -04:00
Waseem Daher 48cda57d84 Fix issue where arrowing-down near end of page would skip a message.
We had this fascinating behavior where pressing a down arrow near the
end of the page would advance the pointer, call recenter_view, which
would trigger a scroll event, which would call keep_pointer_in_view,
which would notice that we were at the end of the page and advance the
pointer again!

I split out that last part into its own function which is only called
on mousewheel events.

(imported from commit bc85443e762356e3055f8f88585940a1f11f9124)
2012-10-10 14:29:15 -04:00
Tim Abbott 26b5c11d64 Rename get_zephyr_row to get_message_row.
(imported from commit 2480b0bfe0be58cdb6bdf687760967b26ca38558)
2012-10-10 10:19:46 -04:00
Tim Abbott 06ffd206ae Rename respond_to_zephyr to respond_to_message.
(imported from commit 34e7793601ad6f41d71be2e2060c58138b9d3b53)
2012-10-10 10:18:51 -04:00
Tim Abbott 9a359c8d05 Rename selected_zephyr_* to selected_message_*
(imported from commit 04025c4472b893ce12764775e10c1dc89850b639)
2012-10-10 10:17:58 -04:00
Tim Abbott ae97a88e72 Rename selected_zephyr_id to selected_message_id.
(imported from commit bbb368efdd5010b6dfdaaf60f3f48904b40671af)
2012-10-09 22:42:19 -04:00
Tim Abbott f66124cbe2 Rename select_zephyr(_by_id) to select_message_*.
(imported from commit 91619adf0e610017fbef52d2796020cb16537653)
2012-10-09 22:40:13 -04:00
Tim Abbott f1e90cde8c Rename zephyr_dict and zephyr_array.
(imported from commit 5d93fddc1758c0ee47390cfe599732a60a8d817a)
2012-10-09 22:40:12 -04:00
Jessica McKellar fb62e808d7 Use an associative array for faster subscription checks.
This also helps us manage checking, case-insensitive, for
subscriptions while preserving the casing used by the class creator
for display.

It also fixes a bug where the class_list would become out of sync with
your true subscriptions, allowing you to appear to send messages to
classes to which you had unsubscribed.

(imported from commit 5e8d017bcfb27a71c52f7517733eda7b926d721b)
2012-10-09 17:28:21 -04:00
Tim Abbott 2f910a1629 Show success messages on the subscriptions page.
(imported from commit 771fa4459e6a09ffc4132ccff12372b204334de2)
2012-10-09 15:44:55 -04:00
Tim Abbott 5568e1a79c Move hotkey.js jslint globals into check-all.js.
(imported from commit ec737e658e9f2251025e493abb92e4cf2a7aab72)
2012-10-09 14:11:22 -04:00
Tim Abbott a5c8b5dc7e Detect whether the user is currently in an input area correctly.
Rather than trying to keep track of whether the last thing that
happened was an input area being focused (which had all kinds of
bugs), just detect whether we're in an input area using the
appropriate jquery selector.  Hopefully this has OK performance.

(imported from commit 6150692ffcb0ab9b04244c3d053b5527847ded2d)
2012-10-09 14:11:22 -04:00
Jessica McKellar e351439d0b Don't have clicking on a sender prepare a personal.
It is confusing, and clicking on it should behave like clicking
elsewhere in the message.

(imported from commit e56434e8e143f6fa58b095e1c7d311b4aa24313f)
2012-10-09 11:01:28 -04:00