timeline-theming.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='https://use.fontawesome.com/releases/v5.0.6/css/all.css' rel='stylesheet'>
  6. <link href='../packages/core/dist/main.css' rel='stylesheet' />
  7. <link href='../packages/bootstrap/dist/main.css' rel='stylesheet' />
  8. <link href='../packages/daygrid/dist/main.css' rel='stylesheet' />
  9. <link href='../packages/timegrid/dist/main.css' rel='stylesheet' />
  10. <link href='../packages/list/dist/main.css' rel='stylesheet' />
  11. <link href='../packages-premium/timeline/dist/main.css' rel='stylesheet' />
  12. <link href='../packages-premium/resource-timeline/dist/main.css' rel='stylesheet' />
  13. <script src='../packages/core/dist/main.js'></script>
  14. <script src='../packages/bootstrap/dist/main.js'></script>
  15. <script src='../packages/interaction/dist/main.js'></script>
  16. <script src='../packages/daygrid/dist/main.js'></script>
  17. <script src='../packages/timegrid/dist/main.js'></script>
  18. <script src='../packages/list/dist/main.js'></script>
  19. <script src='../packages-premium/timeline/dist/main.js'></script>
  20. <script src='../packages-premium/resource-common/dist/main.js'></script>
  21. <script src='../packages-premium/resource-timeline/dist/main.js'></script>
  22. <script src='js/theme-chooser.js'></script>
  23. <script>
  24. document.addEventListener('DOMContentLoaded', function() {
  25. var calendarEl = document.getElementById('calendar');
  26. var calendar;
  27. initThemeChooser({
  28. init: function(themeSystem) {
  29. calendar = new FullCalendar.Calendar(calendarEl, {
  30. plugins: [ 'bootstrap', 'interaction', 'dayGrid', 'timeGrid', 'list', 'resourceTimeline' ],
  31. themeSystem: themeSystem,
  32. now: '2020-05-07',
  33. editable: true, // enable draggable events
  34. aspectRatio: 1.8,
  35. scrollTime: '00:00', // undo default 6am scrollTime
  36. header: {
  37. left: 'today prev,next',
  38. center: 'title',
  39. right: 'resourceTimelineDay,resourceTimelineThreeDays,timeGridWeek,dayGridMonth,listWeek'
  40. },
  41. defaultView: 'resourceTimelineDay',
  42. views: {
  43. resourceTimelineThreeDays: {
  44. type: 'resourceTimeline',
  45. duration: { days: 3 },
  46. buttonText: '3 days'
  47. }
  48. },
  49. resourceLabelText: 'Rooms',
  50. resources: [
  51. { id: 'a', title: 'Auditorium A' },
  52. { id: 'b', title: 'Auditorium B', eventColor: 'green' },
  53. { id: 'c', title: 'Auditorium C', eventColor: 'orange' },
  54. { id: 'd', title: 'Auditorium D', children: [
  55. { id: 'd1', title: 'Room D1' },
  56. { id: 'd2', title: 'Room D2' }
  57. ] },
  58. { id: 'e', title: 'Auditorium E' },
  59. { id: 'f', title: 'Auditorium F', eventColor: 'red' },
  60. { id: 'g', title: 'Auditorium G' },
  61. { id: 'h', title: 'Auditorium H' },
  62. { id: 'i', title: 'Auditorium I' },
  63. { id: 'j', title: 'Auditorium J' },
  64. { id: 'k', title: 'Auditorium K' },
  65. { id: 'l', title: 'Auditorium L' },
  66. { id: 'm', title: 'Auditorium M' },
  67. { id: 'n', title: 'Auditorium N' },
  68. { id: 'o', title: 'Auditorium O' },
  69. { id: 'p', title: 'Auditorium P' },
  70. { id: 'q', title: 'Auditorium Q' },
  71. { id: 'r', title: 'Auditorium R' },
  72. { id: 's', title: 'Auditorium S' },
  73. { id: 't', title: 'Auditorium T' },
  74. { id: 'u', title: 'Auditorium U' },
  75. { id: 'v', title: 'Auditorium V' },
  76. { id: 'w', title: 'Auditorium W' },
  77. { id: 'x', title: 'Auditorium X' },
  78. { id: 'y', title: 'Auditorium Y' },
  79. { id: 'z', title: 'Auditorium Z' }
  80. ],
  81. events: [
  82. { id: '1', resourceId: 'b', start: '2020-05-07T02:00:00', end: '2020-05-07T07:00:00', title: 'event 1' },
  83. { id: '2', resourceId: 'c', start: '2020-05-07T05:00:00', end: '2020-05-07T22:00:00', title: 'event 2' },
  84. { id: '3', resourceId: 'd', start: '2020-05-06', end: '2020-05-08', title: 'event 3' },
  85. { id: '4', resourceId: 'e', start: '2020-05-07T03:00:00', end: '2020-05-07T08:00:00', title: 'event 4' },
  86. { id: '5', resourceId: 'f', start: '2020-05-07T00:30:00', end: '2020-05-07T02:30:00', title: 'event 5' }
  87. ]
  88. });
  89. calendar.render();
  90. },
  91. change: function(themeSystem) {
  92. calendar.setOption('themeSystem', themeSystem);
  93. }
  94. });
  95. });
  96. </script>
  97. <style>
  98. body {
  99. margin: 0;
  100. padding: 0;
  101. font-size: 14px;
  102. }
  103. #top,
  104. #calendar.fc-unthemed {
  105. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  106. }
  107. #top {
  108. background: #eee;
  109. border-bottom: 1px solid #ddd;
  110. padding: 0 10px;
  111. line-height: 40px;
  112. font-size: 12px;
  113. color: #000;
  114. }
  115. #top .selector {
  116. display: inline-block;
  117. margin-right: 10px;
  118. }
  119. #top select {
  120. font: inherit; /* mock what Boostrap does, don't compete */
  121. }
  122. .left { float: left }
  123. .right { float: right }
  124. .clear { clear: both }
  125. #calendar {
  126. max-width: 900px;
  127. margin: 40px auto;
  128. padding: 0 10px;
  129. }
  130. </style>
  131. </head>
  132. <body>
  133. <div id='top'>
  134. <div class='left'>
  135. <div id='theme-system-selector' class='selector'>
  136. Theme System:
  137. <select>
  138. <option value='bootstrap' selected>Bootstrap 4</option>
  139. <option value='standard'>unthemed</option>
  140. </select>
  141. </div>
  142. <div data-theme-system="bootstrap" class='selector' style='display:none'>
  143. Theme Name:
  144. <select>
  145. <option value='' selected>Default</option>
  146. <option value='cerulean'>Cerulean</option>
  147. <option value='cosmo'>Cosmo</option>
  148. <option value='cyborg'>Cyborg</option>
  149. <option value='darkly'>Darkly</option>
  150. <option value='flatly'>Flatly</option>
  151. <option value='journal'>Journal</option>
  152. <option value='litera'>Litera</option>
  153. <option value='lumen'>Lumen</option>
  154. <option value='lux'>Lux</option>
  155. <option value='materia'>Materia</option>
  156. <option value='minty'>Minty</option>
  157. <option value='pulse'>Pulse</option>
  158. <option value='sandstone'>Sandstone</option>
  159. <option value='simplex'>Simplex</option>
  160. <option value='sketchy'>Sketchy</option>
  161. <option value='slate'>Slate</option>
  162. <option value='solar'>Solar</option>
  163. <option value='spacelab'>Spacelab</option>
  164. <option value='superhero'>Superhero</option>
  165. <option value='united'>United</option>
  166. <option value='yeti'>Yeti</option>
  167. </select>
  168. </div>
  169. <span id='loading' style='display:none'>loading theme...</span>
  170. </div>
  171. <div class='right'>
  172. <span class='credits' data-credit-id='bootstrap-standard' style='display:none'>
  173. <a href='https://getbootstrap.com/docs/3.3/' target='_blank'>Theme by Bootstrap</a>
  174. </span>
  175. <span class='credits' data-credit-id='bootstrap-custom' style='display:none'>
  176. <a href='https://bootswatch.com/' target='_blank'>Theme by Bootswatch</a>
  177. </span>
  178. </div>
  179. <div class='clear'></div>
  180. </div>
  181. <div id='calendar'></div>
  182. </body>
  183. </html>