Permalink
Browse files

Merged PRs. Updated README badges and version number references.

1 parent e03f4df commit aed806b8d99733c9fed188e87fbdc3008c2f009e @pklauzinski committed Apr 8, 2016
Showing with 15 additions and 43 deletions.
  1. +4 −1 README.md
  2. +2 −1 bower.json
  3. +3 −3 jquery.jscroll.js
  4. +2 −34 jquery.jscroll.min.js
  5. +4 −4 package.json
View
@@ -1,11 +1,14 @@
# jScroll - jQuery Plugin for Infinite Scrolling / Auto-Paging
+[![Build Status](https://travis-ci.org/pklauzinski/jscroll.svg?branch=master)](https://travis-ci.org/pklauzinski/jscroll)
+[![npm version](https://img.shields.io/npm/v/jscroll.svg)](https://www.npmjs.com/package/jscroll)
+[![Bower version](https://img.shields.io/bower/v/jscroll.svg)](https://github.com/pklauzinski/jscroll)
[![Join the chat at https://gitter.im/pklauzinski/jscroll](https://badges.gitter.im/pklauzinski/jscroll.svg)](https://gitter.im/pklauzinski/jscroll?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Official site at [jscroll.com](http://jscroll.com/).
* Copyright © 2011-2015, [Philip Klauzinski](http://gui.ninja)
-* Current Version: 2.3.4
+* Current Version: 2.3.5
* Dual licensed under the MIT and GPL Version 2 licenses.
* http://jscroll.com/#license
* http://www.opensource.org/licenses/mit-license.php
View
@@ -1,6 +1,6 @@
{
"name": "jscroll",
- "version": "2.3.4",
+ "version": "2.3.5",
"homepage": "http://jscroll.com",
"authors": [
{
@@ -20,6 +20,7 @@
"jscroll",
"infinite-scroll",
"infinite-scrolling",
+ "infinite-ajax-scroll",
"jquery-scrolling",
"ajax-scrolling",
"scrolling",
View
@@ -10,7 +10,7 @@
* http://www.gnu.org/licenses/gpl-2.0.html
*
* @author Philip Klauzinski
- * @version 2.3.4
+ * @version 2.3.5
* @requires jQuery v1.4.3+
* @preserve
*/
@@ -97,12 +97,12 @@
iTopHeight = _isWindow ? _$scroll.scrollTop() : $e.offset().top,
innerTop = $inner.length ? $inner.offset().top : 0,
iTotalHeight = Math.ceil(iTopHeight - innerTop + _$scroll.height() + iContainerTop);
-
+
if (!data.waiting && iTotalHeight + _options.padding >= $inner.outerHeight()) {
//data.nextHref = $.trim(data.nextHref + ' ' + _options.contentSelector);
_debug('info', 'jScroll:', $inner.outerHeight() - iTotalHeight, 'from bottom. Loading next request...');
return _load();
- }
+ }
}
},
View
@@ -10,40 +10,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html
*
* @author Philip Klauzinski
- * @version 2.3.4
+ * @version 2.3.5
* @requires jQuery v1.4.3+
* @preserve
*/
-!function(a){"use strict";
-// Define the jscroll namespace and default settings
-a.jscroll={defaults:{debug:!1,autoTrigger:!0,autoTriggerUntil:!1,loadingHtml:"<small>Loading...</small>",loadingFunction:!1,padding:0,nextSelector:"a:last",contentSelector:"",pagingSelector:"",callback:!1}};
-// Constructor
-var b=function(b,c){
-// Private vars and methods
-var d=b.data("jscroll"),e="function"==typeof c?{callback:c}:c,f=a.extend({},a.jscroll.defaults,e,d||{}),g="visible"===b.css("overflow-y"),h=b.find(f.nextSelector).first(),i=a(window),j=a("body"),k=g?i:b,l=a.trim(h.attr("href")+" "+f.contentSelector),
-// Check if a loading image is defined and preload
-m=function(){var b=a(f.loadingHtml).filter("img").attr("src");if(b){var c=new Image;c.src=b}},
-// Wrap inner content, if it isn't already
-n=function(){b.find(".jscroll-inner").length||b.contents().wrapAll('<div class="jscroll-inner" />')},
-// Find the next link's parent, or add one, and hide it
-o=function(a){var b;f.pagingSelector?a.closest(f.pagingSelector).hide():(b=a.parent().not(".jscroll-inner,.jscroll-added").addClass("jscroll-next-parent").hide(),b.length||a.wrap('<div class="jscroll-next-parent" />').parent().hide())},
-// Remove the jscroll behavior and data from an element
-p=function(){return k.unbind(".jscroll").removeData("jscroll").find(".jscroll-inner").children().unwrap().filter(".jscroll-added").children().unwrap()},
-// Observe the scroll event for when to trigger the next load
-q=function(){n();var a=b.find("div.jscroll-inner").first(),c=b.data("jscroll"),d=parseInt(b.css("borderTopWidth"),10),e=isNaN(d)?0:d,h=parseInt(b.css("paddingTop"),10)+e,i=g?k.scrollTop():b.offset().top,j=a.length?a.offset().top:0,l=Math.ceil(i-j+k.height()+h);
-//data.nextHref = $.trim(data.nextHref + ' ' + _options.contentSelector);
-return!c.waiting&&l+f.padding>=a.outerHeight()?(u("info","jScroll:",a.outerHeight()-l,"from bottom. Loading next request..."),t()):void 0},
-// Check if the href for the next set of content has been set
-r=function(a){return a=a||b.data("jscroll"),a&&a.nextHref?(s(),!0):(u("warn","jScroll: nextSelector not found - destroying"),p(),!1)},s=function(){var c=b.find(f.nextSelector).first();if(c.length)if(f.autoTrigger&&(f.autoTriggerUntil===!1||f.autoTriggerUntil>0)){o(c);var d=j.height()-b.offset().top,e=b.height()<d?b.height():d,g=b.offset().top-i.scrollTop()>0?i.height()-(b.offset().top-a(window).scrollTop()):i.height();g>=e&&q(),k.unbind(".jscroll").bind("scroll.jscroll",function(){return q()}),f.autoTriggerUntil>0&&f.autoTriggerUntil--}else k.unbind(".jscroll"),c.bind("click.jscroll",function(){return o(c),t(),!1})},
-// Load the next set of content, if available
-t=function(){var c=b.find("div.jscroll-inner").first(),d=b.data("jscroll");return d.waiting=!0,c.append('<div class="jscroll-added" />').children(".jscroll-added").last().html('<div class="jscroll-loading" id="jscroll-loading">'+f.loadingHtml+"</div>").promise().done(function(){f.loadingFunction&&f.loadingFunction()}),b.animate({scrollTop:c.outerHeight()},0,function(){c.find("div.jscroll-added").last().load(d.nextHref,function(c,e){if("error"===e)return p();var g=a(this).find(f.nextSelector).first();d.waiting=!1,d.nextHref=g.attr("href")?a.trim(g.attr("href")+" "+f.contentSelector):!1,a(".jscroll-next-parent",b).remove(),// Remove the previous next link now that we have a new one
-r(),f.callback&&f.callback.call(this),u("dir",d)})})},
-// Safe console debug - http://klauzinski.com/javascript/safe-firebug-console-in-javascript
-u=function(a){if(f.debug&&"object"==typeof console&&("object"==typeof a||"function"==typeof console[a]))if("object"==typeof a){var b=[];for(var c in a)"function"==typeof console[c]?(b=a[c].length?a[c]:[a[c]],console[c].apply(console,b)):console.log.apply(console,b)}else console[a].apply(console,Array.prototype.slice.call(arguments,1))};
-// Initialization
-// Expose API methods via the jQuery.jscroll namespace, e.g. $('sel').jscroll.method()
-return b.data("jscroll",a.extend({},d,{initialized:!0,waiting:!1,nextHref:l})),n(),m(),s(),a.extend(b.jscroll,{destroy:p}),b};
-// Define the jscroll plugin method and loop
-a.fn.jscroll=function(c){return this.each(function(){var d,e=a(this),f=e.data("jscroll");
-// Instantiate jScroll on this element if it hasn't been already
-f&&f.initialized||(d=new b(e,c))})}}(jQuery);
+!function(a){"use strict";a.jscroll={defaults:{debug:!1,autoTrigger:!0,autoTriggerUntil:!1,loadingHtml:"<small>Loading...</small>",loadingFunction:!1,padding:0,nextSelector:"a:last",contentSelector:"",pagingSelector:"",callback:!1}};var b=function(b,c){var d=b.data("jscroll"),e="function"==typeof c?{callback:c}:c,f=a.extend({},a.jscroll.defaults,e,d||{}),g="visible"===b.css("overflow-y"),h=b.find(f.nextSelector).first(),i=a(window),j=a("body"),k=g?i:b,l=a.trim(h.attr("href")+" "+f.contentSelector),m=function(){var b=a(f.loadingHtml).filter("img").attr("src");if(b){var c=new Image;c.src=b}},n=function(){b.find(".jscroll-inner").length||b.contents().wrapAll('<div class="jscroll-inner" />')},o=function(a){var b;f.pagingSelector?a.closest(f.pagingSelector).hide():(b=a.parent().not(".jscroll-inner,.jscroll-added").addClass("jscroll-next-parent").hide(),b.length||a.wrap('<div class="jscroll-next-parent" />').parent().hide())},p=function(){return k.unbind(".jscroll").removeData("jscroll").find(".jscroll-inner").children().unwrap().filter(".jscroll-added").children().unwrap()},q=function(){if(b.is(":visible")){n();var a=b.find("div.jscroll-inner").first(),c=b.data("jscroll"),d=parseInt(b.css("borderTopWidth"),10),e=isNaN(d)?0:d,h=parseInt(b.css("paddingTop"),10)+e,i=g?k.scrollTop():b.offset().top,j=a.length?a.offset().top:0,l=Math.ceil(i-j+k.height()+h);if(!c.waiting&&l+f.padding>=a.outerHeight())return u("info","jScroll:",a.outerHeight()-l,"from bottom. Loading next request..."),t()}},r=function(a){return a=a||b.data("jscroll"),a&&a.nextHref?(s(),!0):(u("warn","jScroll: nextSelector not found - destroying"),p(),!1)},s=function(){var c=b.find(f.nextSelector).first();if(c.length)if(f.autoTrigger&&(f.autoTriggerUntil===!1||f.autoTriggerUntil>0)){o(c);var d=j.height()-b.offset().top,e=b.height()<d?b.height():d,g=b.offset().top-i.scrollTop()>0?i.height()-(b.offset().top-a(window).scrollTop()):i.height();g>=e&&q(),k.unbind(".jscroll").bind("scroll.jscroll",function(){return q()}),f.autoTriggerUntil>0&&f.autoTriggerUntil--}else k.unbind(".jscroll"),c.bind("click.jscroll",function(){return o(c),t(),!1})},t=function(){var c=b.find("div.jscroll-inner").first(),d=b.data("jscroll");return d.waiting=!0,c.append('<div class="jscroll-added" />').children(".jscroll-added").last().html('<div class="jscroll-loading" id="jscroll-loading">'+f.loadingHtml+"</div>").promise().done(function(){f.loadingFunction&&f.loadingFunction()}),b.animate({scrollTop:c.outerHeight()},0,function(){c.find("div.jscroll-added").last().load(d.nextHref,function(c,e){if("error"===e)return p();var g=a(this).find(f.nextSelector).first();d.waiting=!1,d.nextHref=g.attr("href")?a.trim(g.attr("href")+" "+f.contentSelector):!1,a(".jscroll-next-parent",b).remove(),r(),f.callback&&f.callback.call(this),u("dir",d)})})},u=function(a){if(f.debug&&"object"==typeof console&&("object"==typeof a||"function"==typeof console[a]))if("object"==typeof a){var b=[];for(var c in a)"function"==typeof console[c]?(b=a[c].length?a[c]:[a[c]],console[c].apply(console,b)):console.log.apply(console,b)}else console[a].apply(console,Array.prototype.slice.call(arguments,1))};return b.data("jscroll",a.extend({},d,{initialized:!0,waiting:!1,nextHref:l})),n(),m(),s(),a.extend(b.jscroll,{destroy:p}),b};a.fn.jscroll=function(c){return this.each(function(){var d,e=a(this),f=e.data("jscroll");f&&f.initialized||(d=new b(e,c))})}}(jQuery);
View
@@ -1,6 +1,6 @@
{
"name": "jscroll",
- "version": "2.3.4",
+ "version": "2.3.5",
"description": "jQuery plugin for infinite scrolling / auto-paging.",
"main": "jquery.jscroll.js",
"scripts": {
@@ -31,11 +31,11 @@
},
"homepage": "http://jscroll.com",
"dependencies": {
- "jQuery": ">=1.4.3"
+ "jquery": "^1.7.4"
},
"devDependencies": {
"grunt": "^0.4.5",
- "grunt-contrib-jshint": "^0.11.1",
- "grunt-contrib-uglify": "^0.9.1"
+ "grunt-contrib-jshint": "^0.11.3",
+ "grunt-contrib-uglify": "^0.9.2"
}
}

0 comments on commit aed806b

Please sign in to comment.