Commit Graph

1493 Commits

Author SHA1 Message Date
Tim Abbott 61ee8b1921 Unfade messages after you manually edit the recipient.
It's pretty confusing if this doesn't change.  In some other world we
could update the fade, but since we're currently only fading on reply,
I think it would be weird to update the fade when you're picking a new
recipient.

(imported from commit 8f77419d443d578068b57f847354ac6da7632ee2)
2013-03-13 11:12:25 -04:00
Tim Abbott 1e62ced172 Fix fading when replying to sender.
Previously, we compared the recipients of messages to the message that
you triggered the reply off of -- even if you did a reply-to-sender.
This commit changes the code to instead track what you faded by,
rather than just the message you faded on.

Fixes #1037.

(imported from commit d9e2cb4122501b1bc45e231d4b52c2e7f9284fdd)
2013-03-13 11:12:25 -04:00
Tim Abbott 24a235a091 compose: Move unfade_messages() call inside fade_around.
This makes the API a little cleaner.

(imported from commit c5eb9a4998971cdbe1f8ac3a14fd9759584771bb)
2013-03-13 11:12:25 -04:00
Tim Abbott 6c6a005920 Update recipient on renarrow when compose box is open but empty.
(imported from commit ff50b3b38833e7467ca77714acb1d81c22aeed0c)
2013-03-13 11:12:25 -04:00
Tim Abbott ee8d646d74 compose: Don't clear the compose box when recipient didn't change.
(imported from commit 5188a0f510e499c80d4c188a1ce59af4f2fe3262)
2013-03-13 11:12:23 -04:00
Tim Abbott 10be8d2a12 compose: Fix loss of message fading on renarrow.
Previously, if you renarrowed, all message fading would be cleared
until you close and then reopen the compose box.

Fixes #1024.

(imported from commit 57981ba29ab597c4c84ca6e4e9d04a8284f49117)
2013-03-13 11:10:51 -04:00
Tim Abbott 012f0566a1 compose: Fade all relevant messages on the page, not just neighbors.
(imported from commit 69e11a980b9cbd69753754b9a42248ef0f3d5a21)
2013-03-13 11:10:51 -04:00
Zev Benjamin 05eec2ae19 blueslip: Add some clarifying comments
(imported from commit 8b8ed83593d4dfb8ac3deb2c3442c2614481701a)
2013-03-13 10:55:34 -04:00
Zev Benjamin 09cf339c2b blueslip: Handle exceptions from jQuery event handlers and $(document).ready functions
We treat these exceptions the same way we treat fatal errors: report
the error message to our server and then allow the exception to reach
the top level.

We could also override document.onerror, but don't.  There are a
couple of ramifications of this:
* Exceptions caused by event handlers directly attached to DOM
  elements aren't handled
* Exceptions caused by code at the top level that triggers an error
  (such as parse errors in our Javascript files) aren't handled

The reason we don't override document.onerror is because the
document.onerror handler has a limited interface and doesn't receive
the exception object.  It only gets the message, file, and line
number of the error.  Additionally, exceptions that we allow to
propogate out of blueslip trigger an onerror event when they're never
caught.  In order to avoid handling the error twice (once by blueslip
and once by the onerror handler), we'd have to encode the fact that
the error has already been handled in the error message, which is
pretty ugly.

(imported from commit 7f049ae519dc198a9f7cfd41fd5dd18e584bd061)
2013-03-13 10:55:34 -04:00
Zev Benjamin 5bd4f2ccd7 blueslip: Throw a custom exception type
(imported from commit 4a3612b63bb4481a56901cc3dd6cea9a3d1a1aea)
2013-03-13 10:55:34 -04:00
Zev Benjamin 6d25940299 blueslip: Pass the stacktrace into report_error
This is to let us pass in the stack trace of an existing exception,
which will be required in a upcoming commit.

