Merge pull request #63 from ok2/codex/add-properties-to-control-event-visibility

This commit is contained in:
Kiyomichi Kosaka 2025-06-20 07:49:53 +02:00 committed by GitHub
commit 456f0744c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -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 }
];

View File

@ -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;