Commit Graph

3926 Commits

Author SHA1 Message Date
Leo Franchi 2d4ba0ed4b Set Reply-To to noreply@ explicitly in all required cases
It seems that even though we set the From to be <noreply@humbughq.com>
it's possible that when sending mail via Google it automatically sets
the From: field to be humbug@humbughq.com. Here we set Reply-To to noreply@
in all cases explicitly in order to avoid having replies sent to our
inboxes.

(imported from commit 5fa643be2b78fd632e310836bf1be862d6f1d333)
2013-07-10 17:38:37 -04:00
Steve Howell e736e393aa Show errors when deleting bots.
It's pretty unlikely these will come up in practice.

(imported from commit 6d809a8c98bfa09e69541d7dfd02094c16273c18)
2013-07-10 17:23:20 -04:00
Steve Howell 97994ea7a9 Shorten private operator (private-message -> private).
(imported from commit f938bd56de05cc8fc0da18348d4dec8a18c96bb9)
2013-07-10 16:58:17 -04:00
Steve Howell 43602b589f Shorten mentioned operator (mentioned-message -> mentioned).
(imported from commit 5104f75a7ed19f533ab5bca466d3e017c72bd1b8)
2013-07-10 16:58:16 -04:00
Steve Howell 600964b1de Animate removal of bot from the list.
(imported from commit 4c7e7aa07fa58c924ed78dbdc1d81c6e4bb28756)
2013-07-10 16:19:22 -04:00
Steve Howell c27e1105e5 Allow users to deactivate their bots from the website.
(The back end had been in place already.)

(imported from commit ec4b7b3ea39d71d86b0bdc161740e494ce1e13f7)
2013-07-10 16:19:22 -04:00
Tim Abbott 227995e971 narrow: Don't crash computing then_select_offset for offscreen then_select_id.
Unlike the other cases where we do this sort of offset calculation,
we're working with a message which is not msg_list.selected_id() --
which means that this message might not actually be rendered at all.
Correct for this by just letting then_select_offset stay undefined in
that case.

(imported from commit ebb8a23bf34c52f9495aa88ceca8eb4458d50be1)
2013-07-10 13:21:08 -04:00
Kevin Mehall 54d85c68e2 Avoid the focus border around modals.
(imported from commit 9f0111f9d858ab2f058e2c75c8cb00a3716cdfed)
2013-07-10 12:31:32 -04:00
Kevin Mehall c190be38fe Make modals shrink to keep buttons on the screen.
This works down to about 330px height, and is probably about the
best you can do with current browsers in pure CSS.

See also: http://caniuse.com/#feat=viewport-units

Trac #786, Trac #1416

(imported from commit eeb931bb34aa6414fdf1b61db68c6aede1808a58)
2013-07-10 12:31:32 -04:00
Kevin Mehall 4f68cf939e Don't show the subject typeahead when it's not helpful.
When it's not offering any other suggestions, suggesting what
you've typed is unnecessary and confusing and it should just
hide completely instead.

Trac #1476

(imported from commit ff69bb53c661e0a3a193dbddde6e7a4ff8b10031)
2013-07-10 11:41:12 -04:00
Jessica McKellar 6719854961 Make the tutorial popovers visible even in thin windows.
(imported from commit 0cec5db8b3a881ac1850210bd5ff4563ce2ad699)
2013-07-10 11:20:22 -04:00
Tim Abbott 98f6a20900 Fix selector when picking a custom color.
This seems to have been somehow introduced in the refactoring to move
the popovers into their own file
(36ad3c61e4d7eb05751f9b886d15edceab656d71).

(imported from commit f5f58844a9c2da4b4433489be1772263f3aba350)
2013-07-10 11:09:56 -04:00
Steve Howell 86930191ae Show up to 5 subjects in left sidebar (8 -> 5).
(imported from commit 78888034a2b71617dd6f639b4e7db4beedbb5fa5)
2013-07-09 22:30:28 -04:00
Allen Rabinovich 2176ca0977 Fix unread indicator in FF by moving the pseudoselector to an inner div that supports relative positioning. Position the indicator based on whether the sender avatar and name are included in the message or not.
(imported from commit 305343bceb8656c380afd2100220afc0d0777540)
2013-07-09 15:12:51 -07:00
Tim Abbott b8c40119a2 Don't 500 when users try to make their name super long.
(imported from commit 0c5e8baa421ed8cbff431bc5085ffe78b0a8fc1e)
2013-07-09 17:43:47 -04:00
Tim Abbott ce365829f1 Fix traceback checking for new messages on empty narrows.
(imported from commit da0ba189f23fecdee376066db956e1320bca4deb)
2013-07-09 17:43:46 -04:00
Waseem Daher 7d7330df03 Bring the floating recipient bar closer to the tab bar.
I feel bad about this commit because it really only exists
to fix a math error elsewhere -- it's basically a hacky solution
to Trac #1426 that doesn't involve actually fixing the math
that exists in the app somewhere, but instead makes our app
conform to that math.

(imported from commit ad43bf9440b80fd768c5fa1cbe5cb4a683415c02)
2013-07-09 15:36:20 -04:00
Tim Abbott 9cb2cb07d5 populate_db: Tweak the humbughq.com realm's default streams.
(imported from commit c13e68e4e3de9d689eb494709c7de54c5a063060)
2013-07-09 14:35:02 -04:00
Tim Abbott 679f29ddf7 populate_db: Clear memcached when deleting database.
(imported from commit 58f01a6922cf8b20c08ca9157d08f3c553764da5)
2013-07-09 14:35:02 -04:00
Jessica McKellar 20a43706f4 When you change a stream color, also update the floating recipient bar if applicable.
(imported from commit 121f48887a18f22ec173ad5e540d040859f2bf62)
2013-07-09 14:22:42 -04:00
Jessica McKellar 2b10ccf03a When you change a stream color, also update the color in the crumb bar.
(imported from commit 187c1738f4a7bf3f888dfccca315feeeb2137f4d)
2013-07-09 14:22:38 -04:00
Jessica McKellar 3c1b59d840 Fix updating the stream color in messages.
(imported from commit 5d38cf7864ddeb489ca653ac568ee9c738577711)
2013-07-09 14:20:41 -04:00
Steve Howell 6347bdfcc8 Starring a message makes it read.
(imported from commit 80c1af9e34f4904266a64d89c57cd82e84c02b48)
2013-07-09 09:57:20 -04:00
Steve Howell 1edd9a1d9f Fix scroll-to-the-middle bug.
(imported from commit dcd102541c8ee2b341060def714c24b05f2db514)
2013-07-08 23:11:09 -04:00
Waseem Daher cf710708df Add a little space between startup checkboxes and their options.
(imported from commit 0168e9ba4173e92d0c0c01250c8f63e25918a016)
2013-07-08 23:02:56 -04:00
Waseem Daher c89b662ce6 Give up on "pin tab" and instead push for "get app".
(imported from commit 2aacc547bbe4578c19bc6044183eb06005f2e666)
2013-07-08 23:02:56 -04:00
Tim Abbott 849cf69f61 Fix scroll position when updating messages.
(imported from commit 8d6eb0c1cb980f3d5ad46370ae0f05355bcbeb33)
2013-07-08 22:26:17 -04:00
Allen Rabinovich c999019ae3 Add highlights to selected filters and streams/subjects in the left sidebars, as well as a pointer arrow
(imported from commit 5c799a19c5bde52705c60e1b9fdae832bd5474f0)
2013-07-08 19:09:52 -07:00
Steve Howell f87b27a9c3 Bold @-mentions link when you click on it.
This fix also cleans up the search operators so that @-mentions
and Private messages have a more similar naming convention.

(imported from commit fb1a2119aab5aa9e179c6e321a8d2ef2e90290cf)
2013-07-08 22:04:28 -04:00
Waseem Daher 58e57d7462 Revert "Increase bottom_whitespace to be most of the viewport height."
This scrolling behavior is driving me crazy on staging.
Reverting until we come up with a better alternative.

This reverts commit 41954fecd9efb43820ed1ccb5210283c17752f51.

(imported from commit 2db602cf51ca734b00ec1bd454c39204468fa024)
2013-07-08 21:04:52 -04:00
Allen Rabinovich 9c81056962 Remove gradient from unread messages
(imported from commit 1dbf0d81884bb45f3f67453e75acbc77aea43293)
2013-07-08 17:26:00 -07:00
Scott Feeney ba71013b7c Hide a popover when showing a different popover
This is one case I forgot from the last commit. For example, if the
message actions popover is open, and you open the user sidebar popover,
the message actions popover should close. It now does.

