Commit Graph

2587 Commits

Author SHA1 Message Date
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
Leo Franchi 45322a2791 Always add messageds from get_updates to the home and all lists
(imported from commit d922fa2d80b339ef0f6b76c83d30a7c0fcc29888)
2013-02-26 15:09:55 -05:00
Reid Barton d5ac00aa68 Display timestamps as "Today", "Yesterday"
(imported from commit 7f24d1a86c5ffc9b02d35f43f60ad5cf9143f2e3)
2013-02-26 15:06:45 -05:00
Reid Barton 318ee5df7d Move timestamp updating to an exported function for testing purposes
(imported from commit 9d632eb03564899fe2c8ad937d9e2aaac94e1396)
2013-02-26 15:06:45 -05:00
Reid Barton 593af9daa8 Fix two comments in time rendering
(imported from commit 056c8eb7f77947ac967a73ace404f9262bf05923)
2013-02-26 15:06:45 -05:00
Leo Franchi 1300b684e5 Don't let clicking 'Show in home' change the scroll position
(imported from commit b760abdaa23f9549f15670b14fdaf57c45dc0aeb)
2013-02-26 14:13:35 -05:00
Leo Franchi 19d107e42b Add a home_msg_list that contains all messages shown in the home view
By splitting up all_msg_list and home_msg_list, we can properly add/remove
streams from the home view without having to jump through hoops.

(imported from commit 92767197759f7519197dfc58be951b60fa823fbb)
2013-02-26 14:13:35 -05:00
Keegan McAllister 49e16b0ba6 Add portico and misc CSS and JS to Pipeline
Fixes #963.

(imported from commit 63ec313a41fd13350657c78356efc16422a5fff1)
2013-02-25 16:18:35 -05:00
Keegan McAllister d4e02f10eb Set the favicon href directly on Webkit browsers
We still delete and re-create the node on other browsers.

Fixes #960.

(imported from commit 3f0862793042c4a52d18104060ac2fe2ad21b3e6)
2013-02-25 16:01:29 -05:00
Leo Franchi 64bb48421b Fix jQuery usage and properly show/hide messages table
(imported from commit b6d82a6e717b23ce88407499dc8edb4d4c609270)
2013-02-25 10:04:10 -05:00
Jessica McKellar 11a01dac6c When a narrow would have no messages and just be grey, show a notice instead.
(imported from commit 2b2b653805cb1ebdb545f83b20c01f1d6cbde9b7)
2013-02-23 14:38:25 -05:00
Jessica McKellar cf72ca441f Add the feedback bot to the people autocomplete list.
(imported from commit d32724ca647da5053677dbb7bc720465823d79f1)
2013-02-23 14:38:21 -05:00
Jessica McKellar c1d4bc58e8 Un-break get_updates when you have no messages.
(imported from commit 5221682c8dacdb8d57b4f65749a28f39f2875f3d)
2013-02-23 12:33:58 -05:00
Jessica McKellar 0bf787321c Allow inline code blocks to wrap, instead of truncating on overflow.
(imported from commit f2586971c113642dba395a68476685be63f6dce6)
2013-02-22 17:06:41 -05:00
Leo Franchi d08b8459ed Only show unread notifications in the title bar if a message is shown in the home view.
(imported from commit 795a6cb55d480c57e84ea5e17ef3afdc5d62d68b)
2013-02-22 17:05:36 -05:00
Zev Benjamin 6e4093a0a5 Fix the copy-paste code copying too few or too many messages
(imported from commit 2e379618b29cd5c8b168e3f4bdbaa278c5247462)
2013-02-22 15:52:51 -05:00
Zev Benjamin 296d7d89a3 Disallow replying when there are no messages
(imported from commit b2fb2d9508afcf0470665bd9d42bb50826d838e4)
2013-02-22 13:07:26 -05:00
Zev Benjamin 06d69f10d9 Remove superfluous call to MessageList.closest_id
(imported from commit 11d4f096517df4b9ed89f184a1d383c8a55697bc)
2013-02-22 11:46:05 -05:00
Leo Franchi ca0f414b60 Fix narrowing not marking as unread when backfilling messages
(imported from commit 91b164251b0c2f97bf70c0051216347e2a4616eb)
2013-02-22 11:41:35 -05:00
Leo Franchi 9fb5487473 Add a select_closest option to MessageList.select_id()
If we have removed a stream from the home view, and our pointer
that we load from the server refers to a message that is no longer
visible, we don't want to error out but rather select the nearest
message to our previously selected one.

(imported from commit d212f1fba7b06836d1d916b43042991625b6f41e)
2013-02-22 11:39:22 -05:00
Leo Franchi e6bd8271e0 Return undefined from MessageList.get() for consistency
(imported from commit 2fe76786921a1500c6ee7fc57af7de7cea667c73)
2013-02-22 11:37:47 -05:00
Jessica McKellar 947d389a33 Fix incorrect sidebar height, which makes you scroll past your messages.
(imported from commit 7244853c83ea884697f205ec5355403c5007d61e)
2013-02-22 09:58:12 -05:00
Jessica McKellar faf37b47be Lighten some of the jet-black text to dark grey.
(imported from commit 5588c2adda941ca0d7305fb7d4d0f97656a277c3)
2013-02-21 22:40:18 -05:00
Jessica McKellar 5821e85317 Make presence links black, like stream filter links.
(imported from commit 70cbf16ec4c5fa4b0d4ed2ce326354cbb1cd3679)
2013-02-21 22:40:18 -05:00
Jessica McKellar 015cfb594e compose: remove a recent bit of error handling for subscribe-and-send.
(imported from commit c22ae573904a4532386291e540b8a23dca389a82)
2013-02-21 22:31:25 -05:00
Jessica McKellar f96079ee48 compose: move X to close a compose error to upper right.
(imported from commit f27e3b44f0f62bce8e448116926608da0066f78b)
2013-02-21 22:31:25 -05:00
Jessica McKellar 41aa91d300 compose: give users an action to take on subscription errors.
(imported from commit 62b2500bb1993f70b8218cd58fb335de25b18480)
2013-02-21 22:31:25 -05:00
Jessica McKellar 42ba9adad7 Remove unused CSS from removing subscribe-and-send.
(imported from commit ad315599277a1d15d536ff3d87c962e03e97d536)
2013-02-21 22:31:25 -05:00
Luke O'Malley eec2487b9e Remove sub-and-send javascript and add 'X' to all error messages
(imported from commit 66fd42914e4fc33719c4f21ad401748989f20b49)
2013-02-21 22:31:23 -05:00
Keegan McAllister 56d183ea06 Remove lurk mode from web client and API examples
See #796.

