1/* 2 * DC jQuery Social Stream 3 * Copyright (c) 2013 Design Chemical 4 * http://www.designchemical.com/blog/index.php/premium-jquery-plugins/jquery-social-stream-plugin/ 5 * Version 1.6.2 (10-07-2017) 6 * 7 */ 8 9(function($){SocialStreamObject=function(el,options){this.create(el,options);};$.extend(SocialStreamObject.prototype,{version:'1.6.2',create:function(el,options){this.defaults={feeds:{facebook:{id:'',intro:'Posted',out:'intro,thumb,title,text,user,share',text:'content',comments:3,image_width:4,url:'facebook.php',feed:'feed',icon:'facebook.png'},twitter:{id:'',intro:'Tweeted',search:'Tweeted',out:'intro,thumb,text,share',retweets:false,replies:false,images:'',url:'twitter.php',icon:'twitter.png'},google:{id:'',intro:'Shared',out:'intro,thumb,title,text,share',api_key:'AIzaSyAWNgUpUj_W26tP3yev5Ysr4Zb53OIPgR4',image_height:300,image_width:300,shares:true,icon:'google.png'},youtube:{id:'',intro:'Uploaded',search:'Search',out:'intro,thumb,title,text,user,share',text:0,api_key:'AIzaSyB1zptnRspzltRVLGQJMBCH2yYujYp7ytI',thumb:'medium',icon:'youtube.png'},flickr:{id:'',intro:'Uploaded',out:'intro,thumb,title,text,share',lang:'en-us',icon:'flickr.png'},delicious:{id:'',intro:'Bookmarked',out:'intro,thumb,title,text,user,share',icon:'delicious.png'},pinterest:{id:'',intro:'Pinned',out:'intro,thumb,text,user,share',url:'rss.php',icon:'pinterest.png'},rss:{id:'',intro:'Posted',out:'intro,thumb,title,text,user,share',url:'rss.php',text:'contentSnippet',icon:'rss.png'},lastfm:{id:'',intro:'Listened to,Loved,Replied',out:'intro,thumb,title,text,user,share',feed:'recenttracks,lovedtracks,replytracker',icon:'lastfm.png'},dribbble:{id:'',intro:'Posted,Liked',out:'intro,thumb,title,text,user,share',accessToken:'55cab8e9db75df986449fe486fdd46501e4c8d985b7ba6b9a0bfc2d229bc88b3',feed:'shots,likes',icon:'dribbble.png'},vimeo:{id:'',intro:'Liked,Video,Appeared In,Video,Album,Channel,Group',out:'intro,thumb,title,text,user,share',feed:'likes,videos,appears_in,all_videos,albums,channels,groups',thumb:'large',stats:true,icon:'vimeo.png'},stumbleupon:{id:'',intro:'Shared,Reviewed',out:'intro,thumb,title,text,user,share',feed:'favorites,reviews',icon:'stumbleupon.png'},deviantart:{id:'',intro:'Deviation',out:'intro,thumb,title,text,user,share',icon:'deviantart.png'},tumblr:{id:'',intro:'Posted',out:'intro,title,text,user,share',thumb:100,video:250,icon:'tumblr.png'},instagram:{id:'',intro:'Posted',search:'Search',out:'intro,thumb,text,user,share,meta',accessToken:'',redirectUrl:'',clientId:'',thumb:'low_resolution',icon:'instagram.png'}},remove:'',twitterId:'',days:5,limit:10,max:'days',external:true,speed:600,height:550,wall:false,centre:false,order:'date',filter:true,controls:true,rotate:{direction:'up',delay:8000},style:{layout:'classic',colour:'light'},dates:'min,mins,hr,hrs,day,days,week,weeks,month,months,year,years',transition:'0.8s',cache:true,container:'dcsns',cstream:'stream',content:'dcsns-content',iconPath:'images/dcsns-dark/',imagePath:'images/dcsns-dark/',debug:false};this.o={},this.timer_on=0,this.id='dcsns-'+$(el).index(),this.timerId='',this.o=$.extend(true,this.defaults,options),opt=this.o,$load=$('<div class="dcsns-loading">creating stream ...</div>');$(el).addClass(this.o.container).addClass(this.o.style.layout).addClass(this.o.style.colour).append('<div class="'+this.o.content+'"><ul class="'+this.o.cstream+'"></ul></div>');var $c=$('.'+this.o.content,el),$a=$('.'+this.o.cstream,el),$l=$('li',$a);if(opt.height>0&&opt.wall==false){$c.css({height:opt.height+'px'});} 10if(this.o.filter==true||this.o.controls==true){var x='<div class="dcsns-toolbar">';if(this.o.filter==true){var fclass=this.o.center==true?'option-set filter dc-center':'option-set filter';x+='<ul id="dcsns-filter" class="'+fclass+' '+this.o.style.layout+' '+this.o.style.colour+'">';x+=this.o.wall==true?'<li><a href="#filter" data-group="dc-filter" data-filter="*" class="selected link-all"><span>Alle</span></li>':'';var $f=$('.filter',el);$.each(opt.feeds,function(k,v){x+=v.id!=''?'<li class="active f-'+k+'"><a href="#filter" rel="'+k+'" data-group="dc-filter" data-filter=".dcsns-'+k+'"><span class="socicon socicon-'+k+'"></span></a></li>':'';});x+='</ul>';} 11if(this.o.controls==true&&opt.wall==false){var play=this.o.rotate.delay<=0?'':'<li><a href="#" class="play"></a></li>';x+='<div class="controls"><ul>'+play+'<li><a href="#" class="prev"></a></li><li><a href="#" class="next"></a></li></ul></div>';} 12x+='</div>';if(opt.wall==false){$(el).append(x);}else{$(el).before(x);}} 13if(this.o.wall==true){$('.dcsns-toolbar').append($load);var w=$("#dcsns-filter.dc-center").width()/2;$("#dcsns-filter.dc-center").css({'margin-left':-w+"px"}).fadeIn();this.createwall($a);}else{$c.append($load);} 14this.createstream(el,$a,0,opt.days);this.addevents(el,$a);if(this.o.rotate.delay>0){this.rotate(el);} 15$load.remove();},createstream:function(obj,s,f1,f2){$.each(opt.feeds,function(k,v){if(opt.feeds[k].id!=''){var txt=[];$.each(opt.feeds[k].intro.split(','),function(i,v){v=$.trim(v);txt.push(v);});$.each(opt.feeds[k].id.split(','),function(i,v){v=$.trim(v);if(opt.feeds[k].feed&&v.split('#').length<2){if(k=='youtube'&&v.split('/').length>1){getFeed(k,v,opt.iconPath,opt.feeds[k],obj,opt,f1,f2,'posted','',i);}else{$.each(opt.feeds[k].feed.split(','),function(i,feed){getFeed(k,v,opt.iconPath,opt.feeds[k],obj,opt,f1,f2,txt[i],feed,i);});}}else{intro=v.split('#').length<2?opt.feeds[k].intro:opt.feeds[k].search;getFeed(k,v,opt.iconPath,opt.feeds[k],obj,opt,f1,f2,intro,'',i);}});}});},createwall:function(obj){obj.isotope({itemSelector:'li.dcsns-li',transitionDuration:opt.transition,getSortData:{postDate:function(itemElem){return parseInt($(itemElem).attr('rel'),10);}},sortBy:'postDate',masonry:{isFitWidth:opt.center}});},addevents:function(obj,$a){var self=this,speed=this.o.speed;var $container=$('.stream',obj),filters={} 16$('.controls',obj).delegate('a','click',function(){var x=$(this).attr('class');switch(x) 17{case'prev':self.pauseTimer();ticker($a,'prev',speed);break;case'next':self.pauseTimer();ticker($a,'next',speed);break;case'play':self.rotate(obj);$('.controls .play').removeClass('play').addClass('pause');break;case'pause':self.pauseTimer();break;} 18return false;});$('.filter',obj).delegate('a','click',function(){if(opt.wall==false){var rel=$(this).attr('rel');
18if($(this).parent().hasClass('active')){$('.dcsns-'+rel,$a).slideUp().addClass('inactive');$(this).parent().animate({opacity:0.3},400);}else{$('.dcsns-'+rel,$a).slideDown().removeClass('inactive');$(this).parent().animate({opacity:1},400);} 19$(this).parent().toggleClass('active');} 20return false;});if(this.o.external){$a.delegate('a','click',function(){if(!$(this).parent().hasClass('section-share')){this.target='_blank';}});}},rotate:function(a){var self=this,stream=$('.'+this.o.cstream,a),speed=this.o.speed,delay=this.o.rotate.delay,r=this.o.rotate.direction=='up'?'prev':'next';this.timer_on=1;$('.controls .play').removeClass('play').addClass('pause');this.timerId=setTimeout(function(){ticker(stream,r,speed);self.rotate(a);},delay);},pauseTimer:function(){clearTimeout(this.timerId);this.timer_on=0;$('.controls .pause').removeClass('pause').addClass('play');}});$.fn.dcSocialStream=function(options,callback){var d={};this.each(function(){var s=$(this);d=s.data("socialtabs");if(!d){d=new SocialStreamObject(this,options,callback);s.data("socialtabs",d);}});return d;};function getFeed(type,id,path,o,obj,opt,f1,f2,intro,feed,fn){var stream=$('.stream',obj),list=[],d='',px=300,c=[],data,href,url,n=opt.limit,txt=[],src;frl='https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num='+n+'&callback=?&q=';switch(type){case'facebook':var cp=id.split('/');var curl=o.url.replace(/\&/gi,"&");url=url=cp.length>1?curl+'?id='+cp[1]+'&limit='+n+'&feed=photos':curl+'?id='+id+'&limit='+n+'&feed='+o.feed;break;case'twitter':var curl=o.url.replace(/\&/gi,"&");var cp=id.split('/'),cq=id.split('#'),cu=o.url.split('?'),replies=o.replies==true?'&exclude_replies=false':'&exclude_replies=true';var param='&include_entities=true&include_rts='+o.retweets+replies;url1=cu.length>1?curl+'&':curl+'?';url=cp.length>1?url1+'url=list&list_id='+cp[1]+'&per_page='+n+param:url1+'url=timeline&screen_name='+id+'&count='+n+param;if(cq.length>1){var rts=o.retweets==false?'+exclude:retweets':'';url=url1+'url=search&q='+cq[1]+'&count='+n;} 21break;case'google':n=n>100?100:n;href='https://plus.google.com/'+id;url='https://www.googleapis.com/plus/v1/people/'+id+'/activities/public';data={key:o.api_key,maxResults:n,prettyprint:false,fields:"items(id,kind,object(attachments(displayName,fullImage,id,image,objectType,url),id,objectType,plusoners,replies,resharers,url),published,title,url,verb)"};break;case'youtube':n=n>50?50:n;var cp=id.split('/'),cq=decodeURIComponent(id).split('#'),cc=id.split('!');if(cq.length>1){url='https://www.googleapis.com/youtube/v3/search?part=snippet&key='+o.api_key+'&pageToken=&order=date&maxResults='+n+'&q='+cq[1];href='https://www.youtube.com/results?search_query='+cq[1];}else{if(cc.length>1){id=cc[1];id='UU'+cc[1].substring(2);href='https://www.youtube.com/channel/UC'+id.substring(2);}else{id=cp.length>1?cp[1]:id;if(id.substr(0,2)!='UU'){if(id.substr(0,2)!='UC'){href='https://www.youtube.com/playlist?list='+id;}else{href='https://www.youtube.com/channel/'+id;id='UU'+id.substring(2);}}else{href='https://www.youtube.com/channel/UC'+id.substring(2);}} 22url='https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId='+id+'&key='+o.api_key+'&pageToken=&maxResults='+n;} 23break;case'flickr':var cq=id.split('/'),fd=cq.length>1?'groups_pool':'photos_public';id=cq.length>1?cq[1]:id;href='https://www.flickr.com/photos/'+id;url='https://api.flickr.com/services/feeds/'+fd+'.gne?id='+id+'&lang='+o.lang+'&format=json&jsoncallback=?';break;case'delicious':href='https://www.delicious.com/'+id;url='http://feeds.delicious.com/v2/json/'+id;break;case'pinterest':var cp=id.split('/');url='https://www.pinterest.com/'+id;var curl=o.url.replace(/\&/gi,"&");href='http://www.pinterest.com/'+id;url=cp.length>1?curl+'?id='+id+'&limit='+n+'&feed=board&type='+type:curl+'?id='+id+'&limit='+n+'&feed=user&type='+type;break;case'rss':href=id;var cp=id.split('://');var curl=o.url.replace(/\&/gi,"&");url=curl+'?id='+encodeURIComponent(cp[1])+'&limit='+n+'&type='+type;break;case'lastfm':href='https://www.last.fm/user/'+id;var ver=feed=='lovedtracks'?'2.0':'1.0';url=frl+encodeURIComponent('https://ws.audioscrobbler.com/'+ver+'/user/'+id+'/'+feed+'.rss');break;case'dribbble':href='https://www.dribbble.com/'+id;url='https://api.dribbble.com/v1/users/'+id+'/'+feed+'?access_token='+o.accessToken+'&sort=recent&page=';break;case'vimeo':href='https://www.vimeo.com/'+id;url='https://vimeo.com/api/v2/'+id+'/'+feed+'.json';break;case'stumbleupon':href='https://www.stumbleupon.com/stumbler/'+id;url=frl+encodeURIComponent('http://rss.stumbleupon.com/user/'+id+'/'+feed);break;case'deviantart':href='https://'+id+'.deviantart.com';url=frl+encodeURIComponent('https://backend.deviantart.com/rss.xml?type=deviation&q=by%3A'+id+'+sort%3Atime+meta%3Aall');break;case'tumblr':href='http://'+id+'.tumblr.com';url='http://'+id+'.tumblr.com/api/read/json?callback=?&num='+n;break;case'instagram':href='#';url='https://api.instagram.com/v1';var cp=id.substr(0,1),cq=id.split(cp),url1=cq[1],qs='',ts=0;switch(cp) 24{case'?':var p=cq[1].split('/');qs='&lat='+p[0]+'&lng='+p[1]+'&distance='+p[2];url+='/media/search';break;case'#':url+='/tags/'+url1+'/media/recent';ts=1;break;case'!':url+='/users/'+url1+'/media/recent';break;case'@':url+='/locations/'+url1+'/media/recent';break;} 25if(o.accessToken==''&&ts==0){if(location.hash){o.accessToken=location.hash.split('=')[1];}else{location.href="https://instagram.com/oauth/authorize/?client_id="+o.clientId+"&redirect_uri="+o.redirectUrl+"&response_type=token";}} 26url+='?access_token='+o.accessToken+'&client_id='+o.clientId+'&count='+n+qs;break;} 27var dataType=type=='twitter'||type=='facebook'||type=='rss'||type=='pinterest'||type=='dribbble'?'json':'jsonp';jQuery.ajax({url:url,data:data,cache:opt.cache,dataType:dataType,success:function(a){var error='';switch(type) 28{case'facebook':a=a.responseData.feed.entries?a.responseData.feed.entries:'';break;case'google':error=a.error?a.error:'';a=a.items;break;case'flickr':a=a.items;break;case'instagram':a=a.data;break;case'pinterest':a=a.item;break;case'twitter':error=a.errors?a.errors:'';if(cq.length>1){a=a.statuses};break;case'youtube':a=a.items;break;case'dribbble':break;case'tumblr':a=a.posts;break;case'delicious':break;case'vimeo':break;case'rss':a=a.item;break;default:if(a.responseStatus==200){a=a.responseData.feed.entries;}else{error=a.responseDetails;} 29break;} 30if(error==''){$.each(a,function(i,item){if(i<n){var html=[],q=item.link,u='<a href="'+href+'" class="link-user">'+id+'</a>',w='',x='<a href="'+q+'">'+item.title+'</a>',y='',z='',zz='',m='',d=item.publishedDate,sq=q,st=item.title,s='';switch(type) 31{case'facebook':x='';thumb=item.thumb;if(thumb!=null) 32{if(thumb.indexOf('safe_image.php')!=-1){if(thumb.indexOf('fbstaging')!=-1){thumb='https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&resize_w=260&refresh=86400&url='+encodeURIComponent(thumb);}else{thumb=unescape(thumb.match(/url=([^&]+)/)[1]);}} 33thumb=thumb.replace(/^http:\/\//i,'https://');y='<a href="'+q+'"><img src="'+thumb+'" alt="" /></a>';} 34var pageName=item.pageName;st=item.content;if(cp.length>1){st=cp[0]!=''?cp[0]:pageName;pageName=cp[0]!=''?cp[0]:pageName;} 35u='<a href="'+item.pageLink+'" class="link-user">'+pageName+'</a>';href=item.pageLink;z=linkify(item.content,type);break;case'twitter':d=parseTwitterDate(item.created_at);var un=item.user.screen_name,ua=item.user.profile_image_url_https;href='https://www.twitter.com/'+un;q=href;y='<a href="'+q+'" class="thumb"><img src="'+ua+'" alt="" /></a>';if(o.images!=''&&item.entities.media){$.each(item.entities.media,function(i,media){z+='<a href="'+media.media_url_https+'"><img src="'+media.media_url_https+':'+o.images+'" alt="" /></a>';});} 36z+='<span class="twitter-user"><a href="https://www.twitter.com/'+un+'"><strong>'+item.user.name+' </strong>@'+un+'</a></span>';z+='<span class="twitter-text">'+linkify(item.full_text,type)+'</span>';u='<a href="https://www.twitter.com/'+un+'" class="link-user">'+un+'</a>';sq=item.id_str;break;case'delicious':var d=new Date();d=d.setRFC3339(item.dt);x='<a href="'+item.u+'">'+item.d+'</a>';q=item.u;z=item.n;sq=item.u;st=item.d;break;case'rss':z=item.text;var src=item.image;y=src?'<a href="'+q+'"><img src="'+src+'" alt="" /></a>':'';break;case'pinterest':var src=$('img',item.description).attr('src');if(src){var res=src.replace('236x','736x');} 37y=src?'<a href="'+q+'"><img src="'+res+'" alt="" /></a>':'';z=item.text;st=z;break;case'youtube':x=item.snippet.title;var vidId=cq.length>1?item.id.videoId:item.snippet.resourceId.videoId;var ytthumb=o.thumb=='0'?'medium':o.thumb;q='https://www.youtube.com/watch?v='+vidId+'&feature=youtube_gdata';sq=q;
37if(item.snippet.thumbnails){y='<a href="'+q+'" title="'+item.snippet.title+'"><img src="'+item.snippet.thumbnails[ytthumb].url+'" alt="" /></a>';}else{opt.remove+=','+q;} 38z=o.text>0?cut(item.snippet.description,o.text):item.snippet.description;d=item.snippet.publishedAt;var profile='Youtube';if(cq.length>1){profile=decodeURIComponent(id);}else if(cp.length>1){profile=cp[0];}else if(cc.length>1){profile=cc[0];} 39u='<a href="'+href+'" class="link-user">'+profile+'</a>';st=item.snippet.title;break;case'flickr':d=parseTwitterDate(item.published);x=item.title;y='<a href="'+q+'" title="'+item.title+'"><img src="'+item.media.m+'" alt="" /></a>';break;case'lastfm':q=item.content;break;case'dribbble':d=item.created_at;dribbble=feed=='likes'?item.shot:item;q=dribbble.html_url;st=dribbble.title;y='<a href="'+q+'"><img src="'+dribbble.images.normal+'" alt="'+st+'" /></a>';x='<a href="'+q+'">'+st+'</a>';z='<span class="meta"><span class="views">'+num(dribbble.views_count)+'</span><span class="likes">'+num(dribbble.likes_count)+'</span><span class="comments">'+num(dribbble.comments_count)+'</span></span>';sq=q;break;case'instagram':d=parseInt(item.created_time*1000,10);x='';y='<a href="'+q+'"><img src="'+item.images[o.thumb].url+'" alt="" /></a>';z=item.caption!=null?htmlEncode(item.caption.text):'';u='<a href="'+q+'" class="link-user">'+item.user.username+'</a>';href='https://instagram.com/'+item.user.username;st=item.caption!=null?item.caption.text:'';break;case'vimeo':f=feed,at=item.name,tx=item.description,q=item.url;if(f=='channels'){y=item.logo!=''?'<a href="'+q+'" class="logo"><img src="'+item.logo+'" alt="" width="'+px+'" /></a>':'';}else if(f=='groups'){y='<a href="'+q+'"><img src="'+item.thumbnail+'" alt="" /></a>';}else{var thumb='thumbnail_'+o.thumb,at=item.title,tx=f!='albums'?item.duration+' secs':item.description;y='<a href="'+item.url+'" title="'+at+'"><img src="'+item[thumb]+'" alt="" /></a>';} 40x='<a href="'+q+'">'+at+'</a>';z=tx;if(o.stats==true){var m='';m+=f=='albums'||f=='channels'||f=='groups'?'<span class="videos">'+num(item.total_videos)+'</span>':'';if(f=='channels'){m+='<span class="users">'+num(item.total_subscribers)+'</span>';}else if(f=='groups'){m+='<span class="users">'+num(item.total_members)+'</span>';}else if(f!='albums'){m+='<span class="likes">'+num(item.stats_number_of_likes)+'</span><span class="views">'+num(item.stats_number_of_plays)+'</span><span class="comments">'+num(item.stats_number_of_comments)+'</span>';} 41z+='<span class="meta">'+m+'</span>';} 42var dt=item.upload_date;if(f=='likes'){dt=item.liked_on;}else if(f=='albums'||f=='channels'||f=='groups'){dt=item.created_on;} 43var d=new Date();d=d.setVimeo(dt);sq=q;st=at;break;case'stumbleupon':var src=$('img',item.content).attr('src');y=src!=''&&feed=='favorites'?'<a href="'+q+'"><img src="'+src+'" alt="" /></a>':'';z=item.contentSnippet;break;case'deviantart':var src=$('img',item.content).attr('src');y=src?'<a href="'+q+'"><img src="'+src+'" alt="" /></a>':'';z=item.contentSnippet;break;case'tumblr':q=item['url-with-slug'];d=item.date;x='<a href="'+q+'">';switch(item.type) 44{case'photo':x=item['photo-caption'];z='<a href="'+q+'"><img src="'+item['photo-url-'+o.thumb]+'" alt="" /></a>';st=x;break;case'video':x+=item['video-caption'];z=o.video!='400'?item['video-player-'+o.video]:item['video-player'];st=x;break;case'regular':x+=item['regular-title'];z=item['regular-body'];st=x;break;case'quote':x+=item['quote-source'];z=item['quote-text'];st=x;break;case'audio':x=item['id3-artist']?'<a href="'+q+'">'+item['id3-artist']+' - '+item['id3-album']+'</a>':'';x+=item['id3-title']?'<a href="'+q+'" class="track">'+item['id3-title']+'</a>':'';z=item['audio-caption'];z+=item['audio-player'];st=item['id3-artist']+' - '+item['id3-album']+' - '+item['id3-title'];break;case'conversation':x+=item['conversation-title'];z=item['conversation-text'];st=x;break;case'link':var ltxt=item['link-text'].replace(/:/g,'').replace(/\?/g,'').replace(/\!/g,'').replace(/\./g,'').replace(/\'/g,'').replace(/\(/g,'').replace(/\)/g,'').replace(/\@/g,'').replace(/\#/g,'').replace(/\|/g,'').replace(/\&/g,'');x='<a href="'+item['link-url']+'">'+ltxt+'</a>';z=item['link-description'];st=ltxt;break;} 45x+=item.type!='photo'||item.type!='audio'?'</a>':'';st=stripHtml(st);sq=q;break;case'google':var g=item.object.replies?num(item.object.replies.totalItems):0,m=item.object.plusoners?num(item.object.plusoners.totalItems):0,p=item.object.resharers?num(item.object.resharers.totalItems):0,dl;var d=new Date();d=d.setRFC3339(item.published);dl={src:"",imgLink:"",useLink:"",useTitle:""};var k=item.object.attachments;if(k)if(k.length){for(var l=0;l<k.length;l++){var h=k[l];if(h.image){dl.src=h.image.url;dl.imgLink=h.url;if(h.fullImage){dl.w=h.fullImage.width||0;dl.h=h.fullImage.height||0}} 46if(h.objectType=="article")dl.useLink=h.url;if(h.displayName)dl.useTitle=h.displayName} 47if(!dl.useLink)dl.useLink=dl.imgLink;var img_h=o.image_height?o.image_height:300;var img_w=o.image_width?o.image_width:300;if(dl.src.indexOf("resize_h")>=0)dl.src=dl.w>=dl.h?dl.src.replace(/resize_h=\d+/i,"resize_h="+img_h):dl.src.replace(/resize_h=\d+/i,"resize_w="+img_w)} 48dl=dl;q=dl.useLink;y=(dl.src?(dl.useLink?'<a href="'+dl.useLink+'">':'')+'<img src="'+dl.src+'" />'+(dl.useLink?'</a>':''):'');
48var t1=px/(dl.w/dl.h)<px/3?' class="clear"':'';x=(dl.useLink?'<a href="'+dl.useLink+'"'+t1+'>':'')+(item.title?item.title:dl.useTitle)+(dl.useLink?'</a>':'');if(o.shares){z='<span class="meta"><span class="plusones">+1s '+m+'</span><span class="shares">'+p+'</span><span class="comments">'+g+'</span></span>';} 49sq=q;st=dl.useTitle;break;} 50icon='<a href="'+href+'"><span class="socicon socicon-'+type+'"></span></a>';if(type=='twitter'){var intent='https://twitter.com/intent/';s='<a href="'+intent+'tweet?in_reply_to='+sq+'&via='+opt.twitterId+'" class="share-reply"></a>';s+='<a href="'+intent+'retweet?tweet_id='+sq+'&via='+opt.twitterId+'" class="share-retweet"></a>';s+='<a href="'+intent+'favorite?tweet_id='+sq+'" class="share-favorite"></a>';s+=share('','https://twitter.com/'+un+'/status/'+sq,opt.twitterId);}else{s=share(st,sq,opt.twitterId);} 51$.each(o.out.split(','),function(i,v){zz+=v!='intro'?'<span class="section-'+v+'">':'';switch(v) 52{case'intro':zintro=opt.style.layout=='modern'?'<span class="section-'+v+'">'+u:'<span class="section-'+v+'">';if(type=='twitter'){zintro+='<a href="'+q+'" class="link-intro">'+decodeURIComponent(intro)+'</a> <span><a href="https://twitter.com/'+un+'/status/'+item.id_str+'">'+nicetime(new Date(d).getTime(),0,opt.dates)+'</a></span></span>';}else{zintro+='<a href="'+q+'" class="link-intro">'+decodeURIComponent(intro)+'</a> <span>'+nicetime(new Date(d).getTime(),0,opt.dates)+'</span></span>';} 53break;case'title':zz+=x;break;case'thumb':zz+=y;break;case'text':zz+=z;break;case'user':opt.style.layout=='modern'?'':zz+=u;break;case'meta':zz+=m;break;case'share':zz+=s;break;} 54zz+=v!='intro'?'</span>':'';});var df=type=='instagram'?nicetime(d,1,opt.dates):nicetime(new Date(d).getTime(),1,opt.dates);var ob=df;switch(opt.order) 55{case'random':ob=randomish(6);break;case'none':ob=1;break;} 56var out='<li rel="'+ob+'" class="dcsns-li dcsns-'+type+' dcsns-feed-'+fn+'">'+w+'<div class="inner">'+zz+'<span class="clear"></span></div>'+zintro+icon+'</li>',str=decodeURIComponent(opt.remove),rem=q;if(type=='twitter'){rem='https://twitter.com/'+un+'/status/'+item.id_str;} 57if(str.indexOf(rem)!==-1&&rem!=''){n=n+1;}else{if(opt.max=='days'){if(df<=f2*86400&&df>=f1*86400){list.push(out);}else if(df>f2*86400){return false;}}else{list.push(out);}}}});}else if(opt.debug==true){list.push('<li class="dcsns-li dcsns-error">Error. '+error+'</li>');}},complete:function(){var $newItems=$(list.join(''));if(opt.wall==true){stream.isotope('insert',$newItems);if(type=='facebook'||type=='pinterest'||type=='rss'||type=='dribbble'){$('li.dcsns-'+type+' .section-thumb img',stream).css('opacity',0).show().fadeTo(800,1);$('img',stream).on('load',function(){stream.isotope('layout');});} 58if(type=='twitter'){setTimeout(function(){stream.isotope('layout');},1000);$('img',stream).on('load',function(){stream.isotope('layout');});}}else{stream.append($newItems);sortstream(stream,'asc');} 59if(type=='flickr'&&cq.length>1){flickrHrefLink(cq[1],$newItems);}}});return;} 60function linkify(text,type){text=text.replace(/((https?\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi,function(url){var full_url=!url.match('^https?:\/\/')?'http://'+url:url;return'<a href="'+full_url+'">'+url+'</a>';});if(type=='twitter'){text=text.replace(/(^|\s)@(\w+)/g,'$1@<a href="http://www.twitter.com/$2">$2</a>');text=text.replace(/(^|\s)#(\w+)/g,'$1#<a href="http://twitter.com/search/%23$2">$2</a>');}else if(type=='facebook'){text=text.replace(/<\/br>/g,' ');text=text.replace(/(^|\s)#(\w+)/g,'$1#<a href="http://facebook.com/hashtag/%23$2">$2</a>');} 61return text;} 62function cut(text,n){var short=text.substr(0,n);if(/^\S/.test(text.substr(n))) 63short=short.replace(/\s+\S*$/,"");return short;} 64function htmlEncode(v){return $('<div/>').text(v).html();} 65function stripHtml(v){var $html=$(v);return $html.text();} 66Date.prototype.setRFC3339=function(dString){var utcOffset,offsetSplitChar;var offsetMultiplier=1;var dateTime=dString.split('T');var date=dateTime[0].split('-');var time=dateTime[1].split(':');var offsetField=time[time.length-1];var offsetString;offsetFieldIdentifier=offsetField.charAt(offsetField.length-1);if(offsetFieldIdentifier=='Z'){utcOffset=0;time[time.length-1]=offsetField.substr(0,offsetField.length-2);}else{if(offsetField[offsetField.length-1].indexOf('+')!=-1){offsetSplitChar='+';offsetMultiplier=1;}else{offsetSplitChar='-';offsetMultiplier=-1;} 67offsetString=offsetField.split(offsetSplitChar);time[time.length-1]==offsetString[0];offsetString=offsetString[1].split(':');utcOffset=(offsetString[0]*60)+offsetString[1];utcOffset=utcOffset*60*1000;} 68this.setTime(Date.UTC(date[0],date[1]-1,date[2],time[0],time[1],time[2])+(utcOffset*offsetMultiplier));return this;};Date.prototype.setFbAlbum=function(dString){var utcOffset,offsetSplitChar='+',offsetMultiplier=1,dateTime=dString.split('T'),date=dateTime[0].split('-'),time=dateTime[1].split(':'),offsetField=time[time.length-1],offsetString;if(offsetField[offsetField.length-1].indexOf('+')!=-1){offsetSplitChar='-';offsetMultiplier=-1;} 69offsetTime=offsetField.split(offsetSplitChar);utcOffset=parseInt((offsetTime[1]/100),10)*60*1000;this.setTime(Date.UTC(date[0],date[1]-1,date[2],time[0],time[1],offsetTime[0])+(utcOffset*offsetMultiplier));return this;};Date.prototype.setVimeo=function(dString){var utcOffset=0,offsetSplitChar,offsetMultiplier=1;var dateTime=dString.split(' ');var date=dateTime[0].split('-');var time=dateTime[1].split(':');this.setTime(Date.UTC(date[0],date[1]-1,date[2],time[0],time[1],time[2])+(utcOffset*offsetMultiplier));return this;};function parseTwitterDate(a){var out=!!navigator.userAgent.match(/Trident\/7\./)||navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Edge")>=0?a.replace(/(\+\S+) (.*)/,'$2 $1'):a;return out;} 70function nicetime(a,out,dates){var d=Math.round((+new Date-a)/ 1000),fuzzy='',d=d<0?0:d,dates=dates==null?'min,mins,hr,hrs,day,days,week,weeks,month,months,year,years':dates,trans=dates.split(','),n=trans[1];if(out==1){return d;}else if(out==0){var chunks=new Array();chunks[0]=[60*60*24*365,trans[10],trans[11]];chunks[1]=[60*60*24*30,trans[8],trans[9]];chunks[2]=[60*60*24*7,trans[6],trans[7]];chunks[3]=[60*60*24,trans[4],trans[5]];chunks[4]=[60*60,trans[2],trans[3]];chunks[5]=[60,trans[0],trans[1]];var i=0,j=chunks.length;for(i=0;i<j;i++){s=chunks[i][0];if((xj=Math.floor(d / s))!=0) 71{n=xj==1?chunks[i][1]:chunks[i][2];break;}} 72fuzzy+=xj==1?'1 '+n:xj+' '+n;if(i+1<j){s2=chunks[i+1][0];if(((xj2=Math.floor((d-(s*xj))/ s2))!=0)) 73{n2=(xj2==1)?chunks[i+1][1]:chunks[i+1][2];fuzzy+=(xj2==1)?' + 1 '+n2:' + '+xj2+' '+n2;}} 74fuzzy+=' zuvor';return fuzzy;}} 75function num(a){var b=a;if(a>999999)b=Math.floor(a / 1E6)+"M";else if(a>9999)b=Math.floor(a / 1E3)+"K";else if(a>999)b=Math.floor(a / 1E3)+","+a%1E3;return b} 76function parseQ(url){var v=[],hash,q=url.split('?')[1];if(q!=undefined){q=q.split('&');for(var i=0;i<q.length;i++){hash=q[i].split('=');v.push(hash[1]);v[hash[0]]=hash[1];}} 77return v;} 78function getImg(content){var imgArr=new Array(),reg=/<img .*?src=["\']([^ ^"^\']*)["\']/gi,check,image;while(check=reg.exec(content)){imgArr.push(check[1]);} 79if(imgArr.length>0&&imgArr[0].indexOf('sndcdn.com')===-1){var image=imgArr[0];if(image.indexOf('instagram.com/profiles')!==-1){image=imgArr[1];} 80image=image.replace("_m.jpg",".jpg");if(image.indexOf('fbcdn')==-1){image=image.replace("_b.jpg","_f.jpg");image=image.replace("_b.png","_f.png");}else{if(image.indexOf('safe_image.php')==-1){var id=image.split("_"),object_id=id[1];image='http://graph.facebook.com/'+object_id+'/picture?type=normal';}} 81image=image.replace("_s.jpg","_b.jpg");image=image.replace("_m.png",".png");image=image.replace("_s.png","_b.png");image=image.replace(/\&/g,'&');if(image.indexOf('safe_image.php')!=-1){image=unescape(image.match(/url=([^&]+)/)[1]);} 82if(image.indexOf('app_full_proxy.php')!=-1){image=unescape(image.match(/src=([^&]+)/)[1]);} 83if(this.prefix=='https://'){var image_tmp=image.replace('http://','https://');image=image_tmp;}}else{return false} 84return image;} 85function sortstream(obj,d){var $l=$('li',obj);$l.sort(function(a,b){var keyA=parseInt($(a).attr('rel'),10),keyB=parseInt($(b).attr('rel'),10);if(d=='asc'){return(keyA>keyB)?1:-1;}else{return(keyA<keyB)?1:-1;} 86return 0;});$.each($l,function(index,row){obj.append(row);});$('.dcsns-loading').slideUp().remove();return;} 87function randomish(l){var i=0,out='';while(i<l){out+=Math.floor((Math.random()*10)+1)+'';i++;} 88return out;} 89function ticker(s,b,speed){var $a=$('li:last',s),$b=$('li:first',s),$gx,bh=$b.outerHeight(true);if($('li',s).not('.inactive').length>2){if(b=='next'){$gx=$a.clone().hide();$b.before($gx);$a.remove();
89if($a.hasClass('inactive')){ticker(s,b,speed);}else{$('.inner',$gx).css({opacity:0});$gx.slideDown(speed,'linear',function(){$('.inner',this).animate({opacity:1},speed);});return;}}else{$gx=$b.clone();if($b.hasClass('inactive')){$a.after($gx);$b.remove();ticker(s,b,speed);}else{$b.animate({marginTop:-bh+'px'},speed,'linear',function(){$a.after($gx);$b.remove();});$('.inner',$b).animate({opacity:0},speed);}}}} 90function flickrHrefLink(id,obj){jQuery.ajax({url:'http://api.flickr.com/services/feeds/groups_pool.gne?id='+id+'&format=json&jsoncallback=?',dataType:'jsonp',success:function(a){$('.icon',obj).each(function(){$(this).parent().attr('href',a.link);});}});} 91function share(st,sq,twitterId){var s='',sq=encodeURIComponent(sq),st=encodeURIComponent(st);s='<a href="http://www.facebook.com/sharer.php?u='+sq+'&t='+st+'" class="share-facebook" target="_blank"></a>';s+='<a href="https://twitter.com/share?url='+sq+'&text='+st+'&via='+twitterId+'" class="share-twitter" target="_blank"></a>';s+='<a href="https://plus.google.com/share?url='+sq+'" class="share-google" target="_blank"></a>';s+='<a href="http://www.linkedin.com/shareArticle?mini=true&url='+sq+'&title='+st+'" class="share-linkedin" target="_blank"></a>';return s;}})(jQuery); 92jQuery(window).load(function(){ 93 jQuery.getScript("//platform.twitter.com/widgets.js", function(){}); 94 jQuery('.section-share a').click(function(){ 95 var u = jQuery(this).attr('href'); 96 window.open(u,'sharer','toolbar=0,status=0,width=626,height=436'); 97 return false; 98 }); 99});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.