Commit Graph

1599 Commits

Author SHA1 Message Date
Luke Faraone 424c5b49ef Add a progress bar to show file upload progress from browser to Django.
When testing locally this bar sort of lies, because the actual bottleneck
is Django→S3.

In prod, our connection to S3 will supposudly be really fast so this won't
matter.

(imported from commit c9f4b4882cbfdf3bbb8180f1500f35d8481c1f39)
2013-04-05 13:07:18 -07:00
Luke Faraone b692e8fc99 Abort the XHR if you close the alert or cancel the compose.
(imported from commit 21540f7b290d3f55f8116f9940554a5feb8809d7)
2013-04-05 13:07:18 -07:00
Luke Faraone 932e98f456 [third] Store the XHR produced by filedrop in the calling object's .data.
(imported from commit 92d165d66e09cb8fe02652b32000850665e675e5)
2013-04-05 13:07:17 -07:00
Luke Faraone 0f10d1c6d4 Boostrapify filedrop errors.
(imported from commit b2ff2850e952f33af3e99fc14c21599f856345d1)
2013-04-05 13:07:17 -07:00
Luke Faraone f20f605376 [manual] Add file upload support.
This allows users to drag and drop content onto the compose box, storing
their data in Amazon S3.

New dependencies:
 - python-boto

(imported from commit 339874e483db5c36312c9ceae56db29da6ca0d99)
2013-04-05 13:07:13 -07:00
Luke Faraone ca1e729ea2 [third] Import jquery.filedrop.js drom http://www.github.com/weixiyen/jquery-filedrop
License: MIT

(imported from commit b523594e31e242dbb9d00cfbed12d6e455c8a6ca)
2013-04-05 13:03:49 -07:00
Tim Abbott bfd9287068 Append timestamp to URLs when getting templates on dev machines.
This prevents the templates from being cached by over-aggressive
chrome caching.

(imported from commit 1a1f7f697a823f6e806d3f2289c3bbda7e3f0d79)
2013-04-05 10:38:38 -04:00
Zev Benjamin a701083f71 Report additional information for "message in the middle of msg_list" errors
Hopefully this will help us track down what the problem is.

(imported from commit b8e30ee23ab8f1bf93525faa4f52ce9a4ccc9013)
2013-04-04 17:42:09 -04:00
Zev Benjamin d4acc3dd94 blueslip: Add mechanism for reporting additional information
(imported from commit 738bd3b8800e3b67497755580a2b7ccf66bb3829)
2013-04-04 17:42:09 -04:00
Zev Benjamin be04cff7c1 blueslip: Don't report some fatal errors twice
(imported from commit e50a324c3fc74e076b82c6154686a98e70ebed90)
2013-04-04 17:42:09 -04:00
Zev Benjamin b7cd8db139 Small code cleanup
(imported from commit d9f09e5a9b33be0b23ddae072a3021bb01a3de3e)
2013-04-04 17:42:09 -04:00
Leo Franchi 8fe82085c4 [schema][manual] Automatically subscribe users to default streams only after tutorial
(imported from commit 6511851c0aee2628bef597bf1310d6f96b0fd1d4)
2013-04-04 17:11:39 -04:00
Reid Barton 94c46a0af2 Tutorial punctuation tweaks
(imported from commit 0097cfad492de2658a2ab8a08fba0844ec6ba3fa)
2013-04-04 14:11:15 -04:00
Zev Benjamin 9d1548fe08 Add empty feed notices for private messages
(imported from commit e4067336f6b2e9e82b794599d30dfc3825852652)
2013-04-04 11:36:51 -04:00
Zev Benjamin de1f4b0be2 Remove all inline event handlers
This allows blueslip to catch exceptions from the event handlers on
these elements in addition to the other benefits that not using
inline handlers provide.

(imported from commit 2bdcb2496c6c08fa7228a20ce6164b527cf64e41)
2013-04-04 11:34:32 -04:00
Zev Benjamin 79d0e78130 Remove extraneous delete statement
The close handler will be called on cancel anyway, so we don't need
to delete in the click handler.

