mirror of
https://github.com/nfonteyne/octane-website.git
synced 2026-09-03 23:24:48 +02:00
update: hide rehersal icon when accepted or rejected, drop down for calendar
This commit is contained in:
parent
5730a9fe3c
commit
6042d92f47
5 changed files with 114 additions and 18 deletions
|
|
@ -118,3 +118,26 @@ function icsDataUrl({ uid, title, startISO, endISO, location }) {
|
|||
lines.push('END:VEVENT', 'END:VCALENDAR');
|
||||
return `data:text/calendar;charset=utf-8,${encodeURIComponent(lines.join('\r\n'))}`;
|
||||
}
|
||||
|
||||
// Single "+ Calendrier" control that reveals the 3 provider links on click,
|
||||
// instead of showing all 3 pills side by side.
|
||||
function calendarLinksMenuHtml(linkArgs, icsFilename) {
|
||||
return `
|
||||
<details class="calendar-menu">
|
||||
<summary class="pill-link">+ Calendrier</summary>
|
||||
<div class="calendar-menu-options">
|
||||
<a href="${googleCalendarLink(linkArgs)}" target="_blank" rel="noopener">Google</a>
|
||||
<a href="${outlookCalendarLink(linkArgs)}" target="_blank" rel="noopener">Outlook</a>
|
||||
<a href="${icsDataUrl(linkArgs)}" download="${escapeHtml(icsFilename)}">Apple / autre (.ics)</a>
|
||||
</div>
|
||||
</details>
|
||||
`;
|
||||
}
|
||||
|
||||
// Close any open "+ Calendrier" menu when picking a link inside it or
|
||||
// clicking anywhere else on the page.
|
||||
document.addEventListener('click', (e) => {
|
||||
document.querySelectorAll('details.calendar-menu[open]').forEach((menu) => {
|
||||
if (!menu.contains(e.target) || e.target.closest('a')) menu.open = false;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue