diff --git a/public/scripts/autoDownload.js b/public/scripts/autoDownload.js deleted file mode 100644 index 908ac72..0000000 --- a/public/scripts/autoDownload.js +++ /dev/null @@ -1,12 +0,0 @@ -function ready(fn) { - if (document.readyState != "loading") { - fn(); - } else { - document.addEventListener("DOMContentLoaded", fn); - } -} -ready(main); - -function main() { - generateZIP(window.targetDeviceId); -} diff --git a/src/pages/download/_autoDownload.ts b/src/pages/download/_autoDownload.ts new file mode 100644 index 0000000..e99aadf --- /dev/null +++ b/src/pages/download/_autoDownload.ts @@ -0,0 +1,13 @@ +export function readyForAutoDownload(fn: () => void): void { + if (document.readyState != "loading") { + fn(); + } else { + document.addEventListener("DOMContentLoaded", fn); + } +} + +export function mainForAutoDownload(): void { + generateZIP((window as any).targetDeviceId); +} + +readyForAutoDownload(mainForAutoDownload); diff --git a/src/pages/download.astro b/src/pages/download/index.astro similarity index 93% rename from src/pages/download.astro rename to src/pages/download/index.astro index ecd0acb..474005a 100644 --- a/src/pages/download.astro +++ b/src/pages/download/index.astro @@ -1,7 +1,7 @@ --- -import BaseLayout from "../layouts/BaseLayout.astro"; -import "/src/styles/download.css"; -import ErrorPage from "../components/ErrorPage.astro"; +import BaseLayout from "../../layouts/BaseLayout.astro"; +import ErrorPage from "../../components/ErrorPage.astro"; +import "./index.css"; --- + -