Commit Graph

2587 Commits

Author SHA1 Message Date
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 a8d6bd3322 Remove some unused imports.
(imported from commit bb8311848ca24fbb1fb1b3df8f8b4403eb38ce1c)
2013-03-11 16:47:03 -04:00
Jessica McKellar 2314809d73 Auto-color streams.
(imported from commit b669f864b0574e9e9af282ccb8783ccfaa12adfd)
2013-03-11 16:47:03 -04:00
Waseem Daher 3c6d489064 Don't do Twitter previews on prod.
(imported from commit 4baed7ba22482eff6ed381d319f6e21da904d9ba)
2013-03-11 15:18:57 -04:00
Leo Franchi 9466addbe2 Allow negative anchor param to get_old_message
When narrowing, we use the selected id in the home view as the anchor,
and if the user is new and hasn't selected any messages yet (or moved
the pointer since first using humbug), their home view selected message
will be -1. Rather than failing to get_old_messages for any narrows starting
from that point, return all matching messages.

(imported from commit 72cfe392d9ac01ed41abc8eadf0f47240e374665)
2013-03-11 15:11:24 -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
Tim Abbott d679a72952 [manual] Cache results of the Twitter API in the database.
This should substantially improve the repeat-rendering time for pages
with large numbers of tweets since we don't need to go all the way to
twitter.com, which can take like a second, to render tweets properly.

To deploy this commit properly, one needs to run

./manage.py createcachetable third_party_api_results

(imported from commit 01b528e61f9dde2ee718bdec0490088907b6017e)
2013-03-11 13:15:55 -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 29d504149c twitter: Only render the first Twitter link we see, not all of them.
(imported from commit 68582224962da14795d91a68197db1001ae7b75c)
2013-03-08 17:45:58 -05:00
Tim Abbott f37c6e7a1a do_create_realm: Use internal_send_message.
(imported from commit 92edff133d16f72cf954671392e413066fb22955)
2013-03-08 17:24:33 -05:00
Tim Abbott a6c461e3e0 internal_send_message: Render content before sending.
(imported from commit 00b80c71ccf5b1388d64cf8b6a2cb21b818ece4a)
2013-03-08 17:24:33 -05:00
Tim Abbott 254bc9f361 Attempt to render messages before accepting them from the user.
This fixes trac #407.

(imported from commit e33647eec32266790f864d14ad377d51956d2a6f)
2013-03-08 17:24:33 -05:00
Tim Abbott 2f022ebb34 bugdown: Allow caller of convert to tell whether we succeeded.
(imported from commit 9e3cab73e0d9e9ad31ba770210e535584cca3bb2)
2013-03-08 17:24:33 -05:00
Tim Abbott a22c5e63a8 create_user: Remove unused import.
(imported from commit 7a2a7c171b87d8098c0a589c1e6228c0b131eba1)
2013-03-08 17:24:33 -05:00
Waseem Daher 0e2e754c3d [manual] Use Twitter API v1.1 for inline previews.
This commit adds a dependency on python-twitter,
whose upstream is at https://github.com/bear/python-twitter,
and which for now needs to manually be installed on our
servers from the Debian package in sid.

(imported from commit 80cd9f4f59a6f0de6b75ac95e412c69e2a2e2490)
2013-03-08 17:10:06 -05: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
Jessica McKellar 2f644f8439 Add a management command to clean up lingering tutorial streams.
We now clean up the stream subscription in more places, but some
historical tutorial streams are still around and if an error or page
reload happens during the tutorial it'll stick around.

(imported from commit 8cf0ebda26bf752c1a23296a4ba85d194bbb3004)
2013-03-08 17:01:11 -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
Tim Abbott 4ab5cabb80 bugdown: Split out iteration through a tree into helper function.
(imported from commit ba73832c61eccdefe45f8e0d935216e6cc431176)
2013-03-08 14:31:17 -05:00
Waseem Daher 68fc8e161f github: Suppress pull request notifications for CUSTOMER18.
(imported from commit adacd7ef23b1762276888c9bda5c69fd6c89ede4)
2013-03-07 22:15:54 -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
Zev Benjamin ebb095d0ce tests: Basic compose box tests
(imported from commit e1e7fc1f9efec464f1a86c1a8b39c1a6db207adb)
2013-03-07 14:30:08 -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
Waseem Daher 68e7a052cb Remove the link to 'activity' from the gear menu.
I find that I never use it, and I don't totally like our
experience in the app to be different from our users'.
Admittedly, this is a small way in which that's the case :)