(imported from commit e238ce571c3f30d8312b630df7048ad1d9cad6d2)
2013-02-21 15:11:10 -05:00
Leo Franchi 982a3fda9a Only ignore website messages from user when calculating unread counts
(imported from commit 95bd6f8c2ce0ad1f5d59e311107f81e4b07b33dc)
2013-02-21 15:05:59 -05:00
Leo Franchi 771eea22b8 Properly auto-complete usernames whenever they appear in a message box
(imported from commit 82ef65125731eb48fa029d16acc28add401ac633)
2013-02-21 14:24:55 -05:00
Zev Benjamin 48e7fed00f Fix the selected message when narrowing to a stream that has no messages loaded
We would previously scroll you to the top of the just-loaded block of
messages

(imported from commit 520e5588aa078313649677663c7feea4ca1d7145)
2013-02-21 13:29:17 -05:00
Zev Benjamin 4c9e3a167e Move message selection to an event-based system
Messages are now selected on a MessageList, which triggers a
message_selected event that other parts of the code can listen for.

(imported from commit 1da9e4121425c0ac4461b41b7aea169072e1512b)
2013-02-21 13:29:17 -05:00
Zev Benjamin ed51bd0432 Select messages on the MessageList instead of calling a global function
(imported from commit 0ea1c2695cda5ec415c42a450103e768cf2ff5db)
2013-02-21 13:29:17 -05:00
Zev Benjamin 9e9b4c8541 Make MessageList.selected_id an accessor method
(imported from commit 144d12ba8be2de02900ef06c3413f660144de8bf)
2013-02-21 13:29:17 -05:00
Zev Benjamin 36798c8d67 Select the closest message to the target after narrowing
(imported from commit e41fcb032af5a8653b7573cb87bbc879a2008343)
2013-02-21 13:29:17 -05:00
Zev Benjamin a91aa7f8f5 Move message filtering from add_to_table to add_messages_helper
(imported from commit 45b1149771a0d96af4c6267fc8457e49c3d10799)
2013-02-21 13:29:17 -05:00
Zev Benjamin 9cac51d0b5 Add MessageList method for finding the closest id in the list to a given id
(imported from commit 244239f44e018940c26626388fd56ff7ac017a80)
2013-02-21 13:29:17 -05:00
Zev Benjamin fc10556b84 Select a more correct message when narrowing by clicking on message's stream or subject
Previously we would select the first message in the block.  Now, we
only do that if a message that is selected will not be in the
resulting narrowed view.  If the selected message will be in the
narrowed view, we select that message once narrowed.

(imported from commit 4da5a3a0b597b58c2e028f1b29ac20ae3808a4d1)
2013-02-21 13:29:17 -05:00
Zev Benjamin e9b915c2b9 Remove global selected_message_id and persistent_message_id variables
Each message list now has a selected message id.

(imported from commit 041abc54ea42c636c30e39df4a2e838bb830e1aa)
2013-02-21 13:29:17 -05:00
Zev Benjamin 97160d79d4 Use the new MessageList for storing messages
(imported from commit 38a04d2ff504aa49189997b972318af7c944d528)
2013-02-21 13:28:23 -05:00
Zev Benjamin 814e3d6385 Implement a message list structure for storing messages and related information
(imported from commit 171de93636a215d9357c7fc4ee8fb71696d23fb5)
2013-02-21 13:27:45 -05:00
Zev Benjamin e19f9fd3d0 Also restore the scrollTop when the hash changes to '#'
(imported from commit 7b93c4692cca0a6e12b8e01560be7ae00240fa39)
2013-02-21 13:25:29 -05:00
Zev Benjamin b2eb4530d3 Fix comment spelling error
(imported from commit 347a860dfb0de2c49c2810f3aa041bc5c4f427d0)
2013-02-21 13:25:29 -05:00
Leo Franchi 36d953e2af Show messages to streams we were just subscribed to
(imported from commit f852be239da1f3385f9fc9861a3ed07a7f47a6da)
2013-02-21 12:10:53 -05:00
Jessica McKellar 382f94b5b5 Move presence information to a right sidebar.
(imported from commit c5533988606f1fc05de6b83eeb39f8f913f6ad42)
2013-02-21 09:23:59 -05:00
Waseem Daher 6913d16f28 Make your name and gravatar clickable as a way of returning home.
I kind of expect this to work, and hopefully this'll help with
people getting stuck on the "Settings" page in the tutorial.

(imported from commit 1159d884dcd331bcfb74864a0176fa293e8c3714)
2013-02-21 14:05:40 +00:00
Tim Abbott 63d7279cce Some small improvements to the tutorial text.
Most of them are just typos or funny punctuation, but this also adds
the word "above" after "You and Humbug Tutorial Bot" since otherwise
the user might try to click the text in the message body and be
confused.

(imported from commit dccaf4acd24db713acab261440f0a9d03860e0f4)
2013-02-20 20:59:36 -05:00
Keegan McAllister c7b88cc708 Disable backfilling 1,000 messages on idle
Right now the MIT realm has pretty bad UI lag with 1,200 messages loaded.  We
need to fix the root problem, but this commit at least makes reloading the page
a satisfactory remedy.

(imported from commit 93d47710891cfc4db9fa00beaa5ccd10113aa1c3)
2013-02-20 18:50:20 -05:00
Waseem Daher af1327230a tutorial: A first draft of a tutorial.
Here I have a sketchy but functional framework for dealing with
all of the async stuff that a tutorial requires, and an early
draft of what such a tutorial might look like.

I could probably go and remove the first-run message, but I'll
keep it around for now in the unlikely event that something I
haven't anticipated goes wrong in starting up the tutorial.

(imported from commit de9779a66a1b3fe790082decb324c90ec180b39b)
2013-02-20 23:04:50 +00:00
Waseem Daher b51dc36667 Add a tutorial.js file.
(imported from commit 58b72d08c0cd7815c3c54bd37c4a8033f32cc7ad)
2013-02-20 23:04:49 +00:00
Waseem Daher 163c9c8d75 Add a JSON call that causes the tutorial bot to send you a message.
The idea here is: part of the onboarding tutorial is going to
be you talking to the tutorial bot and it talking to you, from
our Javascript.

The reason it's driven by Javascript is that then in principle we can
do nice stuff like making popovers appear in places to point things
out to you, whereas if we were to do it strictly server-side, doing so
would be a lot harder.

The downside to doing it in Javascript is that you don't get any of
the Markdown rendering, since that happens on the server. So instead
we add this call where you give it a message, and it responds by
having the tutorial bot send you that message.

I don't think there are any security concerns here because
(1) The bot only messages you -- so you can't use it to make someone
    else think that the system is telling them to do something
(2) If there were an issue associated with having the server parse
    arbitrary Markdown, you could just trigger the issue by sending
    a message yourself.

