ZDDC/bootstrap/level2.html.tmpl
ZDDC ea385b5366 Initial commit
ZDDC — Zero Day Document Control. A file-naming convention plus five
single-file HTML tools (archive, transmittal, classifier, mdedit,
landing) and an optional Go HTTP server (zddc-server) with ACL and a
virtual archive index. Self-contained, offline-capable, dependency-free.

See README.md for an overview, AGENTS.md and ARCHITECTURE.md for the
build/release/architecture detail, bootstrap/README.md for the
two-level deployment install pattern, and zddc/README.md for the
HTTP server.
2026-04-27 11:05:47 -05:00

50 lines
1.8 KiB
Cheetah

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Loading {{TOOL_TITLE}}…</title>
<style>html,body{margin:0;font:14px system-ui,sans-serif;color:#666;padding:1rem}</style>
</head>
<body>
Loading…
<script>
// Level-2 bootstrap. Fetches {{TOOL}} from zddc.varasys.io and
// document.write()s it in place. The default upstream is the
// {{CHANNEL}} channel; the URL parameter ?v= overrides it:
//
// ?v=alpha|beta|latest switches to that channel
// ?v=0.0.4 (or v0.0.4) pins to that exact stable version
// (none) uses the {{CHANNEL}} default
//
// Requires zddc.varasys.io to serve Access-Control-Allow-Origin: *.
(async function () {
const params = new URLSearchParams(location.search);
const v = params.get('v');
const tool = '{{TOOL}}';
const defaultChannel = '{{CHANNEL}}';
const channels = { alpha: '_alpha', beta: '_beta', latest: '_latest', stable: '_latest' };
function suffixFor(value) {
if (!value) return '_' + defaultChannel;
if (value in channels) return channels[value];
const ver = value.startsWith('v') ? value.slice(1) : value;
return '_v' + ver;
}
const upstream = 'https://zddc.varasys.io/releases/' + tool + suffixFor(v) + '.html';
try {
const resp = await fetch(upstream, { cache: 'no-cache', credentials: 'omit' });
if (!resp.ok) throw new Error(resp.status + ' ' + resp.statusText);
const html = await resp.text();
document.open();
document.write(html);
document.close();
} catch (err) {
document.body.textContent = 'Failed to load from ' + upstream + ': ' + err.message;
}
})();
</script>
</body>
</html>