(imported from commit a241634cb1aabf8883cf95ebd5b8ba96f5ed9908)
2013-07-08 18:58:08 -04:00
Scott Feeney 6030abb888 Fix clicks not dismissing popovers (Trac #1435)
A cleaner, more general solution would be nice but this fixes at least
the most obvious cases for now.

(imported from commit fc7260e25a4f2172eee74af9c2d9384898947ad3)
2013-07-08 18:53:20 -04:00
Scott Feeney d23e8d8a30 Simplify and fix preventDefault -> stopPropagation
(imported from commit 3cb84804027b67662392e5a7c75bfb0603b9318d)
2013-07-08 18:53:03 -04:00
Scott Feeney c42bf9b9b2 Refactor popovers into their own file
(imported from commit 36ad3c61e4d7eb05751f9b886d15edceab656d71)
2013-07-08 18:53:03 -04:00
Luke Faraone cfe9e268f4 Do not specify cascade=True in deactivate_user_backend.
This was mistakenly included from a previous iteration of the do_deactivate()
function's interface.

(imported from commit 0a6ddc5ba1dfe944f2cc0087c590046da6a73531)
2013-07-08 15:44:01 -07:00
Tim Abbott 7540ad6234 Fix tracebacks from prepending messages after narrowing.
(imported from commit 6bed33975ee80c324270b518e0dcb807c1f1df41)
2013-07-08 18:18:48 -04:00
Luke Faraone 2c83d015a9 Refactor bot deactivation view to cover all users and expose via REST
(imported from commit 9f7afb3b43ed14db0bb4217dbae4114846bb840b)
2013-07-08 18:00:28 -04:00
Allen Rabinovich d4da8570bd Change the unread message style to a top-left corner marker and a full messagebox diagonal overlay gradient
(imported from commit dd171437bdd40219584774bc38c77798fa1568e2)
2013-07-08 14:36:55 -07:00
Tim Abbott 54c32992fd Fix hitting down-arrow at bottom of message list.
Previously the viewport.scrollTop() command that we ran in this case
would actually scroll far off the bottom of the site; it only did
something that looked reasonable because bottom_whitespace was small
and thus the scroll was truncated.

This version scrolls to 10% of the viewport away from the top.  We may
need to tweak that to instead be a fixed number of pixels or something.

(imported from commit 0176bf6e3662dfa24887f41b110b429bd8054cb0)
2013-07-08 17:32:18 -04:00
Tim Abbott 0e8c55395c Fix save/restoring scroll position when toggling in_home_view.
Previously the code to save/restore the scroll position when toggling
a stream in/out of the home view would only work if you were currently
not in the home tab -- because you used to only be able to do this
from other pages.

(imported from commit 4002a3980dfd87dabd570abee3ebc63417a78cc5)
2013-07-08 17:32:18 -04:00
Tim Abbott 641377e7e0 Add messages at bottom when message list is empty.
(imported from commit d15ff7ddb39e30ca08dd9d0eccf3dae75414a3ef)
2013-07-08 17:32:18 -04:00
Tim Abbott 43279b99ff message_list: Clear rendering window when clearing message list.
(imported from commit 5eefbced42e9ab987e4e2d60332f1d416df605af)
2013-07-08 17:32:18 -04:00
Tim Abbott 166a9c9635 Return the viewport to a corresponding position when unnarrowing.
(imported from commit d1cb35b175a23e18ed79537843ce7940ec370cf3)
2013-07-08 17:32:18 -04:00
Tim Abbott 0d5469f6ab Preserve the location of the selected message when narrowing.
(imported from commit 38230a79d3bb2c403e20ed9b40b04731c0312325)
2013-07-08 17:32:18 -04:00
Tim Abbott 9145246ace message_list: Don't leak date row headers when prepending messages.
(imported from commit 794c668dd79f89000e6559c0d96c78832e4e43d0)
2013-07-08 17:32:17 -04:00
Tim Abbott bdaacc5393 Don't call msg_list.append/prepend with empty arguments lists.
This can cause unnecessary work to be done.

(imported from commit a33d69598531b6a99520f92cbbac1fdb7eb9ee49)
2013-07-08 17:32:17 -04:00
Tim Abbott a158ee233a message_list: Preserve the scroll position when prepending.
Previously, we had some ugly complicated logic through which we
attempted to keep the selected message on screen when prepending
messages, but we didn't actually preserve the scroll position -- the
selected message would jump on the screen.  This fixes that, by just
saving/restoring the scroll position of the selected message.

This perhaps makes our model/view split even less clear, but at least
it's correct.

(imported from commit 0a01450bbbcdf1b45c891d0570c9fcfb11769315)
2013-07-08 17:32:17 -04:00
Tim Abbott 24055e894e message_list: Fix prepending of messages.
message_list.prepend() now actually only rerenders the new messages
when prepending using the where="top" functionality (previously it
would erroneously just adjust the message database and then wait for
message_list.append() to call _maybe_rerender(), determine that things
are awry, and rerender the whole message list).

(imported from commit c64b7b540a4f5332ad792de0fad9f20750e6db1c)
2013-07-08 17:32:17 -04:00
Tim Abbott e5c96fb3ad Increase bottom_whitespace to be most of the viewport height.
This has two benefits:

(1) Users can scroll their last message to near the top of the screen,
which decreases how often one needs to scroll down to track current
messages.

(2) It makes scrolling bugs near the bottom of the screen a lot easier
to find, because scrolling down too far isn't blocked by being unable
to scroll messages off the screen.

We should probably later convert this to some formula that varies
dynamically based on the height of the last message.

(imported from commit 41954fecd9efb43820ed1ccb5210283c17752f51)
2013-07-08 17:32:17 -04:00
Tim Abbott f48097b609 recenter_view: Always place the initial pointer at the center.
It turns out that this code tries to place the initial pointer 1/7
from the top; the only reason something reasonable happened
historically is that bottom_whitespace was only 40% of the screen, so
the pointer message ends up landing in the center anyway.

(imported from commit 56d4c2acd018d9a87551c82a43c214c6d80bfb90)
2013-07-08 17:32:17 -04:00
Tim Abbott f10d3d5517 Only autoscroll for messages that arrived via get_updates.
Previously we incorrectly would sometimes trigger autoscroll when
messages arrived via get_old_messages (i.e. we loaded some historical
messages from the server).  This resulted in some confusing and
erroneous scrolling behavior.

I kinda hate the fact that we need to pass these values all the way
through the rendering process, but fundamentally there's no other way
for _render to find out, and pushing the autoscrolling higher up in
the stack is hard since we don't return anything like the block of new
messages.

(imported from commit c5ed27f1b21691a21c68ed7e09cff8e3e4a75e76)
2013-07-08 17:32:17 -04:00
Steve Howell a90a155e03 Make narrow.by_recipient 'read' a message.
(imported from commit aadefa6be8f04a033d278050eb1d5135d5b1bdc5)
2013-07-08 17:12:32 -04:00
Steve Howell 0908f15109 Make narrow.by_subject 'read' its message.
(imported from commit e81140c440fecd283443eab46f0c65faffee8df1)
2013-07-08 17:12:32 -04:00
Steve Howell 465728da37 Move functions inside zephyr.js (cosmetic).
This is purely cosmetic, and just puts some similar functions
together in a way that JS lint won't complain about calling a
function before it was defined.

(imported from commit 8a5a81ae5b7ca7dbaa60147ae4f32f50b1cbbf3a)
2013-07-08 17:12:32 -04:00
Steve Howell 01d96ee7fb Mark messages as read when beginning a reply.
(imported from commit 9743e044dbb7570edcb341ca726369a673fc3db9)
2013-07-08 17:12:32 -04:00
Luke Faraone 09249ffa3b knight should dry-run unless you specify -f
(imported from commit fd0e5af1d941c6fadcbc14ff7f86f71a170a503e)
2013-07-08 17:07:55 -04:00
Luke Faraone 2daf8db3a5 Add a parameter to knight.py to remove user rights.
(imported from commit 4527955f688298ba56296e9f24d42e33f7d04948)
2013-07-08 17:07:55 -04:00
Luke Faraone f22abf2b8a Add a management command to create realm administrators.
(imported from commit ab2dd580a206f29086c0d5a4e717c1bfd65a7435)
2013-07-08 17:07:55 -04:00
Luke Faraone ae03ff408b [manual] Define realm.administer permission
To apply this to your system, run:
    python manage.py update_permissions

A rebuilt database will already have the correct permission defined.

(imported from commit 5b826b940257e14b3e9e44f9c32b20ed0183dedf)
2013-07-08 17:07:55 -04:00
Luke Faraone 6988490980 Add a management command to create objects for newly defined permissions
This script does not remove permissions that already exist.

(imported from commit 15d18266a05a84b9cac6cc7d2104668b41b48f35)
2013-07-08 17:07:55 -04:00
Luke Faraone 93ce1ff431 [schema] Add PermissionsMixin to UserProfile
This creates the required model fields to use the Django permissions
framework or various other third-party frameworks.

To apply this commit, run:

    python manage.py migrate zephyr

(imported from commit a14fa7552c5389522d15edecedfd8a34418bb23d)
2013-07-08 17:07:55 -04:00
Kevin Mehall 9cb5c23da9 Removed unused rendered_content argument
(imported from commit 214d0dac63bb4e7fc4fd477ab1e22a0f2e65227d)
2013-07-08 16:53:13 -04:00
Kevin Mehall a7c91bce1b If there is no rendered_content in the database, render it and
save it. This fixes the "Humbug note:" error on old messages that
do not have rendered_content in the DB.

(imported from commit f4664d712fc40e4af9eb12eae74f37d100499def)
2013-07-08 16:53:13 -04:00
Jessica McKellar dd53c1fbe3 Keep the compose box open on a buddy list-initiative PM.
(imported from commit aabfec328a3c1b64aab653ddcbe04568f5742727)
2013-07-08 16:36:32 -04:00
Allen Rabinovich 0e28fd608c Prevent mention overlaps
(imported from commit e39e9e00f7304d4b811169a5075c5dd98dadad61)
2013-07-08 13:03:31 -07:00
Allen Rabinovich 126f5e37e3 Lighten the appearance of mentions -- lighter colors, no inversion, no bolding, prevent white space wrap
(imported from commit e0acfce3332ce0693d15e8e1c6f22330c760028f)
2013-07-08 13:03:31 -07:00
acrefoot fdb597b4d3 v1 Emoji autocomplete
(imported from commit 0b0d4b004936ce4abc37f44317aec414451f3a8e)
2013-07-08 15:26:39 -04:00
Luke Faraone b6cfb40140 Allow for rest_dispatch-backed webapp API calls
(imported from commit 7813f1911bda92f76921159ef67dd60de9ca6465)
2013-07-08 14:30:20 -04:00
Luke Faraone 6a49e8aa1b Deactivate bots in deactivate_user.py
Closes trac #1434.

(imported from commit d60e338f77b5ee38a43c6cd3edb9b3de0cd0cacf)
2013-07-08 14:30:20 -04:00
Luke Faraone 29cb701444 Allow deactivations to cascade to bots
(imported from commit 1c42013dab02a8f264e814fef63c84cd03102458)
2013-07-08 14:30:20 -04:00
Luke Faraone 37edb61b67 Don't set an unusable password during deactivation.
This would have made reactivations hard, and doesn't really buy us much
additional security.

During deactivation, all a user's current sessions are deactivated and
they are marked as not active. This prevents them from logging in via
the web UI, and makes their API key unusable.

Randomizing their password is probably gratuitious, especially as we
start to allow authorized end-users to deactivate others.

(imported from commit c63d23816da0452a1df821f2fa6c1db2761733da)
2013-07-08 14:00:19 -04:00
Luke Faraone 573bb8e5fd Add populate_db support for deactivating users.
Prior to this commit, populate_db would crash if you had ever deactivated
a user in your development instance's message log.

(imported from commit 227b2c0226a46ef5680443d3dbf62a13ce961e64)
2013-07-08 14:00:19 -04:00
Luke Faraone e5031e5a0f Perform JS validation of the login form.
This reduces roundtrips hopefully and will provide a friendlier error
message than what would otherwise be produced by Django.

(imported from commit 034aeef00043e3bf059583770f6c08c4f73ceeb5)
2013-07-08 14:00:19 -04:00
Luke Faraone b715cd2034 Block API usage by deactivated users.
Previously we rested on the safety of randomised API keys to ensure that
deactivated users could not use the product. Here, we add an explicit check
to prevent that.

(imported from commit e32f355fb35b898d43503b96efb291f795aac881)
2013-07-08 14:00:19 -04:00
Allen Rabinovich 1b670f0f69 Desaturate background by 75%, lighten by 50%
(imported from commit 8b7ace11d0ecb776c33421ecda0eb31c9e24c07c)
2013-07-08 08:39:32 -07:00
Jessica McKellar fd4205d5cd tutorial: tweak the language of some of the popover titles.
(imported from commit 9a6ebdb39049c56137925dd30ff94b852256a0ba)
2013-07-07 19:30:12 -04:00
Jessica McKellar 867647a230 tutorial: don't try to restore event handlers added during the tutorial.
They end up being duplicate blueslip handlers, and they cause hotkeys
to not work.

(imported from commit 6240d1f2b00b3fe9f02ed2e64f2406b22fa4f6ea)
2013-07-07 19:30:12 -04:00
Jessica McKellar b535037d25 Always show the onboarding checklist if it's unfinished.
(imported from commit da5a84f7b70f5240f9bdd54b25719c3ed88fc1ee)
2013-07-07 19:30:12 -04:00
Jessica McKellar 03d6ec0819 tutorial: add missing info to un-collapse senders in the fake PM conversation.
(imported from commit 60518a9c704ab0a4a1ecc0ad6f5f506e9417437c)
2013-07-07 19:30:12 -04:00
Steve Howell 7a9d7aff0f Restyle list of bots.
(imported from commit 858f0c58b391d92f98b25cf9661543b7bac61865)
2013-07-06 09:49:23 -04:00
Steve Howell 9f95f3f07b Use handlebars for bot rows.
(imported from commit 0dfdb5dd49ec9e553bee0ef837b1010288cb1ea4)
2013-07-06 09:49:22 -04:00
Steve Howell 433f5daef5 Change bots table to a list.
(imported from commit 6e1163d8cab42dafa958a4d1c95f60ef927ef2c3)
2013-07-06 09:49:21 -04:00
Leo Franchi e09016c1e2 Mention our new apps on our /apps page
(imported from commit e1b1f467c72a90a84b54d867c7e31c6721439af0)
2013-07-05 17:56:14 -04:00
Allen Rabinovich 14d3a6b567 Remove unused CSS reference and an unused extra_cls variable
(imported from commit d94e8c432d476009bc729cf0cd889a7871ba26ff)
2013-07-05 14:18:08 -07:00
Allen Rabinovich 7b1a774a50 Remove background coloring and restyle crumbs
(imported from commit f08cb73ebc0cf35212ed2f2084bb524698a5b1f2)
2013-07-05 14:14:29 -07:00
Allen Rabinovich 1b703b0808 Change crumb bar coloring logic and some text: remove dark background from PM, change the name of Search to Search results, remove background recoloring from the entire crumb bar, set border color instead of background color on individual crumbs.
(imported from commit d2106675b3f06e014e41a67df82778ae04eea45c)
2013-07-05 14:14:29 -07:00
Allen Rabinovich 926cfc2cc9 Remove colorize_tab_outline class from the crumb bar tab list
(imported from commit bd2664dc05ea2a57826ffb4a000e70bcc2589812)
2013-07-05 14:14:29 -07:00
Steve Howell 249252f700 Put spaces after "function" in JS code (cosmetic).
(imported from commit 7579547bfed70b3e53122109d0d6f30ea01f5ac3)
2013-07-05 16:32:32 -04:00
Leo Franchi 26c66b17a9 Mark desktop apps as having sound enabled regardless of webkit
(imported from commit 478fdead0fa43b0706fd0af09c8d890eec0ce5e1)
2013-07-05 16:24:39 -04:00
Jeff Arnold 8f58647ff6 Don't let up/down close a compose unless the compose content is focused.
Fixes #1447.

(imported from commit 73603050680c526be3764dbaaa8ed747b76ead56)
2013-07-05 15:00:08 -04:00
Steve Howell 75ac44f9f3 Support deactivate_bot API.
(imported from commit 41eece8bf69a930e02eb4c0208cf25b5c283da16)
2013-07-05 14:09:32 -04:00
Steve Howell a3f965ea6a Add test_add_bot().
(imported from commit 07aa3e474e69473f2eb4b090aabcf48fd72f7a2c)
2013-07-05 14:09:32 -04:00
Kevin Mehall dce866fc0a Restore favicon.ico, fixing favicon indicator weirdness.
Deleted in 064c159, but it's still used. For some reason, nginx still
serves it on staging and prod despite it being deleted from git.

(imported from commit 11d6d29f974caca6c75d36f273674d3084ad9182)
2013-07-05 11:38:08 -04:00
Kevin Mehall 91268b16a8 Add unread message gradient with -webkit- prefix for desktop app and Safari.
(imported from commit d98720922665e9c3a41d15d8e91efc3235d93287)
2013-07-05 11:29:03 -04:00
Kevin Mehall 97b7b6ee33 Don't try to test message visibility when it's not in the current stream.
Fixes the JS traceback "'null' is not an object" introduced in b67e52d.

Testing: Receive a message when narrowed to a different subject, with
the window focused.

(imported from commit 54b9e7924a2bf66ba5cc9799fc3687a084496465)
2013-07-05 11:29:03 -04:00
Kevin Mehall 49e3ba7cb3 Make sure a message is in the list before trying to select it.
Fixes the JS traceback "Selected message id not in MessageList"
introduced by b67e52d

Testing:
  * Narrow to a subject and send a PM
  * Narrow to a PM recipient and send a stream message
  * Narrow to a subject and send a stream message to a different subject

(imported from commit 1171c3f97813dc7db891042906762be8afb2a1b5)
2013-07-05 11:26:18 -04:00
Tim Abbott 20c1e1bb8c Fix regexp for mit.edu on javascript side as well.
(imported from commit cf1bf6c78b7116a49436fe0de98abc4aad74e611)
2013-07-03 18:39:44 -04:00
Tim Abbott 58536354ad Fix regexp for mit.edu narrowing.
(imported from commit 1f82671de8a00ac6fb0fc649ed3f85a8ceaa388f)
2013-07-03 18:34:01 -04:00
Jeff Arnold b96f41a991 Honor the case of the user's subject in the first autocomplete option
(imported from commit 7820fc7c8c45498407f857c20755f1bcdc292e1f)
2013-07-03 18:08:46 -04:00
Waseem Daher 51f9ace595 Revert "Chevron icon on each message now causes a dropdown menu; hover on message for info"
This reverts commit f8fbf70c8502370a78159e24f3cf9589fb9d384f, since
we're waiting on some Firefox and no-hover fixes.

(imported from commit 6b13f5bb9d907303ab311afd7da584bc06538c91)
2013-07-03 17:44:35 -04:00
Steve Howell ccd759cc3f Remove dead code related to showing bots.
(The dead code made sense in the very early phases of sketching out
the feature, but it's no longer executed.)

(imported from commit 464145f227ddb25f0554bbbade0b0e3e0e399bc3)
2013-07-03 17:28:10 -04:00
Steve Howell 949d6bfc8c Clean up HTML construction for bot avatars.
(imported from commit ef9122ac739163d97b3142c7e300ce595eefa6f7)
2013-07-03 17:28:10 -04:00
Kevin Mehall 5999df005e Wrap option lists onto multiple lines where previous commits made them long
(imported from commit 856bd9f0082ef1a6e8d537316330c40266f2f25c)
2013-07-03 17:10:15 -04:00
Kevin Mehall 56bd11fa7f Don't mark messages read when the pointer lands on them when narrowing.
This is slightly inconsistent, but keeps the unread count from decreasing
when narrowing and un-narrowing.

(imported from commit 185e8653c31a312c166e784b335ae7ae7e9b78e9)
2013-07-03 17:10:15 -04:00
Kevin Mehall 0f6bdafea3 Mark all messages in view as read when you hit the bottom.
Trac #1428

(imported from commit f40d890091528969ae4e4db80adb019cbce60fef)
2013-07-03 17:10:15 -04:00
Kevin Mehall e6b2acefe2 Move message_is_visible to viewport.js
(imported from commit 9f05f8f2f00badb67325994825a904bde6958d73)
2013-07-03 17:10:15 -04:00
Kevin Mehall 22c1a66da8 Don't mark messages as read by visibility.
Trac #1428

(imported from commit b67e52d7434220e397ca20ffa49915de6633519c)
2013-07-03 17:10:15 -04:00
Kevin Mehall 318d66ed9e Apply CSS class .unread to unread message rows.
Trac #1428

(imported from commit e19d75ecd6164b9643411b4740a10527952acc0c)
2013-07-03 17:10:15 -04:00
Luke Faraone 490020b441 Serve custom fonts to OS X desktop clients
Previously we added code which prevented us from serving custom fonts to
Humbug Desktop user agents due to concerns QtWebKit bugs with
@font-face.

On OS X, we use the system WebKit so we don't have this bug. In fact,
the aformentioned change caused us to have no custom fonts at all on Mac
systems!

Here we fix this by resuming the serving of such fonts to Macs.

(imported from commit b222e9dd721914d17aed8341244cfb5c71149a12)
2013-07-03 16:37:56 -04:00
Steve Howell 009d7b8174 Shrink avatars to 35px in the Your bots table.
I tried 30px at first, but I think a slightly bigger avatar helps
fill out the table a bit.  It should be easier to tweek these in
CSS now, although Allen agrees with me that the tabular display
may be short lived when we add edit/delete features.

(imported from commit b4d69cddf63fa122374e20731a5755e7dec86304)
2013-07-03 11:49:04 -04:00
acrefoot b6bd54b350 If your event_log is empty, finish (don't fail) with more helpful message
(imported from commit b08e8fc32438fba16fbe1c3f01afc99a1b62d583)
2013-07-03 11:15:09 -04:00
Steve Howell 71dec63ad1 Fix regression with JS tests only working the first time.
The JS tests would fail on the second run due to memcache having
dirty data.  This change sets a new KEY_PREFIX whenever you launch
a server in test mode.

(imported from commit 4d41e6b79ab3bb7cb4c96b37050f0b1c9abc6b5e)
2013-07-03 10:43:24 -04:00
Jessica McKellar 078defaf15 Regardless of how you get to it, run the tutorial un-narrowed, in the Home view.
(imported from commit 9e57d098b9a4064388c12969fd77663c96597986)
2013-07-02 18:26:18 -04:00
Jessica McKellar 4567bcea1a Add fake message timestamp info needed for new date separators.
(imported from commit 20a29af1f140385f37fc1dff4e278304a2c16c4a)
2013-07-02 18:26:18 -04:00
Jessica McKellar 58780f0637 Disable hotkeys during the tutorial.
We don't want you accidentally arrowing around.

(imported from commit 6a1d18c40833007439c5c54849598438f04b13b1)
2013-07-02 18:26:18 -04:00
Jessica McKellar 04001fdc64 models: remove outdated tutorial comment.
(imported from commit 11ad15b7beb84555fae7edda92a48d5032c99994)
2013-07-02 18:26:18 -04:00
Jessica McKellar 5db6d16b4a subs: remove unused tutorial functions.
(imported from commit 666bcae369f64848c778eccf3fc97ae39986c353)
2013-07-02 18:26:17 -04:00
Jessica McKellar 46afe3be69 views: remove now-unused tutorial message sending capabilities.
(imported from commit 65d14bf469f64b47cf682f4fb36946c6d841eebd)
2013-07-02 18:26:17 -04:00
Jessica McKellar dbbc555a52 Remove now-unused do_finish_tutorial.
(imported from commit 6511d086376d1e81218cd31268f39e2145cb4d48)
2013-07-02 18:26:17 -04:00
Jessica McKellar 14e27e7583 Add the new tutorial steps.
(imported from commit 9269acbcf58332002b1d45c0134ccb2db980f05c)
2013-07-02 18:26:17 -04:00
Jessica McKellar fcf3b262d0 Add some screen divs to be used to box spotlighted content in the tutorial.
(imported from commit 2fcb357b9d812287fcb7070e16d91f5da19ffb96)
2013-07-02 18:26:17 -04:00
Jessica McKellar 5688ee5e57 Provide a function to set the get_updates timeout to 0 for the tutorial.
(imported from commit c904360ffe6fe3cacc9de37d523501a0d45f7176)
2013-07-02 18:26:17 -04:00
Jessica McKellar 672a2ef9ac get_updates: factor out success work into a function.
It has ballooned to screenfuls of code, and this refactor will help
with the tutorial.

(imported from commit 05d18558911ee7ce58b0de43eedf164b495d47ae)
2013-07-02 18:26:17 -04:00
Jessica McKellar 8d73f2d80f Load fake tutorial messages on tutorial start.
(imported from commit aa58f134d86662f090db52f9fdfd815e69f42235)
2013-07-02 18:26:16 -04:00
Jessica McKellar e2fe16af84 subs: export the ability to check and set stream colors.
We'll need this to temporarily set stream colors for the fake tutorial
messages.

(imported from commit 3a2943ccf061cf414d95dc89f3221f9986da9c64)
2013-07-02 18:26:16 -04:00
Jessica McKellar 9a40276865 views: don't defer subscribing a new users to their streams until after the tutorial.
We did this as a hack to prevent traffic while you were in the
tutorial. In the revised tutorial, we want you to see your actual
streams while you go through it, and we'll instead store the events
client-side for processing after you finish.

(imported from commit 75af93d0661c9d14b2c85624aef3f71a78053980)
2013-07-02 18:26:16 -04:00
Jessica McKellar c7d289e328 Rip out old tutorial.
(imported from commit a8f2b246f23500e93a56e028e22aa1196c017d8e)
2013-07-02 18:26:16 -04:00
Jessica McKellar bc3837f440 compose: remove tutorial check on sent messages.
We did this to check if you sent a message that would progress the
tutorial. Since the tutorial is getting overhauled we don't need this
anymore.

(imported from commit 25ee55ab034fff42a220ddd7b222b3f7459af3a1)
2013-07-02 18:26:16 -04:00
Kevin Mehall dce1f7f729 Parse @-mentions in bugdown and style them.
* This makes bugdown.convert take a `message` parameter. Properties
    for parsed mentions are added to the message object by the `Pattern`
    for use in do_send_messages.

  * Refactor repeated markdown rendering code into `Message` model methods.

(imported from commit 4f0ed5570104c0210f984b6de21e9048e2b53fa0)
2013-07-02 18:20:26 -04:00
Steve Howell 7604534050 Use get_user_profile_by_email() in tests.
We use get_user_profile_by_email() in all our tests now, as it
gives us code coverage on the function itself, and it should be
faster for tests that call it multiple times.

(imported from commit 51ebffb193980fd6f81b0ef5574d96cd92e87364)
2013-07-02 16:50:11 -04:00
Steve Howell 9e64750083 Use memcache in the test suite.
This uses a new configuration that enables memcache, but we have
to be careful to bounce KEY_PREFIX on every new test, since data
gets rolled back in the databases between tests, but not in
memcached.  We had to break up one test to work around UserProfile
objects actually being cached.

(imported from commit f201cf9cd9e0e4c61d3c384fa8d2bbd5134161e8)
2013-07-02 16:50:10 -04:00
Steve Howell 741929008b Add profiled decorator and a tool to show profiler results.
The goal here is to make it easier to do ad hoc profiling on
our codebase, particularly by running tests.

(imported from commit 71da06feb3a369dec8dc4d8391f7f40e4c2d02ff)
2013-07-02 16:47:34 -04:00
Allen Rabinovich cff0096f3b Make date boundary separators all uppercase, lighter, and letterpressed
(imported from commit 01ffbda9b4dc478732dba091e3cefced9fb1cb7c)
2013-07-02 13:08:44 -07:00
Allen Rabinovich c5e70f08f7 Make the pointer highlight lighter on private messages
(imported from commit 51f95f010336ffcfcbfae19f27efd074ec8d8be5)
2013-07-02 13:08:44 -07:00
Allen Rabinovich 090cb8b436 Switch the private message recipient bar back to a dark background
(imported from commit b172e35bf1f33eda5dc8b352d017a96530bf27b7)
2013-07-02 13:08:44 -07:00
Allen Rabinovich 332116f8fb Change the recipient bar background to a darker gray with less gradient
(imported from commit 7586453625da76623771cff9fe147d22c9f8709d)
2013-07-02 13:08:44 -07:00
Leo Franchi 779ab0e3ca Get apply_markdown value from REQ if it exists
(imported from commit c93b0a96564535c0a0162e827a67379fdf166de9)
2013-07-02 15:04:42 -04:00
Steve Howell 86e89b66e7 Make GetProfileTest tests pass deteministically.
(Make sure users have at least one message in their stream.)

(imported from commit a6654447ae9a9626f5b3d5e01ffaa00dde17c79b)
2013-07-02 13:17:35 -04:00
Leo Franchi 93765b0568 Keep variable in list comprehension from shadowing
(imported from commit 2d2bbc029d7c13b5e6f125bd5f79ba3d73d3c677)
2013-07-02 12:10:23 -04:00
Leo Franchi a2294c05d5 Send the proper Content-Type header on our Tornado responses
(imported from commit 574d2421541449fae0f91509dc3bc018e49bd24d)
2013-07-02 11:46:10 -04:00
Tim Abbott f473cb5fbe Use bulk operations in notify_subscription_{added_removed}.
After fixing the high numbers of database queries earlier in this
branch, I found that sending 500 RabbitMQ messages for a bulk change
in subscriptions was consuming more than half the time for these (and
then we'd end up with 500 events in a queue).  To handle this, we
create a "user X subscribed to these N streams" event, rather than
sending one event for each individual subscription.

(imported from commit 44a34a9fab9b67e9f0da6fee53335d8c5030392b)
2013-07-02 10:50:29 -04:00
Tim Abbott 74fd508b2f Remove subscriptions using bulk queries.
This improves the performance of unsubscribing to N streams by more
than a factor of 10 for large N.

(imported from commit a529e6d3ac4452f49c2294908d275280019bbd05)
2013-07-02 10:50:29 -04:00
Tim Abbott 7f3fded612 Add default stream subscriptions using bulk queries.
(imported from commit f6d7415269cc74836c1c331741665b01cb1090cd)
2013-07-02 10:50:29 -04:00
Tim Abbott 703dec0344 Use bulk queries to get the recipients for narrowing to MIT streams.
Otherwise we could in theory make dozens or hundreds of
memcached/database queries to handle a narrow.

(imported from commit 232f38d8c005b9aef6f12f2f9a4d68a19134d038)
2013-07-02 10:50:29 -04:00
Jeff Arnold 45116a0b61 For mit.edu, include unclasses and .d classes in narrowed views
(imported from commit e21aab715c949d4348c447e6e135281b47e06b98)
2013-07-02 10:50:29 -04:00
Tim Abbott dc54a24766 Add util.escape_regexp.
(imported from commit 3ba7caa0d444a64b228bcb5f5c658c8363ddfbf5)
2013-07-02 10:50:29 -04:00
Tim Abbott a4cf528fad Use a bulk query to fetch the streams in list_to_streams.
This substantially improves the performance of all the functions using
this helper.

(imported from commit 9c247e82f392475c8ddf46b4b498ef293911e9f5)
2013-07-02 10:50:29 -04:00
Tim Abbott a66bb508bb Use bulk queries for adding many subscriptions to a single user.
Previously we only used bulk queries when adding many users to a
single stream, resulting in very slow performance when subscribing
users to large numbers of streams (as happens when setting up a new
MIT realm user).

(imported from commit 849fa7b2a1a146c0a9adc1c727c20c9fbfb7b425)
2013-07-02 10:50:28 -04:00
Tim Abbott 738793a962 bulk_add_subscriptions: Remove incorrect comment.
This comment was only ever accurate for prototype versions of
bulk_add_subscriptions prior to it being committed to master.

(imported from commit 89b9dc49423c45553cb6c810d97eea4583ff0f69)
2013-07-02 10:50:28 -04:00