-
Notifications
You must be signed in to change notification settings - Fork 0
/
table.html
216 lines (169 loc) · 5.84 KB
/
table.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Timeglider jQuery Widget: Basic Demo</title>
<link rel="stylesheet" href="css/aristo/jquery-ui-1.8.5.custom.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="js/timeglider/Timeglider.css" type="text/css" media="screen" title="no title" charset="utf-8">
<style type='text/css'>
/* timeline div style */
body { font-family:Helvetica, Arial, sans-serif; }
.info {
width:750px;
font-family:Helvetica, Arial, sans-serif;
margin:32px auto 32px auto;
color:#444;
font-size:.9em;
}
#placement {
width:750px;
margin:32px auto 32px auto;
height:400px;
}
.timeline-table {
/* In case JS fails, the table will still
display.
*/
width:750px;
margin:32px auto 32px auto;
border:1px solid black;
border-collapse:collapse;
}
.timeline-table td {
border:1px dotted #ccc;
padding:3px;
font-size:10px;
}
#toggle {
color:blue;
cursor:pointer;
font-weight:bold;
}
</style>
</head>
<body>
<h1>Timeglider timeline fed from HTML table</h1>
<div class='info'>
<p>Please view source to see how to construct the table for importing data. Code is commented.</p>
<p id='toggle'>Toggle view</p>
<p id='output'>...</p>
</div>
<!-- TIMEGLIDER PLACEMENT: Put the intended location for the timeline
directly above the data table -->
<div id='placement'></div>
<!-- TIMELINE PROPERTIES are set as attributes of the table element,
most importantly the id, focus_date, and initial_zoom -->
<table class='timeline-table' id="mylife" focus_date="1985-06-12" title="my life" initial_zoom="48" description="The Wild and Wooly times of Michael Richardson.">
<!-- The first row of the table is reserved for meta-data.
Class values below are *critical* for mapping out data from the
<td> elements that follow --- though order is not important.
The text in <td> elements is *not* critical: just the class names.
-->
<tr>
<th class="tg-startdate">start date</th>
<th class="tg-enddate">end date</th>
<th class="tg-title">title</th>
<th class="tg-description">description</th>
<th class="tg-icon">icon</th>
<th class="tg-date_limit">date limit</th>
<th class="tg-importance">importance</th>
<th class="tg-link">link</th>
</tr>
<!-- EVENTS ARE IN THE 2nd+ ROWS OF THE TABLE. While appropriate for viewing
as a visual table, order of rows is not important.
-->
<tr>
<td>1968-08-20</td>
<td></td>
<td>Born</td>
<td>Valley hospital in Ridgewood, NJ, to Martha & Steve Richardson.</td>
<td>circle_green.png</td>
<td> </td>
<td>50</td>
<td>http://www.ridgewoodnj.net/main.cfm</td>
</tr>
<tr>
<td>1982-09-01</td>
<td>1986-06-20</td>
<td>HHS</td>
<td>Hanover (NH) High School.</td>
<td>star_blue.png</td>
<td>da</td>
<td>32</td>
<td>http://hanoverhigh.us/Hanover/</td>
</tr>
<tr>
<td>1987-03-01</td>
<td>1987-07-20</td>
<td>Asia</td>
<td>Thailand, India, and Nepal</td>
<td>circle_orange.png</td>
<td>mo</td>
<td>32</td>
<td></td>
</tr>
<tr>
<td>1986-09-01</td>
<td>1992-06-01</td>
<td>Wesleyan</td>
<td>After six years of too little sex, too many drugs, and questionable rock and roll.</td>
<td>star_blue.png</td>
<td>da</td>
<td>32</td>
<td>http://wesleyan.edu</td>
</tr>
<tr>
<td>1995-09-05</td>
<td>today</td>
<td>Marriage</td>
<td></td>
<td>star_green.png</td>
<td>ye</td>
<td>45</td>
<td></td>
</tr>
</table>
<!-- 3rd party libs -->
<script src="js/jquery-1.4.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery-ui-1.8.9.custom.min.js" type="text/javascript" charset="utf-8"></script>
<!-- FRIEND LIBS -->
<script src="js/underscore-min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/backbone-min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.global.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.tmpl.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ba-debug.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ba-tinyPubSub.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.mousewheel.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.ui.ipad.js" type="text/javascript" charset="utf-8"></script>
<script src="js/raphael-min.js" type="text/javascript" charset="utf-8"></script>
<!-- TIMEGLIDER -->
<script src="js/timeglider/TG_Date.js" type="text/javascript" charset="utf-8"></script>
<script src="js/timeglider/TG_Org.js" type="text/javascript" charset="utf-8"></script>
<script src="js/timeglider/TG_Timeline.js" type="text/javascript" charset="utf-8"></script>
<script src="js/timeglider/TG_TimelineView.js" type="text/javascript" charset="utf-8"></script>
<script src="js/timeglider/TG_Mediator.js" type="text/javascript" charset="utf-8"></script>
<script src="js/timeglider/timeglider.timeline.widget.js" type="text/javascript" charset="utf-8"></script>
<script>
$(document).ready(function () {
var tld = "timeline";
var tg1 = $("#placement").timeline({
"min_zoom":18,
"max_zoom":55,
// data source is the id of the table!
"data_source":"#mylife"
});
$("#toggle").click(function () {
if (tld == "timeline") {
$("#placement").css({"display":"none"});
$(".timeline-table").css({"display":"block"});
tld = "table";
} else {
$("#placement").css({"display":"block"});
$(".timeline-table").css({"display":"none"});
tld = "timeline";
}
});
}); // end document-ready
</script>
</body>
</html>