(imported from commit 0fcf4b0d1408312a0889f2b69e01207c9c3835fa)
2013-04-04 11:34:05 -04:00
Zev Benjamin a6058c40ad Wrap hashchange event handler with blueslip wrapper
(imported from commit 96ed0681964d36e13878e09a3f58a65c5a993aa0)
2013-04-04 11:34:05 -04:00
Zev Benjamin a2a48a5d95 Expose blueslip's callback wrapper
(imported from commit e8b2139519254ac9f3a9ec6031c5134c4d6c0fef)
2013-04-04 11:34:05 -04:00
Zev Benjamin 0e4aa6727b Convert to string before using string methods on search operators
Previously, narrowing to a stream name that only contained digits
would throw an exception.

(imported from commit dc76877427078d70e3d5625622c665be3302c976)
2013-04-04 11:34:05 -04:00
Tim Abbott fa239ea270 hashchange: Don't change the hash when called from hashchange code.
I generally don't like this sort of state variable, but I don't see a
better solution.  The codepath is that when you start out on the
subscriptions page and then click one of the left sidebar links to
narrow to something:

(1) hashchanged() would call ui.change_tab
(2) ui.change_tab triggers a gear change event
(3) The ui.js gear-changed event handler updates the hash

Resulting in the hash ending up at "#".  Since there's no easy way to
pass arguments through to the event handler, we just use a global
variable inside hash_change.js to track whether we're currently
handling a hashchange event.

(imported from commit 7bb905a223b5539240fc36de7896ee8074ebc62e)
2013-04-03 14:49:32 -04:00
Tim Abbott 200fd7ff70 Fix clicking on streams in left sidebar from subscriptions page.
We previously had 2 mechanisms for narrowing used by the left sidebar
-- the top few links used the hashchange mechanism, while the streams
links used a custom click handler.  Both were buggy -- the hashchange
one hadn't been updated to just select the first unread message,
whereas the click handler didn't change tabs.

Fixes #1141.

(imported from commit 8a8af974e78cc5c33937ac0078f04a9b5452b94a)
2013-04-03 14:15:07 -04:00
Tim Abbott 3a93c8cc90 Fix pointer jumps on unnarrowing after certain scroll events.
This appears to have been caused by our code for preventing the
viewport from being recentered if you move the pointer away from the
edge of the viewport from a position near the edge, which was being
run even when it was not triggered by a scroll event.

(imported from commit 0a4b3dcca75a6e5dbf1beb77a5249bd6a9c61341)
2013-04-03 13:38:41 -04:00
Tim Abbott 11ad134f7b Fix directional hotkey calculations for Home and End keys.
The old directional hotkey calculation system was fragile, and because
of this, didn't scroll when you used the home/end keys.

(imported from commit dca4786de13a4ed2864600dadbf4b1a5ba848074)
2013-04-03 13:37:23 -04:00
Leo Franchi 2f09492e71 Don't scroll to a message if there are no messages loaded
(imported from commit 8b881713595f60b3a989cb2c6875444e80c736d4)
2013-04-03 11:33:20 -04:00
Leo Franchi d8bed8dc08 Update integrations copy to mention %40 hack
(imported from commit 3b952309289204317a2a5ba57ba17e75ae9732ac)
2013-04-03 10:21:06 -04:00
Keegan McAllister 9dd987be7e Precompile Handlebars templates in production
Fixes #908.

(imported from commit 30458e9bea8117d1fa15dc962bb1a495f22672cc)
2013-04-02 14:43:59 -04:00
Keegan McAllister 17d5406b55 [manual] Fetch Handlebars templates using Ajax
...rather than embedding them into index.html.

This is only acceptable for dev, but the next commit adds an alternative
mechanism for prod.

There isn't actually a manual deployment step here.  However, this commit won't
work on staging / prod without the next one (since we don't serve
zephyr/static/templates in prod).

