*/
(function(){
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,
done = 0,
toString = Object.prototype.toString;
CLASS: function(match, curLoop, inplace, result, not){
match = " " + match[1].replace(/\\/g, "") + " ";
- for ( var i = 0; curLoop[i] != null; i++ ) {
- if ( curLoop[i] ) {
- if ( not ^ (" " + curLoop[i].className + " ").indexOf(match) >= 0 ) {
+ var elem;
+ for ( var i = 0; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) {
if ( !inplace )
- result.push( curLoop[i] );
+ result.push( elem );
} else if ( inplace ) {
curLoop[i] = false;
}
CHILD: function(elem, match){
var type = match[1], parent = elem.parentNode;
- var doneName = "child" + parent.childNodes.length;
+ var doneName = match[0];
if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) {
var count = 1;
ATTR: function(elem, match){
var result = Expr.attrHandle[ match[1] ] ? Expr.attrHandle[ match[1] ]( elem ) : elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4];
return result == null ?
- false :
+ type === "!=" :
type === "=" ?
value === check :
type === "*=" ?
}
return Sizzle.filter( later, tmpSet );
-}
+};
// EXPOSE
jQuery.find = Sizzle;