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.

100 lines
2.6 KiB

  1. <html>
  2. <head>
  3. <title>Timeline</title>
  4. <script type="text/javascript" src="../timeline.js"></script>
  5. <link rel="stylesheet" type="text/css" href="../timeline.css">
  6. <style type="text/css">
  7. body {
  8. font-size: 10pt;
  9. font-family: verdana, sans, arial, sans-serif;
  10. }
  11. div.readonly {
  12. background-color: #ff4500;
  13. border-color: red;
  14. color: white;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <h1>Timeline - editable/read-only events</h1>
  20. <p style="max-width: 600px;">
  21. In the demo below, events are made editable or read-only on an individual
  22. basis.
  23. To check whether an item is editable, the Timeline first checks
  24. if the item has the field 'editable' defined, and if not, uses the global
  25. options.editable.
  26. </p>
  27. <div id="mytimeline"></div>
  28. <script type="text/javascript">
  29. // Create some JSON data
  30. var data = [
  31. {
  32. 'start': new Date(2010,7,23),
  33. 'content': 'Editable',
  34. 'editable': true
  35. },
  36. {
  37. 'start': new Date(2010,7,23,23,0,0),
  38. 'content': 'Editable',
  39. 'editable': true
  40. },
  41. {
  42. 'start': new Date(2010,7,24,16,0,0),
  43. 'content': 'Read-only',
  44. 'className': 'readonly',
  45. 'editable': false
  46. },
  47. {
  48. 'start': new Date(2010,7,26),
  49. 'end': new Date(2010,8,2),
  50. 'content': 'Read-only',
  51. 'className': 'readonly',
  52. 'editable': false
  53. },
  54. {
  55. 'start': new Date(2010,7,28),
  56. 'content': 'Editable',
  57. 'editable': true
  58. },
  59. {
  60. 'start': new Date(2010,7,29),
  61. 'content': 'Read-only',
  62. 'className': 'readonly',
  63. 'editable': false
  64. },
  65. {
  66. 'start': new Date(2010,7,31),
  67. 'end': new Date(2010,8,3),
  68. 'content': 'Editable',
  69. 'editable': true
  70. },
  71. {
  72. 'start': new Date(2010,8,4,12,0,0),
  73. 'className': 'readonly',
  74. 'content': 'Read-only',
  75. 'editable': false
  76. }
  77. ];
  78. // specify options
  79. var options = {
  80. 'width': '100%',
  81. 'height': '300px',
  82. 'editable': true, // enable dragging and editing events
  83. 'style': 'box'
  84. };
  85. // Instantiate our timeline object.
  86. var timeline = new links.Timeline(document.getElementById('mytimeline'), options);
  87. // Draw our timeline with the created data and options
  88. timeline.draw(data);
  89. </script>
  90. </body>
  91. </html>