You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
4.1 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Timeline jQuery Themeroller demo</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  6. <script type="text/javascript" src="../lib/jquery-1.9.1.js"></script>
  7. <script type="text/javascript" src="../lib/jquery-ui.js"></script>
  8. <script type="text/javascript" src="../lib/jquery.themeswitcher.js"></script>
  9. <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  10. <script type="text/javascript" src="../timeline.js"></script>
  11. <link rel="stylesheet" type="text/css" href="../timeline-theme.css">
  12. <style>
  13. body,
  14. .ui-widget,
  15. .ui-widget input,
  16. .ui-widget select,
  17. .ui-widget textarea,
  18. .ui-widget button,
  19. .ui-widget-header,
  20. .ui-widget-content,
  21. .ui-widget-header .ui-widget-header,
  22. .ui-widget-content .ui-widget-content {
  23. font-family: Arial, "Trebuchet MS", Verdana, sans-serif !important;
  24. font-size: 12px !important;
  25. }
  26. </style>
  27. <script type="text/javascript">
  28. $(document).ready(function () {
  29. $("#switcher").themeswitcher({
  30. imgpath: "../img/themeswitcher/",
  31. loadtheme: "sunny"
  32. });
  33. });
  34. google.load("visualization", "1");
  35. // Set callback to run when API is loaded
  36. google.setOnLoadCallback(drawVisualization);
  37. var timeline;
  38. var data;
  39. function getSelectedRow() {
  40. var row = undefined
  41. var sel = timeline.getSelection();
  42. if (sel.length) {
  43. if (sel[0].row != undefined) {
  44. var row = sel[0].row;
  45. }
  46. }
  47. return row;
  48. }
  49. // Called when the Visualization API is loaded.
  50. function drawVisualization() {
  51. // Create and populate a data table.
  52. data = new google.visualization.DataTable();
  53. data.addColumn('datetime', 'start');
  54. data.addColumn('datetime', 'end');
  55. data.addColumn('string', 'content');
  56. data.addRows([
  57. [new Date(2011, 01, 23), , '<div>Conversation</div><img src="../examples/img/comments-icon.png" style="width:32px; height:32px;">'],
  58. [new Date(2011, 01, 23, 23, 00, 00), , '<div>Mail from boss</div><img src="../examples/img/mail-icon.png" style="width:32px; height:32px;">'],
  59. [new Date(2011, 01, 24, 16, 00, 00), , '<span onclick="alert(\'test\')">Click here!</span>'],
  60. [new Date(2011, 01, 26), new Date(2011, 02, 02), 'Traject A'],
  61. [new Date(2011, 01, 27), , '<div>Memo</div><img src="../examples/img/notes-edit-icon.png" style="width:48px; height:48px;">'],
  62. [new Date(2011, 01, 28), new Date(2011, 02, 03), 'Traject B'],
  63. [new Date(2011, 02, 04, 12, 00, 00), , '<div>Report</div><img src="../examples/img/attachment-icon.png" style="width:32px; height:32px;">']
  64. ]);
  65. // specify options
  66. var options = {
  67. width: "100%",
  68. editable: true, // enable dragging and editing events
  69. enableKeys: true,
  70. axisOnTop: false,
  71. showNavigation: true,
  72. showButtonNew: true,
  73. animate: true,
  74. animateZoom: true,
  75. layout: "box"
  76. };
  77. timeline = new links.Timeline(document.getElementById('mytimeline'), options);
  78. timeline.draw(data);
  79. }
  80. </script>
  81. </head>
  82. <body>
  83. <h1><strong>This page demonstrates the timeline intergation with jQuery Themeroller CSS framework.</strong></h1>
  84. <p>
  85. <div id="switcher"></div>
  86. </p>
  87. <div id="mytimeline"></div>
  88. <!-- Information about where the used icons come from -->
  89. <p style="color:gray; font-size:10px; font-style:italic;">
  90. Icons by <a href="http://dryicons.com" target="_blank" title="Aesthetica 2 Icons by DryIcons" style="color:gray;">DryIcons</a>
  91. and <a href="http://www.tpdkdesign.net" target="_blank" title="Refresh Cl Icons by TpdkDesign.net" style="color:gray;">TpdkDesign.net</a>
  92. </p>
  93. </body>
  94. </html>