Finally, since we do usability studies in @humbughq.com,
the link appears there too, and I'd like it not to.

(imported from commit 1225c4ae79de52fa98b21ce00a6542df76b667ea)
2013-03-07 13:12:45 -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
Waseem Daher 4ea7ac102f Allow internal_send_message to send cross-realm stream messages.
Prior to this change, any stream message sent by internal_send_message
could only be in the realm of the sender.

This was a problem most notably for... the tutorial bot, with the
hilarious consequence that the tutorial worked fine in humbughq.com,
but failed to start anywhere else.

(imported from commit 33a904a28e3a57e1a2cf9172c2e2a75b50967a50)
2013-03-06 23:04:57 -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
Reid Barton bc0dbbb566 Detect image-ness by end of path component, not end of entire URL
(imported from commit 9dd2e9c7273d3c7d071a8e5f82014e28b2a99ee4)
2013-03-06 19:02:29 -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
Waseem Daher f7d189feb8 Don't send GitHub notifications (for CUSTOMER18) if not to master.
People make throwaway branches all the time, and we don't
want to spam them.

(imported from commit 0e7b628573ad1a6a7f49d3c4b4135c7d3a911834)
2013-03-06 17:30:52 -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
Tim Abbott acab720502 Add support for making Tornado dump its stack via SIGUSR1/2.
With this change,

pkill -SIGUSR1 -f runtornado

will dump the stack and SIGUSR2 will enable an interactive debugging
session.

This fixes #613 for Tornado which was the original motive for that
ticket; I'm not sure whether we want to do this for our Django
processes as well, but it would be easy to do so if we did.

(imported from commit a7de7c6070f4bf0404bed6f434e6a6b291d66a26)
2013-03-06 14:19:32 -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
Jessica McKellar ac305ffc1d Add a management command to deactivate a user.
(imported from commit 14ef58bdd2cd20c05c68cd53cf911711d3bdb5fd)
2013-03-06 11:57:04 -05:00
Tim Abbott 0c62dcc9f6 tests: Move casper.page.onError setup outside casper.start().
This has no functional impact, it's just for clarity.

(imported from commit 2ec1948929df120a3a410324412912ec062b8500)
2013-03-06 11:36:15 -05:00
Tim Abbott b861e19654 tests: Write screenshots for all casperjs failures to /tmp/.
(imported from commit 4e1a54b89fce76c6923157967ade3d525f5c7f30)
2013-03-06 11:36:15 -05:00
Tim Abbott 0fee4e8d9d tests: Set casperjs viewport size to a reasonable browser size.
Otherwise we're by default testing the phone size layout, which
probably isn't what we want the default test setup to be.

(imported from commit a76b2d51c18824b0a5f6342cce848aca87dda15a)
2013-03-06 11:36:15 -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
Tim Abbott 27d91eb9ea Fix including debug.js when DEBUG=True.
Previously, it wasn't actually included in the index.html templates.

(imported from commit b9f9903e0daa808ec1f6ff966309cbc4eef9b9fd)
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
Zev Benjamin a84947eade tests: Don't regenerate the test database every time we run tests
This cuts about 6 seconds off of the test startup time on my laptop.
The other startup costs are about 1 second for the server to come up
and about half a second for casperjs to begin executing tests.

generate-fixtures now takes a '--force' option that can be use to
force a regeneration of the test database.

(imported from commit 1f473507502f0edf159b2638abb392d9357eb46f)
2013-03-05 17:26:50 -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
Waseem Daher 0dee6235cc Don't image-ify :( and other smileys 😞
(imported from commit 25323f19572c24da36267064a1ca820d80c9db79)
2013-03-05 16:22:51 -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 eadb2ea6d3 Update casperjs to 1.0.2.
(imported from commit 9e34b51c4588dce6419ea86024b2e8c06346a685)
2013-03-05 15:10:32 -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 0891f3e4e5 tests: Actually wait until message is sent on send_message.
Previously, using e.g. the search box would be problematic because the
compose box closing event might fire, blurring the search box, in the
middle of whatever you were doing.

