json.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <script src='../../bundle/dist/index.global.js'></script>
  6. <script>
  7. document.addEventListener('DOMContentLoaded', function() {
  8. var calendarEl = document.getElementById('calendar');
  9. var calendar = new FullCalendar.Calendar(calendarEl, {
  10. headerToolbar: {
  11. left: 'prev,next today',
  12. center: 'title',
  13. right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
  14. },
  15. initialDate: '2020-09-12',
  16. editable: true,
  17. navLinks: true, // can click day/week names to navigate views
  18. dayMaxEvents: true, // allow "more" link when too many events
  19. events: {
  20. url: 'php/get-events.php',
  21. failure: function() {
  22. document.getElementById('script-warning').style.display = 'block'
  23. }
  24. },
  25. loading: function(bool) {
  26. document.getElementById('loading').style.display =
  27. bool ? 'block' : 'none';
  28. }
  29. });
  30. calendar.render();
  31. });
  32. </script>
  33. <style>
  34. body {
  35. margin: 0;
  36. padding: 0;
  37. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  38. font-size: 14px;
  39. }
  40. #script-warning {
  41. display: none;
  42. background: #eee;
  43. border-bottom: 1px solid #ddd;
  44. padding: 0 10px;
  45. line-height: 40px;
  46. text-align: center;
  47. font-weight: bold;
  48. font-size: 12px;
  49. color: red;
  50. }
  51. #loading {
  52. display: none;
  53. position: absolute;
  54. top: 10px;
  55. right: 10px;
  56. }
  57. #calendar {
  58. max-width: 1100px;
  59. margin: 40px auto;
  60. padding: 0 10px;
  61. }
  62. </style>
  63. </head>
  64. <body>
  65. <div id='script-warning'>
  66. <code>php/get-events.php</code> must be running.
  67. </div>
  68. <div id='loading'>loading...</div>
  69. <div id='calendar'></div>
  70. </body>
  71. </html>