diff --git a/frontend/src/application/htmx.js b/frontend/src/application/htmx.js index 4759e0a..443eb54 100644 --- a/frontend/src/application/htmx.js +++ b/frontend/src/application/htmx.js @@ -2,47 +2,19 @@ import htmx from "htmx.org"; import _hyperscript from 'hyperscript.org/dist/_hyperscript.min'; import Alpine from "alpinejs"; import mask from '@alpinejs/mask'; + +window.htmx = htmx; window.Alpine = Alpine; Alpine.start(); Alpine.plugin(mask); _hyperscript.browserInit(); -let modalEle = document.getElementById("modal"); - -if (modalEle) { - const modal = new bootstrap.Modal(modalEle); // eslint-disable-line no-undef - - htmx.on("htmx:beforeSwap", (e) => { - // Empty response targeting #dialog => hide the modal - if (e.detail.target.id === "dialog" && !e.detail.xhr.response) { - modal.hide(); - e.detail.shouldSwap = false; - } - }); - - htmx.on("hidden.bs.modal", () => { - document.getElementById("dialog").innerHTML = ""; - }); -} - const successAudio = new Audio("/static/sounds/success.mp3"); const popAudio = new Audio("/static/sounds/pop.mp3"); window.paidSound = successAudio; window.unpaidSound = popAudio; -// htmx.on("paid", () => { -// successAudio.pause(); -// successAudio.currentTime = 0; -// successAudio.play(); -// }); -// -// htmx.on("unpaid", () => { -// popAudio.pause(); -// popAudio.currentTime = 0; -// popAudio.play(); -// }); - /** * Parse a localized number to a float. * @param {string} stringNumber - the localized number