diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb
index a11af53b8..7a8377a34 100644
--- a/features/step_definitions/custom_web_steps.rb
+++ b/features/step_definitions/custom_web_steps.rb
@@ -195,5 +195,6 @@ end
And /^I scroll down$/ do
evaluate_script("window.scrollBy(0,3000000)")
+ sleep 1
wait_until(10) { evaluate_script('$("#infscr-loading:visible").length') == 0 }
end
diff --git a/public/javascripts/vendor/jquery.infinitescroll.min.js b/public/javascripts/vendor/jquery.infinitescroll.min.js
index c092afa69..5249dec6c 100644
--- a/public/javascripts/vendor/jquery.infinitescroll.min.js
+++ b/public/javascripts/vendor/jquery.infinitescroll.min.js
@@ -1,9 +1,8 @@
/*!
// Infinite Scroll jQuery plugin
// copyright Paul Irish, licensed GPL & MIT
-// version 1.5.101207
+// version 2.0b1.110420
// home and docs: http://www.infinite-scroll.com
*/
-(function($){$.fn.infinitescroll=function(options,callback){function debug(){if(opts.debug){window.console&&console.log.call(console,arguments)}}function areSelectorsValid(opts){for(var key in opts){if(key.indexOf&&key.indexOf("Selector")>-1&&$(opts[key]).length===0){debug("Your "+key+" found no elements.");return false}return true}}function determinePath(path){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}debug("Trying backup next selector parse technique. Treacherous waters here, matey.");path=path.match(/^(.*?)2(.*?$)/).slice(1)}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path}if($.isFunction(opts.pathParse)){return[path]}else{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.");props.isInvalidPage=true}}}return path}function filterNav(){opts.isFiltered=true;return $(window).trigger("error.infscr."+opts.infid,[302])}function isNearBottom(){var pixelsFromWindowBottomToBottom=0+$(document).height()-($(props.container).scrollTop()||$(props.container.ownerDocument.body).scrollTop())-$(window).height();debug("math:",pixelsFromWindowBottomToBottom,props.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx"):$("
");frag=document.createDocumentFragment();if($.isFunction(opts.pathParse)){desturl=opts.pathParse(path.join("2"),opts.currPage)}else{desturl=path.join(opts.currPage)}box.load(desturl+" "+opts.itemSelector,null,loadCallback)})}function loadCallback(){if(opts.isDone){showDoneMsg();return false}else{var children=box.children();if(children.length==0||children.hasClass("error404")){return $(window).trigger("error.infscr."+opts.infid,[404])}while(box[0].firstChild){frag.appendChild(box[0].firstChild)}$(opts.contentSelector)[0].appendChild(frag);props.loadingMsg.fadeOut("normal");if(opts.animate){var scrollTo=$(window).scrollTop()+$("#infscr-loading").height()+opts.extraScrollPx+"px";$("html,body").animate({scrollTop:scrollTo},800,function(){opts.isDuringAjax=false})}callback.call($(opts.contentSelector)[0],children.get());if(!opts.animate){opts.isDuringAjax=false}}}function initPause(pauseValue){if(pauseValue=="pause"){opts.isPaused=true}else{if(pauseValue=="resume"){opts.isPaused=false}else{opts.isPaused=!opts.isPaused}}debug("Paused: "+opts.isPaused);return false}function infscrError(xhr){if(!opts.isDone&&xhr==404){debug("Page not found. Self-destructing...");showDoneMsg();opts.isDone=true;opts.currPage=1;$(window).unbind("scroll.infscr."+opts.infid);$(document).unbind("retrieve.infscr."+opts.infid)}if(opts.isFiltered&&xhr==302){debug("Filtered. Going to next instance...");opts.isDone=true;opts.currPage=1;opts.isPaused=false;$(window).unbind("scroll.infscr."+opts.infid,infscrSetup).unbind("pause.infscr."+opts.infid).unbind("filter.infscr."+opts.infid).unbind("error.infscr."+opts.infid);$(document).unbind("retrieve.infscr."+opts.infid,kickOffAjax)}}$.browser.ie6=$.browser.msie&&$.browser.version<7;var opts=$.extend({},$.infinitescroll.defaults,options),props=$.infinitescroll,box,frag,desturl,thisPause,errorStatus;callback=callback||function(){};if(!areSelectorsValid(opts)){return false}props.container=document.documentElement;opts.contentSelector=opts.contentSelector||this;opts.loadMsgSelector=opts.loadMsgSelector||opts.contentSelector;var relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr("href");if(!path){debug("Navigation selector not found");return}path=determinePath(path);props.pixelsFromNavToBottom=$(document).height()+(props.container==document.documentElement?0:$(props.container).offset().top)-$(opts.navSelector).offset().top;props.loadingMsg=$('
'+opts.loadingText+"
");(new Image()).src=opts.loadingImg;$(window).bind("scroll.infscr."+opts.infid,infscrSetup).bind("filter.infscr."+opts.infid,filterNav).bind("error.infscr."+opts.infid,function(event,errorStatus){infscrError(errorStatus)}).bind("pause.infscr."+opts.infid,function(event,thisPause){initPause(thisPause)}).trigger("scroll.infscr."+opts.infid);$(document).bind("retrieve.infscr."+opts.infid,kickOffAjax);return this};$.infinitescroll={defaults:{debug:false,preload:false,nextSelector:"div.navigation a:first",loadingImg:"http://www.infinite-scroll.com/loading.gif",loadingText:"Loading the next set of posts...",donetext:"Congratulations, you've reached the end of the internet.",navSelector:"div.navigation",contentSelector:null,loadMsgSelector:null,loadingMsgRevealSpeed:"fast",extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,bufferPx:40,errorCallback:function(){},infid:1,currPage:1,isDuringAjax:false,isInvalidPage:false,isFiltered:false,isDone:false,isPaused:false},loadingImg:undefined,loadingMsg:undefined,container:undefined,currDOMChunk:null}})(jQuery);
-
+(function($){$.fn.infinitescroll=function infscr(options,callback){function areSelectorsValid(opts){var debug=$.fn.infinitescroll._debug;for(var key in opts){if(key.indexOf&&key.indexOf("Selector")>-1&&$(opts[key]).length===0){debug("Your "+key+" found no elements.");return false}return true}}function determinePath(path){if($.isFunction(opts.pathParse)){debug("pathParse");return[path]}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{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.");props.isInvalidPage=true}}}}debug("determinePath",path);return path}function hiddenHeight(element){var height=0;$(element).children().each(function(){height=height+$(this).outerHeight(false)});return height}function generateInstanceID(element){var number=$(element).length+$(element).html().length+$(element).attr("class").length+$(element).attr("id").length;opts.infid=number}if(typeof options=="string"){var command=options,argument=callback,validCommand=(command=="pause"||command=="destroy"||command=="retrieve"||command=="binding"),debug=$.fn.infinitescroll._debug;argument=argument||null;command=(validCommand)?$.fn.infinitescroll[command](argument):debug("Invalid command");return false}var opts=$.infinitescroll.opts=$.extend({},$.infinitescroll.defaults,options),props=$.infinitescroll,innerContainerHeight,box,frag,desturl,pause,error,errorStatus,method,result;callback=$.fn.infinitescroll._callback=callback||function(){},debug=$.fn.infinitescroll._debug,error=$.fn.infinitescroll._error,pause=$.fn.infinitescroll.pause,destroy=$.fn.infinitescroll.destroy,binding=$.fn.infinitescroll.binding;if(!areSelectorsValid(opts)){return false}opts.container=opts.container||document.documentElement;opts.contentSelector=opts.contentSelector||this;opts.infid=(opts.infid==0)?generateInstanceID(opts.contentSelector):opts.infid;opts.loadMsgSelector=opts.loadMsgSelector||opts.contentSelector;var relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr("href");if(!path){debug("Navigation selector not found");return}opts.path=determinePath(path);props.loadingMsg=$('
'+opts.loadingText+"
");(new Image()).src=opts.loadingImg;opts.binder=(opts.container.nodeName=="HTML")?$(window):$(opts.container);innerContainerHeight=(opts.container.nodeName=="HTML")?$(document).height():innerContainerHeight=hiddenHeight(opts.container);debug("Scrolling in: ",(opts.container.nodeName=="HTML")?"window":opts.container);opts.pixelsFromNavToBottom=innerContainerHeight+(opts.container==document.documentElement?0:$(opts.container).offset().top)-$(opts.navSelector).offset().top;binding("bind");opts.binder.trigger("smartscroll.infscr."+opts.infid);return this};$.infinitescroll={defaults:{debug:false,binder:$(window),preload:false,nextSelector:"div.navigation a:first",loadingImg:"http://www.infinite-scroll.com/loading.gif",loadingText:"Loading the next set of posts...",donetext:"Congratulations, you've reached the end of the internet.",navSelector:"div.navigation",contentSelector:null,loadMsgSelector:null,loadingMsgRevealSpeed:"fast",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,container:undefined,pixelsFromNavToBottom:undefined,path:undefined},loadingImg:undefined,loadingMsg:undefined,currDOMChunk:null};$.fn.infinitescroll._debug=function infscr_debug(){if($.infinitescroll.opts.debug){return window.console&&console.log.call(console,arguments)}};$.fn.infinitescroll._shorthand=function infscr_shorthand(){};$.fn.infinitescroll._nearbottom=function infscr_nearbottom(){var opts=$.infinitescroll.opts,debug=$.fn.infinitescroll._debug,hiddenHeight=$.fn.infinitescroll._hiddenheight;if(opts.container.nodeName=="HTML"){var pixelsFromWindowBottomToBottom=0+$(document).height()-($(opts.container).scrollTop()||$(opts.container.ownerDocument.body).scrollTop())-$(window).height()}else{var pixelsFromWindowBottomToBottom=0+hiddenHeight(opts.container)-$(opts.container).scrollTop()-$(opts.container).height()}debug("math:",pixelsFromWindowBottomToBottom,opts.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx"):$("");desturl=($.isFunction(opts.pathParse))?opts.pathParse(path.join("2"),opts.currPage):desturl=path.join(opts.currPage);method=(opts.dataType=="html"||opts.dataType=="json")?opts.dataType:"html+callback";if(opts.appendCallback&&opts.dataType=="html"){method+="+callback"}switch(method){case"html+callback":debug("Using HTML via .load() method");box.load(desturl+" "+opts.itemSelector,null,function(jqXHR,textStatus){loadCallback(box,jqXHR.responseText)});break;case"html":case"json":debug("Using "+(method.toUpperCase())+" via $.ajax() method");$.ajax({url:desturl,dataType:opts.dataType,complete:function _infscrAjax(jqXHR,textStatus){condition=(typeof(jqXHR.isResolved)!=="undefined")?(jqXHR.isResolved()):(textStatus==="success"||textStatus==="notmodified");(condition)?loadCallback(box,jqXHR.responseText):error([404])}});break}})};$.fn.infinitescroll._loadcallback=function infscr_loadcallback(box,data){var props=$.infinitescroll,opts=$.infinitescroll.opts,error=$.fn.infinitescroll._error,showDoneMsg=$.fn.infinitescroll._donemsg,callback=$.fn.infinitescroll._callback,result,frag;result=(opts.isDone)?"done":(!opts.appendCallback)?"no-append":"append";switch(result){case"done":showDoneMsg();return false;break;case"no-append":if(opts.dataType=="html"){data=""+data+"
";data=$(data).find(opts.itemSelector)}break;case"append":var children=box.children();if(children.length==0||children.hasClass("error404")){return error([404])}frag=document.createDocumentFragment();while(box[0].firstChild){frag.appendChild(box[0].firstChild)}$(opts.contentSelector)[0].appendChild(frag);data=children.get();break}props.loadingMsg.fadeOut("normal");if(opts.animate){var scrollTo=$(window).scrollTop()+$("#infscr-loading").height()+opts.extraScrollPx+"px";$("html,body").animate({scrollTop:scrollTo},800,function(){opts.isDuringAjax=false})}if(!opts.animate){opts.isDuringAjax=false}callback.call($(opts.contentSelector)[0],data)};$.fn.infinitescroll._donemsg=function infscr_donemsg(){var props=$.infinitescroll,opts=$.infinitescroll.opts;props.loadingMsg.find("img").hide().parent().find("div").html(opts.donetext).animate({opacity:1},2000,function(){$(this).parent().fadeOut("normal")});opts.errorCallback()};$.fn.infinitescroll.pause=function infscr_pause(pause){var debug=$.fn.infinitescroll._debug,opts=$.infinitescroll.opts;if(pause!=="pause"&&pause!=="resume"&&pause!=="toggle"&&pause!==null){debug("Invalid argument. Toggling pause value instead")}pause=(pause&&(pause=="pause"||pause=="resume"))?pause:"toggle";switch(pause){case"pause":opts.isPaused=true;break;case"resume":opts.isPaused=false;break;case"toggle":opts.isPaused=!opts.isPaused;break}debug("Paused",opts.isPaused);return false};$.fn.infinitescroll._error=function infscr_error(xhr){var opts=$.infinitescroll.opts,binder=(opts.container.nodeName=="HTML")?$(window):$(opts.container),debug=$.fn.infinitescroll._debug,showDoneMsg=$.fn.infinitescroll._donemsg,error=(!opts.isDone&&xhr==404)?"end":(opts.isDestroyed&&xhr==302)?"destroy":"unknown";switch(error){case"end":debug("Page not found. Self-destructing...");showDoneMsg();opts.isDone=true;opts.currPage=1;opts.isPaused=false;binder.unbind("smartscroll.infscr."+opts.infid);break;case"destroy":debug("Destroyed. Going to next instance...");opts.isDone=true;opts.currPage=1;opts.isPaused=false;binder.unbind("smartscroll.infscr."+opts.infid);break;case"unknown":debug("Unknown Error. WHAT DID YOU DO?!...");showDoneMsg();opts.isDone=true;opts.currPage=1;binder.unbind("smartscroll.infscr."+opts.infid);break}};$.fn.infinitescroll.destroy=function infscr_destroy(){var opts=$.infinitescroll.opts,error=$.fn.infinitescroll._error;opts.isDestroyed=true;return error([302])};$.fn.infinitescroll.binding=function infscr_binding(binding){var opts=$.infinitescroll.opts,setup=$.fn.infinitescroll._setup,error=$.fn.infinitescroll._error,debug=$.fn.infinitescroll._debug;switch(binding){case"bind":opts.binder.bind("smartscroll.infscr."+opts.infid,setup);break;case"unbind":opts.binder.unbind("smartscroll.infscr."+opts.infid);break}debug("Binding",binding);return false};var event=$.event,scrollTimeout;event.special.smartscroll={setup:function(){$(this).bind("scroll",event.special.smartscroll.handler)},teardown:function(){$(this).unbind("scroll",event.special.smartscroll.handler)},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartscroll";if(scrollTimeout){clearTimeout(scrollTimeout)}scrollTimeout=setTimeout(function(){jQuery.event.handle.apply(context,args)},execAsap==="execAsap"?0:100)}};$.fn.smartscroll=function(fn){return fn?this.bind("smartscroll",fn):this.trigger("smartscroll",["execAsap"])}})(jQuery);
\ No newline at end of file