Adjusting comments into files.

This commit is contained in:
Johnnybegood90
2026-03-14 04:23:44 +01:00
parent 062954a780
commit 8dabd2d190
19 changed files with 69 additions and 73 deletions
+8 -8
View File
@@ -31,7 +31,7 @@ function onSearchInput(val) {
function applySearch(q) {
if (!q) {
// Remettre toutes les chaines
// Restore the full channel list when the query is cleared.
renderAll();
return;
}
@@ -40,11 +40,11 @@ function applySearch(q) {
today.setHours(0,0,0,0);
const tomorrow = new Date(today.getTime() + 24*3600000);
// Filtrer les chaines : nom OU programme aujourd'hui correspond
// Keep channels whose name matches or that have a matching program today.
const filtered = channels.filter(ch => {
// Match sur le nom de la chaine
// Match against the channel name.
if (ch.name.toLowerCase().includes(q)) return true;
// Match sur les programmes d'aujourd'hui (titre + desc)
// Match against today's programs (title + description).
return (programs[ch.id]||[]).some(p => {
if (p.stop < today || p.start > tomorrow) return false;
if (p.title.toLowerCase().includes(q)) return true;
@@ -72,7 +72,7 @@ function renderFiltered(filteredChannels, q) {
inner.style.width = TOTAL_WIDTH_PX + 'px';
inner.style.height = (filteredChannels.length * ROW_H) + 'px';
// Remettre la now-line
// Recreate the now-line after clearing the container.
const nowLine = document.createElement('div');
nowLine.className = 'now-line'; nowLine.id = 'nowLine';
nowLine.style.height = (filteredChannels.length * ROW_H) + 'px';
@@ -81,7 +81,7 @@ function renderFiltered(filteredChannels, q) {
const now = new Date();
filteredChannels.forEach((ch, i) => {
// Colonne chaîne
// Channel column.
const cell = document.createElement('div');
cell.className = 'channel-cell';
if (ch.icon) {
@@ -96,7 +96,7 @@ function renderFiltered(filteredChannels, q) {
cell.addEventListener('click', () => openPip(ch.name, getNowPlaying(ch.id)));
list.appendChild(cell);
// Programmes
// Programs row.
const row = document.createElement('div');
row.className = 'program-row';
row.style.cssText = `top:${i*ROW_H}px;position:absolute;left:0;right:0;`;
@@ -109,7 +109,7 @@ function renderFiltered(filteredChannels, q) {
const block = document.createElement('div');
block.className = 'program-block';
// Highlight si le programme matche la recherche
// Highlight programs that match the current search query.
const matchesProg = p.title.toLowerCase().includes(q) || (p.desc && p.desc.toLowerCase().includes(q));
if (matchesProg) block.classList.add('search-match');