2021-12-21 19:09:24 +01:00
|
|
|
import { QueryParameters } from "./Logic/Web/QueryParameters"
|
2023-11-19 01:05:15 +01:00
|
|
|
import AllThemesGui from "./UI/AllThemesGui.svelte"
|
2021-12-21 19:09:24 +01:00
|
|
|
|
2024-10-17 04:06:03 +02:00
|
|
|
const theme = QueryParameters.GetQueryParameter("layout", undefined).data ?? ""
|
2021-12-21 19:09:24 +01:00
|
|
|
const customLayout = QueryParameters.GetQueryParameter("userlayout", undefined).data ?? ""
|
|
|
|
const l = window.location
|
2024-10-17 04:06:03 +02:00
|
|
|
if (theme !== "") {
|
2022-01-26 21:40:38 +01:00
|
|
|
if (window.location.host.startsWith("127.0.0.1")) {
|
|
|
|
window.location.replace(
|
|
|
|
l.protocol +
|
|
|
|
"//" +
|
|
|
|
window.location.host +
|
|
|
|
"/theme.html" +
|
|
|
|
l.search +
|
|
|
|
"&layout=" +
|
2024-10-17 04:06:03 +02:00
|
|
|
theme +
|
2022-01-26 21:40:38 +01:00
|
|
|
l.hash
|
2022-09-08 21:40:48 +02:00
|
|
|
)
|
2022-01-26 21:40:38 +01:00
|
|
|
} else {
|
|
|
|
window.location.replace(
|
2024-10-17 04:06:03 +02:00
|
|
|
l.protocol + "//" + window.location.host + "/" + theme + ".html" + l.search + l.hash
|
2022-09-08 21:40:48 +02:00
|
|
|
)
|
2022-01-14 01:41:19 +01:00
|
|
|
}
|
2022-01-26 21:40:38 +01:00
|
|
|
} else if (customLayout !== "") {
|
|
|
|
window.location.replace(
|
|
|
|
l.protocol + "//" + window.location.host + "/theme.html" + l.search + l.hash
|
2022-09-08 21:40:48 +02:00
|
|
|
)
|
2021-12-21 19:09:24 +01:00
|
|
|
}
|
|
|
|
|
2024-06-15 02:21:18 +02:00
|
|
|
new AllThemesGui({
|
2024-06-16 16:06:26 +02:00
|
|
|
target: document.getElementById("main"),
|
2024-06-15 02:21:18 +02:00
|
|
|
})
|