1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-22 04:31:13 +01:00
No description
Find a file
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
bin Port Diviner Core to Phabricator 2013-01-07 14:04:23 -08:00
conf Remove PhabricatorSetup and make PHABRICATOR_ENV optional 2013-01-23 12:03:19 -08:00
externals Fix JSON encoding of PhutilSafeHTML for browser consumption 2013-01-28 18:11:27 -08:00
resources Notifcation icons for Conpherence 2013-01-26 17:04:18 -08:00
scripts Use direct inclusion, not submodules, to bring Javelin into Phabricator 2013-01-22 12:43:55 -08:00
src Simplify form/lightbox stuff 2013-01-28 18:12:09 -08:00
support Raise early fatal for bad rewrite with no "/" 2013-01-22 17:17:37 -08:00
webroot Simplify form/lightbox stuff 2013-01-28 18:12:09 -08:00
.arcconfig Delete license headers from files 2012-11-05 11:16:51 -08:00
.divinerconfig Centralize rendering of application mail bodies 2012-07-16 19:01:43 -07:00
.editorconfig Specify config for text editors 2012-11-03 22:34:44 -07:00
.gitignore Remove PhabricatorSetup and make PHABRICATOR_ENV optional 2013-01-23 12:03:19 -08:00
LICENSE Delete license headers from files 2012-11-05 11:16:51 -08:00
NOTICE Increment year. 2013-01-03 05:45:08 -08:00
README Delete license headers from files 2012-11-05 11:16:51 -08:00

Phabricator is a open source collection of web applications which make it easier
to write, review, and share source code. Phabricator was developed at Facebook.

This is an early release. It's pretty high-quality and usable, but under
active development so things may change quickly.

You can learn more about the project and find links to documentation and
resources at: http://phabricator.org/

LICENSE

Phabricator is released under the Apache 2.0 license except as otherwise noted.