Commit Graph

708 Commits

Author SHA1 Message Date
Zev Benjamin a9583f6889 Fix get_updates missing messages between calls
(imported from commit 2b84df2a35a9a006b8548904ebf145a351a2e92b)
2012-10-25 18:11:23 -04:00
Waseem Daher 98d7116ee8 Delete some dead code in signup workflow.
(imported from commit d07fffd4c0efdaaf4a233c1dbc9d09bc5ec03ad3)
2012-10-25 16:59:37 -04:00
Zev Benjamin a798e14d86 Remove more unused code related to get_updates not returning old messages
(imported from commit d2cc795634c46d8a595ed15c093cfbfc113e6d10)
2012-10-25 15:48:35 -04:00
Zev Benjamin 47eeae0d36 Restore the "load more messages" button disappearing when there are no more
(imported from commit 4f46d49c88d9d0dadefe3e770868b6844dc80d64)
2012-10-25 15:45:14 -04:00
Zev Benjamin 451a041919 Remove the ability to fetch old messages via get_updates
Clients should use get_old_messages, instead.

(imported from commit 67847ef67d8ad4bf4af3f6082f85f0c76a41944c)
2012-10-25 15:31:27 -04:00
Keegan McAllister f8540dcdae Wrap some other extremely long lines
(imported from commit e7d55f318c8865ca953bf4520d1b07f7e84a4aeb)
2012-10-25 15:22:18 -04:00
Zev Benjamin c047502840 Use get_old_messages in client instead of get_updates for loading initial messages
(imported from commit 169b3720c1fa10606f2351039cac9655bb5165b4)
2012-10-25 12:10:44 -04:00
Waseem Daher 22a32c09c4 Add a shortcut to pull up the shortcuts dialog.
(imported from commit 0d6d3ba78a06f0eb1ecba8e6a571b79709980cef)
2012-10-24 18:31:44 -04:00
Keegan McAllister f3f9fb545d Narrow by recipient when the user presses 'S' on a huddle
(imported from commit 7e7c3d27b0824a60f7e8379c282ec05704d842f6)
2012-10-23 23:04:42 -04:00
Keegan McAllister 899e6d1042 Resize the compose box on show
It doesn't work to do this immediately after we clear the contents, for some
reason.

(imported from commit b24e2464afc7a4703d4a679ab0b51ac150f1ce89)
2012-10-23 22:08:47 -04:00
Keegan McAllister af065005fc Automatically resize the compose box
(imported from commit 7e9cb632bdca47fee6ad0897a55d1d3c004c34b3)
2012-10-23 22:08:44 -04:00
Keegan McAllister eaecaab7f4 Rename narrow.all_personals -> all_huddles
(imported from commit 6258ddd1548b6ee8cf20c28c9b18e229ebf4e720)
2012-10-23 20:43:23 -04:00
Keegan McAllister f0bebe1cc0 Change 'p' hotkey to 'h', for 'huddles'
(imported from commit 3415f1d3f679be41cb5b92827036b09829a99734)
2012-10-23 20:41:54 -04:00
Waseem Daher 8ce8a083bb Slightly hackish way of stripping out   in narrowbar tooltips.
(imported from commit 414738408cd1e4e53f0268b0851c903c6a1a9eda)
2012-10-23 20:30:58 -04:00
Waseem Daher feff1d811d Allow icons in narrowbar without putting their HTML in the title text.
Before this commit, a hover read "<i class='icon-whatever'></i> All huddles with..."

(imported from commit e5a20678b87355d6709ec3b8776469114c92b2f6)
2012-10-23 20:21:51 -04:00
Keegan McAllister 718018bbf6 select_message_by_id: Fix return value when already selected
(imported from commit c86509f6cf040d6acb771764d7fe2b40afa72fe3)
2012-10-23 19:34:54 -04:00
Tim Abbott bcfe06c69c Don't show floating recipient bar when narrowed to huddle/subject.
(imported from commit b7cbd83035292ed447a3da666df9326d75aac35e)
2012-10-23 18:29:54 -04:00
Keegan McAllister afdd3af1b6 Handle having no selected message more gracefully
(imported from commit ba00c012061b35dfe490bf1312b3fa78a4f6582f)
2012-10-23 17:03:31 -04:00
Keegan McAllister 0744332658 select_message: Reliably return success or failure
(imported from commit 5e6b4066bd53a9b958ec0e752550feb423e52de5)
2012-10-23 17:03:31 -04:00
Zev Benjamin d4c2fd6cb6 Don't update the pointer on the server when the client receives messages
(imported from commit 54a0d10e94d2f4d39a29d4c8596bf4712c1eb45b)
2012-10-23 16:39:05 -04:00
Zev Benjamin 6c4b56517f Revert "Temporarily disable pointer sync"
This reverts commit 7d8f673559ca6359923aa0bdd48edebe0955e921.

(imported from commit 32f7ad925cc4df72220a191602487620a9970f43)
2012-10-23 16:39:04 -04:00
Keegan McAllister e7746e97e8 select_message: Fall back to the last, not first, message
This seems more likely to be what people want when e.g. viewing all huddles.
Later we can get more clever and select the nearest huddle, or something.

(imported from commit 8ec1aa02c050dd25eb868b1e317d114743525c7b)
2012-10-23 16:31:05 -04:00
Keegan McAllister 37ac9d2a91 select_message: Misc cleanup
We can safely call .is(':hidden') on an empty jQuery result and get false.

(imported from commit a73932f63b8fec7c43d8603fca95adcd4f164317)
2012-10-23 16:28:40 -04:00
Keegan McAllister d34bebc584 select_message: Properly fall back to the first visible message
Our old selector here was picking up the floating recipient label, or
something.  This was breaking narrow-to-all-huddles when on a stream message --
you get no selection and the code is sad.

(imported from commit d25fab03bd6d745df6d787c0b1b6452c8c539e32)
2012-10-23 16:28:40 -04:00
Keegan McAllister b049749cb2 New hotkeys for narrowing
- s for stream or huddle
  - S for subject
  - p for all personals (still buggy)

We've eliminated the 'g' prefix entirely.  And the old 'g-a' un-narrow sequence
has no new equivalent, but you can still use Esc.

(imported from commit 6bdaacce9639e3f749418e06622a317937e7d014)
2012-10-23 15:28:07 -04:00
Zev Benjamin ce3ea9f019 Temporarily disable pointer sync
(imported from commit 74e6bb347e0b8c01b6450914a50448b78b9749c9)
2012-10-23 15:24:00 -04:00
Keegan McAllister 86159813df Hide the "Load older messages" button in narrowed view
Ideally this would be part of hiding zhome, but right now zhome/zfilt are
assumed to the tables themselves, and changing that seems unfortunately
invasive.  And it's not crazy to think of the "loading controls" as a logically
separate thing that we might show/hide independently.

Longer term, we may want an indication in narrowed view that there could be
more messages on the server.

