Node.js + Express 5 backend with flat NDJSON key-value store (borrowed from electronics-inventory). Sequential integer IDs per namespace. Vanilla JS SPA with filters for status, priority, and tags. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
541 B
JavaScript
17 lines
541 B
JavaScript
export function qs(scope, selector) {
|
|
if (typeof scope === 'string') { return document.querySelector(scope); }
|
|
return scope.querySelector(selector);
|
|
}
|
|
|
|
export function clone(template_id) {
|
|
return document.getElementById(template_id).content.cloneNode(true).firstElementChild;
|
|
}
|
|
|
|
export function set_text(el, selector, text) {
|
|
const target = typeof selector === 'string' ? el.querySelector(selector) : selector;
|
|
target.textContent = text;
|
|
}
|
|
|
|
export function show(el) { el.hidden = false; }
|
|
export function hide(el) { el.hidden = true; }
|