Commit Graph

1144 Commits

Author SHA1 Message Date
Tim Abbott 8388353859 Clean up the decorators code for the API.
(imported from commit b3fd6cfa475f021e35043148ad9a38633d9bddfe)
2012-10-16 16:38:42 -04:00
Tim Abbott a859c10017 Don't redirect to a login page when responding to json messages.
Also update tests to actually check all our URLs.

(imported from commit 86de2027d140da6118e2f2f60c1c86511b16c141)
2012-10-16 16:38:39 -04:00
Tim Abbott 3e994c16b7 Rename/reorganize our urls to be more consistent.
(imported from commit ca3cc7ccd5d7da83a9c60968527378ee1118648e)
2012-10-16 15:56:06 -04:00
Zev Benjamin fab64fd7b0 Make the client reload the page when it detects a server restart
If the client is not composing a message, we can just force a page
reload.  However, if he is composing a message, we must preserve that
message while still reloading as soon as possible.

We take the following approach: if the client has not completed the
composition after 5 minutes, do a compose-preserving reload
(described below).  If he sends the message before the timeout
expires, reload the page after a successful send.  If the send fails
(not due to server timeout), however, we do a compose-perserving
reload in case the error was due to the data format changing.  If the
send failed due to server timeout, we don't reload because the reload
will probably also fail.

In a compose-preserving reload, we redirect to an URI that has a
fragment indicating we are doing a reload and containing all the
necessary information for restoring the compose window to its
previous state.  On page load, we check the fragment to see if we
just did a compose-preserving reload, and, if we did, we restore the
compose window (or just try the send again in the case of send
failure).  The URI fragment looks like:

(imported from commit af4eeb3930c24118e088057d4da456748fbd2229)
2012-10-16 15:30:41 -04:00
Zev Benjamin 103bf321b4 Have client and server exchange a server generation number
This will allow the client to detect when the server has restarted.

(imported from commit 89e75916719d967beb2520be6263f79f897d9ec1)
2012-10-16 15:30:09 -04:00
Zev Benjamin 24c1a2d7f1 Make compose box accessor functions also be setters
(imported from commit ab568cc2c224b8558148f158d1c9c1f89bb1eb49)
2012-10-16 15:30:09 -04:00
Tim Abbott 3a784cd0b2 Sync messages on Zephyr instances to corresponding humbug stream intelligently.
(imported from commit 182cab9442f6444c0a710699420524e82542d9cc)
2012-10-16 14:57:46 -04:00
Tim Abbott 2cb9589fd1 zephyr_mirror.py: Clean up duplicated lower-casing code.
(imported from commit 2357202a4d8e0780cda3329f2e86d25b7596afbf)
2012-10-16 14:57:46 -04:00
Waseem Daher 6dad169d12 Workaround for 'Can't click stream name in narrowed view' issue.
There was this very cute problem where if you were narrowed and
scrolled to the top of the page, you couldn't seem to click on the
stream or subject name.

The issue was: the floating_recipient_row div was visibility: hidden,
which means that it made top_statusbar big enough to cover up that top
part, capturing the clicks.

So instead we make top_statusbar also visibility: hidden so that
the clicks get through.

(imported from commit 471e041ba1c429ad0b6e225da22585dc72120945)
2012-10-16 14:25:12 -04:00
Waseem Daher ea7770c4b7 Properly handle mousewheel events when we're simultaneously at top and bottom.
(imported from commit 72efb1c52b5aed759150d9d2fe82ca619a25ff35)
2012-10-16 12:16:26 -04:00
Waseem Daher ca1dcf222f Don't allow the top of the pointer to be past the 2/3 mark.
Given that we now look at the top of the pointer rather than the
bottom for this check, our previous 4/5 number was far too permissive
(and led to your selected message often getting covered up by the
compose window).

Anecdotally, this feels a bit better to me.

(imported from commit 39ca7924db56272f7e623708ce0125b2a7012656)
2012-10-16 11:46:17 -04:00
Waseem Daher fc5287e7ed Redo above_view_threshold/below_view_threshold to prevent glitching.
In particular, we had this issue on huge messages. Suppose you had a
huge message and were scrolling up from the bottom. Initially it would
get selected as the message underneath it was below the
threshold. Then, when you scrolled again we said "oh, well, the top is
too tall, it's also *above* the threshold" and moved the pointer back
down. So it glitched back and forth.

Now we consider you above the view threshold by looking at your
bottom, and below the view threshold by looking at your top, which
seems to resolve this issue.

