Commit Graph

1232 Commits

Author SHA1 Message Date
Waseem Daher 22ce2c04e3 [third] Bootstrap bug fixup - dropdowns not closing on fix
Some time between the 2.0.4 and the 2.1.0 upgrade, Bootstrap broke in
a way such that clicking on a dropdown did not cause it to close.

Here's the bug thread about it:
https://github.com/twitter/bootstrap/issues/4497

I've implemented this workaround discussed there, though the bug is
fixed in 2.1.1, so when we upgrade this will go away (which is why I
only reluctantly tag it 'third', since the diff will not need to be
carried forward.)

(imported from commit f8d9cf65b33306a426d864c9b503bb3446614111)
2013-01-22 17:18:49 -05:00
Jeff Arnold fc0b7c00f1 Improve selecting, copying, and pasting multiple messages
Addresses Trac #289

(imported from commit 53078abc23f4939b3f5ffba084f16c340e4928c5)
2013-01-21 21:30:43 -05:00
Jeff Arnold bb19978397 Reset the new message count whenever the user mouses over the window
(imported from commit 5813398dbc59acc9f9e53c1e0631fc7d327de50d)
2013-01-21 15:54:02 -05:00
Jeff Arnold 621dbcaac0 Firefox on Ubuntu claims falsely to be able to do webkit notifications
(imported from commit d4778f38eaefc4fe95d93c6f3dcb5e43bbef5bb2)
2013-01-21 15:53:52 -05:00
Jeff Arnold 360737d928 Fix lowercasing issue with notifications for people with same name
(imported from commit 7f9c6f040c428af2c53929e4251861dea9361f2f)
2013-01-18 18:02:14 -05:00
Jeff Arnold 5b9cb1ebcd Fix notifications for users whose username is their first or last name
(imported from commit 66a58e81571f4eed3c840950bde63ef245ca4d48)
2013-01-18 17:02:17 -05:00
Reid Barton 07edc87cb9 Fix subscribe-and-send
When not in lurk mode, lurk_stream is undefined which caused
lurk_stream.toLowerCase() to fail.

(imported from commit 63ce79083b55a37cb0455871237a76d724fbbbea)
2013-01-17 15:37:36 -05:00
Zev Benjamin 747df69de1 Show a loading indicator while the subscriber list is loading
(imported from commit 83c6d64f665e82d1cff6e9654342d2a6c4bf6f36)
2013-01-17 14:19:37 -05:00
Zev Benjamin 661632673b Show a loading indicator on the subscriptions page
(imported from commit f5c4847e016921827354df09a544d98ceef16bee)
2013-01-17 14:19:37 -05:00
Zev Benjamin 4637b20f43 Set up the subscriptions page when the page is shown instead of when its about to be shown
This is needed for the next commit so that the loading indicator is
created while its associated div is visible.

(imported from commit 72d6ccc14158b49e0ea640ab818114869aa548bf)
2013-01-17 14:19:37 -05:00
Zev Benjamin 1b58e6eb9c Hide loading indicators when they're destroyed
(imported from commit e83204771b4ac7c0f0a7b19b6c306440d5cedabb)
2013-01-17 14:19:37 -05:00
Reid Barton 3e928cec48 Simplify navbar at phone size in lurk mode
(imported from commit b4e7336174d4cde4947c96fa82473c311c6ed2b5)
2013-01-17 12:17:06 -05:00
Reid Barton 8c90808491 Reduce some horizontal padding/margins in skinny windows
(imported from commit 47e2cc9a035acdfbc2e475bf770f15f90d896ac0)
2013-01-17 11:02:32 -05:00
Reid Barton ef8c7d78ac Keep the search box from overflowing in skinny windows
A hack, but better than the status quo.

(imported from commit 3a523904ffee7b2c64e5fc118eeb8e2f7575541c)
2013-01-17 11:02:32 -05:00
Reid Barton 949dcbfbc7 Fix inverted logic for autofocus field in set_mode
This meant that the "New stream message" button would focus the wrong
text field.

(imported from commit 5e34f0fb936b94b8c1515e915e8059d19feba45e)
2013-01-16 16:04:17 -05:00
Zev Benjamin 93c706a610 Fix subscriptions page for MIT users
Prior to this commit, they weren't able to subscribe or unsubscribe
from streams or change stream colors.

(imported from commit 7f690c724bec3e7e6ba3b45ac7b41d1f7296b6f1)
2013-01-16 15:00:35 -05:00
Zev Benjamin e6c5b309ce Use consistent terminology for loading indicators and spinners
(imported from commit 54d14c7176e8feb125de253d1bf6205013d53760)
2013-01-16 14:45:23 -05:00
Zev Benjamin 9d27878abf Destroy spinners with a new abstraction instead of hiding them
If you create a spinner in a hidden element and then show the
element, the spinner is placed differently than if you had created
the spinner while the element was visible.  This commit makes it so
that we never create spinners while their parent is hidden.

(imported from commit a21e68976d70fcceece30ee35f5e7cf6f9490497)
2013-01-16 14:45:23 -05:00
Zev Benjamin 5e76815c43 Use not-tables for loading indicators
(imported from commit 37a18feea4366e66d4e0a42d8f66edc55928c5f7)
2013-01-16 14:45:23 -05:00
Zev Benjamin beea0f747e Rename loading_{indicator,spinner} to page_loading_{indicator,spinner}
(imported from commit e1222569f62ac693d45d2f057ef6b05c883c900e)
2013-01-16 14:45:23 -05:00
Zev Benjamin 1b1d5ff92a Use a helper function to create spinners
This allows us to use a uniform style across all our spinners.  It
also cuts down on boilerplate HTML.

(imported from commit 9879f38e0f1ca8edd40a937753811e329447262d)
2013-01-16 14:45:23 -05:00
Zev Benjamin 03adc138c5 Remove dead CSS
(imported from commit fcabfeca475be71c19e326f938e4112bd71794b9)
2013-01-16 14:45:23 -05:00
Reid Barton 2797a41fd8 Automatically subscribe on send when lurking
(imported from commit 636c07346e766615a0012e4532f35d328bb7984d)
2013-01-16 14:19:06 -05:00
Reid Barton 64ebbc6c73 Restrict lurk mode compose box stream to the lurk stream
(imported from commit f187f619fc77645a294ab4cb90baf802f55d3326)
2013-01-16 14:19:06 -05:00
Reid Barton 169fb36674 Don't move the pointer when in lurk mode
(imported from commit 6acda4b6d924d605e8ade945e1e4f10ce1e2864e)
2013-01-16 14:19:06 -05:00
Reid Barton 9e23907259 Add "Lurk" mode
/?lurk=foo will show all messages to the stream "foo", regardless of
whether you're subscribed.

(imported from commit 049d98b3ee8df19ef0a9dc392ae941dd463f8dd5)
2013-01-16 14:19:06 -05:00
Zev Benjamin 14cccd9787 Be more robust when creating names for the subscriber lists
(imported from commit fca2c0f2d9dcee4830394c9be5b08ce81379e4a6)
2013-01-15 17:40:30 -05:00
Keegan McAllister a15a1702e1 search: Only highlight actual message or recipient header text
Before, a whitespace-only search would "highlight" the pointer and all kinds of
other interstitial space, which totally broke the page layout.

