2013-03-27 01:20:27 +00:00
|
|
|
var isSimple = /^.[^:#\[\.,]*$/,
|
2013-05-01 15:33:06 +00:00
|
|
|
rparentsprev = /^(?:parents|prev(?:Until|All))/,
|
2012-07-23 16:48:29 +00:00
|
|
|
rneedsContext = jQuery.expr.match.needsContext,
|
2011-01-14 14:55:40 +00:00
|
|
|
// methods guaranteed to produce a unique set when starting from a unique set
|
|
|
|
guaranteedUnique = {
|
|
|
|
children: true,
|
|
|
|
contents: true,
|
|
|
|
next: true,
|
|
|
|
prev: true
|
|
|
|
};
|
2010-10-10 04:33:02 +00:00
|
|
|
|
2009-03-18 21:15:38 +00:00
|
|
|
jQuery.fn.extend({
|
|
|
|
find: function( selector ) {
|
2013-04-20 14:02:07 +00:00
|
|
|
var i,
|
|
|
|
ret = [],
|
|
|
|
self = this,
|
|
|
|
len = self.length;
|
2009-03-18 21:15:38 +00:00
|
|
|
|
2011-03-16 05:16:32 +00:00
|
|
|
if ( typeof selector !== "string" ) {
|
2012-11-01 02:43:04 +00:00
|
|
|
return this.pushStack( jQuery( selector ).filter(function() {
|
2013-04-20 14:02:07 +00:00
|
|
|
for ( i = 0; i < len; i++ ) {
|
2011-03-16 05:16:32 +00:00
|
|
|
if ( jQuery.contains( self[ i ], this ) ) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2012-11-01 02:43:04 +00:00
|
|
|
}) );
|
|
|
|
}
|
2009-03-18 21:15:38 +00:00
|
|
|
|
2013-04-20 14:02:07 +00:00
|
|
|
for ( i = 0; i < len; i++ ) {
|
|
|
|
jQuery.find( selector, self[ i ], ret );
|
2009-03-18 21:15:38 +00:00
|
|
|
}
|
|
|
|
|
2012-10-30 17:32:53 +00:00
|
|
|
// Needed because $( selector, context ) becomes $( context ).find( selector )
|
2013-04-20 14:02:07 +00:00
|
|
|
ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
|
|
|
|
ret.selector = this.selector ? this.selector + " " + selector : selector;
|
|
|
|
return ret;
|
2009-03-18 21:15:38 +00:00
|
|
|
},
|
|
|
|
|
2009-12-09 20:43:13 +00:00
|
|
|
has: function( target ) {
|
2012-12-18 11:29:04 +00:00
|
|
|
var targets = jQuery( target, this ),
|
|
|
|
l = targets.length;
|
2012-07-10 01:38:11 +00:00
|
|
|
|
2009-12-09 20:43:13 +00:00
|
|
|
return this.filter(function() {
|
2012-12-18 11:29:04 +00:00
|
|
|
var i = 0;
|
|
|
|
for ( ; i < l; i++ ) {
|
2009-12-09 20:43:13 +00:00
|
|
|
if ( jQuery.contains( this, targets[i] ) ) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2009-07-16 07:32:11 +00:00
|
|
|
not: function( selector ) {
|
2013-03-27 01:20:27 +00:00
|
|
|
return this.pushStack( winnow(this, selector || [], true) );
|
2009-07-16 07:32:11 +00:00
|
|
|
},
|
|
|
|
|
2009-03-18 21:15:38 +00:00
|
|
|
filter: function( selector ) {
|
2013-03-27 01:20:27 +00:00
|
|
|
return this.pushStack( winnow(this, selector || [], false) );
|
2009-03-18 21:15:38 +00:00
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2009-12-10 17:25:25 +00:00
|
|
|
is: function( selector ) {
|
2013-04-20 15:40:27 +00:00
|
|
|
return !!winnow(
|
|
|
|
this,
|
|
|
|
|
|
|
|
// If this is a positional/relative selector, check membership in the returned set
|
|
|
|
// so $("p:first").is("p:last") won't return true for a doc with two "p".
|
|
|
|
typeof selector === "string" && rneedsContext.test( selector ) ?
|
|
|
|
jQuery( selector ) :
|
|
|
|
selector || [],
|
|
|
|
false
|
|
|
|
).length;
|
2009-12-10 17:25:25 +00:00
|
|
|
},
|
2009-03-18 21:15:38 +00:00
|
|
|
|
2009-12-03 00:05:51 +00:00
|
|
|
closest: function( selectors, context ) {
|
2012-12-19 15:38:33 +00:00
|
|
|
var cur,
|
|
|
|
i = 0,
|
2012-07-10 01:38:11 +00:00
|
|
|
l = this.length,
|
2012-12-18 11:29:04 +00:00
|
|
|
matched = [],
|
|
|
|
pos = ( rneedsContext.test( selectors ) || typeof selectors !== "string" ) ?
|
2011-03-22 00:59:20 +00:00
|
|
|
jQuery( selectors, context || this.context ) :
|
|
|
|
0;
|
2010-09-28 00:59:42 +00:00
|
|
|
|
2012-07-10 01:38:11 +00:00
|
|
|
for ( ; i < l; i++ ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
|
|
|
|
// Always skip document fragments
|
|
|
|
if ( cur.nodeType < 11 && (pos ?
|
|
|
|
pos.index(cur) > -1 :
|
2010-10-10 04:33:02 +00:00
|
|
|
|
2013-01-27 18:24:50 +00:00
|
|
|
// Don't pass non-elements to Sizzle
|
|
|
|
cur.nodeType === 1 &&
|
|
|
|
jQuery.find.matchesSelector(cur, selectors)) ) {
|
|
|
|
|
|
|
|
cur = matched.push( cur );
|
2010-10-10 17:37:36 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-09-28 00:59:42 +00:00
|
|
|
|
2012-12-18 11:29:04 +00:00
|
|
|
return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
|
2009-03-18 21:15:38 +00:00
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2009-12-10 17:25:25 +00:00
|
|
|
// Determine the position of an element within
|
|
|
|
// the matched set of elements
|
|
|
|
index: function( elem ) {
|
2011-06-15 04:38:36 +00:00
|
|
|
|
|
|
|
// No argument, return index in parent
|
|
|
|
if ( !elem ) {
|
2012-12-18 11:29:04 +00:00
|
|
|
return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
|
2011-06-15 04:38:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// index in selector
|
|
|
|
if ( typeof elem === "string" ) {
|
2012-12-18 11:29:04 +00:00
|
|
|
return core_indexOf.call( jQuery( elem ), this[ 0 ] );
|
2009-12-10 17:25:25 +00:00
|
|
|
}
|
2011-06-15 04:38:36 +00:00
|
|
|
|
2009-12-10 17:25:25 +00:00
|
|
|
// Locate the position of the desired element
|
2012-12-18 11:29:04 +00:00
|
|
|
return core_indexOf.call( this,
|
|
|
|
|
2009-12-10 17:25:25 +00:00
|
|
|
// If it receives a jQuery object, the first element is used
|
2012-12-18 11:29:04 +00:00
|
|
|
elem.jquery ? elem[ 0 ] : elem
|
|
|
|
);
|
2009-12-10 17:25:25 +00:00
|
|
|
},
|
2009-03-18 21:15:38 +00:00
|
|
|
|
2009-11-07 15:43:31 +00:00
|
|
|
add: function( selector, context ) {
|
A follow-up to [6578] (which stopped adding expandos to elements that didn't have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID).
$("<div/>").after("<span/>")
=> [ div, span ]
(calling after on a disconnected DOM node adds the nodes to the end of the jQuery set)
$("<div/>").before("<span/>")
=> [ span, div ]
(calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set)
$("div").add("span")
=> [ div, span, span, div, span ]
(results now come out in document order)
$("div").find("code").andSelf();
=> [ div, code, code ]
(results now come out in document order)
Same goes for .parents(), .nextAll(), .prevAll(), and .siblings().
Exception: .parents() will still return the results in reverse document order.
jQuery.data(elem)
=> { object of data }
(no longer returns the unique ID assigned to the node)
2009-09-25 17:55:20 +00:00
|
|
|
var set = typeof selector === "string" ?
|
2010-12-29 02:07:04 +00:00
|
|
|
jQuery( selector, context ) :
|
2011-04-17 17:51:24 +00:00
|
|
|
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
|
A follow-up to [6578] (which stopped adding expandos to elements that didn't have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID).
$("<div/>").after("<span/>")
=> [ div, span ]
(calling after on a disconnected DOM node adds the nodes to the end of the jQuery set)
$("<div/>").before("<span/>")
=> [ span, div ]
(calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set)
$("div").add("span")
=> [ div, span, span, div, span ]
(results now come out in document order)
$("div").find("code").andSelf();
=> [ div, code, code ]
(results now come out in document order)
Same goes for .parents(), .nextAll(), .prevAll(), and .siblings().
Exception: .parents() will still return the results in reverse document order.
jQuery.data(elem)
=> { object of data }
(no longer returns the unique ID assigned to the node)
2009-09-25 17:55:20 +00:00
|
|
|
all = jQuery.merge( this.get(), set );
|
|
|
|
|
2012-10-16 15:52:48 +00:00
|
|
|
return this.pushStack( jQuery.unique(all) );
|
2009-03-18 21:15:38 +00:00
|
|
|
},
|
|
|
|
|
2012-05-29 16:04:27 +00:00
|
|
|
addBack: function( selector ) {
|
2012-05-31 22:15:57 +00:00
|
|
|
return this.add( selector == null ?
|
2012-06-03 14:42:24 +00:00
|
|
|
this.prevObject : this.prevObject.filter(selector)
|
|
|
|
);
|
2009-03-18 21:15:38 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2013-01-27 18:24:50 +00:00
|
|
|
function sibling( cur, dir ) {
|
|
|
|
while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
|
|
|
|
|
|
|
|
return cur;
|
|
|
|
}
|
|
|
|
|
2009-03-18 21:15:38 +00:00
|
|
|
jQuery.each({
|
2009-12-22 00:58:13 +00:00
|
|
|
parent: function( elem ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
var parent = elem.parentNode;
|
|
|
|
return parent && parent.nodeType !== 11 ? parent : null;
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
parents: function( elem ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return jQuery.dir( elem, "parentNode" );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
parentsUntil: function( elem, i, until ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return jQuery.dir( elem, "parentNode", until );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
next: function( elem ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return sibling( elem, "nextSibling" );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
prev: function( elem ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return sibling( elem, "previousSibling" );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
nextAll: function( elem ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return jQuery.dir( elem, "nextSibling" );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
prevAll: function( elem ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return jQuery.dir( elem, "previousSibling" );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
nextUntil: function( elem, i, until ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return jQuery.dir( elem, "nextSibling", until );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
prevUntil: function( elem, i, until ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return jQuery.dir( elem, "previousSibling", until );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
siblings: function( elem ) {
|
2012-02-22 05:21:18 +00:00
|
|
|
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
children: function( elem ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
return jQuery.sibling( elem.firstChild );
|
2009-12-22 00:58:13 +00:00
|
|
|
},
|
|
|
|
contents: function( elem ) {
|
2013-05-26 11:20:47 +00:00
|
|
|
return elem.contentDocument || jQuery.merge( [], elem.childNodes );
|
2009-12-22 00:58:13 +00:00
|
|
|
}
|
|
|
|
}, function( name, fn ) {
|
2009-12-04 17:28:47 +00:00
|
|
|
jQuery.fn[ name ] = function( until, selector ) {
|
2012-12-18 11:29:04 +00:00
|
|
|
var matched = jQuery.map( this, fn, until );
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2013-03-27 01:20:27 +00:00
|
|
|
if ( name.slice( -5 ) !== "Until" ) {
|
2009-12-04 17:28:47 +00:00
|
|
|
selector = until;
|
|
|
|
}
|
2009-03-18 21:15:38 +00:00
|
|
|
|
A follow-up to [6578] (which stopped adding expandos to elements that didn't have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID).
$("<div/>").after("<span/>")
=> [ div, span ]
(calling after on a disconnected DOM node adds the nodes to the end of the jQuery set)
$("<div/>").before("<span/>")
=> [ span, div ]
(calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set)
$("div").add("span")
=> [ div, span, span, div, span ]
(results now come out in document order)
$("div").find("code").andSelf();
=> [ div, code, code ]
(results now come out in document order)
Same goes for .parents(), .nextAll(), .prevAll(), and .siblings().
Exception: .parents() will still return the results in reverse document order.
jQuery.data(elem)
=> { object of data }
(no longer returns the unique ID assigned to the node)
2009-09-25 17:55:20 +00:00
|
|
|
if ( selector && typeof selector === "string" ) {
|
2012-12-18 11:29:04 +00:00
|
|
|
matched = jQuery.filter( selector, matched );
|
A follow-up to [6578] (which stopped adding expandos to elements that didn't have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID).
$("<div/>").after("<span/>")
=> [ div, span ]
(calling after on a disconnected DOM node adds the nodes to the end of the jQuery set)
$("<div/>").before("<span/>")
=> [ span, div ]
(calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set)
$("div").add("span")
=> [ div, span, span, div, span ]
(results now come out in document order)
$("div").find("code").andSelf();
=> [ div, code, code ]
(results now come out in document order)
Same goes for .parents(), .nextAll(), .prevAll(), and .siblings().
Exception: .parents() will still return the results in reverse document order.
jQuery.data(elem)
=> { object of data }
(no longer returns the unique ID assigned to the node)
2009-09-25 17:55:20 +00:00
|
|
|
}
|
|
|
|
|
2012-12-18 11:29:04 +00:00
|
|
|
if ( this.length > 1 ) {
|
2013-03-27 01:20:27 +00:00
|
|
|
// Remove duplicates
|
2012-12-18 11:29:04 +00:00
|
|
|
if ( !guaranteedUnique[ name ] ) {
|
|
|
|
jQuery.unique( matched );
|
|
|
|
}
|
A follow-up to [6578] (which stopped adding expandos to elements that didn't have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID).
$("<div/>").after("<span/>")
=> [ div, span ]
(calling after on a disconnected DOM node adds the nodes to the end of the jQuery set)
$("<div/>").before("<span/>")
=> [ span, div ]
(calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set)
$("div").add("span")
=> [ div, span, span, div, span ]
(results now come out in document order)
$("div").find("code").andSelf();
=> [ div, code, code ]
(results now come out in document order)
Same goes for .parents(), .nextAll(), .prevAll(), and .siblings().
Exception: .parents() will still return the results in reverse document order.
jQuery.data(elem)
=> { object of data }
(no longer returns the unique ID assigned to the node)
2009-09-25 17:55:20 +00:00
|
|
|
|
2013-05-01 15:33:06 +00:00
|
|
|
// Reverse order for parents* and prev-derivatives
|
|
|
|
if ( rparentsprev.test( name ) ) {
|
2012-12-18 11:29:04 +00:00
|
|
|
matched.reverse();
|
|
|
|
}
|
A follow-up to [6578] (which stopped adding expandos to elements that didn't have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID).
$("<div/>").after("<span/>")
=> [ div, span ]
(calling after on a disconnected DOM node adds the nodes to the end of the jQuery set)
$("<div/>").before("<span/>")
=> [ span, div ]
(calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set)
$("div").add("span")
=> [ div, span, span, div, span ]
(results now come out in document order)
$("div").find("code").andSelf();
=> [ div, code, code ]
(results now come out in document order)
Same goes for .parents(), .nextAll(), .prevAll(), and .siblings().
Exception: .parents() will still return the results in reverse document order.
jQuery.data(elem)
=> { object of data }
(no longer returns the unique ID assigned to the node)
2009-09-25 17:55:20 +00:00
|
|
|
}
|
2009-03-18 21:15:38 +00:00
|
|
|
|
2012-12-18 11:29:04 +00:00
|
|
|
return this.pushStack( matched );
|
2009-03-18 21:15:38 +00:00
|
|
|
};
|
2009-07-25 21:31:59 +00:00
|
|
|
});
|
2009-10-26 22:07:57 +00:00
|
|
|
|
|
|
|
jQuery.extend({
|
|
|
|
filter: function( expr, elems, not ) {
|
2013-03-27 01:20:27 +00:00
|
|
|
var elem = elems[ 0 ];
|
|
|
|
|
2009-10-26 22:07:57 +00:00
|
|
|
if ( not ) {
|
|
|
|
expr = ":not(" + expr + ")";
|
|
|
|
}
|
|
|
|
|
2013-03-27 01:20:27 +00:00
|
|
|
return elems.length === 1 && elem.nodeType === 1 ?
|
|
|
|
jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
|
|
|
|
jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
|
|
|
|
return elem.nodeType === 1;
|
|
|
|
}));
|
2009-10-26 22:07:57 +00:00
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2009-12-04 17:28:47 +00:00
|
|
|
dir: function( elem, dir, until ) {
|
2013-01-27 18:24:50 +00:00
|
|
|
var matched = [],
|
|
|
|
truncate = until !== undefined;
|
2010-11-09 16:09:07 +00:00
|
|
|
|
2013-01-27 18:24:50 +00:00
|
|
|
while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
|
|
|
|
if ( elem.nodeType === 1 ) {
|
|
|
|
if ( truncate && jQuery( elem ).is( until ) ) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
matched.push( elem );
|
|
|
|
}
|
2009-10-26 22:07:57 +00:00
|
|
|
}
|
|
|
|
return matched;
|
|
|
|
},
|
|
|
|
|
|
|
|
sibling: function( n, elem ) {
|
2012-12-18 11:29:04 +00:00
|
|
|
var matched = [];
|
2009-10-26 22:07:57 +00:00
|
|
|
|
|
|
|
for ( ; n; n = n.nextSibling ) {
|
|
|
|
if ( n.nodeType === 1 && n !== elem ) {
|
2012-12-18 11:29:04 +00:00
|
|
|
matched.push( n );
|
2009-10-26 22:07:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-18 11:29:04 +00:00
|
|
|
return matched;
|
2009-10-26 22:07:57 +00:00
|
|
|
}
|
2009-11-07 15:43:31 +00:00
|
|
|
});
|
2010-03-23 16:12:16 +00:00
|
|
|
|
|
|
|
// Implement the identical functionality for filter and not
|
2013-03-27 01:20:27 +00:00
|
|
|
function winnow( elements, qualifier, not ) {
|
2010-03-23 16:12:16 +00:00
|
|
|
if ( jQuery.isFunction( qualifier ) ) {
|
2013-03-27 01:20:27 +00:00
|
|
|
return jQuery.grep( elements, function( elem, i ) {
|
|
|
|
/* jshint -W018 */
|
|
|
|
return !!qualifier.call( elem, i, elem ) !== not;
|
2010-03-23 16:12:16 +00:00
|
|
|
});
|
2013-03-27 01:20:27 +00:00
|
|
|
|
2012-12-18 11:29:04 +00:00
|
|
|
}
|
2010-03-23 16:12:16 +00:00
|
|
|
|
2012-12-18 11:29:04 +00:00
|
|
|
if ( qualifier.nodeType ) {
|
2013-03-27 01:20:27 +00:00
|
|
|
return jQuery.grep( elements, function( elem ) {
|
|
|
|
return ( elem === qualifier ) !== not;
|
2010-03-23 16:12:16 +00:00
|
|
|
});
|
2013-03-27 01:20:27 +00:00
|
|
|
|
2012-12-18 11:29:04 +00:00
|
|
|
}
|
2010-03-23 16:12:16 +00:00
|
|
|
|
2012-12-18 11:29:04 +00:00
|
|
|
if ( typeof qualifier === "string" ) {
|
2010-03-23 16:12:16 +00:00
|
|
|
if ( isSimple.test( qualifier ) ) {
|
2013-03-27 01:20:27 +00:00
|
|
|
return jQuery.filter( qualifier, elements, not );
|
2010-03-23 16:12:16 +00:00
|
|
|
}
|
2012-12-18 11:29:04 +00:00
|
|
|
|
2013-03-27 01:20:27 +00:00
|
|
|
qualifier = jQuery.filter( qualifier, elements );
|
2010-03-23 16:12:16 +00:00
|
|
|
}
|
|
|
|
|
2013-03-27 01:20:27 +00:00
|
|
|
return jQuery.grep( elements, function( elem ) {
|
|
|
|
return ( core_indexOf.call( qualifier, elem ) >= 0 ) !== not;
|
2010-03-23 16:12:16 +00:00
|
|
|
});
|
2010-03-31 18:36:24 +00:00
|
|
|
}
|