Commit Graph

643 Commits

Author SHA1 Message Date
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
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
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 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
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
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
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
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
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 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
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
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
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
Waseem Daher e7e05d8617 Fix up some overzealous "instance->subject" renames.
(imported from commit f4ddcfd3749d374cc6abee3b1e7a5aacc3b83e16)
2012-10-30 16:48:00 -04:00
Keegan McAllister c99f995782 Update comment in debug.js
(imported from commit c23c67331c6433e11e9131f75edce9be52d3ecff)
2012-10-29 23:21:00 -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
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
Zev Benjamin 2723a54088 Disable pointer sync for alpha rollout
(imported from commit 50a41e49e9b4a7db0b07ee7705d51c3a2abdff35)
2012-10-29 14:18:08 -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
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 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
Keegan McAllister faa7565a75 Clean up duplicated code in setup.js
(imported from commit 86566f194497b618dff0be6ea2bc829204d03366)
2012-10-26 16:08:18 -04:00
Keegan McAllister 80ef222a60 Get the CSRF token from the DOM rather than a cookie
This simplifies the code, and lets us set the CSRF cookie as HttpOnly, which
adds a little bit of security.

(imported from commit 9d5923a1acf19bd27e6e1d55cf627049526de245)
2012-10-26 16:08:18 -04:00
Waseem Daher 22e6a8ac1d Revert "Hide additional search buttons when not in use."
This reverts commit 074011dfe7dfa4d3cb331b32fc6cf465f98d095f.  For
some reason this introduces some buggy behavior, and if anything I
should debug it more locally first.

(imported from commit 182193e6bb466a5668c2bb64e41712a793fa7ca2)
2012-10-26 15:41:38 -04:00
Waseem Daher b0406ee1d2 update_floating_recipient_bar: Don't loop infinitely if no message selected.
(imported from commit a75cfd41ed8a8ce5256d1caa29f6c5bc0689e7d2)
2012-10-26 15:10:30 -04:00
Waseem Daher 9274437eb5 Hide additional search buttons when not in use.
(imported from commit 074011dfe7dfa4d3cb331b32fc6cf465f98d095f)
2012-10-26 14:55:42 -04:00
Waseem Daher 44a6a2b8a4 Have search bar always take on color of main area.
(imported from commit 85f6db17ca2fd616e4c7b63a98b80332cbddc1c0)
2012-10-26 14:31:05 -04:00
Jessica McKellar 92593b7cc8 Add basic up/down search functionality, including across narrows.
(imported from commit c82acad95e97733b87d65287c685caf7533a774e)
2012-10-26 14:31:05 -04:00
Zev Benjamin 652c524777 Try loading older messages after user is idle
(imported from commit bb3c39f9b5a9b7befb353647af75001ec168fc8d)
2012-10-26 13:31:14 -04:00
Zev Benjamin 6ed1d38743 Show persistent pointer on narrow again
(imported from commit c871ec931ffad4bc692a908e687bb21c6cb2e7e9)
2012-10-26 11:44:28 -04:00
Zev Benjamin 9c838c44a1 Scroll to the correct message when narrowing
(imported from commit c6f11f3315f1d168b85f80ab524f322b399f5a85)
2012-10-26 11:44:28 -04:00
Zev Benjamin 51a39fdb0a Remove unused variable
(imported from commit 5a2a100aa3d9a577cde2517be3d9bacc2147fa7e)
2012-10-25 18:11:23 -04:00
Zev Benjamin 1c904e8607 Only start get_updates call after we've gotten all old messages
(imported from commit 8af46008a3abcdacb59e6223f38742a94a87b125)
2012-10-25 18:11:23 -04:00
Zev Benjamin a9583f6889 Fix get_updates missing messages between calls
(imported from commit 2b84df2a35a9a006b8548904ebf145a351a2e92b)
2012-10-25 18:11:23 -04:00
Waseem Daher 98d7116ee8 Delete some dead code in signup workflow.
(imported from commit d07fffd4c0efdaaf4a233c1dbc9d09bc5ec03ad3)
2012-10-25 16:59:37 -04:00
Zev Benjamin a798e14d86 Remove more unused code related to get_updates not returning old messages
(imported from commit d2cc795634c46d8a595ed15c093cfbfc113e6d10)
2012-10-25 15:48:35 -04:00
Zev Benjamin 47eeae0d36 Restore the "load more messages" button disappearing when there are no more
(imported from commit 4f46d49c88d9d0dadefe3e770868b6844dc80d64)
2012-10-25 15:45:14 -04:00
Zev Benjamin 451a041919 Remove the ability to fetch old messages via get_updates
Clients should use get_old_messages, instead.

(imported from commit 67847ef67d8ad4bf4af3f6082f85f0c76a41944c)
2012-10-25 15:31:27 -04:00
Keegan McAllister f8540dcdae Wrap some other extremely long lines
(imported from commit e7d55f318c8865ca953bf4520d1b07f7e84a4aeb)
2012-10-25 15:22:18 -04:00
Zev Benjamin c047502840 Use get_old_messages in client instead of get_updates for loading initial messages
(imported from commit 169b3720c1fa10606f2351039cac9655bb5165b4)
2012-10-25 12:10:44 -04:00
Waseem Daher 22a32c09c4 Add a shortcut to pull up the shortcuts dialog.
(imported from commit 0d6d3ba78a06f0eb1ecba8e6a571b79709980cef)
2012-10-24 18:31:44 -04:00
Keegan McAllister f3f9fb545d Narrow by recipient when the user presses 'S' on a huddle
(imported from commit 7e7c3d27b0824a60f7e8379c282ec05704d842f6)
2012-10-23 23:04:42 -04:00
Keegan McAllister 899e6d1042 Resize the compose box on show
It doesn't work to do this immediately after we clear the contents, for some
reason.

(imported from commit b24e2464afc7a4703d4a679ab0b51ac150f1ce89)
2012-10-23 22:08:47 -04:00
Keegan McAllister af065005fc Automatically resize the compose box
(imported from commit 7e9cb632bdca47fee6ad0897a55d1d3c004c34b3)
2012-10-23 22:08:44 -04:00
Keegan McAllister eaecaab7f4 Rename narrow.all_personals -> all_huddles
(imported from commit 6258ddd1548b6ee8cf20c28c9b18e229ebf4e720)
2012-10-23 20:43:23 -04:00
Keegan McAllister f0bebe1cc0 Change 'p' hotkey to 'h', for 'huddles'
(imported from commit 3415f1d3f679be41cb5b92827036b09829a99734)
2012-10-23 20:41:54 -04:00
Waseem Daher 8ce8a083bb Slightly hackish way of stripping out &nbsp; in narrowbar tooltips.
(imported from commit 414738408cd1e4e53f0268b0851c903c6a1a9eda)
2012-10-23 20:30:58 -04:00
Waseem Daher feff1d811d Allow icons in narrowbar without putting their HTML in the title text.
Before this commit, a hover read "<i class='icon-whatever'></i> All huddles with..."

(imported from commit e5a20678b87355d6709ec3b8776469114c92b2f6)
2012-10-23 20:21:51 -04:00