forked from pietervdvn/MapComplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall_themes_index.ts
22 lines (18 loc) · 943 Bytes
/
all_themes_index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import {Utils} from "./Utils";
import AllThemesGui from "./UI/AllThemesGui";
import {QueryParameters} from "./Logic/Web/QueryParameters";
const layout = QueryParameters.GetQueryParameter("layout", undefined).data ?? ""
const customLayout = QueryParameters.GetQueryParameter("userlayout", undefined).data ?? ""
const l = window.location;
if (layout !== "") {
if (window.location.host.startsWith("127.0.0.1")) {
window.location.replace(l.protocol + "//" + window.location.host + "/theme.html" + l.search + "&layout=" + layout + l.hash);
} else {
window.location.replace(l.protocol + "//" + window.location.host + "/" + layout + ".html" + l.search + l.hash);
}
} else if (customLayout !== "") {
window.location.replace(l.protocol + "//" + window.location.host + "/theme.html" + l.search + l.hash);
}
Utils.DisableLongPresses()
document.getElementById("decoration-desktop").remove();
new AllThemesGui().setup();