8 lines
172 KiB
JavaScript
8 lines
172 KiB
JavaScript
|
/* Timeline API 2.3.0
|
||
|
* Copyright Massachusetts Institute of Technology
|
||
|
* and Contributors 2006-2009 ~ Some rights reserved
|
||
|
* Timeline is open source software and is licensed
|
||
|
* under the BSD license.
|
||
|
* http://www.simile-widgets.org/timeline/
|
||
|
*/
|
||
|
(function(){var Timeline,SimileAjax;var loadMe=function(){Timeline=window.Timeline=new Object();Timeline.DateTime=window.SimileAjax.DateTime;try{(function(){if(typeof Timeline_urlPrefix=="string"){Timeline.urlPrefix=Timeline_urlPrefix;if(typeof Timeline_parameters=="string"){SimileAjax.parseURLParameters(Timeline_parameters)}}else{var heads=document.documentElement.getElementsByTagName("head");for(var h=0;h<heads.length;h++){var scripts=heads[h].getElementsByTagName("script");for(var s=0;s<scripts.length;s++){var url=scripts[s].src;var i=url.indexOf("timeline-2.3.0.js");if(i>=0){Timeline.urlPrefix=url.substr(0,i);var q=url.indexOf("?");if(q>0){SimileAjax.parseURLParameters(url.substr(q+1))}return}}}throw new Error("Failed to derive URL prefix for Timeline API code files")}})();var includeCssFiles=function(urlPrefix,filenames){SimileAjax.includeCssFiles(document,urlPrefix,filenames)};includeCssFiles(Timeline.urlPrefix,["timeline-2.3.0.css"]);Timeline.serverLocale="en";Timeline.clientLocale="en"}catch(e){alert(e)}};if(typeof SimileAjax=="undefined"){var SimileAjax=window.SimileAjax={loaded:false,loadingScriptsCount:0,error:null,params:{bundle:"true"}};SimileAjax.Platform=new Object();var getHead=function(doc){return doc.getElementsByTagName("head")[0]};SimileAjax.findScript=function(doc,substring){var heads=doc.documentElement.getElementsByTagName("head");for(var h=0;h<heads.length;h++){var node=heads[h].firstChild;while(node!=null){if(node.nodeType==1&&node.tagName.toLowerCase()=="script"){var url=node.src;var i=url.indexOf(substring);if(i>=0){return url}}node=node.nextSibling}}return null};SimileAjax.includeJavascriptFile=function(doc,url,onerror,charset){onerror=onerror||"";if(doc.body==null){try{var q="'"+onerror.replace(/'/g,"&apos")+"'";doc.write("<script src='"+url+"' onerror="+q+(charset?" charset='"+charset+"'":"")+" type='text/javascript'>"+onerror+"<\/script>");return}catch(e){}}var script=doc.createElement("script");if(onerror){try{script.innerHTML=onerror}catch(e){}script.setAttribute("onerror",onerror)}if(charset){script.setAttribute("charset",charset)}script.type="text/javascript";script.language="JavaScript";script.src=url;return getHead(doc).appendChild(script)};SimileAjax.includeCssFile=function(doc,url){if(doc.body==null){try{doc.write("<link rel='stylesheet' href='"+url+"' type='text/css'/>");return}catch(e){}}var link=doc.createElement("link");link.setAttribute("rel","stylesheet");link.setAttribute("type","text/css");link.setAttribute("href",url);getHead(doc).appendChild(link)};SimileAjax.includeCssFiles=function(doc,urlPrefix,filenames){for(var i=0;i<filenames.length;i++){SimileAjax.includeCssFile(doc,urlPrefix+filenames[i])}};SimileAjax.prefixURLs=function(urls,urlPrefix,suffixes){for(var i=0;i<suffixes.length;i++){urls.push(urlPrefix+suffixes[i])}};SimileAjax.parseURLParameters=function(url,to,types){to=to||{};types=types||{};if(typeof url=="undefined"){url=location.href}var q=url.indexOf("?");if(q<0){return to}url=(url+"#").slice(q+1,url.indexOf("#"));var params=url.split("&"),param,parsed={};var decode=window.decodeURIComponent||unescape;for(var i=0;param=params[i];i++){var eq=param.indexOf("=");var name=decode(param.slice(0,eq));var old=parsed[name];if(typeof old=="undefined"){old=[]}else{if(!(old instanceof Array)){old=[old]}}parsed[name]=old.concat(decode(param.slice(eq+1)))}for(var i in parsed){if(!parsed.hasOwnProperty(i)){continue}var type=types[i]||String;var data=parsed[i];if(!(data instanceof Array)){data=[data]}if(type===Boolean&&data[0]=="false"){to[i]=false}else{to[i]=type.apply(this,data)}}return to};SimileAjax.loaded=true}SimileAjax.version="pre 2.3.0";SimileAjax.jQuery=jQuery;SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};(function(){var C=navigator.appName.toLowerCase();var A=navigator.userAgent.toLowerCase();SimileAjax.Platform.os.isMac=(A.indexOf("mac")!=-1);SimileAjax.Platform.os.isWin=(A.indexOf("win")
|