197 Commits

Author SHA1 Message Date
Carson Gross
af0dc9c352 add hx-disabled-elts functionality 2023-09-14 13:20:46 -06:00
Sascha Woo
81ac34994a
Support event names with "." character (#1453)
hx-on throws an error when used with event names that contain dots
2023-09-14 10:58:42 -06:00
Sascha Woo
f15795e79c
Allow hx-swap options to be used without specifying modifier (innerHTML remains the default) (#1455)
* hx-swap: make swap style optional

* hx-swap: log an error when an unknown option or modifier is used
2023-09-14 10:57:30 -06:00
Jacob Ebey
89f13e6cf2
Support formaction and formmethod on <button> (#1777) 2023-09-14 10:40:39 -06:00
Vincent
55c30b5607
Make htmx IE11 compatible again + tests IE11 compatible (#1687)
* Make htmx IE11 compatible again + tests IE11 compatible

* IE11 compatible handmade socket mock for ws-ext tests

* Fallback when xpath isn't supported, hx-on wildcard now working on IE11

* Merge remote-tracking branch 'upstream/relative-url-in-hx-boost' into ie11-compatibility
2023-09-06 09:55:18 -06:00
Alexander Petros
1763cfc64e
Use raw attribute href on hx-boost (#1742)
This resolves a bug when file system URLs are used on Windows. It
reverts part of a previous change where URLs were normalized prior to
the request in order to reduce key collisions in the history cache.
Because htmx's history cache is based entirely on response URLs, not
request URLs, I am reasonably confident that reverting this line doesn't
affect that optimization at all, but in any case it causes a bug which
is more important.
2023-09-06 09:54:43 -06:00
Carson Gross
c230931d42 support ability to ignore new title tags via config, event and hx-swap 2023-08-31 10:54:47 -06:00
Mark Gibson
94623d1129
Fix hx-on/hx-on:* to suppress evaluation if allowEval is false (#1682)
* Added more tests for allowEval=false

* Wrap hx-on event handlers in maybeEval

* Create and cache hx-on function on first event trigger.
2023-08-24 12:11:00 -06:00
Vincent
6d1adc853f
[Bugfix] Fix hx-trigger changed modifier along from clause (#1571)
Fix hx-trigger changed modifier along from clause #1565
2023-07-22 08:39:28 -06:00
Viktor Szépe
b085d89459
Fix assorted comment typos (#1590) 2023-07-17 11:36:04 -04: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
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
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
c98e254d87 add test for relative indicator definition 2023-04-26 12:06:06 -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
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
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
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
b4e6c5cbd5 hx-on attribute 2023-03-31 06:44:01 -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
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
Carson Gross
613f7b61d5 Support an opt-in cache-buster parameter that is sent up with htmx GET requests but that is stripped from the URL pushed into the browser's history 2023-01-08 17:35:07 -07:00
Carson Gross
30f762aa47 Merge branch 'master' into dev 2022-12-06 13:10:58 -07:00
Mark Croxton
4419bc4c90
History cache embargo (#1113)
* Add hx-history="false" to prevent sensitive or session data entering the localStorage cache

* Correctly get value of hx-history attribute.

* Add test for hx-history attribute.

* Allow history cache to be disabled when multiple `hx-history` attributes are present in a document, and any one of them is set to false.

* Add documentation for `hx-history` attribute.

* Add `hx-history` attribute to reference doc

* Correct the order of the `hx-history` attr in the reference doc.
2022-12-03 16:56:15 -06:00
Denis Palashevskii
36b017bc26
Add events support for WebSockets (#1126)
* Add events support for WebSockets

* Stop reconnection attempts after element has been removed

* Add tests for websockets

* Hide socker wrapper behind a more strict interface to avoid breaking changes in the future

* Fix legacy websocket tests interfering with new extension tests

* Minor doc fixes

* Add `wsBinaryType` configuration option
2022-12-03 16:53:59 -06:00
Carson Gross
84d8e33deb fix tests 2022-10-30 13:49:29 -06:00
Carson Gross
85338f4435 fix revealed issue 2022-10-30 13:05:03 -06:00
Carson Gross
9af34ce0e3 fix revealed bug 2022-10-12 22:46:02 -06:00
Carson Gross
cab3e352eb Merge remote-tracking branch 'origin/dev' into dev 2022-10-02 16:43:12 -06:00
Carson Gross
c1bf3fa686 keep a count on indicators so we only hide when no requests are in flight 2022-10-02 16:43:00 -06:00
Ben Lenton
c3662ce00d
Allow 'unset' directive for hx-vals and hx-vars (#1013)
* Allow 'unset' directive for hx-vals and hx-vars

* PR feedback

Co-authored-by: Ben Lenton <benlenton@Bens-MacBook-Air.local>
2022-09-30 14:08:46 -06:00
Carson Gross
892173c355 fix tests 2022-07-11 16:29:40 -06:00
Carson Gross
8b9585f439 flip revealed to be a normal event
this fixes an ugly bug introduced when the trigger logic was pulled out, where the handler of the first revealed element was used over and over again for any future elements that also were revealed.  many braincells lost mmm.
2022-07-08 13:54:25 -06:00
Carson Gross
05619c5bec support the hx-select-oob attribute 2022-05-31 13:30:34 -06:00
Carson Gross
742f05b9bd support filters on load event
fixes https://github.com/bigskysoftware/htmx/issues/752
2022-05-13 08:44:41 -06:00
Carson Gross
8290da624b support next and previous (taken from hyperscript) in target expressions
fixes https://github.com/bigskysoftware/htmx/issues/814
2022-05-13 08:14:38 -06:00
carson
ce260beb65 enable legacy web socket usage 2022-02-04 19:37:08 -07:00
carson
baa84e7803 get old sse syntax working 2022-02-04 19:16:13 -07:00
carson
051084af49 merge hx-disinherit and clean up target, etc. 2022-02-04 16:22:09 -07:00
carson
c7f4f360d1 Merge branch 'dev' into pull/753
# Conflicts:
#	src/htmx.js
2022-02-04 11:16:59 -07:00
alfonsrv
bce4baa20c Rename hx-inherit to hx-disinherit 2022-01-25 23:27:39 +01:00
carson
f524901d5e Merge branch 'hx-sync-implementation' into dev 2022-01-25 08:06:34 -07:00
carson
cd6d2b78e2 convert objects to JSON representation
fixes https://github.com/bigskysoftware/htmx/issues/772
2022-01-18 20:21:26 -07:00
carson
e6751be2ee first pass at hx-sync attribute 2022-01-17 13:11:09 -07:00
carson
2707016f01 support this in hx-include and hx-indicator
fixes

https://github.com/bigskysoftware/htmx/issues/757
https://github.com/bigskysoftware/htmx/issues/767
2022-01-17 10:45:59 -07:00
carson
636fd1b902 fix tests + add test for https://github.com/bigskysoftware/htmx/pull/214 2022-01-14 12:54:28 -07:00
alfonsrv
d025afe49f hx-inherit tests x documentation 2022-01-06 14:45:12 +01:00
alfonsrv
fb78c826d1 Adding preliminary hx-inherit tests 2022-01-05 23:50:13 +01:00
Arham Jain
5045534d26 added two simple tests for delete mode 2021-11-24 21:23:35 -05:00