* Fix return type for htmx.ajax
* Add `@returns` statement to `htmx.ajax` types
* Make issueAjaxRequest return types consistent
The function now always returns a `Promise`.
It will be resolved when the request completes, or when it naturally
wasn't sent.
It will be rejected, when the return statement is preceeded by a call to
`triggerErrorEvent`.
* 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
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.
If HTMX is imported in a module the readyState is "interactive"
so the extension processing happens too late. This would fix it.
Co-authored-by: Dave Syer <david_syer@hotmail.com>
* Fix submit buttons/inputs handling
* Removed useless concatenation
* Don't initNode links and forms that shouldn't be initialized
* Removed selectors filtering to alleviate PR
* Add @1cg 's addValueToValues function to factor code
* Use formValues variable for clicked button's value including
* 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
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.
* 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`