Highlight export: CSV/JSON download, same-name highlights disambiguated per day, sorted chronologically

This commit is contained in:
2026-08-28 16:47:14 +01:00
parent 43561d5012
commit 8d194d5241
2 changed files with 46 additions and 0 deletions
+5
View File
@@ -200,6 +200,9 @@
<button id="mark-end">Mark end</button><span class="mark-time" id="highlight-end">--:--:--</span>
<input id="highlight-label" placeholder="Highlight name" maxlength="120">
<button id="save-highlight">Add highlight</button>
<span style="flex:1"></span>
<button id="export-csv" title="Download all highlights as CSV">Export CSV</button>
<button id="export-json" title="Download all highlights as JSON">Export JSON</button>
</div>
<div class="highlight-list" id="highlight-list"><span style="color:var(--dim);font-size:12px">No highlights yet.</span></div>
</section>
@@ -397,6 +400,8 @@
}
document.querySelector("#mark-start").onclick = () => setMark("start");
document.querySelector("#mark-end").onclick = () => setMark("end");
document.querySelector("#export-csv").onclick = () => location.href = "/api/highlights/export?format=csv";
document.querySelector("#export-json").onclick = () => location.href = "/api/highlights/export?format=json";
document.querySelector("#save-highlight").onclick = async () => {
if (highlightStart === null || highlightEnd === null || highlightStart >= highlightEnd) return;
await fetch("/api/highlights", {method: "POST", headers: {"Content-Type": "application/json"},