Fixes #408.

(imported from commit e7e0e251551a9da5a2ea53e36b9cce16e3e30634)
2013-01-15 17:28:07 -05:00
Waseem Daher 7a6068c3ad Colorize the stream bar in the composebox based on where we're writing.
(imported from commit 8e9bddf465661826d63fe0f79e3f1bd6b903cf4d)
2013-01-15 17:22:47 -05:00
Zev Benjamin 0e2401199a Show full names in stream subscriber lists
(imported from commit 6be00256da74db6af9a6dd14e70929679c19db52)
2013-01-15 17:02:39 -05:00
Zev Benjamin cb8c67b325 Keep a dictionary of user email address to person object
(imported from commit 16d63fefff3bda33cfc2f90398539b5e2d9bb499)
2013-01-15 17:02:39 -05:00
Zev Benjamin 26f38065cd Insert text for the subscriber lists into the DOM as text nodes
This effectively escapes the names.

(imported from commit 68cfdaba2376a8863baf7e7325c4d8a77273de7f)
2013-01-15 17:02:39 -05:00
Zev Benjamin 17e92ebe13 Sort the subscription member lists
(imported from commit 54457c2cbe971cd8f29f0d682890c18f9ca05bd5)
2013-01-15 17:02:39 -05:00
Zev Benjamin 1d4a34aeba Clean up stream subscribe/unsubscribe button code
(imported from commit ac8fc7058534aaa3fdcb161c2aead4cc397980cf)
2013-01-15 17:02:39 -05:00
Zev Benjamin 97e7cae796 Rename subs.fetch -> subs.setup_page
(imported from commit 385ff00cc5ebaafe9127974471ed2d55f0cdf546)
2013-01-15 17:02:39 -05:00
Zev Benjamin 717513cc07 Only draw a color picker when it is shown
(imported from commit 3ad2f3dbc753a1e04429ac365aa1c9d244742cbc)
2013-01-15 17:02:39 -05:00
Zev Benjamin 3442ac05b8 Be more clever about whitespace in typeahead for adding subscribers
* Ignore beginning and ending whitespace when submitting the form
* Ignore beginning and ending whitespace when doing autocomplete
* Don't autocomplete on just whitespace

(imported from commit b3231e08f6797a38bafbcef2e694f4bae059c20f)
2013-01-15 17:02:39 -05:00
Zev Benjamin cd60f18752 Add typeahead to 'add subscriber' input box
(imported from commit 49e9a75d3153e1ac97e924a1bdc971df46d6bc10)
2013-01-15 17:02:39 -05:00
Zev Benjamin 5ffc646972 Add control to subscriptions settings to add other users to streams
(imported from commit c013c41f288b438e7462f8024b6c1c6e817e06ee)
2013-01-15 17:02:39 -05:00
Zev Benjamin 4191d2f024 Use a span instead of headings for subscription setting titles
(imported from commit 0453417affe440d411dc018c92c9a41b89b99cd9)
2013-01-15 17:02:39 -05:00
Zev Benjamin 82ac1fb317 Don't render the subscribers list for the mit.edu realm
(imported from commit 0577cfd644b55982e8fa0e7bb18cca3f883f8c1f)
2013-01-15 17:02:38 -05:00
Zev Benjamin 67511e2ac6 Show the list of subscribers for each stream on the subscriptions page
(imported from commit 1d092f8ad36d48e1f83df185c2b4f2a9667d4943)
2013-01-15 17:02:38 -05:00
Zev Benjamin f5e25d2e64 Clear removed_streams when we repopulate the subscriptions table
(imported from commit e9f90425b097f54188e4085828a3fed4c4885954)
2013-01-15 17:02:38 -05:00
Zev Benjamin a1b017eea6 Fetch subs when the subscription page is shown, not when the button is clicked
Fixes #643

(imported from commit c28103c6ec787d1cafa9c845d3b6a771f3c12c05)
2013-01-15 17:02:38 -05:00
Zev Benjamin 3a127871f0 Move search element event handler binding to ui.js
This is hopefully a fix for #679

(imported from commit cd82f763d904fd5dbed366e56aca664a1b75c496)
2013-01-15 14:19:32 -05:00
Waseem Daher f4d5186541 Rearrange keyboard shortcuts dialog so it all fits on one screen.
So that it is, in fact, navigable via keyboard shortcut.  It's not the
most beautiful way to do this; in the ideal world the layout would be
more properly responsive and could fill up the screen for you when you
have the room for it.

The issue is that the version of Bootstrap we're running doesn't
easily allow for variable-sized modals, and the hassle of showing
and hiding a div manually didn't seem worth it.

The pixel sizes are specified manually as well, in a way that
isn't particularly responsive, because of a few competing
desires:
1) For them to appear side-by-side when wide enough
2) For them to stack when not wide enough
3) The fact that they're awkwardly between a span2 and a span3,
   so we can't just use the Bootstrap responsive layout stuff

Finally, the diff here is best viewed with -w. (I also swapped the
order of Narrowing and Navigation, which unfortunately clutters the
diff.)

(imported from commit 62cfa7959d48ce515562713eb48f9d9b33c8cc16)
2013-01-14 17:37:17 -05:00
Jeff Arnold 030fbbccad Autocomplete @names in the compose box
(imported from commit a6df85d4dbeaecaceaa4ed76d1adff4a000392c5)
2013-01-14 13:27:20 -05:00
Waseem Daher 5a77e16fbe Pad out the bottom of the composebox in a symmetrical way.
(imported from commit f0db908755417c6f032b2c02e710fef04032c343)
2013-01-14 13:00:43 -05:00
Waseem Daher 7e9242c796 Reminder of tab-enter to send.
I'd like to phase this out in favor of something you actually
see only when you don't use Tab-Enter, but that's more challenging
than I'm prepared to tackle right this second.

(imported from commit eeda53b0ed69d0e528b00ea9e7c7a20edb35df34)
2013-01-14 13:00:43 -05:00
Waseem Daher b464896fda Decrease composebox typeahead suggestion count to 2.
Now that the box is shorter, we don't have room for more!

(imported from commit 7fd06120df095d46ee087a59f20b745fdd483ca7)
2013-01-14 13:00:43 -05:00
Waseem Daher 5b473a18c3 Have the "New stream/new PM" buttons no longer clear message contents.
If you're currently composing a message and you click one of those, it
now no longer clears out your old message contents, making it more
analogous to the job the old selector used to play.

(imported from commit b935a3bf307bdbd82f1ee7db31d3a3c89c623195)
2013-01-14 13:00:43 -05:00
Waseem Daher bfa1e98e35 Eliminate the stream-or-PM selector.
(imported from commit eda85e19ac6c4557dde14a51f58f1f9a14fc7ab9)
2013-01-14 13:00:43 -05:00
Waseem Daher b25380c8b6 More compact composebox.
Accomplished by:
- Hiding the stream/PM selector
- Eliminating the "tab to send" reminder
- Moving send and formatting links to the right
- Reducing the size of the 'subject' box
- Generally tightening up whitespace

To be fixed later in this series:
- A Tab-Enter reminder
- Completely eliminating the stream/PM selector

