-
+
+
+
+
+
+
+
|
@@ -398,26 +347,14 @@
|
-
- | 播出日期 |
- 頻道 |
- 節目名稱 |
- 出演成員 |
- 集數 |
+
+ | 播出日期 |
+ 頻道 |
+ 節目名稱 |
+ 出演成員 |
+ 集數 |
-
-
-
-
-
-
-
-
-
-
-
-
-
+
| 04/22 09 |
-
+
| 04/27 09 |
-
+
| 05/04 12 |
-
+
| 06/05 12 |
-
+
| 09/05 12 |
-
+
| 10/12 02 |
-
-
-
- |
-
|
@@ -519,26 +451,14 @@
|
-
- | 播出日期 |
- 頻道 |
- 節目名稱 |
- 出演成員 |
- 集數 |
+
+ | 播出日期 |
+ 頻道 |
+ 節目名稱 |
+ 出演成員 |
+ 集數 |
-
-
-
-
-
-
-
-
-
-
-
-
-
+
| 01/01 280 |
-
+
| 01/08 09+導演版 |
-
+
| 06/13 10+導演版 |
-
+
| 12/05 05+導演版 |
-
-
-
- |
-
|
@@ -612,26 +527,14 @@
|
-
- | 播出日期 |
- 頻道 |
- 節目名稱 |
- 出演成員 |
- 集數 |
+
+ | 播出日期 |
+ 頻道 |
+ 節目名稱 |
+ 出演成員 |
+ 集數 |
-
-
-
-
-
-
-
-
-
-
-
-
-
+
| 05/05 25 |
-
+
| 09/30 05 |
-
+
| 10/28 05+導演版 |
-
-
-
- |
-
|
@@ -693,26 +591,14 @@
|
-
- | 播出日期 |
- 頻道 |
- 節目名稱 |
- 出演成員 |
- 集數 |
+
+ | 播出日期 |
+ 頻道 |
+ 節目名稱 |
+ 出演成員 |
+ 集數 |
-
-
-
-
-
-
-
-
-
-
-
-
-
+
| 05/31 06 |
-
+
| 06/08 11 |
-
+
| 07/05 04 |
-
+
| 09/20 10 |
-
+
| 10/25 11 |
-
-
-
- |
-
|
@@ -800,26 +681,14 @@
|
-
- | 播出日期 |
- 頻道 |
- 節目名稱 |
- 出演成員 |
- 集數 |
+
+ | 播出日期 |
+ 頻道 |
+ 節目名稱 |
+ 出演成員 |
+ 集數 |
-
-
-
-
-
-
-
-
-
-
-
-
-
+
| 01/10 10+導演版 |
-
+
| 10/09 10+導演版 |
-
-
-
- |
-
@@ -906,7 +770,9 @@
}
function rowMatchesSearch(row, q) {
- if (!q) return true;
+ if (!q || row.classList.contains("variety-table__show-row--labels")) {
+ return true;
+ }
const air = row.querySelector(".variety-table__air-date");
const airData = air
? `${air.dataset.airStart || ""} ${air.dataset.airEnd || ""}`
@@ -918,83 +784,41 @@
return text.includes(q);
}
- function getYearPanelRow(slot, year) {
+ function getYearLabelsRow(slot, year) {
return slot.querySelector(
- `.variety-table__year-panel-row[data-year="${year}"]`
+ `.variety-table__show-row--labels[data-year="${year}"]`
);
}
- function getYearHeadRow(slot, year) {
- return slot.querySelector(
- `.variety-table__year-head[data-year="${year}"]`
+ function getYearShowRows(slot, year) {
+ return slot.querySelectorAll(
+ `.variety-table__show-row[data-year="${year}"]:not(.variety-table__show-row--labels)`
);
}
- function getYearPanel(slot, year) {
- return getYearPanelRow(slot, year)?.querySelector(
- `.variety-table__year-panel[data-year="${year}"]`
- );
- }
+ function applyYearDetailVisibility(yearRow, open, q) {
+ const year = yearRow.dataset.year;
+ const slot = yearRow.closest("table[data-show-tabs]");
+ if (!slot) return;
+ const labels = getYearLabelsRow(slot, year);
+ const showRows = getYearShowRows(slot, year);
+ let anyMatch = false;
- function setYearHeadVisible(slot, year, visible) {
- const head = getYearHeadRow(slot, year);
- if (!head) return;
- head.classList.remove("is-closing");
- head.hidden = !visible;
- }
-
- function openYearPanel(slot, panelRow, panel, year) {
- if (!panelRow || !panel) return;
- const head = getYearHeadRow(slot, year);
- if (head) {
- head.classList.remove("is-closing");
- head.hidden = false;
- head.style.opacity = "1";
- }
- panelRow.hidden = false;
- panelRow.classList.remove("is-closing");
- if (panel.classList.contains("is-open")) {
- panel.style.maxHeight = `${panel.scrollHeight}px`;
- return;
- }
- panel.style.maxHeight = "0";
- panel.classList.add("is-open");
- requestAnimationFrame(() => {
- panel.style.maxHeight = `${panel.scrollHeight}px`;
- });
- }
-
- function closeYearPanel(slot, panelRow, panel, year) {
- if (!panelRow || !panel || !panel.classList.contains("is-open")) {
- return;
- }
- const head = getYearHeadRow(slot, year);
- panelRow.classList.add("is-closing");
- if (head) head.classList.add("is-closing");
- panel.classList.remove("is-open");
- panel.style.maxHeight = `${panel.scrollHeight}px`;
- requestAnimationFrame(() => {
- panel.style.maxHeight = "0";
- });
- const onEnd = (e) => {
- if (e.propertyName !== "max-height") return;
- panel.style.maxHeight = "";
- panelRow.classList.remove("is-closing");
- panelRow.hidden = true;
- if (head) {
- head.classList.remove("is-closing");
- head.hidden = true;
+ showRows.forEach((row) => {
+ const match = rowMatchesSearch(row, q);
+ if (match) anyMatch = true;
+ if (!open) {
+ row.hidden = true;
+ } else {
+ row.hidden = Boolean(q) && !match;
}
- panel.removeEventListener("transitionend", onEnd);
- };
- panel.addEventListener("transitionend", onEnd);
- }
+ });
- function isYearAnimating(panel, panelRow) {
- return (
- panel?.classList.contains("is-open") ||
- panelRow?.classList.contains("is-closing")
- );
+ if (labels) {
+ labels.hidden = !open || (Boolean(q) && !anyMatch);
+ }
+
+ return anyMatch;
}
function syncYearRows(slot) {
@@ -1002,41 +826,22 @@
slot.querySelectorAll(".variety-table__year-row").forEach((yearRow) => {
const year = yearRow.dataset.year;
const btn = yearRow.querySelector(".variety-table__year-toggle");
- const panelRow = getYearPanelRow(slot, year);
- const panel = getYearPanel(slot, year);
- const detailRows = panelRow
- ? panelRow.querySelectorAll(".variety-table__show-row")
- : [];
- let anyMatch = false;
- const yearOpen = yearRow.classList.contains("is-open");
+ let yearOpen = yearRow.classList.contains("is-open");
+ let anyMatch = applyYearDetailVisibility(yearRow, yearOpen, q);
- detailRows.forEach((row) => {
- const match = rowMatchesSearch(row, q);
- if (match) anyMatch = true;
- row.hidden = Boolean(q) && !match;
- });
-
- if (yearOpen && panelRow && panel) {
- if (q && !anyMatch) {
- closeYearPanel(slot, panelRow, panel, year);
- yearRow.classList.remove("is-open");
- if (btn) btn.setAttribute("aria-expanded", "false");
- } else {
- openYearPanel(slot, panelRow, panel, year);
- panel.style.maxHeight = `${panel.scrollHeight}px`;
- }
- } else if (
- !yearOpen &&
- !isYearAnimating(panel, panelRow) &&
- panelRow?.hidden
- ) {
- setYearHeadVisible(slot, year, false);
+ if (yearOpen && q && !anyMatch) {
+ yearOpen = false;
+ yearRow.classList.remove("is-open");
+ if (btn) btn.setAttribute("aria-expanded", "false");
+ applyYearDetailVisibility(yearRow, false, q);
}
- if (q && anyMatch && !yearOpen && panelRow && panel) {
+ if (q && anyMatch && !yearOpen) {
+ yearOpen = true;
yearRow.classList.add("is-open");
if (btn) btn.setAttribute("aria-expanded", "true");
- openYearPanel(slot, panelRow, panel, year);
+ applyYearDetailVisibility(yearRow, true, q);
+ anyMatch = true;
}
yearRow.hidden = Boolean(q) && !anyMatch;
@@ -1045,20 +850,11 @@
function setYearOpen(yearRow, open) {
const btn = yearRow.querySelector(".variety-table__year-toggle");
- const year = yearRow.dataset.year;
- const slot = yearRow.closest("table[data-show-tabs]");
- const panelRow = slot ? getYearPanelRow(slot, year) : null;
- const panel = slot ? getYearPanel(slot, year) : null;
- if (!btn || !panelRow || !panel) return;
+ if (!btn) return;
btn.setAttribute("aria-expanded", open ? "true" : "false");
yearRow.classList.toggle("is-open", open);
- if (open) {
- openYearPanel(slot, panelRow, panel, year);
- } else {
- closeYearPanel(slot, panelRow, panel, year);
- }
- const q = (input && input.value.trim()) || "";
- if (slot && q) syncYearRows(slot);
+ const q = (input && input.value.trim().toLowerCase()) || "";
+ applyYearDetailVisibility(yearRow, open, q);
}
function filterVisibleRows() {