Nettleseren støtter ikke mappevalg
' +
+ 'Bruk paste-import nedenfor for å laste inn ' +
+ '
';
+ var main = document.getElementById('main-content');
+ if (main) main.insertBefore(warn, main.firstChild);
+ return;
+ }
+
+ // Click-delegation: clicking the visible button programmatically clicks the hidden input.
+ document.addEventListener('click', function (e) {
+ var btn = e.target && e.target.closest && e.target.closest('[data-action="open-project-picker"]');
+ if (!btn) return;
+ e.preventDefault();
+ input.click();
+ });
+
+ // Change-handler: derive basePath from first file's webkitRelativePath.
+ input.addEventListener('change', function (e) {
+ var files = e.target.files;
+ if (!files || !files.length) return;
+ var first = files[0].webkitRelativePath || '';
+ var basePath = first.split('/')[0] || '';
+ if (typeof loadProjectDirectory === 'function') {
+ loadProjectDirectory(files, basePath);
+ } else {
+ // Step 13 not yet wired — log-only fallback for incremental delivery.
+ try { console.log('[voyage] project-loader: ' + files.length + ' files in ' + basePath); } catch (_) {}
+ }
+ });
+ }
+
// ---- v4.3 Step 9 — renderPageShell --------------------------------
// Universal page-header for dashboard + artifact-detail flater.
// Returns an HTML string wrapping body content with DS Tier 3
@@ -1589,6 +1646,10 @@ playground first-run shows a complete round-trip-able artifact.
// Step 8 (v4.3) — initial topbar render with single-crumb (voyage root).
// renderDashboard / drill-down (Wave 3) re-renders with deeper crumbs.
renderTopbar([{ label: 'Hjem' }]);
+
+ // Step 11 (v4.3) — webkitdirectory project-loader wiring (button +
+ // hidden file-input + browser-support detection).
+ wireProjectLoader();
}
function setThemeLabel(theme) {
brief.md, plan.md eller review.md.