sources_new.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link href='../dist/fullcalendar.css' rel='stylesheet' />
  5. <link href='../dist/fullcalendar.print.css' rel='stylesheet' media='print' />
  6. <script src='../lib/jquery/jquery.js'></script>
  7. <script src='../lib/jquery-ui/ui/jquery-ui.js'></script>
  8. <script src='../lib/moment/moment.js'></script>
  9. <script src='../dist/fullcalendar.js'></script>
  10. <script src='../dist/gcal.js'></script>
  11. <script>
  12. /*
  13. (main options)
  14. startParam
  15. endParam
  16. cacheParam
  17. ignoreTimezone
  18. allDayDefault
  19. editable
  20. eventColor
  21. eventTextColor
  22. eventBorderColor
  23. eventBackgroundColor
  24. (event source)
  25. startParam
  26. endParam
  27. cacheParam
  28. ignoreTimezone
  29. allDayDefault
  30. className
  31. editable
  32. color
  33. textColor
  34. borderColor
  35. backgroundColor
  36. (event)
  37. className
  38. editable
  39. color
  40. textColor
  41. borderColor
  42. backgroundColor
  43. */
  44. $(document).ready(function() {
  45. var date = new Date();
  46. var d = date.getDate();
  47. var m = date.getMonth();
  48. var y = date.getFullYear();
  49. $('#calendar').fullCalendar({
  50. header: {
  51. left: 'prev,next today',
  52. center: 'title',
  53. right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
  54. },
  55. editable: true,
  56. //eventStartEditable: false,
  57. //eventDurationEditable: false,
  58. //disableResizing: true, // deprecated
  59. //disableDragging: true, // deprecated
  60. selectable: true,
  61. selectHelper: true,
  62. dragOpacity: .5,
  63. eventSources: [
  64. {
  65. url: 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
  66. color: 'orange',
  67. className: 'gcal',
  68. success: function(events) {
  69. console.log('successfully loaded gcal event data!', events);
  70. },
  71. editable: true
  72. },
  73. /*
  74. $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic', {
  75. color: 'orange',
  76. className: 'gcal'
  77. }),
  78. */
  79. {
  80. url: "../demos/json-events.php",
  81. //editable: false,
  82. color: 'red',
  83. data: {
  84. something: 'cool'
  85. },
  86. success: function() {
  87. console.log('json-events.php is done!!!', arguments);
  88. }
  89. },
  90. {
  91. color: 'purple',
  92. //editable: false,
  93. //startEditable: false,
  94. //durationEditable: false,
  95. events: [
  96. {
  97. title: 'All Day Event',
  98. //startEditable: false,
  99. //durationEditable: false,
  100. start: new Date(y, m, 1)
  101. },
  102. {
  103. title: 'Long Event',
  104. start: new Date(y, m, d-5),
  105. end: new Date(y, m, d-2)
  106. },
  107. {
  108. id: 999,
  109. title: 'Repeating Event',
  110. start: new Date(y, m, d-3, 16, 0),
  111. allDay: false
  112. },
  113. {
  114. id: 999,
  115. title: 'Repeating Event',
  116. start: new Date(y, m, d+4, 16, 0),
  117. allDay: false
  118. }
  119. ]
  120. },
  121. {
  122. events: [
  123. {
  124. title: 'Meeting',
  125. start: new Date(y, m, d, 10, 30),
  126. allDay: false
  127. },
  128. {
  129. title: 'Lunch',
  130. start: new Date(y, m, d, 12, 5),
  131. end: new Date(y, m, d, 14, 43),
  132. allDay: false
  133. },
  134. {
  135. title: 'Birthday Party',
  136. start: new Date(y, m, d+1, 19, 0),
  137. end: new Date(y, m, d+1, 22, 30),
  138. allDay: false
  139. },
  140. {
  141. title: 'Click for Google',
  142. start: new Date(y, m, 28),
  143. end: new Date(y, m, 29),
  144. url: 'http://google.com/'
  145. }
  146. ]
  147. }
  148. ],
  149. eventClick: function(event) {
  150. if (event.url) {
  151. window.open(event.url);
  152. }
  153. return false;
  154. }
  155. });
  156. });
  157. </script>
  158. <style>
  159. body {
  160. margin-top: 40px;
  161. text-align: center;
  162. font-size: 13px;
  163. font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
  164. }
  165. #calendar {
  166. width: 900px;
  167. margin: 0 auto;
  168. }
  169. </style>
  170. </head>
  171. <body>
  172. <div id='calendar'></div>
  173. </body>
  174. </html>