(imported from commit 421366a7a01deb770b7620417fb4660769c5db53)
2013-03-13 10:55:34 -04:00
Zev Benjamin a5b7c86303 Show an error message to users on fatal errors
(imported from commit a1ee2329e6b9dfa6f575106f1e32574bef0598a2)
2013-03-13 10:55:34 -04:00
Zev Benjamin fb0dd60857 Simply compose.check_stream_existence now that one of its return values isn't used
(imported from commit 8c910032e8ffd12b9691138ce03ceb096156e3f2)
2013-03-13 10:55:33 -04:00
Zev Benjamin 054d377709 Make stream existance error actually go somewhere
The referenced element where the error was supposed to go was removed
in 66fd42914e4fc33719c4f21ad401748989f20b49.  Now the error message uses
the regular compose error message area.

(imported from commit c82a6d863fa327ba982157d0b0607545d7e65cb7)
2013-03-13 10:55:33 -04:00
Zev Benjamin b383ee1dd4 Only report a given error message once per page load
(imported from commit 058fe321a991bbc50eed63b0bdbf75bcfa8afe2b)
2013-03-13 10:55:33 -04:00
Zev Benjamin 1109d20149 Send browser errors back to the server
(imported from commit 8c676017e8b3fc4f17552db15d32266099dba8f2)
2013-03-13 10:55:33 -04:00
Zev Benjamin 65d2f65bbb Check if we need to rerender after appending messages to the MessageList
Previously, if the pointer was high on the page such that there was a
lot of empty space below and the render window was full (a situation
we could get into if we're following new messages arriving), a newly
recieved message would not be rendered even though it would have been
visible on the screen if we had done a rerender.  Adding the
_maybe_rerender() call to the end of append() ensures that we don't
end up in this situation.

(imported from commit 925d3cc62e8221b42f1d5ff1788e99c7d07ccc24)
2013-03-13 00:48:26 -04:00
Tim Abbott c947fbd0e9 Revert "Disable backfilling 1,000 messages on idle"
Now that Zev's message list branch is merged, there's no longer a
performance penalty for loading these old messages, and it improves
our narrowing performance to have them loaded.

This code is slightly different from the original commit
93d47710891cfc4db9fa00beaa5ccd10113aa1c3 since the way to access the
first element in the message list and the API for get_old_messages
have changed since then.

(imported from commit f295f892bea9327eb8316225b7b98f0e3b3fdc9a)
2013-03-12 18:16:55 -04:00
Luke Faraone 10b15640e9 Highlight messages which contain your name.
This was requested by CUSTOMER18 and CUSTOMER4.

Closes trac #705.

(imported from commit a25c6b7ca0ae3ba89c03779b19c4d6b0af93a014)
2013-03-12 18:01:16 -04:00
Jeff Arnold e9cbae67b3 Make clicking notifications give focus to browser
Resolves Trac #1081

(imported from commit d5546ecda53a57b6dbbfc65db923432f8e4cc7b2)
2013-03-12 16:03:42 -04:00
Luke Faraone 3c95013a15 Iconify public/private streams on subs page and new stream modal
This will hopefully make stream privacy more noticeable. We still don't
allow people to modify privacy after stream creation, however.

Since we now use a radio box on the stream creation modal we had to change
the selector used by subs.js to determine if a new stream was to be invite-
only.

(imported from commit 641a4fab74301a9b3ecd4b3859f010dd4ece193e)
2013-03-12 15:14:29 -04:00
Zev Benjamin 26580f2399 Deduplicate messages from get_updates
This is a workaround for bug #1062.

(imported from commit 449b00e653829e263583376a88ae67b1fe4f5eb6)
2013-03-12 14:36:45 -04:00
Waseem Daher 33dc3a2fb7 Properly start tutorial on first run, even if you have new messages.
We were previously having an issue where the tutorial could
be pre-empted if you got a few messages while you were first
logging in.

I have some reservations about this being slightly fragile, and a
better approach might be to just have a bit that we use to determine
whether or not you've already seen a tutorial. (Or potentially that
checks whether or not you've ever sent a message.)

(imported from commit f8858f64a36bcd25887b76314caff283929f340c)
2013-03-12 09:56:57 -04:00
Waseem Daher dffde7714c Don't have the presence list occlude the "More messages" popup.
The issue, prior to this fix, is that the presence list actually
gets drawn *on top of* our "more messages" popup, which is ugly.

(Toggling the z-index on either or both of them did not seem
 necessarily to matter, but that's probably because z-index
 is subtler than I understand.)

This fixes Trac #1078.

(imported from commit a255aadb1884cf6c659085b26a36d378f680e83e)
2013-03-11 23:28:37 -04:00
Jessica McKellar 039178b12e tutorial: remove step telling you to colorize the tutorial stream.
We don't need it now that we auto-color.

(imported from commit 80066849b8f2aeef5e839f4fca40c9659b60a4af)
2013-03-11 16:47:04 -04:00
Jessica McKellar 2314809d73 Auto-color streams.
(imported from commit b669f864b0574e9e9af282ccb8783ccfaa12adfd)
2013-03-11 16:47:03 -04:00
Waseem Daher 436d3b2578 Don't open the composebox when you click on a Twitter avatar.
(imported from commit 9844d15a522d1b31a84aee15c9c0617951c53cc9)
2013-03-11 14:38:21 -04:00
Zev Benjamin 05d89139dc Use blueslip instead of throwing errors directly
(imported from commit 095ae006fd344943d7dc1c0bbc86f0ac0458e755)
2013-03-11 13:22:12 -04:00
Zev Benjamin dc0913077a Add a new frontend error-reporting system
The new system, called blueslip, makes errors fatal when in debug
mode and only output a message when running in production.  In the
future, it could also send user errors back to us automatically.

(imported from commit 1232607c0311e885c8b5a5e8a45ffb28822426e0)
2013-03-11 13:22:12 -04:00
Zev Benjamin 36f7e6ffd5 Remove verbose_stacktrace function. Use console.trace instead
console.trace is available in both Firefox and Chrome and is more
powerful.

(imported from commit fa6e2cd5c78e7b0588b8656270d078bfa6af41fa)
2013-03-11 13:22:12 -04:00
Zev Benjamin 9c28e52f91 Fix sort error for streams with names that are numeric
The jQuery .data() documentation says: "Every attempt is made to
convert the string to a JavaScript value (this includes booleans,
numbers, objects, arrays, and null) otherwise it is left as a
string. To retrieve the value's attribute as a string without any
attempt to convert it, use the attr() method."

(imported from commit f47c1cbb94cb5a98ea9842b00f45c35cd21873f9)
2013-03-11 13:00:01 -04:00
Waseem Daher bf2ad720c8 Specify both the width and the height for our emoji.
This should hopefully cause the page not to scroll around when we load
a giant block of emoji, because now the size of the emoji is known
before it finishes loading.

(imported from commit f566437edd725f6084c6a10c6230fd36e8d12346)
2013-03-11 12:52:11 -04:00
Zev Benjamin c50abd1c76 Fix jQuery selector exception from single quotes in stream names
Fixes #1065

(imported from commit 67f74e41f16c01d0d307bd8edf48dd70dde4edf4)
2013-03-11 12:38:15 -04:00
Waseem Daher 0e1b019f0a Allow Esc to blur the searchbox input.
This is a fix in response to an issue reported by Nelson.

(imported from commit 3db9e3a91d4e848408f19645e20382414a87b115)
2013-03-11 11:49:47 -04:00
Luke Faraone 8f52f8e4a2 Sort the streams sidebar the same way as the subscriptions page.
Closes trac #1050.

(imported from commit 8a6d5e067b7f726071e5797d70132cab689bbb49)
2013-03-11 11:44:06 -04:00
Tim Abbott 413a989058 Enable use_closest when moving pointer due to other clients.
Our mobile apps (which don't support in_home_view filtering) will move
the pointer to a message that isn't actually in the home view, so we
need to accept that sort of input for now (and maybe in general --
even if we fix our mobile apps, third-party clients may screw this up
too).

(imported from commit ce837e972f0581abd1df44fdb2dd5270dfb9afde)
2013-03-11 10:56:44 -04:00
Waseem Daher 244b239828 twitter: Specify a width for the Twitter avatars.
This should make their size totally known to the DOM,
which should prevent jumpiness when they load.

(imported from commit 564d920014f5bc52c217adf54c2f5bab6ba625e0)
2013-03-08 17:03:47 -05:00
Waseem Daher 1df648baa9 Add inline preview of Twitter links.
This uses the unauthed v1 of the Twitter API, which is going to go
away soon, but it's fine as an interim measure.

(imported from commit 709a250271321f5479854a363875c9da43e6382d)
2013-03-08 14:31:18 -05:00
Luke Faraone 93b4fcfeac Exclude humbuggers from the new stream modal
For people who aren't on the @humbughq.com realm the tutorial bot showed
up in the create new stream modal but attempting to invite them failed.

This was most often noticed with the tutorial bot.

In the future we should figure out a really good cross-realm story, but
in the near-term we need to probably exclude other people outside your
realm rather than special-casing @humbughq.com.

This closes trac #1059.

(imported from commit df704df0c8ae84b23d9491ce6ab77300831cdd20)
2013-03-07 16:58:29 -05:00
Waseem Daher a7495a8470 tutorial: Send an error message if the tutorial times out.
(imported from commit ae8b11f9b3d6e0480207492c4a3f64ac52b51367)
2013-03-07 16:52:52 -05:00
Waseem Daher 47da3b5229 tutorial: Get rid of unnecessary sleep.
We should start listening for the message right away,
not five seconds later.

(imported from commit 19de74e4dc309e81db56074bdc625aa76197b6ef)
2013-03-07 16:52:51 -05:00
Luke Faraone f73929c952 Update own name in sidebar when updating name globally.
We now add the my_fullname class to the entry for you in the sidebar so
that we can automatically update this element when changing your name.

This closes trac #979.

(imported from commit f1473d6bb6f18810311d42c85d4b57aab9966498)
2013-03-07 16:01:41 -05:00
Luke Faraone 34ecfb339f Add an alert to indicate bankruptcy is processing.
We also grey out the box to prevent the user from clicking twice.

This closes trac #1030.

(imported from commit eec810e3fbc5b7c9350c2d91e448fb27d4c856f8)
2013-03-07 15:50:16 -05:00
Zev Benjamin 740e48d427 Switch the MessageList from using a closed interval for its render window to a half-open interval
(imported from commit 53cdbd603d8ab68fdbb338a852cb214a35a0403d)
2013-03-07 15:22:28 -05:00
Zev Benjamin 94a3e2c7a4 Use a delegated event handler on the presence list
This code also has the side effect of making it no longer possible to
click to the right of a name to start composing a message to them.

Fixes #931

(imported from commit 80e995ccc8ead18b80a39181c47cc94d6063f0f6)
2013-03-07 14:54:41 -05:00
Tim Abbott d49e9bdf95 Select the first message to arrive in a narrowed view.
Previously, if a narrowed view started out with no message selected,
one would never be selected unless you clicked on it.

(imported from commit 11c6a1a8d046ec33a3dbea4067c40896be137485)
2013-03-07 13:24:46 -05:00
Tim Abbott c88684d1f5 Fix first message in narrowed views never appearing.
The message list data structure never had the rendered_idx values
initiatized except via _maybe_rerender (called when a message is
selected).  For the narrowed message list for streams with no messages
yet, we didn't select a message (as there was none to select); the end
result is that msg_list.append() will never rerender because it tries
to subtract undefined from undefined and gets NaN in its test for
whether it needs to rerender.

So fix this by initializing _min_rendered_idx and _max_rendered_idx to
valid values for the empty message list (the closed interval from 0 to -1).

(imported from commit 6afecb1569185a842a3a9108cedba7e88f8befad)
2013-03-07 13:24:46 -05:00
Jessica McKellar 9d821b9541 Tweak tutorial text about subjects.
Use less technical subjects, and make them good examples of actual
topics you'd want to discuss (previous examples like 'jQuery' might
leave people wondering "jQuery is a technology, not a topic, why is
that a subject?")

(imported from commit 23b74fe145ed2d325daa94a46e63c42c005b1459)
2013-03-07 10:14:13 -05:00
Reid Barton 6bb9ad4e3c Avoid cross-site logout attacks
Require POST method for /accounts/logout. This has the side effect of
automatically enabling Django's CSRF protection.

(imported from commit 44b1b6ebaadc1c03006e21ae54ac768e31234801)
2013-03-06 19:10:04 -05:00
Jeff Arnold 025b79d98b Don't change focus away from the PM recipient box on keydown
The typeaheads take some time to open and changing focus on keydown
sometimes prevents them from doing so before the focus is changed.

(imported from commit a8153704e60f3d6c34af55a3de5bd43071a15baf)
2013-03-06 18:42:52 -05:00
Waseem Daher f941a58ec1 Suppress enter-replies if a button or link has focus.
This is in response to the following bug report by Evan Broder:

FYI, it looks like if I accidentally tab to the "Formatting" link and
hit enter, it erases the message (and replaces it with a reply to
whatever the selected message is, I think?)

This is subtle and here's why: Suppose you have the focus on a
stream name in your left sidebar. j and k will still move your
cursor up and down, but Enter won't reply -- it'll just trigger
the link on the sidebar! So you keep pressing enter over and
over again. Until you click somewhere or press r.

Net-net though, I think it's a change worth making, because
it's good for keyboard accessibility.

(imported from commit b65bcc0abbc751718bb03d418c03961b9ed9e42b)
2013-03-06 18:10:20 -05:00
Tim Abbott 9f06f5344d tutorial: Remove stale 'Great, you did it!' text.
(imported from commit 224b2ce50f5c86fdcb902a3ac3cc25ada81d51e3)
2013-03-06 18:03:42 -05:00
Tim Abbott bb97019720 Make Tutorial bot's 'exit' reply the same type as the exit message.
I.e. if you sent a stream message, Tutorial bot will reply to that
stream, and if you sent a PM, Tutorial bot will reply with a PM.

(imported from commit 05b7d1848f6eb1f70dcd5fb365fba9daee52a5dd)
2013-03-06 18:03:42 -05:00
Tim Abbott 26a42bfd36 Clean up some copy/paste code in our copy/paste support.
Fixes #823.

(imported from commit a45e853ecdf258e03ceb13419794bd69505c01ce)
2013-03-06 15:38:23 -05:00
Waseem Daher c41fa46fb4 Always show the searchbar 'x'.
This simplifies a bunch of fragile resizing logic in our code,
and also addresses the Chrome Canary bug where clicking in the
searchbox causes the navbar to get huge.

This fixes Trac #764 and Trac #1039

(imported from commit fc8c3995109de384b71dfba2b986a8500ff7f08d)
2013-03-06 15:06:35 -05:00
Zev Benjamin 97344573ef Fix spurious rerender when navigating to a newly arrived message
We weren't properly incrementing max_rendered_idx before.

Fixes #1044

(imported from commit 1bf0ade2a168fde97dc662aaf42511d47b3e81f3)
2013-03-06 14:05:34 -05:00
Jessica McKellar 1f7a74e54f Add color swatches to the stream sidebar.
(imported from commit 16104eb351361a0fabbf7d4b71cb096b7cba0dd7)
2013-03-06 14:00:44 -05:00
Tim Abbott fc59ebbd66 Increase time for 5xx error page before redirect to 60 seconds.
I figure it's worth giving people time to read the message and click
the "Report error link" before we redirect the page away; 60 seconds
is still short enough that if the person wasn't at their computer,
it'll still fix itself.

(imported from commit 577193cf8dca0a646933741a50769378ddd824bb)
2013-03-06 13:34:59 -05:00
Tim Abbott 1b6bd45f07 Use a relative redirect on 5xx error page.
(imported from commit a86053bdb6fe74a88c21428b8ec2b64ae8d7bb95)
2013-03-06 13:34:59 -05:00
Tim Abbott 821b77488d Properly rehighlight messages after rerendering of the message list.
The new message list system can rerender the message list on scroll,
but did not properly re-highlight any messages which were highlighted
at the time the scrolling was initiated due to an open compose box,
this time due to a bug where the meaning of "this" changes when we
moved the rendering code into the message list library.

(imported from commit 26d9716811b56a6f89ae22e68038ad560dcfee64)
2013-03-06 13:34:59 -05:00
Tim Abbott 1992583d82 Properly refade messages after rerendering of the message list.
The new message list system can rerender the message list on scroll,
but did not properly re-fade any messages which were faded at the
time the scrolling was initiated due to an open compose box.

(imported from commit 4bc7c172e8bb55acfaacc5e5460eb6a2ef9aebe2)
2013-03-06 13:34:59 -05:00
Waseem Daher 932aeb86b5 Add a tiny visual indicator that the message is sending.
This fixes Trac #1035.

(imported from commit f8d179f6f5e59922fdc5391624c6efb3da59395d)
2013-03-06 12:09:00 -05:00
Waseem Daher 569c9dbdc1 Size emoji more responsively.
Now when the font increases, so will the size of the emoji.  (1.4em
seems to be 20px at our default settings, so this doesn't change the
size of the emoji for any of our existing people).

(imported from commit edb0b590f00bfbad0355a41b1f995335cf0e9e07)
2013-03-06 12:03:29 -05:00
Tim Abbott 618183d065 debug: Add verbose stacktrace function.
Zev and I found this useful for debugging what's happening inside
casperjs today.

(imported from commit 6fb42165c4ff138ba3417ac2ee0db92040e49fa4)
2013-03-06 11:36:15 -05:00
Luke Faraone 82d6039fdc Correct selector to apply to the descendants of .message_comp.
Previously we did the equivalent of a $('.message_comp').child('input'),
which does not search beyond the first level.

In addition, using a comma in a selector is essentially an AND, which
means the narrow search only applied to elements of the 'input' class.
So when debugging we saw a bunch of elements being selected and that hid
the bug for a bit.

Now we do a .find instead which will ensure we blur the correct
elements.

This closes trac #1045.

(imported from commit f44383ee9fc93406d031589ef914f5a003334ea7)
2013-03-06 11:22:04 -05:00
Waseem Daher c39aa0b0bc tutorial: Update script and use stream messages.
This now adds you to a special `tutorial-username` when you begin,
we send tutorial messages there, and we remove you from it when
you're done.

(imported from commit a93a90b9347a4f72536e96331ddfd1d47727ce71)
2013-03-06 10:39:51 -05:00
Waseem Daher ca127f8228 Allow tutorial bot to send messages to a stream.
But only allow them to send to tutorial-<<your username>>.

The idea being that this helps reduce potential abuse from this JSON
call. (Because otherwise, anyone could call into this endpoint and
have the tutorial bot send random messages to random peoples's
streams.)

(imported from commit 471d4348d7ad43858b5df240e4f1dceba006aab6)
2013-03-05 23:46:10 -05:00
Waseem Daher ad5bb68906 Fix a height for our inline image previews.
Without this, the whole message list bounces around a lot,
leading to frustration.

(imported from commit 4857086e7ec4c4fc18436615bd12bb1a6ee9cba4)
2013-03-05 17:30:40 -05:00
Waseem Daher 707796b37b Cause login page to be more responsive.
Prior to this commit, at 800px, e.g., the Google button
is smushed into the login form.

(imported from commit 422d1b677439460785f6b31ea2fe2c819e23e259)
2013-03-05 17:24:46 -05:00
Tim Abbott 8160795cdc compose: Only blur text boxes in compose box on hide.
Previously, we blurred all input/text boxes, including e.g. the search
box.  This probably won't impact normal operation, but this can be a
problem for our automated frontend tests which tend to have different
timing than real life.

(imported from commit ea84312bea2aae99d51b48cede0746e7a5b6e76e)
2013-03-05 15:48:34 -05:00
Tim Abbott d1fb74e627 Fix rebase issue with same_stream_and_subject being moved.
(imported from commit d3b4f066ea03d63e329491fd5c8d793ee30c0b47)
2013-03-05 15:10:28 -05:00
Tim Abbott a0c60ba236 Fix narrowing by subject when selected message has different stream.
We had a bug where if the selected message had the same subject as the
target message, but a different stream, narrowing by subject would
narrow to that subject plus the selected message's stream rather than
the target message's stream.

(imported from commit 4b196342318a06d8aeea46bf05e3d7416ecb6c5b)
2013-03-05 15:06:31 -05:00
Tim Abbott b1d1863604 Fix narrowing to pm-with lists not in alphabetical order.
Previously if you narrowed to
"pm-with:wdaher@humbughq.com,jbarnold@humbughq.com", you'd always get
no results because our filter was comparing your query against
message.reply_to, which is sorted in alphabetical order.

(imported from commit 40dc78640f3b010f11312176cfcf3c331fdf3337)
2013-03-05 15:06:31 -05:00
Tim Abbott 1d37238a89 Prettify display of narrowing in our search box.
(imported from commit ccb7f4798a949751a396845baf399591b5d83fb3)
2013-03-05 15:06:31 -05:00
Waseem Daher 023464ce9e Give emoji a fixed height so they don't scroll the page as they load.
(imported from commit ca7504f4e08705d748465f9ea20772a09006c999)
2013-03-05 12:50:21 -05:00
Zev Benjamin ba1c170f02 Do just in time calculation of full date and time for messages
The most expensive part of adding the display time to messages is
calling time.toLocaleDateString() and time.toLocaleTimeString().
Most of the time, this information never gets seen, so we now delay
calculating it until just before the user would see it.  This cuts
the time to render a chunk of messages from >1s to ~200ms.

(imported from commit 6167e7a8e1c3b4ca77471fa346292be4ffa67ec8)
2013-03-05 12:48:33 -05:00
Zev Benjamin 4b3e4b118e Don't re-compute display time when rendering a message a second time
Adding the display times to messages is very expensive (> 1s for 400
messages in Chrome on my machine).  This commit doesn't directly
address that issue, but does mitigate its affects on scrolling speed
when rendering the next chunk of the message list.  After this
commit, rendering a portion of the message list for the second time
only takes ~300ms.

(imported from commit b22badb5dcce69be297f6403b1cb40950e46376e)
2013-03-05 12:48:33 -05:00
Zev Benjamin ebabe0caeb Avoid scrolling when rendering a new portion of the message list
(imported from commit f8a2f8ee13b20187df179d41dea5cc14de24e797)
2013-03-05 12:48:32 -05:00
Zev Benjamin 182eb86db7 Only render a small portion of the message list at a time
Long-term we probably want to pick the render window size and
re-render threshold based on the user's window height instead of
arbitrarily.

When we re-render we probably also want to ensure that the newly
selected message appears in the same location as it would have
before the re-render.

(imported from commit f044b7f2200822e8e6e8dba7108d087a69016134)
2013-03-05 12:48:32 -05:00
Zev Benjamin 134fc469ad Re-disable collapsing when narrowed by a search term
This seems to have been broken for a while.

(imported from commit a0bcbffaec53b30e9099befc59e7171d2b96aa68)
2013-03-05 12:48:32 -05:00
Zev Benjamin 5daf327f9d Add a function for narrowing by time travel
(imported from commit 1f8871309a34b0bfef79b671d308d6219f4377b4)
2013-03-05 12:48:32 -05:00
Zev Benjamin bc8bc8567b Make the decision of whether to collapse messages on a per-MessageList basis
This also renames the option to 'collapse_messages'.

(imported from commit 95307ee72b761b72e43d9c7a66f5ba76f7134d9e)
2013-03-05 12:48:32 -05:00
Zev Benjamin d05ac105fe Move clear_table into MessageList
(imported from commit 138c3103920413580f86fede115843ecfddc0691)
2013-03-05 12:48:32 -05:00
Zev Benjamin f6ba728a24 Move message rendering into the MessageList
(imported from commit c1e16b1d2fafe5c079991e7ae96a013e25bc8618)
2013-03-05 12:48:32 -05:00
Zev Benjamin 95309539bc Move same_{stream_and_subject,recipient,sender} into the util module
(imported from commit 0d79bc3ae29be16eba59acea8bc5fda2aba1d4de)
2013-03-05 12:45:12 -05:00
Waseem Daher e662db9c68 Increase the time we mark you as green or yellow.
One of Matt Goldstein's comments is that we often make you look
like you're not at your computer, even when you are, just because
you haven't checked Humbug for a while.

While it's important to have this be accurate, right now I think
we err on the side of showing you as not present. So I increased
some of the timeouts in an attempt to fix that.

(imported from commit 9fd8f432e6684ec1b33d1d932f37caa99c627959)
2013-03-05 11:26:55 -05:00
Tim Abbott a92f2a5229 Rename 'Narrow to messages containing' to 'Search for'.
(imported from commit 147164bb96bb4fdb451454956ac56f5d3b2424b6)
2013-03-05 09:32:59 -05:00
Tim Abbott ee3662d1da Move 'Narrow to' to text inside narrow.describe().
(imported from commit a5ccce0034f4c70b71958b26b60521b779837377)
2013-03-05 09:32:59 -05:00
Tim Abbott 021052a247 search: Remove unused variable search_active.
(imported from commit ebb907742fd38f60116fb0fe46fa622abd3b23e0)
2013-03-04 17:57:21 -05:00
Tim Abbott d5a185dca8 Add highlighting of search terms in "messages containing" narrows.
(imported from commit 47fca2f20650c32e976ab01e213463d4fb4ed655)
2013-03-04 17:57:20 -05:00
Tim Abbott 12bb641e9f Fade new messages that arrive while compose is open.
This might need to change after we merge zev's message list branch, but
it fixes the bug and performs well and isn't a lot of code.

And it has the nice property that it'll only fade messages within the
neighbors range, so there's no need to update the unfading code to
support this.

(imported from commit c562d7335bc5635c960321e1451e4ba0f4452ee9)
2013-03-04 17:29:16 -05:00
Waseem Daher 09a0471486 Update tutorial to reflect presence list on the right.
(imported from commit b3616337b5bcf2b07d7c5ba87f6c0ce185cc5889)
2013-03-04 16:27:13 -05:00
Waseem Daher c1269d9e42 End the tutorial if they don't send us a response.
But lengthen the length of time you're willing to wait for one,
as a consequence.

(imported from commit bbdcf29a8b9d479a08259e5ccabd464e09c18b58)
2013-03-04 16:27:13 -05:00
Waseem Daher 9f0877a7f2 Add emoji support 👍 🎩 💩 😀
(imported from commit 5f15ddb4492aad7cc4a9b3249acac8b8edc0a177)
2013-03-04 11:08:00 -05:00
Luke Faraone f533b92d63 Add a halfing to the Home link.
(imported from commit 6ddf4d996d09373eb2509c65760df9280f7402c8)
2013-03-04 10:59:41 -05:00
Luke Faraone d88107567a Remove "find in page" functionality.
This was a source of user confusion and didn't provide that much value.

(imported from commit fbe9405d8bc4cb6661baa7fe7583eab5ed73d886)
2013-03-04 10:59:41 -05:00
Waseem Daher 812fce0534 More nicely align your name and email in the sidebar.
It's not quite what the CUSTOMER4 person wanted, but
I think it scratches the itch.

This fixes Trac #1023

(imported from commit 9186499c8f6bacb230a2d1ed6d5ca7ffa7416ac3)
2013-03-03 11:34:41 -05:00
Waseem Daher 3ce48f8a45 Make layout more responsive.
To be fully responsive, we can basically never specify the width of
our container in a fixed number of pixels; otherwise we'll run into
the situation where there's an inordinate amount of wasted space on
our left and right.

So everything needs to change from, e.g. row to row-fluid,
and that has a whole cascading series of changes that that implies.

(imported from commit 7e2771d916f429548c65c0a00fc4c11397054656)
2013-03-03 11:04:57 -05:00
Tim Abbott 5502ea9f88 Don't open compose box when clicking on inline images.
(imported from commit 1603b117a322d31e92a3b6684ce8afe33bac0b7d)
2013-03-01 14:50:45 -05:00
Leo Franchi 7374fe53f1 Only show the "More messages below" if unread messages are in the home view
(imported from commit 6b1ded10519305bca935b093a74b59d7ab814c55)
2013-03-01 14:35:39 -05:00