json.html 1.7 KB

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