Commit Graph

1683 Commits

Author SHA1 Message Date
Waseem Daher bf1d6f4aa4 Don't linewrap the user's full name and ellipsize if it gets too long.
This should address the catherio/tibbetts feedback of the name
breaking oddly across the middle of their name.

One notable change introduced by this commit is: If your name is very
long, e.g., "Waseemio Daherioian", it gets cut off. (On Firefox, it
gets rendered as "Waseemio Daherioia...", and on Chrome it gets no
ellipsis at all.)

The current behavior is that the long name actually overflows into
the main text area, which I think is worse.

(imported from commit 668cb30bc2326c255b229f4f19f29be473bdc1e8)
2012-11-16 11:00:14 -05:00
Waseem Daher 79abd7cb5c Make searchbox shrinking idempotent.
The existing code shortens the searchbox each time it receives focus.
Unfortunately, this means that if it receives focus twice in a row, it
shrinks twice in a row. (For some reason, the '/' hotkey does this).

So, instead, make it idempotent -- if we're already shrunk, don't
shrink us again.

(imported from commit 8179963bbd00822d15d92609d89f572d2de7800c)
2012-11-15 22:13:52 -05:00
Waseem Daher 5fa0b8d9d0 Allow searchbox to grow and shrink more flexibly.
This is nearly perfect, modulo two things:

1. If you have a search active and you resize the window, the search
   box resize doesn't take effect until you exit the search.

2. In super-narrow windows (<380px), the searchbox overshoots
   the message area slightly.

I don't regard either as huge issues -- I'll probably fix #1
eventually.

(imported from commit 4900fb9783cc9f447315b0892bd3505f5c31ce15)
2012-11-15 17:23:00 -05:00
Tim Abbott 50995dc6b7 Fix showing the subscribe-and-send dialogue when you're subscribed.
This doesn't fully fix the problems related to not syncing
subscriptions to browser clients, but it does fix the instance that
everyone experiences.

(imported from commit be2bc31a7c4443c1678321f1a938496e2632c0d3)
2012-11-15 17:15:59 -05:00
Jeff Arnold a68efd9ce2 Handle loading of older messages in narrowed view
(imported from commit 2fe1377736322a44e8682c69dd5e4312d5f46ca4)
2012-11-15 16:32:00 -05:00
Tim Abbott 2ed1917a10 api_get_old_messages: Use @has_request_variables.
(imported from commit 98862197e7b2f57e64ac4d906251cb81f582f5d1)
2012-11-15 15:39:14 -05:00
Tim Abbott 00cd30ff97 Use @has_request_variables in json_remove_subscription.
(imported from commit b08b7672959f8773db1ff7e40b53648926b47a09)
2012-11-15 15:39:14 -05:00
Tim Abbott 1c0832583c send_message_backend: Use POST() for the forged variable.
(imported from commit f2ca2a1adf1c71aa2e92e13a5f9396dfb091a8ef)
2012-11-15 15:39:14 -05:00
Tim Abbott 5467678a2e send_message_backend: Return error on messages with no recipients.
(imported from commit 4cf9bac8eb6e35dde0510afe4efb8ba70c86b566)
2012-11-15 15:39:14 -05:00
Tim Abbott 17f55441b5 Filter out empty string recipients in extract_recipients.
(imported from commit 0a4168e36ea2fe40bde281d2690adcf40bb15abe)
2012-11-15 15:39:08 -05:00
Tim Abbott 1ea1cdcdfd Call extract_recipients using a POST() decorator.
(imported from commit 135c465251a7af688b4354d0bd57763fd8ce282e)
2012-11-15 15:38:18 -05:00
Tim Abbott 03e52767ff Don't lower-case recipient email addresses in extract_recipients.
(imported from commit 7dd150dae659cc68aa6c8f1bad39f7be32384a95)
2012-11-15 15:36:23 -05:00
Tim Abbott 5230382e4d mirror: Check whether the user is a recipient by id.
(imported from commit e50f0b00d8e3cb00fdc7af3872b5adc38c432dcc)
2012-11-15 15:36:23 -05:00
Tim Abbott 4fe089e1ce Refactor arguments to create_mirrored_message_users.
(imported from commit 1a0954018585514c391dd0a6d5d2d382cb8e37ab)
2012-11-15 15:31:48 -05:00
Tim Abbott eddc516d5f send_message: Allow list-form "to" for sending to streams.
(imported from commit f1d8c694b5d89d09222d4f303f68841aede64385)
2012-11-15 15:31:48 -05:00
Tim Abbott 5faf18754e Decrease code duplication in create_mirrored_message_users.
(imported from commit d299124aa1eaa9afac62278c6b98208a14d2cdb1)
2012-11-15 15:30:09 -05:00
Tim Abbott 411a7f6b4f [manual] send_message: Rename recipient/stream fields to 'to'.
This commit changes APIs and requires and update of all zephyr
mirroring bots to deploy properly.

(imported from commit 2672d2d07269379f7a865644aaeb6796d54183e1)
2012-11-15 15:30:06 -05:00
Tim Abbott 6f10d27f3b send_message_backend: Eliminate unnecessary sender argument.
(imported from commit 64c1b9e2973e47a1d6af355cef0617c9abbff946)
2012-11-15 15:20:52 -05:00
Tim Abbott b219be06d3 Use @has_request_variables for client_name extraction.
(imported from commit b2ba8edaa680c69c82258bfc3f93a9e8028f2cfa)
2012-11-15 15:20:52 -05:00
Tim Abbott 542f8695ad Add 'try now' link when not receiving messages.
(imported from commit f52a376a62f2aed213d641e31a6f4c0380057d12)
2012-11-15 15:09:25 -05:00
Zev Benjamin 4497ef1493 Basic API tests
These tests don't have the same coverage as the json test on the
theory that the backend is shared by the two views and that
differences are mostly on the way into the backend functions.

(imported from commit ddd21135565122dae8cbe90846d1aee7e4a2f56e)
2012-11-15 13:42:17 -05:00
Zev Benjamin 3bc47bc44a Make @asynchronous's added 'handler' argument be keyword instead of positional
Adding a positional argument caused a problem when
@authenticated_api_view started using @has_request_variables
internally.  The 'handler' argument used to be passed through
positionally to the wrapped function, but when using
@has_request_variables, the wrapper inside @authenticated_api_view
had to take additional arguments.  The handler argument was then
assigned to one of those parameters instead of being passed through.

(imported from commit 66240bd465c803ddcbf4a603509051fca7381468)
2012-11-15 12:52:46 -05:00
Zev Benjamin 720d04a98b Use request variable decorator in @authenticated_api_view
(imported from commit ec46ec307cfb34275ebc33e429663172d3f2d169)
2012-11-14 17:35:38 -05:00
Zev Benjamin 012840108f Give more informative error messages for API authentication failures
(imported from commit e86495853c615915ca39be48128bd8f9bc312e5b)
2012-11-14 17:35:38 -05:00
Tim Abbott 4198dc74f1 Fix banish_broken tool.
(imported from commit 505c4a86ab106abab4c36af7c5f67c955f143c1d)
2012-11-14 16:57:21 -05:00
Waseem Daher 834c812a14 Rename "send_message" to "send_message_form" for clarity.
(imported from commit 25d9bde3390e47390724a8d4b3fd1fe95b44bd71)
2012-11-14 16:19:56 -05:00
Waseem Daher 3cf29025ec Prevent composebox form-handling code from running on all forms.
(imported from commit aee10dac671b1da83295d9e197eec4d3a0a7ceeb)
2012-11-14 16:14:48 -05:00
Tim Abbott 7ae73fabd4 Log how long requests take to process.
(imported from commit 89915f859e4493ff04a34d198ac6df5541b743cc)
2012-11-14 15:52:57 -05:00
Waseem Daher b7a9e17b67 Rename 'search' input element to 'search_query'.
If we don't do this, we get all kinds of nasty shadowing where
references to 'search.whatever' seem to be references to the
HTML input element, rather than our search.js module.

(imported from commit 4e4b562ddf895baea9619316d9fab27ae5e9fc4e)
2012-11-14 15:29:18 -05:00
Waseem Daher a1c4aa6865 Modularize search.js.
(imported from commit 72f00f832846124d833071fdd46b026c99189512)
2012-11-14 15:29:18 -05:00
Tim Abbott b22249d861 Helper scripts to fix some buggy users.
We have a lot of forged users that have bad fullnames due to
historical versions of our fullname computations; this function will
clean those up.

Also, we have a bunch of users with emails like foo|mit.edu@mit.edu
that were the result of a mirroring bug that we want to get rid of
from autocomplete -- putting them in a useless realm name will do.

(imported from commit 6e305093653ca9d327e9e28491636e99d16cfe1d)
2012-11-14 15:03:49 -05:00
Tim Abbott 2ab8af0b91 Clean up now-unnecessary extract_sender.
(imported from commit c504838bec7ec14be8fb660015445c9bc20a2a88)
2012-11-14 15:03:49 -05:00
Tim Abbott 7227cb32f8 zephyr_mirror: Compute zephyr mirror fullnames server-side.
(imported from commit 9e6f6f9fe49d60ed30753582480e592613feb3c8)
2012-11-14 15:03:46 -05:00
Tim Abbott 0971b3d8e6 Add proper transaction handling in create_user_if_needed.
(imported from commit cab9cb4886acf61f36a0b0bc80d87ed9037cc414)
2012-11-14 14:33:31 -05:00
Tim Abbott 979560d2fe mirror: Make check for duplicate messages more exact.
This should fix the problem where only one of pairs of identical
messages sent to two different zephyr classes by bots will make it
over.

