2
0

resource-event-json.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../packages-premium/bundle/main.css' rel='stylesheet' />
  6. <script src='../packages-premium/bundle/main.js'></script>
  7. <script>
  8. document.addEventListener('DOMContentLoaded', function() {
  9. var calendarEl = document.getElementById('calendar');
  10. var calendar = new FullCalendar.Calendar(calendarEl, {
  11. now: '2020-09-07',
  12. editable: true, // enable draggable events
  13. aspectRatio: 1.8,
  14. scrollTime: '00:00', // undo default 6am scrollTime
  15. headerToolbar: {
  16. left: 'today prev,next',
  17. center: 'title',
  18. right: 'resourceTimelineDay,resourceTimelineThreeDays,timeGridWeek,dayGridMonth'
  19. },
  20. initialView: 'resourceTimelineDay',
  21. views: {
  22. resourceTimelineThreeDays: {
  23. type: 'resourceTimeline',
  24. duration: { days: 3 },
  25. buttonText: '3 days'
  26. }
  27. },
  28. resourceAreaHeaderContent: 'Rooms',
  29. resources: { // you can also specify a plain string like 'json/resources.json'
  30. url: 'json/resources.json',
  31. failure: function() {
  32. document.getElementById('script-warning').style.display = 'block';
  33. }
  34. },
  35. events: { // you can also specify a plain string like 'json/events-for-resources.json'
  36. url: 'json/events-for-resources.json',
  37. failure: function() {
  38. document.getElementById('script-warning').style.display = 'block';
  39. }
  40. }
  41. });
  42. calendar.render();
  43. });
  44. </script>
  45. <style>
  46. body {
  47. margin: 0;
  48. padding: 0;
  49. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  50. font-size: 14px;
  51. }
  52. #script-warning {
  53. display: none;
  54. background: #eee;
  55. border-bottom: 1px solid #ddd;
  56. padding: 0 10px;
  57. line-height: 40px;
  58. text-align: center;
  59. font-weight: bold;
  60. font-size: 12px;
  61. color: red;
  62. }
  63. #loading {
  64. display: none;
  65. position: absolute;
  66. top: 10px;
  67. right: 10px;
  68. }
  69. #calendar {
  70. max-width: 1100px;
  71. margin: 50px auto;
  72. }
  73. </style>
  74. </head>
  75. <body>
  76. <div id='script-warning'>
  77. This page should be running from a webserver, to allow fetching from the <code>json/</code> directory.
  78. </div>
  79. <div id='loading'>loading...</div>
  80. <div id='calendar'></div>
  81. </body>
  82. </html>