From 642a0693dc777cdd007d1dc860e4ce9478655bc1 Mon Sep 17 00:00:00 2001 From: Beaver6813 Date: Tue, 28 Jun 2011 19:56:18 +0100 Subject: [PATCH] Minified new version. Added debug switch between min and not min files. --- jquery.infinitescroll.min.js | 4 ++-- wp_infinite_scroll.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/jquery.infinitescroll.min.js b/jquery.infinitescroll.min.js index 4ba3fb5..9851a4c 100644 --- a/jquery.infinitescroll.min.js +++ b/jquery.infinitescroll.min.js @@ -11,12 +11,12 @@ */ -(function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={callback:function(){},debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",loadMsgSelector:null,loadingMsgRevealSpeed:'fast',loadingImg:"http://www.infinite-scroll.com/loading.gif",loadingText:"Loading the next set of posts...",loadingStart:undefined,loadingEnd:undefined,donetext:"Congratulations, you've reached the end of the internet.",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,orientation:'height',errorCallback:function(){},currPage:1,infid:0,isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,pixelsFromNavToBottom:undefined,pagesLoaded:null,path:undefined,loadingMsg:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;} +(function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={callback:undefined,debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",loadMsgSelector:null,loadingMsgRevealSpeed:'fast',loadingImg:"http://www.infinite-scroll.com/loading.gif",loadingText:"Loading the next set of posts...",loadingStart:undefined,loadingEnd:undefined,donetext:"Congratulations, you've reached the end of the internet.",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,orientation:'height',errorCallback:function(){},currPage:1,infid:0,isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,pixelsFromNavToBottom:undefined,pagesLoaded:null,path:undefined,loadingMsg:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;} if(binding!=='bind'&&binding!=='unbind'){this._debug('Binding value '+binding+' not valid') return false;} if(binding=='unbind'){(this.options.binder).unbind('smartscroll.infscr.'+instance.options.infid);}else{(this.options.binder)[binding]('smartscroll.infscr.'+instance.options.infid,function(){instance.scroll();});};this._debug('Binding',binding);},_create:function infscr_create(options,callback){if(!this._validate(options)){return false;} var opts=this.options=$.extend({},$.infinitescroll.defaults,options),relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr('href');opts.contentSelector=opts.contentSelector||this.element;opts.loadMsgSelector=opts.loadMsgSelector||opts.contentSelector;if(!path){this._debug('Navigation selector not found');return;} -opts.path=this._determinepath(path);opts.loadingMsg=$('
Loading...
'+opts.loadingText+'
');(new Image()).src=opts.loadingImg;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loadingStart=opts.loadingStart||function(){$(opts.navSelector).hide();opts.loadingMsg.appendTo(opts.loadMsgSelector).show(opts.loadingMsgRevealSpeed,function(){beginAjax(opts);});};opts.loadingEnd=opts.loadingEnd||function(){opts.loadingMsg.fadeOut('normal');};opts.callback=callback||function(){};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;} +opts.path=this._determinepath(path);opts.loadingMsg=$('
Loading...
'+opts.loadingText+'
');(new Image()).src=opts.loadingImg;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loadingStart=opts.loadingStart||function(){$(opts.navSelector).hide();opts.loadingMsg.appendTo(opts.loadMsgSelector).show(opts.loadingMsgRevealSpeed,function(){beginAjax(opts);});};opts.loadingEnd=opts.loadingEnd||function(){opts.loadingMsg.fadeOut('normal');};opts.callback=opts.callback||callback||function(){};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;} if(!!opts.pathParse){this._debug('pathParse manual');return opts.pathParse;}else if(path.match(/^(.*?)\b2\b(.*?$)/)){path=path.match(/^(.*?)\b2\b(.*?$)/).slice(1);}else if(path.match(/^(.*?)2(.*?$)/)){if(path.match(/^(.*?page=)2(\/.*|$)/)){path=path.match(/^(.*?page=)2(\/.*|$)/).slice(1);return path;} path=path.match(/^(.*?)2(.*?$)/).slice(1);}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path;}else{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.');opts.isInvalidPage=true;}} this._debug('determinePath',path);return path;},_error:function infscr_error(xhr){var opts=this.options;if(!!opts.behavior&&this['_error_'+opts.behavior]!==undefined){this['_error_'+opts.behavior].call(this,xhr);return;} diff --git a/wp_infinite_scroll.php b/wp_infinite_scroll.php index f3645d7..efcbd4a 100644 --- a/wp_infinite_scroll.php +++ b/wp_infinite_scroll.php @@ -4,7 +4,7 @@ Version: 2.0b2.110628 Plugin URI: http://www.infinite-scroll.com Description: Automatically loads the next page of posts into the bottom of the initial page. -Author: dirkhaim & Paul Irish & Beaver6813 +Author: dirkhaim, Paul Irish, Beaver6813 Author URI: http://www.infinite-scroll.com License : http://creativecommons.org/licenses/GPL/2.0/ @@ -206,7 +206,10 @@ function wp_inf_scroll_init() { /* I always hated the way the old plugin outputted... so did my IDE... */ echo ""; - echo ""; + if($debug=="true") + echo ""; + else + echo ""; echo "