csp-nonce.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <!-- <meta name='csp-nonce' content='abc123shouldbreakthings' /> -->
  6. <meta http-equiv='Content-Security-Policy' content="default-src 'nonce-abc123'; font-src data:">
  7. <script nonce='abc123' src='../../bundle/dist/index.global.js'></script>
  8. <script nonce='abc123'>
  9. document.addEventListener('DOMContentLoaded', function() {
  10. var calendarEl = document.getElementById('calendar');
  11. var calendar = new FullCalendar.Calendar(calendarEl, {
  12. initialDate: '2020-09-12',
  13. initialView: 'timeGridWeek',
  14. nowIndicator: true,
  15. headerToolbar: {
  16. left: 'prev,next today',
  17. center: 'title',
  18. right: 'dayGridMonth,timeGridWeek,timeGridDay'
  19. },
  20. navLinks: true, // can click day/week names to navigate views
  21. editable: true,
  22. selectable: true,
  23. selectMirror: true,
  24. dayMaxEvents: true, // allow "more" link when too many events
  25. events: [
  26. {
  27. title: 'All Day Event',
  28. start: '2020-09-01',
  29. },
  30. {
  31. title: 'Long Event',
  32. start: '2020-09-07',
  33. end: '2020-09-10'
  34. },
  35. {
  36. groupId: 999,
  37. title: 'Repeating Event',
  38. start: '2020-09-09T16:00:00'
  39. },
  40. {
  41. groupId: 999,
  42. title: 'Repeating Event',
  43. start: '2020-09-16T16:00:00'
  44. },
  45. {
  46. title: 'Conference',
  47. start: '2020-09-11',
  48. end: '2020-09-13'
  49. },
  50. {
  51. title: 'Meeting',
  52. start: '2020-09-12T10:30:00',
  53. end: '2020-09-12T12:30:00'
  54. },
  55. {
  56. title: 'Lunch',
  57. start: '2020-09-12T12:00:00'
  58. },
  59. {
  60. title: 'Meeting',
  61. start: '2020-09-12T14:30:00'
  62. },
  63. {
  64. title: 'Happy Hour',
  65. start: '2020-09-12T17:30:00'
  66. },
  67. {
  68. title: 'Dinner',
  69. start: '2020-09-12T20:00:00'
  70. },
  71. {
  72. title: 'Birthday Party',
  73. start: '2020-09-13T07:00:00'
  74. },
  75. {
  76. title: 'Click for Google',
  77. url: 'http://google.com/',
  78. start: '2020-09-28'
  79. }
  80. ]
  81. });
  82. calendar.render();
  83. });
  84. </script>
  85. <style nonce='abc123'>
  86. body {
  87. margin: 40px 10px;
  88. padding: 0;
  89. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  90. font-size: 14px;
  91. }
  92. #calendar {
  93. max-width: 1100px;
  94. margin: 0 auto;
  95. }
  96. </style>
  97. </head>
  98. <body>
  99. <div id='calendar'></div>
  100. </body>
  101. </html>