MCPcopy
hub / github.com/cloudflare/mcp-server-cloudflare / setupCalendarActions

Function setupCalendarActions

apps/demo-day/frontend/script.js:270–336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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
300VERSION:2.0
301PRODID:-//MCP Demo Day//EN
302CALSCALE:GREGORIAN
303BEGIN:VEVENT
304SUMMARY:MCP Demo Day
305DESCRIPTION:${eventDetails.replace(/\n/g, '\\n')}
306LOCATION:${location}
307DTSTART:20250501T170000Z
308DTEND:20250501T183000Z
309STATUS:CONFIRMED
310SEQUENCE:0
311END:VEVENT
312END: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 }

Callers 1

script.jsFile · 0.85

Calls 2

replaceMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected