666 Commits

Author SHA1 Message Date
JackWithOneEye
8bbcc235a9
Fix: hx-on event listener clean-up (#1586)
fix: hx-on listener clean-up
2023-07-17 15:08:12 -06:00
Carson Gross
1837f1fa97 Merge remote-tracking branch 'origin/master' into dev 2023-07-14 14:26:48 -06:00
RoToRa
3521c3c059
Implementation of HX-Reselect (#1385)
* HX-Reselect #1040

* HX-Reselect documentation

* HX-Reselect: Fix wrong variable name
2023-07-14 15:21:21 -05:00
Carson Gross
05a1f8cba7 Merge remote-tracking branch 'origin/dev' into dev 2023-07-14 13:50:31 -06:00
Carson Gross
4e97877047 Merge branch 'master' into dev 2023-07-14 13:50:25 -06:00
Alexander Petros
febfa1c6a7
Add configs to choose between ecoding parameters in the URL or request body (#1525)
* Allow extensions to set request bodies for GET and DELETE

Even though the semantics of request bodies for GET and DELETE are
undefined, it is legal to set request bodies for them. By default, GET
and DELETE form parameters should be encoded as URLs. If, however, an
extension defines `encodeParameters`, that should override the default
and set the request bodies for GET and DELETE methods, just like it does
for all the other HTTP methods.

* Don't use URL params by default with DELETE

* Re-enable skipped DELETE test

* Remove reference to DELETE in comment

* Add "useUrlParams" to requestConfig

* Add config.methodsThatUseUrlParams

* Add methodsThatUseUrlParams config tests

* Don't switch to body params based on extension
2023-07-10 15:52:01 -06:00
Vincent
1561a7daa2
Fix sse listener removal if element isn't in body anymore (#1484) 2023-06-30 11:25:37 -05:00
Vincent
714adc46e3
Encode as URL params for DELETE requests, instead of using body (#1513) 2023-06-24 14:27:13 -06:00
Alexander Petros
fe4a803e2e
Add logNone function and apply it to tests (#1504)
New function to turn off the logger after using `logAll()`. I applied to
this to the tests as well so that `logAll()` is only used in the specfic
places where debug output is required. This makes the console output of
the tests dramatically more useful when run from the command line.
2023-06-24 14:21:55 -06:00
Clint Checketts
f39c0be9b6 Include node as 'source' for preload so hx-sync/queue works properly 2023-06-19 10:58:21 -06:00
Alexander Petros
adef1166e2
Add support for hx-on:* attribute (#1489)
* Add support for hx-on:* attribute

* Use shorter XPath selector

* Add support for "hx-on::" shorthand

* Add note about mixing the two forms of `hx-on`
2023-06-13 09:23:16 -06:00
Denis Palashevskii
108d2b458a
Fix WebSocket extension trigger handlers initialization (#1468)
* fix websockets initialization to accomodate "haked hx-trigger"

* update changelog
2023-06-07 15:04:40 -06:00
Vincent
81ead8e39a
Fix inverted elt / target for sse selectAndSwap (#1483) 2023-06-07 15:04:06 -06:00
Tadej Stanic
19f8ee9b20
fix type in sse event (#1463) 2023-06-07 15:01:47 -06:00
Denis Palashevskii
c8568ea774
fix a bug with afterSettle event raised just once after multiple OOB swaps (#1474) 2023-06-07 15:00:25 -06:00
Carson Gross
ae19c18b20 Merge branch 'master' into dev
# Conflicts:
#	www/content/essays/hypermedia-on-whatever-youd-like.md
#	www/themes/htmx-theme/static/css/site.css
2023-06-03 14:20:16 -06:00
Mark Croxton
2bbe36301a
Allow time for browser to render layout restored from history cache before setting the cached scroll position. (#1344) 2023-05-23 09:54:09 -05:00
Christiaan B van Zyl
cbdbe1d858
Init (#1428) 2023-05-23 09:47:16 -05:00
Paweł Wilk
7fc5ac5074
response-targets extension with documentation, exposed 3 functions in internal API (#1436)
* findThisElement, getClosestAttributeValue, querySelectorExt exposed in internal API

* Added response-targets extension.

* Extra check for empty element in response-targets.js

* Added test/ext/response-targets.js

* Linked response-targets.md

* Added htmx.config.{responseTargetPrefersExisting, responseTargetPrefersRetargetHeader} configuration options

* Typo fixed (not impacting logic)
2023-05-23 09:46:54 -05:00
Eddie Cohen
d766c14aa6
Missing types 1.8.6 (#1324)
* add auto for scrollBehavior

* add swap to ajax
2023-05-11 16:13:32 -06:00
Carson Gross
1d146b103d disallow hx-on if allowEval is not true 2023-05-02 14:57:19 -06:00
Carson Gross
c96f01e81e bump verison + add this symbol in filter expressions 2023-05-02 14:52:54 -06:00
Carson Gross
9ee51a59ff fix https://github.com/bigskysoftware/htmx/issues/1413
properly clean up events from event handlers (also handle corner case where multiple listeners are added for the same even)
2023-04-28 11:38:42 -06:00
Carson Gross
6c0aa11f62 bump to 1.9.2 2023-04-28 11:28:12 -06:00
Carson Gross
8708fe26b7 fix bug where naked hx-triggers caused boosted forms w/ explicit hx-triggers to not fire 2023-04-26 12:04:06 -06:00
Carson Gross
d3d5155085 play nice w/ other software that uses window.onpopstate 2023-04-26 11:49:28 -06:00
Carson Gross
a807a5f08e bump version 2023-04-20 17:13:30 -06:00
Carson Gross
56ed5696e6 Merge branch 'master' into dev
# Conflicts:
#	www/attributes/hx-target.md
#	www/css/site.css
#	www/reference.md
#	www/themes/htmx-theme/templates/base.html
2023-04-11 10:05:27 -06:00
Carson Gross
110dd63e97 two small bug fixes:
* do not use template parsing for full body response content
* clear polling when reprocessing an element to avoid stacking up poll requests

latter fixes https://github.com/bigskysoftware/htmx/issues/1350
2023-04-11 09:32:52 -06:00
Carson Gross
7de777de6d Merge remote-tracking branch 'origin/dev' into dev 2023-04-05 12:48:07 -06:00
Carson Gross
6cc92bf12d fix https://github.com/bigskysoftware/htmx/issues/1348
properly trim ids in `hx-select-oob` and also support hyperscript-style query literals in attributes like `hx-target`
2023-04-05 12:47:51 -06:00
Ben Pate
4883aa830c
Merge pull request #1331 from hirschenberger/master
Trigger event when a SSE-source is opened
2023-04-02 08:09:50 -06:00
Nicolas Appriou
1e1b7cf94a
escape colons in querySelector (#1314)
thank you!
2023-04-01 17:36:15 -06:00
Mark Croxton
192df25b25
Normalize history cache keys - redux (#1338)
* Normalize URL used as a cache key for history, without breaking IE.

* Update test `boosted element hx-disinherit sanity check` to check that the fully resolved href of the boosted element matches request.detail.requestConfig.path
2023-04-01 08:02:08 -06:00
Carson Gross
5e12b33ed1 1.9.0 release prep 2023-03-31 07:07:34 -06:00
Carson Gross
b4e6c5cbd5 hx-on attribute 2023-03-31 06:44:01 -06:00
Carson Gross
2713a3ada0 Merge branch 'dev' into hx-on-experiment
# Conflicts:
#	src/htmx.js
#	test/scratch/scratch.html
2023-03-31 05:12:32 -06:00
Carson Gross
44dc3255af Merge remote-tracking branch 'origin/dev' into dev 2023-03-28 14:15:13 -06:00
Carson Gross
fd87ffd516 Experimental support for the [View Transitions API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) 2023-03-28 14:15:00 -06:00
Mark Croxton
8cd3a480a7
Nullify unreachable references to dom nodes inside setTimeout(), to allow garbage collection. (#1330) 2023-03-28 13:28:39 -06:00
Alexander Petros
5a5ebd7693
Add support for "naked" triggers and htmx:trigger event (#1327)
The `htmx:trigger` event is fired whenever an HTMX AJAX request would
be. Now, `hx-trigger` can also be specified on an element without an
AJAX request, which will simply fire the `htmx:trigger` event on the
action specified by the attribute, and do nothing else.

This pattern allows for specifying client-side actions that don't
require a network request, while remaining within the HTMX control
paradigm.
2023-03-28 09:14:16 -06:00
Carson Gross
a96189ed5e another take on generalized event handling w/ and hx-on attribute 2023-03-18 21:03:18 -06:00
Falco Hirschenberger
857095650f Trigger event when a SSE-source is opened
fixes #1325
2023-03-16 17:44:30 +01:00
Carson Gross
5de968e933 Merge branch 'master' into dev 2023-03-02 12:49:03 -07:00
Fredrik Vaeng Røtnes
03a286648d
Fix typo in comment (#1308) 2023-03-01 12:18:46 -07:00
Aral Balkan
f79fec8176
Fixes #1246: ws extension socketWrapper methods are undefined (#1247) 2023-02-24 11:03:45 -07:00
Epidiah Ravachol
a6701de473
class-tools extension only handling the last operation fix (#1258)
* fix class-tools issue

* Popped performOperation and toggleOperation out of processClassList
2023-02-24 11:02:51 -07:00
Carson Gross
f84029badb fix https://github.com/bigskysoftware/htmx/issues/1264
update target to result of `beforeSwap` event
2023-02-24 11:01:53 -07:00
Carson Gross
26bd4002d0 Merge remote-tracking branch 'origin/dev' into dev 2023-02-23 13:48:14 -07:00
Carson Gross
bed3d25d2c fix https://github.com/bigskysoftware/htmx/issues/1259
store initial value on init of event listener so first trigger has correct value to compare against
2023-02-23 13:48:05 -07:00