diff --git a/mise.toml b/mise.toml index 881ee5b..3221f7d 100644 --- a/mise.toml +++ b/mise.toml @@ -13,6 +13,7 @@ all = { run = "go build -buildvcs=false -o fetch . && make -C third_party/akaiut serve = { run = "go build -buildvcs=false -o fetch . && ./fetch serve" } lint = "golangci-lint run" js-lint = "cd web/ui && npm run lint" +js-test = "cd web/ui && npm test" electron-deps = "cd electron && npm install" electron-dev = { run = "go build -buildvcs=false -o fetch . && cd electron && npx electron ." } electron-build = { run = "go build -buildvcs=false -o fetch . && make -C third_party/akaiutil && cd electron && npx electron-builder --dir" } diff --git a/web/ui/app.js b/web/ui/app.js index 6d3ed62..29d57f2 100644 --- a/web/ui/app.js +++ b/web/ui/app.js @@ -307,12 +307,6 @@ function updateProgress() { } } -function formatTime(secs) { - const m = Math.floor(secs / 60); - const s = Math.floor(secs % 60); - return m + ':' + s.toString().padStart(2, '0'); -} - function setActiveItem(filename) { document.querySelectorAll('.wav-item').forEach(el => { el.classList.toggle('playing', el.dataset.file === filename); @@ -325,26 +319,6 @@ function clearActiveItem() { }); } -// ─── Helpers ────────────────────────────────────────────────────── - -function esc(s) { - if (!s) return ''; - return s.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); -} - -function sanitize(s) { - return s.replace(/[^a-zA-Z0-9_-]/g, '_'); -} - -function formatBytes(bytes) { - if (bytes === 0) return '0 B'; - const k = 1024; - const sizes = ['B', 'KB', 'MB', 'GB']; - const i = Math.floor(Math.log(bytes) / Math.log(k)); - return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]; -} - // Initial load doSearch(); diff --git a/web/ui/index.html b/web/ui/index.html index 3a6e677..1794e9b 100644 --- a/web/ui/index.html +++ b/web/ui/index.html @@ -60,6 +60,7 @@
- + +