Dynamically inject epoxy, libcurl, and bare transport.

This commit is contained in:
wearrrrr 2024-03-29 12:55:58 -05:00
parent 52005fd480
commit 52af3fed5d

View file

@ -12,9 +12,6 @@ export function getStaticPaths() {
--- ---
<Layout title={t("pages.home")}> <Layout title={t("pages.home")}>
<script src="/libcurl/index.js" is:inline></script>
<script src="/epoxy/index.js" is:inline></script>
<script src="/bare_transport.js" is:inline></script>
<div class="main-content"> <div class="main-content">
<h1 class="title-text">{t("menu.welcome")}</h1> <h1 class="title-text">{t("menu.welcome")}</h1>
<div class="form-wrapper"> <div class="form-wrapper">
@ -74,8 +71,29 @@ export function getStaticPaths() {
TransportMgr.setTransport(parsedTransport.value); TransportMgr.setTransport(parsedTransport.value);
} }
initTransport(); initTransport();
// Inject Epoxy, Libcurl, and Bare scripts into the DOM
let epoxyScript = document.createElement("script");
epoxyScript.src = "/epoxy/index.js";
document.body.appendChild(epoxyScript);
let libcurlScript = document.createElement("script");
libcurlScript.src = "/libcurl/index.js";
document.body.appendChild(libcurlScript);
let bareTransportScript = document.createElement("script");
bareTransportScript.src = "/bare_transport.js";
document.body.appendChild(bareTransportScript);
}); });
initTransport(); initTransport();
// Inject Epoxy, Libcurl, and Bare scripts into the DOM
let epoxyScript = document.createElement("script");
epoxyScript.src = "/epoxy/index.js";
document.body.appendChild(epoxyScript);
let libcurlScript = document.createElement("script");
libcurlScript.src = "/libcurl/index.js";
document.body.appendChild(libcurlScript);
let bareTransportScript = document.createElement("script");
bareTransportScript.src = "/bare_transport.js";
document.body.appendChild(bareTransportScript);
type Suggestion = { type Suggestion = {
phrase: string; phrase: string;
}; };