1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 04:32:43 +01:00
phorge-phorge/webroot/rsrc/js/application
epriestley 08bcb8c30a Simplify form/lightbox stuff
Summary:
I broke this a bit a few revisions ago by making `phabricator_render_csrf_magic()` return array instead of string without actually grepping for callsites.

Instead of building a form in JS, build it in PHP and just change its action in JS. This is simpler and doesn't require us to expose CSRF magic in more places.

This change triggered a rather subtle bug: if we rendered a normal form on the page (and thus installed the "disable forms when submitted" behavior), the download button would incorrectly disable after being clicked. This doesn't currently happen in Files because we don't put a form on the same page as the download button.

Instead, make the "disable" behavior check if the form is downloading stuff, and not disable stuff if it is. Then mark the lightbox and Files form as both download forms.

Test Plan: Used lightbox; used Files. Verified download buttons download the right stuff and behave correctly. Grepped for other download forms, but all the other places where we write "download" don't appear to actually be download links.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4685
2013-01-28 18:12:09 -08:00
..
aphlict Improve style of notifications 2012-12-07 16:26:43 -08:00
conpherence Conpherence V1 2013-01-24 17:23:05 -08:00
core Simplify form/lightbox stuff 2013-01-28 18:12:09 -08:00
countdown Make countdowns (internally) embeddable 2012-08-14 19:19:23 -07:00
differential Disable Differential 1up views in all cases for now 2013-01-17 15:04:44 -08:00
diffusion Update tables to table-kit view. 2013-01-11 11:24:35 -08:00
herald Clean up Login, Responsive Forms 2013-01-19 14:30:26 -08:00
maniphest Allow commits to be associated with projects and associated goodies 2012-08-08 10:03:41 -07:00
owners Allow excluding paths from package 2012-12-07 16:33:16 -08:00
phame Modernize blog UI 2012-10-15 14:50:12 -07:00
phortune For discussion -- Stripe integration 2012-04-04 16:09:29 -07:00
phriction Add a document preview to Phriction 2011-07-16 18:48:27 -07:00
ponder Simplify upvote/downvote implementation 2012-09-30 20:12:35 -07:00
projects Allow commits to be associated with projects and associated goodies 2012-08-08 10:03:41 -07:00
repository Don't open symbols on double click 2012-09-17 16:08:53 -07:00
transactions Add draft support to ApplicationTransactions 2012-12-21 05:57:14 -08:00
uiexample Improve the implementation of Notifications 2012-10-08 15:22:29 -07:00