sources.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html>
  3. <head>
  4. <link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
  5. <link rel='stylesheet' type='text/css' href='jgrowl/jgrowl.css' />
  6. <style type='text/css'>
  7. .full-calendar-month .static td {
  8. background: blue;
  9. color: yellow;
  10. }
  11. .full-calendar-month .gcal td {
  12. background: lightgreen;
  13. }
  14. </style>
  15. <!--
  16. <script type='text/javascript' src='legacy_jquery/jquery.js'></script>
  17. <script type='text/javascript' src='legacy_jquery/ui.core.js'></script>
  18. <script type='text/javascript' src='legacy_jquery/ui.draggable.js'></script>
  19. -->
  20. <script type='text/javascript' src='../jquery/jquery.js'></script>
  21. <script type='text/javascript' src='../jquery/ui.core.js'></script>
  22. <script type='text/javascript' src='../jquery/ui.draggable.js'></script>
  23. <script type='text/javascript' src='../fullcalendar/fullcalendar.js'></script>
  24. <!--<script type='text/javascript' src='../build/fullcalendar.min.js'></script>-->
  25. <script type='text/javascript' src='../fullcalendar/gcal.js'></script>
  26. <script type='text/javascript' src='jgrowl/jgrowl.js'></script>
  27. <script type='text/javascript'>
  28. $(document).ready(function() {
  29. var d = new Date();
  30. var y = d.getFullYear();
  31. var m = d.getMonth();
  32. var gcalSource = $.fullCalendar.gcalFeed(
  33. 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
  34. {draggable: true, className: 'gcal'}
  35. );
  36. var staticSource = [
  37. {
  38. id: 1,
  39. title: "Long Event",
  40. start: new Date(y, m, 6, 14, 0),
  41. end: new Date(y, m, 11),
  42. className: 'static'
  43. },
  44. {
  45. id: 2,
  46. title: "Repeating Event",
  47. start: new Date(y, m, 2),
  48. className: 'static'
  49. },
  50. {
  51. id: 2,
  52. title: "Repeating Event",
  53. start: new Date(y, m, 9),
  54. className: 'static'
  55. },
  56. {
  57. id: 3,
  58. title: "Meeting",
  59. start: new Date(y, m, 20, 9, 0),
  60. className: 'static'
  61. },
  62. {
  63. id: 4,
  64. title: "Click for Facebook",
  65. start: new Date(y, m, 27, 16),
  66. end: new Date(y, m, 29),
  67. url: "http://facebook.com/",
  68. className: 'static'
  69. }
  70. ];
  71. var jsonSource = "../examples/json_events.php";
  72. $('#calendar').fullCalendar({
  73. draggable: true,
  74. eventSources: [staticSource, gcalSource],
  75. loading: function(bool) {
  76. if (bool) {
  77. $('#loading').css('visibility', 'visible');
  78. }else{
  79. $('#loading').css('visibility', 'hidden');
  80. }
  81. }
  82. });
  83. window.addStaticSource = function() {
  84. $('#calendar').fullCalendar('addEventSource', staticSource);
  85. };
  86. window.addJsonSource = function() {
  87. $('#calendar').fullCalendar('addEventSource', jsonSource);
  88. };
  89. window.addGcalSource = function() {
  90. $('#calendar').fullCalendar('addEventSource', gcalSource);
  91. };
  92. window.removeStaticSource = function() {
  93. $('#calendar').fullCalendar('removeEventSource', staticSource);
  94. };
  95. window.removeJsonSource = function() {
  96. $('#calendar').fullCalendar('removeEventSource', jsonSource);
  97. };
  98. window.removeGcalSource = function() {
  99. $('#calendar').fullCalendar('removeEventSource', gcalSource);
  100. };
  101. });
  102. </script>
  103. </head>
  104. <body style='font-size:14px;font-family:Arial'>
  105. <div style='float:right'>
  106. <input type='button' value='add static event source' onclick='addStaticSource()' /><br />
  107. <input type='button' value='* add json event source' onclick='addJsonSource()' /><br />
  108. <input type='button' value='add gcal event source' onclick='addGcalSource()' /><br />
  109. <br />
  110. <input type='button' value='remove static event source' onclick='removeStaticSource()' /><br />
  111. <input type='button' value='remove json event source' onclick='removeJsonSource()' /><br />
  112. <input type='button' value='remove gcal event source' onclick='removeGcalSource()' /><br />
  113. <br />
  114. <input type='button' value='refresh' onclick="$('#calendar').fullCalendar('refresh')" />
  115. </div>
  116. <div style='visibility:hidden' id='loading'>loading...</div>
  117. <div id='calendar' style='float:left;width:75%'></div>
  118. </body>
  119. </html>