diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-17 15:25:52 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-17 15:25:52 +0300 |
| commit | 914bd7cd6aa14e839332a98d91c30b19865b0cf2 (patch) | |
| tree | 02b11537237a204048589e14ed24938b805e42f7 /web/js/dom.js | |
| parent | 3b24f0e1be832584d6550e8cc3e5d24329f66f90 (diff) | |
Restructure repo: move Go server into player-server/
Diffstat (limited to 'web/js/dom.js')
| -rw-r--r-- | web/js/dom.js | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/web/js/dom.js b/web/js/dom.js deleted file mode 100644 index 1ea5840..0000000 --- a/web/js/dom.js +++ /dev/null @@ -1,27 +0,0 @@ -export { escapeHtml, fmtDur, toast } from './utils.js'; - -export function fmtDate(d) { - if (!d) return ''; - const dt = typeof d === 'string' ? new Date(d) : d; - return dt.toLocaleDateString(); -} - -export function fmtDateTime(d) { - if (!d) return ''; - const dt = typeof d === 'string' ? new Date(d) : d; - if (Number.isNaN(dt.getTime())) return ''; - return dt.toLocaleString(); -} - -export function fmtSize(bytes) { - if (!bytes || bytes <= 0) return ''; - const kb = bytes / 1024; - if (kb < 1024) return Math.round(kb) + ' KB'; - const mb = kb / 1024; - if (mb < 1024) return Math.round(mb * 10) / 10 + ' MB'; - return Math.round((mb / 1024) * 10) / 10 + ' GB'; -} - -export function closeAllModals() { - document.querySelectorAll('.modal-overlay.open').forEach((m) => m.classList.remove('open')); -} |