(imported from commit b34f594dab6be6bcb81899278ae1cbe447404468)
2013-02-20 23:04:49 +00:00
Reid Barton 8b8f2707e7 Fix bolding of "Home", "All messages", "All private messages" when active
(imported from commit 759729b4b2c0ebac3e3f1c9f74617a2dbea50223)
2013-02-20 17:50:26 -05:00
Reid Barton 873f171fb3 Only perform scrolling functions when the home tab is active
(imported from commit a6bcbadfd94f6312af62648a90a9e4e9b0e97dbc)
2013-02-20 17:50:26 -05:00
Keegan McAllister 9323203cfb frontend tests: Remove trailing commas to make JSLint happy
(imported from commit b62192e67a74f1f47e87f87245c910f42e0b3bec)
2013-02-20 16:02:30 -05:00
Keegan McAllister 75704ad1e8 Consistently use #!/usr/bin/env python
At Ksplice we used /usr/bin/python because we shipped dependencies as Debian /
Red Hat packages, which would be installed against the system Python.  We were
also very careful to use only Python 2.3 features so that even old system
Python would still work.

None of that is true at Humbug.  We expect users to install dependencies
themselves, so it's more likely that the Python in $PATH is correct.  On OS X
in particular, it's common to have five broken Python installs and there's no
expectation that /usr/bin/python is the right one.

The files which aren't marked executable are not interesting to run as scripts,
so we just remove the line there.  (In general it's common to have libraries
that can also be executed, to run test cases or whatever, but that's not the
case here.)

(imported from commit 437d4aee2c6e66601ad3334eefd50749cce2eca6)
2013-02-20 16:02:30 -05:00
Leo Franchi af58956f9e Only show All messages link in sidebar if there are non-homeview streams
(imported from commit b247b651e531debbac2ad34a15b9a758de936348)
2013-02-20 14:24:49 -05:00
Leo Franchi 8162d46d5c Mark as unread messages loaded in a narrow view older than pointer
(imported from commit 37362d1fbb4932f064753a5d3d335d9b2bec2964)
2013-02-20 14:05:49 -05:00
Leo Franchi 0e6ba5ebf4 Hide message table when adding/removing large number of entries
This fixes the issue where toggling show/hide on a stream in the home
view scrolls the page, because the removing and adding of rows in the
still-visible message table causes the cursor and scroll position to jump

(imported from commit 7454284a44af26379a0d2e7fce3683d98e3e4c48)
2013-02-20 13:49:24 -05:00
Keegan McAllister 4c037a938c Add title text to presence entries
(imported from commit 3c27607e59df222c4c8b3113a5efe7cdb23aa37d)
2013-02-19 18:31:26 -05:00
Keegan McAllister bf21c29ce1 Clean up and simplify ui.set_presence_list
(imported from commit edeadfbfc623150e87b7f47c9e46212e24784154)
2013-02-19 18:31:26 -05:00
Keegan McAllister cb45d88cea Get rid of constants activity.user_{active,away,idle}
We don't typically have these (see message type, etc.) and removing
them will allow simplifying the code.

(imported from commit fbefb08ee9b08c73f32c8150a6fa1060957aa8ad)
2013-02-19 18:27:36 -05:00
Keegan McAllister 0b5ba3090a Rename presence CSS classes for clarity
(imported from commit 14b3e80deaf5066210ff7e540b517597884219f3)
2013-02-19 18:27:36 -05:00
Keegan McAllister 947d450a6d Draw user presence dots as actual list bullets
This keeps the name to the right of the bullet even if it overflows
onto two lines.

Fixes #909.

(imported from commit 60528bb30c2d9e29687b773abc76c18369a8a068)
2013-02-19 18:26:58 -05:00
Tim Abbott 9ef3754682 Use bulk_create to create sent messages.
Previously we were doing 100 queries for new messages being sent to
the main hacker school channels; they were faster than many similar
instances because they were all done within 1 transaction, but still,
send_message_backend would be spending up to 200ms (and 148 queries)
querying the database with the previous code on prod; this new version
should do a fixed number of database queries per message.

(imported from commit 3799e63aebb6f017932ddb0fe1f6209281c0ddcf)
2013-02-19 17:36:22 -05:00
Tim Abbott d364e450ea Move create_user to its own file.
(imported from commit b3dc11d3730634b35256dca940d479a81441c062)
2013-02-19 17:36:22 -05:00
Leo Franchi 75fc80be60 Do not show self in presence list for MIT
(imported from commit adbbe0dd9728d4c88fa6865f3d5ae54e715868cc)
2013-02-19 17:36:22 -05:00
Reid Barton 61350d65d1 Render recent dates as weekdays, part 2.
This commit does the actual work of formatting recent dates as weekday
names and updating the format when the date is sufficiently far in the
past.

Also, silence a bogus jslint warning.

(imported from commit 503286fbd9c1e33a81cc7d78cf8d08d5e7f78c1a)
2013-02-19 15:58:25 -05:00
Reid Barton 59dab21fcd Render recent dates as weekdays, part 1.
This commit just moves time rendering logic to its own file, and does
not make any functionality changes.

(imported from commit d111d03c6abc8d9550fcf65e4f89eab8056d1ed4)
2013-02-19 15:58:25 -05:00
Leo Franchi 5d79bb6a20 Add a 'show in home view' toggle to the stream settings
(imported from commit af8bcc4df6fcd9f6ffed4ccb1b9be5261ffe619d)
2013-02-19 15:43:27 -05:00
Luke Faraone 85b6b551f2 Add a notion of "All messages" to the sidebar.
(imported from commit 740711d1fa925055b26249071f79fc0b287d78c1)
2013-02-19 15:43:26 -05:00
Keegan McAllister f214be92c2 Draw stream separator ">" using > rather than a bare >
(imported from commit 97df1e7c8d16f87962784265d37ff40fd1fc858c)
2013-02-19 15:33:35 -05:00
Keegan McAllister ebbbc4d8c2 Apply stream bar color class to the compose window as well
(imported from commit 3c3f3d1073a95ceff74a571f1b2c985a7b820c8e)
2013-02-19 15:33:35 -05:00
Keegan McAllister bb5f59d310 Use white text for recipient labels on streams set to dark colors
Fixes #577.

(imported from commit 0518e33b96bc0028fc80d533f6b8ec35fd5cdc04)
2013-02-19 15:33:35 -05:00
Keegan McAllister da7f6e0fe8 Add a helper util.memoize
(imported from commit 16b5c49580e30a51583bc0bc8b11293bba595b3a)
2013-02-19 15:33:35 -05:00
Reid Barton 968d1cd9ee Only show "More messages below" when there are unread messages
Fixes Trac #838.

(imported from commit 9b02820946698cf6ef76f1836b5fd6c3c50ed0f4)
2013-02-19 13:43:34 -05:00
Reid Barton 37b5a84af4 Track total number of unread messages
(imported from commit 0a6f270b8a4debf0cbb7e869ecbff59f39f22049)
2013-02-19 13:43:34 -05:00
Reid Barton bec83b2bc3 Minor style changes to process_unread_counts
(imported from commit 1cf468e4c2d6237772b3424e4941ee2481dc9bfd)
2013-02-19 13:43:34 -05:00
Reid Barton 583fdf6d0b Make pre blocks inherit their line-height
(imported from commit 80bfff2e7f054ab44ae58fc7d2f4c7238534c092)
2013-02-19 12:01:39 -05:00
Reid Barton b558d062ba Scale code and pre contents with font size
Fixes Trac #893.