(imported from commit dce7ddfe89e07afc3a96699bb972fd124335aa05)
2013-04-02 14:43:58 -04:00
Keegan McAllister 37c5e1acd5 Upgrade to Handlebars 1.0.0-rc.3
Not needed for any specific reason, but we will need the .runtime.js file
eventually, and we should use a version of the library that matches the
Handlebars compiler.

(imported from commit 5600bc8d44b681999e2e5bbf04b890e2bb8477a1)
2013-04-02 14:43:58 -04:00
Leo Franchi e727caa4e8 Add integrations blurb about Beanstalk
(imported from commit e8f952dd9614fd050891275084e5b2f7be1471c4)
2013-04-02 13:35:43 -04:00
Jessica McKellar 33a9bae5d1 Tailor empty narrow messages to what you were narrowing for.
(imported from commit 876afce2a63d4d6a522ac5300349b2be8805405f)
2013-04-01 14:26:50 -04:00
Jessica McKellar 6977920493 Don't try to auto-scroll when composing.
It's distracting, and may push messages you care about out of view.

(imported from commit 585d013c18d392433e432fc37bc02b4055822915)
2013-04-01 14:26:50 -04:00
Zev Benjamin ee9f040040 Handle subscription events in the web client
This has the nice side effect of not requiring us to trigger the
events manually in the success callbacks of our subscribe/unsubscribe
ajax calls.

(imported from commit e8d9970b708e9832d22be4803570071bacb46792)
2013-04-01 13:07:48 -04:00
Zev Benjamin 73af933f1f Handle the result of subscriptions by Javascript events
(imported from commit 7b564b1bf076581034021052fa5e2da20cf405c5)
2013-04-01 13:07:48 -04:00
Zev Benjamin bd81706558 Handle realm_user events in web client
We currently only use these events to change the autocomplete lists.
I figure that the presence list will be updated by presence events.

(imported from commit e9c1466659c4bfd463806656e0023984a4ea4177)
2013-04-01 13:07:48 -04:00
Leo Franchi 9817ef3460 Remove url encoding from data-name attribute as we match via iteration
(imported from commit 737418c430991414124daff41b62383284e86dc1)
2013-03-29 15:44:21 -04:00
Keegan McAllister b7bb598e02 Trim search operand from the end until URI decoding succeeds
Fixes #1137.

(imported from commit a23219d2cefdc2b739a165c88780fba409d4d878)
2013-03-29 10:37:02 -04:00
Leo Franchi a8816f81c0 Comment out blueslip scroll finish error to quiet emails
A ticket is filed and this error is not fatal to the UI but rather
a warning to investigate, which we will now do

(imported from commit 3f67ec2b503e91b3921e33b89febd97790e389f1)
2013-03-29 09:38:42 -04:00
Jessica McKellar ce66bdec5b Remove unused hotkeys.in_scroll_caused_by_keypress.
(imported from commit 65223a036e72489a41130a83e4537d0ccb80b90c)
2013-03-28 17:08:25 -04:00
Jessica McKellar 3df47f2025 Do not try to recenter if you were already moving in the right direction.
Before this commit, if you try to arrow around when the selected
message is outside the pointer threshold for recentering, you get a
big jump, even if you are arrowing towards the center of the viewport.

