..</em>",selector:null,speed:"fast",start:undefined},state:{isDuringAjax:!1,isInvalidPage:!1,isDestroyed:!1,isDone:!1,isPaused:!1,currPage:1},debug:!1,behavior:undefined,binder:t(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:!1,pathParse:undefined,dataType:"html",appendCallback:!0,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:undefined,path:undefined,prefill:!1},t.infinitescroll.prototype={_binding:function(n){var r=this,i=r.options;i.v="2.0b2.111027";if(!!i.behavior&&this["_binding_"+i.behavior]!==undefined){this["_binding_"+i.behavior].call(this);return}if(n!=="bind"&&n!=="unbind")return this._debug("Binding value "+n+" not valid"),!1;n==="unbind"?this.options.binder.unbind("scroll.infscr."+r.options.infid):this.options.binder[n]("scroll.infscr."+r.options.infid,t.throttle(100,function(){r.scroll()})),this._debug("Binding",n)},_create:function(n,r){var i=t.extend(!0,{},t.infinitescroll.defaults,n);this.options=i;var s=t(window),o=this;if(!o._validate(n))return!1;var u=t(i.nextSelector).attr("href");if(!u)return this._debug("Navigation selector not found"),!1;i.path=i.path||this._determinepath(u),i.contentSelector=i.contentSelector||this.element,i.loading.selector=i.loading.selector||i.contentSelector,i.loading.msg=i.loading.msg||t('<div id="infscr-loading"><img alt="Loading..." src="'+i.loading.img+'" /><div>'+i.loading.msgText+"</div></div>"),(new Image).src=i.loading.img,i.pixelsFromNavToBottom===undefined&&(i.pixelsFromNavToBottom=t(document).height()-t(i.navSelector).offset().top);var a=this;return i.loading.start=i.loading.start||function(){t(i.navSelector).hide(),i.loading.msg.appendTo(i.loading.selector).show(i.loading.speed,t.proxy(function(){this.beginAjax(i)},a))},i.loading.finished=i.loading.finished||function(){i.loading.msg.fadeOut(i.loading.speed)},i.callback=function(e,n){!!i.behavior&&e["_callback_"+i.behavior]!==undefined&&e["_callback_"+i.behavior].call(t(i.contentSelector)[0],n),r&&r.call(t(i.contentSelector)[0],n,i),i.prefill&&s.bind("resize.infinite-scroll",e._prefill)},n.debug&&Function.prototype.bind&&(typeof console=="object"||typeof console=="function")&&typeof console.log=="object"&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.call(console[e],console)},Function.prototype.bind),this._setup(),i.prefill&&this._prefill(),!0},_prefill:function(){function s(){return r.height()<=i.height()}var n=this,r=t(document),i=t(window);this._prefill=function(){s()&&n.scroll(),i.bind("resize.infinite-scroll",function(){s()&&(i.unbind("resize.infinite-scroll"),n.scroll())})},this._prefill()},_debug:function(){if(!0!==this.options.debug)return;typeof console!="undefined"&&typeof console.log=="function"?Array.prototype.slice.call(arguments).length===1&&typeof Array.prototype.slice.call(arguments)[0]=="string"?console.log(Array.prototype.slice.call(arguments).toString()):console.log(Array.prototype.slice.call(arguments)):!Function.prototype.bind&&typeof console!="undefined"&&typeof console.log=="object"&&Function.prototype.call.call(console.log,console,Array.prototype.slice.call(arguments))},_determinepath:function(t){var n=this.options;if(!n.behavior||this["_determinepath_"+n.behavior]===undefined){if(!n.pathParse){if(t.match(/^(.*?)\b2\b(.*?$)/))t=t.match(/^(.*?)\b2\b(.*?$)/).slice(1);else if(t.match(/^(.*?)2(.*?$)/)){if(t.match(/^(.*?page=)2(\/.*|$)/))return t=t.match(/^(.*?page=)2(\/.*|$)/).slice(1),t;t=t.match(/^(.*?)2(.*?$)/).slice(1)}else{if(t.match(/^(.*?page=)1(\/.*|$)/))return t=t.match(/^(.*?page=)1(\/.*|$)/).slice(1),t;this._debug("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com."),n.state.isInvalidPage=!0}return this._debug("determinePath",t),t}return this._debug("pathParse manual"),n.pathParse(t,this.options.state.currPage+1)}return this["_determinepath_"+n.behavior].call(this,t)},_error:function(t){var n=this.options;if(!!n.behavior&&this["_error_"+n.behavior]!==undefined){this["_error_"+n.behavior].call(this,t);return}t!=="destroy"&&t!=="end"&&(t="unknown"),this._debug("Error",t),t==="end"&&this._showdonemsg(),n.state.isDone=!0,n.state.currPage=1,n.state.isPaused=!1,this._binding("unbind")},_loadcallback:function(n,r){var i=this.options,s=this.options.callback,o=i.state.isDone?"done":i.appendCallback?"append":"no-append",u;if(!!i.behavior&&this["_loadcallback_"+i.behavior]!==undefined){this["_loadcallback_"+i.behavior].call(this,n,r);return}switch(o){case"done":return this._showdonemsg(),!1;case"no-append":i.dataType==="html"&&(r="<div>"+r+"</div>",r=t(r).find(i.itemSelector));break;case"append":var a=n.children();if(a.length===0)return this._error("end");u=document.createDocumentFragment();while(n[0].firstChild)u.appendChild(n[0].firstChild);this._debug("contentSelector",t(i.contentSelector)[0]),t(i.contentSelector)[0].appendChild(u),r=a.get()}i.loading.finished.call(t(i.contentSelector)[0],i);if(i.animate){var f=t(window).scrollTop()+t("#infscr-loading").height()+i.extraScrollPx+"px";t("html,body").animate({scrollTop:f},800,function(){i.state.isDuringAjax=!1})}i.animate||(i.state.isDuringAjax=!1),s(this,r),i.prefill&&this._prefill()},_nearbottom:function(){var n=this.options,r=0+t(document).height()-n.binder.scrollTop()-t(window).height();return!n.behavior||this["_nearbottom_"+n.behavior]===undefined?(this._debug("math:",r,r-n.bufferPx,n.pixelsFromNavToBottom),this._debug("nearbottom?",r-n.bufferPx<n.pixelsFromNavToBottom),r-n.bufferPx<n.pixelsFromNavToBottom):this["_nearbottom_"+n.behavior].call(this)},_pausing:function(t){var n=this.options;if(!n.behavior||this["_pausing_"+n.behavior]===undefined){t!=="pause"&&t!=="resume"&&t!==null&&this._debug("Invalid argument. Toggling pause value instead"),t=!t||t!=="pause"&&t!=="resume"?"toggle":t;switch(t){case"pause":n.state.isPaused=!0;break;case"resume":n.state.isPaused=!1;break;case"toggle":n.state.isPaused=!n.state.isPaused}return this.

Prev | Next
Pg.: 1 ... 18 19 20 21 22 23 24 25 26 27 28 ... 41


Back to home | File page

Subscribe | Register | Login | N