(imported from commit eb72d720da7c03f6f1378ae18ab6e973bf98247f)
2012-10-23 13:28:08 -04:00
Zev Benjamin fca4cade34 Ignore long-poll successes with no data
The server will occationally return successfully with no data during
a restart.  Previously, when we would get such responses, the page
would stop working because of JS errors.

(imported from commit 39b89907dc5ae9a9eb54ebf60d0069281e401786)
2012-10-23 12:03:56 -04:00
Tim Abbott 9779ca9e5c Shorten get_updates timeout to under a minute.
(imported from commit fcc87011051c25051861e3c36e442398cd3ca3c0)
2012-10-23 11:31:32 -04:00
Zev Benjamin ed05e28e55 Update server when selected message changes via scrolling
(imported from commit a763baf064e73d358632f3754aba940d188f733d)
2012-10-23 10:30:59 -04:00
Zev Benjamin 899d5c776f Check reason_empty on client when there are no new messages
This fixes a problem where the client would never stop asking for old
messages (bug introduced during rebase)

(imported from commit eef9f19e1e9982b1e0a954eb36a81e1b7ee5b564)
2012-10-22 18:19:14 -04:00
Zev Benjamin 0f474285bf Up idle timeout for reload
(imported from commit 7d9c7dbd77f49865d7e1922ddcee08cd963f4abf)
2012-10-22 17:30:26 -04:00
Zev Benjamin 732ca19729 Synchronize the pointer across sessions
The client may now optionally send its current pointer during
get_updates and the server will return the latest pointer if it
differs and was updated more recently by a different session.

(imported from commit e43b377d7dfb52f83cefb0b1003863d5407caf80)
2012-10-22 16:44:57 -04:00
Zev Benjamin 7e4b7fb881 Add message selection option to not update the server
(imported from commit a5ef9506be24fee7652cd5479cb74789aa365216)
2012-10-22 16:06:38 -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 35bb3613cd Rate limit pointer updates to avoid hammering the server
(imported from commit e1add1b64779f3d0caf5426eb99233e78de278ae)
2012-10-22 16:06:38 -04:00
Tim Abbott bf007776ce Fix selecting huddles using the mouse type-tabs.
(imported from commit 6b9981cf6d5a5aaf9d644a18cc04397f3cf0dead)
2012-10-20 10:35:39 -04:00
Zev Benjamin 33c40bd9ba Don't reload the app after sending messages
(imported from commit 0985a3e7d13b1be00ae0b190914aeb3647ba196a)
2012-10-19 18:25:57 -04:00
Keegan McAllister 5b13f9192f Load more messages when the user presses the "Load more messages" button
(imported from commit 060e6f67b13fd67b56f80f913eb6b835860a8115)
2012-10-19 17:13:14 -04:00
Keegan McAllister 3dfed7b6a1 Add a "Load more messages" button
...which currently does nothing.

(imported from commit 185b35c2bf651779bfcdba44524d1bcb8af74f27)
2012-10-19 17:13:13 -04:00
Keegan McAllister fa011c108c Factor out restart_get_updates
(imported from commit 03755dccbbe296e8c5208c460d80645c0fa17e14)
2012-10-19 17:13:12 -04:00
Keegan McAllister c67e7035aa Limit the number of old messages the client requests
(imported from commit 6bff6aa0b48d46b98aa68c6e29eb569cf41f4989)
2012-10-19 17:13:08 -04:00
Zev Benjamin a80e08fbf3 Fix typo
It was preventing the right text area being focused on huddles

(imported from commit 8ebe457b4e5bce723e3afd9f396f97eeb0e97c46)
2012-10-19 17:04:28 -04:00
Zev Benjamin 9c2da407e6 Update the current composition type on toggle
This was preventing huddles from sending because clients thought they
were still sending a stream message.

(imported from commit 694b06cbc43adc9563327ebffccb7fa37aa36bac)
2012-10-19 17:00:27 -04:00
Zev Benjamin 337836ef54 Fix initial focus on new messages
(imported from commit 4553f6209362f684110b34e92fdba2046cfbb08e)
2012-10-19 16:17:29 -04:00
Zev Benjamin 9de73b5a91 Be intelligent about which input box is highlighted in compose.start()
(imported from commit 37268601d569fdb510415ebfae594804817c0e3a)
2012-10-19 16:09:13 -04:00
Zev Benjamin 2a98045406 Fix responding to messages (broken by rebase error)
(imported from commit 1fac8d8757ee7f9b79c35e884edaa37e5cca0120)
2012-10-19 15:59:03 -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
Zev Benjamin 1b47cd58f1 Rename compose.message -> compose.message_content to avoid confusion with new API
(imported from commit cce8baba49a4176bdb900a83006db3bf23bcd82b)
2012-10-19 15:53:05 -04:00
Zev Benjamin 08b4bd0d9c Determine whether the user is composing based on a flag instead of element visibility
The flag is set to the kind of message being composed in
start_composing() and set to false in finish_composing().

This avoids the problem where composing_message() will return true
when the animation is still running.

(imported from commit 4c2e7e1fad2e6b2123825bd51d5b24ae41bccd45)
2012-10-19 15:53:05 -04:00
Zev Benjamin 621909df6b Add custom jQuery events to the compose abstraction
(imported from commit 3ff10baafd0825ed8b7ed50a8b668080d1e9f303)
2012-10-19 15:53:05 -04:00
Zev Benjamin 7a44a3b05a Use the new compose API
(imported from commit fb91febbd5c257aea15292d8071da69a3e6b9a99)
2012-10-19 15:53:05 -04:00
Zev Benjamin 746897b36a Add a compose API for starting, canceling, and finishing messages
(imported from commit 372e1c2ae19a72bcbb989fa2be5c510a1278fc69)
2012-10-19 15:53:05 -04:00
Zev Benjamin ab382040c1 Make get_updates reload_pending request parameter an integer
This fixes a bug where the server wasn't returning from get_updates
immediately when the client needed a reload.

(imported from commit 1d854eb1c7061f468d091e103f10074f4c7231d8)
2012-10-19 15:53:05 -04:00
Waseem Daher 17d44be14a Display huddles as 'You and...'.
(imported from commit 35fe0e56751b1a2993bd99181e8bbd57e8c3ce81)
2012-10-19 15:11:13 -04:00
Waseem Daher 647f3c1220 Hack to make narrowbar line up a liiiiitle bit with real bar.
(imported from commit 83f0066def43b2a35e2d8aa089f5962617cf5546)
2012-10-19 15:07:08 -04:00
Waseem Daher 92045f2c9e Experiment: Use icons in more places (instead of the word Huddle).
(imported from commit 6e27da4e54634c1f2fe05e2bffac24dc00576d2c)
2012-10-19 14:42:43 -04:00
Keegan McAllister 299a298bfb Fix variable name typo in narrow.by_recipient
(imported from commit 87954f2d9007ebdd9d6da8a71584d2677c19ad4d)
2012-10-19 13:02:25 -04:00
Keegan McAllister 5d0fdd1958 Clean up narrow.by_recipient
(imported from commit ca6665f29847077d6038d3f48821c4be02e95ff1)
2012-10-19 13:02:25 -04:00
Keegan McAllister 390c9a26c1 Explain why target_id exists
(imported from commit af2235d80ada47e95806a8a2f807261da583e39e)
2012-10-19 12:57:34 -04:00
Keegan McAllister 3c00b828b0 Use target_id in narrow.by_recipient
Following 958ce29.

