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

32 lines
134 KiB

/*!
13 years ago
TimelineJS
Designed and built by Zach Wise at VéritéCo
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
http://www.gnu.org/licenses/
*//***********************************************
Begin VMM.js
***********************************************//* VéritéCo JS Master
Version: 0.6
Date: June 19, 2012
Copyright 2012 VéritéCo unless part of TimelineJS,
if part of TimelineJS then it inherits TimelineJS's license.
Designed and built by Zach Wise digitalartwork.net
================================================== *//* Simple JavaScript Inheritance
By John Resig http://ejohn.org/
MIT Licensed.
================================================== */function trace(e){VMM.debug&&(window.console?console.log(e):typeof jsTrace!="undefined"&&jsTrace.send(e))}function onYouTubePlayerAPIReady(){trace("GLOBAL YOUTUBE API CALLED");VMM.ExternalAPI.youtube.onAPIReady()}(function(){var e=!1,t=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(n){function o(){!e&&this.init&&this.init.apply(this,arguments)}var r=this.prototype;e=!0;var i=new this;e=!1;for(var s in n)i[s]=typeof n[s]=="function"&&typeof r[s]=="function"&&t.test(n[s])?function(e,t){return function(){var n=this._super;this._super=r[e];var i=t.apply(this,arguments);this._super=n;return i}}(s,n[s]):n[s];o.prototype=i;o.prototype.constructor=o;o.extend=arguments.callee;return o}})();var global=function(){return this||(1,eval)("this")}();if(typeof VMM=="undefined"){var VMM=Class.extend({});VMM.debug=!0;VMM.master_config={init:function(){return this},sizes:{api:{width:0,height:0}},vp:"Pellentesque nibh felis, eleifend id, commodo in, interdum vitae, leo",api_keys_master:{flickr:"RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==",google:"jwNGnYw4hE9lmAez4ll0QD+jo6SKBJFknkopLS4FrSAuGfIwyj57AusuR0s8dAo=",twitter:""},timers:{api:7e3},api:{pushques:[]},twitter:{active:!1,array:[],api_loaded:!1,que:[]},flickr:{active:!1,array:[],api_loaded:!1,que:[]},youtube:{active:!1,array:[],api_loaded:!1,que:[]},vimeo:{active:!1,array:[],api_loaded:!1,que:[]},googlemaps:{active:!1,map_active:!1,places_active:!1,array:[],api_loaded:!1,que:[]},googledocs:{active:!1,array:[],api_loaded:!1,que:[]},googleplus:{active:!1,array:[],api_loaded:!1,que:[]},wikipedia:{active:!1,array:[],api_loaded:!1,que:[],tries:0},soundcloud:{active:!1,array:[],api_loaded:!1,que:[]}}.init();VMM.createElement=function(e,t,n,r,i){var s="";if(e!=null&&e!=""){s+="<"+e;n!=null&&n!=""&&(s+=" class='"+n+"'");r!=null&&r!=""&&(s+=" "+r);i!=null&&i!=""&&(s+=" style='"+i+"'");s+=">";t!=null&&t!=""&&(s+=t);s=s+"</"+e+">"}return s};VMM.createMediaElement=function(e,t,n){var r="",i=!1;r+="<div class='media'>";if(e!=null&&e!=""){valid=!0;r+="<img src='"+e+"'>";n!=null&&n!=""&&(r+=VMM.createElement("div",n,"credit"));t!=null&&t!=""&&(r+=VMM.createElement("div",t,"caption"))}r+="</div>";return r};VMM.hideUrlBar=function(){var e=window,t=e.document;if(!location.hash||!e.addEventListener){window.scrollTo(0,1);var n=1,r=setInterval(function(){if(t.body){clearInterval(r);n="scrollTop"in t.body?t.body.scrollTop:1;e.scrollTo(0,n===1?0:1)}},15);e.addEventListener("load",function(){setTimeout(function(){e.scrollTo(0,n===1?0:1)},0)},!1)}}}Array.prototype.remove=function(e,t){var n=this.slice((t||e)+1||this.length);this.length=e<0?this.length+e:e;return this.push.apply(this,n)};Date.prototype.getWeek=function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil(((this-e)/864e5+e.getDay()+1)/7)};Date.prototype.getDayOfYear=function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil((this-e)/864e5)};var is={Null:function(e){return e===null},Undefined:function(e){return e===undefined},nt:function(e){return e===null||e===undefined},Function:function(e){return typeof e=="function"?e.constructor.toString().match(/Function/)!==null:!1},String:function(e){return typeof e=="string"?!0:typeof e=="object"?e.constructor.toString().match(/string/i)!==null:!1},Array:function(e){return typeof e=="object"?e.constructor.toString().match(/array/i)!==null||e.length!==undefined:!1},Boolean:function(e){return typeof e=="boolean"?!0:typeof e=="object"?e.constructor.toString().match(/boolean/i)!==null:!1},Date:function(e){return typeof e=="date"?!0:typeof e=="object"?e.constructor.toString().match(/date/i)!==null:!1},HTML:function(e){return typeof e=="object"?e.constructor.toString().match(/html/i)!==null:!1},Number:function(e){return typeof e=="number"?!0:typeof e=="object"?e.constructor.toString().match(/Number/)!==null:!1},Object:function(e){return typeof e=="object"?e.constructor.toString().match(/object/i)!==null:!1},RegExp:function(e){return typeof e=="function"?e.constructor.toString().match(/reg
.twitter.que.remove(0)}},getHTML:function(e){var t="http://api.twitter.com/1/statuses/oembed.json?id="+e+"&callback=?";VMM.getJSON(t,VMM.ExternalAPI.twitter.onJSONLoaded)},onJSONLoaded:function(e){trace("TWITTER JSON LOADED");var t=e.id;VMM.attachElement("#"+t,VMM.Util.linkify_with_twitter(e.html))},parseTwitterDate:function(e){var t=new Date(Date.parse(e));return t},prettyParseTwitterDate:function(e){var t=new Date(Date.parse(e));return VMM.Date.prettyDate(t,!0)},getTweets:function(e){var t=[],n=e.length;for(var r=0;r<e.length;r++){var i="";e[r].tweet.match("status/")?i=e[r].tweet.split("status/")[1]:e[r].tweet.match("statuses/")?i=e[r].tweet.split("statuses/")[1]:i="";var s="http://api.twitter.com/1/statuses/show.json?id="+i+"&include_entities=true&callback=?";VMM.getJSON(s,function(e){var r={},i="<div class='twitter'><blockquote><p>",s=VMM.Util.linkify_with_twitter(e.text,"_blank");i+=s;i+="</p>";i+="— "+e.user.name+" (<a href='https://twitter.com/"+e.user.screen_name+"'>@"+e.user.screen_name+"</a>) <a href='https://twitter.com/"+e.user.screen_name+"/status/"+e.id+"'>"+VMM.ExternalAPI.twitter.prettyParseTwitterDate(e.created_at)+" </a></blockquote></div>";r.content=i;r.raw=e;t.push(r);if(t.length==n){var o={tweetdata:t};VMM.fireEvent(global,"TWEETSLOADED",o)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(e,t){var n=40;t!=null&&t!=""&&(n=t);var r="http://search.twitter.com/search.json?q="+e+"&rpp="+n+"&include_entities=true&result_type=mixed",i=[];VMM.getJSON(r,function(e){for(var t=0;t<e.results.length;t++){var n={},r="<div class='twitter'><blockquote><p>",s=VMM.Util.linkify_with_twitter(e.results[t].text,"_blank");r+=s;r+="</p>";r+="— "+e.results[t].from_user_name+" (<a href='https://twitter.com/"+e.results[t].from_user+"'>@"+e.results[t].from_user+"</a>) <a href='https://twitter.com/"+e.results[t].from_user+"/status/"+e.id+"'>"+VMM.ExternalAPI.twitter.prettyParseTwitterDate(e.results[t].created_at)+" </a></blockquote></div>";n.content=r;n.raw=e.results[t];i.push(n)}var o={tweetdata:i};VMM.fireEvent(global,"TWEETSLOADED",o)})},prettyHTML:function(e,t){var e=e.toString(),n={twitterid:e},r="http://api.twitter.com/1/statuses/show.json?id="+e+"&include_entities=true&callback=?",i=setTimeout(VMM.ExternalAPI.twitter.errorTimeOut,VMM.master_config.timers.api,e);VMM.getJSON(r,VMM.ExternalAPI.twitter.formatJSON).error(function(t,n,r){trace("TWITTER error");trace("TWITTER ERROR: "+n+" "+t.responseText);VMM.attachElement("#twitter_"+e,"<p>ERROR LOADING TWEET "+e+"</p>")}).success(function(e){clearTimeout(i);t&&VMM.ExternalAPI.twitter.secondaryMedia(e)})},formatJSON:function(e){var t=e.id_str,n="<blockquote><p>",r=VMM.Util.linkify_with_twitter(e.text,"_blank");n+=r;n+="</p></blockquote>";n+="<div class='vcard author'>";n+="<a class='screen-name url' href='https://twitter.com/"+e.user.screen_name+"' data-screen-name='"+e.user.screen_name+"' target='_blank'>";n+="<span class='avatar'><img src=' "+e.user.profile_image_url+"' alt=''></span>";n+="<span class='fn'>"+e.user.name+"</span>";n+="<span class='nickname'>@"+e.user.screen_name+"<span class='thumbnail-inline'></span></span>";n+="</a>";n+="</div>";typeof e.entities.media!="undefined"&&e.entities.media[0].type=="photo"&&(n+="<img src=' "+e.entities.media[0].media_url+"' alt=''>");VMM.attachElement("#twitter_"+t.toString(),n);VMM.attachElement("#text_thumb_"+t.toString(),e.text)}},googlemaps:{get:function(e,t){var n,r,i;i=VMM.Util.getUrlVars(e);VMM.master_config.Timeline.api_keys.google!=""?r=VMM.master_config.Timeline.api_keys.google:r=Aes.Ctr.decrypt(VMM.master_config.api_keys_master.google,VMM.master_config.vp,256);var s="http://maps.googleapis.com/maps/api/js?key="+r+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",o={url:e,vars:i,id:t};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.que.push(o);else{VMM.master_config.googlemaps.que.push(o);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(s,function(){trace("G
VMM!="undefined"&&typeof VMM.DragSlider=="undefined"&&(VMM.DragSlider={createPanel:function(e,t,n,r,i){var s=r;VMM.DragSlider.width=n;VMM.DragSlider.makeDraggable(e,t);VMM.DragSlider.drag_elem=e;VMM.DragSlider.sticky=i},makeDraggable:function(e,t){VMM.bindEvent(e,VMM.DragSlider.onDragStart,"mousedown",{element:t,delement:e});VMM.bindEvent(e,VMM.DragSlider.onDragEnd,"mouseup",{element:t,delement:e});VMM.bindEvent(e,VMM.DragSlider.onDragLeave,"mouseleave",{element:t,delement:e})},cancelSlide:function(e){VMM.unbindEvent(VMM.DragSlider.drag_elem,VMM.DragSlider.onDragMove,"mousemove");return!0},onDragLeave:function(e){VMM.unbindEvent(e.data.delement,VMM.DragSlider.onDragMove,"mousemove");e.preventDefault();e.stopPropagation();return!0},onDragStart:function(e){VMM.DragSlider.dragStart(e.data.element,e.data.delement,e);e.preventDefault();e.stopPropagation();return!0},onDragEnd:function(e){e.preventDefault();e.stopPropagation();if(VMM.DragSlider.sliding){VMM.DragSlider.sliding=!1;VMM.DragSlider.dragEnd(e.data.element,e.data.delement,e);return!1}return!0},onDragMove:function(e){VMM.DragSlider.dragMove(e.data.element,e);e.preventDefault();e.stopPropagation();return!1},dragStart:function(e,t,n){VMM.DragSlider.startX=n.pageX;VMM.DragSlider.startLeft=VMM.DragSlider.getLeft(e);VMM.DragSlider.dragStartTime=(new Date).getTime();VMM.DragSlider.dragWidth=VMM.Lib.width(t);var r=Math.round(VMM.DragSlider.startX-n.pageX-VMM.DragSlider.startLeft);VMM.Lib.stop(e);VMM.bindEvent(t,VMM.DragSlider.onDragMove,"mousemove",{element:e})},dragEnd:function(e,t,n){VMM.unbindEvent(t,VMM.DragSlider.onDragMove,"mousemove");VMM.DragSlider.getLeft(e)>0||VMM.DragSlider.dragMomentum(e,n)},dragMove:function(e,t){!VMM.DragSlider.sliding;VMM.DragSlider.sliding=!0;if(VMM.DragSlider.startX>t.pageX){VMM.Lib.css(e,"left",-(VMM.DragSlider.startX-t.pageX-VMM.DragSlider.startLeft));VMM.DragSlider.slidingLeft=!0}else{var n=t.pageX-VMM.DragSlider.startX+VMM.DragSlider.startLeft;VMM.Lib.css(e,"left",-(VMM.DragSlider.startX-t.pageX-VMM.DragSlider.startLeft));VMM.DragSlider.slidingLeft=!1}},dragMomentum:function(e,t){var n=((new Date).getTime()-VMM.DragSlider.dragStartTime)*10,r=n,i=VMM.DragSlider.getLeft(e),s=6e3*(Math.abs(VMM.DragSlider.startLeft)-Math.abs(i));n=Math.round(s/n);var o=i+n,u=o%VMM.DragSlider.width,a={left:Math.min(o),time:r};VMM.fireEvent(e,"DRAGUPDATE",[a]);var f="easeOutExpo";a.time>0&&VMM.Lib.animate(e,a.time,f,{left:a.left})},getLeft:function(e){return parseInt(VMM.Lib.css(e,"left").substring(0,VMM.Lib.css(e,"left").length-2),10)}});typeof VMM!="undefined"&&typeof VMM.Slider=="undefined"&&(VMM.Slider=function(e,t){function w(){trace("onConfigSet")}function E(e,t){var n=!0,i=!1;e!=null&&(n=e);t!=null&&(i=t);p=r.slider.width;r.slider.nav.height=VMM.Lib.height(y.prevBtnContainer);r.slider.content.width=p-r.slider.content.padding*2;VMM.Lib.width(u,f.length*r.slider.content.width);if(i){var a=f[h].leftpos();VMM.Lib.css(o,"left",a)}_();D();VMM.Lib.css(y.nextBtn,"left",p-r.slider.nav.width);VMM.Lib.height(y.prevBtn,r.slider.height);VMM.Lib.height(y.nextBtn,r.slider.height);VMM.Lib.css(y.nextBtnContainer,"top",r.slider.height/2-r.slider.nav.height/2+10);VMM.Lib.css(y.prevBtnContainer,"top",r.slider.height/2-r.slider.nav.height/2+10);VMM.Lib.height(s,r.slider.height);VMM.Lib.width(s,p);n&&H(h,"linear",1);h==0&&VMM.Lib.visible(y.prevBtn,!1)}function S(e){if(h==f.length-1)VMM.Lib.animate(o,r.duration,r.ease,{left:-f[h].leftpos()});else{H(h+1);C()}}function x(e){if(h==0)H(h);else{H(h-1);C()}}function T(e){switch(e.keyCode){case 39:S(e);break;case 37:x(e)}}function N(e,t){if(l.length==0)for(var n=0;n<f.length;n++)l.push(f[n].leftpos());if(typeof t.left=="number"){var i=t.left,s=-f[h].leftpos();i<s-r.slider_width/3?S():i>s+r.slider_width/3?x():VMM.Lib.animate(o,r.duration,r.ease,{left:s})}else VMM.Lib.animate(o,r.duration,r.ease,{left:s});typeof t.top=="number"&&VMM.Lib.animate(o,r.duration,r.ease,{top:-t.top})}function C(){r.current_slide=h;VMM.fireEvent(g,"UPDATE")}var n={},r,i,s,o,u,a=[],f=[],l=[],c="",h=0,p=960,d={move:!1,x:10,y:0,off:0,dampen:48},v="",m=!1,g=e,y=
:130},nav:{width:100,height:200}},ease:"easeInOutExpo",duration:1e3,language:VMM.Language};if(e!=null&&e!=""){p.width=e;d=!0}if(t!=null&&t!=""){p.height=t;v=!0}if(window.location.hash){var y=window.location.hash.substring(1);isNaN(y)||(p.current_slide=parseInt(y))}window.onhashchange=function(){if(p.hash_bookmark)if(g){var e=window.location.hash.substring(1);A(parseInt(e))}else g=!1};var b=function(e){if(typeof timeline_config=="object"){trace("HAS TIMELINE CONFIG");var t;for(t in timeline_config)Object.prototype.hasOwnProperty.call(timeline_config,t)&&(p[t]=timeline_config[t])}else if(typeof e=="object"){var t;for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(p[t]=e[t])}p.nav.width=p.width;p.nav.height=200;p.feature.width=p.width;p.feature.height=p.height-p.nav.height;VMM.Timeline.Config=p;VMM.master_config.Timeline=VMM.Timeline.Config;this.events=p.events},w=function(e,t){i=VMM.getElement(f);VMM.Lib.addClass(f,"vmm-timeline");s=VMM.appendAndGetElement(i,"<div>","feedback","");o=new VMM.Slider(f+" div.slider",p);u=new VMM.Timeline.TimeNav(f+" div.navigation");d?VMM.Lib.width(i,p.width):p.width=VMM.Lib.width(i);v?VMM.Lib.height(i,p.height):p.height=VMM.Lib.height(i)},A=function(e){if(e<=h.length-1&&e>=0){p.current_slide=e;o.setSlide(p.current_slide);u.setMarker(p.current_slide,p.ease,p.duration)}};this.init=function(n,r,o){type.of(r)=="string"&&(r.match("#")?f=r:f="#"+r);b(o);w(e,t);trace("TIMELINE INIT");VMM.Date.setLanguage(VMM.Timeline.Config.language);VMM.master_config.language=VMM.Timeline.Config.language;s=VMM.appendAndGetElement(i,"<div>","feedback","");VMM.bindEvent(global,E,p.events.data_ready);VMM.bindEvent(global,_,p.events.messege);VMM.fireEvent(global,p.events.messege,VMM.master_config.language.messages.loading_timeline);(VMM.Browser.browser=="Explorer"||VMM.Browser.browser=="MSIE")&&parseInt(VMM.Browser.version,10)<=7&&(m=!0);if(m){m=!0;VMM.fireEvent(global,p.events.messege,"Internet Explorer "+VMM.Browser.version+" is not supported by TimelineJS. Please update your browser to version 8 or higher.")}else type.of(n)=="string"||type.of(n)=="object"?VMM.Timeline.DataObj.getData(n):VMM.Timeline.DataObj.getData(VMM.getElement(f))};this.iframeLoaded=function(){trace("iframeLoaded")};this.reload=function(e){trace("loadNewDates"+e);VMM.fireEvent(global,p.events.messege,VMM.master_config.language.messages.loading_timeline);c={};VMM.Timeline.DataObj.getData(e)};var M=function(e){VMM.getJSON(e,function(e){c=VMM.Timeline.DataObj.getData(e);VMM.fireEvent(global,p.events.data_ready)})},_=function(e,t){trace("showMessege "+t);VMM.attachElement(s,VMM.MediaElement.loadingmessage(t))},D=function(){VMM.Lib.animate(s,p.duration,p.ease*4,{opacity:0},P)},P=function(){VMM.Lib.detach(s)},H=function(){p.start_at_end&&p.current_slide==0&&(p.current_slide=h.length-1);VMM.attachElement(i,"");VMM.appendElement(i,"<div class='container main'><div class='feature'><div class='slider'></div></div><div class='navigation'></div></div>");x();VMM.bindEvent("div.slider",T,"LOADED");VMM.bindEvent("div.navigation",C,"LOADED");VMM.bindEvent("div.slider",k,"UPDATE");VMM.bindEvent("div.navigation",L,"UPDATE");o.init(h);u.init(h,c.era);VMM.bindEvent(global,x,p.events.resize)},B=function(){trace("UPDATE SIZE");p.width=VMM.Lib.width(i);p.height=VMM.Lib.height(i);p.nav.width=p.width;p.feature.width=p.width;VMM.Browser.device=="mobile";p.feature.height=p.height-p.nav.height-3},j=function(){h=[];VMM.fireEvent(global,p.events.messege,"Building Dates");B();for(var e=0;e<c.date.length;e++)if(c.date[e].startDate!=null&&c.date[e].startDate!=""){var t={};c.date[e].type=="tweets"?t.startdate=VMM.ExternalAPI.twitter.parseTwitterDate(c.date[e].startDate):t.startdate=VMM.Date.parse(c.date[e].startDate);if(!isNaN(t.startdate)){c.date[e].endDate!=null&&c.date[e].endDate!=""?c.date[e].type=="tweets"?t.enddate=VMM.ExternalAPI.twitter.parseTwitterDate(c.date[e].endDate):t.enddate=VMM.Date.parse(c.date[e].endDate):t.enddate=t.startdate;t.needs_slug=!1;c.date[e].headline==""&&c.date[e].slug!=null&&c.date[e].slug!=""&&(t.needs_slug=!0);t.title=c.date[e].headline;t.he
e.content.title;trace(e);var n="",r=e.content.author.username,i="";if(typeof e.content.author.name!="undefined"){r=e.content.author.name;i=e.content.author.username+"&nbsp;"}typeof e.content.description!="undefined"&&e.content.description!=null&&(n+=e.content.description);n+="<div class='storify'>";n+="<div class='vcard author'><a class='screen-name url' href='"+e.content.author.permalink+"' target='_blank'>";n+="<span class='avatar'><img src='"+e.content.author.avatar+"' style='max-width: 32px; max-height: 32px;'></span>";n+="<span class='fn'>"+r+"</span>";n+="<span class='nickname'>"+i+"<span class='thumbnail-inline'></span></span>";n+="</a>";n+="</div>";n+="</div>";t.timeline.text=n;t.timeline.asset.media=e.content.thumbnail;t.timeline.type="storify";for(var s=0;s<e.content.elements.length;s++){var o=e.content.elements[s],u=!1,a=new Date(o.posted_at);trace(o.type);var f={type:"storify",startDate:o.posted_at,endDate:o.posted_at,headline:" ",slug:"",text:"",asset:{media:"",credit:"",caption:""}};if(o.type=="image"){if(typeof o.source.name!="undefined")if(o.source.name=="flickr"){f.asset.media="http://flickr.com/photos/"+o.meta.pathalias+"/"+o.meta.id+"/";f.asset.credit="<a href='"+f.asset.media+"'>"+o.attribution.name+"</a>";f.asset.credit+=" on <a href='"+o.source.href+"'>"+o.source.name+"</a>"}else if(o.source.name=="instagram"){f.asset.media=o.permalink;f.asset.credit="<a href='"+o.permalink+"'>"+o.attribution.name+"</a>";f.asset.credit+=" on <a href='"+o.source.href+"'>"+o.source.name+"</a>"}else{f.asset.credit="<a href='"+o.permalink+"'>"+o.attribution.name+"</a>";typeof o.source.href!="undefined"&&(f.asset.credit+=" on <a href='"+o.source.href+"'>"+o.source.name+"</a>");f.asset.media=o.data.image.src}else{f.asset.credit="<a href='"+o.permalink+"'>"+o.attribution.name+"</a>";f.asset.media=o.data.image.src}f.slug=o.attribution.name;if(typeof o.data.image.caption!="undefined"&&o.data.image.caption!="undefined"){f.asset.caption=o.data.image.caption;f.slug=o.data.image.caption}}else if(o.type=="quote"){if(o.permalink.match("twitter")){f.asset.media=o.permalink;f.slug=VMM.Util.untagify(o.data.quote.text)}else if(o.permalink.match("storify")){u=!0;f.asset.media="<blockquote>"+o.data.quote.text.replace(/<\s*\/?\s*b\s*.*?>/g,"")+"</blockquote>"}}else if(o.type=="link"){f.headline=o.data.link.title;f.text=o.data.link.description;o.data.link.thumbnail!="undefined"&&o.data.link.thumbnail!=""?f.asset.media=o.data.link.thumbnail:f.asset.media=o.permalink;f.asset.caption="<a href='"+o.permalink+"' target='_blank'>"+o.data.link.title+"</a>";f.slug=o.data.link.title}else if(o.type=="text"){if(o.permalink.match("storify")){u=!0;var l=e.content.author.username,c="";if(typeof o.attribution.name!="undefined"){r=o.attribution.name;i=o.attribution.username+"&nbsp;"}var h="<div class='storify'>";h+="<blockquote><p>"+o.data.text.replace(/<\s*\/?\s*b\s*.*?>/g,"")+"</p></blockquote>";h+="<div class='vcard author'><a class='screen-name url' href='"+o.attribution.href+"' target='_blank'>";h+="<span class='avatar'><img src='"+o.attribution.thumbnail+"' style='max-width: 32px; max-height: 32px;'></span>";h+="<span class='fn'>"+r+"</span>";h+="<span class='nickname'>"+i+"<span class='thumbnail-inline'></span></span>";h+="</a></div></div>";f.text=h;if(s+1>=e.content.elements.length)f.startDate=e.content.elements[s-1].posted_at;else if(e.content.elements[s+1].type=="text"&&e.content.elements[s+1].permalink.match("storify"))if(s+2>=e.content.elements.length)f.startDate=e.content.elements[s-1].posted_at;else if(e.content.elements[s+2].type=="text"&&e.content.elements[s+2].permalink.match("storify"))if(s+3>=e.content.elements.length)f.startDate=e.content.elements[s-1].posted_at;else if(e.content.elements[s+3].type=="text"&&e.content.elements[s+3].permalink.match("storify"))f.startDate=e.content.elements[s-1].posted_at;else{trace("LEVEL 3");f.startDate=e.content.elements[s+3].posted_at}else{trace("LEVEL 2");f.startDate=e.content.elements[s+2].posted_at}else{trace("LEVEL 1");f.startDate=e.content.elements[s+1].posted_at}f.endDate=f.startDate}}else if(