Commit Graph

915 Commits

Author SHA1 Message Date
Zev Benjamin f0d4cc3d42 Don't error out when displaying huddles with oneself
(imported from commit aa08d85f4af6352f49ef6584ae0d4a3d310e231e)
2012-10-17 18:17:43 -04:00
Zev Benjamin 2ade66bf3e Remove stale comment
(imported from commit c880fc2f543e3f0cdfd531c968a1e77249c04f4c)
2012-10-17 18:17:43 -04:00
Zev Benjamin f7644dfcd3 Rename the 'received' variable to 'get_updates_params'
(imported from commit 5d307f7de7edfb7aa65346353b20afe0e9aa49fc)
2012-10-17 18:17:43 -04:00
Waseem Daher 0fba2d2df3 Attempt at making stream names more prominent when skimming.
Known issues:
 * Narrowing links sort of broken
 * "S/H" is a terrible selector

(imported from commit 14d309b55dfaa4c4bc5cb1310a111a46f2fb7e20)
2012-10-17 18:12:32 -04:00
Tim Abbott bff0046c51 Fix client continuously calling get_updates when a reload is pending.
(imported from commit 2c29c8b892e7843f4d75178cc683bf48f7a5cdf5)
2012-10-17 17:46:07 -04:00
Waseem Daher 49a8677517 Remove 'timezone' from the settings page.
We weren't doing anything with it anyway, so...

(imported from commit ad927f3d2ce5b9bd219d6f36a021542812486aef)
2012-10-17 17:26:55 -04:00
Waseem Daher d9715825b1 Remove 'short_name' from the settings page (but not the db).
For now, we're not using this, so let's expunge the user-facing
references to it.

(imported from commit 90a8dcdc77d0a991bef3e319e6971327639d1f4e)
2012-10-17 17:26:06 -04:00
Tim Abbott 758bbe6fc9 Rename api_fetch_key to api_fetch_api_key to match json methods.
(imported from commit ed1c33f5017426dd38882c06ac38343451edb94b)
2012-10-17 17:13:33 -04:00
Tim Abbott a9d4dd4ffb Test new API key URLs.
(imported from commit e4d41b73f905730cb8728862373265d2119cfa00)
2012-10-17 17:12:44 -04:00
Tim Abbott ae3e24458c Add a UI for requesting your API key.
(imported from commit 07c40caf73f3b6c1c502a6c8e18109532dd28cc3)
2012-10-17 17:09:46 -04:00
Luke Faraone 716badc2c6 Don't reference GET if we now require post.
(imported from commit b78b62e81b4064f53c1a83a68e0b7e67a08230b5)
2012-10-17 16:52:30 -04:00
Luke Faraone 6c3a328426 API key fetching should happen over POST, not GET.
(imported from commit 351d0035a55f49f00693081584d882c1aef7dd01)
2012-10-17 16:36:49 -04:00
Luke Faraone 12bad46740 Introduce API method to return a user's API key by logging in.
This makes it easier for mobile clients to use the API by enabling them to
present the user with a familiar username / password prompt, rather than
by asking them for their API key.

(imported from commit 6ed06cfe86f87e7aef54a4be7835fb7bf8d7f209)
2012-10-17 15:33:05 -04:00
Keegan McAllister 235ce960b8 Use the obfuscated URLs
The key property is that we never reveal the non-public directory name
4nrjx8cwce2bka8r to a not-logged-in user.  This makes it less likely that
random people from the Internet will download all our client code while we're
still in private beta.

(imported from commit 7428e847e0a1a34152cb6dc2b677c1b47290c202)
2012-10-17 15:04:33 -04:00
Keegan McAllister 38750b5f02 Add a tree of symlinks to obfuscate static URLs
(imported from commit bb90863848ef5133c0cd90d5167b7004d72073f9)
2012-10-17 15:04:33 -04:00
Keegan McAllister cfb72a7337 Add robots.txt
For now, disallow everything.

(imported from commit fad7ba7ec28c86342a5c11bc721cdf45507c7c4f)
2012-10-17 15:04:33 -04:00
Keegan McAllister b59e895bbf Remove favicon
Browsers tend to cache these forever, and it's not our final logo.

(imported from commit 48e607c9e7ff95ee523dd339b3fcc9a1b189fa7f)
2012-10-17 15:04:33 -04:00
Tim Abbott 5c50375e02 Display a message and disable compose while reloading.
(imported from commit f998d2e4053e7e2d676f7fe08ee274118dd9faba)
2012-10-17 14:59:49 -04:00
Waseem Daher fdfe81bfb9 Don't linebreak between '(not you?)'.
(imported from commit 20569aed3fac59d979a05c456e21cdf668c78bcf)
2012-10-17 14:30:06 -04:00
Tim Abbott 7237b4a73e Fix sending to a stream with a space in its name.
Previously if you tried to send to "a b", we actually ended up trying
to send to "a%20b", since we were url-encoding the stream name and
then not properly decoding it.

