westdc-zf1/htdocs/js/time.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

2009-12-20 07:55:31 +00:00
var tl;
var date = "Nov 22 2007 13:00:00";
var theme = Timeline.ClassicTheme.create();
theme.event.label.width = 250; // px
theme.event.bubble.width = 250;
theme.event.bubble.height = 200;
2009-12-20 06:35:29 +00:00
2009-12-20 07:55:31 +00:00
window.onload=function() {
var eventSource = new Timeline.DefaultEventSource();
var bandInfos = [
Timeline.createBandInfo({
width: "70%",
intervalUnit: Timeline.DateTime.MONTH,
eventSource: eventSource,
date: date,
intervalPixels: 100,
theme: theme
}),
Timeline.createBandInfo({
width: "30%",
intervalUnit: Timeline.DateTime.YEAR,
eventSource: eventSource,
date: date,
overview: true,
intervalPixels: 200,
2010-01-14 08:23:02 +00:00
theme: theme
2009-12-20 07:55:31 +00:00
})
];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
tl = Timeline.create(document.getElementById("tl"), bandInfos);
2010-01-14 08:23:02 +00:00
tl.loadXML("/time1.xml", function(xml, url) {
2009-12-20 07:55:31 +00:00
eventSource.loadXML(xml, url);
});
}
var resizeTimerID = null;
window.onresize=function() {
if (resizeTimerID == null) {
resizeTimerID = window.setTimeout(function() {
resizeTimerID = null;
tl.layout();
}, 500);
}
}