From 94323ea356883e06520b6d4c04b454e291706fce Mon Sep 17 00:00:00 2001 From: ZDDC Date: Sat, 9 May 2026 22:34:24 -0500 Subject: [PATCH] chore(embedded): cut v0.0.17-beta --- zddc/internal/apps/embedded/archive.html | 2 +- zddc/internal/apps/embedded/browse.html | 2 +- zddc/internal/apps/embedded/classifier.html | 2 +- zddc/internal/apps/embedded/index.html | 2 +- zddc/internal/apps/embedded/mdedit.html | 35 ++++++++++++++++++-- zddc/internal/apps/embedded/transmittal.html | 2 +- zddc/internal/apps/embedded/versions.txt | 16 ++++----- zddc/internal/handler/tables.html | 2 +- 8 files changed, 46 insertions(+), 17 deletions(-) diff --git a/zddc/internal/apps/embedded/archive.html b/zddc/internal/apps/embedded/archive.html index 6009207..07facb6 100644 --- a/zddc/internal/apps/embedded/archive.html +++ b/zddc/internal/apps/embedded/archive.html @@ -2245,7 +2245,7 @@ td[data-field="trackingNumber"] {
ZDDC Archive - v0.0.17-beta · 2026-05-10 · rock-cliff-boat + v0.0.17-beta · 2026-05-10 · fox-berry-prism
diff --git a/zddc/internal/apps/embedded/browse.html b/zddc/internal/apps/embedded/browse.html index 5e914b6..2fd71c5 100644 --- a/zddc/internal/apps/embedded/browse.html +++ b/zddc/internal/apps/embedded/browse.html @@ -947,7 +947,7 @@ body {
ZDDC Browse - v0.0.17-beta · 2026-05-10 · rock-cliff-boat + v0.0.17-beta · 2026-05-10 · fox-berry-prism
diff --git a/zddc/internal/apps/embedded/classifier.html b/zddc/internal/apps/embedded/classifier.html index 1a84641..e08b19b 100644 --- a/zddc/internal/apps/embedded/classifier.html +++ b/zddc/internal/apps/embedded/classifier.html @@ -1464,7 +1464,7 @@ body.help-open .app-header {
ZDDC Classifier - v0.0.17-beta · 2026-05-10 · rock-cliff-boat + v0.0.17-beta · 2026-05-10 · fox-berry-prism
diff --git a/zddc/internal/apps/embedded/index.html b/zddc/internal/apps/embedded/index.html index 352add9..529e959 100644 --- a/zddc/internal/apps/embedded/index.html +++ b/zddc/internal/apps/embedded/index.html @@ -988,7 +988,7 @@ body {
ZDDC - v0.0.17-beta · 2026-05-10 · rock-cliff-boat + v0.0.17-beta · 2026-05-10 · fox-berry-prism
diff --git a/zddc/internal/apps/embedded/mdedit.html b/zddc/internal/apps/embedded/mdedit.html index 3fcff20..1053afa 100644 --- a/zddc/internal/apps/embedded/mdedit.html +++ b/zddc/internal/apps/embedded/mdedit.html @@ -1903,7 +1903,7 @@ body.help-open .app-header {
ZDDC Markdown - v0.0.17-beta · 2026-05-10 · rock-cliff-boat + v0.0.17-beta · 2026-05-10 · fox-berry-prism
@@ -4990,9 +4990,38 @@ async function readServerDirectory(dirUrl, parentNode, depth) { async function loadServerDirectory() { if (!(location.protocol === 'http:' || location.protocol === 'https:')) return; + // Compute the directory URL the file tree should be rooted at. + // + // /working/ → root = /working/ + // /working/x/y/ → root = /working/x/y/ + // /working → root = /working/ (no-slash + // canonical-folder URL — the dispatcher + // routes mdedit here directly without + // a redirect, so we infer "directory" + // from the absence of a `.` in the + // last segment rather than stripping + // back to the parent.) + // /x/y/mdedit.html → root = /x/y/ (the leaf + // segment IS a file; strip to parent.) + // + // The rule: if the last path segment contains a "." it's a file, + // strip it; otherwise treat the whole path as the directory. let href = window.location.href.split('?')[0].split('#')[0]; - const lastSlash = href.lastIndexOf('/'); - const baseUrl = (lastSlash >= 0) ? href.substring(0, lastSlash + 1) : href + '/'; + let baseUrl; + if (href.endsWith('/')) { + baseUrl = href; + } else { + const lastSlash = href.lastIndexOf('/'); + const lastSeg = lastSlash >= 0 ? href.substring(lastSlash + 1) : href; + if (lastSeg.indexOf('.') !== -1) { + // Looks like a file (has an extension) — strip to parent. + baseUrl = lastSlash >= 0 ? href.substring(0, lastSlash + 1) : href + '/'; + } else { + // Looks like a directory — append the trailing slash so all + // subsequent listing URLs are computed correctly. + baseUrl = href + '/'; + } + } // Only enter server-source mode if the host actually serves JSON directory // listings (zddc-server / Caddy). On a plain static host the probe fails diff --git a/zddc/internal/apps/embedded/transmittal.html b/zddc/internal/apps/embedded/transmittal.html index 80f0f46..5d19fc0 100644 --- a/zddc/internal/apps/embedded/transmittal.html +++ b/zddc/internal/apps/embedded/transmittal.html @@ -2263,7 +2263,7 @@ dialog.modal--narrow {
ZDDC Transmittal - v0.0.17-beta · 2026-05-10 · rock-cliff-boat + v0.0.17-beta · 2026-05-10 · fox-berry-prism
JavaScript not available