ZDDC/mdedit/js
ZDDC 2aa29d1ec4 fix(mdedit): root file tree at <project>/working/ even with no trailing slash
mdedit's loadServerDirectory derived its file-tree root by stripping
back to the last "/" in window.location.href. For a no-trailing-slash
canonical URL (<project>/working) that gave the wrong root: the parent
project directory rather than working/ itself. Visible symptom on
zddc-server's auto-served URLs after the recent dispatcher changes —
mdedit at /Project/working would show the project's archive, working,
staging, etc. all together instead of being sandboxed to working/.

Detect the directory-shaped URL by checking whether the last path
segment contains "." (file marker). No dot = directory; treat the
whole path as the root and append the trailing slash internally.

  /Project/working          → root /Project/working/  (was /Project/)
  /Project/working/x/y/     → root /Project/working/x/y/ (unchanged)
  /Project/x/mdedit.html    → root /Project/x/  (file URL; unchanged)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 22:34:11 -05:00
..
app.js chore(headers): standardize across all 7 tools 2026-05-04 07:49:17 -05:00
editor.js refactor(mdedit): drop window.* TOC globals, call functions directly 2026-05-09 18:39:10 -05:00
events.js refactor(mdedit): drop window.* TOC globals, call functions directly 2026-05-09 18:39:10 -05:00
file-ops.js Initial commit 2026-04-27 11:05:47 -05:00
file-system.js fix(mdedit): root file tree at <project>/working/ even with no trailing slash 2026-05-09 22:34:11 -05:00
file-tree.js feat(server): authenticated CRUD + verb-based RBAC with WORM archive folders 2026-05-05 15:58:04 -05:00
front-matter.js Initial commit 2026-04-27 11:05:47 -05:00
main.js chore(headers): standardize across all 7 tools 2026-05-04 07:49:17 -05:00
resizer.js feat(tools,build): in-flight HTML-tool reworks and build-infra updates 2026-04-29 12:52:27 -05:00
toc.js refactor(mdedit): drop window.* TOC globals, call functions directly 2026-05-09 18:39:10 -05:00
utils.js feat(tools,build): in-flight HTML-tool reworks and build-infra updates 2026-04-29 12:52:27 -05:00