diaspora/public/javascripts/infinite_scroll.js
2011-04-07 15:00:57 -07:00

23 lines
815 B
JavaScript

var InfiniteScroll = {
options: {
navSelector : "#pagination",
// selector for the paged navigation (it will be hidden)
nextSelector : ".paginate",
// selector for the NEXT link (to page 2)
itemSelector : ".stream_element",
// selector for all items you'll retrieve
pathParse : function( pathStr, nextPage ){
var newPath = pathStr.replace("?", "?only_posts=true&");
return newPath.replace( "page=2", "page=" + nextPage);
},
bufferPx: 500,
debug: false,
donetext: "no more.",
loadingText: "",
loadingImg: '/images/ajax-loader.gif'
},
postScrollCallback: function(){},
initialize: function(){
$('#main_stream').infinitescroll(InfiniteScroll.options, InfiniteScroll.postScrollCallback);
}
}