(imported from commit 2434d1103ab3fa894ade612ac1fb10b2f3cd66cf)
2012-10-16 11:46:17 -04:00
Keegan McAllister ed094b6a84 Markdown: Disable headings using our extension
(imported from commit cd40f6bf010ff30775ca2af494b9566843444797)
2012-10-16 11:39:00 -04:00
Keegan McAllister d8556707aa Markdown: Disable images
(imported from commit 6656b15fa690b463265af6384a73529ee635f688)
2012-10-16 11:35:58 -04:00
Keegan McAllister 2bd9a6953c django-template-graph: Replace slashes with newlines
Makes the graph fit better on the screen.

(imported from commit 7d42caca478634143c6b291f47a4642acfdd1128)
2012-10-16 01:45:37 -04:00
Keegan McAllister 7d44e1c56f Don't include signup.js in login.html
(imported from commit fe36afb1703e706012f1c690d15481a0da204eb3)
2012-10-16 01:33:15 -04:00
Keegan McAllister 1769b4c21b portico.css: Get rid of div.foo / span.foo selectors
(imported from commit eb98aed3b95bcfbfb3f2b420b61318ab0a43b0f8)
2012-10-16 01:33:15 -04:00
Keegan McAllister 216ab3de8b Rename signup.css -> portico.css
This is used on all portico pages, including login.

(imported from commit b37121a0975c46fba581c314e05af0a77e6607e9)
2012-10-16 01:33:15 -04:00
Keegan McAllister 37c51b80cc Add a tool to draw the Django template inheritance graph
(imported from commit e10bb719d62a76abfea76c7fc69093a3cc33272e)
2012-10-16 01:33:15 -04:00
Keegan McAllister dbd88b28f3 Document what all the Django templates are for
(imported from commit fa2b6c5327b0004f2c19502471f6717d84705ba7)
2012-10-16 01:33:15 -04:00
Keegan McAllister b55e277930 Rename more_content -> portico_content
(imported from commit 4a3df508bb0227e998115eeff24b789dd8b42698)
2012-10-16 01:33:15 -04:00
Keegan McAllister 46f17431cf Rename content_base.html -> portico.html
(imported from commit 556fb5aeca76eb186013a28da9bab77c1e56d700)
2012-10-16 01:33:15 -04:00
Waseem Daher ca7855e03e Use outerHeight instead of height.
I think this'll allow for a slighlty more accurate drawing of our
floating recipient row in the even that some of these things have
borders and others don't.

(imported from commit 31714f7356604e1d9c64bcc7f6fd14b8a02a99b5)
2012-10-15 22:47:42 -04:00
Waseem Daher aaca685c4c A cheating way of eliminating the floattheworld 1px issue.
If we make the recipient_rows the same size for huddles and stream
messages, this becomes a non-issue. (Previously, the border on huddles
was 2px, which I think caused our invisible row to have its height
grow by 1px -- which was a problem, because then it left a little 1px
gap that you could see through when we scrolled over non-huddle
messages.)

(imported from commit d1f24e5c536bdf9c0827a15b611ba680ee4e5e36)
2012-10-15 22:47:42 -04:00
Waseem Daher b76422d8d0 Cache the window selector as 'viewport' in an attempt to improve performance.
(imported from commit 3e01382260938737fbee663f6a9e94ad495ef21e)
2012-10-15 22:47:42 -04:00
Waseem Daher 45629a362d Break apart the scroll and mousewheel handlers.
I'm actually not sure if this is a performance gain or not; I guess it
depends if any of the stuff inside mousewheel or scroll took longer
than 50ms to call (and right now it does).

(imported from commit e3fcc4a14cd8787fa2357a43ed878ab08646e4f2)
2012-10-15 22:47:42 -04:00
Waseem Daher d51aec272d Rename. More consistent references to floating_recipient_bar.
(imported from commit 7bfd2bf55ede0604349faf06944c551a0d23fb73)
2012-10-15 22:47:42 -04:00
Waseem Daher 1c56ad00c9 Optimize update_floating_recipient_bar's showing-and-hiding code.
(imported from commit 6cd67d9c7bf418ae78288363636ee75fdc3fcada)
2012-10-15 22:47:42 -04:00
Waseem Daher 1781a4a616 Optimize update_floating_recipient_bar's "pick a subject/stream" code.
(imported from commit a6e615a3939fb072cc9cd310e653f13d690a55cc)
2012-10-15 22:47:42 -04:00
Waseem Daher daf06b9beb Hack around visibility: collapse for Chrome.
(imported from commit 25e6453fe6fa1c5a3c72f56bec2e4bbb089edb4f)
2012-10-15 22:47:42 -04:00
Waseem Daher bca36ba4c2 Eliminate some inline styles (visibility: collapse).
(imported from commit a29f12ea2f82672ef05e5dcca486ec527acbd6dd)
2012-10-15 22:47:41 -04:00
Waseem Daher 4d914df68b Rename things.
narrowbox -> top_statusbar
narrowcontent -> narrowed_to_bar

