|
|
|
/*
|
|
|
|
TimelineJS - ver. 2015-06-10-16-17-35 - 2015-06-10
|
|
|
|
Copyright (c) 2012-2015 Northwestern University
|
|
|
|
a project of the Northwestern University Knight Lab, originally created by Zach Wise
|
|
|
|
https://github.com/NUKnightLab/TimelineJS
|
|
|
|
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/.
|
|
|
|
*/
|
|
|
|
(function(){var initializing=false,fnTest=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(prop){var _super=this.prototype;initializing=true;var prototype=new this;initializing=false;for(var name in prop){prototype[name]=typeof prop[name]=="function"&&typeof _super[name]=="function"&&fnTest.test(prop[name])?function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);this._super=tmp;return ret}}(name,prop[name]):prop[name]}function Class(){if(!initializing&&this.init)this.init.apply(this,arguments)}Class.prototype=prototype;Class.prototype.constructor=Class;Class.extend=arguments.callee;return Class}})();var global=function(){return this||(1,eval)("this")}();if(typeof VMM=="undefined"){var VMM=Class.extend({});VMM.debug=true;VMM.master_config={init:function(){return this},sizes:{api:{width:0,height:0}},vp:"Pellentesque nibh felis, eleifend id, commodo in, interdum vitae, leo",api_keys_master:{flickr:"RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==",google:"uQKadH1VMlCsp560gN2aOiMz4evWkl1s34yryl3F/9FJOsn+/948CbBUvKLN46U=",twitter:""},timers:{api:7e3},api:{pushques:[]},twitter:{active:false,array:[],api_loaded:false,que:[]},flickr:{active:false,array:[],api_loaded:false,que:[]},youtube:{active:false,array:[],api_loaded:false,que:[]},vimeo:{active:false,array:[],api_loaded:false,que:[]},vine:{active:false,array:[],api_loaded:false,que:[]},webthumb:{active:false,array:[],api_loaded:false,que:[]},googlemaps:{active:false,map_active:false,places_active:false,array:[],api_loaded:false,que:[]},googledocs:{active:false,array:[],api_loaded:false,que:[]},googleplus:{active:false,array:[],api_loaded:false,que:[]},wikipedia:{active:false,array:[],api_loaded:false,que:[],tries:0},soundcloud:{active:false,array:[],api_loaded:false,que:[]}}.init();VMM.createElement=function(tag,value,cName,attrs,styles){var ce="";if(tag!=null&&tag!=""){ce+="<"+tag;if(cName!=null&&cName!=""){ce+=" class='"+cName+"'"}if(attrs!=null&&attrs!=""){ce+=" "+attrs}if(styles!=null&&styles!=""){ce+=" style='"+styles+"'"}ce+=">";if(value!=null&&value!=""){ce+=value}ce=ce+"</"+tag+">"}return ce};VMM.createMediaElement=function(media,caption,credit){var ce="";var _valid=false;ce+="<div class='media'>";if(media!=null&&media!=""){valid=true;ce+="<img src='"+media+"'>";if(credit!=null&&credit!=""){ce+=VMM.createElement("div",credit,"credit")}if(caption!=null&&caption!=""){ce+=VMM.createElement("div",caption,"caption")}}ce+="</div>";return ce};VMM.hideUrlBar=function(){var win=window,doc=win.document;if(!location.hash||!win.addEventListener){window.scrollTo(0,1);var scrollTop=1,bodycheck=setInterval(function(){if(doc.body){clearInterval(bodycheck);scrollTop="scrollTop"in doc.body?doc.body.scrollTop:1;win.scrollTo(0,scrollTop===1?0:1)}},15);win.addEventListener("load",function(){setTimeout(function(){win.scrollTo(0,scrollTop===1?0:1)},0)},false)}}}function trace(msg){if(VMM.debug){if(window.console){console.log(msg)}else if(typeof jsTrace!="undefined"){jsTrace.send(msg)}else{}}}Date.prototype.getWeek=function(){var onejan=new Date(this.getFullYear(),0,1);return Math.ceil(((this-onejan)/864e5+onejan.getDay()+1)/7)};Date.prototype.getDayOfYear=function(){var onejan=new Date(this.getFullYear(),0,1);return Math.ceil((this-onejan)/864e5)};var is={Null:function(a){return a===null},Undefined:function(a){return a===undefined},nt:function(a){return a===null||a===undefined},Function:function(a){return typeof a==="function"?a.constructor.toString().match(/Function/)!==null:false},String:function(a){return typeof a==="string"?true:typeof a==="object"?a.constructor.toString().match(/string/i)!==null:false},Array:function(a){return typeof a==="object"?a.constructor.toString().match(/array/i)!==null||a.length!==undefined:false},Boolean:function(a){return typeof a==="boolean"?true:typeof a==="object"?a.constructor.toString().match(/boolean/i)!==null:false},Date:function(a){return typeof a==="date"?true:typeof a==="object"?a.constructor.toString().match(/date/i)!==null:false},HTML:fun
|
|
|
|
return text.replace(exp,"<a href='$1' target='_blank'>$3</a>")}var emailAddressPattern=/([a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)/gim;var twitterHandlePattern=/\B@([\w-]+)/gm;var twitterSearchPattern=/(#([\w]+))/g;return text.replace(url_pattern,url_replace).replace(pseudoUrlPattern,"$1<a target='_blank' class='hyphenate' onclick='void(0)' href='http://$2'>$2</a>").replace(emailAddressPattern,"<a target='_blank' onclick='void(0)' href='mailto:$1'>$1</a>").replace(twitterHandlePattern,"<a href='http://twitter.com/$1' target='_blank' onclick='void(0)'>@$1</a>")},linkify_wikipedia:function(text){var urlPattern=/<i[^>]*>(.*?)<\/i>/gim;return text.replace(urlPattern,"<a target='_blank' href='http://en.wikipedia.org/wiki/$&' onclick='void(0)'>$&</a>").replace(/<i\b[^>]*>/gim,"").replace(/<\/i>/gim,"").replace(/<b\b[^>]*>/gim,"").replace(/<\/b>/gim,"")},unlinkify:function(text){if(!text)return text;text=text.replace(/<a\b[^>]*>/i,"");text=text.replace(/<\/a>/i,"");return text},untagify:function(text){if(!text){return text}text=text.replace(/<\/?\s*\w.*?>/g,"");return text},nl2br:function(text){return text.replace(/(\r\n|[\r\n]|\\n|\\r)/g,"<br/>")},unique_ID:function(size){var getRandomNumber=function(range){return Math.floor(Math.random()*range)};var getRandomChar=function(){var chars="abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ";return chars.substr(getRandomNumber(62),1)};var randomID=function(size){var str="";for(var i=0;i<size;i++){str+=getRandomChar()}return str};return randomID(size)},isEven:function(n){return n%2===0?true:false},getUrlVars:function(string){var str=string.toString();if(str.match("&")){str=str.replace("&","&")}else if(str.match("&")){str=str.replace("&","&")}else if(str.match("&")){str=str.replace("&","&")}var vars=[],hash;var hashes=str.slice(str.indexOf("?")+1).split("&");for(var i=0;i<hashes.length;i++){hash=hashes[i].split("=");vars.push(hash[0]);vars[hash[0]]=hash[1]}return vars},toHTML:function(text){text=this.nl2br(text);text=this.linkify(text);return text.replace(/\s\s/g," ")},toCamelCase:function(s,forceLowerCase){if(forceLowerCase!==false)forceLowerCase=true;var sps=(forceLowerCase?s.toLowerCase():s).split(" ");for(var i=0;i<sps.length;i++){sps[i]=sps[i].substr(0,1).toUpperCase()+sps[i].substr(1)}return sps.join(" ")},properQuotes:function(str){return str.replace(/\"([^\"]*)\"/gi,"“$1”")},niceNumber:function(nStr){nStr+="";x=nStr.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,"$1"+","+"$2")}return x1+x2},toTitleCase:function(t){if(VMM.Browser.browser=="Explorer"&&parseInt(VMM.Browser.version,10)>=7){return t.replace("_","%20")}else{var __TitleCase={__smallWords:["a","an","and","as","at","but","by","en","for","if","in","of","on","or","the","to","v[.]?","via","vs[.]?"],init:function(){this.__smallRE=this.__smallWords.join("|");this.__lowerCaseWordsRE=new RegExp("\\b("+this.__smallRE+")\\b","gi");this.__firstWordRE=new RegExp("^([^a-zA-Z0-9 \\r\\n\\t]*)("+this.__smallRE+")\\b","gi");this.__lastWordRE=new RegExp("\\b("+this.__smallRE+")([^a-zA-Z0-9 \\r\\n\\t]*)$","gi")},toTitleCase:function(string){var line="";var split=string.split(/([:.;?!][ ]|(?:[ ]|^)["“])/);for(var i=0;i<split.length;++i){var s=split[i];s=s.replace(/\b([a-zA-Z][a-z.'’]*)\b/g,this.__titleCaseDottedWordReplacer);s=s.replace(this.__lowerCaseWordsRE,this.__lowerReplacer);s=s.replace(this.__firstWordRE,this.__firstToUpperCase);s=s.replace(this.__lastWordRE,this.__firstToUpperCase);line+=s}line=line.replace(/ V(s?)\. /g," v$1. ");line=line.replace(/(['’])S\b/g,"$1s");line=line.replace(/\b(AT&T|Q&A)\b/gi,this.__upperReplacer);return line},__titleCaseDottedWordReplacer:function(w){return w.match(/[a-zA-Z][.][a-zA-Z]/)?w:__TitleCase.__firstToUpperCase(w)},__lowerReplacer:function(w){return w.toLowerCase()},__upperReplacer:function(w){return w.toUpperCase()},__firstToUpperCase:function(w){var split=w.split(/(^[^a-zA-Z0-9]*
|
|
|
|
mediaElem+="</a></div>";VMM.attachElement("#googleplus_"+gplus.activity,mediaElem)});break}}}).error(function(jqXHR,textStatus,errorThrown){var error_obj=VMM.parseJSON(jqXHR.responseText);trace(error_obj.error.message);VMM.attachElement("#googleplus_"+gplus.activity,VMM.MediaElement.loadingmessage("<p>ERROR LOADING GOOGLE+ </p><p>"+error_obj.error.message+"</p>"))}).success(function(d){clearTimeout(googleplus_timeout);clearTimeout(callback_timeout);callback()})},pushQue:function(){if(VMM.master_config.googleplus.que.length>0){VMM.ExternalAPI.googleplus.create(VMM.master_config.googleplus.que[0],VMM.ExternalAPI.googleplus.pushQue);VMM.Util.removeRange(VMM.master_config.googleplus.que,0)}},errorTimeOut:function(gplus){trace("GOOGLE+ JSON ERROR TIMEOUT "+gplus.activity);VMM.attachElement("#googleplus_"+gplus.activity,VMM.MediaElement.loadingmessage("<p>Still waiting on GOOGLE+ </p><p>"+gplus.activity+"</p>"))}},googledocs:{get:function(m){VMM.master_config.googledocs.que.push(m);VMM.master_config.googledocs.active=true},create:function(m){var mediaElem="";if(m.id.match(/docs.google.com/i)){mediaElem="<iframe class='doc' frameborder='0' width='100%' height='100%' src='"+m.id+"&embedded=true'></iframe>"}else{mediaElem="<iframe class='doc' frameborder='0' width='100%' height='100%' src='"+"//docs.google.com/viewer?url="+m.id+"&embedded=true'></iframe>"}VMM.attachElement("#"+m.uid,mediaElem)},pushQue:function(){for(var i=0;i<VMM.master_config.googledocs.que.length;i++){VMM.ExternalAPI.googledocs.create(VMM.master_config.googledocs.que[i])}VMM.master_config.googledocs.que=[]}},flickr:{get:function(m){VMM.master_config.flickr.que.push(m);VMM.master_config.flickr.active=true},create:function(m,callback){var api_key,callback_timeout=setTimeout(callback,VMM.master_config.timers.api,m);if(typeof VMM.master_config.Timeline!="undefined"&&VMM.master_config.Timeline.api_keys.flickr!=""){api_key=VMM.master_config.Timeline.api_keys.flickr}else{api_key=Aes.Ctr.decrypt(VMM.master_config.api_keys_master.flickr,VMM.master_config.vp,256)}var the_url="https://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+api_key+"&photo_id="+m.id+"&format=json&jsoncallback=?";VMM.getJSON(the_url,function(d){var flickr_id=VMM.ExternalAPI.flickr.getFlickrIdFromUrl(d.sizes.size[0].url);var flickr_large_id="#"+m.uid,flickr_thumb_id="#"+m.uid+"_thumb";var flickr_img_size,flickr_img_thumb,flickr_size_found=false,flickr_best_size="Large";flickr_best_size=VMM.ExternalAPI.flickr.sizes(VMM.master_config.sizes.api.height);for(var i=0;i<d.sizes.size.length;i++){if(d.sizes.size[i].label==flickr_best_size){flickr_size_found=true;flickr_img_size=d.sizes.size[i].source}}if(!flickr_size_found){flickr_img_size=d.sizes.size[d.sizes.size.length-2].source}flickr_img_thumb=d.sizes.size[0].source;VMM.Lib.attr(flickr_large_id,"src",flickr_img_size);VMM.attachElement(flickr_thumb_id,"<img src='"+flickr_img_thumb+"'>")}).error(function(jqXHR,textStatus,errorThrown){trace("FLICKR error");trace("FLICKR ERROR: "+textStatus+" "+jqXHR.responseText)}).success(function(d){clearTimeout(callback_timeout);callback()})},pushQue:function(){if(VMM.master_config.flickr.que.length>0){VMM.ExternalAPI.flickr.create(VMM.master_config.flickr.que[0],VMM.ExternalAPI.flickr.pushQue);VMM.Util.removeRange(VMM.master_config.flickr.que,0)}},sizes:function(s){var _size="";if(s<=75){_size="Thumbnail"}else if(s<=180){_size="Small"}else if(s<=240){_size="Small 320"}else if(s<=375){_size="Medium"}else if(s<=480){_size="Medium 640"}else if(s<=600){_size="Large"}else{_size="Large"}return _size},getFlickrIdFromUrl:function(url){var idx=url.indexOf("flickr.com/photos/");if(idx==-1)return null;var pos=idx+"flickr.com/photos/".length;var photo_info=url.substr(pos);if(photo_info.indexOf("/")==-1)return null;if(photo_info.indexOf("/")==0)photo_info=photo_info.substr(1);return photo_info.split("/")[1]}},instagram:{get:function(m,thumb){if(thumb){return"//instagr.am/p/"+m.id+"/media/?size=t"}else{return"//instagr.am/p/"+m.id+"/media/?size="+VMM.ExternalAPI.instagram.sizes(VMM.master_config.sizes
|
|
|
|
}function buildSlides(d){var i=0;VMM.attachElement($slides_items,"");slides=[];for(i=0;i<d.length;i++){var _slide=new VMM.Slider.Slide(d[i],$slides_items);slides.push(_slide)}}function preloadSlides(skip){var i=0;if(skip){preloadTimeOutSlides()}else{for(i=0;i<slides.length;i++){slides[i].clearTimers()}timer=setTimeout(preloadTimeOutSlides,config.duration)}}function preloadTimeOutSlides(){var i=0;for(i=0;i<slides.length;i++){slides[i].enqueue=true}for(i=0;i<config.preload;i++){if(!(current_slide+i>slides.length-1)){slides[current_slide+i].show();slides[current_slide+i].enqueue=false}if(!(current_slide-i<0)){slides[current_slide-i].show();slides[current_slide-i].enqueue=false}}if(slides.length>50){for(i=0;i<slides.length;i++){if(slides[i].enqueue){slides[i].hide()}}}sizeSlides()}function sizeSlide(slide_id){}function sizeSlides(){var i=0,layout_text_media=".slider-item .layout-text-media .media .media-container ",layout_media=".slider-item .layout-media .media .media-container ",layout_both=".slider-item .media .media-container",layout_caption=".slider-item .media .media-container .media-shadow .caption",is_skinny=false,mediasize={text_media:{width:config.slider.content.width/100*60,height:config.slider.height-60,video:{width:0,height:0},text:{width:config.slider.content.width/100*40-30,height:config.slider.height}},media:{width:config.slider.content.width,height:config.slider.height-110,video:{width:0,height:0}}};if(VMM.Browser.device=="mobile"||current_width<641){is_skinny=true}VMM.master_config.sizes.api.width=mediasize.media.width;VMM.master_config.sizes.api.height=mediasize.media.height;mediasize.text_media.video=VMM.Util.ratio.fit(mediasize.text_media.width,mediasize.text_media.height,16,9);mediasize.media.video=VMM.Util.ratio.fit(mediasize.media.width,mediasize.media.height,16,9);VMM.Lib.css(".slider-item","width",config.slider.content.width);VMM.Lib.height(".slider-item",config.slider.height);if(is_skinny){mediasize.text_media.width=config.slider.content.width-config.slider.content.padding*2;mediasize.media.width=config.slider.content.width-config.slider.content.padding*2;mediasize.text_media.height=config.slider.height/100*50-50;mediasize.media.height=config.slider.height/100*70-40;mediasize.text_media.video=VMM.Util.ratio.fit(mediasize.text_media.width,mediasize.text_media.height,16,9);mediasize.media.video=VMM.Util.ratio.fit(mediasize.media.width,mediasize.media.height,16,9);VMM.Lib.css(".slider-item .layout-text-media .text","width","100%");VMM.Lib.css(".slider-item .layout-text-media .text","display","block");VMM.Lib.css(".slider-item .layout-text-media .text .container","display","block");VMM.Lib.css(".slider-item .layout-text-media .text .container","width",mediasize.media.width);VMM.Lib.css(".slider-item .layout-text-media .text .container .start","width","auto");VMM.Lib.css(".slider-item .layout-text-media .media","float","none");VMM.Lib.addClass(".slider-item .content-container","pad-top");VMM.Lib.css(".slider-item .media blockquote p","line-height","18px");VMM.Lib.css(".slider-item .media blockquote p","font-size","16px");VMM.Lib.css(".slider-item","overflow-y","auto")}else{VMM.Lib.css(".slider-item .layout-text-media .text","width","40%");VMM.Lib.css(".slider-item .layout-text-media .text","display","table-cell");VMM.Lib.css(".slider-item .layout-text-media .text .container","display","table-cell");VMM.Lib.css(".slider-item .layout-text-media .text .container","width","auto");VMM.Lib.css(".slider-item .layout-text-media .text .container .start","width",mediasize.text_media.text.width);VMM.Lib.removeClass(".slider-item .content-container","pad-top");VMM.Lib.css(".slider-item .layout-text-media .media","float","left");VMM.Lib.css(".slider-item .layout-text-media","display","table");VMM.Lib.css(".slider-item .media blockquote p","line-height","36px");VMM.Lib.css(".slider-item .media blockquote p","font-size","28px");VMM.Lib.css(".slider-item","display","table");VMM.Lib.css(".slider-item","overflow-y","auto")}VMM.Lib.css(layout_text_media+".media-frame","max-width",mediasize.text_media.width);VMM.Lib.heigh
|
|
|
|
}function createStructure(){$timeline=VMM.getElement(timeline_id);VMM.Lib.addClass($timeline,"vco-timeline");VMM.Lib.addClass($timeline,"vco-storyjs");$container=VMM.appendAndGetElement($timeline,"<div>","vco-container vco-main");$feature=VMM.appendAndGetElement($container,"<div>","vco-feature");$slider=VMM.appendAndGetElement($feature,"<div>","vco-slider");$navigation=VMM.appendAndGetElement($container,"<div>","vco-navigation");$feedback=VMM.appendAndGetElement($timeline,"<div>","vco-feedback","");if(typeof config.language.right_to_left!="undefined"){VMM.Lib.addClass($timeline,"vco-right-to-left")}slider=new VMM.Slider($slider,config);timenav=new VMM.Timeline.TimeNav($navigation);if(!has_width){config.width=VMM.Lib.width($timeline)}else{VMM.Lib.width($timeline,config.width)}if(!has_height){config.height=VMM.Lib.height($timeline)}else{VMM.Lib.height($timeline,config.height)}if(config.touch){VMM.Lib.addClass($timeline,"vco-touch")}else{VMM.Lib.addClass($timeline,"vco-notouch")}}function onDataReady(e,d){trace("onDataReady");data=d.timeline;if(type.of(data.era)!="array"){data.era=[]}buildDates()}function reSize(){updateSize();slider.setSize(config.feature.width,config.feature.height);timenav.setSize(config.width,config.height);if(orientationChange()){setViewport()}}function onSliderLoaded(e){config.loaded.slider=true;onComponentLoaded()}function onComponentLoaded(e){config.loaded.percentloaded=config.loaded.percentloaded+25;if(config.loaded.slider&&config.loaded.timenav){hideMessege()}}function onTimeNavLoaded(e){config.loaded.timenav=true;onComponentLoaded()}function onSlideUpdate(e){is_moving=true;config.current_slide=slider.getCurrentNumber();setHash(config.current_slide);timenav.setMarker(config.current_slide,config.ease,config.duration)}function onMarkerUpdate(e){is_moving=true;config.current_slide=timenav.getCurrentNumber();setHash(config.current_slide);slider.setSlide(config.current_slide)}function goToEvent(n){if(n<=_dates.length-1&&n>=0){config.current_slide=n;slider.setSlide(config.current_slide);timenav.setMarker(config.current_slide,config.ease,config.duration)}}function setHash(n){if(config.hash_bookmark){window.location.hash="#"+n.toString()}}function getViewport(){}function setViewport(){var viewport_content="",viewport_orientation=searchOrientation(window.orientation);if(VMM.Browser.device=="mobile"){if(viewport_orientation=="portrait"){viewport_content="width=device-width; initial-scale=0.5, maximum-scale=0.5"}else if(viewport_orientation=="landscape"){viewport_content="width=device-width; initial-scale=0.5, maximum-scale=0.5"}else{viewport_content="width=device-width, initial-scale=1, maximum-scale=1.0"}}else if(VMM.Browser.device=="tablet"){}if(document.getElementById("viewport")){}else{}}function searchOrientation(orientation){var orient="";if(orientation==0||orientation==180){orient="portrait"}else if(orientation==90||orientation==-90){orient="landscape"}else{orient="normal"}return orient}function orientationChange(){var orientation=searchOrientation(window.orientation);if(orientation==config.orientation){return false}else{config.orientation=orientation;return true}}this.init=function(c,_data){trace("INIT");setViewport();createConfig(c);createStructure();if(type.of(_data)=="string"){config.source=_data}VMM.Date.setLanguage(config.language);VMM.master_config.language=config.language;VMM.ExternalAPI.setKeys(config.api_keys);VMM.ExternalAPI.googlemaps.setMapType(config.maptype);VMM.bindEvent(global,onDataReady,config.events.data_ready);VMM.bindEvent(global,showMessege,config.events.messege);VMM.fireEvent(global,config.events.messege,config.language.messages.loading_timeline);if(VMM.Browser.browser=="Explorer"||VMM.Browser.browser=="MSIE"){if(parseInt(VMM.Browser.version,10)<=7&&(VMM.Browser.tridentVersion==null||VMM.Browser.tridentVersion<4)){ie7=true}}if(type.of(config.source)=="string"||type.of(config.source)=="object"){VMM.Timeline.DataObj.getData(config.source)}else{VMM.fireEvent(global,config.events.messege,"No data source provided")}};this.iframeLoaded=function(){trace("iframeLoaded")};this.reload=
|
|
|
|
}int_obj.date.setMonth(data[0].startdate.getMonth());int_obj.date.setDate(_first_date+inc_time)}else if(_interval.type=="hour"){if(_first_run){_first_date=data[0].startdate.getHours()}int_obj.date.setMonth(data[0].startdate.getMonth());int_obj.date.setDate(data[0].startdate.getDate());int_obj.date.setHours(_first_date+inc_time)}else if(_interval.type=="minute"){if(_first_run){_first_date=data[0].startdate.getMinutes()}int_obj.date.setMonth(data[0].startdate.getMonth());int_obj.date.setDate(data[0].startdate.getDate());int_obj.date.setHours(data[0].startdate.getHours());int_obj.date.setMinutes(_first_date+inc_time)}else if(_interval.type=="second"){if(_first_run){_first_date=data[0].startdate.getSeconds()}int_obj.date.setMonth(data[0].startdate.getMonth());int_obj.date.setDate(data[0].startdate.getDate());int_obj.date.setHours(data[0].startdate.getHours());int_obj.date.setMinutes(data[0].startdate.getMinutes());int_obj.date.setSeconds(_first_date+inc_time)}else if(_interval.type=="millisecond"){if(_first_run){_first_date=data[0].startdate.getMilliseconds()}int_obj.date.setMonth(data[0].startdate.getMonth());int_obj.date.setDate(data[0].startdate.getDate());int_obj.date.setHours(data[0].startdate.getHours());int_obj.date.setMinutes(data[0].startdate.getMinutes());int_obj.date.setSeconds(data[0].startdate.getSeconds());int_obj.date.setMilliseconds(_first_date+inc_time)}if(VMM.Browser.browser=="Firefox"){if(int_obj.date.getFullYear()=="1970"&&int_obj.date.getTimezoneOffset()!=_timezone_offset){trace("FIREFOX 1970 TIMEZONE OFFSET "+int_obj.date.getTimezoneOffset()+" SHOULD BE "+_timezone_offset);trace(_interval.type+" "+_interval.date);firefox.offset=int_obj.date.getTimezoneOffset()/60;firefox.flag=true;int_obj.date.setHours(int_obj.date.getHours()+firefox.offset)}else if(firefox.flag){firefox.flag=false;int_obj.date.setHours(int_obj.date.getHours()+firefox.offset);if(_is_year){firefox.flag=true}}}if(_is_year){if(int_obj.date.getFullYear()<0){int_obj.date_string=Math.abs(int_obj.date.getFullYear()).toString()+" B.C."}else{int_obj.date_string=int_obj.date.getFullYear()}}else{int_obj.date_string=VMM.Date.prettyDate(int_obj.date,true)}inc_time=inc_time+1;_first_run=false;int_obj.relative_pos=positionRelative(interval,int_obj.date);_last_pos=int_obj.relative_pos.begin;if(int_obj.relative_pos.begin>_largest_pos){_largest_pos=int_obj.relative_pos.begin}VMM.appendElement(int_obj.element,int_obj.date_string);VMM.Lib.css(int_obj.element,"text-indent",-(VMM.Lib.width(int_obj.element)/2));VMM.Lib.css(int_obj.element,"opacity","0");_array.push(int_obj)}VMM.Lib.width($timeintervalminor_minor,_largest_pos);positionInterval(_element_parent,_array)}function build(){var i=0,j=0;VMM.attachElement(layout,"");$timenav=VMM.appendAndGetElement(layout,"<div>","timenav");$content=VMM.appendAndGetElement($timenav,"<div>","content");$time=VMM.appendAndGetElement($timenav,"<div>","time");$timeintervalminor=VMM.appendAndGetElement($time,"<div>","time-interval-minor");$timeintervalminor_minor=VMM.appendAndGetElement($timeintervalminor,"<div>","minor");$timeintervalmajor=VMM.appendAndGetElement($time,"<div>","time-interval-major");$timeinterval=VMM.appendAndGetElement($time,"<div>","time-interval");$timebackground=VMM.appendAndGetElement(layout,"<div>","timenav-background");$timenavline=VMM.appendAndGetElement($timebackground,"<div>","timenav-line");$timenavindicator=VMM.appendAndGetElement($timebackground,"<div>","timenav-indicator");$timeintervalbackground=VMM.appendAndGetElement($timebackground,"<div>","timenav-interval-background","<div class='top-highlight'></div>");$toolbar=VMM.appendAndGetElement(layout,"<div>","vco-toolbar");buildInterval();buildMarkers();buildEras();calculateMultiplier();positionMarkers(false);positionEras();positionInterval($timeinterval,interval_array,false,true);positionInterval($timeintervalmajor,interval_major_array);if(config.start_page){$backhome=VMM.appendAndGetElement($toolbar,"<div>","back-home","<div class='icon'></div>");VMM.bindEvent(".back-home",onBackHome,"click");VMM.Lib.attribute($backhome,"title",VMM.master_con
|