(imported from commit 7efe04adcbe373f99a36d3ba23b32944c17aa099)
2013-01-14 13:00:43 -05:00
Reid Barton 904f55a08e Don't show sender email in skinny windows
It can easily cost an entire line, and the information is available by
clicking on the sender's name.  Plus on a phone, you can't hover
anyways.

Annoyingly, this tends to put the popover partly off the window, but
there must be a way to fix that separately.

(imported from commit 19334cb067981b323e300245654c83c8e545fb2e)
2013-01-14 10:39:20 -05:00
Reid Barton 389a52de6e Fix test for adding to top or bottom of zhome/zfilt
It's possible for selected_message_id to not exist in zhome. For
instance, when you open the page to a narrowed URL, there is a race
between loading the narrowed messages and loading all your
messages. If the narrowed message request completes first, it will
update selected_message_id to your initial_pointer if the latter
happens to be among the narrowed messages. Even if it is not, you can
select a message by clicking on it before the zhome request finishes.

Then the old code would never add that selected_message_id to the
zhome table, so it wouldn't show up in the Home view or if you
re-narrowed.

I'm pretty sure there are still cases where the selected_message_id
might be outside the range of messages in zhome, in which case adding
to zhome might put old messages at the bottom. I observed this twice
on staging but was unable to reproduce it consistently.

(imported from commit 162feff3090f8806cc67140db0cfabb6e965aece)
2013-01-14 10:33:51 -05:00
Waseem Daher d9e50117be Frontend for invitations.
(imported from commit 8afab7cc5a4a5c14b605f1b27b48036c9414f7d0)
2013-01-14 10:25:26 -05:00
Jessica McKellar 163003b4c1 Lighten the message highlight colors.
(imported from commit c2fc2859efca3ee2ebda5f4ee7c5c02c4a3b6719)
2013-01-11 21:19:16 -05:00
Jeff Arnold 3c8b30d043 Revert "Autocomplete @names in the compose box"
This reverts commit d60d1693e77bdd045a1bd20491c6d6efed918b39.

(imported from commit 796036e146eaf917b74dc0bac01e92aa6a682d16)
2013-01-11 13:49:23 -05:00
Jeff Arnold 09a6dc6c42 Autocomplete @names in the compose box
(imported from commit d60d1693e77bdd045a1bd20491c6d6efed918b39)
2013-01-11 13:00:34 -05:00
Jeff Arnold 279ded6072 Notify when we see our username or our name plus punctuation
(imported from commit 158c78de264ef31f61670694764d025a773ae840)
2013-01-11 13:00:34 -05:00
Waseem Daher e3e8d9b939 Revert recent set of floating_recipient_bar changes.
We suspect that these seem to be causing a regression where scrolling
in narrowed views gets really sluggish, but we haven't totally been
able to figure out why since it's challenging to reproduce locally.
(It currently manifests itself on staging but not prod.)

So for now we'll back them out. Here's the full set of things:
Revert "Cause update_floating_recipient_bar to get called less frequently."
This reverts commit a6c1518c4001a2dde44d7b512236795da3ccd351.

Revert "Remove double-scroll in un-narrowing code."
This reverts commit 3dde6c27ffa1e8afa1a084b1b2baee3bc0512962.

Revert "Reset our scroll position if we change our hash to "#"."
This reverts commit 925b44d770c96dafaabebc9e0114f9a3b8f53c4d.

Revert "Properly update floating subject bar when you are at top of page."
This reverts commit 6633cc8a81aedcbb31b30d7c1f27816f8808c700.

(imported from commit a273730581cef30c33bedf701659ee084434f8ad)
2013-01-11 10:58:04 -05:00
Waseem Daher 66af2da9ed Cause update_floating_recipient_bar to get called less frequently.
Putting update_floating_recipient_bar in the old location caused it to
be called on every single keypress, which is unnecessarily
expensive. Instead, just call it once when we think we might actually
need it: after initiating a narrow.

(imported from commit a6c1518c4001a2dde44d7b512236795da3ccd351)
2013-01-10 14:19:29 -05:00
Jeff Arnold 97e8fb893b Fire a notification for an @name match anywhere in the msg content
(imported from commit 1b6932b1b1094af6f0de2346ca721805e264490d)
2013-01-10 13:44:06 -05:00
Jessica McKellar 1f4f058837 Subtly highlight the selected message content.
Watching new users, I've seen them not notice the pointer and
mix. Give them a little more hinting about what message is selected.

(imported from commit c98e22dcef881ed7400071ec438a6e91d6cd3d9e)
2013-01-10 11:54:15 -05:00
Waseem Daher 7796940c72 Remove double-scroll in un-narrowing code.
select_message_by_id with then_scroll: true already recenter_views
on the selected message; no need to also call scroll_to_selected.

(imported from commit 3dde6c27ffa1e8afa1a084b1b2baee3bc0512962)
2013-01-10 11:38:50 -05:00
Waseem Daher a9112155da Reset our scroll position if we change our hash to "#".
Changing the hash to "#" causes Chrome to jump to the top of the page
on Mac OS X. This commit doesn't actually fix any bug, but it
is necessary for my *next* commit, where otherwise you'd have to
ensure that the scroll code came *after* the hashchange code.

(imported from commit 925b44d770c96dafaabebc9e0114f9a3b8f53c4d)
2013-01-10 11:37:44 -05:00
Waseem Daher 1141bfa888 Properly update floating subject bar when you are at top of page.
There's this very edge-case issue which is: if you go to the top of
the page and narrow to something other than the top message, the
floating subject bar does not update.

Why? Well, the way that the narrowing code works is that it sets up
narrowing and then calls
  select_message_by_id(target_id, {then_scroll: true});
so that our selected message is in the view.

This in turn calls select_message, which calls recenter_view as
appropriate. This usually causes a scroll action, which in turn causes
the floating recipient bar to be updated.

But when we're at the top of the page, recenter_view doesn't need
to scroll at all! So the bar remains un-updated. Here we explicitly
update it to guard against that case.

This fixes Trac #651.

(imported from commit 6633cc8a81aedcbb31b30d7c1f27816f8808c700)
2013-01-10 10:59:03 -05:00
Jeff Arnold 5d5c490613 Disable speaking-at-me notifications for mit.edu
(imported from commit 194c5241311b46f26ecb0b2bb2201b1a7af7b520)
2013-01-09 23:05:02 -05:00
Waseem Daher c206930711 Fade in when you narrow, in an attempt to make it more visually obvious.
I don't view this as a complete solution to
Trac #466 - Make the fact that you are narrowed more apparent,
but it's a start.

(I think a real solution would have to give you something that
helps you make the determination of "Is this view narrowed?"
when you come back to your computer, and this animation does not
help you do that.)

(imported from commit eb3646f3f3a4e25a43266e9146308633fd997eb2)
2013-01-09 21:46:08 -05:00
Waseem Daher 9fb6edfb96 Rearrange code for clarity.
This commit just moves around some lines so that the code that
hides the main view and shows the filtered view, or vice versa,
are together so that it's easier to reason about the sequence
of things that's happening.

