htmx.org 2.0.0-beta3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +0,0 @@
1
- if (htmx.version && !htmx.version.startsWith("1.")) {
2
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
3
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
4
- }
5
- htmx.defineExtension('alpine-morph', {
6
- isInlineSwap: function (swapStyle) {
7
- return swapStyle === 'morph';
8
- },
9
- handleSwap: function (swapStyle, target, fragment) {
10
- if (swapStyle === 'morph') {
11
- if (fragment.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
12
- Alpine.morph(target, fragment.firstElementChild);
13
- return [target];
14
- } else {
15
- Alpine.morph(target, fragment.outerHTML);
16
- return [target];
17
- }
18
- }
19
- }
20
- });
@@ -1,97 +0,0 @@
1
- (function () {
2
-
3
- if (htmx.version && !htmx.version.startsWith("1.")) {
4
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
5
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
6
- }
7
-
8
- function splitOnWhitespace(trigger) {
9
- return trigger.split(/\s+/);
10
- }
11
-
12
- function parseClassOperation(trimmedValue) {
13
- var split = splitOnWhitespace(trimmedValue);
14
- if (split.length > 1) {
15
- var operation = split[0];
16
- var classDef = split[1].trim();
17
- var cssClass;
18
- var delay;
19
- if (classDef.indexOf(":") > 0) {
20
- var splitCssClass = classDef.split(':');
21
- cssClass = splitCssClass[0];
22
- delay = htmx.parseInterval(splitCssClass[1]);
23
- } else {
24
- cssClass = classDef;
25
- delay = 100;
26
- }
27
- return {
28
- operation: operation,
29
- cssClass: cssClass,
30
- delay: delay
31
- }
32
- } else {
33
- return null;
34
- }
35
- }
36
-
37
- function performOperation(elt, classOperation, classList, currentRunTime) {
38
- setTimeout(function () {
39
- elt.classList[classOperation.operation].call(elt.classList, classOperation.cssClass);
40
- }, currentRunTime)
41
- }
42
-
43
- function toggleOperation(elt, classOperation, classList, currentRunTime) {
44
- setTimeout(function () {
45
- setInterval(function () {
46
- elt.classList[classOperation.operation].call(elt.classList, classOperation.cssClass);
47
- }, classOperation.delay);
48
- }, currentRunTime)
49
- }
50
-
51
- function processClassList(elt, classList) {
52
- var runs = classList.split("&");
53
- for (var i = 0; i < runs.length; i++) {
54
- var run = runs[i];
55
- var currentRunTime = 0;
56
- var classOperations = run.split(",");
57
- for (var j = 0; j < classOperations.length; j++) {
58
- var value = classOperations[j];
59
- var trimmedValue = value.trim();
60
- var classOperation = parseClassOperation(trimmedValue);
61
- if (classOperation) {
62
- if (classOperation.operation === "toggle") {
63
- toggleOperation(elt, classOperation, classList, currentRunTime);
64
- currentRunTime = currentRunTime + classOperation.delay;
65
- } else {
66
- currentRunTime = currentRunTime + classOperation.delay;
67
- performOperation(elt, classOperation, classList, currentRunTime);
68
- }
69
- }
70
- }
71
- }
72
- }
73
-
74
- function maybeProcessClasses(elt) {
75
- if (elt.getAttribute) {
76
- var classList = elt.getAttribute("classes") || elt.getAttribute("data-classes");
77
- if (classList) {
78
- processClassList(elt, classList);
79
- }
80
- }
81
- }
82
-
83
- htmx.defineExtension('class-tools', {
84
- onEvent: function (name, evt) {
85
- if (name === "htmx:afterProcessNode") {
86
- var elt = evt.detail.elt;
87
- maybeProcessClasses(elt);
88
- if (elt.querySelectorAll) {
89
- var children = elt.querySelectorAll("[classes], [data-classes]");
90
- for (var i = 0; i < children.length; i++) {
91
- maybeProcessClasses(children[i]);
92
- }
93
- }
94
- }
95
- }
96
- });
97
- })();
@@ -1,100 +0,0 @@
1
- if (htmx.version && !htmx.version.startsWith("1.")) {
2
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
3
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
4
- }
5
- htmx.defineExtension('client-side-templates', {
6
- transformResponse : function(text, xhr, elt) {
7
-
8
- var mustacheTemplate = htmx.closest(elt, "[mustache-template]");
9
- if (mustacheTemplate) {
10
- var data = JSON.parse(text);
11
- var templateId = mustacheTemplate.getAttribute('mustache-template');
12
- var template = htmx.find("#" + templateId);
13
- if (template) {
14
- return Mustache.render(template.innerHTML, data);
15
- } else {
16
- throw "Unknown mustache template: " + templateId;
17
- }
18
- }
19
-
20
- var mustacheArrayTemplate = htmx.closest(elt, "[mustache-array-template]");
21
- if (mustacheArrayTemplate) {
22
- var data = JSON.parse(text);
23
- var templateId = mustacheArrayTemplate.getAttribute('mustache-array-template');
24
- var template = htmx.find("#" + templateId);
25
- if (template) {
26
- return Mustache.render(template.innerHTML, {"data": data });
27
- } else {
28
- throw "Unknown mustache template: " + templateId;
29
- }
30
- }
31
-
32
- var handlebarsTemplate = htmx.closest(elt, "[handlebars-template]");
33
- if (handlebarsTemplate) {
34
- var data = JSON.parse(text);
35
- var templateId = handlebarsTemplate.getAttribute('handlebars-template');
36
- var templateElement = htmx.find('#' + templateId).innerHTML;
37
- var renderTemplate = Handlebars.compile(templateElement);
38
- if (renderTemplate) {
39
- return renderTemplate(data);
40
- } else {
41
- throw "Unknown handlebars template: " + templateId;
42
- }
43
- }
44
-
45
- var handlebarsArrayTemplate = htmx.closest(elt, "[handlebars-array-template]");
46
- if (handlebarsArrayTemplate) {
47
- var data = JSON.parse(text);
48
- var templateId = handlebarsArrayTemplate.getAttribute('handlebars-array-template');
49
- var templateElement = htmx.find('#' + templateId).innerHTML;
50
- var renderTemplate = Handlebars.compile(templateElement);
51
- if (renderTemplate) {
52
- return renderTemplate(data);
53
- } else {
54
- throw "Unknown handlebars template: " + templateId;
55
- }
56
- }
57
-
58
- var nunjucksTemplate = htmx.closest(elt, "[nunjucks-template]");
59
- if (nunjucksTemplate) {
60
- var data = JSON.parse(text);
61
- var templateName = nunjucksTemplate.getAttribute('nunjucks-template');
62
- var template = htmx.find('#' + templateName);
63
- if (template) {
64
- return nunjucks.renderString(template.innerHTML, data);
65
- } else {
66
- return nunjucks.render(templateName, data);
67
- }
68
- }
69
-
70
- var xsltTemplate = htmx.closest(elt, "[xslt-template]");
71
- if (xsltTemplate) {
72
- var templateId = xsltTemplate.getAttribute('xslt-template');
73
- var template = htmx.find("#" + templateId);
74
- if (template) {
75
- var content = template.innerHTML ? new DOMParser().parseFromString(template.innerHTML, 'application/xml')
76
- : template.contentDocument;
77
- var processor = new XSLTProcessor();
78
- processor.importStylesheet(content);
79
- var data = new DOMParser().parseFromString(text, "application/xml");
80
- var frag = processor.transformToFragment(data, document);
81
- return new XMLSerializer().serializeToString(frag);
82
- } else {
83
- throw "Unknown XSLT template: " + templateId;
84
- }
85
- }
86
-
87
- var nunjucksArrayTemplate = htmx.closest(elt, "[nunjucks-array-template]");
88
- if (nunjucksArrayTemplate) {
89
- var data = JSON.parse(text);
90
- var templateName = nunjucksArrayTemplate.getAttribute('nunjucks-array-template');
91
- var template = htmx.find('#' + templateName);
92
- if (template) {
93
- return nunjucks.renderString(template.innerHTML, {"data": data});
94
- } else {
95
- return nunjucks.render(templateName, {"data": data});
96
- }
97
- }
98
- return text;
99
- }
100
- });
package/dist/ext/debug.js DELETED
@@ -1,15 +0,0 @@
1
- if (htmx.version && !htmx.version.startsWith("1.")) {
2
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
3
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
4
- }
5
- htmx.defineExtension('debug', {
6
- onEvent: function (name, evt) {
7
- if (console.debug) {
8
- console.debug(name, evt);
9
- } else if (console) {
10
- console.log("DEBUG:", name, evt);
11
- } else {
12
- throw "NO CONSOLE SUPPORTED"
13
- }
14
- }
15
- });
@@ -1,20 +0,0 @@
1
- if (htmx.version && !htmx.version.startsWith("1.")) {
2
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
3
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
4
- }
5
- // Disable Submit Button
6
- htmx.defineExtension('disable-element', {
7
- onEvent: function (name, evt) {
8
- let elt = evt.detail.elt;
9
- let target = elt.getAttribute("hx-disable-element");
10
- let targetElements = (target == "self") ? [ elt ] : document.querySelectorAll(target);
11
-
12
- for (var i = 0; i < targetElements.length; i++) {
13
- if (name === "htmx:beforeRequest" && targetElements[i]) {
14
- targetElements[i].disabled = true;
15
- } else if (name == "htmx:afterRequest" && targetElements[i]) {
16
- targetElements[i].disabled = false;
17
- }
18
- }
19
- }
20
- });
@@ -1,41 +0,0 @@
1
- (function(){
2
- if (htmx.version && !htmx.version.startsWith("1.")) {
3
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
4
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
5
- }
6
- function stringifyEvent(event) {
7
- var obj = {};
8
- for (var key in event) {
9
- obj[key] = event[key];
10
- }
11
- return JSON.stringify(obj, function(key, value){
12
- if(value instanceof Node){
13
- var nodeRep = value.tagName;
14
- if (nodeRep) {
15
- nodeRep = nodeRep.toLowerCase();
16
- if(value.id){
17
- nodeRep += "#" + value.id;
18
- }
19
- if(value.classList && value.classList.length){
20
- nodeRep += "." + value.classList.toString().replace(" ", ".")
21
- }
22
- return nodeRep;
23
- } else {
24
- return "Node"
25
- }
26
- }
27
- if (value instanceof Window) return 'Window';
28
- return value;
29
- });
30
- }
31
-
32
- htmx.defineExtension('event-header', {
33
- onEvent: function (name, evt) {
34
- if (name === "htmx:configRequest") {
35
- if (evt.detail.triggeringEvent) {
36
- evt.detail.headers['Triggering-Event'] = stringifyEvent(evt.detail.triggeringEvent);
37
- }
38
- }
39
- }
40
- });
41
- })();
@@ -1,146 +0,0 @@
1
- //==========================================================
2
- // head-support.js
3
- //
4
- // An extension to htmx 1.0 to add head tag merging.
5
- //==========================================================
6
- (function(){
7
-
8
- if (htmx.version && !htmx.version.startsWith("1.")) {
9
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
10
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
11
- }
12
-
13
- var api = null;
14
-
15
- function log() {
16
- //console.log(arguments);
17
- }
18
-
19
- function mergeHead(newContent, defaultMergeStrategy) {
20
-
21
- if (newContent && newContent.indexOf('<head') > -1) {
22
- const htmlDoc = document.createElement("html");
23
- // remove svgs to avoid conflicts
24
- var contentWithSvgsRemoved = newContent.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim, '');
25
- // extract head tag
26
- var headTag = contentWithSvgsRemoved.match(/(<head(\s[^>]*>|>)([\s\S]*?)<\/head>)/im);
27
-
28
- // if the head tag exists...
29
- if (headTag) {
30
-
31
- var added = []
32
- var removed = []
33
- var preserved = []
34
- var nodesToAppend = []
35
-
36
- htmlDoc.innerHTML = headTag;
37
- var newHeadTag = htmlDoc.querySelector("head");
38
- var currentHead = document.head;
39
-
40
- if (newHeadTag == null) {
41
- return;
42
- } else {
43
- // put all new head elements into a Map, by their outerHTML
44
- var srcToNewHeadNodes = new Map();
45
- for (const newHeadChild of newHeadTag.children) {
46
- srcToNewHeadNodes.set(newHeadChild.outerHTML, newHeadChild);
47
- }
48
- }
49
-
50
-
51
-
52
- // determine merge strategy
53
- var mergeStrategy = api.getAttributeValue(newHeadTag, "hx-head") || defaultMergeStrategy;
54
-
55
- // get the current head
56
- for (const currentHeadElt of currentHead.children) {
57
-
58
- // If the current head element is in the map
59
- var inNewContent = srcToNewHeadNodes.has(currentHeadElt.outerHTML);
60
- var isReAppended = currentHeadElt.getAttribute("hx-head") === "re-eval";
61
- var isPreserved = api.getAttributeValue(currentHeadElt, "hx-preserve") === "true";
62
- if (inNewContent || isPreserved) {
63
- if (isReAppended) {
64
- // remove the current version and let the new version replace it and re-execute
65
- removed.push(currentHeadElt);
66
- } else {
67
- // this element already exists and should not be re-appended, so remove it from
68
- // the new content map, preserving it in the DOM
69
- srcToNewHeadNodes.delete(currentHeadElt.outerHTML);
70
- preserved.push(currentHeadElt);
71
- }
72
- } else {
73
- if (mergeStrategy === "append") {
74
- // we are appending and this existing element is not new content
75
- // so if and only if it is marked for re-append do we do anything
76
- if (isReAppended) {
77
- removed.push(currentHeadElt);
78
- nodesToAppend.push(currentHeadElt);
79
- }
80
- } else {
81
- // if this is a merge, we remove this content since it is not in the new head
82
- if (api.triggerEvent(document.body, "htmx:removingHeadElement", {headElement: currentHeadElt}) !== false) {
83
- removed.push(currentHeadElt);
84
- }
85
- }
86
- }
87
- }
88
-
89
- // Push the tremaining new head elements in the Map into the
90
- // nodes to append to the head tag
91
- nodesToAppend.push(...srcToNewHeadNodes.values());
92
- log("to append: ", nodesToAppend);
93
-
94
- for (const newNode of nodesToAppend) {
95
- log("adding: ", newNode);
96
- var newElt = document.createRange().createContextualFragment(newNode.outerHTML);
97
- log(newElt);
98
- if (api.triggerEvent(document.body, "htmx:addingHeadElement", {headElement: newElt}) !== false) {
99
- currentHead.appendChild(newElt);
100
- added.push(newElt);
101
- }
102
- }
103
-
104
- // remove all removed elements, after we have appended the new elements to avoid
105
- // additional network requests for things like style sheets
106
- for (const removedElement of removed) {
107
- if (api.triggerEvent(document.body, "htmx:removingHeadElement", {headElement: removedElement}) !== false) {
108
- currentHead.removeChild(removedElement);
109
- }
110
- }
111
-
112
- api.triggerEvent(document.body, "htmx:afterHeadMerge", {added: added, kept: preserved, removed: removed});
113
- }
114
- }
115
- }
116
-
117
- htmx.defineExtension("head-support", {
118
- init: function(apiRef) {
119
- // store a reference to the internal API.
120
- api = apiRef;
121
-
122
- htmx.on('htmx:afterSwap', function(evt){
123
- var serverResponse = evt.detail.xhr.response;
124
- if (api.triggerEvent(document.body, "htmx:beforeHeadMerge", evt.detail)) {
125
- mergeHead(serverResponse, evt.detail.boosted ? "merge" : "append");
126
- }
127
- })
128
-
129
- htmx.on('htmx:historyRestore', function(evt){
130
- if (api.triggerEvent(document.body, "htmx:beforeHeadMerge", evt.detail)) {
131
- if (evt.detail.cacheMiss) {
132
- mergeHead(evt.detail.serverResponse, "merge");
133
- } else {
134
- mergeHead(evt.detail.item.head, "merge");
135
- }
136
- }
137
- })
138
-
139
- htmx.on('htmx:historyItemCreated', function(evt){
140
- var historyItem = evt.detail.item;
141
- historyItem.head = document.head.outerHTML;
142
- })
143
- }
144
- });
145
-
146
- })()
@@ -1,28 +0,0 @@
1
- (function(){
2
- if (htmx.version && !htmx.version.startsWith("1.")) {
3
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
4
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
5
- }
6
-
7
- function mergeObjects(obj1, obj2) {
8
- for (var key in obj2) {
9
- if (obj2.hasOwnProperty(key)) {
10
- obj1[key] = obj2[key];
11
- }
12
- }
13
- return obj1;
14
- }
15
-
16
- htmx.defineExtension('include-vals', {
17
- onEvent: function (name, evt) {
18
- if (name === "htmx:configRequest") {
19
- var includeValsElt = htmx.closest(evt.detail.elt, "[include-vals],[data-include-vals]");
20
- if (includeValsElt) {
21
- var includeVals = includeValsElt.getAttribute("include-vals") || includeValsElt.getAttribute("data-include-vals");
22
- var valuesToInclude = eval("({" + includeVals + "})");
23
- mergeObjects(evt.detail.parameters, valuesToInclude);
24
- }
25
- }
26
- }
27
- });
28
- })();
@@ -1,16 +0,0 @@
1
- if (htmx.version && !htmx.version.startsWith("1.")) {
2
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
3
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
4
- }
5
- htmx.defineExtension('json-enc', {
6
- onEvent: function (name, evt) {
7
- if (name === "htmx:configRequest") {
8
- evt.detail.headers['Content-Type'] = "application/json";
9
- }
10
- },
11
-
12
- encodeParameters : function(xhr, parameters, elt) {
13
- xhr.overrideMimeType('text/json');
14
- return (JSON.stringify(parameters));
15
- }
16
- });
@@ -1,189 +0,0 @@
1
- ;(function () {
2
-
3
- if (htmx.version && !htmx.version.startsWith("1.")) {
4
- console.warn("WARNING: You are using an htmx 1 extension with htmx " + htmx.version +
5
- ". It is recommended that you move to the version of this extension found on https://extensions.htmx.org")
6
- }
7
-
8
- let loadingStatesUndoQueue = []
9
-
10
- function loadingStateContainer(target) {
11
- return htmx.closest(target, '[data-loading-states]') || document.body
12
- }
13
-
14
- function mayProcessUndoCallback(target, callback) {
15
- if (document.body.contains(target)) {
16
- callback()
17
- }
18
- }
19
-
20
- function mayProcessLoadingStateByPath(elt, requestPath) {
21
- const pathElt = htmx.closest(elt, '[data-loading-path]')
22
- if (!pathElt) {
23
- return true
24
- }
25
-
26
- return pathElt.getAttribute('data-loading-path') === requestPath
27
- }
28
-
29
- function queueLoadingState(sourceElt, targetElt, doCallback, undoCallback) {
30
- const delayElt = htmx.closest(sourceElt, '[data-loading-delay]')
31
- if (delayElt) {
32
- const delayInMilliseconds =
33
- delayElt.getAttribute('data-loading-delay') || 200
34
- const timeout = setTimeout(function () {
35
- doCallback()
36
-
37
- loadingStatesUndoQueue.push(function () {
38
- mayProcessUndoCallback(targetElt, undoCallback)
39
- })
40
- }, delayInMilliseconds)
41
-
42
- loadingStatesUndoQueue.push(function () {
43
- mayProcessUndoCallback(targetElt, function () { clearTimeout(timeout) })
44
- })
45
- } else {
46
- doCallback()
47
- loadingStatesUndoQueue.push(function () {
48
- mayProcessUndoCallback(targetElt, undoCallback)
49
- })
50
- }
51
- }
52
-
53
- function getLoadingStateElts(loadingScope, type, path) {
54
- return Array.from(htmx.findAll(loadingScope, "[" + type + "]")).filter(
55
- function (elt) { return mayProcessLoadingStateByPath(elt, path) }
56
- )
57
- }
58
-
59
- function getLoadingTarget(elt) {
60
- if (elt.getAttribute('data-loading-target')) {
61
- return Array.from(
62
- htmx.findAll(elt.getAttribute('data-loading-target'))
63
- )
64
- }
65
- return [elt]
66
- }
67
-
68
- htmx.defineExtension('loading-states', {
69
- onEvent: function (name, evt) {
70
- if (name === 'htmx:beforeRequest') {
71
- const container = loadingStateContainer(evt.target)
72
-
73
- const loadingStateTypes = [
74
- 'data-loading',
75
- 'data-loading-class',
76
- 'data-loading-class-remove',
77
- 'data-loading-disable',
78
- 'data-loading-aria-busy',
79
- ]
80
-
81
- let loadingStateEltsByType = {}
82
-
83
- loadingStateTypes.forEach(function (type) {
84
- loadingStateEltsByType[type] = getLoadingStateElts(
85
- container,
86
- type,
87
- evt.detail.pathInfo.requestPath
88
- )
89
- })
90
-
91
- loadingStateEltsByType['data-loading'].forEach(function (sourceElt) {
92
- getLoadingTarget(sourceElt).forEach(function (targetElt) {
93
- queueLoadingState(
94
- sourceElt,
95
- targetElt,
96
- function () {
97
- targetElt.style.display =
98
- sourceElt.getAttribute('data-loading') ||
99
- 'inline-block' },
100
- function () { targetElt.style.display = 'none' }
101
- )
102
- })
103
- })
104
-
105
- loadingStateEltsByType['data-loading-class'].forEach(
106
- function (sourceElt) {
107
- const classNames = sourceElt
108
- .getAttribute('data-loading-class')
109
- .split(' ')
110
-
111
- getLoadingTarget(sourceElt).forEach(function (targetElt) {
112
- queueLoadingState(
113
- sourceElt,
114
- targetElt,
115
- function () {
116
- classNames.forEach(function (className) {
117
- targetElt.classList.add(className)
118
- })
119
- },
120
- function() {
121
- classNames.forEach(function (className) {
122
- targetElt.classList.remove(className)
123
- })
124
- }
125
- )
126
- })
127
- }
128
- )
129
-
130
- loadingStateEltsByType['data-loading-class-remove'].forEach(
131
- function (sourceElt) {
132
- const classNames = sourceElt
133
- .getAttribute('data-loading-class-remove')
134
- .split(' ')
135
-
136
- getLoadingTarget(sourceElt).forEach(function (targetElt) {
137
- queueLoadingState(
138
- sourceElt,
139
- targetElt,
140
- function () {
141
- classNames.forEach(function (className) {
142
- targetElt.classList.remove(className)
143
- })
144
- },
145
- function() {
146
- classNames.forEach(function (className) {
147
- targetElt.classList.add(className)
148
- })
149
- }
150
- )
151
- })
152
- }
153
- )
154
-
155
- loadingStateEltsByType['data-loading-disable'].forEach(
156
- function (sourceElt) {
157
- getLoadingTarget(sourceElt).forEach(function (targetElt) {
158
- queueLoadingState(
159
- sourceElt,
160
- targetElt,
161
- function() { targetElt.disabled = true },
162
- function() { targetElt.disabled = false }
163
- )
164
- })
165
- }
166
- )
167
-
168
- loadingStateEltsByType['data-loading-aria-busy'].forEach(
169
- function (sourceElt) {
170
- getLoadingTarget(sourceElt).forEach(function (targetElt) {
171
- queueLoadingState(
172
- sourceElt,
173
- targetElt,
174
- function () { targetElt.setAttribute("aria-busy", "true") },
175
- function () { targetElt.removeAttribute("aria-busy") }
176
- )
177
- })
178
- }
179
- )
180
- }
181
-
182
- if (name === 'htmx:beforeOnLoad') {
183
- while (loadingStatesUndoQueue.length > 0) {
184
- loadingStatesUndoQueue.shift()()
185
- }
186
- }
187
- },
188
- })
189
- })()