(imported from commit ef376a4921d682d48e86a3a442877c0e5b15feef)
2013-02-19 12:01:39 -05:00
Keegan McAllister 00445c843e Restore the cursor position when shift-tabbing back from send button to content
Fixes #806.

(imported from commit ccdab39b52f3aee387be17f13c91ecfabee2b214)
2013-02-19 11:25:03 -05:00
Keegan McAllister eaec3c03d4 Import jQuery Caret plugin
(imported from commit 814f32cd68c07be224b3f793670e764c5d470679)
2013-02-19 11:25:03 -05:00
Keegan McAllister 45dd9e8ec9 Remove Safari Tab-Enter workaround
These days we explicitly handle the Tab hotkey in composebox_typeahead.js

(imported from commit e554a20bf0517f928359ad83f8ba83abb22aa68e)
2013-02-19 11:25:02 -05:00
Tim Abbott 4caafd66ce Rewrite git hook for distribution and document it.
(imported from commit c3238bc5b5e29727cddb43bc55ab418326226acd)
2013-02-19 09:17:06 -05:00
Jessica McKellar 2852692de5 Hide floating recipient bar on mousewheel scroll but not keypress.
That way it is visible more consistently when arrowing through
messages (arrowing causes scroll events).

(imported from commit ba629b907e4e593032a61a10b04f00e592fe8427)
2013-02-18 21:17:29 -05:00
Jessica McKellar 1b02928806 Only update floating recipient bar at end of scroll.
This makes scrolling much cheaper and reduces jerky scrolling.

(imported from commit 38b620bb13c498556a21962113a94e35a209d52b)
2013-02-18 14:58:58 -05:00
Waseem Daher 2b7b39fe1f Make 'New stream' and 'New PM' buttons work when not on home tab.
This fixes Trac #898.

Prior to this commit, we only changed the tab to #home in
compose.start; i.e. when a compose was not already in progress. This
means that if the composebox was open and we were on the settings
page, clicking one of these buttons would not work.

(imported from commit aa88a605cdcb61d5b6a1ece6292001c5f5a19c66)
2013-02-17 17:45:53 -05:00
Waseem Daher 73372882cb Properly clip long subjects in recipient row box.
This fixes Trac #912.

My guess is that 'overflow: hidden hidden' was just being interpreted
as no setting on the overflow, which is why this was broken.

Regardless, this fix seems to work in Firefox and Chrome.

(imported from commit a08ddc5db97ee1e8a65a278c0d278e823afae65d)
2013-02-17 17:31:16 -05:00
Keegan McAllister e25d9a8492 Remove unused Notificon library
(imported from commit 8c0717b4e305d28f30b9088a974e99d510ab3021)
2013-02-15 16:19:58 -05:00
Keegan McAllister ddcf2cb86e Set favicon from our generated images rather than using Notificon
We've been noticing a long delay between switching to a window with unread
messages and the time that those messages actually appear.  This got much worse
around the time we added Notificon.

Our hypothesis (supported by some testing) is that the work done by Notificon
in creating a <canvas>, drawing into it, serializing it to PNG, etc. is using
up some quota of background operations that would be better spent rendering
messages.

Switching to precomputed images should mitigate this problem.

Resolves #896.

May resolve #882 to our satisfaction.

(imported from commit a2d98a163486bdd35fdfb5351f96c5529ba5c7e9)
2013-02-15 16:19:50 -05:00
Keegan McAllister c0054f6335 notifications: Remove duplicated code
(imported from commit 3b6fe986ed51a3698460b2e6f984df6f71cc5f6f)
2013-02-15 16:18:24 -05:00
Keegan McAllister 7f9deed321 favicon: Add an 'infinite' favicon for more than 99 messages
(imported from commit f899a50982d0613878d94d77b086277ce634a079)
2013-02-15 16:18:24 -05:00
Keegan McAllister bb55097b86 favicon: Add the generated numbered favicons
(imported from commit 1ad1503f3f472795ebddea4d166fd0120560aae5)
2013-02-15 16:18:24 -05:00
Zev Benjamin 061aaea601 Use plainto_tsquery instead of to_tsquery
This will discard punctuation symbols in the Postgres search and also prevent
syntax errors when users try to submit queries with symbols that to_tsquery
interprets as special syntax (such as '|' and '&').

Fixes #906

(imported from commit 3e3a0d6ae3d4a516beb8a5846f06065294ca9457)
2013-02-15 16:18:02 -05:00
Leo Franchi a1234afc4b Make sure we have a full name for a user before accessing it
(imported from commit 20165ada3f04edd714e5d2e8ee31a388a1ff00de)
2013-02-15 15:56:14 -05:00
Waseem Daher 91a3e0402f Update test (again) to match new '>' delimiter.
It looks like there was a stray | in the tests.

(imported from commit 991c35988daa1d6dbf268f8334f28ab69e222eb4)
2013-02-15 12:14:59 -05:00
Leo Franchi 49328c2551 Unify rabbitmq usage to use only one queue.
To work around the issue we're having with queue draining between
parallel blocking connections, use the same rabbitmq queue for both
activity and presence events, keyed on a 'type' flag in the message
itself.

(imported from commit 188e8fda1695734e52c5740db2195072cfc81479)
2013-02-15 11:43:17 -05:00
Keegan McAllister 1047a2a590 Create custom presence indicator images which differ in shape as well as color
Addresses #890.

(imported from commit 748df008690b6fd557060fb6e88e2f3d26fbf4a3)
2013-02-15 11:11:50 -05:00
Leo Franchi d4a582fa1c Handle SIGINT and SIGTERM in process_user_activity by closing communication gracefully
(imported from commit dcf813fa8af1aaf5d6cc635268757e40c6c202ab)
2013-02-15 11:05:31 -05:00
Leo Franchi c2074813ca Generate unique consumer tags when connecting to the queues
(imported from commit cd9c78db46ae1a36b46bebf5cb0d226e15f71ba4)
2013-02-15 11:05:31 -05:00
Jessica McKellar 1f24133292 Update tests to match new '>' delimiter.
(imported from commit e9a0c60ee89f7cd3cf0756baaf35221263c3d3be)
2013-02-15 11:01:06 -05:00
Jessica McKellar b8ad7f235a Replace the pipe character between stream and subject with a '>'.
It helps to clarify the relationship between subjects and streams.

(imported from commit 53ed623f3875939c5b6f812de54ccbe616cdb1db)
2013-02-15 11:01:06 -05:00
Waseem Daher f37f6b2d37 Don't show popover on right-click.
I experimented briefly with window.getSelection to try to determine if
any text was highlighted (and then we could've done something like
"Don't popover if text is highlighted"), but I couldn't quickly get it
to work in a robust way, so for now I am removing the feature.