(imported from commit 37005417e2e1f737501c9524b95b044eefbfe235)
2012-11-14 14:33:31 -05:00
Keegan McAllister ce49595a00 reload: Remove dead variable
(imported from commit d3ec0d7c422990606817efcc47e7eb18c221ca25)
2012-11-14 14:18:05 -05:00
Keegan McAllister 6f2bbe5917 Set and check csrf_token for #reload
Fixes a message forgery bug (#335).

This works because Django will not generate a new CSRF token if a valid token
cookie is already present (see django/middleware/csrf.py).

(imported from commit 23222cb0bb62ae8a2f8ac7fb3f24bbc866103454)
2012-11-14 13:35:24 -05:00
Keegan McAllister 122281553a Make csrf_token global
(imported from commit 734d9c886c3a77d2ba40bd449cb089a00807a656)
2012-11-14 13:35:24 -05:00
Zev Benjamin 585210feaa Fix the "load more" button disappearing after the first time it's clicked
I think this broke during a rebase.

(imported from commit 1b8d28b72127b47fbca7d4c44bab77bec1e3d053)
2012-11-14 13:01:28 -05:00
Jeff Arnold d473292f5c Make enter not submit the form in private message compose box
Fixes regression introduced by 97a438

(imported from commit 2da31fb7a742a317c9d6839ef7a1a5f887746dd3)
2012-11-14 10:27:52 -05:00
Zev Benjamin 150a800b95 Don't reject mirrored stream messages because they don't have a recipient field
(imported from commit 1677ad91dc2e470c02a01a553d9d07789199a8d9)
2012-11-13 20:22:37 -05:00
Keegan McAllister 42a5ea9d2e Specify requests.post data as a dict
These were lists of pairs because we were going to repeat keys, but that didn't
work anyway.

(imported from commit 687b3f7b8a2821d057719c725f1f39db3992ae5c)
2012-11-13 17:33:41 -05:00
Keegan McAllister f82e8fc4d1 Move Markdown rendering out of the Tornado server
(imported from commit fc726939aa1061c40b292899dbbc9ade3b29ea01)
2012-11-13 17:33:41 -05:00
Zev Benjamin 9c99e00228 Normalize the sender email while we're at it
(imported from commit 1c245156809da77b4bef7a4396e8c0bee5724490)
2012-11-13 17:25:13 -05:00
Zev Benjamin 57bc0e0b8d Normalize recipient list on the server-side send path
This was causing Zephyr mirroring to break because
create_mirrored_message_users was returning False due to the
same_realm_email check failing.

(imported from commit e6a63160f34ec056461038650b5f8027718e6c63)
2012-11-13 17:25:13 -05:00
Jeff Arnold d78d7619a8 [third] We no longer need the tabSkips option
(imported from commit 18a292f05a6a0d473b02b1817de116e1c3d66202)
2012-11-13 16:15:43 -05:00
Jeff Arnold db34090f1f Now that we have proper escape support, tab can autocomplete
(imported from commit 28faff5416301dbc168e6ffcd0045df582961c9d)
2012-11-13 16:15:43 -05:00
Jeff Arnold 1d818db995 Make escape close just the open typeahead on Firefox, not the compose
(imported from commit 59dc10dbf9deb1b42240ae534da4ccc1ec2ef7df)
2012-11-13 16:15:43 -05:00
Zev Benjamin bb534f7a5f Missed a usage of the old get_old_messages API
(imported from commit 15d3e4bb40f9aa64e976de636a5bef6e694e00c9)
2012-11-13 16:06:46 -05:00
Zev Benjamin 534a1fd2ec frontend-tests: Click on the buttons the user would for sending
Previously we bypassed the big buttons on the left bar and clicked on
the anchor tag inside the compose box.  This bypassed the
compose.start() call.

(imported from commit 2b627825596c8d3c21441e58db895b8e488e624b)
2012-11-13 15:40:53 -05:00
Zev Benjamin f851d9437d Turn 2-person huddles between the sender and other user into a personal on the backend
(imported from commit 959e7ea8101dc1d469d62ea2c7c7a65854679833)
2012-11-13 15:40:53 -05:00
Zev Benjamin 195bdb07c9 Unify huddles and personals into private messages on the send path
Personals are now just private messages between two people (which
sometimes manifests as a private message with one recipient).  The
new message type on the send path is 'private'.  Note that the receive
path still has 'personal' and 'huddle' message types.

(imported from commit 97a438ef5c0b3db4eb3e6db674ea38a081265dd3)
2012-11-13 15:40:53 -05:00
Zev Benjamin 0c1cccc880 Use plain $.ajax instead of jquery.form for sending messages
(imported from commit 46651224dfb0b1b3b4903b30cba5385025da173c)
2012-11-13 15:40:53 -05:00
Zev Benjamin 33c23c0113 Use a JSON array for recipients in send_message
(imported from commit e2184f92b708cc2e8ef3e9ae79ee4241c0aa12a1)
2012-11-13 15:40:53 -05:00
Zev Benjamin b948473a45 Simplify get_old_messages API
It now takes an anchor message id, a number of messages before, and a
number of messages after.  The result always contains the anchor
message.

(imported from commit 84d070dc8091161c86d4bbeafbdc299493890a2a)
2012-11-13 15:40:53 -05:00
Zev Benjamin 69598e2b0b Don't return server_generation in get_old_messages
(imported from commit de2b22fa51c645b7f1b92229bc15b1d0c4b4a8e4)
2012-11-13 15:40:53 -05:00
Keegan McAllister c0204ea5b3 get_display_recipient: Sort huddle recipients by email address
We need a deterministic order for the client test suite, and it seems like a
good idea generally.

(imported from commit cc8fc555611f2d2f1b21e63ce6860d446baa3410)
2012-11-13 15:09:15 -05:00
Keegan McAllister a954277647 get_{display,log}_recipient: Use a join query
(imported from commit 1278f46655760842e21a62ca5add891515ee1945)
2012-11-13 15:09:15 -05:00
Waseem Daher c8e87e0e6a Unbreak ctrl-click and shift-click in Firefox.
We had this problem where clicking a hyperlink bubbles up and causes a
click on the message, which causes the composebox to open.

We "fixed" this by setting cancelBubble (or, even better, calling
stopPropagation()).

Unfortunately, on Firefox, this fix breaks Ctrl-click and Shift-click,
because those are (apparently) implemented by adding an event listener
on link clicks, and stopPropagation prevents them from being called.

We instead work around this by handling this case in the click handler
of the parent element. (This allows the normal URL click AND Firefox's
bound event handlers for Ctrl and Shift to run.)

This resolves Trac #374.

(imported from commit 16fb3aa6fc582f1fba5009812e0b1178ce7c5bb7)
2012-11-13 13:44:31 -05:00
Keegan McAllister a91947fdde Add a command to run the frontend test suite against a testing server
(imported from commit f72604e5be3e3342cf95bde8bedc4d1733e24d79)
2012-11-13 10:59:02 -05:00
Keegan McAllister 23bdc74863 Add a client test script
(imported from commit c31ba54ed0e15b1eab5a731471f40cfa1c87152f)
2012-11-13 10:59:02 -05:00
Keegan McAllister 9bbe12c6cd Pause for 25 ms in between successful get_updates calls
(imported from commit e86c0b653669cf86b0d8956c2c85eb7610fc342f)
2012-11-13 10:59:02 -05:00
Keegan McAllister 31496e9189 Generalize Tornado-related settings
(imported from commit 76a1338a87e1a6663aa7602a499e2d769814bf08)
2012-11-13 10:59:02 -05:00
Keegan McAllister 921f7832c5 Import CasperJS 1.0.0-RC4-0-g8c798c7
(imported from commit b24184d9de034ecf4054dbc72cd6c28b49309182)
2012-11-13 10:59:02 -05:00
Jeff Arnold 488370b681 Fix various compose box bugs involving typeahead and field navigation
(imported from commit 08fe92794d566163bd935d43ec5bd7eb69978f90)
2012-11-12 18:04:31 -05:00
Jeff Arnold bff933e0e2 [third] Modify bootstrap to help fix various compose box bugs
(imported from commit 6737adac5c09c41643210f4f0ae537304e0f87ae)
2012-11-12 18:04:31 -05:00
Waseem Daher d7f146ed4f Standardize on 'e', not 'event', within hotkey.js.
Mixing these two in this file is bound to lead to a world of hurt (and
has, historically). At some point I'd like to do this across the
entire codebase.

(imported from commit 9ff029597587f9c37a0bd9f32c25a769aa1a7a20)
2012-11-11 17:56:46 -05:00
Waseem Daher cdb31303fc Remove unused function.
(imported from commit 81ba1f66128f1e7f132ae3e1da3d81ad14d7ebe0)
2012-11-11 17:56:45 -05:00
Waseem Daher c5f3018431 Simplify hotkey handling when combinations are involved.
This makes the "handle hotkeys" code path a lot simpler, and also
fixes the "copy not working" issue we were seeing on Firefox 17.

(imported from commit 8ab96d12895da2876f60da58f373372612f4ba32)
2012-11-11 17:56:41 -05:00
Waseem Daher d76442c7e4 Process the whole key event through the hotkey handler, not just the key code.
(imported from commit c356dd09f7c2620c45d5bada61c0a5b261768888)
2012-11-11 16:35:45 -05:00
Jeff Arnold 5c7419307c Fix style mistakes we didn't catch the first time
(imported from commit ae1ca10ea8559702e4e73481715239ff456eca4b)
2012-11-11 13:24:44 -05:00
Jeff Arnold e7807742cb Pressing "enter" in the compose box fields should not submit the form
Resolves Trac #333

(imported from commit 2a824c5d38a6b53a425c72f5eb3534fe26d75faf)
2012-11-11 12:28:26 -05:00
Waseem Daher da571f16ff Fix "resizing window breaks in Firefox" issue.
So, in Firefox, $(window).width() does not include the width of the
scrollbar. However, the CSS media-query max-width DOES include the
width of the scrollbar -- so the Bootstrap change and our change do
not happen at the same time.

window.innerWidth does take into account the width of the scrollbar,
though, and seems to have reasonable cross-browser support, so we use
that instead.

(If we wanted to be slicker, we could use a media query a la
https://developer.mozilla.org/en-US/docs/DOM/window.matchMedia ,
but that's not supported in IE <10.)

This resolves Trac #35.

(imported from commit ca35321c02d5e79e4f9c439a662805c016a333ed)
2012-11-10 14:52:53 -05:00
Zev Benjamin c3a17de14c Don't switch to the not-composing state if the server did not accept our message
This fixes #349

(imported from commit 4e54f3ab3e9c91c5f23ccf22269775b01550f757)
2012-11-09 18:08:31 -05:00
Zev Benjamin d41fde7d92 Rename parameter for clarity
(imported from commit c69a5a57467664631ba812c5237641e0203e1aaa)
2012-11-09 18:08:31 -05:00
Zev Benjamin d980afcf25 Actually convert to JSON instead of hacking it with string concatenation
Old browsers might not have the global JSON object, so we may have to
include something like https://github.com/douglascrockford/JSON-js
for old browsers in the future.

(imported from commit e30a291d1212f2a00b543551b3a77082c7406eec)
2012-11-09 18:08:31 -05:00
Jeff Arnold c800186553 Make tab not autocomplete on the compose box subject field
(imported from commit 7b305a3ca5ae5864255c4eca5464560f92b708b0)
2012-11-09 17:57:20 -05:00
Jeff Arnold ef585cf1f6 [third] Create a Typeahead option tabSelects for whether tab autocompletes
(imported from commit d1602e998b54d39eb515d0866e7ed2d158fe97d8)
2012-11-09 17:57:20 -05:00
Waseem Daher cb0f48b59d Restyle subscriptions 'undo button' slightly.
Some stylistic tweaking to the solution to Trac #127.

(imported from commit 5f9a84c91716e6e57cce2cef1d8ca0915e4b135f)
2012-11-09 17:13:15 -05:00
Jessica McKellar d6ad978c1a activity monitor: style tables and make them sortable.
(imported from commit 03c5002e6a289ca123b47f99c065b41cfc013762)
2012-11-09 16:45:18 -05:00
Jessica McKellar a800904183 Add sorttable JS library.
(imported from commit a60799d0301a590a599fe70f1058006e1398faa9)
2012-11-09 16:45:17 -05:00
Jeff Arnold 7e3536960a [third] Make tab move to the next field without autocompleting
(imported from commit 232d3662a0a910d8056ba838d7f07c8e774b23a1)
2012-11-09 15:50:05 -05:00
Luke Faraone ed1caec147 Document the selctors in signup.js per trac #327
(imported from commit b21f5c4dbdc1b4dc5dbdc5a3152fdc8cbbb872ef)
2012-11-09 15:03:08 -05:00
Tim Abbott 30b43ebee2 Uniformize /json/ and /api/ URLs to end with no trailing slash.
(imported from commit c35b30bcc43982db3a2f774ea69269e5424a6159)
2012-11-09 14:30:10 -05:00
Zev Benjamin 565edc3c5a Fix tests failing due to changes in error message text
(imported from commit 1b0a869d427b33a0e8fcec4e2aa083bd94eee640)
2012-11-09 14:21:06 -05:00
Zev Benjamin 50b3cdd637 Make failures parameter in get_updates_backend optional
This was causing our tests to fail and would have also
affected API users not using our Python bindings

(imported from commit 2d81496892e9042e328279edea94be8ee4d21c1b)
2012-11-09 14:21:06 -05:00
Tim Abbott 831316c6a6 Fix tests failing due to new activity tracking.
(imported from commit 9c7ddfd4ad40cd2dfd38ac41537e058e02797085)
2012-11-09 14:16:52 -05:00
Jessica McKellar 3af5e246be Don't cache your personal gravatar across gravatar updates.
(imported from commit 06f82faaa350db8a64cebef24b738b5e93bebb98)
2012-11-09 12:44:09 -05:00
Tim Abbott 85423bc010 Add a /activity page displaying data on user activity on the site.
(imported from commit 3877be49e4e0b89cadfead88b5c51f955759a996)
2012-11-09 12:28:38 -05:00
Zev Benjamin 1e91310ee6 @has_request_variables: tell users what their bad value was in the error message
(imported from commit 0e5e576da74c6492c2f9189bcf725c336cd9b2d7)
2012-11-09 12:27:40 -05:00
Zev Benjamin 8a0bef6c42 @has_request_variables: don't apply the converter to default values
(imported from commit 44fecac26268c4c1b7f69b4d5013cfbff2010744)
2012-11-09 12:27:40 -05:00
Zev Benjamin 472480a4b6 Move @has_request_variables decorator from return_messages_immediately to get_updates_backend
return_messages_immediately's return value is not returned, so the
argument validation in @has_request_variables didn't work correctly.
@has_request_variables would return a json_error, but
send_with_safety_check expects a dict.

(imported from commit 86b6bccb7861dbf523c06b606b87374e339059a4)
2012-11-09 12:27:40 -05:00
Zev Benjamin fd51cf343b Make client_id parameter in api_get_messages optional
(imported from commit a3221fe73f63c2cfa8f87b6059283a9aa0e8b8e4)
2012-11-09 12:27:40 -05:00
Jessica McKellar 3df5d0faf3 Don't disable hotkeys on buttons in general -- just the send button.
The original check has become too broad now that we have more buttons,
and specifically this lets you use the search hotkey to start a new
search after you've been searching up and down.

(imported from commit 0e691ff55ff9d4be8d406d1eb47fc2062758d28b)
2012-11-09 11:44:06 -05:00
Tim Abbott 9e9438153c [schema] Store analytics on usage of our product.
(imported from commit 4fbf8215225fc8f505b9c749ccf80c556af13e87)
2012-11-08 18:00:57 -05:00
Tim Abbott de4548dcb5 populate_db: Don't give huddle senders 2 UserMessage rows per message.
This bug was caught by our new unique_together constraints.

(imported from commit 5392c12cdc8e5c9603652ba2a32ae4400375f14b)
2012-11-08 18:00:46 -05:00
Tim Abbott 2be66f0e8a populate_db: Don't create huddles with 2 copies of the same person in them.
Bug caught by our new unique_together constraints.

(imported from commit 37c1fc459b98050417e907653a5a4fc97004903b)
2012-11-08 17:59:31 -05:00
Tim Abbott 5ab0cccf41 Pass the user's user_profile to authenticated view functions.
This change substantially increases the number of view functions where
the API and JSON versions are actually identical code.

(imported from commit 2eee55a8943cf9a684bec2ba1f6d7afcb2b91948)
2012-11-08 17:59:31 -05:00
Zev Benjamin 506a5b729b Add note to @has_request_variables about when it is inappropriate to use
(imported from commit 952341aad07e07d762ea3ec66a5b167bcb40ecea)
2012-11-08 16:40:07 -05:00
Zev Benjamin 95cd3f8ee6 Use the new @has_request_variables decorator
(imported from commit 2aa99140bf19e7e236f872960abd1b84b6a713be)
2012-11-08 16:40:07 -05:00
Zev Benjamin 27cf7e09d3 Add magic request variable extractor decorator
Functions with the @has_request_variables decorator can have some of
their arguments extracted from the HTTP request.  For each such
argument, its default value should be an instance of the POST class.
The arguments to the POST constructor control the request variable
name that the function parameter should be populated from (it
defaults to the same as the parameter name), whether the value should
be converted before being passed, and whether a default value should
be supplied if the parameter is missing from the request.

(imported from commit ba1c25d73ba3980e44abec1458e6496807fcdaa4)
2012-11-08 16:36:14 -05:00
Zev Benjamin dc8c54e6db Move view decorators into decorator.py
(imported from commit 737cff552b395493f44864ac06e901b0ba17fa29)
2012-11-08 16:35:31 -05:00
Zev Benjamin b278db110f Move json response functions into their own file
(imported from commit 91a786849bfa30dcacecef6b8339d8f1a9365156)
2012-11-08 16:30:57 -05:00
Zev Benjamin 7bbde14d78 Use functools.wraps on the functions returned by our decorators
This lets Django report the correct view name in errors

(imported from commit b21347e7af39cda439125355f99f4fc63fc3bd2f)
2012-11-08 16:30:57 -05:00
Zev Benjamin 0ca46d5abe Correctly construct tuple
(imported from commit f85ae7b0e4c335548cbe7254e5d820ced17a50a9)
2012-11-08 16:30:57 -05:00
Keegan McAllister c5035dade0 Remove unnecessary intermediate list
(imported from commit 037000d1c7c84d976866b9a8cef6eb3a69baecb9)
2012-11-08 15:13:20 -05:00
Keegan McAllister b0d395b0c1 Use generator expressions with sorted()
No need for an intermediate list.

(imported from commit c8ccdf2399155876b6cbf1f768ad3ec303730757)
2012-11-08 15:13:20 -05:00
Keegan McAllister ac1edd05fa parse_named_users: Rephrase odd for loop
(imported from commit daf77ceccb7eabf27946836841a34d5fa703b3ac)
2012-11-08 15:13:19 -05:00
Keegan McAllister 0fbb33c33f already_sent_mirrored_message: Clean up query
No need for an 'if' if we're just returning a boolean.  And using
QuerySet.exists() should be a little more efficient.

(imported from commit 69ec3cc9f2fe904ec40ea3b8a8687a06cd03f3f3)
2012-11-08 15:13:19 -05:00
Keegan McAllister e94c6fdf86 return_messages_immediately: Remove dead assignment
(imported from commit ef5583c292db3c3087af4949a0b0b255cf098cd1)
2012-11-08 15:13:19 -05:00
Keegan McAllister f2ac76aeac get_stream: Use try/except
For consistency with the rest of our code.

(imported from commit a2df17facad1a4e3b9e5e1dc4d33b64010cee939)
2012-11-08 15:13:19 -05:00
Keegan McAllister 8df247708c Rename login_required_*_view -> authenticated_*_view
login_required_api_view is misleadingly named.  It accepts neither a Django
login session nor login credentials (username / password).  The intent here is
authentication, whether stateful (login) or stateless (API key).

(imported from commit 7e9be552168396b399116737655bd7267fd5c1a3)
2012-11-08 15:13:19 -05:00
Tim Abbott 9a14073dda models: Add unique_together constraint on UserMessage table.
(imported from commit 79fcc1c9db11cc89a300b9d78a3c2f8cccb0917c)
2012-11-08 15:10:34 -05:00
Luke Faraone 3928f763e9 Make unsubbing an undoable action.
(imported from commit 713fdad5aa5d138b9e95a14dccaeba0d9d612c1c)
2012-11-08 14:42:50 -05:00
Waseem Daher 055d18b484 Add a "New private message" button.
(imported from commit fd15f26b73d0fedb536763d51fb4f0b50b2912bb)
2012-11-08 13:54:16 -05:00
Tim Abbott 1ef33bc5ea Remove starnine@mit.edu from API super users.
(imported from commit 67019a1e2a298a56b0efe598d4492f4b0f8dee87)
2012-11-08 13:34:32 -05:00
Tim Abbott f74bf4da92 is_super_user_api_key: Make tabbott/extra@mit.edu a super user.
(imported from commit a8bb8356c3d3ca37eb8de9ab705f400942389429)
2012-11-08 13:04:47 -05:00
Keegan McAllister d52728e3ae Recipient: use a dict to name types
(imported from commit 35ab065e7def38cb684672e48f2ca10f5f6479ad)
2012-11-08 10:48:34 -05:00
Keegan McAllister b57270322a models: Always pass a tuple to string %
(imported from commit c2881ef8f60fd7be2f70138868214d42d41b492d)
2012-11-08 10:48:13 -05:00
Keegan McAllister 979d997cf8 bulk_create_huddles: Use a set for existing_huddles
(imported from commit af66c6e4e87109feafbafdc6e84cf02903ca93ca)
2012-11-08 10:48:13 -05:00
Keegan McAllister 246c0a37bc Get rid of bare 'raise' outside 'except'
Within 'except', 'raise' re-raises the current exception.  But outside, it produces

    TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType

which is pretty confusing as a generic "something has gone wrong" exception.

(imported from commit 9fcd003a952b82df67726c26161dced079978a32)
2012-11-08 10:48:11 -05:00
Keegan McAllister 5933a902c7 Remove unnecessary line-continuation backslash
(imported from commit afabcea50432b0e00f17e7a4cc4cb6c4a0c19cf2)
2012-11-08 10:47:09 -05:00
Keegan McAllister a70d82b8fc Use comprehensions more consistently in bulk create
(imported from commit f6b67b9ce74b379004e5fde6c99368c077a77f7b)
2012-11-08 10:47:09 -05:00
Keegan McAllister 51a96484f9 Consolidate callback code
(imported from commit e79ea42df3506bedd2077dcc63a45d32fe7b73de)
2012-11-08 10:47:09 -05:00
Keegan McAllister 9b9373d2ba Make callbacks_table class data rather than global
(imported from commit 39699304255b475ccab8a4760b155f3307cfe5d9)
2012-11-08 10:47:09 -05:00
Keegan McAllister f89366f5dd Use a new-style class for Callbacks
For consistency with the rest of our Python code.

(imported from commit 02659914f50b488039fe8c65bd1de796e2a16e65)
2012-11-08 10:47:09 -05:00
Keegan McAllister 3b8dbbc7d7 Use django.utils.timezone.now consistently
(imported from commit f223d9c1f6c77012db342b8be7aaed964b9f18c6)
2012-11-07 18:51:33 -05:00
Tim Abbott 218588ead0 models: Comment the IntegrityError code in get_client (#326).
(imported from commit 85c3580084dcd4c28f319a19d684e5a5af7069c7)
2012-11-07 18:22:32 -05:00
Keegan McAllister 205d839a58 context_processors: Rename misleadingly named unused parameter
(imported from commit 45fcb3e349747f430372767c21a50660cbb19228)
2012-11-07 17:46:46 -05:00
Keegan McAllister 0d538d91ac test: Fail if generate-fixtures fails
(imported from commit b13167ad04837cfeb64989ff43fec2e6ae890a33)
2012-11-07 17:46:46 -05:00
Tim Abbott 573cc4db33 models: Add unique_together restrictions for various tables.
(imported from commit 30957d465d5e7bc728e854b8b99f6ad99b98dba6)
2012-11-07 17:31:16 -05:00
Tim Abbott ff369373bf populate_db: Strip whitespace from stream names.
(imported from commit a33b4983994040060f8d7631238250297f4d152e)
2012-11-07 17:30:50 -05:00
Tim Abbott 02b7bcf1a4 populate_db: Make double-unsubscribes not a fatal error.
(imported from commit 4dadb28f9c310659ddd780e98da70da55ace7187)
2012-11-07 15:49:45 -05:00
Tim Abbott 95c39cbc76 bulk_create: Use a (large) batch_size with MySQL.
(imported from commit 529fef7dd55bb8a5f4e286f7c896f4b14b0d1b8d)
2012-11-07 15:49:45 -05:00
Tim Abbott e7abe13cd6 The empty string shouldn't be a valid stream name.
(imported from commit 1fa878d7d51d3c3444ac75edf08b32f886683964)
2012-11-07 15:42:32 -05:00
Keegan McAllister a815a253f7 get_profile: Return max_message_id
(imported from commit 5b5c853e667e47ff46ff14558f1e27f619f77cd7)
2012-11-07 15:34:44 -05:00
Keegan McAllister d461453250 Remove max_message_id from updates response
(imported from commit 1d8ce12a4d32dfb761617b4c2aa8e9fbe3ad2994)
2012-11-07 15:34:44 -05:00
Jessica McKellar 9077d51d54 For now, allow all characters in stream names.
We've had multiple requests from MIT zephyr users to allow
non-alphanumeric stream names, and we haven't decided what we want to
allow, so for now allow everything.

Note that the web client and mirror script limit stream names to 30
characters, which is our database limit.

(imported from commit 2acb5ee04e5ee7c40031ac831e12d09d04bbb2e6)
2012-11-07 15:12:03 -05:00
Jessica McKellar 1801292320 Update autocomplete lists only on case-insensitive new additions.
That way your autocomplete isn't polluted by multiple casings of the
same subject.

(imported from commit 0f28029be45bb48981f2e29ccb9f1490c1a56c94)
2012-11-07 14:51:51 -05:00
Jessica McKellar a2c6975ca2 Be case-insensitive about subjects when collapsing and narrowing.
(imported from commit 0baf20179c037c3eac82d8db20c6ec8062bb136a)
2012-11-07 14:51:51 -05:00
Keegan McAllister 3b78280786 search_button_handler: Remove unnecessary id lookup
(imported from commit e6da0cfa0b39e48c63464eaf91673c3133ad4cd4)
2012-11-07 11:51:03 -05:00
Keegan McAllister 3de0a0d1dd Use rows.id consistently
(imported from commit 58098986b90609484e4a7c10688eeb27f2c126b2)
2012-11-07 11:51:03 -05:00
Keegan McAllister 644702892b Return an int from rows.id
I believe this is more correct for our one existing user,
update_selected_message.

(imported from commit a2f1a20c0d885a4e6de49c69d930844177549cbe)
2012-11-07 11:51:03 -05:00
Luke Faraone 8bcbe55238 Clarify line in hotkey.js per trac #253
(imported from commit d5bacdd4cef2f62ba22e3a47d25c3a656cf601c0)
2012-11-07 10:43:42 -05:00
Keegan McAllister bbb70b496b send_pointer_update: Use an absolute path for /json/update_pointer
(imported from commit 8711df3f705023e763cf916a7dfbf43054d4823f)
2012-11-06 17:04:10 -05:00
Keegan McAllister 3923e2eca6 subs: Use an absolute path for /json/subscriptions/list
(imported from commit 82a2de5373e9170b27f4157c566e7ee23ba1f278)
2012-11-06 17:04:10 -05:00
Keegan McAllister 5f20d71065 Rename people_hash -> people_set
And use 'true' for consistency with stream_list_as_set.

(imported from commit 1cfb0a64eae368388cb2e0e57162d3b3d5ef88c1)
2012-11-06 17:04:10 -05:00
Keegan McAllister 22dc487a72 Rename stream_list_hash -> stream_set
This makes the intent more clear, since the values are all 'true'.

(imported from commit 1f1d6e206af9f2258b55bc77e7722158c2ffac98)
2012-11-06 17:04:10 -05:00
Keegan McAllister 651566ba16 Use an Object for associative stream_list_hash, not an array
From the Google JavaScript Style Guide:

    If you need a map/hash use Object instead of Array in these cases because
    the features that you want are actually features of Object and not of Array.
    Array just happens to extend Object (like any other object in JS and
    therefore you might as well have used Date, RegExp or String).

(imported from commit 048e7a640137f3919c0097a421b7b6c366b65cfe)
2012-11-06 17:04:10 -05:00
Keegan McAllister 4f53457f2f show_all_messages: Use .empty() instead of .html("")
(imported from commit 8df159bee6512856fd61eb5038e4b12470724553)
2012-11-06 17:04:10 -05:00
Keegan McAllister d6d34075ab Remove duplication in message validation
NB: this does change which error will be flagged if multiple conditions apply.

(imported from commit 080bf7d764f1f16ad57b365ad9aa6bc48f3cff72)
2012-11-06 17:04:10 -05:00
Keegan McAllister 366ca546e8 compose: Remove duplicated code in getters / setters
(imported from commit 3a17ef6fbcf9b8b4a31a54656152a1d37dea4fa0)
2012-11-06 17:04:10 -05:00
Keegan McAllister fcf21177fe compose.start: Reformat default opts
(imported from commit e0266265dbe81d19f3a666b2f822dffd2d8793d5)
2012-11-06 17:04:09 -05:00
Tim Abbott 6a690d4d4a Create our various bot users without subscriptions.
(imported from commit 9f9249cdb295f147d8b8b5cef17709c9aaa66418)
2012-11-06 16:59:28 -05:00
Zev Benjamin 58684965da Don't show the 'load more' button when the user has no messages
(imported from commit f763535480e5efcf0d345f22e076a97ba1f5809c)
2012-11-06 16:40:52 -05:00
Zev Benjamin c21a255b37 Hide the 'load more' button sooner if there are no more messages to load
(imported from commit ac046851c3a74a6f053e5f3c3b2950526a49cc46)
2012-11-06 16:40:52 -05:00
Zev Benjamin 39db8bf5d5 Use symbolic name for constant
(imported from commit cafb513c082b1ff1cf2169d90c3e4a77a9af5a9e)
2012-11-06 16:40:52 -05:00
Zev Benjamin 9875164908 Select the first ever message the user receives
(imported from commit 0fd6fa03175d9787a5e5a93d6172309a5eb47bfc)
2012-11-06 16:40:52 -05:00
Zev Benjamin df10d184a7 Only load initial messages if we know we will have some
(imported from commit af6bec8bdcd5dc1a643662e7531a3ec75298ffa0)
2012-11-06 16:40:52 -05:00
Zev Benjamin b5cd40723f Start long-polling immediately in get_updates if the user has no messages
(imported from commit 02f883c58513f3bb705b248320cd9cfb7abd6417)
2012-11-06 16:40:52 -05:00
Zev Benjamin 8464e45507 Set the response status to 400 in send_with_safety_check if there was an error
(imported from commit 11fd082bb88be271b268d60cc797318386c9d778)
2012-11-06 16:40:52 -05:00
Jessica McKellar 4cad5f6e96 settings: Update name and gravatar without a reload.
(imported from commit 961c9f64d7c39b4345ece036062854e8d474d2c0)
2012-11-06 16:33:22 -05:00
Jessica McKellar 7dcd8a5a3c Don't have clicking in the blue background on a row update the pointer.
(imported from commit 384c91454b15ddf3ce80e71603a594916c2916d4)
2012-11-06 16:33:22 -05:00
Jessica McKellar 0700b96f37 Hover the sender name on gravatar and e-mail hovers as well.
This clarifies that clicking on any of those three pieces of
information will pop up the user info tooltip.

(imported from commit 1e57550d66acbb2e8d5d244d2997bbd394c334c3)
2012-11-06 16:33:21 -05:00
Waseem Daher c654520c73 Display email on currently moused-over message.
(imported from commit ae27dc6068fefa9df7b5a03992df0253da9ec61a)
2012-11-06 16:33:21 -05:00
Waseem Daher 9e090b2d28 Make sender name more obviously clickable.
(imported from commit e75a6a051c939dd780d4815385b9c1eef0a07255)
2012-11-06 16:33:21 -05:00
Tim Abbott f342217700 Add timestamps to our various non-message logged events.
(imported from commit 65102419ac0032ccedcbdb342dbea9b91bbe3e13)
2012-11-06 14:12:19 -05:00
Tim Abbott a6cd21a1b8 Log events to a file named after the current server.
Merging these log files together is future work.

(imported from commit 54abf1ed41c2d8ba220fd3af0d997256c2718db0)
2012-11-06 14:12:19 -05:00
Waseem Daher ce2023b348 Make 'v' the new hotkey for "Show all private messages".
(imported from commit a7299633bf363cf832ff7099c963bc56abfdf734)
2012-11-06 13:37:24 -05:00
Waseem Daher 6b149af91d Rename 'huddle'->'Private message' in user-facing strings.
(imported from commit d3bdccc37a4fb7b373c6c1c69091353f39fecafd)
2012-11-06 13:37:24 -05:00
Keegan McAllister e9c81a4a8b runtornado: Don't apply response middleware twice
This was causing us to log some requests twice, and might have more serious
consequences as well.

(imported from commit 0bb2d7207ee3e4e04679215a7f5ae637cd26aa19)
2012-11-06 13:15:49 -05:00
Keegan McAllister 8259059119 runtornado: Remove ability to run without specifying exactly one port
The zero-port case never actually worked, because addrport wasn't an optional
parameter in run_one.  And multiple ports was implemented using the
multiprocessing library, which is just bad news.  Since we have no need for
this, remove it before it can cause trouble.

(imported from commit 9d913924701f30d23ebe878b76c8f1f0da2800e2)
2012-11-06 13:15:49 -05:00
Keegan McAllister 43af871759 ui: Fix punctuation in a comment
(imported from commit 9ca5317cd73485891c136876d4e19e986f04c579)
2012-11-06 11:25:11 -05:00
Keegan McAllister 54e8df4393 Fix missing newline at end of reload.js
(imported from commit 30faacb6b3c0d6d57265c464459c2c088cd9244f)
2012-11-06 11:25:11 -05:00
Keegan McAllister f1809b8f9c add_display_time: Note unescaped variable
(imported from commit 17d683e2bf0e5eabfb1cb2cdb6a1db18d140b5c9)
2012-11-06 11:25:11 -05:00
Keegan McAllister 080c169e90 same_recipient: Fix spacing
(imported from commit 75247bbbb496870236ab26f827daeb3fbe7bb7f3)
2012-11-06 11:25:11 -05:00
Keegan McAllister b56446513f Don't set default opts in select_message_by_id
These are set again in select_message and we don't use them before then.

(imported from commit 9d1f5ebd7f87890817d6cb4411d62f1e7d1cd053)
2012-11-06 11:25:11 -05:00
Keegan McAllister f9b346666a Comment use of .outerHeight(true)
(imported from commit 1b0f8da2c76dc5bc7504b4d4aa026351d1ab6627)
2012-11-06 11:25:11 -05:00
Keegan McAllister ca25c4d4a5 Consolidate report_{message,success,error}
(imported from commit 21deb6a41438bf7697bd8a3c46a428ca0034f2b0)
2012-11-06 11:25:11 -05:00
Waseem Daher 807fab6760 Make composebox look more 'on top of the page'.
Hopefully fixes https://trac.humbughq.com/ticket/126

(imported from commit cd9f74dbc29b918c4a81d2c2c53554586134477b)
2012-11-05 18:39:20 -05:00
Waseem Daher 8e6aa3d2d7 Use "huddle" consistently.
(If nothing else, because it will make the inevitable rename easier.)

(imported from commit 5077b04412ba9d5f885bf2c2e898bfd702adbe6c)
2012-11-05 18:39:20 -05:00
Zev Benjamin b9c86ca49c Be more robust and aggressive about cleaning up recipients in the huddle compose box
(imported from commit 6fe4ca445b6559e91a9b23088f3effdde4f18d7b)
2012-11-05 18:09:11 -05:00
Zev Benjamin fc9a47a26f Factor recipient splitting out into a function
(imported from commit a00b090d0446dc9b80a33a92c68e37cd9aece251)
2012-11-05 18:07:11 -05:00
Zev Benjamin dc95a2b8f3 More regex robustification
(imported from commit 1f7c7c660b0446f0724ff339b9326b9b8a5fe5a0)
2012-11-05 18:07:11 -05:00
Jeff Arnold 986b780c69 Increase the bottom line.
(imported from commit c1ac8a3be566713b61f971fb1da0214d2c1aef9c)
2012-11-05 16:03:50 -05:00
Keegan McAllister eac7040bd0 hotkey: Reduce keydown/keypress duplicated code
(imported from commit 9d279166607105cffca6b18bdce9324be91be9f4)
2012-11-05 15:38:23 -05:00
Keegan McAllister 94a635a379 hotkey: Rename keydown_handler -> current_key_handler
Since it's used for both keydown and keypress.

(imported from commit 23ac169b20ec33d961f982a7deb0fa721b8173f7)
2012-11-05 15:38:23 -05:00
Keegan McAllister 288fc6f2ee hotkey: Implement and use the contract on key handlers
The comment on keydown_handler says that these functions should

   "return a new handler, or 'false' to decline to handle the event."

(imported from commit 8cd23ee69ef900fcb7c7c211fe6ad36f54f02ba9)
2012-11-05 15:38:23 -05:00
Keegan McAllister 14f7f46c24 hotkey: Document more clearly what key 13 is
(imported from commit a91ca23d9586374defbe5cc29fd9b1969a99be09)
2012-11-05 15:38:23 -05:00
Keegan McAllister fed4d6f69e hotkey: Expand on forward declaration comment
(imported from commit f23414655dbf3caa2220b938cd93959753eae8fe)
2012-11-05 15:38:22 -05:00
Keegan McAllister 3b66748967 hotkey: Use $.each instead of 'in'
This is simpler and more consistent with the rest of our code.

(imported from commit 5188b8047952fe4e6556a26f10ab93123d67e03f)
2012-11-05 15:38:22 -05:00
Keegan McAllister 4cd5cdbcd6 Revert "Clean up how we deal with the message type tabs"
This reverts commit 429e055d3eca65af8bc0fe58481a7becf9ced66a.

There is some inconsistency between the names 'huddle' and 'personal' that is
breaking things.

(imported from commit 4c81853fca9d88d13ce8f23e2d6884c33cdc57d2)
2012-11-05 15:01:49 -05:00
Keegan McAllister 89b667ba20 Cleanup whitespace in CSS
(imported from commit ffd0d4715977b1655ee9df84db4fe014d67216bf)
2012-11-05 11:49:01 -05:00
Keegan McAllister 477bad9536 Clean up how we deal with the message type tabs
(imported from commit 429e055d3eca65af8bc0fe58481a7becf9ced66a)
2012-11-05 11:49:01 -05:00
Keegan McAllister db845350ad Clear password change boxes when switching tabs
Fixes #256.

(imported from commit 32a2528f299aea8f2d28cce807f60eb81a75e26d)
2012-11-05 10:46:46 -05:00
Jessica McKellar 15ca35e961 views: remove unused imports.
(imported from commit 1c44a1b23bb020b82bae99a75a12218c3e708e26)
2012-11-05 10:32:42 -05:00
Jessica McKellar 9eb86df03a tests: Unbreak registration, which was missing the new TOS field.
Also remove unused fields.

The registration tests should be revamped for our new multi-stage
signup, but for now just get the test suite passing completely.

(imported from commit 481f420cf99341e44e71942ae563e3f9a1270d3e)
2012-11-05 10:32:42 -05:00
Zev Benjamin 7b6eb243ed Make the regex that removes trailing commas in the huddle recipient box on blur more robust
(imported from commit ff71c802c5590a96c6649aa9a5e7c841bed82e1f)
2012-11-05 00:47:22 -05:00
Jessica McKellar 4396f1bf35 Don't unnarrow if you click the Home link from another pane.
This makes the Home link modal (when on the Home pane, it unnarrows
you; when on a different pane, it returns you to your feed in whatever
state you left it).

Fixes Trac #5.

(imported from commit 3181f17035d78a9916ab7a3ad336f34cb66d3cdf)
2012-11-04 11:17:48 -05:00
Waseem Daher 39dbc23660 Rename function for clarity.
You're not necessariy getting the last email, you're getting
the last recipient the user typed in.

(imported from commit f7ab4153a5b2497bc31a42d3ac5aea0636daaf60)
2012-11-03 02:03:51 -04:00
Waseem Daher 5d43328d1e Make typeahead autocomplete more reasonable when composing huddles.
This attempts to tackle the issue where Cordelia always gets
accidentally CCd, with the following as a reproducer:

wda [tab] [backspace] [tab or enter] sends a message to wdaher and cordelia

(imported from commit fbbd722173584e50c34878b7d6249b09564fb172)
2012-11-03 02:03:09 -04:00
Waseem Daher a52e4fafc9 Cause huddle autocompletes to highlight after the first one.
(imported from commit da660998d771ba350a793d058938737af2b9ae84)
2012-11-03 01:50:15 -04:00
Tim Abbott 1993ee403d Remove @asynchronous on notify_foo views.
(imported from commit 79e3f99450deb3efa0c4154465a692ef01306ce4)
2012-11-02 20:55:31 -04:00
Tim Abbott 517c8e298a Remove now-unnecessary check for 'time' in json_send_message.
(imported from commit aa177e13c16a43a5914227142a4e2589e2bd92bb)
2012-11-02 20:55:31 -04:00
Tim Abbott 1adc54185f Fix unnecessary usage of realm ids creating new users.
(imported from commit 5870b583efffa4a5280c81125eefecc23978cf11)
2012-11-02 20:55:31 -04:00
Keegan McAllister 2b1ecd1ad8 Fix name of login_required_api_view in comment
(imported from commit e278256da19c3abd4ee05bd6c4318a482a25cee0)
2012-11-02 14:57:38 -04:00
Keegan McAllister ac6a74bd73 test_public_urls: Fix docstring
(imported from commit 18bf6595386ca65e0a928c9e0b60e8e0a46f77e2)
2012-11-02 14:57:38 -04:00
Keegan McAllister 02aa92a604 Correct comment on filter_by_subscriptions
This isn't dead code; it's used by tests.

(imported from commit ce6cfc049d2cb8050aff1fef1b77a3778b7ceacb)
2012-11-02 14:57:38 -04:00
Waseem Daher d545ae4884 Bugfix: event -> e.
The fact that we're inconsistent about this in our functions
is definitely going to lead to more bugs of this form
down the road.

(imported from commit 907badcb28c0834729e21436c621255fa6584d44)
2012-11-02 14:31:16 -04:00
Keegan McAllister b87a35c1ff bugdown: Disable + as a bullet character for an unordered list
Fixes #272.

(imported from commit 8afaf14965ed1f6a4bb3ccfc9d4c2d807148666d)
2012-11-02 14:04:09 -04:00
Keegan McAllister 7a6fe207c5 bugdown: Disable ordered lists
These get automatically re-numbered, which will do the wrong thing when people
split their lists across multiple messages.

Fixes #241.

(imported from commit 7f6f2c36a6ab27cef0a34008f304fc0fe25c8bd0)
2012-11-02 14:04:09 -04:00
Jessica McKellar 296f707aef Blur search buttons before hiding them, so they don't interfere with hotkeys.
We currently disable hotkeys if the focus is on a textbox or
button. Hidden buttons can still be in focus, so blur the search
buttons before hiding them.

(imported from commit 5fdab34ad9931ea5ea2ad1827b36dfe4c02d8797)
2012-11-02 12:00:31 -04:00
Jessica McKellar bd822bebcd Disable arrows when you have no more results in a direction.
(imported from commit 824f541fd0b71bf0a9887cb94bb9585059a5413b)
2012-11-02 11:04:16 -04:00
Jessica McKellar d91ddf9359 Hide search arrow keys until a search is active.
(imported from commit 2f6a11ccc410633157502e8beebb4acf32eca2b6)
2012-11-02 11:04:16 -04:00
Jessica McKellar c1cc9f0742 Don't re-focus on the search box after ending the search.
(imported from commit 35bffb245ad9dc58b394a1c5228b32db4830f2bd)
2012-11-02 11:04:16 -04:00
Jessica McKellar 336e4ac5a6 Add a '/' hotkey to initiate a search.
(imported from commit 893865b73ddef0202da8b2f57e341fb1dc0f4fa0)
2012-11-02 11:04:16 -04:00
Jessica McKellar 7877507fe6 Re-enable the search box.
(imported from commit 6fee7e6853e9608bcb5ef211939309eca46801c8)
2012-11-02 11:04:15 -04:00
Tim Abbott 3aa7cc521f Workaround missing keyup event when user types ctrl-f.
(imported from commit ad37e0c9069ee29dd8159e020682cc05738b300b)
2012-11-02 10:50:59 -04:00
Waseem Daher a6dbb88d0a Three autocompletes for subject, for consistency with stream.
(imported from commit 08e12fa2cfbe37b53a06888b879babbcf12733bf)
2012-11-01 21:56:37 -04:00
Waseem Daher 41290f3e23 Fix XSS issue in composebox typeahead.
Whenever we use a typeahead, we should use the escaping highlighter
unless we're explicitly going to put sanitized content in it.

(imported from commit 33086327fe56a7bcbbbf8a08fe3f39800b195e75)
2012-11-01 21:56:37 -04:00
Waseem Daher 69b534c0ba Move composebox typeahead code into its own module.
This also cleans up the autocomplete source specifications,
making the three typeaheads all look fairly consistent.

(imported from commit e72655d715db74cfc9ab45b51e7e2ff9e8ea84c5)
2012-11-01 21:56:33 -04:00
Waseem Daher e72279d6a8 Reintroduce XSS issues in composebox typeahead.
This makes the diff a bit cleaner.
Revert "Interim measure: Escape fullnames as well."
This reverts commit a634e6ac39ea337be499889b3ff64b3c4f4fcccb.

Revert "Interim measure: Escape subject names before they go into the typeahead."
This reverts commit 806bc719ab296ec0fe299b33c7aa6767a0c71b9d.

(imported from commit 5a579e3535846b2bc612cf03e43c562c83119812)
2012-11-01 17:16:27 -04:00
Zev Benjamin 6178cd830a Return the error if return_messages_immediately returns an error response
We previously started long-polling.

(imported from commit 5860e484c63088ed34226f39f5aeb74e3ed43f91)
2012-11-01 16:02:28 -04:00
Tim Abbott 08b76126b4 Make the mouseover date string always include a timezone.
(imported from commit 5b4a98c6e0cdfc87ba57f6d6454488fff2810603)
2012-11-01 14:07:10 -04:00
Tim Abbott 7c3a189c03 Combine api_subscribe and json_add_subscriptions.
(imported from commit 1a5df7c88beb2c27a048b1880136b9c7cb4451b2)
2012-11-01 13:05:52 -04:00
Tim Abbott 7e0cbd1c8b Change json_add_subscription to use the same interface as api_subscribe.
(imported from commit 9b9eb0284ad262ce9701ef81162d954544435d52)
2012-11-01 13:05:52 -04:00
Tim Abbott 27867b0022 Rename add_for_send to subscribe_for_send.
(imported from commit 19f6a0710a84bf8204b81957ca49b09ec9174188)
2012-11-01 13:05:52 -04:00
Tim Abbott aca815d727 Don't add duplicate entries to subscriptions_table.
While we're at it, fix the fact that we're currently not adding
entries to the subscriptions_table at all when we do
subscribe-and-send.

(imported from commit 99bf574a4a296463e562a44186e2282654464542)
2012-11-01 13:05:52 -04:00
Tim Abbott 01bf0868a9 Rename new_subscription argument to streams.
(imported from commit 8024f47564fe580734d5e452f5092520870003a7)
2012-11-01 13:05:52 -04:00
Tim Abbott 0120b2b239 Don't show a user-facing error when subscribe-and-sending and already subscribed.
(imported from commit 7262740e8d967bf69a61fb9fddd74270a3211f5f)
2012-11-01 13:05:52 -04:00
Keegan McAllister cb9cdf22c3 tests: Correct documentation on test_message_to_nonexistent_stream
(imported from commit 76176083c1a0494856a3507214e2cfc3844d1fc1)
2012-11-01 12:08:38 -04:00
Keegan McAllister b81ef9cca7 Replace template variables static_{third,public} with hardcoded paths
So that the 500 error view will render properly, even though no variables are
set.  We keep the variable static_hidden, which by design is not used on the
500 page.

Fixes #240.

(imported from commit 3c7534f896479b7d7edbe5ef13958481e169a13c)
2012-10-31 18:43:44 -04:00
Waseem Daher f0fd80a294 Interim measure: Escape fullnames as well.
I'm sure this problem exists in a latent way with stream names and
email addresses as well. Once I figure out a general way to fix this,
I'd like to go back and handle these three cases in a cleaner,
symmetric way, but this'll do for now.

(imported from commit a634e6ac39ea337be499889b3ff64b3c4f4fcccb)
2012-10-31 17:49:19 -04:00
Waseem Daher 4d83aa96ff Interim measure: Escape subject names before they go into the typeahead.
This is problematic because if your subject name is <b>hi</b>,
selecting it from the typeahead comes back with:
 &lt;b&gt;hi&lt;/b&gt;
which obviously isn't really OK.

(imported from commit 806bc719ab296ec0fe299b33c7aa6767a0c71b9d)
2012-10-31 17:26:13 -04:00
Waseem Daher 765aa833bc Clean up jQuery selectors for the composebox send button.
(imported from commit 6bf7ee00f23290ae5e254b4964db3ed51527368b)
2012-10-31 16:36:22 -04:00
Waseem Daher 1e34e46a2e Make Tab-Enter work as a "send message" shortcut in Safari.
(imported from commit 2eccaea06594a7c3d3e8c6d3c00a20c4c94116a2)
2012-10-31 16:36:22 -04:00
Tim Abbott 22bb5a5830 Fix longpolling on messages to nobody.
This is what caused our server to hang when receiving certain messages
over the last couple days.  It was introduced by me making in the
assumption that doing the same thing we did after validate_notify
failed was a correct way to immediately return from
notify_new_message, which it was not.  The code of validate_notify
actually finished the handler in the event that validation failed,
which isn't "correct", but did not manifest in a visible problem.

The correct way to trigger an immediate response from a tornado view
is to just return the value, not call handler.finish() and then return
None.

Similarly, the correct way to trigger longpolling from a tornado view
is to either return None (or equivalently, / drop off the end of the
function) or return a generator.

(imported from commit 5b931248b4650fc88d5d68f5936a95f19e097af9)
2012-10-31 16:35:30 -04:00
Keegan McAllister 5a7b307d71 Create the narrowbar using a Handlebars template
This fixes an XSS hole (#249).

(imported from commit 5f70c0bc23e0d992f2d85889e2ba9157f1b73b3a)
2012-10-31 16:02:17 -04:00
Tim Abbott 5a3d52baa7 Make the narrowing tooltips a bit more verbose.
(imported from commit ab2cbaa7bfe4eeb0b1d1dd00b6db6aa76574cbff)
2012-10-31 14:06:35 -04:00
Tim Abbott b33c0c4eee Send the stripped stream name to add_subscriptions_backend.
(imported from commit c3bbb9bd200629020fe7e60d42644beaab30bff5)
2012-10-31 14:06:35 -04:00
Tim Abbott 426ab9559d Fix creating new users via zephyr mirroring.
(imported from commit 05e01efabdce081fc574486916c7db343f2cdb1d)
2012-10-31 14:06:35 -04:00
Zev Benjamin 564565f627 When narrowing a second time, don't move the pointer and display the persistent pointer
(imported from commit f49222f3a5df636517cadcafbc3d278f4f0ced00)
2012-10-31 12:03:00 -04:00
Keegan McAllister eac48d9b04 Clear password boxes on settings change submission
(imported from commit 523df7ee039db7be30e66608c491cc441f14fd70)
2012-10-30 17:05:10 -04:00
Tim Abbott 30aab26ccd Fix test_missing_last_received to match current behavior.
(imported from commit 101b08d740ddf46d100c9763f2b78b86e2b07a00)
2012-10-30 16:59:25 -04:00
Tim Abbott 70f21f9d8e Fix 'Stream does not exist' test.
(imported from commit d4f0f3deaa3cc4b9cab67c90b87aa8bff2e72653)
2012-10-30 16:59:25 -04:00
Tim Abbott e48bdfe847 Use json_success for api_fetch_api_key.
(imported from commit 395d992fa634f5304f8a44f38f0251109c1a0810)
2012-10-30 16:59:18 -04:00
Tim Abbott c00e37c106 Use json_error rather than HttpResponseBadRequest and friends.
(imported from commit a9f6df2e561218db46f4ade86bac1ecd87b6ca78)
2012-10-30 16:59:18 -04:00
Tim Abbott 9fa2f0d4f8 Use @require_post for login_required_json_view.
(imported from commit e7efea5f016b1b44a0a3deba024e3df828006cfa)
2012-10-30 16:59:18 -04:00
Waseem Daher e7e05d8617 Fix up some overzealous "instance->subject" renames.
(imported from commit f4ddcfd3749d374cc6abee3b1e7a5aacc3b83e16)
2012-10-30 16:48:00 -04:00
Luke Faraone 75c6fa7202 When doing a deployment, set the site name to app.humbughq.com.
(imported from commit b89f72f0cb94fae7678db570a1e9774dbe471ba9)
2012-10-30 15:13:12 -04:00
Tim Abbott 4e9df28c12 send_message: Don't create streams automatically on send.
(imported from commit 7be1b72c5fdf9a21167d2be3948cf1febf8da8ed)
2012-10-30 15:02:45 -04:00
Luke Faraone 1d6a5741e0 Previously conditionals used the wrong case to reference request.POST.
(imported from commit 2624def3745c3b26114ee1a1a9a20288e078b243)
2012-10-30 13:29:40 -04:00
Luke Faraone 9f61e27218 Fix broken conditionals in get_old_messages_backend.
(imported from commit 13b934cdd2805d45efff18f7ce485b3e17e11c1a)
2012-10-30 13:24:02 -04:00
Keegan McAllister 4a6eafd6bf Provide the static access control link for the 404 page
(imported from commit 3915ff409e1026c35a6d976ed5eea51ba679e0c3)
2012-10-30 11:01:36 -04:00
Keegan McAllister f0c2421f00 Customize the 404 error page Nginx serves for missing static content
(imported from commit 70fc821f9ae29b8a902c48ce57e39273c90f57ff)
2012-10-30 11:00:10 -04:00
Keegan McAllister 7267ba9cd2 Fix test for /accounts/logout
(imported from commit 256929fc4d462832358c31c99bd470a23ffaba29)
2012-10-30 00:18:01 -04:00
Keegan McAllister c99f995782 Update comment in debug.js
(imported from commit c23c67331c6433e11e9131f75edce9be52d3ecff)
2012-10-29 23:21:00 -04:00
Tim Abbott 0fcf1db00a Fix tracebacks sending messages nobody will receive.
(imported from commit afe3d7465f105015f7fa8247ab3cba7476b89fc2)
2012-10-29 19:17:26 -04:00
Waseem Daher e8225973ba Make subscriptions page look a little nicer.
(imported from commit 86c77b6bf6ef673b39e85a7a5555847fce7707b6)
2012-10-29 18:26:34 -04:00
Zev Benjamin bdb0ac73a3 Manually validate before send
Validation was happening, but was not preventing sending.  We now
just manually call the validation function in compose.finish()
instead of relying on jquery.form's beforeSubmit option.

(imported from commit e094832bf8948f4c6f58cc0d0923bf0fd09db4b1)
2012-10-29 17:39:22 -04:00
Zev Benjamin 696a04743a Factor reload-related functionality into reload.js module
(imported from commit ef533f3416e8b406a03d28f67b45ca59523cef8e)
2012-10-29 17:38:44 -04:00
Tim Abbott af09279483 Check for empty stream/subject names.
(imported from commit 208be288f903e8a040ed9e1de243315df0d9adae)
2012-10-29 17:36:01 -04:00
Tim Abbott 44b332693e Fix the fact that new auto-created MIT users are active.
(imported from commit 577f1a0165a56fc3cc1ed6f0a54f6c5f31345cc7)
2012-10-29 17:30:06 -04:00
Luke Faraone 5dad59e864 Implement MIT signups.
Here we introduce a new manage.py command, activate_mit, which takes a
number of usernames and sends out emails to the users with instructions on
how to activate their accounts.

(imported from commit f14401b55f915698e83ff27b86434f53e64685f3)
2012-10-29 16:59:37 -04:00
Waseem Daher 26133f6bbd Temporarily disable find.
(imported from commit 22d62547206481015d5d0501a01c65e82dd59d6f)
2012-10-29 16:10:28 -04:00
Waseem Daher 3c3877f1b5 Have Esc dismiss userinfo popover.
It's possible that the three places we can kill a popover
(body click, Esc, clicking on a new one) should be
refactored to use the same code.

(imported from commit ba7eab480fd2258abfb469c8f1155f29bc63f7f6)
2012-10-29 15:49:40 -04:00
Keegan McAllister 0e03a7acc8 views.home: Use @login_required
We can't use reverse() due to what amounts to a module import cycle.

(imported from commit 8a2904648173bc3e4ff2079d33320417b28518d3)
2012-10-29 15:41:28 -04:00
Keegan McAllister 5353f5b3b0 Rename NOT_LOGGED_IN_REDIRECT -> HOME_NOT_LOGGED_IN
If we have other pages that require login, we might want them to redirect to
the login form.  But the root of the site should take you to /accounts/home --
but only after we launch the product.

(imported from commit b5d10e1c908f1ffe1ee68c2689691ca66c896786)
2012-10-29 15:41:28 -04:00
Waseem Daher c6e64291c1 Use full name in popovers.
(imported from commit e6463ef9331ad9c4defebf827ddef52312d21ddd)
2012-10-29 15:02:25 -04:00
Waseem Daher 06fa574f29 Give popovers variable widths.
(imported from commit 3f38e8a35add3f7f5566d5712b4421f8e2e44776)
2012-10-29 15:02:25 -04:00
Tim Abbott 8510f4e207 tests: Add a mocked session object for tornado tests.
(imported from commit 0431d4cbb2233b7136367ad33f04ed2cc219add2)
2012-10-29 14:54:18 -04:00
Tim Abbott 6c39bf5cbd Cut out duplicated code between clear_database and populate_db.
(imported from commit 4bb44c20d2f0477d8a3db72788f82b0cf8572b2d)
2012-10-29 14:54:18 -04:00
Tim Abbott 9caf205ed9 Fix missing tables when clearing databases.
(imported from commit 950839216af8366b87564fb310cb1ac47711ae02)
2012-10-29 14:54:18 -04:00
Waseem Daher 6632bac97d Show userinfo popup if you click on email address.
(imported from commit ae3c1e5983520e945193c02561ebebf26ebb488a)
2012-10-29 14:40:04 -04:00
Zev Benjamin 2723a54088 Disable pointer sync for alpha rollout
(imported from commit 50a41e49e9b4a7db0b07ee7705d51c3a2abdff35)
2012-10-29 14:18:08 -04:00
Waseem Daher e5d89cb377 Make context menu a little bit smarter/clearer.
Don't, e.g., show "start a huddle with me" when you're
already in a huddle with me.

(imported from commit 58a646ebcf7ab7f0b2bcc901e9e081cce782ee46)
2012-10-29 14:17:27 -04:00
Zev Benjamin bc4447f9f8 Prevent compose box from popping back up inappropriately on reload
We weren't listing to compose finish events during reload previously,
which meant that finishing a message was not handled in the same way
as canceling a message.

(imported from commit 4f2576121a8b5354c94348bc2896a2db8c4be000)
2012-10-29 13:58:40 -04:00
Zev Benjamin cee3f87585 Use compose.finish() instead of manually calling ajaxSubmit() in multiple places
(imported from commit 3bbe4a03171d9eace413b576ae2c7ccf99141bf1)
2012-10-29 13:58:40 -04:00
Keegan McAllister e93c1ab87c Switch from Open Sans to Droid Sans
We found a number of characters that look bad in Open Sans.

(imported from commit f8e7926f002b2de7f0d8bab255d212fac1cf6115)
2012-10-29 13:02:31 -04:00
Jessica McKellar 7912b2abbe Fix find bug causing a search to skip over the first result.
This would only happen when you hit enter directly, instead of using
the search up / down buttons.

(imported from commit 90301f64b3f24e91c103342bd6a7f1b3e61f8928)
2012-10-29 12:33:53 -04:00
Jessica McKellar cfc2601451 Include timestamps in find-able content.
(imported from commit a084a2d1c90b5f51049768ecd608d34ddd390a7b)
2012-10-29 12:25:48 -04:00
Keegan McAllister 9689887cbd Copy the csrf_exempt attribute in @asynchronous
Needed for @csrf_exempt to work.

(imported from commit 563ab11b0d26262511e9a6d9cc2735b0b835a391)
2012-10-27 17:56:18 -04:00
Keegan McAllister da252e8499 runtornado: Abort view processing if request or view middleware returns a response
This is the behavior specified by Django.  Since this was broken before,
our CSRF protection had no effect on Tornado views other than printing
a warning message :(

(imported from commit 7975d3c9b6c18915f917ac2da4592a55f6b6a658)
2012-10-27 17:28:07 -04:00
Keegan McAllister d71b9594fe Configure nginx for the new server
(imported from commit d073276912ea844e75fd710689f152fd7a2213c7)
2012-10-27 11:38:15 -04:00
Keegan McAllister 36f4ce0c0b Properly defer send_pointer_update setTimeout
(imported from commit 02a9c648eb420c8aebe84386cbb708bec96ca2e7)
2012-10-26 22:48:21 -04:00
Keegan McAllister 92acd7bd1c match_on_visible_text: Return boolean directly, without a conditional
(imported from commit b38800d074ab3e1dd557e49ef5a6cd7adfd677a3)
2012-10-26 22:21:41 -04:00
Keegan McAllister c32b0a1a22 Remove dodgy use of $( array ).last()
Per the docs, these are only meant to be used on arrays of DOM elements.
jQuery might one day assign a different meaning to arrays of strings,
and then we could have some security issues or weird breakage.

(imported from commit 545eee1e9c6955556d5c4bda30cd6db0dce19c60)
2012-10-26 22:21:30 -04:00
Keegan McAllister 5c4fe1d521 Simplify tab click handler
We don't need to get the tab link href twice.

(imported from commit 4b437924c88074e706536b143af493804612746f)
2012-10-26 21:45:05 -04:00
Keegan McAllister 6d0cebb6c2 Simplify update_floating_recipient_bar
The transformation here is

    $($('foo')[0]) -> $('foo:first')

(imported from commit 79ea257c9935eea01c5a2f7afb171045692eff01)
2012-10-26 21:38:39 -04:00
Keegan McAllister 582cb799dd Get rid of the selected_message_class global
Instead we infer this from narrow.active(), with the ability to override during
the narrowing procedure.

(imported from commit fab9c6861f19aedf0ee8af094c1ef4e8a0a73d80)
2012-10-26 21:05:04 -04:00
Keegan McAllister 6e63ac926e Add rows.get_table()
This checks against the table name whitelist before building the jQuery query.

(imported from commit b296f117cdd2707aeb626328f8b0f9e00c723d59)
2012-10-26 21:03:52 -04:00
Keegan McAllister 138721ebbb ui.js: Wrap an extremely long line
(imported from commit e8bef501249cc11655780ab87c425c91e2ad4db5)
2012-10-26 20:41:08 -04:00
Keegan McAllister 19d4631e6f search.js: Call .each on the jQuery match rather than $ itself
(imported from commit cff239b483a8ef1a7997a1430f40a7fda11739b1)
2012-10-26 20:41:08 -04:00
Keegan McAllister a0eea37fd4 search.js: Wrap extremely long line
(imported from commit c5b76e2da4ebb8322b5a69bf0679fa7700bb7bd1)
2012-10-26 20:41:08 -04:00
Keegan McAllister 58ca5b3e24 Harden rows.get against bad input
(imported from commit af0283323089f6ed4edb4cb732fe1cc821fb5dd5)
2012-10-26 20:41:08 -04:00
Keegan McAllister 3ebee51ce0 rows.js: Use full module pattern
(imported from commit 770741958798317401e918a7b8331cfc2f73bf77)
2012-10-26 20:41:08 -04:00
Keegan McAllister 6bd2087d89 zephyr.js: Combine get_huddle_recipient{,_names}
(imported from commit dcb4c32250f4ff3a3cf32d999d6469916b17b06e)
2012-10-26 20:31:52 -04:00
Zev Benjamin 5413f74a7e Allow API users to update the pointer and receive pointer updates
The get_profile API call now returns a client_id, which an API user
can pass to update_pointer and get_messages (note that clients still
need to pass a pointer argument to get pointer updates).  This
client_id is currently the equivalent of the website's session key,
but the website might get client_ids in the future to distinguish
browser windows.

This commit differs from 88f6cf0033c849af88d1b99da3bdc2148dfbb6fe in
that it uses request.POST.get("foo") instead of request.POST["foo"].
For some reason the latter triggers CSRF errors.

(imported from commit b2a4a7322d16dbf241cd6eef146621c79d84cafc)
2012-10-26 17:17:09 -04:00
Zev Benjamin b36f1702fc Revert "Allow API users to update the pointer and receive pointer updates"
This reverts commit 88f6cf0033c849af88d1b99da3bdc2148dfbb6fe.
It seems to have broken API users.

(imported from commit 2f861ebc016076547092421f87dbcac00a65e2f6)
2012-10-26 16:19:57 -04:00
Keegan McAllister faa7565a75 Clean up duplicated code in setup.js
(imported from commit 86566f194497b618dff0be6ea2bc829204d03366)
2012-10-26 16:08:18 -04:00