| 268 | //() |
| 269 | |
| 270 | function setupCalendarActions() { |
| 271 | const calendarActions = document.querySelectorAll( |
| 272 | '.success-message .calendar-action, .calendar-option' |
| 273 | ) |
| 274 | const eventDetails = |
| 275 | "Get a preview of the future of agentic software. See how the world's most innovative platforms have connected agents to their services with MCP to build a new class of product experiences.\n\nJoin Live: https://cloudflare.tv/mcp-demo-day" |
| 276 | const location = 'https://cloudflare.tv/mcp-demo-day' |
| 277 | |
| 278 | calendarActions.forEach((option) => { |
| 279 | option.addEventListener('click', () => { |
| 280 | const calendarType = option.dataset.calendarType |
| 281 | |
| 282 | switch (calendarType) { |
| 283 | case 'google': |
| 284 | window.open( |
| 285 | 'https://calendar.google.com/calendar/render?action=TEMPLATE&text=MCP+Demo+Day&details=Get+a+preview+of+the+future+of+agentic+software.+See+how+the+world%27s+most+innovative+platforms+have+connected+agents+to+their+services+with+MCP+to+build+a+new+class+of+product+experiences.%0A%0AJoin+Live%3A+https%3A%2F%2Fcloudflare.tv%2Fmcp-demo-day&location=https%3A%2F%2Fcloudflare.tv%2Fmcp-demo-day&dates=20250501T170000Z%2F20250501T183000Z', |
| 286 | '_blank' |
| 287 | ) |
| 288 | break |
| 289 | |
| 290 | case 'outlook': |
| 291 | window.open( |
| 292 | 'https://outlook.live.com/calendar/0/deeplink/compose?subject=MCP+Demo+Day&body=Get+a+preview+of+the+future+of+agentic+software.+See+how+the+world%27s+most+innovative+platforms+have+connected+agents+to+their+services+with+MCP+to+build+a+new+class+of+product+experiences.%0A%0AJoin+Live%3A+https%3A%2F%2Fcloudflare.tv%2Fmcp-demo-day&startdt=2025-05-01T17%3A00%3A00Z&enddt=2025-05-01T18%3A30%3A00Z&location=https%3A%2F%2Fcloudflare.tv%2Fmcp-demo-day', |
| 293 | '_blank' |
| 294 | ) |
| 295 | break |
| 296 | |
| 297 | case 'apple': |
| 298 | case 'ics': |
| 299 | const icsContent = `BEGIN:VCALENDAR |
| 300 | VERSION:2.0 |
| 301 | PRODID:-//MCP Demo Day//EN |
| 302 | CALSCALE:GREGORIAN |
| 303 | BEGIN:VEVENT |
| 304 | SUMMARY:MCP Demo Day |
| 305 | DESCRIPTION:${eventDetails.replace(/\n/g, '\\n')} |
| 306 | LOCATION:${location} |
| 307 | DTSTART:20250501T170000Z |
| 308 | DTEND:20250501T183000Z |
| 309 | STATUS:CONFIRMED |
| 310 | SEQUENCE:0 |
| 311 | END:VEVENT |
| 312 | END:VCALENDAR` |
| 313 | |
| 314 | if (calendarType === 'apple') { |
| 315 | const dataUri = 'data:text/calendar;charset=utf-8,' + encodeURIComponent(icsContent) |
| 316 | window.open(dataUri) |
| 317 | } else { |
| 318 | const blob = new Blob([icsContent], { type: 'text/calendar;charset=utf-8' }) |
| 319 | const link = document.createElement('a') |
| 320 | link.href = window.URL.createObjectURL(blob) |
| 321 | link.download = 'mcp_demo_day.ics' |
| 322 | document.body.appendChild(link) |
| 323 | link.click() |
| 324 | document.body.removeChild(link) |
| 325 | } |
| 326 | break |
| 327 | } |