(imported from commit 7e99f45293c0e1a4cdfa1a08f41f8c770c370d6c)
2013-01-09 21:46:08 -05:00
Waseem Daher a629f7edf6 Remove dead reference to 'show_all_messages'.
This used to be a button that let us un-narrow, I guess.
A git grep for it after this commit turns up no actual
references to it.

(imported from commit 05acb4bb40da1b032f548c511fbae5b2b20874a8)
2013-01-09 21:46:08 -05:00
Waseem Daher 3a585505a4 Remove the narrow-view 'shadow' pointer.
And change the color to a more thematically appropriate blue.

The shadow pointer is sort of confusing; we should really provide some
different sort of indication that your pointer is potentially moving
on narrow-and-unnarrow. (I think my fade-in-fade-out later in this
commit series is a not-bad first crack at this.)

Resolves Trac #472 - Dual pointers in narrowed view can be confusing

(imported from commit 2450517d99de85ade1c0e98c5510b59e70282451)
2013-01-09 21:46:08 -05:00
Jeff Arnold 7709e21a24 Notify the user when someone is speaking at them
(imported from commit 662ea67b2cf210bfd327ae2db6f924e4424d6d50)
2013-01-09 20:18:39 -05:00
Waseem Daher 10db1b30f1 Use cached selector for $(window).
Mostly for consistency with the rest of the code around here.

(imported from commit 87539fea96286e1563624efd2a4800df88f2199c)
2013-01-09 15:30:48 -05:00
Waseem Daher 96e66d4c5f Always make sure main_div stretches to the bottom of the page.
If you narrow to a view that only has one or two message, sometimes
the grey box gets cut off and doesn't go to the bottom of the
page. This fixes that.

(imported from commit 55724d03aa30922d91bd33fab4447d889be78889)
2013-01-09 15:30:48 -05:00
Waseem Daher fad7d0a7cb Always show the floating recipient bar.
The initial rationale for hiding the floating recipient bar
was that it duplicated information that was in the "narrowbar".
Now that this no longer exists, let's *always* show the
floating recipient bar.

(Yes, there is some duplication of this information in the
search area, but I think the situation is fundamentally
different now and would basically like to see it everywhere.)

(imported from commit 6fd4506c2f48caade9496139e580e6550252ce8c)
2013-01-08 16:43:50 -05:00
Keegan McAllister 83a0d82d8f Don't retry or display connection error if we send bad narrow operators
Alternatively the server could return a successful result with an empty list of
messages.  But I prefer the solution in this commit, because it would allow us
in the future to warn the user about the problem.  It does allow users to
determine if a given stream exists, but we haven't tried to hide that
information so far.

(imported from commit a91e12c90b12d3c870c0b637c3f1d6d3cef88491)
2013-01-08 12:18:31 -05:00
Keegan McAllister 952296bb3d Hide search.update_button_visibility focus override argument from exports
(imported from commit 98201f7c833f9fc4a1c1d6ecdff033e08c28dd5c)
2013-01-08 12:18:31 -05:00
Keegan McAllister 6dea25fd9f Add narrow.by for syntactic convenience
(imported from commit 51300b93a078d54e5111e6bb16ecd9ecbcc295d2)
2013-01-08 12:18:31 -05:00
Keegan McAllister 3af2bf345a Reinstate server-side narrow filtering
(imported from commit 40f63324a8dff404b504b06bddf303b8c1ad5780)
2013-01-08 12:18:31 -05:00
Keegan McAllister 3455e37160 Get rid of is:pm alias for is:private-message
It's cleaner if the filtering code recognizes only one value.
We can add this back in by converting in the parser.

(imported from commit 453b7b01e094955c6d66be63b5d997cc56b50a35)
2013-01-08 12:18:31 -05:00
Keegan McAllister dbc4798594 Be consistent about when we display search buttons
Show the buttons iff

    - the search input is focused,
    - the search input has non-empty contents, or
    - we are narrowed.

(imported from commit f5c98471a2db4ab522160960dd1271471a9db555)
2013-01-08 12:18:31 -05:00
Keegan McAllister 60f2d06736 search: Factor out show_buttons / hide_buttons
(imported from commit 776f066129e8cf4e298ae90fdd4f62341b36dcae)
2013-01-08 12:18:30 -05:00
Keegan McAllister f3e4b3bc31 search: Simplify event handler setup
(imported from commit b14c4bafb09fa5919e03aac24e968329778a01d6)
2013-01-08 12:18:30 -05:00
Keegan McAllister ddf75b64f7 Un-narrow whenever we clear the search box
(imported from commit 15533579bfbae1644cc76b33348c3cd21a829713)
2013-01-08 12:18:30 -05:00
Keegan McAllister 4ddaf5a2ae Use case-insensitive matching for all narrow operators
We don't require that the parsed form be lower case; that's handled by
narrow.activate.  However we unparse as lower case, in order to give the user a
hint that matching is not case sensitive.

(imported from commit 2882b440deb59a049b095db7a13cfc18e047caec)
2013-01-08 12:18:30 -05:00
Keegan McAllister 3619480673 Handle narrowing operators typed into the search box
(imported from commit 6f758091e2953d00d6a331210aa774b72ba889d5)
2013-01-08 12:18:30 -05:00
Keegan McAllister d2705ab913 Add narrow.describe
(imported from commit df123384754701108fe7597710cb0cf46cb86caf)
2013-01-08 12:18:30 -05:00
Keegan McAllister 6d50e233ec Add narrow.parse
(imported from commit 2275d02c2aee411d07645f7c3d81fdff7d188607)
2013-01-08 12:18:30 -05:00
Keegan McAllister 121ba29abe Simplify searchbox_sorter
(imported from commit cce3d2fd2e56801b43c668c849ef4664edc32a6c)
2013-01-08 12:18:30 -05:00
Keegan McAllister 1fcc7a6185 Rework render_object_in_parts to use switch/case
And rename fields for conciseness.

(imported from commit 77d89085f0786ecdcbb2897e3d171c930b44137a)
2013-01-08 12:18:30 -05:00
Keegan McAllister e202638184 Rework narrow_or_search_for_term to use switch/case
(imported from commit a1296e79d9f6414113a475e407fbaccb54eadb14)
2013-01-08 12:18:30 -05:00
Keegan McAllister 5ee6a9ebca Rename narrow.show_all_messages to narrow.deactivate
(imported from commit 927374756e112abc1042b16caa315af8c1f0baec)
2013-01-08 12:18:29 -05:00
Keegan McAllister ba7ffcead4 narrow: Remove some unnecessary helpers
(imported from commit 307dfec262648bc1fc79d2fb46f8950c7a2f1e2e)
2013-01-08 12:18:29 -05:00
Keegan McAllister 3c9b9227f8 Get rid of the narrowbar
(imported from commit 53335b8177561d4b103659a51704d6b2ce7ec367)
2013-01-08 12:18:29 -05:00
Keegan McAllister d4d4ea7a8d Display narrowing operators in the search bar
(imported from commit d801128c5b961360939c9e3f3f6f89c8602f987b)
2013-01-08 12:18:29 -05:00
Keegan McAllister 38ff2d9993 Use operators to express narrowing internally
This breaks server-side filtering, for the time being.