(imported from commit 76048b8fd070675b480a2d29e2c8d7d6018633ec)
2013-02-15 10:50:17 -05:00
Tim Abbott 63827c2301 Make the Nagios integration configurable, available, and documented.
(imported from commit 1208fc08ed366a892763c3b29b9aeafa90b29981)
2013-02-14 17:50:00 -05:00
Luke Faraone 32a406a5cf Display a total count of the number of PMs you have pending.
This is accomplished by continuning to have per-conversation PM counts
but then summing them up into a global count.

We may split this off into per-conversation counts in the future.

(imported from commit 311e3b74715c3a01c0b75837e397a386ab65505c)
2013-02-14 17:32:22 -05:00
Keegan McAllister 148e47e74a Remove unused CSS rules
(imported from commit 99227b8d9d7fc7d4ac5c3b9c78bf73cba2589767)
2013-02-14 14:39:32 -05:00
Keegan McAllister fc4d80d941 Make various UI elements look and work better when the font size changes
(imported from commit 0229aaf059941892eaaa16fb20a807015136a7ca)
2013-02-14 14:39:32 -05:00
Keegan McAllister 6c12fd3909 Add a basic font size menu
(imported from commit ff0c27ccb177ddc69a31bf8997d31e7cfb5b78b5)
2013-02-14 14:39:32 -05:00
Luke Faraone a9e602c1bb Implement label counts for stream messages.
(imported from commit 45d3d5ba8c2be3ebed8385fb714044ac9419f3c2)
2013-02-14 13:44:06 -05:00
Leo Franchi 86fbdfe183 Add test for ** not matching over newlines
(imported from commit 08556ab9f5a5b9455c4e31dded089776ded9d708)
2013-02-14 11:56:53 -05:00
Leo Franchi 5d82dc5ce2 Don't match ** for strong across newlines
(imported from commit e3bc0b409bd99c3707746c23eb73e11342cfe178)
2013-02-14 11:56:53 -05:00
Leo Franchi 1201fc1144 Add semicolons to js statements to pass lint
(imported from commit b67d30c5944276309c4e41b29afa5e55122530d8)
2013-02-14 11:27:36 -05:00
Leo Franchi a86599fc28 Add grey idle icon
(imported from commit f04d74a999a16d0118fdccccf8dcffe9d3da6bb0)
2013-02-14 10:44:41 -05:00
Leo Franchi 6efcfdf593 Show the users themselves in the activity list, at top
(imported from commit e0b3e52719cd27fe1c2755840ea16a69f9d6169b)
2013-02-14 10:19:32 -05:00
Leo Franchi ddef0c3b28 Sort user list by name not email
(imported from commit cc13d1c65625727a923616e402e4c9fd2b5afbb4)
2013-02-13 23:03:18 -05:00
Tim Abbott 874309b959 Fix sending to stream names that are JSON strings.
(imported from commit 51ca1b577796a6f438d5bba4a9e8e0af3293b423)
2013-02-13 13:08:40 -05:00
Tim Abbott 1612b5c045 Fix sending messages to numeric stream names.
json_to_foo will raise a ValueError if the JSON passed to it is just a
string containing a number, e.g. "1".

Traceback (most recent call last):
  File "/home/tabbott/humbug/zephyr/views.py", line 711, in extract_recipients
    recipients = json_to_list(raw_recipients)
  File "/home/tabbott/humbug/zephyr/decorator.py", line 289, in json_to_list
    return json_to_foo(json, list)
  File "/home/tabbott/humbug/zephyr/decorator.py", line 282, in json_to_foo
    raise ValueError("argument is not a %s" % (type().__class__.__name__))
ValueError: argument is not a list

Fixes #776.

(imported from commit 0c123a610c009eda9004cf0b0b53d60695c4e8d5)
2013-02-13 13:08:40 -05:00
Zev Benjamin d3f92eeab6 Remove narrow.from_popover()
(imported from commit 5214955658cdbd652777dda1c4351d89b5f220af)
2013-02-13 10:56:10 -05:00
Zev Benjamin bcd0bb80e1 Remove narrow.target() and pass the target explicitly
This fixes #861

(imported from commit 244deaae84db2e8c7c5ce3f9b9b25cc33bdd234d)
2013-02-13 10:56:10 -05:00
Waseem Daher feef28da59 Make the presence images have more semantic names.
(imported from commit 9de1a4183b575fb3d88498bd0b17bd566aec2da4)
2013-02-12 18:14:51 -05:00
Waseem Daher 0f798c7783 Add an orange dot "away" status for presence information.
(imported from commit 7adaff6bee4e3ba3164d2d47b32da28e136c56af)
2013-02-12 17:34:57 -05:00
Keegan McAllister 2a556fd002 Re-enable markup for CUSTOMER1
(imported from commit 3d74260796c85216d71d8261020cc149e0b6ce1c)
2013-02-12 17:09:47 -05:00
Jeff Arnold 04d31a12eb Let's not call an expensive function on every mouse movement
(imported from commit 762e4f51210afcc3d394841ee0708dba09e4bc01)
2013-02-12 17:09:35 -05:00
Tim Abbott ff099f9291 logging: Fix super verbose logging of 404 errors.
(imported from commit bb2b4f0c3cf37c16d5c634d22b7cc576ee00e5f4)
2013-02-12 16:36:13 -05:00
Jeff Arnold d0f422979b Change the favicon on notification (great for pinned tabs)
(imported from commit 025ad165d15b2e6d979c246776148f13ebc555fb)
2013-02-12 16:27:07 -05:00
Tim Abbott c38092424e Clean up fetch_table_messages code a bit.
Fixes #792.  I'm really curious what (if anything) this change does to
our Tornado load numbers.

(imported from commit daf81d2dea81f36ec4a3eb19993169b58681e717)
2013-02-12 16:25:45 -05:00
Tim Abbott 2f4b62048e gather_subscriptions: Fix making O(streams) database queries.
This cuts the MIT Zephyr home page load time and also #subscriptions
database-sourced load time for me from about a second to about 50ms on
my laptop.  The home page still takes about 600ms to load due to
templating.

(imported from commit 1cfd8c750301abe6b6a881be4b2857532be947ec)
2013-02-12 16:25:45 -05:00
Luke Faraone ea7005e8e3 Rename is_active to is_inactive.
The purpose of the validator is to ensure the user isn't active, so
let's correctly test for that here.

(imported from commit 772ddb901098f78750efab274405a10f36c49232)
2013-02-12 16:15:29 -05:00
Reid Barton 5d4206056e Dim the pointer when the window loses focus
(imported from commit ccea3148706ac4e96b0ecbefa5ba1623144c919b)
2013-02-12 15:31:49 -05:00
Luke Faraone 54a19e9091 Check whether users are active, not whether they are nonunique.
Previously we checked and bailed when there was a user registered with
an email address, regardless of active status.

