| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 |
|
| 11 | ( function( window ) {
|
| 12 | var i,
|
| 13 | support,
|
| 14 | Expr,
|
| 15 | getText,
|
| 16 | isXML,
|
| 17 | tokenize,
|
| 18 | compile,
|
| 19 | select,
|
| 20 | outermostContext,
|
| 21 | sortInput,
|
| 22 | hasDuplicate,
|
| 23 |
|
| 24 |
|
| 25 | setDocument,
|
| 26 | document,
|
| 27 | docElem,
|
| 28 | documentIsHTML,
|
| 29 | rbuggyQSA,
|
| 30 | rbuggyMatches,
|
| 31 | matches,
|
| 32 | contains,
|
| 33 |
|
| 34 |
|
| 35 | expando = "sizzle" + 1 * new Date(),
|
| 36 | preferredDoc = window.document,
|
| 37 | dirruns = 0,
|
| 38 | done = 0,
|
| 39 | classCache = createCache(),
|
| 40 | tokenCache = createCache(),
|
| 41 | compilerCache = createCache(),
|
| 42 | nonnativeSelectorCache = createCache(),
|
| 43 | sortOrder = function( a, b ) {
|
| 44 | if ( a === b ) {
|
| 45 | hasDuplicate = true;
|
| 46 | }
|
| 47 | return 0;
|
| 48 | },
|
| 49 |
|
| 50 |
|
| 51 | hasOwn = ( {} ).hasOwnProperty,
|
| 52 | arr = [],
|
| 53 | pop = arr.pop,
|
| 54 | pushNative = arr.push,
|
| 55 | push = arr.push,
|
| 56 | slice = arr.slice,
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 | indexOf = function( list, elem ) {
|
| 61 | var i = 0,
|
| 62 | len = list.length;
|
| 63 | for ( ; i < len; i++ ) {
|
| 64 | if ( list[ i ] === elem ) {
|
| 65 | return i;
|
| 66 | }
|
| 67 | }
|
| 68 | return -1;
|
| 69 | },
|
| 70 |
|
| 71 | booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
|
| 72 | "ismap|loop|multiple|open|readonly|required|scoped",
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 | whitespace = "[\\x20\\t\\r\\n\\f]",
|
| 78 |
|
| 79 |
|
| 80 | identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
|
| 81 | "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
|
| 82 |
|
| 83 |
|
| 84 | attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
|
| 85 |
|
| 86 |
|
| 87 | "*([*^$|!~]?=)" + whitespace +
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 | "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
|
| 92 | whitespace + "*\\]",
|
| 93 |
|
| 94 | pseudos = ":(" + identifier + ")(?:\\((" +
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 | "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
|
| 99 |
|
| 100 |
|
| 101 | "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
|
| 102 |
|
| 103 |
|
| 104 | ".*" +
|
| 105 | ")\\)|)",
|
| 106 |
|
| 107 |
|
| 108 | rwhitespace = new RegExp( whitespace + "+", "g" ),
|
| 109 | rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
|
| 110 | whitespace + "+$", "g" ),
|
| 111 |
|
| 112 | rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
|
| 113 | rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
|
| 114 | "*" ),
|
| 115 | rdescend = new RegExp( whitespace + "|>" ),
|
| 116 |
|
| 117 | rpseudo = new RegExp( pseudos ),
|
| 118 | ridentifier = new RegExp( "^" + identifier + "$" ),
|
| 119 |
|
| 120 | matchExpr = {
|
| 121 | "ID": new RegExp( "^#(" + identifier + ")" ),
|
| 122 | "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
|
| 123 | "TAG": new RegExp( "^(" + identifier + "|[*])" ),
|
| 124 | "ATTR": new RegExp( "^" + attributes ),
|
| 125 | "PSEUDO": new RegExp( "^" + pseudos ),
|
| 126 | "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
|
| 127 | whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
|
| 128 | whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
|
| 129 | "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 | "needsContext": new RegExp( "^" + whitespace +
|
| 134 | "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
|
| 135 | "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
|
| 136 | },
|
| 137 |
|
| 138 | rhtml = /HTML$/i,
|
| 139 | rinputs = /^(?:input|select|textarea|button)$/i,
|
| 140 | rheader = /^h\d$/i,
|
| 141 |
|
| 142 | rnative = /^[^{]+\{\s*\[native \w/,
|
| 143 |
|
| 144 |
|
| 145 | rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
|
| 146 |
|
| 147 | rsibling = /[+~]/,
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 | runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
|
| 152 | funescape = function( escape, nonHex ) {
|
| 153 | var high = "0x" + escape.slice( 1 ) - 0x10000;
|
| 154 |
|
| 155 | return nonHex ?
|
| 156 |
|
| 157 |
|
| 158 | nonHex :
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 | high < 0 ?
|
| 165 | String.fromCharCode( high + 0x10000 ) :
|
| 166 | String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
|
| 167 | },
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 | rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
|
| 172 | fcssescape = function( ch, asCodePoint ) {
|
| 173 | if ( asCodePoint ) {
|
| 174 |
|
| 175 |
|
| 176 | if ( ch === "\0" ) {
|
| 177 | return "\uFFFD";
|
| 178 | }
|
| 179 |
|
| 180 |
|
| 181 | return ch.slice( 0, -1 ) + "\\" +
|
| 182 | ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
|
| 183 | }
|
| 184 |
|
| 185 |
|
| 186 | return "\\" + ch;
|
| 187 | },
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 | unloadHandler = function() {
|
| 194 | setDocument();
|
| 195 | },
|
| 196 |
|
| 197 | inDisabledFieldset = addCombinator(
|
| 198 | function( elem ) {
|
| 199 | return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
|
| 200 | },
|
| 201 | { dir: "parentNode", next: "legend" }
|
| 202 | );
|
| 203 |
|
| 204 |
|
| 205 | try {
|
| 206 | push.apply(
|
| 207 | ( arr = slice.call( preferredDoc.childNodes ) ),
|
| 208 | preferredDoc.childNodes
|
| 209 | );
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 | arr[ preferredDoc.childNodes.length ].nodeType;
|
| 215 | } catch ( e ) {
|
| 216 | push = { apply: arr.length ?
|
| 217 |
|
| 218 |
|
| 219 | function( target, els ) {
|
| 220 | pushNative.apply( target, slice.call( els ) );
|
| 221 | } :
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 | function( target, els ) {
|
| 226 | var j = target.length,
|
| 227 | i = 0;
|
| 228 |
|
| 229 |
|
| 230 | while ( ( target[ j++ ] = els[ i++ ] ) ) {}
|
| 231 | target.length = j - 1;
|
| 232 | }
|
| 233 | };
|
| 234 | }
|
| 235 |
|
| 236 | function Sizzle( selector, context, results, seed ) {
|
| 237 | var m, i, elem, nid, match, groups, newSelector,
|
| 238 | newContext = context && context.ownerDocument,
|
| 239 |
|
| 240 |
|
| 241 | nodeType = context ? context.nodeType : 9;
|
| 242 |
|
| 243 | results = results || [];
|
| 244 |
|
| 245 |
|
| 246 | if ( typeof selector !== "string" || !selector ||
|
| 247 | nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
|
| 248 |
|
| 249 | return results;
|
| 250 | }
|
| 251 |
|
| 252 |
|
| 253 | if ( !seed ) {
|
| 254 | setDocument( context );
|
| 255 | context = context || document;
|
| 256 |
|
| 257 | if ( documentIsHTML ) {
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 | if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
|
| 262 |
|
| 263 |
|
| 264 | if ( ( m = match[ 1 ] ) ) {
|
| 265 |
|
| 266 |
|
| 267 | if ( nodeType === 9 ) {
|
| 268 | if ( ( elem = context.getElementById( m ) ) ) {
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 | if ( elem.id === m ) {
|
| 274 | results.push( elem );
|
| 275 | return results;
|
| 276 | }
|
| 277 | } else {
|
| 278 | return results;
|
| 279 | }
|
| 280 |
|
| 281 |
|
| 282 | } else {
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 | if ( newContext && ( elem = newContext.getElementById( m ) ) &&
|
| 288 | contains( context, elem ) &&
|
| 289 | elem.id === m ) {
|
| 290 |
|
| 291 | results.push( elem );
|
| 292 | return results;
|
| 293 | }
|
| 294 | }
|
| 295 |
|
| 296 |
|
| 297 | } else if ( match[ 2 ] ) {
|
| 298 | push.apply( results, context.getElementsByTagName( selector ) );
|
| 299 | return results;
|
| 300 |
|
| 301 |
|
| 302 | } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
|
| 303 | context.getElementsByClassName ) {
|
| 304 |
|
| 305 | push.apply( results, context.getElementsByClassName( m ) );
|
| 306 | return results;
|
| 307 | }
|
| 308 | }
|
| 309 |
|
| 310 |
|
| 311 | if ( support.qsa &&
|
| 312 | !nonnativeSelectorCache[ selector + " " ] &&
|
| 313 | ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
|
| 314 |
|
| 315 |
|
| 316 |
|
| 317 | ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
|
| 318 |
|
| 319 | newSelector = selector;
|
| 320 | newContext = context;
|
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 | if ( nodeType === 1 &&
|
| 330 | ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
|
| 331 |
|
| 332 |
|
| 333 | newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
|
| 334 | context;
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 | if ( newContext !== context || !support.scope ) {
|
| 339 |
|
| 340 |
|
| 341 | if ( ( nid = context.getAttribute( "id" ) ) ) {
|
| 342 | nid = nid.replace( rcssescape, fcssescape );
|
| 343 | } else {
|
| 344 | context.setAttribute( "id", ( nid = expando ) );
|
| 345 | }
|
| 346 | }
|
| 347 |
|
| 348 |
|
| 349 | groups = tokenize( selector );
|
| 350 | i = groups.length;
|
| 351 | while ( i-- ) {
|
| 352 | groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
|
| 353 | toSelector( groups[ i ] );
|
| 354 | }
|
| 355 | newSelector = groups.join( "," );
|
| 356 | }
|
| 357 |
|
| 358 | try {
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 | if ( support.cssSupportsSelector &&
|
| 368 |
|
| 369 |
|
| 370 | !CSS.supports( "selector(:is(" + newSelector + "))" ) ) {
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 | throw new Error();
|
| 378 | }
|
| 379 |
|
| 380 | push.apply( results,
|
| 381 | newContext.querySelectorAll( newSelector )
|
| 382 | );
|
| 383 | return results;
|
| 384 | } catch ( qsaError ) {
|
| 385 | nonnativeSelectorCache( selector, true );
|
| 386 | } finally {
|
| 387 | if ( nid === expando ) {
|
| 388 | context.removeAttribute( "id" );
|
| 389 | }
|
| 390 | }
|
| 391 | }
|
| 392 | }
|
| 393 | }
|
| 394 |
|
| 395 |
|
| 396 | return select( selector.replace( rtrim, "$1" ), context, results, seed );
|
| 397 | }
|
| 398 |
|
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 |
|
| 405 | function createCache() {
|
| 406 | var keys = [];
|
| 407 |
|
| 408 | function cache( key, value ) {
|
| 409 |
|
| 410 |
|
| 411 | if ( keys.push( key + " " ) > Expr.cacheLength ) {
|
| 412 |
|
| 413 |
|
| 414 | delete cache[ keys.shift() ];
|
| 415 | }
|
| 416 | return ( cache[ key + " " ] = value );
|
| 417 | }
|
| 418 | return cache;
|
| 419 | }
|
| 420 |
|
| 421 | |
| 422 | |
| 423 | |
| 424 |
|
| 425 | function markFunction( fn ) {
|
| 426 | fn[ expando ] = true;
|
| 427 | return fn;
|
| 428 | }
|
| 429 |
|
| 430 | |
| 431 | |
| 432 | |
| 433 |
|
| 434 | function assert( fn ) {
|
| 435 | var el = document.createElement( "fieldset" );
|
| 436 |
|
| 437 | try {
|
| 438 | return !!fn( el );
|
| 439 | } catch ( e ) {
|
| 440 | return false;
|
| 441 | } finally {
|
| 442 |
|
| 443 |
|
| 444 | if ( el.parentNode ) {
|
| 445 | el.parentNode.removeChild( el );
|
| 446 | }
|
| 447 |
|
| 448 |
|
| 449 | el = null;
|
| 450 | }
|
| 451 | }
|
| 452 |
|
| 453 | |
| 454 | |
| 455 | |
| 456 | |
| 457 |
|
| 458 | function addHandle( attrs, handler ) {
|
| 459 | var arr = attrs.split( "|" ),
|
| 460 | i = arr.length;
|
| 461 |
|
| 462 | while ( i-- ) {
|
| 463 | Expr.attrHandle[ arr[ i ] ] = handler;
|
| 464 | }
|
| 465 | }
|
| 466 |
|
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 |
|
| 473 | function siblingCheck( a, b ) {
|
| 474 | var cur = b && a,
|
| 475 | diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
|
| 476 | a.sourceIndex - b.sourceIndex;
|
| 477 |
|
| 478 |
|
| 479 | if ( diff ) {
|
| 480 | return diff;
|
| 481 | }
|
| 482 |
|
| 483 |
|
| 484 | if ( cur ) {
|
| 485 | while ( ( cur = cur.nextSibling ) ) {
|
| 486 | if ( cur === b ) {
|
| 487 | return -1;
|
| 488 | }
|
| 489 | }
|
| 490 | }
|
| 491 |
|
| 492 | return a ? 1 : -1;
|
| 493 | }
|
| 494 |
|
| 495 | |
| 496 | |
| 497 | |
| 498 |
|
| 499 | function createInputPseudo( type ) {
|
| 500 | return function( elem ) {
|
| 501 | var name = elem.nodeName.toLowerCase();
|
| 502 | return name === "input" && elem.type === type;
|
| 503 | };
|
| 504 | }
|
| 505 |
|
| 506 | |
| 507 | |
| 508 | |
| 509 |
|
| 510 | function createButtonPseudo( type ) {
|
| 511 | return function( elem ) {
|
| 512 | var name = elem.nodeName.toLowerCase();
|
| 513 | return ( name === "input" || name === "button" ) && elem.type === type;
|
| 514 | };
|
| 515 | }
|
| 516 |
|
| 517 | |
| 518 | |
| 519 | |
| 520 |
|
| 521 | function createDisabledPseudo( disabled ) {
|
| 522 |
|
| 523 |
|
| 524 | return function( elem ) {
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 | if ( "form" in elem ) {
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 | if ( elem.parentNode && elem.disabled === false ) {
|
| 539 |
|
| 540 |
|
| 541 | if ( "label" in elem ) {
|
| 542 | if ( "label" in elem.parentNode ) {
|
| 543 | return elem.parentNode.disabled === disabled;
|
| 544 | } else {
|
| 545 | return elem.disabled === disabled;
|
| 546 | }
|
| 547 | }
|
| 548 |
|
| 549 |
|
| 550 |
|
| 551 | return elem.isDisabled === disabled ||
|
| 552 |
|
| 553 |
|
| 554 |
|
| 555 | elem.isDisabled !== !disabled &&
|
| 556 | inDisabledFieldset( elem ) === disabled;
|
| 557 | }
|
| 558 |
|
| 559 | return elem.disabled === disabled;
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 | } else if ( "label" in elem ) {
|
| 565 | return elem.disabled === disabled;
|
| 566 | }
|
| 567 |
|
| 568 |
|
| 569 | return false;
|
| 570 | };
|
| 571 | }
|
| 572 |
|
| 573 | |
| 574 | |
| 575 | |
| 576 |
|
| 577 | function createPositionalPseudo( fn ) {
|
| 578 | return markFunction( function( argument ) {
|
| 579 | argument = +argument;
|
| 580 | return markFunction( function( seed, matches ) {
|
| 581 | var j,
|
| 582 | matchIndexes = fn( [], seed.length, argument ),
|
| 583 | i = matchIndexes.length;
|
| 584 |
|
| 585 |
|
| 586 | while ( i-- ) {
|
| 587 | if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
|
| 588 | seed[ j ] = !( matches[ j ] = seed[ j ] );
|
| 589 | }
|
| 590 | }
|
| 591 | } );
|
| 592 | } );
|
| 593 | }
|
| 594 |
|
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 |
|
| 600 | function testContext( context ) {
|
| 601 | return context && typeof context.getElementsByTagName !== "undefined" && context;
|
| 602 | }
|
| 603 |
|
| 604 |
|
| 605 | support = Sizzle.support = {};
|
| 606 |
|
| 607 | |
| 608 | |
| 609 | |
| 610 | |
| 611 |
|
| 612 | isXML = Sizzle.isXML = function( elem ) {
|
| 613 | var namespace = elem && elem.namespaceURI,
|
| 614 | docElem = elem && ( elem.ownerDocument || elem ).documentElement;
|
| 615 |
|
| 616 |
|
| 617 |
|
| 618 |
|
| 619 | return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
|
| 620 | };
|
| 621 |
|
| 622 | |
| 623 | |
| 624 | |
| 625 | |
| 626 |
|
| 627 | setDocument = Sizzle.setDocument = function( node ) {
|
| 628 | var hasCompare, subWindow,
|
| 629 | doc = node ? node.ownerDocument || node : preferredDoc;
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 | if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
|
| 637 | return document;
|
| 638 | }
|
| 639 |
|
| 640 |
|
| 641 | document = doc;
|
| 642 | docElem = document.documentElement;
|
| 643 | documentIsHTML = !isXML( document );
|
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
|
| 648 |
|
| 649 |
|
| 650 |
|
| 651 | if ( preferredDoc != document &&
|
| 652 | ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
|
| 653 |
|
| 654 |
|
| 655 | if ( subWindow.addEventListener ) {
|
| 656 | subWindow.addEventListener( "unload", unloadHandler, false );
|
| 657 |
|
| 658 |
|
| 659 | } else if ( subWindow.attachEvent ) {
|
| 660 | subWindow.attachEvent( "onunload", unloadHandler );
|
| 661 | }
|
| 662 | }
|
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
|
| 669 | support.scope = assert( function( el ) {
|
| 670 | docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
|
| 671 | return typeof el.querySelectorAll !== "undefined" &&
|
| 672 | !el.querySelectorAll( ":scope fieldset div" ).length;
|
| 673 | } );
|
| 674 |
|
| 675 |
|
| 676 |
|
| 677 |
|
| 678 |
|
| 679 |
|
| 680 | support.cssSupportsSelector = assert( function() {
|
| 681 |
|
| 682 |
|
| 683 | return CSS.supports( "selector(*)" ) &&
|
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
|
| 689 | document.querySelectorAll( ":is(:jqfake)" ) &&
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
|
| 695 | !CSS.supports( "selector(:is(*,:jqfake))" );
|
| 696 |
|
| 697 |
|
| 698 | } );
|
| 699 |
|
| 700 | |
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 | support.attributes = assert( function( el ) {
|
| 707 | el.className = "i";
|
| 708 | return !el.getAttribute( "className" );
|
| 709 | } );
|
| 710 |
|
| 711 | |
| 712 |
|
| 713 |
|
| 714 |
|
| 715 | support.getElementsByTagName = assert( function( el ) {
|
| 716 | el.appendChild( document.createComment( "" ) );
|
| 717 | return !el.getElementsByTagName( "*" ).length;
|
| 718 | } );
|
| 719 |
|
| 720 |
|
| 721 | support.getElementsByClassName = rnative.test( document.getElementsByClassName );
|
| 722 |
|
| 723 |
|
| 724 |
|
| 725 |
|
| 726 |
|
| 727 | support.getById = assert( function( el ) {
|
| 728 | docElem.appendChild( el ).id = expando;
|
| 729 | return !document.getElementsByName || !document.getElementsByName( expando ).length;
|
| 730 | } );
|
| 731 |
|
| 732 |
|
| 733 | if ( support.getById ) {
|
| 734 | Expr.filter[ "ID" ] = function( id ) {
|
| 735 | var attrId = id.replace( runescape, funescape );
|
| 736 | return function( elem ) {
|
| 737 | return elem.getAttribute( "id" ) === attrId;
|
| 738 | };
|
| 739 | };
|
| 740 | Expr.find[ "ID" ] = function( id, context ) {
|
| 741 | if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
|
| 742 | var elem = context.getElementById( id );
|
| 743 | return elem ? [ elem ] : [];
|
| 744 | }
|
| 745 | };
|
| 746 | } else {
|
| 747 | Expr.filter[ "ID" ] = function( id ) {
|
| 748 | var attrId = id.replace( runescape, funescape );
|
| 749 | return function( elem ) {
|
| 750 | var node = typeof elem.getAttributeNode !== "undefined" &&
|
| 751 | elem.getAttributeNode( "id" );
|
| 752 | return node && node.value === attrId;
|
| 753 | };
|
| 754 | };
|
| 755 |
|
| 756 |
|
| 757 |
|
| 758 | Expr.find[ "ID" ] = function( id, context ) {
|
| 759 | if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
|
| 760 | var node, i, elems,
|
| 761 | elem = context.getElementById( id );
|
| 762 |
|
| 763 | if ( elem ) {
|
| 764 |
|
| 765 |
|
| 766 | node = elem.getAttributeNode( "id" );
|
| 767 | if ( node && node.value === id ) {
|
| 768 | return [ elem ];
|
| 769 | }
|
| 770 |
|
| 771 |
|
| 772 | elems = context.getElementsByName( id );
|
| 773 | i = 0;
|
| 774 | while ( ( elem = elems[ i++ ] ) ) {
|
| 775 | node = elem.getAttributeNode( "id" );
|
| 776 | if ( node && node.value === id ) {
|
| 777 | return [ elem ];
|
| 778 | }
|
| 779 | }
|
| 780 | }
|
| 781 |
|
| 782 | return [];
|
| 783 | }
|
| 784 | };
|
| 785 | }
|
| 786 |
|
| 787 |
|
| 788 | Expr.find[ "TAG" ] = support.getElementsByTagName ?
|
| 789 | function( tag, context ) {
|
| 790 | if ( typeof context.getElementsByTagName !== "undefined" ) {
|
| 791 | return context.getElementsByTagName( tag );
|
| 792 |
|
| 793 |
|
| 794 | } else if ( support.qsa ) {
|
| 795 | return context.querySelectorAll( tag );
|
| 796 | }
|
| 797 | } :
|
| 798 |
|
| 799 | function( tag, context ) {
|
| 800 | var elem,
|
| 801 | tmp = [],
|
| 802 | i = 0,
|
| 803 |
|
| 804 |
|
| 805 | results = context.getElementsByTagName( tag );
|
| 806 |
|
| 807 |
|
| 808 | if ( tag === "*" ) {
|
| 809 | while ( ( elem = results[ i++ ] ) ) {
|
| 810 | if ( elem.nodeType === 1 ) {
|
| 811 | tmp.push( elem );
|
| 812 | }
|
| 813 | }
|
| 814 |
|
| 815 | return tmp;
|
| 816 | }
|
| 817 | return results;
|
| 818 | };
|
| 819 |
|
| 820 |
|
| 821 | Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
|
| 822 | if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
|
| 823 | return context.getElementsByClassName( className );
|
| 824 | }
|
| 825 | };
|
| 826 |
|
| 827 | |
| 828 |
|
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
|
| 833 | rbuggyMatches = [];
|
| 834 |
|
| 835 |
|
| 836 |
|
| 837 |
|
| 838 |
|
| 839 |
|
| 840 | rbuggyQSA = [];
|
| 841 |
|
| 842 | if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
|
| 843 |
|
| 844 |
|
| 845 |
|
| 846 | assert( function( el ) {
|
| 847 |
|
| 848 | var input;
|
| 849 |
|
| 850 |
|
| 851 |
|
| 852 |
|
| 853 |
|
| 854 |
|
| 855 | docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
|
| 856 | "<select id='" + expando + "-\r\\' msallowcapture=''>" +
|
| 857 | "<option selected=''></option></select>";
|
| 858 |
|
| 859 |
|
| 860 |
|
| 861 |
|
| 862 |
|
| 863 | if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
|
| 864 | rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
|
| 865 | }
|
| 866 |
|
| 867 |
|
| 868 |
|
| 869 | if ( !el.querySelectorAll( "[selected]" ).length ) {
|
| 870 | rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
|
| 871 | }
|
| 872 |
|
| 873 |
|
| 874 | if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
|
| 875 | rbuggyQSA.push( "~=" );
|
| 876 | }
|
| 877 |
|
| 878 |
|
| 879 |
|
| 880 |
|
| 881 |
|
| 882 |
|
| 883 | input = document.createElement( "input" );
|
| 884 | input.setAttribute( "name", "" );
|
| 885 | el.appendChild( input );
|
| 886 | if ( !el.querySelectorAll( "[name='']" ).length ) {
|
| 887 | rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
|
| 888 | whitespace + "*(?:''|\"\")" );
|
| 889 | }
|
| 890 |
|
| 891 |
|
| 892 |
|
| 893 |
|
| 894 | if ( !el.querySelectorAll( ":checked" ).length ) {
|
| 895 | rbuggyQSA.push( ":checked" );
|
| 896 | }
|
| 897 |
|
| 898 |
|
| 899 |
|
| 900 |
|
| 901 | if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
|
| 902 | rbuggyQSA.push( ".#.+[+~]" );
|
| 903 | }
|
| 904 |
|
| 905 |
|
| 906 |
|
| 907 | el.querySelectorAll( "\\\f" );
|
| 908 | rbuggyQSA.push( "[\\r\\n\\f]" );
|
| 909 | } );
|
| 910 |
|
| 911 | assert( function( el ) {
|
| 912 | el.innerHTML = "<a href='' disabled='disabled'></a>" +
|
| 913 | "<select disabled='disabled'><option/></select>";
|
| 914 |
|
| 915 |
|
| 916 |
|
| 917 | var input = document.createElement( "input" );
|
| 918 | input.setAttribute( "type", "hidden" );
|
| 919 | el.appendChild( input ).setAttribute( "name", "D" );
|
| 920 |
|
| 921 |
|
| 922 |
|
| 923 | if ( el.querySelectorAll( "[name=d]" ).length ) {
|
| 924 | rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
|
| 925 | }
|
| 926 |
|
| 927 |
|
| 928 |
|
| 929 | if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
|
| 930 | rbuggyQSA.push( ":enabled", ":disabled" );
|
| 931 | }
|
| 932 |
|
| 933 |
|
| 934 |
|
| 935 | docElem.appendChild( el ).disabled = true;
|
| 936 | if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
|
| 937 | rbuggyQSA.push( ":enabled", ":disabled" );
|
| 938 | }
|
| 939 |
|
| 940 |
|
| 941 |
|
| 942 | el.querySelectorAll( "*,:x" );
|
| 943 | rbuggyQSA.push( ",.*:" );
|
| 944 | } );
|
| 945 | }
|
| 946 |
|
| 947 | if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
|
| 948 | docElem.webkitMatchesSelector ||
|
| 949 | docElem.mozMatchesSelector ||
|
| 950 | docElem.oMatchesSelector ||
|
| 951 | docElem.msMatchesSelector ) ) ) ) {
|
| 952 |
|
| 953 | assert( function( el ) {
|
| 954 |
|
| 955 |
|
| 956 |
|
| 957 | support.disconnectedMatch = matches.call( el, "*" );
|
| 958 |
|
| 959 |
|
| 960 |
|
| 961 | matches.call( el, "[s!='']:x" );
|
| 962 | rbuggyMatches.push( "!=", pseudos );
|
| 963 | } );
|
| 964 | }
|
| 965 |
|
| 966 | if ( !support.cssSupportsSelector ) {
|
| 967 |
|
| 968 |
|
| 969 |
|
| 970 |
|
| 971 |
|
| 972 |
|
| 973 |
|
| 974 | rbuggyQSA.push( ":has" );
|
| 975 | }
|
| 976 |
|
| 977 | rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
|
| 978 | rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
|
| 979 |
|
| 980 | |
| 981 |
|
| 982 | hasCompare = rnative.test( docElem.compareDocumentPosition );
|
| 983 |
|
| 984 |
|
| 985 |
|
| 986 |
|
| 987 | contains = hasCompare || rnative.test( docElem.contains ) ?
|
| 988 | function( a, b ) {
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
|
| 993 |
|
| 994 |
|
| 995 |
|
| 996 | var adown = a.nodeType === 9 && a.documentElement || a,
|
| 997 | bup = b && b.parentNode;
|
| 998 | return a === bup || !!( bup && bup.nodeType === 1 && (
|
| 999 | adown.contains ?
|
| 1000 | adown.contains( bup ) :
|
| 1001 | a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
|
| 1002 | ) );
|
| 1003 | } :
|
| 1004 | function( a, b ) {
|
| 1005 | if ( b ) {
|
| 1006 | while ( ( b = b.parentNode ) ) {
|
| 1007 | if ( b === a ) {
|
| 1008 | return true;
|
| 1009 | }
|
| 1010 | }
|
| 1011 | }
|
| 1012 | return false;
|
| 1013 | };
|
| 1014 |
|
| 1015 | |
| 1016 |
|
| 1017 |
|
| 1018 |
|
| 1019 | sortOrder = hasCompare ?
|
| 1020 | function( a, b ) {
|
| 1021 |
|
| 1022 |
|
| 1023 | if ( a === b ) {
|
| 1024 | hasDuplicate = true;
|
| 1025 | return 0;
|
| 1026 | }
|
| 1027 |
|
| 1028 |
|
| 1029 | var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
|
| 1030 | if ( compare ) {
|
| 1031 | return compare;
|
| 1032 | }
|
| 1033 |
|
| 1034 |
|
| 1035 |
|
| 1036 |
|
| 1037 |
|
| 1038 |
|
| 1039 | compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
|
| 1040 | a.compareDocumentPosition( b ) :
|
| 1041 |
|
| 1042 |
|
| 1043 | 1;
|
| 1044 |
|
| 1045 |
|
| 1046 | if ( compare & 1 ||
|
| 1047 | ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
|
| 1048 |
|
| 1049 |
|
| 1050 |
|
| 1051 |
|
| 1052 |
|
| 1053 |
|
| 1054 | if ( a == document || a.ownerDocument == preferredDoc &&
|
| 1055 | contains( preferredDoc, a ) ) {
|
| 1056 | return -1;
|
| 1057 | }
|
| 1058 |
|
| 1059 |
|
| 1060 |
|
| 1061 |
|
| 1062 |
|
| 1063 | if ( b == document || b.ownerDocument == preferredDoc &&
|
| 1064 | contains( preferredDoc, b ) ) {
|
| 1065 | return 1;
|
| 1066 | }
|
| 1067 |
|
| 1068 |
|
| 1069 | return sortInput ?
|
| 1070 | ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
|
| 1071 | 0;
|
| 1072 | }
|
| 1073 |
|
| 1074 | return compare & 4 ? -1 : 1;
|
| 1075 | } :
|
| 1076 | function( a, b ) {
|
| 1077 |
|
| 1078 |
|
| 1079 | if ( a === b ) {
|
| 1080 | hasDuplicate = true;
|
| 1081 | return 0;
|
| 1082 | }
|
| 1083 |
|
| 1084 | var cur,
|
| 1085 | i = 0,
|
| 1086 | aup = a.parentNode,
|
| 1087 | bup = b.parentNode,
|
| 1088 | ap = [ a ],
|
| 1089 | bp = [ b ];
|
| 1090 |
|
| 1091 |
|
| 1092 | if ( !aup || !bup ) {
|
| 1093 |
|
| 1094 |
|
| 1095 |
|
| 1096 |
|
| 1097 |
|
| 1098 | return a == document ? -1 :
|
| 1099 | b == document ? 1 :
|
| 1100 |
|
| 1101 | aup ? -1 :
|
| 1102 | bup ? 1 :
|
| 1103 | sortInput ?
|
| 1104 | ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
|
| 1105 | 0;
|
| 1106 |
|
| 1107 |
|
| 1108 | } else if ( aup === bup ) {
|
| 1109 | return siblingCheck( a, b );
|
| 1110 | }
|
| 1111 |
|
| 1112 |
|
| 1113 | cur = a;
|
| 1114 | while ( ( cur = cur.parentNode ) ) {
|
| 1115 | ap.unshift( cur );
|
| 1116 | }
|
| 1117 | cur = b;
|
| 1118 | while ( ( cur = cur.parentNode ) ) {
|
| 1119 | bp.unshift( cur );
|
| 1120 | }
|
| 1121 |
|
| 1122 |
|
| 1123 | while ( ap[ i ] === bp[ i ] ) {
|
| 1124 | i++;
|
| 1125 | }
|
| 1126 |
|
| 1127 | return i ?
|
| 1128 |
|
| 1129 |
|
| 1130 | siblingCheck( ap[ i ], bp[ i ] ) :
|
| 1131 |
|
| 1132 |
|
| 1133 |
|
| 1134 |
|
| 1135 |
|
| 1136 |
|
| 1137 | ap[ i ] == preferredDoc ? -1 :
|
| 1138 | bp[ i ] == preferredDoc ? 1 :
|
| 1139 |
|
| 1140 | 0;
|
| 1141 | };
|
| 1142 |
|
| 1143 | return document;
|
| 1144 | };
|
| 1145 |
|
| 1146 | Sizzle.matches = function( expr, elements ) {
|
| 1147 | return Sizzle( expr, null, null, elements );
|
| 1148 | };
|
| 1149 |
|
| 1150 | Sizzle.matchesSelector = function( elem, expr ) {
|
| 1151 | setDocument( elem );
|
| 1152 |
|
| 1153 | if ( support.matchesSelector && documentIsHTML &&
|
| 1154 | !nonnativeSelectorCache[ expr + " " ] &&
|
| 1155 | ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
|
| 1156 | ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
|
| 1157 |
|
| 1158 | try {
|
| 1159 | var ret = matches.call( elem, expr );
|
| 1160 |
|
| 1161 |
|
| 1162 | if ( ret || support.disconnectedMatch ||
|
| 1163 |
|
| 1164 |
|
| 1165 |
|
| 1166 | elem.document && elem.document.nodeType !== 11 ) {
|
| 1167 | return ret;
|
| 1168 | }
|
| 1169 | } catch ( e ) {
|
| 1170 | nonnativeSelectorCache( expr, true );
|
| 1171 | }
|
| 1172 | }
|
| 1173 |
|
| 1174 | return Sizzle( expr, document, null, [ elem ] ).length > 0;
|
| 1175 | };
|
| 1176 |
|
| 1177 | Sizzle.contains = function( context, elem ) {
|
| 1178 |
|
| 1179 |
|
| 1180 |
|
| 1181 |
|
| 1182 |
|
| 1183 |
|
| 1184 | if ( ( context.ownerDocument || context ) != document ) {
|
| 1185 | setDocument( context );
|
| 1186 | }
|
| 1187 | return contains( context, elem );
|
| 1188 | };
|
| 1189 |
|
| 1190 | Sizzle.attr = function( elem, name ) {
|
| 1191 |
|
| 1192 |
|
| 1193 |
|
| 1194 |
|
| 1195 |
|
| 1196 |
|
| 1197 | if ( ( elem.ownerDocument || elem ) != document ) {
|
| 1198 | setDocument( elem );
|
| 1199 | }
|
| 1200 |
|
| 1201 | var fn = Expr.attrHandle[ name.toLowerCase() ],
|
| 1202 |
|
| 1203 |
|
| 1204 | val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
|
| 1205 | fn( elem, name, !documentIsHTML ) :
|
| 1206 | undefined;
|
| 1207 |
|
| 1208 | return val !== undefined ?
|
| 1209 | val :
|
| 1210 | support.attributes || !documentIsHTML ?
|
| 1211 | elem.getAttribute( name ) :
|
| 1212 | ( val = elem.getAttributeNode( name ) ) && val.specified ?
|
| 1213 | val.value :
|
| 1214 | null;
|
| 1215 | };
|
| 1216 |
|
| 1217 | Sizzle.escape = function( sel ) {
|
| 1218 | return ( sel + "" ).replace( rcssescape, fcssescape );
|
| 1219 | };
|
| 1220 |
|
| 1221 | Sizzle.error = function( msg ) {
|
| 1222 | throw new Error( "Syntax error, unrecognized expression: " + msg );
|
| 1223 | };
|
| 1224 |
|
| 1225 | |
| 1226 | |
| 1227 | |
| 1228 |
|
| 1229 | Sizzle.uniqueSort = function( results ) {
|
| 1230 | var elem,
|
| 1231 | duplicates = [],
|
| 1232 | j = 0,
|
| 1233 | i = 0;
|
| 1234 |
|
| 1235 |
|
| 1236 | hasDuplicate = !support.detectDuplicates;
|
| 1237 | sortInput = !support.sortStable && results.slice( 0 );
|
| 1238 | results.sort( sortOrder );
|
| 1239 |
|
| 1240 | if ( hasDuplicate ) {
|
| 1241 | while ( ( elem = results[ i++ ] ) ) {
|
| 1242 | if ( elem === results[ i ] ) {
|
| 1243 | j = duplicates.push( i );
|
| 1244 | }
|
| 1245 | }
|
| 1246 | while ( j-- ) {
|
| 1247 | results.splice( duplicates[ j ], 1 );
|
| 1248 | }
|
| 1249 | }
|
| 1250 |
|
| 1251 |
|
| 1252 |
|
| 1253 | sortInput = null;
|
| 1254 |
|
| 1255 | return results;
|
| 1256 | };
|
| 1257 |
|
| 1258 | |
| 1259 | |
| 1260 | |
| 1261 |
|
| 1262 | getText = Sizzle.getText = function( elem ) {
|
| 1263 | var node,
|
| 1264 | ret = "",
|
| 1265 | i = 0,
|
| 1266 | nodeType = elem.nodeType;
|
| 1267 |
|
| 1268 | if ( !nodeType ) {
|
| 1269 |
|
| 1270 |
|
| 1271 | while ( ( node = elem[ i++ ] ) ) {
|
| 1272 |
|
| 1273 |
|
| 1274 | ret += getText( node );
|
| 1275 | }
|
| 1276 | } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
|
| 1277 |
|
| 1278 |
|
| 1279 |
|
| 1280 | if ( typeof elem.textContent === "string" ) {
|
| 1281 | return elem.textContent;
|
| 1282 | } else {
|
| 1283 |
|
| 1284 |
|
| 1285 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
| 1286 | ret += getText( elem );
|
| 1287 | }
|
| 1288 | }
|
| 1289 | } else if ( nodeType === 3 || nodeType === 4 ) {
|
| 1290 | return elem.nodeValue;
|
| 1291 | }
|
| 1292 |
|
| 1293 |
|
| 1294 |
|
| 1295 | return ret;
|
| 1296 | };
|
| 1297 |
|
| 1298 | Expr = Sizzle.selectors = {
|
| 1299 |
|
| 1300 |
|
| 1301 | cacheLength: 50,
|
| 1302 |
|
| 1303 | createPseudo: markFunction,
|
| 1304 |
|
| 1305 | match: matchExpr,
|
| 1306 |
|
| 1307 | attrHandle: {},
|
| 1308 |
|
| 1309 | find: {},
|
| 1310 |
|
| 1311 | relative: {
|
| 1312 | ">": { dir: "parentNode", first: true },
|
| 1313 | " ": { dir: "parentNode" },
|
| 1314 | "+": { dir: "previousSibling", first: true },
|
| 1315 | "~": { dir: "previousSibling" }
|
| 1316 | },
|
| 1317 |
|
| 1318 | preFilter: {
|
| 1319 | "ATTR": function( match ) {
|
| 1320 | match[ 1 ] = match[ 1 ].replace( runescape, funescape );
|
| 1321 |
|
| 1322 |
|
| 1323 | match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
|
| 1324 | match[ 5 ] || "" ).replace( runescape, funescape );
|
| 1325 |
|
| 1326 | if ( match[ 2 ] === "~=" ) {
|
| 1327 | match[ 3 ] = " " + match[ 3 ] + " ";
|
| 1328 | }
|
| 1329 |
|
| 1330 | return match.slice( 0, 4 );
|
| 1331 | },
|
| 1332 |
|
| 1333 | "CHILD": function( match ) {
|
| 1334 |
|
| 1335 | |
| 1336 | |
| 1337 | |
| 1338 | |
| 1339 | |
| 1340 | |
| 1341 | |
| 1342 | |
| 1343 | |
| 1344 |
|
| 1345 | match[ 1 ] = match[ 1 ].toLowerCase();
|
| 1346 |
|
| 1347 | if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
|
| 1348 |
|
| 1349 |
|
| 1350 | if ( !match[ 3 ] ) {
|
| 1351 | Sizzle.error( match[ 0 ] );
|
| 1352 | }
|
| 1353 |
|
| 1354 |
|
| 1355 |
|
| 1356 | match[ 4 ] = +( match[ 4 ] ?
|
| 1357 | match[ 5 ] + ( match[ 6 ] || 1 ) :
|
| 1358 | 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
|
| 1359 | match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
|
| 1360 |
|
| 1361 |
|
| 1362 | } else if ( match[ 3 ] ) {
|
| 1363 | Sizzle.error( match[ 0 ] );
|
| 1364 | }
|
| 1365 |
|
| 1366 | return match;
|
| 1367 | },
|
| 1368 |
|
| 1369 | "PSEUDO": function( match ) {
|
| 1370 | var excess,
|
| 1371 | unquoted = !match[ 6 ] && match[ 2 ];
|
| 1372 |
|
| 1373 | if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
|
| 1374 | return null;
|
| 1375 | }
|
| 1376 |
|
| 1377 |
|
| 1378 | if ( match[ 3 ] ) {
|
| 1379 | match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
|
| 1380 |
|
| 1381 |
|
| 1382 | } else if ( unquoted && rpseudo.test( unquoted ) &&
|
| 1383 |
|
| 1384 |
|
| 1385 | ( excess = tokenize( unquoted, true ) ) &&
|
| 1386 |
|
| 1387 |
|
| 1388 | ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
|
| 1389 |
|
| 1390 |
|
| 1391 | match[ 0 ] = match[ 0 ].slice( 0, excess );
|
| 1392 | match[ 2 ] = unquoted.slice( 0, excess );
|
| 1393 | }
|
| 1394 |
|
| 1395 |
|
| 1396 | return match.slice( 0, 3 );
|
| 1397 | }
|
| 1398 | },
|
| 1399 |
|
| 1400 | filter: {
|
| 1401 |
|
| 1402 | "TAG": function( nodeNameSelector ) {
|
| 1403 | var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
|
| 1404 | return nodeNameSelector === "*" ?
|
| 1405 | function() {
|
| 1406 | return true;
|
| 1407 | } :
|
| 1408 | function( elem ) {
|
| 1409 | return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
|
| 1410 | };
|
| 1411 | },
|
| 1412 |
|
| 1413 | "CLASS": function( className ) {
|
| 1414 | var pattern = classCache[ className + " " ];
|
| 1415 |
|
| 1416 | return pattern ||
|
| 1417 | ( pattern = new RegExp( "(^|" + whitespace +
|
| 1418 | ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
|
| 1419 | className, function( elem ) {
|
| 1420 | return pattern.test(
|
| 1421 | typeof elem.className === "string" && elem.className ||
|
| 1422 | typeof elem.getAttribute !== "undefined" &&
|
| 1423 | elem.getAttribute( "class" ) ||
|
| 1424 | ""
|
| 1425 | );
|
| 1426 | } );
|
| 1427 | },
|
| 1428 |
|
| 1429 | "ATTR": function( name, operator, check ) {
|
| 1430 | return function( elem ) {
|
| 1431 | var result = Sizzle.attr( elem, name );
|
| 1432 |
|
| 1433 | if ( result == null ) {
|
| 1434 | return operator === "!=";
|
| 1435 | }
|
| 1436 | if ( !operator ) {
|
| 1437 | return true;
|
| 1438 | }
|
| 1439 |
|
| 1440 | result += "";
|
| 1441 |
|
| 1442 |
|
| 1443 |
|
| 1444 | return operator === "=" ? result === check :
|
| 1445 | operator === "!=" ? result !== check :
|
| 1446 | operator === "^=" ? check && result.indexOf( check ) === 0 :
|
| 1447 | operator === "*=" ? check && result.indexOf( check ) > -1 :
|
| 1448 | operator === "$=" ? check && result.slice( -check.length ) === check :
|
| 1449 | operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
|
| 1450 | operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
|
| 1451 | false;
|
| 1452 |
|
| 1453 |
|
| 1454 | };
|
| 1455 | },
|
| 1456 |
|
| 1457 | "CHILD": function( type, what, _argument, first, last ) {
|
| 1458 | var simple = type.slice( 0, 3 ) !== "nth",
|
| 1459 | forward = type.slice( -4 ) !== "last",
|
| 1460 | ofType = what === "of-type";
|
| 1461 |
|
| 1462 | return first === 1 && last === 0 ?
|
| 1463 |
|
| 1464 |
|
| 1465 | function( elem ) {
|
| 1466 | return !!elem.parentNode;
|
| 1467 | } :
|
| 1468 |
|
| 1469 | function( elem, _context, xml ) {
|
| 1470 | var cache, uniqueCache, outerCache, node, nodeIndex, start,
|
| 1471 | dir = simple !== forward ? "nextSibling" : "previousSibling",
|
| 1472 | parent = elem.parentNode,
|
| 1473 | name = ofType && elem.nodeName.toLowerCase(),
|
| 1474 | useCache = !xml && !ofType,
|
| 1475 | diff = false;
|
| 1476 |
|
| 1477 | if ( parent ) {
|
| 1478 |
|
| 1479 |
|
| 1480 | if ( simple ) {
|
| 1481 | while ( dir ) {
|
| 1482 | node = elem;
|
| 1483 | while ( ( node = node[ dir ] ) ) {
|
| 1484 | if ( ofType ?
|
| 1485 | node.nodeName.toLowerCase() === name :
|
| 1486 | node.nodeType === 1 ) {
|
| 1487 |
|
| 1488 | return false;
|
| 1489 | }
|
| 1490 | }
|
| 1491 |
|
| 1492 |
|
| 1493 | start = dir = type === "only" && !start && "nextSibling";
|
| 1494 | }
|
| 1495 | return true;
|
| 1496 | }
|
| 1497 |
|
| 1498 | start = [ forward ? parent.firstChild : parent.lastChild ];
|
| 1499 |
|
| 1500 |
|
| 1501 | if ( forward && useCache ) {
|
| 1502 |
|
| 1503 |
|
| 1504 |
|
| 1505 |
|
| 1506 | node = parent;
|
| 1507 | outerCache = node[ expando ] || ( node[ expando ] = {} );
|
| 1508 |
|
| 1509 |
|
| 1510 |
|
| 1511 | uniqueCache = outerCache[ node.uniqueID ] ||
|
| 1512 | ( outerCache[ node.uniqueID ] = {} );
|
| 1513 |
|
| 1514 | cache = uniqueCache[ type ] || [];
|
| 1515 | nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
|
| 1516 | diff = nodeIndex && cache[ 2 ];
|
| 1517 | node = nodeIndex && parent.childNodes[ nodeIndex ];
|
| 1518 |
|
| 1519 | while ( ( node = ++nodeIndex && node && node[ dir ] ||
|
| 1520 |
|
| 1521 |
|
| 1522 | ( diff = nodeIndex = 0 ) || start.pop() ) ) {
|
| 1523 |
|
| 1524 |
|
| 1525 | if ( node.nodeType === 1 && ++diff && node === elem ) {
|
| 1526 | uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
|
| 1527 | break;
|
| 1528 | }
|
| 1529 | }
|
| 1530 |
|
| 1531 | } else {
|
| 1532 |
|
| 1533 |
|
| 1534 | if ( useCache ) {
|
| 1535 |
|
| 1536 |
|
| 1537 | node = elem;
|
| 1538 | outerCache = node[ expando ] || ( node[ expando ] = {} );
|
| 1539 |
|
| 1540 |
|
| 1541 |
|
| 1542 | uniqueCache = outerCache[ node.uniqueID ] ||
|
| 1543 | ( outerCache[ node.uniqueID ] = {} );
|
| 1544 |
|
| 1545 | cache = uniqueCache[ type ] || [];
|
| 1546 | nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
|
| 1547 | diff = nodeIndex;
|
| 1548 | }
|
| 1549 |
|
| 1550 |
|
| 1551 |
|
| 1552 | if ( diff === false ) {
|
| 1553 |
|
| 1554 |
|
| 1555 | while ( ( node = ++nodeIndex && node && node[ dir ] ||
|
| 1556 | ( diff = nodeIndex = 0 ) || start.pop() ) ) {
|
| 1557 |
|
| 1558 | if ( ( ofType ?
|
| 1559 | node.nodeName.toLowerCase() === name :
|
| 1560 | node.nodeType === 1 ) &&
|
| 1561 | ++diff ) {
|
| 1562 |
|
| 1563 |
|
| 1564 | if ( useCache ) {
|
| 1565 | outerCache = node[ expando ] ||
|
| 1566 | ( node[ expando ] = {} );
|
| 1567 |
|
| 1568 |
|
| 1569 |
|
| 1570 | uniqueCache = outerCache[ node.uniqueID ] ||
|
| 1571 | ( outerCache[ node.uniqueID ] = {} );
|
| 1572 |
|
| 1573 | uniqueCache[ type ] = [ dirruns, diff ];
|
| 1574 | }
|
| 1575 |
|
| 1576 | if ( node === elem ) {
|
| 1577 | break;
|
| 1578 | }
|
| 1579 | }
|
| 1580 | }
|
| 1581 | }
|
| 1582 | }
|
| 1583 |
|
| 1584 |
|
| 1585 | diff -= last;
|
| 1586 | return diff === first || ( diff % first === 0 && diff / first >= 0 );
|
| 1587 | }
|
| 1588 | };
|
| 1589 | },
|
| 1590 |
|
| 1591 | "PSEUDO": function( pseudo, argument ) {
|
| 1592 |
|
| 1593 |
|
| 1594 |
|
| 1595 |
|
| 1596 |
|
| 1597 | var args,
|
| 1598 | fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
|
| 1599 | Sizzle.error( "unsupported pseudo: " + pseudo );
|
| 1600 |
|
| 1601 |
|
| 1602 |
|
| 1603 |
|
| 1604 | if ( fn[ expando ] ) {
|
| 1605 | return fn( argument );
|
| 1606 | }
|
| 1607 |
|
| 1608 |
|
| 1609 | if ( fn.length > 1 ) {
|
| 1610 | args = [ pseudo, pseudo, "", argument ];
|
| 1611 | return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
|
| 1612 | markFunction( function( seed, matches ) {
|
| 1613 | var idx,
|
| 1614 | matched = fn( seed, argument ),
|
| 1615 | i = matched.length;
|
| 1616 | while ( i-- ) {
|
| 1617 | idx = indexOf( seed, matched[ i ] );
|
| 1618 | seed[ idx ] = !( matches[ idx ] = matched[ i ] );
|
| 1619 | }
|
| 1620 | } ) :
|
| 1621 | function( elem ) {
|
| 1622 | return fn( elem, 0, args );
|
| 1623 | };
|
| 1624 | }
|
| 1625 |
|
| 1626 | return fn;
|
| 1627 | }
|
| 1628 | },
|
| 1629 |
|
| 1630 | pseudos: {
|
| 1631 |
|
| 1632 |
|
| 1633 | "not": markFunction( function( selector ) {
|
| 1634 |
|
| 1635 |
|
| 1636 |
|
| 1637 |
|
| 1638 | var input = [],
|
| 1639 | results = [],
|
| 1640 | matcher = compile( selector.replace( rtrim, "$1" ) );
|
| 1641 |
|
| 1642 | return matcher[ expando ] ?
|
| 1643 | markFunction( function( seed, matches, _context, xml ) {
|
| 1644 | var elem,
|
| 1645 | unmatched = matcher( seed, null, xml, [] ),
|
| 1646 | i = seed.length;
|
| 1647 |
|
| 1648 |
|
| 1649 | while ( i-- ) {
|
| 1650 | if ( ( elem = unmatched[ i ] ) ) {
|
| 1651 | seed[ i ] = !( matches[ i ] = elem );
|
| 1652 | }
|
| 1653 | }
|
| 1654 | } ) :
|
| 1655 | function( elem, _context, xml ) {
|
| 1656 | input[ 0 ] = elem;
|
| 1657 | matcher( input, null, xml, results );
|
| 1658 |
|
| 1659 |
|
| 1660 | input[ 0 ] = null;
|
| 1661 | return !results.pop();
|
| 1662 | };
|
| 1663 | } ),
|
| 1664 |
|
| 1665 | "has": markFunction( function( selector ) {
|
| 1666 | return function( elem ) {
|
| 1667 | return Sizzle( selector, elem ).length > 0;
|
| 1668 | };
|
| 1669 | } ),
|
| 1670 |
|
| 1671 | "contains": markFunction( function( text ) {
|
| 1672 | text = text.replace( runescape, funescape );
|
| 1673 | return function( elem ) {
|
| 1674 | return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
|
| 1675 | };
|
| 1676 | } ),
|
| 1677 |
|
| 1678 |
|
| 1679 |
|
| 1680 |
|
| 1681 |
|
| 1682 |
|
| 1683 |
|
| 1684 |
|
| 1685 | "lang": markFunction( function( lang ) {
|
| 1686 |
|
| 1687 |
|
| 1688 | if ( !ridentifier.test( lang || "" ) ) {
|
| 1689 | Sizzle.error( "unsupported lang: " + lang );
|
| 1690 | }
|
| 1691 | lang = lang.replace( runescape, funescape ).toLowerCase();
|
| 1692 | return function( elem ) {
|
| 1693 | var elemLang;
|
| 1694 | do {
|
| 1695 | if ( ( elemLang = documentIsHTML ?
|
| 1696 | elem.lang :
|
| 1697 | elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
|
| 1698 |
|
| 1699 | elemLang = elemLang.toLowerCase();
|
| 1700 | return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
|
| 1701 | }
|
| 1702 | } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
|
| 1703 | return false;
|
| 1704 | };
|
| 1705 | } ),
|
| 1706 |
|
| 1707 |
|
| 1708 | "target": function( elem ) {
|
| 1709 | var hash = window.location && window.location.hash;
|
| 1710 | return hash && hash.slice( 1 ) === elem.id;
|
| 1711 | },
|
| 1712 |
|
| 1713 | "root": function( elem ) {
|
| 1714 | return elem === docElem;
|
| 1715 | },
|
| 1716 |
|
| 1717 | "focus": function( elem ) {
|
| 1718 | return elem === document.activeElement &&
|
| 1719 | ( !document.hasFocus || document.hasFocus() ) &&
|
| 1720 | !!( elem.type || elem.href || ~elem.tabIndex );
|
| 1721 | },
|
| 1722 |
|
| 1723 |
|
| 1724 | "enabled": createDisabledPseudo( false ),
|
| 1725 | "disabled": createDisabledPseudo( true ),
|
| 1726 |
|
| 1727 | "checked": function( elem ) {
|
| 1728 |
|
| 1729 |
|
| 1730 |
|
| 1731 | var nodeName = elem.nodeName.toLowerCase();
|
| 1732 | return ( nodeName === "input" && !!elem.checked ) ||
|
| 1733 | ( nodeName === "option" && !!elem.selected );
|
| 1734 | },
|
| 1735 |
|
| 1736 | "selected": function( elem ) {
|
| 1737 |
|
| 1738 |
|
| 1739 |
|
| 1740 | if ( elem.parentNode ) {
|
| 1741 |
|
| 1742 | elem.parentNode.selectedIndex;
|
| 1743 | }
|
| 1744 |
|
| 1745 | return elem.selected === true;
|
| 1746 | },
|
| 1747 |
|
| 1748 |
|
| 1749 | "empty": function( elem ) {
|
| 1750 |
|
| 1751 |
|
| 1752 |
|
| 1753 |
|
| 1754 |
|
| 1755 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
| 1756 | if ( elem.nodeType < 6 ) {
|
| 1757 | return false;
|
| 1758 | }
|
| 1759 | }
|
| 1760 | return true;
|
| 1761 | },
|
| 1762 |
|
| 1763 | "parent": function( elem ) {
|
| 1764 | return !Expr.pseudos[ "empty" ]( elem );
|
| 1765 | },
|
| 1766 |
|
| 1767 |
|
| 1768 | "header": function( elem ) {
|
| 1769 | return rheader.test( elem.nodeName );
|
| 1770 | },
|
| 1771 |
|
| 1772 | "input": function( elem ) {
|
| 1773 | return rinputs.test( elem.nodeName );
|
| 1774 | },
|
| 1775 |
|
| 1776 | "button": function( elem ) {
|
| 1777 | var name = elem.nodeName.toLowerCase();
|
| 1778 | return name === "input" && elem.type === "button" || name === "button";
|
| 1779 | },
|
| 1780 |
|
| 1781 | "text": function( elem ) {
|
| 1782 | var attr;
|
| 1783 | return elem.nodeName.toLowerCase() === "input" &&
|
| 1784 | elem.type === "text" &&
|
| 1785 |
|
| 1786 |
|
| 1787 |
|
| 1788 | ( ( attr = elem.getAttribute( "type" ) ) == null ||
|
| 1789 | attr.toLowerCase() === "text" );
|
| 1790 | },
|
| 1791 |
|
| 1792 |
|
| 1793 | "first": createPositionalPseudo( function() {
|
| 1794 | return [ 0 ];
|
| 1795 | } ),
|
| 1796 |
|
| 1797 | "last": createPositionalPseudo( function( _matchIndexes, length ) {
|
| 1798 | return [ length - 1 ];
|
| 1799 | } ),
|
| 1800 |
|
| 1801 | "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
|
| 1802 | return [ argument < 0 ? argument + length : argument ];
|
| 1803 | } ),
|
| 1804 |
|
| 1805 | "even": createPositionalPseudo( function( matchIndexes, length ) {
|
| 1806 | var i = 0;
|
| 1807 | for ( ; i < length; i += 2 ) {
|
| 1808 | matchIndexes.push( i );
|
| 1809 | }
|
| 1810 | return matchIndexes;
|
| 1811 | } ),
|
| 1812 |
|
| 1813 | "odd": createPositionalPseudo( function( matchIndexes, length ) {
|
| 1814 | var i = 1;
|
| 1815 | for ( ; i < length; i += 2 ) {
|
| 1816 | matchIndexes.push( i );
|
| 1817 | }
|
| 1818 | return matchIndexes;
|
| 1819 | } ),
|
| 1820 |
|
| 1821 | "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
|
| 1822 | var i = argument < 0 ?
|
| 1823 | argument + length :
|
| 1824 | argument > length ?
|
| 1825 | length :
|
| 1826 | argument;
|
| 1827 | for ( ; --i >= 0; ) {
|
| 1828 | matchIndexes.push( i );
|
| 1829 | }
|
| 1830 | return matchIndexes;
|
| 1831 | } ),
|
| 1832 |
|
| 1833 | "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
|
| 1834 | var i = argument < 0 ? argument + length : argument;
|
| 1835 | for ( ; ++i < length; ) {
|
| 1836 | matchIndexes.push( i );
|
| 1837 | }
|
| 1838 | return matchIndexes;
|
| 1839 | } )
|
| 1840 | }
|
| 1841 | };
|
| 1842 |
|
| 1843 | Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
|
| 1844 |
|
| 1845 |
|
| 1846 | for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
|
| 1847 | Expr.pseudos[ i ] = createInputPseudo( i );
|
| 1848 | }
|
| 1849 | for ( i in { submit: true, reset: true } ) {
|
| 1850 | Expr.pseudos[ i ] = createButtonPseudo( i );
|
| 1851 | }
|
| 1852 |
|
| 1853 |
|
| 1854 | function setFilters() {}
|
| 1855 | setFilters.prototype = Expr.filters = Expr.pseudos;
|
| 1856 | Expr.setFilters = new setFilters();
|
| 1857 |
|
| 1858 | tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
|
| 1859 | var matched, match, tokens, type,
|
| 1860 | soFar, groups, preFilters,
|
| 1861 | cached = tokenCache[ selector + " " ];
|
| 1862 |
|
| 1863 | if ( cached ) {
|
| 1864 | return parseOnly ? 0 : cached.slice( 0 );
|
| 1865 | }
|
| 1866 |
|
| 1867 | soFar = selector;
|
| 1868 | groups = [];
|
| 1869 | preFilters = Expr.preFilter;
|
| 1870 |
|
| 1871 | while ( soFar ) {
|
| 1872 |
|
| 1873 |
|
| 1874 | if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
|
| 1875 | if ( match ) {
|
| 1876 |
|
| 1877 |
|
| 1878 | soFar = soFar.slice( match[ 0 ].length ) || soFar;
|
| 1879 | }
|
| 1880 | groups.push( ( tokens = [] ) );
|
| 1881 | }
|
| 1882 |
|
| 1883 | matched = false;
|
| 1884 |
|
| 1885 |
|
| 1886 | if ( ( match = rcombinators.exec( soFar ) ) ) {
|
| 1887 | matched = match.shift();
|
| 1888 | tokens.push( {
|
| 1889 | value: matched,
|
| 1890 |
|
| 1891 |
|
| 1892 | type: match[ 0 ].replace( rtrim, " " )
|
| 1893 | } );
|
| 1894 | soFar = soFar.slice( matched.length );
|
| 1895 | }
|
| 1896 |
|
| 1897 |
|
| 1898 | for ( type in Expr.filter ) {
|
| 1899 | if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
|
| 1900 | ( match = preFilters[ type ]( match ) ) ) ) {
|
| 1901 | matched = match.shift();
|
| 1902 | tokens.push( {
|
| 1903 | value: matched,
|
| 1904 | type: type,
|
| 1905 | matches: match
|
| 1906 | } );
|
| 1907 | soFar = soFar.slice( matched.length );
|
| 1908 | }
|
| 1909 | }
|
| 1910 |
|
| 1911 | if ( !matched ) {
|
| 1912 | break;
|
| 1913 | }
|
| 1914 | }
|
| 1915 |
|
| 1916 |
|
| 1917 |
|
| 1918 |
|
| 1919 | return parseOnly ?
|
| 1920 | soFar.length :
|
| 1921 | soFar ?
|
| 1922 | Sizzle.error( selector ) :
|
| 1923 |
|
| 1924 |
|
| 1925 | tokenCache( selector, groups ).slice( 0 );
|
| 1926 | };
|
| 1927 |
|
| 1928 | function toSelector( tokens ) {
|
| 1929 | var i = 0,
|
| 1930 | len = tokens.length,
|
| 1931 | selector = "";
|
| 1932 | for ( ; i < len; i++ ) {
|
| 1933 | selector += tokens[ i ].value;
|
| 1934 | }
|
| 1935 | return selector;
|
| 1936 | }
|
| 1937 |
|
| 1938 | function addCombinator( matcher, combinator, base ) {
|
| 1939 | var dir = combinator.dir,
|
| 1940 | skip = combinator.next,
|
| 1941 | key = skip || dir,
|
| 1942 | checkNonElements = base && key === "parentNode",
|
| 1943 | doneName = done++;
|
| 1944 |
|
| 1945 | return combinator.first ?
|
| 1946 |
|
| 1947 |
|
| 1948 | function( elem, context, xml ) {
|
| 1949 | while ( ( elem = elem[ dir ] ) ) {
|
| 1950 | if ( elem.nodeType === 1 || checkNonElements ) {
|
| 1951 | return matcher( elem, context, xml );
|
| 1952 | }
|
| 1953 | }
|
| 1954 | return false;
|
| 1955 | } :
|
| 1956 |
|
| 1957 |
|
| 1958 | function( elem, context, xml ) {
|
| 1959 | var oldCache, uniqueCache, outerCache,
|
| 1960 | newCache = [ dirruns, doneName ];
|
| 1961 |
|
| 1962 |
|
| 1963 | if ( xml ) {
|
| 1964 | while ( ( elem = elem[ dir ] ) ) {
|
| 1965 | if ( elem.nodeType === 1 || checkNonElements ) {
|
| 1966 | if ( matcher( elem, context, xml ) ) {
|
| 1967 | return true;
|
| 1968 | }
|
| 1969 | }
|
| 1970 | }
|
| 1971 | } else {
|
| 1972 | while ( ( elem = elem[ dir ] ) ) {
|
| 1973 | if ( elem.nodeType === 1 || checkNonElements ) {
|
| 1974 | outerCache = elem[ expando ] || ( elem[ expando ] = {} );
|
| 1975 |
|
| 1976 |
|
| 1977 |
|
| 1978 | uniqueCache = outerCache[ elem.uniqueID ] ||
|
| 1979 | ( outerCache[ elem.uniqueID ] = {} );
|
| 1980 |
|
| 1981 | if ( skip && skip === elem.nodeName.toLowerCase() ) {
|
| 1982 | elem = elem[ dir ] || elem;
|
| 1983 | } else if ( ( oldCache = uniqueCache[ key ] ) &&
|
| 1984 | oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
|
| 1985 |
|
| 1986 |
|
| 1987 | return ( newCache[ 2 ] = oldCache[ 2 ] );
|
| 1988 | } else {
|
| 1989 |
|
| 1990 |
|
| 1991 | uniqueCache[ key ] = newCache;
|
| 1992 |
|
| 1993 |
|
| 1994 | if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
|
| 1995 | return true;
|
| 1996 | }
|
| 1997 | }
|
| 1998 | }
|
| 1999 | }
|
| 2000 | }
|
| 2001 | return false;
|
| 2002 | };
|
| 2003 | }
|
| 2004 |
|
| 2005 | function elementMatcher( matchers ) {
|
| 2006 | return matchers.length > 1 ?
|
| 2007 | function( elem, context, xml ) {
|
| 2008 | var i = matchers.length;
|
| 2009 | while ( i-- ) {
|
| 2010 | if ( !matchers[ i ]( elem, context, xml ) ) {
|
| 2011 | return false;
|
| 2012 | }
|
| 2013 | }
|
| 2014 | return true;
|
| 2015 | } :
|
| 2016 | matchers[ 0 ];
|
| 2017 | }
|
| 2018 |
|
| 2019 | function multipleContexts( selector, contexts, results ) {
|
| 2020 | var i = 0,
|
| 2021 | len = contexts.length;
|
| 2022 | for ( ; i < len; i++ ) {
|
| 2023 | Sizzle( selector, contexts[ i ], results );
|
| 2024 | }
|
| 2025 | return results;
|
| 2026 | }
|
| 2027 |
|
| 2028 | function condense( unmatched, map, filter, context, xml ) {
|
| 2029 | var elem,
|
| 2030 | newUnmatched = [],
|
| 2031 | i = 0,
|
| 2032 | len = unmatched.length,
|
| 2033 | mapped = map != null;
|
| 2034 |
|
| 2035 | for ( ; i < len; i++ ) {
|
| 2036 | if ( ( elem = unmatched[ i ] ) ) {
|
| 2037 | if ( !filter || filter( elem, context, xml ) ) {
|
| 2038 | newUnmatched.push( elem );
|
| 2039 | if ( mapped ) {
|
| 2040 | map.push( i );
|
| 2041 | }
|
| 2042 | }
|
| 2043 | }
|
| 2044 | }
|
| 2045 |
|
| 2046 | return newUnmatched;
|
| 2047 | }
|
| 2048 |
|
| 2049 | function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
|
| 2050 | if ( postFilter && !postFilter[ expando ] ) {
|
| 2051 | postFilter = setMatcher( postFilter );
|
| 2052 | }
|
| 2053 | if ( postFinder && !postFinder[ expando ] ) {
|
| 2054 | postFinder = setMatcher( postFinder, postSelector );
|
| 2055 | }
|
| 2056 | return markFunction( function( seed, results, context, xml ) {
|
| 2057 | var temp, i, elem,
|
| 2058 | preMap = [],
|
| 2059 | postMap = [],
|
| 2060 | preexisting = results.length,
|
| 2061 |
|
| 2062 |
|
| 2063 | elems = seed || multipleContexts(
|
| 2064 | selector || "*",
|
| 2065 | context.nodeType ? [ context ] : context,
|
| 2066 | []
|
| 2067 | ),
|
| 2068 |
|
| 2069 |
|
| 2070 | matcherIn = preFilter && ( seed || !selector ) ?
|
| 2071 | condense( elems, preMap, preFilter, context, xml ) :
|
| 2072 | elems,
|
| 2073 |
|
| 2074 | matcherOut = matcher ?
|
| 2075 |
|
| 2076 |
|
| 2077 | postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
|
| 2078 |
|
| 2079 |
|
| 2080 | [] :
|
| 2081 |
|
| 2082 |
|
| 2083 | results :
|
| 2084 | matcherIn;
|
| 2085 |
|
| 2086 |
|
| 2087 | if ( matcher ) {
|
| 2088 | matcher( matcherIn, matcherOut, context, xml );
|
| 2089 | }
|
| 2090 |
|
| 2091 |
|
| 2092 | if ( postFilter ) {
|
| 2093 | temp = condense( matcherOut, postMap );
|
| 2094 | postFilter( temp, [], context, xml );
|
| 2095 |
|
| 2096 |
|
| 2097 | i = temp.length;
|
| 2098 | while ( i-- ) {
|
| 2099 | if ( ( elem = temp[ i ] ) ) {
|
| 2100 | matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
|
| 2101 | }
|
| 2102 | }
|
| 2103 | }
|
| 2104 |
|
| 2105 | if ( seed ) {
|
| 2106 | if ( postFinder || preFilter ) {
|
| 2107 | if ( postFinder ) {
|
| 2108 |
|
| 2109 |
|
| 2110 | temp = [];
|
| 2111 | i = matcherOut.length;
|
| 2112 | while ( i-- ) {
|
| 2113 | if ( ( elem = matcherOut[ i ] ) ) {
|
| 2114 |
|
| 2115 |
|
| 2116 | temp.push( ( matcherIn[ i ] = elem ) );
|
| 2117 | }
|
| 2118 | }
|
| 2119 | postFinder( null, ( matcherOut = [] ), temp, xml );
|
| 2120 | }
|
| 2121 |
|
| 2122 |
|
| 2123 | i = matcherOut.length;
|
| 2124 | while ( i-- ) {
|
| 2125 | if ( ( elem = matcherOut[ i ] ) &&
|
| 2126 | ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
|
| 2127 |
|
| 2128 | seed[ temp ] = !( results[ temp ] = elem );
|
| 2129 | }
|
| 2130 | }
|
| 2131 | }
|
| 2132 |
|
| 2133 |
|
| 2134 | } else {
|
| 2135 | matcherOut = condense(
|
| 2136 | matcherOut === results ?
|
| 2137 | matcherOut.splice( preexisting, matcherOut.length ) :
|
| 2138 | matcherOut
|
| 2139 | );
|
| 2140 | if ( postFinder ) {
|
| 2141 | postFinder( null, results, matcherOut, xml );
|
| 2142 | } else {
|
| 2143 | push.apply( results, matcherOut );
|
| 2144 | }
|
| 2145 | }
|
| 2146 | } );
|
| 2147 | }
|
| 2148 |
|
| 2149 | function matcherFromTokens( tokens ) {
|
| 2150 | var checkContext, matcher, j,
|
| 2151 | len = tokens.length,
|
| 2152 | leadingRelative = Expr.relative[ tokens[ 0 ].type ],
|
| 2153 | implicitRelative = leadingRelative || Expr.relative[ " " ],
|
| 2154 | i = leadingRelative ? 1 : 0,
|
| 2155 |
|
| 2156 |
|
| 2157 | matchContext = addCombinator( function( elem ) {
|
| 2158 | return elem === checkContext;
|
| 2159 | }, implicitRelative, true ),
|
| 2160 | matchAnyContext = addCombinator( function( elem ) {
|
| 2161 | return indexOf( checkContext, elem ) > -1;
|
| 2162 | }, implicitRelative, true ),
|
| 2163 | matchers = [ function( elem, context, xml ) {
|
| 2164 | var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
|
| 2165 | ( checkContext = context ).nodeType ?
|
| 2166 | matchContext( elem, context, xml ) :
|
| 2167 | matchAnyContext( elem, context, xml ) );
|
| 2168 |
|
| 2169 |
|
| 2170 | checkContext = null;
|
| 2171 | return ret;
|
| 2172 | } ];
|
| 2173 |
|
| 2174 | for ( ; i < len; i++ ) {
|
| 2175 | if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
|
| 2176 | matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
|
| 2177 | } else {
|
| 2178 | matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
|
| 2179 |
|
| 2180 |
|
| 2181 | if ( matcher[ expando ] ) {
|
| 2182 |
|
| 2183 |
|
| 2184 | j = ++i;
|
| 2185 | for ( ; j < len; j++ ) {
|
| 2186 | if ( Expr.relative[ tokens[ j ].type ] ) {
|
| 2187 | break;
|
| 2188 | }
|
| 2189 | }
|
| 2190 | return setMatcher(
|
| 2191 | i > 1 && elementMatcher( matchers ),
|
| 2192 | i > 1 && toSelector(
|
| 2193 |
|
| 2194 |
|
| 2195 | tokens
|
| 2196 | .slice( 0, i - 1 )
|
| 2197 | .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
|
| 2198 | ).replace( rtrim, "$1" ),
|
| 2199 | matcher,
|
| 2200 | i < j && matcherFromTokens( tokens.slice( i, j ) ),
|
| 2201 | j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
|
| 2202 | j < len && toSelector( tokens )
|
| 2203 | );
|
| 2204 | }
|
| 2205 | matchers.push( matcher );
|
| 2206 | }
|
| 2207 | }
|
| 2208 |
|
| 2209 | return elementMatcher( matchers );
|
| 2210 | }
|
| 2211 |
|
| 2212 | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
| 2213 | var bySet = setMatchers.length > 0,
|
| 2214 | byElement = elementMatchers.length > 0,
|
| 2215 | superMatcher = function( seed, context, xml, results, outermost ) {
|
| 2216 | var elem, j, matcher,
|
| 2217 | matchedCount = 0,
|
| 2218 | i = "0",
|
| 2219 | unmatched = seed && [],
|
| 2220 | setMatched = [],
|
| 2221 | contextBackup = outermostContext,
|
| 2222 |
|
| 2223 |
|
| 2224 | elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
|
| 2225 |
|
| 2226 |
|
| 2227 | dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
|
| 2228 | len = elems.length;
|
| 2229 |
|
| 2230 | if ( outermost ) {
|
| 2231 |
|
| 2232 |
|
| 2233 |
|
| 2234 |
|
| 2235 |
|
| 2236 | outermostContext = context == document || context || outermost;
|
| 2237 | }
|
| 2238 |
|
| 2239 |
|
| 2240 |
|
| 2241 |
|
| 2242 | for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
|
| 2243 | if ( byElement && elem ) {
|
| 2244 | j = 0;
|
| 2245 |
|
| 2246 |
|
| 2247 |
|
| 2248 |
|
| 2249 |
|
| 2250 | if ( !context && elem.ownerDocument != document ) {
|
| 2251 | setDocument( elem );
|
| 2252 | xml = !documentIsHTML;
|
| 2253 | }
|
| 2254 | while ( ( matcher = elementMatchers[ j++ ] ) ) {
|
| 2255 | if ( matcher( elem, context || document, xml ) ) {
|
| 2256 | results.push( elem );
|
| 2257 | break;
|
| 2258 | }
|
| 2259 | }
|
| 2260 | if ( outermost ) {
|
| 2261 | dirruns = dirrunsUnique;
|
| 2262 | }
|
| 2263 | }
|
| 2264 |
|
| 2265 |
|
| 2266 | if ( bySet ) {
|
| 2267 |
|
| 2268 |
|
| 2269 | if ( ( elem = !matcher && elem ) ) {
|
| 2270 | matchedCount--;
|
| 2271 | }
|
| 2272 |
|
| 2273 |
|
| 2274 | if ( seed ) {
|
| 2275 | unmatched.push( elem );
|
| 2276 | }
|
| 2277 | }
|
| 2278 | }
|
| 2279 |
|
| 2280 |
|
| 2281 |
|
| 2282 | matchedCount += i;
|
| 2283 |
|
| 2284 |
|
| 2285 |
|
| 2286 |
|
| 2287 |
|
| 2288 |
|
| 2289 |
|
| 2290 |
|
| 2291 | if ( bySet && i !== matchedCount ) {
|
| 2292 | j = 0;
|
| 2293 | while ( ( matcher = setMatchers[ j++ ] ) ) {
|
| 2294 | matcher( unmatched, setMatched, context, xml );
|
| 2295 | }
|
| 2296 |
|
| 2297 | if ( seed ) {
|
| 2298 |
|
| 2299 |
|
| 2300 | if ( matchedCount > 0 ) {
|
| 2301 | while ( i-- ) {
|
| 2302 | if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
|
| 2303 | setMatched[ i ] = pop.call( results );
|
| 2304 | }
|
| 2305 | }
|
| 2306 | }
|
| 2307 |
|
| 2308 |
|
| 2309 | setMatched = condense( setMatched );
|
| 2310 | }
|
| 2311 |
|
| 2312 |
|
| 2313 | push.apply( results, setMatched );
|
| 2314 |
|
| 2315 |
|
| 2316 | if ( outermost && !seed && setMatched.length > 0 &&
|
| 2317 | ( matchedCount + setMatchers.length ) > 1 ) {
|
| 2318 |
|
| 2319 | Sizzle.uniqueSort( results );
|
| 2320 | }
|
| 2321 | }
|
| 2322 |
|
| 2323 |
|
| 2324 | if ( outermost ) {
|
| 2325 | dirruns = dirrunsUnique;
|
| 2326 | outermostContext = contextBackup;
|
| 2327 | }
|
| 2328 |
|
| 2329 | return unmatched;
|
| 2330 | };
|
| 2331 |
|
| 2332 | return bySet ?
|
| 2333 | markFunction( superMatcher ) :
|
| 2334 | superMatcher;
|
| 2335 | }
|
| 2336 |
|
| 2337 | compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
|
| 2338 | var i,
|
| 2339 | setMatchers = [],
|
| 2340 | elementMatchers = [],
|
| 2341 | cached = compilerCache[ selector + " " ];
|
| 2342 |
|
| 2343 | if ( !cached ) {
|
| 2344 |
|
| 2345 |
|
| 2346 | if ( !match ) {
|
| 2347 | match = tokenize( selector );
|
| 2348 | }
|
| 2349 | i = match.length;
|
| 2350 | while ( i-- ) {
|
| 2351 | cached = matcherFromTokens( match[ i ] );
|
| 2352 | if ( cached[ expando ] ) {
|
| 2353 | setMatchers.push( cached );
|
| 2354 | } else {
|
| 2355 | elementMatchers.push( cached );
|
| 2356 | }
|
| 2357 | }
|
| 2358 |
|
| 2359 |
|
| 2360 | cached = compilerCache(
|
| 2361 | selector,
|
| 2362 | matcherFromGroupMatchers( elementMatchers, setMatchers )
|
| 2363 | );
|
| 2364 |
|
| 2365 |
|
| 2366 | cached.selector = selector;
|
| 2367 | }
|
| 2368 | return cached;
|
| 2369 | };
|
| 2370 |
|
| 2371 | |
| 2372 | |
| 2373 | |
| 2374 | |
| 2375 | |
| 2376 | |
| 2377 | |
| 2378 | |
| 2379 |
|
| 2380 | select = Sizzle.select = function( selector, context, results, seed ) {
|
| 2381 | var i, tokens, token, type, find,
|
| 2382 | compiled = typeof selector === "function" && selector,
|
| 2383 | match = !seed && tokenize( ( selector = compiled.selector || selector ) );
|
| 2384 |
|
| 2385 | results = results || [];
|
| 2386 |
|
| 2387 |
|
| 2388 |
|
| 2389 | if ( match.length === 1 ) {
|
| 2390 |
|
| 2391 |
|
| 2392 | tokens = match[ 0 ] = match[ 0 ].slice( 0 );
|
| 2393 | if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
|
| 2394 | context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
|
| 2395 |
|
| 2396 | context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
|
| 2397 | .replace( runescape, funescape ), context ) || [] )[ 0 ];
|
| 2398 | if ( !context ) {
|
| 2399 | return results;
|
| 2400 |
|
| 2401 |
|
| 2402 | } else if ( compiled ) {
|
| 2403 | context = context.parentNode;
|
| 2404 | }
|
| 2405 |
|
| 2406 | selector = selector.slice( tokens.shift().value.length );
|
| 2407 | }
|
| 2408 |
|
| 2409 |
|
| 2410 | i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
|
| 2411 | while ( i-- ) {
|
| 2412 | token = tokens[ i ];
|
| 2413 |
|
| 2414 |
|
| 2415 | if ( Expr.relative[ ( type = token.type ) ] ) {
|
| 2416 | break;
|
| 2417 | }
|
| 2418 | if ( ( find = Expr.find[ type ] ) ) {
|
| 2419 |
|
| 2420 |
|
| 2421 | if ( ( seed = find(
|
| 2422 | token.matches[ 0 ].replace( runescape, funescape ),
|
| 2423 | rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
|
| 2424 | context
|
| 2425 | ) ) ) {
|
| 2426 |
|
| 2427 |
|
| 2428 | tokens.splice( i, 1 );
|
| 2429 | selector = seed.length && toSelector( tokens );
|
| 2430 | if ( !selector ) {
|
| 2431 | push.apply( results, seed );
|
| 2432 | return results;
|
| 2433 | }
|
| 2434 |
|
| 2435 | break;
|
| 2436 | }
|
| 2437 | }
|
| 2438 | }
|
| 2439 | }
|
| 2440 |
|
| 2441 |
|
| 2442 |
|
| 2443 | ( compiled || compile( selector, match ) )(
|
| 2444 | seed,
|
| 2445 | context,
|
| 2446 | !documentIsHTML,
|
| 2447 | results,
|
| 2448 | !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
|
| 2449 | );
|
| 2450 | return results;
|
| 2451 | };
|
| 2452 |
|
| 2453 |
|
| 2454 |
|
| 2455 |
|
| 2456 | support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
|
| 2457 |
|
| 2458 |
|
| 2459 |
|
| 2460 | support.detectDuplicates = !!hasDuplicate;
|
| 2461 |
|
| 2462 |
|
| 2463 | setDocument();
|
| 2464 |
|
| 2465 |
|
| 2466 |
|
| 2467 | support.sortDetached = assert( function( el ) {
|
| 2468 |
|
| 2469 |
|
| 2470 | return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
|
| 2471 | } );
|
| 2472 |
|
| 2473 |
|
| 2474 |
|
| 2475 |
|
| 2476 | if ( !assert( function( el ) {
|
| 2477 | el.innerHTML = "<a href='#'></a>";
|
| 2478 | return el.firstChild.getAttribute( "href" ) === "#";
|
| 2479 | } ) ) {
|
| 2480 | addHandle( "type|href|height|width", function( elem, name, isXML ) {
|
| 2481 | if ( !isXML ) {
|
| 2482 | return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
|
| 2483 | }
|
| 2484 | } );
|
| 2485 | }
|
| 2486 |
|
| 2487 |
|
| 2488 |
|
| 2489 | if ( !support.attributes || !assert( function( el ) {
|
| 2490 | el.innerHTML = "<input/>";
|
| 2491 | el.firstChild.setAttribute( "value", "" );
|
| 2492 | return el.firstChild.getAttribute( "value" ) === "";
|
| 2493 | } ) ) {
|
| 2494 | addHandle( "value", function( elem, _name, isXML ) {
|
| 2495 | if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
|
| 2496 | return elem.defaultValue;
|
| 2497 | }
|
| 2498 | } );
|
| 2499 | }
|
| 2500 |
|
| 2501 |
|
| 2502 |
|
| 2503 | if ( !assert( function( el ) {
|
| 2504 | return el.getAttribute( "disabled" ) == null;
|
| 2505 | } ) ) {
|
| 2506 | addHandle( booleans, function( elem, name, isXML ) {
|
| 2507 | var val;
|
| 2508 | if ( !isXML ) {
|
| 2509 | return elem[ name ] === true ? name.toLowerCase() :
|
| 2510 | ( val = elem.getAttributeNode( name ) ) && val.specified ?
|
| 2511 | val.value :
|
| 2512 | null;
|
| 2513 | }
|
| 2514 | } );
|
| 2515 | }
|
| 2516 |
|
| 2517 |
|
| 2518 | var _sizzle = window.Sizzle;
|
| 2519 |
|
| 2520 | Sizzle.noConflict = function() {
|
| 2521 | if ( window.Sizzle === Sizzle ) {
|
| 2522 | window.Sizzle = _sizzle;
|
| 2523 | }
|
| 2524 |
|
| 2525 | return Sizzle;
|
| 2526 | };
|
| 2527 |
|
| 2528 | if ( typeof define === "function" && define.amd ) {
|
| 2529 | define( function() {
|
| 2530 | return Sizzle;
|
| 2531 | } );
|
| 2532 |
|
| 2533 |
|
| 2534 | } else if ( typeof module !== "undefined" && module.exports ) {
|
| 2535 | module.exports = Sizzle;
|
| 2536 | } else {
|
| 2537 | window.Sizzle = Sizzle;
|
| 2538 | }
|
| 2539 |
|
| 2540 |
|
| 2541 |
|
| 2542 | } )( window );
|