Browse files

Added extensibility

version update
small extensibility sample in test
updated to jquery 1.6.1 in test
  • Loading branch information...
1 parent d3ab737 commit 43c77bcb51380f18685ff67620d9630ed7797b88 Luke Shumard committed Jun 17, 2011
Showing with 1,504 additions and 937 deletions.
  1. +6 −7 jquery.infinitescroll.js
  2. +8 −2 test/index.html
  3. +1,490 −928 test/{jquery-1.5.2.js → jquery-1.6.1.js}
View
13 jquery.infinitescroll.js
@@ -3,7 +3,7 @@
Infinite Scroll
--------------------------------
+ https://github.com/paulirish/infinitescroll
- + version 2.0b2.110603
+ + version 2.0b2.110617
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
@@ -92,6 +92,7 @@
},
+ // Fundamental aspects of the plugin are initialized
_create: function infscr_create(options, callback) {
// If selectors from options aren't valid, return false
@@ -325,16 +326,14 @@
},
+ // Behavior is determined
+ // If the behavior option is undefined, it will set to default and bind to scroll
_setup: function infscr_setup() {
var opts = this.options;
+ (!opts.behavior)? this._binding('bind') : this['_setup_'+opts.behavior]();
- // Setup binding
- // if extended, do that
- // else, do this
- if (!opts.behavior) {
- this._binding('bind');
- }
+ return false;
},
View
10 test/index.html
@@ -63,13 +63,19 @@
</div>
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.js"></script>
- <script>window.jQuery || document.write("<script src='jquery-1.5.2.js'>\x3C/script>")</script>
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
+ <script>window.jQuery || document.write("<script src='jquery-1.6.1.js'>\x3C/script>")</script>
<script src="debug.js"></script>
<script src="../jquery.infinitescroll.js"></script>
<script>
+ $.extend($.infinitescroll.prototype,{
+ _setup_twitter: function() {
+ console.log('TWITTER SETUP OMG');
+ }
+ });
+
$('#content').infinitescroll({
navSelector : "a#next:last",
View
2,418 test/jquery-1.5.2.js → test/jquery-1.6.1.js
1,490 additions, 928 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit 43c77bc

Please sign in to comment.