This meant that MIT users who had inactive accounts autocreated had
issues where they would be confusingly told they were signed up even
though they had never taken any action on our site directly.

Now we instead check whether there are any current *active* user
accounts with that email address, and proceed with generating an
activation link if the user lacks a corresponding active account.

Security implications of this commit come into play if we start
implementing removing users ability to sign in as deactivation. Since we
lack a user removal story here, this isn't terribly concerning yet and
we'll revist this code when we decide to add such functionality in the
future.

This resolves trac #581 and #631.

(imported from commit c3fb93ce065e63e19b41f63c1f27891b93b75f86)
2013-02-12 15:31:06 -05:00
Waseem Daher 94ceac9980 Add an initial message to greet you.
(And to let you know that it's OK that you have no messages.)

This fixes Trac #850 for the case where you first log in.

(imported from commit 47741856e34f67bfc2cc91bdc21def75ab6fe09d)
2013-02-12 15:21:28 -05:00
Keegan McAllister 3d69db8469 tests: Fail with a useful error message if Pygments is missing
(imported from commit 9c0eba6b5629a28c6171ec316038120acaa3ea44)
2013-02-12 15:04:30 -05:00
Tim Abbott 62c632ceef presence: Fix loop making database queries.
The previous select_related didn't properly get the User object,
containing the email address, and thus would make one query per user
with presernce information.

(imported from commit 3341bc5a65387030fa8737b03ca43f79089ef56b)
2013-02-12 14:52:59 -05:00
Leo Franchi 7e09166f45 Remove sort by PM status in activity list
Now the sorting is done by activity status, then alphabetical.

(imported from commit 202df275f7502eb1c97d6f04880e67392f5cde0d)
2013-02-12 14:41:24 -05:00
Leo Franchi 3fe5ffe293 Add active test for MIT being empty and fix same_realm test
(imported from commit 8f67e594fabc9fe1b1d1356f94f046e7cb562c6a)
2013-02-12 13:57:10 -05:00
Keegan McAllister 6fba03a0a4 activity: Use select_related when querying UserActivity records
On my dev machine this cuts /activity load time with lots of users by more than
2/3.  I expect the gains will be even greater in production due to the greater
relative cost of database queries.

(imported from commit 0391cb29f66b618b4b99902d9fb9ab0a6cff0cb3)
2013-02-12 13:46:16 -05:00
Keegan McAllister 78398fab95 Restore click-to-reply in the blank space between the sender name and timestamp
(imported from commit 12c0b08bdac0eb5eebde4984dee3272b124ee256)
2013-02-12 12:36:39 -05:00
Leo Franchi 78ffe36c2d Hide users list for MIT
(imported from commit 4e9dcef483e0c0d85ba2e7511f1abfa4da06be9e)
2013-02-12 12:30:52 -05:00
Leo Franchi 7ab82019eb Add more url linkify tests
(imported from commit 34e22ede44e8089cc551b1b7350fdf85b3a80cf0)
2013-02-12 12:24:15 -05:00
Leo Franchi 168f8623e4 Add https?: greedy url matching before falling back to our url guesser
(imported from commit 9e6e5a0522e6501b354a56223c2639841d290d4b)
2013-02-12 12:24:15 -05:00
Leo Franchi 7af226398e Only connect to RabbitMQ if it is enabled
(imported from commit 9726595bbb850c903177b5f64612eb4aa82e36ce)
2013-02-12 12:12:28 -05:00
Tim Abbott 54b10a292c Monkeypatch Django cursor to log query times even when DEBUG=False.
I don't like monkeypatching in general, but this will give us logging
of how much time is being spent in total on database queries on our
staging and prod instances for each of the views we have -- which
should help a lot with debugging performance problems.

The code being patched is identical in Django 1.5, so I don't expect
any issues upgrading in the near future.

I may work on a patch to upstream Django to support this as well.

(imported from commit 08624c7a30f1fd192a972973e0380dd6a131d84e)
2013-02-12 12:01:02 -05:00
Waseem Daher c3cb9a6246 Allow the stream and user lists to scroll with mousewheel.
The previous commit stopped the mousewheel event at .bottom_sidebar,
which means it was never getting to our individual scrolling lists.

(imported from commit 92d32c21bb596d0e14d887ff779a857223d45342)
2013-02-12 11:54:34 -05:00
Waseem Daher 55b05d7bd2 Have the stream list and user list share the sidebar.
This isn't perfect, because if, e.g. the stream list is super short,
it still takes up lots of space that the user list might want to use,
but it's an acceptable first pass solution, in my view.

(imported from commit 669737d769258c089b40ffea4abee3229902e857)
2013-02-12 11:54:34 -05:00
Jessica McKellar 7956f859b2 management: add a remove_users_from_stream command.
(imported from commit 4aeefcc5160a382b13f8bcc2321e76eeea55f4d3)
2013-02-12 11:49:22 -05:00
Jessica McKellar 645e7d58be management: fix add_users_to_streams given do_add_subscriptions output change.
(imported from commit bc03ee0bd601122689e2062b6963780743ac7d27)
2013-02-12 11:49:22 -05:00
Tim Abbott d0953bc8a1 Log time spent doing database queries when DEBUG=True.
When DEBUG=False, Django doesn't log the data at all.  We can and
should add tracking of that at some point, but it requires patching
Django; so for now just log the data when DEBUG=True.

(imported from commit 2b9e6a4c68009733373724f38debe4e77313fdeb)
2013-02-12 11:07:36 -05:00
Tim Abbott c24e05f0e9 Log requestor email address for non-error requests too.
This should make it much easier to debug issues where a particular
user is hosing our API, for example.

(imported from commit cbea49fd1e11805cadf564bd9160d3d6bf7e0eca)
2013-02-12 11:07:36 -05:00
Jeff Arnold f93661e798 Make @**Jeff Arnold** only notify me, not every Jeff
(imported from commit 8e59eceebb4c5af298b0251c126b181cf5899d93)
2013-02-12 10:42:52 -05:00
Leo Franchi 495f7835c8 Make linter happy.
(imported from commit 0c30f2ef176249cd1a06a21946e51a20d6ca7a32)
2013-02-12 10:40:21 -05:00
Jeff Arnold 875e125fb9 Cause @all or @everyone to alert everyone
(imported from commit e2d1cd8b6ea4f2cbae82d052643a5b88e979931c)
2013-02-12 10:27:09 -05:00
Jeff Arnold e2f3a85dbd Clean up the notification code
(imported from commit 5bd811ba40b3f535d474ac53e22fd16816f9bac6)
2013-02-12 10:27:09 -05:00
Leo Franchi b30e277f5a One minute interval for keep-alive pings
(imported from commit f41ffc853c42e75a2e2cb365b73cceac44b7d723)
2013-02-12 10:22:11 -05:00
Waseem Daher 30bed51a65 Style the green 'online now' dot entirely in CSS.
This lets us clean up the HTML a little bit in preparation
for a later change which will cause the stream and people
lists to scroll independently of one another.

Also it feels a bit more fun.

(imported from commit b3b49149d7ec2960fd752fe50b41e55d363c1a98)
2013-02-11 23:15:19 -05:00
Waseem Daher 096e1b7727 Cause clicking on a person's name to start a PM with them.
This is actually a tricky one, because:
* Later, probably if we display an unread count by the person's
  name, the action on clicking them might very well be
  "Narrow to PMs with that person"
* But for now, while we don't have that, everything about
  historical precedent really does strongly suggest that
  clicking that person's name is going to get you a PM with
  that person.

So we implement that. For now anyway.

(imported from commit 4d461fd6edec122d542c4a97e23f2e400c31122e)
2013-02-11 22:36:20 -05:00
Keegan McAllister ca2b48e1ee Prevent scrolling in the stream/user sidebar from moving the message view
(imported from commit b2279b2bac07e29a41b3e5335d2e0d81eb196757)
2013-02-11 20:43:25 -05:00
Zev Benjamin 57b6d6eb50 Make integral easter-egg font-neutral
(imported from commit 2a6c751ab7e872e4b4ddd6bafcb86b0e5d091c1e)
2013-02-11 18:37:34 -05:00
Leo Franchi 674118c104 Add unit tests for active/idle presence
(imported from commit 2685b4ed052b32f347d9d879392b7e87c3e89e1a)
2013-02-11 18:05:57 -05:00
Leo Franchi 83011f7f47 Show a user activity list in the sidebar
(imported from commit 95aaa55c7e4cc39f844518b5308866bedf2cd1c5)
2013-02-11 18:05:57 -05:00
Leo Franchi c348dd3587 Remove get_instance() from SimpleQueueClient
SimpleQueueClient was not thread-safe as the pika method
calls that we are using might disconnect and end up in a bad
state if two threads enqueue messages at the same time.

In order to avoid this, each user of the rabbitmq queue
gets its own instance of a SimpleQueueClient.

(imported from commit 694083b75cd58a60b8de282a8f40eb92a864c5ce)
2013-02-11 18:05:57 -05:00
Leo Franchi 0a0c4bb9a0 [manual] Use rabbitmq for asynchronous presence updating
Note: When deploying, restarting the process-user-activity-commandline script is needed

(imported from commit 63ee795c9c7a7db4a40170cff5636dc1dd0b46a8)
2013-02-11 18:05:57 -05:00
Leo Franchi 31f87481d0 [manual][schema] Add an API for user presence (idle) information
Adds a new db table for storing presences, and an API for setting
an individual user's idleness as well as fetching all idle status
for all users in a realm

(imported from commit 5aad3510d4c90c49470c130d6dfa80f0d36b0057)
2013-02-11 18:05:57 -05:00
Leo Franchi 6f18f4465d Don't add a person more than once to our people_list
The full name may have changed

(imported from commit 44cf37b3f5e17c28f0a6b0a4c75a5c22470a9516)
2013-02-11 17:58:46 -05:00
Keegan McAllister b0bdd7fe0b actions: Flip the popover to the top of the message when near the bottom of the page
From the "reimplementing GUI toolkit behaviors from the early 90's" department.

(imported from commit f3aac2e44c77a858f657233dc032cd52c60843e9)
2013-02-11 17:17:04 -05:00
Keegan McAllister fb3a32f8f0 actions: Open the popover on more specific elements
Now if you click the timestamp, the popover appears near there, rather than in
the middle of the message.

(imported from commit 285a71fddd5b6d9ac86511e5fe41c811d2663342)
2013-02-11 16:59:07 -05:00
Keegan McAllister fe6a9b09ce Also underline timestamp and sender name when a click would open the popover
(imported from commit 4b234e2e1f0025862929906a80188b006c6048b4)
2013-02-11 13:59:19 -05:00
Keegan McAllister 04266fb39d Restore the timestamp tooltip
Now that this isn't the object controlling the actions popover, we can set its
title= back to anything we like.

(imported from commit 36d3ecb23fd22cdc9189537820b944442f7bb5c6)
2013-02-11 13:59:19 -05:00
Keegan McAllister f6cc8d3306 Make right-clicking anywhere on a message open the actions popover
(Except for links.)

(imported from commit 82ce229f3bbc647e9a35d93b063075fa68dbfe93)
2013-02-11 13:59:19 -05:00
Keegan McAllister 7fac4afbe7 Refactor show_actions_popover
(imported from commit 1cb7d7c6c032b0c38adc5b4a4e0752d554f07521)
2013-02-11 13:59:19 -05:00
Keegan McAllister acf61d9c48 actions: Add narrowing to the popover
This addresses another usability problem from #470.

I decided it was too confusing to have menu options for both stream and subject
narrowing, so I went with the latter.

(imported from commit 948fca954a265029ceb27c72ae178015d513785d)
2013-02-11 13:59:19 -05:00
Keegan McAllister 3609f5fdee Add helper narrow.from_popover
(imported from commit 6b20ce7e4eddff03351f5abe8f3f7c080876ea16)
2013-02-11 13:59:18 -05:00
Keegan McAllister 9356c0ca95 Add a link for the actions popover next to the timestamp
Hopefully the text and link-like styling will make it more clear that this
feature exists.

The sender's name is still clickable, but loses the link-like styling since the
popover isn't about the sender.  The space between the sender's name and this
link is now active as well.

We also remove the sender's email address that was previously visible on hover.
It's not hard for the name + email + actions link + timestamp to be too long
for one line.  The email is still present in the popover.

(imported from commit 3a85f199c42102cac0d217543db0a539935e2914)
2013-02-11 13:59:18 -05:00
Keegan McAllister a240ca2a67 Fix indentation in message template
(imported from commit e506bccefdfdc3c015f71f5caa144ce5de2a2bac)
2013-02-11 13:59:18 -05:00
Keegan McAllister 5052460b95 Generalize hover effect for stuff clickable to get the actions popover
Similar to the previous commit.

(imported from commit 4b9558ea204f637467f42995a69b0dbc1e0d8cac)
2013-02-11 13:59:18 -05:00
Keegan McAllister 03cf4199b5 Generalize the message hover effect
We now set a CSS class on the hovered message, which is used to
control email address visibility.

(imported from commit 787e24f71f20aa3a6452e57b94f5ca1a4c8bc32f)
2013-02-11 13:59:18 -05:00
Keegan McAllister 4476f3c083 actions: Clarify reply target
This addresses one of the usability problems from #470.

(imported from commit cb196ab02a82a18a3236ffc5c0c2c7bc87054810)
2013-02-11 13:59:18 -05:00
Keegan McAllister ab8037d828 actions: Move sender information out of the popover title into the body
This makes sense because the actions aren't really about the sender.

(imported from commit cf47939ecc93f4d1113268637e41c0a6daa0f2c2)
2013-02-11 13:59:18 -05:00
Keegan McAllister 16d62fe5de Combine the actions popover with the timeinfo popover
The message timestamp is now always clickable, and the popover contains the
full long-form date and time.  This addresses one problem from usability
testing (see #470).

(imported from commit ad502dff128ad1c934fc0d3faaf5e2931c91c37e)
2013-02-11 13:59:18 -05:00
Keegan McAllister 520d7b1f97 Rename userinfo_popover -> actions_popover
(imported from commit fab5a44af1acaf93640a2f57ffc25b3e97f55d2e)
2013-02-11 13:59:18 -05:00
Jessica McKellar 3a39ac76c4 Add a new /get_members API query.
(imported from commit ced7c74212210a1fcee03c1c402dca9b42483d11)
2013-02-11 13:45:46 -05:00
Zev Benjamin af2d8902c2 Only show the scrollbar for the sidebar on hover
(imported from commit 359443e2ebcbb9a4e440ee8edfe42cb7f2b2e73c)
2013-02-11 11:10:10 -05:00
Luke Faraone 8dbda2cd64 Use full emails rather than just usernames in /activity.
(imported from commit c0397d6429fe85f0bd6e57731dd2132ed1e11b85)
2013-02-11 10:33:16 -05:00
Jessica McKellar 0cbe53b9c7 Autocomplete @notifications to your bolded full name.
This is a stopgap to handle e-mail addresses like me@foo.com.

(imported from commit 804b477214d45f46373b2138d5ff9036644c87da)
2013-02-11 10:03:51 -05:00
Jessica McKellar 53f0b00785 Add a management command to change and log user emails.
(imported from commit 0bf25433a371f7e46ade96019f4a9ceebe395fe5)
2013-02-10 16:45:25 -05:00
Waseem Daher dc02e236df Document our Jenkins integration.
(imported from commit a2711e10eaf5ae4b06de5becf94f9857b535a63b)
2013-02-09 20:54:10 -05:00
Keegan McAllister aa644ab757 Remove direct use of x.attr('zid')
See https://wiki.humbughq.com/Code%20style#x.attrzid-vs.rows.idx
for why this is bad.

(imported from commit b341146704af3bb1b477b12d226096ab72b5e269)
2013-02-09 13:52:16 -05:00
Keegan McAllister 8399426b9c Remove incorrect 'title' argument when creating timeinfo popover
Bootstrap ignored this and instead used the title= attribute, containing the
full timestamp, which seems like what we want.

(imported from commit 8442835d61f89bd0bce75c05e17aabe85e0f417c)
2013-02-08 18:24:16 -05:00
Tim Abbott 000b02c068 Clean up code duplication in add_messages.
The interface is a little messy because so many of the inputs change
-- we need to better organize all these variables under centralized
'zfilt' and 'zhome' headings.

(imported from commit b247e86bf63ea2ea2c0d42ef23e8af0ce288d5dd)
2013-02-08 14:43:21 -05:00
Tim Abbott 2d9a21654b Fix messages being added to the home view out of order.
So here's the reproduction recipe:
(1) Find a narrow that doesn't have any messages since 4 days ago

(2) Directly visit that narrow in your browser (or wait for someone to
do a deploy and thus auto-reload)

(3) Wait until load_old_messages has been called at least once

(4) Un-narrow

(5) Scroll up, and notice that the 400 most recent messages are above
sets of older messages.

The cause is that the code in add_messages assumed that
selected_message_id was within the range of message already in the
home view.  This is true in most cases where add_message is being
called, but it is not true in the case that the user was in a narrowed
view containing only very old messages (And thus selected_message_id
would be older than everything in the home view).

We can fix this by tracking persistent_message_id separately and using
that for the relevant test in add_messages.

(imported from commit f0da2561ba68f729343b260adc398029fae6acf7)
2013-02-08 14:43:13 -05:00
Keegan McAllister 9edb616feb queue: Add logging
(imported from commit db2f15cf5f6a683f03d08a2e8b8ee4547537daf7)
2013-02-08 13:57:22 -05:00
Keegan McAllister 89c544f21f queue: Refactor SimpleQueueClient initialization
In anticipation of subclassing.

(imported from commit 1ebee932aed1b472bf9a8ab6d9bc30519f587c83)
2013-02-08 13:57:22 -05:00
Keegan McAllister d349de903b queue: Get rid of lazy initialization in SimpleQueue
Instead make it a singleton with a get_instance() class method.

(imported from commit e32cabf77b43361e74a11a23bba3a6d9fb32f82f)
2013-02-08 13:57:22 -05:00
Keegan McAllister b2bc7941dc queue: Use normal instance data in SimpleQueue
Code like this is dangerous:

    class SimpleQueue(object):
        queues = set()

because all instances will share the same 'queues' set object.

We don't really need multiple instances, but neither is there a reason to break
them.  So do the normal Python thing instead.

(imported from commit a56bb8414dd549cfd312c9565df198cf9d20f08a)
2013-02-08 13:57:22 -05:00
Keegan McAllister f14db52f22 queue: Rename SimpleQueue to SimpleQueueClient
It doesn't represent a single queue; that's what the 'queue_name' arguments are
for.

(imported from commit 8382ae6793ca7c3ae4b5aacf2c128113a7a88fb6)
2013-02-08 13:57:22 -05:00
Keegan McAllister 2617bbcdff queue: Remove shebang line
There's no reason to run this file as a script, and it's not marked as
executable.

(imported from commit 52bddaf2b59333c1f37b2cfc90b92a164c2e6d3c)
2013-02-08 13:57:22 -05:00
Keegan McAllister c5644cff12 notify_new_user: Remove code specific to customer29.invalid
(imported from commit 4ac29251ccbfafb4a7c2dd9d7b200474d68505d9)
2013-02-08 13:33:28 -05:00
Keegan McAllister d68674be83 Remove CUSTOMER30-specific account views
Reverts c4b6f744 (inexactly, since there are some other changes along the way).

(imported from commit 5c7294fb13cd0bc523ae55c137dc5254b7cb0121)
2013-02-08 13:33:28 -05:00
Jessica McKellar ad8e9598f6 Log domain in do_activate_user.
(imported from commit 0e39b5ddc395ff245f8e3b0252ea3b33a90860f1)
2013-02-08 13:20:19 -05:00
Jessica McKellar 18db4bc823 views: remove unused imports.
(imported from commit 38a4981637f1b3bfd9135d459a17a3ba142c86a7)
2013-02-08 13:20:19 -05:00
Jessica McKellar 50bab7af8f Log domain in user creation event.
(imported from commit d5aca898781b4f33a749536181e50f941bd16b59)
2013-02-08 13:20:19 -05:00