(imported from commit e52e9628f85d83ef02bef393f6b10697a7d4eec4)
2012-10-19 12:57:34 -04:00
Keegan McAllister 2439d69209 Get rid of helpers by_personal, by_huddle, by_stream
These make assumptions about the current message type.  We should just use
by_recipient externally.

This reverts commit ad2123f99ce91361ab907c308bfecec4efd722a4.

(imported from commit b7945896568c4c5c31a9d5bddb0e9ade8eef859b)
2012-10-19 12:57:34 -04:00
Waseem Daher 9dbcea2a16 Unbreak narrowing.
(imported from commit ad2123f99ce91361ab907c308bfecec4efd722a4)
2012-10-19 10:38:54 -04:00
Waseem Daher 34fc2266ce Pop up a little box of info/actions when you click a name or gravatar.
Known issues:
* Not all of the options in the menu are functional yet
* The wording isn't totally perfect on some of these options;
   I kind of want to use a 'first name' in some of them.

(imported from commit 5a333fb939fcca7e0d0ecb2c43e79501139ac0db)
2012-10-18 21:19:49 -04:00
Keegan McAllister 2fe034d161 Rename subs.add -> subs.add_for_send
This has some logic specific to the "Create and send" / "Subscribe and send"
buttons.

(imported from commit 5f9e314ebde31ec1e6a183513816d1ade361e4cc)
2012-10-18 16:25:58 -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
Tim Abbott 461da3f742 Only check if a stream exists if we're not subscribed to it.
This should make sending twice as fast.

(imported from commit a30c6fe7f20aae65d0bfe65e76774017b2627c04)
2012-10-18 13:43:54 -04:00
Tim Abbott 247cfc5344 Fix create-and-send functionality.
(imported from commit 24452eb90e9aaeb0ad406f6c56ce412e2f410865)
2012-10-18 13:43:50 -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
Zev Benjamin f0d4cc3d42 Don't error out when displaying huddles with oneself
(imported from commit aa08d85f4af6352f49ef6584ae0d4a3d310e231e)
2012-10-17 18:17:43 -04:00
Zev Benjamin f7644dfcd3 Rename the 'received' variable to 'get_updates_params'
(imported from commit 5d307f7de7edfb7aa65346353b20afe0e9aa49fc)
2012-10-17 18:17:43 -04:00
Waseem Daher 0fba2d2df3 Attempt at making stream names more prominent when skimming.
Known issues:
 * Narrowing links sort of broken
 * "S/H" is a terrible selector

(imported from commit 14d309b55dfaa4c4bc5cb1310a111a46f2fb7e20)
2012-10-17 18:12:32 -04:00
Tim Abbott bff0046c51 Fix client continuously calling get_updates when a reload is pending.
(imported from commit 2c29c8b892e7843f4d75178cc683bf48f7a5cdf5)
2012-10-17 17:46:07 -04:00
Tim Abbott ae3e24458c Add a UI for requesting your API key.
(imported from commit 07c40caf73f3b6c1c502a6c8e18109532dd28cc3)
2012-10-17 17:09:46 -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 7237b4a73e Fix sending to a stream with a space in its name.
Previously if you tried to send to "a b", we actually ended up trying
to send to "a%20b", since we were url-encoding the stream name and
then not properly decoding it.

(imported from commit 307d2999bd309e47fc654ae4422ab4372edde064)
2012-10-17 14:06:00 -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
Tim Abbott d2343813df Add 'C' hotkey to start composing a huddle.
(imported from commit 693aeba202a06465dd41e46d78491ecfe23e97f6)
2012-10-17 11:55:21 -04:00
Waseem Daher bf73a54576 Have Spacebar exhibit the same scrolling behavior as PgDn.
(imported from commit 46a1204a9a8b973e7fa6bae9c65a9dc9f341077c)
2012-10-17 11:25:38 -04:00
Waseem Daher 2d4857d6c1 Remove extraneous calls to keep_pointer_in_view.
PgUp, PgDn will already call the scroll handler, which will
of its own accord call keep_pointer_in_view.

(imported from commit 8b6e53eaeda91d0f35775de72e16d63dc6c8340b)
2012-10-17 11:25:38 -04:00
Waseem Daher 93954177f9 Code a little more defensively in update_floating_recipient_bar.
That andSelf is only necessary if a .recipient_row were immediately
followed by a .bookend_tr, which, I don't know, after a redesign could
very well be the case, so let's guard against it now, especially since
our performance on scroll is currently pretty good.

(imported from commit 1011555fbfd30943b4aa917997d6e35bcce959fc)
2012-10-16 17:26:02 -04:00
Waseem Daher 433ac07b37 Very very slight speedup in get_next_visible/get_prev_visible.
In my limited trial, this sped the call up, on average, from
0.507ms to 0.473 ms... so, admittedly, not a lot.

I think this is a little conceptually cleaner, though, and it handles
the common path with the least work, which I like.

(imported from commit c8b827a2e8111fbdd54bcabe05ac36f64523c466)
2012-10-16 17:06:36 -04:00
Waseem Daher b730dc7983 Huge speedup in get_next_visible/get_prev_visible.
nextAll/prevAll walks the entire DOM, basically.
This code only walks the DOM until we find a new .message_row.

This speeds up the average time of a call to this function from about
6.38ms to 0.678ms, in my benchmarking.

Admittedly, the whole outer loop here could still use some
optimization, if we want to; do we really need to call this 1000
times?

(imported from commit 852e2f660a16f8cfd7be35d3271aedb1ac481663)
2012-10-16 17:06:36 -04:00
Waseem Daher cada47a981 Slight speedup in get_next_visible/get_prev_visible.
http://api.jquery.com/first-selector/ mentions that using ":first" in
query selectors can be a little slow since we can't use the browser's
native querySelectorForAll implementation.

In my tests, this cut the average time down from 6.70ms to 6.38ms.
So, not great, but this function is most frequently called
many times in a big while loop, so, better than nothing.

(imported from commit d7725edd0c81431829fe353c6dd2bc61b1de6b19)
2012-10-16 17:06:36 -04:00
Tim Abbott 94944d2c5e Fix updating the pointer.
(imported from commit e0214c59c7c14b3c6791e4da205386253f6861c1)
2012-10-16 16:56:21 -04:00
Tim Abbott 6642a65269 Convert last few json views to use the json_success api.
(imported from commit 7a617ec7e7c8607e8ba87e7a9b8599a83b91666c)
2012-10-16 16:54:41 -04:00
Tim Abbott a859c10017 Don't redirect to a login page when responding to json messages.
Also update tests to actually check all our URLs.

