From 04891a7838c953c70202cac10e44ccb4ea26ed20 Mon Sep 17 00:00:00 2001 From: "hehihoho3@gmail.com" Date: Sun, 31 May 2026 01:01:18 +0900 Subject: [PATCH] feat(collection): apply initial filters from URL params (dashboard deep-link target) --- src/main/resources/templates/collection.html | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/resources/templates/collection.html b/src/main/resources/templates/collection.html index 0b8ca26..e9d39a3 100644 --- a/src/main/resources/templates/collection.html +++ b/src/main/resources/templates/collection.html @@ -314,8 +314,26 @@ document.getElementById('videoModal').style.display = 'none'; } + // ----- URL 파라미터 필터 적용 ----- + function applyUrlFilters(){ + const q = new URLSearchParams(window.location.search); + const setSel = (id, val) => { + if(val == null) return; + const el = document.getElementById(id); + if(!el) return; + if(el.tagName === 'SELECT'){ + if([...el.options].some(o => o.value === String(val))) el.value = String(val); + } else { el.value = String(val); } + }; + setSel('fStatus', q.get('status')); + setSel('fCategory', q.get('categoryId')); + setSel('fSource', q.get('source')); + if(q.get('shortsOnly') === 'true'){ const c = document.getElementById('fShorts'); if(c) c.checked = true; } + if(q.get('bookmarkedOnly') === 'true'){ const c = document.getElementById('fBookmarked'); if(c) c.checked = true; } + } + // init - (async ()=>{ await loadCategories(); await loadVideos(); })(); + (async ()=>{ await loadCategories(); applyUrlFilters(); await loadVideos(); })(); /*]]>*/