"use strict";window.BYUTV=window.BYUTV||{};BYUTV.Widgets=BYUTV.Widgets||{};BYUTV.seeTheGoodRoot="http://byutv.org/seethegood/";BYUTV.blogRoot="http://byutv.org/seethegood/blog/syndication.axd?format=rss&category=";BYUTV.Widgets.BlogList=function(a){if(!(this instanceof BYUTV.Widgets.BlogList)){return new BYUTV.Widgets.BlogList(a)}a.url=BYUTV.blogRoot+a.url;a.category="";this.init(a)};BYUTV.Widgets.BlogList.prototype=function(){var a,b;a=function(f){var j="",h,c,d,m="",k,e,l;for(h=0;h<f.posts;h=h+1){if(h<f.data.feed.entries.length){try{d=f.data.feed.entries[h];if(!f.feedList){e={};e.Title=d.title;e.Description=d.contentSnippet;e.Link=d.link;e.Timestamp=new Date(d.publishedDate).format("mmmm, dd, yyyy");if(!$("img",d.content).attr("src")){e.Image="/Content/images/logo.png"}else{e.Image=$("img",d.content).attr("src")}l=(e.Image.indexOf(BYUTV.seeTheGoodRoot)<0)?BYUTV.seeTheGoodRoot:"";c='<li><a href="{5}"><div class="imgContainer"><img src="{1}"></div></a><div class="postDate">{2}</div><a class="postTitle" href="{5}">{3}</a><article>{4}</article><a class="view-post" href="{5}" id="_TrueBlue_Blog​_ViewPost"></a></li>';j=j+c.format(l,e.Image,e.Timestamp,e.Title,e.Description,e.Link)}else{j=j+'<li><a href="{0}" target="_blank">{1}</a></li>'.format(d.link,d.title)}}catch(g){}}}if(f.scroller){k=(f.data.feed.entries.length*231)+"px"}else{k="auto"}if(f.feedList){return'<header>{0}<a href="http://byutv.org/seethegood/{1}">View all Posts</a></header>'.format(f.title,f.category)+'<div><ul style="">{1}</ul>{2}</div>'.format(k,j,m)}else{return'<header>{0}<a href="http://byutv.org/seethegood/{1}">View all Posts</a></header>'.format(f.title,f.category)+'<div><ul style="">{1}</ul>{2}</div>'.format(k,j,m)}};b=function(c){var d=function(){var f=new google.feeds.Feed(c.url);c.posts=c.posts||1;f.setNumEntries(c.posts);f.load(e)},e=function(f){if(f.feed.entries.length>0){$(c.selector).html(a({data:f,Selector:c.selector,posts:c.posts,scroller:c.scroller,featured:c.featured,feedList:c.feedList,title:c.title,category:c.category})).addClass("blog-list");$(c.selector+" > div, "+c.selector+" header").addClass("rssList");$(c.selector+" header").addClass("widget-header")}else{c.url=c.url.split("&author")[0];d()}};if(!c||!c.selector){throw {name:"Undefined Parameter",message:"A required parameter has not been defined"}}google.load("feeds","1",{callback:d})};return{init:b}}();
