1/* 2** 3** jquery.kyco.googleplusfeed 4** ========================== 5** 6** Version 2.1.3 7** 8** Brought to you by 9** https://www.kycosoftware.com/ 10** 11** Copyright 2015 Cornelius Weidmann 12** 13** Distributed under the GPL 14** 15*/ 16 17(function(h){var l={init:function(b){var a=h.extend({},{feedPosts:3,postsIncrement:3,maxPosts:20,profileImageSize:50,fadeSpeed:250,loadAttachments:!0,orderBy:"date",sort:"asc",lang:"en"},b);return this.each(function(){var b=h(this),l,n,g,z,A,y,t,w,p,x,q;a.lang="en"===a.lang?{langCode:"en",loading:"Loading...",showMore:"Show more",viewMore:"View more posts on Google+",shared:"Shared publicly - ",viewPost:"View post",errorEmpty:"Nothing to show. Empty feed. ",retryEmpty:"Refresh",errorGeneral:"Unable to retrieve feed contents. ",errorNotFound:"User not found... Enter a valid Google+ ID",retryGeneral:"Retry",originalShare:"originally shared",viewVideo:"View video at original URL"}:{langCode:"de",loading:"Wird geladen...",showMore:"Mehr anzeigen",viewMore:"Weitere Beitr\u00e4ge ansehen bei Google+",shared:"\u00d6ffentlich geteilt - ",viewPost:"Beitrag ansehen",errorEmpty:"Nichts zu sehen. Keine Beitr\u00e4ge. ",retryEmpty:"Wiederholen",errorGeneral:"Es ist ein Fehler beim Abrufen der Beitr\u00e4ge aufgetreten. ",errorNotFound:"Benutzer nicht gefunden... Verwende einen g\u00fcltigen Google+ ID",retryGeneral:"Wiederholen",originalShare:"urspr\u00fcnglich geteilt",viewVideo:"Video Blick in Original URL"};l=h('<div id="feed_'+b.attr("class")+'" class="kyco_googleplusfeed '+a.lang.langCode+'"></div>');n=h('<div class="feed_loader">'+a.lang.loading+"</div>");g=h('<div class="feed_wrapper"></div>');z=h('<div class="feed_header"></div>');A=h('<h3 class="feed_screen_name"><a href="#" target="_blank"></a></h3>');y=h('<a href="#" class="feed_profile_image" target="_blank"></a>');t=h('<div class="feed_content"></div>');w=h('<span class="feed_show_more">'+a.lang.showMore+"</span>");p=h('<div class="error"></div>');x=h('<span class="retry"></span>');z.append(y,A);g.append(z,t,w);l.append(n,g);b.append(l);q=new function(b){var e=this;e.id=b;e.url="https://plus.google.com/"+e.id;e.init=function(){function h(a,b){var g=b||!1,e="",f,k,m,e=c[a].publishedDate.substr(0,19);f=e.split("T")[0];m=f.split("-")[0];k="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")["01 02 03 04 05 06 07 08 09 10 11 12".split(" ").indexOf(f.split("-")[1])];f=f.split("-")[2];e=e.split("T").pop();f=f+" "+k+" "+m;return g?f+" "+e:f}function e(d){var b="",g="",k="",f,m,r,v;if(a.loadAttachments&&"undefined"!==typeof c[d].attachments)for(f=0,m=c[d].attachments.length;f<m;f++)switch(g="",c[d].attachments[f].objectType){case "photo":k+='<p class="attachment photo"><a href="'+c[d].attachments[f].url+'" target="_blank" title="View photo"><img width="100%" src="'+c[d].attachments[f].image.url+'"></a></p>';break;case "album":r=0;for(v=c[d].attachments[f].thumbnails.length;r<v;r++)g+='<a href="'+c[d].attachments[f].thumbnails[r].url+'" target="_blank" title="View album"><img width="100%" src="'+c[d].attachments[f].thumbnails[r].image.url+'"></a>';k+='<p class="attachment album">'+g+"</p>";break;case "article":k=c[d].attachments[f].fullImage?k+('<p class="attachment photo"><a href="'+c[d].attachments[f].url+'" target="_blank" title="View article"><img width="100%" src="'+c[d].attachments[f].fullImage.url+'"></a></p>'):k+('<p class="attachment article"><a href="'+c[d].attachments[f].url+'" target="_blank" title="View article"><span title="'+c[d].attachments[f].displayName+'">'+c[d].attachments[f].displayName+'</span><small title="'+c[d].attachments[f].url+'">'+c[d].attachments[f].url+"</small></a></p>");break;case "video":k="undefined"!==typeof c[d].attachments[f].embed?k+('<p class="attachment video"><iframe width="100%" scrolling="no" src="'+c[d].attachments[f].embed.url+'"></iframe><a href="'+c[d].attachments[f].url+'" target="_blank" title="View video">'+a.lang.viewVideo+"</a></p>"):k+('<p class="attachment photo"><a href="'+c[d].attachments[f].url+'" target="_blank" title="View video"><img width="100%" src="'+c[d].attachments[f].image.url+'"></a></p>')}return b="undefined"!==typeof c[d].annotation?b+('<div class="feed_post post_'+(d+1)+'"><span title="'+h(d,!0)+'">'+a.lang.shared+h(d)+"</span><p>"+c[d].annotation+'</p><div class="original"><p class="original">'+c[d].originalPoster.displayName+" <span>"+a.lang.originalShare+":</span></p>"+k+"<p>"+c[d].content+'</p></div><a href="'+c[d].url+'" target="_blank">'+a.lang.viewPost+"</a></div>"):b+('<div class="feed_post post_'+(d+1)+'"><span title="'+h(d,!0)+'">'+a.lang.shared+h(d)+"</span>"+k+"<p>"+c[d].content+'</p><a href="'+c[d].url+'" target="_blank">'+a.lang.viewPost+"</a></div>")}var c=q.entries,b=c.length,k=a.feedPosts,B=a.postsIncrement,u=0,r=!1,l=0,v=k,m="",k=b<k?b:k;if(0<b){for(;l<k;l++)m+=e(l);A.children("a").attr("href",q.url).text(q.screenName);y.attr("href",q.url);y.append('<img src="'+q.image+'" width="'+a.profileImageSize+'" height="'+a.profileImageSize+'">');t.html(m);t.animate({scrollTop:0},1);
17g.fadeIn(a.fadeSpeed)}else g.children().remove(),p.text(a.lang.errorEmpty),x.text(a.lang.retryEmpty),p.append(x),g.append(p),g.fadeIn(a.fadeSpeed),g.find(".retry").click(function(){g.children().remove();g.append(n);n.show();q.getFeed()});w.click(function(){var d=function(){window.open(q.url)};if(u<=b){u+=r?B:k+B;for(u=u>b?b:u;v<u;v++)m+=e(v),v===b-1&&(w.unbind("click").addClass("link"),w.text(a.lang.viewMore).click(d));t.animate({scrollTop:t[0].scrollHeight},500);r=!0}t.html(m)})};e.getFeed=function(){h.ajax({type:"GET",url:"https://www.kycosoftware.com/api/googleplus-feed/"+encodeURIComponent(e.id),dataType:"json",success:function(b){var l,c,q;try{"404"!==b&&!1!==b?(l=b.profile,c=b.activity,q=function(b){for(var c=[],g=b.length,e=0,h=0;e<g;e++)h<a.maxPosts&&""!==b[e].object.content&&(c.push({url:b[e].object.url,publishedDate:b[e].published,content:b[e].object.content,annotation:b[e].annotation,attachments:b[e].object.attachments,plusones:b[e].object.plusoners.totalItems,originalPoster:b[e].object.actor}),h++);switch(a.orderBy){case "date":c.sort(function(a,b){return new Date(b.publishedDate)-new Date(a.publishedDate)});break;case "popularity":"asc"===a.sort?c.sort(function(a,b){return b.plusones-a.plusones}):c.sort(function(a,b){return a.plusones-b.plusones})}return c},e.screenName=l.displayName,e.entries=q(c.items),e.image=l.image.url.substr(0,l.image.url.indexOf("?"))+"?sz="+a.profileImageSize,h.get(e.image).fail(function(){e.image="https://www.kycosoftware.com/images/general/googleplus-404.png"}).always(function(){h('<img src="'+e.image+'">').load(function(){n.fadeOut(a.fadeSpeed,function(){n.remove();e.init()})})})):"404"===b?n.fadeOut(a.fadeSpeed,function(){p.text(a.lang.errorNotFound);g.html(p);
17g.fadeIn(a.fadeSpeed)}):n.fadeOut(a.fadeSpeed,function(){p.text(a.lang.errorGeneral);g.html(p);g.fadeIn(a.fadeSpeed)})}catch(k){n.fadeOut(a.fadeSpeed,function(){g.children().remove();p.text(a.lang.errorGeneral);x.text(a.lang.retryGeneral);p.append(x);g.append(p);g.fadeIn(a.fadeSpeed);g.find(".retry").click(function(){g.children().remove();g.append(n);n.show();e.getFeed()})})}}})};e.getFeed()}(a.id)})}};h.fn.kycoGooglePlusFeed2=function(b){var a=b;"string"===typeof b&&(a={id:b});return l[b]?l[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"===typeof a?l.init.apply(this,[a]):h.error("Method "+b+" does not exist on jQuery.kycoGooglePlusFeed2")}})(jQuery);
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.