Beautifully crafted timelines that are easy and intuitive to use. http://timeline.knightlab.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
12 KiB

11 years ago
/*
TimelineJS - ver. 2015-02-12-22-19-24 - 2015-02-12
Copyright (c) 2012-2013 Northwestern University
a project of the Northwestern University Knight Lab, originally created by Zach Wise
https://github.com/NUKnightLab/TimelineJS
11 years ago
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 years ago
*/
var embed_analytics="UA-537357-20";var load_time_start=(new Date).getTime(),the_load_time=0;var _gaq=_gaq||[];(function(){var ga=document.createElement("script"),s=document.getElementsByTagName("script")[0];ga.type="text/javascript";ga.async=true;if("https:"!=document.location.protocol){ga.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";s.parentNode.insertBefore(ga,s);_gaq.push(["_setAccount",embed_analytics]);_gaq.push(["_trackPageview"])}})();var getUrlVars=function(){var varobj={},url_vars=[],uv;url_vars=window.location.href.slice(window.location.href.indexOf("?")+1);if(url_vars.match("#")){url_vars=url_vars.split("#")[0]}url_vars=url_vars.split("&");for(var i=0;i<url_vars.length;i++){uv=url_vars[i].split("=");varobj[uv[0]]=uv[1]}return varobj};var onHeadline=function(e,headline){var the_page_title="/"+headline,the_page_url=location.href;document.title=headline;the_load_time=Math.floor(((new Date).getTime()-load_time_start)/100)/10;_gaq.push(["_trackEvent","Timeline",headline,the_page_url,the_load_time])};var url_config=getUrlVars();LazyLoad=function(doc){var env,head,pending={},pollCount=0,queue={css:[],js:[]},styleSheets=doc.styleSheets;function createNode(name,attrs){var node=doc.createElement(name),attr;for(attr in attrs){if(attrs.hasOwnProperty(attr)){node.setAttribute(attr,attrs[attr])}}return node}function finish(type){var p=pending[type],callback,urls;if(p){callback=p.callback;urls=p.urls;urls.shift();pollCount=0;if(!urls.length){callback&&callback.call(p.context,p.obj);pending[type]=null;queue[type].length&&load(type)}}}function getEnv(){var ua=navigator.userAgent;env={async:doc.createElement("script").async===true};(env.webkit=/AppleWebKit\//.test(ua))||(env.ie=/MSIE/.test(ua))||(env.opera=/Opera/.test(ua))||(env.gecko=/Gecko\//.test(ua))||(env.unknown=true)}function load(type,urls,callback,obj,context){var _finish=function(){finish(type)},isCSS=type==="css",nodes=[],i,len,node,p,pendingUrls,url;env||getEnv();if(urls){urls=typeof urls==="string"?[urls]:urls.concat();if(isCSS||env.async||env.gecko||env.opera){queue[type].push({urls:urls,callback:callback,obj:obj,context:context})}else{for(i=0,len=urls.length;i<len;++i){queue[type].push({urls:[urls[i]],callback:i===len-1?callback:null,obj:obj,context:context})}}}if(pending[type]||!(p=pending[type]=queue[type].shift())){return}head||(head=doc.head||doc.getElementsByTagName("head")[0]);pendingUrls=p.urls;for(i=0,len=pendingUrls.length;i<len;++i){url=pendingUrls[i];if(isCSS){node=env.gecko?createNode("style"):createNode("link",{href:url,rel:"stylesheet"})}else{node=createNode("script",{src:url});node.async=false}node.className="lazyload";node.setAttribute("charset","utf-8");if(env.ie&&!isCSS){node.onreadystatechange=function(){if(/loaded|complete/.test(node.readyState)){node.onreadystatechange=null;_finish()}}}else if(isCSS&&(env.gecko||env.webkit)){if(env.webkit){p.urls[i]=node.href;pollWebKit()}else{node.innerHTML='@import "'+url+'";';pollGecko(node)}}else{node.onload=node.onerror=_finish}nodes.push(node)}for(i=0,len=nodes.length;i<len;++i){head.appendChild(nodes[i])}}function pollGecko(node){var hasRules;try{hasRules=!!node.sheet.cssRules}catch(ex){pollCount+=1;if(pollCount<200){setTimeout(function(){pollGecko(node)},50)}else{hasRules&&finish("css")}return}finish("css")}function pollWebKit(){var css=pending.css,i;if(css){i=styleSheets.length;while(--i>=0){if(styleSheets[i].href===css.urls[0]){finish("css");break}}pollCount+=1;if(css){if(pollCount<200){setTimeout(pollWebKit,50)}else{finish("css")}}}}return{css:function(urls,callback,obj,context){load("css",urls,callback,obj,context)},js:function(urls,callback,obj,context){load("js",urls,callback,obj,context)}}}(this.document);LoadLib=function(doc){var loaded=[];function isLoaded(url){var i=0,has_loaded=false;for(i=0;i<loaded.length;i++){if(loaded[i]==url){has_loaded=true}}if(has_loaded){return true}else{loaded.push(url);return false}}return{css:function(urls,callback,obj,context){if(!isLoaded(urls)){LazyLoad.css(urls,callback,obj,context)}},js:function(urls,c