(imported from commit 86de2027d140da6118e2f2f60c1c86511b16c141)
2012-10-16 16:38:39 -04:00
Tim Abbott 3e994c16b7 Rename/reorganize our urls to be more consistent.
(imported from commit ca3cc7ccd5d7da83a9c60968527378ee1118648e)
2012-10-16 15:56:06 -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
Zev Benjamin 24c1a2d7f1 Make compose box accessor functions also be setters
(imported from commit ab568cc2c224b8558148f158d1c9c1f89bb1eb49)
2012-10-16 15:30:09 -04:00
Waseem Daher ea7770c4b7 Properly handle mousewheel events when we're simultaneously at top and bottom.
(imported from commit 72efb1c52b5aed759150d9d2fe82ca619a25ff35)
2012-10-16 12:16:26 -04:00
Waseem Daher ca1dcf222f Don't allow the top of the pointer to be past the 2/3 mark.
Given that we now look at the top of the pointer rather than the
bottom for this check, our previous 4/5 number was far too permissive
(and led to your selected message often getting covered up by the
compose window).

Anecdotally, this feels a bit better to me.

(imported from commit 39ca7924db56272f7e623708ce0125b2a7012656)
2012-10-16 11:46:17 -04:00
Waseem Daher fc5287e7ed Redo above_view_threshold/below_view_threshold to prevent glitching.
In particular, we had this issue on huge messages. Suppose you had a
huge message and were scrolling up from the bottom. Initially it would
get selected as the message underneath it was below the
threshold. Then, when you scrolled again we said "oh, well, the top is
too tall, it's also *above* the threshold" and moved the pointer back
down. So it glitched back and forth.

Now we consider you above the view threshold by looking at your
bottom, and below the view threshold by looking at your top, which
seems to resolve this issue.

(imported from commit 2434d1103ab3fa894ade612ac1fb10b2f3cd66cf)
2012-10-16 11:46:17 -04:00
Waseem Daher ca7855e03e Use outerHeight instead of height.
I think this'll allow for a slighlty more accurate drawing of our
floating recipient row in the even that some of these things have
borders and others don't.

(imported from commit 31714f7356604e1d9c64bcc7f6fd14b8a02a99b5)
2012-10-15 22:47:42 -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
Waseem Daher 45629a362d Break apart the scroll and mousewheel handlers.
I'm actually not sure if this is a performance gain or not; I guess it
depends if any of the stuff inside mousewheel or scroll took longer
than 50ms to call (and right now it does).

(imported from commit e3fcc4a14cd8787fa2357a43ed878ab08646e4f2)
2012-10-15 22:47:42 -04:00
Waseem Daher d51aec272d Rename. More consistent references to floating_recipient_bar.
(imported from commit 7bfd2bf55ede0604349faf06944c551a0d23fb73)
2012-10-15 22:47:42 -04:00
Waseem Daher 1c56ad00c9 Optimize update_floating_recipient_bar's showing-and-hiding code.
(imported from commit 6cd67d9c7bf418ae78288363636ee75fdc3fcada)
2012-10-15 22:47:42 -04:00
Waseem Daher 1781a4a616 Optimize update_floating_recipient_bar's "pick a subject/stream" code.
(imported from commit a6e615a3939fb072cc9cd310e653f13d690a55cc)
2012-10-15 22:47:42 -04:00
Waseem Daher daf06b9beb Hack around visibility: collapse for Chrome.
(imported from commit 25e6453fe6fa1c5a3c72f56bec2e4bbb089edb4f)
2012-10-15 22:47:42 -04:00
Waseem Daher 4d914df68b Rename things.
narrowbox -> top_statusbar
narrowcontent -> narrowed_to_bar

floating_indicator -> floating_recipient_bar
fixed_narrowbox -> table.floating_recipient

(imported from commit 7b5bbb17aeff9372275311ab09cd3cbf8262ea13)
2012-10-15 22:47:41 -04:00
Waseem Daher acb75ecf67 Only float narrowbar when #home is active.
(imported from commit a2da9b5a41e5a645d0c72ef48ff4a856558bed15)
2012-10-15 22:47:41 -04:00
Waseem Daher a80ba151b0 Eliminate scroll direction detection.
(imported from commit 2aa8665c9ffa137830fc871061d7e72ba5ccfc6f)
2012-10-15 22:47:41 -04:00
Waseem Daher 6015d1d928 Refactor the 'floating stream/subject' bar.
(imported from commit 76528653c29809bc461693b069140bfdfbeec97b)
2012-10-15 22:47:41 -04:00
Waseem Daher d95b4a30e2 Resize the narrowbox, not the 'narrowcontent' when we shrink.
This allows us to put other stuff in the narrowbox and have
it also magically get resized. At least in theory.

(imported from commit 92975e3d0893b34d52cad910462cbf2ccaed2eab)
2012-10-15 22:47:41 -04:00
Jessica McKellar d07f4c05f3 Keep the top-most recipient row floating at the top of the screen as you scroll.
(imported from commit e597b60c86f5b38a55dc78df80d84dfe112c8d8f)
2012-10-15 22:47:41 -04:00
Zev Benjamin 828fc05da5 Don't display one's own email when replying to multi-person huddles
(imported from commit afcf48e17b3dc6f1103f089f8746d462e90c0db7)
2012-10-15 15:57:41 -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 8f3aea5cbf Fix narrowing to personals with a specific user
(imported from commit 06f84dd056e8212cb146a17bec37d0bbe63651d0)
2012-10-15 15:40:55 -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 0bf78df2f6 Display full names in narrow description for huddles
(imported from commit 665df20d129df4d7e516f145f064b90c6e0f34af)
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
Tim Abbott cd14988b47 Reset the failures count to 0 when restoring from suspend.
(imported from commit 11b03f8a0565063cc7381dd32a96af79bd26a0d1)
2012-10-15 13:20:54 -04:00
Tim Abbott 4062550ef7 Fix tab not toggling the compose window in Firefox.
(imported from commit 4dfd3d6eb3e81c519d0aefbfe0b3b1390adb241b)
2012-10-15 10:45:31 -04:00
Tim Abbott db3c40fad1 Don't display yourself on list of huddle recipients.
(imported from commit 17919c153ad380adbb0a9dc2c111ea1686603414)
2012-10-12 18:41:04 -04:00
Tim Abbott ec1533b0b1 Fix display of huddles.
(imported from commit c894411331fd0fa905d0c72d5cfa78317fad8c2b)
2012-10-12 18:37:34 -04:00
Tim Abbott 89aa539024 Display fullnames for headings on huddles and personals.
(imported from commit bfd296bd962b6c44d4da3e5dfa1a6791c4c46b8a)
2012-10-12 18:35:28 -04:00
Tim Abbott 41e935fd28 Send the sender_short_name to clients.
(imported from commit 1652f5cadbe9c90d4c6d53c97cb23305aaaaa34d)
2012-10-12 18:35:28 -04:00
Zev Benjamin 827cc31aa7 Be more efficient about adding new people to the people list
(imported from commit ff0a891fd8f60b01308c6be21d3f8eb645d4ee31)
2012-10-12 18:18:04 -04:00
Zev Benjamin 09deef9611 Improve autocomplete for multi-person huddles
(imported from commit 3dacbc6b8c8470177844987e509bc1d413a10766)
2012-10-12 17:29:52 -04:00
Zev Benjamin bc4487ebf9 Fix autocomplete
There were two issues:
* The people_list population changed and I failed to noticed
* Typeahead source updating never worked before because calling .typeahead()
  more than once does not change the data source

