1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-01 17:05:48 +00:00
gitea/web_src/js
Yarden Shoham 14f6fcf448
Don't do a full page load when clicking the subscribe button (#28871)
- Refactor the form around the subscribe button into its own template
- Use htmx to perform the form submission
- `hx-boost="true"` to prevent the default form submission behavior of a
full page load
- `hx-sync="this:replace"` to replace the current request (in case the
button is clicked again before the response is returned)
  - `hx-target="this"` to replace the form tag with the new form tag
  - `hx-push-url="false"` to disable a change to the URL
  - `hx-swap="show:no-scroll"` to preserve the scroll position
- Change the backend response to return a `<form>` tag instead of a
redirect to the issue page
- Include `htmx.org` in javascript imports

This change introduces htmx with the hope we could use it to make Gitea
more reactive while keeping our "HTML rendered on the server" approach.

# Before


![before](https://github.com/go-gitea/gitea/assets/20454870/4ec3e81e-4dbf-4338-9968-b0655c276d4c)

# After


![after](https://github.com/go-gitea/gitea/assets/20454870/8c8841af-9bfe-40b2-b1cd-cd1f3c90ba4d)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-01-20 20:44:51 +01:00
..
components Modernize merge button (#28140) 2024-01-15 00:00:47 +02:00
features Don't do a full page load when clicking the subscribe button (#28871) 2024-01-20 20:44:51 +01:00
markup Change katex limits (#27823) 2023-10-29 01:52:02 +00:00
modules Polyfill SubmitEvent for PaleMoon (#28441) 2023-12-15 07:26:36 +08:00
render Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
standalone Add toasts to UI (#25449) 2023-06-27 02:45:24 +00:00
test Replace 'userxx' with 'orgxx' in all test files when the user type is org (#27052) 2023-09-14 02:59:53 +00:00
utils Polyfill SubmitEvent for PaleMoon (#28441) 2023-12-15 07:26:36 +08:00
vendor Vendor jquery.are-you-sure with strict mode fixes (#26901) 2023-09-06 00:02:44 +00:00
webcomponents Polyfill SubmitEvent for PaleMoon (#28441) 2023-12-15 07:26:36 +08:00
bootstrap.js Remove joinPaths function (#26833) 2023-08-31 02:46:44 +00:00
index.js Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) 2023-10-17 16:10:45 +02:00
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) 2020-04-18 18:46:29 -04:00
svg.js Replace ajax with fetch, improve image diff (#27267) 2023-10-11 12:34:21 +00:00
svg.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
utils.js Replace ajax with fetch, improve image diff (#27267) 2023-10-11 12:34:21 +00:00
utils.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00