blob: 3e55141739f5679158676c960e6992e1a4f18577 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright Epic Games, Inc. All Rights Reserved.
"use strict";
import { Component } from "./util/component.js"
////////////////////////////////////////////////////////////////////////////////
function display_error(message, stack)
{
const pane = new Component(document.body).tag().id("error");
pane.tag().text("!");
const content = pane.tag();
content.tag("pre").text(message);
content.tag("pre").text(stack);
}
window.addEventListener("error", function(evt) {
const reason = evt.error;
display_error(reason.message, reason.stack);
});
window.addEventListener("unhandledrejection", function(evt) {
const reason = evt.reason;
display_error(reason.message, reason.stack);
});
////////////////////////////////////////////////////////////////////////////////
async function main()
{
const body = new Component(document.body);
const root = body.tag().id("container").tag();
const params = new URLSearchParams(window.location.search);
var page = params.get("page") || "start";
page = page.replaceAll(".", "");
page = page.replaceAll("/", "");
page = page.replaceAll("\\", "");
root.id(page);
const module = await import(`./pages/${page}.js`);
new module.Page(root, params).main();
}
main();
|