tot - jquery/jquery.fixes.diff 25
Not logged in
[Browse]  [Directory]  [Home]  [Login
[Reports]  [Search]  [Timeline
  [Raw
jquery/jquery.fixes.diff 25
Index: jquery/version.txt
===================================================================
--- jquery/version.txt	(revision 1611)
+++ jquery/version.txt	(working copy)
@@ -1 +1 @@
-1.1.2
+1.1.2+RSE
Index: jquery/src/jquery/jquery.js
===================================================================
--- jquery/src/jquery/jquery.js	(revision 1611)
+++ jquery/src/jquery/jquery.js	(working copy)
@@ -1043,6 +1043,18 @@
 	is: function(expr) {
 		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
 	},
+
+	/**
+	 * Sort and reverse the nodes in an jQuery object
+	 * (see http://dev.jquery.com/ticket/255)
+	 */
+	sort: function () {
+		return this.pushStack(jQuery.makeArray([].sort.apply(this, arguments)));
+	},
+
+	reverse: function () {
+		return this.pushStack(this.get().reverse(), arguments);
+	},
 	
 	/**
 	 * Get the content of the value attribute of the first matched element.
@@ -1453,7 +1465,7 @@
 			if ( arg.constructor == Number )
 				arg = arg.toString();
 			
-			 // Convert html string into DOM nodes
+			// Convert html string into DOM nodes
 			if ( typeof arg == "string" ) {
 				// Trim whitespace, otherwise indexOf won't work as expected
 				var s = jQuery.trim(arg), div = doc.createElement("div"), tb = [];
Index: jquery/src/selector/selector.js
===================================================================
--- jquery/src/selector/selector.js	(revision 1611)
+++ jquery/src/selector/selector.js	(working copy)
@@ -52,6 +52,8 @@
 		"@": {
 			"=": "z==m[4]",
 			"!=": "z!=m[4]",
+			"=~": "z.match(RegExp(m[4]))!=null",
+			"!~": "z.match(RegExp(m[4]))==null",
 			"^=": "z&&!z.indexOf(m[4])",
 			"$=": "z&&z.substr(z.length - m[4].length,m[4].length)==m[4]",
 			"*=": "z&&z.indexOf(m[4])>=0",
@@ -67,7 +69,7 @@
 	// The regular expressions that power the parsing engine
 	parse: [
 		// Match: [@value='test'], [@foo]
-		/^\[ *(@)([\w-]+) *([!*$^=]*) *('?"?)(.*?)\4 *\]/,
+		/^\[ *(@)([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
 
 		// Match: [div], [div p]
 		/^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/,
Index: jquery/src/event/event.js
===================================================================
--- jquery/src/event/event.js	(revision 1611)
+++ jquery/src/event/event.js	(working copy)
@@ -264,7 +264,7 @@
 	 * Binds a handler to a particular event (like click) for each matched element.
 	 * The handler is executed only once for each element. Otherwise, the same rules
 	 * as described in bind() apply.
-	 The event handler is passed an event object that you can use to prevent
+	 * The event handler is passed an event object that you can use to prevent
 	 * default behaviour. To stop both default action and event bubbling, your handler
 	 * has to return false.
 	 *
@@ -545,6 +545,7 @@
 	 *
 	 * @name scroll
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the scroll event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -560,6 +561,7 @@
 	 *
 	 * @name submit
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the submit event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -590,6 +592,7 @@
 	 *
 	 * @name focus
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the focus event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -619,6 +622,7 @@
 	 *
 	 * @name keydown
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the keydown event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -632,6 +636,7 @@
 	 *
 	 * @name dblclick
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the dblclick event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -645,6 +650,7 @@
 	 *
 	 * @name keypress
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the keypress event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -658,6 +664,7 @@
 	 *
 	 * @name error
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the error event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -671,6 +678,7 @@
 	 *
 	 * @name blur
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the blur event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -702,6 +710,7 @@
 	 *
 	 * @name load
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the load event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -715,6 +724,7 @@
 	 *
 	 * @name select
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the select event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -743,6 +753,7 @@
 	 *
 	 * @name mouseup
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the mouseup event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -756,6 +767,7 @@
 	 *
 	 * @name unload
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the unload event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -769,6 +781,7 @@
 	 *
 	 * @name change
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the change event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -782,6 +795,7 @@
 	 *
 	 * @name mouseout
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the mouseout event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -795,6 +809,7 @@
 	 *
 	 * @name keyup
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the keyup event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -808,6 +823,7 @@
 	 *
 	 * @name click
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the click event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -834,6 +850,7 @@
 	 *
 	 * @name resize
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the resize event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -847,6 +864,7 @@
 	 *
 	 * @name mousemove
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the mousemove event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -860,6 +878,7 @@
 	 *
 	 * @name mousedown
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the mousedown event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -873,6 +892,7 @@
 	 *
 	 * @name mouseover
 	 * @type jQuery
+	 * @param Object data (optional) Additional data passed to the event handler as event.data
 	 * @param Function fn A function to bind to the mousedown event on each of the matched elements.
 	 * @cat Events
 	 */
@@ -881,8 +901,8 @@
 		"submit,keydown,keypress,keyup,error").split(","), function(i,o){
 		
 		// Handle event binding
-		jQuery.fn[o] = function(f){
-			return f ? this.bind(o, f) : this.trigger(o);
+		jQuery.fn[o] = function(d,f){
+			return (f || d) ? this.bind(o, d, f) : this.trigger(o);
 		};
 			
 	});
Index: jquery/src/fx/fx.js
===================================================================
--- jquery/src/fx/fx.js	(revision 1611)
+++ jquery/src/fx/fx.js	(working copy)
@@ -304,7 +304,7 @@
 	 * @example $("p").animate({
 	 *   opacity: 'show'
 	 * }, "slow", "easein");
-	 * @desc An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function (Only 'linear' is provided by default, with jQuery).
+	 * @desc An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function (Only 'swing' and 'linear' are provided by default, with jQuery).
 	 *
 	 * @name animate
 	 * @type jQuery
Index: plugins/validate/jquery.validate.js
===================================================================
--- plugins/validate/jquery.validate.js	(revision 1611)
+++ plugins/validate/jquery.validate.js	(working copy)
@@ -756,6 +756,17 @@
 				return value.length > 0;
 			}
 		},