(imported from commit 58ec2d7aa593e1c71f835b186535a038faa63239)
2013-01-08 12:18:29 -05:00
Jeff Arnold 78506acd20 Do not send the browser back on backspace when send button focused
Fixes Trac #585

(imported from commit 2b5a02db66cc09ae41da7e6921a31a14c49cf811)
2013-01-08 12:00:57 -05:00
Reid Barton e5ab18276e Move sender gravatar inline in skinny windows
(imported from commit 570c1f6409213fd8a2b6dbb98372dbf2f62ec50c)
2013-01-08 11:28:49 -05:00
Reid Barton c5b4461ac6 Fix outdated comment in CSS
(imported from commit 198e3449b5396f6698b4fb7292ee4921ed326f18)
2013-01-08 11:28:49 -05:00
Jeff Arnold dbb63cb524 Don't continuously bug user if they dismiss the notifications box
Fixes Trac #514

(imported from commit 445af7cf458118be0394491aebbd9996817b08a4)
2013-01-08 11:04:16 -05:00
Waseem Daher 40a8ee48a5 Make stream_list only contain lowercase stream names.
(imported from commit 350f1b20987206c1e910fcc5c2926bd6e96baaeb)
2013-01-07 17:36:37 -05:00
Waseem Daher baba72e3b8 Cause case to be respected when adding a subscription.
And have its colorpicker work.

(imported from commit 998c54153518bb94b7ce41e073078675767694c0)
2013-01-07 17:36:03 -05:00
Waseem Daher 5501558fa7 Only request background color for stream messages.
subs.get_color is expecting a string, and so if you do this on
a PM, it breaks.

(imported from commit acf6d51b84d7bbbe643466f1f72f90a8f6cf16f6)
2013-01-07 17:34:27 -05:00
Tyler Hallada b6e1024b69 Display composebox again upon server errors
Also removed .show()s for the alert on does-not-exist and not-subscribed, where
a blank error would display. This should fix the underlying issue with #166:
that hiding the composebox before send_message() was called would hide server
errors.

(imported from commit a8a50cdf82ddf1d15f1e405432ff3bbfdb7a491a)
2013-01-07 17:03:34 -05:00
Zev Benjamin 9b3e4a8bed Don't focus the new stream box after sucessfully subscribing or unsubscribing
If you have a lot of subscriptions that you're trying to modify,
jumping back up to the top of the page is very disruptive.  We still
show the success message, which has the effect of scrolling the page
and is thus surprising, but that's better than the user completely
losing their place.

We do need a story for informing users about failures to subscribe or
unsubscribe, though.  We currently jump back to the top so they can
see the error, but that's not optimal.

(imported from commit 48d938ddc47f286a72e2147f4459b91ca5684e36)
2013-01-07 13:48:19 -05:00
Zev Benjamin 42bf93fb07 Add expandable settings panel for subscription entries
(imported from commit 3c07dcac7ec8086d417c2898a307ee67fc286704)
2013-01-07 13:48:19 -05:00
Zev Benjamin e1a3765644 Give each subscription an id for easier DOM manipulation
(imported from commit 976744174d06abf8bde651ca815d8fe17b8e64ff)
2013-01-07 13:48:19 -05:00
Zev Benjamin 2b4b827715 Fix repeatedly clicking the subscribe/unsubscribe button
(imported from commit e85f2678a4ca896e5a9bd40d37c3713153825c4d)
2013-01-04 18:11:07 -05:00
Zev Benjamin aad09fc267 Merge stream_set and stream_color into a single data structure
(imported from commit 88324e0d296f192feac4f5ecf45f347712cc5914)
2013-01-04 18:11:07 -05:00
Waseem Daher bcbfa30deb Revert bottom_whitespace to 300px by default.
For whatever reason, specifying a percentage for bottom_whitespace
seems to cause issues in some browsers, including Firefox 17
and the Firefox Nightlies.

This is a bit confusing to me, since bottom_whitespace is basically
immediately resized by resizehandler initially anyway. But hey.

(imported from commit 93da101edeb6f16b01a92aed775e9117c0295086)
2012-12-28 15:39:42 -05:00
Jeff Arnold ff57c9af59 Immediately load_old_messages when the user arrives via a #narrow URL
(imported from commit 9705cbb70f9ce62ea5e362212ac91daf1b97ff13)
2012-12-21 12:13:42 -05:00
Jeff Arnold 8b56de22e0 Make #narrowing to a stream with no recent messages not error
(imported from commit b8f0ff9b81876927a59139385d52a9ace96f7559)
2012-12-21 12:12:08 -05:00
Tyler Hallada a3ccfdc78f Set bottom_whitespace height on resize with js
CSS height percentage was not working because parent div has an undefined
height, so instead it is set to 40% of the window height on resize (and initial
load) via JavaScript.

Fixes trac ticket #24.

(imported from commit 2c6a8489585c4bf70c44469ce8628264ec3fbc36)
2012-12-20 22:41:47 -05:00
Jeff Arnold 4feae6b202 Make the back button work for the settings and subscriptions pages
(imported from commit 650c884abc9514cdfc934ae01e0a490f5f681292)
2012-12-20 14:45:11 -05:00
Jeff Arnold f4ddf4412b Make it possible to paste a #narrow URL into a new tab
(imported from commit 0a2ac3e7100627fd02874b02c1b5abe6d4b58c77)
2012-12-20 14:45:11 -05:00
Tyler Hallada d179de07f6 Clear the composebox on open instead of close
Variables like stream, subject, and message were getting cleared from the DOM
when the compose box was closed. The "Create and send" button was trying to
access these variables to create a new stream, but they were gone. Now they
are cleared when a new compose is started.

Fixes trac ticket #568.

(imported from commit 39ccaaeacb3f92f4b1d771be1b34ff660e0d5883)
2012-12-19 15:07:04 -05:00
Jeff Arnold db6f03d46d Make the back button work when narrowed
(imported from commit be922b06e7b53ec21751e67a490bb518333c3e6c)
2012-12-19 14:46:31 -05:00
Waseem Daher e0b8f4d3aa Make favicon have transparent background.
(imported from commit 841b1a21b2b4f01f298f0ceb099cf885f30d17b8)
2012-12-18 16:24:00 -05:00
Zev Benjamin a92a35906c Reset favicon after setting window.location.hash
Firefox drops the favicon after modifying window.location.hash, so we
reset it after modifying it.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=408415 and
https://bugzilla.mozilla.org/show_bug.cgi?id=519028

This fixes #422

(imported from commit 3d7ac5ba28a4fa94d2bd9a0f711db8cd538039d3)
2012-12-17 20:55:47 -05:00
Zev Benjamin 989cee3194 Only set the hash portion of the URL for future-proofing
(imported from commit b860e6c5dde0a75c54678d6a6798611497c1db39)
2012-12-17 20:54:32 -05:00
Tim Abbott 0dda71fb54 Fix website improperly submitting a last value of -1.
We were submitting a 'last' value of -1 to the server at startup,
which is invalid but normally ended up being OK because the user
usually had no messages whatsoever or had last be updated via
get_old_messages before the get_updates call went through.

(imported from commit df55ac1cdac443721c06ebed94a1c4b3ec7af2d1)
2012-12-14 17:15:32 -05:00
Keegan McAllister 197d0dcc01 Revert "Pause for 25 ms in between successful get_updates calls"
This was not totally effective, and with the previous commit it is no longer
needed.