(imported from commit fda14029f4cd37260d82e7bb5689f5022e1b0d28)
2012-10-12 16:57:27 -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 88009b4854 Auto-complete huddle names based on full name.
This also makes the people_list a list of objects containing the person's full name and email.

(imported from commit cff9b3de8cab0c9b2690ffa60d65d666302b989f)
2012-10-12 11:35:45 -04:00
Zev Benjamin c4d35280ea Make Message's display_recipient field be an object with consistent names for both personals and huddles.
(imported from commit 8b00f16b036ed3fb3f7d56e7393271ec1d458ea5)
2012-10-12 11:34:42 -04:00
Waseem Daher 22099dfe9f Fix scrolling bug related to resize.
When Bootstrap shrinks the divs down into 'tablet' mode, our selected
message might end up being even lower in the screen than it was before
(because more text wraps). But our scrollbar does not automatically
advance to keep it in view -- so we do it manually.

This implementation is a little hackish in that it does some
unnecessary recenter_view-ing in big views (which can be a touch
disorienting) to optimize recentering on resizing for small views.

If that behavior is annoying, we can deal with it by being
smarter about when we trigger the recenter code.

(imported from commit 6834e11f7a37833982c388f15174df661d7f55b3)
2012-10-12 00:17:24 -04:00
Waseem Daher 04b0000d83 Embarrassing typo fixes.
(imported from commit 0ea86386e3d4269be63610f4729b1f1762cdc0b7)
2012-10-11 22:49:18 -04:00
Waseem Daher 3853bf6dd8 In case we start out very small, trigger resize handler on page ready.
(imported from commit b3492eee7299e89ded422527facf9c8e44421c73)
2012-10-11 22:44:28 -04:00
Waseem Daher 7d155850a9 Have the navbar,composewindow,narrowbar look OK in small windows.
(imported from commit 724ecfee79a263919e93c47513332ffdd3c6d286)
2012-10-11 22:44:28 -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 8dca315a18 Rename s/class/stream/ in code local to various js files.
(imported from commit c441f9d7d4155ff3c4b171a2a4a3db4ffbb60ac4)
2012-10-10 17:48:18 -04:00
Tim Abbott 5509419084 Rename #class* to #stream*.
(imported from commit a8f15f636f3801ba1152f1020e885240984d070e)
2012-10-10 17:48:17 -04:00
Tim Abbott 98ba39700c Rename is_class to is_stream.
(imported from commit 6a68581c8a3ab72b13907af651a772a4a190ac40)
2012-10-10 17:48:17 -04:00
Tim Abbott 873f8fd2bb Rename class-message to stream-message.
(imported from commit fe69222bdca28bab303adca8ea8448a6aac35e40)
2012-10-10 17:48:17 -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
Tim Abbott 081f82c50c Rename narrow_class to narrow_stream.
(imported from commit 4654718c1226f7d0d945436f8dafdfa64d74c92c)
2012-10-10 17:48:17 -04:00
Tim Abbott 08e832e093 Change send_message to accept a stream, not a class.
(imported from commit 0f58de2502bec227f5f33e44692d03f2f28d6f63)
2012-10-10 17:48:17 -04:00
Tim Abbott 44e9e4cebf Rename Recipient.CLASS to Recipient.STREAM.
(imported from commit a530194163f7260c73921137fa1ff671f14516f6)
2012-10-10 17:47:13 -04:00
Tim Abbott 8daff2e05e Rename ZephyrClass to Stream.
(imported from commit ae51b7a9e03f322dfe2dfccd250cbfc23adfe32e)
2012-10-10 17:47:12 -04:00
Jessica McKellar c4dd4ea06f Clear compose error messages on New Message or message type tab toggle.
Also highlight a useful input box on tab toggle.

(imported from commit e046cd077039b42069e866267038b92536a05e1b)
2012-10-10 16:59:20 -04:00
Jessica McKellar 19823bdec8 Add a watchdog for your laptop waking up that wakes up polling more promptly.
Without this, if you suspend and resume you wait up to 90 seconds for
long polling to retry.