(imported from commit 5c15d5ccccdf027a8bfa8b79bf519fccbfa971d8)
2013-03-28 17:08:25 -04:00
Jessica McKellar 0f02eb17f4 Reduce code duplication in process_visible_unread_messages.
(imported from commit 49c36f704d9937ff06129a0b737a7d9ef32e35ed)
2013-03-28 17:08:25 -04:00
Jessica McKellar 08422009fe Add a `Starred messages` sidebar link.
(imported from commit 0109e64b412afcd8d0d58b5e027d30c82faa970c)
2013-03-28 16:59:59 -04:00
Jessica McKellar 07967e7257 Add the ability to narrow to starred messages with `is:starred`.
(imported from commit f1eb552ddd90a1822fa988b60dc13f88f04cfc79)
2013-03-28 16:59:59 -04:00
Jessica McKellar 3d683a93bf Add the ability to toggle a message star and save it server-side.
(imported from commit 6d9eda14cddee9ce65a85deadac57925b1864f94)
2013-03-28 16:59:59 -04:00
Jessica McKellar 1e9bb457a1 Show a bookmark/favorite star on messages.
(imported from commit af34abb353f3d5b5aace59c31c073d6426b0ff03)
2013-03-28 16:59:59 -04:00
Jessica McKellar 2f560a79db Expose the `starred` flag as a client-side message attribute.
(imported from commit 3046a44e1313d0a91a1aa6ce6d166e29311a0567)
2013-03-28 16:59:59 -04:00
Zev Benjamin 00e5f904a3 Use do_events_register() in home() and pass the results to the initial page load
(imported from commit 532036c01bde1f5d49c43a96ce6aa496ca77cea9)
2013-03-28 16:57:48 -04:00
Zev Benjamin 0624a97d8e Force a reload when the server has garbage collected a client's queue
We have to be careful about timing here.  If Tornado fails to load
existing queues on startup then all clients will reload at once.  On
the other hand, if we don't reload immediately then the client won't
get any events until the reload.  For now, I've opted for the
user-friendly approach, so we need to make sure that Tornado gets a
chance to dump and reload its queues correctly.

(imported from commit 51a6ab31cb461e1e3373486dcec2e57eb12a8077)
2013-03-28 16:57:48 -04:00
Zev Benjamin 4bc9152f71 Inform clients to reload via a 'restart' event sent on Tornado start up
(imported from commit 10bb45547ea0bf34e56fc620ecd7415bb8a825c5)
2013-03-28 16:57:48 -04:00
Zev Benjamin 6cc70d94f6 Add register() call to event system
(imported from commit 0c9fbfec1866591b2169ce2da2bc2af6003f8f31)
2013-03-28 16:57:47 -04:00
Zev Benjamin b12715e3f2 Make web client use get_events instead of get_updates
(imported from commit 15c007fd89f02558b710e7146fc40b785934f76c)
2013-03-28 16:49:51 -04:00
Leo Franchi 0a419e51d0 Fix ui.set_count not finding streams that require url encoding in sidebar
(imported from commit c363669806f56650c6aecb66f7208ea692bfd613)
2013-03-28 14:44:57 -04:00
Luke Faraone 799e2873d3 Run decodeURIComponent over stream names before comparing them.
This resolves an edge case not handled in a previous fix to trac #1050.

(imported from commit 3fc142946b01de8955e1b52d4f4ebb36e584cdeb)
2013-03-28 11:24:38 -07:00
Leo Franchi 23802bc278 Filter out private messages in home view when counting in home unread
(imported from commit 6b42168e880269c8fe14f0e2eab98cf03b480f17)
2013-03-28 13:21:11 -04:00
Leo Franchi 5b2f4462fb Only count messages in home view when determining home_unread_count
(imported from commit 22a0a00bd242a4a12efc5dca723c13f7c9b47f2c)
2013-03-28 11:44:58 -04:00
Luke Faraone 60075e596f stream_exists_backend now returns a 404 if the stream is not found.
Update tests and compose.js to handle the 404.

(imported from commit d9ba4fe59c34bd14d9198e3365a845888fa04f03)
2013-03-28 07:53:37 -07:00
Luke Faraone fc2a071314 Scroll subscription settings into view on click.
Addresses a complaint brought up in our usability study.

We now hook into the "show" event on .subscription_settings elements and
do some obnoxious math to move the scrollbar the way we want.

Closes trac #1015.

(imported from commit 5d9cee1ffc242eb7b743fdccd2bd76bf0a7ba060)
2013-03-28 07:50:49 -07:00
Zev Benjamin 304899cd8a blueslip: Indicate whether users saw an error in the error emails
(imported from commit dd31976a3279df5ea5de2a0433387c82c8f80d41)
2013-03-27 21:53:58 -04:00
Zev Benjamin 4d30089220 blueslip: Only try to report a given error once every 5 minutes
This is in addition to only successfully reporting a given error once
per session.  Previously, if an error was triggered many times before
the ajax call to report the error returned, we'd end up making many
ajax requests to report the error.

