From 7bfee30e7148ad7006420ee715cb36b950df886f Mon Sep 17 00:00:00 2001 From: Kiyomichi Kosaka Date: Fri, 20 Jun 2025 07:49:34 +0200 Subject: [PATCH] feat(events): configurable visibility --- events.js | 4 +++- script.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/events.js b/events.js index c6b32b2..ecb8d2b 100644 --- a/events.js +++ b/events.js @@ -10,6 +10,8 @@ // 2 = every second unit, ...). // label - short description displayed on the calendar. // duration - optional length of the event in seconds. +// showMega - optional boolean, show label on the megasequence view (default true). +// showDetail - optional boolean, show event in the detail view (default true). window.SPECIAL_EVENTS = [ { start: '49f4.9332', label: 'Afina', unit: 'cosmocycle', interval: 1 }, @@ -19,5 +21,5 @@ window.SPECIAL_EVENTS = [ { start: '330d.d4ae', label: 'Zusammentag', unit: 'cosmocycle', interval: 1 }, { start: '11de.0c52', label: 'Anna', unit: 'cosmocycle', interval: 1 }, { start: '467f.ae61', label: 'Iris', unit: 'cosmocycle', interval: 1 }, - { start: '6854.7a75', cobie: '6854.7a75', label: 'Sleep', unit: 'second', interval: 86400, duration: 28800 } + { start: '6854.7a75', cobie: '6854.7a75', label: 'Sleep', unit: 'second', interval: 86400, duration: 28800, showMega: false } ]; diff --git a/script.js b/script.js index 9066a2c..3aeae96 100644 --- a/script.js +++ b/script.js @@ -605,6 +605,7 @@ function updateCalendar() { const cellStart = cellCob; const cellEnd = cellCob + COBIE_UNITS.eonstrip; window.SPECIAL_EVENTS.forEach(ev => { + if (ev.showMega === false) return; const startCob = parseCobiets(ev.start || ev.cobie); if (startCob === null) return; const endCob = ev.end ? parseCobiets(ev.end) : Number.POSITIVE_INFINITY; @@ -705,6 +706,7 @@ function showEonstripDetail(index, startCob) { const start = startCob; const end = startCob + COBIE_UNITS.eonstrip; window.SPECIAL_EVENTS.forEach(ev => { + if (ev.showDetail === false) return; const startCobEv = parseCobiets(ev.start || ev.cobie); if (startCobEv === null) return; const endCobEv = ev.end ? parseCobiets(ev.end) : Number.POSITIVE_INFINITY;