diff --git a/.jshintrc b/.jshintrc index 862068c59..d3eb60ed3 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,6 +1,6 @@ { "bitwise": true, - "browser" : true, + "browser": true, "camelcase": true, "curly": true, "eqeqeq": true, @@ -9,9 +9,10 @@ "latedef": true, "maxerr": 50, "noarg": true, - "node" : true, + "node": true, "noempty": true, "plusplus": false, + "quotmark": "single", "regexp": true, "strict": false, "trailing": true, diff --git a/ChangeLog.markdown b/ChangeLog.markdown index 6609c7626..f7cdfe356 100644 --- a/ChangeLog.markdown +++ b/ChangeLog.markdown @@ -2,7 +2,7 @@ ## 3.1.3 -* Include MozMousePixelScroll in the to fix list to avoid inconsistent behavior in older Firefox +* Include `MozMousePixelScroll` in the to fix list to avoid inconsistent behavior in older Firefox ## 3.1.2 @@ -40,7 +40,7 @@ ## 3.0.3 -* Added deltaX and deltaY for horizontal scrolling support (Thanks to Seamus Leahy) +* Added `deltaX` and `deltaY` for horizontal scrolling support (Thanks to Seamus Leahy) ## 3.0.2 @@ -71,7 +71,7 @@ ## 2.1.1 * Updated to work with jQuery 1.1.3 -* Used one instead of bind to do unload event for clean up. +* Used one instead of bind to do unload event for clean up ## 2.1 diff --git a/Gruntfile.js b/Gruntfile.js index 6a4d398f3..b3102a7ff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,27 +1,30 @@ module.exports = function(grunt) { - // Project configuration. - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - uglify: { - options: { - preserveComments: 'some' - }, - build: { - src: 'jquery.mousewheel.js', - dest: 'build/jquery.mousewheel.min.js' - } - }, - jshint: { - all: ['*.js'] - } - }); + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + uglify: { + options: { + preserveComments: 'some' + }, + build: { + src: 'jquery.mousewheel.js', + dest: 'build/jquery.mousewheel.min.js' + } + }, + jshint: { + options: { + jshintrc: '.jshintrc' + }, + all: ['*.js'] + } + }); - // Load the plugin that provides the "uglify" task. - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-jshint'); + // Load the plugin that provides the 'uglify' task. + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-jshint'); - // Default task(s). - grunt.registerTask('default', ['jshint', 'uglify']); + // Default task(s). + grunt.registerTask('default', ['jshint', 'uglify']); }; diff --git a/README.markdown b/README.markdown index 66086b43a..4853e06cd 100644 --- a/README.markdown +++ b/README.markdown @@ -1,13 +1,13 @@ # jQuery Mouse Wheel Plugin -A jQuery plugin that adds cross-browser mouse wheel support. +A [jQuery](http://jquery.com/) plugin that adds cross-browser mouse wheel support. In order to use the plugin, simply bind the `mousewheel` event to an element. It also provides two helper methods called `mousewheel` and `unmousewheel` that act just like other event helper methods in jQuery. The event callback receives three extra arguments which are the normalized "deltas" of the mouse wheel. -Here is an example of using both the bind and helper method syntax. +Here is an example of using both the bind and helper method syntax: ```js // using bind diff --git a/jquery.mousewheel.js b/jquery.mousewheel.js index 9d65c7162..573a44313 100755 --- a/jquery.mousewheel.js +++ b/jquery.mousewheel.js @@ -57,11 +57,11 @@ $.fn.extend({ mousewheel: function(fn) { - return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); + return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); }, unmousewheel: function(fn) { - return this.unbind("mousewheel", fn); + return this.unbind('mousewheel', fn); } }); @@ -76,7 +76,7 @@ absDeltaXY = 0, fn; event = $.event.fix(orgEvent); - event.type = "mousewheel"; + event.type = 'mousewheel'; // Old school scrollwheel delta if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta; } diff --git a/package.json b/package.json index a17cc1f1c..633fc807d 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,38 @@ { - "name" : "jquery-mousewheel", - "version": "3.1.3", -"description" : "A jQuery plugin that adds cross-browser mouse wheel support.", - "main" : "./jquery.mousewheel.js", - "repository" : { - "type" : "git", - "url" : "https://github.com/brandonaaron/jquery-mousewheel.git" - }, - "keywords" : [ "jquery", "mouse", "wheel", "event", "mousewheel", "plugin", "browser" ], - "author" : { - "name" : "Brandon Aaron", - "email" : "brandon.aaron@gmail.com", - "url" : "http://brandonaaron.net/" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/brandonaaron/jquery-mousewheel/master/LICENSE.txt" - } - ], - "devDependencies": { - "grunt-contrib-jshint": "~0.2.0", - "grunt-contrib-uglify": "~0.1.2", - "grunt": "~0.4.0" + "name": "jquery-mousewheel", + "version": "3.1.3", + "author": "Brandon Aaron (http://brandonaaron.net/)", + "description": "A jQuery plugin that adds cross-browser mouse wheel support.", + "main": "./jquery.mousewheel.js", + "repository": { + "type": "git", + "url": "https://github.com/brandonaaron/jquery-mousewheel.git" + }, + "bugs": { + "url": "https://github.com/brandonaaron/jquery-mousewheel/issues" + }, + "keywords": [ + "jquery", + "mouse", + "wheel", + "event", + "mousewheel", + "plugin", + "browser" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/brandonaaron/jquery-mousewheel/master/LICENSE.txt" } + ], + "devDependencies": { + "grunt": "~0.4.1", + "grunt-contrib-jshint": "~0.6.4", + "grunt-contrib-uglify": "~0.2.4" + }, + "readmeFilename": "README.markdown", + "directories": { + "test": "test" + } }