From d0b926b80b44ecf84b6cf6d6ce15519bb1943cbe Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 29 May 2013 19:34:30 +0300 Subject: [PATCH 1/7] Normalize package.json and add missing properties. Also refactor the properties in a more sane way. --- package.json | 59 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index a17cc1f1c..d8f5abea3 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-contrib-jshint": "~0.4.3", + "grunt-contrib-uglify": "~0.2.0", + "grunt": "~0.4.1" + }, + "readmeFilename": "README.markdown", + "directories": { + "test": "test" + } } From ad29b7e8705e845adca44198844f327c070367e9 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 7 Sep 2013 10:25:55 +0300 Subject: [PATCH 2/7] Update dependencies. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d8f5abea3..633fc807d 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,9 @@ } ], "devDependencies": { - "grunt-contrib-jshint": "~0.4.3", - "grunt-contrib-uglify": "~0.2.0", - "grunt": "~0.4.1" + "grunt": "~0.4.1", + "grunt-contrib-jshint": "~0.6.4", + "grunt-contrib-uglify": "~0.2.4" }, "readmeFilename": "README.markdown", "directories": { From 9602df3f7003625e6544a9d32fe35c19469f32c3 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 10 Sep 2013 10:26:28 +0300 Subject: [PATCH 3/7] Update docs. Use code syntax in more places and link to jquery. --- ChangeLog.markdown | 6 +++--- README.markdown | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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/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 From 26b1117f9433cb13adc6a6889d273a43f1a5b50a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 10 Sep 2013 10:37:42 +0300 Subject: [PATCH 4/7] Use single quotes consistently. --- .jshintrc | 1 + Gruntfile.js | 2 +- jquery.mousewheel.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.jshintrc b/.jshintrc index 862068c59..6025094ce 100644 --- a/.jshintrc +++ b/.jshintrc @@ -11,6 +11,7 @@ "noarg": true, "node" : true, "noempty": true, + "quotmark": "single", "plusplus": false, "regexp": true, "strict": false, diff --git a/Gruntfile.js b/Gruntfile.js index 6a4d398f3..fff8672c7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,7 +17,7 @@ module.exports = function(grunt) { } }); - // Load the plugin that provides the "uglify" task. + // Load the plugin that provides the 'uglify' task. grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); 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; } From d6941b9ed7960eca5b9149368f45dfc6bfe6b392 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 10 Sep 2013 10:41:10 +0300 Subject: [PATCH 5/7] Fix loading JSHint options. --- Gruntfile.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index fff8672c7..80633c8f0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,6 +13,9 @@ module.exports = function(grunt) { } }, jshint: { + options: { + jshintrc: '.jshintrc' + }, all: ['*.js'] } }); From c60712d15033fdf8242aedf46e821cee8abf5396 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 10 Sep 2013 10:48:18 +0300 Subject: [PATCH 6/7] Gruntfile.js: Fix JSHint issues. --- Gruntfile.js | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 80633c8f0..b3102a7ff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,30 +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: { - options: { - jshintrc: '.jshintrc' - }, - 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']); }; From b1dad433fbf5c3431a97e292ec8ff8c336d5cc64 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 10 Sep 2013 10:45:22 +0300 Subject: [PATCH 7/7] Normalize .jshintrc. --- .jshintrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.jshintrc b/.jshintrc index 6025094ce..d3eb60ed3 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,6 +1,6 @@ { "bitwise": true, - "browser" : true, + "browser": true, "camelcase": true, "curly": true, "eqeqeq": true, @@ -9,10 +9,10 @@ "latedef": true, "maxerr": 50, "noarg": true, - "node" : true, + "node": true, "noempty": true, - "quotmark": "single", "plusplus": false, + "quotmark": "single", "regexp": true, "strict": false, "trailing": true,