From 914bd7cd6aa14e839332a98d91c30b19865b0cf2 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 17 May 2026 15:25:52 +0300 Subject: Restructure repo: move Go server into player-server/ --- web/js/dom.js | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 web/js/dom.js (limited to 'web/js/dom.js') 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')); -} -- cgit v1.2.3