text: !function(t){"use strict";t.jscroll={defaults:{debug:!1,autoTrigger:!0,autoTriggerUntil:!1,loadingHtml:"<small>Loading...</small>",padding:0,nextSelector:"a:last",contentSelector:"",pagingSelector:"",callback:!1}};var n=function(n,e){var l=n.data("jscroll"),r="function"==typeof e?{callback:e}:e,o=t.extend({},t.jscroll.defaults,r,l||{}),i="visible"===n.css("overflow-y"),c=n.find(o.nextSelector).first(),a=t(window),s=t("body"),d=i?a:n,f=t.trim(c.attr("href")+" "+o.contentSelector),g=function(){var n=t(o.loadingHtml).filter("img").attr("src");if(n){var e=new Image;e.src=n}},u=function(){n.find(".jscroll-inner").length||n.contents().wrapAll('<div class="jscroll-inner" />')},p=function(t){var n;o.pagingSelector?t.closest(o.pagingSelector).hide():(n=t.parent().not(".jscroll-inner,.jscroll-added").addClass("jscroll-next-parent").hide(),n.length||t.wrap('<div class="jscroll-next-parent" />').parent().hide())},j=function(){return d.unbind(".jscroll").removeData("jscroll").find(".jscroll-inner").children().unwrap().filter(".jscroll-added").children().unwrap()},h=function(){u();var t=n.find("div.jscroll-inner").first(),e=n.data("jscroll"),l=parseInt(n.css("borderTopWidth"),10),r=isNaN(l)?0:l,c=parseInt(n.css("paddingTop"),10)+r,a=i?d.scrollTop():n.offset().top,s=t.length?t.offset().top:0,f=Math.ceil(a-s+d.height()+c);return!e.waiting&&f+o.padding>=t.outerHeight()?(x("info","jScroll:",t.outerHeight()-f,"from bottom. Loading next request..."),b()):void 0},v=function(t){return t=t||n.data("jscroll"),t&&t.nextHref?(m(),!0):(x("warn","jScroll: nextSelector not found - destroying"),j(),!1)},m=function(){var t=n.find(o.nextSelector).first();t.length&&(o.autoTrigger&&(o.autoTriggerUntil===!1||o.autoTriggerUntil>0)?(p(t),s.height()<=a.height()&&h(),d.unbind(".jscroll").bind("scroll.jscroll",function(){return h()}),o.autoTriggerUntil>0&&o.autoTriggerUntil--):(d.unbind(".jscroll"),t.bind("click.jscroll",function(){return p(t),b(),!1})))},b=function(){var e=n.find("div.jscroll-inner").first(),l=n.data("jscroll");return l.waiting=!0,e.append('<div class="jscroll-added" />').children(".jscroll-added").last().html('<div class="jscroll-loading">'+o.loadingHtml+"</div>"),n.animate({scrollTop:e.outerHeight()},0,function(){e.find("div.jscroll-added").last().load(l.nextHref,function(e,r){if("error"===r)return j();var i=t(this).find(o.nextSelector).first();l.waiting=!1,l.nextHref=i.attr("href")?t.trim(i.attr("href")+" "+o.contentSelector):!1,t(".jscroll-next-parent",n).remove(),v(),o.callback&&o.callback.call(this),x("dir",l)})})},x=function(t){if(o.debug&&"object"==typeof console&&("object"==typeof t||"function"==typeof console[t]))if("object"==typeof t){var n=[];for(var e in t)"function"==typeof console[e]?(n=t[e].length?t[e]:[t[e]],console[e].apply(console,n)):console.log.apply(console,n)}else console[t].apply(console,Array.prototype.slice.call(arguments,1))};return n.data("jscroll",t.extend({},l,{initialized:!0,waiting:!1,nextHref:f})),u(),g(),m(),t.extend(n.jscroll,{destroy:j}),n};t.fn.jscroll=function(e){return this.each(function(){var l,r=t(this),o=r.data("jscroll");o&&o.initialized||(l=new n(r,e))})}}(jQuery),function(t){"use strict";t(document).ready(function(){t(".posts").jscroll({contentSelector:".posts",loadingHtml:'<img src="/assets/images/loading.gif" alt="Loading" />',padding:10,nextSelector:".next"})})}(jQuery);