(imported from commit 307d2999bd309e47fc654ae4422ab4372edde064)
2012-10-17 14:06:00 -04:00
Tim Abbott 8a7779ad49 Tab should toggle stream/huddle even if you clicked the compose botton.
(imported from commit a705c7cd0d6067dc05da7a64f29fb3ef42838785)
2012-10-17 12:05:43 -04:00
Tim Abbott d2343813df Add 'C' hotkey to start composing a huddle.
(imported from commit 693aeba202a06465dd41e46d78491ecfe23e97f6)
2012-10-17 11:55:21 -04:00
Waseem Daher bf73a54576 Have Spacebar exhibit the same scrolling behavior as PgDn.
(imported from commit 46a1204a9a8b973e7fa6bae9c65a9dc9f341077c)
2012-10-17 11:25:38 -04:00
Waseem Daher 2d4857d6c1 Remove extraneous calls to keep_pointer_in_view.
PgUp, PgDn will already call the scroll handler, which will
of its own accord call keep_pointer_in_view.

(imported from commit 8b6e53eaeda91d0f35775de72e16d63dc6c8340b)
2012-10-17 11:25:38 -04:00
Keegan McAllister c31462c278 Allow users to embed Gravatars in messages
We'll use this internally for the commit bot.  We might eventually disable it
for external users.

(imported from commit 3136cd9faadc6b81355889d2ee6472985da87fbe)
2012-10-17 01:11:33 -04:00
Keegan McAllister 81f0d61c3b Factor out Gravatar hash calculation
(imported from commit 29872722fb4856773d98fc987a1e2d6eb99ad8b2)
2012-10-17 01:09:16 -04:00
Waseem Daher 93954177f9 Code a little more defensively in update_floating_recipient_bar.
That andSelf is only necessary if a .recipient_row were immediately
followed by a .bookend_tr, which, I don't know, after a redesign could
very well be the case, so let's guard against it now, especially since
our performance on scroll is currently pretty good.

(imported from commit 1011555fbfd30943b4aa917997d6e35bcce959fc)
2012-10-16 17:26:02 -04:00
Tim Abbott b5c1178ac7 test_public_urls doesn't work with Tornado urls.
(imported from commit fe56a80842ac7f34fc0af0f916ce26f94a4baca8)
2012-10-16 17:25:00 -04:00
Tim Abbott 539c3abbab @asynchronous needs to be the outer wrapper.
(imported from commit 24b8f157d600e69276178d609820d3f0dfb685a7)
2012-10-16 17:10:15 -04:00
Waseem Daher 433ac07b37 Very very slight speedup in get_next_visible/get_prev_visible.
In my limited trial, this sped the call up, on average, from
0.507ms to 0.473 ms... so, admittedly, not a lot.

I think this is a little conceptually cleaner, though, and it handles
the common path with the least work, which I like.

(imported from commit c8b827a2e8111fbdd54bcabe05ac36f64523c466)
2012-10-16 17:06:36 -04:00
Waseem Daher b730dc7983 Huge speedup in get_next_visible/get_prev_visible.
nextAll/prevAll walks the entire DOM, basically.
This code only walks the DOM until we find a new .message_row.

This speeds up the average time of a call to this function from about
6.38ms to 0.678ms, in my benchmarking.

Admittedly, the whole outer loop here could still use some
optimization, if we want to; do we really need to call this 1000
times?

(imported from commit 852e2f660a16f8cfd7be35d3271aedb1ac481663)
2012-10-16 17:06:36 -04:00
Waseem Daher cada47a981 Slight speedup in get_next_visible/get_prev_visible.
http://api.jquery.com/first-selector/ mentions that using ":first" in
query selectors can be a little slow since we can't use the browser's
native querySelectorForAll implementation.

In my tests, this cut the average time down from 6.70ms to 6.38ms.
So, not great, but this function is most frequently called
many times in a big while loop, so, better than nothing.

(imported from commit d7725edd0c81431829fe353c6dd2bc61b1de6b19)
2012-10-16 17:06:36 -04:00
Tim Abbott 94944d2c5e Fix updating the pointer.
(imported from commit e0214c59c7c14b3c6791e4da205386253f6861c1)
2012-10-16 16:56:21 -04:00
Tim Abbott 6642a65269 Convert last few json views to use the json_success api.
(imported from commit 7a617ec7e7c8607e8ba87e7a9b8599a83b91666c)
2012-10-16 16:54:41 -04:00
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
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 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
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