(imported from commit 559179e3c8c3fbf03bbb091a67361d447c80b7bb)
2013-03-27 21:52:55 -04:00
Leo Franchi dbb2157457 Make home view unread count only count messages newer than the pointer
(imported from commit 0f699ed23f59380b04606bd30600373956f89ae4)
2013-03-26 18:34:16 -04:00
Leo Franchi 9de2442bd9 Add infomation in JIRA integration in our integrations page
(imported from commit 2aef274c630cc918a6fde8fa33a4598ba8ee7f3f)
2013-03-26 14:14:47 -04:00
Jessica McKellar 297bc7f09b Don't hide the floating recipient bar when scrolling.
We made this change for performance reasons that don't exist now that
we only render a small portion of your messages, and it causes a
distracting flicker when you scroll through messages slowly.

(imported from commit 33379320f6b90d93ec8beac17323b287f8bb2485)
2013-03-26 14:06:27 -04:00
Jessica McKellar 9451451672 tutorial: streamline some sections, and bold user actions.
This may help with compliance.

(imported from commit 8ef250b07a0a1a7023bc74f89a46875c88fadef7)
2013-03-26 14:06:25 -04:00
Jessica McKellar 76dade3b6e tutorial: remove code formatting examples and just link to documentation.
Those examples make the tutorial feel much longer, and they aren't
relevant to people who aren't using Humbug to talk about code.

(imported from commit c3213775d26cf533b3d9bde691de08a53d427939)
2013-03-26 14:05:45 -04:00
Jessica McKellar 2fd56b3745 tutorial: de-emphasize that we don't auto-scroll.
It's not so black and white in a world where we auto-scroll at the
bottom, and we've observed that people trying Humbug over-focus on it.

(imported from commit 2057643f179d5d1666cb33438c5a513977197b37)
2013-03-26 14:05:45 -04:00
Jessica McKellar eaa2cc702e Autoscroll when you are at the bottom of your message feed.
(imported from commit 7ca92b13c874346f846aea8200a638a7914fe7d6)
2013-03-26 14:05:45 -04:00
Keegan McAllister 6d9aca5f1a Move "page parameters" (email, enter_sends, etc) into a single object
(imported from commit 842b2371bf6364982f1358f1cd2d91118c7fb2bf)
2013-03-26 13:50:03 -04:00
Keegan McAllister 38ebefe68f Remove unused variables
(imported from commit c18d43165c1dbdee28107ef21e26e474b819c653)
2013-03-26 13:50:03 -04:00
Waseem Daher 6760e68f94 integrations: Document Capistrano integration.
(imported from commit e26774e3657a71e8f21bf8ef2b1b1a9c289707da)
2013-03-22 14:37:54 -04:00
Leo Franchi 0184f31af0 Reprocess unread counts when subscribing to a stream.
This is required if the stream has unread messages in it
(from a previous subscription period). Otherwise the
unread count will be 0 until reload.

Fixes Trac #1117

(imported from commit 8f3d78eb52fdecb52456b0037cc89665c9027fbc)
2013-03-21 17:13:17 -04:00
Leo Franchi 4edf85e730 Mark messages taller than the screen as read once we have moved past them
(imported from commit c142c2447a8f2b5ed40337a75c1afbaf05f9fecf)
2013-03-21 09:37:10 -04:00
Jeff Arnold a95b1a1a23 Revert "Automatically condense long messages"
This reverts commit 27244550d5d94980d7e33d8cc7c69708427dbbec.

(imported from commit e468051b8052d244beb09ba795605d70124254dd)
2013-03-20 18:45:12 -04:00
Jeff Arnold 795d968b91 Revert "Center the message condenser messages with respect to the message body"
This reverts commit da64f33551b500857bb91cb3ece959aafc9b1eb0.

(imported from commit 004f9a95cf5dfd4c4b8565d6eec15ceac27f7bf2)
2013-03-20 18:45:09 -04:00
Zev Benjamin e5c62d164c Center the message condenser messages with respect to the message body
Previously it was centered with respect to its enclosing div, which
looked slightly off.