(imported from commit cc045f5a6a7b7fbf72848da14b6fcd3df39cab05)
2013-03-05 15:08:47 -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 3b8ae6b006 Unsmush the "Add members" textbox on the streams page.
(imported from commit abfb2cdfd9dbd2b10abf1968fd84b625dc01083a)
2013-03-05 14:52:57 -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
Zev Benjamin 86f5030587 tests: Allow frontend "run" script to accept a list of test files to run
(imported from commit 1d29be561bf6a2501797d4875b9deb43eb560fb3)
2013-03-05 11:57:24 -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
Zev Benjamin e588323f5d tests: Move log int and log out functions into a common.js
(imported from commit d6c2f45af775dea9c99426aa46b08ed45eb76d17)
2013-03-05 11:05:12 -05:00
Zev Benjamin d5493ed580 tests: Split site.js out into 00-login.js and 01-site.js
(imported from commit cdd3b2c675b6ae33456377546424fcc5cad58cf5)
2013-03-05 10:32: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
Jessica McKellar 30c7bdf018 Fix bug in colorize_streams that tried to include non-streams for colorizing.
(imported from commit 286a6ab38513303968b3c476ebd528a3ab2cacf1)
2013-03-04 16:30:23 -05:00
Waseem Daher 7d97a739df Don't let tutorial break test suite.
I don't actually have this problem, but Jessica et al tell me that the
tutorial bot's messages sometimes arrive too late for them and it
interferes with the test suite's ability to run correctly.

I add a delay which should hopefully reduce the occurrence
of this issue.

(imported from commit 0f41610ada7dd49d71f0deef034e014164357197)
2013-03-04 16:27:14 -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 1650dba322 Intelligently preview Dropbox image links.
Even though they look like images, they're not -- you need to
append ?dl=1 to get the image version.

(imported from commit 2a05e7c58f475c908687110d9191f8709425c660)
2013-03-04 10:38:42 -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
Tim Abbott 02bf89c3c3 Add inline previews for images and youtube videos.
(imported from commit 13711a7821318c8bff7c483e874756a63d761c15)
2013-03-01 14:21:35 -05:00
Keegan McAllister ac1c111489 Fill in default recipient when composing while narrowed
Fixes #977.

(imported from commit 1abe26d94d5179a3dd1e970224a36c63bba9ff48)
2013-03-01 14:10:51 -05:00
Jessica McKellar bfbdb94ecf reply fading: get the table from current_msg_list.
(imported from commit 88e504b989a6ee66d162edb424d27765bd5f2ba8)
2013-03-01 13:29:04 -05:00
Jessica McKellar c516ce98e9 Calculate neighbors for replying-to messages fades based on window height.
(imported from commit 522025f16655fc1aa9776f08e991aab05a407ad4)
2013-03-01 13:29:04 -05:00
Jeff Arnold 06a44077aa Prevent multiple enters from sending duplicate messages
(imported from commit 872bb9971a6af3e352318665559e00b502dfb880)
2013-03-01 11:55:01 -05:00
Tim Abbott cad295b9d9 narrow: Fix incorrect default then_select_id.
Previously we defaulted to current_msg_list.selected_id, which was
fine if you were narrowing from the home view, but if you navigated to
a narrow with no messages in it and then clicked something in the left
panel or used the search bar, it wouldn't work.

Fixes trac: #870.

(imported from commit 5ee480d8d2b1fb300fccbe75e04135d977a1fc07)
2013-02-28 17:49:57 -05:00
Tim Abbott a7b466118e Add narrowing by sender to the info popover.
(imported from commit 92bd56e9bf4a482b499fe31919a43b363f328f9b)
2013-02-28 17:49:57 -05:00
Tim Abbott 36bb39ede9 Fix improperly case-sensitive narrowing by subject.
(imported from commit 24403f0815e46f21000f7d5a5b59bfdfe3448ddf)
2013-02-28 17:49:57 -05:00
Tim Abbott 1e9a85ff05 Fix use of case-sensitive comparisons on email addresses.
(imported from commit d420169640a9f9c034b3d9ded207e583691f6652)
2013-02-28 17:49:57 -05:00
Tim Abbott 096df2d3da typeahead_helper: Rename render_pm_object and cleanup usage.
(imported from commit 28bca00802e189daed22dcabba1241ef2625536e)
2013-02-28 17:49:57 -05:00
Tim Abbott 49af19aa71 Add support for narrowing by a message's sender.
Fixes #972.

