add glacier and yrnmr theme data in menu; add glaicer timeline js

This commit is contained in:
wlx 2012-11-03 09:58:20 +00:00
parent 53e48b23ca
commit 3f32fca1d6
2 changed files with 46 additions and 2 deletions

45
htdocs/js/glaciertime.js Normal file
View File

@ -0,0 +1,45 @@
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;
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,
theme: theme
})
];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
tl = Timeline.create(document.getElementById("tl"), bandInfos);
tl.loadXML("/glaciertime.xml", function(xml, url) {
eventSource.loadXML(xml, url);
});
}
var resizeTimerID = null;
window.onresize=function() {
if (resizeTimerID == null) {
resizeTimerID = window.setTimeout(function() {
resizeTimerID = null;
tl.layout();
}, 500);
}
}

View File

@ -2,8 +2,7 @@ function extractPageName(hrefString)
{
var arr = hrefString.split('/');
var result=(arr.length<3) ? hrefString : arr[3].toLowerCase();
if (result=='water') result='data';
if (result=='heihe') result='data';
if (result=='water' || result=='heihe' || result=='glacier' || result=='yrnmr') result='data';
if (result=='admin' && arr.length>=4) result+="/"+arr[4];
return result;
}