(imported from commit da64f33551b500857bb91cb3ece959aafc9b1eb0)
2013-03-20 18:08:39 -04:00
Jeff Arnold c92d664b44 Automatically condense long messages
Addresses Trac #747.

(imported from commit 27244550d5d94980d7e33d8cc7c69708427dbbec)
2013-03-20 17:39:15 -04:00
Keegan McAllister 118cf4edec Modify encoding for URL fragment so Firefox doesn't decode it automatically
Fixes #826.

(imported from commit a4c0ada9559684db7e597686d9354219de742819)
2013-03-20 12:07:53 -04:00
Keegan McAllister e97c6f52ce Don't save narrow operators to the URL fragment if that's where they came from
In Firefox, prevents e.g. a slash in a stream name, which we wanted to store as
%2F, from converting back to a literal slash.

There is some appeal to normalizing the URL fragment after parsing, but in
general this way seems better.  It may decrease page load time on narrowed
views.

Doesn't yet fix #826; the URL is correct but the narrow is still wrong.

(imported from commit 32e3fa9e968139863f34b9698f1c8b39d06f0c14)
2013-03-20 12:07:53 -04:00
Keegan McAllister ae27deb30f Encode search operands using a cleaner-looking variant of URI encoding
Fixes #1098.

(imported from commit 1ed05248f3c6b69a48b9c74c0ce344621fe637b5)
2013-03-20 12:07:52 -04:00
Jessica McKellar 37e58b613d Truncate the tutorial stream name to fit the DB max stream name length.
(imported from commit e267656337f97d3ea14e14e957a405cf4fd2d06c)
2013-03-20 10:15:08 -04:00
Leo Franchi 6263c9ba1e Unify calculation of unread-count for notifications and use it in the title bar
Fixes trac #1004

(imported from commit 6f04d1d3ded198b46cc2ff1733b94b5c17beb581)
2013-03-20 10:09:40 -04:00
Leo Franchi 2ce683421b Only show 'More Messages Below" if there are actually more messages below
This fixes Trac #1004

(imported from commit fa57936aaf5b5f4ec74569bee389d18b989d6b9f)
2013-03-19 16:21:36 -04:00
Waseem Daher e1e7978fae "Lead designer" job posting.
(imported from commit 1f9e00e45f69d47842524d715fe5e8a8a4a8b7df)
2013-03-19 13:28:53 -04:00
Leo Franchi 6d6c3364dc Rewrite message flag handling to fork out to a subprocess for batch handling
(imported from commit 1ef846f542950cabf32f8b176f5591cf5794a0ff)
2013-03-19 09:55:12 -04:00
Waseem Daher 797b5ee63f Add page describing our Humbug apps.
(imported from commit 2e071782a13a497e57225b2a84c41d58f5e120b5)
2013-03-15 19:16:44 -04:00
Zev Benjamin b08dbdfe48 blueslip: Send the user agent string back with the error report
(imported from commit ed77877465b1497cd3d78753c3398329302075ff)
2013-03-15 17:30:07 -04:00
Zev Benjamin 53a68144e0 Don't do processing for a get_old_messages if the message list it was for goes away
This was biting us before when the user would leave a narrow before a
get_old_messages call associated with it finished.  Specifically,
search.maybe_highlight_message() would assume a message was in the
DOM when it wasn't any more.

We also have to hide the 'loading more messages' indicator when
reseting the 'load more' status because otherwise it wouldn't get
hidden like normal in the load_old_messages() continuation, causing a
load_more_messages() not to fire when re-entering a narrow.

(imported from commit 4a136dd01305b039c0970f897b07e603b87d5d8e)
2013-03-15 16:40:05 -04:00
Tim Abbott a46eb8a36c Clean up excessive positional arguments to load_old_messages.
(imported from commit 072c0fcbd59256d55364a0fc6be42d5df8ab99e2)
2013-03-15 16:30:03 -04:00
Zev Benjamin a495b0dfa6 Re-educate rogue emoticon
He was wrecking havoc by confusing the Javascript mode syntax
highlighter.