floating_indicator -> floating_recipient_bar
fixed_narrowbox -> table.floating_recipient

(imported from commit 7b5bbb17aeff9372275311ab09cd3cbf8262ea13)
2012-10-15 22:47:41 -04:00
Waseem Daher acb75ecf67 Only float narrowbar when #home is active.
(imported from commit a2da9b5a41e5a645d0c72ef48ff4a856558bed15)
2012-10-15 22:47:41 -04:00
Waseem Daher a80ba151b0 Eliminate scroll direction detection.
(imported from commit 2aa8665c9ffa137830fc871061d7e72ba5ccfc6f)
2012-10-15 22:47:41 -04:00
Waseem Daher 6015d1d928 Refactor the 'floating stream/subject' bar.
(imported from commit 76528653c29809bc461693b069140bfdfbeec97b)
2012-10-15 22:47:41 -04:00
Waseem Daher 470143e254 Add top_whitespace.
(imported from commit 2c049f3032879926e98287428e839b9117460a90)
2012-10-15 22:47:41 -04:00
Waseem Daher f3ab2dc5ac Move the floating stream/subject bar into #narrowbox.
This allows us to reposition both of them more cleanly
when we resize things.

(imported from commit a772d2390bd80146e91181e348930559a9e2f4eb)
2012-10-15 22:47:41 -04:00
Waseem Daher d95b4a30e2 Resize the narrowbox, not the 'narrowcontent' when we shrink.
This allows us to put other stuff in the narrowbox and have
it also magically get resized. At least in theory.

(imported from commit 92975e3d0893b34d52cad910462cbf2ccaed2eab)
2012-10-15 22:47:41 -04:00
Waseem Daher 4933a986b9 Un-remove the normal narrowbar.
(imported from commit 2dbaa7e482db40b65865c252b9eee081655d5f72)
2012-10-15 22:47:41 -04:00
Jessica McKellar d07f4c05f3 Keep the top-most recipient row floating at the top of the screen as you scroll.
(imported from commit e597b60c86f5b38a55dc78df80d84dfe112c8d8f)
2012-10-15 22:47:41 -04:00
Keegan McAllister 8819bdc0fc Hide most of the navbar on the deployed app
(imported from commit 3b055588f7de805bf1b038f1bc6c03837eda010a)
2012-10-15 18:44:36 -04:00
Keegan McAllister 489fd58e43 Hide register, confirm, etc. on the deployed app
(imported from commit 8bcf84383d4ea4c24dfadaee330517bfc9801bbd)
2012-10-15 18:44:36 -04:00
Keegan McAllister 1876995abb Redirect home to login on deployed server
(imported from commit 9642a3c6b7b0b55cf5731cc2e241aed51431c8ae)
2012-10-15 18:44:36 -04:00
Keegan McAllister 5141cd7ab9 Make a setting for where we redirect home for not logged in users
(imported from commit 95bae4e52d8a8a34c001975e8d3547db5ba256a2)
2012-10-15 18:44:36 -04:00
Tim Abbott bcc895b95b Avoid expensive queries to check whether the user has any messages.
(imported from commit 035ec44db7a2f61b1c04e80feebe9af1a214505c)
2012-10-15 17:10:55 -04:00
Keegan McAllister ab9832092d Remove an unnecessary @require_post
(imported from commit c8a43e696dbcfa4cdb494f286e6f0b989d328bd9)
2012-10-15 17:05:37 -04:00
Keegan McAllister 277f37aea4 Fix formatting
(imported from commit d87311335d97a6e01892b8e341edf95f41977340)
2012-10-15 17:05:36 -04:00
Keegan McAllister bc43613a10 Some import cleanup
(imported from commit 265cebb011309b9a880035ccd587a5e51554803a)
2012-10-15 16:16:10 -04:00
Keegan McAllister 80e60c3120 check-all: Show unused imports if passed --imports
(imported from commit ecae64a3257b3ebd40656717718177270d02111a)
2012-10-15 16:16:10 -04:00
Keegan McAllister fa729c838a Move our various Markdown hacks into their own file
(imported from commit b03a5c64cc95964936c4aba7d667807969e35d21)
2012-10-15 16:16:09 -04:00