zulip/zephyr/static/js
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
..
common.js Drop JSLint directives 2012-10-04 11:04:25 -04:00
compose.js Make compose box accessor functions also be setters 2012-10-16 15:30:09 -04:00
debug.js Allow console.log in debug.js 2012-10-04 12:36:59 -04:00
dom_access.js Rename zephyr_row to message_row. 2012-10-10 10:27:59 -04:00
hotkey.js Cache the window selector as 'viewport' in an attempt to improve performance. 2012-10-15 22:47:42 -04:00
narrow.js Rename things. 2012-10-15 22:47:41 -04:00
setup.js Rename the zephyr template to the message template. 2012-10-10 10:32:59 -04:00
signup.js Remove errant console.log. 2012-10-04 13:33:59 -04:00
subscribe.js Rename class_name to stream_name. 2012-10-10 17:48:17 -04:00
ui.js Properly handle mousewheel events when we're simultaneously at top and bottom. 2012-10-16 12:16:26 -04:00
zephyr.js Make the client reload the page when it detects a server restart 2012-10-16 15:30:41 -04:00