refactor: split static/ into css/ js/ html/; add tests/test_json.c (15/15 pass)

This commit is contained in:
2026-06-09 01:04:50 +02:00
parent 32deda57e0
commit 9fc9494ccd
11 changed files with 91 additions and 17 deletions
+20
View File
@@ -0,0 +1,20 @@
/* ── Shared IPTV downloader JS ──────────────────────────────── */
var BASE = (function(){
var m = window.location.pathname.match(/^(\/[^/]+)/);
return m ? m[1] : '';
})();
function filter(el) {
document.querySelectorAll('.card').forEach(function(c) {
c.style.display = c.textContent.toLowerCase().includes(el.value.toLowerCase()) ? '' : 'none';
});
}
function dlMov(id, title, ext, icon) {
if (!confirm('Download: ' + title + '?')) return;
fetch(BASE + '/api/download_movie', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id: id, title: title, ext: ext || 'mp4', cover_url: icon || ''})
}).then(function() { alert('Queued!'); location.href = BASE + '/downloads'; });
}