This reverts commit e86c0b653669cf86b0d8956c2c85eb7610fc342f.

(imported from commit 0de5bfec87147b1336f6f79c33d4e32493e1e508)
2012-12-14 16:22:42 -05:00
Keegan McAllister 44b9925bfc Configure get_updates timeout in settings.py
(imported from commit 2a647bdd73c43ca5fed704925808efafc70da044)
2012-12-14 16:22:42 -05:00
Waseem Daher 7de057dcb0 Remove unescaped use of stream name in subscriptions page.
This was causing issues with our ability to unsubscribe from
streams with " in their names.

The solution here is a bit hacky, since it depends on the JavaScript
being fairly aware of the layout of the DOM, which is not great.
But it works.

This fixes Trac #328.

(imported from commit a1b6c8e1f3a9daacdc48920a195717aa89b3a9a9)
2012-12-13 15:46:30 -05:00
Waseem Daher 858d638960 Make subscriptions page slightly more robust to weird characters.
This fixes Trac #522, which previously prevented you from
subscribing to a stream named
    '"]'); alert('hi');

This does not fix #328, which is that you can't unsubscribe
from 'Waseem', among other things.

(imported from commit 869063cafa9e7e988aea993d072ca1ad880bcee1)
2012-12-13 15:46:30 -05:00
Waseem Daher 622bcb9ef4 Call the colorpicker drawing code just once, rather than in a tight loop.
Unfortunately, this doesn't actually give us much performance gain
either; it's not really the calls to 'find' that are taking any time.
But I do find this a little cleaner as well.

Simply initializing 100 colorpickers with our options takes about 700ms.
Initializing ~100 colorpickers with the total default set of options
shaves that down to about 300-400ms (though obviously doesn't quite
achieve what we want).

(imported from commit 7084b35fb6e77600edfcdcfcc2761a11e6f38c03)
2012-12-13 15:46:30 -05:00
Waseem Daher cd237c3429 Smarter template invocation on settings page.
Rather than calling the template generating code once per
subscription, let's just do it in a batch when possible.

With about 100 subscriptions, the "fetch" call takes about 800ms to
render (while testing locally) both before and after this change,
which is somewhat disappointing.

But this *is* cleaner!

(imported from commit 9ba8819524da86c00a2508349be0ea0ddd48606b)
2012-12-13 15:46:30 -05:00
Zev Benjamin 695d9a4dc6 Change get_updates_params.reload_pending to reload.is_pending() as the former no longer exists
(imported from commit fdc59a27230cb49adee2f5444e440aaa84103e5e)
2012-12-11 16:40:26 -05:00
Waseem Daher d04758f5f1 Don't make it seem like the composebox messagebox is clickable.
(imported from commit cd5840b42c11e69e87fa51085f152a193ec8aebd)
2012-12-07 15:57:35 -05:00
Waseem Daher 4397400ab4 An ugly reminder of the shortcut for sending messages.
Hopefully this will make things slightly more discoverable;
the previous solution (putting a prompt in the initial text)
was not that discoverable.

(imported from commit f6a7fce1bfd27bda412522768e981b2ffc39f474)
2012-12-07 15:37:25 -05:00
Waseem Daher 4bb330bb21 Allow 'Esc' to clear a keyboard-driven Find.
(imported from commit d48028531b6e7286d177790ec5adb2e5f256b1e0)
2012-12-07 15:01:20 -05:00
Waseem Daher 64b3f072fe Restore "Enter advances find" behavior.
This fixes https://trac.humbughq.com/ticket/546.

It's a little unpleasant that this special-casing lives in hotkey.js
-- instead you could imagine doing something where there was a whole
special set of hotkeys when a search is active, like we do with the
composebox, but this gets the job and is probably simplest.

I would have written this as a case that just falls through in the
else condition, but jslint doesn't like that.

(imported from commit 65a1b8aa1efc356b6690dc177058a4fb9e12745a)
2012-12-07 15:01:20 -05:00
Waseem Daher de8b6b5125 Make nginx static pages consistent with the Django ones.
(imported from commit da5aac54285336926ef0c53bd94ca7d68b5e746a)
2012-12-06 16:03:34 -05:00
Jeff Arnold d67e2cc4f3 Put the domain earlier in the titlebar, to help distinguish tabs
(imported from commit 225072a7cc044b011114a8630b02d74640b39d55)
2012-12-05 16:03:02 -05:00
Tim Abbott 72b9f25cbd Don't try to scroll to show composebox when no messages are showing.
(imported from commit 3835c7de0f3cad777b1fd5b609e9dc71635422ac)
2012-12-05 14:06:57 -05:00
Keegan McAllister fb77bdf359 bugdown: Set link target, title attributes on the server
For consistency.  Fixes #266.

(imported from commit 63e199a0fe4534df804a82cc98a1fdcf8ccb45da)
2012-12-05 13:54:43 -05:00
Jeff Arnold 8d4ddeb57d Keep text in the compose box when another stream/subj is clicked on
(imported from commit f063c92c4378074a7b27e45787dd1591fdde98b7)
2012-12-05 13:12:52 -05:00
Keegan McAllister c256fcca15 activity: Right-align numeric columns
(imported from commit a09e961247a8747c96f23b8468c1a0dd5a4edbb8)
2012-12-05 11:42:09 -05:00
Keegan McAllister 3032c94668 activity: Prevent cells from wrapping
(imported from commit d6f9d935b9ed32351804aa153835a171ff093e10)
2012-12-05 11:42:09 -05:00
Keegan McAllister 3f5d9902ab activity: Color rows for recently active or long inactive users
(imported from commit 5acc9317085acd7b4433b24b96bdf7fdebee5380)
2012-12-05 11:42:09 -05:00
Keegan McAllister 6efe52b935 activity: Decrease table padding
(imported from commit 90bed6ce94442e00e7516f65388b578bdfa920b3)
2012-12-05 11:42:08 -05:00
Waseem Daher f3ba899fe1 Fix responsive layout on Subscriptions and Settings page.
This was a really cute bug where our layout messes up if you resize
the page while "Subscriptions" (or to a less visible extent,
"Settings") is active.

The problem here is that we compute the size of the top navbar
based on the size of main_div -- but when main_div is hidden,
it has a width of zero!

We need to instead look at the width of the pane that *is* active.

Resolves https://trac.humbughq.com/ticket/216

(imported from commit adbef00d190845f90c5cfdb46df4ec7b703635ef)
2012-12-04 23:00:06 -05:00
Zev Benjamin 7e4776322d [manual] Unify huddles and personals into private messages on the receive path
feedback-bot and zephyr_mirror will need to be updated and restarted
when this is deployed to prod.

(imported from commit fe2b524424c174bcb1b717a851a5d3815fda3f69)
2012-12-04 18:01:51 -05:00
Waseem Daher af401fe659 Fix "resizing window breaks in Chrome" issue.
Ironically, I think this might've bee introduced by
commit ca35321c02d5e79e4f9c439a662805c016a333ed,
'Fix "resizing window breaks in Firefox" issue'.

