-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
85 lines (79 loc) · 3.33 KB
/
Copy pathindex.html
File metadata and controls
85 lines (79 loc) · 3.33 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, max-age=0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="description" content="SP42 Wikipedia patrolling workbench." />
<link rel="manifest" href="/manifest.json" />
<link rel="icon" href="/icons/sp42-icon-192.svg" />
<link rel="apple-touch-icon" href="/icons/sp42-icon-192.svg" />
<script>
// Restore the saved Codex theme before first paint to avoid a flash.
// Mirrors sp42_ui::theme (localStorage key "sp42-theme"). Dark is default.
(function () {
try {
if (localStorage.getItem("sp42-theme") === "light") {
document.documentElement.setAttribute("data-theme", "light");
}
} catch (_) {}
})();
</script>
<title>SP42</title>
<link data-trunk rel="rust" href="crates/sp42-app/Cargo.toml" data-target-name="sp42_app" data-wasm-opt="0" />
<link data-trunk rel="copy-file" href="crates/sp42-ui/static/manifest.json" />
<link data-trunk rel="copy-file" href="crates/sp42-app/static/sw.js" />
<link data-trunk rel="copy-file" href="crates/sp42-ui/static/offline.html" />
<link data-trunk rel="copy-dir" href="crates/sp42-ui/static/icons" />
<link data-trunk rel="css" href="crates/sp42-ui/static/style.css" />
<script src="/runtime-config.js"></script>
<script>
(async () => {
const isLocalhost =
location.hostname === "127.0.0.1" || location.hostname === "localhost";
if (!isLocalhost || !("serviceWorker" in navigator) || !("caches" in window)) {
return;
}
const cacheResetKey = "sp42-localhost-cache-reset";
try {
const registrations = await navigator.serviceWorker.getRegistrations();
const hadRegistrations = registrations.length > 0;
await Promise.all(registrations.map((registration) => registration.unregister()));
const cacheNames = await caches.keys();
const hadCaches = cacheNames.length > 0;
await Promise.all(cacheNames.map((cacheName) => caches.delete(cacheName)));
if ((hadRegistrations || hadCaches) && !sessionStorage.getItem(cacheResetKey)) {
sessionStorage.setItem(cacheResetKey, "1");
location.reload();
return;
}
} catch (_) {
// Local dev should keep booting even if cache cleanup fails.
}
sessionStorage.removeItem(cacheResetKey);
})();
window.addEventListener("TrunkApplicationStarted", () => {
document.getElementById("sp42-loading-shell")?.remove();
});
</script>
</head>
<body>
<div id="sp42-app-root"></div>
<main id="sp42-loading-shell" class="sp42-loading-shell">
<section class="sp42-loading-card">
<h1>SP42</h1>
<p><strong>Booting patrol workbench…</strong></p>
<p>
The browser shell mounts here once the Rust/Wasm bundle is ready. Run the
localhost server on <code>127.0.0.1:8788</code> for auth, coordination,
and debug surfaces.
</p>
</section>
</main>
</body>
</html>