Commit Graph

875 Commits

Author SHA1 Message Date
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 b07bb45e35 Fix regression focusing on content box after autocompleting a single huddle name.
There are other focus issues related to switching between a class
message and huddle during composition, but this fixes the immediate
problem.

(imported from commit ec7ebc1c68e52942e9eaa0ea61e0de2f6ccae521)
2012-10-09 18:00:08 -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
Keegan McAllister 26906777c1 Use 'reverse' when redirecting from home, for consistency
(imported from commit badd2a78cbe9d0007c7c8f515613761e68f01096)
2012-10-09 17:15:35 -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 6916d02f26 Put class/instance/huddle-recipient names in the title tag.
That way you can at least see them by hovering on them if they're
too long. (I'd probably like a better solution long-term,
but this'll do for now.)

(imported from commit 8628be101475ea72865bcaeda7d7f5cfe6453931)
2012-10-09 15:03:45 -04:00
Waseem Daher bc4a96f813 The animated composebox area must start off hidden to animate the first time.
Before this commit, the 'showing' animation works every time but the first.

(imported from commit c9d39ae46a272f35b2a2338057afac5f73beb812)
2012-10-09 14:29:06 -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 9544964277 Having tabbing from a huddle recipient focus on the content input box.
This stopped working after unifying the content boxes for streams and
huddles.

(imported from commit cd4e733ff8b3a2fe43c4551b9615ba922ff005a1)
2012-10-09 13:33:50 -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
Keegan McAllister 1fc80f40ff Log to console even when DEBUG = False
(imported from commit e9812f295ad4e861901092ad1e9f3f14b22371fa)
2012-10-09 11:41:28 -04:00
Waseem Daher c32a6a4d88 HTML cleanup since the two compose forms are now unified.
This also prevents the "bounciness" associated with the fact
that the stream/huddle selector was an absolutely positioned
div relative to the bottom of the compose window.

(imported from commit 413003a83c187efd45d0281f7cb6c9d0bd550674)
2012-10-09 11:14:21 -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 54c420a15e Make instance names lower case when mirroring zephys.
(imported from commit 7e55f2339bb242ae29a7ee4db5c5f2bd654e8f7e)
2012-10-09 10:55:42 -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
Waseem Daher 1f2c0faee4 Unnarrow when you click 'home'.
Potential downside: If you were narrowed and went to, e.g.,
settings, you would lose your place. If we wanted to be more
fancy we could have this code fire only if you were already
on the #home tab.

(imported from commit 5e8d90ba255076a11aa6f7a58c447156729ca23f)
2012-10-07 17:02:22 -04:00
Waseem Daher 10c15ba1cf Don't use <a> when you really want a button.
href="#" will cause the browser to jump to the top of the page, which
breaks everything in the scrolltheworld world, unless you suppress the
event.

(imported from commit ae03cbb9e8a82f28e8536f29485e9e947e7e76c2)
2012-10-06 22:18:35 -04:00
Keegan McAllister e1113a6d08 populate_db: Fix mit_subs_list import
(imported from commit b67abb47892d561b9e300a324528303694bcf8de)
2012-10-06 17:53:05 -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
Waseem Daher 9ecb978388 Hide the composebox's personal-message bar by default.
The form decides which fields to require based on whether
or not the personal-message bar is showing. Hide it by
default.

(Otherwise, both the 'Stream' and 'Huddle' prompts show up,
and you're obligated to fill out both of them.)

(imported from commit 13521ed5b7849f41c0335157d468f5e463c7f62d)
2012-10-05 19:05:14 -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 367feda747 check-all: add new viewport globals.
(imported from commit e163dc07ad196ffd2731f7ccc67bfaada8e8580a)
2012-10-05 16:29:59 -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
Waseem Daher 6de37bc9ad Break long words in a messagebox.
(It's not totally beautiful, though, in that it causes
your timestamp to appear in a weird place, but it's
better than the alternative.)

(imported from commit 217b6545330f7850f2892df2e82df18976463361)
2012-10-05 15:57:59 -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 d9f03d9842 Import xdate javascript library.
(imported from commit 6a9344a07672c377f38d29f6d8a5d866684c8456)
2012-10-05 15:42:54 -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