2c3d687b6d
Adds the three UI mutation endpoints (favourite toggle, manual chapter override, delete) plus the card controls that call them via htmx. Each mutation is a read-modify-write through Store.Get/Upsert so Upsert alone decides whether updated_at moves — favouriting must not reorder the list, only real reading progress should. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
14 lines
414 B
JavaScript
14 lines
414 B
JavaScript
// Title search and tab-state handling land in Task 7.
|
|
function setActiveTab(el) {
|
|
el.parentElement.querySelectorAll("[role=tab]").forEach(function (t) {
|
|
t.classList.toggle("active", t === el);
|
|
});
|
|
}
|
|
|
|
function toggleChapterForm(key) {
|
|
var form = document.getElementById("chapter-form-" + key);
|
|
if (!form) return;
|
|
form.hidden = !form.hidden;
|
|
if (!form.hidden) form.querySelector("input").focus();
|
|
}
|