(imported from commit 27900cf6b6dc7866f2b2f108e79d28d6785aa466)
2013-03-15 12:43:12 -04:00
Leo Franchi 96041be75c Use 'undefined' instead of -1 as sentinel
(imported from commit 30cc280d89cf0c290459f9d90960cd8eaf76a22f)
2013-03-15 10:51:25 -04:00
Leo Franchi 79dfe57840 Mark all messages between start of scroll and end of scroll as read
If the user scrolls super fast, our scroll handler might not catch
the user  passing by some messages.

(imported from commit 14cebffcd1321f02443971ac5e1c922db19648ab)
2013-03-15 10:43:17 -04:00
Leo Franchi 07433b80cc Don't mark your message as read if it comes from the API
(imported from commit 0570d4db590e21b0fadd544b10c9865fa7acd66b)
2013-03-14 15:51:21 -04:00
Leo Franchi 95c9c6817f Mark messages as read as you scroll by them
(imported from commit 7e4595dcbfe900bde7f062e3fe9e2d53c71b6884)
2013-03-14 15:51:21 -04:00
Leo Franchi d3364eef5d Try a different color for mentions
(imported from commit e1f7e4c03abb54b8e7efbdff84314a902ad32697)
2013-03-14 15:38:09 -04:00
Zev Benjamin 719e24a25b blueslip: Use reference counting to try and break the circular references we create
We create a circular reference between handler functions and our
wrappers for them so that we can pass the wrapper to jQuery.off when
users pass the original handler to us.  This reference-counting
system can't break all the circular references we create because
users can unbind event handlers without explicitly naming the
handlers they want to remove (they can remove all bindings on an
element, for example).  For now, we hope that this memory leak isn't
too bad.

(imported from commit 9615b5761b4b09ca7ca52c0d847e9b83330373fa)
2013-03-14 15:07:28 -04:00
Zev Benjamin e8470b9481 blueslip: Also override jQuery.off so that we can pass the correct handlers to the original jQuery.off
Previously, we couldn't actually unbind some event handlers.  The
problem was that when a user called $.off(events, handler), the
passed handler wouldn't match any that were actually bound because
the handler that was actually bound was our wrapper.

This bug specifically caused the handlers for our idle timers to
never be unbound, effectively never cancelling them.

(imported from commit 48efac954994a05c356d326e64a78ab0ace9fe3e)
2013-03-14 15:07:28 -04:00
Zev Benjamin 8709e3f8b4 blueslip: Store the handler wrapper on the original function
We will need this for removing event handlers.  This will
unfortunately create a memory leak, but we'll partially deal with
that later.

(imported from commit e439cb44d245e16d2254d1be053b68015a1f4c79)
2013-03-14 15:07:28 -04:00
Zev Benjamin 122996b656 blueslip: don't double-wrap handlers when invoked with the $.on(types-Object, selector, data) syntax
(imported from commit 458ee9248fc82efc6c2307634b2be6d3ce32246d)
2013-03-14 15:07:28 -04:00
Zev Benjamin 22bb67150c blueslip: Do not catch exceptions from callbacks in debug_mode
(imported from commit 6ea79285dfd9f1f7b5d9f5d663a84247757d8af4)
2013-03-14 15:07:28 -04:00
Zev Benjamin dfe69eef0d Funnel exceptions from ajax handlers through blueslip
(imported from commit 5ad08482989d25a0fd0ee02251b74a23f950a0b9)
2013-03-14 15:07:28 -04:00
Leo Franchi 7510f87eac Select first unread when narrowing by clicking on stream in sidebar
(imported from commit 557751f44e3fee61b6a55f8f8328e2f97e6adc04)
2013-03-14 15:01:13 -04:00
Tim Abbott a0d0bdb5cf Fix copy/paste in compose box.
(imported from commit 075a461136e040b7d5d752e9386d9321d76c956e)
2013-03-14 14:55:14 -04:00