Replace server-folder docx import with direct file picker

The old import scanned a hardcoded Seafile CloudStorage path that only
worked on one specific machine. Replaced with a standard <input type=file>
browser picker that reads the .docx as base64 and uploads it directly, so
the feature works everywhere. Server endpoint now accepts either a base64
payload or the legacy path. Also fixed a crash where resetImportSection()
still referenced the removed select element, which was breaking the item
editor for all item types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-07-29 17:15:23 -04:00
1 parent de598496bc
commit b048f51d46
3 files changed
+33 -40

No files matched your search

+5 -4
View File
@@ -169,12 +169,13 @@
<p id="scan-status" class="hint"></p>
</div>
<!-- Import from Homeschool folder: visible for lesson, assignment, quiz types -->
<!-- Import from .docx file: visible for lesson, assignment, quiz types -->
<div id="ie-import-section" class="scan-card" hidden>
<strong>📂 Import from Homeschool folder</strong>
<strong>📂 Import from .docx</strong>
<input type="file" id="import-local-input" accept=".docx" hidden>
<div class="scan-controls">
<select id="import-file-select" style="flex:1"><option value="">— choose a file —</option></select>
<button type="button" id="import-load-btn" class="secondary">↓ Load files</button>
<button type="button" id="import-browse-btn" class="secondary">📂 Choose file…</button>
<span id="import-local-name" class="hint" style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"></span>
<button type="button" id="import-go-btn" class="secondary" disabled>📥 Import</button>
</div>
<p id="import-status" class="hint"></p>