Bundles a stretch of in-progress work across the SPA tools so the
tree returns to a coherent shippable state ahead of cutting a new
zddc-server stable image:
- landing: substantial rework of the project picker (sortable/filterable
table, presets refactor, ?projects= filter, ?v= channel propagation,
loading/error states)
- archive: presets cleanup, source.js refactor, filtering/url-state
alignment with the landing page
- mdedit: file-system module split, resizer, file-tree improvements,
base/toc styling tweaks
- transmittal/classifier: small template touch-ups for shared chrome
- shared: build-lib.sh helpers, new favicon.svg
- bootstrap, build.sh: pick up the channel-aware install/track zip
generation
- tests: new landing.spec.js, expanded archive/mdedit/build-label specs
- docs: CLAUDE.md picks up the zddc-server section and freshens the
alpha-build exception note
- regenerated artifacts: install.zip, track-{alpha,beta,stable}.zip,
*_alpha.html — these are produced by `sh build.sh` and per project
convention are committed alongside the source changes
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
50 lines
1.8 KiB
JavaScript
50 lines
1.8 KiB
JavaScript
/**
|
|
* Application initialization
|
|
*/
|
|
|
|
// Initialize when DOM is loaded
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
// Check File System API availability and update UI
|
|
initializeApiAvailability();
|
|
|
|
setupEventListeners();
|
|
initializeFileNavResizer();
|
|
setupTocDepthSelector();
|
|
startFileChangeMonitoring();
|
|
|
|
// Show scratchpad in file tree on startup
|
|
renderFileTree();
|
|
|
|
// Always start with scratchpad selected and loaded
|
|
openScratchpad();
|
|
const scratchpadEl = document.querySelector(`.file-item[data-path="${SCRATCHPAD_ID}"]`);
|
|
if (scratchpadEl) scratchpadEl.classList.add('active-file');
|
|
|
|
// In server (HTTP) mode, fetch and render the current directory subtree.
|
|
if (location.protocol === 'http:' || location.protocol === 'https:') {
|
|
loadServerDirectory().catch((err) => {
|
|
if (DEBUG) console.warn('Server directory load failed:', err);
|
|
});
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Initialize UI based on File System API availability
|
|
*/
|
|
function initializeApiAvailability() {
|
|
const selectDirectoryBtn = document.getElementById('select-directory');
|
|
const welcomeHint = document.getElementById('welcome-hint');
|
|
const welcomeFirefox = document.getElementById('welcome-firefox');
|
|
|
|
if (!hasFileSystemAccess) {
|
|
// Disable file system buttons in Firefox and other unsupported browsers
|
|
if (selectDirectoryBtn) {
|
|
selectDirectoryBtn.disabled = true;
|
|
selectDirectoryBtn.title = 'File System API not supported in this browser';
|
|
}
|
|
// Show Firefox warning, hide normal hint
|
|
if (welcomeHint) welcomeHint.classList.add('hidden');
|
|
if (welcomeFirefox) welcomeFirefox.classList.remove('hidden');
|
|
|
|
}
|
|
}
|