}
// Map over the $ in case of overwrite
-if ( $ )
+if ( typeof $ != "undefined" )
jQuery._$ = $;
// Map the jQuery namespace to the '$' one
* argument representing the position of the element in the matched
* set.
*
- * @example $("img").each(function(){ this.src = "test.jpg"; });
+ * @example $("img").each(function(){
+ * this.src = "test.jpg";
+ * });
+ * @before <img/> <img/>
+ * @result <img src="test.jpg"/> <img src="test.jpg"/>
+ *
+ * @example $("img").each(function(i){
+ * alert( "Image #" + i + " is " + this );
+ * });
* @before <img/> <img/>
* @result <img src="test.jpg"/> <img src="test.jpg"/>
*
* @example $("p").not("#selected")
* @before <p>Hello</p><p id="selected">Hello Again</p>
* @result [ <p>Hello</p> ]
+ * @test cmpOK($("#main > p#ap > a").not("#google").length, "==", 2, ".not")
*
* @name not
* @type jQuery
* @name add
* @type jQuery
* @param Array<Element> els An array of Elements to add
- * @cat jQuery
+ * @cat DOM/Traversing
*/
/**
* @name add
* @type jQuery
* @param Element el An Element to add
- * @cat jQuery
+ * @cat DOM/Traversing
*/
add: function(t) {
return this.pushStack( jQuery.merge( this, t.constructor == String ?
* @member jQuery
* @param {String} expr The expression with which to filter
* @type Boolean
- * @cat jQuery
+ * @cat DOM/Traversing
*/
is: function(expr) {
return expr ? jQuery.filter(expr,this).r.length > 0 : this.length > 0;
odd: "i%2",
// Child Checks
+ "nth-child": "jQuery.sibling(a,m[3]).cur",
"first-child": "jQuery.sibling(a,0).cur",
"last-child": "jQuery.sibling(a,0).last",
"only-child": "jQuery.sibling(a).length==1",
"class": "className",
"float": "cssFloat",
innerHTML: "innerHTML",
- className: "className"
+ className: "className",
+ value: "value"
};
if ( fix[name] ) {
/**
* Get a set of elements containing the unique ancestors of the matched
- * set of elements.
+ * set of elements (except for the root element).
*
* @example $("span").ancestors()
* @before <html><body><div><p><span>Hello</span></p><span>Hello Again</span></div></body></html>
/**
* Get a set of elements containing the unique ancestors of the matched
- * set of elements.
+ * set of elements (except for the root element).
*
* @example $("span").ancestors()
* @before <html><body><div><p><span>Hello</span></p><span>Hello Again</span></div></body></html>
* @param String expr An expression to filter the child Elements with
* @cat DOM/Traversing
*/
- children: "a.childNodes"
+ children: "jQuery.sibling(a.firstChild)"
},
each: {
* @cat DOM/Manipulation
*/
remove: function(a){
- if ( !a || jQuery.filter( [this], a ).r )
+ if ( !a || jQuery.filter( a, [this] ).r )
this.parentNode.removeChild( this );
},
}
};
-jQuery.init();
\ No newline at end of file
+jQuery.init();