2
0

triggers_view.html 3.5 KB

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