-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unify JavaScript handling of form submissions
- drop the `js-submit` class and merge the two separate `submit` event handlers into one - it's now easy to run custom functions both before and after a form submission - however, the after functions may not be called if the server responds to the form submission with an error - the unified function's source code is commented - the unified function sends debugging messages to the console - form inputs are no longer disabled during submission, because it was complicating the JavaScript code - CSS is used instead to gray out the entire form and disable mouse events, but keyboard events aren't be disabled - the submission feedback overlay is back, for forms making slow requests before submitting - replace most uses of `jQuery.ajax()` with `fetch()`, simplifying the `Liberapay.error()` function and removing the need for the `Liberapay.getCookie()` function - all forms are now required to include an anti-CSRF token, whereas previously the forms that required JavaScript didn't need to contain the token as it would be taken from the cookies anyway - since we no longer need the `csrf_token` cookie to be accessible from JavaScript, mark it as `httponly`
- Loading branch information
Showing
23 changed files
with
328 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.