From e64238dba3113c2eabe26b1e9e9ba7fe29ba3010 Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 21 Mar 2024 23:06:44 +0100 Subject: Fix IE11 incompatibilities (#2408) --- src/htmx.js | 17 ++++++++++------- test/core/ajax.js | 10 ++++++++++ test/core/regressions.js | 10 ++++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/htmx.js b/src/htmx.js index 0e31707b..5620b45b 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -138,12 +138,12 @@ return (function () { /** * @param {string} tag - * @param {boolean} global + * @param {boolean} [global] * @returns {RegExp} */ - function makeTagRegEx(tag, global = false) { - return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`, - global ? 'gim' : 'im'); + function makeTagRegEx(tag, global) { + return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>', + !!global ? 'gim' : 'im') } function parseInterval(str) { @@ -1945,6 +1945,9 @@ return (function () { function shouldProcessHxOn(elt) { var attributes = elt.attributes + if (!attributes) { + return false + } for (var j = 0; j < attributes.length; j++) { var attrName = attributes[j].name if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") || @@ -1967,11 +1970,11 @@ return (function () { var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' + ' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt) while (node = iter.iterateNext()) elements.push(node) - } else { + } else if (typeof elt.getElementsByTagName === "function") { var allElements = elt.getElementsByTagName("*") for (var i = 0; i < allElements.length; i++) { - if (shouldProcessHxOn(allElements[i])) { - elements.push(allElements[i]) + if (shouldProcessHxOn(allElements[i])) { + elements.push(allElements[i]) } } } diff --git a/test/core/ajax.js b/test/core/ajax.js index 00e677df..58603e85 100644 --- a/test/core/ajax.js +++ b/test/core/ajax.js @@ -1237,6 +1237,11 @@ describe("Core htmx AJAX Tests", function(){ }) it('properly handles inputs external to form', function () { + if (!supportsFormAttribute()) { + this._runnable.title += " - Skipped as IE11 doesn't support form attribute" + this.skip() + return + } var values; this.server.respondWith("Post", "/test", function (xhr) { values = getParameters(xhr); @@ -1287,6 +1292,11 @@ describe("Core htmx AJAX Tests", function(){ }) it("can associate submit buttons from outside a form with the current version of the form after swap", function(){ + if (!supportsFormAttribute()) { + this._runnable.title += " - Skipped as IE11 doesn't support form attribute" + this.skip() + return + } const template = '
Date: Thu, 21 Mar 2024 17:01:40 -0600 Subject: set root --- www/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/config.toml b/www/config.toml index 9d695528..a15e0266 100644 --- a/www/config.toml +++ b/www/config.toml @@ -1,4 +1,4 @@ -base_url = "https://htmx.org" +base_url = "https://v1.htmx.org" title = " htmx - high power tools for html" theme = "htmx-theme" -- cgit v1.2.3 From 7dd6cd722437ab1f07b1328602ec2e301a6a0290 Mon Sep 17 00:00:00 2001 From: Carson Gross Date: Wed, 17 Apr 2024 10:48:55 -0600 Subject: prep v1.9.12 --- CHANGELOG.md | 6 +++++- README.md | 2 +- dist/htmx.js | 19 +++++++++++-------- dist/htmx.min.js | 2 +- dist/htmx.min.js.gz | Bin 15675 -> 15677 bytes package.json | 2 +- src/htmx.js | 2 +- www/content/_index.md | 2 +- www/content/docs.md | 2 +- www/content/extensions/_index.md | 2 +- www/content/extensions/ajax-header.md | 2 +- www/content/extensions/alpine-morph.md | 2 +- www/content/extensions/class-tools.md | 2 +- www/content/extensions/client-side-templates.md | 8 ++++---- www/content/extensions/debug.md | 2 +- www/content/extensions/disable-element.md | 2 +- www/content/extensions/event-header.md | 2 +- www/content/extensions/head-support.md | 2 +- www/content/extensions/include-vals.md | 2 +- www/content/extensions/json-enc.md | 2 +- www/content/extensions/loading-states.md | 2 +- www/content/extensions/method-override.md | 2 +- www/content/extensions/morphdom-swap.md | 2 +- www/content/extensions/multi-swap.md | 2 +- www/content/extensions/path-deps.md | 2 +- www/content/extensions/path-params.md | 2 +- www/content/extensions/preload.md | 2 +- www/content/extensions/remove-me.md | 2 +- www/content/extensions/response-targets.md | 2 +- www/content/extensions/restored.md | 2 +- www/content/extensions/server-sent-events.md | 2 +- www/content/extensions/web-sockets.md | 2 +- www/static/src/htmx.js | 19 +++++++++++-------- www/static/test/core/ajax.js | 10 ++++++++++ www/static/test/core/regressions.js | 10 ++++++++++ www/themes/htmx-theme/static/js/htmx.js | 19 +++++++++++-------- 36 files changed, 90 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96c04c58..64124681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -## [1.9.11] - 2024-04-15 +## [1.9.12] - 2024-04-17 + +* [IE Fixes](https://github.com/bigskysoftware/htmx/commit/e64238dba3113c2eabe26b1e9e9ba7fe29ba3010) + +## [1.9.11] - 2024-03-15 * Fix for new issue w/ web sockets & SSE on iOS 17.4 (thanks apple!) * Fix for double script execution issue when using template parsing diff --git a/README.md b/README.md index d7e16511..84defa94 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ By removing these arbitrary constraints htmx completes HTML as a ## quick start ```html - +