]> source.dussan.org Git - jquery-ui.git/commitdiff
Slider: Update to latest mousewheel plugin
authorjzaefferer <joern.zaefferer@gmail.com>
Tue, 26 Oct 2010 08:53:03 +0000 (10:53 +0200)
committerjzaefferer <joern.zaefferer@gmail.com>
Tue, 26 Oct 2010 08:53:03 +0000 (10:53 +0200)
demos/spinner/currency.html
demos/spinner/decimal.html
demos/spinner/default.html
demos/spinner/latlong.html
demos/spinner/rtl.html
external/jquery.mousewheel-3.0.2.js [deleted file]
external/jquery.mousewheel-3.0.4.js [new file with mode: 0644]
tests/unit/spinner/spinner.html

index 418dca228089de54b48f9e9e67a2e15d180f0c0e..0909f4ef57ec697a249256ef65779d21bf5fe02f 100644 (file)
@@ -5,7 +5,7 @@
        <title>jQuery UI Spinner - Default functionality</title>\r
        <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />\r
        <script type="text/javascript" src="../../jquery-1.4.3.js"></script>\r
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.2.js"></script>\r
+       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>\r
        <script type="text/javascript" src="../../external/glob.js"></script>\r
        <script type="text/javascript" src="../../external/glob.de-DE.js"></script>\r
        <script type="text/javascript" src="../../external/glob.ja-JP.js"></script>\r
index 82d0fcc201bd108740fbe9a1cdc3d471901c681a..c472515526fa90c581fd2ccd3524217de83baa0e 100644 (file)
@@ -5,7 +5,7 @@
        <title>jQuery UI Spinner - decimal</title>\r
        <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />\r
        <script type="text/javascript" src="../../jquery-1.4.3.js"></script>\r
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.2.js"></script>\r
+       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>\r
        <script type="text/javascript" src="../../external/glob.js"></script>\r
        <script type="text/javascript" src="../../external/glob.de-DE.js"></script>\r
        <script type="text/javascript" src="../../external/glob.ja-JP.js"></script>\r
index d90b73f6d6633360cde67edcd47ff6a1d33c6200..b0f62308d7e40c7fd01229a7b6843d0b65ab9933 100644 (file)
@@ -5,7 +5,7 @@
        <title>jQuery UI Spinner - Default functionality</title>\r
        <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />\r
        <script type="text/javascript" src="../../jquery-1.4.3.js"></script>\r
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.2.js"></script>\r
+       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>\r
index 6b955ba476e244ac9f710a8a70e5d92d706d7896..7c0c9b21a6e55f27200acc978a159d54eeb01389 100644 (file)
@@ -6,7 +6,7 @@
        <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />\r
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>\r
        <script type="text/javascript" src="../../jquery-1.4.3.js"></script>\r
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.2.js"></script>\r
+       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>\r
index 52d7b10486f8d704ea465c7ed86fd7d048e1f300..93a2022ffe474dc627533636b8729d71cedcd9ed 100644 (file)
@@ -5,7 +5,7 @@
        <title>jQuery UI Spinner - Default functionality</title>\r
        <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />\r
        <script type="text/javascript" src="../../jquery-1.4.3.js"></script>\r
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.2.js"></script>\r
+       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>\r
        <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>\r
