37 lines
1.1 KiB
JavaScript
Executable File
37 lines
1.1 KiB
JavaScript
Executable File
var tl;
|
|
function onLoad() {
|
|
var eventSource = new Timeline.DefaultEventSource();
|
|
var bandInfos = [
|
|
Timeline.createBandInfo({
|
|
width: "70%",
|
|
intervalUnit: Timeline.DateTime.MONTH,
|
|
eventSource: eventSource,
|
|
date: "Jun 28 2005 00:00:00 GMT",
|
|
intervalPixels: 100
|
|
}),
|
|
Timeline.createBandInfo({
|
|
width: "30%",
|
|
intervalUnit: Timeline.DateTime.YEAR,
|
|
eventSource: eventSource,
|
|
date: "Jun 28 2006 00:00:00 GMT",
|
|
intervalPixels: 200
|
|
})
|
|
];
|
|
bandInfos[1].syncWith = 0;
|
|
bandInfos[1].highlight = true;
|
|
|
|
|
|
tl = Timeline.create(document.getElementById("tl"), bandInfos);
|
|
tl.loadXML("/time.xml", function(xml, url) {
|
|
eventSource.loadXML(xml, url);
|
|
});
|
|
}
|
|
var resizeTimerID = null;
|
|
function onResize() {
|
|
if (resizeTimerID == null) {
|
|
resizeTimerID = window.setTimeout(function() {
|
|
resizeTimerID = null;
|
|
tl.layout();
|
|
}, 500);
|
|
}
|
|
} |