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
135 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.create(VMM.master_config.twitter.que[0],VMM.ExternalAPI.twitter.pushQue);VMM.master_config.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.g
.touches[0].screenX-VMM.TouchSlider.startLeft));VMM.TouchSlider.slidingLeft=!1}}});typeof VMM!="undefined"&&typeof VMM.DragSlider=="undefined"&&(VMM.DragSlider=function(){var e={element:"",element_move:"",constraint:"",sliding:!1,pagex:{start:0,end:0},left:{start:0,end:0},time:{start:0,end:0},touch:!1,ease:"easeOutExpo"},t={down:"mousedown",up:"mouseup",leave:"mouseleave",move:"mousemove"},n={down:"mousedown",up:"mouseup",leave:"mouseleave",move:"mousemove"},r={down:"touchstart",up:"touchend",leave:"mouseleave",move:"touchmove"};this.createPanel=function(s,o,u,a){e.element=s;e.element_move=o;u!=null&&u!=""?e.constraint=u:e.constraint=!1;a?e.touch=a:e.touch=!1;trace("TOUCH"+e.touch);e.touch?t=r:t=n;i(e.element,e.element_move)};this.updateConstraint=function(t){trace("updateConstraint");e.constraint=t};var i=function(e,n){VMM.bindEvent(e,o,t.down,{element:n,delement:e});VMM.bindEvent(e,u,t.up,{element:n,delement:e});VMM.bindEvent(e,s,t.leave,{element:n,delement:e})};this.cancelSlide=function(n){VMM.unbindEvent(e.element,a,t.move);return!0};var s=function(n){VMM.unbindEvent(n.data.delement,a,t.move);e.touch||n.preventDefault();n.stopPropagation();if(e.sliding){e.sliding=!1;l(n.data.element,n.data.delement,n);return!1}return!0},o=function(t){f(t.data.element,t.data.delement,t);e.touch||t.preventDefault();t.stopPropagation();return!0},u=function(t){e.touch||t.preventDefault();t.stopPropagation();if(e.sliding){e.sliding=!1;l(t.data.element,t.data.delement,t);return!1}return!0},a=function(e){c(e.data.element,e);e.preventDefault();e.stopPropagation();return!1},f=function(n,r,i){if(e.touch){trace("IS TOUCH");VMM.Lib.css(n,"-webkit-transition-duration","0");e.pagex.start=i.originalEvent.touches[0].screenX}else e.pagex.start=i.pageX;e.left.start=p(n);e.time.start=(new Date).getTime();VMM.Lib.stop(n);VMM.bindEvent(r,a,t.move,{element:n})},l=function(e,n,r){VMM.unbindEvent(n,a,t.move);h(e,r)},c=function(t,n){e.sliding=!0;e.touch?e.pagex.end=n.originalEvent.touches[0].screenX:e.pagex.end=n.pageX;e.left.end=p(t);VMM.Lib.css(t,"left",-(e.pagex.start-e.pagex.end-e.left.start))},h=function(t,n){var r={left:e.left.end,left_adjust:0,change:{x:0},time:((new Date).getTime()-e.time.start)*10,time_adjust:((new Date).getTime()-e.time.start)*10};r.change.x=3e3*(Math.abs(e.pagex.end)-Math.abs(e.pagex.start));r.left_adjust=Math.round(r.change.x/r.time);r.left=Math.min(r.left+r.left_adjust);if(e.constraint)if(r.left>e.constraint.left){r.left=e.constraint.left;r.time>5e3&&(r.time=5e3)}else if(r.left<e.constraint.right){r.left=e.constraint.right;r.time>5e3&&(r.time=5e3)}VMM.fireEvent(t,"DRAGUPDATE",[r]);r.time>0&&(e.touch?VMM.Lib.animate(t,r.time,"easeOutCirc",{left:r.left}):VMM.Lib.animate(t,r.time,e.ease,{left:r.left}))},p=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,
maptype:"toner",preload:4,current_slide:0,hash_bookmark:!1,start_at_end:!1,start_at_slide:0,start_zoom_adjust:0,start_page:!1,api_keys:{google:"",flickr:"",twitter:""},interval:10,something:0,width:960,height:540,spacing:15,loaded:{slider:!1,timenav:!1,percentloaded:0},nav:{start_page:!1,interval_width:200,density:4,minor_width:0,minor_left:0,constraint:{left:0,right:0,right_min:0,right_max:0},zoom:{adjust:0},multiplier:{current:6,min:.1,max:50},rows:[1,1,1],width:960,height:200,marker:{width:150,height:50}},feature:{width:960,height:540},slider:{width:720,height:400,content:{width:720,height:400,padding: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(){var e=window.location.hash.substring(1);p.hash_bookmark?g?A(parseInt(e)):g=!1:A(parseInt(e))};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])}if(VMM.Browser.device=="mobile"||VMM.Browser.device=="tablet")p.touch=!0;p.nav.width=p.width;p.nav.height=200;p.feature.width=p.width;p.feature.height=p.height-p.nav.height;p.nav.zoom.adjust=parseInt(p.start_zoom_adjust,10);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);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(){parseInt(p.start_at_slide)>0&&p.current_slide==0&&(p.current_slide=parseInt(p.start_at_slide));p.start_at_end&&p.current_slide==0&&(p.current_slide=h.length-1);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{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("IE7 or lower");for(var e=0;e<h.
,startDate:r.gsx$startdate.$t,endDate:r.gsx$enddate.$t,headline:r.gsx$headline.$t,text:r.gsx$text.$t,asset:{media:r.gsx$media.$t,credit:r.gsx$mediacredit.$t,caption:r.gsx$mediacaption.$t},tag:""};typeof r.gsx$tag!="undefined"&&(o.tag=r.gsx$tag.$t);t.timeline.date.push(o)}}VMM.fireEvent(global,VMM.Timeline.Config.events.data_ready,t)}},storify:{getData:function(e){VMM.fireEvent(global,VMM.Timeline.Config.events.messege,"Loading Storify...");var t=e.split("storify.com/")[1],n="http://api.storify.com/v1/stories/"+t+"?per_page=300&callback=?",r=setTimeout(function(){trace("STORIFY timeout");VMM.fireEvent(global,VMM.Timeline.Config.events.messege,"Storify is not responding")},6e3);VMM.getJSON(n,VMM.Timeline.DataObj.model.storify.buildData).error(function(e,t,n){trace("STORIFY error");trace("STORIFY ERROR: "+t+" "+e.responseText)}).success(function(e){clearTimeout(r)})},buildData:function(e){VMM.fireEvent(global,VMM.Timeline.Config.events.messege,"Parsing Data");var t=VMM.Timeline.DataObj.data_template_obj;t.timeline.startDate=new Date(e.content.date.created);t.timeline.headline=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+"' t