diff --git a/external/jquery.mousewheel-3.0.2.js b/external/jquery.mousewheel-3.0.2.js
deleted file mode 100644 (file)
index 507ab00..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)\r
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)\r
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.\r
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.\r
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.\r
- *\r
- * Version: 3.0.2\r
- * \r
- * Requires: 1.2.2+\r
- */\r
-\r
-(function($) {\r
-\r
-var types = ['DOMMouseScroll', 'mousewheel'];\r
-\r
-$.event.special.mousewheel = {\r
-       setup: function() {\r
-               if ( this.addEventListener )\r
-                       for ( var i=types.length; i; )\r
-                               this.addEventListener( types[--i], handler, false );\r
-               else\r
-                       this.onmousewheel = handler;\r
-       },\r
-       \r
-       teardown: function() {\r
-               if ( this.removeEventListener )\r
-                       for ( var i=types.length; i; )\r
-                               this.removeEventListener( types[--i], handler, false );\r
-               else\r
-                       this.onmousewheel = null;\r
-       }\r
-};\r
-\r
-$.fn.extend({\r
-       mousewheel: function(fn) {\r
-               return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");\r
-       },\r
-       \r
-       unmousewheel: function(fn) {\r
-               return this.unbind("mousewheel", fn);\r
-       }\r
-});\r
-\r
-\r
-function handler(event) {\r
-       var args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true;\r
-       \r
-       event = $.event.fix(event || window.event);\r
-       event.type = "mousewheel";\r
-       \r
-       if ( event.wheelDelta ) delta = event.wheelDelta/120;\r
-       if ( event.detail     ) delta = -event.detail/3;\r
-       \r
-       // Add events and delta to the front of the arguments\r
-       args.unshift(event, delta);\r
-\r
-       return $.event.handle.apply(this, args);\r
-}\r
-\r
-})(jQuery);
\ No newline at end of file
diff --git a/external/jquery.mousewheel-3.0.4.js b/external/jquery.mousewheel-3.0.4.js
new file mode 100644 (file)
index 0000000..dbf8f4b
--- /dev/null
@@ -0,0 +1,78 @@
+/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)\r
+ * Licensed under the MIT License (LICENSE.txt).\r
+ *\r
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.\r
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.\r
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY\r
+ *\r
+ * Version: 3.0.4\r
+ * \r
+ * Requires: 1.2.2+\r
+ */\r
+\r
+(function($) {\r
+\r
+var types = ['DOMMouseScroll', 'mousewheel'];\r
+\r
+$.event.special.mousewheel = {\r
+    setup: function() {\r
+        if ( this.addEventListener ) {\r
+            for ( var i=types.length; i; ) {\r
+                this.addEventListener( types[--i], handler, false );\r
+            }\r
+        } else {\r
+            this.onmousewheel = handler;\r
+        }\r
+    },\r
+    \r
+    teardown: function() {\r
+        if ( this.removeEventListener ) {\r
+            for ( var i=types.length; i; ) {\r
+                this.removeEventListener( types[--i], handler, false );\r
+            }\r
+        } else {\r
+            this.onmousewheel = null;\r
+        }\r
+    }\r
+};\r
+\r
+$.fn.extend({\r
+    mousewheel: function(fn) {\r
+        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");\r
+    },\r
+    \r
+    unmousewheel: function(fn) {\r
+        return this.unbind("mousewheel", fn);\r
+    }\r
+});\r
+\r
+\r
+function handler(event) {\r
+    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;\r
+    event = $.event.fix(orgEvent);\r
+    event.type = "mousewheel";\r
+    \r
+    // Old school scrollwheel delta\r
+    if ( event.wheelDelta ) { delta = event.wheelDelta/120; }\r
+    if ( event.detail     ) { delta = -event.detail/3; }\r
+    \r
+    // New school multidimensional scroll (touchpads) deltas\r
+    deltaY = delta;\r
+    \r
+    // Gecko\r
+    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {\r
+        deltaY = 0;\r
+        deltaX = -1*delta;\r
+    }\r
+    \r
+    // Webkit\r
+    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }\r
+    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }\r
+    \r
+    // Add event and delta to the front of the arguments\r
+    args.unshift(event, delta, deltaX, deltaY);\r
+    \r
+    return $.event.handle.apply(this, args);\r
+}\r
+\r
+})(jQuery);
\ No newline at end of file
index a9902a2510bb2f667aa4ea014b59123d81927df5..5868a4590343ce5d6c56f4c2a29383157f2ec08b 100644 (file)
@@ -6,7 +6,7 @@
        <link type="text/css" href="../../../themes/base/jquery.ui.spinner.css" rel="stylesheet" />\r
        \r
        <script type="text/javascript" src="../../../jquery-1.4.3.js"></script>\r
-       <script type="text/javascript" src="../../../external/jquery.mousewheel-3.0.2.js"></script>\r
+       <script type="text/javascript" src="../../../external/jquery.mousewheel-3.0.4.js"></script>\r
        <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>\r
        <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>\r
        <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>\r
@@ -33,7 +33,7 @@
 </ol>\r
 \r
 <div id="qunit-fixture">\r
-       <input id="spin">\r
+       <input id="spin" class="foo">\r
        <input id="spin2" value="2">\r
 </div>\r
 \r