(imported from commit 5e964c357f395d30107af5b2c934949058c0d3a8)
2012-10-10 15:09:16 -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 a0bb0d257b Set the URL to include which subpage we're on.
(imported from commit 9f7d3db53477a294ec72762dcc278341c4d183c7)
2012-10-10 14:22:19 -04:00
Tim Abbott 18cd32b042 Rename zephyr=>message in remaining local variables in zephyr.js.
(imported from commit 5641ea31b03079e9a0910b2c8451e961cc7cb285)
2012-10-10 10:35:48 -04:00
Tim Abbott 21260d0aca Rename zephyr=>message in add_zephyr_metadata.
(imported from commit 3b174cc645baa00023164c3407bec95e556cc6de)
2012-10-10 10:34:42 -04:00
Tim Abbott 42c05b9690 Rename the zephyr template to the message template.
(imported from commit c15e2cc08d3604a82d90a96efa4f70d101971df4)
2012-10-10 10:32:59 -04:00
Tim Abbott 2170c7a352 Rename zephyrs to messages in various local variables.
(imported from commit 91ac7e47c51fdcaf6559b06f07e36b041aad3e2c)
2012-10-10 10:29:48 -04:00
Tim Abbott 27b84f7705 Rename zephyr_row to message_row.
(imported from commit 5975c7fe5e792ec294e55764581474fa55f62b70)
2012-10-10 10:27:59 -04:00
Tim Abbott 0c89972c54 Do zephyr=>message rename for local variables in dom_access.js.
(imported from commit f6160f56730301c9e8e00e5edf79914d42eceeaf)
2012-10-10 10:24:02 -04:00
Tim Abbott dde773c7b5 Update comments in hotkey.js zephyr=>message.
(imported from commit 648fc45a8c6324d57c2c9e57f12bf162b438758f)
2012-10-10 10:22:10 -04:00
Tim Abbott 5e2d3ab74b Rename zephyr_mousedown/zephyr_mousemove => mousedown/mousemove.
(imported from commit e479ae44fd18099dc616591cef740c382dd7e0d0)
2012-10-10 10:21:40 -04:00
Tim Abbott a0f702089d Do zephyr=>message rename for local variables in ui.js.
(imported from commit d101787903ec1fdbf2a644739d4f63c2ae8fb41e)
2012-10-10 10:20:48 -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 75e01a3e62 Rename persistent_zephyr_id to persistent_message_id.
(imported from commit f8eca5fcec920f61aaf59b91ec7d11722da62164)
2012-10-09 22:42:20 -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 363c658896 Rename zephyr_comp to message_comp.
(imported from commit 752b669c3298dd791ba26de9fd815faa1b4e8a73)
2012-10-09 22:42:19 -04:00
Tim Abbott 836971d3b3 Rename zephyr_content to message_content.
(imported from commit 05e255ec275a8aeaf3967d6a4305cc4440c81913)
2012-10-09 22:42:19 -04:00
Tim Abbott 760b540e55 Rename zephyr_sender_{name,email} to just sender_*.
(imported from commit 9bfa197a391e5dbdabf616244afb3634cdab1921)
2012-10-09 22:41:17 -04:00
Tim Abbott a62cd32107 Rename zephyr_compose* to compose*.
(imported from commit 103351bbdb7657720d7b7b9f57ee88e5957d09a4)
2012-10-09 22:41:17 -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
Tim Abbott 78c303e44a Rename zephyr-type-tabs to message-type-tabs.
(imported from commit 623d226209bc6cbe20721be08a271e52185ea65e)
2012-10-09 22:40:12 -04:00
Tim Abbott dfc0b1a4d9 Rename next_zephyr local variables to next_message.
(imported from commit 88f3b5dc3fdde3340dcc4f040cf8ecc8554955bb)
2012-10-09 22:40:12 -04:00
Tim Abbott 864a26acd6 Rename the new_zephyr text area to new_message_content.
(imported from commit b5d09625a9c50865be7a6401e8da95efe06410fc)
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 bcd958f051 Hide all status error messages when switching tabs.
(imported from commit 184802bc3bf5c02f992486353c7209d4c5d99b17)
2012-10-09 15:44:29 -04:00
Waseem Daher 8a620cb687 Group chat -> Huddle in narrowbar.
(imported from commit aa437792584849d008274886c6a0ca1858fb8ba7)
2012-10-09 15:11:10 -04:00
Waseem Daher e7dab1f757 Set title text in narrowbar as well (this lets us mouseover if it gets too long).
(imported from commit be1e1f604016c2964d7b89cc50bfbc4113215819)
2012-10-09 15:10:20 -04:00
Waseem Daher 86dfc93f96 Reintroduce composebox animation.
So what's now happening here is that the outer div (which we were
previously animating) doesn't get animated at all; instead it is
simply made visible or hidden.

I *believe* this means that it always continues to take the same
amount of space in the DOM; its being added and removed seemed to
cause a slight height-of-page change which caused the scrollHandler to
fire, causing the selected message indicator to move down the page.

So now that this height is fixed, we achieve the animation instead by
animating the inner div -- the one that actually contains the
composebox elements.

(imported from commit 95b2f95d52254e3792633460f42efaac27559efe)
2012-10-09 14:25:18 -04:00
Waseem Daher 8083a149b8 Fix selected-message glitch on composewindow by removing animation.
The issue with the animation is that it removes the composebox div
when it's done -- or more relevantly, it "adds" it when the composebox
appears, which causes some DOM elements to get reshuffled slightly
which causes some jitter.

(Similar to what was happening with the email addresses earlier.)

So instead of using display:none, we play with visibility:hidden,
which causes the thing not to show up, but doesn't cause it to
lose its place in the DOM.

(imported from commit a18dbdcd1784b2b54436d48d8425d5fdc8dfbba4)
2012-10-09 14:25:18 -04:00
Tim Abbott 48a0c65bd6 Clear the class/instance values when replying to a huddle message.
(imported from commit 8953c6a8911503b4d938588e94d2323773f21c6c)
2012-10-09 14:18:55 -04:00
Tim Abbott d5c89ffe9d Fix needing to hit escape twice immediately after hitting "c".
(imported from commit 8132d61c14bcd012239c4364a249c3e52dd488c3)
2012-10-09 14:13:58 -04:00
Tim Abbott 1defb363e5 Disable hotkey processing on non-home pages.
(imported from commit 0865d2962e94d80cd1451e696e98ca6f9630ba1b)
2012-10-09 14:11:22 -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 ad213fc810 Fix focus on create/sub buttons if you try to send to a new/unsubscribed class.
This is a regression introduced by switching from links to buttons,
which get blurred by hide_compose.

(imported from commit f5aa67cb949f3edc7f86a0ef0d7f48b43860138b)
2012-10-09 14:06:56 -04:00
Jessica McKellar 6050a0a251 Advance focus to the next input field after autocompleting class or instance.
(imported from commit 068009946f0581834e268f1ed3d5e7e6a940fcde)
2012-10-09 11:45:46 -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
Tim Abbott ad9f58d90a Rewrite respond_to_zephyr.
The new version is now the only codepath that we use in order to start
a reply to a message.

(imported from commit dd28316d2640fd5fd712f326690d480b7db59c4c)
2012-10-09 10:40:27 -04:00
Tim Abbott 19a0e4a690 Fix totally backwards comparison and don't recompute the result.
(imported from commit 90b6711b668449aa550e1fdd6412030866e459aa)
2012-10-09 10:27:52 -04:00
Tim Abbott 67c08dfaf2 Set huddle_recipient even when replying to class messages.
(imported from commit dc91d66d87fb1b4c70d7b1842b733282c80b3e4a)
2012-10-09 10:27:52 -04:00
Tim Abbott d510a62976 Rename huddle recipient field to #huddle_recipient.
(imported from commit 8670f06679aa1554003aa2832dec3ed6d00ad1c3)
2012-10-09 10:27:40 -04:00
Keegan McAllister 94e542e3de Modify the right table in add_to_table
(imported from commit 0b4171556cff1e1e46ab1e3c64ec8bc74ac45576)
2012-10-06 17:43:09 -04:00
Jessica McKellar 321c2df67e Autocomplete on each recipient when composing a huddle.
(imported from commit 0a95f431d960f8a39544d4598fd859a8090fbfa3)
2012-10-05 19:41:28 -04:00
Tim Abbott 358351d423 Use the new_zephyr form for personal zephyrs, rather than a duplicate.
(imported from commit 741a785efba9ea40b5c1022d710360f086a2d859)
2012-10-05 17:44:55 -04:00
Tim Abbott 71d87499d8 Fix bug where hotkeys would still work in the compose box.
Just for the record, here's what happened:

