Feat: Language support via json files in the locales folder + Feat: Popup with title, channel, schedule, duration, season, episode, synopsis, Watch button (if M3U provided) and IMDb link + Fix: Date added to the timebar
This commit is contained in:
+12
-6
@@ -37,10 +37,18 @@ function renderRuler() {
|
||||
let t = new Date(GRID_START); t.setSeconds(0,0);
|
||||
const rem = t.getMinutes()%15; if (rem) t.setMinutes(t.getMinutes()+(15-rem));
|
||||
while (t <= GRID_END) {
|
||||
const x = msToX(t.getTime()); const isHour = t.getMinutes()===0;
|
||||
const x = msToX(t.getTime());
|
||||
const isHour = t.getMinutes() === 0;
|
||||
const isMidnight = isHour && t.getHours() === 0;
|
||||
const tick = document.createElement('div'); tick.className='time-tick'; tick.style.left=x+'px';
|
||||
const lbl = document.createElement('div'); lbl.className='time-tick-label'+(isHour?' hour':''); lbl.textContent=fmtTime(t);
|
||||
const line = document.createElement('div'); line.className='time-tick-line'+(isHour?' hour':'');
|
||||
const lbl = document.createElement('div');
|
||||
lbl.className = 'time-tick-label' + (isHour ? ' hour' : '') + (isMidnight ? ' midnight' : '');
|
||||
if (isMidnight) {
|
||||
lbl.textContent = `${L.days[t.getDay()]} ${t.getDate()} ${L.months[t.getMonth()]}`;
|
||||
} else {
|
||||
lbl.textContent = fmtTime(t);
|
||||
}
|
||||
const line = document.createElement('div'); line.className='time-tick-line'+(isHour?' hour':'')+(isMidnight?' midnight':'');
|
||||
tick.appendChild(lbl); tick.appendChild(line); ruler.appendChild(tick);
|
||||
t = new Date(t.getTime()+15*60000);
|
||||
}
|
||||
@@ -88,9 +96,7 @@ function renderPrograms() {
|
||||
block.addEventListener('mouseenter', e=>showTooltip(e,p));
|
||||
block.addEventListener('mousemove', e=>moveTooltip(e));
|
||||
block.addEventListener('mouseleave', hideTooltip);
|
||||
if (p.start <= now && p.stop > now) {
|
||||
block.addEventListener('click', () => openPip(ch.name, p.title));
|
||||
}
|
||||
block.addEventListener('click', (e) => { hideTooltip(); openProgramModal(ch, p); });
|
||||
row.appendChild(block);
|
||||
});
|
||||
inner.appendChild(row);
|
||||
|
||||
Reference in New Issue
Block a user