Permalink
Browse files

Removed the conditional return statements on method.

Reason is that, we should be able to force it to scroll to the bottom.
I'm not even sure why I had it in there in the first place.

Other changes:
Changed @isDead to @stopped because the former's ambiguity.

Added method chaining for the @addEvents method and replaced 'bind' with 'on'.
Similar thing done to @removeEvents

Cleaned up code and added comments on the @reset method.

It may have added a few weight in terms of file size, but I prefer
having a comprehensive code that's easy to improve and update.

Added explanation to the formula for the scrolling mechanism in the
@scroll method.

Added makefile for development preview.

On a personal note: Seriously, good job guys. I've seen the changes and just wanna say
thank you for contributing and helping the plugin work better. Special shoutout to @kristerkari
for the continuous updates.
  • Loading branch information...
1 parent a40c7d5 commit 6ef76ca3f5098bdc244a9236ee390bc79d01098a @jamesflorentino committed May 24, 2012
Showing with 277 additions and 285 deletions.
  1. +15 −11 Cakefile
  2. +6 −0 Makefile
  3. +106 −132 bin/javascripts/jquery.nanoscroller.js
  4. +11 −11 bin/javascripts/jquery.nanoscroller.min.js
  5. +6 −5 bin/javascripts/main.js
  6. +133 −126 coffeescripts/jquery.nanoscroller.coffee
View
@@ -3,14 +3,18 @@ fs = require "fs"
closure = require "./build/closure"
task "build", "Build everything and minify", (options) ->
- exec "redcarpet README.md > bin/readme.html", () ->
- exec "coffee -c --bare --output bin/javascripts/ coffeescripts/", (err, stdout, stderr) ->
- throw err if err
- console.log stdout + stderr if (stderr? or stdout?)
- fs.readFile "bin/javascripts/jquery.nanoscroller.js", "utf-8", (errReading, data) ->
- throw errReading if errReading
- closure.compile data, (errCompiling, code) ->
- throw errCompiling if errCompiling
- fs.writeFile "bin/javascripts/jquery.nanoscroller.min.js", code, (errWriting) ->
- throw errWriting if errWriting
- console.log "Success!"
+ exec "redcarpet README.md > bin/readme.html", () ->
+ exec "coffee -c --bare --output bin/javascripts/ coffeescripts/", (err, stdout, stderr) ->
+ throw err if err
+ console.log stdout + stderr if (stderr? or stdout?)
+ fs.readFile "bin/javascripts/jquery.nanoscroller.js", "utf-8", (errReading, data) ->
+ throw errReading if errReading
+ closure.compile data, (errCompiling, code) ->
+ throw errCompiling if errCompiling
+ fs.writeFile "bin/javascripts/jquery.nanoscroller.min.js", code, (errWriting) ->
+ throw errWriting if errWriting
+ console.log "Success!"
+
+task "server", "Run a simple http server in Python for testing", (options) ->
+ console.log "Running a python server in http://localhost:8100"
+ exec "python -m SimpleHTTPServer 8100", (o) ->
View
@@ -0,0 +1,6 @@
+all:
+ cake build
+ cake server
+
+develop:
+ coffee -o bin/javascripts -wcb coffeescripts
Oops, something went wrong.

4 comments on commit 6ef76ca

Collaborator

kristerkari replied May 24, 2012

Are you sure we want .on instead of .bind ? It makes the plugin incompatible with jQuery versions older than 1.7

Hmm good call. Hang on, pushing a commit.

Committed.

Collaborator

kristerkari replied May 24, 2012

Nice, thanks!

Please sign in to comment.