+
+		/**
+		 * Return true, if the value matches a regex.
+		 *
+		 * @name jQuery.validator.methods.regex
+		 * @type Boolean
+		 * @cat Plugins/Validate/Methods
+		 */
+		regex: function(value, element, param) {
+			return !jQuery.validator.methods.required(value, element) || param.test(value);
+		},
 	
 		/**
 		 * Return false, if the element is
@@ -1115,8 +1126,8 @@
 	 * Add a new validation method. It must consist of a name (must be a legal
 	 * javascript identifier), a function and a default message.
 	 *
-	 * Please note: While the temptation is great to
-	 * add a regex method that checks it's paramter against the value,
+	 * Please note: While the "regex" method above can be used
+	 * to checks it's paramter against the value,
 	 * it is much cleaner to encapsulate those regular expressions
 	 * inside their own method. If you need lots of slightly different
 	 * expressions, try to extract a common parameter.
Index: plugins/methods/string.js
===================================================================
--- plugins/methods/string.js	(revision 1611)
+++ plugins/methods/string.js	(working copy)
@@ -16,7 +16,7 @@
 
 	/**
 	 * Adds a given method under the given name 
-	 * to the Date prototype if it doesn't
+	 * to the String prototype if it doesn't
 	 * currently exist.
 	 *
 	 * @private
@@ -147,7 +147,7 @@
 	 * @cat Plugins/Methods/String
 	 */
 	add("stripTags", function() {
-		return this.replace(/<\/?[^>]+>/gi, '');
+		return this.replace(/<([a-zA-Z][a-zA-Z0-9:_-]*(\s+[a-zA-Z][a-zA-Z0-9:_-]*=("[^"]*"|'[^']*'))*|\/?[a-zA-Z][a-zA-Z0-9:_-])>/gi, '');
 	});
 
-})();
\ No newline at end of file
+})();
Index: plugins/methods/array.js
===================================================================
--- plugins/methods/array.js	(revision 1611)
+++ plugins/methods/array.js	(working copy)
@@ -16,7 +16,7 @@
 	
 	/**
 	 * Adds a given method under the given name 
-	 * to the Date prototype if it doesn't
+	 * to the Array prototype if it doesn't
 	 * currently exist.
 	 *
 	 * @private
@@ -47,7 +47,7 @@
 		for( var i = 0; i < this.length; i++)
 			handler.call(scope, this[i], i, this);
 	});
-	
+
 	/**
 	 * Tests whether all elements in the array pass the test
 	 * implemented by the provided function.
@@ -194,4 +194,4 @@
 		});
 	});
 	
-})();
\ No newline at end of file
+})();
Index: plugins/cookie/jquery.cookie.js
===================================================================
--- plugins/cookie/jquery.cookie.js	(revision 1611)
+++ plugins/cookie/jquery.cookie.js	(working copy)
@@ -17,6 +17,8 @@
  * @desc Create a cookie with all available options.
  * @example $.cookie('the_cookie', 'the_value');
  * @desc Create a session cookie.
+ * @example $.cookie('the_cookie', null);
+ * @desc Delete a cookie by passing a null value.
  * @example $.cookie('the_cookie', '', {expires: -1});
  * @desc Delete a cookie by setting a date in the past.
  *
@@ -55,15 +57,35 @@
 jQuery.cookie = function(name, value, options) {
     if (typeof value != 'undefined') { // name and value given, set cookie
         options = options || {};
+        if (value === null) {
+            value = "";
+            options.expires = -1;
+        }
         var expires = '';
-        if (options.expires && (typeof options.expires == 'number' || options.expires.toGMTString)) {
+        if (options.expires) {
             var date;
-            if (typeof options.expires == 'number') {
+            if (typeof options.expires == 'string' && options.expires.match(/^[+-]?[0-9]+[YMWDhms]$/) !== null) {
+                var match = options.expires.match(/^([+-]?[0-9]+)([YMDWhms])$/);
+                options.expires = parseInt(match[0], 10) * (({
+                    "Y": (60 * 60 * 24 * 365),
+                    "M": (60 * 60 * 24 * 365/12),
+                    "W": (60 * 60 * 24 * 7),
+                    "D": (60 * 60 * 24),
+                    "h": (60 * 60),
+                    "m": (60),
+                    "s": (1)
+                }[match[1]]) || 0);
                 date = new Date();
-                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
-            } else {
+                date.setTime(date.getTime() + options.expires * 1000);
+            }
+            else if (typeof options.expires == 'number') {
+                date = new Date();
+                date.setTime(date.getTime() + options.expires * 24 * 60 * 60 * 1000);
+            }
+            else if (typeof options.expires.toGMTString != 'undefined')
                 date = options.expires;
-            }
+            else
+                throw "invalid \"expires\" option";
             expires = '; expires=' + date.toGMTString(); // use expires attribute, max-age is not supported by IE
         }
         var path = options.path ? '; path=' + options.path : '';
@@ -85,4 +107,4 @@
         }
         return cookieValue;
     }
-};
\ No newline at end of file
+};
Index: plugins/squeezebox/index.html
===================================================================
--- plugins/squeezebox/index.html	(revision 1611)
+++ plugins/squeezebox/index.html	(working copy)
@@ -8,7 +8,7 @@
 	
 	<link rel="stylesheet" href="squeezebox.css" />
 	
-	<script type="text/javascript" src="../../jquery/dist/jquery.js"></script>
+	<script type="text/javascript" src="http://jquery.com/src/jquery-latest.pack.js"></script>
 	<script type="text/javascript" src="jquery.squeezebox.js"></script>
 
 	<script type="text/javascript">
@@ -233,4 +233,4 @@
 		<div id="log"><div><strong>Log of the 2nd accordion</strong></div></div>
 
 	</body>
-</html>
\ No newline at end of file
+</html>
Index: plugins/interface/easing.js
===================================================================
--- plugins/interface/easing.js	(revision 1611)
+++ plugins/interface/easing.js	(working copy)
@@ -24,6 +24,10 @@
 	 */
 	easing :  {
 		linear: function(p, n, firstNum, delta, duration) {
+			return p * delta + firstNum;
+		},
+
+		swing: function(p, n, firstNum, delta, duration) {
 			return ((-Math.cos(p*Math.PI)/2) + 0.5) * delta + firstNum;
 		},
 		
@@ -121,4 +125,4 @@
 			return a*Math.pow(2,-10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )*.5 + delta + firstNum; 
 		}
 	}
-});
\ No newline at end of file
+});
Index: plugins/interface/ifx.js
===================================================================
--- plugins/interface/ifx.js	(revision 1611)
+++ plugins/interface/ifx.js	(working copy)
@@ -288,7 +288,7 @@
 	}
 });
 /**
- * Improved FX function that aniamtes collection of properties per timer. Accepts inline styles and class names to animate
+ * Improved FX function that animates collection of properties per timer. Accepts inline styles and class names to animate
  */
 jQuery.extend({
 	pause: function(elem, options)
@@ -304,6 +304,9 @@
 	},
 	easing :  {
 		linear: function(p, n, firstNum, delta, duration) {
+			return p * delta + firstNum;
+		},
+		swing: function(p, n, firstNum, delta, duration) {
 			return ((-Math.cos(p*Math.PI)/2) + 0.5) * delta + firstNum;
 		}
 	},
@@ -485,4 +488,4 @@
 		}
 	}
 	return newStyles;
-};
\ No newline at end of file
+};