Basically, when the window is 776px wide according to
window.innerWidth, that's the width not including the
scrollbar. However, in Chrome, the media query seems to ignore the
width of the scrollbar, so from the CSS's perspective, the window is
actually ~766px wide, so it goes into condensed mode.

But the rest of our code doesn't, which causes the break.

A bit more on this browser-specific difference at:
http://www.456bereastreet.com/archive/201101/media_queries_viewport_width_scrollbars_and_webkit_browsers/

So the issue we have is, to match the CSS's behavior:
* In Firefox, we should be listening to window.innerWidth
* In Chrome, we should be listening to window.width

We fix this hopefully once and for all by using window.matchMedia --
aka the exact same query that the CSS itself uses. As discussed in my
last commit, this feature is unavailable in IE<10, so we provide a
potentially more fragile fallback, i.e. what we did before this
commit.

(imported from commit d8e6425b81c90c8e0fdda28e7273988c9bfd67ec)
2012-12-04 14:52:29 -05:00
Tim Abbott 386e9eeb22 Fix load_old_messages being called with NaN argument.
(imported from commit 32cb17c98b81a40861f3d825e17a687575f35542)
2012-12-04 14:13:04 -05:00
Luke Faraone ec0683cd86 Cosmetic fixes to tutorial page and copy.
Make it so the image is not squished, change some paragraphs into
headers, and wordsmith a bit.

(imported from commit 81295e1a8ddd4f1ecd4532c4dfb8a38467bb530e)
2012-12-04 13:12:01 -05:00
Waseem Daher 3d69853784 Shrink inline gravatars.
This causes our deploy message to be less huge.

(imported from commit 5649eb42df0429a6bbaf8c8fd6f8048a66d22aa8)
2012-12-04 11:28:52 -05:00
Keegan McAllister 7907be735e hotkey: Make Enter an alias for 'r'
(imported from commit 9bf1b97304a4a4c1100826fefbba8edf1e4cff12)
2012-12-04 10:52:44 -05:00
Jeff Arnold f014163aed When narrowed, we want to load messages older than the oldest message
in the narrowed view, not messages older than the oldest message in
the home view

Tim provided most of the code for this patch

(imported from commit ec0bbfd344cac351f56a456fc560848603721135)
2012-12-03 15:58:26 -05:00
Keegan McAllister f61c26c361 preventDefault for modal mousewheel events but not e.g. subscriptions tab
Fixes mousewheel scrolling on the subscriptions tab.

(imported from commit 38d214fd53a478f3076dbfa4d7942ff13ec61369)
2012-12-03 15:35:46 -05:00
Keegan McAllister 2401fab25c Replace home_tab_active with home_tab_obscured
(imported from commit fb8c47079e63594a22c3d47fcf373887bda6e499)
2012-12-03 15:35:46 -05:00
Jessica McKellar 2fd3eb521c Refactor colorizing requests into a subscription properties model.
(imported from commit da4bfee4a12e941d4ec4c9f140973bb138c82c93)
2012-12-03 12:46:27 -05:00
Jessica McKellar 6a316daee8 Add frontend support for colorizing streams.
(imported from commit 48395ba915d6b22d8a7a8c7fbfb5e462680cef09)
2012-12-03 12:46:27 -05:00
Waseem Daher f71affdc11 Layout for colorizing streams.
(imported from commit 50d359ed44f46a0c666778bf510dafbb3e6e6f97)
2012-12-03 12:46:26 -05:00
Waseem Daher bbd2ea4c5a Add spectrum.js (color picker).
(imported from commit 7d25ecab2cb0126df0f165b6cce42a3b266b772c)
2012-12-03 12:46:26 -05:00
Zev Benjamin c5bf05ad0a Make clicking on 'Find <search term>' work
(imported from commit 756bd6cb3533e985e031954ece9228a146c5160e)
2012-11-30 17:03:52 -05:00
Zev Benjamin 0af3199d7c Desynchronize web client reloads
(imported from commit 216df5996f597ccd47bbc80e3f2fdaae751789d0)
2012-11-30 15:04:46 -05:00
Zev Benjamin 46f4a5eb38 Add util module
(imported from commit 3844e136fb799c6f57f8823255addf00a07ef686)
2012-11-30 15:04:46 -05:00
Zev Benjamin d29c77b14c Name unconditional reload time constant and appropriately move its use
(imported from commit 5ead2dbe0f170f8b93e726de6d6ed10a985882ab)
2012-11-30 15:03:19 -05:00
Jessica McKellar 37968bc9c7 If necessary, scroll to avoid occluding the message to which you are replying.
(imported from commit adf23d647a3d462d6236d8f1039da89a31b782d5)
2012-11-30 14:32:41 -05:00
Keegan McAllister 83660d7020 mousewheel: Explain why the home_tab_active() check is outside throttled_mousewheelhandler
(imported from commit 6fd5504fb5fb0e72426fa60e051b7e912696b8c2)
2012-11-30 13:58:04 -05:00
Keegan McAllister 3ce4427614 ui.js: Whitespace fixes
(imported from commit d7bb9fe17e319f60f1cc65bdfd381dc2f5d25a3a)
2012-11-30 13:01:02 -05:00
Keegan McAllister ee17165ad5 ui.js: Simplify event setup
(imported from commit 96444a0776e6408eb7e885a630855a0f33e0b6ff)
2012-11-30 13:01:02 -05:00
Keegan McAllister 45e515cc20 Handle mousewheel events properly in modals, different tabs, and compose box
Fixes #109.

(imported from commit ebcc90deeba712296998bfaa2df46ec6be305219)
2012-11-30 13:01:01 -05:00
Keegan McAllister 11487a0fd8 Ignore hotkeys when a modal pop-up is visible
Fixes #382.

(imported from commit 50162fde211a88de5e7f410fd7b1ed0df12d6082)
2012-11-29 19:28:59 -05:00
Keegan McAllister cb7b2eec80 Prevent an animation glitch on showing the compose box
See added comment for details.

(imported from commit 0248500be07584729d03e2543100a320e0410eee)
2012-11-29 19:09:47 -05:00
Keegan McAllister 8cbb6ab95f Equalize the widths of the two columns in the formatting help table
(imported from commit f0a1c7216cfbee777eac4827209ab93c32056515)
2012-11-29 19:09:47 -05:00
Keegan McAllister 3d3e88ad2d Tweak code block examples
(imported from commit 4790e217320ad2dae0b85216321b11755b0ba88c)
2012-11-29 19:09:47 -05:00
Keegan McAllister 27a5d81134 Make the heading of a striped table more distinct
e.g. in formatting help

(imported from commit 0a4123c412689fb2f90985028bd7237fa6cdfb19)
2012-11-29 19:09:47 -05:00
Keegan McAllister 2aaeb6e44b Move the "Formatting help" link next to the send button
The tabindex on this link doesn't actually do anything, because of the Safari
tab workaround.  I added it anyway in case we remove that workaround later.

(imported from commit 11f31f2561907300b350c11732be88589d736f94)
2012-11-29 19:09:23 -05:00
Keegan McAllister f8d83af2f0 Move the send button into a <div>
So we can float other things along with it.

