migrate stage build to native elc; chat restores from localStorage on return
Build pipeline - build-stage.sh replaces the old in-Dockerfile bootstrap.py path. Host pre-compiles src/*.el into dist/main.c via the canonical native elc at foundation/el/dist/platform/elc and applies the stub-decl sed before docker buildx runs. - Dockerfile.stage drops bootstrap.py + python3 from the builder stage and just runs cc on the host-supplied dist/main.c. - Pre-rendered HTML shells under /srv/landing/ are now chowned to the landing user so the El page-builder's fs_write at startup can rewrite them — without that, post-COPY edits never reach the served HTML and the served page stays as the stale build-time fallback. Chat restore - session.verified + session.verifiedAt persist through localStorage so a return visit within 24h skips the Turnstile gate and lands directly in the restored conversation. - restoreOrGreet() is the single source of truth for what shows up in the message pane after the gate clears: replays prior messages with skipSave, else drops the canned hello once and remembers it. - applyVerifiedDom() hides the gate / reveals the chat row, called both from the verified-on-load path (DOMContentLoaded if loading, else immediate) and from the Turnstile callback. - neuronDemoReset clears verified + verifiedAt so the gate returns next open. Extracted JS assets (src/assets/js/*.js + manifest.json) and the extract-js.py helper land here too — they match what the new build-stage flow produces and removes the inline <script> blobs from the served HTML.
This commit is contained in:
+1
-58
@@ -52,63 +52,6 @@ fn nav() -> String {
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var btn = document.getElementById('nav-hamburger');
|
||||
var menu = document.getElementById('nav-mobile');
|
||||
var nav = document.getElementById('nav');
|
||||
if (!btn || !menu) return;
|
||||
|
||||
function close() {
|
||||
menu.classList.remove('open');
|
||||
btn.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
function open() {
|
||||
menu.classList.add('open');
|
||||
btn.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
function toggle() {
|
||||
if (menu.classList.contains('open')) { close(); } else { open(); }
|
||||
}
|
||||
|
||||
btn.addEventListener('click', function(e) { e.stopPropagation(); toggle(); });
|
||||
|
||||
// Dropdown — Mission
|
||||
var ddBtn = document.querySelector('.nav-dropdown-btn');
|
||||
var dd = document.querySelector('.nav-dropdown');
|
||||
if (ddBtn && dd) {
|
||||
ddBtn.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
var isOpen = dd.classList.contains('open');
|
||||
dd.classList.toggle('open');
|
||||
ddBtn.setAttribute('aria-expanded', isOpen ? 'false' : 'true');
|
||||
});
|
||||
dd.querySelectorAll('.nav-dropdown-item').forEach(function(a) {
|
||||
a.addEventListener('click', function() { dd.classList.remove('open'); });
|
||||
});
|
||||
document.addEventListener('click', function() { dd.classList.remove('open'); });
|
||||
}
|
||||
|
||||
// Close on any link inside mobile menu
|
||||
menu.querySelectorAll('a').forEach(function(a) {
|
||||
a.addEventListener('click', close);
|
||||
});
|
||||
|
||||
// Close when clicking outside
|
||||
document.addEventListener('click', function(e) {
|
||||
if (!nav.contains(e.target)) { close(); }
|
||||
});
|
||||
|
||||
// Close on Escape
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape') { close(); }
|
||||
});
|
||||
|
||||
// Close if viewport grows past breakpoint
|
||||
window.addEventListener('resize', function() {
|
||||
if (window.innerWidth > 1060) { close(); }
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<script src=\"/assets/js/529d45d105c9.js\" defer></script>
|
||||
"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user