(imported from commit 2514d14c94a071f2b3e6149a2bdaeaa00e0c847f)
2013-02-28 17:49:57 -05:00
Jessica McKellar a03a639cce Add a management script to set stream colors for a domain.
(imported from commit 186e8226b57d385bbbed756615c0c63315c9d463)
2013-02-28 16:41:44 -05:00
Luke Faraone 40ad84b363 Introduce script to bulk-create activation URIs.
(imported from commit 12435d8f0d48833f52a699c0d8a0c9ec0750e6af)
2013-02-28 14:34:18 -05:00
Waseem Daher 6743d0e4fa Disable the tutorial as part of the test suite.
It's causing unexpected messages to appear.

(imported from commit e80a8cd43a771c4d06a7147e06b21246f47de316)
2013-02-28 13:23:13 -05:00
Keegan McAllister e8dff94bfc Clear the search box on blur if not searching or narrowed
Fixes #978.

(imported from commit 5aefa1bf369e01e4cb6df15478080a793116628b)
2013-02-28 12:29:52 -05:00
Keegan McAllister db58ede658 Move some search UI code from ui.js to search.js
(imported from commit 4e761636769b320431d34d00bfed6b2ba888fa55)
2013-02-28 12:29:52 -05:00
Tim Abbott a689e704ac tutorial: Clarify the initial reply instructions.
The first change might somewhat address users asking "does it matter
which one I click on?" by not being specific that one should click on
_this message_.

The latter I think addresses a small confusion I've seen where people
try try to hit tab before starting a reply.

(imported from commit 708acdf4d4c80713795b96b1a59d681a88604670)
2013-02-28 11:37:53 -05:00
Leo Franchi 87d294de49 Prepend messages to all_msg_list when loading old messages
(imported from commit cbe862b2ac133a365d0da28f3b761868e01eb48f)
2013-02-28 11:36:41 -05:00
Jessica McKellar e3e5a0656d Wait until after reset_load_more_status to select a message upon narrow.
This is the fix for https://trac.humbughq.com/ticket/958 (Narrowing
moves the pointer) proposed by jhurwitz. Currently on master,
narrowing can cause you to end up wildly out of place.

This branch is not a perfect fix -- you do end up with the pointer on
the expected message after the narrow, but that message is centered on
the screen; better would be for that message to not move at all.

(imported from commit b89e4e2c896add20eceb609db46c46dc025fdce2)
2013-02-28 11:31:58 -05:00
Waseem Daher 6cceda503f Hide the 'Send' button when Enter sends.
Like Facebook does.

Fixes Trac #1019.

(imported from commit 62bd35026ed532d5cb35be9bef5eecd5f63b34de)
2013-02-28 00:00:27 -05:00
Waseem Daher dcba1e3f46 Cause shift-enter to insert a newline, even if enter sends.
This fixes Trac #1018.

(imported from commit 9f1bc3ef3c86077a8852ba7fd23a184a4eac9e68)
2013-02-27 23:42:58 -05:00
Waseem Daher 41c0605fe6 Cause the composebox to be on top of the "more messages" popup.
If this is not the case, then you can't actually click the
"Press Enter to send" checkbox in the composebox (or anything
in the space occupied by where the popup will go).

