attempt at playing nice with the insanity of javascript loaders

This commit is contained in:
carson 2020-05-24 22:00:33 -07:00
parent cbe8cd9fce
commit 7092576aad
7 changed files with 62 additions and 17 deletions

25
dist/htmx.js vendored
View File

@ -1,5 +1,14 @@
// noinspection JSUnusedAssignment
var htmx = htmx || (function () {
//AMD insanity
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else {
// Browser globals
root.htmx = factory();
}
}(typeof self !== 'undefined' ? self : this, function () {
return (function () {
'use strict';
var VERBS = ['get', 'post', 'put', 'delete', 'patch'];
@ -565,7 +574,9 @@ var htmx = htmx || (function () {
if (ignoreBoostedAnchorCtrlClick(elt, evt)) {
return;
}
if(explicitCancel || shouldCancel(elt)) {}evt.preventDefault();
if(explicitCancel || shouldCancel(elt)){
evt.preventDefault();
}
var eventData = getInternalData(evt);
var elementData = getInternalData(elt);
if (!eventData.handled) {
@ -688,12 +699,15 @@ var htmx = htmx || (function () {
});
if (webSocketSourceElt) {
var webSocket = getInternalData(webSocketSourceElt).webSocket;
elt.addEventListener(eventName, function () {
elt.addEventListener(eventName, function (evt) {
var headers = getHeaders(elt, webSocketSourceElt, null, elt);
var rawParameters = getInputValues(elt, 'post');
var filteredParameters = filterValues(rawParameters, elt);
filteredParameters['HEADERS'] = headers;
webSocket.send(JSON.stringify(filteredParameters));
if(shouldCancel(elt)){
evt.preventDefault();
}
});
} else {
triggerErrorEvent(elt, "noWebSocketSourceError.htmx");
@ -1511,4 +1525,5 @@ var htmx = htmx || (function () {
_:internalEval
}
}
)();
)()
}));

2
dist/htmx.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/htmx.min.js.gz vendored

Binary file not shown.

View File

@ -1,5 +1,14 @@
// noinspection JSUnusedAssignment
var htmx = htmx || (function () {
//AMD insanity
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else {
// Browser globals
root.htmx = factory();
}
}(typeof self !== 'undefined' ? self : this, function () {
return (function () {
'use strict';
var VERBS = ['get', 'post', 'put', 'delete', 'patch'];
@ -1516,4 +1525,5 @@ var htmx = htmx || (function () {
_:internalEval
}
}
)();
)()
}));

View File

@ -1,5 +1,14 @@
// noinspection JSUnusedAssignment
var htmx = htmx || (function () {
//AMD insanity
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else {
// Browser globals
root.htmx = factory();
}
}(typeof self !== 'undefined' ? self : this, function () {
return (function () {
'use strict';
var VERBS = ['get', 'post', 'put', 'delete', 'patch'];
@ -1516,4 +1525,5 @@ var htmx = htmx || (function () {
_:internalEval
}
}
)();
)()
}));

View File

@ -1,5 +1,14 @@
// noinspection JSUnusedAssignment
var htmx = htmx || (function () {
//AMD insanity
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else {
// Browser globals
root.htmx = factory();
}
}(typeof self !== 'undefined' ? self : this, function () {
return (function () {
'use strict';
var VERBS = ['get', 'post', 'put', 'delete', 'patch'];
@ -1516,4 +1525,5 @@ var htmx = htmx || (function () {
_:internalEval
}
}
)();
)()
}));

View File

@ -132,9 +132,9 @@ describe("hx-trigger attribute", function(){
}
for (var specString in specExamples) {
it("parses " + specString + "`, function()
it("parses " + specString, function()
{
var div = make("<div hx-trigger=" + specString + "></div>`);
var div = make("<div hx-trigger=" + specString + "></div>");
var spec = htmx._('getTriggerSpecs')(div);
spec.should.deep.equal(specExamples[specString]);
});