text: function init(){loadFeed(0)}function loadFeed(e,n){var t=allFeeds[e].url,o=allFeeds[e].name;return $.ajax({type:"POST",url:"https://rsstojson.udacity.com/parseFeed",data:JSON.stringify({url:t}),contentType:"application/json",success:function(e){var t=$(".feed"),a=$(".header-title"),d=e.feed.entries,i=(d.length,Handlebars.compile($(".tpl-entry").html()));a.html(o),t.empty(),d.forEach(function(e){t.append(i(e))}),n&&n()},error:function(){n&&n()},dataType:"json"})}var allFeeds=[{name:"Udacity Blog",url:"http://blog.udacity.com/feed"},{name:"CSS Tricks",url:"http://css-tricks.com/feed"},{name:"HTML5 Rocks",url:"http://feeds.feedburner.com/html5rocks"},{name:"Linear Digressions",url:"http://feeds.feedburner.com/udacity-linear-digressions"}];google.load("feeds","1"),google.setOnLoadCallback(init),$(function(){var e=($(".feed"),$(".feed-list")),n=Handlebars.compile($(".tpl-feed-list-item").html()),t=0,o=$(".menu-icon-link");orderIcon=$(".order-icon-items"),allFeeds.forEach(function(o){o.id=t,e.append(n(o)),t++}),e.on("click","a",function(){var e=$(this);return $("body").addClass("menu-hidden"),loadFeed(e.data("id")),!1}),o.on("click",function(){$("body").toggleClass("menu-hidden")}),orderIcon.on("click",function(){var e=$(".feed"),n=e.find(".entry-link");n.detach().sort(function(e,n){return $(e).find("h2").text().toLowerCase().localeCompare($(n).find("h2").text().toLowerCase())}),e.append(n)})}());