This actually is not a perfect solution because that area still
remains unclickable for anything else. (In particular, for example,
scroll a message's "Info" link and then try to click on it -- you
can't! The click is captured by the #notifications-area div.)

http://www.vinylfox.com/forwarding-mouse-events-through-layers/
proposes an alternative more general way of dealing with this,
but it seems like a real pain.

This fixes Trac #1017.

(imported from commit 9cfde1cfff63ab32ae7d129980c47567e221eac3)
2013-02-27 23:42:58 -05:00
Waseem Daher 4e4e15bb4a Allow you to click the 'enter sends' label to toggle the checkbox.
(imported from commit 2c0d6d2547adb5233589765fa2ef851f1712ee52)
2013-02-27 23:42:58 -05:00
Jessica McKellar 6a56ed0c94 Add a button on the Settings page to declare Humbug bankruptcy.
(imported from commit 6ca635e997ada54b816abe3425980102ad8f5d2c)
2013-02-27 18:16:51 -05:00
Jessica McKellar ff62ac96e6 Extend get_profile to also be a JSON request.
(imported from commit 38e0d5a9aa2498ffcdfa65b07283a456257feafd)
2013-02-27 18:16:50 -05:00
Jeff Arnold fcd033e33e [schema] Save enter_sends on the server in the database.
(imported from commit 4d82f6aaf5918f155a930253c9cc334dbcc0d97a)
2013-02-27 17:25:29 -05:00
Jeff Arnold ebb9be1ead [south] Add enter-sends field to UserProfile model.
(imported from commit e8a153bdcbe4abc00a7361c85c1347ec2bf39efa)
2013-02-27 17:25:15 -05:00
Jeff Arnold 221d3a6740 Introduce an "enter sends" checkbox that defaults to off
(imported from commit abd0f260acac9fa92c651dc677e636781d75e6fd)
2013-02-27 17:19:08 -05:00
Jessica McKellar 4e193377dd Fade out messages surrounding a reply message, to make mixing harder.
(imported from commit da150ad2f0877d058e1a60deb7a7632e52bd3533)
2013-02-27 15:02:47 -05:00
Keegan McAllister 29b98e5546 Display invalid links as plain text rather than linkifying with empty href
Fixes #1001.

(imported from commit 116df72f37e45dd87c34cd836918dd559630fe76)
2013-02-27 11:29:05 -05:00
Luke Faraone d48fdcc781 Show button to enable users to log in with Google.
(imported from commit 52343e7e408c46f148b88e5eede9167fc77edce5)
2013-02-27 10:16:54 -05:00
Luke Faraone e1cdbd14d3 [third] Import zocial from http://zocial.smcllns.com/
This import strips other icons we aren't using from the CSS definitions and
fonts.

Licensed under MIT.

(imported from commit 02cc2681a1cf44107444b6fe70420afca6950ae2)
2013-02-27 10:16:54 -05:00
Luke Faraone 0fe0cf0ffb [manual] Implement backend support for authenticating a user via Google.
This code adds a dependency on python-django-auth-openid, installable as
django-openid-auth from PyPI.

On prod, one needs to run a syncdb in order to create the required
tables. A database *migration* is not required, as these are new tables
only.

(imported from commit c902a0df8d589d93743b27e480154a04402b2c41)
2013-02-27 10:16:54 -05:00
Waseem Daher 801723b45c Recenter your message in view after you unnarrow.
In Safari only, if you narrow to something and scroll all the way back
up to the top and then unnarrow, your position actually remains all
the way at the top!

We explicitly call a "scroll_to_selected" as the final step of
deactivating a narrow, which brings this message into view.

This doesn't seem to be an issue on Chrome and Firefox, but I'm not
quite sure why; something about the sequence of events.

(imported from commit fc73640351be03c02eb2f3c8a23de3327723f002)
2013-02-27 09:14:54 -05:00
Keegan McAllister cc19afd0fe Re-enable desktop notifications in automated testing
After c1d98239 the function works in CasperJS as well.

Reverts some of 90f4d6ac3ddb387e74051b9af2c230698fa94479.

(imported from commit 3579df33930bb34dc081908b84900905eee6d270)
2013-02-26 18:02:20 -05:00
Waseem Daher d3ebe22a58 Allow Safari desktop notifications.
Apparently the Safari version of requestPermission wants to take
a callback function as an argument and gets unhappy when you
don't give it to them.

I learned this tip from http://www.inserthtml.com/2012/07/html5-app/

But more importantly, from the draft spec at
http://dev.chromium.org/developers/design-documents/desktop-notifications/api-specification
mentions that requestPermission takes a callback function that is
invoked once the user accepts.

(imported from commit c1d98239028ffce2e294568c5711315f985160a3)
2013-02-26 17:51:31 -05:00
Zev Benjamin fc085cbd77 Add a bottom border to the left sidebar streams list
The idea here is to better hint that the list is scrollable.

(imported from commit 75a415535f47807ef146d4dc9a2806d193d31fe7)
2013-02-26 17:18:56 -05:00
Zev Benjamin e7604e170a Make left sidebar HTML more standards-compliant
(imported from commit 4cfc7789d4b930ea074596ddf06d16638e91c9a2)
2013-02-26 17:18:56 -05:00