(imported from commit a01e554bdb3ab3187557244400954194149fb172)
2012-11-29 19:09:23 -05:00
Keegan McAllister c25d1ea8e7 Guard against incorrect use of compose.set_mode
(imported from commit 294441f2b9107ce2488866764c3d30c35133a14a)
2012-11-29 16:51:32 -05:00
Keegan McAllister 1047bf49b4 Replace compose.toggle_mode with compose.set_mode
This fixes a bug where you could click on the already-selected mode button, and
it would switch modes without changing which button is selected.

(imported from commit 263ee0b52ba844c52a3a60968bb1bbff73482412)
2012-11-29 16:51:32 -05:00
Keegan McAllister d55ccd32af Remove state machine code from hotkey.js
With the removal of process_compose_hotkey, the state machine now has only one
state.  Everything else is based on things like "is a text box focused right
now", which is probably a better approach.

(imported from commit 0e39c03956d28e30d2bdbf3b285410ad0cacca3e)
2012-11-29 16:51:32 -05:00
Keegan McAllister 093c65fed2 Remove Tab hotkey to switch compose mode
Resolves #461.

(imported from commit 1ee64f0d6ca05064041e6619e8dbf1dc516c2c13)
2012-11-29 16:51:32 -05:00
Jeff Arnold 4c4e153ace When load_old_messages restarts itself, we need to repass all arguments
Fixes a bug introduced by e30e02c2

(imported from commit ca07eab76295ab1557f6866cff19debaec26e8c2)
2012-11-29 16:08:57 -05:00
Jeff Arnold 6670cf7b55 The load old messages "button" is now gone.
load_old_messages cares whether it is acting on behalf of a narrow
(for_narrow) not whether it is acting on behalf of a button push.

(imported from commit 16c00e015478f94f0631e211a92a7066a38135a8)
2012-11-29 14:18:38 -05:00
Jeff Arnold 50de4db2de Show the loading spinner when automatically loading more messages
(imported from commit 8025dde8696378bbb40b23a14204bfb489eb6798)
2012-11-29 14:18:38 -05:00
Waseem Daher fcc2fd5cdc Add ability to show/hide a "load more messages" spinner.
(imported from commit 611e53b2574ef50c9ab0a47fc2ebedd931a49dfd)
2012-11-29 14:18:38 -05:00
Jeff Arnold b52dbe1ca9 Auto-invoke "Load older messages" when at the top of the page
Resolves Trac #445

(imported from commit d7d96fe82e9e1cbef32e0dde284ce217e83aff55)
2012-11-29 14:18:38 -05:00
Tim Abbott aba2192ec2 Restore the time-travel functionality with Waseem's UI.
This restores the time-travel functionality and fixes Waseem's laundry
list of problems with its original UI.

(imported from commit e30e02c25af994435adb815d26284b3669c945a4)
2012-11-28 22:26:31 -05:00
Tim Abbott 44235e8e7e Fix last_message_id computation catching the dummy row hack.
This was causing glitching where if you narrow so that zfilt has only
one message, and add messages on top (e.g. via get_old_messages), and
then add messages on bottom (e.g. by receiving one), we end up with
the bookend row missing.  One can make this happen with narrowing,
but, this situation happens every time with time travelling.

(imported from commit 71d85980d8aa9431a17b33e9e5111fd3f76cecf3)
2012-11-28 22:26:31 -05:00
Tim Abbott a44c3ff247 get_updates: Eliminate the reload_pending parameter.
(imported from commit c7b57c4ef7fc4d6f0028f174f33ff7ff063d4b9d)
2012-11-28 17:41:38 -05:00
Tim Abbott 55181621bc Send a nonblocking get_updates request on wake-from-sleep.
(imported from commit 91c53f4294a609b1942c6753e9fba4fc4cb2f20f)
2012-11-28 17:41:38 -05:00
Tim Abbott d23a83ee81 get_updates: Replace "failures" with the new dont_block option.
(imported from commit 2b4ecb35c4f14b6c408323662ef6f39c6485c62d)
2012-11-28 17:41:38 -05:00
Keegan McAllister 0f1be6a9f6 rows: Consistently return an empty jQuery object in some corner cases
(imported from commit 4a83c8a3671fe13c8ff7c55fa2e22221bd68b21e)
2012-11-28 17:15:25 -05:00
Keegan McAllister 83216a5965 Ensure initial state satisfies selected_message == rows.get(selected_message_id)
If the message doesn't exist, rows.get returns an empty jQuery object, not
'undefined'.

(imported from commit 40620f3e4853a662cb93939bf7f0695f81298777)
2012-11-28 17:15:25 -05:00
Zev Benjamin faf426baa7 Only send pointer updates when user has been idle for a short period
This is so we only send a single pointer update when the user scrolls
through a bunch of messages at once.

(imported from commit 20d239d7179e5f57ada99968361a0f9b7b18c591)
2012-11-28 16:36:43 -05:00
Zev Benjamin 48790187ca select_message_id: Remove no longer applicable update_server option
(imported from commit 03076f1d514017b70ec5bd2b34b1a575d0c56f6e)
2012-11-28 16:36:43 -05:00
Zev Benjamin 249b7a527f Switch to high-watermark pointer model
(imported from commit c05d074a404e823eaa0808b6938a3c80e457175b)
2012-11-28 16:36:41 -05:00
Zev Benjamin fbe41c95d5 Re-enable pointer sync
(imported from commit 9f765bbc32e6a3fd91e83aa4016c8e8f8c47bfc1)
2012-11-28 16:36:24 -05:00
Zev Benjamin 71a2cc6611 jquery.idle.js: fix keepTracking option
(imported from commit 327a1c128a88e2e7fcfe7654c6c2c0c67dac0f27)
2012-11-28 16:35:56 -05:00
Luke Faraone 1dbd806b6a Implement a favicon as a link rel.
This has the benefit of not getting cached forever by browsers.

(imported from commit c7c7877dfbb9d479e997d122827017036c5337f5)
2012-11-28 15:12:37 -05:00
Keegan McAllister d1aa92c983 Style inline code inside a link to look more like a normal link
Fixes #448.

(imported from commit 02f538a9d3fb43539640e77b2e194ac2de611c18)
2012-11-27 13:41:00 -05:00
Jeff Arnold ed1eff9bfa Dismiss all notifications when the tab regains focus
(imported from commit 53c807d7a02aabe62a832a129505d690e98e39cc)
2012-11-27 13:39:46 -05:00
Jeff Arnold 2f882b505a Show "how many messages have arrived while away" in the document title
(imported from commit 6e2a18be9953694048d107a56a03a67f8bc2bd5a)
2012-11-27 13:39:46 -05:00
Waseem Daher 60789abd7f Consistently use 'exports' rather than 'typeahead_helper'.
(imported from commit 6106f0ed2708f710a9e3f589560fda58999caa71)
2012-11-27 13:29:26 -05:00
Waseem Daher 2321059240 Don't highlight, e.g. 'Narrow to', in the searchbox typeahead.
(imported from commit f16f1417da708ad2060ba603fe14ea113559d100)
2012-11-27 13:28:21 -05:00
Waseem Daher e0f3c43432 Deduplicate code a little.
(imported from commit 52c32776641256fc145ce1ff7a60ca8fb92ea784)
2012-11-27 13:28:21 -05:00