function Controller(){function e(){g.closeWindow(n.blogDetail)}function l(){Alloy.Globals.loading.showHide("show");for(var e=n.detailScroll.children.length,l=0;e>l;++l)n.detailScroll.remove(n.detailScroll.children[0]);r()}function t(){g.i("blogDetail drag ended")}function i(e){g.i("blogDetail Scrolled"),_.isEmpty(c)||(g.i("scrolling... y: "+e.y+" | next load point: "+m),e.y>m&&(m+=420,o(3)))}function o(e){var l=_.first(c,e);c=_.rest(c,e),_.each(l,function(e){g.is("blog item",e),n.detailScroll.add(Alloy.createController("blogDetailItem",{title:u.unix(e.moment).format("HH:mm, dddd, Do MMM YYYY"),image:e.imageUrl.medium,post:e.message}).getView())}),_.defer(function(){Alloy.Globals.loading.showHide("hide")})}function r(){function e(e){c=e.messages,_.defer(function(){o(3)})}function l(){}var t=v.signUrl(Alloy.CFG.feedUrls.blogDetail.replace("{{id}}",f.id));w.getData({getUrl:t},e,l)}function a(){n.blogDetail.open()}require("alloy/controllers/BaseController").apply(this,Array.prototype.slice.call(arguments)),this.__controllerPath="blogDetail",arguments[0]?arguments[0].__parentSymbol:null,arguments[0]?arguments[0].$model:null,arguments[0]?arguments[0].__itemTemplate:null;var n=this,d={},s={};n.__views.blogDetail=Ti.UI.createWindow({backgroundColor:Alloy.CFG.colors.darkBlue,layout:"vertical",id:"blogDetail"}),n.__views.blogDetail&&n.addTopLevelView(n.__views.blogDetail),n.__views.titleBar=Ti.UI.createView({height:40,top:0,id:"titleBar"}),n.__views.blogDetail.add(n.__views.titleBar),n.__views.backButton=Ti.UI.createView({width:33,height:33,left:12,backgroundImage:"images/iconBack.png",id:"backButton"}),n.__views.titleBar.add(n.__views.backButton),e?n.__views.backButton.addEventListener("click",e):s["$.__views.backButton!click!closeWindow"]=!0,n.__views.title=Ti.UI.createLabel({font:{fontSize:20,fontFamily:Alloy.CFG.fonts.bold},color:Alloy.CFG.colors.white,text:L("Blog_Title"),id:"title"}),n.__views.titleBar.add(n.__views.title),n.__views.refreshButton=Ti.UI.createView({width:33,height:33,right:12,backgroundImage:"images/iconRefresh.png",id:"refreshButton"}),n.__views.titleBar.add(n.__views.refreshButton),l?n.__views.refreshButton.addEventListener("click",l):s["$.__views.refreshButton!click!refreshBlogDetail"]=!0,n.__views.detailScroll=Ti.UI.createScrollView({layout:"vertical",id:"detailScroll"}),n.__views.blogDetail.add(n.__views.detailScroll),i?n.__views.detailScroll.addEventListener("scroll",i):s["$.__views.detailScroll!scroll!scrolled"]=!0,t?n.__views.detailScroll.addEventListener("dragend",t):s["$.__views.detailScroll!dragend!dragEnded"]=!0,d.destroy=function(){},_.extend(n,n.__views);var c,g=require("helpers"),u=require("alloy/moment"),v=require("feedSigner"),w=require("netConnect"),f=arguments[0]||{},m=120;d.openWin=a,r(),s["$.__views.backButton!click!closeWindow"]&&n.__views.backButton.addEventListener("click",e),s["$.__views.refreshButton!click!refreshBlogDetail"]&&n.__views.refreshButton.addEventListener("click",l),s["$.__views.detailScroll!scroll!scrolled"]&&n.__views.detailScroll.addEventListener("scroll",i),s["$.__views.detailScroll!dragend!dragEnded"]&&n.__views.detailScroll.addEventListener("dragend",t),_.extend(n,d)}var Alloy=require("alloy"),Backbone=Alloy.Backbone,_=Alloy._;module.exports=Controller;