triggers_view.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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='../../node_modules/jquery/dist/jquery.js'></script>
  7. <script src='../../node_modules/moment/moment.js'></script>
  8. <script src='../../dist/fullcalendar.js'></script>
  9. <script src='../../dist/gcal.js'></script>
  10. <script>
  11. var date = new Date();
  12. var d = date.getDate();
  13. var m = date.getMonth();
  14. var y = date.getFullYear();
  15. var verbose = false;
  16. $(document).ready(function() {
  17. $('#calendar').fullCalendar({
  18. header: {
  19. left: 'prev,next today',
  20. center: 'title',
  21. right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
  22. },
  23. editable: true,
  24. selectable: true,
  25. viewRender: function(view, element) {
  26. console.log('viewRender');
  27. //alert('viewRender');
  28. if (verbose) {
  29. console.log(' this', this);
  30. console.log(' view', view);
  31. console.log(' element', element);
  32. }
  33. },
  34. eventAfterAllRender: function(view) {
  35. console.log('eventAfterAllRender');
  36. if (verbose) {
  37. console.log(' this', this);
  38. console.log(' view', view);
  39. }
  40. },
  41. viewDestroy: function(view, element) {
  42. console.log('viewDestroy');
  43. //alert('viewDestroy');
  44. if (verbose) {
  45. console.log(' this', this);
  46. console.log(' view', view);
  47. console.log(' element', element);
  48. }
  49. },
  50. eventDestroy: function(event, element) {
  51. console.log('eventDestroy');
  52. //alert('eventDestroy');
  53. if (verbose) {
  54. console.log(' this', this);
  55. console.log(' event', event);
  56. console.log(' element', element);
  57. }
  58. },
  59. /*
  60. viewDisplay: function(view) { // deprecated
  61. console.log('viewDisplay');
  62. if (verbose) {
  63. console.log('The new title of the view is ' + view.title);
  64. }
  65. },
  66. */
  67. eventSources: [
  68. {
  69. url: "http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic",
  70. editable: true,
  71. className: 'holiday'
  72. },
  73. {
  74. events: [
  75. {
  76. title: 'All Day Event',
  77. start: new Date(y, m, 1)
  78. },
  79. {
  80. title: 'Long Event',
  81. start: new Date(y, m, d-5),
  82. end: new Date(y, m, d-2)
  83. },
  84. {
  85. id: 999,
  86. title: 'Repeating Event',
  87. start: new Date(y, m, d-3, 16, 0),
  88. allDay: false
  89. },
  90. {
  91. id: 999,
  92. title: 'Repeating Event',
  93. start: new Date(y, m, d+4, 16, 0),
  94. allDay: false
  95. },
  96. {
  97. id: 888,
  98. title: 'Meeting',
  99. start: new Date(y, m, d, 10, 30),
  100. allDay: false
  101. },
  102. {
  103. id: 777,
  104. title: 'Lunch',
  105. start: new Date(y, m, d, 12, 0),
  106. end: new Date(y, m, d, 14, 0),
  107. allDay: false
  108. },
  109. {
  110. title: 'Birthday Party',
  111. start: new Date(y, m, d+1, 19, 0),
  112. end: new Date(y, m, d+1, 22, 30),
  113. allDay: false
  114. },
  115. {
  116. title: 'Click for Google',
  117. start: new Date(y, m, 28),
  118. end: new Date(y, m, 29),
  119. url: 'http://google.com/'
  120. }
  121. ]
  122. }
  123. ]
  124. });
  125. });
  126. function hyperJump() {console.log('hyperJump');
  127. $('#calendar').fullCalendar('changeView', 'agendaWeek');
  128. //alert('pause');
  129. $('#calendar').fullCalendar('gotoDate', new Date(y, m+2, d));
  130. }
  131. </script>
  132. </head>
  133. <body style='font-size:14px'>
  134. <button onclick='hyperJump()'>changeView+gotoDate</button>
  135. <div id='calendar' style='width:75%;margin:20px auto 0;font-family:arial'></div>
  136. </body>
  137. </html>