-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Introduce htmx and use it to avoid full page load on Subscribe
and Follow
#28908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
80f33f7
Introduce htmx and use it to avoid full page load on `Subscribe` and …
yardenshoham 2096553
Add `is-loading` during request and disable autoscroll
yardenshoham 90b2eb3
Change default swap style to `outerHTML` and disable url push
yardenshoham 55c4706
Apply spinner on entire profile
yardenshoham d312b30
Merge branch 'main' into htmx
6543 94c151c
Merge branch 'main' into htmx
6543 5cdc587
Merge branch 'main' into htmx
yardenshoham 5e27261
Merge branch 'main' into htmx
yardenshoham 5fbbaa2
Merge branch 'main' into htmx
yardenshoham 9d6015f
Merge branch 'main' into htmx
GiteaBot 910d973
Merge branch 'main' into htmx
GiteaBot 42b1435
Merge branch 'main' into htmx
GiteaBot 6859b1b
Merge branch 'main' into htmx
GiteaBot 0d03be1
Merge branch 'main' into htmx
GiteaBot acc2ca8
Merge branch 'main' into htmx
GiteaBot ae3b58f
Remove `window.htmx`
yardenshoham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<form hx-boost="true" hx-sync="this:replace" hx-target="this" hx-push-url="false" hx-swap="show:no-scroll" method="post" action="{{.Issue.Link}}/watch"> | ||
<input type="hidden" name="watch" value="{{if $.IssueWatch.IsWatching}}0{{else}}1{{end}}"> | ||
<span class="htmx-indicator is-loading"></span> | ||
<button class="fluid ui button"> | ||
{{if $.IssueWatch.IsWatching}} | ||
{{svg "octicon-mute" 16 "gt-mr-3"}} | ||
{{ctx.Locale.Tr "repo.issues.unsubscribe"}} | ||
{{else}} | ||
{{svg "octicon-unmute" 16 "gt-mr-3"}} | ||
{{ctx.Locale.Tr "repo.issues.subscribe"}} | ||
{{end}} | ||
</button> | ||
</form> |
This file contains hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'htmx.org'; | ||
import {showErrorToast} from './modules/toast.js'; | ||
|
||
// https://htmx.org/events/#htmx:sendError | ||
document.body.addEventListener('htmx:sendError', (event) => { | ||
// TODO: add translations | ||
showErrorToast(`Network error when calling ${event.detail.requestConfig.path}`); | ||
}); | ||
|
||
// https://htmx.org/events/#htmx:responseError | ||
document.body.addEventListener('htmx:responseError', (event) => { | ||
// TODO: add translations | ||
showErrorToast(`Error ${event.detail.xhr.status} when calling ${event.detail.requestConfig.path}`); | ||
}); |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.