Merge remote-tracking branch 'origin/master'

This commit is contained in:
Carson Gross 2023-06-13 12:34:46 -06:00
commit b4a61c543b
6 changed files with 11 additions and 9 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
_site
test/scratch/scratch.html
.DS_Store
.vscode

View File

@ -157,7 +157,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
};
source.onopen = function (evt) {
api.triggerEvent(elt, "htmx::sseOpen", {source: source});
api.triggerEvent(elt, "htmx:sseOpen", {source: source});
}
// Add message handlers for every `sse-swap` attribute

View File

@ -13,7 +13,7 @@ the HTML into the DOM using a swap strategy:
This example will cause the `button` to issue a `DELETE` to `/account` and swap the returned HTML into
the `innerHTML` of the `body`.
## Notes
* `hx-delete` is not inherited
@ -21,3 +21,4 @@ This example will cause the `button` to issue a `DELETE` to `/account` and swap
* You can control the swap strategy by using the [hx-swap](@/attributes/hx-swap.md) attribute
* You can control what event triggers the request with the [hx-trigger](@/attributes/hx-trigger.md) attribute
* You can control the data submitted with the request in various ways, documented here: [Parameters](@/docs.md#parameters)
* To remove the element following a successful `DELETE`, return a `200` status code with an empty body; if the server responds with a `204`, no swap takes place, documented here: [Requests & Responses](@/docs.md#requests)

View File

@ -34,7 +34,7 @@ The `hx-swap` attributes supports modifiers for changing the behavior of the swa
#### Transition: `transition`
If you want to use the new (View Transitions)[https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API] API
If you want to use the new [View Transitions](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) API
when a swap occurs, you can use the `transition:true` option for your swap. You can also enable this feature globally by
setting the `htmx.config.globalViewTransitions` config setting to `true`.

View File

@ -131,7 +131,7 @@ After all, both htmx and hyperscript are _built in JavaScript_. We couldn't hav
JavaScript, which, whatever else one might say, has the great virtue of [_being there_](https://en.wikipedia.org/wiki/Being_There).
And we even go so far as to _recommend using_ JavaScript for front-end scripting needs in a hypermedia-driven
application, so long as you script in a [hypermedia-friendly](/hypermedia-friendly-scripting/) way.
application, so long as you script in a [hypermedia-friendly](/essays/hypermedia-friendly-scripting/) way.
Further, we wouldn't steer someone away from using JavaScript (or TypeScript) on the _server side_ for a
hypermedia-driven application, if that language is the best option for your team. As we said earlier, JavaScript now

View File

@ -23,7 +23,7 @@ table body:
```
The table body has a [`hx-confirm`](@/attributes/hx-confirm.md) attribute to confirm the delete action. It also
set the target to be the `closest tr` that is, the closest table row, for all the buttons ([`hx-target`](@/attributes/hx-target.md)
set the target to be the `closest tr` that is, the closest table row, for all the buttons ([`hx-target`](@/attributes/hx-target.md)
is inherited from parents in the DOM.) The swap specification in [`hx-swap`](@/attributes/hx-swap.md) says to swap the
entire target out and to wait 1 second after receiving a response. This last bit is so that we can use the following
CSS:
@ -37,9 +37,9 @@ tr.htmx-swapping td {
To fade the row out before it is swapped/removed.
Each row has a button with a [`hx-delete`](@/attributes/hx-delete.md) attribute containing the url on which to issue a `DELETE`
request to delete the row from the server. This request responds with empty content, indicating that the row should
be replaced with nothing.
Each row has a button with a [`hx-delete`](@/attributes/hx-delete.md) attribute containing the url on which to issue a `DELETE`
request to delete the row from the server. This request responds with a `200` status code and empty content, indicating that the
row should be replaced with nothing.
```html
<tr>
@ -138,4 +138,4 @@ tr.htmx-swapping td {
</table>`;
}
</script>
</script>