522 Commits

Author SHA1 Message Date
Aral Balkan
ee09ae7a51
Closes #1241: Add wsConnecting event (#1248)
* Closes #1241: Add wsConnecting event

* Remove redundant tests

(The separate tests for connecting, open, and close events are handled by the one lifecycle event test which both tests that the events are called as expected and in the order expected.)

* Add event.type to detail object of wsConnecting event

(This makes the event polymorphic for this property path with the other lifecycle events – wsOpen and wsClose – which proxy the underlying socket’s event object. This means all lifecycle events can be handled by one handler – e.g., a status indication function – if desired.)

* Minor: Add missing semicolon

* Document wsConnecting event

(And fix two tiny grammar issues.)
2023-02-23 07:23:50 -07:00
Carson Gross
704739d1f0 fix https://github.com/bigskysoftware/htmx/issues/1236
handle single quotes in ids properly by escaping them in selectors
2023-02-16 11:11:50 -07:00
Meet Rajesh Gor
503ed9527a
fix a typo in test-ws example (#1230) 2023-02-02 10:34:35 -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
666c6aa8e5 support clicking on elements within a button element as well as directly on the element itself.
based on https://github.com/bigskysoftware/htmx/pull/1168
2023-01-06 14:18:00 -07:00
Ben Beecher
546fba2776
Hotfix for swapping fields that don't support setSelectionRange (#1187)
* Hotfix for swapping fields that don't support setSelectionRange

* Fix test
2023-01-04 08:54:38 -07:00
Thomas Eizinger
899c454580
Actually pass original event on to htmx:configRequest (#1156)
* Add failing test

* Use all arguments of `handler`
2022-12-17 07:19:39 -06: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
Billy Keyes
8520f6f374
Fix handling of repeated empty inputs (#1144)
Native form handling submits repeated empty inputs as an array with an
empty value for each input, but htmx would only submit the first
non-empty input and any following inputs. Fix the value collection code
so that it correctly distinguishes between empty values and new inputs.
2022-12-02 09:35:59 -07:00
Carson Gross
90db47fbea bump version 2022-12-01 08:05:32 -07:00
Carson Gross
63b6dc018a Merge branch 'master' into dev 2022-12-01 08:01:22 -07:00
Carson Gross
71f1ff58b3 rework article 2022-11-24 05:03:02 -07:00
Denis Palashevskii
c87dc8a519
Fix loading-states event subscription to prevent saving loading states in history (#1116) 2022-11-09 10:32:45 -07:00
Carson Gross
28a96275a8 ie fix 2022-11-04 10:20:10 -06:00
Carson Gross
84d8e33deb fix tests 2022-10-30 13:49:29 -06:00
Carson Gross
d16cf3c9bb hook to allow for custom confirmation dialogs, etc. 2022-10-30 13:14:28 -06:00
Carson Gross
85338f4435 fix revealed issue 2022-10-30 13:05:03 -06:00
Carson Gross
6ec00b7bed update head-support.js 2022-10-28 10:17:27 -06:00
Carson Gross
fe4c002db9 maybe ios history bug 2022-10-27 08:51:04 -06:00
Carson Gross
5652c01635 maybe ios history bug 2022-10-27 08:50:50 -06:00
Carson Gross
ff8e146282 Merge branch 'master' into dev
# Conflicts:
#	www/extensions.md
2022-10-23 09:20:14 -06:00
Ján Regeš
34582b839c
extensions: added new extension 'multi-swap' with mocha tests and docs (#1096)
* extensions: added new extension 'multi-swap' with mocha tests and docs

* multi-swap extension: removed forgotten debug console.log()

* multi-swap extension: removed forgotten debug comment from mocha test
2022-10-23 08:59:03 -06:00
Carson Gross
accd55d4e8 document the new head-support extension 2022-10-18 13:39:07 -06:00
Carson Gross
9c74684881 rename 2022-10-15 09:35:55 -06:00
Carson Gross
418ce8e1e2 tighten up logic and trigger event w/ request info for better filtering possibilites 2022-10-13 14:42:03 -06:00
Carson Gross
c6c1395469 head-merge extension 2022-10-13 14:25:30 -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
Carson Gross
35d5fc8086 Merge branch 'feature_update_on_attribute_changes' into dev
# Conflicts:
#	CHANGELOG.md
#	www/essays/hypermedia-driven-applications.md
#	www/reference.md
2022-10-02 16:29:10 -06:00
Carson Gross
1dbb22b682 allow re-initialization if attributes change 2022-10-02 13:17:23 -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
dependabot[bot]
51653ee93b
Bump github.com/labstack/echo/v4 from 4.1.17 to 4.9.0 in /test/realtime (#1066)
Bumps [github.com/labstack/echo/v4](https://github.com/labstack/echo) from 4.1.17 to 4.9.0.
- [Release notes](https://github.com/labstack/echo/releases)
- [Changelog](https://github.com/labstack/echo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/labstack/echo/compare/v4.1.17...v4.9.0)

---
updated-dependencies:
- dependency-name: github.com/labstack/echo/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-30 14:01:04 -06:00
Carson Gross
4d1164c8e0 support the hx-validate attribute, when set to true an individual input will validate itself. 2022-08-23 19:04:46 -06:00
Carson Gross
892173c355 fix tests 2022-07-11 16:29:40 -06:00
Carson Gross
207889f283 fix tests 2022-07-11 16:16:33 -06:00
Carson Gross
7e7a5b4361 fix https://github.com/bigskysoftware/htmx/issues/827
keep local URL anchors along for the magical ride into the history API, and scroll to the target directly to avoid adding a junk history entry along the way

have i mentioned that I hate the javascript history API?
2022-07-11 13:34: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
mayowa
9eef783011
Implement HX-Reswap (#949)
* Document optional delay parameter for addClass, removeClass, remove

* Implement HX-Reswap (resolves #933)
2022-06-29 15:37:28 -06:00
Carson Gross
8e7a4bca27 Merge remote-tracking branch 'origin/dev' into dev 2022-05-31 13:30:42 -06:00
Carson Gross
05619c5bec support the hx-select-oob attribute 2022-05-31 13:30:34 -06:00
Ben Beecher
d51d8cb74c
Adding support for client side redirects - HX-Location (#832)
* Adding support for client side boosted redirects

* First pass at hx-boost-redirect

* Fixing some small documentation issues

* Rename boost-redirect to Location
2022-05-27 11:39:23 -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
Ben Pate
ca27475b7b Fix stylesheet in realtime tests
The stylesheet was preventing the "echo" test from working correctly.  WS messages were sent/received correctly, but the results could not be displayed because the container size was too small.  This patch allows the containers to grow, and display WS results correctly.
2022-04-18 14:09:30 -06:00
carson
3beec111b8 Merge remote-tracking branch 'origin/dev' into dev 2022-04-15 09:42:31 -06:00
carson
9e7d5e7939 attempt to reproduce https://github.com/bigskysoftware/htmx/issues/854 (unsuccessful so far) 2022-04-15 09:42:23 -06:00
David Guillot
be85c2c191
feat(ext): add disable-element extension (#869)
* feat(ext): add disable-element extension

* fixup! feat(ext): add disable-element extension
2022-04-08 13:13:03 -06:00