26 Commits

Author SHA1 Message Date
carson
2944bf372c search for extensions in new content
fixes https://github.com/bigskysoftware/htmx/issues/281
2021-11-12 15:37:29 -07:00
Andy
38ff8fa54f morphdom-swap handles DocumentFragment properly 2021-02-06 04:55:12 +00:00
Joe Mullally
8538f18c40 Add test for path-deps outerHTML case
This test reproduces issue #323
2021-02-05 20:38:02 +00:00
carson
16765b39bf support the on load syntax in hyperscript 2021-01-03 09:15:43 -07:00
Johan Vosloo
b46e8ab10f Added tests 2020-12-30 14:49:21 +01:00
carson
ab88b86109 add event-header extension 2020-10-05 08:29:09 -06:00
carson
45f3909b9c Update htmx to latest hyperscript, fix tests 2020-09-11 08:00:45 -06:00
carson
4f3cf2d889 Move events from <event name>.htmx (jQuery style) to htmx:<event name> (zepto style)
fixes https://github.com/bigskysoftware/htmx/issues/109
2020-06-30 10:45:30 -07:00
carson
2524fcf436 rename test 2020-06-17 18:37:02 -07:00
carson
74c7395f1f integrate improvement for extension swapping, back out extension passing through event object, run www and dist 2020-06-17 18:33:41 -07:00
chg20
6c8930028c
Merge pull request #94 from twidi/handle-events-and-content-after-handleSwap-extensions
Handle events and content after `handleSwap` in extensions
2020-06-17 18:05:45 -07:00
carson
76a1d5c5a4 fix remove-me extension tests 2020-06-17 15:02:32 -07:00
carson
504bd34ee4 fix tests, hyperscript is so awesome 2020-06-15 18:28:14 -07:00
chg20
64f263f778
Merge pull request #82 from 36864/dev
Add an extension to include the commonly-used X-Requested-With header
2020-06-15 18:25:07 -07:00
carson
0ac641b63f remove the hx-error-url attribute in favor of hyperscript
add basic hyperscript compatibility testing
2020-06-12 13:42:55 -07:00
Stephane Angel (Twidi)
0b9448e727
Extension.handleSwap: handle new content
Before this commit, the content that were swapped by an extension via
`handleSwap` was not handled by htmx: elemtents with `hx-` attributes,
scripts, no `load.htmx` event...

With this commit, if the `handleSwap` command returns an array of newly
added elements (only the first level), then they will be handled by htmx
like it's done for internal swap.

To not break existing extensions, `handleSwap` can still return `true`
to tell that the swap was handled, assuming than there is no new
elements to handle.

A new test was added with a button that, when clicked, loads a text and
a span with `hx-trigger=load`, both handled by an extension. This commit
allows this span to be loaded.

The return of the `morphdom-swap` extension was updated to return the
target element, even if unchanged, to let htmx check in the maybe new
content that there is something new to handle. This is tested in a new
test.
2020-06-12 02:08:05 +02:00
Stephane Angel (Twidi)
86febd3efc
Extension.handleSwap: trigger events for extensions defined on parents
If an element is replaced by an extension in `handleSwap`, the events
(`afterSwap.htmx` and `afterSettle.htmx`) were not received by the
`onLoad` method of extensions defined on parents of the target, because
theses extensions were retrieved after the replacement, and so it was
not possible to get through the parents, the target not being in the dom
anymore.

This commits loads the extensions for the target and save them in
`eventDetail` before doing the swap, so they are accessible in
`triggerEvent`, and passed to `withExtensions` that use this list if
passed (else load them).

A new test is added that fails without the updates in `htmx.js`.
2020-06-12 01:20:13 +02:00
carson
2305aed18e Move X-HTTP-Method-Override out to an extension
fixes https://github.com/bigskysoftware/htmx/issues/86
2020-06-10 16:01:56 -07:00
36864
92561e193c Add an extension to include the commonly-used X-Requested-With header 2020-06-05 15:44:02 +01:00
carson
7b7f00baa0 include-vals extension + docs cleanup 2020-05-26 10:19:39 -07:00
carson
ec6ec68a1e remove-me extension 2020-05-26 08:36:14 -07:00
carson
821ae457f0 handle bad extensions gracefully 2020-05-26 08:11:32 -07:00
carson
860d263d4d pull hx-classes out to an extension 2020-05-24 17:04:59 -07:00
carson
23a9a33486 path-deps extension
fixes https://github.com/bigskysoftware/htmx/issues/21
2020-05-23 17:06:20 -07:00
carson
cdb80690e9 support client side templating via an extension 2020-05-23 08:33:25 -07:00
carson
2110d49ee1 include extensions in dist 2020-05-22 21:50:01 -07:00