From 9fb3c0e492c8f44d0d997ef63a6276af18c65d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 15 Jul 2025 01:38:39 +0200 Subject: [PATCH] Fix variable names (#3344) * Fix variable names * Fix one more variable name --- TESTING.md | 2 +- editors/jetbrains/htmx.web-types.json | 6 +++--- test/attributes/hx-swap-oob.js | 2 +- www/content/_index.md | 2 +- www/content/events.md | 6 +++--- www/static/test/attributes/hx-swap-oob.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/TESTING.md b/TESTING.md index df00be3c..7edb8e53 100644 --- a/TESTING.md +++ b/TESTING.md @@ -10,7 +10,7 @@ This guide outlines how to test htmx, focusing on running tests headlessly or in npm install npm run test ``` -During test runs it will auto install playwrite +During test runs it will auto install playwright ## Running All Tests diff --git a/editors/jetbrains/htmx.web-types.json b/editors/jetbrains/htmx.web-types.json index 81a04442..88eb5da9 100644 --- a/editors/jetbrains/htmx.web-types.json +++ b/editors/jetbrains/htmx.web-types.json @@ -431,12 +431,12 @@ }, { "name": "historyCacheHit", - "description": "This event is triggered when a cache hit occurs when restoring history\n\nYou can prevent the history restoration via `preventDefault()` to allow alternative restore handling.\nYou can also override the details of the history restoration request in this event if required\n\n##### Details\n\n* `detail.historyElt` - the history element or body that will get replaced\n* `detail.item.content` - the content of the cache that will be swapped in\n* `detail.item.title` - the page title to update from the cache\n* `detail.path` - the path and query of the page being restored\n* `detial.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML'\n\n", + "description": "This event is triggered when a cache hit occurs when restoring history\n\nYou can prevent the history restoration via `preventDefault()` to allow alternative restore handling.\nYou can also override the details of the history restoration request in this event if required\n\n##### Details\n\n* `detail.historyElt` - the history element or body that will get replaced\n* `detail.item.content` - the content of the cache that will be swapped in\n* `detail.item.title` - the page title to update from the cache\n* `detail.path` - the path and query of the page being restored\n* `detail.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML'\n\n", "doc-url": "https://htmx.org/events/#htmx:historyCacheHit" }, { "name": "historyCacheMiss", - "description": "This event is triggered when a cache miss occurs when restoring history\n\nYou can prevent the history restoration via `preventDefault()` to allow alternative restore handling.\nYou can also modify the xhr request or other details before it makes the the request to restore history\n\n##### Details\n\n* `detail.historyElt` - the history element or body that will get replaced\n* `detail.xhr` - the `XMLHttpRequest` that will retrieve the remote content for restoration\n* `detail.path` - the path and query of the page being restored\n* `detial.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML'\n\n", + "description": "This event is triggered when a cache miss occurs when restoring history\n\nYou can prevent the history restoration via `preventDefault()` to allow alternative restore handling.\nYou can also modify the xhr request or other details before it makes the the request to restore history\n\n##### Details\n\n* `detail.historyElt` - the history element or body that will get replaced\n* `detail.xhr` - the `XMLHttpRequest` that will retrieve the remote content for restoration\n* `detail.path` - the path and query of the page being restored\n* `detail.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML'\n\n", "doc-url": "https://htmx.org/events/#htmx:historyCacheMiss" }, { @@ -446,7 +446,7 @@ }, { "name": "historyCacheMissLoad", - "description": "This event is triggered when a cache miss occurs and a response has been retrieved successfully from the server\nfor the content to restore\n\nYou can modify the details before it makes the swap to restore the history\n\n##### Details\n\n* `detail.historyElt` - the history element or body that will get replaced\n* `detail.xhr` - the `XMLHttpRequest`\n* `detail.path` - the path and query of the page being restored\n* `detail.response` - the response text that will be swapped in\n* `detial.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML'\n\n", + "description": "This event is triggered when a cache miss occurs and a response has been retrieved successfully from the server\nfor the content to restore\n\nYou can modify the details before it makes the swap to restore the history\n\n##### Details\n\n* `detail.historyElt` - the history element or body that will get replaced\n* `detail.xhr` - the `XMLHttpRequest`\n* `detail.path` - the path and query of the page being restored\n* `detail.response` - the response text that will be swapped in\n* `detail.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML'\n\n", "doc-url": "https://htmx.org/events/#htmx:historyCacheMissLoad" }, { diff --git a/test/attributes/hx-swap-oob.js b/test/attributes/hx-swap-oob.js index 875c4d45..4acf5fe8 100644 --- a/test/attributes/hx-swap-oob.js +++ b/test/attributes/hx-swap-oob.js @@ -349,7 +349,7 @@ describe('hx-swap-oob attribute', function() { } it.skip('triggers htmx:oobErrorNoTarget when no targets found', function(done) { - // this test fails right now because when targets not found it returns an empty array which makes it miss the event as it should be if (targets.lenght) + // this test fails right now because when targets not found it returns an empty array which makes it miss the event as it should be if (targets.length) this.server.respondWith('GET', '/test', "Clicked
Swapped
") var div = make('
click me
') diff --git a/www/content/_index.md b/www/content/_index.md index 020f2897..2668946d 100644 --- a/www/content/_index.md +++ b/www/content/_index.md @@ -258,7 +258,7 @@ Thank you to all our generous Tracebit Cloud Canaries - Tracebit Cloud Canaries + Tracebit Cloud Canaries
diff --git a/www/content/events.md b/www/content/events.md index 47aa460f..0c3657e4 100644 --- a/www/content/events.md +++ b/www/content/events.md @@ -275,7 +275,7 @@ You can also override the details of the history restoration request in this eve * `detail.item.content` - the content of the cache that will be swapped in * `detail.item.title` - the page title to update from the cache * `detail.path` - the path and query of the page being restored -* `detial.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML' +* `detail.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML' ### Event - `htmx:historyCacheMiss` {#htmx:historyCacheMiss} @@ -289,7 +289,7 @@ You can also modify the xhr request or other details before it makes the the req * `detail.historyElt` - the history element or body that will get replaced * `detail.xhr` - the `XMLHttpRequest` that will retrieve the remote content for restoration * `detail.path` - the path and query of the page being restored -* `detial.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML' +* `detail.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML' ### Event - `htmx:historyCacheMissLoadError` {#htmx:historyCacheMissLoadError} @@ -314,7 +314,7 @@ You can modify the details before it makes the swap to restore the history * `detail.xhr` - the `XMLHttpRequest` * `detail.path` - the path and query of the page being restored * `detail.response` - the response text that will be swapped in -* `detial.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML' +* `detail.swapSpec` - the swapSpec to be used containing the defatul swapStyle='innerHTML' ### Event - `htmx:historyRestore` {#htmx:historyRestore} diff --git a/www/static/test/attributes/hx-swap-oob.js b/www/static/test/attributes/hx-swap-oob.js index 875c4d45..4acf5fe8 100644 --- a/www/static/test/attributes/hx-swap-oob.js +++ b/www/static/test/attributes/hx-swap-oob.js @@ -349,7 +349,7 @@ describe('hx-swap-oob attribute', function() { } it.skip('triggers htmx:oobErrorNoTarget when no targets found', function(done) { - // this test fails right now because when targets not found it returns an empty array which makes it miss the event as it should be if (targets.lenght) + // this test fails right now because when targets not found it returns an empty array which makes it miss the event as it should be if (targets.length) this.server.respondWith('GET', '/test', "Clicked
Swapped
") var div = make('
click me
')