I added our "static" directory to NODE_PATH for our JS unit tests.
This eliminates most of the verbosity in our require statements, but
it still requires us to explicitly call out "js" or "third"
subdirectories, which should make it a bit easier for folks reading
the tests to distinguish modules from js, third, or node itself.
(imported from commit b77a5283135d388d46f4b7e511acc59986f1a8ba)
In dev, only show the message "Tornado X% busy over the past Y seconds"
if we've been more than 20% busy.
(imported from commit 2775e6151ccf03ba0cb2a1f96e4f4839774a870f)
I'd like to minimize the probability that we'll actually run the code
in the "messages not rendered yet in database" codepath since it might
perform poorly, and it seems like the best way to do that is to just
run a loop that renders them all.
(imported from commit 247cb85fffa6cbc95958b9feda97462792a542c2)
This is a temporary expedient measure to work around our
PATCH not supporting file uploads in our current Django setup.
(imported from commit c3146b23d5d7d134c2b80507eb87033ca375a4db)
E.g. if the Zulip realm, if you ever put "#15" in a Markdown link, you
surely don't want it to be auto-replaced with a Trac link.
(imported from commit 2e117a7bbbd9c82f8c0ba4d390472770f4425589)
The previous regex didn't escape the period in '.d' and was doing a
case-sensitive match to find the base stream name.
(imported from commit 43ef13733987e50dcead06b7bd3e768cb4395998)
We now write the fact that a message was created or updated to a log
table and actually update the tsvector asynchronously from a worker
process.
This also means that when running locally, one now needs to run the
process_fts_updates script in order to have new messages indexed for
full text search.
(imported from commit ebb11b08d30be2a45242dafe146e8e861a0f050a)
The documentation for the Python `random` module explains that it "is
completely unsuitable for cryptographic purposes." This new way of
generating API keys replaces use of the random module with
`os.urandom()`, which is intended to be suitable for such uses. As a
bonus, the code is simpler and clearer.
(imported from commit cc3697a5048f2da53f0fce6689167f9d1cbb6466)
As Kevin points out, un_narrow() itself calls casper.then() so should be
called outside of a callback, not inside one.
(imported from commit c5f02a14c750045697558aeafb070227e3a9d24c)
This covers most of the module's functionality, with special
emphasis on lines that use underscore.js (_.each and _.filter).
(imported from commit 074181a0273286a258504be634bdd1cead2eecd5)
Rather than play elaborate games to strip off the 'active' class, we
just neutralize it by making it the exact same as the inactive class.
(imported from commit d26a02ca0edef6ee86affa2fa5daee0426eb5f8a)
We had to turn off hover styling to make typeaheads work properly, but
some plain dropdown menus might need it, like our gear menu, and they
can set a class of actual-dropdown-menu to be unaffected by the
typeahead patch.
(imported from commit af41c1cfa6da3ff90ca4245a12c47993c65e6766)
Previously, we'd render all the rows of the table except the first
(which is for creating new subscriptions) and append them all to the
table. This ends up being really slow. We now instead render the
entire tbody element and replace the existing tbody element.
When profiling on my laptop, this reduces the rendering time for a
few thousand streams from ~62 seconds to ~2 seconds.
(imported from commit 83a48e0e1f776f7663343662157298e89165ece3)
Regular Handlebars partials require pre-registering. This allows us
to treat any template as a partial.
(imported from commit fff785d4fa944547b7ad4c3a620ef9400777ec87)
I haven't hooked this into test-all yet, but I did modify
message_tour.js to accomodate the test.
(imported from commit e58f595f4fe1160f539c18ec09dbe22eebf1f104)
This change also adds comments to make it clear what the function does
and why it's used.
(imported from commit 68382abaf2d7c41c7de7d92cbf6e7583003aaf2a)
When you return to Home, we normally restore your last
position when in Home, which might have been before the
first unread message. This is cumbersome for sidebar readers,
so now we keep track of messages that you visit while on a
tour away from Home, and when you return Home, we skip forward
any messages that were in the tour, landing on the last visited
message. This all happens before rendering.
(imported from commit 9124a231d94f153e283e5ea95e40c50a58406275)
The goal here is to make it so that we can do other stuff with
the range of messages between two subsequent selections, besides
marking them as read.
(imported from commit f6eb07844fb2ccda195c9d4dfcdf1c15f3f40aff)