If you click on a class message to start a reply, then click outside
to unfocus, then click on a huddle message to reply to that instead,
the system would end up calling the focus handler twice and _then_ the
unfocus handler once (why are we unfocusing something?  Because we
have two compose windows -- new_zephyr and new_personal_zephyr, and
we're switching between them).  the end result is that we'd re-enable
hotkeys with that unfocus handler.

Fix this by being sure to explicitly disable hotkeys after we setup a
reply to a message.

(imported from commit a7735d9a63f0c3c9f6c12d94e8bb107bf3675f44)
2012-10-05 16:38:09 -04:00
Waseem Daher 56bb7ae614 Make extra room when you press down on the last message.
This essentially reverts commit 0d6c3e4d0a70e06b9b2f6e5830b3a9650e44441a,
though also adds support for this behavior with the 'j' key.

(imported from commit 36c51e0f6bd03c53b84abddc75097cb06fc04e16)
2012-10-05 16:32:47 -04:00
Jessica McKellar a282f7b32b Have PageDown at the bottom/PageUp at the top select the last/first zephyr.
As opposed to inching towards it message by message.

(imported from commit 31e833dd06bf27336d9b1f293ab992e99537bc21)
2012-10-05 16:06:10 -04:00
Luke Faraone 6e4daba2aa Implement respond-to-author bound to the 'R' keypress.
(imported from commit d38b57d175a10423c566549371ae70032b02c29d)
2012-10-05 15:53:40 -04:00
Luke Faraone b16c3f1982 Make hotkeys case sensitive.
Previously we triggered all hotkeys on keydown. Now, if the keydown event
is in the range of a character we bail and wait for it to be handled by the
keypress function instead.

We also redefine all of the keycodes for characters to be their lowercase
versions.

(imported from commit 534199de92174c2858220abb21ce774e1ee0e1d3)
2012-10-05 15:53:40 -04:00
Luke Faraone 6094f46b3a Rename simulate_keypress; we're really faking a keydown event.
(imported from commit 2574afb738787311bc32885d36eaed862925d39c)
2012-10-05 15:53:39 -04:00
Tim Abbott c02c6cc954 Display the date when either it or the recipient changes.
This is somewhat experimental and we may need to work on the condition
when it shows up (or move it elsewhere).

Also, maybe it should say "Today/Yesterday" for times super close to
now -- the main issue with doing this is whether it needs to update
without your reloading the page to avoid being super confusing.

(imported from commit e29faf30c83b9574e5d233213f42a24175f9a616)
2012-10-05 15:44:15 -04:00
Tim Abbott fc71233b9a Show the sender line again if there is a delay between messages.
(imported from commit fffdb5d5fb5804c44af24e8e8037a7b4af14833a)
2012-10-05 15:42:54 -04:00
Waseem Daher 0c3ace82d5 Use throttling on our handling of scroll events.
This actually is a bit cleaner than our last approach,
because (I believe) we run our scroll handler code
even after the final scroll event, which prevents the
pointer from getting hidden by rapid scrolls.

(imported from commit 3bde4e8f067cd2406f90c04425c6e4ffb81ea784)
2012-10-05 15:39:10 -04:00
Jessica McKellar 7a88fd71e6 Fix broken math for scrolling at the top or bottom of a stream.
(imported from commit 2ba6ab58800b86cd5b31a1b6e235c0be51d985c1)
2012-10-05 14:50:28 -04:00
Jessica McKellar 3166921057 Implement Barnowl-style pointer centering.
This keeps the pointer in the middle 3/5ths of the screen and
asymmetrically handles going above or below those bounds.

(imported from commit 9a6033f53365e6d6cd8f82eb096af849e3b22542)
2012-10-05 14:50:28 -04:00
Waseem Daher 0eb6817d6b Remember scrollbar position as you switch tabs.
(imported from commit d71112acd81901fd5e6c6d8ddfae3c9f0a8ff4db)
2012-10-05 14:25:27 -04:00
Waseem Daher 32758e2e4b Don't have scrollhandler fire when the 'home' tab isn't active.
(imported from commit 242591730e5ce108c511e4eeaad7589d768b1b94)
2012-10-05 13:35:23 -04:00
Luke Faraone 8fc22ab5b4 Clicking on a zsender should populate the stream box, too.
(imported from commit d933053c9b081457cb523d90fee4daa0cc65fae1)
2012-10-04 17:59:04 -04:00
Keegan McAllister 8bf693224c Fix up attributes on links (whether auto-linkified or not)
(imported from commit cf362db2a2c9500f62b03a89055ac4585ba00a96)
2012-10-04 16:52:10 -04:00
Keegan McAllister 2ebd708a8d Remove client-side linkification
It causes problems when [un]narrowing, and we already do the rest of formatting
on the server side.

This reverts commit 90af0192b37bbebbf56d5e7c50f182485ddbca10.
This reverts commit df7e355648d2c4d6319de049933547ed96402fd8.

(imported from commit 99d87f0826ec2f49741f86fad6524ed93e76723f)
2012-10-04 16:52:08 -04:00
Waseem Daher e28373ec13 Properly handle refocusing pointer on both scroll and mousewheel events.
When you're at the top of the page, you don't get scroll events
anymore if you're scrolling with a mousewheel. So we need
to listen to mousewheel as well as scroll.

(Why not *just* mousewheel? Because then the scrolling done by
 PageUp and PageDown no longer causes the pointer to refocus,
 because those trigger scroll events.)

(imported from commit 4ee23004f6e090abaabb836f0a9d7b59d0394ced)
2012-10-04 15:47:21 -04:00
Waseem Daher 93dbb21aff Prevent glitching on scrolling.
This duplicate call to scrollTop is the source of our problems.

(imported from commit 4374e0837d2af5eb20545449469fade7b5d47aca)
2012-10-04 15:47:21 -04:00
Waseem Daher 14daa08726 Restore scrolling behavior in this brave new scrolltheworld world.
There still seems to be some glitching when arrowing around,
which still needs some investigation.

(imported from commit 9c4d8f2b0b55fda5077e2fba70cbe4bcd50b823a)
2012-10-04 15:47:21 -04:00
Waseem Daher fe3fcd334e Remove dead code.
This code is the start of something that would make your
narrowed-on message remain in the same place post-narrow,
which is possibly a good idea.

(imported from commit 0a557d6492de470928245b33f95ae8c0102db0a6)
2012-10-04 15:47:20 -04:00
Waseem Daher 0fcec1aad9 Remove high water mark code.
(imported from commit 308148b2b54709354d219fd7c0ba1ae63f7e7503)
2012-10-04 15:47:20 -04:00
Waseem Daher c7175f5f43 Delete code that repositioned window on last message.
I believe we'll get this for free with the new version of
select_zephyr and our bottom_whitespace div.

(imported from commit 0d6c3e4d0a70e06b9b2f6e5830b3a9650e44441a)
2012-10-04 15:47:20 -04:00
Waseem Daher 1f669e1c85 Do a little handling of Home, End, PgUp, PgDn ourselves.
It turns out it's marginally easier for us to completely handle Home
and End ourselves rather than let the browser do it, because home
scrolls to the top of the page, but it does not select the topmost
message.

With PgUp and PgDn, the default browser behavior is fine,
but it seems like PgUp on a screen where you're already
"scrolled to the top" should not be a no-op.

(imported from commit 609d639f3a4313e75e1fd6138966f15447b70f2e)
2012-10-04 15:47:06 -04:00
Tim Abbott 2a79ff0cc8 Rename 'zephyrs' => 'messages' when formatting a message list to send to clients.
(imported from commit bfbb556f2444aca8277f54c363eccb678b6bf2dc)
2012-10-04 14:42:38 -04:00
Luke Faraone 15a99f6be2 Remove errant console.log.
(imported from commit 3cfb7991e01417274387ab0e36c1c950a0a865c6)
2012-10-04 13:33:59 -04:00
Keegan McAllister c456e2850a Allow console.log in debug.js
(imported from commit fe965c9687f0080c639ab3526b245ca3304e5672)
2012-10-04 12:36:59 -04:00
Keegan McAllister f30f10b71d Remove console.log calls in get_updates
We haven't needed these lately.  If we see more problems that need diagnosis
"in the wild" then we can revert this commit.

(imported from commit 3885183d08aefa1f7fd7aa8c2c060e917bf215fb)
2012-10-04 12:35:53 -04:00
Keegan McAllister c1c8ce9e53 More style fixes for signup.js
(imported from commit 15303c4e0dbf342da752d5f215cbcb0e8c6652f5)
2012-10-04 11:05:34 -04:00
Keegan McAllister fcfcf834a1 Replace 'in' with .hasOwnProperty
(imported from commit 209aef184f0a6117d1c14e755e7b916a866b8702)
2012-10-04 11:04:26 -04:00
Keegan McAllister bdf1e7e25c Introduce a function for controlling whether keydown is interpreted as message input
(imported from commit 88194bf560257ec0c4033076703d24c670a2c4ba)
2012-10-04 11:04:26 -04:00
Keegan McAllister 46a788202d Move go_to_high_water_mark back to zephyr.js
(imported from commit 843199811bf16afd4b54c2b0467b3b18d431b73a)
2012-10-04 11:04:25 -04:00
Keegan McAllister 0830799ce4 Move persistent_zephyr_id to the file where it is used
(imported from commit 1960e61b638a7c2eb832648b71d6f49f6b409b36)
2012-10-04 11:04:25 -04:00
Keegan McAllister c944c08e79 Drop JSLint directives
(imported from commit 5a091b4cb23bae5c307ad19cb772b878d605fbfe)
2012-10-04 11:04:25 -04:00
Luke Faraone 120d0aa99d Validate the register.html page.
(imported from commit 10ce8b637ae40ab733c01c2adbf6a2ad61a85d82)
2012-10-04 10:59:43 -04:00
Keegan McAllister 2f749afc8d Tweak JSLint options
(imported from commit 7e7582a48228b879ea29c2a27eb22e46e093f9dc)
2012-10-03 18:26:00 -04:00
Keegan McAllister 1cbceeec87 Fix more problems uncovered by lint
(imported from commit 7fb8432f362f22770334e6bd1161a61b0bc0e528)
2012-10-03 18:26:00 -04:00
Keegan McAllister 9c6bf90fad Misc. style fixes
(imported from commit b1f32a19a280e3efacf207bfe22bd10eb3aec537)
2012-10-03 18:26:00 -04:00
Keegan McAllister d4217b4383 Add jslint options to each file
(imported from commit f49cdbfd655d8d8fdff792f525c7abc58951dacb)
2012-10-03 18:26:00 -04:00
Keegan McAllister 8e47b33645 Move still more validation
(imported from commit a98d145168abc743888fb4a88dc00c925f138b00)
2012-10-03 18:26:00 -04:00
Keegan McAllister 2508e87d03 Fix an undefined variable
(imported from commit ed2432b4414617e97d61c84c9636e771e9c05b81)
2012-10-03 18:26:00 -04:00
Keegan McAllister 534cf77265 Simplify validation logic
(imported from commit aec56185fae88c3c51611a15fc11d44fa120951e)
2012-10-03 18:26:00 -04:00
Keegan McAllister d619618fed Move more validation
(imported from commit 62d660a3c34f4aeb170771ee85580362a2c1b8a7)
2012-10-03 18:26:00 -04:00
Keegan McAllister 0c76788ed5 Move some validation functions
(imported from commit e482108981b2b4caa6159060729766b4d224db23)
2012-10-03 18:25:59 -04:00
Keegan McAllister c2ddde2053 Move some settings stuff into ui.js
(imported from commit dea0a6fac11fb3349ac09e90c01d9313ee69c001)
2012-10-03 18:25:59 -04:00
Keegan McAllister ffff63eaad Move some subscriptions-related code
(imported from commit 49f6e525e3aa8a7a5336f713c94e81fee6546dfa)
2012-10-03 18:25:59 -04:00
Keegan McAllister 8d17de1247 Move some early setup code
(imported from commit ca57718e4a71f43bbf229d2a6e8c70174bb3583f)
2012-10-03 18:25:59 -04:00
Keegan McAllister 50d84e9ca8 Move some UI-related code
(imported from commit 28dc554ed91c14f8a8b4be282a211d3d50cf9873)
2012-10-03 18:25:59 -04:00
Keegan McAllister 37f8445318 Split more files out of zephyr.js
I would like to have split this into several commits, but it's hard to do
incrementally, because functions need to be defined before their use in global
data.

(imported from commit 31533396b236f3b657950b073982c317256f082a)
2012-10-03 18:25:59 -04:00
Keegan McAllister f2a73985c9 Fix my own variable typo (whoops)
(imported from commit d12467db2756281fe0710645825c54c269ab6781)
2012-10-03 17:39:14 -04:00
Keegan McAllister db224c1c24 Fix other problems in signup.js
(imported from commit c4562cae29a635454990f093932ff8dd9879ead3)
2012-10-03 17:34:53 -04:00
Keegan McAllister d18a79ad07 Fix wtf control flow in signup.js
(imported from commit d4cb46cda138c542884e0373b4498b4f7890ef51)
2012-10-03 17:34:53 -04:00
Keegan McAllister 5a6247288a Fix typo'd variable
(imported from commit 971e5d28cb14826b020d6e130cd62e600d88a168)
2012-10-03 17:34:53 -04:00
Luke Faraone 3a7dda5099 Replace usage of send_status.toggle() with the more clear .show()
(imported from commit 0593222b16bf845b7bcd9075d02c156a05764c12)
2012-10-03 13:56:35 -04:00
Waseem Daher 2c294694fd Restyle narrowbar to avoid wrapping.
Previously, when we narrowed on a super-long class/instance or
a huddle with lots of people, the box overflowed. This is an
attempt to fix that, even if it isn't the prettiest.

(imported from commit 4eb58726a4c4714bd5435a791ad8fea0eabb58ed)
2012-10-03 13:38:33 -04:00