Fixed tests for gt/lt
[jquery.git] / src / jquery / jquery.js
index 4059807..6e71268 100644 (file)
@@ -160,21 +160,6 @@ var $ = jQuery;
  * @type jQuery
  */
 
-/**
- * A means of creating a cloned copy of a jQuery object. This function
- * copies the set of matched elements from one jQuery object and creates
- * another, new, jQuery object containing the same elements.
- *
- * @example var div = $("div");
- * $( div ).find("p");
- * @desc Locates all p elements with all div elements, without disrupting the original jQuery object contained in 'div' (as would normally be the case if a simple div.find("p") was done).
- *
- * @name $
- * @param jQuery obj The jQuery object to be cloned.
- * @cat Core
- * @type jQuery
- */
-
 jQuery.fn = jQuery.prototype = {
        /**
         * The current version of jQuery.
@@ -447,7 +432,7 @@ jQuery.fn = jQuery.prototype = {
                        for ( var prop in obj )
                                jQuery.attr(
                                        type ? this.style : this,
-                                       prop, jQuery.prop(this, prop, obj[prop], type)
+                                       prop, jQuery.prop(this, obj[prop])
                                );
                });
        },
@@ -930,6 +915,19 @@ jQuery.fn = jQuery.prototype = {
         * @param String expr An expression whose matched elements are added
         * @cat DOM/Traversing
         */
+        
+       /**
+        * Adds the on the fly created elements to the jQuery object.
+        *
+        * @example $("p").add("<span>Again</span>")
+        * @before <p>Hello</p>
+        * @result [ <p>Hello</p>, <span>Again</span> ]
+        *
+        * @name add
+        * @type jQuery
+        * @param String html A string of HTML to create on the fly.
+        * @cat DOM/Traversing
+        */
 
        /**
         * Adds one or more Elements to the set of matched elements.
@@ -951,9 +949,9 @@ jQuery.fn = jQuery.prototype = {
         */
        add: function(t) {
                return this.set( jQuery.merge(
-                       this.get(), typeof t == "string" ?
-                               jQuery.find(t) :
-                               t.constructor == Array ? t : [t] ) );
+                       this.get(),
+                       typeof t == "string" ? jQuery(t).get() : t )
+               );
        },
 
        /**
@@ -1220,7 +1218,7 @@ jQuery.extend({
                return obj;
        },
        
-       prop: function(elem, key, value){
+       prop: function(elem, value){
                // Handle executable functions
                return value.constructor == Function &&
                        value.call( elem ) || value;
@@ -1355,16 +1353,17 @@ jQuery.extend({
 
                                var wrap =
                                         // option or optgroup
-                                       !s.indexOf("<opt") && [1, "<select>", "</select>"] ||
+                                       !s.indexOf("<opt") &&
+                                       [1, "<select>", "</select>"] ||
                                        
-                                       !s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot") &&
+                                       (!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot")) &&
                                        [1, "<table>", "</table>"] ||
                                        
                                        !s.indexOf("<tr") &&
                                        [2, "<table><tbody>", "</tbody></table>"] ||
                                        
                                        // <thead> matched above
-                                       !s.indexOf("<td") || !s.indexOf("<th") &&
+                                       (!s.indexOf("<td") || !s.indexOf("<th")) &&
                                        [3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
                                        
                                        [0,"",""];
@@ -1400,6 +1399,7 @@ jQuery.extend({
                                r.push( arg );
                        else
                                r = jQuery.merge( r, arg );
+
                }
 
                return r;
@@ -1844,8 +1844,9 @@ jQuery.each({
  *
  * @name appendTo
  * @type jQuery
- * @param String expr A jQuery expression of elements to match.
+ * @param <Content> content Content to append to the selected element to.
  * @cat DOM/Manipulation
+ * @see append(<Content>)
  */
 
 /**
@@ -1861,8 +1862,9 @@ jQuery.each({
  *
  * @name prependTo
  * @type jQuery
- * @param String expr A jQuery expression of elements to match.
+ * @param <Content> content Content to prepend to the selected element to.
  * @cat DOM/Manipulation
+ * @see prepend(<Content>)
  */
 
 /**
@@ -1878,8 +1880,9 @@ jQuery.each({
  *
  * @name insertBefore
  * @type jQuery
- * @param String expr A jQuery expression of elements to match.
+ * @param <Content> content Content to insert the selected element before.
  * @cat DOM/Manipulation
+ * @see before(<Content>)
  */
 
 /**
@@ -1895,8 +1898,9 @@ jQuery.each({
  *
  * @name insertAfter
  * @type jQuery
- * @param String expr A jQuery expression of elements to match.
+ * @param <Content> content Content to insert the selected element after.
  * @cat DOM/Manipulation
+ * @see after(<Content>)
  */
 
 jQuery.each({
@@ -1928,21 +1932,25 @@ jQuery.each({
  */
 
 /**
- * Adds the specified class to each of the set of matched elements.
+ * Adds the specified class(es) to each of the set of matched elements.
  *
  * @example $("p").addClass("selected")
  * @before <p>Hello</p>
  * @result [ <p class="selected">Hello</p> ]
  *
+ * @example $("p").addClass("selected highlight")
+ * @before <p>Hello</p>
+ * @result [ <p class="selected highlight">Hello</p> ]
+ *
  * @name addClass
  * @type jQuery
- * @param String class A CSS class to add to the elements
+ * @param String class One or more CSS classes to add to the elements
  * @cat DOM/Attributes
  * @see removeClass(String)
  */
 
 /**
- * Removes all or the specified class from the set of matched elements.
+ * Removes all or the specified class(es) from the set of matched elements.
  *
  * @example $("p").removeClass()
  * @before <p class="selected">Hello</p>
@@ -1952,9 +1960,13 @@ jQuery.each({
  * @before <p class="selected first">Hello</p>
  * @result [ <p class="first">Hello</p> ]
  *
+ * @example $("p").removeClass("selected highlight")
+ * @before <p class="highlight selected first">Hello</p>
+ * @result [ <p class="first">Hello</p> ]
+ *
  * @name removeClass
  * @type jQuery
- * @param String class (optional) A CSS class to remove from the elements
+ * @param String class (optional) One or more CSS classes to remove from the elements
  * @cat DOM/Attributes
  * @see addClass(String)
  */