diff --git a/locale/de.js b/locale/de.js index e8757a7..733203f 100644 --- a/locale/de.js +++ b/locale/de.js @@ -1,14 +1,13 @@ /* Verite * Verite JS Master - * Version: 0.5 - * Date: April 5, 2012 + * Version: 0.6 + * Date: April 26, 2012 * Copyright 2012 Verite unless part of Verite Timeline, * if part of Timeline then it inherits Timeline's license. * Designed and built by Zach Wise digitalartwork.net - * ----------------------------------------------------- *//* CodeKit Import -================================================== *//* Simple JavaScript Inheritance + * ----------------------------------------------------- *//* Simple JavaScript Inheritance * By John Resig http://ejohn.org/ * MIT Licensed. -================================================== */function trace(a){window.console?console.log(a):typeof jsTrace!="undefined"&&jsTrace.send(a)}function onYouTubePlayerAPIReady(){trace("GLOBAL YOUTUBE API CALLED");VMM.ExternalAPI.youtube.onAPIReady()}(function(){var a=!1,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(c){function g(){!a&&this.init&&this.init.apply(this,arguments)}var d=this.prototype;a=!0;var e=new this;a=!1;for(var f in c)e[f]=typeof c[f]=="function"&&typeof d[f]=="function"&&b.test(c[f])?function(a,b){return function(){var c=this._super;this._super=d[a];var e=b.apply(this,arguments);this._super=c;return e}}(f,c[f]):c[f];g.prototype=e;g.prototype.constructor=g;g.extend=arguments.callee;return g}})();var global=function(){return this||(1,eval)("this")}();if(typeof VMM=="undefined"){var VMM=Class.extend({});VMM.master_config={init:function(){return this},vp:"Pellentesque nibh felis, eleifend id, commodo in, interdum vitae, leo",keys:{flickr:"RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==",google:"jwNGnYw4hE9lmAez4ll0QD+jo6SKBJFknkopLS4FrSAuGfIwyj57AusuR0s8dAo="},youtube:{active:!1,array:[],api_loaded:!1,que:[]},googlemaps:{active:!1,map_active:!1,places_active:!1,array:[],api_loaded:!1,que:[]}}.init();VMM.createElement=function(a,b,c,d,e){var f="";if(a!=null&&a!=""){f+="<"+a;c!=null&&c!=""&&(f+=" class='"+c+"'");d!=null&&d!=""&&(f+=" "+d);e!=null&&e!=""&&(f+=" "+e);f+=">";b!=null&&b!=""&&(f+=b);f=f+""}return f};VMM.createMediaElement=function(a,b,c){var d="",e=!1;d+="
";if(a!=null&&a!=""){valid=!0;d+="";c!=null&&c!=""&&(d+=VMM.createElement("div",c,"credit"));b!=null&&b!=""&&(d+=VMM.createElement("div",b,"caption"))}d+="
";return d};VMM.attachElement=function(a,b){typeof jQuery!="undefined"&&$(a).html(b)};VMM.appendElement=function(a,b){typeof jQuery!="undefined"&&$(a).append(b)};VMM.getHTML=function(a){var b;if(typeof jQuery!="undefined"){b=jQuery(a).html();return b}};VMM.getElement=function(a,b){var c;if(typeof jQuery!="undefined"){b?c=jQuery(a).parent().get(0):c=jQuery(a).get(0);return c}};VMM.bindEvent=function(a,b,c,d){var e,f="click",g={};c!=null&&c!=""&&(f=c);g!=null&&g!=""&&(g=d);typeof jQuery!="undefined"&&jQuery(a).bind(f,g,b)};VMM.unbindEvent=function(a,b,c){var d,e="click",f={};c!=null&&c!=""&&(e=c);typeof jQuery!="undefined"&&jQuery(a).unbind(e,b)};VMM.fireEvent=function(a,b,c){var d,e="click",f=[];b!=null&&b!=""&&(e=b);c!=null&&c!=""&&(f=c);typeof jQuery!="undefined"&&jQuery(a).trigger(e,f)};VMM.getJSON=function(a,b,c){if(typeof jQuery!="undefined"){if(!(VMM.Browser.browser=="Explorer"&&parseInt(VMM.Browser.version,10)>=7&&window.XDomainRequest)){trace("getJSON");return jQuery.getJSON(a,b,c)}trace("it's ie");var d=a;if(d.match("^http://")){trace("RUNNING GET JSON");d=d.replace("http://","//");return jQuery.getJSON(a,b,c)}if(!d.match("^https://"))return jQuery.getJSON(a,b,c);trace("RUNNING XDR");d=d.replace("https://","http://");var e=new XDomainRequest;e.open("get",d);e.onload=function(){var a=VMM.parseJSON(e.responseText);trace(e.responseText);if(type.of(a)!="null"&&type.of(a)!="undefined")return b(a);trace("IE JSON ERROR")};e.send()}};VMM.parseJSON=function(a){if(typeof jQuery!="undefined")return jQuery.parseJSON(a)};VMM.appendAndGetElement=function(a,b,c,d){var e,f="
",g="",h="";b!=null&&b!=""&&(f=b);c!=null&&c!=""&&(g=c);d!=null&&d!=""&&(h=d);if(typeof jQuery!="undefined"){e=$(b);e.addClass(g);e.html(h);jQuery(a).append(e)}return e};VMM.Element={init:function(){return this},hide:function(a,b){b!=null&&b!=""?typeof jQuery!="undefined"&&jQuery(a).hide(b):typeof jQuery!="undefined"&&jQuery(a).hide()},remove:function(a){typeof jQuery!="undefined"&&jQuery(a).remove()},detach:function(a){typeof jQuery!="undefined"&&jQuery(a).detach()},append:function(a,b){typeof jQuery!="undefined"&&jQuery(a).append(b)},show:function(a,b){b!=null&&b!=""?typeof jQuery!="undefined"&&jQuery(a).show(b):typeof jQuery!="undefined"&&jQuery(a).show()},load:function(a,b,c){var d={elem:a};d!=null&&d!=""&&(d=c);typeof jQuery!="undefined"&&jQuery(a).load(d,b)},addClass:function(a,b){typeof jQuery!="undefined"&&jQuery(a).addClass(b)},removeClass:function(a,b){typeof jQuery!="undefined"&&jQuery(a).removeClass(b)},attr:function(a,b,c){if(c!=null&&c!="")typeof jQuery!="undefined"&&jQuery(a).attr(b,c);else if(typeof jQuery!="undefined")return jQuery(a).attr(b)},prop:function(a,b,c){typeof jQuery=="undefined"||!/[1-9]\.[3-9].[1-9]/.test($.fn.jquery)?VMM.Element.attribute(a,b,c):jQuery(a).prop(b,c)},attribute:function(a,b,c){if(c!=null&&c!="")typeof jQuery!="undefined"&&jQuery(a).attr(b,c);else if(typeof jQuery!="undefined")return jQuery(a).attr(b)},visible:function(a,b){if(b!=null)typeof jQuery!="undefined"&&(b?jQuery(a).show(0):jQuery(a).hide(0));else if(typeof jQuery!="undefined")return jQuery(a).is(":visible")?!0:!1},css:function(a,b,c){if(c!=null&&c!="")typeof jQuery!="undefined"&&jQuery(a).css(b,c);else if(typeof jQuery!="undefined")return jQuery(a).css(b)},cssmultiple:function(a,b){if(typeof jQuery!="undefined")return jQuery(a).css(b)},offset:function(a){var b;typeof jQuery!="undefined"&&(b=jQuery(a).offset());return b},position:function(a){var b;typeof jQuery!="undefined"&&(b=jQuery(a).position());return b},width:function(a,b){if(b!=null&&b!="")typeof jQuery!="undefined"&&jQuery(a).width(b);else if(typeof jQuery!="undefined")return jQuery(a).width()},height:function(a,b){if(b!=null&&b!="")typeof jQuery!="undefined"&&jQuery(a).height(b);else if(typeof jQuery!="undefined")return jQuery(a).height()},toggleClass:function(a,b){typeof jQuery!="undefined"&&jQuery(a).toggleClass(b)},each:function(a,b){typeof jQuery!="undefined"&&jQuery(a).each(b)},html:function(a,b){var c;if(typeof jQuery!="undefined"){c=jQuery(a).html();return c}if(b!=null&&b!="")typeof jQuery!="undefined"&&jQuery(a).html(b);else{var c;if(typeof jQuery!="undefined"){c=jQuery(a).html();return c}}},find:function(a,b){if(typeof jQuery!="undefined")return jQuery(a).find(b)},stop:function(a){typeof jQuery!="undefined"&&jQuery(a).stop()},animate:function(a,b,c,d,e){var f="easein",g=1e3,h={};b!=null&&(b<1?g=1:g=Math.round(b));c!=null&&c!=""&&(f=c);d!=null?h=d:h={opacity:0};if(VMM.Browser.device=="mobile"||VMM.Browser.device=="tablet"){var i=Math.round(g/1500*10)/10,j=i+"s";VMM.Element.css(a,"-webkit-transition","all "+j+" ease");VMM.Element.css(a,"-moz-transition","all "+j+" ease");VMM.Element.css(a,"-o-transition","all "+j+" ease");VMM.Element.css(a,"-ms-transition","all "+j+" ease");VMM.Element.css(a,"transition","all "+j+" ease");VMM.Element.cssmultiple(a,h)}else typeof jQuery!="undefined"&&(e!=null&&e!=""?jQuery(a).animate(h,{queue:!1,duration:g,easing:f,complete:e}):jQuery(a).animate(h,{queue:!1,duration:g,easing:f}))}}.init();VMM.TouchSlider={createPanel:function(a,b,c,d,e,f){VMM.TouchSlider.vertical=!1;VMM.TouchSlider.vertical=e;var g=d;VMM.TouchSlider.width=c;VMM.TouchSlider.height=f;VMM.TouchSlider.makeTouchable(a,b)},removePanel:function(a){VMM.unbindEvent(a,VMM.TouchSlider.onTouchStart,"touchstart");VMM.unbindEvent(a,VMM.TouchSlider.onTouchMove,"touchmove");VMM.unbindEvent(a,VMM.TouchSlider.onTouchEnd,"touchend")},makeTouchable:function(a,b){VMM.bindEvent(a,VMM.TouchSlider.onTouchStart,"touchstart",{element:b});VMM.bindEvent(a,VMM.TouchSlider.onTouchMove,"touchmove",{element:b});VMM.bindEvent(a,VMM.TouchSlider.onTouchEnd,"touchend",{element:b})},onTouchStart:function(a){VMM.TouchSlider.touchStart(a.data.element,a);a.preventDefault();a.stopPropagation();return!0},onTouchEnd:function(a){a.preventDefault();a.stopPropagation();if(VMM.TouchSlider.sliding){VMM.TouchSlider.sliding=!1;VMM.TouchSlider.touchEnd(a.data.element,a);return!1}return!0},onTouchMove:function(a){VMM.TouchSlider.touchMove(a.data.element,a);a.preventDefault();a.stopPropagation();return!1},getLeft:function(a){return parseInt(VMM.Element.css(a,"left").substring(0,VMM.Element.css(a,"left").length-2),10)},getTop:function(a){return parseInt(VMM.Element.css(a,"top").substring(0,VMM.Element.css(a,"top").length-2),10)},touchStart:function(a,b){VMM.Element.css(a,"-webkit-transition-duration","0");VMM.TouchSlider.startX=b.originalEvent.touches[0].screenX;VMM.TouchSlider.startY=b.originalEvent.touches[0].screenY;VMM.TouchSlider.startLeft=VMM.TouchSlider.getLeft(a);VMM.TouchSlider.startTop=VMM.TouchSlider.getTop(a);VMM.TouchSlider.touchStartTime=(new Date).getTime()},touchEnd:function(a,b){if(VMM.TouchSlider.getLeft(a)>0){VMM.TouchSlider.vertical?VMM.Element.animate(a,1e3,"",{top:0}):VMM.Element.animate(a,1e3,"",{left:0});VMM.TouchSlider.startX=null;VMM.TouchSlider.startY=null;VMM.fireEvent(a,"TOUCHUPDATE",[0])}else VMM.TouchSlider.slideMomentum(a,b)},slideMomentum:function(a,b){var c=((new Date).getTime()-VMM.TouchSlider.touchStartTime)*10,d=c,e=VMM.TouchSlider.getLeft(a),f=VMM.TouchSlider.getTop(a),g=6e3*(Math.abs(VMM.TouchSlider.startLeft)-Math.abs(e)),h=6e3*(Math.abs(VMM.TouchSlider.startTop)-Math.abs(f));c=Math.round(g/c);slideAdjustY=Math.round(h/c);var i=c+e,j=slideAdjustY+f,k=j%VMM.TouchSlider.height,l=i%VMM.TouchSlider.width,m={top:Math.min(0,j),left:Math.min(0,i),time:d};VMM.fireEvent(a,"TOUCHUPDATE",[m]);VMM.TouchSlider.startX=null;VMM.TouchSlider.startY=null},doSlide:function(a,b,c){VMM.Element.css(a,"-webkit-transition-property","left");VMM.Element.css(a,"-webkit-transition-duration",c);VMM.Element.css(a,"left",b)},touchMove:function(a,b){!!VMM.TouchSlider.sliding;VMM.TouchSlider.sliding=!0;if(VMM.TouchSlider.vertical)if(VMM.TouchSlider.startY>b.originalEvent.touches[0].screenY){VMM.Element.css(a,"top",-(VMM.TouchSlider.startY-b.originalEvent.touches[0].screenY-VMM.TouchSlider.startTop));VMM.TouchSlider.slidingTop=!0}else{var c=b.originalEvent.touches[0].screenY-VMM.TouchSlider.startY+VMM.TouchSlider.startTop;VMM.Element.css(a,"top",-(VMM.TouchSlider.startY-b.originalEvent.touches[0].screenY-VMM.TouchSlider.startTop));VMM.TouchSlider.slidingTop=!1}else if(VMM.TouchSlider.startX>b.originalEvent.touches[0].screenX){VMM.Element.css(a,"left",-(VMM.TouchSlider.startX-b.originalEvent.touches[0].screenX-VMM.TouchSlider.startLeft));VMM.TouchSlider.slidingLeft=!0}else{var d=b.originalEvent.touches[0].screenX-VMM.TouchSlider.startX+VMM.TouchSlider.startLeft;VMM.Element.css(a,"left",-(VMM.TouchSlider.startX-b.originalEvent.touches[0].screenX-VMM.TouchSlider.startLeft));VMM.TouchSlider.slidingLeft=!1}}};VMM.hideUrlBar=function(){var a=window,b=a.document;if(!location.hash||!a.addEventListener){window.scrollTo(0,1);var c=1,d=setInterval(function(){if(b.body){clearInterval(d);c="scrollTop"in b.body?b.body.scrollTop:1;a.scrollTo(0,c===1?0:1)}},15);a.addEventListener("load",function(){setTimeout(function(){a.scrollTo(0,c===1?0:1)},0)},!1)}};VMM.DragSlider={createPanel:function(a,b,c,d,e){var f=d;VMM.DragSlider.width=c;VMM.DragSlider.makeDraggable(a,b);VMM.DragSlider.drag_elem=a;VMM.DragSlider.sticky=e},makeDraggable:function(a,b){VMM.bindEvent(a,VMM.DragSlider.onDragStart,"mousedown",{element:b,delement:a});VMM.bindEvent(a,VMM.DragSlider.onDragEnd,"mouseup",{element:b,delement:a});VMM.bindEvent(a,VMM.DragSlider.onDragLeave,"mouseleave",{element:b,delement:a})},cancelSlide:function(a){VMM.unbindEvent(VMM.DragSlider.drag_elem,VMM.DragSlider.onDragMove,"mousemove");return!0},onDragLeave:function(a){VMM.unbindEvent(a.data.delement,VMM.DragSlider.onDragMove,"mousemove");a.preventDefault();a.stopPropagation();return!0},onDragStart:function(a){VMM.DragSlider.dragStart(a.data.element,a.data.delement,a);a.preventDefault();a.stopPropagation();return!0},onDragEnd:function(a){a.preventDefault();a.stopPropagation();if(VMM.DragSlider.sliding){VMM.DragSlider.sliding=!1;VMM.DragSlider.dragEnd(a.data.element,a.data.delement,a);return!1}return!0},onDragMove:function(a){VMM.DragSlider.dragMove(a.data.element,a);a.preventDefault();a.stopPropagation();return!1},dragStart:function(a,b,c){VMM.DragSlider.startX=c.pageX;VMM.DragSlider.startLeft=VMM.DragSlider.getLeft(a);VMM.DragSlider.dragStartTime=(new Date).getTime();VMM.DragSlider.dragWidth=VMM.Element.width(b);var d=Math.round(VMM.DragSlider.startX-c.pageX-VMM.DragSlider.startLeft);VMM.Element.stop(a);VMM.bindEvent(b,VMM.DragSlider.onDragMove,"mousemove",{element:a})},dragEnd:function(a,b,c){VMM.unbindEvent(b,VMM.DragSlider.onDragMove,"mousemove");VMM.DragSlider.getLeft(a)>0||VMM.DragSlider.dragMomentum(a,c)},dragMove:function(a,b){!!VMM.DragSlider.sliding;VMM.DragSlider.sliding=!0;if(VMM.DragSlider.startX>b.pageX){VMM.Element.css(a,"left",-(VMM.DragSlider.startX-b.pageX-VMM.DragSlider.startLeft));VMM.DragSlider.slidingLeft=!0}else{var c=b.pageX-VMM.DragSlider.startX+VMM.DragSlider.startLeft;VMM.Element.css(a,"left",-(VMM.DragSlider.startX-b.pageX-VMM.DragSlider.startLeft));VMM.DragSlider.slidingLeft=!1}},dragMomentum:function(a,b){var c=((new Date).getTime()-VMM.DragSlider.dragStartTime)*10,d=c,e=VMM.DragSlider.getLeft(a),f=6e3*(Math.abs(VMM.DragSlider.startLeft)-Math.abs(e));c=Math.round(f/c);var g=e+c,h=g%VMM.DragSlider.width,i={left:Math.min(g),time:d};VMM.fireEvent(a,"DRAGUPDATE",[i]);var j="easeOutExpo";i.time>0&&VMM.Element.animate(a,i.time,j,{left:i.left})},getLeft:function(a){return parseInt(VMM.Element.css(a,"left").substring(0,VMM.Element.css(a,"left").length-2),10)}};VMM.Browser={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";this.device=this.searchDevice(navigator.userAgent)},searchDevice:function(a){return a.match(/Android/i)||a.match(/iPhone|iPod/i)?"mobile":a.match(/iPad/i)?"tablet":a.match(/BlackBerry/i)||a.match(/IEMobile/i)?"other mobile":"desktop"},searchString:function(a){for(var b=0;b
";return d}if(e.type=="flickr"){d="
";return d}if(e.type=="youtube"){d="
";return d}if(e.type!="googledoc"){if(e.type=="vimeo"){d="
";return d}if(e.type=="twitter"){d="
";return d}if(e.type=="twitter-ready"){d="
";return d}if(e.type=="soundcloud"){d="
";return d}if(e.type=="google-map"){d="
";return d}if(e.type=="unknown"){d="";return d}if(e.type=="website"){d="
";return d}d="
";return d}d=""}},create:function(a,b,c,d,e){_return=c;_w=500;_h=400;$mediacontainer=a;var f=!1;d!=null&&d!=""&&(_w=d);e!=null&&e!=""&&(_h=e);if(b.media!=null&&b.media!=""){f=!0;var g="",h="",i="",j={},k=_h-50,l=!1;b.credit!=null&&b.credit!=""&&(i="
"+VMM.Util.linkify_with_twitter(b.credit,"_blank")+"
");b.caption!=null&&b.caption!=""&&(h="
"+VMM.Util.linkify_with_twitter(b.caption,"_blank")+"
");j=VMM.MediaType(b.media);if(j.type=="image")g="";else if(j.type=="flickr"){var m="flickr_"+j.id;g="";VMM.ExternalAPI.flickr.getPhoto(j.id,"#"+m)}else if(j.type=="googledoc")j.id.match(/docs.google.com/i)?g="":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="
Loading Tweet
";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f

",f=VMM.Util.linkify_with_twitter(a.text,"_blank");e+=f;e+="

";e+="— "+a.user.name+" (@"+a.user.screen_name+") "+VMM.ExternalAPI.twitter.prettyParseTwitterDate(a.created_at)+"
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b

",f=VMM.Util.linkify_with_twitter(a.results[b].text,"_blank");d+=f;d+="

";d+="— "+a.results[b].from_user_name+" (@"+a.results[b].from_user+") "+VMM.ExternalAPI.twitter.prettyParseTwitterDate(a.results[b].created_at)+"
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,""; + } else { + mediaElem = ""; + } + + + } else if (m.type == "youtube") { + mediaElem = "
Loading YouTube video...
"; + VMM.ExternalAPI.youtube.init(m.id); + //mediaElem = ""; + } else if (m.type == "vimeo") { + mediaElem = ""; + } else if (m.type == "twitter"){ + mediaElem = ""; + //VMM.ExternalAPI.twitter.getHTML(m.id); + trace("TWITTER"); + VMM.ExternalAPI.twitter.prettyHTML(m.id); + isTextMedia = true; + } else if (m.type == "twitter-ready") { + mediaElem = m.id; + } else if (m.type == "soundcloud") { + var soundcloud_id = "soundcloud_" + VMM.Util.unique_ID(5); + mediaElem = "
Loading Sound
"; + VMM.ExternalAPI.soundcloud.getSound(m.id, soundcloud_id) + } else if (m.type == "google-map") { + //mediaElem = "" + var map_id = "googlemap_" + VMM.Util.unique_ID(7); + mediaElem = "
Loading Map...
"; + VMM.ExternalAPI.googlemaps.getMap(m.id, map_id); + } else if (m.type == "unknown") { + trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML"); + mediaElem = VMM.Util.properQuotes(m.id); + } else if (m.type == "website") { + mediaElem = ""; + //mediaElem = "" + ""; + } else { + trace("NO KNOWN MEDIA TYPE FOUND"); + trace(m.type); + } + // WRAP THE MEDIA ELEMENT + mediaElem = "
" + mediaElem + creditElem + captionElem + "
"; + + if (_return) { + if (isTextMedia) { + return "
" + mediaElem + "
"; + } else { + return "
" + mediaElem + "
"; + } + } else { + VMM.appendElement($mediacontainer, mediaElem); + VMM.appendElement($mediacontainer, creditElem); + VMM.appendElement($mediacontainer, captionElem); + } + }; + + }, + + }).init(); +} \ No newline at end of file diff --git a/source/js/VMM.MediaType.js b/source/js/VMM.MediaType.js new file mode 100644 index 0000000..ee1ec95 --- /dev/null +++ b/source/js/VMM.MediaType.js @@ -0,0 +1,98 @@ +/* MediaType +================================================== */ +if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') { + + //VMM.mediaType.youtube(d); //should return a true or false + // VMM.MediaType(url); //returns an object with .type and .id + + VMM.MediaType = function(d) { + var success = false; + var media = {}; + if (d.match("div class='twitter'")) { + media.type = "twitter-ready"; + media.id = d; + success = true; + } else if (d.match('(www.)?youtube|youtu\.be')) { + if (d.match('v=')) { + youtube_id = VMM.Util.getUrlVars(d)["v"]; + //youtube_id = d.split(/embed\//)[1].split('"')[0]; + } else { + youtube_id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; + } + //youtube_id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; + // http://www.youtube.com/watch?feature=player_embedded&v=0l-ivcnLrSc + //http://www.youtube.com/watch?v=0l-ivcnLrSc + media.type = "youtube"; + media.id = youtube_id; + success = true; + } else if (d.match('(player.)?vimeo\.com')) { + //vimeo_id = d.split(/video\/|http:\/\/vimeo\.com\//)[1].split(/[?&]/)[0]; + vimeo_id = d.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0]; + + media.type = "vimeo"; + media.id = vimeo_id; + success = true; + } else if (d.match('(player.)?soundcloud\.com')) { + //soundcloud_url = unescape(d.split(/value="/)[1].split(/["]/)[0]); + //soundcloud_id = soundcloud_url.split(/tracks\//)[1].split(/[&"]/)[0]; + media.type = "soundcloud"; + media.id = d; + success = true; + } else if (d.match('(www.)?twitter\.com')) { + trace("TWITTER MATCH"); + // https://twitter.com/#!/twitterapi/statuses/133640144317198338 + // https://twitter.com/#!/DeliciousHot/status/23189589820702720 + if (d.match("status\/")) { + twitter_id = d.split("status\/")[1]; + } else if (d.match("statuses\/")) { + twitter_id = d.split("statuses\/")[1]; + } else { + twitter_id = ""; + } + + media.type = "twitter"; + media.id = twitter_id; + success = true; + } else if (d.match("maps.google")) { + //maps.google.com + media.type = "google-map"; + media.id = d.split(/src=['|"][^'|"]*?['|"]/gi); + //trace("google map " + media.id); + success = true; + } else if (d.match("flickr.com/photos")) { + media.type = "flickr"; + //media.id = d.split('/photos/[^/]+/([0-9]+)/gi'); + + media.id = d.split("photos\/")[1].split("/")[1]; + media.link = d; + //media.id = media.id.split("/")[1]; + //trace("FLICKR " + media.id); + success = true; + } else if (d.match(/jpg|jpeg|png|gif/i)) { + media.type = "image"; + media.id = d; + success = true; + } else if (VMM.FileExtention.googleDocType(d)) { + media.type = "googledoc"; + media.id = d; + success = true; + } else if (d.indexOf('http://') == 0) { + media.type = "website"; + media.id = d; + success = true; + } else { + trace("unknown media"); + media.type = "unknown"; + media.id = d; + success = true; + } + + if (success) { + return media; + } else { + trace("No valid media id detected"); + trace(d); + } + return false; + } +} \ No newline at end of file diff --git a/source/js/VMM.Core.js b/source/js/VMM.Slider.js similarity index 99% rename from source/js/VMM.Core.js rename to source/js/VMM.Slider.js index c09dd4f..e221bec 100644 --- a/source/js/VMM.Core.js +++ b/source/js/VMM.Slider.js @@ -1,7 +1,3 @@ -/* Core -================================================== */ - - /* Slider ================================================== */ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') { diff --git a/source/js/VMM.TImeline.Min.js b/source/js/VMM.TImeline.Min.js index d5dccae..8e9c44a 100644 --- a/source/js/VMM.TImeline.Min.js +++ b/source/js/VMM.TImeline.Min.js @@ -1,3 +1,6 @@ +/* Timeline Minified +================================================== */ + /* CodeKit Import http://incident57.com/codekit/ ================================================== */ diff --git a/source/js/VMM.Timeline.DataObj.js b/source/js/VMM.Timeline.DataObj.js new file mode 100644 index 0000000..244fb56 --- /dev/null +++ b/source/js/VMM.Timeline.DataObj.js @@ -0,0 +1,334 @@ +/* TIMELINE SOURCE DATA PROCESSOR +================================================== */ + +if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.DataObj == 'undefined') { + + VMM.Timeline.DataObj = { + + data_obj: {}, + + model_array: [], + + getData: function(raw_data) { + + data = VMM.Timeline.DataObj.data_obj; + + + if (type.of(raw_data) != "string") { + + trace("DATA SOURCE: NOT JSON"); + trace("TRYING HTML PARSE"); + VMM.Timeline.DataObj.parseHTML(raw_data); + + } else { + + if (raw_data.match("%23")) { + + trace("DATA SOURCE: TWITTER SEARCH"); + VMM.Timeline.DataObj.model_Tweets.getData("%23medill"); + + } else if ( raw_data.match("spreadsheet") ) { + + trace("DATA SOURCE: GOOGLE SPREADSHEET"); + VMM.Timeline.DataObj.model_GoogleSpreadsheet.getData(raw_data); + + } else { + + trace("DATA SOURCE: JSON"); + VMM.getJSON(raw_data, VMM.Timeline.DataObj.parseJSON); + + } + + } + + }, + + parseHTML: function(d) { + trace("parseHTML"); + + var _data_obj = VMM.Timeline.DataObj.data_template_obj; + + /* Timeline start slide + ================================================== */ + if (VMM.Element.find("#timeline section", "time")[0]) { + _data_obj.timeline.startDate = VMM.Element.html(VMM.Element.find("#timeline section", "time")[0]); + _data_obj.timeline.headline = VMM.Element.html(VMM.Element.find("#timeline section", "h2")); + _data_obj.timeline.text = VMM.Element.html(VMM.Element.find("#timeline section", "article")); + + var found_main_media = false; + + if (VMM.Element.find("#timeline section", "figure img").length != 0) { + found_main_media = true; + _data_obj.timeline.asset.media = VMM.Element.attr(VMM.Element.find("#timeline section", "figure img"), "src"); + } else if (VMM.Element.find("#timeline section", "figure a").length != 0) { + found_main_media = true; + _data_obj.timeline.asset.media = VMM.Element.attr(VMM.Element.find("#timeline section", "figure a"), "href"); + } else { + //trace("NOT FOUND"); + } + + if (found_main_media) { + if (VMM.Element.find("#timeline section", "cite").length != 0) { + _data_obj.timeline.asset.credit = VMM.Element.html(VMM.Element.find("#timeline section", "cite")); + } + if (VMM.Element.find(this, "figcaption").length != 0) { + _data_obj.timeline.asset.caption = VMM.Element.html(VMM.Element.find("#timeline section", "figcaption")); + } + } + } + + /* Timeline Date Slides + ================================================== */ + VMM.Element.each("#timeline li", function(i, elem){ + + var valid_date = false; + + var _date = { + "type":"default", + "startDate":"", + "headline":"", + "text":"", + "asset": + { + "media":"", + "credit":"", + "caption":"" + }, + "tags":"Optional" + }; + + if (VMM.Element.find(this, "time") != 0) { + + valid_date = true; + + _date.startDate = VMM.Element.html(VMM.Element.find(this, "time")[0]); + + if (VMM.Element.find(this, "time")[1]) { + _date.endDate = VMM.Element.html(VMM.Element.find(this, "time")[0]); + } + + _date.headline = VMM.Element.html(VMM.Element.find(this, "h3")); + + _date.text = VMM.Element.html(VMM.Element.find(this, "article")); + + var found_media = false; + if (VMM.Element.find(this, "figure img").length != 0) { + found_media = true; + _date.asset.media = VMM.Element.attr(VMM.Element.find(this, "figure img"), "src"); + } else if (VMM.Element.find(this, "figure a").length != 0) { + found_media = true; + _date.asset.media = VMM.Element.attr(VMM.Element.find(this, "figure a"), "href"); + } else { + //trace("NOT FOUND"); + } + + if (found_media) { + if (VMM.Element.find(this, "cite").length != 0) { + _date.asset.credit = VMM.Element.html(VMM.Element.find(this, "cite")); + } + if (VMM.Element.find(this, "figcaption").length != 0) { + _date.asset.caption = VMM.Element.html(VMM.Element.find(this, "figcaption")); + } + } + + trace(_date); + _data_obj.timeline.date.push(_date); + + } + + }); + + VMM.fireEvent(global, "DATAREADY", _data_obj); + + }, + + parseJSON: function(d) { + + if (d.timeline.type == "default") { + + trace("DATA SOURCE: JSON STANDARD TIMELINE"); + + VMM.fireEvent(global, "DATAREADY", d); + //return _data_obj.timeline; + + } else if (d.timeline.type == "twitter") { + + trace("DATA SOURCE: JSON TWEETS"); + + VMM.Timeline.DataObj.model_Tweets.buildData(d); + + + } else { + trace("DATA SOURCE: NO IDEA"); + trace(type.of(d.timeline)); + }; + + }, + + /* MODEL OBJECTS + New Types of Data can be formatted for the timeline here + ================================================== */ + + model_Tweets: { + + type: "twitter", + + buildData: function(raw_data) { + + VMM.bindEvent(global, VMM.Timeline.DataObj.model_Tweets.onTwitterDataReady, "TWEETSLOADED"); + VMM.ExternalAPI.twitter.getTweets(raw_data.timeline.tweets); + + }, + + getData: function(raw_data) { + + VMM.bindEvent(global, VMM.Timeline.DataObj.model_Tweets.onTwitterDataReady, "TWEETSLOADED"); + VMM.ExternalAPI.twitter.getTweetSearch(raw_data); + + }, + + onTwitterDataReady: function(e, d) { + + var _data_obj = VMM.Timeline.DataObj.data_template_obj; + + for(var i = 0; i < d.tweetdata.length; i++) { + + var _date = { + "type":"tweets", + "startDate":"", + "headline":"", + "text":"", + "asset": + { + "media":"", + "credit":"", + "caption":"" + }, + "tags":"Optional" + }; + // pass in the 'created_at' string returned from twitter // + // stamp arrives formatted as Tue Apr 07 22:52:51 +0000 2009 // + + //var twit_date = VMM.ExternalAPI.twitter.parseTwitterDate(d.tweetdata[i].raw.created_at); + //trace(twit_date); + _date.startDate = d.tweetdata[i].raw.created_at; + + if (type.of(d.tweetdata[i].raw.from_user_name)) { + _date.headline = d.tweetdata[i].raw.from_user_name + " (" + "@" + d.tweetdata[i].raw.from_user + ")" ; + } else { + _date.headline = d.tweetdata[i].raw.user.name + " (" + "@" + d.tweetdata[i].raw.user.screen_name + ")" ; + + } + + _date.asset.media = d.tweetdata[i].content; + _data_obj.timeline.date.push(_date); + + }; + + VMM.fireEvent(global, "DATAREADY", _data_obj); + + } + }, + + model_GoogleSpreadsheet: { + + /* + TEMPLATE CAN BE FOUND HERE + https://docs.google.com/previewtemplate?id=0AppSVxABhnltdEhzQjQ4MlpOaldjTmZLclQxQWFTOUE&mode=public + + */ + type: "google spreadsheet", + + getData: function(raw_data) { + var _key = VMM.Util.getUrlVars(raw_data)["key"]; + var _url = "https://spreadsheets.google.com/feeds/list/" + _key + "/od6/public/values?alt=json"; + VMM.getJSON(_url, VMM.Timeline.DataObj.model_GoogleSpreadsheet.buildData); + + }, + + buildData: function(d) { + var _data_obj = VMM.Timeline.DataObj.data_template_obj; + + for(var i = 0; i < d.feed.entry.length; i++) { + + + var dd = d.feed.entry[i]; + + if (dd.gsx$titleslide.$t.match("start")) { + _data_obj.timeline.startDate = dd.gsx$startdate.$t; + _data_obj.timeline.headline = dd.gsx$headline.$t; + _data_obj.timeline.asset.media = dd.gsx$media.$t; + _data_obj.timeline.asset.caption = dd.gsx$mediacaption.$t; + _data_obj.timeline.asset.credit = dd.gsx$mediacredit.$t; + _data_obj.timeline.text = dd.gsx$text.$t; + _data_obj.timeline.type = "google spreadsheet"; + } else { + var _date = { + "type":"google spreadsheet", + "startDate":"", + "endDate":"", + "headline":"", + "text":"", + "type":"google spreadsheet", + "asset": + { + "media":"", + "credit":"", + "caption":"" + }, + "tags":"Optional" + }; + + _date.endDate = dd.gsx$enddate.$t; + _date.startDate = dd.gsx$startdate.$t; + _date.headline = dd.gsx$headline.$t; + _date.asset.media = dd.gsx$media.$t; + _date.asset.caption = dd.gsx$mediacaption.$t; + _date.asset.credit = dd.gsx$mediacredit.$t; + _date.text = dd.gsx$text.$t; + + _data_obj.timeline.date.push(_date); + } + + + + }; + + VMM.fireEvent(global, "DATAREADY", _data_obj); + + } + + }, + + + /* TEMPLATE OBJECTS + ================================================== */ + + data_template_obj: { + "timeline": { + "headline":"", + "description":"", + "asset": { + "media":"", + "credit":"", + "caption":"" + }, + "date": [] + } + }, + + date_obj: { + "startDate":"2012,2,2,11,30", + "headline":"", + "text":"", + "asset": + { + "media":"http://youtu.be/vjVfu8-Wp6s", + "credit":"", + "caption":"" + }, + "tags":"Optional" + } + + }; +} \ No newline at end of file diff --git a/source/js/VMM.Timeline.TimeNav.js b/source/js/VMM.Timeline.TimeNav.js new file mode 100644 index 0000000..3988d80 --- /dev/null +++ b/source/js/VMM.Timeline.TimeNav.js @@ -0,0 +1,1179 @@ +/* TIMELINE NAVIGATION +================================================== */ + +if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefined') { + + VMM.Timeline.TimeNav = function(parent, content_width, content_height) { + trace("VMM.Timeline.TimeNav"); + + var events = {}; // CUSTOM EVENT HOLDER + var data = []; // HOLDS DATA + var eras; + var era_markers = []; + var markers = []; // HOLDS MARKER DOM OBJECTS + var interval_array = []; + var timespan = {}; + var current_marker = 0; // CURRENT MARKER + var _active = false; + + var timelookup = { + day: 24 , + month: 12, + year: 10, + hour: 60, + minute: 60, + second: 1000, + decade: 10, + century: 100, + millenium: 1000, + week: 4.34812141, + days_in_month: 30.4368499, + days_in_week: 7, + weeks_in_month:4.34812141, + weeks_in_year:52.177457, + days_in_year: 365.242199, + hours_in_day: 24 + }; + + var dateFractionBrowser = { + day: 86400000 , + week: 7, + month: 30.4166666667, + year: 12, + hour: 24, + minute: 1440, + second: 86400, + decade: 10, + century: 100, + millenium: 1000 + } + + // somestring = VMM.Util.date.month[2]; // Returns March + // somestring = VMM.Util.date.month_abbrev[1]; // Returns Feb. + + var interval = { + type: "year", + number: 10, + first: 1970, + last: 2011, + multiplier: 100 + }; + + var interval_major = { + type: "year", + number: 10, + first: 1970, + last: 2011, + multiplier: 100 + }; + + var interval_calc = { + day: {} , + month: {}, + year: {}, + hour: {}, + minute: {}, + second: {}, + decade: {}, + century: {}, + millenium: {}, + week: {} + }; + + /* ADD to Config + ================================================== */ + var config = VMM.Timeline.Config; + config.something = 0; + config.nav_width = 100; + config.nav_height = 200; + config.timeline = false; + config.marker_width = 150; + config.marker_height = 48; + config.density = 2; + config.timeline_width = 900; + config.interval_width = 200; + config.rows = [1, 1, 1]; + config.multiplier = 6; + config.max_multiplier = 16; + config.min_multiplier = 1; + config.has_start_page = false; + + config.rows = [config.marker_height, config.marker_height*2, 1]; + + if (content_width != null && content_width != "") { + config.width = content_width; + } + if (content_height != null && content_height != "") { + config.height = content_height; + } + + var content = ""; + var _active = false; + + /* ELEMENTS + ================================================== */ + var $timenav = ""; + //var $timenav_container_mask = ""; + //var $timenav_container = ""; + + var $content = ""; + var $time = ""; + var $timeintervalminor = ""; + var $timeinterval = ""; + var $timeintervalmajor = ""; + var $timebackground = ""; + var $timeintervalbackground = ""; + var $timenavline = ""; + var $timeintervalminor_minor = ""; + var $toolbar = ""; + var $zoomin = ""; + var $zoomout = ""; + + var navigation = {}; + // Nav Items + navigation.nextBtn; + navigation.prevBtn; + navigation.nextDate; + navigation.prevDate; + navigation.nextTitle; + navigation.prevTitle; + + /* PUBLIC VARS + ================================================== */ + this.ver = "0.1"; + var layout = parent; // expecting slider div + + + /* PUBLIC FUNCTIONS + ================================================== */ + this.init = function(d,e) { + trace('VMM.Timeline.TimeNav init'); + // need to evaluate d + // some function to determine type of data and prepare it + if(typeof d != 'undefined') { + this.setData(d, e); + } else { + trace("WAITING ON DATA"); + } + }; + + /* GETTERS AND SETTERS + ================================================== */ + this.setData = function(d,e) { + if(typeof d != 'undefined') { + data = d; + eras = e; + build(); + } else{ + trace("NO DATA"); + } + }; + + this.setSize = function(w, h) { + if (w != null) {config.width = w}; + if (h != null) {config.height = h}; + if (_active) { + reSize(); + } + + + } + + this.setMarker = function(n, ease, duration, fast) { + goToMarker(n, ease, duration); + } + + this.getCurrentNumber = function() { + return current_marker; + } + + /* ON EVENT + ================================================== */ + + function onConfigSet() { + trace("onConfigSet"); + }; + + function reSize(firstrun) { + VMM.Element.css($timenavline, "left", Math.round(config.width/2)+2); + //VMM.Element.css($toolbar, "left", Math.round(config.width/2)-19); + + goToMarker(current_marker, config.ease, config.duration, true, firstrun); + }; + + function upDate() { + VMM.fireEvent(layout, "UPDATE"); + } + + function onZoomIn() { + trace("CLICK"); + VMM.DragSlider.cancelSlide(); + if (config.multiplier > config.min_multiplier) { + config.multiplier = config.multiplier - 1; + if (config.multiplier < 0) { + config.multiplier = config.min_multiplier; + } + refreshTimeline(); + } + } + + + + function onZoomOut() { + trace("CLICK"); + VMM.DragSlider.cancelSlide(); + if (config.multiplier < config.max_multiplier) { + config.multiplier = config.multiplier + 1; + if (config.multiplier == config.max_multiplier) { + + } + refreshTimeline(); + } + } + + + function onBackHome(e) { + VMM.DragSlider.cancelSlide(); + goToMarker(0); + upDate(); + } + /* MARKER EVENTS + ================================================== */ + function onMarkerClick(e) { + VMM.DragSlider.cancelSlide(); + goToMarker(e.data.number); + upDate(); + }; + + function onMarkerHover(e) { + VMM.Element.toggleClass(e.data.elem, "zFront"); + + }; + + /* TOUCH EVENTS + ================================================== */ + function onTouchUpdate(e, b) { + VMM.Element.animate($timenav, b.time/2, config.ease, {"left": b.left}); + + + }; + + /* NAVIGATION + ================================================== */ + var buildMarkers = function() { + + var row = 2; //row + var lpos = 0; // last marker pos; + var row_depth = 0; + + for(var i = 0; i < data.length; i++) { + + var bw = ""; + var _marker; + var _marker_flag; + var _marker_content; + + var _marker_dot; + var _marker_line; + var _marker_line_event; + + /* CREATE ELEMENTS + ================================================== */ + _marker = VMM.appendAndGetElement($content, "
", "marker"); + _marker_flag = VMM.appendAndGetElement(_marker, "
", "flag"); + _marker_content = VMM.appendAndGetElement(_marker_flag, "
", "flag-content"); + _marker_dot = VMM.appendAndGetElement(_marker, "
", "dot"); + _marker_line = VMM.appendAndGetElement(_marker, "
", "line"); + _marker_line_event = VMM.appendAndGetElement(_marker_line, "
", "event-line"); + + + /* CREATE THUMBNAIL + ================================================== */ + if (data[i].asset != null && data[i].asset != "") { + VMM.appendElement(_marker_content, VMM.MediaElement.thumbnail(data[i].asset, 32, 32)); + } + + /* ADD DATE AND TITLE + ================================================== */ + VMM.appendElement(_marker_content, "

" + VMM.Util.unlinkify(data[i].title) + "

" + data[i].date + "

"); + + /* ADD ID + ================================================== */ + VMM.Element.attr(_marker, "id", (data[i].uniqueid).toString()); + + /* MARKER CLICK + ================================================== */ + VMM.bindEvent(_marker_flag, onMarkerClick, "", {number: i}); + VMM.bindEvent(_marker_flag, onMarkerHover, "mouseenter mouseleave", {number: i, elem:_marker_flag}); + + + + /* ADD MARKER OBJ TO ARRAY FOR RETRIEVAL LATER + ================================================== */ + var _marker_obj = { + marker: _marker, + flag:_marker_flag, + lineevent: _marker_line_event, + type: "marker" + }; + + + if (data[i].type == "start") { + trace("BUILD MARKER HAS START PAGE") + config.has_start_page = true; + _marker_obj.type = "start"; + } + + markers.push(_marker_obj); + + + + } + + /* CREATE ERAS + ================================================== */ + for(var j = 0; j < eras.length; j++) { + + var bw = ""; + var era = { + content:"", + startdate:"", + enddate:"", + headline:"", + uniqueid:"", + color:"" + }; + + era.title = eras[j].headline; + era.uniqueid = VMM.Util.unique_ID(4); + era.color = eras[j].color; + /* CREATE ELEMENTS + ================================================== */ + era.content = VMM.appendAndGetElement($content, "
", "era"); + VMM.Element.attr(era.content, "id", era.uniqueid); + VMM.Element.css(era.content, "background", era.color); + /* ADD DATE AND TITLE + ================================================== */ + VMM.appendElement(era.content, "

" + VMM.Util.unlinkify(era.title) + "

"); + + + era.startdate = VMM.Util.parseDate(eras[j].startDate); + era.enddate = VMM.Util.parseDate(eras[j].endDate); + + era_markers.push(era); + } + + positionMarkers(); + } + + + var positionOnTimeline = function(the_interval, first, last) { + + var _type = the_interval.type; + var _multiplier = the_interval.multiplier; + + var _first = getDateFractions(first); + var _last = getDateFractions(last); + + /* CALCULATE POSITION ON TIMELINE + ================================================== */ + var tsd = first.months; + var ted = last.months; + + if (_type == "millenium") { + tsd = first.milleniums; + ted = last.milleniums; + } else if (_type == "century") { + tsd = _first.centuries; + ted = _last.centuries; + } else if (_type == "decade") { + tsd = _first.decades; + ted = _last.decades; + } else if (_type == "year") { + tsd = _first.years; + ted = _last.years; + } else if (_type == "month") { + tsd = _first.months; + ted = _last.months; + } else if (_type == "week") { + tsd = _first.weeks; + ted = _last.weeks; + } else if (_type == "day") { + tsd = _first.days; + ted = _last.days; + } else if (_type == "hour") { + tsd = _first.hours; + ted = _last.hours; + } else if (_type == "minute") { + tsd = _first.minutes; + ted = _last.minutes; + } + + + _pos = ( tsd - interval.base ) * (config.interval_width / config.multiplier); + _pos_end = ( ted - interval.base ) * (config.interval_width / config.multiplier); + + return pos = {begin:_pos ,end:_pos_end}; + + } + + var positionMarkers = function(is_animated) { + + var _type = interval.type; + var _multiplier = interval.multiplier; + + // ROWS + var row = 2; //row + var lpos = 0; // last marker pos; + var row_depth = 0; + var _line_last_height_pos = 150; + var _line_height = 6; + + var cur_mark = 0; + + VMM.Element.removeClass(".flag", "row1"); + VMM.Element.removeClass(".flag", "row2"); + VMM.Element.removeClass(".flag", "row3"); + + for(var i = 0; i < markers.length; i++) { + + //var pos; // X POSITION OF BEGINNING OF EVENT + var _line; // EVENT LENGTH + //var _pos_end; // X POSITION OF END OF EVENT + + var _marker = markers[i].marker; + var _marker_flag = markers[i].flag; + var _marker_line_event = markers[i].lineevent; + + + + var _pos = positionOnTimeline(interval, data[i].startdate, data[i].enddate); + + + pos = _pos.begin; + _pos_end = _pos.end; + + /* COMPENSATE FOR DATES BEING POITIONED IN THE MIDDLE + ================================================== */ + var _pos_offset = -2; + pos = Math.round(pos + _pos_offset); + _pos_end = Math.round(_pos_end + _pos_offset); + _line = Math.round(_pos_end - pos); + + /* APPLY POSITION TO MARKER + ================================================== */ + if (is_animated) { + VMM.Element.stop(_marker); + VMM.Element.animate(_marker, config.duration/2, config.ease, {"left": pos}); + } else { + VMM.Element.css(_marker, "left", pos); + } + if (i == current_marker) { + cur_mark = pos; + //trace("=========================== cur_mark " + cur_mark) + } + + /* EVENT LENGTH LINE + ================================================== */ + if (_line > 5) { + VMM.Element.css(_marker_line_event, "height", _line_height); + VMM.Element.css(_marker_line_event, "width", _line); + VMM.Element.css(_marker_line_event, "top", _line_last_height_pos); + //_line_last_height_pos = _line_last_height_pos - _line_height; + } + + /* CONTROL ROW POSITION + ================================================== */ + if (pos - lpos < (config.marker_width + config.spacing)) { + if (row < config.rows.length - 1) { + row ++; + + } else { + row = 0; + row_depth ++; + } + } else { + row_depth = 0; + row = 0; + } + + /* SET LAST MARKER POSITION + ================================================== */ + lpos = pos; + + if (is_animated) { + VMM.Element.stop(_marker_flag); + VMM.Element.animate(_marker_flag, config.duration, config.ease, {"top": config.rows[row]}); + } else { + VMM.Element.css(_marker_flag, "top", config.rows[row]); + } + + /* IS THE MARKER A REPRESENTATION OF A START SCREEN? + ================================================== */ + if (config.has_start_page && markers[i].type == "start") { + VMM.Element.visible(_marker, false); + } + + } + + for(var j = 0; j < era_markers.length; j++) { + //var pos; // X POSITION OF BEGINNING OF EVENT + var _line; // EVENT LENGTH + //var _pos_end; // X POSITION OF END OF EVENT + + var era = era_markers[j]; + var era_elem = era.content; + var pos = positionOnTimeline(interval, era.startdate, era.enddate); + var era_length = pos.end - pos.begin; + var era_height = 25; + + /* APPLY POSITION TO MARKER + ================================================== */ + VMM.Element.css(era_elem, "left", pos.begin); + VMM.Element.css(era_elem, "width", era_length); + } + + + /* ANIMATE THE TIMELINE TO ADJUST TO CHANGES + ================================================== */ + if (is_animated) { + VMM.Element.stop($timenav); + VMM.Element.animate($timenav, config.duration/2, config.ease, {"left": (config.width/2) - (cur_mark)}); + } + + + } + + var getDateFractions = function(the_date, is_utc) { + + var _time = {}; + _time.days = the_date / dateFractionBrowser.day; + _time.weeks = _time.days / dateFractionBrowser.week; + _time.months = _time.days / dateFractionBrowser.month; + _time.years = _time.months / dateFractionBrowser.year; + _time.hours = _time.days * dateFractionBrowser.hour; + _time.minutes = _time.days * dateFractionBrowser.minute; + _time.seconds = _time.days * dateFractionBrowser.second; + _time.decades = _time.years / dateFractionBrowser.decade; + _time.centuries = _time.years / dateFractionBrowser.century; + _time.milleniums = _time.years / dateFractionBrowser.millenium; + /* + trace("MILLENIUMS " + _time.milleniums); + trace("CENTURIES " + _time.centuries); + trace("DECADES " + _time.decades); + trace("YEARS " + _time.years); + trace("MONTHS " + _time.months); + trace("WEEKS " + _time.weeks); + trace("DAYS " + _time.days); + trace("HOURS " + _time.hours); + trace("MINUTES " + _time.minutes); + trace("SECONDS " + _time.seconds); + */ + return _time; + } + + var calculateInterval = function() { + + var _first = getDateFractions(data[0].startdate); + var _last = getDateFractions(data[data.length - 1].enddate); + + /* MILLENIUM + ================================================== */ + // NOT DONE + interval_calc.millenium.type = "millenium"; + interval_calc.millenium.first = _first.milleniums; + interval_calc.millenium.base = Math.floor(_first.milleniums); + interval_calc.millenium.last = _last.milleniums; + interval_calc.millenium.number = timespan.milleniums; + interval_calc.millenium.multiplier = timelookup.millenium; + interval_calc.millenium.minor = timelookup.millenium; + + /* CENTURY + ================================================== */ + // NOT DONE + interval_calc.century.type = "century"; + interval_calc.century.first = _first.centuries; + interval_calc.century.base = Math.floor(_first.centuries); + interval_calc.century.last = _last.centuries; + interval_calc.century.number = timespan.centuries; + interval_calc.century.multiplier = timelookup.century; + interval_calc.century.minor = timelookup.century; + + /* DECADE + ================================================== */ + interval_calc.decade.type = "decade"; + interval_calc.decade.first = _first.decades; + interval_calc.decade.base = Math.floor(_first.decades); + interval_calc.decade.last = _last.decades; + interval_calc.decade.number = timespan.decades; + interval_calc.decade.multiplier = timelookup.decade; + interval_calc.decade.minor = timelookup.decade; + + /* YEAR + ================================================== */ + + interval_calc.year.type = "year"; + interval_calc.year.first = _first.years; + interval_calc.year.base = Math.floor(_first.years); + interval_calc.year.last = _last.years; + interval_calc.year.number = timespan.years; + interval_calc.year.multiplier = 1; + interval_calc.year.minor = timelookup.month; + + /* MONTH + ================================================== */ + interval_calc.month.type = "month"; + interval_calc.month.first = _first.months; + interval_calc.month.base = Math.floor(_first.months); + interval_calc.month.last = _last.months; + interval_calc.month.number = timespan.months; + interval_calc.month.multiplier = 1; + interval_calc.month.minor = Math.round(timelookup.week); + + /* WEEK + ================================================== */ + // NOT DONE + interval_calc.week.type = "week"; + + interval_calc.week.first = _first.weeks; + interval_calc.week.base = Math.floor(_first.weeks); + interval_calc.week.last = _last.weeks; + interval_calc.week.number = timespan.weeks; + interval_calc.week.multiplier = 1; + interval_calc.week.minor = 7; + + /* DAY + ================================================== */ + // NOT DONE + interval_calc.day.type = "day"; + interval_calc.day.first = _first.days; + interval_calc.day.base = Math.floor(_first.days); + interval_calc.day.last = _last.days; + interval_calc.day.number = timespan.days; + interval_calc.day.multiplier = 1; + interval_calc.day.minor = 24; + + /* HOUR + ================================================== */ + // NOT DONE + interval_calc.hour.type = "hour"; + interval_calc.hour.first = _first.hours; + interval_calc.hour.base = Math.floor(_first.hours); + interval_calc.hour.last = _last.hours; + interval_calc.hour.number = timespan.hours; + interval_calc.hour.multiplier = 1; + interval_calc.hour.minor = 60; + + /* MINUTE + ================================================== */ + // NOT DONE + interval_calc.minute.type = "minute"; + interval_calc.minute.first = _first.minutes; + interval_calc.minute.base = Math.floor(_first.minutes); + interval_calc.minute.last = _last.minutes; + interval_calc.minute.number = timespan.minutes; + interval_calc.minute.multiplier = 1; + interval_calc.minute.minor = 60; + + /* SECOND + ================================================== */ + // NOT DONE + interval_calc.second.type = "decade"; + interval_calc.second.first = _first.seconds; + interval_calc.second.base = Math.floor(_first.seconds); + interval_calc.second.last = _last.seconds; + interval_calc.second.number = timespan.seconds; + interval_calc.second.multiplier = 1; + interval_calc.second.minor = 10; + } + + var positionInterval = function() { + + VMM.attachElement($timeinterval, ""); + VMM.attachElement($timeintervalmajor, ""); + + interval.date = new Date(data[0].startdate.getFullYear(), 0, 1, 0,0,0); + interval_major.date = new Date(data[0].startdate.getFullYear(), 0, 1, 0,0,0); + + //interval.date_major_start = new Date(data[0].startdate.getFullYear(), 0, 1, 0,0,0); + //interval.date_major_end = new Date(data[0].startdate.getFullYear(), 0, 1, 0,0,0); + + var inc_time = 0; + var inc_time_major = 0; + var _first_run = true; + var _normal_first_pos = 0; + var _last_pos = 0; + var _last_pos_major = 0; + + for(var i = 0; i < interval.number + 1; i++) { + + var _idd; + if (interval.type == "century") { + if (_first_run) { + interval.date.setFullYear( Math.floor(data[0].startdate.getFullYear() / 100) * 100 ); + } + interval.date.setFullYear(interval.date.getFullYear() + (inc_time * 100)); + _idd = Math.floor(interval.date.getFullYear() / 100) * 100; + } else if (interval.type == "decade") { + if (_first_run) { + interval.date.setFullYear( Math.floor(data[0].startdate.getFullYear() / 10) * 10 ); + } + interval.date.setFullYear(interval.date.getFullYear() + (inc_time * 10)); + _idd = Math.floor(interval.date.getFullYear() / 10) * 10; + } else if (interval.type == "year") { + if (_first_run) { + + } + interval.date.setFullYear(interval.date.getFullYear() + inc_time); + //_idd = interval.date.getFullYear(); + _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); + } else if (interval.type == "month") { + if (_first_run) { + interval.date.setMonth(data[0].startdate.getMonth()); + } + interval.date.setMonth(interval.date.getMonth() + inc_time); + //_idd = VMM.Util.date.month[interval.date.getMonth()] + ", " + interval.date.getFullYear() ; + _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); + } else if (interval.type == "week") { + if (_first_run) { + interval.date.setMonth( data[0].startdate.getMonth() ); + interval.date.setDate( Math.floor(data[0].startdate.getDate() *7) ); + } + interval.date.setDate(interval.date.getDate() + (inc_time * 7) ); + _idd = VMM.Util.date.day_abbr[interval.date.getDay()] + " " + VMM.Util.date.month_abbr[interval.date.getMonth()] + " " + interval.date.getDate(); + } else if (interval.type == "day") { + if (_first_run) { + interval.date.setMonth( data[0].startdate.getMonth() ); + interval.date.setDate( data[0].startdate.getDate() ); + } + interval.date.setDate(interval.date.getDate() + inc_time); + _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); + //_idd = VMM.Util.date.day_abbr[interval.date.getDay()] + " " +VMM.Util.date.month[interval.date.getMonth()] + " " + interval.date.getDate(); + } else if (interval.type == "hour") { + if (_first_run) { + interval.date.setMonth( data[0].startdate.getMonth() ); + interval.date.setDate( data[0].startdate.getDate() ); + interval.date.setHours( data[0].startdate.getHours() ); + } + interval.date.setHours(interval.date.getHours() + inc_time); + //_idd = VMM.Util.date.get12HRTime(interval.date, false); //interval.date.getHours() + ":00"; + _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); + } else if (interval.type == "minute") { + if (_first_run) { + interval.date.setMonth( data[0].startdate.getMonth() ); + interval.date.setDate( data[0].startdate.getDate() ); + interval.date.setHours( data[0].startdate.getHours() ); + interval.date.setMinutes( data[0].startdate.getMinutes() ); + } + interval.date.setMinutes(interval.date.getMinutes() + inc_time); + //_idd = interval.date.getHours() + ":" + VMM.Util.doubledigit(interval.date.getMinutes()); + _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); + } else if (interval.type == "second") { + if (_first_run) { + interval.date.setMonth( data[0].startdate.getMonth() ); + interval.date.setDate( data[0].startdate.getDate() ); + interval.date.setHours( data[0].startdate.getHours() ); + interval.date.setMinutes( data[0].startdate.getMinutes() ); + interval.date.setSeconds( data[0].startdate.getSeconds() ); + } + interval.date.setSeconds(interval.date.getSeconds() + inc_time); + //_idd = interval.date.getHours() + ":" + VMM.Util.doubledigit(interval.date.getMinutes()) + ":" + VMM.Util.doubledigit(interval.date.getSeconds()); + _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); + } + + inc_time = 1; + + if (_first_run) { + _normal_first_pos = pos; + } + _first_run = false; + + var _pos = positionOnTimeline(interval, interval.date, interval.date); + var pos = _pos.begin; + + $interval_date = VMM.appendAndGetElement($timeinterval, "
", "_idd"); + VMM.appendElement($interval_date, _idd); + + VMM.Element.css($interval_date, "left", pos); + VMM.Element.css($interval_date, "text-indent", -(VMM.Element.width($interval_date)/2)); + + if ((pos - _last_pos) < 65 ) { + if ((pos - _last_pos) < 35 ) { + if (i%4 == 0) { + if (pos == 0) { + VMM.Element.css($interval_date, "display", "none"); + } else { + VMM.Element.css($interval_date, "display", ""); + } + + } else { + VMM.Element.css($interval_date, "display", "none"); + } + } else { + if (VMM.Util.isEven(i)) { + VMM.Element.css($interval_date, "display", "none"); + } else { + VMM.Element.css($interval_date, "display", ""); + } + } + + } else { + VMM.Element.css($interval_date, "display", ""); + } + + _last_pos = pos; + } + + _first_run = true; + _major_first_pos = 0; + _major_last_pos = 0; + + for(var i = 0; i < Math.ceil(interval_major.number) + 1; i++) { + var _idd; + + if (interval_major.type == "century") { + if (_first_run) { + interval_major.date.setFullYear( Math.floor(data[0].startdate.getFullYear() / 100) * 100 ); + } + interval_major.date.setFullYear(interval_major.date.getFullYear() + (inc_time_major * 100)); + _idd = Math.floor(interval_major.date.getFullYear() / 100) * 100; + } else if (interval_major.type == "decade") { + if (_first_run) { + interval_major.date.setFullYear( Math.floor(data[0].startdate.getFullYear() / 10) * 10 ); + } + interval_major.date.setFullYear(interval_major.date.getFullYear() + (inc_time_major * 10)); + _idd = Math.floor(interval_major.date.getFullYear() / 10) * 10; + } else if (interval_major.type == "year") { + if (_first_run) { + + } + interval_major.date.setFullYear(interval_major.date.getFullYear() + inc_time_major); + _idd = interval_major.date.getFullYear(); + //_idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); + } else if (interval_major.type == "month") { + if (_first_run) { + interval_major.date.setMonth(data[0].startdate.getMonth()); + } + interval_major.date.setMonth(interval_major.date.getMonth() + inc_time_major); + _idd = VMM.Util.date.month[interval_major.date.getMonth()] + " " + interval_major.date.getFullYear(); + //_idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); + } else if (interval_major.type == "week") { + if (_first_run) { + interval_major.date.setMonth( data[0].startdate.getMonth() ); + interval_major.date.setDate( Math.floor(data[0].startdate.getDate() *7) ); + } + interval_major.date.setDate(interval_major.date.getDate() + (inc_time_major * 7) ); + _idd = VMM.Util.date.day_abbr[interval_major.date.getDay()] + " " + VMM.Util.date.month_abbr[interval_major.date.getMonth()] + " " + interval_major.date.getDate(); + } else if (interval_major.type == "day") { + if (_first_run) { + interval_major.date.setMonth( data[0].startdate.getMonth() ); + interval_major.date.setDate( data[0].startdate.getDate() ); + } + interval_major.date.setDate(interval_major.date.getDate() + inc_time_major); + //_idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); + //_idd = VMM.Util.date.day[interval_major.date.getDay()] + " " + VMM.Util.date.month_abbr[interval_major.date.getMonth()] + " " + interval_major.date.getDate(); + _idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); + } else if (interval_major.type == "hour") { + if (_first_run) { + interval_major.date.setMonth( data[0].startdate.getMonth() ); + interval_major.date.setDate( data[0].startdate.getDate() ); + interval_major.date.setHours( data[0].startdate.getHours() ); + } + interval_major.date.setHours(interval_major.date.getHours() + inc_time_major); + //_idd = VMM.Util.date.get12HRTime(interval_major.date, false); //interval_major.date.getHours() + ":00"; + _idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); + } else if (interval_major.type == "minute") { + if (_first_run) { + interval_major.date.setMonth( data[0].startdate.getMonth() ); + interval_major.date.setDate( data[0].startdate.getDate() ); + interval_major.date.setHours( data[0].startdate.getHours() ); + interval_major.date.setMinutes( data[0].startdate.getMinutes() ); + } + interval_major.date.setMinutes(interval_major.date.getMinutes() + inc_time_major); + //_idd = interval_major.date.getHours() + ":" + VMM.Util.doubledigit(interval_major.date.getMinutes()); + _idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); + } else if (interval_major.type == "second") { + if (_first_run) { + interval_major.date.setMonth( data[0].startdate.getMonth() ); + interval_major.date.setDate( data[0].startdate.getDate() ); + interval_major.date.setHours( data[0].startdate.getHours() ); + interval_major.date.setMinutes( data[0].startdate.getMinutes() ); + interval_major.date.setSeconds( data[0].startdate.getSeconds() ); + } + interval_major.date.setSeconds(interval_major.date.getSeconds() + inc_time_major); + //_idd = interval_major.date.getHours() + ":" + VMM.Util.doubledigit(interval_major.date.getMinutes()) + ":" + VMM.Util.doubledigit(interval_major.date.getSeconds()); + _idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); + } + trace("interval_major.type " + interval_major.type); + + inc_time_major = 1; + + + + /* BUILD DATE USING SAME METHODOLOGY AS MARKER POSITON + CREATE A DATE + //================================================== */ + + var _pos = positionOnTimeline(interval, interval_major.date, interval_major.date); + var pos = _pos.begin; + + $interval_date = VMM.appendAndGetElement($timeintervalmajor, "
", "major"); + VMM.appendElement($interval_date, _idd); + + VMM.Element.css($interval_date, "left", pos); + VMM.Element.css($interval_date, "left", pos); + VMM.Element.css($interval_date, "text-indent", -(VMM.Element.width($interval_date)/2)); + + if (_first_run) { + _major_first_pos = pos; + } + _first_run = false; + + _last_pos_major = pos; + _major_last_pos = pos; + + } + + VMM.Element.width($content, interval.number * (config.interval_width / config.multiplier) ); + + //VMM.Element.width($timeintervalminor_minor, (interval.number * (config.interval_width / config.multiplier)) + 200 ); + _minor_pos_offset = 50; + var _minor_width = (_major_last_pos - _major_first_pos)+(_minor_pos_offset*6); + var _normal_width = (_last_pos)+(_minor_pos_offset*6); + + if (_minor_width < _normal_width) { + VMM.Element.width($timeintervalminor_minor, _normal_width); + } else { + VMM.Element.width($timeintervalminor_minor, _minor_width); + } + + + VMM.Element.css($timeintervalminor_minor, "left", _major_first_pos - _minor_pos_offset); + + config.timeline_width = VMM.Element.width($timeinterval); + + + } + + var buildInterval = function() { + + /* CALCULATE INTERVAL + ================================================== */ + timespan = getDateFractions((data[data.length - 1].enddate) - (data[0].startdate), true); + calculateInterval(); + + /* DETERMINE DEFAULT INTERVAL TYPE + ================================================== */ + + if (timespan.milleniums > data.length / config.density) { + interval = interval_calc.millenium; + //interval_major = interval_calc.millenium; + } else if (timespan.centuries > data.length / config.density) { + interval = Math.ceil(interval_calc.century); + //interval_major = interval_calc.millenium; + } else if (timespan.decades > data.length / config.density) { + interval = interval_calc.decade; + //interval_major = Math.ceil(interval_calc.century); + } else if (timespan.years > data.length / config.density) { + interval = interval_calc.year; + //interval_major = interval_calc.decade; + } else if (timespan.months > data.length / config.density) { + interval = interval_calc.month; + //interval_major = interval_calc.year; + //} else if (timespan.weeks > data.length / config.density) { + //interval = interval_calc.week; + //interval = interval_calc.month; + //interval_major = interval_calc.month; + } else if (timespan.days > data.length / config.density) { + interval = interval_calc.day; + //interval_major = interval_calc.month; + } else if (timespan.hours > data.length / config.density) { + interval = interval_calc.hour; + //interval_major = interval_calc.day; + } else if (timespan.minutes > data.length / config.density) { + interval = interval_calc.minute; + //interval_major = interval_calc.hour; + } else if (timespan.seconds > data.length / config.density) { + interval = interval_calc.second; + //interval_major = interval_calc.minute; + } else { + trace("NO IDEA WHAT THE TYPE SHOULD BE"); + interval.type = "unknown"; + } + + /* DETERMINE MAJOR TYPE + ================================================== */ + + if (timespan.milleniums >= 1) { + interval_major = interval_calc.millenium; + } else if (timespan.centuries >= 1) { + interval_major = interval_calc.century; + } else if (timespan.decades >= 1) { + interval_major = interval_calc.decade; + } else if (timespan.years >= 1) { + interval_major = interval_calc.year; + } else if (timespan.months > 1) { + interval_major = interval_calc.month; + } else if (timespan.weeks > 1) { + interval_major = interval_calc.month; + } else if (timespan.days > 1) { + interval_major = interval_calc.day; + } else if (timespan.hours > 1) { + interval_major = interval_calc.hour; + } else if (timespan.minutes > 1) { + interval_major = interval_calc.minute; + } else if (timespan.seconds > 1) { + interval_major = interval_calc.minute; + } else { + trace("NO IDEA WHAT THE TYPE SHOULD BE"); + interval_major.type = "unknown"; + } + + //trace(interval_major.type); + + $timeintervalminor_minor = VMM.appendAndGetElement($timeintervalminor, "
", "minor"); + + positionInterval(); + + } + + /* GO TO TIME MARKER + ================================================== */ + var goToMarker = function(n, ease, duration, fast, firstrun) { + + // Set current slide + current_marker = n; + + var _ease = config.ease; + var _duration = config.duration; + var is_last = false; + var is_first = false; + + if (current_marker == 0) { + is_first = true; + } + if (current_marker +1 == markers.length) { + is_last = true + } + if (ease != null && ease != "") {_ease = ease}; + if (duration != null && duration != "") {_duration = duration}; + + /* get marker position + ================================================== */ + var _pos = VMM.Element.position(markers[current_marker].marker); + + /* set marker style + ================================================== */ + for(var i = 0; i < markers.length; i++) { + VMM.Element.removeClass(markers[i].marker, "active"); + } + + if (config.has_start_page && markers[current_marker].type == "start") { + VMM.Element.visible(markers[current_marker].marker, false); + VMM.Element.addClass(markers[current_marker].marker, "start"); + } + + VMM.Element.addClass(markers[current_marker].marker, "active"); + + /* set proper nav titles and dates etc. + ================================================== */ + if (is_first) { + //VMM.Element.visible(navigation.prevBtn, false); + } else { + //VMM.Element.visible(navigation.prevBtn, true); + } + if (is_last) { + //VMM.Element.visible(navigation.nextBtn, false); + } else { + //VMM.Element.visible(navigation.nextBtn, true); + } + + /* ANIMATE MARKER + ================================================== */ + VMM.Element.stop($timenav); + VMM.Element.animate($timenav, _duration, _ease, {"left": (config.width/2) - (_pos.left)}); + + + } + + + /* BUILD + ================================================== */ + var build = function() { + // Clear out existing content + + VMM.attachElement(layout, ""); + + $timenav = VMM.appendAndGetElement(layout, "
", "timenav"); + + + $content = VMM.appendAndGetElement($timenav, "
", "content"); + $time = VMM.appendAndGetElement($timenav, "
", "time"); + $timeintervalminor = VMM.appendAndGetElement($time, "
", "time-interval-minor"); + $timeintervalmajor = VMM.appendAndGetElement($time, "
", "time-interval-major"); + $timeinterval = VMM.appendAndGetElement($time, "
", "time-interval"); + $timebackground = VMM.appendAndGetElement(layout, "
", "timenav-background"); + $timenavline = VMM.appendAndGetElement($timebackground, "
", "timenav-line"); + $timeintervalbackground = VMM.appendAndGetElement($timebackground, "
", "timenav-interval-background", "
"); + + buildInterval(); + buildMarkers(); + reSize(true); + VMM.fireEvent(layout, "LOADED"); + + $toolbar = VMM.appendAndGetElement(layout, "
", "toolbar"); + + if (config.has_start_page) { + $backhome = VMM.appendAndGetElement($toolbar, "
", "back-home", "
"); + VMM.bindEvent(".back-home", onBackHome, "click"); + VMM.Element.css($toolbar, "top", 27); + + } + $zoomin = VMM.appendAndGetElement($toolbar, "
", "zoom-in", "
"); + $zoomout = VMM.appendAndGetElement($toolbar, "
", "zoom-out", "
"); + + VMM.Element.attribute($backhome, "title", VMM.Timeline.Config.language.messages.return_to_title); + VMM.Element.attribute($backhome, "rel", "tooltip"); + + VMM.Element.attribute($zoomin, "title", VMM.Timeline.Config.language.messages.expand_timeline); + VMM.Element.attribute($zoomin, "rel", "tooltip"); + + VMM.Element.attribute($zoomout, "title", VMM.Timeline.Config.language.messages.contract_timeline); + VMM.Element.attribute($zoomout, "rel", "tooltip"); + + VMM.bindEvent(".zoom-in", onZoomIn, "click"); + VMM.bindEvent(".zoom-out", onZoomOut, "click"); + + + $toolbar.tooltip({ + selector: "div[rel=tooltip]", + placement: "right" + }) + /* MAKE TIMELINE TOUCHABLE + ================================================== */ + if (VMM.Browser.device == "mobile" || VMM.Browser.device == "tablet") { + VMM.TouchSlider.createPanel($timebackground, $timenav, config.width, config.spacing, false); + VMM.bindEvent($timenav, onTouchUpdate, "TOUCHUPDATE"); + } else { + + VMM.DragSlider.createPanel(layout, $timenav, config.width, config.spacing, false); + //VMM.bindEvent($timenav, onDragUpdate, "DRAGUPDATE"); + } + + + + _active = true; + + }; + + var refreshTimeline = function() { + positionInterval(); + positionMarkers(true); + //reSize(); + }; + + + + }; + +} \ No newline at end of file diff --git a/source/js/VMM.Timeline.js b/source/js/VMM.Timeline.js index 451332a..a446fd4 100755 --- a/source/js/VMM.Timeline.js +++ b/source/js/VMM.Timeline.js @@ -1,7 +1,7 @@ /*! - Timeline 0.92 + Timeline 0.95 Designed and built by Zach Wise digitalartwork.net - Date: April 8, 2012 + Date: April 26, 2012 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,68 +17,37 @@ */ -/*! - TODO - - - - - FUTURE PLANS - - Better iPhone usability - - Support feeds from popular sources - - Storify integration - - Code optimization - - Possible tagging of events (depends on usability factors) - -*/ - /* CodeKit Import http://incident57.com/codekit/ ================================================== */ // @codekit-prepend "VMM.js"; -// @codekit-prepend "VMM.Core.js"; +// @codekit-prepend "VMM.Library.js"; +// @codekit-prepend "VMM.Browser.js"; +// @codekit-prepend "VMM.MediaElement.js"; +// @codekit-prepend "VMM.MediaType.js"; +// @codekit-prepend "VMM.Media.js"; +// @codekit-prepend "VMM.FileExtention.js"; +// @codekit-prepend "VMM.ExternalAPI.js"; +// @codekit-prepend "VMM.TouchSlider.js"; +// @codekit-prepend "VMM.DragSlider.js"; +// @codekit-prepend "VMM.Slider.js"; // @codekit-prepend "VMM.Util.js"; // @codekit-prepend "VMM.LoadLib.js"; +// @codekit-prepend "VMM.Language.js"; // @codekit-prepend "bootstrap-tooltip.js"; // @codekit-prepend "AES.js"; -/* Open Timeline Class contained in VMM (verite) namespace -================================================== */ -/* LANGUAGE +// @codekit-append "VMM.Timeline.TimeNav.js"; +// @codekit-append "VMM.Timeline.DataObj.js"; + +/* Timeline ================================================== */ -if(typeof VMM != 'undefined' && typeof VMM.Language == 'undefined') { - VMM.Language = { - date: { - month: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - month_abbr: ["Jan.", "Feb.", "March", "April", "May", "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."], - day: ["Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - day_abbr: ["Sun.","Mon.", "Tues.", "Wed.", "Thurs.", "Fri.", "Sat."], - }, - dateformats: { - year: "yyyy", - month_short: "mmm", - month: "mmmm yyyy", - full_short: "mmm d", - full: "mmmm d',' yyyy", - time_no_seconds_short: "hh:MM TT", - time_no_seconds_small_date: "hh:MM TT'
'mmmm d',' yyyy''", - full_long: "dddd',' mmm d',' yyyy 'at' hh:MM TT", - full_long_small_date: "hh:MM TT'
'dddd',' mmm d',' yyyy''", - }, - messages: { - loading_timeline: "Loading Timeline... ", - return_to_title: "Return to Title", - expand_timeline: "Expand Timeline", - contract_timeline: "Contract Timeline" - } - } -}; if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { - - VMM.Timeline = function(w, h, conf) { - var version = "0.92"; + var version = "0.95"; trace("TIMELINE VERSION " + version); var $timeline = VMM.getElement("#timeline"); // expecting name only for parent @@ -612,1529 +581,6 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { }; - - VMM.Timeline.TimeNav = function(parent, content_width, content_height) { - trace("VMM.Timeline.TimeNav"); - - var events = {}; // CUSTOM EVENT HOLDER - var data = []; // HOLDS DATA - var eras; - var era_markers = []; - var markers = []; // HOLDS MARKER DOM OBJECTS - var interval_array = []; - var timespan = {}; - var current_marker = 0; // CURRENT MARKER - var _active = false; - - var timelookup = { - day: 24 , - month: 12, - year: 10, - hour: 60, - minute: 60, - second: 1000, - decade: 10, - century: 100, - millenium: 1000, - week: 4.34812141, - days_in_month: 30.4368499, - days_in_week: 7, - weeks_in_month:4.34812141, - weeks_in_year:52.177457, - days_in_year: 365.242199, - hours_in_day: 24 - }; - - var dateFractionBrowser = { - day: 86400000 , - week: 7, - month: 30.4166666667, - year: 12, - hour: 24, - minute: 1440, - second: 86400, - decade: 10, - century: 100, - millenium: 1000 - } - - // somestring = VMM.Util.date.month[2]; // Returns March - // somestring = VMM.Util.date.month_abbrev[1]; // Returns Feb. - - var interval = { - type: "year", - number: 10, - first: 1970, - last: 2011, - multiplier: 100 - }; - - var interval_major = { - type: "year", - number: 10, - first: 1970, - last: 2011, - multiplier: 100 - }; - - var interval_calc = { - day: {} , - month: {}, - year: {}, - hour: {}, - minute: {}, - second: {}, - decade: {}, - century: {}, - millenium: {}, - week: {} - }; - - /* ADD to Config - ================================================== */ - var config = VMM.Timeline.Config; - config.something = 0; - config.nav_width = 100; - config.nav_height = 200; - config.timeline = false; - config.marker_width = 150; - config.marker_height = 48; - config.density = 2; - config.timeline_width = 900; - config.interval_width = 200; - config.rows = [1, 1, 1]; - config.multiplier = 6; - config.max_multiplier = 16; - config.min_multiplier = 1; - config.has_start_page = false; - - config.rows = [config.marker_height, config.marker_height*2, 1]; - - if (content_width != null && content_width != "") { - config.width = content_width; - } - if (content_height != null && content_height != "") { - config.height = content_height; - } - - var content = ""; - var _active = false; - - /* ELEMENTS - ================================================== */ - var $timenav = ""; - //var $timenav_container_mask = ""; - //var $timenav_container = ""; - - var $content = ""; - var $time = ""; - var $timeintervalminor = ""; - var $timeinterval = ""; - var $timeintervalmajor = ""; - var $timebackground = ""; - var $timeintervalbackground = ""; - var $timenavline = ""; - var $timeintervalminor_minor = ""; - var $toolbar = ""; - var $zoomin = ""; - var $zoomout = ""; - - var navigation = {}; - // Nav Items - navigation.nextBtn; - navigation.prevBtn; - navigation.nextDate; - navigation.prevDate; - navigation.nextTitle; - navigation.prevTitle; - - /* PUBLIC VARS - ================================================== */ - this.ver = "0.1"; - var layout = parent; // expecting slider div - - - /* PUBLIC FUNCTIONS - ================================================== */ - this.init = function(d,e) { - trace('VMM.Timeline.TimeNav init'); - // need to evaluate d - // some function to determine type of data and prepare it - if(typeof d != 'undefined') { - this.setData(d, e); - } else { - trace("WAITING ON DATA"); - } - }; - - /* GETTERS AND SETTERS - ================================================== */ - this.setData = function(d,e) { - if(typeof d != 'undefined') { - data = d; - eras = e; - build(); - } else{ - trace("NO DATA"); - } - }; - - this.setSize = function(w, h) { - if (w != null) {config.width = w}; - if (h != null) {config.height = h}; - if (_active) { - reSize(); - } - - - } - - this.setMarker = function(n, ease, duration, fast) { - goToMarker(n, ease, duration); - } - - this.getCurrentNumber = function() { - return current_marker; - } - - /* ON EVENT - ================================================== */ - - function onConfigSet() { - trace("onConfigSet"); - }; - - function reSize(firstrun) { - VMM.Element.css($timenavline, "left", Math.round(config.width/2)+2); - //VMM.Element.css($toolbar, "left", Math.round(config.width/2)-19); - - goToMarker(current_marker, config.ease, config.duration, true, firstrun); - }; - - function upDate() { - VMM.fireEvent(layout, "UPDATE"); - } - - function onZoomIn() { - trace("CLICK"); - VMM.DragSlider.cancelSlide(); - if (config.multiplier > config.min_multiplier) { - config.multiplier = config.multiplier - 1; - if (config.multiplier < 0) { - config.multiplier = config.min_multiplier; - } - refreshTimeline(); - } - } - - - - function onZoomOut() { - trace("CLICK"); - VMM.DragSlider.cancelSlide(); - if (config.multiplier < config.max_multiplier) { - config.multiplier = config.multiplier + 1; - if (config.multiplier == config.max_multiplier) { - - } - refreshTimeline(); - } - } - - - function onBackHome(e) { - VMM.DragSlider.cancelSlide(); - goToMarker(0); - upDate(); - } - /* MARKER EVENTS - ================================================== */ - function onMarkerClick(e) { - VMM.DragSlider.cancelSlide(); - goToMarker(e.data.number); - upDate(); - }; - - function onMarkerHover(e) { - VMM.Element.toggleClass(e.data.elem, "zFront"); - - }; - - /* TOUCH EVENTS - ================================================== */ - function onTouchUpdate(e, b) { - VMM.Element.animate($timenav, b.time/2, config.ease, {"left": b.left}); - - - }; - - /* NAVIGATION - ================================================== */ - var buildMarkers = function() { - - var row = 2; //row - var lpos = 0; // last marker pos; - var row_depth = 0; - - for(var i = 0; i < data.length; i++) { - - var bw = ""; - var _marker; - var _marker_flag; - var _marker_content; - - var _marker_dot; - var _marker_line; - var _marker_line_event; - - /* CREATE ELEMENTS - ================================================== */ - _marker = VMM.appendAndGetElement($content, "
", "marker"); - _marker_flag = VMM.appendAndGetElement(_marker, "
", "flag"); - _marker_content = VMM.appendAndGetElement(_marker_flag, "
", "flag-content"); - _marker_dot = VMM.appendAndGetElement(_marker, "
", "dot"); - _marker_line = VMM.appendAndGetElement(_marker, "
", "line"); - _marker_line_event = VMM.appendAndGetElement(_marker_line, "
", "event-line"); - - - /* CREATE THUMBNAIL - ================================================== */ - if (data[i].asset != null && data[i].asset != "") { - VMM.appendElement(_marker_content, VMM.MediaElement.thumbnail(data[i].asset, 32, 32)); - } - - /* ADD DATE AND TITLE - ================================================== */ - VMM.appendElement(_marker_content, "

" + VMM.Util.unlinkify(data[i].title) + "

" + data[i].date + "

"); - - /* ADD ID - ================================================== */ - VMM.Element.attr(_marker, "id", (data[i].uniqueid).toString()); - - /* MARKER CLICK - ================================================== */ - VMM.bindEvent(_marker_flag, onMarkerClick, "", {number: i}); - VMM.bindEvent(_marker_flag, onMarkerHover, "mouseenter mouseleave", {number: i, elem:_marker_flag}); - - - - /* ADD MARKER OBJ TO ARRAY FOR RETRIEVAL LATER - ================================================== */ - var _marker_obj = { - marker: _marker, - flag:_marker_flag, - lineevent: _marker_line_event, - type: "marker" - }; - - - if (data[i].type == "start") { - trace("BUILD MARKER HAS START PAGE") - config.has_start_page = true; - _marker_obj.type = "start"; - } - - markers.push(_marker_obj); - - - - } - - /* CREATE ERAS - ================================================== */ - for(var j = 0; j < eras.length; j++) { - - var bw = ""; - var era = { - content:"", - startdate:"", - enddate:"", - headline:"", - uniqueid:"", - color:"" - }; - - era.title = eras[j].headline; - era.uniqueid = VMM.Util.unique_ID(4); - era.color = eras[j].color; - /* CREATE ELEMENTS - ================================================== */ - era.content = VMM.appendAndGetElement($content, "
", "era"); - VMM.Element.attr(era.content, "id", era.uniqueid); - VMM.Element.css(era.content, "background", era.color); - /* ADD DATE AND TITLE - ================================================== */ - VMM.appendElement(era.content, "

" + VMM.Util.unlinkify(era.title) + "

"); - - - era.startdate = VMM.Util.parseDate(eras[j].startDate); - era.enddate = VMM.Util.parseDate(eras[j].endDate); - - era_markers.push(era); - } - - positionMarkers(); - } - - - var positionOnTimeline = function(the_interval, first, last) { - - var _type = the_interval.type; - var _multiplier = the_interval.multiplier; - - var _first = getDateFractions(first); - var _last = getDateFractions(last); - - /* CALCULATE POSITION ON TIMELINE - ================================================== */ - var tsd = first.months; - var ted = last.months; - - if (_type == "millenium") { - tsd = first.milleniums; - ted = last.milleniums; - } else if (_type == "century") { - tsd = _first.centuries; - ted = _last.centuries; - } else if (_type == "decade") { - tsd = _first.decades; - ted = _last.decades; - } else if (_type == "year") { - tsd = _first.years; - ted = _last.years; - } else if (_type == "month") { - tsd = _first.months; - ted = _last.months; - } else if (_type == "week") { - tsd = _first.weeks; - ted = _last.weeks; - } else if (_type == "day") { - tsd = _first.days; - ted = _last.days; - } else if (_type == "hour") { - tsd = _first.hours; - ted = _last.hours; - } else if (_type == "minute") { - tsd = _first.minutes; - ted = _last.minutes; - } - - - _pos = ( tsd - interval.base ) * (config.interval_width / config.multiplier); - _pos_end = ( ted - interval.base ) * (config.interval_width / config.multiplier); - - return pos = {begin:_pos ,end:_pos_end}; - - } - - var positionMarkers = function(is_animated) { - - var _type = interval.type; - var _multiplier = interval.multiplier; - - // ROWS - var row = 2; //row - var lpos = 0; // last marker pos; - var row_depth = 0; - var _line_last_height_pos = 150; - var _line_height = 6; - - var cur_mark = 0; - - VMM.Element.removeClass(".flag", "row1"); - VMM.Element.removeClass(".flag", "row2"); - VMM.Element.removeClass(".flag", "row3"); - - for(var i = 0; i < markers.length; i++) { - - //var pos; // X POSITION OF BEGINNING OF EVENT - var _line; // EVENT LENGTH - //var _pos_end; // X POSITION OF END OF EVENT - - var _marker = markers[i].marker; - var _marker_flag = markers[i].flag; - var _marker_line_event = markers[i].lineevent; - - - - var _pos = positionOnTimeline(interval, data[i].startdate, data[i].enddate); - - - pos = _pos.begin; - _pos_end = _pos.end; - - /* COMPENSATE FOR DATES BEING POITIONED IN THE MIDDLE - ================================================== */ - var _pos_offset = -2; - pos = Math.round(pos + _pos_offset); - _pos_end = Math.round(_pos_end + _pos_offset); - _line = Math.round(_pos_end - pos); - - /* APPLY POSITION TO MARKER - ================================================== */ - if (is_animated) { - VMM.Element.stop(_marker); - VMM.Element.animate(_marker, config.duration/2, config.ease, {"left": pos}); - } else { - VMM.Element.css(_marker, "left", pos); - } - if (i == current_marker) { - cur_mark = pos; - //trace("=========================== cur_mark " + cur_mark) - } - - /* EVENT LENGTH LINE - ================================================== */ - if (_line > 5) { - VMM.Element.css(_marker_line_event, "height", _line_height); - VMM.Element.css(_marker_line_event, "width", _line); - VMM.Element.css(_marker_line_event, "top", _line_last_height_pos); - //_line_last_height_pos = _line_last_height_pos - _line_height; - } - - /* CONTROL ROW POSITION - ================================================== */ - if (pos - lpos < (config.marker_width + config.spacing)) { - if (row < config.rows.length - 1) { - row ++; - - } else { - row = 0; - row_depth ++; - } - } else { - row_depth = 0; - row = 0; - } - - /* SET LAST MARKER POSITION - ================================================== */ - lpos = pos; - - if (is_animated) { - VMM.Element.stop(_marker_flag); - VMM.Element.animate(_marker_flag, config.duration, config.ease, {"top": config.rows[row]}); - } else { - VMM.Element.css(_marker_flag, "top", config.rows[row]); - } - - /* IS THE MARKER A REPRESENTATION OF A START SCREEN? - ================================================== */ - if (config.has_start_page && markers[i].type == "start") { - VMM.Element.visible(_marker, false); - } - - } - - for(var j = 0; j < era_markers.length; j++) { - //var pos; // X POSITION OF BEGINNING OF EVENT - var _line; // EVENT LENGTH - //var _pos_end; // X POSITION OF END OF EVENT - - var era = era_markers[j]; - var era_elem = era.content; - var pos = positionOnTimeline(interval, era.startdate, era.enddate); - var era_length = pos.end - pos.begin; - var era_height = 25; - - /* APPLY POSITION TO MARKER - ================================================== */ - VMM.Element.css(era_elem, "left", pos.begin); - VMM.Element.css(era_elem, "width", era_length); - } - - - /* ANIMATE THE TIMELINE TO ADJUST TO CHANGES - ================================================== */ - if (is_animated) { - VMM.Element.stop($timenav); - VMM.Element.animate($timenav, config.duration/2, config.ease, {"left": (config.width/2) - (cur_mark)}); - } - - - } - - var getDateFractions = function(the_date, is_utc) { - - var _time = {}; - _time.days = the_date / dateFractionBrowser.day; - _time.weeks = _time.days / dateFractionBrowser.week; - _time.months = _time.days / dateFractionBrowser.month; - _time.years = _time.months / dateFractionBrowser.year; - _time.hours = _time.days * dateFractionBrowser.hour; - _time.minutes = _time.days * dateFractionBrowser.minute; - _time.seconds = _time.days * dateFractionBrowser.second; - _time.decades = _time.years / dateFractionBrowser.decade; - _time.centuries = _time.years / dateFractionBrowser.century; - _time.milleniums = _time.years / dateFractionBrowser.millenium; - /* - trace("MILLENIUMS " + _time.milleniums); - trace("CENTURIES " + _time.centuries); - trace("DECADES " + _time.decades); - trace("YEARS " + _time.years); - trace("MONTHS " + _time.months); - trace("WEEKS " + _time.weeks); - trace("DAYS " + _time.days); - trace("HOURS " + _time.hours); - trace("MINUTES " + _time.minutes); - trace("SECONDS " + _time.seconds); - */ - return _time; - } - - var calculateInterval = function() { - - var _first = getDateFractions(data[0].startdate); - var _last = getDateFractions(data[data.length - 1].enddate); - - /* MILLENIUM - ================================================== */ - // NOT DONE - interval_calc.millenium.type = "millenium"; - interval_calc.millenium.first = _first.milleniums; - interval_calc.millenium.base = Math.floor(_first.milleniums); - interval_calc.millenium.last = _last.milleniums; - interval_calc.millenium.number = timespan.milleniums; - interval_calc.millenium.multiplier = timelookup.millenium; - interval_calc.millenium.minor = timelookup.millenium; - - /* CENTURY - ================================================== */ - // NOT DONE - interval_calc.century.type = "century"; - interval_calc.century.first = _first.centuries; - interval_calc.century.base = Math.floor(_first.centuries); - interval_calc.century.last = _last.centuries; - interval_calc.century.number = timespan.centuries; - interval_calc.century.multiplier = timelookup.century; - interval_calc.century.minor = timelookup.century; - - /* DECADE - ================================================== */ - interval_calc.decade.type = "decade"; - interval_calc.decade.first = _first.decades; - interval_calc.decade.base = Math.floor(_first.decades); - interval_calc.decade.last = _last.decades; - interval_calc.decade.number = timespan.decades; - interval_calc.decade.multiplier = timelookup.decade; - interval_calc.decade.minor = timelookup.decade; - - /* YEAR - ================================================== */ - - interval_calc.year.type = "year"; - interval_calc.year.first = _first.years; - interval_calc.year.base = Math.floor(_first.years); - interval_calc.year.last = _last.years; - interval_calc.year.number = timespan.years; - interval_calc.year.multiplier = 1; - interval_calc.year.minor = timelookup.month; - - /* MONTH - ================================================== */ - interval_calc.month.type = "month"; - interval_calc.month.first = _first.months; - interval_calc.month.base = Math.floor(_first.months); - interval_calc.month.last = _last.months; - interval_calc.month.number = timespan.months; - interval_calc.month.multiplier = 1; - interval_calc.month.minor = Math.round(timelookup.week); - - /* WEEK - ================================================== */ - // NOT DONE - interval_calc.week.type = "week"; - - interval_calc.week.first = _first.weeks; - interval_calc.week.base = Math.floor(_first.weeks); - interval_calc.week.last = _last.weeks; - interval_calc.week.number = timespan.weeks; - interval_calc.week.multiplier = 1; - interval_calc.week.minor = 7; - - /* DAY - ================================================== */ - // NOT DONE - interval_calc.day.type = "day"; - interval_calc.day.first = _first.days; - interval_calc.day.base = Math.floor(_first.days); - interval_calc.day.last = _last.days; - interval_calc.day.number = timespan.days; - interval_calc.day.multiplier = 1; - interval_calc.day.minor = 24; - - /* HOUR - ================================================== */ - // NOT DONE - interval_calc.hour.type = "hour"; - interval_calc.hour.first = _first.hours; - interval_calc.hour.base = Math.floor(_first.hours); - interval_calc.hour.last = _last.hours; - interval_calc.hour.number = timespan.hours; - interval_calc.hour.multiplier = 1; - interval_calc.hour.minor = 60; - - /* MINUTE - ================================================== */ - // NOT DONE - interval_calc.minute.type = "minute"; - interval_calc.minute.first = _first.minutes; - interval_calc.minute.base = Math.floor(_first.minutes); - interval_calc.minute.last = _last.minutes; - interval_calc.minute.number = timespan.minutes; - interval_calc.minute.multiplier = 1; - interval_calc.minute.minor = 60; - - /* SECOND - ================================================== */ - // NOT DONE - interval_calc.second.type = "decade"; - interval_calc.second.first = _first.seconds; - interval_calc.second.base = Math.floor(_first.seconds); - interval_calc.second.last = _last.seconds; - interval_calc.second.number = timespan.seconds; - interval_calc.second.multiplier = 1; - interval_calc.second.minor = 10; - } - - var positionInterval = function() { - - VMM.attachElement($timeinterval, ""); - VMM.attachElement($timeintervalmajor, ""); - - interval.date = new Date(data[0].startdate.getFullYear(), 0, 1, 0,0,0); - interval_major.date = new Date(data[0].startdate.getFullYear(), 0, 1, 0,0,0); - - //interval.date_major_start = new Date(data[0].startdate.getFullYear(), 0, 1, 0,0,0); - //interval.date_major_end = new Date(data[0].startdate.getFullYear(), 0, 1, 0,0,0); - - var inc_time = 0; - var inc_time_major = 0; - var _first_run = true; - var _normal_first_pos = 0; - var _last_pos = 0; - var _last_pos_major = 0; - - for(var i = 0; i < interval.number + 1; i++) { - - var _idd; - if (interval.type == "century") { - if (_first_run) { - interval.date.setFullYear( Math.floor(data[0].startdate.getFullYear() / 100) * 100 ); - } - interval.date.setFullYear(interval.date.getFullYear() + (inc_time * 100)); - _idd = Math.floor(interval.date.getFullYear() / 100) * 100; - } else if (interval.type == "decade") { - if (_first_run) { - interval.date.setFullYear( Math.floor(data[0].startdate.getFullYear() / 10) * 10 ); - } - interval.date.setFullYear(interval.date.getFullYear() + (inc_time * 10)); - _idd = Math.floor(interval.date.getFullYear() / 10) * 10; - } else if (interval.type == "year") { - if (_first_run) { - - } - interval.date.setFullYear(interval.date.getFullYear() + inc_time); - //_idd = interval.date.getFullYear(); - _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); - } else if (interval.type == "month") { - if (_first_run) { - interval.date.setMonth(data[0].startdate.getMonth()); - } - interval.date.setMonth(interval.date.getMonth() + inc_time); - //_idd = VMM.Util.date.month[interval.date.getMonth()] + ", " + interval.date.getFullYear() ; - _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); - } else if (interval.type == "week") { - if (_first_run) { - interval.date.setMonth( data[0].startdate.getMonth() ); - interval.date.setDate( Math.floor(data[0].startdate.getDate() *7) ); - } - interval.date.setDate(interval.date.getDate() + (inc_time * 7) ); - _idd = VMM.Util.date.day_abbr[interval.date.getDay()] + " " + VMM.Util.date.month_abbr[interval.date.getMonth()] + " " + interval.date.getDate(); - } else if (interval.type == "day") { - if (_first_run) { - interval.date.setMonth( data[0].startdate.getMonth() ); - interval.date.setDate( data[0].startdate.getDate() ); - } - interval.date.setDate(interval.date.getDate() + inc_time); - _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); - //_idd = VMM.Util.date.day_abbr[interval.date.getDay()] + " " +VMM.Util.date.month[interval.date.getMonth()] + " " + interval.date.getDate(); - } else if (interval.type == "hour") { - if (_first_run) { - interval.date.setMonth( data[0].startdate.getMonth() ); - interval.date.setDate( data[0].startdate.getDate() ); - interval.date.setHours( data[0].startdate.getHours() ); - } - interval.date.setHours(interval.date.getHours() + inc_time); - //_idd = VMM.Util.date.get12HRTime(interval.date, false); //interval.date.getHours() + ":00"; - _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); - } else if (interval.type == "minute") { - if (_first_run) { - interval.date.setMonth( data[0].startdate.getMonth() ); - interval.date.setDate( data[0].startdate.getDate() ); - interval.date.setHours( data[0].startdate.getHours() ); - interval.date.setMinutes( data[0].startdate.getMinutes() ); - } - interval.date.setMinutes(interval.date.getMinutes() + inc_time); - //_idd = interval.date.getHours() + ":" + VMM.Util.doubledigit(interval.date.getMinutes()); - _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); - } else if (interval.type == "second") { - if (_first_run) { - interval.date.setMonth( data[0].startdate.getMonth() ); - interval.date.setDate( data[0].startdate.getDate() ); - interval.date.setHours( data[0].startdate.getHours() ); - interval.date.setMinutes( data[0].startdate.getMinutes() ); - interval.date.setSeconds( data[0].startdate.getSeconds() ); - } - interval.date.setSeconds(interval.date.getSeconds() + inc_time); - //_idd = interval.date.getHours() + ":" + VMM.Util.doubledigit(interval.date.getMinutes()) + ":" + VMM.Util.doubledigit(interval.date.getSeconds()); - _idd = VMM.Util.date.prettyDate(interval.date, true, interval.type); - } - - inc_time = 1; - - if (_first_run) { - _normal_first_pos = pos; - } - _first_run = false; - - var _pos = positionOnTimeline(interval, interval.date, interval.date); - var pos = _pos.begin; - - $interval_date = VMM.appendAndGetElement($timeinterval, "
", "_idd"); - VMM.appendElement($interval_date, _idd); - - VMM.Element.css($interval_date, "left", pos); - VMM.Element.css($interval_date, "text-indent", -(VMM.Element.width($interval_date)/2)); - - if ((pos - _last_pos) < 65 ) { - if ((pos - _last_pos) < 35 ) { - if (i%4 == 0) { - if (pos == 0) { - VMM.Element.css($interval_date, "display", "none"); - } else { - VMM.Element.css($interval_date, "display", ""); - } - - } else { - VMM.Element.css($interval_date, "display", "none"); - } - } else { - if (VMM.Util.isEven(i)) { - VMM.Element.css($interval_date, "display", "none"); - } else { - VMM.Element.css($interval_date, "display", ""); - } - } - - } else { - VMM.Element.css($interval_date, "display", ""); - } - - _last_pos = pos; - } - - _first_run = true; - _major_first_pos = 0; - _major_last_pos = 0; - - for(var i = 0; i < Math.ceil(interval_major.number) + 1; i++) { - var _idd; - - if (interval_major.type == "century") { - if (_first_run) { - interval_major.date.setFullYear( Math.floor(data[0].startdate.getFullYear() / 100) * 100 ); - } - interval_major.date.setFullYear(interval_major.date.getFullYear() + (inc_time_major * 100)); - _idd = Math.floor(interval_major.date.getFullYear() / 100) * 100; - } else if (interval_major.type == "decade") { - if (_first_run) { - interval_major.date.setFullYear( Math.floor(data[0].startdate.getFullYear() / 10) * 10 ); - } - interval_major.date.setFullYear(interval_major.date.getFullYear() + (inc_time_major * 10)); - _idd = Math.floor(interval_major.date.getFullYear() / 10) * 10; - } else if (interval_major.type == "year") { - if (_first_run) { - - } - interval_major.date.setFullYear(interval_major.date.getFullYear() + inc_time_major); - _idd = interval_major.date.getFullYear(); - //_idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); - } else if (interval_major.type == "month") { - if (_first_run) { - interval_major.date.setMonth(data[0].startdate.getMonth()); - } - interval_major.date.setMonth(interval_major.date.getMonth() + inc_time_major); - _idd = VMM.Util.date.month[interval_major.date.getMonth()] + " " + interval_major.date.getFullYear(); - //_idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); - } else if (interval_major.type == "week") { - if (_first_run) { - interval_major.date.setMonth( data[0].startdate.getMonth() ); - interval_major.date.setDate( Math.floor(data[0].startdate.getDate() *7) ); - } - interval_major.date.setDate(interval_major.date.getDate() + (inc_time_major * 7) ); - _idd = VMM.Util.date.day_abbr[interval_major.date.getDay()] + " " + VMM.Util.date.month_abbr[interval_major.date.getMonth()] + " " + interval_major.date.getDate(); - } else if (interval_major.type == "day") { - if (_first_run) { - interval_major.date.setMonth( data[0].startdate.getMonth() ); - interval_major.date.setDate( data[0].startdate.getDate() ); - } - interval_major.date.setDate(interval_major.date.getDate() + inc_time_major); - //_idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); - //_idd = VMM.Util.date.day[interval_major.date.getDay()] + " " + VMM.Util.date.month_abbr[interval_major.date.getMonth()] + " " + interval_major.date.getDate(); - _idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); - } else if (interval_major.type == "hour") { - if (_first_run) { - interval_major.date.setMonth( data[0].startdate.getMonth() ); - interval_major.date.setDate( data[0].startdate.getDate() ); - interval_major.date.setHours( data[0].startdate.getHours() ); - } - interval_major.date.setHours(interval_major.date.getHours() + inc_time_major); - //_idd = VMM.Util.date.get12HRTime(interval_major.date, false); //interval_major.date.getHours() + ":00"; - _idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); - } else if (interval_major.type == "minute") { - if (_first_run) { - interval_major.date.setMonth( data[0].startdate.getMonth() ); - interval_major.date.setDate( data[0].startdate.getDate() ); - interval_major.date.setHours( data[0].startdate.getHours() ); - interval_major.date.setMinutes( data[0].startdate.getMinutes() ); - } - interval_major.date.setMinutes(interval_major.date.getMinutes() + inc_time_major); - //_idd = interval_major.date.getHours() + ":" + VMM.Util.doubledigit(interval_major.date.getMinutes()); - _idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); - } else if (interval_major.type == "second") { - if (_first_run) { - interval_major.date.setMonth( data[0].startdate.getMonth() ); - interval_major.date.setDate( data[0].startdate.getDate() ); - interval_major.date.setHours( data[0].startdate.getHours() ); - interval_major.date.setMinutes( data[0].startdate.getMinutes() ); - interval_major.date.setSeconds( data[0].startdate.getSeconds() ); - } - interval_major.date.setSeconds(interval_major.date.getSeconds() + inc_time_major); - //_idd = interval_major.date.getHours() + ":" + VMM.Util.doubledigit(interval_major.date.getMinutes()) + ":" + VMM.Util.doubledigit(interval_major.date.getSeconds()); - _idd = VMM.Util.date.prettyDate(interval_major.date, true, interval_major.type); - } - trace("interval_major.type " + interval_major.type); - - inc_time_major = 1; - - - - /* BUILD DATE USING SAME METHODOLOGY AS MARKER POSITON - CREATE A DATE - //================================================== */ - - var _pos = positionOnTimeline(interval, interval_major.date, interval_major.date); - var pos = _pos.begin; - - $interval_date = VMM.appendAndGetElement($timeintervalmajor, "
", "major"); - VMM.appendElement($interval_date, _idd); - - VMM.Element.css($interval_date, "left", pos); - VMM.Element.css($interval_date, "left", pos); - VMM.Element.css($interval_date, "text-indent", -(VMM.Element.width($interval_date)/2)); - - if (_first_run) { - _major_first_pos = pos; - } - _first_run = false; - - _last_pos_major = pos; - _major_last_pos = pos; - - } - - VMM.Element.width($content, interval.number * (config.interval_width / config.multiplier) ); - - //VMM.Element.width($timeintervalminor_minor, (interval.number * (config.interval_width / config.multiplier)) + 200 ); - _minor_pos_offset = 50; - var _minor_width = (_major_last_pos - _major_first_pos)+(_minor_pos_offset*6); - var _normal_width = (_last_pos)+(_minor_pos_offset*6); - - if (_minor_width < _normal_width) { - VMM.Element.width($timeintervalminor_minor, _normal_width); - } else { - VMM.Element.width($timeintervalminor_minor, _minor_width); - } - - - VMM.Element.css($timeintervalminor_minor, "left", _major_first_pos - _minor_pos_offset); - - config.timeline_width = VMM.Element.width($timeinterval); - - - } - - var buildInterval = function() { - - /* CALCULATE INTERVAL - ================================================== */ - timespan = getDateFractions((data[data.length - 1].enddate) - (data[0].startdate), true); - calculateInterval(); - - /* DETERMINE DEFAULT INTERVAL TYPE - ================================================== */ - - if (timespan.milleniums > data.length / config.density) { - interval = interval_calc.millenium; - //interval_major = interval_calc.millenium; - } else if (timespan.centuries > data.length / config.density) { - interval = Math.ceil(interval_calc.century); - //interval_major = interval_calc.millenium; - } else if (timespan.decades > data.length / config.density) { - interval = interval_calc.decade; - //interval_major = Math.ceil(interval_calc.century); - } else if (timespan.years > data.length / config.density) { - interval = interval_calc.year; - //interval_major = interval_calc.decade; - } else if (timespan.months > data.length / config.density) { - interval = interval_calc.month; - //interval_major = interval_calc.year; - //} else if (timespan.weeks > data.length / config.density) { - //interval = interval_calc.week; - //interval = interval_calc.month; - //interval_major = interval_calc.month; - } else if (timespan.days > data.length / config.density) { - interval = interval_calc.day; - //interval_major = interval_calc.month; - } else if (timespan.hours > data.length / config.density) { - interval = interval_calc.hour; - //interval_major = interval_calc.day; - } else if (timespan.minutes > data.length / config.density) { - interval = interval_calc.minute; - //interval_major = interval_calc.hour; - } else if (timespan.seconds > data.length / config.density) { - interval = interval_calc.second; - //interval_major = interval_calc.minute; - } else { - trace("NO IDEA WHAT THE TYPE SHOULD BE"); - interval.type = "unknown"; - } - - /* DETERMINE MAJOR TYPE - ================================================== */ - - if (timespan.milleniums >= 1) { - interval_major = interval_calc.millenium; - } else if (timespan.centuries >= 1) { - interval_major = interval_calc.century; - } else if (timespan.decades >= 1) { - interval_major = interval_calc.decade; - } else if (timespan.years >= 1) { - interval_major = interval_calc.year; - } else if (timespan.months > 1) { - interval_major = interval_calc.month; - } else if (timespan.weeks > 1) { - interval_major = interval_calc.month; - } else if (timespan.days > 1) { - interval_major = interval_calc.day; - } else if (timespan.hours > 1) { - interval_major = interval_calc.hour; - } else if (timespan.minutes > 1) { - interval_major = interval_calc.minute; - } else if (timespan.seconds > 1) { - interval_major = interval_calc.minute; - } else { - trace("NO IDEA WHAT THE TYPE SHOULD BE"); - interval_major.type = "unknown"; - } - - //trace(interval_major.type); - - $timeintervalminor_minor = VMM.appendAndGetElement($timeintervalminor, "
", "minor"); - - positionInterval(); - - } - - /* GO TO TIME MARKER - ================================================== */ - var goToMarker = function(n, ease, duration, fast, firstrun) { - - // Set current slide - current_marker = n; - - var _ease = config.ease; - var _duration = config.duration; - var is_last = false; - var is_first = false; - - if (current_marker == 0) { - is_first = true; - } - if (current_marker +1 == markers.length) { - is_last = true - } - if (ease != null && ease != "") {_ease = ease}; - if (duration != null && duration != "") {_duration = duration}; - - /* get marker position - ================================================== */ - var _pos = VMM.Element.position(markers[current_marker].marker); - - /* set marker style - ================================================== */ - for(var i = 0; i < markers.length; i++) { - VMM.Element.removeClass(markers[i].marker, "active"); - } - - if (config.has_start_page && markers[current_marker].type == "start") { - VMM.Element.visible(markers[current_marker].marker, false); - VMM.Element.addClass(markers[current_marker].marker, "start"); - } - - VMM.Element.addClass(markers[current_marker].marker, "active"); - - /* set proper nav titles and dates etc. - ================================================== */ - if (is_first) { - //VMM.Element.visible(navigation.prevBtn, false); - } else { - //VMM.Element.visible(navigation.prevBtn, true); - } - if (is_last) { - //VMM.Element.visible(navigation.nextBtn, false); - } else { - //VMM.Element.visible(navigation.nextBtn, true); - } - - /* ANIMATE MARKER - ================================================== */ - VMM.Element.stop($timenav); - VMM.Element.animate($timenav, _duration, _ease, {"left": (config.width/2) - (_pos.left)}); - - - } - - - /* BUILD - ================================================== */ - var build = function() { - // Clear out existing content - - VMM.attachElement(layout, ""); - - $timenav = VMM.appendAndGetElement(layout, "
", "timenav"); - - - $content = VMM.appendAndGetElement($timenav, "
", "content"); - $time = VMM.appendAndGetElement($timenav, "
", "time"); - $timeintervalminor = VMM.appendAndGetElement($time, "
", "time-interval-minor"); - $timeintervalmajor = VMM.appendAndGetElement($time, "
", "time-interval-major"); - $timeinterval = VMM.appendAndGetElement($time, "
", "time-interval"); - $timebackground = VMM.appendAndGetElement(layout, "
", "timenav-background"); - $timenavline = VMM.appendAndGetElement($timebackground, "
", "timenav-line"); - $timeintervalbackground = VMM.appendAndGetElement($timebackground, "
", "timenav-interval-background", "
"); - - buildInterval(); - buildMarkers(); - reSize(true); - VMM.fireEvent(layout, "LOADED"); - - $toolbar = VMM.appendAndGetElement(layout, "
", "toolbar"); - - if (config.has_start_page) { - $backhome = VMM.appendAndGetElement($toolbar, "
", "back-home", "
"); - VMM.bindEvent(".back-home", onBackHome, "click"); - VMM.Element.css($toolbar, "top", 27); - - } - $zoomin = VMM.appendAndGetElement($toolbar, "
", "zoom-in", "
"); - $zoomout = VMM.appendAndGetElement($toolbar, "
", "zoom-out", "
"); - - VMM.Element.attribute($backhome, "title", VMM.Timeline.Config.language.messages.return_to_title); - VMM.Element.attribute($backhome, "rel", "tooltip"); - - VMM.Element.attribute($zoomin, "title", VMM.Timeline.Config.language.messages.expand_timeline); - VMM.Element.attribute($zoomin, "rel", "tooltip"); - - VMM.Element.attribute($zoomout, "title", VMM.Timeline.Config.language.messages.contract_timeline); - VMM.Element.attribute($zoomout, "rel", "tooltip"); - - VMM.bindEvent(".zoom-in", onZoomIn, "click"); - VMM.bindEvent(".zoom-out", onZoomOut, "click"); - - - $toolbar.tooltip({ - selector: "div[rel=tooltip]", - placement: "right" - }) - /* MAKE TIMELINE TOUCHABLE - ================================================== */ - if (VMM.Browser.device == "mobile" || VMM.Browser.device == "tablet") { - VMM.TouchSlider.createPanel($timebackground, $timenav, config.width, config.spacing, false); - VMM.bindEvent($timenav, onTouchUpdate, "TOUCHUPDATE"); - } else { - - VMM.DragSlider.createPanel(layout, $timenav, config.width, config.spacing, false); - //VMM.bindEvent($timenav, onDragUpdate, "DRAGUPDATE"); - } - - - - _active = true; - - }; - - var refreshTimeline = function() { - positionInterval(); - positionMarkers(true); - //reSize(); - }; - - - - }; - VMM.Timeline.Config = {}; - - - - /* SOURCE DATA PROCESSOR - ================================================== */ - VMM.Timeline.DataObj = { - - data_obj: {}, - - model_array: [], - - getData: function(raw_data) { - - data = VMM.Timeline.DataObj.data_obj; - - - if (type.of(raw_data) != "string") { - - trace("DATA SOURCE: NOT JSON"); - trace("TRYING HTML PARSE"); - VMM.Timeline.DataObj.parseHTML(raw_data); - - } else { - - if (raw_data.match("%23")) { - - trace("DATA SOURCE: TWITTER SEARCH"); - VMM.Timeline.DataObj.model_Tweets.getData("%23medill"); - - } else if ( raw_data.match("spreadsheet") ) { - - trace("DATA SOURCE: GOOGLE SPREADSHEET"); - VMM.Timeline.DataObj.model_GoogleSpreadsheet.getData(raw_data); - - } else { - - trace("DATA SOURCE: JSON"); - VMM.getJSON(raw_data, VMM.Timeline.DataObj.parseJSON); - - } - - } - - }, - - parseHTML: function(d) { - trace("parseHTML"); - - var _data_obj = VMM.Timeline.DataObj.data_template_obj; - - /* Timeline start slide - ================================================== */ - if (VMM.Element.find("#timeline section", "time")[0]) { - _data_obj.timeline.startDate = VMM.Element.html(VMM.Element.find("#timeline section", "time")[0]); - _data_obj.timeline.headline = VMM.Element.html(VMM.Element.find("#timeline section", "h2")); - _data_obj.timeline.text = VMM.Element.html(VMM.Element.find("#timeline section", "article")); - - var found_main_media = false; - - if (VMM.Element.find("#timeline section", "figure img").length != 0) { - found_main_media = true; - _data_obj.timeline.asset.media = VMM.Element.attr(VMM.Element.find("#timeline section", "figure img"), "src"); - } else if (VMM.Element.find("#timeline section", "figure a").length != 0) { - found_main_media = true; - _data_obj.timeline.asset.media = VMM.Element.attr(VMM.Element.find("#timeline section", "figure a"), "href"); - } else { - //trace("NOT FOUND"); - } - - if (found_main_media) { - if (VMM.Element.find("#timeline section", "cite").length != 0) { - _data_obj.timeline.asset.credit = VMM.Element.html(VMM.Element.find("#timeline section", "cite")); - } - if (VMM.Element.find(this, "figcaption").length != 0) { - _data_obj.timeline.asset.caption = VMM.Element.html(VMM.Element.find("#timeline section", "figcaption")); - } - } - } - - /* Timeline Date Slides - ================================================== */ - VMM.Element.each("#timeline li", function(i, elem){ - - var valid_date = false; - - var _date = { - "type":"default", - "startDate":"", - "headline":"", - "text":"", - "asset": - { - "media":"", - "credit":"", - "caption":"" - }, - "tags":"Optional" - }; - - if (VMM.Element.find(this, "time") != 0) { - - valid_date = true; - - _date.startDate = VMM.Element.html(VMM.Element.find(this, "time")[0]); - - if (VMM.Element.find(this, "time")[1]) { - _date.endDate = VMM.Element.html(VMM.Element.find(this, "time")[0]); - } - - _date.headline = VMM.Element.html(VMM.Element.find(this, "h3")); - - _date.text = VMM.Element.html(VMM.Element.find(this, "article")); - - var found_media = false; - if (VMM.Element.find(this, "figure img").length != 0) { - found_media = true; - _date.asset.media = VMM.Element.attr(VMM.Element.find(this, "figure img"), "src"); - } else if (VMM.Element.find(this, "figure a").length != 0) { - found_media = true; - _date.asset.media = VMM.Element.attr(VMM.Element.find(this, "figure a"), "href"); - } else { - //trace("NOT FOUND"); - } - - if (found_media) { - if (VMM.Element.find(this, "cite").length != 0) { - _date.asset.credit = VMM.Element.html(VMM.Element.find(this, "cite")); - } - if (VMM.Element.find(this, "figcaption").length != 0) { - _date.asset.caption = VMM.Element.html(VMM.Element.find(this, "figcaption")); - } - } - - trace(_date); - _data_obj.timeline.date.push(_date); - - } - - }); - - VMM.fireEvent(global, "DATAREADY", _data_obj); - - }, - - parseJSON: function(d) { - - if (d.timeline.type == "default") { - - trace("DATA SOURCE: JSON STANDARD TIMELINE"); - - VMM.fireEvent(global, "DATAREADY", d); - //return _data_obj.timeline; - - } else if (d.timeline.type == "twitter") { - - trace("DATA SOURCE: JSON TWEETS"); - - VMM.Timeline.DataObj.model_Tweets.buildData(d); - - - } else { - trace("DATA SOURCE: NO IDEA"); - trace(type.of(d.timeline)); - }; - - }, - - /* MODEL OBJECTS - New Types of Data can be formatted for the timeline here - ================================================== */ - - model_Tweets: { - - type: "twitter", - - buildData: function(raw_data) { - - VMM.bindEvent(global, VMM.Timeline.DataObj.model_Tweets.onTwitterDataReady, "TWEETSLOADED"); - VMM.ExternalAPI.twitter.getTweets(raw_data.timeline.tweets); - - }, - - getData: function(raw_data) { - - VMM.bindEvent(global, VMM.Timeline.DataObj.model_Tweets.onTwitterDataReady, "TWEETSLOADED"); - VMM.ExternalAPI.twitter.getTweetSearch(raw_data); - - }, - - onTwitterDataReady: function(e, d) { - - var _data_obj = VMM.Timeline.DataObj.data_template_obj; - - for(var i = 0; i < d.tweetdata.length; i++) { - - var _date = { - "type":"tweets", - "startDate":"", - "headline":"", - "text":"", - "asset": - { - "media":"", - "credit":"", - "caption":"" - }, - "tags":"Optional" - }; - // pass in the 'created_at' string returned from twitter // - // stamp arrives formatted as Tue Apr 07 22:52:51 +0000 2009 // - - //var twit_date = VMM.ExternalAPI.twitter.parseTwitterDate(d.tweetdata[i].raw.created_at); - //trace(twit_date); - _date.startDate = d.tweetdata[i].raw.created_at; - - if (type.of(d.tweetdata[i].raw.from_user_name)) { - _date.headline = d.tweetdata[i].raw.from_user_name + " (" + "@" + d.tweetdata[i].raw.from_user + ")" ; - } else { - _date.headline = d.tweetdata[i].raw.user.name + " (" + "@" + d.tweetdata[i].raw.user.screen_name + ")" ; - - } - - _date.asset.media = d.tweetdata[i].content; - _data_obj.timeline.date.push(_date); - - }; - - VMM.fireEvent(global, "DATAREADY", _data_obj); - - } - }, - - model_GoogleSpreadsheet: { - - /* - TEMPLATE CAN BE FOUND HERE - https://docs.google.com/previewtemplate?id=0AppSVxABhnltdEhzQjQ4MlpOaldjTmZLclQxQWFTOUE&mode=public - - */ - type: "google spreadsheet", - - getData: function(raw_data) { - var _key = VMM.Util.getUrlVars(raw_data)["key"]; - var _url = "https://spreadsheets.google.com/feeds/list/" + _key + "/od6/public/values?alt=json"; - VMM.getJSON(_url, VMM.Timeline.DataObj.model_GoogleSpreadsheet.buildData); - - }, - - buildData: function(d) { - var _data_obj = VMM.Timeline.DataObj.data_template_obj; - - for(var i = 0; i < d.feed.entry.length; i++) { - - - var dd = d.feed.entry[i]; - - if (dd.gsx$titleslide.$t.match("start")) { - _data_obj.timeline.startDate = dd.gsx$startdate.$t; - _data_obj.timeline.headline = dd.gsx$headline.$t; - _data_obj.timeline.asset.media = dd.gsx$media.$t; - _data_obj.timeline.asset.caption = dd.gsx$mediacaption.$t; - _data_obj.timeline.asset.credit = dd.gsx$mediacredit.$t; - _data_obj.timeline.text = dd.gsx$text.$t; - _data_obj.timeline.type = "google spreadsheet"; - } else { - var _date = { - "type":"google spreadsheet", - "startDate":"", - "endDate":"", - "headline":"", - "text":"", - "type":"google spreadsheet", - "asset": - { - "media":"", - "credit":"", - "caption":"" - }, - "tags":"Optional" - }; - - _date.endDate = dd.gsx$enddate.$t; - _date.startDate = dd.gsx$startdate.$t; - _date.headline = dd.gsx$headline.$t; - _date.asset.media = dd.gsx$media.$t; - _date.asset.caption = dd.gsx$mediacaption.$t; - _date.asset.credit = dd.gsx$mediacredit.$t; - _date.text = dd.gsx$text.$t; - - _data_obj.timeline.date.push(_date); - } - - - - }; - - VMM.fireEvent(global, "DATAREADY", _data_obj); - - } - - }, - - - /* TEMPLATE OBJECTS - ================================================== */ - - data_template_obj: { - "timeline": { - "headline":"", - "description":"", - "asset": { - "media":"", - "credit":"", - "caption":"" - }, - "date": [] - } - }, - - date_obj: { - "startDate":"2012,2,2,11,30", - "headline":"", - "text":"", - "asset": - { - "media":"http://youtu.be/vjVfu8-Wp6s", - "credit":"", - "caption":"" - }, - "tags":"Optional" - } - - }; - -}; - - - - -/* -$(document).ready(function() { - - //Instantiate - timeline = new VMM.Timeline(960, 550); // Pass in width and height or set it in your stylesheet; - - // Initialize - timeline.init("example.json"); // Pass in the data - -}); -*/ \ No newline at end of file +}; \ No newline at end of file diff --git a/source/js/VMM.TouchSlider.js b/source/js/VMM.TouchSlider.js new file mode 100644 index 0000000..045aee7 --- /dev/null +++ b/source/js/VMM.TouchSlider.js @@ -0,0 +1,192 @@ +/* TOUCH SLIDER +================================================== */ +if(typeof VMM != 'undefined' && typeof VMM.TouchSlider == 'undefined') { + + // VMM.TouchSlider.createSlidePanel(touch_object, move_object, w, padding, vertical, h) ; + VMM.TouchSlider = { + createPanel: function(touch_object, move_object, w, padding, vertical, h) { + VMM.TouchSlider.vertical = false; + VMM.TouchSlider.vertical = vertical; + + var x = padding; + VMM.TouchSlider.width = w; + VMM.TouchSlider.height = h; + VMM.TouchSlider.makeTouchable(touch_object, move_object); + /* + if (sticky != null && sticky != "") { + VMM.TouchSlider.sticky = sticky; + } else { + VMM.TouchSlider.sticky = false; + } + */ + // VMM.TouchSlider.sticky = sticky; + + }, + + removePanel: function(touch_object) { + VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchStart, "touchstart"); + VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchMove, "touchmove"); + VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchEnd, "touchend"); + }, + + makeTouchable: function(touch_object, move_object) { + VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchStart, "touchstart", {element: move_object}); + VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchMove, "touchmove", {element: move_object}); + VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchEnd, "touchend", {element: move_object}); + }, + onTouchStart: function(e) { + VMM.TouchSlider.touchStart(e.data.element, e); + e.preventDefault(); + e.stopPropagation(); + return true; + }, + onTouchEnd: function(e) { + e.preventDefault(); + e.stopPropagation(); + + if (VMM.TouchSlider.sliding) { + VMM.TouchSlider.sliding = false; + VMM.TouchSlider.touchEnd(e.data.element, e); + return false; + } else { + return true; + } + + }, + onTouchMove: function(e) { + VMM.TouchSlider.touchMove(e.data.element, e); + e.preventDefault(); + e.stopPropagation(); + return false; + }, + getLeft: function(elem) { + return parseInt(VMM.Element.css(elem, 'left').substring(0, VMM.Element.css(elem, 'left').length - 2), 10); + }, + getTop: function(elem) { + return parseInt(VMM.Element.css(elem, 'top').substring(0, VMM.Element.css(elem, 'top').length - 2), 10); + }, + touchStart: function(elem, e) { + + VMM.Element.css(elem, '-webkit-transition-duration', '0'); + + VMM.TouchSlider.startX = e.originalEvent.touches[0].screenX; + VMM.TouchSlider.startY = e.originalEvent.touches[0].screenY; + + VMM.TouchSlider.startLeft = VMM.TouchSlider.getLeft(elem); + VMM.TouchSlider.startTop = VMM.TouchSlider.getTop(elem); + + VMM.TouchSlider.touchStartTime = new Date().getTime(); + + }, + touchEnd: function(elem, e) { + if (VMM.TouchSlider.getLeft(elem) > 0) { + + //This means they dragged to the right past the first item + + if (VMM.TouchSlider.vertical) { + VMM.Element.animate(elem, 1000, "", {"top": 0}); + } else { + VMM.Element.animate(elem, 1000, "", {"left": 0}); + } + + VMM.TouchSlider.startX = null; + VMM.TouchSlider.startY = null; + + VMM.fireEvent(elem, "TOUCHUPDATE", [0]); + + } else { + //This means they were just dragging within the bounds of the grid and we just need to handle the momentum and snap to the grid. + VMM.TouchSlider.slideMomentum(elem, e); + } + }, + slideMomentum: function(elem, e) { + var slideAdjust = (new Date().getTime() - VMM.TouchSlider.touchStartTime) * 10; + var timeAdjust = slideAdjust; + + var left = VMM.TouchSlider.getLeft(elem); + var top = VMM.TouchSlider.getTop(elem); + + var changeX = 6000 * (Math.abs(VMM.TouchSlider.startLeft) - Math.abs(left)); + var changeY = 6000 * (Math.abs(VMM.TouchSlider.startTop) - Math.abs(top)); + + slideAdjust = Math.round(changeX / slideAdjust); + slideAdjustY = Math.round(changeY / slideAdjust); + + var newLeft = slideAdjust + left; + var newTop = slideAdjustY + top; + + var y = newTop % VMM.TouchSlider.height; + var t = newLeft % VMM.TouchSlider.width; + + + var _r_object = { + top: Math.min(0, newTop), + left: Math.min(0, newLeft), + time: timeAdjust + } + VMM.fireEvent(elem, "TOUCHUPDATE", [_r_object]); + /* + if (VMM.TouchSlider.sticky) { + trace("sticky"); + if ((Math.abs(t)) > ((VMM.TouchSlider.width / 2))) { + //Show the next cell + newLeft -= (VMM.TouchSlider.width - Math.abs(t)); + } else { + //Stay on the current cell + newLeft -= t; + } + + VMM.fireEvent(elem, "TOUCHUPDATE", [Math.min(0, newLeft)]); + + } else { + trace("not sticky"); + //VMM.TouchSlider.doSlide(elem, Math.min(0, newLeft), '0.5s'); + VMM.Element.animate(elem, 500, "", {"left": Math.min(0, newLeft)}); + } + */ + + VMM.TouchSlider.startX = null; + VMM.TouchSlider.startY = null; + + }, + doSlide: function(elem, x, duration) { + VMM.Element.css(elem, '-webkit-transition-property', 'left'); + VMM.Element.css(elem, '-webkit-transition-duration', duration); + VMM.Element.css(elem, 'left', x); + }, + touchMove: function(elem, e) { + + if (!VMM.TouchSlider.sliding) { + //elem.parent().addClass('sliding'); + } + + VMM.TouchSlider.sliding = true; + + if (VMM.TouchSlider.vertical) { + + if (VMM.TouchSlider.startY > e.originalEvent.touches[0].screenY) { + VMM.Element.css(elem, 'top', -(VMM.TouchSlider.startY - e.originalEvent.touches[0].screenY - VMM.TouchSlider.startTop)); + VMM.TouchSlider.slidingTop = true; + } else { + var top = (e.originalEvent.touches[0].screenY - VMM.TouchSlider.startY + VMM.TouchSlider.startTop); + VMM.Element.css(elem, 'top', -(VMM.TouchSlider.startY - e.originalEvent.touches[0].screenY - VMM.TouchSlider.startTop)); + VMM.TouchSlider.slidingTop = false; + } + + } else { + + if (VMM.TouchSlider.startX > e.originalEvent.touches[0].screenX) { + VMM.Element.css(elem, 'left', -(VMM.TouchSlider.startX - e.originalEvent.touches[0].screenX - VMM.TouchSlider.startLeft)); + VMM.TouchSlider.slidingLeft = true; + } else { + var left = (e.originalEvent.touches[0].screenX - VMM.TouchSlider.startX + VMM.TouchSlider.startLeft); + VMM.Element.css(elem, 'left', -(VMM.TouchSlider.startX - e.originalEvent.touches[0].screenX - VMM.TouchSlider.startLeft)); + VMM.TouchSlider.slidingLeft = false; + } + + } + + + } + } +} \ No newline at end of file diff --git a/source/js/VMM.js b/source/js/VMM.js index b19aac4..cf3ab34 100644 --- a/source/js/VMM.js +++ b/source/js/VMM.js @@ -1,17 +1,13 @@ /* Verite * Verite JS Master - * Version: 0.5 - * Date: April 5, 2012 + * Version: 0.6 + * Date: April 26, 2012 * Copyright 2012 Verite unless part of Verite Timeline, * if part of Timeline then it inherits Timeline's license. * Designed and built by Zach Wise digitalartwork.net * ----------------------------------------------------- */ -/* CodeKit Import -================================================== */ - - /* Simple JavaScript Inheritance * By John Resig http://ejohn.org/ * MIT Licensed. @@ -89,14 +85,11 @@ var global = (function () { ================================================== */ if (typeof VMM == 'undefined') { - - /* Main Scope Container ================================================== */ //var VMM = {}; var VMM = Class.extend({}); - /* Master Config ================================================== */ @@ -131,8 +124,6 @@ if (typeof VMM == 'undefined') { }).init(); - /* Abstract out DOM element creation to make independent of library - ================================================== */ //VMM.createElement(tag, value, cName, attrs, styles); VMM.createElement = function(tag, value, cName, attrs, styles) { @@ -200,709 +191,6 @@ if (typeof VMM == 'undefined') { }; - - /* LIBRARY ABSTRACTION - ================================================== */ - - //VMM.attachElement(element, content); - VMM.attachElement = function(element, content) { - if( typeof( jQuery ) != 'undefined' ){ - $(element).html(content); - } - - }; - //VMM.appendElement(element, content); - VMM.appendElement = function(element, content) { - - if( typeof( jQuery ) != 'undefined' ){ - $(element).append(content); - } - - }; - - VMM.getHTML = function(element) { - var e; - if( typeof( jQuery ) != 'undefined' ){ - e = jQuery(element).html(); - return e; - } - - }; - //VMM.getElement(element); - VMM.getElement = function(element, p) { - var e; - if( typeof( jQuery ) != 'undefined' ){ - if (p) { - e = jQuery(element).parent().get(0); - - } else { - e = jQuery(element).get(0); - } - return e; - } - - }; - //VMM.bindEvent(element, the_handler, the_event_type, event_data); - //VMM.bindEvent(window, the_handler, "event type", {event_data}); - VMM.bindEvent = function(element, the_handler, the_event_type, event_data) { - var e; - var _event_type = "click"; - var _event_data = {}; - - if (the_event_type != null && the_event_type != "") { - _event_type = the_event_type; - } - - if (_event_data != null && _event_data != "") { - _event_data = event_data; - } - - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).bind(_event_type, _event_data, the_handler); - - //return e; - } - - }; - //VMM.unbindEvent(window, the_handler, "event type"); - VMM.unbindEvent = function(element, the_handler, the_event_type) { - var e; - var _event_type = "click"; - var _event_data = {}; - - if (the_event_type != null && the_event_type != "") { - _event_type = the_event_type; - } - - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).unbind(_event_type, the_handler); - - //return e; - } - - }; - //VMM.fireEvent(element, "resize", [data]); - VMM.fireEvent = function(element, the_event_type, the_data) { - var e; - var _event_type = "click"; - var _data = []; - - if (the_event_type != null && the_event_type != "") { - _event_type = the_event_type; - } - if (the_data != null && the_data != "") { - _data = the_data; - } - - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).trigger(_event_type, _data); - - //return e; - } - - }; - - // VMM.getJSON(url, the_function); - VMM.getJSON = function(url, data, callback) { - if( typeof( jQuery ) != 'undefined' ){ - - /* CHECK FOR IE AND USE Use Microsoft XDR - ================================================== */ - if ( VMM.Browser.browser == "Explorer" && parseInt(VMM.Browser.version, 10) >= 7 && window.XDomainRequest) { - trace("it's ie"); - var ie_url = url; - - if (ie_url.match('^http://')){ - trace("RUNNING GET JSON") - ie_url = ie_url.replace("http://","//"); - return jQuery.getJSON(url, data, callback); - } else if (ie_url.match('^https://')) { - trace("RUNNING XDR"); - ie_url = ie_url.replace("https://","http://"); - var xdr = new XDomainRequest(); - xdr.open("get", ie_url); - xdr.onload = function() { - var ie_json = VMM.parseJSON(xdr.responseText); - trace(xdr.responseText); - if (type.of(ie_json) == "null" || type.of(ie_json) == "undefined") { - trace("IE JSON ERROR") - } else { - return data(ie_json) - } - - } - xdr.send(); - } else { - return jQuery.getJSON(url, data, callback); - } - } else { - //$.getJSON(url, data); - trace("getJSON"); - return jQuery.getJSON(url, data, callback); - - - } - } - } - // VMM.parseJSON(the_json); - VMM.parseJSON = function(the_json) { - if( typeof( jQuery ) != 'undefined' ){ - return jQuery.parseJSON(the_json); - } - } - // ADD ELEMENT AND RETURN IT - // VMM.appendAndGetElement(append_to_element, tag, cName, content, [attrib]); - VMM.appendAndGetElement = function(append_to_element, tag, cName, content) { - var e; - var _tag = "
"; - var _class = ""; - var _content = ""; - - - if (tag != null && tag != "") { - _tag = tag; - } - - if (cName != null && cName != "") { - _class = cName; - } - - if (content != null && content != "") { - _content = content; - } - - if( typeof( jQuery ) != 'undefined' ){ - - e = $(tag); - - e.addClass(_class); - e.html(_content); - - jQuery(append_to_element).append(e); - - //$(e).appendTo(element); - - } - - return e; - - }; - - VMM.Element = ({ - - init: function() { - return this; - }, - // VMM.Element.hide(element); - hide: function(element, duration) { - if (duration != null && duration != "") { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).hide(duration); - } - } else { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).hide(); - } - } - - }, - // VMM.Element.remove(element); - remove: function(element) { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).remove(); - } - }, - // VMM.Element.detach(element); - detach: function(element) { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).detach(); - } - }, - // VMM.Element.append(element, value); - append: function(element, value) { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).append(value); - } - }, - // VMM.Element.show(element); - show: function(element, duration) { - if (duration != null && duration != "") { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).show(duration); - } - } else { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).show(); - } - } - - }, - // VMM.Element.load(element, callback_function, event_data); - load: function(element, callback_function, event_data) { - var _event_data = {elem:element}; // return element by default - if (_event_data != null && _event_data != "") { - _event_data = event_data; - } - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).load(_event_data, callback_function); - } - }, - //VMM.Element.addClass(element, cName); - addClass: function(element, cName) { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).addClass(cName); - } - }, - //VMM.Element.removeClass(element, cName); - removeClass: function(element, cName) { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).removeClass(cName); - } - }, - //VMM.Element.attr(element, aName, value); - attr: function(element, aName, value) { - if (value != null && value != "") { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).attr(aName, value); - } - } else { - if( typeof( jQuery ) != 'undefined' ){ - return jQuery(element).attr(aName); - } - } - }, - //VMM.Element.prop(element, aName, value); - prop: function(element, aName, value) { - if (typeof jQuery == 'undefined' || !/[1-9]\.[3-9].[1-9]/.test($.fn.jquery)) { - VMM.Element.attribute(element, aName, value); - } else { - jQuery(element).prop(aName, value); - } - }, - //VMM.Element.attribute(element, aName, value); - attribute: function(element, aName, value) { - - if (value != null && value != "") { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).attr(aName, value); - } - } else { - if( typeof( jQuery ) != 'undefined' ){ - return jQuery(element).attr(aName); - } - } - }, - /* Sets or gets the visability of a dom element - ================================================== */ - //VMM.Element.visible(element, show); - visible: function(element, show) { - if (show != null) { - if( typeof( jQuery ) != 'undefined' ){ - if (show) { - jQuery(element).show(0); - } else { - jQuery(element).hide(0); - } - } - } else { - if( typeof( jQuery ) != 'undefined' ){ - if ( jQuery(element).is(':visible')){ - return true; - } else { - return false; - } - } - } - }, - /* Sets a style for the specified element or gets the style - ================================================== */ - //VMM.Element.css(element, prop, value); - css: function(element, prop, value) { - - if (value != null && value != "") { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).css(prop, value); - } - } else { - if( typeof( jQuery ) != 'undefined' ){ - return jQuery(element).css(prop); - } - } - }, - - cssmultiple: function(element, propval) { - - if( typeof( jQuery ) != 'undefined' ){ - return jQuery(element).css(propval); - } - }, - /* Gets offset - ================================================== */ - //VMM.Element.offset(element); - offset: function(element) { - var p; - if( typeof( jQuery ) != 'undefined' ){ - p = jQuery(element).offset(); - } - return p; - }, - /* Gets position - ================================================== */ - //VMM.Element.position(element); - position: function(element) { - var p; - if( typeof( jQuery ) != 'undefined' ){ - p = jQuery(element).position(); - } - return p; - }, - /* Sets or gets the width of a dom element - ================================================== */ - //VMM.Element.width(element, s); - width: function(element, s) { - if (s != null && s != "") { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).width(s); - } - } else { - if( typeof( jQuery ) != 'undefined' ){ - return jQuery(element).width(); - } - } - }, - /* Sets or gets the width of a dom element - ================================================== */ - height: function(element, s) { - if (s != null && s != "") { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).height(s); - } - } else { - if( typeof( jQuery ) != 'undefined' ){ - return jQuery(element).height(); - } - } - }, - /* TOGGLE CLASS - ================================================== */ - // VMM.Element.toggleClass(element, cName); - toggleClass: function(element, cName) { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).toggleClass(cName); - } - }, - /* Each - ================================================== */ - // VMM.Element.each(element, return_function); - each:function(element, return_function) { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).each(return_function); - } - - }, - /* Each - ================================================== */ - // VMM.Element.html(element, str); - html: function(element, str) { - var e; - if( typeof( jQuery ) != 'undefined' ){ - e = jQuery(element).html(); - return e; - } - - if (str != null && str != "") { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).html(str); - } - } else { - var e; - if( typeof( jQuery ) != 'undefined' ){ - e = jQuery(element).html(); - return e; - } - } - - }, - /* Find - ================================================== */ - // VMM.Element.find(element, selec); - find: function(element, selec) { - if( typeof( jQuery ) != 'undefined' ){ - return jQuery(element).find(selec); - } - }, - /* Animate - ================================================== */ - // VMM.Element.stop(element); - stop: function(element) { - if( typeof( jQuery ) != 'undefined' ){ - jQuery(element).stop(); - } - }, - // VMM.Element.animate(element, duration, ease, att, callback_function); - animate: function(element, duration, ease, att, callback_function) { - - var _ease = "easein"; - var _duration = 1000; - var _att = {}; - - if (duration != null) { - if (duration < 1) { - _duration = 1; - } else { - _duration = Math.round(duration); - } - - } - - if (ease != null && ease != "") { - _ease = ease; - } - - if (att != null) { - _att = att - } else { - _att = {opacity: 0} - } - - - if (VMM.Browser.device == "mobile" || VMM.Browser.device == "tablet") { - - var _tdd = Math.round((_duration/1500)*10)/10 - var __duration = _tdd + 's'; - VMM.Element.css(element, '-webkit-transition', 'all '+ __duration + ' ease'); - VMM.Element.css(element, '-moz-transition', 'all '+ __duration + ' ease'); - VMM.Element.css(element, '-o-transition', 'all '+ __duration + ' ease'); - VMM.Element.css(element, '-ms-transition', 'all '+ __duration + ' ease'); - VMM.Element.css(element, 'transition', 'all '+ __duration + ' ease'); - VMM.Element.cssmultiple(element, _att); - - //callback_function(); - /* - if( typeof( jQuery ) != 'undefined' ){ - if (callback_function != null && callback_function != "") { - $(element).animate(_att, {queue:false, duration:_duration, easing:"ease", complete:callback_function} ); - } else { - $(element).animate(_att, {queue:false, duration:_duration, easing:"ease"} ); - } - } - */ - - } else { - if( typeof( jQuery ) != 'undefined' ){ - if (callback_function != null && callback_function != "") { - jQuery(element).animate(_att, {queue:false, duration:_duration, easing:_ease, complete:callback_function} ); - } else { - jQuery(element).animate(_att, {queue:false, duration:_duration, easing:_ease} ); - } - } - } - - - /* - VMM.Element.cssmultiple(element, { - '-webkit-transition': 'all 1s ease-in-out', - '-moz-transition': 'all 1s ease-in-out', - '-o-transition': 'all 1s ease-in-out', - '-ms-transition': 'all 1s ease-in-out', - 'transition': 'all 1s ease-in-out', - - }); - */ - }, - - }).init(); - - /* TOUCH - ================================================== */ - // VMM.TouchSlider.createSlidePanel(touch_object, move_object, w, padding, vertical, h) ; - VMM.TouchSlider = { - createPanel: function(touch_object, move_object, w, padding, vertical, h) { - VMM.TouchSlider.vertical = false; - VMM.TouchSlider.vertical = vertical; - - var x = padding; - VMM.TouchSlider.width = w; - VMM.TouchSlider.height = h; - VMM.TouchSlider.makeTouchable(touch_object, move_object); - /* - if (sticky != null && sticky != "") { - VMM.TouchSlider.sticky = sticky; - } else { - VMM.TouchSlider.sticky = false; - } - */ - // VMM.TouchSlider.sticky = sticky; - - }, - - removePanel: function(touch_object) { - VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchStart, "touchstart"); - VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchMove, "touchmove"); - VMM.unbindEvent(touch_object, VMM.TouchSlider.onTouchEnd, "touchend"); - }, - - makeTouchable: function(touch_object, move_object) { - VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchStart, "touchstart", {element: move_object}); - VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchMove, "touchmove", {element: move_object}); - VMM.bindEvent(touch_object, VMM.TouchSlider.onTouchEnd, "touchend", {element: move_object}); - }, - onTouchStart: function(e) { - VMM.TouchSlider.touchStart(e.data.element, e); - e.preventDefault(); - e.stopPropagation(); - return true; - }, - onTouchEnd: function(e) { - e.preventDefault(); - e.stopPropagation(); - - if (VMM.TouchSlider.sliding) { - VMM.TouchSlider.sliding = false; - VMM.TouchSlider.touchEnd(e.data.element, e); - return false; - } else { - return true; - } - - }, - onTouchMove: function(e) { - VMM.TouchSlider.touchMove(e.data.element, e); - e.preventDefault(); - e.stopPropagation(); - return false; - }, - getLeft: function(elem) { - return parseInt(VMM.Element.css(elem, 'left').substring(0, VMM.Element.css(elem, 'left').length - 2), 10); - }, - getTop: function(elem) { - return parseInt(VMM.Element.css(elem, 'top').substring(0, VMM.Element.css(elem, 'top').length - 2), 10); - }, - touchStart: function(elem, e) { - - VMM.Element.css(elem, '-webkit-transition-duration', '0'); - - VMM.TouchSlider.startX = e.originalEvent.touches[0].screenX; - VMM.TouchSlider.startY = e.originalEvent.touches[0].screenY; - - VMM.TouchSlider.startLeft = VMM.TouchSlider.getLeft(elem); - VMM.TouchSlider.startTop = VMM.TouchSlider.getTop(elem); - - VMM.TouchSlider.touchStartTime = new Date().getTime(); - - }, - touchEnd: function(elem, e) { - if (VMM.TouchSlider.getLeft(elem) > 0) { - - //This means they dragged to the right past the first item - - if (VMM.TouchSlider.vertical) { - VMM.Element.animate(elem, 1000, "", {"top": 0}); - } else { - VMM.Element.animate(elem, 1000, "", {"left": 0}); - } - - VMM.TouchSlider.startX = null; - VMM.TouchSlider.startY = null; - - VMM.fireEvent(elem, "TOUCHUPDATE", [0]); - - } else { - //This means they were just dragging within the bounds of the grid and we just need to handle the momentum and snap to the grid. - VMM.TouchSlider.slideMomentum(elem, e); - } - }, - slideMomentum: function(elem, e) { - var slideAdjust = (new Date().getTime() - VMM.TouchSlider.touchStartTime) * 10; - var timeAdjust = slideAdjust; - - var left = VMM.TouchSlider.getLeft(elem); - var top = VMM.TouchSlider.getTop(elem); - - var changeX = 6000 * (Math.abs(VMM.TouchSlider.startLeft) - Math.abs(left)); - var changeY = 6000 * (Math.abs(VMM.TouchSlider.startTop) - Math.abs(top)); - - slideAdjust = Math.round(changeX / slideAdjust); - slideAdjustY = Math.round(changeY / slideAdjust); - - var newLeft = slideAdjust + left; - var newTop = slideAdjustY + top; - - var y = newTop % VMM.TouchSlider.height; - var t = newLeft % VMM.TouchSlider.width; - - - var _r_object = { - top: Math.min(0, newTop), - left: Math.min(0, newLeft), - time: timeAdjust - } - VMM.fireEvent(elem, "TOUCHUPDATE", [_r_object]); - /* - if (VMM.TouchSlider.sticky) { - trace("sticky"); - if ((Math.abs(t)) > ((VMM.TouchSlider.width / 2))) { - //Show the next cell - newLeft -= (VMM.TouchSlider.width - Math.abs(t)); - } else { - //Stay on the current cell - newLeft -= t; - } - - VMM.fireEvent(elem, "TOUCHUPDATE", [Math.min(0, newLeft)]); - - } else { - trace("not sticky"); - //VMM.TouchSlider.doSlide(elem, Math.min(0, newLeft), '0.5s'); - VMM.Element.animate(elem, 500, "", {"left": Math.min(0, newLeft)}); - } - */ - - VMM.TouchSlider.startX = null; - VMM.TouchSlider.startY = null; - - }, - doSlide: function(elem, x, duration) { - VMM.Element.css(elem, '-webkit-transition-property', 'left'); - VMM.Element.css(elem, '-webkit-transition-duration', duration); - VMM.Element.css(elem, 'left', x); - }, - touchMove: function(elem, e) { - - if (!VMM.TouchSlider.sliding) { - //elem.parent().addClass('sliding'); - } - - VMM.TouchSlider.sliding = true; - - if (VMM.TouchSlider.vertical) { - - if (VMM.TouchSlider.startY > e.originalEvent.touches[0].screenY) { - VMM.Element.css(elem, 'top', -(VMM.TouchSlider.startY - e.originalEvent.touches[0].screenY - VMM.TouchSlider.startTop)); - VMM.TouchSlider.slidingTop = true; - } else { - var top = (e.originalEvent.touches[0].screenY - VMM.TouchSlider.startY + VMM.TouchSlider.startTop); - VMM.Element.css(elem, 'top', -(VMM.TouchSlider.startY - e.originalEvent.touches[0].screenY - VMM.TouchSlider.startTop)); - VMM.TouchSlider.slidingTop = false; - } - - } else { - - if (VMM.TouchSlider.startX > e.originalEvent.touches[0].screenX) { - VMM.Element.css(elem, 'left', -(VMM.TouchSlider.startX - e.originalEvent.touches[0].screenX - VMM.TouchSlider.startLeft)); - VMM.TouchSlider.slidingLeft = true; - } else { - var left = (e.originalEvent.touches[0].screenX - VMM.TouchSlider.startX + VMM.TouchSlider.startLeft); - VMM.Element.css(elem, 'left', -(VMM.TouchSlider.startX - e.originalEvent.touches[0].screenX - VMM.TouchSlider.startLeft)); - VMM.TouchSlider.slidingLeft = false; - } - - } - - - } - } - // Hide URL Bar for iOS and Android by Scott Jehl // https://gist.github.com/1183357 @@ -935,1333 +223,9 @@ if (typeof VMM == 'undefined') { } }; - /* DRAG - ================================================== */ - // VMM.DragSlider.createSlidePanel(drag_object, move_object, w, padding, sticky); - // VMM.DragSlider.cancelSlide(); - VMM.DragSlider = { - createPanel: function(drag_object, move_object, w, padding, sticky) { - - - - var x = padding; - VMM.DragSlider.width = w; - VMM.DragSlider.makeDraggable(drag_object, move_object); - VMM.DragSlider.drag_elem = drag_object; - /* - if (sticky != null && sticky != "") { - VMM.TouchSlider.sticky = sticky; - } else { - VMM.TouchSlider.sticky = false; - } - */ - VMM.DragSlider.sticky = sticky; - }, - makeDraggable: function(drag_object, move_object) { - VMM.bindEvent(drag_object, VMM.DragSlider.onDragStart, "mousedown", {element: move_object, delement: drag_object}); - //VMM.bindEvent(drag_object, VMM.DragSlider.onDragMove, "mousemove", {element: move_object}); - VMM.bindEvent(drag_object, VMM.DragSlider.onDragEnd, "mouseup", {element: move_object, delement: drag_object}); - VMM.bindEvent(drag_object, VMM.DragSlider.onDragLeave, "mouseleave", {element: move_object, delement: drag_object}); - }, - cancelSlide: function(e) { - VMM.unbindEvent(VMM.DragSlider.drag_elem, VMM.DragSlider.onDragMove, "mousemove"); - //VMM.DragSlider.drag_elem.preventDefault(); - //VMM.DragSlider.drag_elem.stopPropagation(); - return true; - }, - onDragLeave: function(e) { - - VMM.unbindEvent(e.data.delement, VMM.DragSlider.onDragMove, "mousemove"); - e.preventDefault(); - e.stopPropagation(); - return true; - }, - onDragStart: function(e) { - VMM.DragSlider.dragStart(e.data.element, e.data.delement, e); - - e.preventDefault(); - e.stopPropagation(); - return true; - }, - onDragEnd: function(e) { - e.preventDefault(); - e.stopPropagation(); - - if (VMM.DragSlider.sliding) { - VMM.DragSlider.sliding = false; - VMM.DragSlider.dragEnd(e.data.element, e.data.delement, e); - return false; - } else { - return true; - } - - }, - onDragMove: function(e) { - VMM.DragSlider.dragMove(e.data.element, e); - e.preventDefault(); - e.stopPropagation(); - return false; - }, - dragStart: function(elem, delem, e) { - - VMM.DragSlider.startX = e.pageX; - - VMM.DragSlider.startLeft = VMM.DragSlider.getLeft(elem); - VMM.DragSlider.dragStartTime = new Date().getTime(); - VMM.DragSlider.dragWidth = VMM.Element.width(delem); - - // CANCEL CURRENT ANIMATION IF ANIMATING - var _newx = Math.round(VMM.DragSlider.startX - e.pageX - VMM.DragSlider.startLeft); - - VMM.Element.stop(elem); - VMM.bindEvent(delem, VMM.DragSlider.onDragMove, "mousemove", {element: elem}); - - }, - dragEnd: function(elem, delem, e) { - VMM.unbindEvent(delem, VMM.DragSlider.onDragMove, "mousemove"); - //VMM.DragSlider.dragMomentum(elem, e); - if (VMM.DragSlider.getLeft(elem) > 0) { - //(VMM.DragSlider.dragWidth/2) - //This means they dragged to the right past the first item - //VMM.Element.animate(elem, 1000, "linear", {"left": 0}); - - //VMM.fireEvent(elem, "DRAGUPDATE", [0]); - } else { - //This means they were just dragging within the bounds of the grid and we just need to handle the momentum and snap to the grid. - VMM.DragSlider.dragMomentum(elem, e); - } - }, - dragMove: function(elem, e) { - if (!VMM.DragSlider.sliding) { - //elem.parent().addClass('sliding'); - } - - VMM.DragSlider.sliding = true; - if (VMM.DragSlider.startX > e.pageX) { - //Sliding to the left - VMM.Element.css(elem, 'left', -(VMM.DragSlider.startX - e.pageX - VMM.DragSlider.startLeft)); - VMM.DragSlider.slidingLeft = true; - } else { - //Sliding to the right - var left = (e.pageX - VMM.DragSlider.startX + VMM.DragSlider.startLeft); - VMM.Element.css(elem, 'left', -(VMM.DragSlider.startX - e.pageX - VMM.DragSlider.startLeft)); - VMM.DragSlider.slidingLeft = false; - } - }, - dragMomentum: function(elem, e) { - var slideAdjust = (new Date().getTime() - VMM.DragSlider.dragStartTime) * 10; - var timeAdjust = slideAdjust; - var left = VMM.DragSlider.getLeft(elem); - - var changeX = 6000 * (Math.abs(VMM.DragSlider.startLeft) - Math.abs(left)); - //var changeX = 6000 * (VMM.DragSlider.startLeft - left); - slideAdjust = Math.round(changeX / slideAdjust); - - var newLeft = left + slideAdjust; - - var t = newLeft % VMM.DragSlider.width; - //left: Math.min(0, newLeft), - var _r_object = { - left: Math.min(newLeft), - time: timeAdjust - } - - VMM.fireEvent(elem, "DRAGUPDATE", [_r_object]); - var _ease = "easeOutExpo"; - if (_r_object.time > 0) { - VMM.Element.animate(elem, _r_object.time, _ease, {"left": _r_object.left}); - }; - - - //VMM.DragSlider.startX = null; - }, - getLeft: function(elem) { - return parseInt(VMM.Element.css(elem, 'left').substring(0, VMM.Element.css(elem, 'left').length - 2), 10); - } - - } - - /* DEVICE - ================================================== */ - - VMM.Browser = { - init: function () { - this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; - this.version = this.searchVersion(navigator.userAgent) - || this.searchVersion(navigator.appVersion) - || "an unknown version"; - this.OS = this.searchString(this.dataOS) || "an unknown OS"; - this.device = this.searchDevice(navigator.userAgent); - - }, - searchDevice: function(d) { - if (d.match(/Android/i) || d.match(/iPhone|iPod/i)) { - return "mobile"; - } else if (d.match(/iPad/i)) { - return "tablet"; - } else if (d.match(/BlackBerry/i) || d.match(/IEMobile/i)) { - return "other mobile"; - } else { - return "desktop"; - } - }, - searchString: function (data) { - for (var i=0;i
"; - return mediaElem; - } else if (m.type == "flickr") { - mediaElem = "
"; - return mediaElem; - } else if (m.type == "youtube") { - mediaElem = "
"; - return mediaElem; - } else if (m.type == "googledoc") { - mediaElem = ""; - } else if (m.type == "vimeo") { - mediaElem = "
"; - return mediaElem; - } else if (m.type == "twitter"){ - mediaElem = ""; - return mediaElem; - } else if (m.type == "twitter-ready") { - mediaElem = ""; - return mediaElem; - } else if (m.type == "soundcloud") { - mediaElem = "
"; - return mediaElem; - } else if (m.type == "google-map") { - mediaElem = "
"; - return mediaElem; - } else if (m.type == "unknown") { - mediaElem = ""; - return mediaElem; - } else if (m.type == "website") { - mediaElem = "
"; - //mediaElem = "
"; - - return mediaElem; - } else { - mediaElem = "
"; - return mediaElem; - } - } - }, - //VMM.MediaElement.create(element, data, returntrue); - create: function(element, data, __return, w, h) { - - _return = __return; - _w = 500; - _h = 400; - $mediacontainer = element; - //VMM.MediaElement.container = element; - var _valid = false; - if (w != null && w != "") { - _w = w; - } - if (h != null && h != "") { - _h = h; - } - - if (data.media != null && data.media != "") { - - _valid = true; - var mediaElem = ""; - var captionElem = ""; - var creditElem = ""; - var m = {}; - var media_height = (_h - 50); - var isTextMedia = false; - - // CREDIT - if (data.credit != null && data.credit != "") { - creditElem = "
" + VMM.Util.linkify_with_twitter(data.credit, "_blank") + "
"; - } - // CAPTION - if (data.caption != null && data.caption != "") { - captionElem = "
" + VMM.Util.linkify_with_twitter(data.caption, "_blank") + "
"; - } - - // MEDIA TYPE - m = VMM.MediaType(data.media); //returns an object with .type and .id - - // CREATE MEDIA CODE - if (m.type == "image") { - mediaElem = ""; - } else if (m.type == "flickr") { - var flickr_id = "flickr_" + m.id; - mediaElem = ""; - VMM.ExternalAPI.flickr.getPhoto(m.id, "#" + flickr_id); - } else if (m.type == "googledoc") { - if (m.id.match(/docs.google.com/i)) { - mediaElem = ""; - } else { - mediaElem = ""; - } - - - } else if (m.type == "youtube") { - mediaElem = "
Loading YouTube video...
"; - VMM.ExternalAPI.youtube.init(m.id); - //mediaElem = ""; - } else if (m.type == "vimeo") { - mediaElem = ""; - } else if (m.type == "twitter"){ - mediaElem = ""; - //VMM.ExternalAPI.twitter.getHTML(m.id); - trace("TWITTER"); - VMM.ExternalAPI.twitter.prettyHTML(m.id); - isTextMedia = true; - } else if (m.type == "twitter-ready") { - mediaElem = m.id; - } else if (m.type == "soundcloud") { - var soundcloud_id = "soundcloud_" + VMM.Util.unique_ID(5); - mediaElem = "
Loading Sound
"; - VMM.ExternalAPI.soundcloud.getSound(m.id, soundcloud_id) - } else if (m.type == "google-map") { - //mediaElem = "" - var map_id = "googlemap_" + VMM.Util.unique_ID(7); - mediaElem = "
Loading Map...
"; - VMM.ExternalAPI.googlemaps.getMap(m.id, map_id); - } else if (m.type == "unknown") { - trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML"); - mediaElem = VMM.Util.properQuotes(m.id); - } else if (m.type == "website") { - mediaElem = ""; - //mediaElem = "" + ""; - } else { - trace("NO KNOWN MEDIA TYPE FOUND"); - trace(m.type); - } - // WRAP THE MEDIA ELEMENT - mediaElem = "
" + mediaElem + creditElem + captionElem + "
"; - - if (_return) { - if (isTextMedia) { - return "
" + mediaElem + "
"; - } else { - return "
" + mediaElem + "
"; - } - } else { - VMM.appendElement($mediacontainer, mediaElem); - VMM.appendElement($mediacontainer, creditElem); - VMM.appendElement($mediacontainer, captionElem); - } - }; - - }, - - }).init(); - - //VMM.mediaType.youtube(d); //should return a true or false - // VMM.MediaType(url); //returns an object with .type and .id - VMM.MediaType = function(d) { - var success = false; - var media = {}; - if (d.match("div class='twitter'")) { - media.type = "twitter-ready"; - media.id = d; - success = true; - } else if (d.match('(www.)?youtube|youtu\.be')) { - if (d.match('v=')) { - youtube_id = VMM.Util.getUrlVars(d)["v"]; - //youtube_id = d.split(/embed\//)[1].split('"')[0]; - } else { - youtube_id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; - } - //youtube_id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; - // http://www.youtube.com/watch?feature=player_embedded&v=0l-ivcnLrSc - //http://www.youtube.com/watch?v=0l-ivcnLrSc - media.type = "youtube"; - media.id = youtube_id; - success = true; - } else if (d.match('(player.)?vimeo\.com')) { - //vimeo_id = d.split(/video\/|http:\/\/vimeo\.com\//)[1].split(/[?&]/)[0]; - vimeo_id = d.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0]; - - media.type = "vimeo"; - media.id = vimeo_id; - success = true; - } else if (d.match('(player.)?soundcloud\.com')) { - //soundcloud_url = unescape(d.split(/value="/)[1].split(/["]/)[0]); - //soundcloud_id = soundcloud_url.split(/tracks\//)[1].split(/[&"]/)[0]; - media.type = "soundcloud"; - media.id = d; - success = true; - } else if (d.match('(www.)?twitter\.com')) { - trace("TWITTER MATCH"); - // https://twitter.com/#!/twitterapi/statuses/133640144317198338 - // https://twitter.com/#!/DeliciousHot/status/23189589820702720 - if (d.match("status\/")) { - twitter_id = d.split("status\/")[1]; - } else if (d.match("statuses\/")) { - twitter_id = d.split("statuses\/")[1]; - } else { - twitter_id = ""; - } - - media.type = "twitter"; - media.id = twitter_id; - success = true; - } else if (d.match("maps.google")) { - //maps.google.com - media.type = "google-map"; - media.id = d.split(/src=['|"][^'|"]*?['|"]/gi); - //trace("google map " + media.id); - success = true; - } else if (d.match("flickr.com/photos")) { - media.type = "flickr"; - //media.id = d.split('/photos/[^/]+/([0-9]+)/gi'); - - media.id = d.split("photos\/")[1].split("/")[1]; - media.link = d; - //media.id = media.id.split("/")[1]; - //trace("FLICKR " + media.id); - success = true; - } else if (d.match(/jpg|jpeg|png|gif/i)) { - media.type = "image"; - media.id = d; - success = true; - } else if (VMM.FileExtention.googleDocType(d)) { - media.type = "googledoc"; - media.id = d; - success = true; - } else if (d.indexOf('http://') == 0) { - media.type = "website"; - media.id = d; - success = true; - } else { - trace("unknown media"); - media.type = "unknown"; - media.id = d; - success = true; - } - - if (success) { - return media; - } else { - trace("No valid media id detected"); - trace(d); - } - return false; - } - //VMM.FileExtention.googleDocType(url); - VMM.FileExtention = { - googleDocType: function(url) { - var fileName = url; - var fileExtension = ""; - //fileExtension = fileName.substr(5); - fileExtension = fileName.substr(fileName.length - 5, 5); - var validFileExtensions = ["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"]; - var flag = false; - - for (var i = 0; i < validFileExtensions.length; i++) { - - - if (fileExtension.toLowerCase().match(validFileExtensions[i].toString().toLowerCase()) || fileName.match("docs.google.com") ) { - flag = true; - } - - } - - return flag; - - } - } - - - - - VMM.ExternalAPI = { - - twitter: { - tweetArray: [], - // VMM.ExternalAPI.twitter.getHTML(id); - getHTML: function(id) { - //var the_url = document.location.protocol + "//api.twitter.com/1/statuses/oembed.json?id=" + id+ "&callback=?"; - var the_url = "http://api.twitter.com/1/statuses/oembed.json?id=" + id+ "&callback=?"; - VMM.getJSON(the_url, VMM.ExternalAPI.twitter.onJSONLoaded); - }, - onJSONLoaded: function(d) { - trace("TWITTER JSON LOADED"); - var id = d.id; - VMM.attachElement("#"+id, VMM.Util.linkify_with_twitter(d.html) ); - }, - - // VMM.ExternalAPI.twitter.parseTwitterDate(date); - parseTwitterDate: function(d) { - var date = new Date(Date.parse(d)); - /* - var t = d.replace(/(\d{1,2}[:]\d{2}[:]\d{2}) (.*)/, '$2 $1'); - t = t.replace(/(\+\S+) (.*)/, '$2 $1'); - var date = new Date(Date.parse(t)).toLocaleDateString(); - var time = new Date(Date.parse(t)).toLocaleTimeString(); - */ - return date; - }, - - prettyParseTwitterDate: function(d) { - var date = new Date(Date.parse(d)); - return VMM.Util.date.prettyDate(date, true); - }, - - // VMM.ExternalAPI.twitter.getTweets(tweets_array); - getTweets: function(tweets) { - var tweetArray = []; - var number_of_tweets = tweets.length; - - for(var i = 0; i < tweets.length; i++) { - - var twitter_id = ""; - - - /* FIND THE TWITTER ID - ================================================== */ - if (tweets[i].tweet.match("status\/")) { - twitter_id = tweets[i].tweet.split("status\/")[1]; - } else if (tweets[i].tweet.match("statuses\/")) { - twitter_id = tweets[i].tweet.split("statuses\/")[1]; - } else { - twitter_id = ""; - } - - /* FETCH THE DATA - ================================================== */ - var the_url = "http://api.twitter.com/1/statuses/show.json?id=" + twitter_id + "&include_entities=true&callback=?"; - VMM.getJSON(the_url, function(d) { - - var tweet = {} - /* FORMAT RESPONSE - ================================================== */ - var twit = ""; - - tweet.content = twit; - tweet.raw = d; - - tweetArray.push(tweet); - - - /* CHECK IF THATS ALL OF THEM - ================================================== */ - if (tweetArray.length == number_of_tweets) { - var the_tweets = {tweetdata: tweetArray} - VMM.fireEvent(global, "TWEETSLOADED", the_tweets); - } - }) - .success(function() { trace("second success"); }) - .error(function() { trace("error"); }) - .complete(function() { trace("complete"); }); - - } - - - }, - - // VMM.ExternalAPI.twitter.getTweetSearch(search string); - getTweetSearch: function(tweets, number_of_tweets) { - var _number_of_tweets = 40; - if (number_of_tweets != null && number_of_tweets != "") { - _number_of_tweets = number_of_tweets; - } - - var the_url = "http://search.twitter.com/search.json?q=" + tweets + "&rpp=" + _number_of_tweets + "&include_entities=true&result_type=mixed"; - var tweetArray = []; - VMM.getJSON(the_url, function(d) { - - /* FORMAT RESPONSE - ================================================== */ - for(var i = 0; i < d.results.length; i++) { - var tweet = {} - var twit = ""; - tweet.content = twit; - tweet.raw = d.results[i]; - tweetArray.push(tweet); - } - var the_tweets = {tweetdata: tweetArray} - VMM.fireEvent(global, "TWEETSLOADED", the_tweets); - }); - - }, - // VMM.ExternalAPI.twitter.prettyHTML(id); - prettyHTML: function(id) { - var id = id.toString(); - var error_obj = { - twitterid: id - }; - var the_url = "http://api.twitter.com/1/statuses/show.json?id=" + id + "&include_entities=true&callback=?"; - trace("id " + id); - var twitter_timeout = setTimeout(VMM.ExternalAPI.twitter.notFoundError, 4000, id); - VMM.getJSON(the_url, VMM.ExternalAPI.twitter.formatJSON) - - .error(function(jqXHR, textStatus, errorThrown) { - trace("TWITTER error"); - trace("TWITTER ERROR: " + textStatus + " " + jqXHR.responseText); - VMM.attachElement("#twitter_"+id, "

ERROR LOADING TWEET " + id + "

" ); - }) - .success(function() { - clearTimeout(twitter_timeout); - }); - - - }, - - notFoundError: function(id) { - trace("TWITTER JSON ERROR TIMEOUT " + id); - VMM.attachElement("#twitter_" + id, "

TWEET NOT FOUND " + id + "

" ); - }, - - formatJSON: function(d) { - trace("TWITTER JSON LOADED F"); - trace(d); - var id = d.id_str; - - var twit = "

"; - var td = VMM.Util.linkify_with_twitter(d.text, "_blank"); - //td = td.replace(/(@([\w]+))/g,"$1"); - //td = td.replace(/(#([\w]+))/g,"$1"); - twit += td; - twit += "

"; - twit += " " + "" + " "; - twit += ""; - - VMM.attachElement("#twitter_"+id.toString(), twit ); - - } - - }, - - //VMM.ExternalAPI.googlemaps.getMap() - googlemaps: { - /* - //http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9 - - http://maps.google.com/maps?q=chicago&hl=en&sll=41.874961,-87.619054&sspn=0.159263,0.351906&t=t&hnear=Chicago,+Cook,+Illinois&z=11&output=kml - http://maps.google.com/maps/ms?msid=215143221704623082244.0004a53ad1e3365113a32&msa=0 - http://maps.google.com/maps/ms?msid=215143221704623082244.0004a53ad1e3365113a32&msa=0&output=kml - http://maps.google.com/maps/ms?msid=215143221704623082244.0004a21354b1a2f188082&msa=0&ll=38.719738,-9.142599&spn=0.04172,0.087976&iwloc=0004a214c0e99e2da91e0 - http://maps.google.com/maps?q=Bavaria&hl=en&ll=47.597829,9.398804&spn=1.010316,2.709503&sll=37.0625,-95.677068&sspn=73.579623,173.408203&hnear=Bavaria,+Germany&t=m&z=10&output=embed - */ - getMap: function(url, id) { - var map_vars = VMM.Util.getUrlVars(url); - trace(map_vars); - var map_url = "http://maps.googleapis.com/maps/api/js?key=" + Aes.Ctr.decrypt(VMM.master_config.keys.google, VMM.master_config.vp, 256) + "&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady"; - var map = { - url: url, - vars: map_vars, - id: id - } - - if (VMM.master_config.googlemaps.active) { - VMM.master_config.googlemaps.createMap(map); - } else { - - VMM.master_config.googlemaps.que.push(map); - - if (VMM.master_config.googlemaps.api_loaded) { - - } else { - - VMM.LoadLib.js(map_url, function() { - trace("Google Maps API Library Loaded"); - }); - } - - } - - - - }, - - onMapAPIReady: function() { - VMM.master_config.googlemaps.map_active = true; - VMM.master_config.googlemaps.places_active = true; - VMM.ExternalAPI.googlemaps.onAPIReady(); - }, - onPlacesAPIReady: function() { - VMM.master_config.googlemaps.places_active = true; - VMM.ExternalAPI.googlemaps.onAPIReady(); - }, - onAPIReady: function() { - if (!VMM.master_config.googlemaps.active) { - if (VMM.master_config.googlemaps.map_active && VMM.master_config.googlemaps.places_active) { - VMM.master_config.googlemaps.active = true; - for(var i = 0; i < VMM.master_config.googlemaps.que.length; i++) { - VMM.ExternalAPI.googlemaps.createMap(VMM.master_config.googlemaps.que[i]); - } - } - } - }, - - - - map_subdomains: ["", "a.", "b.", "c.", "d."], - - - map_attribution: { - "stamen": "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.", - "apple": "Map data © 2012 Apple, Imagery © 2012 Apple" - }, - - map_providers: { - "toner": { - "url": "http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png", - "minZoom": 0, - "maxZoom": 20, - "attribution": "stamen" - - }, - "toner-lines": { - "url": "http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png", - "minZoom": 0, - "maxZoom": 20, - "attribution": "stamen" - }, - "toner-labels": { - "url": "http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png", - "minZoom": 0, - "maxZoom": 20, - "attribution": "stamen" - }, - "sterrain": { - "url": "http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg", - "minZoom": 4, - "maxZoom": 20, - "attribution": "stamen" - }, - "apple": { - "url": "http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9", - "minZoom": 4, - "maxZoom": 20, - "attribution": "apple" - }, - "watercolor": { - "url": "http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg", - "minZoom": 3, - "maxZoom": 16, - "attribution": "stamen" - } - }, - - createMap: function(m) { - trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution); - /* MAP PROVIDERS - Including Stamen Maps - http://maps.stamen.com/ - Except otherwise noted, each of these map tile sets are © Stamen Design, under a Creative Commons Attribution (CC BY 3.0) license. - ================================================== */ - - var map_attribution = ""; - - function mapProvider(name) { - if (name in VMM.ExternalAPI.googlemaps.map_providers) { - map_attribution = VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[name].attribution]; - return VMM.ExternalAPI.googlemaps.map_providers[name]; - } else { - throw 'No such provider: "' + name + '"'; - } - } - - google.maps.VeriteMapType = function(name) { - var provider = mapProvider(name); - return google.maps.ImageMapType.call(this, { - "getTileUrl": function(coord, zoom) { - var index = (zoom + coord.x + coord.y) % VMM.ExternalAPI.googlemaps.map_subdomains.length; - return [ - provider.url - .replace("{S}", VMM.ExternalAPI.googlemaps.map_subdomains[index]) - .replace("{Z}", zoom) - .replace("{X}", coord.x) - .replace("{Y}", coord.y) - .replace("{z}", zoom) - .replace("{x}", coord.x) - .replace("{y}", coord.y) - ]; - }, - "tileSize": new google.maps.Size(256, 256), - "name": name, - "minZoom": provider.minZoom, - "maxZoom": provider.maxZoom - }); - }; - - google.maps.VeriteMapType.prototype = new google.maps.ImageMapType("_"); - - /* Make the Map - ================================================== */ - var layer; - - - if (type.of(VMM.master_config.Timeline.maptype) == "string") { - layer = VMM.master_config.Timeline.maptype; - } else { - layer = "toner"; - } - - var location = new google.maps.LatLng(41.875696,-87.624207); - var latlong; - var zoom = 11; - var has_location = false; - var has_zoom = false; - var map_bounds; - - if (type.of(VMM.Util.getUrlVars(m.url)["ll"]) == "string") { - has_location = true; - latlong = VMM.Util.getUrlVars(m.url)["ll"].split(","); - location = new google.maps.LatLng(parseFloat(latlong[0]),parseFloat(latlong[1])); - - } else if (type.of(VMM.Util.getUrlVars(m.url)["sll"]) == "string") { - has_location = true; - latlong = VMM.Util.getUrlVars(m.url)["sll"].split(","); - location = new google.maps.LatLng(parseFloat(latlong[0]),parseFloat(latlong[1])); - - } - - if (type.of(VMM.Util.getUrlVars(m.url)["z"]) == "string") { - has_zoom = true; - zoom = parseFloat(VMM.Util.getUrlVars(m.url)["z"]); - } - - var map_options = { - zoom:zoom, - disableDefaultUI: true, - mapTypeControl: false, - zoomControl: true, - zoomControlOptions: { - style: google.maps.ZoomControlStyle.SMALL, - position: google.maps.ControlPosition.TOP_RIGHT - }, - center: location, - mapTypeId: layer, - mapTypeControlOptions: { - mapTypeIds: [layer] - } - } - - var unique_map_id = m.id.toString() + "_gmap"; - VMM.attachElement("#" + m.id, "
"); - /* ATTRIBUTION - ================================================== */ - //var map_attribution_html = "
" + map_attribution + "
"; - //VMM.appendElement("#" + m.id, map_attribution_html); - - var map = new google.maps.Map(document.getElementById(unique_map_id), map_options); - map.mapTypes.set(layer, new google.maps.VeriteMapType(layer)); - - /* ATTRIBUTION - ================================================== */ - var map_attribution_html = "
" + map_attribution + "
"; - VMM.appendElement("#"+unique_map_id, map_attribution_html); - //.map-attribution - //.attribution-text - - loadKML(); - - /* KML - ================================================== */ - function loadKML() { - var kml_url = m.url + "&output=kml"; - kml_url = kml_url.replace("&output=embed", ""); - - var kml_layer = new google.maps.KmlLayer(kml_url, {preserveViewport:true}); - kml_layer.setMap(map); - - var infowindow = new google.maps.InfoWindow(); - - google.maps.event.addListenerOnce(kml_layer, "defaultviewport_changed", function() { - - - - if (has_location) { - map.panTo(location); - } - - if (has_zoom) { - map.setZoom(zoom); - } else { - map.fitBounds(kml_layer.getDefaultViewport() ); - } - - - }); - - google.maps.event.addListener(kml_layer, 'click', function(kmlEvent) { - var text = kmlEvent.featureData.description; - trace(kmlEvent.featureData.infoWindowHtml) - showInfoWindow(text); - function showInfoWindow(c) { - //trace("showInfoWindow") - infowindow.setContent(c); - infowindow.open(map); - } - }); - } - - }, - - }, - - //VMM.ExternalAPI.flickr.getPhoto(mediaID, htmlID); - flickr: { - - getPhoto: function(mid, id) { - // http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=6d6f59d8d30d79f4f402a7644d5073e3&photo_id=6115056146&format=json&nojsoncallback=1 - var the_url = "http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=" + Aes.Ctr.decrypt(VMM.master_config.keys.flickr, VMM.master_config.vp, 256) + "&photo_id=" + mid + "&format=json&jsoncallback=?"; - VMM.getJSON(the_url, VMM.ExternalAPI.flickr.setPhoto); - }, - - setPhoto: function(d) { - var flickr_id = d.sizes.size[0].url.split("photos\/")[1].split("/")[1]; - var id = "flickr_" + flickr_id; - var flickr_large_id = id + "_large"; - var flickr_thumb_id = id + "_thumb"; - // FIND LARGE SIZE - var flickr_img_large; - var flickr_large_found = false; - for(var i = 0; i < d.sizes.size.length; i++) { - if (d.sizes.size[i].label == "Large") { - flickr_large_found = true; - flickr_img_large = d.sizes.size[i].source; - } - } - if (!flickr_large_found) { - flickr_img_large = d.sizes.size[d.sizes.size.length - 1].source; - } - - var flickr_img_thumb = d.sizes.size[0].source; - VMM.Element.attr("#"+flickr_large_id, "src", flickr_img_large); - VMM.Element.attr("#"+flickr_thumb_id, "src", flickr_img_thumb); - } - - - }, - - soundcloud: { - // VMM.ExternalAPI.soundcloud.getSound(url, id) - /* - REFORMAT TO USE API FOR CUSTOM PLAYERS - */ - getSound: function(url, id) { - // http://soundcloud.com/oembed?iframe=true&url=http://soundcloud.com/erasedtapes/olafur-arnalds-poland - var the_url = "http://soundcloud.com/oembed?url=" + url + "&format=js&callback=?"; - VMM.getJSON(the_url, function(d) { - VMM.attachElement("#"+id, d.html ); - }); - }, - - }, - - // VMM.ExternalAPI.youtube.init(id); - youtube: { - init: function(id) { - - if (VMM.master_config.youtube.active) { - VMM.master_config.youtube.createPlayer(id); - } else { - - VMM.master_config.youtube.que.push(id); - - if (VMM.master_config.youtube.api_loaded) { - - } else { - - VMM.LoadLib.js('http://www.youtube.com/player_api', function() { - trace("YouTube API Library Loaded"); - }); - } - - } - }, - - onAPIReady: function() { - trace("YOUTUBE API READY") - VMM.master_config.youtube.active = true; - - for(var i = 0; i < VMM.master_config.youtube.que.length; i++) { - VMM.ExternalAPI.youtube.createPlayer(VMM.master_config.youtube.que[i]); - } - }, - // VMM.ExternalAPI.youtube.createPlayer(id); - createPlayer: function(id) { - var p = { - active:false, - player: {}, - name:'youtube_'+id, - playing:false - }; - - p.player['youtube_'+id] = new YT.Player('youtube_'+id, { - height: '390', - width: '640', - playerVars: { - enablejsapi:1, - color: 'white', - showinfo:0, - theme: 'light', - rel:0, - origin:'http://timeline.verite.co' - }, - videoId: id, - events: { - 'onReady': VMM.ExternalAPI.youtube.onPlayerReady, - 'onStateChange': VMM.ExternalAPI.youtube.onStateChange - } - }); - - VMM.master_config.youtube.array.push(p); - }, - - //VMM.ExternalAPI.youtube.stopPlayers(); - stopPlayers: function() { - for(var i = 0; i < VMM.master_config.youtube.array.length; i++) { - if (VMM.master_config.youtube.array[i].playing) { - var the_name = VMM.master_config.youtube.array[i].name; - VMM.master_config.youtube.array[i].player[the_name].stopVideo(); - } - } - }, - - onStateChange: function(e) { - for(var i = 0; i < VMM.master_config.youtube.array.length; i++) { - var the_name = VMM.master_config.youtube.array[i].name; - if (VMM.master_config.youtube.array[i].player[the_name] == e.target) { - if (e.data == YT.PlayerState.PLAYING) { - VMM.master_config.youtube.array[i].playing = true; - } - } - } - }, - - onPlayerReady: function(e) { - - } - - - } - } - - - /* MEDIA - ================================================== */ - // something = new VMM.Media(parent, w, h, {thedata}); - VMM.Media = function(parent, w, h, thedata) { - - /* PRIVATE VARS - ================================================== */ - var data = {}; // HOLDS DATA - - var _valid = false; - - var config = { - width: 720, - height: 400, - content_width: 720, - content_height: 400, - ease: "easeInOutExpo", - duration: 1000, - spacing: 15 - }; - /* ELEMENTS - ================================================== */ - var $media = ""; - var $container = ""; - var $mediacontainer = ""; - var $mediaelement = ""; - var layout = parent; // expecting media div - - if (w != null && w != "") {config.width = w}; - if (h != null && h != "") {config.height = h}; - /* - if (typeof thedata != "undefined") { - data = thedata; - this.init(data); - } - */ - /* PUBLIC FUNCTIONS - ================================================== */ - this.init = function(d) { - if(typeof d != 'undefined') { - this.setData(d); - } else { - trace("WAITING ON DATA"); - } - }; - - var build = function(media, caption, credit) { - - $media = VMM.appendAndGetElement(layout, "
", "media"); - $container = VMM.appendAndGetElement($media, "
", "container"); - $mediacontainer = VMM.appendAndGetElement($container, "
", "media-container"); - - - if (data.media != null && data.media != "") { - - _valid = true; - var m = {}; - - m = VMM.MediaType(data.media); //returns an object with .type and .id - - if (m.type == "image") { - VMM.appendElement($mediacontainer, ""); - } else if (m.type == "youtube") { - VMM.appendElement($mediacontainer, "":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init();VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1};VMM.FileExtention={googleDocType:function(a){var b=a,c="";c=b.substr(b.length-5,5);var d=["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"],e=!1;for(var f=0;f
";d.content=e;d.raw=a;b.push(d);if(b.length==c){var g={tweetdata:b};VMM.fireEvent(global,"TWEETSLOADED",g)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(a,b){var c=40;b!=null&&b!=""&&(c=b);var d="http://search.twitter.com/search.json?q="+a+"&rpp="+c+"&include_entities=true&result_type=mixed",e=[];VMM.getJSON(d,function(a){for(var b=0;b
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a){var a=a.toString(),b={twitterid:a},c="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?";trace("id "+a);var d=setTimeout(VMM.ExternalAPI.twitter.notFoundError,4e3,a);VMM.getJSON(c,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"

ERROR LOADING TWEET "+a+"

")}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"

TWEET NOT FOUND "+a+"

")},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);var b=a.id_str,c="

",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="

";c+=" "+""+" ";c+="";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{getMap:function(a,b){var c=VMM.Util.getUrlVars(a);trace(c);var d="http://maps.googleapis.com/maps/api/js?key="+Aes.Ctr.decrypt(VMM.master_config.keys.google,VMM.master_config.vp,256)+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",e={url:a,vars:c,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.createMap(e);else{VMM.master_config.googlemaps.que.push(e);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(d,function(){trace("Google Maps API Library Loaded")})}},onMapAPIReady:function(){VMM.master_config.googlemaps.map_active=!0;VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onPlacesAPIReady:function(){VMM.master_config.googlemaps.places_active=!0;VMM.ExternalAPI.googlemaps.onAPIReady()},onAPIReady:function(){if(!VMM.master_config.googlemaps.active&&VMM.master_config.googlemaps.map_active&&VMM.master_config.googlemaps.places_active){VMM.master_config.googlemaps.active=!0;for(var a=0;aStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:20,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}},createMap:function(a){function c(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}throw'No such provider: "'+a+'"'}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0});c.setMap(m);var d=new google.maps.InfoWindow;google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){h&&m.panTo(e);i?m.setZoom(g):m.fitBounds(c.getDefaultViewport())});google.maps.event.addListener(c,"click",function(a){function c(a){d.setContent(a);d.open(m)}var b=a.featureData.description;trace(a.featureData.infoWindowHtml);c(b)})}trace(VMM.ExternalAPI.googlemaps.stamen_map_attribution);var b="";google.maps.VeriteMapType=function(a){var b=c(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");var d;type.of(VMM.master_config.Timeline.maptype)=="string"?d=VMM.master_config.Timeline.maptype:d="toner";var e=new google.maps.LatLng(41.875696,-87.624207),f,g=11,h=!1,i=!1,j;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).ll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){h=!0;f=VMM.Util.getUrlVars(a.url).sll.split(",");e=new google.maps.LatLng(parseFloat(f[0]),parseFloat(f[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){i=!0;g=parseFloat(VMM.Util.getUrlVars(a.url).z)}var k={zoom:g,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:e,mapTypeId:d,mapTypeControlOptions:{mapTypeIds:[d]}},l=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"
");var m=new google.maps.Map(document.getElementById(l),k);m.mapTypes.set(d,new google.maps.VeriteMapType(d));var n="
"+b+"
";VMM.appendElement("#"+l,n);o()}},flickr:{getPhoto:function(a,b){var c="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+Aes.Ctr.decrypt(VMM.master_config.keys.flickr,VMM.master_config.vp,256)+"&photo_id="+a+"&format=json&jsoncallback=?";VMM.getJSON(c,VMM.ExternalAPI.flickr.setPhoto)},setPhoto:function(a){var b=a.sizes.size[0].url.split("photos/")[1].split("/")[1],c="flickr_"+b,d=c+"_large",e=c+"_thumb",f,g=!1;for(var h=0;h","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"":g="";else if(j.type=="youtube"){g="
Loading YouTube video...
";VMM.ExternalAPI.youtube.init(j.id)}else if(j.type=="vimeo")g="";else if(j.type=="twitter"){g="";trace("TWITTER");VMM.ExternalAPI.twitter.prettyHTML(j.id);l=!0}else if(j.type=="twitter-ready")g=j.id;else if(j.type=="soundcloud"){var n="soundcloud_"+VMM.Util.unique_ID(5);g="
Loading Sound
";VMM.ExternalAPI.soundcloud.getSound(j.id,n)}else if(j.type=="google-map"){var o="googlemap_"+VMM.Util.unique_ID(7);g="
Loading Map...
";VMM.ExternalAPI.googlemaps.getMap(j.id,o)}else if(j.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");g=VMM.Util.properQuotes(j.id)}else if(j.type=="website")g="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(j.type)}g="
"+g+i+h+"
";if(_return)return l?"
"+g+"
":"
"+g+"
";VMM.appendElement($mediacontainer,g);VMM.appendElement($mediacontainer,i);VMM.appendElement($mediacontainer,h)}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(a){var b=!1,c={};if(a.match("div class='twitter'")){c.type="twitter-ready";c.id=a;b=!0}else if(a.match("(www.)?youtube|youtu.be")){a.match("v=")?youtube_id=VMM.Util.getUrlVars(a).v:youtube_id=a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];c.type="youtube";c.id=youtube_id;b=!0}else if(a.match("(player.)?vimeo.com")){vimeo_id=a.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];c.type="vimeo";c.id=vimeo_id;b=!0}else if(a.match("(player.)?soundcloud.com")){c.type="soundcloud";c.id=a;b=!0}else if(a.match("(www.)?twitter.com")){trace("TWITTER MATCH");a.match("status/")?twitter_id=a.split("status/")[1]:a.match("statuses/")?twitter_id=a.split("statuses/")[1]:twitter_id="";c.type="twitter";c.id=twitter_id;b=!0}else if(a.match("maps.google")){c.type="google-map";c.id=a.split(/src=['|"][^'|"]*?['|"]/gi);b=!0}else if(a.match("flickr.com/photos")){c.type="flickr";c.id=a.split("photos/")[1].split("/")[1];c.link=a;b=!0}else if(a.match(/jpg|jpeg|png|gif/i)){c.type="image";c.id=a;b=!0}else if(VMM.FileExtention.googleDocType(a)){c.type="googledoc";c.id=a;b=!0}else if(a.indexOf("http://")==0){c.type="website";c.id=a;b=!0}else{trace("unknown media");c.type="unknown";c.id=a;b=!0}if(b)return c;trace("No valid media id detected");trace(a);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(a,b,c,d){function n(){}var e={},f=!1,g={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},h="",i="",j="",k="",l=a;b!=null&&b!=""&&(g.width=b);c!=null&&c!=""&&(g.height=c);this.init=function(a){typeof a!="undefined"?this.setData(a):trace("WAITING ON DATA")};var m=function(a,b,c){h=VMM.appendAndGetElement(l,"
","media");i=VMM.appendAndGetElement(h,"
","container");j=VMM.appendAndGetElement(i,"
","media-container");if(e.media!=null&&e.media!=""){f=!0;var d={};d=VMM.MediaType(e.media);d.type=="image"?VMM.appendElement(j,""):d.type=="youtube"?VMM.appendElement(j,"