1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 19:02:41 +01:00
phorge-phorge/src/applications/files/controller
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
..
PhabricatorFileController.php Modernize file uploads 2012-12-16 16:34:01 -08:00
PhabricatorFileDataController.php Delete license headers from files 2012-11-05 11:16:51 -08:00
PhabricatorFileDeleteController.php Delete license headers from files 2012-11-05 11:16:51 -08:00
PhabricatorFileDropUploadController.php Delete license headers from files 2012-11-05 11:16:51 -08:00
PhabricatorFileInfoController.php Simplify form/lightbox stuff 2013-01-28 18:12:09 -08:00
PhabricatorFileListController.php Rename setViewer() to setUser() in views 2012-12-21 12:18:55 -08:00
PhabricatorFileShortcutController.php Delete license headers from files 2012-11-05 11:16:51 -08:00
PhabricatorFileTransformController.php Delete license headers from files 2012-11-05 11:16:51 -08:00
PhabricatorFileUploadController.php Convert phutil_render_tag(X, Y, '...') to phutil_tag 2013-01-24 19:20:27 -08:00