diff options
Diffstat (limited to 'web/templates/partials/timeline-tab.html')
| -rw-r--r-- | web/templates/partials/timeline-tab.html | 172 |
1 files changed, 0 insertions, 172 deletions
diff --git a/web/templates/partials/timeline-tab.html b/web/templates/partials/timeline-tab.html index 6775808..c73c1b5 100644 --- a/web/templates/partials/timeline-tab.html +++ b/web/templates/partials/timeline-tab.html @@ -199,98 +199,6 @@ {{end}} </div> - <script> - (function() { - const calendar = document.getElementById('today-calendar'); - if (!calendar) return; - const events = calendar.querySelectorAll('.calendar-event'); - const hourHeight = 40; - const startHour = parseInt(calendar.dataset.startHour) || 8; - const nowHour = parseInt(calendar.dataset.nowHour); - const nowMinute = parseInt(calendar.dataset.nowMinute); - - // Build event data for overlap detection - const eventData = []; - events.forEach(function(el) { - const hour = parseInt(el.dataset.hour); - const minute = parseInt(el.dataset.minute); - const endHourVal = parseInt(el.dataset.endHour); - const endMinute = parseInt(el.dataset.endMinute); - const startMin = hour * 60 + minute; - let endMin; - if (endHourVal > hour || (endHourVal === hour && endMinute > minute)) { - endMin = endHourVal * 60 + endMinute; - } else { - endMin = startMin + 55; - } - eventData.push({ el, startMin, endMin, column: 0 }); - }); - - // Assign columns for overlapping events - eventData.sort((a, b) => a.startMin - b.startMin); - for (let i = 0; i < eventData.length; i++) { - const ev = eventData[i]; - const overlaps = eventData.filter((other, j) => - j < i && other.endMin > ev.startMin && other.startMin < ev.endMin - ); - const usedCols = overlaps.map(o => o.column); - let col = 0; - while (usedCols.includes(col)) col++; - ev.column = col; - } - - // Position events with column-based indentation - eventData.forEach(function(ev) { - const el = ev.el; - const hour = parseInt(el.dataset.hour); - const minute = parseInt(el.dataset.minute); - const top = (hour - startHour) * hourHeight + (minute / 60) * hourHeight; - const durationMinutes = ev.endMin - ev.startMin; - const height = Math.max(28, (durationMinutes / 60) * hourHeight - 4); - - el.style.top = top + 'px'; - el.style.height = height + 'px'; - el.style.left = (8 + ev.column * 16) + 'px'; - el.style.display = 'block'; - - // Debounced hover effect (100ms delay) - let hoverTimeout; - el.addEventListener('mouseenter', function() { - hoverTimeout = setTimeout(() => el.classList.add('hover-active'), 100); - }); - el.addEventListener('mouseleave', function() { - clearTimeout(hoverTimeout); - el.classList.remove('hover-active'); - }); - - const url = el.dataset.url; - if (url) { - el.style.cursor = 'pointer'; - el.addEventListener('click', function(e) { - if (e.target.tagName !== 'INPUT') { - window.open(url, '_blank'); - } - }); - } - }); - - // Position the "now" line - const nowLine = document.getElementById('now-line'); - if (nowLine && !isNaN(nowHour)) { - const nowTop = (nowHour - startHour) * hourHeight + (nowMinute / 60) * hourHeight; - if (nowTop >= 0) { - nowLine.style.top = nowTop + 'px'; - nowLine.style.display = 'block'; - } - } - - // Hide untimed section if empty - const untimedSection = document.getElementById('untimed-section'); - if (untimedSection && untimedSection.querySelectorAll('.untimed-item').length === 0) { - untimedSection.style.display = 'none'; - } - })(); - </script> </details> {{end}} @@ -376,86 +284,6 @@ {{end}} </div> - <script> - (function() { - const calendar = document.getElementById('tomorrow-calendar'); - if (!calendar) return; - const events = calendar.querySelectorAll('.calendar-event'); - const hourHeight = 40; - const startHour = parseInt(calendar.dataset.startHour) || 8; - - // Build event data for overlap detection - const eventData = []; - events.forEach(function(el) { - const hour = parseInt(el.dataset.hour); - const minute = parseInt(el.dataset.minute); - const endHourVal = parseInt(el.dataset.endHour); - const endMinute = parseInt(el.dataset.endMinute); - const startMin = hour * 60 + minute; - let endMin; - if (endHourVal > hour || (endHourVal === hour && endMinute > minute)) { - endMin = endHourVal * 60 + endMinute; - } else { - endMin = startMin + 55; - } - eventData.push({ el, startMin, endMin, column: 0 }); - }); - - // Assign columns for overlapping events - eventData.sort((a, b) => a.startMin - b.startMin); - for (let i = 0; i < eventData.length; i++) { - const ev = eventData[i]; - const overlaps = eventData.filter((other, j) => - j < i && other.endMin > ev.startMin && other.startMin < ev.endMin - ); - const usedCols = overlaps.map(o => o.column); - let col = 0; - while (usedCols.includes(col)) col++; - ev.column = col; - } - - // Position events with column-based indentation - eventData.forEach(function(ev) { - const el = ev.el; - const hour = parseInt(el.dataset.hour); - const minute = parseInt(el.dataset.minute); - const top = (hour - startHour) * hourHeight + (minute / 60) * hourHeight; - const durationMinutes = ev.endMin - ev.startMin; - const height = Math.max(28, (durationMinutes / 60) * hourHeight - 4); - - el.style.top = top + 'px'; - el.style.height = height + 'px'; - el.style.left = (8 + ev.column * 16) + 'px'; - el.style.display = 'block'; - - // Debounced hover effect (100ms delay) - let hoverTimeout; - el.addEventListener('mouseenter', function() { - hoverTimeout = setTimeout(() => el.classList.add('hover-active'), 100); - }); - el.addEventListener('mouseleave', function() { - clearTimeout(hoverTimeout); - el.classList.remove('hover-active'); - }); - - const url = el.dataset.url; - if (url) { - el.style.cursor = 'pointer'; - el.addEventListener('click', function(e) { - if (e.target.tagName !== 'INPUT') { - window.open(url, '_blank'); - } - }); - } - }); - - // Hide untimed section if empty - const untimedSection = document.getElementById('tomorrow-untimed-section'); - if (untimedSection && untimedSection.querySelectorAll('.untimed-item').length === 0) { - untimedSection.style.display = 'none'; - } - })(); - </script> </details> {{end}} |
