diff options
| author | jason | 2015-11-16 20:32:09 -0700 |
|---|---|---|
| committer | jason | 2015-11-16 20:32:09 -0700 |
| commit | 9475f75f3500ad35472cabf251460d0e9593fc5f (patch) | |
| tree | 0f17c3fe64c1b42dbc08111328d9601e9f080884 | |
| download | eventmq-9475f75f3500ad35472cabf251460d0e9593fc5f.tar.gz eventmq-9475f75f3500ad35472cabf251460d0e9593fc5f.zip | |
documentation update
34 files changed, 15658 insertions, 0 deletions
diff --git a/_sources/index.txt b/_sources/index.txt new file mode 100644 index 0000000..80569bc --- /dev/null +++ b/_sources/index.txt | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | Welcome to EventMQ's documentation! | ||
| 2 | =================================== | ||
| 3 | |||
| 4 | Contents: | ||
| 5 | |||
| 6 | .. toctree:: | ||
| 7 | :maxdepth: 2 | ||
| 8 | |||
| 9 | receiver | ||
| 10 | router | ||
| 11 | |||
| 12 | |||
| 13 | Indices and tables | ||
| 14 | ================== | ||
| 15 | |||
| 16 | * :ref:`genindex` | ||
| 17 | * :ref:`modindex` | ||
| 18 | * :ref:`search` | ||
| 19 | |||
diff --git a/_sources/receiver.txt b/_sources/receiver.txt new file mode 100644 index 0000000..1b61f63 --- /dev/null +++ b/_sources/receiver.txt | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | .. automodule:: receiver | ||
| 2 | :members: | ||
| 3 | :special-members: | ||
diff --git a/_sources/router.txt b/_sources/router.txt new file mode 100644 index 0000000..8e17e12 --- /dev/null +++ b/_sources/router.txt | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | .. automodule:: router | ||
| 2 | :members: | ||
diff --git a/_static/ajax-loader.gif b/_static/ajax-loader.gif new file mode 100644 index 0000000..61faf8c --- /dev/null +++ b/_static/ajax-loader.gif | |||
| Binary files differ | |||
diff --git a/_static/alabaster.css b/_static/alabaster.css new file mode 100644 index 0000000..07a9e2a --- /dev/null +++ b/_static/alabaster.css | |||
| @@ -0,0 +1,585 @@ | |||
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | @import url("basic.css"); | ||
| 19 | |||
| 20 | /* -- page layout ----------------------------------------------------------- */ | ||
| 21 | |||
| 22 | body { | ||
| 23 | font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; | ||
| 24 | font-size: 17px; | ||
| 25 | background-color: white; | ||
| 26 | color: #000; | ||
| 27 | margin: 0; | ||
| 28 | padding: 0; | ||
| 29 | } | ||
| 30 | |||
| 31 | div.document { | ||
| 32 | width: 940px; | ||
| 33 | margin: 30px auto 0 auto; | ||
| 34 | } | ||
| 35 | |||
| 36 | div.documentwrapper { | ||
| 37 | float: left; | ||
| 38 | width: 100%; | ||
| 39 | } | ||
| 40 | |||
| 41 | div.bodywrapper { | ||
| 42 | margin: 0 0 0 220px; | ||
| 43 | } | ||
| 44 | |||
| 45 | div.sphinxsidebar { | ||
| 46 | width: 220px; | ||
| 47 | } | ||
| 48 | |||
| 49 | hr { | ||
| 50 | border: 1px solid #B1B4B6; | ||
| 51 | } | ||
| 52 | |||
| 53 | div.body { | ||
| 54 | background-color: #ffffff; | ||
| 55 | color: #3E4349; | ||
| 56 | padding: 0 30px 0 30px; | ||
| 57 | } | ||
| 58 | |||
| 59 | div.footer { | ||
| 60 | width: 940px; | ||
| 61 | margin: 20px auto 30px auto; | ||
| 62 | font-size: 14px; | ||
| 63 | color: #888; | ||
| 64 | text-align: right; | ||
| 65 | } | ||
| 66 | |||
| 67 | div.footer a { | ||
| 68 | color: #888; | ||
| 69 | } | ||
| 70 | |||
| 71 | |||
| 72 | div.relations { | ||
| 73 | display: none; | ||
| 74 | } | ||
| 75 | |||
| 76 | |||
| 77 | div.sphinxsidebar a { | ||
| 78 | color: #444; | ||
| 79 | text-decoration: none; | ||
| 80 | border-bottom: 1px dotted #999; | ||
| 81 | } | ||
| 82 | |||
| 83 | div.sphinxsidebar a:hover { | ||
| 84 | border-bottom: 1px solid #999; | ||
| 85 | } | ||
| 86 | |||
| 87 | div.sphinxsidebar { | ||
| 88 | font-size: 14px; | ||
| 89 | line-height: 1.5; | ||
| 90 | } | ||
| 91 | |||
| 92 | div.sphinxsidebarwrapper { | ||
| 93 | padding: 18px 10px; | ||
| 94 | } | ||
| 95 | |||
| 96 | div.sphinxsidebarwrapper p.logo { | ||
| 97 | padding: 0; | ||
| 98 | margin: -10px 0 0 0px; | ||
| 99 | text-align: center; | ||
| 100 | } | ||
| 101 | |||
| 102 | div.sphinxsidebarwrapper h1.logo { | ||
| 103 | margin-top: -10px; | ||
| 104 | text-align: center; | ||
| 105 | margin-bottom: 5px; | ||
| 106 | text-align: left; | ||
| 107 | } | ||
| 108 | |||
| 109 | div.sphinxsidebarwrapper h1.logo-name { | ||
| 110 | margin-top: 0px; | ||
| 111 | } | ||
| 112 | |||
| 113 | div.sphinxsidebarwrapper p.blurb { | ||
| 114 | margin-top: 0; | ||
| 115 | font-style: normal; | ||
| 116 | } | ||
| 117 | |||
| 118 | div.sphinxsidebar h3, | ||
| 119 | div.sphinxsidebar h4 { | ||
| 120 | font-family: 'Garamond', 'Georgia', serif; | ||
| 121 | color: #444; | ||
| 122 | font-size: 24px; | ||
| 123 | font-weight: normal; | ||
| 124 | margin: 0 0 5px 0; | ||
| 125 | padding: 0; | ||
| 126 | } | ||
| 127 | |||
| 128 | div.sphinxsidebar h4 { | ||
| 129 | font-size: 20px; | ||
| 130 | } | ||
| 131 | |||
| 132 | div.sphinxsidebar h3 a { | ||
| 133 | color: #444; | ||
| 134 | } | ||
| 135 | |||
| 136 | div.sphinxsidebar p.logo a, | ||
| 137 | div.sphinxsidebar h3 a, | ||
| 138 | div.sphinxsidebar p.logo a:hover, | ||
| 139 | div.sphinxsidebar h3 a:hover { | ||
| 140 | border: none; | ||
| 141 | } | ||
| 142 | |||
| 143 | div.sphinxsidebar p { | ||
| 144 | color: #555; | ||
| 145 | margin: 10px 0; | ||
| 146 | } | ||
| 147 | |||
| 148 | div.sphinxsidebar ul { | ||
| 149 | margin: 10px 0; | ||
| 150 | padding: 0; | ||
| 151 | color: #000; | ||
| 152 | } | ||
| 153 | |||
| 154 | div.sphinxsidebar ul li.toctree-l1 > a { | ||
| 155 | font-size: 120%; | ||
| 156 | } | ||
| 157 | |||
| 158 | div.sphinxsidebar ul li.toctree-l2 > a { | ||
| 159 | font-size: 110%; | ||
| 160 | } | ||
| 161 | |||
| 162 | div.sphinxsidebar input { | ||
| 163 | border: 1px solid #CCC; | ||
| 164 | font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; | ||
| 165 | font-size: 1em; | ||
| 166 | } | ||
| 167 | |||
| 168 | div.sphinxsidebar hr { | ||
| 169 | border: none; | ||
| 170 | height: 1px; | ||
| 171 | color: #999; | ||
| 172 | background: #999; | ||
| 173 | |||
| 174 | text-align: left; | ||
| 175 | margin-left: 0; | ||
| 176 | width: 50%; | ||
| 177 | } | ||
| 178 | |||
| 179 | /* -- body styles ----------------------------------------------------------- */ | ||
| 180 | |||
| 181 | a { | ||
| 182 | color: #004B6B; | ||
| 183 | text-decoration: underline; | ||
| 184 | } | ||
| 185 | |||
| 186 | a:hover { | ||
| 187 | color: #6D4100; | ||
| 188 | text-decoration: underline; | ||
| 189 | } | ||
| 190 | |||
| 191 | div.body h1, | ||
| 192 | div.body h2, | ||
| 193 | div.body h3, | ||
| 194 | div.body h4, | ||
| 195 | div.body h5, | ||
| 196 | div.body h6 { | ||
| 197 | font-family: 'Garamond', 'Georgia', serif; | ||
| 198 | font-weight: normal; | ||
| 199 | margin: 30px 0px 10px 0px; | ||
| 200 | padding: 0; | ||
| 201 | } | ||
| 202 | |||
| 203 | div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } | ||
| 204 | div.body h2 { font-size: 180%; } | ||
| 205 | div.body h3 { font-size: 150%; } | ||
| 206 | div.body h4 { font-size: 130%; } | ||
| 207 | div.body h5 { font-size: 100%; } | ||
| 208 | div.body h6 { font-size: 100%; } | ||
| 209 | |||
| 210 | a.headerlink { | ||
| 211 | color: #DDD; | ||
| 212 | padding: 0 4px; | ||
| 213 | text-decoration: none; | ||
| 214 | } | ||
| 215 | |||
| 216 | a.headerlink:hover { | ||
| 217 | color: #444; | ||
| 218 | background: #EAEAEA; | ||
| 219 | } | ||
| 220 | |||
| 221 | div.body p, div.body dd, div.body li { | ||
| 222 | line-height: 1.4em; | ||
| 223 | } | ||
| 224 | |||
| 225 | div.admonition { | ||
| 226 | margin: 20px 0px; | ||
| 227 | padding: 10px 30px; | ||
| 228 | background-color: #FCC; | ||
| 229 | border: 1px solid #FAA; | ||
| 230 | } | ||
| 231 | |||
| 232 | div.admonition tt.xref, div.admonition a tt { | ||
| 233 | border-bottom: 1px solid #fafafa; | ||
| 234 | } | ||
| 235 | |||
| 236 | dd div.admonition { | ||
| 237 | margin-left: -60px; | ||
| 238 | padding-left: 60px; | ||
| 239 | } | ||
| 240 | |||
| 241 | div.admonition p.admonition-title { | ||
| 242 | font-family: 'Garamond', 'Georgia', serif; | ||
| 243 | font-weight: normal; | ||
| 244 | font-size: 24px; | ||
| 245 | margin: 0 0 10px 0; | ||
| 246 | padding: 0; | ||
| 247 | line-height: 1; | ||
| 248 | } | ||
| 249 | |||
| 250 | div.admonition p.last { | ||
| 251 | margin-bottom: 0; | ||
| 252 | } | ||
| 253 | |||
| 254 | div.highlight { | ||
| 255 | background-color: white; | ||
| 256 | } | ||
| 257 | |||
| 258 | dt:target, .highlight { | ||
| 259 | background: #FAF3E8; | ||
| 260 | } | ||
| 261 | |||
| 262 | div.note { | ||
| 263 | background-color: #EEE; | ||
| 264 | border: 1px solid #CCC; | ||
| 265 | } | ||
| 266 | |||
| 267 | div.seealso { | ||
| 268 | background-color: #EEE; | ||
| 269 | border: 1px solid #CCC; | ||
| 270 | } | ||
| 271 | |||
| 272 | div.topic { | ||
| 273 | background-color: #eee; | ||
| 274 | } | ||
| 275 | |||
| 276 | p.admonition-title { | ||
| 277 | display: inline; | ||
| 278 | } | ||
| 279 | |||
| 280 | p.admonition-title:after { | ||
| 281 | content: ":"; | ||
| 282 | } | ||
| 283 | |||
| 284 | pre, tt, code { | ||
| 285 | font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; | ||
| 286 | font-size: 0.9em; | ||
| 287 | } | ||
| 288 | |||
| 289 | .hll { | ||
| 290 | background-color: #FFC; | ||
| 291 | margin: 0 -12px; | ||
| 292 | padding: 0 12px; | ||
| 293 | display: block; | ||
| 294 | } | ||
| 295 | |||
| 296 | img.screenshot { | ||
| 297 | } | ||
| 298 | |||
| 299 | tt.descname, tt.descclassname, code.descname, code.descclassname { | ||
| 300 | font-size: 0.95em; | ||
| 301 | } | ||
| 302 | |||
| 303 | tt.descname, code.descname { | ||
| 304 | padding-right: 0.08em; | ||
| 305 | } | ||
| 306 | |||
| 307 | img.screenshot { | ||
| 308 | -moz-box-shadow: 2px 2px 4px #eee; | ||
| 309 | -webkit-box-shadow: 2px 2px 4px #eee; | ||
| 310 | box-shadow: 2px 2px 4px #eee; | ||
| 311 | } | ||
| 312 | |||
| 313 | table.docutils { | ||
| 314 | border: 1px solid #888; | ||
| 315 | -moz-box-shadow: 2px 2px 4px #eee; | ||
| 316 | -webkit-box-shadow: 2px 2px 4px #eee; | ||
| 317 | box-shadow: 2px 2px 4px #eee; | ||
| 318 | } | ||
| 319 | |||
| 320 | table.docutils td, table.docutils th { | ||
| 321 | border: 1px solid #888; | ||
| 322 | padding: 0.25em 0.7em; | ||
| 323 | } | ||
| 324 | |||
| 325 | table.field-list, table.footnote { | ||
| 326 | border: none; | ||
| 327 | -moz-box-shadow: none; | ||
| 328 | -webkit-box-shadow: none; | ||
| 329 | box-shadow: none; | ||
| 330 | } | ||
| 331 | |||
| 332 | table.footnote { | ||
| 333 | margin: 15px 0; | ||
| 334 | width: 100%; | ||
| 335 | border: 1px solid #EEE; | ||
| 336 | background: #FDFDFD; | ||
| 337 | font-size: 0.9em; | ||
| 338 | } | ||
| 339 | |||
| 340 | table.footnote + table.footnote { | ||
| 341 | margin-top: -15px; | ||
| 342 | border-top: none; | ||
| 343 | } | ||
| 344 | |||
| 345 | table.field-list th { | ||
| 346 | padding: 0 0.8em 0 0; | ||
| 347 | } | ||
| 348 | |||
| 349 | table.field-list td { | ||
| 350 | padding: 0; | ||
| 351 | } | ||
| 352 | |||
| 353 | table.footnote td.label { | ||
| 354 | width: 0px; | ||
| 355 | padding: 0.3em 0 0.3em 0.5em; | ||
| 356 | } | ||
| 357 | |||
| 358 | table.footnote td { | ||
| 359 | padding: 0.3em 0.5em; | ||
| 360 | } | ||
| 361 | |||
| 362 | dl { | ||
| 363 | margin: 0; | ||
| 364 | padding: 0; | ||
| 365 | } | ||
| 366 | |||
| 367 | dl dd { | ||
| 368 | margin-left: 30px; | ||
| 369 | } | ||
| 370 | |||
| 371 | blockquote { | ||
| 372 | margin: 0 0 0 30px; | ||
| 373 | padding: 0; | ||
| 374 | } | ||
| 375 | |||
| 376 | ul, ol { | ||
| 377 | margin: 10px 0 10px 30px; | ||
| 378 | padding: 0; | ||
| 379 | } | ||
| 380 | |||
| 381 | pre { | ||
| 382 | background: #EEE; | ||
| 383 | padding: 7px 30px; | ||
| 384 | margin: 15px 0px; | ||
| 385 | line-height: 1.3em; | ||
| 386 | } | ||
| 387 | |||
| 388 | dl pre, blockquote pre, li pre { | ||
| 389 | margin-left: 0; | ||
| 390 | padding-left: 30px; | ||
| 391 | } | ||
| 392 | |||
| 393 | dl dl pre { | ||
| 394 | margin-left: -90px; | ||
| 395 | padding-left: 90px; | ||
| 396 | } | ||
| 397 | |||
| 398 | tt, code { | ||
| 399 | background-color: #ecf0f3; | ||
| 400 | color: #222; | ||
| 401 | /* padding: 1px 2px; */ | ||
| 402 | } | ||
| 403 | |||
| 404 | tt.xref, code.xref, a tt { | ||
| 405 | background-color: #FBFBFB; | ||
| 406 | border-bottom: 1px solid white; | ||
| 407 | } | ||
| 408 | |||
| 409 | a.reference { | ||
| 410 | text-decoration: none; | ||
| 411 | border-bottom: 1px dotted #004B6B; | ||
| 412 | } | ||
| 413 | |||
| 414 | a.reference:hover { | ||
| 415 | border-bottom: 1px solid #6D4100; | ||
| 416 | } | ||
| 417 | |||
| 418 | a.footnote-reference { | ||
| 419 | text-decoration: none; | ||
| 420 | font-size: 0.7em; | ||
| 421 | vertical-align: top; | ||
| 422 | border-bottom: 1px dotted #004B6B; | ||
| 423 | } | ||
| 424 | |||
| 425 | a.footnote-reference:hover { | ||
| 426 | border-bottom: 1px solid #6D4100; | ||
| 427 | } | ||
| 428 | |||
| 429 | a:hover tt, a:hover code { | ||
| 430 | background: #EEE; | ||
| 431 | } | ||
| 432 | |||
| 433 | |||
| 434 | @media screen and (max-width: 870px) { | ||
| 435 | |||
| 436 | div.sphinxsidebar { | ||
| 437 | display: none; | ||
| 438 | } | ||
| 439 | |||
| 440 | div.document { | ||
| 441 | width: 100%; | ||
| 442 | |||
| 443 | } | ||
| 444 | |||
| 445 | div.documentwrapper { | ||
| 446 | margin-left: 0; | ||
| 447 | margin-top: 0; | ||
| 448 | margin-right: 0; | ||
| 449 | margin-bottom: 0; | ||
| 450 | } | ||
| 451 | |||
| 452 | div.bodywrapper { | ||
| 453 | margin-top: 0; | ||
| 454 | margin-right: 0; | ||
| 455 | margin-bottom: 0; | ||
| 456 | margin-left: 0; | ||
| 457 | } | ||
| 458 | |||
| 459 | ul { | ||
| 460 | margin-left: 0; | ||
| 461 | } | ||
| 462 | |||
| 463 | .document { | ||
| 464 | width: auto; | ||
| 465 | } | ||
| 466 | |||
| 467 | .footer { | ||
| 468 | width: auto; | ||
| 469 | } | ||
| 470 | |||
| 471 | .bodywrapper { | ||
| 472 | margin: 0; | ||
| 473 | } | ||
| 474 | |||
| 475 | .footer { | ||
| 476 | width: auto; | ||
| 477 | } | ||
| 478 | |||
| 479 | .github { | ||
| 480 | display: none; | ||
| 481 | } | ||
| 482 | |||
| 483 | |||
| 484 | |||
| 485 | } | ||
| 486 | |||
| 487 | |||
| 488 | |||
| 489 | @media screen and (max-width: 875px) { | ||
| 490 | |||
| 491 | body { | ||
| 492 | margin: 0; | ||
| 493 | padding: 20px 30px; | ||
| 494 | } | ||
| 495 | |||
| 496 | div.documentwrapper { | ||
| 497 | float: none; | ||
| 498 | background: white; | ||
| 499 | } | ||
| 500 | |||
| 501 | div.sphinxsidebar { | ||
| 502 | display: block; | ||
| 503 | float: none; | ||
| 504 | width: 102.5%; | ||
| 505 | margin: 50px -30px -20px -30px; | ||
| 506 | padding: 10px 20px; | ||
| 507 | background: #333; | ||
| 508 | color: #FFF; | ||
| 509 | } | ||
| 510 | |||
| 511 | div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, | ||
| 512 | div.sphinxsidebar h3 a { | ||
| 513 | color: white; | ||
| 514 | } | ||
| 515 | |||
| 516 | div.sphinxsidebar a { | ||
| 517 | color: #AAA; | ||
| 518 | } | ||
| 519 | |||
| 520 | div.sphinxsidebar p.logo { | ||
| 521 | display: none; | ||
| 522 | } | ||
| 523 | |||
| 524 | div.document { | ||
| 525 | width: 100%; | ||
| 526 | margin: 0; | ||
| 527 | } | ||
| 528 | |||
| 529 | div.footer { | ||
| 530 | display: none; | ||
| 531 | } | ||
| 532 | |||
| 533 | div.bodywrapper { | ||
| 534 | margin: 0; | ||
| 535 | } | ||
| 536 | |||
| 537 | div.body { | ||
| 538 | min-height: 0; | ||
| 539 | padding: 0; | ||
| 540 | } | ||
| 541 | |||
| 542 | .rtd_doc_footer { | ||
| 543 | display: none; | ||
| 544 | } | ||
| 545 | |||
| 546 | .document { | ||
| 547 | width: auto; | ||
| 548 | } | ||
| 549 | |||
| 550 | .footer { | ||
| 551 | width: auto; | ||
| 552 | } | ||
| 553 | |||
| 554 | .footer { | ||
| 555 | width: auto; | ||
| 556 | } | ||
| 557 | |||
| 558 | .github { | ||
| 559 | display: none; | ||
| 560 | } | ||
| 561 | } | ||
| 562 | |||
| 563 | |||
| 564 | /* misc. */ | ||
| 565 | |||
| 566 | .revsys-inline { | ||
| 567 | display: none!important; | ||
| 568 | } | ||
| 569 | |||
| 570 | /* Make nested-list/multi-paragraph items look better in Releases changelog | ||
| 571 | * pages. Without this, docutils' magical list fuckery causes inconsistent | ||
| 572 | * formatting between different release sub-lists. | ||
| 573 | */ | ||
| 574 | div#changelog > div.section > ul > li > p:only-child { | ||
| 575 | margin-bottom: 0; | ||
| 576 | } | ||
| 577 | |||
| 578 | /* Hide fugly table cell borders in ..bibliography:: directive output */ | ||
| 579 | table.docutils.citation, table.docutils.citation td, table.docutils.citation th { | ||
| 580 | border: none; | ||
| 581 | /* Below needed in some edge cases; if not applied, bottom shadows appear */ | ||
| 582 | -moz-box-shadow: none; | ||
| 583 | -webkit-box-shadow: none; | ||
| 584 | box-shadow: none; | ||
| 585 | } \ No newline at end of file | ||
diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 0000000..9fa77d8 --- /dev/null +++ b/_static/basic.css | |||
| @@ -0,0 +1,599 @@ | |||
| 1 | /* | ||
| 2 | * basic.css | ||
| 3 | * ~~~~~~~~~ | ||
| 4 | * | ||
| 5 | * Sphinx stylesheet -- basic theme. | ||
| 6 | * | ||
| 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. | ||
| 8 | * :license: BSD, see LICENSE for details. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | /* -- main layout ----------------------------------------------------------- */ | ||
| 13 | |||
| 14 | div.clearer { | ||
| 15 | clear: both; | ||
| 16 | } | ||
| 17 | |||
| 18 | /* -- relbar ---------------------------------------------------------------- */ | ||
| 19 | |||
| 20 | div.related { | ||
| 21 | width: 100%; | ||
| 22 | font-size: 90%; | ||
| 23 | } | ||
| 24 | |||
| 25 | div.related h3 { | ||
| 26 | display: none; | ||
| 27 | } | ||
| 28 | |||
| 29 | div.related ul { | ||
| 30 | margin: 0; | ||
| 31 | padding: 0 0 0 10px; | ||
| 32 | list-style: none; | ||
| 33 | } | ||
| 34 | |||
| 35 | div.related li { | ||
| 36 | display: inline; | ||
| 37 | } | ||
| 38 | |||
| 39 | div.related li.right { | ||
| 40 | float: right; | ||
| 41 | margin-right: 5px; | ||
| 42 | } | ||
| 43 | |||
| 44 | /* -- sidebar --------------------------------------------------------------- */ | ||
| 45 | |||
| 46 | div.sphinxsidebarwrapper { | ||
| 47 | padding: 10px 5px 0 10px; | ||
| 48 | } | ||
| 49 | |||
| 50 | div.sphinxsidebar { | ||
| 51 | float: left; | ||
| 52 | width: 230px; | ||
| 53 | margin-left: -100%; | ||
| 54 | font-size: 90%; | ||
| 55 | } | ||
| 56 | |||
| 57 | div.sphinxsidebar ul { | ||
| 58 | list-style: none; | ||
| 59 | } | ||
| 60 | |||
| 61 | div.sphinxsidebar ul ul, | ||
| 62 | div.sphinxsidebar ul.want-points { | ||
| 63 | margin-left: 20px; | ||
| 64 | list-style: square; | ||
| 65 | } | ||
| 66 | |||
| 67 | div.sphinxsidebar ul ul { | ||
| 68 | margin-top: 0; | ||
| 69 | margin-bottom: 0; | ||
| 70 | } | ||
| 71 | |||
| 72 | div.sphinxsidebar form { | ||
| 73 | margin-top: 10px; | ||
| 74 | } | ||
| 75 | |||
| 76 | div.sphinxsidebar input { | ||
| 77 | border: 1px solid #98dbcc; | ||
| 78 | font-family: sans-serif; | ||
| 79 | font-size: 1em; | ||
| 80 | } | ||
| 81 | |||
| 82 | div.sphinxsidebar #searchbox input[type="text"] { | ||
| 83 | width: 170px; | ||
| 84 | } | ||
| 85 | |||
| 86 | div.sphinxsidebar #searchbox input[type="submit"] { | ||
| 87 | width: 30px; | ||
| 88 | } | ||
| 89 | |||
| 90 | img { | ||
| 91 | border: 0; | ||
| 92 | max-width: 100%; | ||
| 93 | } | ||
| 94 | |||
| 95 | /* -- search page ----------------------------------------------------------- */ | ||
| 96 | |||
| 97 | ul.search { | ||
| 98 | margin: 10px 0 0 20px; | ||
| 99 | padding: 0; | ||
| 100 | } | ||
| 101 | |||
| 102 | ul.search li { | ||
| 103 | padding: 5px 0 5px 20px; | ||
| 104 | background-image: url(file.png); | ||
| 105 | background-repeat: no-repeat; | ||
| 106 | background-position: 0 7px; | ||
| 107 | } | ||
| 108 | |||
| 109 | ul.search li a { | ||
| 110 | font-weight: bold; | ||
| 111 | } | ||
| 112 | |||
| 113 | ul.search li div.context { | ||
| 114 | color: #888; | ||
| 115 | margin: 2px 0 0 30px; | ||
| 116 | text-align: left; | ||
| 117 | } | ||
| 118 | |||
| 119 | ul.keywordmatches li.goodmatch a { | ||
| 120 | font-weight: bold; | ||
| 121 | } | ||
| 122 | |||
| 123 | /* -- index page ------------------------------------------------------------ */ | ||
| 124 | |||
| 125 | table.contentstable { | ||
| 126 | width: 90%; | ||
| 127 | } | ||
| 128 | |||
| 129 | table.contentstable p.biglink { | ||
| 130 | line-height: 150%; | ||
| 131 | } | ||
| 132 | |||
| 133 | a.biglink { | ||
| 134 | font-size: 1.3em; | ||
| 135 | } | ||
| 136 | |||
| 137 | span.linkdescr { | ||
| 138 | font-style: italic; | ||
| 139 | padding-top: 5px; | ||
| 140 | font-size: 90%; | ||
| 141 | } | ||
| 142 | |||
| 143 | /* -- general index --------------------------------------------------------- */ | ||
| 144 | |||
| 145 | table.indextable { | ||
| 146 | width: 100%; | ||
| 147 | } | ||
| 148 | |||
| 149 | table.indextable td { | ||
| 150 | text-align: left; | ||
| 151 | vertical-align: top; | ||
| 152 | } | ||
| 153 | |||
| 154 | table.indextable dl, table.indextable dd { | ||
| 155 | margin-top: 0; | ||
| 156 | margin-bottom: 0; | ||
| 157 | } | ||
| 158 | |||
| 159 | table.indextable tr.pcap { | ||
| 160 | height: 10px; | ||
| 161 | } | ||
| 162 | |||
| 163 | table.indextable tr.cap { | ||
| 164 | margin-top: 10px; | ||
| 165 | background-color: #f2f2f2; | ||
| 166 | } | ||
| 167 | |||
| 168 | img.toggler { | ||
| 169 | margin-right: 3px; | ||
| 170 | margin-top: 3px; | ||
| 171 | cursor: pointer; | ||
| 172 | } | ||
| 173 | |||
| 174 | div.modindex-jumpbox { | ||
| 175 | border-top: 1px solid #ddd; | ||
| 176 | border-bottom: 1px solid #ddd; | ||
| 177 | margin: 1em 0 1em 0; | ||
| 178 | padding: 0.4em; | ||
| 179 | } | ||
| 180 | |||
| 181 | div.genindex-jumpbox { | ||
| 182 | border-top: 1px solid #ddd; | ||
| 183 | border-bottom: 1px solid #ddd; | ||
| 184 | margin: 1em 0 1em 0; | ||
| 185 | padding: 0.4em; | ||
| 186 | } | ||
| 187 | |||
| 188 | /* -- general body styles --------------------------------------------------- */ | ||
| 189 | |||
| 190 | a.headerlink { | ||
| 191 | visibility: hidden; | ||
| 192 | } | ||
| 193 | |||
| 194 | h1:hover > a.headerlink, | ||
| 195 | h2:hover > a.headerlink, | ||
| 196 | h3:hover > a.headerlink, | ||
| 197 | h4:hover > a.headerlink, | ||
| 198 | h5:hover > a.headerlink, | ||
| 199 | h6:hover > a.headerlink, | ||
| 200 | dt:hover > a.headerlink, | ||
| 201 | caption:hover > a.headerlink, | ||
| 202 | p.caption:hover > a.headerlink, | ||
| 203 | div.code-block-caption:hover > a.headerlink { | ||
| 204 | visibility: visible; | ||
| 205 | } | ||
| 206 | |||
| 207 | div.body p.caption { | ||
| 208 | text-align: inherit; | ||
| 209 | } | ||
| 210 | |||
| 211 | div.body td { | ||
| 212 | text-align: left; | ||
| 213 | } | ||
| 214 | |||
| 215 | .field-list ul { | ||
| 216 | padding-left: 1em; | ||
| 217 | } | ||
| 218 | |||
| 219 | .first { | ||
| 220 | margin-top: 0 !important; | ||
| 221 | } | ||
| 222 | |||
| 223 | p.rubric { | ||
| 224 | margin-top: 30px; | ||
| 225 | font-weight: bold; | ||
| 226 | } | ||
| 227 | |||
| 228 | img.align-left, .figure.align-left, object.align-left { | ||
| 229 | clear: left; | ||
| 230 | float: left; | ||
| 231 | margin-right: 1em; | ||
| 232 | } | ||
| 233 | |||
| 234 | img.align-right, .figure.align-right, object.align-right { | ||
| 235 | clear: right; | ||
| 236 | float: right; | ||
| 237 | margin-left: 1em; | ||
| 238 | } | ||
| 239 | |||
| 240 | img.align-center, .figure.align-center, object.align-center { | ||
| 241 | display: block; | ||
| 242 | margin-left: auto; | ||
| 243 | margin-right: auto; | ||
| 244 | } | ||
| 245 | |||
| 246 | .align-left { | ||
| 247 | text-align: left; | ||
| 248 | } | ||
| 249 | |||
| 250 | .align-center { | ||
| 251 | text-align: center; | ||
| 252 | } | ||
| 253 | |||
| 254 | .align-right { | ||
| 255 | text-align: right; | ||
| 256 | } | ||
| 257 | |||
| 258 | /* -- sidebars -------------------------------------------------------------- */ | ||
| 259 | |||
| 260 | div.sidebar { | ||
| 261 | margin: 0 0 0.5em 1em; | ||
| 262 | border: 1px solid #ddb; | ||
| 263 | padding: 7px 7px 0 7px; | ||
| 264 | background-color: #ffe; | ||
| 265 | width: 40%; | ||
| 266 | float: right; | ||
| 267 | } | ||
| 268 | |||
| 269 | p.sidebar-title { | ||
| 270 | font-weight: bold; | ||
| 271 | } | ||
| 272 | |||
| 273 | /* -- topics ---------------------------------------------------------------- */ | ||
| 274 | |||
| 275 | div.topic { | ||
| 276 | border: 1px solid #ccc; | ||
| 277 | padding: 7px 7px 0 7px; | ||
| 278 | margin: 10px 0 10px 0; | ||
| 279 | } | ||
| 280 | |||
| 281 | p.topic-title { | ||
| 282 | font-size: 1.1em; | ||
| 283 | font-weight: bold; | ||
| 284 | margin-top: 10px; | ||
| 285 | } | ||
| 286 | |||
| 287 | /* -- admonitions ----------------------------------------------------------- */ | ||
| 288 | |||
| 289 | div.admonition { | ||
| 290 | margin-top: 10px; | ||
| 291 | margin-bottom: 10px; | ||
| 292 | padding: 7px; | ||
| 293 | } | ||
| 294 | |||
| 295 | div.admonition dt { | ||
| 296 | font-weight: bold; | ||
| 297 | } | ||
| 298 | |||
| 299 | div.admonition dl { | ||
| 300 | margin-bottom: 0; | ||
| 301 | } | ||
| 302 | |||
| 303 | p.admonition-title { | ||
| 304 | margin: 0px 10px 5px 0px; | ||
| 305 | font-weight: bold; | ||
| 306 | } | ||
| 307 | |||
| 308 | div.body p.centered { | ||
| 309 | text-align: center; | ||
| 310 | margin-top: 25px; | ||
| 311 | } | ||
| 312 | |||
| 313 | /* -- tables ---------------------------------------------------------------- */ | ||
| 314 | |||
| 315 | table.docutils { | ||
| 316 | border: 0; | ||
| 317 | border-collapse: collapse; | ||
| 318 | } | ||
| 319 | |||
| 320 | table caption span.caption-number { | ||
| 321 | font-style: italic; | ||
| 322 | } | ||
| 323 | |||
| 324 | table caption span.caption-text { | ||
| 325 | } | ||
| 326 | |||
| 327 | table.docutils td, table.docutils th { | ||
| 328 | padding: 1px 8px 1px 5px; | ||
| 329 | border-top: 0; | ||
| 330 | border-left: 0; | ||
| 331 | border-right: 0; | ||
| 332 | border-bottom: 1px solid #aaa; | ||
| 333 | } | ||
| 334 | |||
| 335 | table.field-list td, table.field-list th { | ||
| 336 | border: 0 !important; | ||
| 337 | } | ||
| 338 | |||
| 339 | table.footnote td, table.footnote th { | ||
| 340 | border: 0 !important; | ||
| 341 | } | ||
| 342 | |||
| 343 | th { | ||
| 344 | text-align: left; | ||
| 345 | padding-right: 5px; | ||
| 346 | } | ||
| 347 | |||
| 348 | table.citation { | ||
| 349 | border-left: solid 1px gray; | ||
| 350 | margin-left: 1px; | ||
| 351 | } | ||
| 352 | |||
| 353 | table.citation td { | ||
| 354 | border-bottom: none; | ||
| 355 | } | ||
| 356 | |||
| 357 | /* -- figures --------------------------------------------------------------- */ | ||
| 358 | |||
| 359 | div.figure { | ||
| 360 | margin: 0.5em; | ||
| 361 | padding: 0.5em; | ||
| 362 | } | ||
| 363 | |||
| 364 | div.figure p.caption { | ||
| 365 | padding: 0.3em; | ||
| 366 | } | ||
| 367 | |||
| 368 | div.figure p.caption span.caption-number { | ||
| 369 | font-style: italic; | ||
| 370 | } | ||
| 371 | |||
| 372 | div.figure p.caption span.caption-text { | ||
| 373 | } | ||
| 374 | |||
| 375 | |||
| 376 | /* -- other body styles ----------------------------------------------------- */ | ||
| 377 | |||
| 378 | ol.arabic { | ||
| 379 | list-style: decimal; | ||
| 380 | } | ||
| 381 | |||
| 382 | ol.loweralpha { | ||
| 383 | list-style: lower-alpha; | ||
| 384 | } | ||
| 385 | |||
| 386 | ol.upperalpha { | ||
| 387 | list-style: upper-alpha; | ||
| 388 | } | ||
| 389 | |||
| 390 | ol.lowerroman { | ||
| 391 | list-style: lower-roman; | ||
| 392 | } | ||
| 393 | |||
| 394 | ol.upperroman { | ||
| 395 | list-style: upper-roman; | ||
| 396 | } | ||
| 397 | |||
| 398 | dl { | ||
| 399 | margin-bottom: 15px; | ||
| 400 | } | ||
| 401 | |||
| 402 | dd p { | ||
| 403 | margin-top: 0px; | ||
| 404 | } | ||
| 405 | |||
| 406 | dd ul, dd table { | ||
| 407 | margin-bottom: 10px; | ||
| 408 | } | ||
| 409 | |||
| 410 | dd { | ||
| 411 | margin-top: 3px; | ||
| 412 | margin-bottom: 10px; | ||
| 413 | margin-left: 30px; | ||
| 414 | } | ||
| 415 | |||
| 416 | dt:target, .highlighted { | ||
| 417 | background-color: #fbe54e; | ||
| 418 | } | ||
| 419 | |||
| 420 | dl.glossary dt { | ||
| 421 | font-weight: bold; | ||
| 422 | font-size: 1.1em; | ||
| 423 | } | ||
| 424 | |||
| 425 | .field-list ul { | ||
| 426 | margin: 0; | ||
| 427 | padding-left: 1em; | ||
| 428 | } | ||
| 429 | |||
| 430 | .field-list p { | ||
| 431 | margin: 0; | ||
| 432 | } | ||
| 433 | |||
| 434 | .optional { | ||
| 435 | font-size: 1.3em; | ||
| 436 | } | ||
| 437 | |||
| 438 | .sig-paren { | ||
| 439 | font-size: larger; | ||
| 440 | } | ||
| 441 | |||
| 442 | .versionmodified { | ||
| 443 | font-style: italic; | ||
| 444 | } | ||
| 445 | |||
| 446 | .system-message { | ||
| 447 | background-color: #fda; | ||
| 448 | padding: 5px; | ||
| 449 | border: 3px solid red; | ||
| 450 | } | ||
| 451 | |||
| 452 | .footnote:target { | ||
| 453 | background-color: #ffa; | ||
| 454 | } | ||
| 455 | |||
| 456 | .line-block { | ||
| 457 | display: block; | ||
| 458 | margin-top: 1em; | ||
| 459 | margin-bottom: 1em; | ||
| 460 | } | ||
| 461 | |||
| 462 | .line-block .line-block { | ||
| 463 | margin-top: 0; | ||
| 464 | margin-bottom: 0; | ||
| 465 | margin-left: 1.5em; | ||
| 466 | } | ||
| 467 | |||
| 468 | .guilabel, .menuselection { | ||
| 469 | font-family: sans-serif; | ||
| 470 | } | ||
| 471 | |||
| 472 | .accelerator { | ||
| 473 | text-decoration: underline; | ||
| 474 | } | ||
| 475 | |||
| 476 | .classifier { | ||
| 477 | font-style: oblique; | ||
| 478 | } | ||
| 479 | |||
| 480 | abbr, acronym { | ||
| 481 | border-bottom: dotted 1px; | ||
| 482 | cursor: help; | ||
| 483 | } | ||
| 484 | |||
| 485 | /* -- code displays --------------------------------------------------------- */ | ||
| 486 | |||
| 487 | pre { | ||
| 488 | overflow: auto; | ||
| 489 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ | ||
| 490 | } | ||
| 491 | |||
| 492 | td.linenos pre { | ||
| 493 | padding: 5px 0px; | ||
| 494 | border: 0; | ||
| 495 | background-color: transparent; | ||
| 496 | color: #aaa; | ||
| 497 | } | ||
| 498 | |||
| 499 | table.highlighttable { | ||
| 500 | margin-left: 0.5em; | ||
| 501 | } | ||
| 502 | |||
| 503 | table.highlighttable td { | ||
| 504 | padding: 0 0.5em 0 0.5em; | ||
| 505 | } | ||
| 506 | |||
| 507 | div.code-block-caption { | ||
| 508 | padding: 2px 5px; | ||
| 509 | font-size: small; | ||
| 510 | } | ||
| 511 | |||
| 512 | div.code-block-caption code { | ||
| 513 | background-color: transparent; | ||
| 514 | } | ||
| 515 | |||
| 516 | div.code-block-caption + div > div.highlight > pre { | ||
| 517 | margin-top: 0; | ||
| 518 | } | ||
| 519 | |||
| 520 | div.code-block-caption span.caption-number { | ||
| 521 | padding: 0.1em 0.3em; | ||
| 522 | font-style: italic; | ||
| 523 | } | ||
| 524 | |||
| 525 | div.code-block-caption span.caption-text { | ||
| 526 | } | ||
| 527 | |||
| 528 | div.literal-block-wrapper { | ||
| 529 | padding: 1em 1em 0; | ||
| 530 | } | ||
| 531 | |||
| 532 | div.literal-block-wrapper div.highlight { | ||
| 533 | margin: 0; | ||
| 534 | } | ||
| 535 | |||
| 536 | code.descname { | ||
| 537 | background-color: transparent; | ||
| 538 | font-weight: bold; | ||
| 539 | font-size: 1.2em; | ||
| 540 | } | ||
| 541 | |||
| 542 | code.descclassname { | ||
| 543 | background-color: transparent; | ||
| 544 | } | ||
| 545 | |||
| 546 | code.xref, a code { | ||
| 547 | background-color: transparent; | ||
| 548 | font-weight: bold; | ||
| 549 | } | ||
| 550 | |||
| 551 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { | ||
| 552 | background-color: transparent; | ||
| 553 | } | ||
| 554 | |||
| 555 | .viewcode-link { | ||
| 556 | float: right; | ||
| 557 | } | ||
| 558 | |||
| 559 | .viewcode-back { | ||
| 560 | float: right; | ||
| 561 | font-family: sans-serif; | ||
| 562 | } | ||
| 563 | |||
| 564 | div.viewcode-block:target { | ||
| 565 | margin: -1px -10px; | ||
| 566 | padding: 0 10px; | ||
| 567 | } | ||
| 568 | |||
| 569 | /* -- math display ---------------------------------------------------------- */ | ||
| 570 | |||
| 571 | img.math { | ||
| 572 | vertical-align: middle; | ||
| 573 | } | ||
| 574 | |||
| 575 | div.body div.math p { | ||
| 576 | text-align: center; | ||
| 577 | } | ||
| 578 | |||
| 579 | span.eqno { | ||
| 580 | float: right; | ||
| 581 | } | ||
| 582 | |||
| 583 | /* -- printout stylesheet --------------------------------------------------- */ | ||
| 584 | |||
| 585 | @media print { | ||
| 586 | div.document, | ||
| 587 | div.documentwrapper, | ||
| 588 | div.bodywrapper { | ||
| 589 | margin: 0 !important; | ||
| 590 | width: 100%; | ||
| 591 | } | ||
| 592 | |||
| 593 | div.sphinxsidebar, | ||
| 594 | div.related, | ||
| 595 | div.footer, | ||
| 596 | #top-link { | ||
| 597 | display: none; | ||
| 598 | } | ||
| 599 | } \ No newline at end of file | ||
diff --git a/_static/classic.css b/_static/classic.css new file mode 100644 index 0000000..2da9234 --- /dev/null +++ b/_static/classic.css | |||
| @@ -0,0 +1,261 @@ | |||
| 1 | /* | ||
| 2 | * default.css_t | ||
| 3 | * ~~~~~~~~~~~~~ | ||
| 4 | * | ||
| 5 | * Sphinx stylesheet -- default theme. | ||
| 6 | * | ||
| 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. | ||
| 8 | * :license: BSD, see LICENSE for details. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | @import url("basic.css"); | ||
| 13 | |||
| 14 | /* -- page layout ----------------------------------------------------------- */ | ||
| 15 | |||
| 16 | body { | ||
| 17 | font-family: sans-serif; | ||
| 18 | font-size: 100%; | ||
| 19 | background-color: #11303d; | ||
| 20 | color: #000; | ||
| 21 | margin: 0; | ||
| 22 | padding: 0; | ||
| 23 | } | ||
| 24 | |||
| 25 | div.document { | ||
| 26 | background-color: #1c4e63; | ||
| 27 | } | ||
| 28 | |||
| 29 | div.documentwrapper { | ||
| 30 | float: left; | ||
| 31 | width: 100%; | ||
| 32 | } | ||
| 33 | |||
| 34 | div.bodywrapper { | ||
| 35 | margin: 0 0 0 230px; | ||
| 36 | } | ||
| 37 | |||
| 38 | div.body { | ||
| 39 | background-color: #ffffff; | ||
| 40 | color: #000000; | ||
| 41 | padding: 0 20px 30px 20px; | ||
| 42 | } | ||
| 43 | |||
| 44 | div.footer { | ||
| 45 | color: #ffffff; | ||
| 46 | width: 100%; | ||
| 47 | padding: 9px 0 9px 0; | ||
| 48 | text-align: center; | ||
| 49 | font-size: 75%; | ||
| 50 | } | ||
| 51 | |||
| 52 | div.footer a { | ||
| 53 | color: #ffffff; | ||
| 54 | text-decoration: underline; | ||
| 55 | } | ||
| 56 | |||
| 57 | div.related { | ||
| 58 | background-color: #133f52; | ||
| 59 | line-height: 30px; | ||
| 60 | color: #ffffff; | ||
| 61 | } | ||
| 62 | |||
| 63 | div.related a { | ||
| 64 | color: #ffffff; | ||
| 65 | } | ||
| 66 | |||
| 67 | div.sphinxsidebar { | ||
| 68 | } | ||
| 69 | |||
| 70 | div.sphinxsidebar h3 { | ||
| 71 | font-family: 'Trebuchet MS', sans-serif; | ||
| 72 | color: #ffffff; | ||
| 73 | font-size: 1.4em; | ||
| 74 | font-weight: normal; | ||
| 75 | margin: 0; | ||
| 76 | padding: 0; | ||
| 77 | } | ||
| 78 | |||
| 79 | div.sphinxsidebar h3 a { | ||
| 80 | color: #ffffff; | ||
| 81 | } | ||
| 82 | |||
| 83 | div.sphinxsidebar h4 { | ||
| 84 | font-family: 'Trebuchet MS', sans-serif; | ||
| 85 | color: #ffffff; | ||
| 86 | font-size: 1.3em; | ||
| 87 | font-weight: normal; | ||
| 88 | margin: 5px 0 0 0; | ||
| 89 | padding: 0; | ||
| 90 | } | ||
| 91 | |||
| 92 | div.sphinxsidebar p { | ||
| 93 | color: #ffffff; | ||
| 94 | } | ||
| 95 | |||
| 96 | div.sphinxsidebar p.topless { | ||
| 97 | margin: 5px 10px 10px 10px; | ||
| 98 | } | ||
| 99 | |||
| 100 | div.sphinxsidebar ul { | ||
| 101 | margin: 10px; | ||
| 102 | padding: 0; | ||
| 103 | color: #ffffff; | ||
| 104 | } | ||
| 105 | |||
| 106 | div.sphinxsidebar a { | ||
| 107 | color: #98dbcc; | ||
| 108 | } | ||
| 109 | |||
| 110 | div.sphinxsidebar input { | ||
| 111 | border: 1px solid #98dbcc; | ||
| 112 | font-family: sans-serif; | ||
| 113 | font-size: 1em; | ||
| 114 | } | ||
| 115 | |||
| 116 | |||
| 117 | |||
| 118 | /* -- hyperlink styles ------------------------------------------------------ */ | ||
| 119 | |||
| 120 | a { | ||
| 121 | color: #355f7c; | ||
| 122 | text-decoration: none; | ||
| 123 | } | ||
| 124 | |||
| 125 | a:visited { | ||
| 126 | color: #355f7c; | ||
| 127 | text-decoration: none; | ||
| 128 | } | ||
| 129 | |||
| 130 | a:hover { | ||
| 131 | text-decoration: underline; | ||
| 132 | } | ||
| 133 | |||
| 134 | |||
| 135 | |||
| 136 | /* -- body styles ----------------------------------------------------------- */ | ||
| 137 | |||
| 138 | div.body h1, | ||
| 139 | div.body h2, | ||
| 140 | div.body h3, | ||
| 141 | div.body h4, | ||
| 142 | div.body h5, | ||
| 143 | div.body h6 { | ||
| 144 | font-family: 'Trebuchet MS', sans-serif; | ||
| 145 | background-color: #f2f2f2; | ||
| 146 | font-weight: normal; | ||
| 147 | color: #20435c; | ||
| 148 | border-bottom: 1px solid #ccc; | ||
| 149 | margin: 20px -20px 10px -20px; | ||
| 150 | padding: 3px 0 3px 10px; | ||
| 151 | } | ||
| 152 | |||
| 153 | div.body h1 { margin-top: 0; font-size: 200%; } | ||
| 154 | div.body h2 { font-size: 160%; } | ||
| 155 | div.body h3 { font-size: 140%; } | ||
| 156 | div.body h4 { font-size: 120%; } | ||
| 157 | div.body h5 { font-size: 110%; } | ||
| 158 | div.body h6 { font-size: 100%; } | ||
| 159 | |||
| 160 | a.headerlink { | ||
| 161 | color: #c60f0f; | ||
| 162 | font-size: 0.8em; | ||
| 163 | padding: 0 4px 0 4px; | ||
| 164 | text-decoration: none; | ||
| 165 | } | ||
| 166 | |||
| 167 | a.headerlink:hover { | ||
| 168 | background-color: #c60f0f; | ||
| 169 | color: white; | ||
| 170 | } | ||
| 171 | |||
| 172 | div.body p, div.body dd, div.body li { | ||
| 173 | text-align: justify; | ||
| 174 | line-height: 130%; | ||
| 175 | } | ||
| 176 | |||
| 177 | div.admonition p.admonition-title + p { | ||
| 178 | display: inline; | ||
| 179 | } | ||
| 180 | |||
| 181 | div.admonition p { | ||
| 182 | margin-bottom: 5px; | ||
| 183 | } | ||
| 184 | |||
| 185 | div.admonition pre { | ||
| 186 | margin-bottom: 5px; | ||
| 187 | } | ||
| 188 | |||
| 189 | div.admonition ul, div.admonition ol { | ||
| 190 | margin-bottom: 5px; | ||
| 191 | } | ||
| 192 | |||
| 193 | div.note { | ||
| 194 | background-color: #eee; | ||
| 195 | border: 1px solid #ccc; | ||
| 196 | } | ||
| 197 | |||
| 198 | div.seealso { | ||
| 199 | background-color: #ffc; | ||
| 200 | border: 1px solid #ff6; | ||
| 201 | } | ||
| 202 | |||
| 203 | div.topic { | ||
| 204 | background-color: #eee; | ||
| 205 | } | ||
| 206 | |||
| 207 | div.warning { | ||
| 208 | background-color: #ffe4e4; | ||
| 209 | border: 1px solid #f66; | ||
| 210 | } | ||
| 211 | |||
| 212 | p.admonition-title { | ||
| 213 | display: inline; | ||
| 214 | } | ||
| 215 | |||
| 216 | p.admonition-title:after { | ||
| 217 | content: ":"; | ||
| 218 | } | ||
| 219 | |||
| 220 | pre { | ||
| 221 | padding: 5px; | ||
| 222 | background-color: #eeffcc; | ||
| 223 | color: #333333; | ||
| 224 | line-height: 120%; | ||
| 225 | border: 1px solid #ac9; | ||
| 226 | border-left: none; | ||
| 227 | border-right: none; | ||
| 228 | } | ||
| 229 | |||
| 230 | code { | ||
| 231 | background-color: #ecf0f3; | ||
| 232 | padding: 0 1px 0 1px; | ||
| 233 | font-size: 0.95em; | ||
| 234 | } | ||
| 235 | |||
| 236 | th { | ||
| 237 | background-color: #ede; | ||
| 238 | } | ||
| 239 | |||
| 240 | .warning code { | ||
| 241 | background: #efc2c2; | ||
| 242 | } | ||
| 243 | |||
| 244 | .note code { | ||
| 245 | background: #d6d6d6; | ||
| 246 | } | ||
| 247 | |||
| 248 | .viewcode-back { | ||
| 249 | font-family: sans-serif; | ||
| 250 | } | ||
| 251 | |||
| 252 | div.viewcode-block:target { | ||
| 253 | background-color: #f4debf; | ||
| 254 | border-top: 1px solid #ac9; | ||
| 255 | border-bottom: 1px solid #ac9; | ||
| 256 | } | ||
| 257 | |||
| 258 | div.code-block-caption { | ||
| 259 | color: #efefef; | ||
| 260 | background-color: #1c4e63; | ||
| 261 | } \ No newline at end of file | ||
diff --git a/_static/comment-bright.png b/_static/comment-bright.png new file mode 100644 index 0000000..551517b --- /dev/null +++ b/_static/comment-bright.png | |||
| Binary files differ | |||
diff --git a/_static/comment-close.png b/_static/comment-close.png new file mode 100644 index 0000000..09b54be --- /dev/null +++ b/_static/comment-close.png | |||
| Binary files differ | |||
diff --git a/_static/comment.png b/_static/comment.png new file mode 100644 index 0000000..92feb52 --- /dev/null +++ b/_static/comment.png | |||
| Binary files differ | |||
diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 0000000..c7bfe76 --- /dev/null +++ b/_static/doctools.js | |||
| @@ -0,0 +1,263 @@ | |||
| 1 | /* | ||
| 2 | * doctools.js | ||
| 3 | * ~~~~~~~~~~~ | ||
| 4 | * | ||
| 5 | * Sphinx JavaScript utilities for all documentation. | ||
| 6 | * | ||
| 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. | ||
| 8 | * :license: BSD, see LICENSE for details. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | /** | ||
| 13 | * select a different prefix for underscore | ||
| 14 | */ | ||
| 15 | $u = _.noConflict(); | ||
| 16 | |||
| 17 | /** | ||
| 18 | * make the code below compatible with browsers without | ||
| 19 | * an installed firebug like debugger | ||
| 20 | if (!window.console || !console.firebug) { | ||
| 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", | ||
| 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", | ||
| 23 | "profile", "profileEnd"]; | ||
| 24 | window.console = {}; | ||
| 25 | for (var i = 0; i < names.length; ++i) | ||
| 26 | window.console[names[i]] = function() {}; | ||
| 27 | } | ||
| 28 | */ | ||
| 29 | |||
| 30 | /** | ||
| 31 | * small helper function to urldecode strings | ||
| 32 | */ | ||
| 33 | jQuery.urldecode = function(x) { | ||
| 34 | return decodeURIComponent(x).replace(/\+/g, ' '); | ||
| 35 | }; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * small helper function to urlencode strings | ||
| 39 | */ | ||
| 40 | jQuery.urlencode = encodeURIComponent; | ||
| 41 | |||
| 42 | /** | ||
| 43 | * This function returns the parsed url parameters of the | ||
| 44 | * current request. Multiple values per key are supported, | ||
| 45 | * it will always return arrays of strings for the value parts. | ||
| 46 | */ | ||
| 47 | jQuery.getQueryParameters = function(s) { | ||
| 48 | if (typeof s == 'undefined') | ||
| 49 | s = document.location.search; | ||
| 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); | ||
| 51 | var result = {}; | ||
| 52 | for (var i = 0; i < parts.length; i++) { | ||
| 53 | var tmp = parts[i].split('=', 2); | ||
| 54 | var key = jQuery.urldecode(tmp[0]); | ||
| 55 | var value = jQuery.urldecode(tmp[1]); | ||
| 56 | if (key in result) | ||
| 57 | result[key].push(value); | ||
| 58 | else | ||
| 59 | result[key] = [value]; | ||
| 60 | } | ||
| 61 | return result; | ||
| 62 | }; | ||
| 63 | |||
| 64 | /** | ||
| 65 | * highlight a given string on a jquery object by wrapping it in | ||
| 66 | * span elements with the given class name. | ||
| 67 | */ | ||
| 68 | jQuery.fn.highlightText = function(text, className) { | ||
| 69 | function highlight(node) { | ||
| 70 | if (node.nodeType == 3) { | ||
| 71 | var val = node.nodeValue; | ||
| 72 | var pos = val.toLowerCase().indexOf(text); | ||
| 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { | ||
| 74 | var span = document.createElement("span"); | ||
| 75 | span.className = className; | ||
| 76 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); | ||
| 77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( | ||
| 78 | document.createTextNode(val.substr(pos + text.length)), | ||
| 79 | node.nextSibling)); | ||
| 80 | node.nodeValue = val.substr(0, pos); | ||
| 81 | } | ||
| 82 | } | ||
| 83 | else if (!jQuery(node).is("button, select, textarea")) { | ||
| 84 | jQuery.each(node.childNodes, function() { | ||
| 85 | highlight(this); | ||
| 86 | }); | ||
| 87 | } | ||
| 88 | } | ||
| 89 | return this.each(function() { | ||
| 90 | highlight(this); | ||
| 91 | }); | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* | ||
| 95 | * backward compatibility for jQuery.browser | ||
| 96 | * This will be supported until firefox bug is fixed. | ||
| 97 | */ | ||
| 98 | if (!jQuery.browser) { | ||
| 99 | jQuery.uaMatch = function(ua) { | ||
| 100 | ua = ua.toLowerCase(); | ||
| 101 | |||
| 102 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || | ||
| 103 | /(webkit)[ \/]([\w.]+)/.exec(ua) || | ||
| 104 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || | ||
| 105 | /(msie) ([\w.]+)/.exec(ua) || | ||
| 106 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || | ||
| 107 | []; | ||
| 108 | |||
| 109 | return { | ||
| 110 | browser: match[ 1 ] || "", | ||
| 111 | version: match[ 2 ] || "0" | ||
| 112 | }; | ||
| 113 | }; | ||
| 114 | jQuery.browser = {}; | ||
| 115 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; | ||
| 116 | } | ||
| 117 | |||
| 118 | /** | ||
| 119 | * Small JavaScript module for the documentation. | ||
| 120 | */ | ||
| 121 | var Documentation = { | ||
| 122 | |||
| 123 | init : function() { | ||
| 124 | this.fixFirefoxAnchorBug(); | ||
| 125 | this.highlightSearchWords(); | ||
| 126 | this.initIndexTable(); | ||
| 127 | }, | ||
| 128 | |||
| 129 | /** | ||
| 130 | * i18n support | ||
| 131 | */ | ||
| 132 | TRANSLATIONS : {}, | ||
| 133 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, | ||
| 134 | LOCALE : 'unknown', | ||
| 135 | |||
| 136 | // gettext and ngettext don't access this so that the functions | ||
| 137 | // can safely bound to a different name (_ = Documentation.gettext) | ||
| 138 | gettext : function(string) { | ||
| 139 | var translated = Documentation.TRANSLATIONS[string]; | ||
| 140 | if (typeof translated == 'undefined') | ||
| 141 | return string; | ||
| 142 | return (typeof translated == 'string') ? translated : translated[0]; | ||
| 143 | }, | ||
| 144 | |||
| 145 | ngettext : function(singular, plural, n) { | ||
| 146 | var translated = Documentation.TRANSLATIONS[singular]; | ||
| 147 | if (typeof translated == 'undefined') | ||
| 148 | return (n == 1) ? singular : plural; | ||
| 149 | return translated[Documentation.PLURALEXPR(n)]; | ||
| 150 | }, | ||
| 151 | |||
| 152 | addTranslations : function(catalog) { | ||
| 153 | for (var key in catalog.messages) | ||
| 154 | this.TRANSLATIONS[key] = catalog.messages[key]; | ||
| 155 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); | ||
| 156 | this.LOCALE = catalog.locale; | ||
| 157 | }, | ||
| 158 | |||
| 159 | /** | ||
| 160 | * add context elements like header anchor links | ||
| 161 | */ | ||
| 162 | addContextElements : function() { | ||
| 163 | $('div[id] > :header:first').each(function() { | ||
| 164 | $('<a class="headerlink">\u00B6</a>'). | ||
| 165 | attr('href', '#' + this.id). | ||
| 166 | attr('title', _('Permalink to this headline')). | ||
| 167 | appendTo(this); | ||
| 168 | }); | ||
| 169 | $('dt[id]').each(function() { | ||
| 170 | $('<a class="headerlink">\u00B6</a>'). | ||
| 171 | attr('href', '#' + this.id). | ||
| 172 | attr('title', _('Permalink to this definition')). | ||
| 173 | appendTo(this); | ||
| 174 | }); | ||
| 175 | }, | ||
| 176 | |||
| 177 | /** | ||
| 178 | * workaround a firefox stupidity | ||
| 179 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 | ||
| 180 | */ | ||
| 181 | fixFirefoxAnchorBug : function() { | ||
| 182 | if (document.location.hash) | ||
| 183 | window.setTimeout(function() { | ||
| 184 | document.location.href += ''; | ||
| 185 | }, 10); | ||
| 186 | }, | ||
| 187 | |||
| 188 | /** | ||
| 189 | * highlight the search words provided in the url in the text | ||
| 190 | */ | ||
| 191 | highlightSearchWords : function() { | ||
| 192 | var params = $.getQueryParameters(); | ||
| 193 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; | ||
| 194 | if (terms.length) { | ||
| 195 | var body = $('div.body'); | ||
| 196 | if (!body.length) { | ||
| 197 | body = $('body'); | ||
| 198 | } | ||
| 199 | window.setTimeout(function() { | ||
| 200 | $.each(terms, function() { | ||
| 201 | body.highlightText(this.toLowerCase(), 'highlighted'); | ||
| 202 | }); | ||
| 203 | }, 10); | ||
| 204 | $('<p class="highlight-link"><a href="javascript:Documentation.' + | ||
| 205 | 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>') | ||
| 206 | .appendTo($('#searchbox')); | ||
| 207 | } | ||
| 208 | }, | ||
| 209 | |||
| 210 | /** | ||
| 211 | * init the domain index toggle buttons | ||
| 212 | */ | ||
| 213 | initIndexTable : function() { | ||
| 214 | var togglers = $('img.toggler').click(function() { | ||
| 215 | var src = $(this).attr('src'); | ||
| 216 | var idnum = $(this).attr('id').substr(7); | ||
| 217 | $('tr.cg-' + idnum).toggle(); | ||
| 218 | if (src.substr(-9) == 'minus.png') | ||
| 219 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); | ||
| 220 | else | ||
| 221 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); | ||
| 222 | }).css('display', ''); | ||
| 223 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { | ||
| 224 | togglers.click(); | ||
| 225 | } | ||
| 226 | }, | ||
| 227 | |||
| 228 | /** | ||
| 229 | * helper function to hide the search marks again | ||
| 230 | */ | ||
| 231 | hideSearchWords : function() { | ||
| 232 | $('#searchbox .highlight-link').fadeOut(300); | ||
| 233 | $('span.highlighted').removeClass('highlighted'); | ||
| 234 | }, | ||
| 235 | |||
| 236 | /** | ||
| 237 | * make the url absolute | ||
| 238 | */ | ||
| 239 | makeURL : function(relativeURL) { | ||
| 240 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; | ||
| 241 | }, | ||
| 242 | |||
| 243 | /** | ||
| 244 | * get the current relative url | ||
| 245 | */ | ||
| 246 | getCurrentURL : function() { | ||
| 247 | var path = document.location.pathname; | ||
| 248 | var parts = path.split(/\//); | ||
| 249 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { | ||
| 250 | if (this == '..') | ||
| 251 | parts.pop(); | ||
| 252 | }); | ||
| 253 | var url = parts.join('/'); | ||
| 254 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); | ||
| 255 | } | ||
| 256 | }; | ||
| 257 | |||
| 258 | // quick alias for translations | ||
| 259 | _ = Documentation.gettext; | ||
| 260 | |||
| 261 | $(document).ready(function() { | ||
| 262 | Documentation.init(); | ||
| 263 | }); | ||
diff --git a/_static/down-pressed.png b/_static/down-pressed.png new file mode 100644 index 0000000..7c30d00 --- /dev/null +++ b/_static/down-pressed.png | |||
| Binary files differ | |||
diff --git a/_static/down.png b/_static/down.png new file mode 100644 index 0000000..f48098a --- /dev/null +++ b/_static/down.png | |||
| Binary files differ | |||
diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 0000000..254c60b --- /dev/null +++ b/_static/file.png | |||
| Binary files differ | |||
diff --git a/_static/jquery-1.11.1.js b/_static/jquery-1.11.1.js new file mode 100644 index 0000000..d4b67f7 --- /dev/null +++ b/_static/jquery-1.11.1.js | |||
| @@ -0,0 +1,10308 @@ | |||
| 1 | /*! | ||
| 2 | * jQuery JavaScript Library v1.11.1 | ||
| 3 | * http://jquery.com/ | ||
| 4 | * | ||
| 5 | * Includes Sizzle.js | ||
| 6 | * http://sizzlejs.com/ | ||
| 7 | * | ||
| 8 | * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors | ||
| 9 | * Released under the MIT license | ||
| 10 | * http://jquery.org/license | ||
| 11 | * | ||
| 12 | * Date: 2014-05-01T17:42Z | ||
| 13 | */ | ||
| 14 | |||
| 15 | (function( global, factory ) { | ||
| 16 | |||
| 17 | if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
| 18 | // For CommonJS and CommonJS-like environments where a proper window is present, | ||
| 19 | // execute the factory and get jQuery | ||
| 20 | // For environments that do not inherently posses a window with a document | ||
| 21 | // (such as Node.js), expose a jQuery-making factory as module.exports | ||
| 22 | // This accentuates the need for the creation of a real window | ||
| 23 | // e.g. var jQuery = require("jquery")(window); | ||
| 24 | // See ticket #14549 for more info | ||
| 25 | module.exports = global.document ? | ||
| 26 | factory( global, true ) : | ||
| 27 | function( w ) { | ||
| 28 | if ( !w.document ) { | ||
| 29 | throw new Error( "jQuery requires a window with a document" ); | ||
| 30 | } | ||
| 31 | return factory( w ); | ||
| 32 | }; | ||
| 33 | } else { | ||
| 34 | factory( global ); | ||
| 35 | } | ||
| 36 | |||
| 37 | // Pass this if window is not defined yet | ||
| 38 | }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | ||
| 39 | |||
| 40 | // Can't do this because several apps including ASP.NET trace | ||
| 41 | // the stack via arguments.caller.callee and Firefox dies if | ||
| 42 | // you try to trace through "use strict" call chains. (#13335) | ||
| 43 | // Support: Firefox 18+ | ||
| 44 | // | ||
| 45 | |||
| 46 | var deletedIds = []; | ||
| 47 | |||
| 48 | var slice = deletedIds.slice; | ||
| 49 | |||
| 50 | var concat = deletedIds.concat; | ||
| 51 | |||
| 52 | var push = deletedIds.push; | ||
| 53 | |||
| 54 | var indexOf = deletedIds.indexOf; | ||
| 55 | |||
| 56 | var class2type = {}; | ||
| 57 | |||
| 58 | var toString = class2type.toString; | ||
| 59 | |||
| 60 | var hasOwn = class2type.hasOwnProperty; | ||
| 61 | |||
| 62 | var support = {}; | ||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | var | ||
| 67 | version = "1.11.1", | ||
| 68 | |||
| 69 | // Define a local copy of jQuery | ||
| 70 | jQuery = function( selector, context ) { | ||
| 71 | // The jQuery object is actually just the init constructor 'enhanced' | ||
| 72 | // Need init if jQuery is called (just allow error to be thrown if not included) | ||
| 73 | return new jQuery.fn.init( selector, context ); | ||
| 74 | }, | ||
| 75 | |||
| 76 | // Support: Android<4.1, IE<9 | ||
| 77 | // Make sure we trim BOM and NBSP | ||
| 78 | rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, | ||
| 79 | |||
| 80 | // Matches dashed string for camelizing | ||
| 81 | rmsPrefix = /^-ms-/, | ||
| 82 | rdashAlpha = /-([\da-z])/gi, | ||
| 83 | |||
| 84 | // Used by jQuery.camelCase as callback to replace() | ||
| 85 | fcamelCase = function( all, letter ) { | ||
| 86 | return letter.toUpperCase(); | ||
| 87 | }; | ||
| 88 | |||
| 89 | jQuery.fn = jQuery.prototype = { | ||
| 90 | // The current version of jQuery being used | ||
| 91 | jquery: version, | ||
| 92 | |||
| 93 | constructor: jQuery, | ||
| 94 | |||
| 95 | // Start with an empty selector | ||
| 96 | selector: "", | ||
| 97 | |||
| 98 | // The default length of a jQuery object is 0 | ||
| 99 | length: 0, | ||
| 100 | |||
| 101 | toArray: function() { | ||
| 102 | return slice.call( this ); | ||
| 103 | }, | ||
| 104 | |||
| 105 | // Get the Nth element in the matched element set OR | ||
| 106 | // Get the whole matched element set as a clean array | ||
| 107 | get: function( num ) { | ||
| 108 | return num != null ? | ||
| 109 | |||
| 110 | // Return just the one element from the set | ||
| 111 | ( num < 0 ? this[ num + this.length ] : this[ num ] ) : | ||
| 112 | |||
| 113 | // Return all the elements in a clean array | ||
| 114 | slice.call( this ); | ||
| 115 | }, | ||
| 116 | |||
| 117 | // Take an array of elements and push it onto the stack | ||
| 118 | // (returning the new matched element set) | ||
| 119 | pushStack: function( elems ) { | ||
| 120 | |||
| 121 | // Build a new jQuery matched element set | ||
| 122 | var ret = jQuery.merge( this.constructor(), elems ); | ||
| 123 | |||
| 124 | // Add the old object onto the stack (as a reference) | ||
| 125 | ret.prevObject = this; | ||
| 126 | ret.context = this.context; | ||
| 127 | |||
| 128 | // Return the newly-formed element set | ||
| 129 | return ret; | ||
| 130 | }, | ||
| 131 | |||
| 132 | // Execute a callback for every element in the matched set. | ||
| 133 | // (You can seed the arguments with an array of args, but this is | ||
| 134 | // only used internally.) | ||
| 135 | each: function( callback, args ) { | ||
| 136 | return jQuery.each( this, callback, args ); | ||
| 137 | }, | ||
| 138 | |||
| 139 | map: function( callback ) { | ||
| 140 | return this.pushStack( jQuery.map(this, function( elem, i ) { | ||
| 141 | return callback.call( elem, i, elem ); | ||
| 142 | })); | ||
| 143 | }, | ||
| 144 | |||
| 145 | slice: function() { | ||
| 146 | return this.pushStack( slice.apply( this, arguments ) ); | ||
| 147 | }, | ||
| 148 | |||
| 149 | first: function() { | ||
| 150 | return this.eq( 0 ); | ||
| 151 | }, | ||
| 152 | |||
| 153 | last: function() { | ||
| 154 | return this.eq( -1 ); | ||
| 155 | }, | ||
| 156 | |||
| 157 | eq: function( i ) { | ||
| 158 | var len = this.length, | ||
| 159 | j = +i + ( i < 0 ? len : 0 ); | ||
| 160 | return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); | ||
| 161 | }, | ||
| 162 | |||
| 163 | end: function() { | ||
| 164 | return this.prevObject || this.constructor(null); | ||
| 165 | }, | ||
| 166 | |||
| 167 | // For internal use only. | ||
| 168 | // Behaves like an Array's method, not like a jQuery method. | ||
| 169 | push: push, | ||
| 170 | sort: deletedIds.sort, | ||
| 171 | splice: deletedIds.splice | ||
| 172 | }; | ||
| 173 | |||
| 174 | jQuery.extend = jQuery.fn.extend = function() { | ||
| 175 | var src, copyIsArray, copy, name, options, clone, | ||
| 176 | target = arguments[0] || {}, | ||
| 177 | i = 1, | ||
| 178 | length = arguments.length, | ||
| 179 | deep = false; | ||
| 180 | |||
| 181 | // Handle a deep copy situation | ||
| 182 | if ( typeof target === "boolean" ) { | ||
| 183 | deep = target; | ||
| 184 | |||
| 185 | // skip the boolean and the target | ||
| 186 | target = arguments[ i ] || {}; | ||
| 187 | i++; | ||
| 188 | } | ||
| 189 | |||
| 190 | // Handle case when target is a string or something (possible in deep copy) | ||
| 191 | if ( typeof target !== "object" && !jQuery.isFunction(target) ) { | ||
| 192 | target = {}; | ||
| 193 | } | ||
| 194 | |||
| 195 | // extend jQuery itself if only one argument is passed | ||
| 196 | if ( i === length ) { | ||
| 197 | target = this; | ||
| 198 | i--; | ||
| 199 | } | ||
| 200 | |||
| 201 | for ( ; i < length; i++ ) { | ||
| 202 | // Only deal with non-null/undefined values | ||
| 203 | if ( (options = arguments[ i ]) != null ) { | ||
| 204 | // Extend the base object | ||
| 205 | for ( name in options ) { | ||
| 206 | src = target[ name ]; | ||
| 207 | copy = options[ name ]; | ||
| 208 | |||
| 209 | // Prevent never-ending loop | ||
| 210 | if ( target === copy ) { | ||
| 211 | continue; | ||
| 212 | } | ||
| 213 | |||
| 214 | // Recurse if we're merging plain objects or arrays | ||
| 215 | if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { | ||
| 216 | if ( copyIsArray ) { | ||
| 217 | copyIsArray = false; | ||
| 218 | clone = src && jQuery.isArray(src) ? src : []; | ||
| 219 | |||
| 220 | } else { | ||
| 221 | clone = src && jQuery.isPlainObject(src) ? src : {}; | ||
| 222 | } | ||
| 223 | |||
| 224 | // Never move original objects, clone them | ||
| 225 | target[ name ] = jQuery.extend( deep, clone, copy ); | ||
| 226 | |||
| 227 | // Don't bring in undefined values | ||
| 228 | } else if ( copy !== undefined ) { | ||
| 229 | target[ name ] = copy; | ||
| 230 | } | ||
| 231 | } | ||
| 232 | } | ||
| 233 | } | ||
| 234 | |||
| 235 | // Return the modified object | ||
| 236 | return target; | ||
| 237 | }; | ||
| 238 | |||
| 239 | jQuery.extend({ | ||
| 240 | // Unique for each copy of jQuery on the page | ||
| 241 | expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), | ||
| 242 | |||
| 243 | // Assume jQuery is ready without the ready module | ||
| 244 | isReady: true, | ||
| 245 | |||
| 246 | error: function( msg ) { | ||
| 247 | throw new Error( msg ); | ||
| 248 | }, | ||
| 249 | |||
| 250 | noop: function() {}, | ||
| 251 | |||
| 252 | // See test/unit/core.js for details concerning isFunction. | ||
| 253 | // Since version 1.3, DOM methods and functions like alert | ||
| 254 | // aren't supported. They return false on IE (#2968). | ||
| 255 | isFunction: function( obj ) { | ||
| 256 | return jQuery.type(obj) === "function"; | ||
| 257 | }, | ||
| 258 | |||
| 259 | isArray: Array.isArray || function( obj ) { | ||
| 260 | return jQuery.type(obj) === "array"; | ||
| 261 | }, | ||
| 262 | |||
| 263 | isWindow: function( obj ) { | ||
| 264 | /* jshint eqeqeq: false */ | ||
| 265 | return obj != null && obj == obj.window; | ||
| 266 | }, | ||
| 267 | |||
| 268 | isNumeric: function( obj ) { | ||
| 269 | // parseFloat NaNs numeric-cast false positives (null|true|false|"") | ||
| 270 | // ...but misinterprets leading-number strings, particularly hex literals ("0x...") | ||
| 271 | // subtraction forces infinities to NaN | ||
| 272 | return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; | ||
| 273 | }, | ||
| 274 | |||
| 275 | isEmptyObject: function( obj ) { | ||
| 276 | var name; | ||
| 277 | for ( name in obj ) { | ||
| 278 | return false; | ||
| 279 | } | ||
| 280 | return true; | ||
| 281 | }, | ||
| 282 | |||
| 283 | isPlainObject: function( obj ) { | ||
| 284 | var key; | ||
| 285 | |||
| 286 | // Must be an Object. | ||
| 287 | // Because of IE, we also have to check the presence of the constructor property. | ||
| 288 | // Make sure that DOM nodes and window objects don't pass through, as well | ||
| 289 | if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { | ||
| 290 | return false; | ||
| 291 | } | ||
| 292 | |||
| 293 | try { | ||
| 294 | // Not own constructor property must be Object | ||
| 295 | if ( obj.constructor && | ||
| 296 | !hasOwn.call(obj, "constructor") && | ||
| 297 | !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { | ||
| 298 | return false; | ||
| 299 | } | ||
| 300 | } catch ( e ) { | ||
| 301 | // IE8,9 Will throw exceptions on certain host objects #9897 | ||
| 302 | return false; | ||
| 303 | } | ||
| 304 | |||
| 305 | // Support: IE<9 | ||
| 306 | // Handle iteration over inherited properties before own properties. | ||
| 307 | if ( support.ownLast ) { | ||
| 308 | for ( key in obj ) { | ||
| 309 | return hasOwn.call( obj, key ); | ||
| 310 | } | ||
| 311 | } | ||
| 312 | |||
| 313 | // Own properties are enumerated firstly, so to speed up, | ||
| 314 | // if last one is own, then all properties are own. | ||
| 315 | for ( key in obj ) {} | ||
| 316 | |||
| 317 | return key === undefined || hasOwn.call( obj, key ); | ||
| 318 | }, | ||
| 319 | |||
| 320 | type: function( obj ) { | ||
| 321 | if ( obj == null ) { | ||
| 322 | return obj + ""; | ||
| 323 | } | ||
| 324 | return typeof obj === "object" || typeof obj === "function" ? | ||
| 325 | class2type[ toString.call(obj) ] || "object" : | ||
| 326 | typeof obj; | ||
| 327 | }, | ||
| 328 | |||
| 329 | // Evaluates a script in a global context | ||
| 330 | // Workarounds based on findings by Jim Driscoll | ||
| 331 | // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context | ||
| 332 | globalEval: function( data ) { | ||
| 333 | if ( data && jQuery.trim( data ) ) { | ||
| 334 | // We use execScript on Internet Explorer | ||
| 335 | // We use an anonymous function so that context is window | ||
| 336 | // rather than jQuery in Firefox | ||
| 337 | ( window.execScript || function( data ) { | ||
| 338 | window[ "eval" ].call( window, data ); | ||
| 339 | } )( data ); | ||
| 340 | } | ||
| 341 | }, | ||
| 342 | |||
| 343 | // Convert dashed to camelCase; used by the css and data modules | ||
| 344 | // Microsoft forgot to hump their vendor prefix (#9572) | ||
| 345 | camelCase: function( string ) { | ||
| 346 | return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); | ||
| 347 | }, | ||
| 348 | |||
| 349 | nodeName: function( elem, name ) { | ||
| 350 | return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); | ||
| 351 | }, | ||
| 352 | |||
| 353 | // args is for internal usage only | ||
| 354 | each: function( obj, callback, args ) { | ||
| 355 | var value, | ||
| 356 | i = 0, | ||
| 357 | length = obj.length, | ||
| 358 | isArray = isArraylike( obj ); | ||
| 359 | |||
| 360 | if ( args ) { | ||
| 361 | if ( isArray ) { | ||
| 362 | for ( ; i < length; i++ ) { | ||
| 363 | value = callback.apply( obj[ i ], args ); | ||
| 364 | |||
| 365 | if ( value === false ) { | ||
| 366 | break; | ||
| 367 | } | ||
| 368 | } | ||
| 369 | } else { | ||
| 370 | for ( i in obj ) { | ||
| 371 | value = callback.apply( obj[ i ], args ); | ||
| 372 | |||
| 373 | if ( value === false ) { | ||
| 374 | break; | ||
| 375 | } | ||
| 376 | } | ||
| 377 | } | ||
| 378 | |||
| 379 | // A special, fast, case for the most common use of each | ||
| 380 | } else { | ||
| 381 | if ( isArray ) { | ||
| 382 | for ( ; i < length; i++ ) { | ||
| 383 | value = callback.call( obj[ i ], i, obj[ i ] ); | ||
| 384 | |||
| 385 | if ( value === false ) { | ||
| 386 | break; | ||
| 387 | } | ||
| 388 | } | ||
| 389 | } else { | ||
| 390 | for ( i in obj ) { | ||
| 391 | value = callback.call( obj[ i ], i, obj[ i ] ); | ||
| 392 | |||
| 393 | if ( value === false ) { | ||
| 394 | break; | ||
| 395 | } | ||
| 396 | } | ||
| 397 | } | ||
| 398 | } | ||
| 399 | |||
| 400 | return obj; | ||
| 401 | }, | ||
| 402 | |||
| 403 | // Support: Android<4.1, IE<9 | ||
| 404 | trim: function( text ) { | ||
| 405 | return text == null ? | ||
| 406 | "" : | ||
| 407 | ( text + "" ).replace( rtrim, "" ); | ||
| 408 | }, | ||
| 409 | |||
| 410 | // results is for internal usage only | ||
| 411 | makeArray: function( arr, results ) { | ||
| 412 | var ret = results || []; | ||
| 413 | |||
| 414 | if ( arr != null ) { | ||
| 415 | if ( isArraylike( Object(arr) ) ) { | ||
| 416 | jQuery.merge( ret, | ||
| 417 | typeof arr === "string" ? | ||
| 418 | [ arr ] : arr | ||
| 419 | ); | ||
| 420 | } else { | ||
| 421 | push.call( ret, arr ); | ||
| 422 | } | ||
| 423 | } | ||
| 424 | |||
| 425 | return ret; | ||
| 426 | }, | ||
| 427 | |||
| 428 | inArray: function( elem, arr, i ) { | ||
| 429 | var len; | ||
| 430 | |||
| 431 | if ( arr ) { | ||
| 432 | if ( indexOf ) { | ||
| 433 | return indexOf.call( arr, elem, i ); | ||
| 434 | } | ||
| 435 | |||
| 436 | len = arr.length; | ||
| 437 | i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; | ||
| 438 | |||
| 439 | for ( ; i < len; i++ ) { | ||
| 440 | // Skip accessing in sparse arrays | ||
| 441 | if ( i in arr && arr[ i ] === elem ) { | ||
| 442 | return i; | ||
| 443 | } | ||
| 444 | } | ||
| 445 | } | ||
| 446 | |||
| 447 | return -1; | ||
| 448 | }, | ||
| 449 | |||
| 450 | merge: function( first, second ) { | ||
| 451 | var len = +second.length, | ||
| 452 | j = 0, | ||
| 453 | i = first.length; | ||
| 454 | |||
| 455 | while ( j < len ) { | ||
| 456 | first[ i++ ] = second[ j++ ]; | ||
| 457 | } | ||
| 458 | |||
| 459 | // Support: IE<9 | ||
| 460 | // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) | ||
| 461 | if ( len !== len ) { | ||
| 462 | while ( second[j] !== undefined ) { | ||
| 463 | first[ i++ ] = second[ j++ ]; | ||
| 464 | } | ||
| 465 | } | ||
| 466 | |||
| 467 | first.length = i; | ||
| 468 | |||
| 469 | return first; | ||
| 470 | }, | ||
| 471 | |||
| 472 | grep: function( elems, callback, invert ) { | ||
| 473 | var callbackInverse, | ||
| 474 | matches = [], | ||
| 475 | i = 0, | ||
| 476 | length = elems.length, | ||
| 477 | callbackExpect = !invert; | ||
| 478 | |||
| 479 | // Go through the array, only saving the items | ||
| 480 | // that pass the validator function | ||
| 481 | for ( ; i < length; i++ ) { | ||
| 482 | callbackInverse = !callback( elems[ i ], i ); | ||
| 483 | if ( callbackInverse !== callbackExpect ) { | ||
| 484 | matches.push( elems[ i ] ); | ||
| 485 | } | ||
| 486 | } | ||
| 487 | |||
| 488 | return matches; | ||
| 489 | }, | ||
| 490 | |||
| 491 | // arg is for internal usage only | ||
| 492 | map: function( elems, callback, arg ) { | ||
| 493 | var value, | ||
| 494 | i = 0, | ||
| 495 | length = elems.length, | ||
| 496 | isArray = isArraylike( elems ), | ||
| 497 | ret = []; | ||
| 498 | |||
| 499 | // Go through the array, translating each of the items to their new values | ||
| 500 | if ( isArray ) { | ||
| 501 | for ( ; i < length; i++ ) { | ||
| 502 | value = callback( elems[ i ], i, arg ); | ||
| 503 | |||
| 504 | if ( value != null ) { | ||
| 505 | ret.push( value ); | ||
| 506 | } | ||
| 507 | } | ||
| 508 | |||
| 509 | // Go through every key on the object, | ||
| 510 | } else { | ||
| 511 | for ( i in elems ) { | ||
| 512 | value = callback( elems[ i ], i, arg ); | ||
| 513 | |||
| 514 | if ( value != null ) { | ||
| 515 | ret.push( value ); | ||
| 516 | } | ||
| 517 | } | ||
| 518 | } | ||
| 519 | |||
| 520 | // Flatten any nested arrays | ||
| 521 | return concat.apply( [], ret ); | ||
| 522 | }, | ||
| 523 | |||
| 524 | // A global GUID counter for objects | ||
| 525 | guid: 1, | ||
| 526 | |||
| 527 | // Bind a function to a context, optionally partially applying any | ||
| 528 | // arguments. | ||
| 529 | proxy: function( fn, context ) { | ||
| 530 | var args, proxy, tmp; | ||
| 531 | |||
| 532 | if ( typeof context === "string" ) { | ||
| 533 | tmp = fn[ context ]; | ||
| 534 | context = fn; | ||
| 535 | fn = tmp; | ||
| 536 | } | ||
| 537 | |||
| 538 | // Quick check to determine if target is callable, in the spec | ||
| 539 | // this throws a TypeError, but we will just return undefined. | ||
| 540 | if ( !jQuery.isFunction( fn ) ) { | ||
| 541 | return undefined; | ||
| 542 | } | ||
| 543 | |||
| 544 | // Simulated bind | ||
| 545 | args = slice.call( arguments, 2 ); | ||
| 546 | proxy = function() { | ||
| 547 | return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); | ||
| 548 | }; | ||
| 549 | |||
| 550 | // Set the guid of unique handler to the same of original handler, so it can be removed | ||
| 551 | proxy.guid = fn.guid = fn.guid || jQuery.guid++; | ||
| 552 | |||
| 553 | return proxy; | ||
| 554 | }, | ||
| 555 | |||
| 556 | now: function() { | ||
| 557 | return +( new Date() ); | ||
| 558 | }, | ||
| 559 | |||
| 560 | // jQuery.support is not used in Core but other projects attach their | ||
| 561 | // properties to it so it needs to exist. | ||
| 562 | support: support | ||
| 563 | }); | ||
| 564 | |||
| 565 | // Populate the class2type map | ||
| 566 | jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { | ||
| 567 | class2type[ "[object " + name + "]" ] = name.toLowerCase(); | ||
| 568 | }); | ||
| 569 | |||
| 570 | function isArraylike( obj ) { | ||
| 571 | var length = obj.length, | ||
| 572 | type = jQuery.type( obj ); | ||
| 573 | |||
| 574 | if ( type === "function" || jQuery.isWindow( obj ) ) { | ||
| 575 | return false; | ||
| 576 | } | ||
| 577 | |||
| 578 | if ( obj.nodeType === 1 && length ) { | ||
| 579 | return true; | ||
| 580 | } | ||
| 581 | |||
| 582 | return type === "array" || length === 0 || | ||
| 583 | typeof length === "number" && length > 0 && ( length - 1 ) in obj; | ||
| 584 | } | ||
| 585 | var Sizzle = | ||
| 586 | /*! | ||
| 587 | * Sizzle CSS Selector Engine v1.10.19 | ||
| 588 | * http://sizzlejs.com/ | ||
| 589 | * | ||
| 590 | * Copyright 2013 jQuery Foundation, Inc. and other contributors | ||
| 591 | * Released under the MIT license | ||
| 592 | * http://jquery.org/license | ||
| 593 | * | ||
| 594 | * Date: 2014-04-18 | ||
| 595 | */ | ||
| 596 | (function( window ) { | ||
| 597 | |||
| 598 | var i, | ||
| 599 | support, | ||
| 600 | Expr, | ||
| 601 | getText, | ||
| 602 | isXML, | ||
| 603 | tokenize, | ||
| 604 | compile, | ||
| 605 | select, | ||
| 606 | outermostContext, | ||
| 607 | sortInput, | ||
| 608 | hasDuplicate, | ||
| 609 | |||
| 610 | // Local document vars | ||
| 611 | setDocument, | ||
| 612 | document, | ||
| 613 | docElem, | ||
| 614 | documentIsHTML, | ||
| 615 | rbuggyQSA, | ||
| 616 | rbuggyMatches, | ||
| 617 | matches, | ||
| 618 | contains, | ||
| 619 | |||
| 620 | // Instance-specific data | ||
| 621 | expando = "sizzle" + -(new Date()), | ||
| 622 | preferredDoc = window.document, | ||
| 623 | dirruns = 0, | ||
| 624 | done = 0, | ||
| 625 | classCache = createCache(), | ||
| 626 | tokenCache = createCache(), | ||
| 627 | compilerCache = createCache(), | ||
| 628 | sortOrder = function( a, b ) { | ||
| 629 | if ( a === b ) { | ||
| 630 | hasDuplicate = true; | ||
| 631 | } | ||
| 632 | return 0; | ||
| 633 | }, | ||
| 634 | |||
| 635 | // General-purpose constants | ||
| 636 | strundefined = typeof undefined, | ||
| 637 | MAX_NEGATIVE = 1 << 31, | ||
| 638 | |||
| 639 | // Instance methods | ||
| 640 | hasOwn = ({}).hasOwnProperty, | ||
| 641 | arr = [], | ||
| 642 | pop = arr.pop, | ||
| 643 | push_native = arr.push, | ||
| 644 | push = arr.push, | ||
| 645 | slice = arr.slice, | ||
| 646 | // Use a stripped-down indexOf if we can't use a native one | ||
| 647 | indexOf = arr.indexOf || function( elem ) { | ||
| 648 | var i = 0, | ||
| 649 | len = this.length; | ||
| 650 | for ( ; i < len; i++ ) { | ||
| 651 | if ( this[i] === elem ) { | ||
| 652 | return i; | ||
| 653 | } | ||
| 654 | } | ||
| 655 | return -1; | ||
| 656 | }, | ||
| 657 | |||
| 658 | booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", | ||
| 659 | |||
| 660 | // Regular expressions | ||
| 661 | |||
| 662 | // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace | ||
| 663 | whitespace = "[\\x20\\t\\r\\n\\f]", | ||
| 664 | // http://www.w3.org/TR/css3-syntax/#characters | ||
| 665 | characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", | ||
| 666 | |||
| 667 | // Loosely modeled on CSS identifier characters | ||
| 668 | // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors | ||
| 669 | // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier | ||
| 670 | identifier = characterEncoding.replace( "w", "w#" ), | ||
| 671 | |||
| 672 | // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors | ||
| 673 | attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + | ||
| 674 | // Operator (capture 2) | ||
| 675 | "*([*^$|!~]?=)" + whitespace + | ||
| 676 | // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" | ||
| 677 | "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + | ||
| 678 | "*\\]", | ||
| 679 | |||
| 680 | pseudos = ":(" + characterEncoding + ")(?:\\((" + | ||
| 681 | // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: | ||
| 682 | // 1. quoted (capture 3; capture 4 or capture 5) | ||
| 683 | "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + | ||
| 684 | // 2. simple (capture 6) | ||
| 685 | "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + | ||
| 686 | // 3. anything else (capture 2) | ||
| 687 | ".*" + | ||
| 688 | ")\\)|)", | ||
| 689 | |||
| 690 | // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter | ||
| 691 | rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), | ||
| 692 | |||
| 693 | rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), | ||
| 694 | rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), | ||
| 695 | |||
| 696 | rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), | ||
| 697 | |||
| 698 | rpseudo = new RegExp( pseudos ), | ||
| 699 | ridentifier = new RegExp( "^" + identifier + "$" ), | ||
| 700 | |||
| 701 | matchExpr = { | ||
| 702 | "ID": new RegExp( "^#(" + characterEncoding + ")" ), | ||
| 703 | "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), | ||
| 704 | "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), | ||
| 705 | "ATTR": new RegExp( "^" + attributes ), | ||
| 706 | "PSEUDO": new RegExp( "^" + pseudos ), | ||
| 707 | "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + | ||
| 708 | "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + | ||
| 709 | "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), | ||
| 710 | "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), | ||
| 711 | // For use in libraries implementing .is() | ||
| 712 | // We use this for POS matching in `select` | ||
| 713 | "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + | ||
| 714 | whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) | ||
| 715 | }, | ||
| 716 | |||
| 717 | rinputs = /^(?:input|select|textarea|button)$/i, | ||
| 718 | rheader = /^h\d$/i, | ||
| 719 | |||
| 720 | rnative = /^[^{]+\{\s*\[native \w/, | ||
| 721 | |||
| 722 | // Easily-parseable/retrievable ID or TAG or CLASS selectors | ||
| 723 | rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, | ||
| 724 | |||
| 725 | rsibling = /[+~]/, | ||
| 726 | rescape = /'|\\/g, | ||
| 727 | |||
| 728 | // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters | ||
| 729 | runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), | ||
| 730 | funescape = function( _, escaped, escapedWhitespace ) { | ||
| 731 | var high = "0x" + escaped - 0x10000; | ||
| 732 | // NaN means non-codepoint | ||
| 733 | // Support: Firefox<24 | ||
| 734 | // Workaround erroneous numeric interpretation of +"0x" | ||
| 735 | return high !== high || escapedWhitespace ? | ||
| 736 | escaped : | ||
| 737 | high < 0 ? | ||
| 738 | // BMP codepoint | ||
| 739 | String.fromCharCode( high + 0x10000 ) : | ||
| 740 | // Supplemental Plane codepoint (surrogate pair) | ||
| 741 | String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); | ||
| 742 | }; | ||
| 743 | |||
| 744 | // Optimize for push.apply( _, NodeList ) | ||
| 745 | try { | ||
| 746 | push.apply( | ||
| 747 | (arr = slice.call( preferredDoc.childNodes )), | ||
| 748 | preferredDoc.childNodes | ||
| 749 | ); | ||
| 750 | // Support: Android<4.0 | ||
| 751 | // Detect silently failing push.apply | ||
| 752 | arr[ preferredDoc.childNodes.length ].nodeType; | ||
| 753 | } catch ( e ) { | ||
| 754 | push = { apply: arr.length ? | ||
| 755 | |||
| 756 | // Leverage slice if possible | ||
| 757 | function( target, els ) { | ||
| 758 | push_native.apply( target, slice.call(els) ); | ||
| 759 | } : | ||
| 760 | |||
| 761 | // Support: IE<9 | ||
| 762 | // Otherwise append directly | ||
| 763 | function( target, els ) { | ||
| 764 | var j = target.length, | ||
| 765 | i = 0; | ||
| 766 | // Can't trust NodeList.length | ||
| 767 | while ( (target[j++] = els[i++]) ) {} | ||
| 768 | target.length = j - 1; | ||
| 769 | } | ||
| 770 | }; | ||
| 771 | } | ||
| 772 | |||
| 773 | function Sizzle( selector, context, results, seed ) { | ||
| 774 | var match, elem, m, nodeType, | ||
| 775 | // QSA vars | ||
| 776 | i, groups, old, nid, newContext, newSelector; | ||
| 777 | |||
| 778 | if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { | ||
| 779 | setDocument( context ); | ||
| 780 | } | ||
| 781 | |||
| 782 | context = context || document; | ||
| 783 | results = results || []; | ||
| 784 | |||
| 785 | if ( !selector || typeof selector !== "string" ) { | ||
| 786 | return results; | ||
| 787 | } | ||
| 788 | |||
| 789 | if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { | ||
| 790 | return []; | ||
| 791 | } | ||
| 792 | |||
| 793 | if ( documentIsHTML && !seed ) { | ||
| 794 | |||
| 795 | // Shortcuts | ||
| 796 | if ( (match = rquickExpr.exec( selector )) ) { | ||
| 797 | // Speed-up: Sizzle("#ID") | ||
| 798 | if ( (m = match[1]) ) { | ||
| 799 | if ( nodeType === 9 ) { | ||
| 800 | elem = context.getElementById( m ); | ||
| 801 | // Check parentNode to catch when Blackberry 4.6 returns | ||
| 802 | // nodes that are no longer in the document (jQuery #6963) | ||
| 803 | if ( elem && elem.parentNode ) { | ||
| 804 | // Handle the case where IE, Opera, and Webkit return items | ||
| 805 | // by name instead of ID | ||
| 806 | if ( elem.id === m ) { | ||
| 807 | results.push( elem ); | ||
| 808 | return results; | ||
| 809 | } | ||
| 810 | } else { | ||
| 811 | return results; | ||
| 812 | } | ||
| 813 | } else { | ||
| 814 | // Context is not a document | ||
| 815 | if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && | ||
| 816 | contains( context, elem ) && elem.id === m ) { | ||
| 817 | results.push( elem ); | ||
| 818 | return results; | ||
| 819 | } | ||
| 820 | } | ||
| 821 | |||
| 822 | // Speed-up: Sizzle("TAG") | ||
| 823 | } else if ( match[2] ) { | ||
| 824 | push.apply( results, context.getElementsByTagName( selector ) ); | ||
| 825 | return results; | ||
| 826 | |||
| 827 | // Speed-up: Sizzle(".CLASS") | ||
| 828 | } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { | ||
| 829 | push.apply( results, context.getElementsByClassName( m ) ); | ||
| 830 | return results; | ||
| 831 | } | ||
| 832 | } | ||
| 833 | |||
| 834 | // QSA path | ||
| 835 | if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { | ||
| 836 | nid = old = expando; | ||
| 837 | newContext = context; | ||
| 838 | newSelector = nodeType === 9 && selector; | ||
| 839 | |||
| 840 | // qSA works strangely on Element-rooted queries | ||
| 841 | // We can work around this by specifying an extra ID on the root | ||
| 842 | // and working up from there (Thanks to Andrew Dupont for the technique) | ||
| 843 | // IE 8 doesn't work on object elements | ||
| 844 | if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { | ||
| 845 | groups = tokenize( selector ); | ||
| 846 | |||
| 847 | if ( (old = context.getAttribute("id")) ) { | ||
| 848 | nid = old.replace( rescape, "\\$&" ); | ||
| 849 | } else { | ||
| 850 | context.setAttribute( "id", nid ); | ||
| 851 | } | ||
| 852 | nid = "[id='" + nid + "'] "; | ||
| 853 | |||
| 854 | i = groups.length; | ||
| 855 | while ( i-- ) { | ||
| 856 | groups[i] = nid + toSelector( groups[i] ); | ||
| 857 | } | ||
| 858 | newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; | ||
| 859 | newSelector = groups.join(","); | ||
| 860 | } | ||
| 861 | |||
| 862 | if ( newSelector ) { | ||
| 863 | try { | ||
| 864 | push.apply( results, | ||
| 865 | newContext.querySelectorAll( newSelector ) | ||
| 866 | ); | ||
| 867 | return results; | ||
| 868 | } catch(qsaError) { | ||
| 869 | } finally { | ||
| 870 | if ( !old ) { | ||
| 871 | context.removeAttribute("id"); | ||
| 872 | } | ||
| 873 | } | ||
| 874 | } | ||
| 875 | } | ||
| 876 | } | ||
| 877 | |||
| 878 | // All others | ||
| 879 | return select( selector.replace( rtrim, "$1" ), context, results, seed ); | ||
| 880 | } | ||
| 881 | |||
| 882 | /** | ||
| 883 | * Create key-value caches of limited size | ||
| 884 | * @returns {Function(string, Object)} Returns the Object data after storing it on itself with | ||
| 885 | * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) | ||
| 886 | * deleting the oldest entry | ||
| 887 | */ | ||
| 888 | function createCache() { | ||
| 889 | var keys = []; | ||
| 890 | |||
| 891 | function cache( key, value ) { | ||
| 892 | // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) | ||
| 893 | if ( keys.push( key + " " ) > Expr.cacheLength ) { | ||
| 894 | // Only keep the most recent entries | ||
| 895 | delete cache[ keys.shift() ]; | ||
| 896 | } | ||
| 897 | return (cache[ key + " " ] = value); | ||
| 898 | } | ||
| 899 | return cache; | ||
| 900 | } | ||
| 901 | |||
| 902 | /** | ||
| 903 | * Mark a function for special use by Sizzle | ||
| 904 | * @param {Function} fn The function to mark | ||
| 905 | */ | ||
| 906 | function markFunction( fn ) { | ||
| 907 | fn[ expando ] = true; | ||
| 908 | return fn; | ||
| 909 | } | ||
| 910 | |||
| 911 | /** | ||
| 912 | * Support testing using an element | ||
| 913 | * @param {Function} fn Passed the created div and expects a boolean result | ||
| 914 | */ | ||
| 915 | function assert( fn ) { | ||
| 916 | var div = document.createElement("div"); | ||
| 917 | |||
| 918 | try { | ||
| 919 | return !!fn( div ); | ||
| 920 | } catch (e) { | ||
| 921 | return false; | ||
| 922 | } finally { | ||
| 923 | // Remove from its parent by default | ||
| 924 | if ( div.parentNode ) { | ||
| 925 | div.parentNode.removeChild( div ); | ||
| 926 | } | ||
| 927 | // release memory in IE | ||
| 928 | div = null; | ||
| 929 | } | ||
| 930 | } | ||
| 931 | |||
| 932 | /** | ||
| 933 | * Adds the same handler for all of the specified attrs | ||
| 934 | * @param {String} attrs Pipe-separated list of attributes | ||
| 935 | * @param {Function} handler The method that will be applied | ||
| 936 | */ | ||
| 937 | function addHandle( attrs, handler ) { | ||
| 938 | var arr = attrs.split("|"), | ||
| 939 | i = attrs.length; | ||
| 940 | |||
| 941 | while ( i-- ) { | ||
| 942 | Expr.attrHandle[ arr[i] ] = handler; | ||
| 943 | } | ||
| 944 | } | ||
| 945 | |||
| 946 | /** | ||
| 947 | * Checks document order of two siblings | ||
| 948 | * @param {Element} a | ||
| 949 | * @param {Element} b | ||
| 950 | * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b | ||
| 951 | */ | ||
| 952 | function siblingCheck( a, b ) { | ||
| 953 | var cur = b && a, | ||
| 954 | diff = cur && a.nodeType === 1 && b.nodeType === 1 && | ||
| 955 | ( ~b.sourceIndex || MAX_NEGATIVE ) - | ||
| 956 | ( ~a.sourceIndex || MAX_NEGATIVE ); | ||
| 957 | |||
| 958 | // Use IE sourceIndex if available on both nodes | ||
| 959 | if ( diff ) { | ||
| 960 | return diff; | ||
| 961 | } | ||
| 962 | |||
| 963 | // Check if b follows a | ||
| 964 | if ( cur ) { | ||
| 965 | while ( (cur = cur.nextSibling) ) { | ||
| 966 | if ( cur === b ) { | ||
| 967 | return -1; | ||
| 968 | } | ||
| 969 | } | ||
| 970 | } | ||
| 971 | |||
| 972 | return a ? 1 : -1; | ||
| 973 | } | ||
| 974 | |||
| 975 | /** | ||
| 976 | * Returns a function to use in pseudos for input types | ||
| 977 | * @param {String} type | ||
| 978 | */ | ||
| 979 | function createInputPseudo( type ) { | ||
| 980 | return function( elem ) { | ||
| 981 | var name = elem.nodeName.toLowerCase(); | ||
| 982 | return name === "input" && elem.type === type; | ||
| 983 | }; | ||
| 984 | } | ||
| 985 | |||
| 986 | /** | ||
| 987 | * Returns a function to use in pseudos for buttons | ||
| 988 | * @param {String} type | ||
| 989 | */ | ||
| 990 | function createButtonPseudo( type ) { | ||
| 991 | return function( elem ) { | ||
| 992 | var name = elem.nodeName.toLowerCase(); | ||
| 993 | return (name === "input" || name === "button") && elem.type === type; | ||
| 994 | }; | ||
| 995 | } | ||
| 996 | |||
| 997 | /** | ||
| 998 | * Returns a function to use in pseudos for positionals | ||
| 999 | * @param {Function} fn | ||
| 1000 | */ | ||
| 1001 | function createPositionalPseudo( fn ) { | ||
| 1002 | return markFunction(function( argument ) { | ||
| 1003 | argument = +argument; | ||
| 1004 | return markFunction(function( seed, matches ) { | ||
| 1005 | var j, | ||
| 1006 | matchIndexes = fn( [], seed.length, argument ), | ||
| 1007 | i = matchIndexes.length; | ||
| 1008 | |||
| 1009 | // Match elements found at the specified indexes | ||
| 1010 | while ( i-- ) { | ||
| 1011 | if ( seed[ (j = matchIndexes[i]) ] ) { | ||
| 1012 | seed[j] = !(matches[j] = seed[j]); | ||
| 1013 | } | ||
| 1014 | } | ||
| 1015 | }); | ||
| 1016 | }); | ||
| 1017 | } | ||
| 1018 | |||
| 1019 | /** | ||
| 1020 | * Checks a node for validity as a Sizzle context | ||
| 1021 | * @param {Element|Object=} context | ||
| 1022 | * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value | ||
| 1023 | */ | ||
| 1024 | function testContext( context ) { | ||
| 1025 | return context && typeof context.getElementsByTagName !== strundefined && context; | ||
| 1026 | } | ||
| 1027 | |||
| 1028 | // Expose support vars for convenience | ||
| 1029 | support = Sizzle.support = {}; | ||
| 1030 | |||
| 1031 | /** | ||
| 1032 | * Detects XML nodes | ||
| 1033 | * @param {Element|Object} elem An element or a document | ||
| 1034 | * @returns {Boolean} True iff elem is a non-HTML XML node | ||
| 1035 | */ | ||
| 1036 | isXML = Sizzle.isXML = function( elem ) { | ||
| 1037 | // documentElement is verified for cases where it doesn't yet exist | ||
| 1038 | // (such as loading iframes in IE - #4833) | ||
| 1039 | var documentElement = elem && (elem.ownerDocument || elem).documentElement; | ||
| 1040 | return documentElement ? documentElement.nodeName !== "HTML" : false; | ||
| 1041 | }; | ||
| 1042 | |||
| 1043 | /** | ||
| 1044 | * Sets document-related variables once based on the current document | ||
| 1045 | * @param {Element|Object} [doc] An element or document object to use to set the document | ||
| 1046 | * @returns {Object} Returns the current document | ||
| 1047 | */ | ||
| 1048 | setDocument = Sizzle.setDocument = function( node ) { | ||
| 1049 | var hasCompare, | ||
| 1050 | doc = node ? node.ownerDocument || node : preferredDoc, | ||
| 1051 | parent = doc.defaultView; | ||
| 1052 | |||
| 1053 | // If no document and documentElement is available, return | ||
| 1054 | if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { | ||
| 1055 | return document; | ||
| 1056 | } | ||
| 1057 | |||
| 1058 | // Set our document | ||
| 1059 | document = doc; | ||
| 1060 | docElem = doc.documentElement; | ||
| 1061 | |||
| 1062 | // Support tests | ||
| 1063 | documentIsHTML = !isXML( doc ); | ||
| 1064 | |||
| 1065 | // Support: IE>8 | ||
| 1066 | // If iframe document is assigned to "document" variable and if iframe has been reloaded, | ||
| 1067 | // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 | ||
| 1068 | // IE6-8 do not support the defaultView property so parent will be undefined | ||
| 1069 | if ( parent && parent !== parent.top ) { | ||
| 1070 | // IE11 does not have attachEvent, so all must suffer | ||
| 1071 | if ( parent.addEventListener ) { | ||
| 1072 | parent.addEventListener( "unload", function() { | ||
| 1073 | setDocument(); | ||
| 1074 | }, false ); | ||
| 1075 | } else if ( parent.attachEvent ) { | ||
| 1076 | parent.attachEvent( "onunload", function() { | ||
| 1077 | setDocument(); | ||
| 1078 | }); | ||
| 1079 | } | ||
| 1080 | } | ||
| 1081 | |||
| 1082 | /* Attributes | ||
| 1083 | ---------------------------------------------------------------------- */ | ||
| 1084 | |||
| 1085 | // Support: IE<8 | ||
| 1086 | // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) | ||
| 1087 | support.attributes = assert(function( div ) { | ||
| 1088 | div.className = "i"; | ||
| 1089 | return !div.getAttribute("className"); | ||
| 1090 | }); | ||
| 1091 | |||
| 1092 | /* getElement(s)By* | ||
| 1093 | ---------------------------------------------------------------------- */ | ||
| 1094 | |||
| 1095 | // Check if getElementsByTagName("*") returns only elements | ||
| 1096 | support.getElementsByTagName = assert(function( div ) { | ||
| 1097 | div.appendChild( doc.createComment("") ); | ||
| 1098 | return !div.getElementsByTagName("*").length; | ||
| 1099 | }); | ||
| 1100 | |||
| 1101 | // Check if getElementsByClassName can be trusted | ||
| 1102 | support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { | ||
| 1103 | div.innerHTML = "<div class='a'></div><div class='a i'></div>"; | ||
| 1104 | |||
| 1105 | // Support: Safari<4 | ||
| 1106 | // Catch class over-caching | ||
| 1107 | div.firstChild.className = "i"; | ||
| 1108 | // Support: Opera<10 | ||
| 1109 | // Catch gEBCN failure to find non-leading classes | ||
| 1110 | return div.getElementsByClassName("i").length === 2; | ||
| 1111 | }); | ||
| 1112 | |||
| 1113 | // Support: IE<10 | ||
| 1114 | // Check if getElementById returns elements by name | ||
| 1115 | // The broken getElementById methods don't pick up programatically-set names, | ||
| 1116 | // so use a roundabout getElementsByName test | ||
| 1117 | support.getById = assert(function( div ) { | ||
| 1118 | docElem.appendChild( div ).id = expando; | ||
| 1119 | return !doc.getElementsByName || !doc.getElementsByName( expando ).length; | ||
| 1120 | }); | ||
| 1121 | |||
| 1122 | // ID find and filter | ||
| 1123 | if ( support.getById ) { | ||
| 1124 | Expr.find["ID"] = function( id, context ) { | ||
| 1125 | if ( typeof context.getElementById !== strundefined && documentIsHTML ) { | ||
| 1126 | var m = context.getElementById( id ); | ||
| 1127 | // Check parentNode to catch when Blackberry 4.6 returns | ||
| 1128 | // nodes that are no longer in the document #6963 | ||
| 1129 | return m && m.parentNode ? [ m ] : []; | ||
| 1130 | } | ||
| 1131 | }; | ||
| 1132 | Expr.filter["ID"] = function( id ) { | ||
| 1133 | var attrId = id.replace( runescape, funescape ); | ||
| 1134 | return function( elem ) { | ||
| 1135 | return elem.getAttribute("id") === attrId; | ||
| 1136 | }; | ||
| 1137 | }; | ||
| 1138 | } else { | ||
| 1139 | // Support: IE6/7 | ||
| 1140 | // getElementById is not reliable as a find shortcut | ||
| 1141 | delete Expr.find["ID"]; | ||
| 1142 | |||
| 1143 | Expr.filter["ID"] = function( id ) { | ||
| 1144 | var attrId = id.replace( runescape, funescape ); | ||
| 1145 | return function( elem ) { | ||
| 1146 | var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); | ||
| 1147 | return node && node.value === attrId; | ||
| 1148 | }; | ||
| 1149 | }; | ||
| 1150 | } | ||
| 1151 | |||
| 1152 | // Tag | ||
| 1153 | Expr.find["TAG"] = support.getElementsByTagName ? | ||
| 1154 | function( tag, context ) { | ||
| 1155 | if ( typeof context.getElementsByTagName !== strundefined ) { | ||
| 1156 | return context.getElementsByTagName( tag ); | ||
| 1157 | } | ||
| 1158 | } : | ||
| 1159 | function( tag, context ) { | ||
| 1160 | var elem, | ||
| 1161 | tmp = [], | ||
| 1162 | i = 0, | ||
| 1163 | results = context.getElementsByTagName( tag ); | ||
| 1164 | |||
| 1165 | // Filter out possible comments | ||
| 1166 | if ( tag === "*" ) { | ||
| 1167 | while ( (elem = results[i++]) ) { | ||
| 1168 | if ( elem.nodeType === 1 ) { | ||
| 1169 | tmp.push( elem ); | ||
| 1170 | } | ||
| 1171 | } | ||
| 1172 | |||
| 1173 | return tmp; | ||
| 1174 | } | ||
| 1175 | return results; | ||
| 1176 | }; | ||
| 1177 | |||
| 1178 | // Class | ||
| 1179 | Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { | ||
| 1180 | if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { | ||
| 1181 | return context.getElementsByClassName( className ); | ||
| 1182 | } | ||
| 1183 | }; | ||
| 1184 | |||
| 1185 | /* QSA/matchesSelector | ||
| 1186 | ---------------------------------------------------------------------- */ | ||
| 1187 | |||
| 1188 | // QSA and matchesSelector support | ||
| 1189 | |||
| 1190 | // matchesSelector(:active) reports false when true (IE9/Opera 11.5) | ||
| 1191 | rbuggyMatches = []; | ||
| 1192 | |||
| 1193 | // qSa(:focus) reports false when true (Chrome 21) | ||
| 1194 | // We allow this because of a bug in IE8/9 that throws an error | ||
| 1195 | // whenever `document.activeElement` is accessed on an iframe | ||
| 1196 | // So, we allow :focus to pass through QSA all the time to avoid the IE error | ||
| 1197 | // See http://bugs.jquery.com/ticket/13378 | ||
| 1198 | rbuggyQSA = []; | ||
| 1199 | |||
| 1200 | if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { | ||
| 1201 | // Build QSA regex | ||
| 1202 | // Regex strategy adopted from Diego Perini | ||
| 1203 | assert(function( div ) { | ||
| 1204 | // Select is set to empty string on purpose | ||
| 1205 | // This is to test IE's treatment of not explicitly | ||
| 1206 | // setting a boolean content attribute, | ||
| 1207 | // since its presence should be enough | ||
| 1208 | // http://bugs.jquery.com/ticket/12359 | ||
| 1209 | div.innerHTML = "<select msallowclip=''><option selected=''></option></select>"; | ||
| 1210 | |||
| 1211 | // Support: IE8, Opera 11-12.16 | ||
| 1212 | // Nothing should be selected when empty strings follow ^= or $= or *= | ||
| 1213 | // The test attribute must be unknown in Opera but "safe" for WinRT | ||
| 1214 | // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section | ||
| 1215 | if ( div.querySelectorAll("[msallowclip^='']").length ) { | ||
| 1216 | rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); | ||
| 1217 | } | ||
| 1218 | |||
| 1219 | // Support: IE8 | ||
| 1220 | // Boolean attributes and "value" are not treated correctly | ||
| 1221 | if ( !div.querySelectorAll("[selected]").length ) { | ||
| 1222 | rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); | ||
| 1223 | } | ||
| 1224 | |||
| 1225 | // Webkit/Opera - :checked should return selected option elements | ||
| 1226 | // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked | ||
| 1227 | // IE8 throws error here and will not see later tests | ||
| 1228 | if ( !div.querySelectorAll(":checked").length ) { | ||
| 1229 | rbuggyQSA.push(":checked"); | ||
| 1230 | } | ||
| 1231 | }); | ||
| 1232 | |||
| 1233 | assert(function( div ) { | ||
| 1234 | // Support: Windows 8 Native Apps | ||
| 1235 | // The type and name attributes are restricted during .innerHTML assignment | ||
| 1236 | var input = doc.createElement("input"); | ||
| 1237 | input.setAttribute( "type", "hidden" ); | ||
| 1238 | div.appendChild( input ).setAttribute( "name", "D" ); | ||
| 1239 | |||
| 1240 | // Support: IE8 | ||
| 1241 | // Enforce case-sensitivity of name attribute | ||
| 1242 | if ( div.querySelectorAll("[name=d]").length ) { | ||
| 1243 | rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); | ||
| 1244 | } | ||
| 1245 | |||
| 1246 | // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) | ||
| 1247 | // IE8 throws error here and will not see later tests | ||
| 1248 | if ( !div.querySelectorAll(":enabled").length ) { | ||
| 1249 | rbuggyQSA.push( ":enabled", ":disabled" ); | ||
| 1250 | } | ||
| 1251 | |||
| 1252 | // Opera 10-11 does not throw on post-comma invalid pseudos | ||
| 1253 | div.querySelectorAll("*,:x"); | ||
| 1254 | rbuggyQSA.push(",.*:"); | ||
| 1255 | }); | ||
| 1256 | } | ||
| 1257 | |||
| 1258 | if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || | ||
| 1259 | docElem.webkitMatchesSelector || | ||
| 1260 | docElem.mozMatchesSelector || | ||
| 1261 | docElem.oMatchesSelector || | ||
| 1262 | docElem.msMatchesSelector) )) ) { | ||
| 1263 | |||
| 1264 | assert(function( div ) { | ||
| 1265 | // Check to see if it's possible to do matchesSelector | ||
| 1266 | // on a disconnected node (IE 9) | ||
| 1267 | support.disconnectedMatch = matches.call( div, "div" ); | ||
| 1268 | |||
| 1269 | // This should fail with an exception | ||
| 1270 | // Gecko does not error, returns false instead | ||
| 1271 | matches.call( div, "[s!='']:x" ); | ||
| 1272 | rbuggyMatches.push( "!=", pseudos ); | ||
| 1273 | }); | ||
| 1274 | } | ||
| 1275 | |||
| 1276 | rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); | ||
| 1277 | rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); | ||
| 1278 | |||
| 1279 | /* Contains | ||
| 1280 | ---------------------------------------------------------------------- */ | ||
| 1281 | hasCompare = rnative.test( docElem.compareDocumentPosition ); | ||
| 1282 | |||
| 1283 | // Element contains another | ||
| 1284 | // Purposefully does not implement inclusive descendent | ||
| 1285 | // As in, an element does not contain itself | ||
| 1286 | contains = hasCompare || rnative.test( docElem.contains ) ? | ||
| 1287 | function( a, b ) { | ||
| 1288 | var adown = a.nodeType === 9 ? a.documentElement : a, | ||
| 1289 | bup = b && b.parentNode; | ||
| 1290 | return a === bup || !!( bup && bup.nodeType === 1 && ( | ||
| 1291 | adown.contains ? | ||
| 1292 | adown.contains( bup ) : | ||
| 1293 | a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 | ||
| 1294 | )); | ||
| 1295 | } : | ||
| 1296 | function( a, b ) { | ||
| 1297 | if ( b ) { | ||
| 1298 | while ( (b = b.parentNode) ) { | ||
| 1299 | if ( b === a ) { | ||
| 1300 | return true; | ||
| 1301 | } | ||
| 1302 | } | ||
| 1303 | } | ||
| 1304 | return false; | ||
| 1305 | }; | ||
| 1306 | |||
| 1307 | /* Sorting | ||
| 1308 | ---------------------------------------------------------------------- */ | ||
| 1309 | |||
| 1310 | // Document order sorting | ||
| 1311 | sortOrder = hasCompare ? | ||
| 1312 | function( a, b ) { | ||
| 1313 | |||
| 1314 | // Flag for duplicate removal | ||
| 1315 | if ( a === b ) { | ||
| 1316 | hasDuplicate = true; | ||
| 1317 | return 0; | ||
| 1318 | } | ||
| 1319 | |||
| 1320 | // Sort on method existence if only one input has compareDocumentPosition | ||
| 1321 | var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; | ||
| 1322 | if ( compare ) { | ||
| 1323 | return compare; | ||
| 1324 | } | ||
| 1325 | |||
| 1326 | // Calculate position if both inputs belong to the same document | ||
| 1327 | compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? | ||
| 1328 | a.compareDocumentPosition( b ) : | ||
| 1329 | |||
| 1330 | // Otherwise we know they are disconnected | ||
| 1331 | 1; | ||
| 1332 | |||
| 1333 | // Disconnected nodes | ||
| 1334 | if ( compare & 1 || | ||
| 1335 | (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { | ||
| 1336 | |||
| 1337 | // Choose the first element that is related to our preferred document | ||
| 1338 | if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { | ||
| 1339 | return -1; | ||
| 1340 | } | ||
| 1341 | if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { | ||
| 1342 | return 1; | ||
| 1343 | } | ||
| 1344 | |||
| 1345 | // Maintain original order | ||
| 1346 | return sortInput ? | ||
| 1347 | ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : | ||
| 1348 | 0; | ||
| 1349 | } | ||
| 1350 | |||
| 1351 | return compare & 4 ? -1 : 1; | ||
| 1352 | } : | ||
| 1353 | function( a, b ) { | ||
| 1354 | // Exit early if the nodes are identical | ||
| 1355 | if ( a === b ) { | ||
| 1356 | hasDuplicate = true; | ||
| 1357 | return 0; | ||
| 1358 | } | ||
| 1359 | |||
| 1360 | var cur, | ||
| 1361 | i = 0, | ||
| 1362 | aup = a.parentNode, | ||
| 1363 | bup = b.parentNode, | ||
| 1364 | ap = [ a ], | ||
| 1365 | bp = [ b ]; | ||
| 1366 | |||
| 1367 | // Parentless nodes are either documents or disconnected | ||
| 1368 | if ( !aup || !bup ) { | ||
| 1369 | return a === doc ? -1 : | ||
| 1370 | b === doc ? 1 : | ||
| 1371 | aup ? -1 : | ||
| 1372 | bup ? 1 : | ||
| 1373 | sortInput ? | ||
| 1374 | ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : | ||
| 1375 | 0; | ||
| 1376 | |||
| 1377 | // If the nodes are siblings, we can do a quick check | ||
| 1378 | } else if ( aup === bup ) { | ||
| 1379 | return siblingCheck( a, b ); | ||
| 1380 | } | ||
| 1381 | |||
| 1382 | // Otherwise we need full lists of their ancestors for comparison | ||
| 1383 | cur = a; | ||
| 1384 | while ( (cur = cur.parentNode) ) { | ||
| 1385 | ap.unshift( cur ); | ||
| 1386 | } | ||
| 1387 | cur = b; | ||
| 1388 | while ( (cur = cur.parentNode) ) { | ||
| 1389 | bp.unshift( cur ); | ||
| 1390 | } | ||
| 1391 | |||
| 1392 | // Walk down the tree looking for a discrepancy | ||
| 1393 | while ( ap[i] === bp[i] ) { | ||
| 1394 | i++; | ||
| 1395 | } | ||
| 1396 | |||
| 1397 | return i ? | ||
| 1398 | // Do a sibling check if the nodes have a common ancestor | ||
| 1399 | siblingCheck( ap[i], bp[i] ) : | ||
| 1400 | |||
| 1401 | // Otherwise nodes in our document sort first | ||
| 1402 | ap[i] === preferredDoc ? -1 : | ||
| 1403 | bp[i] === preferredDoc ? 1 : | ||
| 1404 | 0; | ||
| 1405 | }; | ||
| 1406 | |||
| 1407 | return doc; | ||
| 1408 | }; | ||
| 1409 | |||
| 1410 | Sizzle.matches = function( expr, elements ) { | ||
| 1411 | return Sizzle( expr, null, null, elements ); | ||
| 1412 | }; | ||
| 1413 | |||
| 1414 | Sizzle.matchesSelector = function( elem, expr ) { | ||
| 1415 | // Set document vars if needed | ||
| 1416 | if ( ( elem.ownerDocument || elem ) !== document ) { | ||
| 1417 | setDocument( elem ); | ||
| 1418 | } | ||
| 1419 | |||
| 1420 | // Make sure that attribute selectors are quoted | ||
| 1421 | expr = expr.replace( rattributeQuotes, "='$1']" ); | ||
| 1422 | |||
| 1423 | if ( support.matchesSelector && documentIsHTML && | ||
| 1424 | ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && | ||
| 1425 | ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { | ||
| 1426 | |||
| 1427 | try { | ||
| 1428 | var ret = matches.call( elem, expr ); | ||
| 1429 | |||
| 1430 | // IE 9's matchesSelector returns false on disconnected nodes | ||
| 1431 | if ( ret || support.disconnectedMatch || | ||
| 1432 | // As well, disconnected nodes are said to be in a document | ||
| 1433 | // fragment in IE 9 | ||
| 1434 | elem.document && elem.document.nodeType !== 11 ) { | ||
| 1435 | return ret; | ||
| 1436 | } | ||
| 1437 | } catch(e) {} | ||
| 1438 | } | ||
| 1439 | |||
| 1440 | return Sizzle( expr, document, null, [ elem ] ).length > 0; | ||
| 1441 | }; | ||
| 1442 | |||
| 1443 | Sizzle.contains = function( context, elem ) { | ||
| 1444 | // Set document vars if needed | ||
| 1445 | if ( ( context.ownerDocument || context ) !== document ) { | ||
| 1446 | setDocument( context ); | ||
| 1447 | } | ||
| 1448 | return contains( context, elem ); | ||
| 1449 | }; | ||
| 1450 | |||
| 1451 | Sizzle.attr = function( elem, name ) { | ||
| 1452 | // Set document vars if needed | ||
| 1453 | if ( ( elem.ownerDocument || elem ) !== document ) { | ||
| 1454 | setDocument( elem ); | ||
| 1455 | } | ||
| 1456 | |||
| 1457 | var fn = Expr.attrHandle[ name.toLowerCase() ], | ||
| 1458 | // Don't get fooled by Object.prototype properties (jQuery #13807) | ||
| 1459 | val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? | ||
| 1460 | fn( elem, name, !documentIsHTML ) : | ||
| 1461 | undefined; | ||
| 1462 | |||
| 1463 | return val !== undefined ? | ||
| 1464 | val : | ||
| 1465 | support.attributes || !documentIsHTML ? | ||
| 1466 | elem.getAttribute( name ) : | ||
| 1467 | (val = elem.getAttributeNode(name)) && val.specified ? | ||
| 1468 | val.value : | ||
| 1469 | null; | ||
| 1470 | }; | ||
| 1471 | |||
| 1472 | Sizzle.error = function( msg ) { | ||
| 1473 | throw new Error( "Syntax error, unrecognized expression: " + msg ); | ||
| 1474 | }; | ||
| 1475 | |||
| 1476 | /** | ||
| 1477 | * Document sorting and removing duplicates | ||
| 1478 | * @param {ArrayLike} results | ||
| 1479 | */ | ||
| 1480 | Sizzle.uniqueSort = function( results ) { | ||
| 1481 | var elem, | ||
| 1482 | duplicates = [], | ||
| 1483 | j = 0, | ||
| 1484 | i = 0; | ||
| 1485 | |||
| 1486 | // Unless we *know* we can detect duplicates, assume their presence | ||
| 1487 | hasDuplicate = !support.detectDuplicates; | ||
| 1488 | sortInput = !support.sortStable && results.slice( 0 ); | ||
| 1489 | results.sort( sortOrder ); | ||
| 1490 | |||
| 1491 | if ( hasDuplicate ) { | ||
| 1492 | while ( (elem = results[i++]) ) { | ||
| 1493 | if ( elem === results[ i ] ) { | ||
| 1494 | j = duplicates.push( i ); | ||
| 1495 | } | ||
| 1496 | } | ||
| 1497 | while ( j-- ) { | ||
| 1498 | results.splice( duplicates[ j ], 1 ); | ||
| 1499 | } | ||
| 1500 | } | ||
| 1501 | |||
| 1502 | // Clear input after sorting to release objects | ||
| 1503 | // See https://github.com/jquery/sizzle/pull/225 | ||
| 1504 | sortInput = null; | ||
| 1505 | |||
| 1506 | return results; | ||
| 1507 | }; | ||
| 1508 | |||
| 1509 | /** | ||
| 1510 | * Utility function for retrieving the text value of an array of DOM nodes | ||
| 1511 | * @param {Array|Element} elem | ||
| 1512 | */ | ||
| 1513 | getText = Sizzle.getText = function( elem ) { | ||
| 1514 | var node, | ||
| 1515 | ret = "", | ||
| 1516 | i = 0, | ||
| 1517 | nodeType = elem.nodeType; | ||
| 1518 | |||
| 1519 | if ( !nodeType ) { | ||
| 1520 | // If no nodeType, this is expected to be an array | ||
| 1521 | while ( (node = elem[i++]) ) { | ||
| 1522 | // Do not traverse comment nodes | ||
| 1523 | ret += getText( node ); | ||
| 1524 | } | ||
| 1525 | } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { | ||
| 1526 | // Use textContent for elements | ||
| 1527 | // innerText usage removed for consistency of new lines (jQuery #11153) | ||
| 1528 | if ( typeof elem.textContent === "string" ) { | ||
| 1529 | return elem.textContent; | ||
| 1530 | } else { | ||
| 1531 | // Traverse its children | ||
| 1532 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { | ||
| 1533 | ret += getText( elem ); | ||
| 1534 | } | ||
| 1535 | } | ||
| 1536 | } else if ( nodeType === 3 || nodeType === 4 ) { | ||
| 1537 | return elem.nodeValue; | ||
| 1538 | } | ||
| 1539 | // Do not include comment or processing instruction nodes | ||
| 1540 | |||
| 1541 | return ret; | ||
| 1542 | }; | ||
| 1543 | |||
| 1544 | Expr = Sizzle.selectors = { | ||
| 1545 | |||
| 1546 | // Can be adjusted by the user | ||
| 1547 | cacheLength: 50, | ||
| 1548 | |||
| 1549 | createPseudo: markFunction, | ||
| 1550 | |||
| 1551 | match: matchExpr, | ||
| 1552 | |||
| 1553 | attrHandle: {}, | ||
| 1554 | |||
| 1555 | find: {}, | ||
| 1556 | |||
| 1557 | relative: { | ||
| 1558 | ">": { dir: "parentNode", first: true }, | ||
| 1559 | " ": { dir: "parentNode" }, | ||
| 1560 | "+": { dir: "previousSibling", first: true }, | ||
| 1561 | "~": { dir: "previousSibling" } | ||
| 1562 | }, | ||
| 1563 | |||
| 1564 | preFilter: { | ||
| 1565 | "ATTR": function( match ) { | ||
| 1566 | match[1] = match[1].replace( runescape, funescape ); | ||
| 1567 | |||
| 1568 | // Move the given value to match[3] whether quoted or unquoted | ||
| 1569 | match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); | ||
| 1570 | |||
| 1571 | if ( match[2] === "~=" ) { | ||
| 1572 | match[3] = " " + match[3] + " "; | ||
| 1573 | } | ||
| 1574 | |||
| 1575 | return match.slice( 0, 4 ); | ||
| 1576 | }, | ||
| 1577 | |||
| 1578 | "CHILD": function( match ) { | ||
| 1579 | /* matches from matchExpr["CHILD"] | ||
| 1580 | 1 type (only|nth|...) | ||
| 1581 | 2 what (child|of-type) | ||
| 1582 | 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) | ||
| 1583 | 4 xn-component of xn+y argument ([+-]?\d*n|) | ||
| 1584 | 5 sign of xn-component | ||
| 1585 | 6 x of xn-component | ||
| 1586 | 7 sign of y-component | ||
| 1587 | 8 y of y-component | ||
| 1588 | */ | ||
| 1589 | match[1] = match[1].toLowerCase(); | ||
| 1590 | |||
| 1591 | if ( match[1].slice( 0, 3 ) === "nth" ) { | ||
| 1592 | // nth-* requires argument | ||
| 1593 | if ( !match[3] ) { | ||
| 1594 | Sizzle.error( match[0] ); | ||
| 1595 | } | ||
| 1596 | |||
| 1597 | // numeric x and y parameters for Expr.filter.CHILD | ||
| 1598 | // remember that false/true cast respectively to 0/1 | ||
| 1599 | match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); | ||
| 1600 | match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); | ||
| 1601 | |||
| 1602 | // other types prohibit arguments | ||
| 1603 | } else if ( match[3] ) { | ||
| 1604 | Sizzle.error( match[0] ); | ||
| 1605 | } | ||
| 1606 | |||
| 1607 | return match; | ||
| 1608 | }, | ||
| 1609 | |||
| 1610 | "PSEUDO": function( match ) { | ||
| 1611 | var excess, | ||
| 1612 | unquoted = !match[6] && match[2]; | ||
| 1613 | |||
| 1614 | if ( matchExpr["CHILD"].test( match[0] ) ) { | ||
| 1615 | return null; | ||
| 1616 | } | ||
| 1617 | |||
| 1618 | // Accept quoted arguments as-is | ||
| 1619 | if ( match[3] ) { | ||
| 1620 | match[2] = match[4] || match[5] || ""; | ||
| 1621 | |||
| 1622 | // Strip excess characters from unquoted arguments | ||
| 1623 | } else if ( unquoted && rpseudo.test( unquoted ) && | ||
| 1624 | // Get excess from tokenize (recursively) | ||
| 1625 | (excess = tokenize( unquoted, true )) && | ||
| 1626 | // advance to the next closing parenthesis | ||
| 1627 | (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { | ||
| 1628 | |||
| 1629 | // excess is a negative index | ||
| 1630 | match[0] = match[0].slice( 0, excess ); | ||
| 1631 | match[2] = unquoted.slice( 0, excess ); | ||
| 1632 | } | ||
| 1633 | |||
| 1634 | // Return only captures needed by the pseudo filter method (type and argument) | ||
| 1635 | return match.slice( 0, 3 ); | ||
| 1636 | } | ||
| 1637 | }, | ||
| 1638 | |||
| 1639 | filter: { | ||
| 1640 | |||
| 1641 | "TAG": function( nodeNameSelector ) { | ||
| 1642 | var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); | ||
| 1643 | return nodeNameSelector === "*" ? | ||
| 1644 | function() { return true; } : | ||
| 1645 | function( elem ) { | ||
| 1646 | return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; | ||
| 1647 | }; | ||
| 1648 | }, | ||
| 1649 | |||
| 1650 | "CLASS": function( className ) { | ||
| 1651 | var pattern = classCache[ className + " " ]; | ||
| 1652 | |||
| 1653 | return pattern || | ||
| 1654 | (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && | ||
| 1655 | classCache( className, function( elem ) { | ||
| 1656 | return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); | ||
| 1657 | }); | ||
| 1658 | }, | ||
| 1659 | |||
| 1660 | "ATTR": function( name, operator, check ) { | ||
| 1661 | return function( elem ) { | ||
| 1662 | var result = Sizzle.attr( elem, name ); | ||
| 1663 | |||
| 1664 | if ( result == null ) { | ||
| 1665 | return operator === "!="; | ||
| 1666 | } | ||
| 1667 | if ( !operator ) { | ||
| 1668 | return true; | ||
| 1669 | } | ||
| 1670 | |||
| 1671 | result += ""; | ||
| 1672 | |||
| 1673 | return operator === "=" ? result === check : | ||
| 1674 | operator === "!=" ? result !== check : | ||
| 1675 | operator === "^=" ? check && result.indexOf( check ) === 0 : | ||
| 1676 | operator === "*=" ? check && result.indexOf( check ) > -1 : | ||
| 1677 | operator === "$=" ? check && result.slice( -check.length ) === check : | ||
| 1678 | operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : | ||
| 1679 | operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : | ||
| 1680 | false; | ||
| 1681 | }; | ||
| 1682 | }, | ||
| 1683 | |||
| 1684 | "CHILD": function( type, what, argument, first, last ) { | ||
| 1685 | var simple = type.slice( 0, 3 ) !== "nth", | ||
| 1686 | forward = type.slice( -4 ) !== "last", | ||
| 1687 | ofType = what === "of-type"; | ||
| 1688 | |||
| 1689 | return first === 1 && last === 0 ? | ||
| 1690 | |||
| 1691 | // Shortcut for :nth-*(n) | ||
| 1692 | function( elem ) { | ||
| 1693 | return !!elem.parentNode; | ||
| 1694 | } : | ||
| 1695 | |||
| 1696 | function( elem, context, xml ) { | ||
| 1697 | var cache, outerCache, node, diff, nodeIndex, start, | ||
| 1698 | dir = simple !== forward ? "nextSibling" : "previousSibling", | ||
| 1699 | parent = elem.parentNode, | ||
| 1700 | name = ofType && elem.nodeName.toLowerCase(), | ||
| 1701 | useCache = !xml && !ofType; | ||
| 1702 | |||
| 1703 | if ( parent ) { | ||
| 1704 | |||
| 1705 | // :(first|last|only)-(child|of-type) | ||
| 1706 | if ( simple ) { | ||
| 1707 | while ( dir ) { | ||
| 1708 | node = elem; | ||
| 1709 | while ( (node = node[ dir ]) ) { | ||
| 1710 | if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { | ||
| 1711 | return false; | ||
| 1712 | } | ||
| 1713 | } | ||
| 1714 | // Reverse direction for :only-* (if we haven't yet done so) | ||
| 1715 | start = dir = type === "only" && !start && "nextSibling"; | ||
| 1716 | } | ||
| 1717 | return true; | ||
| 1718 | } | ||
| 1719 | |||
| 1720 | start = [ forward ? parent.firstChild : parent.lastChild ]; | ||
| 1721 | |||
| 1722 | // non-xml :nth-child(...) stores cache data on `parent` | ||
| 1723 | if ( forward && useCache ) { | ||
| 1724 | // Seek `elem` from a previously-cached index | ||
| 1725 | outerCache = parent[ expando ] || (parent[ expando ] = {}); | ||
| 1726 | cache = outerCache[ type ] || []; | ||
| 1727 | nodeIndex = cache[0] === dirruns && cache[1]; | ||
| 1728 | diff = cache[0] === dirruns && cache[2]; | ||
| 1729 | node = nodeIndex && parent.childNodes[ nodeIndex ]; | ||
| 1730 | |||
| 1731 | while ( (node = ++nodeIndex && node && node[ dir ] || | ||
| 1732 | |||
| 1733 | // Fallback to seeking `elem` from the start | ||
| 1734 | (diff = nodeIndex = 0) || start.pop()) ) { | ||
| 1735 | |||
| 1736 | // When found, cache indexes on `parent` and break | ||
| 1737 | if ( node.nodeType === 1 && ++diff && node === elem ) { | ||
| 1738 | outerCache[ type ] = [ dirruns, nodeIndex, diff ]; | ||
| 1739 | break; | ||
| 1740 | } | ||
| 1741 | } | ||
| 1742 | |||
| 1743 | // Use previously-cached element index if available | ||
| 1744 | } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { | ||
| 1745 | diff = cache[1]; | ||
| 1746 | |||
| 1747 | // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) | ||
| 1748 | } else { | ||
| 1749 | // Use the same loop as above to seek `elem` from the start | ||
| 1750 | while ( (node = ++nodeIndex && node && node[ dir ] || | ||
| 1751 | (diff = nodeIndex = 0) || start.pop()) ) { | ||
| 1752 | |||
| 1753 | if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { | ||
| 1754 | // Cache the index of each encountered element | ||
| 1755 | if ( useCache ) { | ||
| 1756 | (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; | ||
| 1757 | } | ||
| 1758 | |||
| 1759 | if ( node === elem ) { | ||
| 1760 | break; | ||
| 1761 | } | ||
| 1762 | } | ||
| 1763 | } | ||
| 1764 | } | ||
| 1765 | |||
| 1766 | // Incorporate the offset, then check against cycle size | ||
| 1767 | diff -= last; | ||
| 1768 | return diff === first || ( diff % first === 0 && diff / first >= 0 ); | ||
| 1769 | } | ||
| 1770 | }; | ||
| 1771 | }, | ||
| 1772 | |||
| 1773 | "PSEUDO": function( pseudo, argument ) { | ||
| 1774 | // pseudo-class names are case-insensitive | ||
| 1775 | // http://www.w3.org/TR/selectors/#pseudo-classes | ||
| 1776 | // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters | ||
| 1777 | // Remember that setFilters inherits from pseudos | ||
| 1778 | var args, | ||
| 1779 | fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || | ||
| 1780 | Sizzle.error( "unsupported pseudo: " + pseudo ); | ||
| 1781 | |||
| 1782 | // The user may use createPseudo to indicate that | ||
| 1783 | // arguments are needed to create the filter function | ||
| 1784 | // just as Sizzle does | ||
| 1785 | if ( fn[ expando ] ) { | ||
| 1786 | return fn( argument ); | ||
| 1787 | } | ||
| 1788 | |||
| 1789 | // But maintain support for old signatures | ||
| 1790 | if ( fn.length > 1 ) { | ||
| 1791 | args = [ pseudo, pseudo, "", argument ]; | ||
| 1792 | return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? | ||
| 1793 | markFunction(function( seed, matches ) { | ||
| 1794 | var idx, | ||
| 1795 | matched = fn( seed, argument ), | ||
| 1796 | i = matched.length; | ||
| 1797 | while ( i-- ) { | ||
| 1798 | idx = indexOf.call( seed, matched[i] ); | ||
| 1799 | seed[ idx ] = !( matches[ idx ] = matched[i] ); | ||
| 1800 | } | ||
| 1801 | }) : | ||
| 1802 | function( elem ) { | ||
| 1803 | return fn( elem, 0, args ); | ||
| 1804 | }; | ||
| 1805 | } | ||
| 1806 | |||
| 1807 | return fn; | ||
| 1808 | } | ||
| 1809 | }, | ||
| 1810 | |||
| 1811 | pseudos: { | ||
| 1812 | // Potentially complex pseudos | ||
| 1813 | "not": markFunction(function( selector ) { | ||
| 1814 | // Trim the selector passed to compile | ||
| 1815 | // to avoid treating leading and trailing | ||
| 1816 | // spaces as combinators | ||
| 1817 | var input = [], | ||
| 1818 | results = [], | ||
| 1819 | matcher = compile( selector.replace( rtrim, "$1" ) ); | ||
| 1820 | |||
| 1821 | return matcher[ expando ] ? | ||
| 1822 | markFunction(function( seed, matches, context, xml ) { | ||
| 1823 | var elem, | ||
| 1824 | unmatched = matcher( seed, null, xml, [] ), | ||
| 1825 | i = seed.length; | ||
| 1826 | |||
| 1827 | // Match elements unmatched by `matcher` | ||
| 1828 | while ( i-- ) { | ||
| 1829 | if ( (elem = unmatched[i]) ) { | ||
| 1830 | seed[i] = !(matches[i] = elem); | ||
| 1831 | } | ||
| 1832 | } | ||
| 1833 | }) : | ||
| 1834 | function( elem, context, xml ) { | ||
| 1835 | input[0] = elem; | ||
| 1836 | matcher( input, null, xml, results ); | ||
| 1837 | return !results.pop(); | ||
| 1838 | }; | ||
| 1839 | }), | ||
| 1840 | |||
| 1841 | "has": markFunction(function( selector ) { | ||
| 1842 | return function( elem ) { | ||
| 1843 | return Sizzle( selector, elem ).length > 0; | ||
| 1844 | }; | ||
| 1845 | }), | ||
| 1846 | |||
| 1847 | "contains": markFunction(function( text ) { | ||
| 1848 | return function( elem ) { | ||
| 1849 | return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; | ||
| 1850 | }; | ||
| 1851 | }), | ||
| 1852 | |||
| 1853 | // "Whether an element is represented by a :lang() selector | ||
| 1854 | // is based solely on the element's language value | ||
| 1855 | // being equal to the identifier C, | ||
| 1856 | // or beginning with the identifier C immediately followed by "-". | ||
| 1857 | // The matching of C against the element's language value is performed case-insensitively. | ||
| 1858 | // The identifier C does not have to be a valid language name." | ||
| 1859 | // http://www.w3.org/TR/selectors/#lang-pseudo | ||
| 1860 | "lang": markFunction( function( lang ) { | ||
| 1861 | // lang value must be a valid identifier | ||
| 1862 | if ( !ridentifier.test(lang || "") ) { | ||
| 1863 | Sizzle.error( "unsupported lang: " + lang ); | ||
| 1864 | } | ||
| 1865 | lang = lang.replace( runescape, funescape ).toLowerCase(); | ||
| 1866 | return function( elem ) { | ||
| 1867 | var elemLang; | ||
| 1868 | do { | ||
| 1869 | if ( (elemLang = documentIsHTML ? | ||
| 1870 | elem.lang : | ||
| 1871 | elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { | ||
| 1872 | |||
| 1873 | elemLang = elemLang.toLowerCase(); | ||
| 1874 | return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; | ||
| 1875 | } | ||
| 1876 | } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); | ||
| 1877 | return false; | ||
| 1878 | }; | ||
| 1879 | }), | ||
| 1880 | |||
| 1881 | // Miscellaneous | ||
| 1882 | "target": function( elem ) { | ||
| 1883 | var hash = window.location && window.location.hash; | ||
| 1884 | return hash && hash.slice( 1 ) === elem.id; | ||
| 1885 | }, | ||
| 1886 | |||
| 1887 | "root": function( elem ) { | ||
| 1888 | return elem === docElem; | ||
| 1889 | }, | ||
| 1890 | |||
| 1891 | "focus": function( elem ) { | ||
| 1892 | return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); | ||
| 1893 | }, | ||
| 1894 | |||
| 1895 | // Boolean properties | ||
| 1896 | "enabled": function( elem ) { | ||
| 1897 | return elem.disabled === false; | ||
| 1898 | }, | ||
| 1899 | |||
| 1900 | "disabled": function( elem ) { | ||
| 1901 | return elem.disabled === true; | ||
| 1902 | }, | ||
| 1903 | |||
| 1904 | "checked": function( elem ) { | ||
| 1905 | // In CSS3, :checked should return both checked and selected elements | ||
| 1906 | // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked | ||
| 1907 | var nodeName = elem.nodeName.toLowerCase(); | ||
| 1908 | return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); | ||
| 1909 | }, | ||
| 1910 | |||
| 1911 | "selected": function( elem ) { | ||
| 1912 | // Accessing this property makes selected-by-default | ||
| 1913 | // options in Safari work properly | ||
| 1914 | if ( elem.parentNode ) { | ||
| 1915 | elem.parentNode.selectedIndex; | ||
| 1916 | } | ||
| 1917 | |||
| 1918 | return elem.selected === true; | ||
| 1919 | }, | ||
| 1920 | |||
| 1921 | // Contents | ||
| 1922 | "empty": function( elem ) { | ||
| 1923 | // http://www.w3.org/TR/selectors/#empty-pseudo | ||
| 1924 | // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), | ||
| 1925 | // but not by others (comment: 8; processing instruction: 7; etc.) | ||
| 1926 | // nodeType < 6 works because attributes (2) do not appear as children | ||
| 1927 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { | ||
| 1928 | if ( elem.nodeType < 6 ) { | ||
| 1929 | return false; | ||
| 1930 | } | ||
| 1931 | } | ||
| 1932 | return true; | ||
| 1933 | }, | ||
| 1934 | |||
| 1935 | "parent": function( elem ) { | ||
| 1936 | return !Expr.pseudos["empty"]( elem ); | ||
| 1937 | }, | ||
| 1938 | |||
| 1939 | // Element/input types | ||
| 1940 | "header": function( elem ) { | ||
| 1941 | return rheader.test( elem.nodeName ); | ||
| 1942 | }, | ||
| 1943 | |||
| 1944 | "input": function( elem ) { | ||
| 1945 | return rinputs.test( elem.nodeName ); | ||
| 1946 | }, | ||
| 1947 | |||
| 1948 | "button": function( elem ) { | ||
| 1949 | var name = elem.nodeName.toLowerCase(); | ||
| 1950 | return name === "input" && elem.type === "button" || name === "button"; | ||
| 1951 | }, | ||
| 1952 | |||
| 1953 | "text": function( elem ) { | ||
| 1954 | var attr; | ||
| 1955 | return elem.nodeName.toLowerCase() === "input" && | ||
| 1956 | elem.type === "text" && | ||
| 1957 | |||
| 1958 | // Support: IE<8 | ||
| 1959 | // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" | ||
| 1960 | ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); | ||
| 1961 | }, | ||
| 1962 | |||
| 1963 | // Position-in-collection | ||
| 1964 | "first": createPositionalPseudo(function() { | ||
| 1965 | return [ 0 ]; | ||
| 1966 | }), | ||
| 1967 | |||
| 1968 | "last": createPositionalPseudo(function( matchIndexes, length ) { | ||
| 1969 | return [ length - 1 ]; | ||
| 1970 | }), | ||
| 1971 | |||
| 1972 | "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { | ||
| 1973 | return [ argument < 0 ? argument + length : argument ]; | ||
| 1974 | }), | ||
| 1975 | |||
| 1976 | "even": createPositionalPseudo(function( matchIndexes, length ) { | ||
| 1977 | var i = 0; | ||
| 1978 | for ( ; i < length; i += 2 ) { | ||
| 1979 | matchIndexes.push( i ); | ||
| 1980 | } | ||
| 1981 | return matchIndexes; | ||
| 1982 | }), | ||
| 1983 | |||
| 1984 | "odd": createPositionalPseudo(function( matchIndexes, length ) { | ||
| 1985 | var i = 1; | ||
| 1986 | for ( ; i < length; i += 2 ) { | ||
| 1987 | matchIndexes.push( i ); | ||
| 1988 | } | ||
| 1989 | return matchIndexes; | ||
| 1990 | }), | ||
| 1991 | |||
| 1992 | "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { | ||
| 1993 | var i = argument < 0 ? argument + length : argument; | ||
| 1994 | for ( ; --i >= 0; ) { | ||
| 1995 | matchIndexes.push( i ); | ||
| 1996 | } | ||
| 1997 | return matchIndexes; | ||
| 1998 | }), | ||
| 1999 | |||
| 2000 | "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { | ||
| 2001 | var i = argument < 0 ? argument + length : argument; | ||
| 2002 | for ( ; ++i < length; ) { | ||
| 2003 | matchIndexes.push( i ); | ||
| 2004 | } | ||
| 2005 | return matchIndexes; | ||
| 2006 | }) | ||
| 2007 | } | ||
| 2008 | }; | ||
| 2009 | |||
| 2010 | Expr.pseudos["nth"] = Expr.pseudos["eq"]; | ||
| 2011 | |||
| 2012 | // Add button/input type pseudos | ||
| 2013 | for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { | ||
| 2014 | Expr.pseudos[ i ] = createInputPseudo( i ); | ||
| 2015 | } | ||
| 2016 | for ( i in { submit: true, reset: true } ) { | ||
| 2017 | Expr.pseudos[ i ] = createButtonPseudo( i ); | ||
| 2018 | } | ||
| 2019 | |||
| 2020 | // Easy API for creating new setFilters | ||
| 2021 | function setFilters() {} | ||
| 2022 | setFilters.prototype = Expr.filters = Expr.pseudos; | ||
| 2023 | Expr.setFilters = new setFilters(); | ||
| 2024 | |||
| 2025 | tokenize = Sizzle.tokenize = function( selector, parseOnly ) { | ||
| 2026 | var matched, match, tokens, type, | ||
| 2027 | soFar, groups, preFilters, | ||
| 2028 | cached = tokenCache[ selector + " " ]; | ||
| 2029 | |||
| 2030 | if ( cached ) { | ||
| 2031 | return parseOnly ? 0 : cached.slice( 0 ); | ||
| 2032 | } | ||
| 2033 | |||
| 2034 | soFar = selector; | ||
| 2035 | groups = []; | ||
| 2036 | preFilters = Expr.preFilter; | ||
| 2037 | |||
| 2038 | while ( soFar ) { | ||
| 2039 | |||
| 2040 | // Comma and first run | ||
| 2041 | if ( !matched || (match = rcomma.exec( soFar )) ) { | ||
| 2042 | if ( match ) { | ||
| 2043 | // Don't consume trailing commas as valid | ||
| 2044 | soFar = soFar.slice( match[0].length ) || soFar; | ||
| 2045 | } | ||
| 2046 | groups.push( (tokens = []) ); | ||
| 2047 | } | ||
| 2048 | |||
| 2049 | matched = false; | ||
| 2050 | |||
| 2051 | // Combinators | ||
| 2052 | if ( (match = rcombinators.exec( soFar )) ) { | ||
| 2053 | matched = match.shift(); | ||
| 2054 | tokens.push({ | ||
| 2055 | value: matched, | ||
| 2056 | // Cast descendant combinators to space | ||
| 2057 | type: match[0].replace( rtrim, " " ) | ||
| 2058 | }); | ||
| 2059 | soFar = soFar.slice( matched.length ); | ||
| 2060 | } | ||
| 2061 | |||
| 2062 | // Filters | ||
| 2063 | for ( type in Expr.filter ) { | ||
| 2064 | if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || | ||
| 2065 | (match = preFilters[ type ]( match ))) ) { | ||
| 2066 | matched = match.shift(); | ||
| 2067 | tokens.push({ | ||
| 2068 | value: matched, | ||
| 2069 | type: type, | ||
| 2070 | matches: match | ||
| 2071 | }); | ||
| 2072 | soFar = soFar.slice( matched.length ); | ||
| 2073 | } | ||
| 2074 | } | ||
| 2075 | |||
| 2076 | if ( !matched ) { | ||
| 2077 | break; | ||
| 2078 | } | ||
| 2079 | } | ||
| 2080 | |||
| 2081 | // Return the length of the invalid excess | ||
| 2082 | // if we're just parsing | ||
| 2083 | // Otherwise, throw an error or return tokens | ||
| 2084 | return parseOnly ? | ||
| 2085 | soFar.length : | ||
| 2086 | soFar ? | ||
| 2087 | Sizzle.error( selector ) : | ||
| 2088 | // Cache the tokens | ||
| 2089 | tokenCache( selector, groups ).slice( 0 ); | ||
| 2090 | }; | ||
| 2091 | |||
| 2092 | function toSelector( tokens ) { | ||
| 2093 | var i = 0, | ||
| 2094 | len = tokens.length, | ||
| 2095 | selector = ""; | ||
| 2096 | for ( ; i < len; i++ ) { | ||
| 2097 | selector += tokens[i].value; | ||
| 2098 | } | ||
| 2099 | return selector; | ||
| 2100 | } | ||
| 2101 | |||
| 2102 | function addCombinator( matcher, combinator, base ) { | ||
| 2103 | var dir = combinator.dir, | ||
| 2104 | checkNonElements = base && dir === "parentNode", | ||
| 2105 | doneName = done++; | ||
| 2106 | |||
| 2107 | return combinator.first ? | ||
| 2108 | // Check against closest ancestor/preceding element | ||
| 2109 | function( elem, context, xml ) { | ||
| 2110 | while ( (elem = elem[ dir ]) ) { | ||
| 2111 | if ( elem.nodeType === 1 || checkNonElements ) { | ||
| 2112 | return matcher( elem, context, xml ); | ||
| 2113 | } | ||
| 2114 | } | ||
| 2115 | } : | ||
| 2116 | |||
| 2117 | // Check against all ancestor/preceding elements | ||
| 2118 | function( elem, context, xml ) { | ||
| 2119 | var oldCache, outerCache, | ||
| 2120 | newCache = [ dirruns, doneName ]; | ||
| 2121 | |||
| 2122 | // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching | ||
| 2123 | if ( xml ) { | ||
| 2124 | while ( (elem = elem[ dir ]) ) { | ||
| 2125 | if ( elem.nodeType === 1 || checkNonElements ) { | ||
| 2126 | if ( matcher( elem, context, xml ) ) { | ||
| 2127 | return true; | ||
| 2128 | } | ||
| 2129 | } | ||
| 2130 | } | ||
| 2131 | } else { | ||
| 2132 | while ( (elem = elem[ dir ]) ) { | ||
| 2133 | if ( elem.nodeType === 1 || checkNonElements ) { | ||
| 2134 | outerCache = elem[ expando ] || (elem[ expando ] = {}); | ||
| 2135 | if ( (oldCache = outerCache[ dir ]) && | ||
| 2136 | oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { | ||
| 2137 | |||
| 2138 | // Assign to newCache so results back-propagate to previous elements | ||
| 2139 | return (newCache[ 2 ] = oldCache[ 2 ]); | ||
| 2140 | } else { | ||
| 2141 | // Reuse newcache so results back-propagate to previous elements | ||
| 2142 | outerCache[ dir ] = newCache; | ||
| 2143 | |||
| 2144 | // A match means we're done; a fail means we have to keep checking | ||
| 2145 | if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { | ||
| 2146 | return true; | ||
| 2147 | } | ||
| 2148 | } | ||
| 2149 | } | ||
| 2150 | } | ||
| 2151 | } | ||
| 2152 | }; | ||
| 2153 | } | ||
| 2154 | |||
| 2155 | function elementMatcher( matchers ) { | ||
| 2156 | return matchers.length > 1 ? | ||
| 2157 | function( elem, context, xml ) { | ||
| 2158 | var i = matchers.length; | ||
| 2159 | while ( i-- ) { | ||
| 2160 | if ( !matchers[i]( elem, context, xml ) ) { | ||
| 2161 | return false; | ||
| 2162 | } | ||
| 2163 | } | ||
| 2164 | return true; | ||
| 2165 | } : | ||
| 2166 | matchers[0]; | ||
| 2167 | } | ||
| 2168 | |||
| 2169 | function multipleContexts( selector, contexts, results ) { | ||
| 2170 | var i = 0, | ||
| 2171 | len = contexts.length; | ||
| 2172 | for ( ; i < len; i++ ) { | ||
| 2173 | Sizzle( selector, contexts[i], results ); | ||
| 2174 | } | ||
| 2175 | return results; | ||
| 2176 | } | ||
| 2177 | |||
| 2178 | function condense( unmatched, map, filter, context, xml ) { | ||
| 2179 | var elem, | ||
| 2180 | newUnmatched = [], | ||
| 2181 | i = 0, | ||
| 2182 | len = unmatched.length, | ||
| 2183 | mapped = map != null; | ||
| 2184 | |||
| 2185 | for ( ; i < len; i++ ) { | ||
| 2186 | if ( (elem = unmatched[i]) ) { | ||
| 2187 | if ( !filter || filter( elem, context, xml ) ) { | ||
| 2188 | newUnmatched.push( elem ); | ||
| 2189 | if ( mapped ) { | ||
| 2190 | map.push( i ); | ||
| 2191 | } | ||
| 2192 | } | ||
| 2193 | } | ||
| 2194 | } | ||
| 2195 | |||
| 2196 | return newUnmatched; | ||
| 2197 | } | ||
| 2198 | |||
| 2199 | function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { | ||
| 2200 | if ( postFilter && !postFilter[ expando ] ) { | ||
| 2201 | postFilter = setMatcher( postFilter ); | ||
| 2202 | } | ||
| 2203 | if ( postFinder && !postFinder[ expando ] ) { | ||
| 2204 | postFinder = setMatcher( postFinder, postSelector ); | ||
| 2205 | } | ||
| 2206 | return markFunction(function( seed, results, context, xml ) { | ||
| 2207 | var temp, i, elem, | ||
| 2208 | preMap = [], | ||
| 2209 | postMap = [], | ||
| 2210 | preexisting = results.length, | ||
| 2211 | |||
| 2212 | // Get initial elements from seed or context | ||
| 2213 | elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), | ||
| 2214 | |||
| 2215 | // Prefilter to get matcher input, preserving a map for seed-results synchronization | ||
| 2216 | matcherIn = preFilter && ( seed || !selector ) ? | ||
| 2217 | condense( elems, preMap, preFilter, context, xml ) : | ||
| 2218 | elems, | ||
| 2219 | |||
| 2220 | matcherOut = matcher ? | ||
| 2221 | // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, | ||
| 2222 | postFinder || ( seed ? preFilter : preexisting || postFilter ) ? | ||
| 2223 | |||
| 2224 | // ...intermediate processing is necessary | ||
| 2225 | [] : | ||
| 2226 | |||
| 2227 | // ...otherwise use results directly | ||
| 2228 | results : | ||
| 2229 | matcherIn; | ||
| 2230 | |||
| 2231 | // Find primary matches | ||
| 2232 | if ( matcher ) { | ||
| 2233 | matcher( matcherIn, matcherOut, context, xml ); | ||
| 2234 | } | ||
| 2235 | |||
| 2236 | // Apply postFilter | ||
| 2237 | if ( postFilter ) { | ||
| 2238 | temp = condense( matcherOut, postMap ); | ||
| 2239 | postFilter( temp, [], context, xml ); | ||
| 2240 | |||
| 2241 | // Un-match failing elements by moving them back to matcherIn | ||
| 2242 | i = temp.length; | ||
| 2243 | while ( i-- ) { | ||
| 2244 | if ( (elem = temp[i]) ) { | ||
| 2245 | matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); | ||
| 2246 | } | ||
| 2247 | } | ||
| 2248 | } | ||
| 2249 | |||
| 2250 | if ( seed ) { | ||
| 2251 | if ( postFinder || preFilter ) { | ||
| 2252 | if ( postFinder ) { | ||
| 2253 | // Get the final matcherOut by condensing this intermediate into postFinder contexts | ||
| 2254 | temp = []; | ||
| 2255 | i = matcherOut.length; | ||
| 2256 | while ( i-- ) { | ||
| 2257 | if ( (elem = matcherOut[i]) ) { | ||
| 2258 | // Restore matcherIn since elem is not yet a final match | ||
| 2259 | temp.push( (matcherIn[i] = elem) ); | ||
| 2260 | } | ||
| 2261 | } | ||
| 2262 | postFinder( null, (matcherOut = []), temp, xml ); | ||
| 2263 | } | ||
| 2264 | |||
| 2265 | // Move matched elements from seed to results to keep them synchronized | ||
| 2266 | i = matcherOut.length; | ||
| 2267 | while ( i-- ) { | ||
| 2268 | if ( (elem = matcherOut[i]) && | ||
| 2269 | (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { | ||
| 2270 | |||
| 2271 | seed[temp] = !(results[temp] = elem); | ||
| 2272 | } | ||
| 2273 | } | ||
| 2274 | } | ||
| 2275 | |||
| 2276 | // Add elements to results, through postFinder if defined | ||
| 2277 | } else { | ||
| 2278 | matcherOut = condense( | ||
| 2279 | matcherOut === results ? | ||
| 2280 | matcherOut.splice( preexisting, matcherOut.length ) : | ||
| 2281 | matcherOut | ||
| 2282 | ); | ||
| 2283 | if ( postFinder ) { | ||
| 2284 | postFinder( null, results, matcherOut, xml ); | ||
| 2285 | } else { | ||
| 2286 | push.apply( results, matcherOut ); | ||
| 2287 | } | ||
| 2288 | } | ||
| 2289 | }); | ||
| 2290 | } | ||
| 2291 | |||
| 2292 | function matcherFromTokens( tokens ) { | ||
| 2293 | var checkContext, matcher, j, | ||
| 2294 | len = tokens.length, | ||
| 2295 | leadingRelative = Expr.relative[ tokens[0].type ], | ||
| 2296 | implicitRelative = leadingRelative || Expr.relative[" "], | ||
| 2297 | i = leadingRelative ? 1 : 0, | ||
| 2298 | |||
| 2299 | // The foundational matcher ensures that elements are reachable from top-level context(s) | ||
| 2300 | matchContext = addCombinator( function( elem ) { | ||
| 2301 | return elem === checkContext; | ||
| 2302 | }, implicitRelative, true ), | ||
| 2303 | matchAnyContext = addCombinator( function( elem ) { | ||
| 2304 | return indexOf.call( checkContext, elem ) > -1; | ||
| 2305 | }, implicitRelative, true ), | ||
| 2306 | matchers = [ function( elem, context, xml ) { | ||
| 2307 | return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( | ||
| 2308 | (checkContext = context).nodeType ? | ||
| 2309 | matchContext( elem, context, xml ) : | ||
| 2310 | matchAnyContext( elem, context, xml ) ); | ||
| 2311 | } ]; | ||
| 2312 | |||
| 2313 | for ( ; i < len; i++ ) { | ||
| 2314 | if ( (matcher = Expr.relative[ tokens[i].type ]) ) { | ||
| 2315 | matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; | ||
| 2316 | } else { | ||
| 2317 | matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); | ||
| 2318 | |||
| 2319 | // Return special upon seeing a positional matcher | ||
| 2320 | if ( matcher[ expando ] ) { | ||
| 2321 | // Find the next relative operator (if any) for proper handling | ||
| 2322 | j = ++i; | ||
| 2323 | for ( ; j < len; j++ ) { | ||
| 2324 | if ( Expr.relative[ tokens[j].type ] ) { | ||
| 2325 | break; | ||
| 2326 | } | ||
| 2327 | } | ||
| 2328 | return setMatcher( | ||
| 2329 | i > 1 && elementMatcher( matchers ), | ||
| 2330 | i > 1 && toSelector( | ||
| 2331 | // If the preceding token was a descendant combinator, insert an implicit any-element `*` | ||
| 2332 | tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) | ||
| 2333 | ).replace( rtrim, "$1" ), | ||
| 2334 | matcher, | ||
| 2335 | i < j && matcherFromTokens( tokens.slice( i, j ) ), | ||
| 2336 | j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), | ||
| 2337 | j < len && toSelector( tokens ) | ||
| 2338 | ); | ||
| 2339 | } | ||
| 2340 | matchers.push( matcher ); | ||
| 2341 | } | ||
| 2342 | } | ||
| 2343 | |||
| 2344 | return elementMatcher( matchers ); | ||
| 2345 | } | ||
| 2346 | |||
| 2347 | function matcherFromGroupMatchers( elementMatchers, setMatchers ) { | ||
| 2348 | var bySet = setMatchers.length > 0, | ||
| 2349 | byElement = elementMatchers.length > 0, | ||
| 2350 | superMatcher = function( seed, context, xml, results, outermost ) { | ||
| 2351 | var elem, j, matcher, | ||
| 2352 | matchedCount = 0, | ||
| 2353 | i = "0", | ||
| 2354 | unmatched = seed && [], | ||
| 2355 | setMatched = [], | ||
| 2356 | contextBackup = outermostContext, | ||
| 2357 | // We must always have either seed elements or outermost context | ||
| 2358 | elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), | ||
| 2359 | // Use integer dirruns iff this is the outermost matcher | ||
| 2360 | dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), | ||
| 2361 | len = elems.length; | ||
| 2362 | |||
| 2363 | if ( outermost ) { | ||
| 2364 | outermostContext = context !== document && context; | ||
| 2365 | } | ||
| 2366 | |||
| 2367 | // Add elements passing elementMatchers directly to results | ||
| 2368 | // Keep `i` a string if there are no elements so `matchedCount` will be "00" below | ||
| 2369 | // Support: IE<9, Safari | ||
| 2370 | // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id | ||
| 2371 | for ( ; i !== len && (elem = elems[i]) != null; i++ ) { | ||
| 2372 | if ( byElement && elem ) { | ||
| 2373 | j = 0; | ||
| 2374 | while ( (matcher = elementMatchers[j++]) ) { | ||
| 2375 | if ( matcher( elem, context, xml ) ) { | ||
| 2376 | results.push( elem ); | ||
| 2377 | break; | ||
| 2378 | } | ||
| 2379 | } | ||
| 2380 | if ( outermost ) { | ||
| 2381 | dirruns = dirrunsUnique; | ||
| 2382 | } | ||
| 2383 | } | ||
| 2384 | |||
| 2385 | // Track unmatched elements for set filters | ||
| 2386 | if ( bySet ) { | ||
| 2387 | // They will have gone through all possible matchers | ||
| 2388 | if ( (elem = !matcher && elem) ) { | ||
| 2389 | matchedCount--; | ||
| 2390 | } | ||
| 2391 | |||
| 2392 | // Lengthen the array for every element, matched or not | ||
| 2393 | if ( seed ) { | ||
| 2394 | unmatched.push( elem ); | ||
| 2395 | } | ||
| 2396 | } | ||
| 2397 | } | ||
| 2398 | |||
| 2399 | // Apply set filters to unmatched elements | ||
| 2400 | matchedCount += i; | ||
| 2401 | if ( bySet && i !== matchedCount ) { | ||
| 2402 | j = 0; | ||
| 2403 | while ( (matcher = setMatchers[j++]) ) { | ||
| 2404 | matcher( unmatched, setMatched, context, xml ); | ||
| 2405 | } | ||
| 2406 | |||
| 2407 | if ( seed ) { | ||
| 2408 | // Reintegrate element matches to eliminate the need for sorting | ||
| 2409 | if ( matchedCount > 0 ) { | ||
| 2410 | while ( i-- ) { | ||
| 2411 | if ( !(unmatched[i] || setMatched[i]) ) { | ||
| 2412 | setMatched[i] = pop.call( results ); | ||
| 2413 | } | ||
| 2414 | } | ||
| 2415 | } | ||
| 2416 | |||
| 2417 | // Discard index placeholder values to get only actual matches | ||
| 2418 | setMatched = condense( setMatched ); | ||
| 2419 | } | ||
| 2420 | |||
| 2421 | // Add matches to results | ||
| 2422 | push.apply( results, setMatched ); | ||
| 2423 | |||
| 2424 | // Seedless set matches succeeding multiple successful matchers stipulate sorting | ||
| 2425 | if ( outermost && !seed && setMatched.length > 0 && | ||
| 2426 | ( matchedCount + setMatchers.length ) > 1 ) { | ||
| 2427 | |||
| 2428 | Sizzle.uniqueSort( results ); | ||
| 2429 | } | ||
| 2430 | } | ||
| 2431 | |||
| 2432 | // Override manipulation of globals by nested matchers | ||
| 2433 | if ( outermost ) { | ||
| 2434 | dirruns = dirrunsUnique; | ||
| 2435 | outermostContext = contextBackup; | ||
| 2436 | } | ||
| 2437 | |||
| 2438 | return unmatched; | ||
| 2439 | }; | ||
| 2440 | |||
| 2441 | return bySet ? | ||
| 2442 | markFunction( superMatcher ) : | ||
| 2443 | superMatcher; | ||
| 2444 | } | ||
| 2445 | |||
| 2446 | compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { | ||
| 2447 | var i, | ||
| 2448 | setMatchers = [], | ||
| 2449 | elementMatchers = [], | ||
| 2450 | cached = compilerCache[ selector + " " ]; | ||
| 2451 | |||
| 2452 | if ( !cached ) { | ||
| 2453 | // Generate a function of recursive functions that can be used to check each element | ||
| 2454 | if ( !match ) { | ||
| 2455 | match = tokenize( selector ); | ||
| 2456 | } | ||
| 2457 | i = match.length; | ||
| 2458 | while ( i-- ) { | ||
| 2459 | cached = matcherFromTokens( match[i] ); | ||
| 2460 | if ( cached[ expando ] ) { | ||
| 2461 | setMatchers.push( cached ); | ||
| 2462 | } else { | ||
| 2463 | elementMatchers.push( cached ); | ||
| 2464 | } | ||
| 2465 | } | ||
| 2466 | |||
| 2467 | // Cache the compiled function | ||
| 2468 | cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); | ||
| 2469 | |||
| 2470 | // Save selector and tokenization | ||
| 2471 | cached.selector = selector; | ||
| 2472 | } | ||
| 2473 | return cached; | ||
| 2474 | }; | ||
| 2475 | |||
| 2476 | /** | ||
| 2477 | * A low-level selection function that works with Sizzle's compiled | ||
| 2478 | * selector functions | ||
| 2479 | * @param {String|Function} selector A selector or a pre-compiled | ||
| 2480 | * selector function built with Sizzle.compile | ||
| 2481 | * @param {Element} context | ||
| 2482 | * @param {Array} [results] | ||
| 2483 | * @param {Array} [seed] A set of elements to match against | ||
| 2484 | */ | ||
| 2485 | select = Sizzle.select = function( selector, context, results, seed ) { | ||
| 2486 | var i, tokens, token, type, find, | ||
| 2487 | compiled = typeof selector === "function" && selector, | ||
| 2488 | match = !seed && tokenize( (selector = compiled.selector || selector) ); | ||
| 2489 | |||
| 2490 | results = results || []; | ||
| 2491 | |||
| 2492 | // Try to minimize operations if there is no seed and only one group | ||
| 2493 | if ( match.length === 1 ) { | ||
| 2494 | |||
| 2495 | // Take a shortcut and set the context if the root selector is an ID | ||
| 2496 | tokens = match[0] = match[0].slice( 0 ); | ||
| 2497 | if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && | ||
| 2498 | support.getById && context.nodeType === 9 && documentIsHTML && | ||
| 2499 | Expr.relative[ tokens[1].type ] ) { | ||
| 2500 | |||
| 2501 | context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; | ||
| 2502 | if ( !context ) { | ||
| 2503 | return results; | ||
| 2504 | |||
| 2505 | // Precompiled matchers will still verify ancestry, so step up a level | ||
| 2506 | } else if ( compiled ) { | ||
| 2507 | context = context.parentNode; | ||
| 2508 | } | ||
| 2509 | |||
| 2510 | selector = selector.slice( tokens.shift().value.length ); | ||
| 2511 | } | ||
| 2512 | |||
| 2513 | // Fetch a seed set for right-to-left matching | ||
| 2514 | i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; | ||
| 2515 | while ( i-- ) { | ||
| 2516 | token = tokens[i]; | ||
| 2517 | |||
| 2518 | // Abort if we hit a combinator | ||
| 2519 | if ( Expr.relative[ (type = token.type) ] ) { | ||
| 2520 | break; | ||
| 2521 | } | ||
| 2522 | if ( (find = Expr.find[ type ]) ) { | ||
| 2523 | // Search, expanding context for leading sibling combinators | ||
| 2524 | if ( (seed = find( | ||
| 2525 | token.matches[0].replace( runescape, funescape ), | ||
| 2526 | rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context | ||
| 2527 | )) ) { | ||
| 2528 | |||
| 2529 | // If seed is empty or no tokens remain, we can return early | ||
| 2530 | tokens.splice( i, 1 ); | ||
| 2531 | selector = seed.length && toSelector( tokens ); | ||
| 2532 | if ( !selector ) { | ||
| 2533 | push.apply( results, seed ); | ||
| 2534 | return results; | ||
| 2535 | } | ||
| 2536 | |||
| 2537 | break; | ||
| 2538 | } | ||
| 2539 | } | ||
| 2540 | } | ||
| 2541 | } | ||
| 2542 | |||
| 2543 | // Compile and execute a filtering function if one is not provided | ||
| 2544 | // Provide `match` to avoid retokenization if we modified the selector above | ||
| 2545 | ( compiled || compile( selector, match ) )( | ||
| 2546 | seed, | ||
| 2547 | context, | ||
| 2548 | !documentIsHTML, | ||
| 2549 | results, | ||
| 2550 | rsibling.test( selector ) && testContext( context.parentNode ) || context | ||
| 2551 | ); | ||
| 2552 | return results; | ||
| 2553 | }; | ||
| 2554 | |||
| 2555 | // One-time assignments | ||
| 2556 | |||
| 2557 | // Sort stability | ||
| 2558 | support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; | ||
| 2559 | |||
| 2560 | // Support: Chrome<14 | ||
| 2561 | // Always assume duplicates if they aren't passed to the comparison function | ||
| 2562 | support.detectDuplicates = !!hasDuplicate; | ||
| 2563 | |||
| 2564 | // Initialize against the default document | ||
| 2565 | setDocument(); | ||
| 2566 | |||
| 2567 | // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) | ||
| 2568 | // Detached nodes confoundingly follow *each other* | ||
| 2569 | support.sortDetached = assert(function( div1 ) { | ||
| 2570 | // Should return 1, but returns 4 (following) | ||
| 2571 | return div1.compareDocumentPosition( document.createElement("div") ) & 1; | ||
| 2572 | }); | ||
| 2573 | |||
| 2574 | // Support: IE<8 | ||
| 2575 | // Prevent attribute/property "interpolation" | ||
| 2576 | // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx | ||
| 2577 | if ( !assert(function( div ) { | ||
| 2578 | div.innerHTML = "<a href='#'></a>"; | ||
| 2579 | return div.firstChild.getAttribute("href") === "#" ; | ||
| 2580 | }) ) { | ||
| 2581 | addHandle( "type|href|height|width", function( elem, name, isXML ) { | ||
| 2582 | if ( !isXML ) { | ||
| 2583 | return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); | ||
| 2584 | } | ||
| 2585 | }); | ||
| 2586 | } | ||
| 2587 | |||
| 2588 | // Support: IE<9 | ||
| 2589 | // Use defaultValue in place of getAttribute("value") | ||
| 2590 | if ( !support.attributes || !assert(function( div ) { | ||
| 2591 | div.innerHTML = "<input/>"; | ||
| 2592 | div.firstChild.setAttribute( "value", "" ); | ||
| 2593 | return div.firstChild.getAttribute( "value" ) === ""; | ||
| 2594 | }) ) { | ||
| 2595 | addHandle( "value", function( elem, name, isXML ) { | ||
| 2596 | if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { | ||
| 2597 | return elem.defaultValue; | ||
| 2598 | } | ||
| 2599 | }); | ||
| 2600 | } | ||
| 2601 | |||
| 2602 | // Support: IE<9 | ||
| 2603 | // Use getAttributeNode to fetch booleans when getAttribute lies | ||
| 2604 | if ( !assert(function( div ) { | ||
| 2605 | return div.getAttribute("disabled") == null; | ||
| 2606 | }) ) { | ||
| 2607 | addHandle( booleans, function( elem, name, isXML ) { | ||
| 2608 | var val; | ||
| 2609 | if ( !isXML ) { | ||
| 2610 | return elem[ name ] === true ? name.toLowerCase() : | ||
| 2611 | (val = elem.getAttributeNode( name )) && val.specified ? | ||
| 2612 | val.value : | ||
| 2613 | null; | ||
| 2614 | } | ||
| 2615 | }); | ||
| 2616 | } | ||
| 2617 | |||
| 2618 | return Sizzle; | ||
| 2619 | |||
| 2620 | })( window ); | ||
| 2621 | |||
| 2622 | |||
| 2623 | |||
| 2624 | jQuery.find = Sizzle; | ||
| 2625 | jQuery.expr = Sizzle.selectors; | ||
| 2626 | jQuery.expr[":"] = jQuery.expr.pseudos; | ||
| 2627 | jQuery.unique = Sizzle.uniqueSort; | ||
| 2628 | jQuery.text = Sizzle.getText; | ||
| 2629 | jQuery.isXMLDoc = Sizzle.isXML; | ||
| 2630 | jQuery.contains = Sizzle.contains; | ||
| 2631 | |||
| 2632 | |||
| 2633 | |||
| 2634 | var rneedsContext = jQuery.expr.match.needsContext; | ||
| 2635 | |||
| 2636 | var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); | ||
| 2637 | |||
| 2638 | |||
| 2639 | |||
| 2640 | var risSimple = /^.[^:#\[\.,]*$/; | ||
| 2641 | |||
| 2642 | // Implement the identical functionality for filter and not | ||
| 2643 | function winnow( elements, qualifier, not ) { | ||
| 2644 | if ( jQuery.isFunction( qualifier ) ) { | ||
| 2645 | return jQuery.grep( elements, function( elem, i ) { | ||
| 2646 | /* jshint -W018 */ | ||
| 2647 | return !!qualifier.call( elem, i, elem ) !== not; | ||
| 2648 | }); | ||
| 2649 | |||
| 2650 | } | ||
| 2651 | |||
| 2652 | if ( qualifier.nodeType ) { | ||
| 2653 | return jQuery.grep( elements, function( elem ) { | ||
| 2654 | return ( elem === qualifier ) !== not; | ||
| 2655 | }); | ||
| 2656 | |||
| 2657 | } | ||
| 2658 | |||
| 2659 | if ( typeof qualifier === "string" ) { | ||
| 2660 | if ( risSimple.test( qualifier ) ) { | ||
| 2661 | return jQuery.filter( qualifier, elements, not ); | ||
| 2662 | } | ||
| 2663 | |||
| 2664 | qualifier = jQuery.filter( qualifier, elements ); | ||
| 2665 | } | ||
| 2666 | |||
| 2667 | return jQuery.grep( elements, function( elem ) { | ||
| 2668 | return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; | ||
| 2669 | }); | ||
| 2670 | } | ||
| 2671 | |||
| 2672 | jQuery.filter = function( expr, elems, not ) { | ||
| 2673 | var elem = elems[ 0 ]; | ||
| 2674 | |||
| 2675 | if ( not ) { | ||
| 2676 | expr = ":not(" + expr + ")"; | ||
| 2677 | } | ||
| 2678 | |||
| 2679 | return elems.length === 1 && elem.nodeType === 1 ? | ||
| 2680 | jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : | ||
| 2681 | jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { | ||
| 2682 | return elem.nodeType === 1; | ||
| 2683 | })); | ||
| 2684 | }; | ||
| 2685 | |||
| 2686 | jQuery.fn.extend({ | ||
| 2687 | find: function( selector ) { | ||
| 2688 | var i, | ||
| 2689 | ret = [], | ||
| 2690 | self = this, | ||
| 2691 | len = self.length; | ||
| 2692 | |||
| 2693 | if ( typeof selector !== "string" ) { | ||
| 2694 | return this.pushStack( jQuery( selector ).filter(function() { | ||
| 2695 | for ( i = 0; i < len; i++ ) { | ||
| 2696 | if ( jQuery.contains( self[ i ], this ) ) { | ||
| 2697 | return true; | ||
| 2698 | } | ||
| 2699 | } | ||
| 2700 | }) ); | ||
| 2701 | } | ||
| 2702 | |||
| 2703 | for ( i = 0; i < len; i++ ) { | ||
| 2704 | jQuery.find( selector, self[ i ], ret ); | ||
| 2705 | } | ||
| 2706 | |||
| 2707 | // Needed because $( selector, context ) becomes $( context ).find( selector ) | ||
| 2708 | ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); | ||
| 2709 | ret.selector = this.selector ? this.selector + " " + selector : selector; | ||
| 2710 | return ret; | ||
| 2711 | }, | ||
| 2712 | filter: function( selector ) { | ||
| 2713 | return this.pushStack( winnow(this, selector || [], false) ); | ||
| 2714 | }, | ||
| 2715 | not: function( selector ) { | ||
| 2716 | return this.pushStack( winnow(this, selector || [], true) ); | ||
| 2717 | }, | ||
| 2718 | is: function( selector ) { | ||
| 2719 | return !!winnow( | ||
| 2720 | this, | ||
| 2721 | |||
| 2722 | // If this is a positional/relative selector, check membership in the returned set | ||
| 2723 | // so $("p:first").is("p:last") won't return true for a doc with two "p". | ||
| 2724 | typeof selector === "string" && rneedsContext.test( selector ) ? | ||
| 2725 | jQuery( selector ) : | ||
| 2726 | selector || [], | ||
| 2727 | false | ||
| 2728 | ).length; | ||
| 2729 | } | ||
| 2730 | }); | ||
| 2731 | |||
| 2732 | |||
| 2733 | // Initialize a jQuery object | ||
| 2734 | |||
| 2735 | |||
| 2736 | // A central reference to the root jQuery(document) | ||
| 2737 | var rootjQuery, | ||
| 2738 | |||
| 2739 | // Use the correct document accordingly with window argument (sandbox) | ||
| 2740 | document = window.document, | ||
| 2741 | |||
| 2742 | // A simple way to check for HTML strings | ||
| 2743 | // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) | ||
| 2744 | // Strict HTML recognition (#11290: must start with <) | ||
| 2745 | rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, | ||
| 2746 | |||
| 2747 | init = jQuery.fn.init = function( selector, context ) { | ||
| 2748 | var match, elem; | ||
| 2749 | |||
| 2750 | // HANDLE: $(""), $(null), $(undefined), $(false) | ||
| 2751 | if ( !selector ) { | ||
| 2752 | return this; | ||
| 2753 | } | ||
| 2754 | |||
| 2755 | // Handle HTML strings | ||
| 2756 | if ( typeof selector === "string" ) { | ||
| 2757 | if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { | ||
| 2758 | // Assume that strings that start and end with <> are HTML and skip the regex check | ||
| 2759 | match = [ null, selector, null ]; | ||
| 2760 | |||
| 2761 | } else { | ||
| 2762 | match = rquickExpr.exec( selector ); | ||
| 2763 | } | ||
| 2764 | |||
| 2765 | // Match html or make sure no context is specified for #id | ||
| 2766 | if ( match && (match[1] || !context) ) { | ||
| 2767 | |||
| 2768 | // HANDLE: $(html) -> $(array) | ||
| 2769 | if ( match[1] ) { | ||
| 2770 | context = context instanceof jQuery ? context[0] : context; | ||
| 2771 | |||
| 2772 | // scripts is true for back-compat | ||
| 2773 | // Intentionally let the error be thrown if parseHTML is not present | ||
| 2774 | jQuery.merge( this, jQuery.parseHTML( | ||
| 2775 | match[1], | ||
| 2776 | context && context.nodeType ? context.ownerDocument || context : document, | ||
| 2777 | true | ||
| 2778 | ) ); | ||
| 2779 | |||
| 2780 | // HANDLE: $(html, props) | ||
| 2781 | if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { | ||
| 2782 | for ( match in context ) { | ||
| 2783 | // Properties of context are called as methods if possible | ||
| 2784 | if ( jQuery.isFunction( this[ match ] ) ) { | ||
| 2785 | this[ match ]( context[ match ] ); | ||
| 2786 | |||
| 2787 | // ...and otherwise set as attributes | ||
| 2788 | } else { | ||
| 2789 | this.attr( match, context[ match ] ); | ||
| 2790 | } | ||
| 2791 | } | ||
| 2792 | } | ||
| 2793 | |||
| 2794 | return this; | ||
| 2795 | |||
| 2796 | // HANDLE: $(#id) | ||
| 2797 | } else { | ||
| 2798 | elem = document.getElementById( match[2] ); | ||
| 2799 | |||
| 2800 | // Check parentNode to catch when Blackberry 4.6 returns | ||
| 2801 | // nodes that are no longer in the document #6963 | ||
| 2802 | if ( elem && elem.parentNode ) { | ||
| 2803 | // Handle the case where IE and Opera return items | ||
| 2804 | // by name instead of ID | ||
| 2805 | if ( elem.id !== match[2] ) { | ||
| 2806 | return rootjQuery.find( selector ); | ||
| 2807 | } | ||
| 2808 | |||
| 2809 | // Otherwise, we inject the element directly into the jQuery object | ||
| 2810 | this.length = 1; | ||
| 2811 | this[0] = elem; | ||
| 2812 | } | ||
| 2813 | |||
| 2814 | this.context = document; | ||
| 2815 | this.selector = selector; | ||
| 2816 | return this; | ||
| 2817 | } | ||
| 2818 | |||
| 2819 | // HANDLE: $(expr, $(...)) | ||
| 2820 | } else if ( !context || context.jquery ) { | ||
| 2821 | return ( context || rootjQuery ).find( selector ); | ||
| 2822 | |||
| 2823 | // HANDLE: $(expr, context) | ||
| 2824 | // (which is just equivalent to: $(context).find(expr) | ||
| 2825 | } else { | ||
| 2826 | return this.constructor( context ).find( selector ); | ||
| 2827 | } | ||
| 2828 | |||
| 2829 | // HANDLE: $(DOMElement) | ||
| 2830 | } else if ( selector.nodeType ) { | ||
| 2831 | this.context = this[0] = selector; | ||
| 2832 | this.length = 1; | ||
| 2833 | return this; | ||
| 2834 | |||
| 2835 | // HANDLE: $(function) | ||
| 2836 | // Shortcut for document ready | ||
| 2837 | } else if ( jQuery.isFunction( selector ) ) { | ||
| 2838 | return typeof rootjQuery.ready !== "undefined" ? | ||
| 2839 | rootjQuery.ready( selector ) : | ||
| 2840 | // Execute immediately if ready is not present | ||
| 2841 | selector( jQuery ); | ||
| 2842 | } | ||
| 2843 | |||
| 2844 | if ( selector.selector !== undefined ) { | ||
| 2845 | this.selector = selector.selector; | ||
| 2846 | this.context = selector.context; | ||
| 2847 | } | ||
| 2848 | |||
| 2849 | return jQuery.makeArray( selector, this ); | ||
| 2850 | }; | ||
| 2851 | |||
| 2852 | // Give the init function the jQuery prototype for later instantiation | ||
| 2853 | init.prototype = jQuery.fn; | ||
| 2854 | |||
| 2855 | // Initialize central reference | ||
| 2856 | rootjQuery = jQuery( document ); | ||
| 2857 | |||
| 2858 | |||
| 2859 | var rparentsprev = /^(?:parents|prev(?:Until|All))/, | ||
| 2860 | // methods guaranteed to produce a unique set when starting from a unique set | ||
| 2861 | guaranteedUnique = { | ||
| 2862 | children: true, | ||
| 2863 | contents: true, | ||
| 2864 | next: true, | ||
| 2865 | prev: true | ||
| 2866 | }; | ||
| 2867 | |||
| 2868 | jQuery.extend({ | ||
| 2869 | dir: function( elem, dir, until ) { | ||
| 2870 | var matched = [], | ||
| 2871 | cur = elem[ dir ]; | ||
| 2872 | |||
| 2873 | while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { | ||
| 2874 | if ( cur.nodeType === 1 ) { | ||
| 2875 | matched.push( cur ); | ||
| 2876 | } | ||
| 2877 | cur = cur[dir]; | ||
| 2878 | } | ||
| 2879 | return matched; | ||
| 2880 | }, | ||
| 2881 | |||
| 2882 | sibling: function( n, elem ) { | ||
| 2883 | var r = []; | ||
| 2884 | |||
| 2885 | for ( ; n; n = n.nextSibling ) { | ||
| 2886 | if ( n.nodeType === 1 && n !== elem ) { | ||
| 2887 | r.push( n ); | ||
| 2888 | } | ||
| 2889 | } | ||
| 2890 | |||
| 2891 | return r; | ||
| 2892 | } | ||
| 2893 | }); | ||
| 2894 | |||
| 2895 | jQuery.fn.extend({ | ||
| 2896 | has: function( target ) { | ||
| 2897 | var i, | ||
| 2898 | targets = jQuery( target, this ), | ||
| 2899 | len = targets.length; | ||
| 2900 | |||
| 2901 | return this.filter(function() { | ||
| 2902 | for ( i = 0; i < len; i++ ) { | ||
| 2903 | if ( jQuery.contains( this, targets[i] ) ) { | ||
| 2904 | return true; | ||
| 2905 | } | ||
| 2906 | } | ||
| 2907 | }); | ||
| 2908 | }, | ||
| 2909 | |||
| 2910 | closest: function( selectors, context ) { | ||
| 2911 | var cur, | ||
| 2912 | i = 0, | ||
| 2913 | l = this.length, | ||
| 2914 | matched = [], | ||
| 2915 | pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? | ||
| 2916 | jQuery( selectors, context || this.context ) : | ||
| 2917 | 0; | ||
| 2918 | |||
| 2919 | for ( ; i < l; i++ ) { | ||
| 2920 | for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { | ||
| 2921 | // Always skip document fragments | ||
| 2922 | if ( cur.nodeType < 11 && (pos ? | ||
| 2923 | pos.index(cur) > -1 : | ||
| 2924 | |||
| 2925 | // Don't pass non-elements to Sizzle | ||
| 2926 | cur.nodeType === 1 && | ||
| 2927 | jQuery.find.matchesSelector(cur, selectors)) ) { | ||
| 2928 | |||
| 2929 | matched.push( cur ); | ||
| 2930 | break; | ||
| 2931 | } | ||
| 2932 | } | ||
| 2933 | } | ||
| 2934 | |||
| 2935 | return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); | ||
| 2936 | }, | ||
| 2937 | |||
| 2938 | // Determine the position of an element within | ||
| 2939 | // the matched set of elements | ||
| 2940 | index: function( elem ) { | ||
| 2941 | |||
| 2942 | // No argument, return index in parent | ||
| 2943 | if ( !elem ) { | ||
| 2944 | return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; | ||
| 2945 | } | ||
| 2946 | |||
| 2947 | // index in selector | ||
| 2948 | if ( typeof elem === "string" ) { | ||
| 2949 | return jQuery.inArray( this[0], jQuery( elem ) ); | ||
| 2950 | } | ||
| 2951 | |||
| 2952 | // Locate the position of the desired element | ||
| 2953 | return jQuery.inArray( | ||
| 2954 | // If it receives a jQuery object, the first element is used | ||
| 2955 | elem.jquery ? elem[0] : elem, this ); | ||
| 2956 | }, | ||
| 2957 | |||
| 2958 | add: function( selector, context ) { | ||
| 2959 | return this.pushStack( | ||
| 2960 | jQuery.unique( | ||
| 2961 | jQuery.merge( this.get(), jQuery( selector, context ) ) | ||
| 2962 | ) | ||
| 2963 | ); | ||
| 2964 | }, | ||
| 2965 | |||
| 2966 | addBack: function( selector ) { | ||
| 2967 | return this.add( selector == null ? | ||
| 2968 | this.prevObject : this.prevObject.filter(selector) | ||
| 2969 | ); | ||
| 2970 | } | ||
| 2971 | }); | ||
| 2972 | |||
| 2973 | function sibling( cur, dir ) { | ||
| 2974 | do { | ||
| 2975 | cur = cur[ dir ]; | ||
| 2976 | } while ( cur && cur.nodeType !== 1 ); | ||
| 2977 | |||
| 2978 | return cur; | ||
| 2979 | } | ||
| 2980 | |||
| 2981 | jQuery.each({ | ||
| 2982 | parent: function( elem ) { | ||
| 2983 | var parent = elem.parentNode; | ||
| 2984 | return parent && parent.nodeType !== 11 ? parent : null; | ||
| 2985 | }, | ||
| 2986 | parents: function( elem ) { | ||
| 2987 | return jQuery.dir( elem, "parentNode" ); | ||
| 2988 | }, | ||
| 2989 | parentsUntil: function( elem, i, until ) { | ||
| 2990 | return jQuery.dir( elem, "parentNode", until ); | ||
| 2991 | }, | ||
| 2992 | next: function( elem ) { | ||
| 2993 | return sibling( elem, "nextSibling" ); | ||
| 2994 | }, | ||
| 2995 | prev: function( elem ) { | ||
| 2996 | return sibling( elem, "previousSibling" ); | ||
| 2997 | }, | ||
| 2998 | nextAll: function( elem ) { | ||
| 2999 | return jQuery.dir( elem, "nextSibling" ); | ||
| 3000 | }, | ||
| 3001 | prevAll: function( elem ) { | ||
| 3002 | return jQuery.dir( elem, "previousSibling" ); | ||
| 3003 | }, | ||
| 3004 | nextUntil: function( elem, i, until ) { | ||
| 3005 | return jQuery.dir( elem, "nextSibling", until ); | ||
| 3006 | }, | ||
| 3007 | prevUntil: function( elem, i, until ) { | ||
| 3008 | return jQuery.dir( elem, "previousSibling", until ); | ||
| 3009 | }, | ||
| 3010 | siblings: function( elem ) { | ||
| 3011 | return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); | ||
| 3012 | }, | ||
| 3013 | children: function( elem ) { | ||
| 3014 | return jQuery.sibling( elem.firstChild ); | ||
| 3015 | }, | ||
| 3016 | contents: function( elem ) { | ||
| 3017 | return jQuery.nodeName( elem, "iframe" ) ? | ||
| 3018 | elem.contentDocument || elem.contentWindow.document : | ||
| 3019 | jQuery.merge( [], elem.childNodes ); | ||
| 3020 | } | ||
| 3021 | }, function( name, fn ) { | ||
| 3022 | jQuery.fn[ name ] = function( until, selector ) { | ||
| 3023 | var ret = jQuery.map( this, fn, until ); | ||
| 3024 | |||
| 3025 | if ( name.slice( -5 ) !== "Until" ) { | ||
| 3026 | selector = until; | ||
| 3027 | } | ||
| 3028 | |||
| 3029 | if ( selector && typeof selector === "string" ) { | ||
| 3030 | ret = jQuery.filter( selector, ret ); | ||
| 3031 | } | ||
| 3032 | |||
| 3033 | if ( this.length > 1 ) { | ||
| 3034 | // Remove duplicates | ||
| 3035 | if ( !guaranteedUnique[ name ] ) { | ||
| 3036 | ret = jQuery.unique( ret ); | ||
| 3037 | } | ||
| 3038 | |||
| 3039 | // Reverse order for parents* and prev-derivatives | ||
| 3040 | if ( rparentsprev.test( name ) ) { | ||
| 3041 | ret = ret.reverse(); | ||
| 3042 | } | ||
| 3043 | } | ||
| 3044 | |||
| 3045 | return this.pushStack( ret ); | ||
| 3046 | }; | ||
| 3047 | }); | ||
| 3048 | var rnotwhite = (/\S+/g); | ||
| 3049 | |||
| 3050 | |||
| 3051 | |||
| 3052 | // String to Object options format cache | ||
| 3053 | var optionsCache = {}; | ||
| 3054 | |||
| 3055 | // Convert String-formatted options into Object-formatted ones and store in cache | ||
| 3056 | function createOptions( options ) { | ||
| 3057 | var object = optionsCache[ options ] = {}; | ||
| 3058 | jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { | ||
| 3059 | object[ flag ] = true; | ||
| 3060 | }); | ||
| 3061 | return object; | ||
| 3062 | } | ||
| 3063 | |||
| 3064 | /* | ||
| 3065 | * Create a callback list using the following parameters: | ||
| 3066 | * | ||
| 3067 | * options: an optional list of space-separated options that will change how | ||
| 3068 | * the callback list behaves or a more traditional option object | ||
| 3069 | * | ||
| 3070 | * By default a callback list will act like an event callback list and can be | ||
| 3071 | * "fired" multiple times. | ||
| 3072 | * | ||
| 3073 | * Possible options: | ||
| 3074 | * | ||
| 3075 | * once: will ensure the callback list can only be fired once (like a Deferred) | ||
| 3076 | * | ||
| 3077 | * memory: will keep track of previous values and will call any callback added | ||
| 3078 | * after the list has been fired right away with the latest "memorized" | ||
| 3079 | * values (like a Deferred) | ||
| 3080 | * | ||
| 3081 | * unique: will ensure a callback can only be added once (no duplicate in the list) | ||
| 3082 | * | ||
| 3083 | * stopOnFalse: interrupt callings when a callback returns false | ||
| 3084 | * | ||
| 3085 | */ | ||
| 3086 | jQuery.Callbacks = function( options ) { | ||
| 3087 | |||
| 3088 | // Convert options from String-formatted to Object-formatted if needed | ||
| 3089 | // (we check in cache first) | ||
| 3090 | options = typeof options === "string" ? | ||
| 3091 | ( optionsCache[ options ] || createOptions( options ) ) : | ||
| 3092 | jQuery.extend( {}, options ); | ||
| 3093 | |||
| 3094 | var // Flag to know if list is currently firing | ||
| 3095 | firing, | ||
| 3096 | // Last fire value (for non-forgettable lists) | ||
| 3097 | memory, | ||
| 3098 | // Flag to know if list was already fired | ||
| 3099 | fired, | ||
| 3100 | // End of the loop when firing | ||
| 3101 | firingLength, | ||
| 3102 | // Index of currently firing callback (modified by remove if needed) | ||
| 3103 | firingIndex, | ||
| 3104 | // First callback to fire (used internally by add and fireWith) | ||
| 3105 | firingStart, | ||
| 3106 | // Actual callback list | ||
| 3107 | list = [], | ||
| 3108 | // Stack of fire calls for repeatable lists | ||
| 3109 | stack = !options.once && [], | ||
| 3110 | // Fire callbacks | ||
| 3111 | fire = function( data ) { | ||
| 3112 | memory = options.memory && data; | ||
| 3113 | fired = true; | ||
| 3114 | firingIndex = firingStart || 0; | ||
| 3115 | firingStart = 0; | ||
| 3116 | firingLength = list.length; | ||
| 3117 | firing = true; | ||
| 3118 | for ( ; list && firingIndex < firingLength; firingIndex++ ) { | ||
| 3119 | if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { | ||
| 3120 | memory = false; // To prevent further calls using add | ||
| 3121 | break; | ||
| 3122 | } | ||
| 3123 | } | ||
| 3124 | firing = false; | ||
| 3125 | if ( list ) { | ||
| 3126 | if ( stack ) { | ||
| 3127 | if ( stack.length ) { | ||
| 3128 | fire( stack.shift() ); | ||
| 3129 | } | ||
| 3130 | } else if ( memory ) { | ||
| 3131 | list = []; | ||
| 3132 | } else { | ||
| 3133 | self.disable(); | ||
| 3134 | } | ||
| 3135 | } | ||
| 3136 | }, | ||
| 3137 | // Actual Callbacks object | ||
| 3138 | self = { | ||
| 3139 | // Add a callback or a collection of callbacks to the list | ||
| 3140 | add: function() { | ||
| 3141 | if ( list ) { | ||
| 3142 | // First, we save the current length | ||
| 3143 | var start = list.length; | ||
| 3144 | (function add( args ) { | ||
| 3145 | jQuery.each( args, function( _, arg ) { | ||
| 3146 | var type = jQuery.type( arg ); | ||
| 3147 | if ( type === "function" ) { | ||
| 3148 | if ( !options.unique || !self.has( arg ) ) { | ||
| 3149 | list.push( arg ); | ||
| 3150 | } | ||
| 3151 | } else if ( arg && arg.length && type !== "string" ) { | ||
| 3152 | // Inspect recursively | ||
| 3153 | add( arg ); | ||
| 3154 | } | ||
| 3155 | }); | ||
| 3156 | })( arguments ); | ||
| 3157 | // Do we need to add the callbacks to the | ||
| 3158 | // current firing batch? | ||
| 3159 | if ( firing ) { | ||
| 3160 | firingLength = list.length; | ||
| 3161 | // With memory, if we're not firing then | ||
| 3162 | // we should call right away | ||
| 3163 | } else if ( memory ) { | ||
| 3164 | firingStart = start; | ||
| 3165 | fire( memory ); | ||
| 3166 | } | ||
| 3167 | } | ||
| 3168 | return this; | ||
| 3169 | }, | ||
| 3170 | // Remove a callback from the list | ||
| 3171 | remove: function() { | ||
| 3172 | if ( list ) { | ||
| 3173 | jQuery.each( arguments, function( _, arg ) { | ||
| 3174 | var index; | ||
| 3175 | while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { | ||
| 3176 | list.splice( index, 1 ); | ||
| 3177 | // Handle firing indexes | ||
| 3178 | if ( firing ) { | ||
| 3179 | if ( index <= firingLength ) { | ||
| 3180 | firingLength--; | ||
| 3181 | } | ||
| 3182 | if ( index <= firingIndex ) { | ||
| 3183 | firingIndex--; | ||
| 3184 | } | ||
| 3185 | } | ||
| 3186 | } | ||
| 3187 | }); | ||
| 3188 | } | ||
| 3189 | return this; | ||
| 3190 | }, | ||
| 3191 | // Check if a given callback is in the list. | ||
| 3192 | // If no argument is given, return whether or not list has callbacks attached. | ||
| 3193 | has: function( fn ) { | ||
| 3194 | return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); | ||
| 3195 | }, | ||
| 3196 | // Remove all callbacks from the list | ||
| 3197 | empty: function() { | ||
| 3198 | list = []; | ||
| 3199 | firingLength = 0; | ||
| 3200 | return this; | ||
| 3201 | }, | ||
| 3202 | // Have the list do nothing anymore | ||
| 3203 | disable: function() { | ||
| 3204 | list = stack = memory = undefined; | ||
| 3205 | return this; | ||
| 3206 | }, | ||
| 3207 | // Is it disabled? | ||
| 3208 | disabled: function() { | ||
| 3209 | return !list; | ||
| 3210 | }, | ||
| 3211 | // Lock the list in its current state | ||
| 3212 | lock: function() { | ||
| 3213 | stack = undefined; | ||
| 3214 | if ( !memory ) { | ||
| 3215 | self.disable(); | ||
| 3216 | } | ||
| 3217 | return this; | ||
| 3218 | }, | ||
| 3219 | // Is it locked? | ||
| 3220 | locked: function() { | ||
| 3221 | return !stack; | ||
| 3222 | }, | ||
| 3223 | // Call all callbacks with the given context and arguments | ||
| 3224 | fireWith: function( context, args ) { | ||
| 3225 | if ( list && ( !fired || stack ) ) { | ||
| 3226 | args = args || []; | ||
| 3227 | args = [ context, args.slice ? args.slice() : args ]; | ||
| 3228 | if ( firing ) { | ||
| 3229 | stack.push( args ); | ||
| 3230 | } else { | ||
| 3231 | fire( args ); | ||
| 3232 | } | ||
| 3233 | } | ||
| 3234 | return this; | ||
| 3235 | }, | ||
| 3236 | // Call all the callbacks with the given arguments | ||
| 3237 | fire: function() { | ||
| 3238 | self.fireWith( this, arguments ); | ||
| 3239 | return this; | ||
| 3240 | }, | ||
| 3241 | // To know if the callbacks have already been called at least once | ||
| 3242 | fired: function() { | ||
| 3243 | return !!fired; | ||
| 3244 | } | ||
| 3245 | }; | ||
| 3246 | |||
| 3247 | return self; | ||
| 3248 | }; | ||
| 3249 | |||
| 3250 | |||
| 3251 | jQuery.extend({ | ||
| 3252 | |||
| 3253 | Deferred: function( func ) { | ||
| 3254 | var tuples = [ | ||
| 3255 | // action, add listener, listener list, final state | ||
| 3256 | [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], | ||
| 3257 | [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], | ||
| 3258 | [ "notify", "progress", jQuery.Callbacks("memory") ] | ||
| 3259 | ], | ||
| 3260 | state = "pending", | ||
| 3261 | promise = { | ||
| 3262 | state: function() { | ||
| 3263 | return state; | ||
| 3264 | }, | ||
| 3265 | always: function() { | ||
| 3266 | deferred.done( arguments ).fail( arguments ); | ||
| 3267 | return this; | ||
| 3268 | }, | ||
| 3269 | then: function( /* fnDone, fnFail, fnProgress */ ) { | ||
| 3270 | var fns = arguments; | ||
| 3271 | return jQuery.Deferred(function( newDefer ) { | ||
| 3272 | jQuery.each( tuples, function( i, tuple ) { | ||
| 3273 | var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; | ||
| 3274 | // deferred[ done | fail | progress ] for forwarding actions to newDefer | ||
| 3275 | deferred[ tuple[1] ](function() { | ||
| 3276 | var returned = fn && fn.apply( this, arguments ); | ||
| 3277 | if ( returned && jQuery.isFunction( returned.promise ) ) { | ||
| 3278 | returned.promise() | ||
| 3279 | .done( newDefer.resolve ) | ||
| 3280 | .fail( newDefer.reject ) | ||
| 3281 | .progress( newDefer.notify ); | ||
| 3282 | } else { | ||
| 3283 | newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); | ||
| 3284 | } | ||
| 3285 | }); | ||
| 3286 | }); | ||
| 3287 | fns = null; | ||
| 3288 | }).promise(); | ||
| 3289 | }, | ||
| 3290 | // Get a promise for this deferred | ||
| 3291 | // If obj is provided, the promise aspect is added to the object | ||
| 3292 | promise: function( obj ) { | ||
| 3293 | return obj != null ? jQuery.extend( obj, promise ) : promise; | ||
| 3294 | } | ||
| 3295 | }, | ||
| 3296 | deferred = {}; | ||
| 3297 | |||
| 3298 | // Keep pipe for back-compat | ||
| 3299 | promise.pipe = promise.then; | ||
| 3300 | |||
| 3301 | // Add list-specific methods | ||
| 3302 | jQuery.each( tuples, function( i, tuple ) { | ||
| 3303 | var list = tuple[ 2 ], | ||
| 3304 | stateString = tuple[ 3 ]; | ||
| 3305 | |||
| 3306 | // promise[ done | fail | progress ] = list.add | ||
| 3307 | promise[ tuple[1] ] = list.add; | ||
| 3308 | |||
| 3309 | // Handle state | ||
| 3310 | if ( stateString ) { | ||
| 3311 | list.add(function() { | ||
| 3312 | // state = [ resolved | rejected ] | ||
| 3313 | state = stateString; | ||
| 3314 | |||
| 3315 | // [ reject_list | resolve_list ].disable; progress_list.lock | ||
| 3316 | }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); | ||
| 3317 | } | ||
| 3318 | |||
| 3319 | // deferred[ resolve | reject | notify ] | ||
| 3320 | deferred[ tuple[0] ] = function() { | ||
| 3321 | deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); | ||
| 3322 | return this; | ||
| 3323 | }; | ||
| 3324 | deferred[ tuple[0] + "With" ] = list.fireWith; | ||
| 3325 | }); | ||
| 3326 | |||
| 3327 | // Make the deferred a promise | ||
| 3328 | promise.promise( deferred ); | ||
| 3329 | |||
| 3330 | // Call given func if any | ||
| 3331 | if ( func ) { | ||
| 3332 | func.call( deferred, deferred ); | ||
| 3333 | } | ||
| 3334 | |||
| 3335 | // All done! | ||
| 3336 | return deferred; | ||
| 3337 | }, | ||
| 3338 | |||
| 3339 | // Deferred helper | ||
| 3340 | when: function( subordinate /* , ..., subordinateN */ ) { | ||
| 3341 | var i = 0, | ||
| 3342 | resolveValues = slice.call( arguments ), | ||
| 3343 | length = resolveValues.length, | ||
| 3344 | |||
| 3345 | // the count of uncompleted subordinates | ||
| 3346 | remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, | ||
| 3347 | |||
| 3348 | // the master Deferred. If resolveValues consist of only a single Deferred, just use that. | ||
| 3349 | deferred = remaining === 1 ? subordinate : jQuery.Deferred(), | ||
| 3350 | |||
| 3351 | // Update function for both resolve and progress values | ||
| 3352 | updateFunc = function( i, contexts, values ) { | ||
| 3353 | return function( value ) { | ||
| 3354 | contexts[ i ] = this; | ||
| 3355 | values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; | ||
| 3356 | if ( values === progressValues ) { | ||
| 3357 | deferred.notifyWith( contexts, values ); | ||
| 3358 | |||
| 3359 | } else if ( !(--remaining) ) { | ||
| 3360 | deferred.resolveWith( contexts, values ); | ||
| 3361 | } | ||
| 3362 | }; | ||
| 3363 | }, | ||
| 3364 | |||
| 3365 | progressValues, progressContexts, resolveContexts; | ||
| 3366 | |||
| 3367 | // add listeners to Deferred subordinates; treat others as resolved | ||
| 3368 | if ( length > 1 ) { | ||
| 3369 | progressValues = new Array( length ); | ||
| 3370 | progressContexts = new Array( length ); | ||
| 3371 | resolveContexts = new Array( length ); | ||
| 3372 | for ( ; i < length; i++ ) { | ||
| 3373 | if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { | ||
| 3374 | resolveValues[ i ].promise() | ||
| 3375 | .done( updateFunc( i, resolveContexts, resolveValues ) ) | ||
| 3376 | .fail( deferred.reject ) | ||
| 3377 | .progress( updateFunc( i, progressContexts, progressValues ) ); | ||
| 3378 | } else { | ||
| 3379 | --remaining; | ||
| 3380 | } | ||
| 3381 | } | ||
| 3382 | } | ||
| 3383 | |||
| 3384 | // if we're not waiting on anything, resolve the master | ||
| 3385 | if ( !remaining ) { | ||
| 3386 | deferred.resolveWith( resolveContexts, resolveValues ); | ||
| 3387 | } | ||
| 3388 | |||
| 3389 | return deferred.promise(); | ||
| 3390 | } | ||
| 3391 | }); | ||
| 3392 | |||
| 3393 | |||
| 3394 | // The deferred used on DOM ready | ||
| 3395 | var readyList; | ||
| 3396 | |||
| 3397 | jQuery.fn.ready = function( fn ) { | ||
| 3398 | // Add the callback | ||
| 3399 | jQuery.ready.promise().done( fn ); | ||
| 3400 | |||
| 3401 | return this; | ||
| 3402 | }; | ||
| 3403 | |||
| 3404 | jQuery.extend({ | ||
| 3405 | // Is the DOM ready to be used? Set to true once it occurs. | ||
| 3406 | isReady: false, | ||
| 3407 | |||
| 3408 | // A counter to track how many items to wait for before | ||
| 3409 | // the ready event fires. See #6781 | ||
| 3410 | readyWait: 1, | ||
| 3411 | |||
| 3412 | // Hold (or release) the ready event | ||
| 3413 | holdReady: function( hold ) { | ||
| 3414 | if ( hold ) { | ||
| 3415 | jQuery.readyWait++; | ||
| 3416 | } else { | ||
| 3417 | jQuery.ready( true ); | ||
| 3418 | } | ||
| 3419 | }, | ||
| 3420 | |||
| 3421 | // Handle when the DOM is ready | ||
| 3422 | ready: function( wait ) { | ||
| 3423 | |||
| 3424 | // Abort if there are pending holds or we're already ready | ||
| 3425 | if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { | ||
| 3426 | return; | ||
| 3427 | } | ||
| 3428 | |||
| 3429 | // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). | ||
| 3430 | if ( !document.body ) { | ||
| 3431 | return setTimeout( jQuery.ready ); | ||
| 3432 | } | ||
| 3433 | |||
| 3434 | // Remember that the DOM is ready | ||
| 3435 | jQuery.isReady = true; | ||
| 3436 | |||
| 3437 | // If a normal DOM Ready event fired, decrement, and wait if need be | ||
| 3438 | if ( wait !== true && --jQuery.readyWait > 0 ) { | ||
| 3439 | return; | ||
| 3440 | } | ||
| 3441 | |||
| 3442 | // If there are functions bound, to execute | ||
| 3443 | readyList.resolveWith( document, [ jQuery ] ); | ||
| 3444 | |||
| 3445 | // Trigger any bound ready events | ||
| 3446 | if ( jQuery.fn.triggerHandler ) { | ||
| 3447 | jQuery( document ).triggerHandler( "ready" ); | ||
| 3448 | jQuery( document ).off( "ready" ); | ||
| 3449 | } | ||
| 3450 | } | ||
| 3451 | }); | ||
| 3452 | |||
| 3453 | /** | ||
| 3454 | * Clean-up method for dom ready events | ||
| 3455 | */ | ||
| 3456 | function detach() { | ||
| 3457 | if ( document.addEventListener ) { | ||
| 3458 | document.removeEventListener( "DOMContentLoaded", completed, false ); | ||
| 3459 | window.removeEventListener( "load", completed, false ); | ||
| 3460 | |||
| 3461 | } else { | ||
| 3462 | document.detachEvent( "onreadystatechange", completed ); | ||
| 3463 | window.detachEvent( "onload", completed ); | ||
| 3464 | } | ||
| 3465 | } | ||
| 3466 | |||
| 3467 | /** | ||
| 3468 | * The ready event handler and self cleanup method | ||
| 3469 | */ | ||
| 3470 | function completed() { | ||
| 3471 | // readyState === "complete" is good enough for us to call the dom ready in oldIE | ||
| 3472 | if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { | ||
| 3473 | detach(); | ||
| 3474 | jQuery.ready(); | ||
| 3475 | } | ||
| 3476 | } | ||
| 3477 | |||
| 3478 | jQuery.ready.promise = function( obj ) { | ||
| 3479 | if ( !readyList ) { | ||
| 3480 | |||
| 3481 | readyList = jQuery.Deferred(); | ||
| 3482 | |||
| 3483 | // Catch cases where $(document).ready() is called after the browser event has already occurred. | ||
| 3484 | // we once tried to use readyState "interactive" here, but it caused issues like the one | ||
| 3485 | // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 | ||
| 3486 | if ( document.readyState === "complete" ) { | ||
| 3487 | // Handle it asynchronously to allow scripts the opportunity to delay ready | ||
| 3488 | setTimeout( jQuery.ready ); | ||
| 3489 | |||
| 3490 | // Standards-based browsers support DOMContentLoaded | ||
| 3491 | } else if ( document.addEventListener ) { | ||
| 3492 | // Use the handy event callback | ||
| 3493 | document.addEventListener( "DOMContentLoaded", completed, false ); | ||
| 3494 | |||
| 3495 | // A fallback to window.onload, that will always work | ||
| 3496 | window.addEventListener( "load", completed, false ); | ||
| 3497 | |||
| 3498 | // If IE event model is used | ||
| 3499 | } else { | ||
| 3500 | // Ensure firing before onload, maybe late but safe also for iframes | ||
| 3501 | document.attachEvent( "onreadystatechange", completed ); | ||
| 3502 | |||
| 3503 | // A fallback to window.onload, that will always work | ||
| 3504 | window.attachEvent( "onload", completed ); | ||
| 3505 | |||
| 3506 | // If IE and not a frame | ||
| 3507 | // continually check to see if the document is ready | ||
| 3508 | var top = false; | ||
| 3509 | |||
| 3510 | try { | ||
| 3511 | top = window.frameElement == null && document.documentElement; | ||
| 3512 | } catch(e) {} | ||
| 3513 | |||
| 3514 | if ( top && top.doScroll ) { | ||
| 3515 | (function doScrollCheck() { | ||
| 3516 | if ( !jQuery.isReady ) { | ||
| 3517 | |||
| 3518 | try { | ||
| 3519 | // Use the trick by Diego Perini | ||
| 3520 | // http://javascript.nwbox.com/IEContentLoaded/ | ||
| 3521 | top.doScroll("left"); | ||
| 3522 | } catch(e) { | ||
| 3523 | return setTimeout( doScrollCheck, 50 ); | ||
| 3524 | } | ||
| 3525 | |||
| 3526 | // detach all dom ready events | ||
| 3527 | detach(); | ||
| 3528 | |||
| 3529 | // and execute any waiting functions | ||
| 3530 | jQuery.ready(); | ||
| 3531 | } | ||
| 3532 | })(); | ||
| 3533 | } | ||
| 3534 | } | ||
| 3535 | } | ||
| 3536 | return readyList.promise( obj ); | ||
| 3537 | }; | ||
| 3538 | |||
| 3539 | |||
| 3540 | var strundefined = typeof undefined; | ||
| 3541 | |||
| 3542 | |||
| 3543 | |||
| 3544 | // Support: IE<9 | ||
| 3545 | // Iteration over object's inherited properties before its own | ||
| 3546 | var i; | ||
| 3547 | for ( i in jQuery( support ) ) { | ||
| 3548 | break; | ||
| 3549 | } | ||
| 3550 | support.ownLast = i !== "0"; | ||
| 3551 | |||
| 3552 | // Note: most support tests are defined in their respective modules. | ||
| 3553 | // false until the test is run | ||
| 3554 | support.inlineBlockNeedsLayout = false; | ||
| 3555 | |||
| 3556 | // Execute ASAP in case we need to set body.style.zoom | ||
| 3557 | jQuery(function() { | ||
| 3558 | // Minified: var a,b,c,d | ||
| 3559 | var val, div, body, container; | ||
| 3560 | |||
| 3561 | body = document.getElementsByTagName( "body" )[ 0 ]; | ||
| 3562 | if ( !body || !body.style ) { | ||
| 3563 | // Return for frameset docs that don't have a body | ||
| 3564 | return; | ||
| 3565 | } | ||
| 3566 | |||
| 3567 | // Setup | ||
| 3568 | div = document.createElement( "div" ); | ||
| 3569 | container = document.createElement( "div" ); | ||
| 3570 | container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; | ||
| 3571 | body.appendChild( container ).appendChild( div ); | ||
| 3572 | |||
| 3573 | if ( typeof div.style.zoom !== strundefined ) { | ||
| 3574 | // Support: IE<8 | ||
| 3575 | // Check if natively block-level elements act like inline-block | ||
| 3576 | // elements when setting their display to 'inline' and giving | ||
| 3577 | // them layout | ||
| 3578 | div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; | ||
| 3579 | |||
| 3580 | support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; | ||
| 3581 | if ( val ) { | ||
| 3582 | // Prevent IE 6 from affecting layout for positioned elements #11048 | ||
| 3583 | // Prevent IE from shrinking the body in IE 7 mode #12869 | ||
| 3584 | // Support: IE<8 | ||
| 3585 | body.style.zoom = 1; | ||
| 3586 | } | ||
| 3587 | } | ||
| 3588 | |||
| 3589 | body.removeChild( container ); | ||
| 3590 | }); | ||
| 3591 | |||
| 3592 | |||
| 3593 | |||
| 3594 | |||
| 3595 | (function() { | ||
| 3596 | var div = document.createElement( "div" ); | ||
| 3597 | |||
| 3598 | // Execute the test only if not already executed in another module. | ||
| 3599 | if (support.deleteExpando == null) { | ||
| 3600 | // Support: IE<9 | ||
| 3601 | support.deleteExpando = true; | ||
| 3602 | try { | ||
| 3603 | delete div.test; | ||
| 3604 | } catch( e ) { | ||
| 3605 | support.deleteExpando = false; | ||
| 3606 | } | ||
| 3607 | } | ||
| 3608 | |||
| 3609 | // Null elements to avoid leaks in IE. | ||
| 3610 | div = null; | ||
| 3611 | })(); | ||
| 3612 | |||
| 3613 | |||
| 3614 | /** | ||
| 3615 | * Determines whether an object can have data | ||
| 3616 | */ | ||
| 3617 | jQuery.acceptData = function( elem ) { | ||
| 3618 | var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], | ||
| 3619 | nodeType = +elem.nodeType || 1; | ||
| 3620 | |||
| 3621 | // Do not set data on non-element DOM nodes because it will not be cleared (#8335). | ||
| 3622 | return nodeType !== 1 && nodeType !== 9 ? | ||
| 3623 | false : | ||
| 3624 | |||
| 3625 | // Nodes accept data unless otherwise specified; rejection can be conditional | ||
| 3626 | !noData || noData !== true && elem.getAttribute("classid") === noData; | ||
| 3627 | }; | ||
| 3628 | |||
| 3629 | |||
| 3630 | var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, | ||
| 3631 | rmultiDash = /([A-Z])/g; | ||
| 3632 | |||
| 3633 | function dataAttr( elem, key, data ) { | ||
| 3634 | // If nothing was found internally, try to fetch any | ||
| 3635 | // data from the HTML5 data-* attribute | ||
| 3636 | if ( data === undefined && elem.nodeType === 1 ) { | ||
| 3637 | |||
| 3638 | var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); | ||
| 3639 | |||
| 3640 | data = elem.getAttribute( name ); | ||
| 3641 | |||
| 3642 | if ( typeof data === "string" ) { | ||
| 3643 | try { | ||
| 3644 | data = data === "true" ? true : | ||
| 3645 | data === "false" ? false : | ||
| 3646 | data === "null" ? null : | ||
| 3647 | // Only convert to a number if it doesn't change the string | ||
| 3648 | +data + "" === data ? +data : | ||
| 3649 | rbrace.test( data ) ? jQuery.parseJSON( data ) : | ||
| 3650 | data; | ||
| 3651 | } catch( e ) {} | ||
| 3652 | |||
| 3653 | // Make sure we set the data so it isn't changed later | ||
| 3654 | jQuery.data( elem, key, data ); | ||
| 3655 | |||
| 3656 | } else { | ||
| 3657 | data = undefined; | ||
| 3658 | } | ||
| 3659 | } | ||
| 3660 | |||
| 3661 | return data; | ||
| 3662 | } | ||
| 3663 | |||
| 3664 | // checks a cache object for emptiness | ||
| 3665 | function isEmptyDataObject( obj ) { | ||
| 3666 | var name; | ||
| 3667 | for ( name in obj ) { | ||
| 3668 | |||
| 3669 | // if the public data object is empty, the private is still empty | ||
| 3670 | if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { | ||
| 3671 | continue; | ||
| 3672 | } | ||
| 3673 | if ( name !== "toJSON" ) { | ||
| 3674 | return false; | ||
| 3675 | } | ||
| 3676 | } | ||
| 3677 | |||
| 3678 | return true; | ||
| 3679 | } | ||
| 3680 | |||
| 3681 | function internalData( elem, name, data, pvt /* Internal Use Only */ ) { | ||
| 3682 | if ( !jQuery.acceptData( elem ) ) { | ||
| 3683 | return; | ||
| 3684 | } | ||
| 3685 | |||
| 3686 | var ret, thisCache, | ||
| 3687 | internalKey = jQuery.expando, | ||
| 3688 | |||
| 3689 | // We have to handle DOM nodes and JS objects differently because IE6-7 | ||
| 3690 | // can't GC object references properly across the DOM-JS boundary | ||
| 3691 | isNode = elem.nodeType, | ||
| 3692 | |||
| 3693 | // Only DOM nodes need the global jQuery cache; JS object data is | ||
| 3694 | // attached directly to the object so GC can occur automatically | ||
| 3695 | cache = isNode ? jQuery.cache : elem, | ||
| 3696 | |||
| 3697 | // Only defining an ID for JS objects if its cache already exists allows | ||
| 3698 | // the code to shortcut on the same path as a DOM node with no cache | ||
| 3699 | id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; | ||
| 3700 | |||
| 3701 | // Avoid doing any more work than we need to when trying to get data on an | ||
| 3702 | // object that has no data at all | ||
| 3703 | if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { | ||
| 3704 | return; | ||
| 3705 | } | ||
| 3706 | |||
| 3707 | if ( !id ) { | ||
| 3708 | // Only DOM nodes need a new unique ID for each element since their data | ||
| 3709 | // ends up in the global cache | ||
| 3710 | if ( isNode ) { | ||
| 3711 | id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; | ||
| 3712 | } else { | ||
| 3713 | id = internalKey; | ||
| 3714 | } | ||
| 3715 | } | ||
| 3716 | |||
| 3717 | if ( !cache[ id ] ) { | ||
| 3718 | // Avoid exposing jQuery metadata on plain JS objects when the object | ||
| 3719 | // is serialized using JSON.stringify | ||
| 3720 | cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; | ||
| 3721 | } | ||
| 3722 | |||
| 3723 | // An object can be passed to jQuery.data instead of a key/value pair; this gets | ||
| 3724 | // shallow copied over onto the existing cache | ||
| 3725 | if ( typeof name === "object" || typeof name === "function" ) { | ||
| 3726 | if ( pvt ) { | ||
| 3727 | cache[ id ] = jQuery.extend( cache[ id ], name ); | ||
| 3728 | } else { | ||
| 3729 | cache[ id ].data = jQuery.extend( cache[ id ].data, name ); | ||
| 3730 | } | ||
| 3731 | } | ||
| 3732 | |||
| 3733 | thisCache = cache[ id ]; | ||
| 3734 | |||
| 3735 | // jQuery data() is stored in a separate object inside the object's internal data | ||
| 3736 | // cache in order to avoid key collisions between internal data and user-defined | ||
| 3737 | // data. | ||
| 3738 | if ( !pvt ) { | ||
| 3739 | if ( !thisCache.data ) { | ||
| 3740 | thisCache.data = {}; | ||
| 3741 | } | ||
| 3742 | |||
| 3743 | thisCache = thisCache.data; | ||
| 3744 | } | ||
| 3745 | |||
| 3746 | if ( data !== undefined ) { | ||
| 3747 | thisCache[ jQuery.camelCase( name ) ] = data; | ||
| 3748 | } | ||
| 3749 | |||
| 3750 | // Check for both converted-to-camel and non-converted data property names | ||
| 3751 | // If a data property was specified | ||
| 3752 | if ( typeof name === "string" ) { | ||
| 3753 | |||
| 3754 | // First Try to find as-is property data | ||
| 3755 | ret = thisCache[ name ]; | ||
| 3756 | |||
| 3757 | // Test for null|undefined property data | ||
| 3758 | if ( ret == null ) { | ||
| 3759 | |||
| 3760 | // Try to find the camelCased property | ||
| 3761 | ret = thisCache[ jQuery.camelCase( name ) ]; | ||
| 3762 | } | ||
| 3763 | } else { | ||
| 3764 | ret = thisCache; | ||
| 3765 | } | ||
| 3766 | |||
| 3767 | return ret; | ||
| 3768 | } | ||
| 3769 | |||
| 3770 | function internalRemoveData( elem, name, pvt ) { | ||
| 3771 | if ( !jQuery.acceptData( elem ) ) { | ||
| 3772 | return; | ||
| 3773 | } | ||
| 3774 | |||
| 3775 | var thisCache, i, | ||
| 3776 | isNode = elem.nodeType, | ||
| 3777 | |||
| 3778 | // See jQuery.data for more information | ||
| 3779 | cache = isNode ? jQuery.cache : elem, | ||
| 3780 | id = isNode ? elem[ jQuery.expando ] : jQuery.expando; | ||
| 3781 | |||
| 3782 | // If there is already no cache entry for this object, there is no | ||
| 3783 | // purpose in continuing | ||
| 3784 | if ( !cache[ id ] ) { | ||
| 3785 | return; | ||
| 3786 | } | ||
| 3787 | |||
| 3788 | if ( name ) { | ||
| 3789 | |||
| 3790 | thisCache = pvt ? cache[ id ] : cache[ id ].data; | ||
| 3791 | |||
| 3792 | if ( thisCache ) { | ||
| 3793 | |||
| 3794 | // Support array or space separated string names for data keys | ||
| 3795 | if ( !jQuery.isArray( name ) ) { | ||
| 3796 | |||
| 3797 | // try the string as a key before any manipulation | ||
| 3798 | if ( name in thisCache ) { | ||
| 3799 | name = [ name ]; | ||
| 3800 | } else { | ||
| 3801 | |||
| 3802 | // split the camel cased version by spaces unless a key with the spaces exists | ||
| 3803 | name = jQuery.camelCase( name ); | ||
| 3804 | if ( name in thisCache ) { | ||
| 3805 | name = [ name ]; | ||
| 3806 | } else { | ||
| 3807 | name = name.split(" "); | ||
| 3808 | } | ||
| 3809 | } | ||
| 3810 | } else { | ||
| 3811 | // If "name" is an array of keys... | ||
| 3812 | // When data is initially created, via ("key", "val") signature, | ||
| 3813 | // keys will be converted to camelCase. | ||
| 3814 | // Since there is no way to tell _how_ a key was added, remove | ||
| 3815 | // both plain key and camelCase key. #12786 | ||
| 3816 | // This will only penalize the array argument path. | ||
| 3817 | name = name.concat( jQuery.map( name, jQuery.camelCase ) ); | ||
| 3818 | } | ||
| 3819 | |||
| 3820 | i = name.length; | ||
| 3821 | while ( i-- ) { | ||
| 3822 | delete thisCache[ name[i] ]; | ||
| 3823 | } | ||
| 3824 | |||
| 3825 | // If there is no data left in the cache, we want to continue | ||
| 3826 | // and let the cache object itself get destroyed | ||
| 3827 | if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { | ||
| 3828 | return; | ||
| 3829 | } | ||
| 3830 | } | ||
| 3831 | } | ||
| 3832 | |||
| 3833 | // See jQuery.data for more information | ||
| 3834 | if ( !pvt ) { | ||
| 3835 | delete cache[ id ].data; | ||
| 3836 | |||
| 3837 | // Don't destroy the parent cache unless the internal data object | ||
| 3838 | // had been the only thing left in it | ||
| 3839 | if ( !isEmptyDataObject( cache[ id ] ) ) { | ||
| 3840 | return; | ||
| 3841 | } | ||
| 3842 | } | ||
| 3843 | |||
| 3844 | // Destroy the cache | ||
| 3845 | if ( isNode ) { | ||
| 3846 | jQuery.cleanData( [ elem ], true ); | ||
| 3847 | |||
| 3848 | // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) | ||
| 3849 | /* jshint eqeqeq: false */ | ||
| 3850 | } else if ( support.deleteExpando || cache != cache.window ) { | ||
| 3851 | /* jshint eqeqeq: true */ | ||
| 3852 | delete cache[ id ]; | ||
| 3853 | |||
| 3854 | // When all else fails, null | ||
| 3855 | } else { | ||
| 3856 | cache[ id ] = null; | ||
| 3857 | } | ||
| 3858 | } | ||
| 3859 | |||
| 3860 | jQuery.extend({ | ||
| 3861 | cache: {}, | ||
| 3862 | |||
| 3863 | // The following elements (space-suffixed to avoid Object.prototype collisions) | ||
| 3864 | // throw uncatchable exceptions if you attempt to set expando properties | ||
| 3865 | noData: { | ||
| 3866 | "applet ": true, | ||
| 3867 | "embed ": true, | ||
| 3868 | // ...but Flash objects (which have this classid) *can* handle expandos | ||
| 3869 | "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" | ||
| 3870 | }, | ||
| 3871 | |||
| 3872 | hasData: function( elem ) { | ||
| 3873 | elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; | ||
| 3874 | return !!elem && !isEmptyDataObject( elem ); | ||
| 3875 | }, | ||
| 3876 | |||
| 3877 | data: function( elem, name, data ) { | ||
| 3878 | return internalData( elem, name, data ); | ||
| 3879 | }, | ||
| 3880 | |||
| 3881 | removeData: function( elem, name ) { | ||
| 3882 | return internalRemoveData( elem, name ); | ||
| 3883 | }, | ||
| 3884 | |||
| 3885 | // For internal use only. | ||
| 3886 | _data: function( elem, name, data ) { | ||
| 3887 | return internalData( elem, name, data, true ); | ||
| 3888 | }, | ||
| 3889 | |||
| 3890 | _removeData: function( elem, name ) { | ||
| 3891 | return internalRemoveData( elem, name, true ); | ||
| 3892 | } | ||
| 3893 | }); | ||
| 3894 | |||
| 3895 | jQuery.fn.extend({ | ||
| 3896 | data: function( key, value ) { | ||
| 3897 | var i, name, data, | ||
| 3898 | elem = this[0], | ||
| 3899 | attrs = elem && elem.attributes; | ||
| 3900 | |||
| 3901 | // Special expections of .data basically thwart jQuery.access, | ||
| 3902 | // so implement the relevant behavior ourselves | ||
| 3903 | |||
| 3904 | // Gets all values | ||
| 3905 | if ( key === undefined ) { | ||
| 3906 | if ( this.length ) { | ||
| 3907 | data = jQuery.data( elem ); | ||
| 3908 | |||
| 3909 | if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { | ||
| 3910 | i = attrs.length; | ||
| 3911 | while ( i-- ) { | ||
| 3912 | |||
| 3913 | // Support: IE11+ | ||
| 3914 | // The attrs elements can be null (#14894) | ||
| 3915 | if ( attrs[ i ] ) { | ||
| 3916 | name = attrs[ i ].name; | ||
| 3917 | if ( name.indexOf( "data-" ) === 0 ) { | ||
| 3918 | name = jQuery.camelCase( name.slice(5) ); | ||
| 3919 | dataAttr( elem, name, data[ name ] ); | ||
| 3920 | } | ||
| 3921 | } | ||
| 3922 | } | ||
| 3923 | jQuery._data( elem, "parsedAttrs", true ); | ||
| 3924 | } | ||
| 3925 | } | ||
| 3926 | |||
| 3927 | return data; | ||
| 3928 | } | ||
| 3929 | |||
| 3930 | // Sets multiple values | ||
| 3931 | if ( typeof key === "object" ) { | ||
| 3932 | return this.each(function() { | ||
| 3933 | jQuery.data( this, key ); | ||
| 3934 | }); | ||
| 3935 | } | ||
| 3936 | |||
| 3937 | return arguments.length > 1 ? | ||
| 3938 | |||
| 3939 | // Sets one value | ||
| 3940 | this.each(function() { | ||
| 3941 | jQuery.data( this, key, value ); | ||
| 3942 | }) : | ||
| 3943 | |||
| 3944 | // Gets one value | ||
| 3945 | // Try to fetch any internally stored data first | ||
| 3946 | elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; | ||
| 3947 | }, | ||
| 3948 | |||
| 3949 | removeData: function( key ) { | ||
| 3950 | return this.each(function() { | ||
| 3951 | jQuery.removeData( this, key ); | ||
| 3952 | }); | ||
| 3953 | } | ||
| 3954 | }); | ||
| 3955 | |||
| 3956 | |||
| 3957 | jQuery.extend({ | ||
| 3958 | queue: function( elem, type, data ) { | ||
| 3959 | var queue; | ||
| 3960 | |||
| 3961 | if ( elem ) { | ||
| 3962 | type = ( type || "fx" ) + "queue"; | ||
| 3963 | queue = jQuery._data( elem, type ); | ||
| 3964 | |||
| 3965 | // Speed up dequeue by getting out quickly if this is just a lookup | ||
| 3966 | if ( data ) { | ||
| 3967 | if ( !queue || jQuery.isArray(data) ) { | ||
| 3968 | queue = jQuery._data( elem, type, jQuery.makeArray(data) ); | ||
| 3969 | } else { | ||
| 3970 | queue.push( data ); | ||
| 3971 | } | ||
| 3972 | } | ||
| 3973 | return queue || []; | ||
| 3974 | } | ||
| 3975 | }, | ||
| 3976 | |||
| 3977 | dequeue: function( elem, type ) { | ||
| 3978 | type = type || "fx"; | ||
| 3979 | |||
| 3980 | var queue = jQuery.queue( elem, type ), | ||
| 3981 | startLength = queue.length, | ||
| 3982 | fn = queue.shift(), | ||
| 3983 | hooks = jQuery._queueHooks( elem, type ), | ||
| 3984 | next = function() { | ||
| 3985 | jQuery.dequeue( elem, type ); | ||
| 3986 | }; | ||
| 3987 | |||
| 3988 | // If the fx queue is dequeued, always remove the progress sentinel | ||
| 3989 | if ( fn === "inprogress" ) { | ||
| 3990 | fn = queue.shift(); | ||
| 3991 | startLength--; | ||
| 3992 | } | ||
| 3993 | |||
| 3994 | if ( fn ) { | ||
| 3995 | |||
| 3996 | // Add a progress sentinel to prevent the fx queue from being | ||
| 3997 | // automatically dequeued | ||
| 3998 | if ( type === "fx" ) { | ||
| 3999 | queue.unshift( "inprogress" ); | ||
| 4000 | } | ||
| 4001 | |||
| 4002 | // clear up the last queue stop function | ||
| 4003 | delete hooks.stop; | ||
| 4004 | fn.call( elem, next, hooks ); | ||
| 4005 | } | ||
| 4006 | |||
| 4007 | if ( !startLength && hooks ) { | ||
| 4008 | hooks.empty.fire(); | ||
| 4009 | } | ||
| 4010 | }, | ||
| 4011 | |||
| 4012 | // not intended for public consumption - generates a queueHooks object, or returns the current one | ||
| 4013 | _queueHooks: function( elem, type ) { | ||
| 4014 | var key = type + "queueHooks"; | ||
| 4015 | return jQuery._data( elem, key ) || jQuery._data( elem, key, { | ||
| 4016 | empty: jQuery.Callbacks("once memory").add(function() { | ||
| 4017 | jQuery._removeData( elem, type + "queue" ); | ||
| 4018 | jQuery._removeData( elem, key ); | ||
| 4019 | }) | ||
| 4020 | }); | ||
| 4021 | } | ||
| 4022 | }); | ||
| 4023 | |||
| 4024 | jQuery.fn.extend({ | ||
| 4025 | queue: function( type, data ) { | ||
| 4026 | var setter = 2; | ||
| 4027 | |||
| 4028 | if ( typeof type !== "string" ) { | ||
| 4029 | data = type; | ||
| 4030 | type = "fx"; | ||
| 4031 | setter--; | ||
| 4032 | } | ||
| 4033 | |||
| 4034 | if ( arguments.length < setter ) { | ||
| 4035 | return jQuery.queue( this[0], type ); | ||
| 4036 | } | ||
| 4037 | |||
| 4038 | return data === undefined ? | ||
| 4039 | this : | ||
| 4040 | this.each(function() { | ||
| 4041 | var queue = jQuery.queue( this, type, data ); | ||
| 4042 | |||
| 4043 | // ensure a hooks for this queue | ||
| 4044 | jQuery._queueHooks( this, type ); | ||
| 4045 | |||
| 4046 | if ( type === "fx" && queue[0] !== "inprogress" ) { | ||
| 4047 | jQuery.dequeue( this, type ); | ||
| 4048 | } | ||
| 4049 | }); | ||
| 4050 | }, | ||
| 4051 | dequeue: function( type ) { | ||
| 4052 | return this.each(function() { | ||
| 4053 | jQuery.dequeue( this, type ); | ||
| 4054 | }); | ||
| 4055 | }, | ||
| 4056 | clearQueue: function( type ) { | ||
| 4057 | return this.queue( type || "fx", [] ); | ||
| 4058 | }, | ||
| 4059 | // Get a promise resolved when queues of a certain type | ||
| 4060 | // are emptied (fx is the type by default) | ||
| 4061 | promise: function( type, obj ) { | ||
| 4062 | var tmp, | ||
| 4063 | count = 1, | ||
| 4064 | defer = jQuery.Deferred(), | ||
| 4065 | elements = this, | ||
| 4066 | i = this.length, | ||
| 4067 | resolve = function() { | ||
| 4068 | if ( !( --count ) ) { | ||
| 4069 | defer.resolveWith( elements, [ elements ] ); | ||
| 4070 | } | ||
| 4071 | }; | ||
| 4072 | |||
| 4073 | if ( typeof type !== "string" ) { | ||
| 4074 | obj = type; | ||
| 4075 | type = undefined; | ||
| 4076 | } | ||
| 4077 | type = type || "fx"; | ||
| 4078 | |||
| 4079 | while ( i-- ) { | ||
| 4080 | tmp = jQuery._data( elements[ i ], type + "queueHooks" ); | ||
| 4081 | if ( tmp && tmp.empty ) { | ||
| 4082 | count++; | ||
| 4083 | tmp.empty.add( resolve ); | ||
| 4084 | } | ||
| 4085 | } | ||
| 4086 | resolve(); | ||
| 4087 | return defer.promise( obj ); | ||
| 4088 | } | ||
| 4089 | }); | ||
| 4090 | var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; | ||
| 4091 | |||
| 4092 | var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; | ||
| 4093 | |||
| 4094 | var isHidden = function( elem, el ) { | ||
| 4095 | // isHidden might be called from jQuery#filter function; | ||
| 4096 | // in that case, element will be second argument | ||
| 4097 | elem = el || elem; | ||
| 4098 | return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); | ||
| 4099 | }; | ||
| 4100 | |||
| 4101 | |||
| 4102 | |||
| 4103 | // Multifunctional method to get and set values of a collection | ||
| 4104 | // The value/s can optionally be executed if it's a function | ||
| 4105 | var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { | ||
| 4106 | var i = 0, | ||
| 4107 | length = elems.length, | ||
| 4108 | bulk = key == null; | ||
| 4109 | |||
| 4110 | // Sets many values | ||
| 4111 | if ( jQuery.type( key ) === "object" ) { | ||
| 4112 | chainable = true; | ||
| 4113 | for ( i in key ) { | ||
| 4114 | jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); | ||
| 4115 | } | ||
| 4116 | |||
| 4117 | // Sets one value | ||
| 4118 | } else if ( value !== undefined ) { | ||
| 4119 | chainable = true; | ||
| 4120 | |||
| 4121 | if ( !jQuery.isFunction( value ) ) { | ||
| 4122 | raw = true; | ||
| 4123 | } | ||
| 4124 | |||
| 4125 | if ( bulk ) { | ||
| 4126 | // Bulk operations run against the entire set | ||
| 4127 | if ( raw ) { | ||
| 4128 | fn.call( elems, value ); | ||
| 4129 | fn = null; | ||
| 4130 | |||
| 4131 | // ...except when executing function values | ||
| 4132 | } else { | ||
| 4133 | bulk = fn; | ||
| 4134 | fn = function( elem, key, value ) { | ||
| 4135 | return bulk.call( jQuery( elem ), value ); | ||
| 4136 | }; | ||
| 4137 | } | ||
| 4138 | } | ||
| 4139 | |||
| 4140 | if ( fn ) { | ||
| 4141 | for ( ; i < length; i++ ) { | ||
| 4142 | fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); | ||
| 4143 | } | ||
| 4144 | } | ||
| 4145 | } | ||
| 4146 | |||
| 4147 | return chainable ? | ||
| 4148 | elems : | ||
| 4149 | |||
| 4150 | // Gets | ||
| 4151 | bulk ? | ||
| 4152 | fn.call( elems ) : | ||
| 4153 | length ? fn( elems[0], key ) : emptyGet; | ||
| 4154 | }; | ||
| 4155 | var rcheckableType = (/^(?:checkbox|radio)$/i); | ||
| 4156 | |||
| 4157 | |||
| 4158 | |||
| 4159 | (function() { | ||
| 4160 | // Minified: var a,b,c | ||
| 4161 | var input = document.createElement( "input" ), | ||
| 4162 | div = document.createElement( "div" ), | ||
| 4163 | fragment = document.createDocumentFragment(); | ||
| 4164 | |||
| 4165 | // Setup | ||
| 4166 | div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; | ||
| 4167 | |||
| 4168 | // IE strips leading whitespace when .innerHTML is used | ||
| 4169 | support.leadingWhitespace = div.firstChild.nodeType === 3; | ||
| 4170 | |||
| 4171 | // Make sure that tbody elements aren't automatically inserted | ||
| 4172 | // IE will insert them into empty tables | ||
| 4173 | support.tbody = !div.getElementsByTagName( "tbody" ).length; | ||
| 4174 | |||
| 4175 | // Make sure that link elements get serialized correctly by innerHTML | ||
| 4176 | // This requires a wrapper element in IE | ||
| 4177 | support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; | ||
| 4178 | |||
| 4179 | // Makes sure cloning an html5 element does not cause problems | ||
| 4180 | // Where outerHTML is undefined, this still works | ||
| 4181 | support.html5Clone = | ||
| 4182 | document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; | ||
| 4183 | |||
| 4184 | // Check if a disconnected checkbox will retain its checked | ||
| 4185 | // value of true after appended to the DOM (IE6/7) | ||
| 4186 | input.type = "checkbox"; | ||
| 4187 | input.checked = true; | ||
| 4188 | fragment.appendChild( input ); | ||
| 4189 | support.appendChecked = input.checked; | ||
| 4190 | |||
| 4191 | // Make sure textarea (and checkbox) defaultValue is properly cloned | ||
| 4192 | // Support: IE6-IE11+ | ||
| 4193 | div.innerHTML = "<textarea>x</textarea>"; | ||
| 4194 | support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; | ||
| 4195 | |||
| 4196 | // #11217 - WebKit loses check when the name is after the checked attribute | ||
| 4197 | fragment.appendChild( div ); | ||
| 4198 | div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; | ||
| 4199 | |||
| 4200 | // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 | ||
| 4201 | // old WebKit doesn't clone checked state correctly in fragments | ||
| 4202 | support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; | ||
| 4203 | |||
| 4204 | // Support: IE<9 | ||
| 4205 | // Opera does not clone events (and typeof div.attachEvent === undefined). | ||
| 4206 | // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() | ||
| 4207 | support.noCloneEvent = true; | ||
| 4208 | if ( div.attachEvent ) { | ||
| 4209 | div.attachEvent( "onclick", function() { | ||
| 4210 | support.noCloneEvent = false; | ||
| 4211 | }); | ||
| 4212 | |||
| 4213 | div.cloneNode( true ).click(); | ||
| 4214 | } | ||
| 4215 | |||
| 4216 | // Execute the test only if not already executed in another module. | ||
| 4217 | if (support.deleteExpando == null) { | ||
| 4218 | // Support: IE<9 | ||
| 4219 | support.deleteExpando = true; | ||
| 4220 | try { | ||
| 4221 | delete div.test; | ||
| 4222 | } catch( e ) { | ||
| 4223 | support.deleteExpando = false; | ||
| 4224 | } | ||
| 4225 | } | ||
| 4226 | })(); | ||
| 4227 | |||
| 4228 | |||
| 4229 | (function() { | ||
| 4230 | var i, eventName, | ||
| 4231 | div = document.createElement( "div" ); | ||
| 4232 | |||
| 4233 | // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) | ||
| 4234 | for ( i in { submit: true, change: true, focusin: true }) { | ||
| 4235 | eventName = "on" + i; | ||
| 4236 | |||
| 4237 | if ( !(support[ i + "Bubbles" ] = eventName in window) ) { | ||
| 4238 | // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) | ||
| 4239 | div.setAttribute( eventName, "t" ); | ||
| 4240 | support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; | ||
| 4241 | } | ||
| 4242 | } | ||
| 4243 | |||
| 4244 | // Null elements to avoid leaks in IE. | ||
| 4245 | div = null; | ||
| 4246 | })(); | ||
| 4247 | |||
| 4248 | |||
| 4249 | var rformElems = /^(?:input|select|textarea)$/i, | ||
| 4250 | rkeyEvent = /^key/, | ||
| 4251 | rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, | ||
| 4252 | rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, | ||
| 4253 | rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; | ||
| 4254 | |||
| 4255 | function returnTrue() { | ||
| 4256 | return true; | ||
| 4257 | } | ||
| 4258 | |||
| 4259 | function returnFalse() { | ||
| 4260 | return false; | ||
| 4261 | } | ||
| 4262 | |||
| 4263 | function safeActiveElement() { | ||
| 4264 | try { | ||
| 4265 | return document.activeElement; | ||
| 4266 | } catch ( err ) { } | ||
| 4267 | } | ||
| 4268 | |||
| 4269 | /* | ||
| 4270 | * Helper functions for managing events -- not part of the public interface. | ||
| 4271 | * Props to Dean Edwards' addEvent library for many of the ideas. | ||
| 4272 | */ | ||
| 4273 | jQuery.event = { | ||
| 4274 | |||
| 4275 | global: {}, | ||
| 4276 | |||
| 4277 | add: function( elem, types, handler, data, selector ) { | ||
| 4278 | var tmp, events, t, handleObjIn, | ||
| 4279 | special, eventHandle, handleObj, | ||
| 4280 | handlers, type, namespaces, origType, | ||
| 4281 | elemData = jQuery._data( elem ); | ||
| 4282 | |||
| 4283 | // Don't attach events to noData or text/comment nodes (but allow plain objects) | ||
| 4284 | if ( !elemData ) { | ||
| 4285 | return; | ||
| 4286 | } | ||
| 4287 | |||
| 4288 | // Caller can pass in an object of custom data in lieu of the handler | ||
| 4289 | if ( handler.handler ) { | ||
| 4290 | handleObjIn = handler; | ||
| 4291 | handler = handleObjIn.handler; | ||
| 4292 | selector = handleObjIn.selector; | ||
| 4293 | } | ||
| 4294 | |||
| 4295 | // Make sure that the handler has a unique ID, used to find/remove it later | ||
| 4296 | if ( !handler.guid ) { | ||
| 4297 | handler.guid = jQuery.guid++; | ||
| 4298 | } | ||
| 4299 | |||
| 4300 | // Init the element's event structure and main handler, if this is the first | ||
| 4301 | if ( !(events = elemData.events) ) { | ||
| 4302 | events = elemData.events = {}; | ||
| 4303 | } | ||
| 4304 | if ( !(eventHandle = elemData.handle) ) { | ||
| 4305 | eventHandle = elemData.handle = function( e ) { | ||
| 4306 | // Discard the second event of a jQuery.event.trigger() and | ||
| 4307 | // when an event is called after a page has unloaded | ||
| 4308 | return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? | ||
| 4309 | jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : | ||
| 4310 | undefined; | ||
| 4311 | }; | ||
| 4312 | // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events | ||
| 4313 | eventHandle.elem = elem; | ||
| 4314 | } | ||
| 4315 | |||
| 4316 | // Handle multiple events separated by a space | ||
| 4317 | types = ( types || "" ).match( rnotwhite ) || [ "" ]; | ||
| 4318 | t = types.length; | ||
| 4319 | while ( t-- ) { | ||
| 4320 | tmp = rtypenamespace.exec( types[t] ) || []; | ||
| 4321 | type = origType = tmp[1]; | ||
| 4322 | namespaces = ( tmp[2] || "" ).split( "." ).sort(); | ||
| 4323 | |||
| 4324 | // There *must* be a type, no attaching namespace-only handlers | ||
| 4325 | if ( !type ) { | ||
| 4326 | continue; | ||
| 4327 | } | ||
| 4328 | |||
| 4329 | // If event changes its type, use the special event handlers for the changed type | ||
| 4330 | special = jQuery.event.special[ type ] || {}; | ||
| 4331 | |||
| 4332 | // If selector defined, determine special event api type, otherwise given type | ||
| 4333 | type = ( selector ? special.delegateType : special.bindType ) || type; | ||
| 4334 | |||
| 4335 | // Update special based on newly reset type | ||
| 4336 | special = jQuery.event.special[ type ] || {}; | ||
| 4337 | |||
| 4338 | // handleObj is passed to all event handlers | ||
| 4339 | handleObj = jQuery.extend({ | ||
| 4340 | type: type, | ||
| 4341 | origType: origType, | ||
| 4342 | data: data, | ||
| 4343 | handler: handler, | ||
| 4344 | guid: handler.guid, | ||
| 4345 | selector: selector, | ||
| 4346 | needsContext: selector && jQuery.expr.match.needsContext.test( selector ), | ||
| 4347 | namespace: namespaces.join(".") | ||
| 4348 | }, handleObjIn ); | ||
| 4349 | |||
| 4350 | // Init the event handler queue if we're the first | ||
| 4351 | if ( !(handlers = events[ type ]) ) { | ||
| 4352 | handlers = events[ type ] = []; | ||
| 4353 | handlers.delegateCount = 0; | ||
| 4354 | |||
| 4355 | // Only use addEventListener/attachEvent if the special events handler returns false | ||
| 4356 | if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { | ||
| 4357 | // Bind the global event handler to the element | ||
| 4358 | if ( elem.addEventListener ) { | ||
| 4359 | elem.addEventListener( type, eventHandle, false ); | ||
| 4360 | |||
| 4361 | } else if ( elem.attachEvent ) { | ||
| 4362 | elem.attachEvent( "on" + type, eventHandle ); | ||
| 4363 | } | ||
| 4364 | } | ||
| 4365 | } | ||
| 4366 | |||
| 4367 | if ( special.add ) { | ||
| 4368 | special.add.call( elem, handleObj ); | ||
| 4369 | |||
| 4370 | if ( !handleObj.handler.guid ) { | ||
| 4371 | handleObj.handler.guid = handler.guid; | ||
| 4372 | } | ||
| 4373 | } | ||
| 4374 | |||
| 4375 | // Add to the element's handler list, delegates in front | ||
| 4376 | if ( selector ) { | ||
| 4377 | handlers.splice( handlers.delegateCount++, 0, handleObj ); | ||
| 4378 | } else { | ||
| 4379 | handlers.push( handleObj ); | ||
| 4380 | } | ||
| 4381 | |||
| 4382 | // Keep track of which events have ever been used, for event optimization | ||
| 4383 | jQuery.event.global[ type ] = true; | ||
| 4384 | } | ||
| 4385 | |||
| 4386 | // Nullify elem to prevent memory leaks in IE | ||
| 4387 | elem = null; | ||
| 4388 | }, | ||
| 4389 | |||
| 4390 | // Detach an event or set of events from an element | ||
| 4391 | remove: function( elem, types, handler, selector, mappedTypes ) { | ||
| 4392 | var j, handleObj, tmp, | ||
| 4393 | origCount, t, events, | ||
| 4394 | special, handlers, type, | ||
| 4395 | namespaces, origType, | ||
| 4396 | elemData = jQuery.hasData( elem ) && jQuery._data( elem ); | ||
| 4397 | |||
| 4398 | if ( !elemData || !(events = elemData.events) ) { | ||
| 4399 | return; | ||
| 4400 | } | ||
| 4401 | |||
| 4402 | // Once for each type.namespace in types; type may be omitted | ||
| 4403 | types = ( types || "" ).match( rnotwhite ) || [ "" ]; | ||
| 4404 | t = types.length; | ||
| 4405 | while ( t-- ) { | ||
| 4406 | tmp = rtypenamespace.exec( types[t] ) || []; | ||
| 4407 | type = origType = tmp[1]; | ||
| 4408 | namespaces = ( tmp[2] || "" ).split( "." ).sort(); | ||
| 4409 | |||
| 4410 | // Unbind all events (on this namespace, if provided) for the element | ||
| 4411 | if ( !type ) { | ||
| 4412 | for ( type in events ) { | ||
| 4413 | jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); | ||
| 4414 | } | ||
| 4415 | continue; | ||
| 4416 | } | ||
| 4417 | |||
| 4418 | special = jQuery.event.special[ type ] || {}; | ||
| 4419 | type = ( selector ? special.delegateType : special.bindType ) || type; | ||
| 4420 | handlers = events[ type ] || []; | ||
| 4421 | tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); | ||
| 4422 | |||
| 4423 | // Remove matching events | ||
| 4424 | origCount = j = handlers.length; | ||
| 4425 | while ( j-- ) { | ||
| 4426 | handleObj = handlers[ j ]; | ||
| 4427 | |||
| 4428 | if ( ( mappedTypes || origType === handleObj.origType ) && | ||
| 4429 | ( !handler || handler.guid === handleObj.guid ) && | ||
| 4430 | ( !tmp || tmp.test( handleObj.namespace ) ) && | ||
| 4431 | ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { | ||
| 4432 | handlers.splice( j, 1 ); | ||
| 4433 | |||
| 4434 | if ( handleObj.selector ) { | ||
| 4435 | handlers.delegateCount--; | ||
| 4436 | } | ||
| 4437 | if ( special.remove ) { | ||
| 4438 | special.remove.call( elem, handleObj ); | ||
| 4439 | } | ||
| 4440 | } | ||
| 4441 | } | ||
| 4442 | |||
| 4443 | // Remove generic event handler if we removed something and no more handlers exist | ||
| 4444 | // (avoids potential for endless recursion during removal of special event handlers) | ||
| 4445 | if ( origCount && !handlers.length ) { | ||
| 4446 | if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { | ||
| 4447 | jQuery.removeEvent( elem, type, elemData.handle ); | ||
| 4448 | } | ||
| 4449 | |||
| 4450 | delete events[ type ]; | ||
| 4451 | } | ||
| 4452 | } | ||
| 4453 | |||
| 4454 | // Remove the expando if it's no longer used | ||
| 4455 | if ( jQuery.isEmptyObject( events ) ) { | ||
| 4456 | delete elemData.handle; | ||
| 4457 | |||
| 4458 | // removeData also checks for emptiness and clears the expando if empty | ||
| 4459 | // so use it instead of delete | ||
| 4460 | jQuery._removeData( elem, "events" ); | ||
| 4461 | } | ||
| 4462 | }, | ||
| 4463 | |||
| 4464 | trigger: function( event, data, elem, onlyHandlers ) { | ||
| 4465 | var handle, ontype, cur, | ||
| 4466 | bubbleType, special, tmp, i, | ||
| 4467 | eventPath = [ elem || document ], | ||
| 4468 | type = hasOwn.call( event, "type" ) ? event.type : event, | ||
| 4469 | namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; | ||
| 4470 | |||
| 4471 | cur = tmp = elem = elem || document; | ||
| 4472 | |||
| 4473 | // Don't do events on text and comment nodes | ||
| 4474 | if ( elem.nodeType === 3 || elem.nodeType === 8 ) { | ||
| 4475 | return; | ||
| 4476 | } | ||
| 4477 | |||
| 4478 | // focus/blur morphs to focusin/out; ensure we're not firing them right now | ||
| 4479 | if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { | ||
| 4480 | return; | ||
| 4481 | } | ||
| 4482 | |||
| 4483 | if ( type.indexOf(".") >= 0 ) { | ||
| 4484 | // Namespaced trigger; create a regexp to match event type in handle() | ||
| 4485 | namespaces = type.split("."); | ||
| 4486 | type = namespaces.shift(); | ||
| 4487 | namespaces.sort(); | ||
| 4488 | } | ||
| 4489 | ontype = type.indexOf(":") < 0 && "on" + type; | ||
| 4490 | |||
| 4491 | // Caller can pass in a jQuery.Event object, Object, or just an event type string | ||
| 4492 | event = event[ jQuery.expando ] ? | ||
| 4493 | event : | ||
| 4494 | new jQuery.Event( type, typeof event === "object" && event ); | ||
| 4495 | |||
| 4496 | // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) | ||
| 4497 | event.isTrigger = onlyHandlers ? 2 : 3; | ||
| 4498 | event.namespace = namespaces.join("."); | ||
| 4499 | event.namespace_re = event.namespace ? | ||
| 4500 | new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : | ||
| 4501 | null; | ||
| 4502 | |||
| 4503 | // Clean up the event in case it is being reused | ||
| 4504 | event.result = undefined; | ||
| 4505 | if ( !event.target ) { | ||
| 4506 | event.target = elem; | ||
| 4507 | } | ||
| 4508 | |||
| 4509 | // Clone any incoming data and prepend the event, creating the handler arg list | ||
| 4510 | data = data == null ? | ||
| 4511 | [ event ] : | ||
| 4512 | jQuery.makeArray( data, [ event ] ); | ||
| 4513 | |||
| 4514 | // Allow special events to draw outside the lines | ||
| 4515 | special = jQuery.event.special[ type ] || {}; | ||
| 4516 | if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { | ||
| 4517 | return; | ||
| 4518 | } | ||
| 4519 | |||
| 4520 | // Determine event propagation path in advance, per W3C events spec (#9951) | ||
| 4521 | // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) | ||
| 4522 | if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { | ||
| 4523 | |||
| 4524 | bubbleType = special.delegateType || type; | ||
| 4525 | if ( !rfocusMorph.test( bubbleType + type ) ) { | ||
| 4526 | cur = cur.parentNode; | ||
| 4527 | } | ||
| 4528 | for ( ; cur; cur = cur.parentNode ) { | ||
| 4529 | eventPath.push( cur ); | ||
| 4530 | tmp = cur; | ||
| 4531 | } | ||
| 4532 | |||
| 4533 | // Only add window if we got to document (e.g., not plain obj or detached DOM) | ||
| 4534 | if ( tmp === (elem.ownerDocument || document) ) { | ||
| 4535 | eventPath.push( tmp.defaultView || tmp.parentWindow || window ); | ||
| 4536 | } | ||
| 4537 | } | ||
| 4538 | |||
| 4539 | // Fire handlers on the event path | ||
| 4540 | i = 0; | ||
| 4541 | while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { | ||
| 4542 | |||
| 4543 | event.type = i > 1 ? | ||
| 4544 | bubbleType : | ||
| 4545 | special.bindType || type; | ||
| 4546 | |||
| 4547 | // jQuery handler | ||
| 4548 | handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); | ||
| 4549 | if ( handle ) { | ||
| 4550 | handle.apply( cur, data ); | ||
| 4551 | } | ||
| 4552 | |||
| 4553 | // Native handler | ||
| 4554 | handle = ontype && cur[ ontype ]; | ||
| 4555 | if ( handle && handle.apply && jQuery.acceptData( cur ) ) { | ||
| 4556 | event.result = handle.apply( cur, data ); | ||
| 4557 | if ( event.result === false ) { | ||
| 4558 | event.preventDefault(); | ||
| 4559 | } | ||
| 4560 | } | ||
| 4561 | } | ||
| 4562 | event.type = type; | ||
| 4563 | |||
| 4564 | // If nobody prevented the default action, do it now | ||
| 4565 | if ( !onlyHandlers && !event.isDefaultPrevented() ) { | ||
| 4566 | |||
| 4567 | if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && | ||
| 4568 | jQuery.acceptData( elem ) ) { | ||
| 4569 | |||
| 4570 | // Call a native DOM method on the target with the same name name as the event. | ||
| 4571 | // Can't use an .isFunction() check here because IE6/7 fails that test. | ||
| 4572 | // Don't do default actions on window, that's where global variables be (#6170) | ||
| 4573 | if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { | ||
| 4574 | |||
| 4575 | // Don't re-trigger an onFOO event when we call its FOO() method | ||
| 4576 | tmp = elem[ ontype ]; | ||
| 4577 | |||
| 4578 | if ( tmp ) { | ||
| 4579 | elem[ ontype ] = null; | ||
| 4580 | } | ||
| 4581 | |||
| 4582 | // Prevent re-triggering of the same event, since we already bubbled it above | ||
| 4583 | jQuery.event.triggered = type; | ||
| 4584 | try { | ||
| 4585 | elem[ type ](); | ||
| 4586 | } catch ( e ) { | ||
| 4587 | // IE<9 dies on focus/blur to hidden element (#1486,#12518) | ||
| 4588 | // only reproducible on winXP IE8 native, not IE9 in IE8 mode | ||
| 4589 | } | ||
| 4590 | jQuery.event.triggered = undefined; | ||
| 4591 | |||
| 4592 | if ( tmp ) { | ||
| 4593 | elem[ ontype ] = tmp; | ||
| 4594 | } | ||
| 4595 | } | ||
| 4596 | } | ||
| 4597 | } | ||
| 4598 | |||
| 4599 | return event.result; | ||
| 4600 | }, | ||
| 4601 | |||
| 4602 | dispatch: function( event ) { | ||
| 4603 | |||
| 4604 | // Make a writable jQuery.Event from the native event object | ||
| 4605 | event = jQuery.event.fix( event ); | ||
| 4606 | |||
| 4607 | var i, ret, handleObj, matched, j, | ||
| 4608 | handlerQueue = [], | ||
| 4609 | args = slice.call( arguments ), | ||
| 4610 | handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], | ||
| 4611 | special = jQuery.event.special[ event.type ] || {}; | ||
| 4612 | |||
| 4613 | // Use the fix-ed jQuery.Event rather than the (read-only) native event | ||
| 4614 | args[0] = event; | ||
| 4615 | event.delegateTarget = this; | ||
| 4616 | |||
| 4617 | // Call the preDispatch hook for the mapped type, and let it bail if desired | ||
| 4618 | if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { | ||
| 4619 | return; | ||
| 4620 | } | ||
| 4621 | |||
| 4622 | // Determine handlers | ||
| 4623 | handlerQueue = jQuery.event.handlers.call( this, event, handlers ); | ||
| 4624 | |||
| 4625 | // Run delegates first; they may want to stop propagation beneath us | ||
| 4626 | i = 0; | ||
| 4627 | while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { | ||
| 4628 | event.currentTarget = matched.elem; | ||
| 4629 | |||
| 4630 | j = 0; | ||
| 4631 | while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { | ||
| 4632 | |||
| 4633 | // Triggered event must either 1) have no namespace, or | ||
| 4634 | // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). | ||
| 4635 | if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { | ||
| 4636 | |||
| 4637 | event.handleObj = handleObj; | ||
| 4638 | event.data = handleObj.data; | ||
| 4639 | |||
| 4640 | ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) | ||
| 4641 | .apply( matched.elem, args ); | ||
| 4642 | |||
| 4643 | if ( ret !== undefined ) { | ||
| 4644 | if ( (event.result = ret) === false ) { | ||
| 4645 | event.preventDefault(); | ||
| 4646 | event.stopPropagation(); | ||
| 4647 | } | ||
| 4648 | } | ||
| 4649 | } | ||
| 4650 | } | ||
| 4651 | } | ||
| 4652 | |||
| 4653 | // Call the postDispatch hook for the mapped type | ||
| 4654 | if ( special.postDispatch ) { | ||
| 4655 | special.postDispatch.call( this, event ); | ||
| 4656 | } | ||
| 4657 | |||
| 4658 | return event.result; | ||
| 4659 | }, | ||
| 4660 | |||
| 4661 | handlers: function( event, handlers ) { | ||
| 4662 | var sel, handleObj, matches, i, | ||
| 4663 | handlerQueue = [], | ||
| 4664 | delegateCount = handlers.delegateCount, | ||
| 4665 | cur = event.target; | ||
| 4666 | |||
| 4667 | // Find delegate handlers | ||
| 4668 | // Black-hole SVG <use> instance trees (#13180) | ||
| 4669 | // Avoid non-left-click bubbling in Firefox (#3861) | ||
| 4670 | if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { | ||
| 4671 | |||
| 4672 | /* jshint eqeqeq: false */ | ||
| 4673 | for ( ; cur != this; cur = cur.parentNode || this ) { | ||
| 4674 | /* jshint eqeqeq: true */ | ||
| 4675 | |||
| 4676 | // Don't check non-elements (#13208) | ||
| 4677 | // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) | ||
| 4678 | if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { | ||
| 4679 | matches = []; | ||
| 4680 | for ( i = 0; i < delegateCount; i++ ) { | ||
| 4681 | handleObj = handlers[ i ]; | ||
| 4682 | |||
| 4683 | // Don't conflict with Object.prototype properties (#13203) | ||
| 4684 | sel = handleObj.selector + " "; | ||
| 4685 | |||
| 4686 | if ( matches[ sel ] === undefined ) { | ||
| 4687 | matches[ sel ] = handleObj.needsContext ? | ||
| 4688 | jQuery( sel, this ).index( cur ) >= 0 : | ||
| 4689 | jQuery.find( sel, this, null, [ cur ] ).length; | ||
| 4690 | } | ||
| 4691 | if ( matches[ sel ] ) { | ||
| 4692 | matches.push( handleObj ); | ||
| 4693 | } | ||
| 4694 | } | ||
| 4695 | if ( matches.length ) { | ||
| 4696 | handlerQueue.push({ elem: cur, handlers: matches }); | ||
| 4697 | } | ||
| 4698 | } | ||
| 4699 | } | ||
| 4700 | } | ||
| 4701 | |||
| 4702 | // Add the remaining (directly-bound) handlers | ||
| 4703 | if ( delegateCount < handlers.length ) { | ||
| 4704 | handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); | ||
| 4705 | } | ||
| 4706 | |||
| 4707 | return handlerQueue; | ||
| 4708 | }, | ||
| 4709 | |||
| 4710 | fix: function( event ) { | ||
| 4711 | if ( event[ jQuery.expando ] ) { | ||
| 4712 | return event; | ||
| 4713 | } | ||
| 4714 | |||
| 4715 | // Create a writable copy of the event object and normalize some properties | ||
| 4716 | var i, prop, copy, | ||
| 4717 | type = event.type, | ||
| 4718 | originalEvent = event, | ||
| 4719 | fixHook = this.fixHooks[ type ]; | ||
| 4720 | |||
| 4721 | if ( !fixHook ) { | ||
| 4722 | this.fixHooks[ type ] = fixHook = | ||
| 4723 | rmouseEvent.test( type ) ? this.mouseHooks : | ||
| 4724 | rkeyEvent.test( type ) ? this.keyHooks : | ||
| 4725 | {}; | ||
| 4726 | } | ||
| 4727 | copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; | ||
| 4728 | |||
| 4729 | event = new jQuery.Event( originalEvent ); | ||
| 4730 | |||
| 4731 | i = copy.length; | ||
| 4732 | while ( i-- ) { | ||
| 4733 | prop = copy[ i ]; | ||
| 4734 | event[ prop ] = originalEvent[ prop ]; | ||
| 4735 | } | ||
| 4736 | |||
| 4737 | // Support: IE<9 | ||
| 4738 | // Fix target property (#1925) | ||
| 4739 | if ( !event.target ) { | ||
| 4740 | event.target = originalEvent.srcElement || document; | ||
| 4741 | } | ||
| 4742 | |||
| 4743 | // Support: Chrome 23+, Safari? | ||
| 4744 | // Target should not be a text node (#504, #13143) | ||
| 4745 | if ( event.target.nodeType === 3 ) { | ||
| 4746 | event.target = event.target.parentNode; | ||
| 4747 | } | ||
| 4748 | |||
| 4749 | // Support: IE<9 | ||
| 4750 | // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) | ||
| 4751 | event.metaKey = !!event.metaKey; | ||
| 4752 | |||
| 4753 | return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; | ||
| 4754 | }, | ||
| 4755 | |||
| 4756 | // Includes some event props shared by KeyEvent and MouseEvent | ||
| 4757 | props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), | ||
| 4758 | |||
| 4759 | fixHooks: {}, | ||
| 4760 | |||
| 4761 | keyHooks: { | ||
| 4762 | props: "char charCode key keyCode".split(" "), | ||
| 4763 | filter: function( event, original ) { | ||
| 4764 | |||
| 4765 | // Add which for key events | ||
| 4766 | if ( event.which == null ) { | ||
| 4767 | event.which = original.charCode != null ? original.charCode : original.keyCode; | ||
| 4768 | } | ||
| 4769 | |||
| 4770 | return event; | ||
| 4771 | } | ||
| 4772 | }, | ||
| 4773 | |||
| 4774 | mouseHooks: { | ||
| 4775 | props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), | ||
| 4776 | filter: function( event, original ) { | ||
| 4777 | var body, eventDoc, doc, | ||
| 4778 | button = original.button, | ||
| 4779 | fromElement = original.fromElement; | ||
| 4780 | |||
| 4781 | // Calculate pageX/Y if missing and clientX/Y available | ||
| 4782 | if ( event.pageX == null && original.clientX != null ) { | ||
| 4783 | eventDoc = event.target.ownerDocument || document; | ||
| 4784 | doc = eventDoc.documentElement; | ||
| 4785 | body = eventDoc.body; | ||
| 4786 | |||
| 4787 | event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); | ||
| 4788 | event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); | ||
| 4789 | } | ||
| 4790 | |||
| 4791 | // Add relatedTarget, if necessary | ||
| 4792 | if ( !event.relatedTarget && fromElement ) { | ||
| 4793 | event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; | ||
| 4794 | } | ||
| 4795 | |||
| 4796 | // Add which for click: 1 === left; 2 === middle; 3 === right | ||
| 4797 | // Note: button is not normalized, so don't use it | ||
| 4798 | if ( !event.which && button !== undefined ) { | ||
| 4799 | event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); | ||
| 4800 | } | ||
| 4801 | |||
| 4802 | return event; | ||
| 4803 | } | ||
| 4804 | }, | ||
| 4805 | |||
| 4806 | special: { | ||
| 4807 | load: { | ||
| 4808 | // Prevent triggered image.load events from bubbling to window.load | ||
| 4809 | noBubble: true | ||
| 4810 | }, | ||
| 4811 | focus: { | ||
| 4812 | // Fire native event if possible so blur/focus sequence is correct | ||
| 4813 | trigger: function() { | ||
| 4814 | if ( this !== safeActiveElement() && this.focus ) { | ||
| 4815 | try { | ||
| 4816 | this.focus(); | ||
| 4817 | return false; | ||
| 4818 | } catch ( e ) { | ||
| 4819 | // Support: IE<9 | ||
| 4820 | // If we error on focus to hidden element (#1486, #12518), | ||
| 4821 | // let .trigger() run the handlers | ||
| 4822 | } | ||
| 4823 | } | ||
| 4824 | }, | ||
| 4825 | delegateType: "focusin" | ||
| 4826 | }, | ||
| 4827 | blur: { | ||
| 4828 | trigger: function() { | ||
| 4829 | if ( this === safeActiveElement() && this.blur ) { | ||
| 4830 | this.blur(); | ||
| 4831 | return false; | ||
| 4832 | } | ||
| 4833 | }, | ||
| 4834 | delegateType: "focusout" | ||
| 4835 | }, | ||
| 4836 | click: { | ||
| 4837 | // For checkbox, fire native event so checked state will be right | ||
| 4838 | trigger: function() { | ||
| 4839 | if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { | ||
| 4840 | this.click(); | ||
| 4841 | return false; | ||
| 4842 | } | ||
| 4843 | }, | ||
| 4844 | |||
| 4845 | // For cross-browser consistency, don't fire native .click() on links | ||
| 4846 | _default: function( event ) { | ||
| 4847 | return jQuery.nodeName( event.target, "a" ); | ||
| 4848 | } | ||
| 4849 | }, | ||
| 4850 | |||
| 4851 | beforeunload: { | ||
| 4852 | postDispatch: function( event ) { | ||
| 4853 | |||
| 4854 | // Support: Firefox 20+ | ||
| 4855 | // Firefox doesn't alert if the returnValue field is not set. | ||
| 4856 | if ( event.result !== undefined && event.originalEvent ) { | ||
| 4857 | event.originalEvent.returnValue = event.result; | ||
| 4858 | } | ||
| 4859 | } | ||
| 4860 | } | ||
| 4861 | }, | ||
| 4862 | |||
| 4863 | simulate: function( type, elem, event, bubble ) { | ||
| 4864 | // Piggyback on a donor event to simulate a different one. | ||
| 4865 | // Fake originalEvent to avoid donor's stopPropagation, but if the | ||
| 4866 | // simulated event prevents default then we do the same on the donor. | ||
| 4867 | var e = jQuery.extend( | ||
| 4868 | new jQuery.Event(), | ||
| 4869 | event, | ||
| 4870 | { | ||
| 4871 | type: type, | ||
| 4872 | isSimulated: true, | ||
| 4873 | originalEvent: {} | ||
| 4874 | } | ||
| 4875 | ); | ||
| 4876 | if ( bubble ) { | ||
| 4877 | jQuery.event.trigger( e, null, elem ); | ||
| 4878 | } else { | ||
| 4879 | jQuery.event.dispatch.call( elem, e ); | ||
| 4880 | } | ||
| 4881 | if ( e.isDefaultPrevented() ) { | ||
| 4882 | event.preventDefault(); | ||
| 4883 | } | ||
| 4884 | } | ||
| 4885 | }; | ||
| 4886 | |||
| 4887 | jQuery.removeEvent = document.removeEventListener ? | ||
| 4888 | function( elem, type, handle ) { | ||
| 4889 | if ( elem.removeEventListener ) { | ||
| 4890 | elem.removeEventListener( type, handle, false ); | ||
| 4891 | } | ||
| 4892 | } : | ||
| 4893 | function( elem, type, handle ) { | ||
| 4894 | var name = "on" + type; | ||
| 4895 | |||
| 4896 | if ( elem.detachEvent ) { | ||
| 4897 | |||
| 4898 | // #8545, #7054, preventing memory leaks for custom events in IE6-8 | ||
| 4899 | // detachEvent needed property on element, by name of that event, to properly expose it to GC | ||
| 4900 | if ( typeof elem[ name ] === strundefined ) { | ||
| 4901 | elem[ name ] = null; | ||
| 4902 | } | ||
| 4903 | |||
| 4904 | elem.detachEvent( name, handle ); | ||
| 4905 | } | ||
| 4906 | }; | ||
| 4907 | |||
| 4908 | jQuery.Event = function( src, props ) { | ||
| 4909 | // Allow instantiation without the 'new' keyword | ||
| 4910 | if ( !(this instanceof jQuery.Event) ) { | ||
| 4911 | return new jQuery.Event( src, props ); | ||
| 4912 | } | ||
| 4913 | |||
| 4914 | // Event object | ||
| 4915 | if ( src && src.type ) { | ||
| 4916 | this.originalEvent = src; | ||
| 4917 | this.type = src.type; | ||
| 4918 | |||
| 4919 | // Events bubbling up the document may have been marked as prevented | ||
| 4920 | // by a handler lower down the tree; reflect the correct value. | ||
| 4921 | this.isDefaultPrevented = src.defaultPrevented || | ||
| 4922 | src.defaultPrevented === undefined && | ||
| 4923 | // Support: IE < 9, Android < 4.0 | ||
| 4924 | src.returnValue === false ? | ||
| 4925 | returnTrue : | ||
| 4926 | returnFalse; | ||
| 4927 | |||
| 4928 | // Event type | ||
| 4929 | } else { | ||
| 4930 | this.type = src; | ||
| 4931 | } | ||
| 4932 | |||
| 4933 | // Put explicitly provided properties onto the event object | ||
| 4934 | if ( props ) { | ||
| 4935 | jQuery.extend( this, props ); | ||
| 4936 | } | ||
| 4937 | |||
| 4938 | // Create a timestamp if incoming event doesn't have one | ||
| 4939 | this.timeStamp = src && src.timeStamp || jQuery.now(); | ||
| 4940 | |||
| 4941 | // Mark it as fixed | ||
| 4942 | this[ jQuery.expando ] = true; | ||
| 4943 | }; | ||
| 4944 | |||
| 4945 | // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding | ||
| 4946 | // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html | ||
| 4947 | jQuery.Event.prototype = { | ||
| 4948 | isDefaultPrevented: returnFalse, | ||
| 4949 | isPropagationStopped: returnFalse, | ||
| 4950 | isImmediatePropagationStopped: returnFalse, | ||
| 4951 | |||
| 4952 | preventDefault: function() { | ||
| 4953 | var e = this.originalEvent; | ||
| 4954 | |||
| 4955 | this.isDefaultPrevented = returnTrue; | ||
| 4956 | if ( !e ) { | ||
| 4957 | return; | ||
| 4958 | } | ||
| 4959 | |||
| 4960 | // If preventDefault exists, run it on the original event | ||
| 4961 | if ( e.preventDefault ) { | ||
| 4962 | e.preventDefault(); | ||
| 4963 | |||
| 4964 | // Support: IE | ||
| 4965 | // Otherwise set the returnValue property of the original event to false | ||
| 4966 | } else { | ||
| 4967 | e.returnValue = false; | ||
| 4968 | } | ||
| 4969 | }, | ||
| 4970 | stopPropagation: function() { | ||
| 4971 | var e = this.originalEvent; | ||
| 4972 | |||
| 4973 | this.isPropagationStopped = returnTrue; | ||
| 4974 | if ( !e ) { | ||
| 4975 | return; | ||
| 4976 | } | ||
| 4977 | // If stopPropagation exists, run it on the original event | ||
| 4978 | if ( e.stopPropagation ) { | ||
| 4979 | e.stopPropagation(); | ||
| 4980 | } | ||
| 4981 | |||
| 4982 | // Support: IE | ||
| 4983 | // Set the cancelBubble property of the original event to true | ||
| 4984 | e.cancelBubble = true; | ||
| 4985 | }, | ||
| 4986 | stopImmediatePropagation: function() { | ||
| 4987 | var e = this.originalEvent; | ||
| 4988 | |||
| 4989 | this.isImmediatePropagationStopped = returnTrue; | ||
| 4990 | |||
| 4991 | if ( e && e.stopImmediatePropagation ) { | ||
| 4992 | e.stopImmediatePropagation(); | ||
| 4993 | } | ||
| 4994 | |||
| 4995 | this.stopPropagation(); | ||
| 4996 | } | ||
| 4997 | }; | ||
| 4998 | |||
| 4999 | // Create mouseenter/leave events using mouseover/out and event-time checks | ||
| 5000 | jQuery.each({ | ||
| 5001 | mouseenter: "mouseover", | ||
| 5002 | mouseleave: "mouseout", | ||
| 5003 | pointerenter: "pointerover", | ||
| 5004 | pointerleave: "pointerout" | ||
| 5005 | }, function( orig, fix ) { | ||
| 5006 | jQuery.event.special[ orig ] = { | ||
| 5007 | delegateType: fix, | ||
| 5008 | bindType: fix, | ||
| 5009 | |||
| 5010 | handle: function( event ) { | ||
| 5011 | var ret, | ||
| 5012 | target = this, | ||
| 5013 | related = event.relatedTarget, | ||
| 5014 | handleObj = event.handleObj; | ||
| 5015 | |||
| 5016 | // For mousenter/leave call the handler if related is outside the target. | ||
| 5017 | // NB: No relatedTarget if the mouse left/entered the browser window | ||
| 5018 | if ( !related || (related !== target && !jQuery.contains( target, related )) ) { | ||
| 5019 | event.type = handleObj.origType; | ||
| 5020 | ret = handleObj.handler.apply( this, arguments ); | ||
| 5021 | event.type = fix; | ||
| 5022 | } | ||
| 5023 | return ret; | ||
| 5024 | } | ||
| 5025 | }; | ||
| 5026 | }); | ||
| 5027 | |||
| 5028 | // IE submit delegation | ||
| 5029 | if ( !support.submitBubbles ) { | ||
| 5030 | |||
| 5031 | jQuery.event.special.submit = { | ||
| 5032 | setup: function() { | ||
| 5033 | // Only need this for delegated form submit events | ||
| 5034 | if ( jQuery.nodeName( this, "form" ) ) { | ||
| 5035 | return false; | ||
| 5036 | } | ||
| 5037 | |||
| 5038 | // Lazy-add a submit handler when a descendant form may potentially be submitted | ||
| 5039 | jQuery.event.add( this, "click._submit keypress._submit", function( e ) { | ||
| 5040 | // Node name check avoids a VML-related crash in IE (#9807) | ||
| 5041 | var elem = e.target, | ||
| 5042 | form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; | ||
| 5043 | if ( form && !jQuery._data( form, "submitBubbles" ) ) { | ||
| 5044 | jQuery.event.add( form, "submit._submit", function( event ) { | ||
| 5045 | event._submit_bubble = true; | ||
| 5046 | }); | ||
| 5047 | jQuery._data( form, "submitBubbles", true ); | ||
| 5048 | } | ||
| 5049 | }); | ||
| 5050 | // return undefined since we don't need an event listener | ||
| 5051 | }, | ||
| 5052 | |||
| 5053 | postDispatch: function( event ) { | ||
| 5054 | // If form was submitted by the user, bubble the event up the tree | ||
| 5055 | if ( event._submit_bubble ) { | ||
| 5056 | delete event._submit_bubble; | ||
| 5057 | if ( this.parentNode && !event.isTrigger ) { | ||
| 5058 | jQuery.event.simulate( "submit", this.parentNode, event, true ); | ||
| 5059 | } | ||
| 5060 | } | ||
| 5061 | }, | ||
| 5062 | |||
| 5063 | teardown: function() { | ||
| 5064 | // Only need this for delegated form submit events | ||
| 5065 | if ( jQuery.nodeName( this, "form" ) ) { | ||
| 5066 | return false; | ||
| 5067 | } | ||
| 5068 | |||
| 5069 | // Remove delegated handlers; cleanData eventually reaps submit handlers attached above | ||
| 5070 | jQuery.event.remove( this, "._submit" ); | ||
| 5071 | } | ||
| 5072 | }; | ||
| 5073 | } | ||
| 5074 | |||
| 5075 | // IE change delegation and checkbox/radio fix | ||
| 5076 | if ( !support.changeBubbles ) { | ||
| 5077 | |||
| 5078 | jQuery.event.special.change = { | ||
| 5079 | |||
| 5080 | setup: function() { | ||
| 5081 | |||
| 5082 | if ( rformElems.test( this.nodeName ) ) { | ||
| 5083 | // IE doesn't fire change on a check/radio until blur; trigger it on click | ||
| 5084 | // after a propertychange. Eat the blur-change in special.change.handle. | ||
| 5085 | // This still fires onchange a second time for check/radio after blur. | ||
| 5086 | if ( this.type === "checkbox" || this.type === "radio" ) { | ||
| 5087 | jQuery.event.add( this, "propertychange._change", function( event ) { | ||
| 5088 | if ( event.originalEvent.propertyName === "checked" ) { | ||
| 5089 | this._just_changed = true; | ||
| 5090 | } | ||
| 5091 | }); | ||
| 5092 | jQuery.event.add( this, "click._change", function( event ) { | ||
| 5093 | if ( this._just_changed && !event.isTrigger ) { | ||
| 5094 | this._just_changed = false; | ||
| 5095 | } | ||
| 5096 | // Allow triggered, simulated change events (#11500) | ||
| 5097 | jQuery.event.simulate( "change", this, event, true ); | ||
| 5098 | }); | ||
| 5099 | } | ||
| 5100 | return false; | ||
| 5101 | } | ||
| 5102 | // Delegated event; lazy-add a change handler on descendant inputs | ||
| 5103 | jQuery.event.add( this, "beforeactivate._change", function( e ) { | ||
| 5104 | var elem = e.target; | ||
| 5105 | |||
| 5106 | if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { | ||
| 5107 | jQuery.event.add( elem, "change._change", function( event ) { | ||
| 5108 | if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { | ||
| 5109 | jQuery.event.simulate( "change", this.parentNode, event, true ); | ||
| 5110 | } | ||
| 5111 | }); | ||
| 5112 | jQuery._data( elem, "changeBubbles", true ); | ||
| 5113 | } | ||
| 5114 | }); | ||
| 5115 | }, | ||
| 5116 | |||
| 5117 | handle: function( event ) { | ||
| 5118 | var elem = event.target; | ||
| 5119 | |||
| 5120 | // Swallow native change events from checkbox/radio, we already triggered them above | ||
| 5121 | if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { | ||
| 5122 | return event.handleObj.handler.apply( this, arguments ); | ||
| 5123 | } | ||
| 5124 | }, | ||
| 5125 | |||
| 5126 | teardown: function() { | ||
| 5127 | jQuery.event.remove( this, "._change" ); | ||
| 5128 | |||
| 5129 | return !rformElems.test( this.nodeName ); | ||
| 5130 | } | ||
| 5131 | }; | ||
| 5132 | } | ||
| 5133 | |||
| 5134 | // Create "bubbling" focus and blur events | ||
| 5135 | if ( !support.focusinBubbles ) { | ||
| 5136 | jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { | ||
| 5137 | |||
| 5138 | // Attach a single capturing handler on the document while someone wants focusin/focusout | ||
| 5139 | var handler = function( event ) { | ||
| 5140 | jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); | ||
| 5141 | }; | ||
| 5142 | |||
| 5143 | jQuery.event.special[ fix ] = { | ||
| 5144 | setup: function() { | ||
| 5145 | var doc = this.ownerDocument || this, | ||
| 5146 | attaches = jQuery._data( doc, fix ); | ||
| 5147 | |||
| 5148 | if ( !attaches ) { | ||
| 5149 | doc.addEventListener( orig, handler, true ); | ||
| 5150 | } | ||
| 5151 | jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); | ||
| 5152 | }, | ||
| 5153 | teardown: function() { | ||
| 5154 | var doc = this.ownerDocument || this, | ||
| 5155 | attaches = jQuery._data( doc, fix ) - 1; | ||
| 5156 | |||
| 5157 | if ( !attaches ) { | ||
| 5158 | doc.removeEventListener( orig, handler, true ); | ||
| 5159 | jQuery._removeData( doc, fix ); | ||
| 5160 | } else { | ||
| 5161 | jQuery._data( doc, fix, attaches ); | ||
| 5162 | } | ||
| 5163 | } | ||
| 5164 | }; | ||
| 5165 | }); | ||
| 5166 | } | ||
| 5167 | |||
| 5168 | jQuery.fn.extend({ | ||
| 5169 | |||
| 5170 | on: function( types, selector, data, fn, /*INTERNAL*/ one ) { | ||
| 5171 | var type, origFn; | ||
| 5172 | |||
| 5173 | // Types can be a map of types/handlers | ||
| 5174 | if ( typeof types === "object" ) { | ||
| 5175 | // ( types-Object, selector, data ) | ||
| 5176 | if ( typeof selector !== "string" ) { | ||
| 5177 | // ( types-Object, data ) | ||
| 5178 | data = data || selector; | ||
| 5179 | selector = undefined; | ||
| 5180 | } | ||
| 5181 | for ( type in types ) { | ||
| 5182 | this.on( type, selector, data, types[ type ], one ); | ||
| 5183 | } | ||
| 5184 | return this; | ||
| 5185 | } | ||
| 5186 | |||
| 5187 | if ( data == null && fn == null ) { | ||
| 5188 | // ( types, fn ) | ||
| 5189 | fn = selector; | ||
| 5190 | data = selector = undefined; | ||
| 5191 | } else if ( fn == null ) { | ||
| 5192 | if ( typeof selector === "string" ) { | ||
| 5193 | // ( types, selector, fn ) | ||
| 5194 | fn = data; | ||
| 5195 | data = undefined; | ||
| 5196 | } else { | ||
| 5197 | // ( types, data, fn ) | ||
| 5198 | fn = data; | ||
| 5199 | data = selector; | ||
| 5200 | selector = undefined; | ||
| 5201 | } | ||
| 5202 | } | ||
| 5203 | if ( fn === false ) { | ||
| 5204 | fn = returnFalse; | ||
| 5205 | } else if ( !fn ) { | ||
| 5206 | return this; | ||
| 5207 | } | ||
| 5208 | |||
| 5209 | if ( one === 1 ) { | ||
| 5210 | origFn = fn; | ||
| 5211 | fn = function( event ) { | ||
| 5212 | // Can use an empty set, since event contains the info | ||
| 5213 | jQuery().off( event ); | ||
| 5214 | return origFn.apply( this, arguments ); | ||
| 5215 | }; | ||
| 5216 | // Use same guid so caller can remove using origFn | ||
| 5217 | fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); | ||
| 5218 | } | ||
| 5219 | return this.each( function() { | ||
| 5220 | jQuery.event.add( this, types, fn, data, selector ); | ||
| 5221 | }); | ||
| 5222 | }, | ||
| 5223 | one: function( types, selector, data, fn ) { | ||
| 5224 | return this.on( types, selector, data, fn, 1 ); | ||
| 5225 | }, | ||
| 5226 | off: function( types, selector, fn ) { | ||
| 5227 | var handleObj, type; | ||
| 5228 | if ( types && types.preventDefault && types.handleObj ) { | ||
| 5229 | // ( event ) dispatched jQuery.Event | ||
| 5230 | handleObj = types.handleObj; | ||
| 5231 | jQuery( types.delegateTarget ).off( | ||
| 5232 | handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, | ||
| 5233 | handleObj.selector, | ||
| 5234 | handleObj.handler | ||
| 5235 | ); | ||
| 5236 | return this; | ||
| 5237 | } | ||
| 5238 | if ( typeof types === "object" ) { | ||
| 5239 | // ( types-object [, selector] ) | ||
| 5240 | for ( type in types ) { | ||
| 5241 | this.off( type, selector, types[ type ] ); | ||
| 5242 | } | ||
| 5243 | return this; | ||
| 5244 | } | ||
| 5245 | if ( selector === false || typeof selector === "function" ) { | ||
| 5246 | // ( types [, fn] ) | ||
| 5247 | fn = selector; | ||
| 5248 | selector = undefined; | ||
| 5249 | } | ||
| 5250 | if ( fn === false ) { | ||
| 5251 | fn = returnFalse; | ||
| 5252 | } | ||
| 5253 | return this.each(function() { | ||
| 5254 | jQuery.event.remove( this, types, fn, selector ); | ||
| 5255 | }); | ||
| 5256 | }, | ||
| 5257 | |||
| 5258 | trigger: function( type, data ) { | ||
| 5259 | return this.each(function() { | ||
| 5260 | jQuery.event.trigger( type, data, this ); | ||
| 5261 | }); | ||
| 5262 | }, | ||
| 5263 | triggerHandler: function( type, data ) { | ||
| 5264 | var elem = this[0]; | ||
| 5265 | if ( elem ) { | ||
| 5266 | return jQuery.event.trigger( type, data, elem, true ); | ||
| 5267 | } | ||
| 5268 | } | ||
| 5269 | }); | ||
| 5270 | |||
| 5271 | |||
| 5272 | function createSafeFragment( document ) { | ||
| 5273 | var list = nodeNames.split( "|" ), | ||
| 5274 | safeFrag = document.createDocumentFragment(); | ||
| 5275 | |||
| 5276 | if ( safeFrag.createElement ) { | ||
| 5277 | while ( list.length ) { | ||
| 5278 | safeFrag.createElement( | ||
| 5279 | list.pop() | ||
| 5280 | ); | ||
| 5281 | } | ||
| 5282 | } | ||
| 5283 | return safeFrag; | ||
| 5284 | } | ||
| 5285 | |||
| 5286 | var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + | ||
| 5287 | "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", | ||
| 5288 | rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, | ||
| 5289 | rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), | ||
| 5290 | rleadingWhitespace = /^\s+/, | ||
| 5291 | rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, | ||
| 5292 | rtagName = /<([\w:]+)/, | ||
| 5293 | rtbody = /<tbody/i, | ||
| 5294 | rhtml = /<|&#?\w+;/, | ||
| 5295 | rnoInnerhtml = /<(?:script|style|link)/i, | ||
| 5296 | // checked="checked" or checked | ||
| 5297 | rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, | ||
| 5298 | rscriptType = /^$|\/(?:java|ecma)script/i, | ||
| 5299 | rscriptTypeMasked = /^true\/(.*)/, | ||
| 5300 | rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, | ||
| 5301 | |||
| 5302 | // We have to close these tags to support XHTML (#13200) | ||
| 5303 | wrapMap = { | ||
| 5304 | option: [ 1, "<select multiple='multiple'>", "</select>" ], | ||
| 5305 | legend: [ 1, "<fieldset>", "</fieldset>" ], | ||
| 5306 | area: [ 1, "<map>", "</map>" ], | ||
| 5307 | param: [ 1, "<object>", "</object>" ], | ||
| 5308 | thead: [ 1, "<table>", "</table>" ], | ||
| 5309 | tr: [ 2, "<table><tbody>", "</tbody></table>" ], | ||
| 5310 | col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], | ||
| 5311 | td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], | ||
| 5312 | |||
| 5313 | // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, | ||
| 5314 | // unless wrapped in a div with non-breaking characters in front of it. | ||
| 5315 | _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] | ||
| 5316 | }, | ||
| 5317 | safeFragment = createSafeFragment( document ), | ||
| 5318 | fragmentDiv = safeFragment.appendChild( document.createElement("div") ); | ||
| 5319 | |||
| 5320 | wrapMap.optgroup = wrapMap.option; | ||
| 5321 | wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; | ||
| 5322 | wrapMap.th = wrapMap.td; | ||
| 5323 | |||
| 5324 | function getAll( context, tag ) { | ||
| 5325 | var elems, elem, | ||
| 5326 | i = 0, | ||
| 5327 | found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : | ||
| 5328 | typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : | ||
| 5329 | undefined; | ||
| 5330 | |||
| 5331 | if ( !found ) { | ||
| 5332 | for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { | ||
| 5333 | if ( !tag || jQuery.nodeName( elem, tag ) ) { | ||
| 5334 | found.push( elem ); | ||
| 5335 | } else { | ||
| 5336 | jQuery.merge( found, getAll( elem, tag ) ); | ||
| 5337 | } | ||
| 5338 | } | ||
| 5339 | } | ||
| 5340 | |||
| 5341 | return tag === undefined || tag && jQuery.nodeName( context, tag ) ? | ||
| 5342 | jQuery.merge( [ context ], found ) : | ||
| 5343 | found; | ||
| 5344 | } | ||
| 5345 | |||
| 5346 | // Used in buildFragment, fixes the defaultChecked property | ||
| 5347 | function fixDefaultChecked( elem ) { | ||
| 5348 | if ( rcheckableType.test( elem.type ) ) { | ||
| 5349 | elem.defaultChecked = elem.checked; | ||
| 5350 | } | ||
| 5351 | } | ||
| 5352 | |||
| 5353 | // Support: IE<8 | ||
| 5354 | // Manipulating tables requires a tbody | ||
| 5355 | function manipulationTarget( elem, content ) { | ||
| 5356 | return jQuery.nodeName( elem, "table" ) && | ||
| 5357 | jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? | ||
| 5358 | |||
| 5359 | elem.getElementsByTagName("tbody")[0] || | ||
| 5360 | elem.appendChild( elem.ownerDocument.createElement("tbody") ) : | ||
| 5361 | elem; | ||
| 5362 | } | ||
| 5363 | |||
| 5364 | // Replace/restore the type attribute of script elements for safe DOM manipulation | ||
| 5365 | function disableScript( elem ) { | ||
| 5366 | elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; | ||
| 5367 | return elem; | ||
| 5368 | } | ||
| 5369 | function restoreScript( elem ) { | ||
| 5370 | var match = rscriptTypeMasked.exec( elem.type ); | ||
| 5371 | if ( match ) { | ||
| 5372 | elem.type = match[1]; | ||
| 5373 | } else { | ||
| 5374 | elem.removeAttribute("type"); | ||
| 5375 | } | ||
| 5376 | return elem; | ||
| 5377 | } | ||
| 5378 | |||
| 5379 | // Mark scripts as having already been evaluated | ||
| 5380 | function setGlobalEval( elems, refElements ) { | ||
| 5381 | var elem, | ||
| 5382 | i = 0; | ||
| 5383 | for ( ; (elem = elems[i]) != null; i++ ) { | ||
| 5384 | jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); | ||
| 5385 | } | ||
| 5386 | } | ||
| 5387 | |||
| 5388 | function cloneCopyEvent( src, dest ) { | ||
| 5389 | |||
| 5390 | if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { | ||
| 5391 | return; | ||
| 5392 | } | ||
| 5393 | |||
| 5394 | var type, i, l, | ||
| 5395 | oldData = jQuery._data( src ), | ||
| 5396 | curData = jQuery._data( dest, oldData ), | ||
| 5397 | events = oldData.events; | ||
| 5398 | |||
| 5399 | if ( events ) { | ||
| 5400 | delete curData.handle; | ||
| 5401 | curData.events = {}; | ||
| 5402 | |||
| 5403 | for ( type in events ) { | ||
| 5404 | for ( i = 0, l = events[ type ].length; i < l; i++ ) { | ||
| 5405 | jQuery.event.add( dest, type, events[ type ][ i ] ); | ||
| 5406 | } | ||
| 5407 | } | ||
| 5408 | } | ||
| 5409 | |||
| 5410 | // make the cloned public data object a copy from the original | ||
| 5411 | if ( curData.data ) { | ||
| 5412 | curData.data = jQuery.extend( {}, curData.data ); | ||
| 5413 | } | ||
| 5414 | } | ||
| 5415 | |||
| 5416 | function fixCloneNodeIssues( src, dest ) { | ||
| 5417 | var nodeName, e, data; | ||
| 5418 | |||
| 5419 | // We do not need to do anything for non-Elements | ||
| 5420 | if ( dest.nodeType !== 1 ) { | ||
| 5421 | return; | ||
| 5422 | } | ||
| 5423 | |||
| 5424 | nodeName = dest.nodeName.toLowerCase(); | ||
| 5425 | |||
| 5426 | // IE6-8 copies events bound via attachEvent when using cloneNode. | ||
| 5427 | if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { | ||
| 5428 | data = jQuery._data( dest ); | ||
| 5429 | |||
| 5430 | for ( e in data.events ) { | ||
| 5431 | jQuery.removeEvent( dest, e, data.handle ); | ||
| 5432 | } | ||
| 5433 | |||
| 5434 | // Event data gets referenced instead of copied if the expando gets copied too | ||
| 5435 | dest.removeAttribute( jQuery.expando ); | ||
| 5436 | } | ||
| 5437 | |||
| 5438 | // IE blanks contents when cloning scripts, and tries to evaluate newly-set text | ||
| 5439 | if ( nodeName === "script" && dest.text !== src.text ) { | ||
| 5440 | disableScript( dest ).text = src.text; | ||
| 5441 | restoreScript( dest ); | ||
| 5442 | |||
| 5443 | // IE6-10 improperly clones children of object elements using classid. | ||
| 5444 | // IE10 throws NoModificationAllowedError if parent is null, #12132. | ||
| 5445 | } else if ( nodeName === "object" ) { | ||
| 5446 | if ( dest.parentNode ) { | ||
| 5447 | dest.outerHTML = src.outerHTML; | ||
| 5448 | } | ||
| 5449 | |||
| 5450 | // This path appears unavoidable for IE9. When cloning an object | ||
| 5451 | // element in IE9, the outerHTML strategy above is not sufficient. | ||
| 5452 | // If the src has innerHTML and the destination does not, | ||
| 5453 | // copy the src.innerHTML into the dest.innerHTML. #10324 | ||
| 5454 | if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { | ||
| 5455 | dest.innerHTML = src.innerHTML; | ||
| 5456 | } | ||
| 5457 | |||
| 5458 | } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { | ||
| 5459 | // IE6-8 fails to persist the checked state of a cloned checkbox | ||
| 5460 | // or radio button. Worse, IE6-7 fail to give the cloned element | ||
| 5461 | // a checked appearance if the defaultChecked value isn't also set | ||
| 5462 | |||
| 5463 | dest.defaultChecked = dest.checked = src.checked; | ||
| 5464 | |||
| 5465 | // IE6-7 get confused and end up setting the value of a cloned | ||
| 5466 | // checkbox/radio button to an empty string instead of "on" | ||
| 5467 | if ( dest.value !== src.value ) { | ||
| 5468 | dest.value = src.value; | ||
| 5469 | } | ||
| 5470 | |||
| 5471 | // IE6-8 fails to return the selected option to the default selected | ||
| 5472 | // state when cloning options | ||
| 5473 | } else if ( nodeName === "option" ) { | ||
| 5474 | dest.defaultSelected = dest.selected = src.defaultSelected; | ||
| 5475 | |||
| 5476 | // IE6-8 fails to set the defaultValue to the correct value when | ||
| 5477 | // cloning other types of input fields | ||
| 5478 | } else if ( nodeName === "input" || nodeName === "textarea" ) { | ||
| 5479 | dest.defaultValue = src.defaultValue; | ||
| 5480 | } | ||
| 5481 | } | ||
| 5482 | |||
| 5483 | jQuery.extend({ | ||
| 5484 | clone: function( elem, dataAndEvents, deepDataAndEvents ) { | ||
| 5485 | var destElements, node, clone, i, srcElements, | ||
| 5486 | inPage = jQuery.contains( elem.ownerDocument, elem ); | ||
| 5487 | |||
| 5488 | if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { | ||
| 5489 | clone = elem.cloneNode( true ); | ||
| 5490 | |||
| 5491 | // IE<=8 does not properly clone detached, unknown element nodes | ||
| 5492 | } else { | ||
| 5493 | fragmentDiv.innerHTML = elem.outerHTML; | ||
| 5494 | fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); | ||
| 5495 | } | ||
| 5496 | |||
| 5497 | if ( (!support.noCloneEvent || !support.noCloneChecked) && | ||
| 5498 | (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { | ||
| 5499 | |||
| 5500 | // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 | ||
| 5501 | destElements = getAll( clone ); | ||
| 5502 | srcElements = getAll( elem ); | ||
| 5503 | |||
| 5504 | // Fix all IE cloning issues | ||
| 5505 | for ( i = 0; (node = srcElements[i]) != null; ++i ) { | ||
| 5506 | // Ensure that the destination node is not null; Fixes #9587 | ||
| 5507 | if ( destElements[i] ) { | ||
| 5508 | fixCloneNodeIssues( node, destElements[i] ); | ||
| 5509 | } | ||
| 5510 | } | ||
| 5511 | } | ||
| 5512 | |||
| 5513 | // Copy the events from the original to the clone | ||
| 5514 | if ( dataAndEvents ) { | ||
| 5515 | if ( deepDataAndEvents ) { | ||
| 5516 | srcElements = srcElements || getAll( elem ); | ||
| 5517 | destElements = destElements || getAll( clone ); | ||
| 5518 | |||
| 5519 | for ( i = 0; (node = srcElements[i]) != null; i++ ) { | ||
| 5520 | cloneCopyEvent( node, destElements[i] ); | ||
| 5521 | } | ||
| 5522 | } else { | ||
| 5523 | cloneCopyEvent( elem, clone ); | ||
| 5524 | } | ||
| 5525 | } | ||
| 5526 | |||
| 5527 | // Preserve script evaluation history | ||
| 5528 | destElements = getAll( clone, "script" ); | ||
| 5529 | if ( destElements.length > 0 ) { | ||
| 5530 | setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); | ||
| 5531 | } | ||
| 5532 | |||
| 5533 | destElements = srcElements = node = null; | ||
| 5534 | |||
| 5535 | // Return the cloned set | ||
| 5536 | return clone; | ||
| 5537 | }, | ||
| 5538 | |||
| 5539 | buildFragment: function( elems, context, scripts, selection ) { | ||
| 5540 | var j, elem, contains, | ||
| 5541 | tmp, tag, tbody, wrap, | ||
| 5542 | l = elems.length, | ||
| 5543 | |||
| 5544 | // Ensure a safe fragment | ||
| 5545 | safe = createSafeFragment( context ), | ||
| 5546 | |||
| 5547 | nodes = [], | ||
| 5548 | i = 0; | ||
| 5549 | |||
| 5550 | for ( ; i < l; i++ ) { | ||
| 5551 | elem = elems[ i ]; | ||
| 5552 | |||
| 5553 | if ( elem || elem === 0 ) { | ||
| 5554 | |||
| 5555 | // Add nodes directly | ||
| 5556 | if ( jQuery.type( elem ) === "object" ) { | ||
| 5557 | jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); | ||
| 5558 | |||
| 5559 | // Convert non-html into a text node | ||
| 5560 | } else if ( !rhtml.test( elem ) ) { | ||
| 5561 | nodes.push( context.createTextNode( elem ) ); | ||
| 5562 | |||
| 5563 | // Convert html into DOM nodes | ||
| 5564 | } else { | ||
| 5565 | tmp = tmp || safe.appendChild( context.createElement("div") ); | ||
| 5566 | |||
| 5567 | // Deserialize a standard representation | ||
| 5568 | tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); | ||
| 5569 | wrap = wrapMap[ tag ] || wrapMap._default; | ||
| 5570 | |||
| 5571 | tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; | ||
| 5572 | |||
| 5573 | // Descend through wrappers to the right content | ||
| 5574 | j = wrap[0]; | ||
| 5575 | while ( j-- ) { | ||
| 5576 | tmp = tmp.lastChild; | ||
| 5577 | } | ||
| 5578 | |||
| 5579 | // Manually add leading whitespace removed by IE | ||
| 5580 | if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { | ||
| 5581 | nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); | ||
| 5582 | } | ||
| 5583 | |||
| 5584 | // Remove IE's autoinserted <tbody> from table fragments | ||
| 5585 | if ( !support.tbody ) { | ||
| 5586 | |||
| 5587 | // String was a <table>, *may* have spurious <tbody> | ||
| 5588 | elem = tag === "table" && !rtbody.test( elem ) ? | ||
| 5589 | tmp.firstChild : | ||
| 5590 | |||
| 5591 | // String was a bare <thead> or <tfoot> | ||
| 5592 | wrap[1] === "<table>" && !rtbody.test( elem ) ? | ||
| 5593 | tmp : | ||
| 5594 | 0; | ||
| 5595 | |||
| 5596 | j = elem && elem.childNodes.length; | ||
| 5597 | while ( j-- ) { | ||
| 5598 | if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { | ||
| 5599 | elem.removeChild( tbody ); | ||
| 5600 | } | ||
| 5601 | } | ||
| 5602 | } | ||
| 5603 | |||
| 5604 | jQuery.merge( nodes, tmp.childNodes ); | ||
| 5605 | |||
| 5606 | // Fix #12392 for WebKit and IE > 9 | ||
| 5607 | tmp.textContent = ""; | ||
| 5608 | |||
| 5609 | // Fix #12392 for oldIE | ||
| 5610 | while ( tmp.firstChild ) { | ||
| 5611 | tmp.removeChild( tmp.firstChild ); | ||
| 5612 | } | ||
| 5613 | |||
| 5614 | // Remember the top-level container for proper cleanup | ||
| 5615 | tmp = safe.lastChild; | ||
| 5616 | } | ||
| 5617 | } | ||
| 5618 | } | ||
| 5619 | |||
| 5620 | // Fix #11356: Clear elements from fragment | ||
| 5621 | if ( tmp ) { | ||
| 5622 | safe.removeChild( tmp ); | ||
| 5623 | } | ||
| 5624 | |||
| 5625 | // Reset defaultChecked for any radios and checkboxes | ||
| 5626 | // about to be appended to the DOM in IE 6/7 (#8060) | ||
| 5627 | if ( !support.appendChecked ) { | ||
| 5628 | jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); | ||
| 5629 | } | ||
| 5630 | |||
| 5631 | i = 0; | ||
| 5632 | while ( (elem = nodes[ i++ ]) ) { | ||
| 5633 | |||
| 5634 | // #4087 - If origin and destination elements are the same, and this is | ||
| 5635 | // that element, do not do anything | ||
| 5636 | if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { | ||
| 5637 | continue; | ||
| 5638 | } | ||
| 5639 | |||
| 5640 | contains = jQuery.contains( elem.ownerDocument, elem ); | ||
| 5641 | |||
| 5642 | // Append to fragment | ||
| 5643 | tmp = getAll( safe.appendChild( elem ), "script" ); | ||
| 5644 | |||
| 5645 | // Preserve script evaluation history | ||
| 5646 | if ( contains ) { | ||
| 5647 | setGlobalEval( tmp ); | ||
| 5648 | } | ||
| 5649 | |||
| 5650 | // Capture executables | ||
| 5651 | if ( scripts ) { | ||
| 5652 | j = 0; | ||
| 5653 | while ( (elem = tmp[ j++ ]) ) { | ||
| 5654 | if ( rscriptType.test( elem.type || "" ) ) { | ||
| 5655 | scripts.push( elem ); | ||
| 5656 | } | ||
| 5657 | } | ||
| 5658 | } | ||
| 5659 | } | ||
| 5660 | |||
| 5661 | tmp = null; | ||
| 5662 | |||
| 5663 | return safe; | ||
| 5664 | }, | ||
| 5665 | |||
| 5666 | cleanData: function( elems, /* internal */ acceptData ) { | ||
| 5667 | var elem, type, id, data, | ||
| 5668 | i = 0, | ||
| 5669 | internalKey = jQuery.expando, | ||
| 5670 | cache = jQuery.cache, | ||
| 5671 | deleteExpando = support.deleteExpando, | ||
| 5672 | special = jQuery.event.special; | ||
| 5673 | |||
| 5674 | for ( ; (elem = elems[i]) != null; i++ ) { | ||
| 5675 | if ( acceptData || jQuery.acceptData( elem ) ) { | ||
| 5676 | |||
| 5677 | id = elem[ internalKey ]; | ||
| 5678 | data = id && cache[ id ]; | ||
| 5679 | |||
| 5680 | if ( data ) { | ||
| 5681 | if ( data.events ) { | ||
| 5682 | for ( type in data.events ) { | ||
| 5683 | if ( special[ type ] ) { | ||
| 5684 | jQuery.event.remove( elem, type ); | ||
| 5685 | |||
| 5686 | // This is a shortcut to avoid jQuery.event.remove's overhead | ||
| 5687 | } else { | ||
| 5688 | jQuery.removeEvent( elem, type, data.handle ); | ||
| 5689 | } | ||
| 5690 | } | ||
| 5691 | } | ||
| 5692 | |||
| 5693 | // Remove cache only if it was not already removed by jQuery.event.remove | ||
| 5694 | if ( cache[ id ] ) { | ||
| 5695 | |||
| 5696 | delete cache[ id ]; | ||
| 5697 | |||
| 5698 | // IE does not allow us to delete expando properties from nodes, | ||
| 5699 | // nor does it have a removeAttribute function on Document nodes; | ||
| 5700 | // we must handle all of these cases | ||
| 5701 | if ( deleteExpando ) { | ||
| 5702 | delete elem[ internalKey ]; | ||
| 5703 | |||
| 5704 | } else if ( typeof elem.removeAttribute !== strundefined ) { | ||
| 5705 | elem.removeAttribute( internalKey ); | ||
| 5706 | |||
| 5707 | } else { | ||
| 5708 | elem[ internalKey ] = null; | ||
| 5709 | } | ||
| 5710 | |||
| 5711 | deletedIds.push( id ); | ||
| 5712 | } | ||
| 5713 | } | ||
| 5714 | } | ||
| 5715 | } | ||
| 5716 | } | ||
| 5717 | }); | ||
| 5718 | |||
| 5719 | jQuery.fn.extend({ | ||
| 5720 | text: function( value ) { | ||
| 5721 | return access( this, function( value ) { | ||
| 5722 | return value === undefined ? | ||
| 5723 | jQuery.text( this ) : | ||
| 5724 | this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); | ||
| 5725 | }, null, value, arguments.length ); | ||
| 5726 | }, | ||
| 5727 | |||
| 5728 | append: function() { | ||
| 5729 | return this.domManip( arguments, function( elem ) { | ||
| 5730 | if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { | ||
| 5731 | var target = manipulationTarget( this, elem ); | ||
| 5732 | target.appendChild( elem ); | ||
| 5733 | } | ||
| 5734 | }); | ||
| 5735 | }, | ||
| 5736 | |||
| 5737 | prepend: function() { | ||
| 5738 | return this.domManip( arguments, function( elem ) { | ||
| 5739 | if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { | ||
| 5740 | var target = manipulationTarget( this, elem ); | ||
| 5741 | target.insertBefore( elem, target.firstChild ); | ||
| 5742 | } | ||
| 5743 | }); | ||
| 5744 | }, | ||
| 5745 | |||
| 5746 | before: function() { | ||
| 5747 | return this.domManip( arguments, function( elem ) { | ||
| 5748 | if ( this.parentNode ) { | ||
| 5749 | this.parentNode.insertBefore( elem, this ); | ||
| 5750 | } | ||
| 5751 | }); | ||
| 5752 | }, | ||
| 5753 | |||
| 5754 | after: function() { | ||
| 5755 | return this.domManip( arguments, function( elem ) { | ||
| 5756 | if ( this.parentNode ) { | ||
| 5757 | this.parentNode.insertBefore( elem, this.nextSibling ); | ||
| 5758 | } | ||
| 5759 | }); | ||
| 5760 | }, | ||
| 5761 | |||
| 5762 | remove: function( selector, keepData /* Internal Use Only */ ) { | ||
| 5763 | var elem, | ||
| 5764 | elems = selector ? jQuery.filter( selector, this ) : this, | ||
| 5765 | i = 0; | ||
| 5766 | |||
| 5767 | for ( ; (elem = elems[i]) != null; i++ ) { | ||
| 5768 | |||
| 5769 | if ( !keepData && elem.nodeType === 1 ) { | ||
| 5770 | jQuery.cleanData( getAll( elem ) ); | ||
| 5771 | } | ||
| 5772 | |||
| 5773 | if ( elem.parentNode ) { | ||
| 5774 | if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { | ||
| 5775 | setGlobalEval( getAll( elem, "script" ) ); | ||
| 5776 | } | ||
| 5777 | elem.parentNode.removeChild( elem ); | ||
| 5778 | } | ||
| 5779 | } | ||
| 5780 | |||
| 5781 | return this; | ||
| 5782 | }, | ||
| 5783 | |||
| 5784 | empty: function() { | ||
| 5785 | var elem, | ||
| 5786 | i = 0; | ||
| 5787 | |||
| 5788 | for ( ; (elem = this[i]) != null; i++ ) { | ||
| 5789 | // Remove element nodes and prevent memory leaks | ||
| 5790 | if ( elem.nodeType === 1 ) { | ||
| 5791 | jQuery.cleanData( getAll( elem, false ) ); | ||
| 5792 | } | ||
| 5793 | |||
| 5794 | // Remove any remaining nodes | ||
| 5795 | while ( elem.firstChild ) { | ||
| 5796 | elem.removeChild( elem.firstChild ); | ||
| 5797 | } | ||
| 5798 | |||
| 5799 | // If this is a select, ensure that it displays empty (#12336) | ||
| 5800 | // Support: IE<9 | ||
| 5801 | if ( elem.options && jQuery.nodeName( elem, "select" ) ) { | ||
| 5802 | elem.options.length = 0; | ||
| 5803 | } | ||
| 5804 | } | ||
| 5805 | |||
| 5806 | return this; | ||
| 5807 | }, | ||
| 5808 | |||
| 5809 | clone: function( dataAndEvents, deepDataAndEvents ) { | ||
| 5810 | dataAndEvents = dataAndEvents == null ? false : dataAndEvents; | ||
| 5811 | deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; | ||
| 5812 | |||
| 5813 | return this.map(function() { | ||
| 5814 | return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); | ||
| 5815 | }); | ||
| 5816 | }, | ||
| 5817 | |||
| 5818 | html: function( value ) { | ||
| 5819 | return access( this, function( value ) { | ||
| 5820 | var elem = this[ 0 ] || {}, | ||
| 5821 | i = 0, | ||
| 5822 | l = this.length; | ||
| 5823 | |||
| 5824 | if ( value === undefined ) { | ||
| 5825 | return elem.nodeType === 1 ? | ||
| 5826 | elem.innerHTML.replace( rinlinejQuery, "" ) : | ||
| 5827 | undefined; | ||
| 5828 | } | ||
| 5829 | |||
| 5830 | // See if we can take a shortcut and just use innerHTML | ||
| 5831 | if ( typeof value === "string" && !rnoInnerhtml.test( value ) && | ||
| 5832 | ( support.htmlSerialize || !rnoshimcache.test( value ) ) && | ||
| 5833 | ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && | ||
| 5834 | !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { | ||
| 5835 | |||
| 5836 | value = value.replace( rxhtmlTag, "<$1></$2>" ); | ||
| 5837 | |||
| 5838 | try { | ||
| 5839 | for (; i < l; i++ ) { | ||
| 5840 | // Remove element nodes and prevent memory leaks | ||
| 5841 | elem = this[i] || {}; | ||
| 5842 | if ( elem.nodeType === 1 ) { | ||
| 5843 | jQuery.cleanData( getAll( elem, false ) ); | ||
| 5844 | elem.innerHTML = value; | ||
| 5845 | } | ||
| 5846 | } | ||
| 5847 | |||
| 5848 | elem = 0; | ||
| 5849 | |||
| 5850 | // If using innerHTML throws an exception, use the fallback method | ||
| 5851 | } catch(e) {} | ||
| 5852 | } | ||
| 5853 | |||
| 5854 | if ( elem ) { | ||
| 5855 | this.empty().append( value ); | ||
| 5856 | } | ||
| 5857 | }, null, value, arguments.length ); | ||
| 5858 | }, | ||
| 5859 | |||
| 5860 | replaceWith: function() { | ||
| 5861 | var arg = arguments[ 0 ]; | ||
| 5862 | |||
| 5863 | // Make the changes, replacing each context element with the new content | ||
| 5864 | this.domManip( arguments, function( elem ) { | ||
| 5865 | arg = this.parentNode; | ||
| 5866 | |||
| 5867 | jQuery.cleanData( getAll( this ) ); | ||
| 5868 | |||
| 5869 | if ( arg ) { | ||
| 5870 | arg.replaceChild( elem, this ); | ||
| 5871 | } | ||
| 5872 | }); | ||
| 5873 | |||
| 5874 | // Force removal if there was no new content (e.g., from empty arguments) | ||
| 5875 | return arg && (arg.length || arg.nodeType) ? this : this.remove(); | ||
| 5876 | }, | ||
| 5877 | |||
| 5878 | detach: function( selector ) { | ||
| 5879 | return this.remove( selector, true ); | ||
| 5880 | }, | ||
| 5881 | |||
| 5882 | domManip: function( args, callback ) { | ||
| 5883 | |||
| 5884 | // Flatten any nested arrays | ||
| 5885 | args = concat.apply( [], args ); | ||
| 5886 | |||
| 5887 | var first, node, hasScripts, | ||
| 5888 | scripts, doc, fragment, | ||
| 5889 | i = 0, | ||
| 5890 | l = this.length, | ||
| 5891 | set = this, | ||
| 5892 | iNoClone = l - 1, | ||
| 5893 | value = args[0], | ||
| 5894 | isFunction = jQuery.isFunction( value ); | ||
| 5895 | |||
| 5896 | // We can't cloneNode fragments that contain checked, in WebKit | ||
| 5897 | if ( isFunction || | ||
| 5898 | ( l > 1 && typeof value === "string" && | ||
| 5899 | !support.checkClone && rchecked.test( value ) ) ) { | ||
| 5900 | return this.each(function( index ) { | ||
| 5901 | var self = set.eq( index ); | ||
| 5902 | if ( isFunction ) { | ||
| 5903 | args[0] = value.call( this, index, self.html() ); | ||
| 5904 | } | ||
| 5905 | self.domManip( args, callback ); | ||
| 5906 | }); | ||
| 5907 | } | ||
| 5908 | |||
| 5909 | if ( l ) { | ||
| 5910 | fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); | ||
| 5911 | first = fragment.firstChild; | ||
| 5912 | |||
| 5913 | if ( fragment.childNodes.length === 1 ) { | ||
| 5914 | fragment = first; | ||
| 5915 | } | ||
| 5916 | |||
| 5917 | if ( first ) { | ||
| 5918 | scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); | ||
| 5919 | hasScripts = scripts.length; | ||
| 5920 | |||
| 5921 | // Use the original fragment for the last item instead of the first because it can end up | ||
| 5922 | // being emptied incorrectly in certain situations (#8070). | ||
| 5923 | for ( ; i < l; i++ ) { | ||
| 5924 | node = fragment; | ||
| 5925 | |||
| 5926 | if ( i !== iNoClone ) { | ||
| 5927 | node = jQuery.clone( node, true, true ); | ||
| 5928 | |||
| 5929 | // Keep references to cloned scripts for later restoration | ||
| 5930 | if ( hasScripts ) { | ||
| 5931 | jQuery.merge( scripts, getAll( node, "script" ) ); | ||
| 5932 | } | ||
| 5933 | } | ||
| 5934 | |||
| 5935 | callback.call( this[i], node, i ); | ||
| 5936 | } | ||
| 5937 | |||
| 5938 | if ( hasScripts ) { | ||
| 5939 | doc = scripts[ scripts.length - 1 ].ownerDocument; | ||
| 5940 | |||
| 5941 | // Reenable scripts | ||
| 5942 | jQuery.map( scripts, restoreScript ); | ||
| 5943 | |||
| 5944 | // Evaluate executable scripts on first document insertion | ||
| 5945 | for ( i = 0; i < hasScripts; i++ ) { | ||
| 5946 | node = scripts[ i ]; | ||
| 5947 | if ( rscriptType.test( node.type || "" ) && | ||
| 5948 | !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { | ||
| 5949 | |||
| 5950 | if ( node.src ) { | ||
| 5951 | // Optional AJAX dependency, but won't run scripts if not present | ||
| 5952 | if ( jQuery._evalUrl ) { | ||
| 5953 | jQuery._evalUrl( node.src ); | ||
| 5954 | } | ||
| 5955 | } else { | ||
| 5956 | jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); | ||
| 5957 | } | ||
| 5958 | } | ||
| 5959 | } | ||
| 5960 | } | ||
| 5961 | |||
| 5962 | // Fix #11809: Avoid leaking memory | ||
| 5963 | fragment = first = null; | ||
| 5964 | } | ||
| 5965 | } | ||
| 5966 | |||
| 5967 | return this; | ||
| 5968 | } | ||
| 5969 | }); | ||
| 5970 | |||
| 5971 | jQuery.each({ | ||
| 5972 | appendTo: "append", | ||
| 5973 | prependTo: "prepend", | ||
| 5974 | insertBefore: "before", | ||
| 5975 | insertAfter: "after", | ||
| 5976 | replaceAll: "replaceWith" | ||
| 5977 | }, function( name, original ) { | ||
| 5978 | jQuery.fn[ name ] = function( selector ) { | ||
| 5979 | var elems, | ||
| 5980 | i = 0, | ||
| 5981 | ret = [], | ||
| 5982 | insert = jQuery( selector ), | ||
| 5983 | last = insert.length - 1; | ||
| 5984 | |||
| 5985 | for ( ; i <= last; i++ ) { | ||
| 5986 | elems = i === last ? this : this.clone(true); | ||
| 5987 | jQuery( insert[i] )[ original ]( elems ); | ||
| 5988 | |||
| 5989 | // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() | ||
| 5990 | push.apply( ret, elems.get() ); | ||
| 5991 | } | ||
| 5992 | |||
| 5993 | return this.pushStack( ret ); | ||
| 5994 | }; | ||
| 5995 | }); | ||
| 5996 | |||
| 5997 | |||
| 5998 | var iframe, | ||
| 5999 | elemdisplay = {}; | ||
| 6000 | |||
| 6001 | /** | ||
| 6002 | * Retrieve the actual display of a element | ||
| 6003 | * @param {String} name nodeName of the element | ||
| 6004 | * @param {Object} doc Document object | ||
| 6005 | */ | ||
| 6006 | // Called only from within defaultDisplay | ||
| 6007 | function actualDisplay( name, doc ) { | ||
| 6008 | var style, | ||
| 6009 | elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), | ||
| 6010 | |||
| 6011 | // getDefaultComputedStyle might be reliably used only on attached element | ||
| 6012 | display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? | ||
| 6013 | |||
| 6014 | // Use of this method is a temporary fix (more like optmization) until something better comes along, | ||
| 6015 | // since it was removed from specification and supported only in FF | ||
| 6016 | style.display : jQuery.css( elem[ 0 ], "display" ); | ||
| 6017 | |||
| 6018 | // We don't have any data stored on the element, | ||
| 6019 | // so use "detach" method as fast way to get rid of the element | ||
| 6020 | elem.detach(); | ||
| 6021 | |||
| 6022 | return display; | ||
| 6023 | } | ||
| 6024 | |||
| 6025 | /** | ||
| 6026 | * Try to determine the default display value of an element | ||
| 6027 | * @param {String} nodeName | ||
| 6028 | */ | ||
| 6029 | function defaultDisplay( nodeName ) { | ||
| 6030 | var doc = document, | ||
| 6031 | display = elemdisplay[ nodeName ]; | ||
| 6032 | |||
| 6033 | if ( !display ) { | ||
| 6034 | display = actualDisplay( nodeName, doc ); | ||
| 6035 | |||
| 6036 | // If the simple way fails, read from inside an iframe | ||
| 6037 | if ( display === "none" || !display ) { | ||
| 6038 | |||
| 6039 | // Use the already-created iframe if possible | ||
| 6040 | iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); | ||
| 6041 | |||
| 6042 | // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse | ||
| 6043 | doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; | ||
| 6044 | |||
| 6045 | // Support: IE | ||
| 6046 | doc.write(); | ||
| 6047 | doc.close(); | ||
| 6048 | |||
| 6049 | display = actualDisplay( nodeName, doc ); | ||
| 6050 | iframe.detach(); | ||
| 6051 | } | ||
| 6052 | |||
| 6053 | // Store the correct default display | ||
| 6054 | elemdisplay[ nodeName ] = display; | ||
| 6055 | } | ||
| 6056 | |||
| 6057 | return display; | ||
| 6058 | } | ||
| 6059 | |||
| 6060 | |||
| 6061 | (function() { | ||
| 6062 | var shrinkWrapBlocksVal; | ||
| 6063 | |||
| 6064 | support.shrinkWrapBlocks = function() { | ||
| 6065 | if ( shrinkWrapBlocksVal != null ) { | ||
| 6066 | return shrinkWrapBlocksVal; | ||
| 6067 | } | ||
| 6068 | |||
| 6069 | // Will be changed later if needed. | ||
| 6070 | shrinkWrapBlocksVal = false; | ||
| 6071 | |||
| 6072 | // Minified: var b,c,d | ||
| 6073 | var div, body, container; | ||
| 6074 | |||
| 6075 | body = document.getElementsByTagName( "body" )[ 0 ]; | ||
| 6076 | if ( !body || !body.style ) { | ||
| 6077 | // Test fired too early or in an unsupported environment, exit. | ||
| 6078 | return; | ||
| 6079 | } | ||
| 6080 | |||
| 6081 | // Setup | ||
| 6082 | div = document.createElement( "div" ); | ||
| 6083 | container = document.createElement( "div" ); | ||
| 6084 | container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; | ||
| 6085 | body.appendChild( container ).appendChild( div ); | ||
| 6086 | |||
| 6087 | // Support: IE6 | ||
| 6088 | // Check if elements with layout shrink-wrap their children | ||
| 6089 | if ( typeof div.style.zoom !== strundefined ) { | ||
| 6090 | // Reset CSS: box-sizing; display; margin; border | ||
| 6091 | div.style.cssText = | ||
| 6092 | // Support: Firefox<29, Android 2.3 | ||
| 6093 | // Vendor-prefix box-sizing | ||
| 6094 | "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + | ||
| 6095 | "box-sizing:content-box;display:block;margin:0;border:0;" + | ||
| 6096 | "padding:1px;width:1px;zoom:1"; | ||
| 6097 | div.appendChild( document.createElement( "div" ) ).style.width = "5px"; | ||
| 6098 | shrinkWrapBlocksVal = div.offsetWidth !== 3; | ||
| 6099 | } | ||
| 6100 | |||
| 6101 | body.removeChild( container ); | ||
| 6102 | |||
| 6103 | return shrinkWrapBlocksVal; | ||
| 6104 | }; | ||
| 6105 | |||
| 6106 | })(); | ||
| 6107 | var rmargin = (/^margin/); | ||
| 6108 | |||
| 6109 | var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); | ||
| 6110 | |||
| 6111 | |||
| 6112 | |||
| 6113 | var getStyles, curCSS, | ||
| 6114 | rposition = /^(top|right|bottom|left)$/; | ||
| 6115 | |||
| 6116 | if ( window.getComputedStyle ) { | ||
| 6117 | getStyles = function( elem ) { | ||
| 6118 | return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); | ||
| 6119 | }; | ||
| 6120 | |||
| 6121 | curCSS = function( elem, name, computed ) { | ||
| 6122 | var width, minWidth, maxWidth, ret, | ||
| 6123 | style = elem.style; | ||
| 6124 | |||
| 6125 | computed = computed || getStyles( elem ); | ||
| 6126 | |||
| 6127 | // getPropertyValue is only needed for .css('filter') in IE9, see #12537 | ||
| 6128 | ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; | ||
| 6129 | |||
| 6130 | if ( computed ) { | ||
| 6131 | |||
| 6132 | if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { | ||
| 6133 | ret = jQuery.style( elem, name ); | ||
| 6134 | } | ||
| 6135 | |||
| 6136 | // A tribute to the "awesome hack by Dean Edwards" | ||
| 6137 | // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right | ||
| 6138 | // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels | ||
| 6139 | // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values | ||
| 6140 | if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { | ||
| 6141 | |||
| 6142 | // Remember the original values | ||
| 6143 | width = style.width; | ||
| 6144 | minWidth = style.minWidth; | ||
| 6145 | maxWidth = style.maxWidth; | ||
| 6146 | |||
| 6147 | // Put in the new values to get a computed value out | ||
| 6148 | style.minWidth = style.maxWidth = style.width = ret; | ||
| 6149 | ret = computed.width; | ||
| 6150 | |||
| 6151 | // Revert the changed values | ||
| 6152 | style.width = width; | ||
| 6153 | style.minWidth = minWidth; | ||
| 6154 | style.maxWidth = maxWidth; | ||
| 6155 | } | ||
| 6156 | } | ||
| 6157 | |||
| 6158 | // Support: IE | ||
| 6159 | // IE returns zIndex value as an integer. | ||
| 6160 | return ret === undefined ? | ||
| 6161 | ret : | ||
| 6162 | ret + ""; | ||
| 6163 | }; | ||
| 6164 | } else if ( document.documentElement.currentStyle ) { | ||
| 6165 | getStyles = function( elem ) { | ||
| 6166 | return elem.currentStyle; | ||
| 6167 | }; | ||
| 6168 | |||
| 6169 | curCSS = function( elem, name, computed ) { | ||
| 6170 | var left, rs, rsLeft, ret, | ||
| 6171 | style = elem.style; | ||
| 6172 | |||
| 6173 | computed = computed || getStyles( elem ); | ||
| 6174 | ret = computed ? computed[ name ] : undefined; | ||
| 6175 | |||
| 6176 | // Avoid setting ret to empty string here | ||
| 6177 | // so we don't default to auto | ||
| 6178 | if ( ret == null && style && style[ name ] ) { | ||
| 6179 | ret = style[ name ]; | ||
| 6180 | } | ||
| 6181 | |||
| 6182 | // From the awesome hack by Dean Edwards | ||
| 6183 | // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 | ||
| 6184 | |||
| 6185 | // If we're not dealing with a regular pixel number | ||
| 6186 | // but a number that has a weird ending, we need to convert it to pixels | ||
| 6187 | // but not position css attributes, as those are proportional to the parent element instead | ||
| 6188 | // and we can't measure the parent instead because it might trigger a "stacking dolls" problem | ||
| 6189 | if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { | ||
| 6190 | |||
| 6191 | // Remember the original values | ||
| 6192 | left = style.left; | ||
| 6193 | rs = elem.runtimeStyle; | ||
| 6194 | rsLeft = rs && rs.left; | ||
| 6195 | |||
| 6196 | // Put in the new values to get a computed value out | ||
| 6197 | if ( rsLeft ) { | ||
| 6198 | rs.left = elem.currentStyle.left; | ||
| 6199 | } | ||
| 6200 | style.left = name === "fontSize" ? "1em" : ret; | ||
| 6201 | ret = style.pixelLeft + "px"; | ||
| 6202 | |||
| 6203 | // Revert the changed values | ||
| 6204 | style.left = left; | ||
| 6205 | if ( rsLeft ) { | ||
| 6206 | rs.left = rsLeft; | ||
| 6207 | } | ||
| 6208 | } | ||
| 6209 | |||
| 6210 | // Support: IE | ||
| 6211 | // IE returns zIndex value as an integer. | ||
| 6212 | return ret === undefined ? | ||
| 6213 | ret : | ||
| 6214 | ret + "" || "auto"; | ||
| 6215 | }; | ||
| 6216 | } | ||
| 6217 | |||
| 6218 | |||
| 6219 | |||
| 6220 | |||
| 6221 | function addGetHookIf( conditionFn, hookFn ) { | ||
| 6222 | // Define the hook, we'll check on the first run if it's really needed. | ||
| 6223 | return { | ||
| 6224 | get: function() { | ||
| 6225 | var condition = conditionFn(); | ||
| 6226 | |||
| 6227 | if ( condition == null ) { | ||
| 6228 | // The test was not ready at this point; screw the hook this time | ||
| 6229 | // but check again when needed next time. | ||
| 6230 | return; | ||
| 6231 | } | ||
| 6232 | |||
| 6233 | if ( condition ) { | ||
| 6234 | // Hook not needed (or it's not possible to use it due to missing dependency), | ||
| 6235 | // remove it. | ||
| 6236 | // Since there are no other hooks for marginRight, remove the whole object. | ||
| 6237 | delete this.get; | ||
| 6238 | return; | ||
| 6239 | } | ||
| 6240 | |||
| 6241 | // Hook needed; redefine it so that the support test is not executed again. | ||
| 6242 | |||
| 6243 | return (this.get = hookFn).apply( this, arguments ); | ||
| 6244 | } | ||
| 6245 | }; | ||
| 6246 | } | ||
| 6247 | |||
| 6248 | |||
| 6249 | (function() { | ||
| 6250 | // Minified: var b,c,d,e,f,g, h,i | ||
| 6251 | var div, style, a, pixelPositionVal, boxSizingReliableVal, | ||
| 6252 | reliableHiddenOffsetsVal, reliableMarginRightVal; | ||
| 6253 | |||
| 6254 | // Setup | ||
| 6255 | div = document.createElement( "div" ); | ||
| 6256 | div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; | ||
| 6257 | a = div.getElementsByTagName( "a" )[ 0 ]; | ||
| 6258 | style = a && a.style; | ||
| 6259 | |||
| 6260 | // Finish early in limited (non-browser) environments | ||
| 6261 | if ( !style ) { | ||
| 6262 | return; | ||
| 6263 | } | ||
| 6264 | |||
| 6265 | style.cssText = "float:left;opacity:.5"; | ||
| 6266 | |||
| 6267 | // Support: IE<9 | ||
| 6268 | // Make sure that element opacity exists (as opposed to filter) | ||
| 6269 | support.opacity = style.opacity === "0.5"; | ||
| 6270 | |||
| 6271 | // Verify style float existence | ||
| 6272 | // (IE uses styleFloat instead of cssFloat) | ||
| 6273 | support.cssFloat = !!style.cssFloat; | ||
| 6274 | |||
| 6275 | div.style.backgroundClip = "content-box"; | ||
| 6276 | div.cloneNode( true ).style.backgroundClip = ""; | ||
| 6277 | support.clearCloneStyle = div.style.backgroundClip === "content-box"; | ||
| 6278 | |||
| 6279 | // Support: Firefox<29, Android 2.3 | ||
| 6280 | // Vendor-prefix box-sizing | ||
| 6281 | support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || | ||
| 6282 | style.WebkitBoxSizing === ""; | ||
| 6283 | |||
| 6284 | jQuery.extend(support, { | ||
| 6285 | reliableHiddenOffsets: function() { | ||
| 6286 | if ( reliableHiddenOffsetsVal == null ) { | ||
| 6287 | computeStyleTests(); | ||
| 6288 | } | ||
| 6289 | return reliableHiddenOffsetsVal; | ||
| 6290 | }, | ||
| 6291 | |||
| 6292 | boxSizingReliable: function() { | ||
| 6293 | if ( boxSizingReliableVal == null ) { | ||
| 6294 | computeStyleTests(); | ||
| 6295 | } | ||
| 6296 | return boxSizingReliableVal; | ||
| 6297 | }, | ||
| 6298 | |||
| 6299 | pixelPosition: function() { | ||
| 6300 | if ( pixelPositionVal == null ) { | ||
| 6301 | computeStyleTests(); | ||
| 6302 | } | ||
| 6303 | return pixelPositionVal; | ||
| 6304 | }, | ||
| 6305 | |||
| 6306 | // Support: Android 2.3 | ||
| 6307 | reliableMarginRight: function() { | ||
| 6308 | if ( reliableMarginRightVal == null ) { | ||
| 6309 | computeStyleTests(); | ||
| 6310 | } | ||
| 6311 | return reliableMarginRightVal; | ||
| 6312 | } | ||
| 6313 | }); | ||
| 6314 | |||
| 6315 | function computeStyleTests() { | ||
| 6316 | // Minified: var b,c,d,j | ||
| 6317 | var div, body, container, contents; | ||
| 6318 | |||
| 6319 | body = document.getElementsByTagName( "body" )[ 0 ]; | ||
| 6320 | if ( !body || !body.style ) { | ||
| 6321 | // Test fired too early or in an unsupported environment, exit. | ||
| 6322 | return; | ||
| 6323 | } | ||
| 6324 | |||
| 6325 | // Setup | ||
| 6326 | div = document.createElement( "div" ); | ||
| 6327 | container = document.createElement( "div" ); | ||
| 6328 | container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; | ||
| 6329 | body.appendChild( container ).appendChild( div ); | ||
| 6330 | |||
| 6331 | div.style.cssText = | ||
| 6332 | // Support: Firefox<29, Android 2.3 | ||
| 6333 | // Vendor-prefix box-sizing | ||
| 6334 | "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + | ||
| 6335 | "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + | ||
| 6336 | "border:1px;padding:1px;width:4px;position:absolute"; | ||
| 6337 | |||
| 6338 | // Support: IE<9 | ||
| 6339 | // Assume reasonable values in the absence of getComputedStyle | ||
| 6340 | pixelPositionVal = boxSizingReliableVal = false; | ||
| 6341 | reliableMarginRightVal = true; | ||
| 6342 | |||
| 6343 | // Check for getComputedStyle so that this code is not run in IE<9. | ||
| 6344 | if ( window.getComputedStyle ) { | ||
| 6345 | pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; | ||
| 6346 | boxSizingReliableVal = | ||
| 6347 | ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; | ||
| 6348 | |||
| 6349 | // Support: Android 2.3 | ||
| 6350 | // Div with explicit width and no margin-right incorrectly | ||
| 6351 | // gets computed margin-right based on width of container (#3333) | ||
| 6352 | // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right | ||
| 6353 | contents = div.appendChild( document.createElement( "div" ) ); | ||
| 6354 | |||
| 6355 | // Reset CSS: box-sizing; display; margin; border; padding | ||
| 6356 | contents.style.cssText = div.style.cssText = | ||
| 6357 | // Support: Firefox<29, Android 2.3 | ||
| 6358 | // Vendor-prefix box-sizing | ||
| 6359 | "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + | ||
| 6360 | "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; | ||
| 6361 | contents.style.marginRight = contents.style.width = "0"; | ||
| 6362 | div.style.width = "1px"; | ||
| 6363 | |||
| 6364 | reliableMarginRightVal = | ||
| 6365 | !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight ); | ||
| 6366 | } | ||
| 6367 | |||
| 6368 | // Support: IE8 | ||
| 6369 | // Check if table cells still have offsetWidth/Height when they are set | ||
| 6370 | // to display:none and there are still other visible table cells in a | ||
| 6371 | // table row; if so, offsetWidth/Height are not reliable for use when | ||
| 6372 | // determining if an element has been hidden directly using | ||
| 6373 | // display:none (it is still safe to use offsets if a parent element is | ||
| 6374 | // hidden; don safety goggles and see bug #4512 for more information). | ||
| 6375 | div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; | ||
| 6376 | contents = div.getElementsByTagName( "td" ); | ||
| 6377 | contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; | ||
| 6378 | reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; | ||
| 6379 | if ( reliableHiddenOffsetsVal ) { | ||
| 6380 | contents[ 0 ].style.display = ""; | ||
| 6381 | contents[ 1 ].style.display = "none"; | ||
| 6382 | reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; | ||
| 6383 | } | ||
| 6384 | |||
| 6385 | body.removeChild( container ); | ||
| 6386 | } | ||
| 6387 | |||
| 6388 | })(); | ||
| 6389 | |||
| 6390 | |||
| 6391 | // A method for quickly swapping in/out CSS properties to get correct calculations. | ||
| 6392 | jQuery.swap = function( elem, options, callback, args ) { | ||
| 6393 | var ret, name, | ||
| 6394 | old = {}; | ||
| 6395 | |||
| 6396 | // Remember the old values, and insert the new ones | ||
| 6397 | for ( name in options ) { | ||
| 6398 | old[ name ] = elem.style[ name ]; | ||
| 6399 | elem.style[ name ] = options[ name ]; | ||
| 6400 | } | ||
| 6401 | |||
| 6402 | ret = callback.apply( elem, args || [] ); | ||
| 6403 | |||
| 6404 | // Revert the old values | ||
| 6405 | for ( name in options ) { | ||
| 6406 | elem.style[ name ] = old[ name ]; | ||
| 6407 | } | ||
| 6408 | |||
| 6409 | return ret; | ||
| 6410 | }; | ||
| 6411 | |||
| 6412 | |||
| 6413 | var | ||
| 6414 | ralpha = /alpha\([^)]*\)/i, | ||
| 6415 | ropacity = /opacity\s*=\s*([^)]*)/, | ||
| 6416 | |||
| 6417 | // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" | ||
| 6418 | // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display | ||
| 6419 | rdisplayswap = /^(none|table(?!-c[ea]).+)/, | ||
| 6420 | rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), | ||
| 6421 | rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ), | ||
| 6422 | |||
| 6423 | cssShow = { position: "absolute", visibility: "hidden", display: "block" }, | ||
| 6424 | cssNormalTransform = { | ||
| 6425 | letterSpacing: "0", | ||
| 6426 | fontWeight: "400" | ||
| 6427 | }, | ||
| 6428 | |||
| 6429 | cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; | ||
| 6430 | |||
| 6431 | |||
| 6432 | // return a css property mapped to a potentially vendor prefixed property | ||
| 6433 | function vendorPropName( style, name ) { | ||
| 6434 | |||
| 6435 | // shortcut for names that are not vendor prefixed | ||
| 6436 | if ( name in style ) { | ||
| 6437 | return name; | ||
| 6438 | } | ||
| 6439 | |||
| 6440 | // check for vendor prefixed names | ||
| 6441 | var capName = name.charAt(0).toUpperCase() + name.slice(1), | ||
| 6442 | origName = name, | ||
| 6443 | i = cssPrefixes.length; | ||
| 6444 | |||
| 6445 | while ( i-- ) { | ||
| 6446 | name = cssPrefixes[ i ] + capName; | ||
| 6447 | if ( name in style ) { | ||
| 6448 | return name; | ||
| 6449 | } | ||
| 6450 | } | ||
| 6451 | |||
| 6452 | return origName; | ||
| 6453 | } | ||
| 6454 | |||
| 6455 | function showHide( elements, show ) { | ||
| 6456 | var display, elem, hidden, | ||
| 6457 | values = [], | ||
| 6458 | index = 0, | ||
| 6459 | length = elements.length; | ||
| 6460 | |||
| 6461 | for ( ; index < length; index++ ) { | ||
| 6462 | elem = elements[ index ]; | ||
| 6463 | if ( !elem.style ) { | ||
| 6464 | continue; | ||
| 6465 | } | ||
| 6466 | |||
| 6467 | values[ index ] = jQuery._data( elem, "olddisplay" ); | ||
| 6468 | display = elem.style.display; | ||
| 6469 | if ( show ) { | ||
| 6470 | // Reset the inline display of this element to learn if it is | ||
| 6471 | // being hidden by cascaded rules or not | ||
| 6472 | if ( !values[ index ] && display === "none" ) { | ||
| 6473 | elem.style.display = ""; | ||
| 6474 | } | ||
| 6475 | |||
| 6476 | // Set elements which have been overridden with display: none | ||
| 6477 | // in a stylesheet to whatever the default browser style is | ||
| 6478 | // for such an element | ||
| 6479 | if ( elem.style.display === "" && isHidden( elem ) ) { | ||
| 6480 | values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); | ||
| 6481 | } | ||
| 6482 | } else { | ||
| 6483 | hidden = isHidden( elem ); | ||
| 6484 | |||
| 6485 | if ( display && display !== "none" || !hidden ) { | ||
| 6486 | jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); | ||
| 6487 | } | ||
| 6488 | } | ||
| 6489 | } | ||
| 6490 | |||
| 6491 | // Set the display of most of the elements in a second loop | ||
| 6492 | // to avoid the constant reflow | ||
| 6493 | for ( index = 0; index < length; index++ ) { | ||
| 6494 | elem = elements[ index ]; | ||
| 6495 | if ( !elem.style ) { | ||
| 6496 | continue; | ||
| 6497 | } | ||
| 6498 | if ( !show || elem.style.display === "none" || elem.style.display === "" ) { | ||
| 6499 | elem.style.display = show ? values[ index ] || "" : "none"; | ||
| 6500 | } | ||
| 6501 | } | ||
| 6502 | |||
| 6503 | return elements; | ||
| 6504 | } | ||
| 6505 | |||
| 6506 | function setPositiveNumber( elem, value, subtract ) { | ||
| 6507 | var matches = rnumsplit.exec( value ); | ||
| 6508 | return matches ? | ||
| 6509 | // Guard against undefined "subtract", e.g., when used as in cssHooks | ||
| 6510 | Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : | ||
| 6511 | value; | ||
| 6512 | } | ||
| 6513 | |||
| 6514 | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { | ||
| 6515 | var i = extra === ( isBorderBox ? "border" : "content" ) ? | ||
| 6516 | // If we already have the right measurement, avoid augmentation | ||
| 6517 | 4 : | ||
| 6518 | // Otherwise initialize for horizontal or vertical properties | ||
| 6519 | name === "width" ? 1 : 0, | ||
| 6520 | |||
| 6521 | val = 0; | ||
| 6522 | |||
| 6523 | for ( ; i < 4; i += 2 ) { | ||
| 6524 | // both box models exclude margin, so add it if we want it | ||
| 6525 | if ( extra === "margin" ) { | ||
| 6526 | val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); | ||
| 6527 | } | ||
| 6528 | |||
| 6529 | if ( isBorderBox ) { | ||
| 6530 | // border-box includes padding, so remove it if we want content | ||
| 6531 | if ( extra === "content" ) { | ||
| 6532 | val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); | ||
| 6533 | } | ||
| 6534 | |||
| 6535 | // at this point, extra isn't border nor margin, so remove border | ||
| 6536 | if ( extra !== "margin" ) { | ||
| 6537 | val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); | ||
| 6538 | } | ||
| 6539 | } else { | ||
| 6540 | // at this point, extra isn't content, so add padding | ||
| 6541 | val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); | ||
| 6542 | |||
| 6543 | // at this point, extra isn't content nor padding, so add border | ||
| 6544 | if ( extra !== "padding" ) { | ||
| 6545 | val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); | ||
| 6546 | } | ||
| 6547 | } | ||
| 6548 | } | ||
| 6549 | |||
| 6550 | return val; | ||
| 6551 | } | ||
| 6552 | |||
| 6553 | function getWidthOrHeight( elem, name, extra ) { | ||
| 6554 | |||
| 6555 | // Start with offset property, which is equivalent to the border-box value | ||
| 6556 | var valueIsBorderBox = true, | ||
| 6557 | val = name === "width" ? elem.offsetWidth : elem.offsetHeight, | ||
| 6558 | styles = getStyles( elem ), | ||
| 6559 | isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; | ||
| 6560 | |||
| 6561 | // some non-html elements return undefined for offsetWidth, so check for null/undefined | ||
| 6562 | // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 | ||
| 6563 | // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 | ||
| 6564 | if ( val <= 0 || val == null ) { | ||
| 6565 | // Fall back to computed then uncomputed css if necessary | ||
| 6566 | val = curCSS( elem, name, styles ); | ||
| 6567 | if ( val < 0 || val == null ) { | ||
| 6568 | val = elem.style[ name ]; | ||
| 6569 | } | ||
| 6570 | |||
| 6571 | // Computed unit is not pixels. Stop here and return. | ||
| 6572 | if ( rnumnonpx.test(val) ) { | ||
| 6573 | return val; | ||
| 6574 | } | ||
| 6575 | |||
| 6576 | // we need the check for style in case a browser which returns unreliable values | ||
| 6577 | // for getComputedStyle silently falls back to the reliable elem.style | ||
| 6578 | valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); | ||
| 6579 | |||
| 6580 | // Normalize "", auto, and prepare for extra | ||
| 6581 | val = parseFloat( val ) || 0; | ||
| 6582 | } | ||
| 6583 | |||
| 6584 | // use the active box-sizing model to add/subtract irrelevant styles | ||
| 6585 | return ( val + | ||
| 6586 | augmentWidthOrHeight( | ||
| 6587 | elem, | ||
| 6588 | name, | ||
| 6589 | extra || ( isBorderBox ? "border" : "content" ), | ||
| 6590 | valueIsBorderBox, | ||
| 6591 | styles | ||
| 6592 | ) | ||
| 6593 | ) + "px"; | ||
| 6594 | } | ||
| 6595 | |||
| 6596 | jQuery.extend({ | ||
| 6597 | // Add in style property hooks for overriding the default | ||
| 6598 | // behavior of getting and setting a style property | ||
| 6599 | cssHooks: { | ||
| 6600 | opacity: { | ||
| 6601 | get: function( elem, computed ) { | ||
| 6602 | if ( computed ) { | ||
| 6603 | // We should always get a number back from opacity | ||
| 6604 | var ret = curCSS( elem, "opacity" ); | ||
| 6605 | return ret === "" ? "1" : ret; | ||
| 6606 | } | ||
| 6607 | } | ||
| 6608 | } | ||
| 6609 | }, | ||
| 6610 | |||
| 6611 | // Don't automatically add "px" to these possibly-unitless properties | ||
| 6612 | cssNumber: { | ||
| 6613 | "columnCount": true, | ||
| 6614 | "fillOpacity": true, | ||
| 6615 | "flexGrow": true, | ||
| 6616 | "flexShrink": true, | ||
| 6617 | "fontWeight": true, | ||
| 6618 | "lineHeight": true, | ||
| 6619 | "opacity": true, | ||
| 6620 | "order": true, | ||
| 6621 | "orphans": true, | ||
| 6622 | "widows": true, | ||
| 6623 | "zIndex": true, | ||
| 6624 | "zoom": true | ||
| 6625 | }, | ||
| 6626 | |||
| 6627 | // Add in properties whose names you wish to fix before | ||
| 6628 | // setting or getting the value | ||
| 6629 | cssProps: { | ||
| 6630 | // normalize float css property | ||
| 6631 | "float": support.cssFloat ? "cssFloat" : "styleFloat" | ||
| 6632 | }, | ||
| 6633 | |||
| 6634 | // Get and set the style property on a DOM Node | ||
| 6635 | style: function( elem, name, value, extra ) { | ||
| 6636 | // Don't set styles on text and comment nodes | ||
| 6637 | if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { | ||
| 6638 | return; | ||
| 6639 | } | ||
| 6640 | |||
| 6641 | // Make sure that we're working with the right name | ||
| 6642 | var ret, type, hooks, | ||
| 6643 | origName = jQuery.camelCase( name ), | ||
| 6644 | style = elem.style; | ||
| 6645 | |||
| 6646 | name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); | ||
| 6647 | |||
| 6648 | // gets hook for the prefixed version | ||
| 6649 | // followed by the unprefixed version | ||
| 6650 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; | ||
| 6651 | |||
| 6652 | // Check if we're setting a value | ||
| 6653 | if ( value !== undefined ) { | ||
| 6654 | type = typeof value; | ||
| 6655 | |||
| 6656 | // convert relative number strings (+= or -=) to relative numbers. #7345 | ||
| 6657 | if ( type === "string" && (ret = rrelNum.exec( value )) ) { | ||
| 6658 | value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); | ||
| 6659 | // Fixes bug #9237 | ||
| 6660 | type = "number"; | ||
| 6661 | } | ||
| 6662 | |||
| 6663 | // Make sure that null and NaN values aren't set. See: #7116 | ||
| 6664 | if ( value == null || value !== value ) { | ||
| 6665 | return; | ||
| 6666 | } | ||
| 6667 | |||
| 6668 | // If a number was passed in, add 'px' to the (except for certain CSS properties) | ||
| 6669 | if ( type === "number" && !jQuery.cssNumber[ origName ] ) { | ||
| 6670 | value += "px"; | ||
| 6671 | } | ||
| 6672 | |||
| 6673 | // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, | ||
| 6674 | // but it would mean to define eight (for every problematic property) identical functions | ||
| 6675 | if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { | ||
| 6676 | style[ name ] = "inherit"; | ||
| 6677 | } | ||
| 6678 | |||
| 6679 | // If a hook was provided, use that value, otherwise just set the specified value | ||
| 6680 | if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { | ||
| 6681 | |||
| 6682 | // Support: IE | ||
| 6683 | // Swallow errors from 'invalid' CSS values (#5509) | ||
| 6684 | try { | ||
| 6685 | style[ name ] = value; | ||
| 6686 | } catch(e) {} | ||
| 6687 | } | ||
| 6688 | |||
| 6689 | } else { | ||
| 6690 | // If a hook was provided get the non-computed value from there | ||
| 6691 | if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { | ||
| 6692 | return ret; | ||
| 6693 | } | ||
| 6694 | |||
| 6695 | // Otherwise just get the value from the style object | ||
| 6696 | return style[ name ]; | ||
| 6697 | } | ||
| 6698 | }, | ||
| 6699 | |||
| 6700 | css: function( elem, name, extra, styles ) { | ||
| 6701 | var num, val, hooks, | ||
| 6702 | origName = jQuery.camelCase( name ); | ||
| 6703 | |||
| 6704 | // Make sure that we're working with the right name | ||
| 6705 | name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); | ||
| 6706 | |||
| 6707 | // gets hook for the prefixed version | ||
| 6708 | // followed by the unprefixed version | ||
| 6709 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; | ||
| 6710 | |||
| 6711 | // If a hook was provided get the computed value from there | ||
| 6712 | if ( hooks && "get" in hooks ) { | ||
| 6713 | val = hooks.get( elem, true, extra ); | ||
| 6714 | } | ||
| 6715 | |||
| 6716 | // Otherwise, if a way to get the computed value exists, use that | ||
| 6717 | if ( val === undefined ) { | ||
| 6718 | val = curCSS( elem, name, styles ); | ||
| 6719 | } | ||
| 6720 | |||
| 6721 | //convert "normal" to computed value | ||
| 6722 | if ( val === "normal" && name in cssNormalTransform ) { | ||
| 6723 | val = cssNormalTransform[ name ]; | ||
| 6724 | } | ||
| 6725 | |||
| 6726 | // Return, converting to number if forced or a qualifier was provided and val looks numeric | ||
| 6727 | if ( extra === "" || extra ) { | ||
| 6728 | num = parseFloat( val ); | ||
| 6729 | return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; | ||
| 6730 | } | ||
| 6731 | return val; | ||
| 6732 | } | ||
| 6733 | }); | ||
| 6734 | |||
| 6735 | jQuery.each([ "height", "width" ], function( i, name ) { | ||
| 6736 | jQuery.cssHooks[ name ] = { | ||
| 6737 | get: function( elem, computed, extra ) { | ||
| 6738 | if ( computed ) { | ||
| 6739 | // certain elements can have dimension info if we invisibly show them | ||
| 6740 | // however, it must have a current display style that would benefit from this | ||
| 6741 | return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? | ||
| 6742 | jQuery.swap( elem, cssShow, function() { | ||
| 6743 | return getWidthOrHeight( elem, name, extra ); | ||
| 6744 | }) : | ||
| 6745 | getWidthOrHeight( elem, name, extra ); | ||
| 6746 | } | ||
| 6747 | }, | ||
| 6748 | |||
| 6749 | set: function( elem, value, extra ) { | ||
| 6750 | var styles = extra && getStyles( elem ); | ||
| 6751 | return setPositiveNumber( elem, value, extra ? | ||
| 6752 | augmentWidthOrHeight( | ||
| 6753 | elem, | ||
| 6754 | name, | ||
| 6755 | extra, | ||
| 6756 | support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", | ||
| 6757 | styles | ||
| 6758 | ) : 0 | ||
| 6759 | ); | ||
| 6760 | } | ||
| 6761 | }; | ||
| 6762 | }); | ||
| 6763 | |||
| 6764 | if ( !support.opacity ) { | ||
| 6765 | jQuery.cssHooks.opacity = { | ||
| 6766 | get: function( elem, computed ) { | ||
| 6767 | // IE uses filters for opacity | ||
| 6768 | return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? | ||
| 6769 | ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : | ||
| 6770 | computed ? "1" : ""; | ||
| 6771 | }, | ||
| 6772 | |||
| 6773 | set: function( elem, value ) { | ||
| 6774 | var style = elem.style, | ||
| 6775 | currentStyle = elem.currentStyle, | ||
| 6776 | opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", | ||
| 6777 | filter = currentStyle && currentStyle.filter || style.filter || ""; | ||
| 6778 | |||
| 6779 | // IE has trouble with opacity if it does not have layout | ||
| 6780 | // Force it by setting the zoom level | ||
| 6781 | style.zoom = 1; | ||
| 6782 | |||
| 6783 | // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 | ||
| 6784 | // if value === "", then remove inline opacity #12685 | ||
| 6785 | if ( ( value >= 1 || value === "" ) && | ||
| 6786 | jQuery.trim( filter.replace( ralpha, "" ) ) === "" && | ||
| 6787 | style.removeAttribute ) { | ||
| 6788 | |||
| 6789 | // Setting style.filter to null, "" & " " still leave "filter:" in the cssText | ||
| 6790 | // if "filter:" is present at all, clearType is disabled, we want to avoid this | ||
| 6791 | // style.removeAttribute is IE Only, but so apparently is this code path... | ||
| 6792 | style.removeAttribute( "filter" ); | ||
| 6793 | |||
| 6794 | // if there is no filter style applied in a css rule or unset inline opacity, we are done | ||
| 6795 | if ( value === "" || currentStyle && !currentStyle.filter ) { | ||
| 6796 | return; | ||
| 6797 | } | ||
| 6798 | } | ||
| 6799 | |||
| 6800 | // otherwise, set new filter values | ||
| 6801 | style.filter = ralpha.test( filter ) ? | ||
| 6802 | filter.replace( ralpha, opacity ) : | ||
| 6803 | filter + " " + opacity; | ||
| 6804 | } | ||
| 6805 | }; | ||
| 6806 | } | ||
| 6807 | |||
| 6808 | jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, | ||
| 6809 | function( elem, computed ) { | ||
| 6810 | if ( computed ) { | ||
| 6811 | // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right | ||
| 6812 | // Work around by temporarily setting element display to inline-block | ||
| 6813 | return jQuery.swap( elem, { "display": "inline-block" }, | ||
| 6814 | curCSS, [ elem, "marginRight" ] ); | ||
| 6815 | } | ||
| 6816 | } | ||
| 6817 | ); | ||
| 6818 | |||
| 6819 | // These hooks are used by animate to expand properties | ||
| 6820 | jQuery.each({ | ||
| 6821 | margin: "", | ||
| 6822 | padding: "", | ||
| 6823 | border: "Width" | ||
| 6824 | }, function( prefix, suffix ) { | ||
| 6825 | jQuery.cssHooks[ prefix + suffix ] = { | ||
| 6826 | expand: function( value ) { | ||
| 6827 | var i = 0, | ||
| 6828 | expanded = {}, | ||
| 6829 | |||
| 6830 | // assumes a single number if not a string | ||
| 6831 | parts = typeof value === "string" ? value.split(" ") : [ value ]; | ||
| 6832 | |||
| 6833 | for ( ; i < 4; i++ ) { | ||
| 6834 | expanded[ prefix + cssExpand[ i ] + suffix ] = | ||
| 6835 | parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; | ||
| 6836 | } | ||
| 6837 | |||
| 6838 | return expanded; | ||
| 6839 | } | ||
| 6840 | }; | ||
| 6841 | |||
| 6842 | if ( !rmargin.test( prefix ) ) { | ||
| 6843 | jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; | ||
| 6844 | } | ||
| 6845 | }); | ||
| 6846 | |||
| 6847 | jQuery.fn.extend({ | ||
| 6848 | css: function( name, value ) { | ||
| 6849 | return access( this, function( elem, name, value ) { | ||
| 6850 | var styles, len, | ||
| 6851 | map = {}, | ||
| 6852 | i = 0; | ||
| 6853 | |||
| 6854 | if ( jQuery.isArray( name ) ) { | ||
| 6855 | styles = getStyles( elem ); | ||
| 6856 | len = name.length; | ||
| 6857 | |||
| 6858 | for ( ; i < len; i++ ) { | ||
| 6859 | map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); | ||
| 6860 | } | ||
| 6861 | |||
| 6862 | return map; | ||
| 6863 | } | ||
| 6864 | |||
| 6865 | return value !== undefined ? | ||
| 6866 | jQuery.style( elem, name, value ) : | ||
| 6867 | jQuery.css( elem, name ); | ||
| 6868 | }, name, value, arguments.length > 1 ); | ||
| 6869 | }, | ||
| 6870 | show: function() { | ||
| 6871 | return showHide( this, true ); | ||
| 6872 | }, | ||
| 6873 | hide: function() { | ||
| 6874 | return showHide( this ); | ||
| 6875 | }, | ||
| 6876 | toggle: function( state ) { | ||
| 6877 | if ( typeof state === "boolean" ) { | ||
| 6878 | return state ? this.show() : this.hide(); | ||
| 6879 | } | ||
| 6880 | |||
| 6881 | return this.each(function() { | ||
| 6882 | if ( isHidden( this ) ) { | ||
| 6883 | jQuery( this ).show(); | ||
| 6884 | } else { | ||
| 6885 | jQuery( this ).hide(); | ||
| 6886 | } | ||
| 6887 | }); | ||
| 6888 | } | ||
| 6889 | }); | ||
| 6890 | |||
| 6891 | |||
| 6892 | function Tween( elem, options, prop, end, easing ) { | ||
| 6893 | return new Tween.prototype.init( elem, options, prop, end, easing ); | ||
| 6894 | } | ||
| 6895 | jQuery.Tween = Tween; | ||
| 6896 | |||
| 6897 | Tween.prototype = { | ||
| 6898 | constructor: Tween, | ||
| 6899 | init: function( elem, options, prop, end, easing, unit ) { | ||
| 6900 | this.elem = elem; | ||
| 6901 | this.prop = prop; | ||
| 6902 | this.easing = easing || "swing"; | ||
| 6903 | this.options = options; | ||
| 6904 | this.start = this.now = this.cur(); | ||
| 6905 | this.end = end; | ||
| 6906 | this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); | ||
| 6907 | }, | ||
| 6908 | cur: function() { | ||
| 6909 | var hooks = Tween.propHooks[ this.prop ]; | ||
| 6910 | |||
| 6911 | return hooks && hooks.get ? | ||
| 6912 | hooks.get( this ) : | ||
| 6913 | Tween.propHooks._default.get( this ); | ||
| 6914 | }, | ||
| 6915 | run: function( percent ) { | ||
| 6916 | var eased, | ||
| 6917 | hooks = Tween.propHooks[ this.prop ]; | ||
| 6918 | |||
| 6919 | if ( this.options.duration ) { | ||
| 6920 | this.pos = eased = jQuery.easing[ this.easing ]( | ||
| 6921 | percent, this.options.duration * percent, 0, 1, this.options.duration | ||
| 6922 | ); | ||
| 6923 | } else { | ||
| 6924 | this.pos = eased = percent; | ||
| 6925 | } | ||
| 6926 | this.now = ( this.end - this.start ) * eased + this.start; | ||
| 6927 | |||
| 6928 | if ( this.options.step ) { | ||
| 6929 | this.options.step.call( this.elem, this.now, this ); | ||
| 6930 | } | ||
| 6931 | |||
| 6932 | if ( hooks && hooks.set ) { | ||
| 6933 | hooks.set( this ); | ||
| 6934 | } else { | ||
| 6935 | Tween.propHooks._default.set( this ); | ||
| 6936 | } | ||
| 6937 | return this; | ||
| 6938 | } | ||
| 6939 | }; | ||
| 6940 | |||
| 6941 | Tween.prototype.init.prototype = Tween.prototype; | ||
| 6942 | |||
| 6943 | Tween.propHooks = { | ||
| 6944 | _default: { | ||
| 6945 | get: function( tween ) { | ||
| 6946 | var result; | ||
| 6947 | |||
| 6948 | if ( tween.elem[ tween.prop ] != null && | ||
| 6949 | (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { | ||
| 6950 | return tween.elem[ tween.prop ]; | ||
| 6951 | } | ||
| 6952 | |||
| 6953 | // passing an empty string as a 3rd parameter to .css will automatically | ||
| 6954 | // attempt a parseFloat and fallback to a string if the parse fails | ||
| 6955 | // so, simple values such as "10px" are parsed to Float. | ||
| 6956 | // complex values such as "rotate(1rad)" are returned as is. | ||
| 6957 | result = jQuery.css( tween.elem, tween.prop, "" ); | ||
| 6958 | // Empty strings, null, undefined and "auto" are converted to 0. | ||
| 6959 | return !result || result === "auto" ? 0 : result; | ||
| 6960 | }, | ||
| 6961 | set: function( tween ) { | ||
| 6962 | // use step hook for back compat - use cssHook if its there - use .style if its | ||
| 6963 | // available and use plain properties where available | ||
| 6964 | if ( jQuery.fx.step[ tween.prop ] ) { | ||
| 6965 | jQuery.fx.step[ tween.prop ]( tween ); | ||
| 6966 | } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { | ||
| 6967 | jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); | ||
| 6968 | } else { | ||
| 6969 | tween.elem[ tween.prop ] = tween.now; | ||
| 6970 | } | ||
| 6971 | } | ||
| 6972 | } | ||
| 6973 | }; | ||
| 6974 | |||
| 6975 | // Support: IE <=9 | ||
| 6976 | // Panic based approach to setting things on disconnected nodes | ||
| 6977 | |||
| 6978 | Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { | ||
| 6979 | set: function( tween ) { | ||
| 6980 | if ( tween.elem.nodeType && tween.elem.parentNode ) { | ||
| 6981 | tween.elem[ tween.prop ] = tween.now; | ||
| 6982 | } | ||
| 6983 | } | ||
| 6984 | }; | ||
| 6985 | |||
| 6986 | jQuery.easing = { | ||
| 6987 | linear: function( p ) { | ||
| 6988 | return p; | ||
| 6989 | }, | ||
| 6990 | swing: function( p ) { | ||
| 6991 | return 0.5 - Math.cos( p * Math.PI ) / 2; | ||
| 6992 | } | ||
| 6993 | }; | ||
| 6994 | |||
| 6995 | jQuery.fx = Tween.prototype.init; | ||
| 6996 | |||
| 6997 | // Back Compat <1.8 extension point | ||
| 6998 | jQuery.fx.step = {}; | ||
| 6999 | |||
| 7000 | |||
| 7001 | |||
| 7002 | |||
| 7003 | var | ||
| 7004 | fxNow, timerId, | ||
| 7005 | rfxtypes = /^(?:toggle|show|hide)$/, | ||
| 7006 | rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ), | ||
| 7007 | rrun = /queueHooks$/, | ||
| 7008 | animationPrefilters = [ defaultPrefilter ], | ||
| 7009 | tweeners = { | ||
| 7010 | "*": [ function( prop, value ) { | ||
| 7011 | var tween = this.createTween( prop, value ), | ||
| 7012 | target = tween.cur(), | ||
| 7013 | parts = rfxnum.exec( value ), | ||
| 7014 | unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), | ||
| 7015 | |||
| 7016 | // Starting value computation is required for potential unit mismatches | ||
| 7017 | start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && | ||
| 7018 | rfxnum.exec( jQuery.css( tween.elem, prop ) ), | ||
| 7019 | scale = 1, | ||
| 7020 | maxIterations = 20; | ||
| 7021 | |||
| 7022 | if ( start && start[ 3 ] !== unit ) { | ||
| 7023 | // Trust units reported by jQuery.css | ||
| 7024 | unit = unit || start[ 3 ]; | ||
| 7025 | |||
| 7026 | // Make sure we update the tween properties later on | ||
| 7027 | parts = parts || []; | ||
| 7028 | |||
| 7029 | // Iteratively approximate from a nonzero starting point | ||
| 7030 | start = +target || 1; | ||
| 7031 | |||
| 7032 | do { | ||
| 7033 | // If previous iteration zeroed out, double until we get *something* | ||
| 7034 | // Use a string for doubling factor so we don't accidentally see scale as unchanged below | ||
| 7035 | scale = scale || ".5"; | ||
| 7036 | |||
| 7037 | // Adjust and apply | ||
| 7038 | start = start / scale; | ||
| 7039 | jQuery.style( tween.elem, prop, start + unit ); | ||
| 7040 | |||
| 7041 | // Update scale, tolerating zero or NaN from tween.cur() | ||
| 7042 | // And breaking the loop if scale is unchanged or perfect, or if we've just had enough | ||
| 7043 | } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); | ||
| 7044 | } | ||
| 7045 | |||
| 7046 | // Update tween properties | ||
| 7047 | if ( parts ) { | ||
| 7048 | start = tween.start = +start || +target || 0; | ||
| 7049 | tween.unit = unit; | ||
| 7050 | // If a +=/-= token was provided, we're doing a relative animation | ||
| 7051 | tween.end = parts[ 1 ] ? | ||
| 7052 | start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : | ||
| 7053 | +parts[ 2 ]; | ||
| 7054 | } | ||
| 7055 | |||
| 7056 | return tween; | ||
| 7057 | } ] | ||
| 7058 | }; | ||
| 7059 | |||
| 7060 | // Animations created synchronously will run synchronously | ||
| 7061 | function createFxNow() { | ||
| 7062 | setTimeout(function() { | ||
| 7063 | fxNow = undefined; | ||
| 7064 | }); | ||
| 7065 | return ( fxNow = jQuery.now() ); | ||
| 7066 | } | ||
| 7067 | |||
| 7068 | // Generate parameters to create a standard animation | ||
| 7069 | function genFx( type, includeWidth ) { | ||
| 7070 | var which, | ||
| 7071 | attrs = { height: type }, | ||
| 7072 | i = 0; | ||
| 7073 | |||
| 7074 | // if we include width, step value is 1 to do all cssExpand values, | ||
| 7075 | // if we don't include width, step value is 2 to skip over Left and Right | ||
| 7076 | includeWidth = includeWidth ? 1 : 0; | ||
| 7077 | for ( ; i < 4 ; i += 2 - includeWidth ) { | ||
| 7078 | which = cssExpand[ i ]; | ||
| 7079 | attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; | ||
| 7080 | } | ||
| 7081 | |||
| 7082 | if ( includeWidth ) { | ||
| 7083 | attrs.opacity = attrs.width = type; | ||
| 7084 | } | ||
| 7085 | |||
| 7086 | return attrs; | ||
| 7087 | } | ||
| 7088 | |||
| 7089 | function createTween( value, prop, animation ) { | ||
| 7090 | var tween, | ||
| 7091 | collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), | ||
| 7092 | index = 0, | ||
| 7093 | length = collection.length; | ||
| 7094 | for ( ; index < length; index++ ) { | ||
| 7095 | if ( (tween = collection[ index ].call( animation, prop, value )) ) { | ||
| 7096 | |||
| 7097 | // we're done with this property | ||
| 7098 | return tween; | ||
| 7099 | } | ||
| 7100 | } | ||
| 7101 | } | ||
| 7102 | |||
| 7103 | function defaultPrefilter( elem, props, opts ) { | ||
| 7104 | /* jshint validthis: true */ | ||
| 7105 | var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, | ||
| 7106 | anim = this, | ||
| 7107 | orig = {}, | ||
| 7108 | style = elem.style, | ||
| 7109 | hidden = elem.nodeType && isHidden( elem ), | ||
| 7110 | dataShow = jQuery._data( elem, "fxshow" ); | ||
| 7111 | |||
| 7112 | // handle queue: false promises | ||
| 7113 | if ( !opts.queue ) { | ||
| 7114 | hooks = jQuery._queueHooks( elem, "fx" ); | ||
| 7115 | if ( hooks.unqueued == null ) { | ||
| 7116 | hooks.unqueued = 0; | ||
| 7117 | oldfire = hooks.empty.fire; | ||
| 7118 | hooks.empty.fire = function() { | ||
| 7119 | if ( !hooks.unqueued ) { | ||
| 7120 | oldfire(); | ||
| 7121 | } | ||
| 7122 | }; | ||
| 7123 | } | ||
| 7124 | hooks.unqueued++; | ||
| 7125 | |||
| 7126 | anim.always(function() { | ||
| 7127 | // doing this makes sure that the complete handler will be called | ||
| 7128 | // before this completes | ||
| 7129 | anim.always(function() { | ||
| 7130 | hooks.unqueued--; | ||
| 7131 | if ( !jQuery.queue( elem, "fx" ).length ) { | ||
| 7132 | hooks.empty.fire(); | ||
| 7133 | } | ||
| 7134 | }); | ||
| 7135 | }); | ||
| 7136 | } | ||
| 7137 | |||
| 7138 | // height/width overflow pass | ||
| 7139 | if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { | ||
| 7140 | // Make sure that nothing sneaks out | ||
| 7141 | // Record all 3 overflow attributes because IE does not | ||
| 7142 | // change the overflow attribute when overflowX and | ||
| 7143 | // overflowY are set to the same value | ||
| 7144 | opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; | ||
| 7145 | |||
| 7146 | // Set display property to inline-block for height/width | ||
| 7147 | // animations on inline elements that are having width/height animated | ||
| 7148 | display = jQuery.css( elem, "display" ); | ||
| 7149 | |||
| 7150 | // Test default display if display is currently "none" | ||
| 7151 | checkDisplay = display === "none" ? | ||
| 7152 | jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; | ||
| 7153 | |||
| 7154 | if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { | ||
| 7155 | |||
| 7156 | // inline-level elements accept inline-block; | ||
| 7157 | // block-level elements need to be inline with layout | ||
| 7158 | if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { | ||
| 7159 | style.display = "inline-block"; | ||
| 7160 | } else { | ||
| 7161 | style.zoom = 1; | ||
| 7162 | } | ||
| 7163 | } | ||
| 7164 | } | ||
| 7165 | |||
| 7166 | if ( opts.overflow ) { | ||
| 7167 | style.overflow = "hidden"; | ||
| 7168 | if ( !support.shrinkWrapBlocks() ) { | ||
| 7169 | anim.always(function() { | ||
| 7170 | style.overflow = opts.overflow[ 0 ]; | ||
| 7171 | style.overflowX = opts.overflow[ 1 ]; | ||
| 7172 | style.overflowY = opts.overflow[ 2 ]; | ||
| 7173 | }); | ||
| 7174 | } | ||
| 7175 | } | ||
| 7176 | |||
| 7177 | // show/hide pass | ||
| 7178 | for ( prop in props ) { | ||
| 7179 | value = props[ prop ]; | ||
| 7180 | if ( rfxtypes.exec( value ) ) { | ||
| 7181 | delete props[ prop ]; | ||
| 7182 | toggle = toggle || value === "toggle"; | ||
| 7183 | if ( value === ( hidden ? "hide" : "show" ) ) { | ||
| 7184 | |||
| 7185 | // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden | ||
| 7186 | if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { | ||
| 7187 | hidden = true; | ||
| 7188 | } else { | ||
| 7189 | continue; | ||
| 7190 | } | ||
| 7191 | } | ||
| 7192 | orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); | ||
| 7193 | |||
| 7194 | // Any non-fx value stops us from restoring the original display value | ||
| 7195 | } else { | ||
| 7196 | display = undefined; | ||
| 7197 | } | ||
| 7198 | } | ||
| 7199 | |||
| 7200 | if ( !jQuery.isEmptyObject( orig ) ) { | ||
| 7201 | if ( dataShow ) { | ||
| 7202 | if ( "hidden" in dataShow ) { | ||
| 7203 | hidden = dataShow.hidden; | ||
| 7204 | } | ||
| 7205 | } else { | ||
| 7206 | dataShow = jQuery._data( elem, "fxshow", {} ); | ||
| 7207 | } | ||
| 7208 | |||
| 7209 | // store state if its toggle - enables .stop().toggle() to "reverse" | ||
| 7210 | if ( toggle ) { | ||
| 7211 | dataShow.hidden = !hidden; | ||
| 7212 | } | ||
| 7213 | if ( hidden ) { | ||
| 7214 | jQuery( elem ).show(); | ||
| 7215 | } else { | ||
| 7216 | anim.done(function() { | ||
| 7217 | jQuery( elem ).hide(); | ||
| 7218 | }); | ||
| 7219 | } | ||
| 7220 | anim.done(function() { | ||
| 7221 | var prop; | ||
| 7222 | jQuery._removeData( elem, "fxshow" ); | ||
| 7223 | for ( prop in orig ) { | ||
| 7224 | jQuery.style( elem, prop, orig[ prop ] ); | ||
| 7225 | } | ||
| 7226 | }); | ||
| 7227 | for ( prop in orig ) { | ||
| 7228 | tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); | ||
| 7229 | |||
| 7230 | if ( !( prop in dataShow ) ) { | ||
| 7231 | dataShow[ prop ] = tween.start; | ||
| 7232 | if ( hidden ) { | ||
| 7233 | tween.end = tween.start; | ||
| 7234 | tween.start = prop === "width" || prop === "height" ? 1 : 0; | ||
| 7235 | } | ||
| 7236 | } | ||
| 7237 | } | ||
| 7238 | |||
| 7239 | // If this is a noop like .hide().hide(), restore an overwritten display value | ||
| 7240 | } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) { | ||
| 7241 | style.display = display; | ||
| 7242 | } | ||
| 7243 | } | ||
| 7244 | |||
| 7245 | function propFilter( props, specialEasing ) { | ||
| 7246 | var index, name, easing, value, hooks; | ||
| 7247 | |||
| 7248 | // camelCase, specialEasing and expand cssHook pass | ||
| 7249 | for ( index in props ) { | ||
| 7250 | name = jQuery.camelCase( index ); | ||
| 7251 | easing = specialEasing[ name ]; | ||
| 7252 | value = props[ index ]; | ||
| 7253 | if ( jQuery.isArray( value ) ) { | ||
| 7254 | easing = value[ 1 ]; | ||
| 7255 | value = props[ index ] = value[ 0 ]; | ||
| 7256 | } | ||
| 7257 | |||
| 7258 | if ( index !== name ) { | ||
| 7259 | props[ name ] = value; | ||
| 7260 | delete props[ index ]; | ||
| 7261 | } | ||
| 7262 | |||
| 7263 | hooks = jQuery.cssHooks[ name ]; | ||
| 7264 | if ( hooks && "expand" in hooks ) { | ||
| 7265 | value = hooks.expand( value ); | ||
| 7266 | delete props[ name ]; | ||
| 7267 | |||
| 7268 | // not quite $.extend, this wont overwrite keys already present. | ||
| 7269 | // also - reusing 'index' from above because we have the correct "name" | ||
| 7270 | for ( index in value ) { | ||
| 7271 | if ( !( index in props ) ) { | ||
| 7272 | props[ index ] = value[ index ]; | ||
| 7273 | specialEasing[ index ] = easing; | ||
| 7274 | } | ||
| 7275 | } | ||
| 7276 | } else { | ||
| 7277 | specialEasing[ name ] = easing; | ||
| 7278 | } | ||
| 7279 | } | ||
| 7280 | } | ||
| 7281 | |||
| 7282 | function Animation( elem, properties, options ) { | ||
| 7283 | var result, | ||
| 7284 | stopped, | ||
| 7285 | index = 0, | ||
| 7286 | length = animationPrefilters.length, | ||
| 7287 | deferred = jQuery.Deferred().always( function() { | ||
| 7288 | // don't match elem in the :animated selector | ||
| 7289 | delete tick.elem; | ||
| 7290 | }), | ||
| 7291 | tick = function() { | ||
| 7292 | if ( stopped ) { | ||
| 7293 | return false; | ||
| 7294 | } | ||
| 7295 | var currentTime = fxNow || createFxNow(), | ||
| 7296 | remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), | ||
| 7297 | // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) | ||
| 7298 | temp = remaining / animation.duration || 0, | ||
| 7299 | percent = 1 - temp, | ||
| 7300 | index = 0, | ||
| 7301 | length = animation.tweens.length; | ||
| 7302 | |||
| 7303 | for ( ; index < length ; index++ ) { | ||
| 7304 | animation.tweens[ index ].run( percent ); | ||
| 7305 | } | ||
| 7306 | |||
| 7307 | deferred.notifyWith( elem, [ animation, percent, remaining ]); | ||
| 7308 | |||
| 7309 | if ( percent < 1 && length ) { | ||
| 7310 | return remaining; | ||
| 7311 | } else { | ||
| 7312 | deferred.resolveWith( elem, [ animation ] ); | ||
| 7313 | return false; | ||
| 7314 | } | ||
| 7315 | }, | ||
| 7316 | animation = deferred.promise({ | ||
| 7317 | elem: elem, | ||
| 7318 | props: jQuery.extend( {}, properties ), | ||
| 7319 | opts: jQuery.extend( true, { specialEasing: {} }, options ), | ||
| 7320 | originalProperties: properties, | ||
| 7321 | originalOptions: options, | ||
| 7322 | startTime: fxNow || createFxNow(), | ||
| 7323 | duration: options.duration, | ||
| 7324 | tweens: [], | ||
| 7325 | createTween: function( prop, end ) { | ||
| 7326 | var tween = jQuery.Tween( elem, animation.opts, prop, end, | ||
| 7327 | animation.opts.specialEasing[ prop ] || animation.opts.easing ); | ||
| 7328 | animation.tweens.push( tween ); | ||
| 7329 | return tween; | ||
| 7330 | }, | ||
| 7331 | stop: function( gotoEnd ) { | ||
| 7332 | var index = 0, | ||
| 7333 | // if we are going to the end, we want to run all the tweens | ||
| 7334 | // otherwise we skip this part | ||
| 7335 | length = gotoEnd ? animation.tweens.length : 0; | ||
| 7336 | if ( stopped ) { | ||
| 7337 | return this; | ||
| 7338 | } | ||
| 7339 | stopped = true; | ||
| 7340 | for ( ; index < length ; index++ ) { | ||
| 7341 | animation.tweens[ index ].run( 1 ); | ||
| 7342 | } | ||
| 7343 | |||
| 7344 | // resolve when we played the last frame | ||
| 7345 | // otherwise, reject | ||
| 7346 | if ( gotoEnd ) { | ||
| 7347 | deferred.resolveWith( elem, [ animation, gotoEnd ] ); | ||
| 7348 | } else { | ||
| 7349 | deferred.rejectWith( elem, [ animation, gotoEnd ] ); | ||
| 7350 | } | ||
| 7351 | return this; | ||
| 7352 | } | ||
| 7353 | }), | ||
| 7354 | props = animation.props; | ||
| 7355 | |||
| 7356 | propFilter( props, animation.opts.specialEasing ); | ||
| 7357 | |||
| 7358 | for ( ; index < length ; index++ ) { | ||
| 7359 | result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); | ||
| 7360 | if ( result ) { | ||
| 7361 | return result; | ||
| 7362 | } | ||
| 7363 | } | ||
| 7364 | |||
| 7365 | jQuery.map( props, createTween, animation ); | ||
| 7366 | |||
| 7367 | if ( jQuery.isFunction( animation.opts.start ) ) { | ||
| 7368 | animation.opts.start.call( elem, animation ); | ||
| 7369 | } | ||
| 7370 | |||
| 7371 | jQuery.fx.timer( | ||
| 7372 | jQuery.extend( tick, { | ||
| 7373 | elem: elem, | ||
| 7374 | anim: animation, | ||
| 7375 | queue: animation.opts.queue | ||
| 7376 | }) | ||
| 7377 | ); | ||
| 7378 | |||
| 7379 | // attach callbacks from options | ||
| 7380 | return animation.progress( animation.opts.progress ) | ||
| 7381 | .done( animation.opts.done, animation.opts.complete ) | ||
| 7382 | .fail( animation.opts.fail ) | ||
| 7383 | .always( animation.opts.always ); | ||
| 7384 | } | ||
| 7385 | |||
| 7386 | jQuery.Animation = jQuery.extend( Animation, { | ||
| 7387 | tweener: function( props, callback ) { | ||
| 7388 | if ( jQuery.isFunction( props ) ) { | ||
| 7389 | callback = props; | ||
| 7390 | props = [ "*" ]; | ||
| 7391 | } else { | ||
| 7392 | props = props.split(" "); | ||
| 7393 | } | ||
| 7394 | |||
| 7395 | var prop, | ||
| 7396 | index = 0, | ||
| 7397 | length = props.length; | ||
| 7398 | |||
| 7399 | for ( ; index < length ; index++ ) { | ||
| 7400 | prop = props[ index ]; | ||
| 7401 | tweeners[ prop ] = tweeners[ prop ] || []; | ||
| 7402 | tweeners[ prop ].unshift( callback ); | ||
| 7403 | } | ||
| 7404 | }, | ||
| 7405 | |||
| 7406 | prefilter: function( callback, prepend ) { | ||
| 7407 | if ( prepend ) { | ||
| 7408 | animationPrefilters.unshift( callback ); | ||
| 7409 | } else { | ||
| 7410 | animationPrefilters.push( callback ); | ||
| 7411 | } | ||
| 7412 | } | ||
| 7413 | }); | ||
| 7414 | |||
| 7415 | jQuery.speed = function( speed, easing, fn ) { | ||
| 7416 | var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { | ||
| 7417 | complete: fn || !fn && easing || | ||
| 7418 | jQuery.isFunction( speed ) && speed, | ||
| 7419 | duration: speed, | ||
| 7420 | easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing | ||
| 7421 | }; | ||
| 7422 | |||
| 7423 | opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : | ||
| 7424 | opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; | ||
| 7425 | |||
| 7426 | // normalize opt.queue - true/undefined/null -> "fx" | ||
| 7427 | if ( opt.queue == null || opt.queue === true ) { | ||
| 7428 | opt.queue = "fx"; | ||
| 7429 | } | ||
| 7430 | |||
| 7431 | // Queueing | ||
| 7432 | opt.old = opt.complete; | ||
| 7433 | |||
| 7434 | opt.complete = function() { | ||
| 7435 | if ( jQuery.isFunction( opt.old ) ) { | ||
| 7436 | opt.old.call( this ); | ||
| 7437 | } | ||
| 7438 | |||
| 7439 | if ( opt.queue ) { | ||
| 7440 | jQuery.dequeue( this, opt.queue ); | ||
| 7441 | } | ||
| 7442 | }; | ||
| 7443 | |||
| 7444 | return opt; | ||
| 7445 | }; | ||
| 7446 | |||
| 7447 | jQuery.fn.extend({ | ||
| 7448 | fadeTo: function( speed, to, easing, callback ) { | ||
| 7449 | |||
| 7450 | // show any hidden elements after setting opacity to 0 | ||
| 7451 | return this.filter( isHidden ).css( "opacity", 0 ).show() | ||
| 7452 | |||
| 7453 | // animate to the value specified | ||
| 7454 | .end().animate({ opacity: to }, speed, easing, callback ); | ||
| 7455 | }, | ||
| 7456 | animate: function( prop, speed, easing, callback ) { | ||
| 7457 | var empty = jQuery.isEmptyObject( prop ), | ||
| 7458 | optall = jQuery.speed( speed, easing, callback ), | ||
| 7459 | doAnimation = function() { | ||
| 7460 | // Operate on a copy of prop so per-property easing won't be lost | ||
| 7461 | var anim = Animation( this, jQuery.extend( {}, prop ), optall ); | ||
| 7462 | |||
| 7463 | // Empty animations, or finishing resolves immediately | ||
| 7464 | if ( empty || jQuery._data( this, "finish" ) ) { | ||
| 7465 | anim.stop( true ); | ||
| 7466 | } | ||
| 7467 | }; | ||
| 7468 | doAnimation.finish = doAnimation; | ||
| 7469 | |||
| 7470 | return empty || optall.queue === false ? | ||
| 7471 | this.each( doAnimation ) : | ||
| 7472 | this.queue( optall.queue, doAnimation ); | ||
| 7473 | }, | ||
| 7474 | stop: function( type, clearQueue, gotoEnd ) { | ||
| 7475 | var stopQueue = function( hooks ) { | ||
| 7476 | var stop = hooks.stop; | ||
| 7477 | delete hooks.stop; | ||
| 7478 | stop( gotoEnd ); | ||
| 7479 | }; | ||
| 7480 | |||
| 7481 | if ( typeof type !== "string" ) { | ||
| 7482 | gotoEnd = clearQueue; | ||
| 7483 | clearQueue = type; | ||
| 7484 | type = undefined; | ||
| 7485 | } | ||
| 7486 | if ( clearQueue && type !== false ) { | ||
| 7487 | this.queue( type || "fx", [] ); | ||
| 7488 | } | ||
| 7489 | |||
| 7490 | return this.each(function() { | ||
| 7491 | var dequeue = true, | ||
| 7492 | index = type != null && type + "queueHooks", | ||
| 7493 | timers = jQuery.timers, | ||
| 7494 | data = jQuery._data( this ); | ||
| 7495 | |||
| 7496 | if ( index ) { | ||
| 7497 | if ( data[ index ] && data[ index ].stop ) { | ||
| 7498 | stopQueue( data[ index ] ); | ||
| 7499 | } | ||
| 7500 | } else { | ||
| 7501 | for ( index in data ) { | ||
| 7502 | if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { | ||
| 7503 | stopQueue( data[ index ] ); | ||
| 7504 | } | ||
| 7505 | } | ||
| 7506 | } | ||
| 7507 | |||
| 7508 | for ( index = timers.length; index--; ) { | ||
| 7509 | if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { | ||
| 7510 | timers[ index ].anim.stop( gotoEnd ); | ||
| 7511 | dequeue = false; | ||
| 7512 | timers.splice( index, 1 ); | ||
| 7513 | } | ||
| 7514 | } | ||
| 7515 | |||
| 7516 | // start the next in the queue if the last step wasn't forced | ||
| 7517 | // timers currently will call their complete callbacks, which will dequeue | ||
| 7518 | // but only if they were gotoEnd | ||
| 7519 | if ( dequeue || !gotoEnd ) { | ||
| 7520 | jQuery.dequeue( this, type ); | ||
| 7521 | } | ||
| 7522 | }); | ||
| 7523 | }, | ||
| 7524 | finish: function( type ) { | ||
| 7525 | if ( type !== false ) { | ||
| 7526 | type = type || "fx"; | ||
| 7527 | } | ||
| 7528 | return this.each(function() { | ||
| 7529 | var index, | ||
| 7530 | data = jQuery._data( this ), | ||
| 7531 | queue = data[ type + "queue" ], | ||
| 7532 | hooks = data[ type + "queueHooks" ], | ||
| 7533 | timers = jQuery.timers, | ||
| 7534 | length = queue ? queue.length : 0; | ||
| 7535 | |||
| 7536 | // enable finishing flag on private data | ||
| 7537 | data.finish = true; | ||
| 7538 | |||
| 7539 | // empty the queue first | ||
| 7540 | jQuery.queue( this, type, [] ); | ||
| 7541 | |||
| 7542 | if ( hooks && hooks.stop ) { | ||
| 7543 | hooks.stop.call( this, true ); | ||
| 7544 | } | ||
| 7545 | |||
| 7546 | // look for any active animations, and finish them | ||
| 7547 | for ( index = timers.length; index--; ) { | ||
| 7548 | if ( timers[ index ].elem === this && timers[ index ].queue === type ) { | ||
| 7549 | timers[ index ].anim.stop( true ); | ||
| 7550 | timers.splice( index, 1 ); | ||
| 7551 | } | ||
| 7552 | } | ||
| 7553 | |||
| 7554 | // look for any animations in the old queue and finish them | ||
| 7555 | for ( index = 0; index < length; index++ ) { | ||
| 7556 | if ( queue[ index ] && queue[ index ].finish ) { | ||
| 7557 | queue[ index ].finish.call( this ); | ||
| 7558 | } | ||
| 7559 | } | ||
| 7560 | |||
| 7561 | // turn off finishing flag | ||
| 7562 | delete data.finish; | ||
| 7563 | }); | ||
| 7564 | } | ||
| 7565 | }); | ||
| 7566 | |||
| 7567 | jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { | ||
| 7568 | var cssFn = jQuery.fn[ name ]; | ||
| 7569 | jQuery.fn[ name ] = function( speed, easing, callback ) { | ||
| 7570 | return speed == null || typeof speed === "boolean" ? | ||
| 7571 | cssFn.apply( this, arguments ) : | ||
| 7572 | this.animate( genFx( name, true ), speed, easing, callback ); | ||
| 7573 | }; | ||
| 7574 | }); | ||
| 7575 | |||
| 7576 | // Generate shortcuts for custom animations | ||
| 7577 | jQuery.each({ | ||
| 7578 | slideDown: genFx("show"), | ||
| 7579 | slideUp: genFx("hide"), | ||
| 7580 | slideToggle: genFx("toggle"), | ||
| 7581 | fadeIn: { opacity: "show" }, | ||
| 7582 | fadeOut: { opacity: "hide" }, | ||
| 7583 | fadeToggle: { opacity: "toggle" } | ||
| 7584 | }, function( name, props ) { | ||
| 7585 | jQuery.fn[ name ] = function( speed, easing, callback ) { | ||
| 7586 | return this.animate( props, speed, easing, callback ); | ||
| 7587 | }; | ||
| 7588 | }); | ||
| 7589 | |||
| 7590 | jQuery.timers = []; | ||
| 7591 | jQuery.fx.tick = function() { | ||
| 7592 | var timer, | ||
| 7593 | timers = jQuery.timers, | ||
| 7594 | i = 0; | ||
| 7595 | |||
| 7596 | fxNow = jQuery.now(); | ||
| 7597 | |||
| 7598 | for ( ; i < timers.length; i++ ) { | ||
| 7599 | timer = timers[ i ]; | ||
| 7600 | // Checks the timer has not already been removed | ||
| 7601 | if ( !timer() && timers[ i ] === timer ) { | ||
| 7602 | timers.splice( i--, 1 ); | ||
| 7603 | } | ||
| 7604 | } | ||
| 7605 | |||
| 7606 | if ( !timers.length ) { | ||
| 7607 | jQuery.fx.stop(); | ||
| 7608 | } | ||
| 7609 | fxNow = undefined; | ||
| 7610 | }; | ||
| 7611 | |||
| 7612 | jQuery.fx.timer = function( timer ) { | ||
| 7613 | jQuery.timers.push( timer ); | ||
| 7614 | if ( timer() ) { | ||
| 7615 | jQuery.fx.start(); | ||
| 7616 | } else { | ||
| 7617 | jQuery.timers.pop(); | ||
| 7618 | } | ||
| 7619 | }; | ||
| 7620 | |||
| 7621 | jQuery.fx.interval = 13; | ||
| 7622 | |||
| 7623 | jQuery.fx.start = function() { | ||
| 7624 | if ( !timerId ) { | ||
| 7625 | timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); | ||
| 7626 | } | ||
| 7627 | }; | ||
| 7628 | |||
| 7629 | jQuery.fx.stop = function() { | ||
| 7630 | clearInterval( timerId ); | ||
| 7631 | timerId = null; | ||
| 7632 | }; | ||
| 7633 | |||
| 7634 | jQuery.fx.speeds = { | ||
| 7635 | slow: 600, | ||
| 7636 | fast: 200, | ||
| 7637 | // Default speed | ||
| 7638 | _default: 400 | ||
| 7639 | }; | ||
| 7640 | |||
| 7641 | |||
| 7642 | // Based off of the plugin by Clint Helfers, with permission. | ||
| 7643 | // http://blindsignals.com/index.php/2009/07/jquery-delay/ | ||
| 7644 | jQuery.fn.delay = function( time, type ) { | ||
| 7645 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; | ||
| 7646 | type = type || "fx"; | ||
| 7647 | |||
| 7648 | return this.queue( type, function( next, hooks ) { | ||
| 7649 | var timeout = setTimeout( next, time ); | ||
| 7650 | hooks.stop = function() { | ||
| 7651 | clearTimeout( timeout ); | ||
| 7652 | }; | ||
| 7653 | }); | ||
| 7654 | }; | ||
| 7655 | |||
| 7656 | |||
| 7657 | (function() { | ||
| 7658 | // Minified: var a,b,c,d,e | ||
| 7659 | var input, div, select, a, opt; | ||
| 7660 | |||
| 7661 | // Setup | ||
| 7662 | div = document.createElement( "div" ); | ||
| 7663 | div.setAttribute( "className", "t" ); | ||
| 7664 | div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; | ||
| 7665 | a = div.getElementsByTagName("a")[ 0 ]; | ||
| 7666 | |||
| 7667 | // First batch of tests. | ||
| 7668 | select = document.createElement("select"); | ||
| 7669 | opt = select.appendChild( document.createElement("option") ); | ||
| 7670 | input = div.getElementsByTagName("input")[ 0 ]; | ||
| 7671 | |||
| 7672 | a.style.cssText = "top:1px"; | ||
| 7673 | |||
| 7674 | // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) | ||
| 7675 | support.getSetAttribute = div.className !== "t"; | ||
| 7676 | |||
| 7677 | // Get the style information from getAttribute | ||
| 7678 | // (IE uses .cssText instead) | ||
| 7679 | support.style = /top/.test( a.getAttribute("style") ); | ||
| 7680 | |||
| 7681 | // Make sure that URLs aren't manipulated | ||
| 7682 | // (IE normalizes it by default) | ||
| 7683 | support.hrefNormalized = a.getAttribute("href") === "/a"; | ||
| 7684 | |||
| 7685 | // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) | ||
| 7686 | support.checkOn = !!input.value; | ||
| 7687 | |||
| 7688 | // Make sure that a selected-by-default option has a working selected property. | ||
| 7689 | // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) | ||
| 7690 | support.optSelected = opt.selected; | ||
| 7691 | |||
| 7692 | // Tests for enctype support on a form (#6743) | ||
| 7693 | support.enctype = !!document.createElement("form").enctype; | ||
| 7694 | |||
| 7695 | // Make sure that the options inside disabled selects aren't marked as disabled | ||
| 7696 | // (WebKit marks them as disabled) | ||
| 7697 | select.disabled = true; | ||
| 7698 | support.optDisabled = !opt.disabled; | ||
| 7699 | |||
| 7700 | // Support: IE8 only | ||
| 7701 | // Check if we can trust getAttribute("value") | ||
| 7702 | input = document.createElement( "input" ); | ||
| 7703 | input.setAttribute( "value", "" ); | ||
| 7704 | support.input = input.getAttribute( "value" ) === ""; | ||
| 7705 | |||
| 7706 | // Check if an input maintains its value after becoming a radio | ||
| 7707 | input.value = "t"; | ||
| 7708 | input.setAttribute( "type", "radio" ); | ||
| 7709 | support.radioValue = input.value === "t"; | ||
| 7710 | })(); | ||
| 7711 | |||
| 7712 | |||
| 7713 | var rreturn = /\r/g; | ||
| 7714 | |||
| 7715 | jQuery.fn.extend({ | ||
| 7716 | val: function( value ) { | ||
| 7717 | var hooks, ret, isFunction, | ||
| 7718 | elem = this[0]; | ||
| 7719 | |||
| 7720 | if ( !arguments.length ) { | ||
| 7721 | if ( elem ) { | ||
| 7722 | hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; | ||
| 7723 | |||
| 7724 | if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { | ||
| 7725 | return ret; | ||
| 7726 | } | ||
| 7727 | |||
| 7728 | ret = elem.value; | ||
| 7729 | |||
| 7730 | return typeof ret === "string" ? | ||
| 7731 | // handle most common string cases | ||
| 7732 | ret.replace(rreturn, "") : | ||
| 7733 | // handle cases where value is null/undef or number | ||
| 7734 | ret == null ? "" : ret; | ||
| 7735 | } | ||
| 7736 | |||
| 7737 | return; | ||
| 7738 | } | ||
| 7739 | |||
| 7740 | isFunction = jQuery.isFunction( value ); | ||
| 7741 | |||
| 7742 | return this.each(function( i ) { | ||
| 7743 | var val; | ||
| 7744 | |||
| 7745 | if ( this.nodeType !== 1 ) { | ||
| 7746 | return; | ||
| 7747 | } | ||
| 7748 | |||
| 7749 | if ( isFunction ) { | ||
| 7750 | val = value.call( this, i, jQuery( this ).val() ); | ||
| 7751 | } else { | ||
| 7752 | val = value; | ||
| 7753 | } | ||
| 7754 | |||
| 7755 | // Treat null/undefined as ""; convert numbers to string | ||
| 7756 | if ( val == null ) { | ||
| 7757 | val = ""; | ||
| 7758 | } else if ( typeof val === "number" ) { | ||
| 7759 | val += ""; | ||
| 7760 | } else if ( jQuery.isArray( val ) ) { | ||
| 7761 | val = jQuery.map( val, function( value ) { | ||
| 7762 | return value == null ? "" : value + ""; | ||
| 7763 | }); | ||
| 7764 | } | ||
| 7765 | |||
| 7766 | hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; | ||
| 7767 | |||
| 7768 | // If set returns undefined, fall back to normal setting | ||
| 7769 | if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { | ||
| 7770 | this.value = val; | ||
| 7771 | } | ||
| 7772 | }); | ||
| 7773 | } | ||
| 7774 | }); | ||
| 7775 | |||
| 7776 | jQuery.extend({ | ||
| 7777 | valHooks: { | ||
| 7778 | option: { | ||
| 7779 | get: function( elem ) { | ||
| 7780 | var val = jQuery.find.attr( elem, "value" ); | ||
| 7781 | return val != null ? | ||
| 7782 | val : | ||
| 7783 | // Support: IE10-11+ | ||
| 7784 | // option.text throws exceptions (#14686, #14858) | ||
| 7785 | jQuery.trim( jQuery.text( elem ) ); | ||
| 7786 | } | ||
| 7787 | }, | ||
| 7788 | select: { | ||
| 7789 | get: function( elem ) { | ||
| 7790 | var value, option, | ||
| 7791 | options = elem.options, | ||
| 7792 | index = elem.selectedIndex, | ||
| 7793 | one = elem.type === "select-one" || index < 0, | ||
| 7794 | values = one ? null : [], | ||
| 7795 | max = one ? index + 1 : options.length, | ||
| 7796 | i = index < 0 ? | ||
| 7797 | max : | ||
| 7798 | one ? index : 0; | ||
| 7799 | |||
| 7800 | // Loop through all the selected options | ||
| 7801 | for ( ; i < max; i++ ) { | ||
| 7802 | option = options[ i ]; | ||
| 7803 | |||
| 7804 | // oldIE doesn't update selected after form reset (#2551) | ||
| 7805 | if ( ( option.selected || i === index ) && | ||
| 7806 | // Don't return options that are disabled or in a disabled optgroup | ||
| 7807 | ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && | ||
| 7808 | ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { | ||
| 7809 | |||
| 7810 | // Get the specific value for the option | ||
| 7811 | value = jQuery( option ).val(); | ||
| 7812 | |||
| 7813 | // We don't need an array for one selects | ||
| 7814 | if ( one ) { | ||
| 7815 | return value; | ||
| 7816 | } | ||
| 7817 | |||
| 7818 | // Multi-Selects return an array | ||
| 7819 | values.push( value ); | ||
| 7820 | } | ||
| 7821 | } | ||
| 7822 | |||
| 7823 | return values; | ||
| 7824 | }, | ||
| 7825 | |||
| 7826 | set: function( elem, value ) { | ||
| 7827 | var optionSet, option, | ||
| 7828 | options = elem.options, | ||
| 7829 | values = jQuery.makeArray( value ), | ||
| 7830 | i = options.length; | ||
| 7831 | |||
| 7832 | while ( i-- ) { | ||
| 7833 | option = options[ i ]; | ||
| 7834 | |||
| 7835 | if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) { | ||
| 7836 | |||
| 7837 | // Support: IE6 | ||
| 7838 | // When new option element is added to select box we need to | ||
| 7839 | // force reflow of newly added node in order to workaround delay | ||
| 7840 | // of initialization properties | ||
| 7841 | try { | ||
| 7842 | option.selected = optionSet = true; | ||
| 7843 | |||
| 7844 | } catch ( _ ) { | ||
| 7845 | |||
| 7846 | // Will be executed only in IE6 | ||
| 7847 | option.scrollHeight; | ||
| 7848 | } | ||
| 7849 | |||
| 7850 | } else { | ||
| 7851 | option.selected = false; | ||
| 7852 | } | ||
| 7853 | } | ||
| 7854 | |||
| 7855 | // Force browsers to behave consistently when non-matching value is set | ||
| 7856 | if ( !optionSet ) { | ||
| 7857 | elem.selectedIndex = -1; | ||
| 7858 | } | ||
| 7859 | |||
| 7860 | return options; | ||
| 7861 | } | ||
| 7862 | } | ||
| 7863 | } | ||
| 7864 | }); | ||
| 7865 | |||
| 7866 | // Radios and checkboxes getter/setter | ||
| 7867 | jQuery.each([ "radio", "checkbox" ], function() { | ||
| 7868 | jQuery.valHooks[ this ] = { | ||
| 7869 | set: function( elem, value ) { | ||
| 7870 | if ( jQuery.isArray( value ) ) { | ||
| 7871 | return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); | ||
| 7872 | } | ||
| 7873 | } | ||
| 7874 | }; | ||
| 7875 | if ( !support.checkOn ) { | ||
| 7876 | jQuery.valHooks[ this ].get = function( elem ) { | ||
| 7877 | // Support: Webkit | ||
| 7878 | // "" is returned instead of "on" if a value isn't specified | ||
| 7879 | return elem.getAttribute("value") === null ? "on" : elem.value; | ||
| 7880 | }; | ||
| 7881 | } | ||
| 7882 | }); | ||
| 7883 | |||
| 7884 | |||
| 7885 | |||
| 7886 | |||
| 7887 | var nodeHook, boolHook, | ||
| 7888 | attrHandle = jQuery.expr.attrHandle, | ||
| 7889 | ruseDefault = /^(?:checked|selected)$/i, | ||
| 7890 | getSetAttribute = support.getSetAttribute, | ||
| 7891 | getSetInput = support.input; | ||
| 7892 | |||
| 7893 | jQuery.fn.extend({ | ||
| 7894 | attr: function( name, value ) { | ||
| 7895 | return access( this, jQuery.attr, name, value, arguments.length > 1 ); | ||
| 7896 | }, | ||
| 7897 | |||
| 7898 | removeAttr: function( name ) { | ||
| 7899 | return this.each(function() { | ||
| 7900 | jQuery.removeAttr( this, name ); | ||
| 7901 | }); | ||
| 7902 | } | ||
| 7903 | }); | ||
| 7904 | |||
| 7905 | jQuery.extend({ | ||
| 7906 | attr: function( elem, name, value ) { | ||
| 7907 | var hooks, ret, | ||
| 7908 | nType = elem.nodeType; | ||
| 7909 | |||
| 7910 | // don't get/set attributes on text, comment and attribute nodes | ||
| 7911 | if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { | ||
| 7912 | return; | ||
| 7913 | } | ||
| 7914 | |||
| 7915 | // Fallback to prop when attributes are not supported | ||
| 7916 | if ( typeof elem.getAttribute === strundefined ) { | ||
| 7917 | return jQuery.prop( elem, name, value ); | ||
| 7918 | } | ||
| 7919 | |||
| 7920 | // All attributes are lowercase | ||
| 7921 | // Grab necessary hook if one is defined | ||
| 7922 | if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { | ||
| 7923 | name = name.toLowerCase(); | ||
| 7924 | hooks = jQuery.attrHooks[ name ] || | ||
| 7925 | ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); | ||
| 7926 | } | ||
| 7927 | |||
| 7928 | if ( value !== undefined ) { | ||
| 7929 | |||
| 7930 | if ( value === null ) { | ||
| 7931 | jQuery.removeAttr( elem, name ); | ||
| 7932 | |||
| 7933 | } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { | ||
| 7934 | return ret; | ||
| 7935 | |||
| 7936 | } else { | ||
| 7937 | elem.setAttribute( name, value + "" ); | ||
| 7938 | return value; | ||
| 7939 | } | ||
| 7940 | |||
| 7941 | } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { | ||
| 7942 | return ret; | ||
| 7943 | |||
| 7944 | } else { | ||
| 7945 | ret = jQuery.find.attr( elem, name ); | ||
| 7946 | |||
| 7947 | // Non-existent attributes return null, we normalize to undefined | ||
| 7948 | return ret == null ? | ||
| 7949 | undefined : | ||
| 7950 | ret; | ||
| 7951 | } | ||
| 7952 | }, | ||
| 7953 | |||
| 7954 | removeAttr: function( elem, value ) { | ||
| 7955 | var name, propName, | ||
| 7956 | i = 0, | ||
| 7957 | attrNames = value && value.match( rnotwhite ); | ||
| 7958 | |||
| 7959 | if ( attrNames && elem.nodeType === 1 ) { | ||
| 7960 | while ( (name = attrNames[i++]) ) { | ||
| 7961 | propName = jQuery.propFix[ name ] || name; | ||
| 7962 | |||
| 7963 | // Boolean attributes get special treatment (#10870) | ||
| 7964 | if ( jQuery.expr.match.bool.test( name ) ) { | ||
| 7965 | // Set corresponding property to false | ||
| 7966 | if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { | ||
| 7967 | elem[ propName ] = false; | ||
| 7968 | // Support: IE<9 | ||
| 7969 | // Also clear defaultChecked/defaultSelected (if appropriate) | ||
| 7970 | } else { | ||
| 7971 | elem[ jQuery.camelCase( "default-" + name ) ] = | ||
| 7972 | elem[ propName ] = false; | ||
| 7973 | } | ||
| 7974 | |||
| 7975 | // See #9699 for explanation of this approach (setting first, then removal) | ||
| 7976 | } else { | ||
| 7977 | jQuery.attr( elem, name, "" ); | ||
| 7978 | } | ||
| 7979 | |||
| 7980 | elem.removeAttribute( getSetAttribute ? name : propName ); | ||
| 7981 | } | ||
| 7982 | } | ||
| 7983 | }, | ||
| 7984 | |||
| 7985 | attrHooks: { | ||
| 7986 | type: { | ||
| 7987 | set: function( elem, value ) { | ||
| 7988 | if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { | ||
| 7989 | // Setting the type on a radio button after the value resets the value in IE6-9 | ||
| 7990 | // Reset value to default in case type is set after value during creation | ||
| 7991 | var val = elem.value; | ||
| 7992 | elem.setAttribute( "type", value ); | ||
| 7993 | if ( val ) { | ||
| 7994 | elem.value = val; | ||
| 7995 | } | ||
| 7996 | return value; | ||
| 7997 | } | ||
| 7998 | } | ||
| 7999 | } | ||
| 8000 | } | ||
| 8001 | }); | ||
| 8002 | |||
| 8003 | // Hook for boolean attributes | ||
| 8004 | boolHook = { | ||
| 8005 | set: function( elem, value, name ) { | ||
| 8006 | if ( value === false ) { | ||
| 8007 | // Remove boolean attributes when set to false | ||
| 8008 | jQuery.removeAttr( elem, name ); | ||
| 8009 | } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { | ||
| 8010 | // IE<8 needs the *property* name | ||
| 8011 | elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); | ||
| 8012 | |||
| 8013 | // Use defaultChecked and defaultSelected for oldIE | ||
| 8014 | } else { | ||
| 8015 | elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; | ||
| 8016 | } | ||
| 8017 | |||
| 8018 | return name; | ||
| 8019 | } | ||
| 8020 | }; | ||
| 8021 | |||
| 8022 | // Retrieve booleans specially | ||
| 8023 | jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { | ||
| 8024 | |||
| 8025 | var getter = attrHandle[ name ] || jQuery.find.attr; | ||
| 8026 | |||
| 8027 | attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? | ||
| 8028 | function( elem, name, isXML ) { | ||
| 8029 | var ret, handle; | ||
| 8030 | if ( !isXML ) { | ||
| 8031 | // Avoid an infinite loop by temporarily removing this function from the getter | ||
| 8032 | handle = attrHandle[ name ]; | ||
| 8033 | attrHandle[ name ] = ret; | ||
| 8034 | ret = getter( elem, name, isXML ) != null ? | ||
| 8035 | name.toLowerCase() : | ||
| 8036 | null; | ||
| 8037 | attrHandle[ name ] = handle; | ||
| 8038 | } | ||
| 8039 | return ret; | ||
| 8040 | } : | ||
| 8041 | function( elem, name, isXML ) { | ||
| 8042 | if ( !isXML ) { | ||
| 8043 | return elem[ jQuery.camelCase( "default-" + name ) ] ? | ||
| 8044 | name.toLowerCase() : | ||
| 8045 | null; | ||
| 8046 | } | ||
| 8047 | }; | ||
| 8048 | }); | ||
| 8049 | |||
| 8050 | // fix oldIE attroperties | ||
| 8051 | if ( !getSetInput || !getSetAttribute ) { | ||
| 8052 | jQuery.attrHooks.value = { | ||
| 8053 | set: function( elem, value, name ) { | ||
| 8054 | if ( jQuery.nodeName( elem, "input" ) ) { | ||
| 8055 | // Does not return so that setAttribute is also used | ||
| 8056 | elem.defaultValue = value; | ||
| 8057 | } else { | ||
| 8058 | // Use nodeHook if defined (#1954); otherwise setAttribute is fine | ||
| 8059 | return nodeHook && nodeHook.set( elem, value, name ); | ||
| 8060 | } | ||
| 8061 | } | ||
| 8062 | }; | ||
| 8063 | } | ||
| 8064 | |||
| 8065 | // IE6/7 do not support getting/setting some attributes with get/setAttribute | ||
| 8066 | if ( !getSetAttribute ) { | ||
| 8067 | |||
| 8068 | // Use this for any attribute in IE6/7 | ||
| 8069 | // This fixes almost every IE6/7 issue | ||
| 8070 | nodeHook = { | ||
| 8071 | set: function( elem, value, name ) { | ||
| 8072 | // Set the existing or create a new attribute node | ||
| 8073 | var ret = elem.getAttributeNode( name ); | ||
| 8074 | if ( !ret ) { | ||
| 8075 | elem.setAttributeNode( | ||
| 8076 | (ret = elem.ownerDocument.createAttribute( name )) | ||
| 8077 | ); | ||
| 8078 | } | ||
| 8079 | |||
| 8080 | ret.value = value += ""; | ||
| 8081 | |||
| 8082 | // Break association with cloned elements by also using setAttribute (#9646) | ||
| 8083 | if ( name === "value" || value === elem.getAttribute( name ) ) { | ||
| 8084 | return value; | ||
| 8085 | } | ||
| 8086 | } | ||
| 8087 | }; | ||
| 8088 | |||
| 8089 | // Some attributes are constructed with empty-string values when not defined | ||
| 8090 | attrHandle.id = attrHandle.name = attrHandle.coords = | ||
| 8091 | function( elem, name, isXML ) { | ||
| 8092 | var ret; | ||
| 8093 | if ( !isXML ) { | ||
| 8094 | return (ret = elem.getAttributeNode( name )) && ret.value !== "" ? | ||
| 8095 | ret.value : | ||
| 8096 | null; | ||
| 8097 | } | ||
| 8098 | }; | ||
| 8099 | |||
| 8100 | // Fixing value retrieval on a button requires this module | ||
| 8101 | jQuery.valHooks.button = { | ||
| 8102 | get: function( elem, name ) { | ||
| 8103 | var ret = elem.getAttributeNode( name ); | ||
| 8104 | if ( ret && ret.specified ) { | ||
| 8105 | return ret.value; | ||
| 8106 | } | ||
| 8107 | }, | ||
| 8108 | set: nodeHook.set | ||
| 8109 | }; | ||
| 8110 | |||
| 8111 | // Set contenteditable to false on removals(#10429) | ||
| 8112 | // Setting to empty string throws an error as an invalid value | ||
| 8113 | jQuery.attrHooks.contenteditable = { | ||
| 8114 | set: function( elem, value, name ) { | ||
| 8115 | nodeHook.set( elem, value === "" ? false : value, name ); | ||
| 8116 | } | ||
| 8117 | }; | ||
| 8118 | |||
| 8119 | // Set width and height to auto instead of 0 on empty string( Bug #8150 ) | ||
| 8120 | // This is for removals | ||
| 8121 | jQuery.each([ "width", "height" ], function( i, name ) { | ||
| 8122 | jQuery.attrHooks[ name ] = { | ||
| 8123 | set: function( elem, value ) { | ||
| 8124 | if ( value === "" ) { | ||
| 8125 | elem.setAttribute( name, "auto" ); | ||
| 8126 | return value; | ||
| 8127 | } | ||
| 8128 | } | ||
| 8129 | }; | ||
| 8130 | }); | ||
| 8131 | } | ||
| 8132 | |||
| 8133 | if ( !support.style ) { | ||
| 8134 | jQuery.attrHooks.style = { | ||
| 8135 | get: function( elem ) { | ||
| 8136 | // Return undefined in the case of empty string | ||
| 8137 | // Note: IE uppercases css property names, but if we were to .toLowerCase() | ||
| 8138 | // .cssText, that would destroy case senstitivity in URL's, like in "background" | ||
| 8139 | return elem.style.cssText || undefined; | ||
| 8140 | }, | ||
| 8141 | set: function( elem, value ) { | ||
| 8142 | return ( elem.style.cssText = value + "" ); | ||
| 8143 | } | ||
| 8144 | }; | ||
| 8145 | } | ||
| 8146 | |||
| 8147 | |||
| 8148 | |||
| 8149 | |||
| 8150 | var rfocusable = /^(?:input|select|textarea|button|object)$/i, | ||
| 8151 | rclickable = /^(?:a|area)$/i; | ||
| 8152 | |||
| 8153 | jQuery.fn.extend({ | ||
| 8154 | prop: function( name, value ) { | ||
| 8155 | return access( this, jQuery.prop, name, value, arguments.length > 1 ); | ||
| 8156 | }, | ||
| 8157 | |||
| 8158 | removeProp: function( name ) { | ||
| 8159 | name = jQuery.propFix[ name ] || name; | ||
| 8160 | return this.each(function() { | ||
| 8161 | // try/catch handles cases where IE balks (such as removing a property on window) | ||
| 8162 | try { | ||
| 8163 | this[ name ] = undefined; | ||
| 8164 | delete this[ name ]; | ||
| 8165 | } catch( e ) {} | ||
| 8166 | }); | ||
| 8167 | } | ||
| 8168 | }); | ||
| 8169 | |||
| 8170 | jQuery.extend({ | ||
| 8171 | propFix: { | ||
| 8172 | "for": "htmlFor", | ||
| 8173 | "class": "className" | ||
| 8174 | }, | ||
| 8175 | |||
| 8176 | prop: function( elem, name, value ) { | ||
| 8177 | var ret, hooks, notxml, | ||
| 8178 | nType = elem.nodeType; | ||
| 8179 | |||
| 8180 | // don't get/set properties on text, comment and attribute nodes | ||
| 8181 | if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { | ||
| 8182 | return; | ||
| 8183 | } | ||
| 8184 | |||
| 8185 | notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); | ||
| 8186 | |||
| 8187 | if ( notxml ) { | ||
| 8188 | // Fix name and attach hooks | ||
| 8189 | name = jQuery.propFix[ name ] || name; | ||
| 8190 | hooks = jQuery.propHooks[ name ]; | ||
| 8191 | } | ||
| 8192 | |||
| 8193 | if ( value !== undefined ) { | ||
| 8194 | return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? | ||
| 8195 | ret : | ||
| 8196 | ( elem[ name ] = value ); | ||
| 8197 | |||
| 8198 | } else { | ||
| 8199 | return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? | ||
| 8200 | ret : | ||
| 8201 | elem[ name ]; | ||
| 8202 | } | ||
| 8203 | }, | ||
| 8204 | |||
| 8205 | propHooks: { | ||
| 8206 | tabIndex: { | ||
| 8207 | get: function( elem ) { | ||
| 8208 | // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set | ||
| 8209 | // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ | ||
| 8210 | // Use proper attribute retrieval(#12072) | ||
| 8211 | var tabindex = jQuery.find.attr( elem, "tabindex" ); | ||
| 8212 | |||
| 8213 | return tabindex ? | ||
| 8214 | parseInt( tabindex, 10 ) : | ||
| 8215 | rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? | ||
| 8216 | 0 : | ||
| 8217 | -1; | ||
| 8218 | } | ||
| 8219 | } | ||
| 8220 | } | ||
| 8221 | }); | ||
| 8222 | |||
| 8223 | // Some attributes require a special call on IE | ||
| 8224 | // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx | ||
| 8225 | if ( !support.hrefNormalized ) { | ||
| 8226 | // href/src property should get the full normalized URL (#10299/#12915) | ||
| 8227 | jQuery.each([ "href", "src" ], function( i, name ) { | ||
| 8228 | jQuery.propHooks[ name ] = { | ||
| 8229 | get: function( elem ) { | ||
| 8230 | return elem.getAttribute( name, 4 ); | ||
| 8231 | } | ||
| 8232 | }; | ||
| 8233 | }); | ||
| 8234 | } | ||
| 8235 | |||
| 8236 | // Support: Safari, IE9+ | ||
| 8237 | // mis-reports the default selected property of an option | ||
| 8238 | // Accessing the parent's selectedIndex property fixes it | ||
| 8239 | if ( !support.optSelected ) { | ||
| 8240 | jQuery.propHooks.selected = { | ||
| 8241 | get: function( elem ) { | ||
| 8242 | var parent = elem.parentNode; | ||
| 8243 | |||
| 8244 | if ( parent ) { | ||
| 8245 | parent.selectedIndex; | ||
| 8246 | |||
| 8247 | // Make sure that it also works with optgroups, see #5701 | ||
| 8248 | if ( parent.parentNode ) { | ||
| 8249 | parent.parentNode.selectedIndex; | ||
| 8250 | } | ||
| 8251 | } | ||
| 8252 | return null; | ||
| 8253 | } | ||
| 8254 | }; | ||
| 8255 | } | ||
| 8256 | |||
| 8257 | jQuery.each([ | ||
| 8258 | "tabIndex", | ||
| 8259 | "readOnly", | ||
| 8260 | "maxLength", | ||
| 8261 | "cellSpacing", | ||
| 8262 | "cellPadding", | ||
| 8263 | "rowSpan", | ||
| 8264 | "colSpan", | ||
| 8265 | "useMap", | ||
| 8266 | "frameBorder", | ||
| 8267 | "contentEditable" | ||
| 8268 | ], function() { | ||
| 8269 | jQuery.propFix[ this.toLowerCase() ] = this; | ||
| 8270 | }); | ||
| 8271 | |||
| 8272 | // IE6/7 call enctype encoding | ||
| 8273 | if ( !support.enctype ) { | ||
| 8274 | jQuery.propFix.enctype = "encoding"; | ||
| 8275 | } | ||
| 8276 | |||
| 8277 | |||
| 8278 | |||
| 8279 | |||
| 8280 | var rclass = /[\t\r\n\f]/g; | ||
| 8281 | |||
| 8282 | jQuery.fn.extend({ | ||
| 8283 | addClass: function( value ) { | ||
| 8284 | var classes, elem, cur, clazz, j, finalValue, | ||
| 8285 | i = 0, | ||
| 8286 | len = this.length, | ||
| 8287 | proceed = typeof value === "string" && value; | ||
| 8288 | |||
| 8289 | if ( jQuery.isFunction( value ) ) { | ||
| 8290 | return this.each(function( j ) { | ||
| 8291 | jQuery( this ).addClass( value.call( this, j, this.className ) ); | ||
| 8292 | }); | ||
| 8293 | } | ||
| 8294 | |||
| 8295 | if ( proceed ) { | ||
| 8296 | // The disjunction here is for better compressibility (see removeClass) | ||
| 8297 | classes = ( value || "" ).match( rnotwhite ) || []; | ||
| 8298 | |||
| 8299 | for ( ; i < len; i++ ) { | ||
| 8300 | elem = this[ i ]; | ||
| 8301 | cur = elem.nodeType === 1 && ( elem.className ? | ||
| 8302 | ( " " + elem.className + " " ).replace( rclass, " " ) : | ||
| 8303 | " " | ||
| 8304 | ); | ||
| 8305 | |||
| 8306 | if ( cur ) { | ||
| 8307 | j = 0; | ||
| 8308 | while ( (clazz = classes[j++]) ) { | ||
| 8309 | if ( cur.indexOf( " " + clazz + " " ) < 0 ) { | ||
| 8310 | cur += clazz + " "; | ||
| 8311 | } | ||
| 8312 | } | ||
| 8313 | |||
| 8314 | // only assign if different to avoid unneeded rendering. | ||
| 8315 | finalValue = jQuery.trim( cur ); | ||
| 8316 | if ( elem.className !== finalValue ) { | ||
| 8317 | elem.className = finalValue; | ||
| 8318 | } | ||
| 8319 | } | ||
| 8320 | } | ||
| 8321 | } | ||
| 8322 | |||
| 8323 | return this; | ||
| 8324 | }, | ||
| 8325 | |||
| 8326 | removeClass: function( value ) { | ||
| 8327 | var classes, elem, cur, clazz, j, finalValue, | ||
| 8328 | i = 0, | ||
| 8329 | len = this.length, | ||
| 8330 | proceed = arguments.length === 0 || typeof value === "string" && value; | ||
| 8331 | |||
| 8332 | if ( jQuery.isFunction( value ) ) { | ||
| 8333 | return this.each(function( j ) { | ||
| 8334 | jQuery( this ).removeClass( value.call( this, j, this.className ) ); | ||
| 8335 | }); | ||
| 8336 | } | ||
| 8337 | if ( proceed ) { | ||
| 8338 | classes = ( value || "" ).match( rnotwhite ) || []; | ||
| 8339 | |||
| 8340 | for ( ; i < len; i++ ) { | ||
| 8341 | elem = this[ i ]; | ||
| 8342 | // This expression is here for better compressibility (see addClass) | ||
| 8343 | cur = elem.nodeType === 1 && ( elem.className ? | ||
| 8344 | ( " " + elem.className + " " ).replace( rclass, " " ) : | ||
| 8345 | "" | ||
| 8346 | ); | ||
| 8347 | |||
| 8348 | if ( cur ) { | ||
| 8349 | j = 0; | ||
| 8350 | while ( (clazz = classes[j++]) ) { | ||
| 8351 | // Remove *all* instances | ||
| 8352 | while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { | ||
| 8353 | cur = cur.replace( " " + clazz + " ", " " ); | ||
| 8354 | } | ||
| 8355 | } | ||
| 8356 | |||
| 8357 | // only assign if different to avoid unneeded rendering. | ||
| 8358 | finalValue = value ? jQuery.trim( cur ) : ""; | ||
| 8359 | if ( elem.className !== finalValue ) { | ||
| 8360 | elem.className = finalValue; | ||
| 8361 | } | ||
| 8362 | } | ||
| 8363 | } | ||
| 8364 | } | ||
| 8365 | |||
| 8366 | return this; | ||
| 8367 | }, | ||
| 8368 | |||
| 8369 | toggleClass: function( value, stateVal ) { | ||
| 8370 | var type = typeof value; | ||
| 8371 | |||
| 8372 | if ( typeof stateVal === "boolean" && type === "string" ) { | ||
| 8373 | return stateVal ? this.addClass( value ) : this.removeClass( value ); | ||
| 8374 | } | ||
| 8375 | |||
| 8376 | if ( jQuery.isFunction( value ) ) { | ||
| 8377 | return this.each(function( i ) { | ||
| 8378 | jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); | ||
| 8379 | }); | ||
| 8380 | } | ||
| 8381 | |||
| 8382 | return this.each(function() { | ||
| 8383 | if ( type === "string" ) { | ||
| 8384 | // toggle individual class names | ||
| 8385 | var className, | ||
| 8386 | i = 0, | ||
| 8387 | self = jQuery( this ), | ||
| 8388 | classNames = value.match( rnotwhite ) || []; | ||
| 8389 | |||
| 8390 | while ( (className = classNames[ i++ ]) ) { | ||
| 8391 | // check each className given, space separated list | ||
| 8392 | if ( self.hasClass( className ) ) { | ||
| 8393 | self.removeClass( className ); | ||
| 8394 | } else { | ||
| 8395 | self.addClass( className ); | ||
| 8396 | } | ||
| 8397 | } | ||
| 8398 | |||
| 8399 | // Toggle whole class name | ||
| 8400 | } else if ( type === strundefined || type === "boolean" ) { | ||
| 8401 | if ( this.className ) { | ||
| 8402 | // store className if set | ||
| 8403 | jQuery._data( this, "__className__", this.className ); | ||
| 8404 | } | ||
| 8405 | |||
| 8406 | // If the element has a class name or if we're passed "false", | ||
| 8407 | // then remove the whole classname (if there was one, the above saved it). | ||
| 8408 | // Otherwise bring back whatever was previously saved (if anything), | ||
| 8409 | // falling back to the empty string if nothing was stored. | ||
| 8410 | this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; | ||
| 8411 | } | ||
| 8412 | }); | ||
| 8413 | }, | ||
| 8414 | |||
| 8415 | hasClass: function( selector ) { | ||
| 8416 | var className = " " + selector + " ", | ||
| 8417 | i = 0, | ||
| 8418 | l = this.length; | ||
| 8419 | for ( ; i < l; i++ ) { | ||
| 8420 | if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { | ||
| 8421 | return true; | ||
| 8422 | } | ||
| 8423 | } | ||
| 8424 | |||
| 8425 | return false; | ||
| 8426 | } | ||
| 8427 | }); | ||
| 8428 | |||
| 8429 | |||
| 8430 | |||
| 8431 | |||
| 8432 | // Return jQuery for attributes-only inclusion | ||
| 8433 | |||
| 8434 | |||
| 8435 | jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + | ||
| 8436 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + | ||
| 8437 | "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { | ||
| 8438 | |||
| 8439 | // Handle event binding | ||
| 8440 | jQuery.fn[ name ] = function( data, fn ) { | ||
| 8441 | return arguments.length > 0 ? | ||
| 8442 | this.on( name, null, data, fn ) : | ||
| 8443 | this.trigger( name ); | ||
| 8444 | }; | ||
| 8445 | }); | ||
| 8446 | |||
| 8447 | jQuery.fn.extend({ | ||
| 8448 | hover: function( fnOver, fnOut ) { | ||
| 8449 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); | ||
| 8450 | }, | ||
| 8451 | |||
| 8452 | bind: function( types, data, fn ) { | ||
| 8453 | return this.on( types, null, data, fn ); | ||
| 8454 | }, | ||
| 8455 | unbind: function( types, fn ) { | ||
| 8456 | return this.off( types, null, fn ); | ||
| 8457 | }, | ||
| 8458 | |||
| 8459 | delegate: function( selector, types, data, fn ) { | ||
| 8460 | return this.on( types, selector, data, fn ); | ||
| 8461 | }, | ||
| 8462 | undelegate: function( selector, types, fn ) { | ||
| 8463 | // ( namespace ) or ( selector, types [, fn] ) | ||
| 8464 | return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); | ||
| 8465 | } | ||
| 8466 | }); | ||
| 8467 | |||
| 8468 | |||
| 8469 | var nonce = jQuery.now(); | ||
| 8470 | |||
| 8471 | var rquery = (/\?/); | ||
| 8472 | |||
| 8473 | |||
| 8474 | |||
| 8475 | var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; | ||
| 8476 | |||
| 8477 | jQuery.parseJSON = function( data ) { | ||
| 8478 | // Attempt to parse using the native JSON parser first | ||
| 8479 | if ( window.JSON && window.JSON.parse ) { | ||
| 8480 | // Support: Android 2.3 | ||
| 8481 | // Workaround failure to string-cast null input | ||
| 8482 | return window.JSON.parse( data + "" ); | ||
| 8483 | } | ||
| 8484 | |||
| 8485 | var requireNonComma, | ||
| 8486 | depth = null, | ||
| 8487 | str = jQuery.trim( data + "" ); | ||
| 8488 | |||
| 8489 | // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains | ||
| 8490 | // after removing valid tokens | ||
| 8491 | return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { | ||
| 8492 | |||
| 8493 | // Force termination if we see a misplaced comma | ||
| 8494 | if ( requireNonComma && comma ) { | ||
| 8495 | depth = 0; | ||
| 8496 | } | ||
| 8497 | |||
| 8498 | // Perform no more replacements after returning to outermost depth | ||
| 8499 | if ( depth === 0 ) { | ||
| 8500 | return token; | ||
| 8501 | } | ||
| 8502 | |||
| 8503 | // Commas must not follow "[", "{", or "," | ||
| 8504 | requireNonComma = open || comma; | ||
| 8505 | |||
| 8506 | // Determine new depth | ||
| 8507 | // array/object open ("[" or "{"): depth += true - false (increment) | ||
| 8508 | // array/object close ("]" or "}"): depth += false - true (decrement) | ||
| 8509 | // other cases ("," or primitive): depth += true - true (numeric cast) | ||
| 8510 | depth += !close - !open; | ||
| 8511 | |||
| 8512 | // Remove this token | ||
| 8513 | return ""; | ||
| 8514 | }) ) ? | ||
| 8515 | ( Function( "return " + str ) )() : | ||
| 8516 | jQuery.error( "Invalid JSON: " + data ); | ||
| 8517 | }; | ||
| 8518 | |||
| 8519 | |||
| 8520 | // Cross-browser xml parsing | ||
| 8521 | jQuery.parseXML = function( data ) { | ||
| 8522 | var xml, tmp; | ||
| 8523 | if ( !data || typeof data !== "string" ) { | ||
| 8524 | return null; | ||
| 8525 | } | ||
| 8526 | try { | ||
| 8527 | if ( window.DOMParser ) { // Standard | ||
| 8528 | tmp = new DOMParser(); | ||
| 8529 | xml = tmp.parseFromString( data, "text/xml" ); | ||
| 8530 | } else { // IE | ||
| 8531 | xml = new ActiveXObject( "Microsoft.XMLDOM" ); | ||
| 8532 | xml.async = "false"; | ||
| 8533 | xml.loadXML( data ); | ||
| 8534 | } | ||
| 8535 | } catch( e ) { | ||
| 8536 | xml = undefined; | ||
| 8537 | } | ||
| 8538 | if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { | ||
| 8539 | jQuery.error( "Invalid XML: " + data ); | ||
| 8540 | } | ||
| 8541 | return xml; | ||
| 8542 | }; | ||
| 8543 | |||
| 8544 | |||
| 8545 | var | ||
| 8546 | // Document location | ||
| 8547 | ajaxLocParts, | ||
| 8548 | ajaxLocation, | ||
| 8549 | |||
| 8550 | rhash = /#.*$/, | ||
| 8551 | rts = /([?&])_=[^&]*/, | ||
| 8552 | rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL | ||
| 8553 | // #7653, #8125, #8152: local protocol detection | ||
| 8554 | rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, | ||
| 8555 | rnoContent = /^(?:GET|HEAD)$/, | ||
| 8556 | rprotocol = /^\/\//, | ||
| 8557 | rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, | ||
| 8558 | |||
| 8559 | /* Prefilters | ||
| 8560 | * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) | ||
| 8561 | * 2) These are called: | ||
| 8562 | * - BEFORE asking for a transport | ||
| 8563 | * - AFTER param serialization (s.data is a string if s.processData is true) | ||
| 8564 | * 3) key is the dataType | ||
| 8565 | * 4) the catchall symbol "*" can be used | ||
| 8566 | * 5) execution will start with transport dataType and THEN continue down to "*" if needed | ||
| 8567 | */ | ||
| 8568 | prefilters = {}, | ||
| 8569 | |||
| 8570 | /* Transports bindings | ||
| 8571 | * 1) key is the dataType | ||
| 8572 | * 2) the catchall symbol "*" can be used | ||
| 8573 | * 3) selection will start with transport dataType and THEN go to "*" if needed | ||
| 8574 | */ | ||
| 8575 | transports = {}, | ||
| 8576 | |||
| 8577 | // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression | ||
| 8578 | allTypes = "*/".concat("*"); | ||
| 8579 | |||
| 8580 | // #8138, IE may throw an exception when accessing | ||
| 8581 | // a field from window.location if document.domain has been set | ||
| 8582 | try { | ||
| 8583 | ajaxLocation = location.href; | ||
| 8584 | } catch( e ) { | ||
| 8585 | // Use the href attribute of an A element | ||
| 8586 | // since IE will modify it given document.location | ||
| 8587 | ajaxLocation = document.createElement( "a" ); | ||
| 8588 | ajaxLocation.href = ""; | ||
| 8589 | ajaxLocation = ajaxLocation.href; | ||
| 8590 | } | ||
| 8591 | |||
| 8592 | // Segment location into parts | ||
| 8593 | ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; | ||
| 8594 | |||
| 8595 | // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport | ||
| 8596 | function addToPrefiltersOrTransports( structure ) { | ||
| 8597 | |||
| 8598 | // dataTypeExpression is optional and defaults to "*" | ||
| 8599 | return function( dataTypeExpression, func ) { | ||
| 8600 | |||
| 8601 | if ( typeof dataTypeExpression !== "string" ) { | ||
| 8602 | func = dataTypeExpression; | ||
| 8603 | dataTypeExpression = "*"; | ||
| 8604 | } | ||
| 8605 | |||
| 8606 | var dataType, | ||
| 8607 | i = 0, | ||
| 8608 | dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; | ||
| 8609 | |||
| 8610 | if ( jQuery.isFunction( func ) ) { | ||
| 8611 | // For each dataType in the dataTypeExpression | ||
| 8612 | while ( (dataType = dataTypes[i++]) ) { | ||
| 8613 | // Prepend if requested | ||
| 8614 | if ( dataType.charAt( 0 ) === "+" ) { | ||
| 8615 | dataType = dataType.slice( 1 ) || "*"; | ||
| 8616 | (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); | ||
| 8617 | |||
| 8618 | // Otherwise append | ||
| 8619 | } else { | ||
| 8620 | (structure[ dataType ] = structure[ dataType ] || []).push( func ); | ||
| 8621 | } | ||
| 8622 | } | ||
| 8623 | } | ||
| 8624 | }; | ||
| 8625 | } | ||
| 8626 | |||
| 8627 | // Base inspection function for prefilters and transports | ||
| 8628 | function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { | ||
| 8629 | |||
| 8630 | var inspected = {}, | ||
| 8631 | seekingTransport = ( structure === transports ); | ||
| 8632 | |||
| 8633 | function inspect( dataType ) { | ||
| 8634 | var selected; | ||
| 8635 | inspected[ dataType ] = true; | ||
| 8636 | jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { | ||
| 8637 | var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); | ||
| 8638 | if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { | ||
| 8639 | options.dataTypes.unshift( dataTypeOrTransport ); | ||
| 8640 | inspect( dataTypeOrTransport ); | ||
| 8641 | return false; | ||
| 8642 | } else if ( seekingTransport ) { | ||
| 8643 | return !( selected = dataTypeOrTransport ); | ||
| 8644 | } | ||
| 8645 | }); | ||
| 8646 | return selected; | ||
| 8647 | } | ||
| 8648 | |||
| 8649 | return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); | ||
| 8650 | } | ||
| 8651 | |||
| 8652 | // A special extend for ajax options | ||
| 8653 | // that takes "flat" options (not to be deep extended) | ||
| 8654 | // Fixes #9887 | ||
| 8655 | function ajaxExtend( target, src ) { | ||
| 8656 | var deep, key, | ||
| 8657 | flatOptions = jQuery.ajaxSettings.flatOptions || {}; | ||
| 8658 | |||
| 8659 | for ( key in src ) { | ||
| 8660 | if ( src[ key ] !== undefined ) { | ||
| 8661 | ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; | ||
| 8662 | } | ||
| 8663 | } | ||
| 8664 | if ( deep ) { | ||
| 8665 | jQuery.extend( true, target, deep ); | ||
| 8666 | } | ||
| 8667 | |||
| 8668 | return target; | ||
| 8669 | } | ||
| 8670 | |||
| 8671 | /* Handles responses to an ajax request: | ||
| 8672 | * - finds the right dataType (mediates between content-type and expected dataType) | ||
| 8673 | * - returns the corresponding response | ||
| 8674 | */ | ||
| 8675 | function ajaxHandleResponses( s, jqXHR, responses ) { | ||
| 8676 | var firstDataType, ct, finalDataType, type, | ||
| 8677 | contents = s.contents, | ||
| 8678 | dataTypes = s.dataTypes; | ||
| 8679 | |||
| 8680 | // Remove auto dataType and get content-type in the process | ||
| 8681 | while ( dataTypes[ 0 ] === "*" ) { | ||
| 8682 | dataTypes.shift(); | ||
| 8683 | if ( ct === undefined ) { | ||
| 8684 | ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); | ||
| 8685 | } | ||
| 8686 | } | ||
| 8687 | |||
| 8688 | // Check if we're dealing with a known content-type | ||
| 8689 | if ( ct ) { | ||
| 8690 | for ( type in contents ) { | ||
| 8691 | if ( contents[ type ] && contents[ type ].test( ct ) ) { | ||
| 8692 | dataTypes.unshift( type ); | ||
| 8693 | break; | ||
| 8694 | } | ||
| 8695 | } | ||
| 8696 | } | ||
| 8697 | |||
| 8698 | // Check to see if we have a response for the expected dataType | ||
| 8699 | if ( dataTypes[ 0 ] in responses ) { | ||
| 8700 | finalDataType = dataTypes[ 0 ]; | ||
| 8701 | } else { | ||
| 8702 | // Try convertible dataTypes | ||
| 8703 | for ( type in responses ) { | ||
| 8704 | if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { | ||
| 8705 | finalDataType = type; | ||
| 8706 | break; | ||
| 8707 | } | ||
| 8708 | if ( !firstDataType ) { | ||
| 8709 | firstDataType = type; | ||
| 8710 | } | ||
| 8711 | } | ||
| 8712 | // Or just use first one | ||
| 8713 | finalDataType = finalDataType || firstDataType; | ||
| 8714 | } | ||
| 8715 | |||
| 8716 | // If we found a dataType | ||
| 8717 | // We add the dataType to the list if needed | ||
| 8718 | // and return the corresponding response | ||
| 8719 | if ( finalDataType ) { | ||
| 8720 | if ( finalDataType !== dataTypes[ 0 ] ) { | ||
| 8721 | dataTypes.unshift( finalDataType ); | ||
| 8722 | } | ||
| 8723 | return responses[ finalDataType ]; | ||
| 8724 | } | ||
| 8725 | } | ||
| 8726 | |||
| 8727 | /* Chain conversions given the request and the original response | ||
| 8728 | * Also sets the responseXXX fields on the jqXHR instance | ||
| 8729 | */ | ||
| 8730 | function ajaxConvert( s, response, jqXHR, isSuccess ) { | ||
| 8731 | var conv2, current, conv, tmp, prev, | ||
| 8732 | converters = {}, | ||
| 8733 | // Work with a copy of dataTypes in case we need to modify it for conversion | ||
| 8734 | dataTypes = s.dataTypes.slice(); | ||
| 8735 | |||
| 8736 | // Create converters map with lowercased keys | ||
| 8737 | if ( dataTypes[ 1 ] ) { | ||
| 8738 | for ( conv in s.converters ) { | ||
| 8739 | converters[ conv.toLowerCase() ] = s.converters[ conv ]; | ||
| 8740 | } | ||
| 8741 | } | ||
| 8742 | |||
| 8743 | current = dataTypes.shift(); | ||
| 8744 | |||
| 8745 | // Convert to each sequential dataType | ||
| 8746 | while ( current ) { | ||
| 8747 | |||
| 8748 | if ( s.responseFields[ current ] ) { | ||
| 8749 | jqXHR[ s.responseFields[ current ] ] = response; | ||
| 8750 | } | ||
| 8751 | |||
| 8752 | // Apply the dataFilter if provided | ||
| 8753 | if ( !prev && isSuccess && s.dataFilter ) { | ||
| 8754 | response = s.dataFilter( response, s.dataType ); | ||
| 8755 | } | ||
| 8756 | |||
| 8757 | prev = current; | ||
| 8758 | current = dataTypes.shift(); | ||
| 8759 | |||
| 8760 | if ( current ) { | ||
| 8761 | |||
| 8762 | // There's only work to do if current dataType is non-auto | ||
| 8763 | if ( current === "*" ) { | ||
| 8764 | |||
| 8765 | current = prev; | ||
| 8766 | |||
| 8767 | // Convert response if prev dataType is non-auto and differs from current | ||
| 8768 | } else if ( prev !== "*" && prev !== current ) { | ||
| 8769 | |||
| 8770 | // Seek a direct converter | ||
| 8771 | conv = converters[ prev + " " + current ] || converters[ "* " + current ]; | ||
| 8772 | |||
| 8773 | // If none found, seek a pair | ||
| 8774 | if ( !conv ) { | ||
| 8775 | for ( conv2 in converters ) { | ||
| 8776 | |||
| 8777 | // If conv2 outputs current | ||
| 8778 | tmp = conv2.split( " " ); | ||
| 8779 | if ( tmp[ 1 ] === current ) { | ||
| 8780 | |||
| 8781 | // If prev can be converted to accepted input | ||
| 8782 | conv = converters[ prev + " " + tmp[ 0 ] ] || | ||
| 8783 | converters[ "* " + tmp[ 0 ] ]; | ||
| 8784 | if ( conv ) { | ||
| 8785 | // Condense equivalence converters | ||
| 8786 | if ( conv === true ) { | ||
| 8787 | conv = converters[ conv2 ]; | ||
| 8788 | |||
| 8789 | // Otherwise, insert the intermediate dataType | ||
| 8790 | } else if ( converters[ conv2 ] !== true ) { | ||
| 8791 | current = tmp[ 0 ]; | ||
| 8792 | dataTypes.unshift( tmp[ 1 ] ); | ||
| 8793 | } | ||
| 8794 | break; | ||
| 8795 | } | ||
| 8796 | } | ||
| 8797 | } | ||
| 8798 | } | ||
| 8799 | |||
| 8800 | // Apply converter (if not an equivalence) | ||
| 8801 | if ( conv !== true ) { | ||
| 8802 | |||
| 8803 | // Unless errors are allowed to bubble, catch and return them | ||
| 8804 | if ( conv && s[ "throws" ] ) { | ||
| 8805 | response = conv( response ); | ||
| 8806 | } else { | ||
| 8807 | try { | ||
| 8808 | response = conv( response ); | ||
| 8809 | } catch ( e ) { | ||
| 8810 | return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; | ||
| 8811 | } | ||
| 8812 | } | ||
| 8813 | } | ||
| 8814 | } | ||
| 8815 | } | ||
| 8816 | } | ||
| 8817 | |||
| 8818 | return { state: "success", data: response }; | ||
| 8819 | } | ||
| 8820 | |||
| 8821 | jQuery.extend({ | ||
| 8822 | |||
| 8823 | // Counter for holding the number of active queries | ||
| 8824 | active: 0, | ||
| 8825 | |||
| 8826 | // Last-Modified header cache for next request | ||
| 8827 | lastModified: {}, | ||
| 8828 | etag: {}, | ||
| 8829 | |||
| 8830 | ajaxSettings: { | ||
| 8831 | url: ajaxLocation, | ||
| 8832 | type: "GET", | ||
| 8833 | isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), | ||
| 8834 | global: true, | ||
| 8835 | processData: true, | ||
| 8836 | async: true, | ||
| 8837 | contentType: "application/x-www-form-urlencoded; charset=UTF-8", | ||
| 8838 | /* | ||
| 8839 | timeout: 0, | ||
| 8840 | data: null, | ||
| 8841 | dataType: null, | ||
| 8842 | username: null, | ||
| 8843 | password: null, | ||
| 8844 | cache: null, | ||
| 8845 | throws: false, | ||
| 8846 | traditional: false, | ||
| 8847 | headers: {}, | ||
| 8848 | */ | ||
| 8849 | |||
| 8850 | accepts: { | ||
| 8851 | "*": allTypes, | ||
| 8852 | text: "text/plain", | ||
| 8853 | html: "text/html", | ||
| 8854 | xml: "application/xml, text/xml", | ||
| 8855 | json: "application/json, text/javascript" | ||
| 8856 | }, | ||
| 8857 | |||
| 8858 | contents: { | ||
| 8859 | xml: /xml/, | ||
| 8860 | html: /html/, | ||
| 8861 | json: /json/ | ||
| 8862 | }, | ||
| 8863 | |||
| 8864 | responseFields: { | ||
| 8865 | xml: "responseXML", | ||
| 8866 | text: "responseText", | ||
| 8867 | json: "responseJSON" | ||
| 8868 | }, | ||
| 8869 | |||
| 8870 | // Data converters | ||
| 8871 | // Keys separate source (or catchall "*") and destination types with a single space | ||
| 8872 | converters: { | ||
| 8873 | |||
| 8874 | // Convert anything to text | ||
| 8875 | "* text": String, | ||
| 8876 | |||
| 8877 | // Text to html (true = no transformation) | ||
| 8878 | "text html": true, | ||
| 8879 | |||
| 8880 | // Evaluate text as a json expression | ||
| 8881 | "text json": jQuery.parseJSON, | ||
| 8882 | |||
| 8883 | // Parse text as xml | ||
| 8884 | "text xml": jQuery.parseXML | ||
| 8885 | }, | ||
| 8886 | |||
| 8887 | // For options that shouldn't be deep extended: | ||
| 8888 | // you can add your own custom options here if | ||
| 8889 | // and when you create one that shouldn't be | ||
| 8890 | // deep extended (see ajaxExtend) | ||
| 8891 | flatOptions: { | ||
| 8892 | url: true, | ||
| 8893 | context: true | ||
| 8894 | } | ||
| 8895 | }, | ||
| 8896 | |||
| 8897 | // Creates a full fledged settings object into target | ||
| 8898 | // with both ajaxSettings and settings fields. | ||
| 8899 | // If target is omitted, writes into ajaxSettings. | ||
| 8900 | ajaxSetup: function( target, settings ) { | ||
| 8901 | return settings ? | ||
| 8902 | |||
| 8903 | // Building a settings object | ||
| 8904 | ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : | ||
| 8905 | |||
| 8906 | // Extending ajaxSettings | ||
| 8907 | ajaxExtend( jQuery.ajaxSettings, target ); | ||
| 8908 | }, | ||
| 8909 | |||
| 8910 | ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), | ||
| 8911 | ajaxTransport: addToPrefiltersOrTransports( transports ), | ||
| 8912 | |||
| 8913 | // Main method | ||
| 8914 | ajax: function( url, options ) { | ||
| 8915 | |||
| 8916 | // If url is an object, simulate pre-1.5 signature | ||
| 8917 | if ( typeof url === "object" ) { | ||
| 8918 | options = url; | ||
| 8919 | url = undefined; | ||
| 8920 | } | ||
| 8921 | |||
| 8922 | // Force options to be an object | ||
| 8923 | options = options || {}; | ||
| 8924 | |||
| 8925 | var // Cross-domain detection vars | ||
| 8926 | parts, | ||
| 8927 | // Loop variable | ||
| 8928 | i, | ||
| 8929 | // URL without anti-cache param | ||
| 8930 | cacheURL, | ||
| 8931 | // Response headers as string | ||
| 8932 | responseHeadersString, | ||
| 8933 | // timeout handle | ||
| 8934 | timeoutTimer, | ||
| 8935 | |||
| 8936 | // To know if global events are to be dispatched | ||
| 8937 | fireGlobals, | ||
| 8938 | |||
| 8939 | transport, | ||
| 8940 | // Response headers | ||
| 8941 | responseHeaders, | ||
| 8942 | // Create the final options object | ||
| 8943 | s = jQuery.ajaxSetup( {}, options ), | ||
| 8944 | // Callbacks context | ||
| 8945 | callbackContext = s.context || s, | ||
| 8946 | // Context for global events is callbackContext if it is a DOM node or jQuery collection | ||
| 8947 | globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? | ||
| 8948 | jQuery( callbackContext ) : | ||
| 8949 | jQuery.event, | ||
| 8950 | // Deferreds | ||
| 8951 | deferred = jQuery.Deferred(), | ||
| 8952 | completeDeferred = jQuery.Callbacks("once memory"), | ||
| 8953 | // Status-dependent callbacks | ||
| 8954 | statusCode = s.statusCode || {}, | ||
| 8955 | // Headers (they are sent all at once) | ||
| 8956 | requestHeaders = {}, | ||
| 8957 | requestHeadersNames = {}, | ||
| 8958 | // The jqXHR state | ||
| 8959 | state = 0, | ||
| 8960 | // Default abort message | ||
| 8961 | strAbort = "canceled", | ||
| 8962 | // Fake xhr | ||
| 8963 | jqXHR = { | ||
| 8964 | readyState: 0, | ||
| 8965 | |||
| 8966 | // Builds headers hashtable if needed | ||
| 8967 | getResponseHeader: function( key ) { | ||
| 8968 | var match; | ||
| 8969 | if ( state === 2 ) { | ||
| 8970 | if ( !responseHeaders ) { | ||
| 8971 | responseHeaders = {}; | ||
| 8972 | while ( (match = rheaders.exec( responseHeadersString )) ) { | ||
| 8973 | responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; | ||
| 8974 | } | ||
| 8975 | } | ||
| 8976 | match = responseHeaders[ key.toLowerCase() ]; | ||
| 8977 | } | ||
| 8978 | return match == null ? null : match; | ||
| 8979 | }, | ||
| 8980 | |||
| 8981 | // Raw string | ||
| 8982 | getAllResponseHeaders: function() { | ||
| 8983 | return state === 2 ? responseHeadersString : null; | ||
| 8984 | }, | ||
| 8985 | |||
| 8986 | // Caches the header | ||
| 8987 | setRequestHeader: function( name, value ) { | ||
| 8988 | var lname = name.toLowerCase(); | ||
| 8989 | if ( !state ) { | ||
| 8990 | name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; | ||
| 8991 | requestHeaders[ name ] = value; | ||
| 8992 | } | ||
| 8993 | return this; | ||
| 8994 | }, | ||
| 8995 | |||
| 8996 | // Overrides response content-type header | ||
| 8997 | overrideMimeType: function( type ) { | ||
| 8998 | if ( !state ) { | ||
| 8999 | s.mimeType = type; | ||
| 9000 | } | ||
| 9001 | return this; | ||
| 9002 | }, | ||
| 9003 | |||
| 9004 | // Status-dependent callbacks | ||
| 9005 | statusCode: function( map ) { | ||
| 9006 | var code; | ||
| 9007 | if ( map ) { | ||
| 9008 | if ( state < 2 ) { | ||
| 9009 | for ( code in map ) { | ||
| 9010 | // Lazy-add the new callback in a way that preserves old ones | ||
| 9011 | statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; | ||
| 9012 | } | ||
| 9013 | } else { | ||
| 9014 | // Execute the appropriate callbacks | ||
| 9015 | jqXHR.always( map[ jqXHR.status ] ); | ||
| 9016 | } | ||
| 9017 | } | ||
| 9018 | return this; | ||
| 9019 | }, | ||
| 9020 | |||
| 9021 | // Cancel the request | ||
| 9022 | abort: function( statusText ) { | ||
| 9023 | var finalText = statusText || strAbort; | ||
| 9024 | if ( transport ) { | ||
| 9025 | transport.abort( finalText ); | ||
| 9026 | } | ||
| 9027 | done( 0, finalText ); | ||
| 9028 | return this; | ||
| 9029 | } | ||
| 9030 | }; | ||
| 9031 | |||
| 9032 | // Attach deferreds | ||
| 9033 | deferred.promise( jqXHR ).complete = completeDeferred.add; | ||
| 9034 | jqXHR.success = jqXHR.done; | ||
| 9035 | jqXHR.error = jqXHR.fail; | ||
| 9036 | |||
| 9037 | // Remove hash character (#7531: and string promotion) | ||
| 9038 | // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) | ||
| 9039 | // Handle falsy url in the settings object (#10093: consistency with old signature) | ||
| 9040 | // We also use the url parameter if available | ||
| 9041 | s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); | ||
| 9042 | |||
| 9043 | // Alias method option to type as per ticket #12004 | ||
| 9044 | s.type = options.method || options.type || s.method || s.type; | ||
| 9045 | |||
| 9046 | // Extract dataTypes list | ||
| 9047 | s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; | ||
| 9048 | |||
| 9049 | // A cross-domain request is in order when we have a protocol:host:port mismatch | ||
| 9050 | if ( s.crossDomain == null ) { | ||
| 9051 | parts = rurl.exec( s.url.toLowerCase() ); | ||
| 9052 | s.crossDomain = !!( parts && | ||
| 9053 | ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || | ||
| 9054 | ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== | ||
| 9055 | ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) | ||
| 9056 | ); | ||
| 9057 | } | ||
| 9058 | |||
| 9059 | // Convert data if not already a string | ||
| 9060 | if ( s.data && s.processData && typeof s.data !== "string" ) { | ||
| 9061 | s.data = jQuery.param( s.data, s.traditional ); | ||
| 9062 | } | ||
| 9063 | |||
| 9064 | // Apply prefilters | ||
| 9065 | inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); | ||
| 9066 | |||
| 9067 | // If request was aborted inside a prefilter, stop there | ||
| 9068 | if ( state === 2 ) { | ||
| 9069 | return jqXHR; | ||
| 9070 | } | ||
| 9071 | |||
| 9072 | // We can fire global events as of now if asked to | ||
| 9073 | fireGlobals = s.global; | ||
| 9074 | |||
| 9075 | // Watch for a new set of requests | ||
| 9076 | if ( fireGlobals && jQuery.active++ === 0 ) { | ||
| 9077 | jQuery.event.trigger("ajaxStart"); | ||
| 9078 | } | ||
| 9079 | |||
| 9080 | // Uppercase the type | ||
| 9081 | s.type = s.type.toUpperCase(); | ||
| 9082 | |||
| 9083 | // Determine if request has content | ||
| 9084 | s.hasContent = !rnoContent.test( s.type ); | ||
| 9085 | |||
| 9086 | // Save the URL in case we're toying with the If-Modified-Since | ||
| 9087 | // and/or If-None-Match header later on | ||
| 9088 | cacheURL = s.url; | ||
| 9089 | |||
| 9090 | // More options handling for requests with no content | ||
| 9091 | if ( !s.hasContent ) { | ||
| 9092 | |||
| 9093 | // If data is available, append data to url | ||
| 9094 | if ( s.data ) { | ||
| 9095 | cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); | ||
| 9096 | // #9682: remove data so that it's not used in an eventual retry | ||
| 9097 | delete s.data; | ||
| 9098 | } | ||
| 9099 | |||
| 9100 | // Add anti-cache in url if needed | ||
| 9101 | if ( s.cache === false ) { | ||
| 9102 | s.url = rts.test( cacheURL ) ? | ||
| 9103 | |||
| 9104 | // If there is already a '_' parameter, set its value | ||
| 9105 | cacheURL.replace( rts, "$1_=" + nonce++ ) : | ||
| 9106 | |||
| 9107 | // Otherwise add one to the end | ||
| 9108 | cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; | ||
| 9109 | } | ||
| 9110 | } | ||
| 9111 | |||
| 9112 | // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. | ||
| 9113 | if ( s.ifModified ) { | ||
| 9114 | if ( jQuery.lastModified[ cacheURL ] ) { | ||
| 9115 | jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); | ||
| 9116 | } | ||
| 9117 | if ( jQuery.etag[ cacheURL ] ) { | ||
| 9118 | jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); | ||
| 9119 | } | ||
| 9120 | } | ||
| 9121 | |||
| 9122 | // Set the correct header, if data is being sent | ||
| 9123 | if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { | ||
| 9124 | jqXHR.setRequestHeader( "Content-Type", s.contentType ); | ||
| 9125 | } | ||
| 9126 | |||
| 9127 | // Set the Accepts header for the server, depending on the dataType | ||
| 9128 | jqXHR.setRequestHeader( | ||
| 9129 | "Accept", | ||
| 9130 | s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? | ||
| 9131 | s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : | ||
| 9132 | s.accepts[ "*" ] | ||
| 9133 | ); | ||
| 9134 | |||
| 9135 | // Check for headers option | ||
| 9136 | for ( i in s.headers ) { | ||
| 9137 | jqXHR.setRequestHeader( i, s.headers[ i ] ); | ||
| 9138 | } | ||
| 9139 | |||
| 9140 | // Allow custom headers/mimetypes and early abort | ||
| 9141 | if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { | ||
| 9142 | // Abort if not done already and return | ||
| 9143 | return jqXHR.abort(); | ||
| 9144 | } | ||
| 9145 | |||
| 9146 | // aborting is no longer a cancellation | ||
| 9147 | strAbort = "abort"; | ||
| 9148 | |||
| 9149 | // Install callbacks on deferreds | ||
| 9150 | for ( i in { success: 1, error: 1, complete: 1 } ) { | ||
| 9151 | jqXHR[ i ]( s[ i ] ); | ||
| 9152 | } | ||
| 9153 | |||
| 9154 | // Get transport | ||
| 9155 | transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); | ||
| 9156 | |||
| 9157 | // If no transport, we auto-abort | ||
| 9158 | if ( !transport ) { | ||
| 9159 | done( -1, "No Transport" ); | ||
| 9160 | } else { | ||
| 9161 | jqXHR.readyState = 1; | ||
| 9162 | |||
| 9163 | // Send global event | ||
| 9164 | if ( fireGlobals ) { | ||
| 9165 | globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); | ||
| 9166 | } | ||
| 9167 | // Timeout | ||
| 9168 | if ( s.async && s.timeout > 0 ) { | ||
| 9169 | timeoutTimer = setTimeout(function() { | ||
| 9170 | jqXHR.abort("timeout"); | ||
| 9171 | }, s.timeout ); | ||
| 9172 | } | ||
| 9173 | |||
| 9174 | try { | ||
| 9175 | state = 1; | ||
| 9176 | transport.send( requestHeaders, done ); | ||
| 9177 | } catch ( e ) { | ||
| 9178 | // Propagate exception as error if not done | ||
| 9179 | if ( state < 2 ) { | ||
| 9180 | done( -1, e ); | ||
| 9181 | // Simply rethrow otherwise | ||
| 9182 | } else { | ||
| 9183 | throw e; | ||
| 9184 | } | ||
| 9185 | } | ||
| 9186 | } | ||
| 9187 | |||
| 9188 | // Callback for when everything is done | ||
| 9189 | function done( status, nativeStatusText, responses, headers ) { | ||
| 9190 | var isSuccess, success, error, response, modified, | ||
| 9191 | statusText = nativeStatusText; | ||
| 9192 | |||
| 9193 | // Called once | ||
| 9194 | if ( state === 2 ) { | ||
| 9195 | return; | ||
| 9196 | } | ||
| 9197 | |||
| 9198 | // State is "done" now | ||
| 9199 | state = 2; | ||
| 9200 | |||
| 9201 | // Clear timeout if it exists | ||
| 9202 | if ( timeoutTimer ) { | ||
| 9203 | clearTimeout( timeoutTimer ); | ||
| 9204 | } | ||
| 9205 | |||
| 9206 | // Dereference transport for early garbage collection | ||
| 9207 | // (no matter how long the jqXHR object will be used) | ||
| 9208 | transport = undefined; | ||
| 9209 | |||
| 9210 | // Cache response headers | ||
| 9211 | responseHeadersString = headers || ""; | ||
| 9212 | |||
| 9213 | // Set readyState | ||
| 9214 | jqXHR.readyState = status > 0 ? 4 : 0; | ||
| 9215 | |||
| 9216 | // Determine if successful | ||
| 9217 | isSuccess = status >= 200 && status < 300 || status === 304; | ||
| 9218 | |||
| 9219 | // Get response data | ||
| 9220 | if ( responses ) { | ||
| 9221 | response = ajaxHandleResponses( s, jqXHR, responses ); | ||
| 9222 | } | ||
| 9223 | |||
| 9224 | // Convert no matter what (that way responseXXX fields are always set) | ||
| 9225 | response = ajaxConvert( s, response, jqXHR, isSuccess ); | ||
| 9226 | |||
| 9227 | // If successful, handle type chaining | ||
| 9228 | if ( isSuccess ) { | ||
| 9229 | |||
| 9230 | // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. | ||
| 9231 | if ( s.ifModified ) { | ||
| 9232 | modified = jqXHR.getResponseHeader("Last-Modified"); | ||
| 9233 | if ( modified ) { | ||
| 9234 | jQuery.lastModified[ cacheURL ] = modified; | ||
| 9235 | } | ||
| 9236 | modified = jqXHR.getResponseHeader("etag"); | ||
| 9237 | if ( modified ) { | ||
| 9238 | jQuery.etag[ cacheURL ] = modified; | ||
| 9239 | } | ||
| 9240 | } | ||
| 9241 | |||
| 9242 | // if no content | ||
| 9243 | if ( status === 204 || s.type === "HEAD" ) { | ||
| 9244 | statusText = "nocontent"; | ||
| 9245 | |||
| 9246 | // if not modified | ||
| 9247 | } else if ( status === 304 ) { | ||
| 9248 | statusText = "notmodified"; | ||
| 9249 | |||
| 9250 | // If we have data, let's convert it | ||
| 9251 | } else { | ||
| 9252 | statusText = response.state; | ||
| 9253 | success = response.data; | ||
| 9254 | error = response.error; | ||
| 9255 | isSuccess = !error; | ||
| 9256 | } | ||
| 9257 | } else { | ||
| 9258 | // We extract error from statusText | ||
| 9259 | // then normalize statusText and status for non-aborts | ||
| 9260 | error = statusText; | ||
| 9261 | if ( status || !statusText ) { | ||
| 9262 | statusText = "error"; | ||
| 9263 | if ( status < 0 ) { | ||
| 9264 | status = 0; | ||
| 9265 | } | ||
| 9266 | } | ||
| 9267 | } | ||
| 9268 | |||
| 9269 | // Set data for the fake xhr object | ||
| 9270 | jqXHR.status = status; | ||
| 9271 | jqXHR.statusText = ( nativeStatusText || statusText ) + ""; | ||
| 9272 | |||
| 9273 | // Success/Error | ||
| 9274 | if ( isSuccess ) { | ||
| 9275 | deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); | ||
| 9276 | } else { | ||
| 9277 | deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); | ||
| 9278 | } | ||
| 9279 | |||
| 9280 | // Status-dependent callbacks | ||
| 9281 | jqXHR.statusCode( statusCode ); | ||
| 9282 | statusCode = undefined; | ||
| 9283 | |||
| 9284 | if ( fireGlobals ) { | ||
| 9285 | globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", | ||
| 9286 | [ jqXHR, s, isSuccess ? success : error ] ); | ||
| 9287 | } | ||
| 9288 | |||
| 9289 | // Complete | ||
| 9290 | completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); | ||
| 9291 | |||
| 9292 | if ( fireGlobals ) { | ||
| 9293 | globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); | ||
| 9294 | // Handle the global AJAX counter | ||
| 9295 | if ( !( --jQuery.active ) ) { | ||
| 9296 | jQuery.event.trigger("ajaxStop"); | ||
| 9297 | } | ||
| 9298 | } | ||
| 9299 | } | ||
| 9300 | |||
| 9301 | return jqXHR; | ||
| 9302 | }, | ||
| 9303 | |||
| 9304 | getJSON: function( url, data, callback ) { | ||
| 9305 | return jQuery.get( url, data, callback, "json" ); | ||
| 9306 | }, | ||
| 9307 | |||
| 9308 | getScript: function( url, callback ) { | ||
| 9309 | return jQuery.get( url, undefined, callback, "script" ); | ||
| 9310 | } | ||
| 9311 | }); | ||
| 9312 | |||
| 9313 | jQuery.each( [ "get", "post" ], function( i, method ) { | ||
| 9314 | jQuery[ method ] = function( url, data, callback, type ) { | ||
| 9315 | // shift arguments if data argument was omitted | ||
| 9316 | if ( jQuery.isFunction( data ) ) { | ||
| 9317 | type = type || callback; | ||
| 9318 | callback = data; | ||
| 9319 | data = undefined; | ||
| 9320 | } | ||
| 9321 | |||
| 9322 | return jQuery.ajax({ | ||
| 9323 | url: url, | ||
| 9324 | type: method, | ||
| 9325 | dataType: type, | ||
| 9326 | data: data, | ||
| 9327 | success: callback | ||
| 9328 | }); | ||
| 9329 | }; | ||
| 9330 | }); | ||
| 9331 | |||
| 9332 | // Attach a bunch of functions for handling common AJAX events | ||
| 9333 | jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { | ||
| 9334 | jQuery.fn[ type ] = function( fn ) { | ||
| 9335 | return this.on( type, fn ); | ||
| 9336 | }; | ||
| 9337 | }); | ||
| 9338 | |||
| 9339 | |||
| 9340 | jQuery._evalUrl = function( url ) { | ||
| 9341 | return jQuery.ajax({ | ||
| 9342 | url: url, | ||
| 9343 | type: "GET", | ||
| 9344 | dataType: "script", | ||
| 9345 | async: false, | ||
| 9346 | global: false, | ||
| 9347 | "throws": true | ||
| 9348 | }); | ||
| 9349 | }; | ||
| 9350 | |||
| 9351 | |||
| 9352 | jQuery.fn.extend({ | ||
| 9353 | wrapAll: function( html ) { | ||
| 9354 | if ( jQuery.isFunction( html ) ) { | ||
| 9355 | return this.each(function(i) { | ||
| 9356 | jQuery(this).wrapAll( html.call(this, i) ); | ||
| 9357 | }); | ||
| 9358 | } | ||
| 9359 | |||
| 9360 | if ( this[0] ) { | ||
| 9361 | // The elements to wrap the target around | ||
| 9362 | var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); | ||
| 9363 | |||
| 9364 | if ( this[0].parentNode ) { | ||
| 9365 | wrap.insertBefore( this[0] ); | ||
| 9366 | } | ||
| 9367 | |||
| 9368 | wrap.map(function() { | ||
| 9369 | var elem = this; | ||
| 9370 | |||
| 9371 | while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { | ||
| 9372 | elem = elem.firstChild; | ||
| 9373 | } | ||
| 9374 | |||
| 9375 | return elem; | ||
| 9376 | }).append( this ); | ||
| 9377 | } | ||
| 9378 | |||
| 9379 | return this; | ||
| 9380 | }, | ||
| 9381 | |||
| 9382 | wrapInner: function( html ) { | ||
| 9383 | if ( jQuery.isFunction( html ) ) { | ||
| 9384 | return this.each(function(i) { | ||
| 9385 | jQuery(this).wrapInner( html.call(this, i) ); | ||
| 9386 | }); | ||
| 9387 | } | ||
| 9388 | |||
| 9389 | return this.each(function() { | ||
| 9390 | var self = jQuery( this ), | ||
| 9391 | contents = self.contents(); | ||
| 9392 | |||
| 9393 | if ( contents.length ) { | ||
| 9394 | contents.wrapAll( html ); | ||
| 9395 | |||
| 9396 | } else { | ||
| 9397 | self.append( html ); | ||
| 9398 | } | ||
| 9399 | }); | ||
| 9400 | }, | ||
| 9401 | |||
| 9402 | wrap: function( html ) { | ||
| 9403 | var isFunction = jQuery.isFunction( html ); | ||
| 9404 | |||
| 9405 | return this.each(function(i) { | ||
| 9406 | jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); | ||
| 9407 | }); | ||
| 9408 | }, | ||
| 9409 | |||
| 9410 | unwrap: function() { | ||
| 9411 | return this.parent().each(function() { | ||
| 9412 | if ( !jQuery.nodeName( this, "body" ) ) { | ||
| 9413 | jQuery( this ).replaceWith( this.childNodes ); | ||
| 9414 | } | ||
| 9415 | }).end(); | ||
| 9416 | } | ||
| 9417 | }); | ||
| 9418 | |||
| 9419 | |||
| 9420 | jQuery.expr.filters.hidden = function( elem ) { | ||
| 9421 | // Support: Opera <= 12.12 | ||
| 9422 | // Opera reports offsetWidths and offsetHeights less than zero on some elements | ||
| 9423 | return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || | ||
| 9424 | (!support.reliableHiddenOffsets() && | ||
| 9425 | ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); | ||
| 9426 | }; | ||
| 9427 | |||
| 9428 | jQuery.expr.filters.visible = function( elem ) { | ||
| 9429 | return !jQuery.expr.filters.hidden( elem ); | ||
| 9430 | }; | ||
| 9431 | |||
| 9432 | |||
| 9433 | |||
| 9434 | |||
| 9435 | var r20 = /%20/g, | ||
| 9436 | rbracket = /\[\]$/, | ||
| 9437 | rCRLF = /\r?\n/g, | ||
| 9438 | rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, | ||
| 9439 | rsubmittable = /^(?:input|select|textarea|keygen)/i; | ||
| 9440 | |||
| 9441 | function buildParams( prefix, obj, traditional, add ) { | ||
| 9442 | var name; | ||
| 9443 | |||
| 9444 | if ( jQuery.isArray( obj ) ) { | ||
| 9445 | // Serialize array item. | ||
| 9446 | jQuery.each( obj, function( i, v ) { | ||
| 9447 | if ( traditional || rbracket.test( prefix ) ) { | ||
| 9448 | // Treat each array item as a scalar. | ||
| 9449 | add( prefix, v ); | ||
| 9450 | |||
| 9451 | } else { | ||
| 9452 | // Item is non-scalar (array or object), encode its numeric index. | ||
| 9453 | buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); | ||
| 9454 | } | ||
| 9455 | }); | ||
| 9456 | |||
| 9457 | } else if ( !traditional && jQuery.type( obj ) === "object" ) { | ||
| 9458 | // Serialize object item. | ||
| 9459 | for ( name in obj ) { | ||
| 9460 | buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); | ||
| 9461 | } | ||
| 9462 | |||
| 9463 | } else { | ||
| 9464 | // Serialize scalar item. | ||
| 9465 | add( prefix, obj ); | ||
| 9466 | } | ||
| 9467 | } | ||
| 9468 | |||
| 9469 | // Serialize an array of form elements or a set of | ||
| 9470 | // key/values into a query string | ||
| 9471 | jQuery.param = function( a, traditional ) { | ||
| 9472 | var prefix, | ||
| 9473 | s = [], | ||
| 9474 | add = function( key, value ) { | ||
| 9475 | // If value is a function, invoke it and return its value | ||
| 9476 | value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); | ||
| 9477 | s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); | ||
| 9478 | }; | ||
| 9479 | |||
| 9480 | // Set traditional to true for jQuery <= 1.3.2 behavior. | ||
| 9481 | if ( traditional === undefined ) { | ||
| 9482 | traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; | ||
| 9483 | } | ||
| 9484 | |||
| 9485 | // If an array was passed in, assume that it is an array of form elements. | ||
| 9486 | if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { | ||
| 9487 | // Serialize the form elements | ||
| 9488 | jQuery.each( a, function() { | ||
| 9489 | add( this.name, this.value ); | ||
| 9490 | }); | ||
| 9491 | |||
| 9492 | } else { | ||
| 9493 | // If traditional, encode the "old" way (the way 1.3.2 or older | ||
| 9494 | // did it), otherwise encode params recursively. | ||
| 9495 | for ( prefix in a ) { | ||
| 9496 | buildParams( prefix, a[ prefix ], traditional, add ); | ||
| 9497 | } | ||
| 9498 | } | ||
| 9499 | |||
| 9500 | // Return the resulting serialization | ||
| 9501 | return s.join( "&" ).replace( r20, "+" ); | ||
| 9502 | }; | ||
| 9503 | |||
| 9504 | jQuery.fn.extend({ | ||
| 9505 | serialize: function() { | ||
| 9506 | return jQuery.param( this.serializeArray() ); | ||
| 9507 | }, | ||
| 9508 | serializeArray: function() { | ||
| 9509 | return this.map(function() { | ||
| 9510 | // Can add propHook for "elements" to filter or add form elements | ||
| 9511 | var elements = jQuery.prop( this, "elements" ); | ||
| 9512 | return elements ? jQuery.makeArray( elements ) : this; | ||
| 9513 | }) | ||
| 9514 | .filter(function() { | ||
| 9515 | var type = this.type; | ||
| 9516 | // Use .is(":disabled") so that fieldset[disabled] works | ||
| 9517 | return this.name && !jQuery( this ).is( ":disabled" ) && | ||
| 9518 | rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && | ||
| 9519 | ( this.checked || !rcheckableType.test( type ) ); | ||
| 9520 | }) | ||
| 9521 | .map(function( i, elem ) { | ||
| 9522 | var val = jQuery( this ).val(); | ||
| 9523 | |||
| 9524 | return val == null ? | ||
| 9525 | null : | ||
| 9526 | jQuery.isArray( val ) ? | ||
| 9527 | jQuery.map( val, function( val ) { | ||
| 9528 | return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; | ||
| 9529 | }) : | ||
| 9530 | { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; | ||
| 9531 | }).get(); | ||
| 9532 | } | ||
| 9533 | }); | ||
| 9534 | |||
| 9535 | |||
| 9536 | // Create the request object | ||
| 9537 | // (This is still attached to ajaxSettings for backward compatibility) | ||
| 9538 | jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? | ||
| 9539 | // Support: IE6+ | ||
| 9540 | function() { | ||
| 9541 | |||
| 9542 | // XHR cannot access local files, always use ActiveX for that case | ||
| 9543 | return !this.isLocal && | ||
| 9544 | |||
| 9545 | // Support: IE7-8 | ||
| 9546 | // oldIE XHR does not support non-RFC2616 methods (#13240) | ||
| 9547 | // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx | ||
| 9548 | // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 | ||
| 9549 | // Although this check for six methods instead of eight | ||
| 9550 | // since IE also does not support "trace" and "connect" | ||
| 9551 | /^(get|post|head|put|delete|options)$/i.test( this.type ) && | ||
| 9552 | |||
| 9553 | createStandardXHR() || createActiveXHR(); | ||
| 9554 | } : | ||
| 9555 | // For all other browsers, use the standard XMLHttpRequest object | ||
| 9556 | createStandardXHR; | ||
| 9557 | |||
| 9558 | var xhrId = 0, | ||
| 9559 | xhrCallbacks = {}, | ||
| 9560 | xhrSupported = jQuery.ajaxSettings.xhr(); | ||
| 9561 | |||
| 9562 | // Support: IE<10 | ||
| 9563 | // Open requests must be manually aborted on unload (#5280) | ||
| 9564 | if ( window.ActiveXObject ) { | ||
| 9565 | jQuery( window ).on( "unload", function() { | ||
| 9566 | for ( var key in xhrCallbacks ) { | ||
| 9567 | xhrCallbacks[ key ]( undefined, true ); | ||
| 9568 | } | ||
| 9569 | }); | ||
| 9570 | } | ||
| 9571 | |||
| 9572 | // Determine support properties | ||
| 9573 | support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); | ||
| 9574 | xhrSupported = support.ajax = !!xhrSupported; | ||
| 9575 | |||
| 9576 | // Create transport if the browser can provide an xhr | ||
| 9577 | if ( xhrSupported ) { | ||
| 9578 | |||
| 9579 | jQuery.ajaxTransport(function( options ) { | ||
| 9580 | // Cross domain only allowed if supported through XMLHttpRequest | ||
| 9581 | if ( !options.crossDomain || support.cors ) { | ||
| 9582 | |||
| 9583 | var callback; | ||
| 9584 | |||
| 9585 | return { | ||
| 9586 | send: function( headers, complete ) { | ||
| 9587 | var i, | ||
| 9588 | xhr = options.xhr(), | ||
| 9589 | id = ++xhrId; | ||
| 9590 | |||
| 9591 | // Open the socket | ||
| 9592 | xhr.open( options.type, options.url, options.async, options.username, options.password ); | ||
| 9593 | |||
| 9594 | // Apply custom fields if provided | ||
| 9595 | if ( options.xhrFields ) { | ||
| 9596 | for ( i in options.xhrFields ) { | ||
| 9597 | xhr[ i ] = options.xhrFields[ i ]; | ||
| 9598 | } | ||
| 9599 | } | ||
| 9600 | |||
| 9601 | // Override mime type if needed | ||
| 9602 | if ( options.mimeType && xhr.overrideMimeType ) { | ||
| 9603 | xhr.overrideMimeType( options.mimeType ); | ||
| 9604 | } | ||
| 9605 | |||
| 9606 | // X-Requested-With header | ||
| 9607 | // For cross-domain requests, seeing as conditions for a preflight are | ||
| 9608 | // akin to a jigsaw puzzle, we simply never set it to be sure. | ||
| 9609 | // (it can always be set on a per-request basis or even using ajaxSetup) | ||
| 9610 | // For same-domain requests, won't change header if already provided. | ||
| 9611 | if ( !options.crossDomain && !headers["X-Requested-With"] ) { | ||
| 9612 | headers["X-Requested-With"] = "XMLHttpRequest"; | ||
| 9613 | } | ||
| 9614 | |||
| 9615 | // Set headers | ||
| 9616 | for ( i in headers ) { | ||
| 9617 | // Support: IE<9 | ||
| 9618 | // IE's ActiveXObject throws a 'Type Mismatch' exception when setting | ||
| 9619 | // request header to a null-value. | ||
| 9620 | // | ||
| 9621 | // To keep consistent with other XHR implementations, cast the value | ||
| 9622 | // to string and ignore `undefined`. | ||
| 9623 | if ( headers[ i ] !== undefined ) { | ||
| 9624 | xhr.setRequestHeader( i, headers[ i ] + "" ); | ||
| 9625 | } | ||
| 9626 | } | ||
| 9627 | |||
| 9628 | // Do send the request | ||
| 9629 | // This may raise an exception which is actually | ||
| 9630 | // handled in jQuery.ajax (so no try/catch here) | ||
| 9631 | xhr.send( ( options.hasContent && options.data ) || null ); | ||
| 9632 | |||
| 9633 | // Listener | ||
| 9634 | callback = function( _, isAbort ) { | ||
| 9635 | var status, statusText, responses; | ||
| 9636 | |||
| 9637 | // Was never called and is aborted or complete | ||
| 9638 | if ( callback && ( isAbort || xhr.readyState === 4 ) ) { | ||
| 9639 | // Clean up | ||
| 9640 | delete xhrCallbacks[ id ]; | ||
| 9641 | callback = undefined; | ||
| 9642 | xhr.onreadystatechange = jQuery.noop; | ||
| 9643 | |||
| 9644 | // Abort manually if needed | ||
| 9645 | if ( isAbort ) { | ||
| 9646 | if ( xhr.readyState !== 4 ) { | ||
| 9647 | xhr.abort(); | ||
| 9648 | } | ||
| 9649 | } else { | ||
| 9650 | responses = {}; | ||
| 9651 | status = xhr.status; | ||
| 9652 | |||
| 9653 | // Support: IE<10 | ||
| 9654 | // Accessing binary-data responseText throws an exception | ||
| 9655 | // (#11426) | ||
| 9656 | if ( typeof xhr.responseText === "string" ) { | ||
| 9657 | responses.text = xhr.responseText; | ||
| 9658 | } | ||
| 9659 | |||
| 9660 | // Firefox throws an exception when accessing | ||
| 9661 | // statusText for faulty cross-domain requests | ||
| 9662 | try { | ||
| 9663 | statusText = xhr.statusText; | ||
| 9664 | } catch( e ) { | ||
| 9665 | // We normalize with Webkit giving an empty statusText | ||
| 9666 | statusText = ""; | ||
| 9667 | } | ||
| 9668 | |||
| 9669 | // Filter status for non standard behaviors | ||
| 9670 | |||
| 9671 | // If the request is local and we have data: assume a success | ||
| 9672 | // (success with no data won't get notified, that's the best we | ||
| 9673 | // can do given current implementations) | ||
| 9674 | if ( !status && options.isLocal && !options.crossDomain ) { | ||
| 9675 | status = responses.text ? 200 : 404; | ||
| 9676 | // IE - #1450: sometimes returns 1223 when it should be 204 | ||
| 9677 | } else if ( status === 1223 ) { | ||
| 9678 | status = 204; | ||
| 9679 | } | ||
| 9680 | } | ||
| 9681 | } | ||
| 9682 | |||
| 9683 | // Call complete if needed | ||
| 9684 | if ( responses ) { | ||
| 9685 | complete( status, statusText, responses, xhr.getAllResponseHeaders() ); | ||
| 9686 | } | ||
| 9687 | }; | ||
| 9688 | |||
| 9689 | if ( !options.async ) { | ||
| 9690 | // if we're in sync mode we fire the callback | ||
| 9691 | callback(); | ||
| 9692 | } else if ( xhr.readyState === 4 ) { | ||
| 9693 | // (IE6 & IE7) if it's in cache and has been | ||
| 9694 | // retrieved directly we need to fire the callback | ||
| 9695 | setTimeout( callback ); | ||
| 9696 | } else { | ||
| 9697 | // Add to the list of active xhr callbacks | ||
| 9698 | xhr.onreadystatechange = xhrCallbacks[ id ] = callback; | ||
| 9699 | } | ||
| 9700 | }, | ||
| 9701 | |||
| 9702 | abort: function() { | ||
| 9703 | if ( callback ) { | ||
| 9704 | callback( undefined, true ); | ||
| 9705 | } | ||
| 9706 | } | ||
| 9707 | }; | ||
| 9708 | } | ||
| 9709 | }); | ||
| 9710 | } | ||
| 9711 | |||
| 9712 | // Functions to create xhrs | ||
| 9713 | function createStandardXHR() { | ||
| 9714 | try { | ||
| 9715 | return new window.XMLHttpRequest(); | ||
| 9716 | } catch( e ) {} | ||
| 9717 | } | ||
| 9718 | |||
| 9719 | function createActiveXHR() { | ||
| 9720 | try { | ||
| 9721 | return new window.ActiveXObject( "Microsoft.XMLHTTP" ); | ||
| 9722 | } catch( e ) {} | ||
| 9723 | } | ||
| 9724 | |||
| 9725 | |||
| 9726 | |||
| 9727 | |||
| 9728 | // Install script dataType | ||
| 9729 | jQuery.ajaxSetup({ | ||
| 9730 | accepts: { | ||
| 9731 | script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" | ||
| 9732 | }, | ||
| 9733 | contents: { | ||
| 9734 | script: /(?:java|ecma)script/ | ||
| 9735 | }, | ||
| 9736 | converters: { | ||
| 9737 | "text script": function( text ) { | ||
| 9738 | jQuery.globalEval( text ); | ||
| 9739 | return text; | ||
| 9740 | } | ||
| 9741 | } | ||
| 9742 | }); | ||
| 9743 | |||
| 9744 | // Handle cache's special case and global | ||
| 9745 | jQuery.ajaxPrefilter( "script", function( s ) { | ||
| 9746 | if ( s.cache === undefined ) { | ||
| 9747 | s.cache = false; | ||
| 9748 | } | ||
| 9749 | if ( s.crossDomain ) { | ||
| 9750 | s.type = "GET"; | ||
| 9751 | s.global = false; | ||
| 9752 | } | ||
| 9753 | }); | ||
| 9754 | |||
| 9755 | // Bind script tag hack transport | ||
| 9756 | jQuery.ajaxTransport( "script", function(s) { | ||
| 9757 | |||
| 9758 | // This transport only deals with cross domain requests | ||
| 9759 | if ( s.crossDomain ) { | ||
| 9760 | |||
| 9761 | var script, | ||
| 9762 | head = document.head || jQuery("head")[0] || document.documentElement; | ||
| 9763 | |||
| 9764 | return { | ||
| 9765 | |||
| 9766 | send: function( _, callback ) { | ||
| 9767 | |||
| 9768 | script = document.createElement("script"); | ||
| 9769 | |||
| 9770 | script.async = true; | ||
| 9771 | |||
| 9772 | if ( s.scriptCharset ) { | ||
| 9773 | script.charset = s.scriptCharset; | ||
| 9774 | } | ||
| 9775 | |||
| 9776 | script.src = s.url; | ||
| 9777 | |||
| 9778 | // Attach handlers for all browsers | ||
| 9779 | script.onload = script.onreadystatechange = function( _, isAbort ) { | ||
| 9780 | |||
| 9781 | if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { | ||
| 9782 | |||
| 9783 | // Handle memory leak in IE | ||
| 9784 | script.onload = script.onreadystatechange = null; | ||
| 9785 | |||
| 9786 | // Remove the script | ||
| 9787 | if ( script.parentNode ) { | ||
| 9788 | script.parentNode.removeChild( script ); | ||
| 9789 | } | ||
| 9790 | |||
| 9791 | // Dereference the script | ||
| 9792 | script = null; | ||
| 9793 | |||
| 9794 | // Callback if not abort | ||
| 9795 | if ( !isAbort ) { | ||
| 9796 | callback( 200, "success" ); | ||
| 9797 | } | ||
| 9798 | } | ||
| 9799 | }; | ||
| 9800 | |||
| 9801 | // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending | ||
| 9802 | // Use native DOM manipulation to avoid our domManip AJAX trickery | ||
| 9803 | head.insertBefore( script, head.firstChild ); | ||
| 9804 | }, | ||
| 9805 | |||
| 9806 | abort: function() { | ||
| 9807 | if ( script ) { | ||
| 9808 | script.onload( undefined, true ); | ||
| 9809 | } | ||
| 9810 | } | ||
| 9811 | }; | ||
| 9812 | } | ||
| 9813 | }); | ||
| 9814 | |||
| 9815 | |||
| 9816 | |||
| 9817 | |||
| 9818 | var oldCallbacks = [], | ||
| 9819 | rjsonp = /(=)\?(?=&|$)|\?\?/; | ||
| 9820 | |||
| 9821 | // Default jsonp settings | ||
| 9822 | jQuery.ajaxSetup({ | ||
| 9823 | jsonp: "callback", | ||
| 9824 | jsonpCallback: function() { | ||
| 9825 | var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); | ||
| 9826 | this[ callback ] = true; | ||
| 9827 | return callback; | ||
| 9828 | } | ||
| 9829 | }); | ||
| 9830 | |||
| 9831 | // Detect, normalize options and install callbacks for jsonp requests | ||
| 9832 | jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { | ||
| 9833 | |||
| 9834 | var callbackName, overwritten, responseContainer, | ||
| 9835 | jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? | ||
| 9836 | "url" : | ||
| 9837 | typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" | ||
| 9838 | ); | ||
| 9839 | |||
| 9840 | // Handle iff the expected data type is "jsonp" or we have a parameter to set | ||
| 9841 | if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { | ||
| 9842 | |||
| 9843 | // Get callback name, remembering preexisting value associated with it | ||
| 9844 | callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? | ||
| 9845 | s.jsonpCallback() : | ||
| 9846 | s.jsonpCallback; | ||
| 9847 | |||
| 9848 | // Insert callback into url or form data | ||
| 9849 | if ( jsonProp ) { | ||
| 9850 | s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); | ||
| 9851 | } else if ( s.jsonp !== false ) { | ||
| 9852 | s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; | ||
| 9853 | } | ||
| 9854 | |||
| 9855 | // Use data converter to retrieve json after script execution | ||
| 9856 | s.converters["script json"] = function() { | ||
| 9857 | if ( !responseContainer ) { | ||
| 9858 | jQuery.error( callbackName + " was not called" ); | ||
| 9859 | } | ||
| 9860 | return responseContainer[ 0 ]; | ||
| 9861 | }; | ||
| 9862 | |||
| 9863 | // force json dataType | ||
| 9864 | s.dataTypes[ 0 ] = "json"; | ||
| 9865 | |||
| 9866 | // Install callback | ||
| 9867 | overwritten = window[ callbackName ]; | ||
| 9868 | window[ callbackName ] = function() { | ||
| 9869 | responseContainer = arguments; | ||
| 9870 | }; | ||
| 9871 | |||
| 9872 | // Clean-up function (fires after converters) | ||
| 9873 | jqXHR.always(function() { | ||
| 9874 | // Restore preexisting value | ||
| 9875 | window[ callbackName ] = overwritten; | ||
| 9876 | |||
| 9877 | // Save back as free | ||
| 9878 | if ( s[ callbackName ] ) { | ||
| 9879 | // make sure that re-using the options doesn't screw things around | ||
| 9880 | s.jsonpCallback = originalSettings.jsonpCallback; | ||
| 9881 | |||
| 9882 | // save the callback name for future use | ||
| 9883 | oldCallbacks.push( callbackName ); | ||
| 9884 | } | ||
| 9885 | |||
| 9886 | // Call if it was a function and we have a response | ||
| 9887 | if ( responseContainer && jQuery.isFunction( overwritten ) ) { | ||
| 9888 | overwritten( responseContainer[ 0 ] ); | ||
| 9889 | } | ||
| 9890 | |||
| 9891 | responseContainer = overwritten = undefined; | ||
| 9892 | }); | ||
| 9893 | |||
| 9894 | // Delegate to script | ||
| 9895 | return "script"; | ||
| 9896 | } | ||
| 9897 | }); | ||
| 9898 | |||
| 9899 | |||
| 9900 | |||
| 9901 | |||
| 9902 | // data: string of html | ||
| 9903 | // context (optional): If specified, the fragment will be created in this context, defaults to document | ||
| 9904 | // keepScripts (optional): If true, will include scripts passed in the html string | ||
| 9905 | jQuery.parseHTML = function( data, context, keepScripts ) { | ||
| 9906 | if ( !data || typeof data !== "string" ) { | ||
| 9907 | return null; | ||
| 9908 | } | ||
| 9909 | if ( typeof context === "boolean" ) { | ||
| 9910 | keepScripts = context; | ||
| 9911 | context = false; | ||
| 9912 | } | ||
| 9913 | context = context || document; | ||
| 9914 | |||
| 9915 | var parsed = rsingleTag.exec( data ), | ||
| 9916 | scripts = !keepScripts && []; | ||
| 9917 | |||
| 9918 | // Single tag | ||
| 9919 | if ( parsed ) { | ||
| 9920 | return [ context.createElement( parsed[1] ) ]; | ||
| 9921 | } | ||
| 9922 | |||
| 9923 | parsed = jQuery.buildFragment( [ data ], context, scripts ); | ||
| 9924 | |||
| 9925 | if ( scripts && scripts.length ) { | ||
| 9926 | jQuery( scripts ).remove(); | ||
| 9927 | } | ||
| 9928 | |||
| 9929 | return jQuery.merge( [], parsed.childNodes ); | ||
| 9930 | }; | ||
| 9931 | |||
| 9932 | |||
| 9933 | // Keep a copy of the old load method | ||
| 9934 | var _load = jQuery.fn.load; | ||
| 9935 | |||
| 9936 | /** | ||
| 9937 | * Load a url into a page | ||
| 9938 | */ | ||
| 9939 | jQuery.fn.load = function( url, params, callback ) { | ||
| 9940 | if ( typeof url !== "string" && _load ) { | ||
| 9941 | return _load.apply( this, arguments ); | ||
| 9942 | } | ||
| 9943 | |||
| 9944 | var selector, response, type, | ||
| 9945 | self = this, | ||
| 9946 | off = url.indexOf(" "); | ||
| 9947 | |||
| 9948 | if ( off >= 0 ) { | ||
| 9949 | selector = jQuery.trim( url.slice( off, url.length ) ); | ||
| 9950 | url = url.slice( 0, off ); | ||
| 9951 | } | ||
| 9952 | |||
| 9953 | // If it's a function | ||
| 9954 | if ( jQuery.isFunction( params ) ) { | ||
| 9955 | |||
| 9956 | // We assume that it's the callback | ||
| 9957 | callback = params; | ||
| 9958 | params = undefined; | ||
| 9959 | |||
| 9960 | // Otherwise, build a param string | ||
| 9961 | } else if ( params && typeof params === "object" ) { | ||
| 9962 | type = "POST"; | ||
| 9963 | } | ||
| 9964 | |||
| 9965 | // If we have elements to modify, make the request | ||
| 9966 | if ( self.length > 0 ) { | ||
| 9967 | jQuery.ajax({ | ||
| 9968 | url: url, | ||
| 9969 | |||
| 9970 | // if "type" variable is undefined, then "GET" method will be used | ||
| 9971 | type: type, | ||
| 9972 | dataType: "html", | ||
| 9973 | data: params | ||
| 9974 | }).done(function( responseText ) { | ||
| 9975 | |||
| 9976 | // Save response for use in complete callback | ||
| 9977 | response = arguments; | ||
| 9978 | |||
| 9979 | self.html( selector ? | ||
| 9980 | |||
| 9981 | // If a selector was specified, locate the right elements in a dummy div | ||
| 9982 | // Exclude scripts to avoid IE 'Permission Denied' errors | ||
| 9983 | jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : | ||
| 9984 | |||
| 9985 | // Otherwise use the full result | ||
| 9986 | responseText ); | ||
| 9987 | |||
| 9988 | }).complete( callback && function( jqXHR, status ) { | ||
| 9989 | self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); | ||
| 9990 | }); | ||
| 9991 | } | ||
| 9992 | |||
| 9993 | return this; | ||
| 9994 | }; | ||
| 9995 | |||
| 9996 | |||
| 9997 | |||
| 9998 | |||
| 9999 | jQuery.expr.filters.animated = function( elem ) { | ||
| 10000 | return jQuery.grep(jQuery.timers, function( fn ) { | ||
| 10001 | return elem === fn.elem; | ||
| 10002 | }).length; | ||
| 10003 | }; | ||
| 10004 | |||
| 10005 | |||
| 10006 | |||
| 10007 | |||
| 10008 | |||
| 10009 | var docElem = window.document.documentElement; | ||
| 10010 | |||
| 10011 | /** | ||
| 10012 | * Gets a window from an element | ||
| 10013 | */ | ||
| 10014 | function getWindow( elem ) { | ||
| 10015 | return jQuery.isWindow( elem ) ? | ||
| 10016 | elem : | ||
| 10017 | elem.nodeType === 9 ? | ||
| 10018 | elem.defaultView || elem.parentWindow : | ||
| 10019 | false; | ||
| 10020 | } | ||
| 10021 | |||
| 10022 | jQuery.offset = { | ||
| 10023 | setOffset: function( elem, options, i ) { | ||
| 10024 | var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, | ||
| 10025 | position = jQuery.css( elem, "position" ), | ||
| 10026 | curElem = jQuery( elem ), | ||
| 10027 | props = {}; | ||
| 10028 | |||
| 10029 | // set position first, in-case top/left are set even on static elem | ||
| 10030 | if ( position === "static" ) { | ||
| 10031 | elem.style.position = "relative"; | ||
| 10032 | } | ||
| 10033 | |||
| 10034 | curOffset = curElem.offset(); | ||
| 10035 | curCSSTop = jQuery.css( elem, "top" ); | ||
| 10036 | curCSSLeft = jQuery.css( elem, "left" ); | ||
| 10037 | calculatePosition = ( position === "absolute" || position === "fixed" ) && | ||
| 10038 | jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1; | ||
| 10039 | |||
| 10040 | // need to be able to calculate position if either top or left is auto and position is either absolute or fixed | ||
| 10041 | if ( calculatePosition ) { | ||
| 10042 | curPosition = curElem.position(); | ||
| 10043 | curTop = curPosition.top; | ||
| 10044 | curLeft = curPosition.left; | ||
| 10045 | } else { | ||
| 10046 | curTop = parseFloat( curCSSTop ) || 0; | ||
| 10047 | curLeft = parseFloat( curCSSLeft ) || 0; | ||
| 10048 | } | ||
| 10049 | |||
| 10050 | if ( jQuery.isFunction( options ) ) { | ||
| 10051 | options = options.call( elem, i, curOffset ); | ||
| 10052 | } | ||
| 10053 | |||
| 10054 | if ( options.top != null ) { | ||
| 10055 | props.top = ( options.top - curOffset.top ) + curTop; | ||
| 10056 | } | ||
| 10057 | if ( options.left != null ) { | ||
| 10058 | props.left = ( options.left - curOffset.left ) + curLeft; | ||
| 10059 | } | ||
| 10060 | |||
| 10061 | if ( "using" in options ) { | ||
| 10062 | options.using.call( elem, props ); | ||
| 10063 | } else { | ||
| 10064 | curElem.css( props ); | ||
| 10065 | } | ||
| 10066 | } | ||
| 10067 | }; | ||
| 10068 | |||
| 10069 | jQuery.fn.extend({ | ||
| 10070 | offset: function( options ) { | ||
| 10071 | if ( arguments.length ) { | ||
| 10072 | return options === undefined ? | ||
| 10073 | this : | ||
| 10074 | this.each(function( i ) { | ||
| 10075 | jQuery.offset.setOffset( this, options, i ); | ||
| 10076 | }); | ||
| 10077 | } | ||
| 10078 | |||
| 10079 | var docElem, win, | ||
| 10080 | box = { top: 0, left: 0 }, | ||
| 10081 | elem = this[ 0 ], | ||
| 10082 | doc = elem && elem.ownerDocument; | ||
| 10083 | |||
| 10084 | if ( !doc ) { | ||
| 10085 | return; | ||
| 10086 | } | ||
| 10087 | |||
| 10088 | docElem = doc.documentElement; | ||
| 10089 | |||
| 10090 | // Make sure it's not a disconnected DOM node | ||
| 10091 | if ( !jQuery.contains( docElem, elem ) ) { | ||
| 10092 | return box; | ||
| 10093 | } | ||
| 10094 | |||
| 10095 | // If we don't have gBCR, just use 0,0 rather than error | ||
| 10096 | // BlackBerry 5, iOS 3 (original iPhone) | ||
| 10097 | if ( typeof elem.getBoundingClientRect !== strundefined ) { | ||
| 10098 | box = elem.getBoundingClientRect(); | ||
| 10099 | } | ||
| 10100 | win = getWindow( doc ); | ||
| 10101 | return { | ||
| 10102 | top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), | ||
| 10103 | left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) | ||
| 10104 | }; | ||
| 10105 | }, | ||
| 10106 | |||
| 10107 | position: function() { | ||
| 10108 | if ( !this[ 0 ] ) { | ||
| 10109 | return; | ||
| 10110 | } | ||
| 10111 | |||
| 10112 | var offsetParent, offset, | ||
| 10113 | parentOffset = { top: 0, left: 0 }, | ||
| 10114 | elem = this[ 0 ]; | ||
| 10115 | |||
| 10116 | // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent | ||
| 10117 | if ( jQuery.css( elem, "position" ) === "fixed" ) { | ||
| 10118 | // we assume that getBoundingClientRect is available when computed position is fixed | ||
| 10119 | offset = elem.getBoundingClientRect(); | ||
| 10120 | } else { | ||
| 10121 | // Get *real* offsetParent | ||
| 10122 | offsetParent = this.offsetParent(); | ||
| 10123 | |||
| 10124 | // Get correct offsets | ||
| 10125 | offset = this.offset(); | ||
| 10126 | if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { | ||
| 10127 | parentOffset = offsetParent.offset(); | ||
| 10128 | } | ||
| 10129 | |||
| 10130 | // Add offsetParent borders | ||
| 10131 | parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); | ||
| 10132 | parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); | ||
| 10133 | } | ||
| 10134 | |||
| 10135 | // Subtract parent offsets and element margins | ||
| 10136 | // note: when an element has margin: auto the offsetLeft and marginLeft | ||
| 10137 | // are the same in Safari causing offset.left to incorrectly be 0 | ||
| 10138 | return { | ||
| 10139 | top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), | ||
| 10140 | left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) | ||
| 10141 | }; | ||
| 10142 | }, | ||
| 10143 | |||
| 10144 | offsetParent: function() { | ||
| 10145 | return this.map(function() { | ||
| 10146 | var offsetParent = this.offsetParent || docElem; | ||
| 10147 | |||
| 10148 | while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { | ||
| 10149 | offsetParent = offsetParent.offsetParent; | ||
| 10150 | } | ||
| 10151 | return offsetParent || docElem; | ||
| 10152 | }); | ||
| 10153 | } | ||
| 10154 | }); | ||
| 10155 | |||
| 10156 | // Create scrollLeft and scrollTop methods | ||
| 10157 | jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { | ||
| 10158 | var top = /Y/.test( prop ); | ||
| 10159 | |||
| 10160 | jQuery.fn[ method ] = function( val ) { | ||
| 10161 | return access( this, function( elem, method, val ) { | ||
| 10162 | var win = getWindow( elem ); | ||
| 10163 | |||
| 10164 | if ( val === undefined ) { | ||
| 10165 | return win ? (prop in win) ? win[ prop ] : | ||
| 10166 | win.document.documentElement[ method ] : | ||
| 10167 | elem[ method ]; | ||
| 10168 | } | ||
| 10169 | |||
| 10170 | if ( win ) { | ||
| 10171 | win.scrollTo( | ||
| 10172 | !top ? val : jQuery( win ).scrollLeft(), | ||
| 10173 | top ? val : jQuery( win ).scrollTop() | ||
| 10174 | ); | ||
| 10175 | |||
| 10176 | } else { | ||
| 10177 | elem[ method ] = val; | ||
| 10178 | } | ||
| 10179 | }, method, val, arguments.length, null ); | ||
| 10180 | }; | ||
| 10181 | }); | ||
| 10182 | |||
| 10183 | // Add the top/left cssHooks using jQuery.fn.position | ||
| 10184 | // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 | ||
| 10185 | // getComputedStyle returns percent when specified for top/left/bottom/right | ||
| 10186 | // rather than make the css module depend on the offset module, we just check for it here | ||
| 10187 | jQuery.each( [ "top", "left" ], function( i, prop ) { | ||
| 10188 | jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, | ||
| 10189 | function( elem, computed ) { | ||
| 10190 | if ( computed ) { | ||
| 10191 | computed = curCSS( elem, prop ); | ||
| 10192 | // if curCSS returns percentage, fallback to offset | ||
| 10193 | return rnumnonpx.test( computed ) ? | ||
| 10194 | jQuery( elem ).position()[ prop ] + "px" : | ||
| 10195 | computed; | ||
| 10196 | } | ||
| 10197 | } | ||
| 10198 | ); | ||
| 10199 | }); | ||
| 10200 | |||
| 10201 | |||
| 10202 | // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods | ||
| 10203 | jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { | ||
| 10204 | jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { | ||
| 10205 | // margin is only for outerHeight, outerWidth | ||
| 10206 | jQuery.fn[ funcName ] = function( margin, value ) { | ||
| 10207 | var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), | ||
| 10208 | extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); | ||
| 10209 | |||
| 10210 | return access( this, function( elem, type, value ) { | ||
| 10211 | var doc; | ||
| 10212 | |||
| 10213 | if ( jQuery.isWindow( elem ) ) { | ||
| 10214 | // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there | ||
| 10215 | // isn't a whole lot we can do. See pull request at this URL for discussion: | ||
| 10216 | // https://github.com/jquery/jquery/pull/764 | ||
| 10217 | return elem.document.documentElement[ "client" + name ]; | ||
| 10218 | } | ||
| 10219 | |||
| 10220 | // Get document width or height | ||
| 10221 | if ( elem.nodeType === 9 ) { | ||
| 10222 | doc = elem.documentElement; | ||
| 10223 | |||
| 10224 | // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest | ||
| 10225 | // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. | ||
| 10226 | return Math.max( | ||
| 10227 | elem.body[ "scroll" + name ], doc[ "scroll" + name ], | ||
| 10228 | elem.body[ "offset" + name ], doc[ "offset" + name ], | ||
| 10229 | doc[ "client" + name ] | ||
| 10230 | ); | ||
| 10231 | } | ||
| 10232 | |||
| 10233 | return value === undefined ? | ||
| 10234 | // Get width or height on the element, requesting but not forcing parseFloat | ||
| 10235 | jQuery.css( elem, type, extra ) : | ||
| 10236 | |||
| 10237 | // Set width or height on the element | ||
| 10238 | jQuery.style( elem, type, value, extra ); | ||
| 10239 | }, type, chainable ? margin : undefined, chainable, null ); | ||
| 10240 | }; | ||
| 10241 | }); | ||
| 10242 | }); | ||
| 10243 | |||
| 10244 | |||
| 10245 | // The number of elements contained in the matched element set | ||
| 10246 | jQuery.fn.size = function() { | ||
| 10247 | return this.length; | ||
| 10248 | }; | ||
| 10249 | |||
| 10250 | jQuery.fn.andSelf = jQuery.fn.addBack; | ||
| 10251 | |||
| 10252 | |||
| 10253 | |||
| 10254 | |||
| 10255 | // Register as a named AMD module, since jQuery can be concatenated with other | ||
| 10256 | // files that may use define, but not via a proper concatenation script that | ||
| 10257 | // understands anonymous AMD modules. A named AMD is safest and most robust | ||
| 10258 | // way to register. Lowercase jquery is used because AMD module names are | ||
| 10259 | // derived from file names, and jQuery is normally delivered in a lowercase | ||
| 10260 | // file name. Do this after creating the global so that if an AMD module wants | ||
| 10261 | // to call noConflict to hide this version of jQuery, it will work. | ||
| 10262 | |||
| 10263 | // Note that for maximum portability, libraries that are not jQuery should | ||
| 10264 | // declare themselves as anonymous modules, and avoid setting a global if an | ||
| 10265 | // AMD loader is present. jQuery is a special case. For more information, see | ||
| 10266 | // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon | ||
| 10267 | |||
| 10268 | if ( typeof define === "function" && define.amd ) { | ||
| 10269 | define( "jquery", [], function() { | ||
| 10270 | return jQuery; | ||
| 10271 | }); | ||
| 10272 | } | ||
| 10273 | |||
| 10274 | |||
| 10275 | |||
| 10276 | |||
| 10277 | var | ||
| 10278 | // Map over jQuery in case of overwrite | ||
| 10279 | _jQuery = window.jQuery, | ||
| 10280 | |||
| 10281 | // Map over the $ in case of overwrite | ||
| 10282 | _$ = window.$; | ||
| 10283 | |||
| 10284 | jQuery.noConflict = function( deep ) { | ||
| 10285 | if ( window.$ === jQuery ) { | ||
| 10286 | window.$ = _$; | ||
| 10287 | } | ||
| 10288 | |||
| 10289 | if ( deep && window.jQuery === jQuery ) { | ||
| 10290 | window.jQuery = _jQuery; | ||
| 10291 | } | ||
| 10292 | |||
| 10293 | return jQuery; | ||
| 10294 | }; | ||
| 10295 | |||
| 10296 | // Expose jQuery and $ identifiers, even in | ||
| 10297 | // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) | ||
| 10298 | // and CommonJS for browser emulators (#13566) | ||
| 10299 | if ( typeof noGlobal === strundefined ) { | ||
| 10300 | window.jQuery = window.$ = jQuery; | ||
| 10301 | } | ||
| 10302 | |||
| 10303 | |||
| 10304 | |||
| 10305 | |||
| 10306 | return jQuery; | ||
| 10307 | |||
| 10308 | })); | ||
diff --git a/_static/jquery.js b/_static/jquery.js new file mode 100644 index 0000000..ab28a24 --- /dev/null +++ b/_static/jquery.js | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | /*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ | ||
| 2 | !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; | ||
| 3 | if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px") | ||
| 4 | },cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m}); | ||
diff --git a/_static/minus.png b/_static/minus.png new file mode 100644 index 0000000..0f22b16 --- /dev/null +++ b/_static/minus.png | |||
| Binary files differ | |||
diff --git a/_static/plus.png b/_static/plus.png new file mode 100644 index 0000000..0cfe084 --- /dev/null +++ b/_static/plus.png | |||
| Binary files differ | |||
diff --git a/_static/pygments.css b/_static/pygments.css new file mode 100644 index 0000000..57eadc0 --- /dev/null +++ b/_static/pygments.css | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | .highlight .hll { background-color: #ffffcc } | ||
| 2 | .highlight { background: #eeffcc; } | ||
| 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ | ||
| 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ | ||
| 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ | ||
| 6 | .highlight .o { color: #666666 } /* Operator */ | ||
| 7 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ | ||
| 8 | .highlight .cp { color: #007020 } /* Comment.Preproc */ | ||
| 9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ | ||
| 10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ | ||
| 11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ | ||
| 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ | ||
| 13 | .highlight .gr { color: #FF0000 } /* Generic.Error */ | ||
| 14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ | ||
| 15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ | ||
| 16 | .highlight .go { color: #333333 } /* Generic.Output */ | ||
| 17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ | ||
| 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ | ||
| 19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ | ||
| 20 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ | ||
| 21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ | ||
| 22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ | ||
| 23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ | ||
| 24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ | ||
| 25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ | ||
| 26 | .highlight .kt { color: #902000 } /* Keyword.Type */ | ||
| 27 | .highlight .m { color: #208050 } /* Literal.Number */ | ||
| 28 | .highlight .s { color: #4070a0 } /* Literal.String */ | ||
| 29 | .highlight .na { color: #4070a0 } /* Name.Attribute */ | ||
| 30 | .highlight .nb { color: #007020 } /* Name.Builtin */ | ||
| 31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ | ||
| 32 | .highlight .no { color: #60add5 } /* Name.Constant */ | ||
| 33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ | ||
| 34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ | ||
| 35 | .highlight .ne { color: #007020 } /* Name.Exception */ | ||
| 36 | .highlight .nf { color: #06287e } /* Name.Function */ | ||
| 37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ | ||
| 38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ | ||
| 39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ | ||
| 40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ | ||
| 41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ | ||
| 42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ | ||
| 43 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ | ||
| 44 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ | ||
| 45 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ | ||
| 46 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ | ||
| 47 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ | ||
| 48 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ | ||
| 49 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ | ||
| 50 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ | ||
| 51 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ | ||
| 52 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ | ||
| 53 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ | ||
| 54 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ | ||
| 55 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ | ||
| 56 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ | ||
| 57 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ | ||
| 58 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ | ||
| 59 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ | ||
| 60 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ | ||
| 61 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ | ||
| 62 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ | ||
| 63 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file | ||
diff --git a/_static/searchtools.js b/_static/searchtools.js new file mode 100644 index 0000000..0e794fd --- /dev/null +++ b/_static/searchtools.js | |||
| @@ -0,0 +1,622 @@ | |||
| 1 | /* | ||
| 2 | * searchtools.js_t | ||
| 3 | * ~~~~~~~~~~~~~~~~ | ||
| 4 | * | ||
| 5 | * Sphinx JavaScript utilties for the full-text search. | ||
| 6 | * | ||
| 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. | ||
| 8 | * :license: BSD, see LICENSE for details. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | |||
| 13 | /** | ||
| 14 | * Porter Stemmer | ||
| 15 | */ | ||
| 16 | var Stemmer = function() { | ||
| 17 | |||
| 18 | var step2list = { | ||
| 19 | ational: 'ate', | ||
| 20 | tional: 'tion', | ||
| 21 | enci: 'ence', | ||
| 22 | anci: 'ance', | ||
| 23 | izer: 'ize', | ||
| 24 | bli: 'ble', | ||
| 25 | alli: 'al', | ||
| 26 | entli: 'ent', | ||
| 27 | eli: 'e', | ||
| 28 | ousli: 'ous', | ||
| 29 | ization: 'ize', | ||
| 30 | ation: 'ate', | ||
| 31 | ator: 'ate', | ||
| 32 | alism: 'al', | ||
| 33 | iveness: 'ive', | ||
| 34 | fulness: 'ful', | ||
| 35 | ousness: 'ous', | ||
| 36 | aliti: 'al', | ||
| 37 | iviti: 'ive', | ||
| 38 | biliti: 'ble', | ||
| 39 | logi: 'log' | ||
| 40 | }; | ||
| 41 | |||
| 42 | var step3list = { | ||
| 43 | icate: 'ic', | ||
| 44 | ative: '', | ||
| 45 | alize: 'al', | ||
| 46 | iciti: 'ic', | ||
| 47 | ical: 'ic', | ||
| 48 | ful: '', | ||
| 49 | ness: '' | ||
| 50 | }; | ||
| 51 | |||
| 52 | var c = "[^aeiou]"; // consonant | ||
| 53 | var v = "[aeiouy]"; // vowel | ||
| 54 | var C = c + "[^aeiouy]*"; // consonant sequence | ||
| 55 | var V = v + "[aeiou]*"; // vowel sequence | ||
| 56 | |||
| 57 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 | ||
| 58 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 | ||
| 59 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 | ||
| 60 | var s_v = "^(" + C + ")?" + v; // vowel in stem | ||
| 61 | |||
| 62 | this.stemWord = function (w) { | ||
| 63 | var stem; | ||
| 64 | var suffix; | ||
| 65 | var firstch; | ||
| 66 | var origword = w; | ||
| 67 | |||
| 68 | if (w.length < 3) | ||
| 69 | return w; | ||
| 70 | |||
| 71 | var re; | ||
| 72 | var re2; | ||
| 73 | var re3; | ||
| 74 | var re4; | ||
| 75 | |||
| 76 | firstch = w.substr(0,1); | ||
| 77 | if (firstch == "y") | ||
| 78 | w = firstch.toUpperCase() + w.substr(1); | ||
| 79 | |||
| 80 | // Step 1a | ||
| 81 | re = /^(.+?)(ss|i)es$/; | ||
| 82 | re2 = /^(.+?)([^s])s$/; | ||
| 83 | |||
| 84 | if (re.test(w)) | ||
| 85 | w = w.replace(re,"$1$2"); | ||
| 86 | else if (re2.test(w)) | ||
| 87 | w = w.replace(re2,"$1$2"); | ||
| 88 | |||
| 89 | // Step 1b | ||
| 90 | re = /^(.+?)eed$/; | ||
| 91 | re2 = /^(.+?)(ed|ing)$/; | ||
| 92 | if (re.test(w)) { | ||
| 93 | var fp = re.exec(w); | ||
| 94 | re = new RegExp(mgr0); | ||
| 95 | if (re.test(fp[1])) { | ||
| 96 | re = /.$/; | ||
| 97 | w = w.replace(re,""); | ||
| 98 | } | ||
| 99 | } | ||
| 100 | else if (re2.test(w)) { | ||
| 101 | var fp = re2.exec(w); | ||
| 102 | stem = fp[1]; | ||
| 103 | re2 = new RegExp(s_v); | ||
| 104 | if (re2.test(stem)) { | ||
| 105 | w = stem; | ||
| 106 | re2 = /(at|bl|iz)$/; | ||
| 107 | re3 = new RegExp("([^aeiouylsz])\\1$"); | ||
| 108 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); | ||
| 109 | if (re2.test(w)) | ||
| 110 | w = w + "e"; | ||
| 111 | else if (re3.test(w)) { | ||
| 112 | re = /.$/; | ||
| 113 | w = w.replace(re,""); | ||
| 114 | } | ||
| 115 | else if (re4.test(w)) | ||
| 116 | w = w + "e"; | ||
| 117 | } | ||
| 118 | } | ||
| 119 | |||
| 120 | // Step 1c | ||
| 121 | re = /^(.+?)y$/; | ||
| 122 | if (re.test(w)) { | ||
| 123 | var fp = re.exec(w); | ||
| 124 | stem = fp[1]; | ||
| 125 | re = new RegExp(s_v); | ||
| 126 | if (re.test(stem)) | ||
| 127 | w = stem + "i"; | ||
| 128 | } | ||
| 129 | |||
| 130 | // Step 2 | ||
| 131 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; | ||
| 132 | if (re.test(w)) { | ||
| 133 | var fp = re.exec(w); | ||
| 134 | stem = fp[1]; | ||
| 135 | suffix = fp[2]; | ||
| 136 | re = new RegExp(mgr0); | ||
| 137 | if (re.test(stem)) | ||
| 138 | w = stem + step2list[suffix]; | ||
| 139 | } | ||
| 140 | |||
| 141 | // Step 3 | ||
| 142 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; | ||
| 143 | if (re.test(w)) { | ||
| 144 | var fp = re.exec(w); | ||
| 145 | stem = fp[1]; | ||
| 146 | suffix = fp[2]; | ||
| 147 | re = new RegExp(mgr0); | ||
| 148 | if (re.test(stem)) | ||
| 149 | w = stem + step3list[suffix]; | ||
| 150 | } | ||
| 151 | |||
| 152 | // Step 4 | ||
| 153 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; | ||
| 154 | re2 = /^(.+?)(s|t)(ion)$/; | ||
| 155 | if (re.test(w)) { | ||
| 156 | var fp = re.exec(w); | ||
| 157 | stem = fp[1]; | ||
| 158 | re = new RegExp(mgr1); | ||
| 159 | if (re.test(stem)) | ||
| 160 | w = stem; | ||
| 161 | } | ||
| 162 | else if (re2.test(w)) { | ||
| 163 | var fp = re2.exec(w); | ||
| 164 | stem = fp[1] + fp[2]; | ||
| 165 | re2 = new RegExp(mgr1); | ||
| 166 | if (re2.test(stem)) | ||
| 167 | w = stem; | ||
| 168 | } | ||
| 169 | |||
| 170 | // Step 5 | ||
| 171 | re = /^(.+?)e$/; | ||
| 172 | if (re.test(w)) { | ||
| 173 | var fp = re.exec(w); | ||
| 174 | stem = fp[1]; | ||
| 175 | re = new RegExp(mgr1); | ||
| 176 | re2 = new RegExp(meq1); | ||
| 177 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); | ||
| 178 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) | ||
| 179 | w = stem; | ||
| 180 | } | ||
| 181 | re = /ll$/; | ||
| 182 | re2 = new RegExp(mgr1); | ||
| 183 | if (re.test(w) && re2.test(w)) { | ||
| 184 | re = /.$/; | ||
| 185 | w = w.replace(re,""); | ||
| 186 | } | ||
| 187 | |||
| 188 | // and turn initial Y back to y | ||
| 189 | if (firstch == "y") | ||
| 190 | w = firstch.toLowerCase() + w.substr(1); | ||
| 191 | return w; | ||
| 192 | } | ||
| 193 | } | ||
| 194 | |||
| 195 | |||
| 196 | |||
| 197 | /** | ||
| 198 | * Simple result scoring code. | ||
| 199 | */ | ||
| 200 | var Scorer = { | ||
| 201 | // Implement the following function to further tweak the score for each result | ||
| 202 | // The function takes a result array [filename, title, anchor, descr, score] | ||
| 203 | // and returns the new score. | ||
| 204 | /* | ||
| 205 | score: function(result) { | ||
| 206 | return result[4]; | ||
| 207 | }, | ||
| 208 | */ | ||
| 209 | |||
| 210 | // query matches the full name of an object | ||
| 211 | objNameMatch: 11, | ||
| 212 | // or matches in the last dotted part of the object name | ||
| 213 | objPartialMatch: 6, | ||
| 214 | // Additive scores depending on the priority of the object | ||
| 215 | objPrio: {0: 15, // used to be importantResults | ||
| 216 | 1: 5, // used to be objectResults | ||
| 217 | 2: -5}, // used to be unimportantResults | ||
| 218 | // Used when the priority is not in the mapping. | ||
| 219 | objPrioDefault: 0, | ||
| 220 | |||
| 221 | // query found in title | ||
| 222 | title: 15, | ||
| 223 | // query found in terms | ||
| 224 | term: 5 | ||
| 225 | }; | ||
| 226 | |||
| 227 | |||
| 228 | /** | ||
| 229 | * Search Module | ||
| 230 | */ | ||
| 231 | var Search = { | ||
| 232 | |||
| 233 | _index : null, | ||
| 234 | _queued_query : null, | ||
| 235 | _pulse_status : -1, | ||
| 236 | |||
| 237 | init : function() { | ||
| 238 | var params = $.getQueryParameters(); | ||
| 239 | if (params.q) { | ||
| 240 | var query = params.q[0]; | ||
| 241 | $('input[name="q"]')[0].value = query; | ||
| 242 | this.performSearch(query); | ||
| 243 | } | ||
| 244 | }, | ||
| 245 | |||
| 246 | loadIndex : function(url) { | ||
| 247 | $.ajax({type: "GET", url: url, data: null, | ||
| 248 | dataType: "script", cache: true, | ||
| 249 | complete: function(jqxhr, textstatus) { | ||
| 250 | if (textstatus != "success") { | ||
| 251 | document.getElementById("searchindexloader").src = url; | ||
| 252 | } | ||
| 253 | }}); | ||
| 254 | }, | ||
| 255 | |||
| 256 | setIndex : function(index) { | ||
| 257 | var q; | ||
| 258 | this._index = index; | ||
| 259 | if ((q = this._queued_query) !== null) { | ||
| 260 | this._queued_query = null; | ||
| 261 | Search.query(q); | ||
| 262 | } | ||
| 263 | }, | ||
| 264 | |||
| 265 | hasIndex : function() { | ||
| 266 | return this._index !== null; | ||
| 267 | }, | ||
| 268 | |||
| 269 | deferQuery : function(query) { | ||
| 270 | this._queued_query = query; | ||
| 271 | }, | ||
| 272 | |||
| 273 | stopPulse : function() { | ||
| 274 | this._pulse_status = 0; | ||
| 275 | }, | ||
| 276 | |||
| 277 | startPulse : function() { | ||
| 278 | if (this._pulse_status >= 0) | ||
| 279 | return; | ||
| 280 | function pulse() { | ||
| 281 | var i; | ||
| 282 | Search._pulse_status = (Search._pulse_status + 1) % 4; | ||
| 283 | var dotString = ''; | ||
| 284 | for (i = 0; i < Search._pulse_status; i++) | ||
| 285 | dotString += '.'; | ||
| 286 | Search.dots.text(dotString); | ||
| 287 | if (Search._pulse_status > -1) | ||
| 288 | window.setTimeout(pulse, 500); | ||
| 289 | } | ||
| 290 | pulse(); | ||
| 291 | }, | ||
| 292 | |||
| 293 | /** | ||
| 294 | * perform a search for something (or wait until index is loaded) | ||
| 295 | */ | ||
| 296 | performSearch : function(query) { | ||
| 297 | // create the required interface elements | ||
| 298 | this.out = $('#search-results'); | ||
| 299 | this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out); | ||
| 300 | this.dots = $('<span></span>').appendTo(this.title); | ||
| 301 | this.status = $('<p style="display: none"></p>').appendTo(this.out); | ||
| 302 | this.output = $('<ul class="search"/>').appendTo(this.out); | ||
| 303 | |||
| 304 | $('#search-progress').text(_('Preparing search...')); | ||
| 305 | this.startPulse(); | ||
| 306 | |||
| 307 | // index already loaded, the browser was quick! | ||
| 308 | if (this.hasIndex()) | ||
| 309 | this.query(query); | ||
| 310 | else | ||
| 311 | this.deferQuery(query); | ||
| 312 | }, | ||
| 313 | |||
| 314 | /** | ||
| 315 | * execute search (requires search index to be loaded) | ||
| 316 | */ | ||
| 317 | query : function(query) { | ||
| 318 | var i; | ||
| 319 | var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; | ||
| 320 | |||
| 321 | // stem the searchterms and add them to the correct list | ||
| 322 | var stemmer = new Stemmer(); | ||
| 323 | var searchterms = []; | ||
| 324 | var excluded = []; | ||
| 325 | var hlterms = []; | ||
| 326 | var tmp = query.split(/\s+/); | ||
| 327 | var objectterms = []; | ||
| 328 | for (i = 0; i < tmp.length; i++) { | ||
| 329 | if (tmp[i] !== "") { | ||
| 330 | objectterms.push(tmp[i].toLowerCase()); | ||
| 331 | } | ||
| 332 | |||
| 333 | if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) || | ||
| 334 | tmp[i] === "") { | ||
| 335 | // skip this "word" | ||
| 336 | continue; | ||
| 337 | } | ||
| 338 | // stem the word | ||
| 339 | var word = stemmer.stemWord(tmp[i].toLowerCase()); | ||
| 340 | var toAppend; | ||
| 341 | // select the correct list | ||
| 342 | if (word[0] == '-') { | ||
| 343 | toAppend = excluded; | ||
| 344 | word = word.substr(1); | ||
| 345 | } | ||
| 346 | else { | ||
| 347 | toAppend = searchterms; | ||
| 348 | hlterms.push(tmp[i].toLowerCase()); | ||
| 349 | } | ||
| 350 | // only add if not already in the list | ||
| 351 | if (!$u.contains(toAppend, word)) | ||
| 352 | toAppend.push(word); | ||
| 353 | } | ||
| 354 | var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" ")); | ||
| 355 | |||
| 356 | // console.debug('SEARCH: searching for:'); | ||
| 357 | // console.info('required: ', searchterms); | ||
| 358 | // console.info('excluded: ', excluded); | ||
| 359 | |||
| 360 | // prepare search | ||
| 361 | var terms = this._index.terms; | ||
| 362 | var titleterms = this._index.titleterms; | ||
| 363 | |||
| 364 | // array of [filename, title, anchor, descr, score] | ||
| 365 | var results = []; | ||
| 366 | $('#search-progress').empty(); | ||
| 367 | |||
| 368 | // lookup as object | ||
| 369 | for (i = 0; i < objectterms.length; i++) { | ||
| 370 | var others = [].concat(objectterms.slice(0, i), | ||
| 371 | objectterms.slice(i+1, objectterms.length)); | ||
| 372 | results = results.concat(this.performObjectSearch(objectterms[i], others)); | ||
| 373 | } | ||
| 374 | |||
| 375 | // lookup as search terms in fulltext | ||
| 376 | results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term)) | ||
| 377 | .concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title)); | ||
| 378 | |||
| 379 | // let the scorer override scores with a custom scoring function | ||
| 380 | if (Scorer.score) { | ||
| 381 | for (i = 0; i < results.length; i++) | ||
| 382 | results[i][4] = Scorer.score(results[i]); | ||
| 383 | } | ||
| 384 | |||
| 385 | // now sort the results by score (in opposite order of appearance, since the | ||
| 386 | // display function below uses pop() to retrieve items) and then | ||
| 387 | // alphabetically | ||
| 388 | results.sort(function(a, b) { | ||
| 389 | var left = a[4]; | ||
| 390 | var right = b[4]; | ||
| 391 | if (left > right) { | ||
| 392 | return 1; | ||
| 393 | } else if (left < right) { | ||
| 394 | return -1; | ||
| 395 | } else { | ||
| 396 | // same score: sort alphabetically | ||
| 397 | left = a[1].toLowerCase(); | ||
| 398 | right = b[1].toLowerCase(); | ||
| 399 | return (left > right) ? -1 : ((left < right) ? 1 : 0); | ||
| 400 | } | ||
| 401 | }); | ||
| 402 | |||
| 403 | // for debugging | ||
| 404 | //Search.lastresults = results.slice(); // a copy | ||
| 405 | //console.info('search results:', Search.lastresults); | ||
| 406 | |||
| 407 | // print the results | ||
| 408 | var resultCount = results.length; | ||
| 409 | function displayNextItem() { | ||
| 410 | // results left, load the summary and display it | ||
| 411 | if (results.length) { | ||
| 412 | var item = results.pop(); | ||
| 413 | var listItem = $('<li style="display:none"></li>'); | ||
| 414 | if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') { | ||
| 415 | // dirhtml builder | ||
| 416 | var dirname = item[0] + '/'; | ||
| 417 | if (dirname.match(/\/index\/$/)) { | ||
| 418 | dirname = dirname.substring(0, dirname.length-6); | ||
| 419 | } else if (dirname == 'index/') { | ||
| 420 | dirname = ''; | ||
| 421 | } | ||
| 422 | listItem.append($('<a/>').attr('href', | ||
| 423 | DOCUMENTATION_OPTIONS.URL_ROOT + dirname + | ||
| 424 | highlightstring + item[2]).html(item[1])); | ||
| 425 | } else { | ||
| 426 | // normal html builders | ||
| 427 | listItem.append($('<a/>').attr('href', | ||
| 428 | item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + | ||
| 429 | highlightstring + item[2]).html(item[1])); | ||
| 430 | } | ||
| 431 | if (item[3]) { | ||
| 432 | listItem.append($('<span> (' + item[3] + ')</span>')); | ||
| 433 | Search.output.append(listItem); | ||
| 434 | listItem.slideDown(5, function() { | ||
| 435 | displayNextItem(); | ||
| 436 | }); | ||
| 437 | } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { | ||
| 438 | $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] + '.txt', | ||
| 439 | dataType: "text", | ||
| 440 | complete: function(jqxhr, textstatus) { | ||
| 441 | var data = jqxhr.responseText; | ||
| 442 | if (data !== '' && data !== undefined) { | ||
| 443 | listItem.append(Search.makeSearchSummary(data, searchterms, hlterms)); | ||
| 444 | } | ||
| 445 | Search.output.append(listItem); | ||
| 446 | listItem.slideDown(5, function() { | ||
| 447 | displayNextItem(); | ||
| 448 | }); | ||
| 449 | }}); | ||
| 450 | } else { | ||
| 451 | // no source available, just display title | ||
| 452 | Search.output.append(listItem); | ||
| 453 | listItem.slideDown(5, function() { | ||
| 454 | displayNextItem(); | ||
| 455 | }); | ||
| 456 | } | ||
| 457 | } | ||
| 458 | // search finished, update title and status message | ||
| 459 | else { | ||
| 460 | Search.stopPulse(); | ||
| 461 | Search.title.text(_('Search Results')); | ||
| 462 | if (!resultCount) | ||
| 463 | Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.')); | ||
| 464 | else | ||
| 465 | Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount)); | ||
| 466 | Search.status.fadeIn(500); | ||
| 467 | } | ||
| 468 | } | ||
| 469 | displayNextItem(); | ||
| 470 | }, | ||
| 471 | |||
| 472 | /** | ||
| 473 | * search for object names | ||
| 474 | */ | ||
| 475 | performObjectSearch : function(object, otherterms) { | ||
| 476 | var filenames = this._index.filenames; | ||
| 477 | var objects = this._index.objects; | ||
| 478 | var objnames = this._index.objnames; | ||
| 479 | var titles = this._index.titles; | ||
| 480 | |||
| 481 | var i; | ||
| 482 | var results = []; | ||
| 483 | |||
| 484 | for (var prefix in objects) { | ||
| 485 | for (var name in objects[prefix]) { | ||
| 486 | var fullname = (prefix ? prefix + '.' : '') + name; | ||
| 487 | if (fullname.toLowerCase().indexOf(object) > -1) { | ||
| 488 | var score = 0; | ||
| 489 | var parts = fullname.split('.'); | ||
| 490 | // check for different match types: exact matches of full name or | ||
| 491 | // "last name" (i.e. last dotted part) | ||
| 492 | if (fullname == object || parts[parts.length - 1] == object) { | ||
| 493 | score += Scorer.objNameMatch; | ||
| 494 | // matches in last name | ||
| 495 | } else if (parts[parts.length - 1].indexOf(object) > -1) { | ||
| 496 | score += Scorer.objPartialMatch; | ||
| 497 | } | ||
| 498 | var match = objects[prefix][name]; | ||
| 499 | var objname = objnames[match[1]][2]; | ||
| 500 | var title = titles[match[0]]; | ||
| 501 | // If more than one term searched for, we require other words to be | ||
| 502 | // found in the name/title/description | ||
| 503 | if (otherterms.length > 0) { | ||
| 504 | var haystack = (prefix + ' ' + name + ' ' + | ||
| 505 | objname + ' ' + title).toLowerCase(); | ||
| 506 | var allfound = true; | ||
| 507 | for (i = 0; i < otherterms.length; i++) { | ||
| 508 | if (haystack.indexOf(otherterms[i]) == -1) { | ||
| 509 | allfound = false; | ||
| 510 | break; | ||
| 511 | } | ||
| 512 | } | ||
| 513 | if (!allfound) { | ||
| 514 | continue; | ||
| 515 | } | ||
| 516 | } | ||
| 517 | var descr = objname + _(', in ') + title; | ||
| 518 | |||
| 519 | var anchor = match[3]; | ||
| 520 | if (anchor === '') | ||
| 521 | anchor = fullname; | ||
| 522 | else if (anchor == '-') | ||
| 523 | anchor = objnames[match[1]][1] + '-' + fullname; | ||
| 524 | // add custom score for some objects according to scorer | ||
| 525 | if (Scorer.objPrio.hasOwnProperty(match[2])) { | ||
| 526 | score += Scorer.objPrio[match[2]]; | ||
| 527 | } else { | ||
| 528 | score += Scorer.objPrioDefault; | ||
| 529 | } | ||
| 530 | results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]); | ||
| 531 | } | ||
| 532 | } | ||
| 533 | } | ||
| 534 | |||
| 535 | return results; | ||
| 536 | }, | ||
| 537 | |||
| 538 | /** | ||
| 539 | * search for full-text terms in the index | ||
| 540 | */ | ||
| 541 | performTermsSearch : function(searchterms, excluded, terms, score) { | ||
| 542 | var filenames = this._index.filenames; | ||
| 543 | var titles = this._index.titles; | ||
| 544 | |||
| 545 | var i, j, file, files; | ||
| 546 | var fileMap = {}; | ||
| 547 | var results = []; | ||
| 548 | |||
| 549 | // perform the search on the required terms | ||
| 550 | for (i = 0; i < searchterms.length; i++) { | ||
| 551 | var word = searchterms[i]; | ||
| 552 | // no match but word was a required one | ||
| 553 | if ((files = terms[word]) === undefined) | ||
| 554 | break; | ||
| 555 | if (files.length === undefined) { | ||
| 556 | files = [files]; | ||
| 557 | } | ||
| 558 | // create the mapping | ||
| 559 | for (j = 0; j < files.length; j++) { | ||
| 560 | file = files[j]; | ||
| 561 | if (file in fileMap) | ||
| 562 | fileMap[file].push(word); | ||
| 563 | else | ||
| 564 | fileMap[file] = [word]; | ||
| 565 | } | ||
| 566 | } | ||
| 567 | |||
| 568 | // now check if the files don't contain excluded terms | ||
| 569 | for (file in fileMap) { | ||
| 570 | var valid = true; | ||
| 571 | |||
| 572 | // check if all requirements are matched | ||
| 573 | if (fileMap[file].length != searchterms.length) | ||
| 574 | continue; | ||
| 575 | |||
| 576 | // ensure that none of the excluded terms is in the search result | ||
| 577 | for (i = 0; i < excluded.length; i++) { | ||
| 578 | if (terms[excluded[i]] == file || | ||
| 579 | $u.contains(terms[excluded[i]] || [], file)) { | ||
| 580 | valid = false; | ||
| 581 | break; | ||
| 582 | } | ||
| 583 | } | ||
| 584 | |||
| 585 | // if we have still a valid result we can add it to the result list | ||
| 586 | if (valid) { | ||
| 587 | results.push([filenames[file], titles[file], '', null, score]); | ||
| 588 | } | ||
| 589 | } | ||
| 590 | return results; | ||
| 591 | }, | ||
| 592 | |||
| 593 | /** | ||
| 594 | * helper function to return a node containing the | ||
| 595 | * search summary for a given text. keywords is a list | ||
| 596 | * of stemmed words, hlwords is the list of normal, unstemmed | ||
| 597 | * words. the first one is used to find the occurance, the | ||
| 598 | * latter for highlighting it. | ||
| 599 | */ | ||
| 600 | makeSearchSummary : function(text, keywords, hlwords) { | ||
| 601 | var textLower = text.toLowerCase(); | ||
| 602 | var start = 0; | ||
| 603 | $.each(keywords, function() { | ||
| 604 | var i = textLower.indexOf(this.toLowerCase()); | ||
| 605 | if (i > -1) | ||
| 606 | start = i; | ||
| 607 | }); | ||
| 608 | start = Math.max(start - 120, 0); | ||
| 609 | var excerpt = ((start > 0) ? '...' : '') + | ||
| 610 | $.trim(text.substr(start, 240)) + | ||
| 611 | ((start + 240 - text.length) ? '...' : ''); | ||
| 612 | var rv = $('<div class="context"></div>').text(excerpt); | ||
| 613 | $.each(hlwords, function() { | ||
| 614 | rv = rv.highlightText(this, 'highlighted'); | ||
| 615 | }); | ||
| 616 | return rv; | ||
| 617 | } | ||
| 618 | }; | ||
| 619 | |||
| 620 | $(document).ready(function() { | ||
| 621 | Search.init(); | ||
| 622 | }); \ No newline at end of file | ||
diff --git a/_static/sidebar.js b/_static/sidebar.js new file mode 100644 index 0000000..5882ecf --- /dev/null +++ b/_static/sidebar.js | |||
| @@ -0,0 +1,159 @@ | |||
| 1 | /* | ||
| 2 | * sidebar.js | ||
| 3 | * ~~~~~~~~~~ | ||
| 4 | * | ||
| 5 | * This script makes the Sphinx sidebar collapsible. | ||
| 6 | * | ||
| 7 | * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds | ||
| 8 | * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton | ||
| 9 | * used to collapse and expand the sidebar. | ||
| 10 | * | ||
| 11 | * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden | ||
| 12 | * and the width of the sidebar and the margin-left of the document | ||
| 13 | * are decreased. When the sidebar is expanded the opposite happens. | ||
| 14 | * This script saves a per-browser/per-session cookie used to | ||
| 15 | * remember the position of the sidebar among the pages. | ||
| 16 | * Once the browser is closed the cookie is deleted and the position | ||
| 17 | * reset to the default (expanded). | ||
| 18 | * | ||
| 19 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. | ||
| 20 | * :license: BSD, see LICENSE for details. | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | |||
| 24 | $(function() { | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | // global elements used by the functions. | ||
| 34 | // the 'sidebarbutton' element is defined as global after its | ||
| 35 | // creation, in the add_sidebar_button function | ||
| 36 | var bodywrapper = $('.bodywrapper'); | ||
| 37 | var sidebar = $('.sphinxsidebar'); | ||
| 38 | var sidebarwrapper = $('.sphinxsidebarwrapper'); | ||
| 39 | |||
| 40 | // for some reason, the document has no sidebar; do not run into errors | ||
| 41 | if (!sidebar.length) return; | ||
| 42 | |||
| 43 | // original margin-left of the bodywrapper and width of the sidebar | ||
| 44 | // with the sidebar expanded | ||
| 45 | var bw_margin_expanded = bodywrapper.css('margin-left'); | ||
| 46 | var ssb_width_expanded = sidebar.width(); | ||
| 47 | |||
| 48 | // margin-left of the bodywrapper and width of the sidebar | ||
| 49 | // with the sidebar collapsed | ||
| 50 | var bw_margin_collapsed = '.8em'; | ||
| 51 | var ssb_width_collapsed = '.8em'; | ||
| 52 | |||
| 53 | // colors used by the current theme | ||
| 54 | var dark_color = $('.related').css('background-color'); | ||
| 55 | var light_color = $('.document').css('background-color'); | ||
| 56 | |||
| 57 | function sidebar_is_collapsed() { | ||
| 58 | return sidebarwrapper.is(':not(:visible)'); | ||
| 59 | } | ||
| 60 | |||
| 61 | function toggle_sidebar() { | ||
| 62 | if (sidebar_is_collapsed()) | ||
| 63 | expand_sidebar(); | ||
| 64 | else | ||
| 65 | collapse_sidebar(); | ||
| 66 | } | ||
| 67 | |||
| 68 | function collapse_sidebar() { | ||
| 69 | sidebarwrapper.hide(); | ||
| 70 | sidebar.css('width', ssb_width_collapsed); | ||
| 71 | bodywrapper.css('margin-left', bw_margin_collapsed); | ||
| 72 | sidebarbutton.css({ | ||
| 73 | 'margin-left': '0', | ||
| 74 | 'height': bodywrapper.height() | ||
| 75 | }); | ||
| 76 | sidebarbutton.find('span').text('»'); | ||
| 77 | sidebarbutton.attr('title', _('Expand sidebar')); | ||
| 78 | document.cookie = 'sidebar=collapsed'; | ||
| 79 | } | ||
| 80 | |||
| 81 | function expand_sidebar() { | ||
| 82 | bodywrapper.css('margin-left', bw_margin_expanded); | ||
| 83 | sidebar.css('width', ssb_width_expanded); | ||
| 84 | sidebarwrapper.show(); | ||
| 85 | sidebarbutton.css({ | ||
| 86 | 'margin-left': ssb_width_expanded-12, | ||
| 87 | 'height': bodywrapper.height() | ||
| 88 | }); | ||
| 89 | sidebarbutton.find('span').text('«'); | ||
| 90 | sidebarbutton.attr('title', _('Collapse sidebar')); | ||
| 91 | document.cookie = 'sidebar=expanded'; | ||
| 92 | } | ||
| 93 | |||
| 94 | function add_sidebar_button() { | ||
| 95 | sidebarwrapper.css({ | ||
| 96 | 'float': 'left', | ||
| 97 | 'margin-right': '0', | ||
| 98 | 'width': ssb_width_expanded - 28 | ||
| 99 | }); | ||
| 100 | // create the button | ||
| 101 | sidebar.append( | ||
| 102 | '<div id="sidebarbutton"><span>«</span></div>' | ||
| 103 | ); | ||
| 104 | var sidebarbutton = $('#sidebarbutton'); | ||
| 105 | light_color = sidebarbutton.css('background-color'); | ||
| 106 | // find the height of the viewport to center the '<<' in the page | ||
| 107 | var viewport_height; | ||
| 108 | if (window.innerHeight) | ||
| 109 | viewport_height = window.innerHeight; | ||
| 110 | else | ||
| 111 | viewport_height = $(window).height(); | ||
| 112 | sidebarbutton.find('span').css({ | ||
| 113 | 'display': 'block', | ||
| 114 | 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 | ||
| 115 | }); | ||
| 116 | |||
| 117 | sidebarbutton.click(toggle_sidebar); | ||
| 118 | sidebarbutton.attr('title', _('Collapse sidebar')); | ||
| 119 | sidebarbutton.css({ | ||
| 120 | 'color': '#FFFFFF', | ||
| 121 | 'border-left': '1px solid ' + dark_color, | ||
| 122 | 'font-size': '1.2em', | ||
| 123 | 'cursor': 'pointer', | ||
| 124 | 'height': bodywrapper.height(), | ||
| 125 | 'padding-top': '1px', | ||
| 126 | 'margin-left': ssb_width_expanded - 12 | ||
| 127 | }); | ||
| 128 | |||
| 129 | sidebarbutton.hover( | ||
| 130 | function () { | ||
| 131 | $(this).css('background-color', dark_color); | ||
| 132 | }, | ||
| 133 | function () { | ||
| 134 | $(this).css('background-color', light_color); | ||
| 135 | } | ||
| 136 | ); | ||
| 137 | } | ||
| 138 | |||
| 139 | function set_position_from_cookie() { | ||
| 140 | if (!document.cookie) | ||
| 141 | return; | ||
| 142 | var items = document.cookie.split(';'); | ||
| 143 | for(var k=0; k<items.length; k++) { | ||
| 144 | var key_val = items[k].split('='); | ||
| 145 | var key = key_val[0].replace(/ /, ""); // strip leading spaces | ||
| 146 | if (key == 'sidebar') { | ||
| 147 | var value = key_val[1]; | ||
| 148 | if ((value == 'collapsed') && (!sidebar_is_collapsed())) | ||
| 149 | collapse_sidebar(); | ||
| 150 | else if ((value == 'expanded') && (sidebar_is_collapsed())) | ||
| 151 | expand_sidebar(); | ||
| 152 | } | ||
| 153 | } | ||
| 154 | } | ||
| 155 | |||
| 156 | add_sidebar_button(); | ||
| 157 | var sidebarbutton = $('#sidebarbutton'); | ||
| 158 | set_position_from_cookie(); | ||
| 159 | }); \ No newline at end of file | ||
diff --git a/_static/underscore-1.3.1.js b/_static/underscore-1.3.1.js new file mode 100644 index 0000000..208d4cd --- /dev/null +++ b/_static/underscore-1.3.1.js | |||
| @@ -0,0 +1,999 @@ | |||
| 1 | // Underscore.js 1.3.1 | ||
| 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. | ||
| 3 | // Underscore is freely distributable under the MIT license. | ||
| 4 | // Portions of Underscore are inspired or borrowed from Prototype, | ||
| 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. | ||
| 6 | // For all details and documentation: | ||
| 7 | // http://documentcloud.github.com/underscore | ||
| 8 | |||
| 9 | (function() { | ||
| 10 | |||
| 11 | // Baseline setup | ||
| 12 | // -------------- | ||
| 13 | |||
| 14 | // Establish the root object, `window` in the browser, or `global` on the server. | ||
| 15 | var root = this; | ||
| 16 | |||
| 17 | // Save the previous value of the `_` variable. | ||
| 18 | var previousUnderscore = root._; | ||
| 19 | |||
| 20 | // Establish the object that gets returned to break out of a loop iteration. | ||
| 21 | var breaker = {}; | ||
| 22 | |||
| 23 | // Save bytes in the minified (but not gzipped) version: | ||
| 24 | var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; | ||
| 25 | |||
| 26 | // Create quick reference variables for speed access to core prototypes. | ||
| 27 | var slice = ArrayProto.slice, | ||
| 28 | unshift = ArrayProto.unshift, | ||
| 29 | toString = ObjProto.toString, | ||
| 30 | hasOwnProperty = ObjProto.hasOwnProperty; | ||
| 31 | |||
| 32 | // All **ECMAScript 5** native function implementations that we hope to use | ||
| 33 | // are declared here. | ||
| 34 | var | ||
| 35 | nativeForEach = ArrayProto.forEach, | ||
| 36 | nativeMap = ArrayProto.map, | ||
| 37 | nativeReduce = ArrayProto.reduce, | ||
| 38 | nativeReduceRight = ArrayProto.reduceRight, | ||
| 39 | nativeFilter = ArrayProto.filter, | ||
| 40 | nativeEvery = ArrayProto.every, | ||
| 41 | nativeSome = ArrayProto.some, | ||
| 42 | nativeIndexOf = ArrayProto.indexOf, | ||
| 43 | nativeLastIndexOf = ArrayProto.lastIndexOf, | ||
| 44 | nativeIsArray = Array.isArray, | ||
| 45 | nativeKeys = Object.keys, | ||
| 46 | nativeBind = FuncProto.bind; | ||
| 47 | |||
| 48 | // Create a safe reference to the Underscore object for use below. | ||
| 49 | var _ = function(obj) { return new wrapper(obj); }; | ||
| 50 | |||
| 51 | // Export the Underscore object for **Node.js**, with | ||
| 52 | // backwards-compatibility for the old `require()` API. If we're in | ||
| 53 | // the browser, add `_` as a global object via a string identifier, | ||
| 54 | // for Closure Compiler "advanced" mode. | ||
| 55 | if (typeof exports !== 'undefined') { | ||
| 56 | if (typeof module !== 'undefined' && module.exports) { | ||
| 57 | exports = module.exports = _; | ||
| 58 | } | ||
| 59 | exports._ = _; | ||
| 60 | } else { | ||
| 61 | root['_'] = _; | ||
| 62 | } | ||
| 63 | |||
| 64 | // Current version. | ||
| 65 | _.VERSION = '1.3.1'; | ||
| 66 | |||
| 67 | // Collection Functions | ||
| 68 | // -------------------- | ||
| 69 | |||
| 70 | // The cornerstone, an `each` implementation, aka `forEach`. | ||
| 71 | // Handles objects with the built-in `forEach`, arrays, and raw objects. | ||
| 72 | // Delegates to **ECMAScript 5**'s native `forEach` if available. | ||
| 73 | var each = _.each = _.forEach = function(obj, iterator, context) { | ||
| 74 | if (obj == null) return; | ||
| 75 | if (nativeForEach && obj.forEach === nativeForEach) { | ||
| 76 | obj.forEach(iterator, context); | ||
| 77 | } else if (obj.length === +obj.length) { | ||
| 78 | for (var i = 0, l = obj.length; i < l; i++) { | ||
| 79 | if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return; | ||
| 80 | } | ||
| 81 | } else { | ||
| 82 | for (var key in obj) { | ||
| 83 | if (_.has(obj, key)) { | ||
| 84 | if (iterator.call(context, obj[key], key, obj) === breaker) return; | ||
| 85 | } | ||
| 86 | } | ||
| 87 | } | ||
| 88 | }; | ||
| 89 | |||
| 90 | // Return the results of applying the iterator to each element. | ||
| 91 | // Delegates to **ECMAScript 5**'s native `map` if available. | ||
| 92 | _.map = _.collect = function(obj, iterator, context) { | ||
| 93 | var results = []; | ||
| 94 | if (obj == null) return results; | ||
| 95 | if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); | ||
| 96 | each(obj, function(value, index, list) { | ||
| 97 | results[results.length] = iterator.call(context, value, index, list); | ||
| 98 | }); | ||
| 99 | if (obj.length === +obj.length) results.length = obj.length; | ||
| 100 | return results; | ||
| 101 | }; | ||
| 102 | |||
| 103 | // **Reduce** builds up a single result from a list of values, aka `inject`, | ||
| 104 | // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. | ||
| 105 | _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { | ||
| 106 | var initial = arguments.length > 2; | ||
| 107 | if (obj == null) obj = []; | ||
| 108 | if (nativeReduce && obj.reduce === nativeReduce) { | ||
| 109 | if (context) iterator = _.bind(iterator, context); | ||
| 110 | return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); | ||
| 111 | } | ||
| 112 | each(obj, function(value, index, list) { | ||
| 113 | if (!initial) { | ||
| 114 | memo = value; | ||
| 115 | initial = true; | ||
| 116 | } else { | ||
| 117 | memo = iterator.call(context, memo, value, index, list); | ||
| 118 | } | ||
| 119 | }); | ||
| 120 | if (!initial) throw new TypeError('Reduce of empty array with no initial value'); | ||
| 121 | return memo; | ||
| 122 | }; | ||
| 123 | |||
| 124 | // The right-associative version of reduce, also known as `foldr`. | ||
| 125 | // Delegates to **ECMAScript 5**'s native `reduceRight` if available. | ||
| 126 | _.reduceRight = _.foldr = function(obj, iterator, memo, context) { | ||
| 127 | var initial = arguments.length > 2; | ||
| 128 | if (obj == null) obj = []; | ||
| 129 | if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { | ||
| 130 | if (context) iterator = _.bind(iterator, context); | ||
| 131 | return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); | ||
| 132 | } | ||
| 133 | var reversed = _.toArray(obj).reverse(); | ||
| 134 | if (context && !initial) iterator = _.bind(iterator, context); | ||
| 135 | return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator); | ||
| 136 | }; | ||
| 137 | |||
| 138 | // Return the first value which passes a truth test. Aliased as `detect`. | ||
| 139 | _.find = _.detect = function(obj, iterator, context) { | ||
| 140 | var result; | ||
| 141 | any(obj, function(value, index, list) { | ||
| 142 | if (iterator.call(context, value, index, list)) { | ||
| 143 | result = value; | ||
| 144 | return true; | ||
| 145 | } | ||
| 146 | }); | ||
| 147 | return result; | ||
| 148 | }; | ||
| 149 | |||
| 150 | // Return all the elements that pass a truth test. | ||
| 151 | // Delegates to **ECMAScript 5**'s native `filter` if available. | ||
| 152 | // Aliased as `select`. | ||
| 153 | _.filter = _.select = function(obj, iterator, context) { | ||
| 154 | var results = []; | ||
| 155 | if (obj == null) return results; | ||
| 156 | if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); | ||
| 157 | each(obj, function(value, index, list) { | ||
| 158 | if (iterator.call(context, value, index, list)) results[results.length] = value; | ||
| 159 | }); | ||
| 160 | return results; | ||
| 161 | }; | ||
| 162 | |||
| 163 | // Return all the elements for which a truth test fails. | ||
| 164 | _.reject = function(obj, iterator, context) { | ||
| 165 | var results = []; | ||
| 166 | if (obj == null) return results; | ||
| 167 | each(obj, function(value, index, list) { | ||
| 168 | if (!iterator.call(context, value, index, list)) results[results.length] = value; | ||
| 169 | }); | ||
| 170 | return results; | ||
| 171 | }; | ||
| 172 | |||
| 173 | // Determine whether all of the elements match a truth test. | ||
| 174 | // Delegates to **ECMAScript 5**'s native `every` if available. | ||
| 175 | // Aliased as `all`. | ||
| 176 | _.every = _.all = function(obj, iterator, context) { | ||
| 177 | var result = true; | ||
| 178 | if (obj == null) return result; | ||
| 179 | if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); | ||
| 180 | each(obj, function(value, index, list) { | ||
| 181 | if (!(result = result && iterator.call(context, value, index, list))) return breaker; | ||
| 182 | }); | ||
| 183 | return result; | ||
| 184 | }; | ||
| 185 | |||
| 186 | // Determine if at least one element in the object matches a truth test. | ||
| 187 | // Delegates to **ECMAScript 5**'s native `some` if available. | ||
| 188 | // Aliased as `any`. | ||
| 189 | var any = _.some = _.any = function(obj, iterator, context) { | ||
| 190 | iterator || (iterator = _.identity); | ||
| 191 | var result = false; | ||
| 192 | if (obj == null) return result; | ||
| 193 | if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); | ||
| 194 | each(obj, function(value, index, list) { | ||
| 195 | if (result || (result = iterator.call(context, value, index, list))) return breaker; | ||
| 196 | }); | ||
| 197 | return !!result; | ||
| 198 | }; | ||
| 199 | |||
| 200 | // Determine if a given value is included in the array or object using `===`. | ||
| 201 | // Aliased as `contains`. | ||
| 202 | _.include = _.contains = function(obj, target) { | ||
| 203 | var found = false; | ||
| 204 | if (obj == null) return found; | ||
| 205 | if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; | ||
| 206 | found = any(obj, function(value) { | ||
| 207 | return value === target; | ||
| 208 | }); | ||
| 209 | return found; | ||
| 210 | }; | ||
| 211 | |||
| 212 | // Invoke a method (with arguments) on every item in a collection. | ||
| 213 | _.invoke = function(obj, method) { | ||
| 214 | var args = slice.call(arguments, 2); | ||
| 215 | return _.map(obj, function(value) { | ||
| 216 | return (_.isFunction(method) ? method || value : value[method]).apply(value, args); | ||
| 217 | }); | ||
| 218 | }; | ||
| 219 | |||
| 220 | // Convenience version of a common use case of `map`: fetching a property. | ||
| 221 | _.pluck = function(obj, key) { | ||
| 222 | return _.map(obj, function(value){ return value[key]; }); | ||
| 223 | }; | ||
| 224 | |||
| 225 | // Return the maximum element or (element-based computation). | ||
| 226 | _.max = function(obj, iterator, context) { | ||
| 227 | if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj); | ||
| 228 | if (!iterator && _.isEmpty(obj)) return -Infinity; | ||
| 229 | var result = {computed : -Infinity}; | ||
| 230 | each(obj, function(value, index, list) { | ||
| 231 | var computed = iterator ? iterator.call(context, value, index, list) : value; | ||
| 232 | computed >= result.computed && (result = {value : value, computed : computed}); | ||
| 233 | }); | ||
| 234 | return result.value; | ||
| 235 | }; | ||
| 236 | |||
| 237 | // Return the minimum element (or element-based computation). | ||
| 238 | _.min = function(obj, iterator, context) { | ||
| 239 | if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj); | ||
| 240 | if (!iterator && _.isEmpty(obj)) return Infinity; | ||
| 241 | var result = {computed : Infinity}; | ||
| 242 | each(obj, function(value, index, list) { | ||
| 243 | var computed = iterator ? iterator.call(context, value, index, list) : value; | ||
| 244 | computed < result.computed && (result = {value : value, computed : computed}); | ||
| 245 | }); | ||
| 246 | return result.value; | ||
| 247 | }; | ||
| 248 | |||
| 249 | // Shuffle an array. | ||
| 250 | _.shuffle = function(obj) { | ||
| 251 | var shuffled = [], rand; | ||
| 252 | each(obj, function(value, index, list) { | ||
| 253 | if (index == 0) { | ||
| 254 | shuffled[0] = value; | ||
| 255 | } else { | ||
| 256 | rand = Math.floor(Math.random() * (index + 1)); | ||
| 257 | shuffled[index] = shuffled[rand]; | ||
| 258 | shuffled[rand] = value; | ||
| 259 | } | ||
| 260 | }); | ||
| 261 | return shuffled; | ||
| 262 | }; | ||
| 263 | |||
| 264 | // Sort the object's values by a criterion produced by an iterator. | ||
| 265 | _.sortBy = function(obj, iterator, context) { | ||
| 266 | return _.pluck(_.map(obj, function(value, index, list) { | ||
| 267 | return { | ||
| 268 | value : value, | ||
| 269 | criteria : iterator.call(context, value, index, list) | ||
| 270 | }; | ||
| 271 | }).sort(function(left, right) { | ||
| 272 | var a = left.criteria, b = right.criteria; | ||
| 273 | return a < b ? -1 : a > b ? 1 : 0; | ||
| 274 | }), 'value'); | ||
| 275 | }; | ||
| 276 | |||
| 277 | // Groups the object's values by a criterion. Pass either a string attribute | ||
| 278 | // to group by, or a function that returns the criterion. | ||
| 279 | _.groupBy = function(obj, val) { | ||
| 280 | var result = {}; | ||
| 281 | var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; }; | ||
| 282 | each(obj, function(value, index) { | ||
| 283 | var key = iterator(value, index); | ||
| 284 | (result[key] || (result[key] = [])).push(value); | ||
| 285 | }); | ||
| 286 | return result; | ||
| 287 | }; | ||
| 288 | |||
| 289 | // Use a comparator function to figure out at what index an object should | ||
| 290 | // be inserted so as to maintain order. Uses binary search. | ||
| 291 | _.sortedIndex = function(array, obj, iterator) { | ||
| 292 | iterator || (iterator = _.identity); | ||
| 293 | var low = 0, high = array.length; | ||
| 294 | while (low < high) { | ||
| 295 | var mid = (low + high) >> 1; | ||
| 296 | iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid; | ||
| 297 | } | ||
| 298 | return low; | ||
| 299 | }; | ||
| 300 | |||
| 301 | // Safely convert anything iterable into a real, live array. | ||
| 302 | _.toArray = function(iterable) { | ||
| 303 | if (!iterable) return []; | ||
| 304 | if (iterable.toArray) return iterable.toArray(); | ||
| 305 | if (_.isArray(iterable)) return slice.call(iterable); | ||
| 306 | if (_.isArguments(iterable)) return slice.call(iterable); | ||
| 307 | return _.values(iterable); | ||
| 308 | }; | ||
| 309 | |||
| 310 | // Return the number of elements in an object. | ||
| 311 | _.size = function(obj) { | ||
| 312 | return _.toArray(obj).length; | ||
| 313 | }; | ||
| 314 | |||
| 315 | // Array Functions | ||
| 316 | // --------------- | ||
| 317 | |||
| 318 | // Get the first element of an array. Passing **n** will return the first N | ||
| 319 | // values in the array. Aliased as `head`. The **guard** check allows it to work | ||
| 320 | // with `_.map`. | ||
| 321 | _.first = _.head = function(array, n, guard) { | ||
| 322 | return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; | ||
| 323 | }; | ||
| 324 | |||
| 325 | // Returns everything but the last entry of the array. Especcialy useful on | ||
| 326 | // the arguments object. Passing **n** will return all the values in | ||
| 327 | // the array, excluding the last N. The **guard** check allows it to work with | ||
| 328 | // `_.map`. | ||
| 329 | _.initial = function(array, n, guard) { | ||
| 330 | return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); | ||
| 331 | }; | ||
| 332 | |||
| 333 | // Get the last element of an array. Passing **n** will return the last N | ||
| 334 | // values in the array. The **guard** check allows it to work with `_.map`. | ||
| 335 | _.last = function(array, n, guard) { | ||
| 336 | if ((n != null) && !guard) { | ||
| 337 | return slice.call(array, Math.max(array.length - n, 0)); | ||
| 338 | } else { | ||
| 339 | return array[array.length - 1]; | ||
| 340 | } | ||
| 341 | }; | ||
| 342 | |||
| 343 | // Returns everything but the first entry of the array. Aliased as `tail`. | ||
| 344 | // Especially useful on the arguments object. Passing an **index** will return | ||
| 345 | // the rest of the values in the array from that index onward. The **guard** | ||
| 346 | // check allows it to work with `_.map`. | ||
| 347 | _.rest = _.tail = function(array, index, guard) { | ||
| 348 | return slice.call(array, (index == null) || guard ? 1 : index); | ||
| 349 | }; | ||
| 350 | |||
| 351 | // Trim out all falsy values from an array. | ||
| 352 | _.compact = function(array) { | ||
| 353 | return _.filter(array, function(value){ return !!value; }); | ||
| 354 | }; | ||
| 355 | |||
| 356 | // Return a completely flattened version of an array. | ||
| 357 | _.flatten = function(array, shallow) { | ||
| 358 | return _.reduce(array, function(memo, value) { | ||
| 359 | if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value)); | ||
| 360 | memo[memo.length] = value; | ||
| 361 | return memo; | ||
| 362 | }, []); | ||
| 363 | }; | ||
| 364 | |||
| 365 | // Return a version of the array that does not contain the specified value(s). | ||
| 366 | _.without = function(array) { | ||
| 367 | return _.difference(array, slice.call(arguments, 1)); | ||
| 368 | }; | ||
| 369 | |||
| 370 | // Produce a duplicate-free version of the array. If the array has already | ||
| 371 | // been sorted, you have the option of using a faster algorithm. | ||
| 372 | // Aliased as `unique`. | ||
| 373 | _.uniq = _.unique = function(array, isSorted, iterator) { | ||
| 374 | var initial = iterator ? _.map(array, iterator) : array; | ||
| 375 | var result = []; | ||
| 376 | _.reduce(initial, function(memo, el, i) { | ||
| 377 | if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) { | ||
| 378 | memo[memo.length] = el; | ||
| 379 | result[result.length] = array[i]; | ||
| 380 | } | ||
| 381 | return memo; | ||
| 382 | }, []); | ||
| 383 | return result; | ||
| 384 | }; | ||
| 385 | |||
| 386 | // Produce an array that contains the union: each distinct element from all of | ||
| 387 | // the passed-in arrays. | ||
| 388 | _.union = function() { | ||
| 389 | return _.uniq(_.flatten(arguments, true)); | ||
| 390 | }; | ||
| 391 | |||
| 392 | // Produce an array that contains every item shared between all the | ||
| 393 | // passed-in arrays. (Aliased as "intersect" for back-compat.) | ||
| 394 | _.intersection = _.intersect = function(array) { | ||
| 395 | var rest = slice.call(arguments, 1); | ||
| 396 | return _.filter(_.uniq(array), function(item) { | ||
| 397 | return _.every(rest, function(other) { | ||
| 398 | return _.indexOf(other, item) >= 0; | ||
| 399 | }); | ||
| 400 | }); | ||
| 401 | }; | ||
| 402 | |||
| 403 | // Take the difference between one array and a number of other arrays. | ||
| 404 | // Only the elements present in just the first array will remain. | ||
| 405 | _.difference = function(array) { | ||
| 406 | var rest = _.flatten(slice.call(arguments, 1)); | ||
| 407 | return _.filter(array, function(value){ return !_.include(rest, value); }); | ||
| 408 | }; | ||
| 409 | |||
| 410 | // Zip together multiple lists into a single array -- elements that share | ||
| 411 | // an index go together. | ||
| 412 | _.zip = function() { | ||
| 413 | var args = slice.call(arguments); | ||
| 414 | var length = _.max(_.pluck(args, 'length')); | ||
| 415 | var results = new Array(length); | ||
| 416 | for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i); | ||
| 417 | return results; | ||
| 418 | }; | ||
| 419 | |||
| 420 | // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), | ||
| 421 | // we need this function. Return the position of the first occurrence of an | ||
| 422 | // item in an array, or -1 if the item is not included in the array. | ||
| 423 | // Delegates to **ECMAScript 5**'s native `indexOf` if available. | ||
| 424 | // If the array is large and already in sort order, pass `true` | ||
| 425 | // for **isSorted** to use binary search. | ||
| 426 | _.indexOf = function(array, item, isSorted) { | ||
| 427 | if (array == null) return -1; | ||
| 428 | var i, l; | ||
| 429 | if (isSorted) { | ||
| 430 | i = _.sortedIndex(array, item); | ||
| 431 | return array[i] === item ? i : -1; | ||
| 432 | } | ||
| 433 | if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item); | ||
| 434 | for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i; | ||
| 435 | return -1; | ||
| 436 | }; | ||
| 437 | |||
| 438 | // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. | ||
| 439 | _.lastIndexOf = function(array, item) { | ||
| 440 | if (array == null) return -1; | ||
| 441 | if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item); | ||
| 442 | var i = array.length; | ||
| 443 | while (i--) if (i in array && array[i] === item) return i; | ||
| 444 | return -1; | ||
| 445 | }; | ||
| 446 | |||
| 447 | // Generate an integer Array containing an arithmetic progression. A port of | ||
| 448 | // the native Python `range()` function. See | ||
| 449 | // [the Python documentation](http://docs.python.org/library/functions.html#range). | ||
| 450 | _.range = function(start, stop, step) { | ||
| 451 | if (arguments.length <= 1) { | ||
| 452 | stop = start || 0; | ||
| 453 | start = 0; | ||
| 454 | } | ||
| 455 | step = arguments[2] || 1; | ||
| 456 | |||
| 457 | var len = Math.max(Math.ceil((stop - start) / step), 0); | ||
| 458 | var idx = 0; | ||
| 459 | var range = new Array(len); | ||
| 460 | |||
| 461 | while(idx < len) { | ||
| 462 | range[idx++] = start; | ||
| 463 | start += step; | ||
| 464 | } | ||
| 465 | |||
| 466 | return range; | ||
| 467 | }; | ||
| 468 | |||
| 469 | // Function (ahem) Functions | ||
| 470 | // ------------------ | ||
| 471 | |||
| 472 | // Reusable constructor function for prototype setting. | ||
| 473 | var ctor = function(){}; | ||
| 474 | |||
| 475 | // Create a function bound to a given object (assigning `this`, and arguments, | ||
| 476 | // optionally). Binding with arguments is also known as `curry`. | ||
| 477 | // Delegates to **ECMAScript 5**'s native `Function.bind` if available. | ||
| 478 | // We check for `func.bind` first, to fail fast when `func` is undefined. | ||
| 479 | _.bind = function bind(func, context) { | ||
| 480 | var bound, args; | ||
| 481 | if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); | ||
| 482 | if (!_.isFunction(func)) throw new TypeError; | ||
| 483 | args = slice.call(arguments, 2); | ||
| 484 | return bound = function() { | ||
| 485 | if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); | ||
| 486 | ctor.prototype = func.prototype; | ||
| 487 | var self = new ctor; | ||
| 488 | var result = func.apply(self, args.concat(slice.call(arguments))); | ||
| 489 | if (Object(result) === result) return result; | ||
| 490 | return self; | ||
| 491 | }; | ||
| 492 | }; | ||
| 493 | |||
| 494 | // Bind all of an object's methods to that object. Useful for ensuring that | ||
| 495 | // all callbacks defined on an object belong to it. | ||
| 496 | _.bindAll = function(obj) { | ||
| 497 | var funcs = slice.call(arguments, 1); | ||
| 498 | if (funcs.length == 0) funcs = _.functions(obj); | ||
| 499 | each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); | ||
| 500 | return obj; | ||
| 501 | }; | ||
| 502 | |||
| 503 | // Memoize an expensive function by storing its results. | ||
| 504 | _.memoize = function(func, hasher) { | ||
| 505 | var memo = {}; | ||
| 506 | hasher || (hasher = _.identity); | ||
| 507 | return function() { | ||
| 508 | var key = hasher.apply(this, arguments); | ||
| 509 | return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); | ||
| 510 | }; | ||
| 511 | }; | ||
| 512 | |||
| 513 | // Delays a function for the given number of milliseconds, and then calls | ||
| 514 | // it with the arguments supplied. | ||
| 515 | _.delay = function(func, wait) { | ||
| 516 | var args = slice.call(arguments, 2); | ||
| 517 | return setTimeout(function(){ return func.apply(func, args); }, wait); | ||
| 518 | }; | ||
| 519 | |||
| 520 | // Defers a function, scheduling it to run after the current call stack has | ||
| 521 | // cleared. | ||
| 522 | _.defer = function(func) { | ||
| 523 | return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); | ||
| 524 | }; | ||
| 525 | |||
| 526 | // Returns a function, that, when invoked, will only be triggered at most once | ||
| 527 | // during a given window of time. | ||
| 528 | _.throttle = function(func, wait) { | ||
| 529 | var context, args, timeout, throttling, more; | ||
| 530 | var whenDone = _.debounce(function(){ more = throttling = false; }, wait); | ||
| 531 | return function() { | ||
| 532 | context = this; args = arguments; | ||
| 533 | var later = function() { | ||
| 534 | timeout = null; | ||
| 535 | if (more) func.apply(context, args); | ||
| 536 | whenDone(); | ||
| 537 | }; | ||
| 538 | if (!timeout) timeout = setTimeout(later, wait); | ||
| 539 | if (throttling) { | ||
| 540 | more = true; | ||
| 541 | } else { | ||
| 542 | func.apply(context, args); | ||
| 543 | } | ||
| 544 | whenDone(); | ||
| 545 | throttling = true; | ||
| 546 | }; | ||
| 547 | }; | ||
| 548 | |||
| 549 | // Returns a function, that, as long as it continues to be invoked, will not | ||
| 550 | // be triggered. The function will be called after it stops being called for | ||
| 551 | // N milliseconds. | ||
| 552 | _.debounce = function(func, wait) { | ||
| 553 | var timeout; | ||
| 554 | return function() { | ||
| 555 | var context = this, args = arguments; | ||
| 556 | var later = function() { | ||
| 557 | timeout = null; | ||
| 558 | func.apply(context, args); | ||
| 559 | }; | ||
| 560 | clearTimeout(timeout); | ||
| 561 | timeout = setTimeout(later, wait); | ||
| 562 | }; | ||
| 563 | }; | ||
| 564 | |||
| 565 | // Returns a function that will be executed at most one time, no matter how | ||
| 566 | // often you call it. Useful for lazy initialization. | ||
| 567 | _.once = function(func) { | ||
| 568 | var ran = false, memo; | ||
| 569 | return function() { | ||
| 570 | if (ran) return memo; | ||
| 571 | ran = true; | ||
| 572 | return memo = func.apply(this, arguments); | ||
| 573 | }; | ||
| 574 | }; | ||
| 575 | |||
| 576 | // Returns the first function passed as an argument to the second, | ||
| 577 | // allowing you to adjust arguments, run code before and after, and | ||
| 578 | // conditionally execute the original function. | ||
| 579 | _.wrap = function(func, wrapper) { | ||
| 580 | return function() { | ||
| 581 | var args = [func].concat(slice.call(arguments, 0)); | ||
| 582 | return wrapper.apply(this, args); | ||
| 583 | }; | ||
| 584 | }; | ||
| 585 | |||
| 586 | // Returns a function that is the composition of a list of functions, each | ||
| 587 | // consuming the return value of the function that follows. | ||
| 588 | _.compose = function() { | ||
| 589 | var funcs = arguments; | ||
| 590 | return function() { | ||
| 591 | var args = arguments; | ||
| 592 | for (var i = funcs.length - 1; i >= 0; i--) { | ||
| 593 | args = [funcs[i].apply(this, args)]; | ||
| 594 | } | ||
| 595 | return args[0]; | ||
| 596 | }; | ||
| 597 | }; | ||
| 598 | |||
| 599 | // Returns a function that will only be executed after being called N times. | ||
| 600 | _.after = function(times, func) { | ||
| 601 | if (times <= 0) return func(); | ||
| 602 | return function() { | ||
| 603 | if (--times < 1) { return func.apply(this, arguments); } | ||
| 604 | }; | ||
| 605 | }; | ||
| 606 | |||
| 607 | // Object Functions | ||
| 608 | // ---------------- | ||
| 609 | |||
| 610 | // Retrieve the names of an object's properties. | ||
| 611 | // Delegates to **ECMAScript 5**'s native `Object.keys` | ||
| 612 | _.keys = nativeKeys || function(obj) { | ||
| 613 | if (obj !== Object(obj)) throw new TypeError('Invalid object'); | ||
| 614 | var keys = []; | ||
| 615 | for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; | ||
| 616 | return keys; | ||
| 617 | }; | ||
| 618 | |||
| 619 | // Retrieve the values of an object's properties. | ||
| 620 | _.values = function(obj) { | ||
| 621 | return _.map(obj, _.identity); | ||
| 622 | }; | ||
| 623 | |||
| 624 | // Return a sorted list of the function names available on the object. | ||
| 625 | // Aliased as `methods` | ||
| 626 | _.functions = _.methods = function(obj) { | ||
| 627 | var names = []; | ||
| 628 | for (var key in obj) { | ||
| 629 | if (_.isFunction(obj[key])) names.push(key); | ||
| 630 | } | ||
| 631 | return names.sort(); | ||
| 632 | }; | ||
| 633 | |||
| 634 | // Extend a given object with all the properties in passed-in object(s). | ||
| 635 | _.extend = function(obj) { | ||
| 636 | each(slice.call(arguments, 1), function(source) { | ||
| 637 | for (var prop in source) { | ||
| 638 | obj[prop] = source[prop]; | ||
| 639 | } | ||
| 640 | }); | ||
| 641 | return obj; | ||
| 642 | }; | ||
| 643 | |||
| 644 | // Fill in a given object with default properties. | ||
| 645 | _.defaults = function(obj) { | ||
| 646 | each(slice.call(arguments, 1), function(source) { | ||
| 647 | for (var prop in source) { | ||
| 648 | if (obj[prop] == null) obj[prop] = source[prop]; | ||
| 649 | } | ||
| 650 | }); | ||
| 651 | return obj; | ||
| 652 | }; | ||
| 653 | |||
| 654 | // Create a (shallow-cloned) duplicate of an object. | ||
| 655 | _.clone = function(obj) { | ||
| 656 | if (!_.isObject(obj)) return obj; | ||
| 657 | return _.isArray(obj) ? obj.slice() : _.extend({}, obj); | ||
| 658 | }; | ||
| 659 | |||
| 660 | // Invokes interceptor with the obj, and then returns obj. | ||
| 661 | // The primary purpose of this method is to "tap into" a method chain, in | ||
| 662 | // order to perform operations on intermediate results within the chain. | ||
| 663 | _.tap = function(obj, interceptor) { | ||
| 664 | interceptor(obj); | ||
| 665 | return obj; | ||
| 666 | }; | ||
| 667 | |||
| 668 | // Internal recursive comparison function. | ||
| 669 | function eq(a, b, stack) { | ||
| 670 | // Identical objects are equal. `0 === -0`, but they aren't identical. | ||
| 671 | // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. | ||
| 672 | if (a === b) return a !== 0 || 1 / a == 1 / b; | ||
| 673 | // A strict comparison is necessary because `null == undefined`. | ||
| 674 | if (a == null || b == null) return a === b; | ||
| 675 | // Unwrap any wrapped objects. | ||
| 676 | if (a._chain) a = a._wrapped; | ||
| 677 | if (b._chain) b = b._wrapped; | ||
| 678 | // Invoke a custom `isEqual` method if one is provided. | ||
| 679 | if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b); | ||
| 680 | if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a); | ||
| 681 | // Compare `[[Class]]` names. | ||
| 682 | var className = toString.call(a); | ||
| 683 | if (className != toString.call(b)) return false; | ||
| 684 | switch (className) { | ||
| 685 | // Strings, numbers, dates, and booleans are compared by value. | ||
| 686 | case '[object String]': | ||
| 687 | // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is | ||
| 688 | // equivalent to `new String("5")`. | ||
| 689 | return a == String(b); | ||
| 690 | case '[object Number]': | ||
| 691 | // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
| 692 | // other numeric values. | ||
| 693 | return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); | ||
| 694 | case '[object Date]': | ||
| 695 | case '[object Boolean]': | ||
| 696 | // Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
| 697 | // millisecond representations. Note that invalid dates with millisecond representations | ||
| 698 | // of `NaN` are not equivalent. | ||
| 699 | return +a == +b; | ||
| 700 | // RegExps are compared by their source patterns and flags. | ||
| 701 | case '[object RegExp]': | ||
| 702 | return a.source == b.source && | ||
| 703 | a.global == b.global && | ||
| 704 | a.multiline == b.multiline && | ||
| 705 | a.ignoreCase == b.ignoreCase; | ||
| 706 | } | ||
| 707 | if (typeof a != 'object' || typeof b != 'object') return false; | ||
| 708 | // Assume equality for cyclic structures. The algorithm for detecting cyclic | ||
| 709 | // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. | ||
| 710 | var length = stack.length; | ||
| 711 | while (length--) { | ||
| 712 | // Linear search. Performance is inversely proportional to the number of | ||
| 713 | // unique nested structures. | ||
| 714 | if (stack[length] == a) return true; | ||
| 715 | } | ||
| 716 | // Add the first object to the stack of traversed objects. | ||
| 717 | stack.push(a); | ||
| 718 | var size = 0, result = true; | ||
| 719 | // Recursively compare objects and arrays. | ||
| 720 | if (className == '[object Array]') { | ||
| 721 | // Compare array lengths to determine if a deep comparison is necessary. | ||
| 722 | size = a.length; | ||
| 723 | result = size == b.length; | ||
| 724 | if (result) { | ||
| 725 | // Deep compare the contents, ignoring non-numeric properties. | ||
| 726 | while (size--) { | ||
| 727 | // Ensure commutative equality for sparse arrays. | ||
| 728 | if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break; | ||
| 729 | } | ||
| 730 | } | ||
| 731 | } else { | ||
| 732 | // Objects with different constructors are not equivalent. | ||
| 733 | if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false; | ||
| 734 | // Deep compare objects. | ||
| 735 | for (var key in a) { | ||
| 736 | if (_.has(a, key)) { | ||
| 737 | // Count the expected number of properties. | ||
| 738 | size++; | ||
| 739 | // Deep compare each member. | ||
| 740 | if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break; | ||
| 741 | } | ||
| 742 | } | ||
| 743 | // Ensure that both objects contain the same number of properties. | ||
| 744 | if (result) { | ||
| 745 | for (key in b) { | ||
| 746 | if (_.has(b, key) && !(size--)) break; | ||
| 747 | } | ||
| 748 | result = !size; | ||
| 749 | } | ||
| 750 | } | ||
| 751 | // Remove the first object from the stack of traversed objects. | ||
| 752 | stack.pop(); | ||
| 753 | return result; | ||
| 754 | } | ||
| 755 | |||
| 756 | // Perform a deep comparison to check if two objects are equal. | ||
| 757 | _.isEqual = function(a, b) { | ||
| 758 | return eq(a, b, []); | ||
| 759 | }; | ||
| 760 | |||
| 761 | // Is a given array, string, or object empty? | ||
| 762 | // An "empty" object has no enumerable own-properties. | ||
| 763 | _.isEmpty = function(obj) { | ||
| 764 | if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; | ||
| 765 | for (var key in obj) if (_.has(obj, key)) return false; | ||
| 766 | return true; | ||
| 767 | }; | ||
| 768 | |||
| 769 | // Is a given value a DOM element? | ||
| 770 | _.isElement = function(obj) { | ||
| 771 | return !!(obj && obj.nodeType == 1); | ||
| 772 | }; | ||
| 773 | |||
| 774 | // Is a given value an array? | ||
| 775 | // Delegates to ECMA5's native Array.isArray | ||
| 776 | _.isArray = nativeIsArray || function(obj) { | ||
| 777 | return toString.call(obj) == '[object Array]'; | ||
| 778 | }; | ||
| 779 | |||
| 780 | // Is a given variable an object? | ||
| 781 | _.isObject = function(obj) { | ||
| 782 | return obj === Object(obj); | ||
| 783 | }; | ||
| 784 | |||
| 785 | // Is a given variable an arguments object? | ||
| 786 | _.isArguments = function(obj) { | ||
| 787 | return toString.call(obj) == '[object Arguments]'; | ||
| 788 | }; | ||
| 789 | if (!_.isArguments(arguments)) { | ||
| 790 | _.isArguments = function(obj) { | ||
| 791 | return !!(obj && _.has(obj, 'callee')); | ||
| 792 | }; | ||
| 793 | } | ||
| 794 | |||
| 795 | // Is a given value a function? | ||
| 796 | _.isFunction = function(obj) { | ||
| 797 | return toString.call(obj) == '[object Function]'; | ||
| 798 | }; | ||
| 799 | |||
| 800 | // Is a given value a string? | ||
| 801 | _.isString = function(obj) { | ||
| 802 | return toString.call(obj) == '[object String]'; | ||
| 803 | }; | ||
| 804 | |||
| 805 | // Is a given value a number? | ||
| 806 | _.isNumber = function(obj) { | ||
| 807 | return toString.call(obj) == '[object Number]'; | ||
| 808 | }; | ||
| 809 | |||
| 810 | // Is the given value `NaN`? | ||
| 811 | _.isNaN = function(obj) { | ||
| 812 | // `NaN` is the only value for which `===` is not reflexive. | ||
| 813 | return obj !== obj; | ||
| 814 | }; | ||
| 815 | |||
| 816 | // Is a given value a boolean? | ||
| 817 | _.isBoolean = function(obj) { | ||
| 818 | return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; | ||
| 819 | }; | ||
| 820 | |||
| 821 | // Is a given value a date? | ||
| 822 | _.isDate = function(obj) { | ||
| 823 | return toString.call(obj) == '[object Date]'; | ||
| 824 | }; | ||
| 825 | |||
| 826 | // Is the given value a regular expression? | ||
| 827 | _.isRegExp = function(obj) { | ||
| 828 | return toString.call(obj) == '[object RegExp]'; | ||
| 829 | }; | ||
| 830 | |||
| 831 | // Is a given value equal to null? | ||
| 832 | _.isNull = function(obj) { | ||
| 833 | return obj === null; | ||
| 834 | }; | ||
| 835 | |||
| 836 | // Is a given variable undefined? | ||
| 837 | _.isUndefined = function(obj) { | ||
| 838 | return obj === void 0; | ||
| 839 | }; | ||
| 840 | |||
| 841 | // Has own property? | ||
| 842 | _.has = function(obj, key) { | ||
| 843 | return hasOwnProperty.call(obj, key); | ||
| 844 | }; | ||
| 845 | |||
| 846 | // Utility Functions | ||
| 847 | // ----------------- | ||
| 848 | |||
| 849 | // Run Underscore.js in *noConflict* mode, returning the `_` variable to its | ||
| 850 | // previous owner. Returns a reference to the Underscore object. | ||
| 851 | _.noConflict = function() { | ||
| 852 | root._ = previousUnderscore; | ||
| 853 | return this; | ||
| 854 | }; | ||
| 855 | |||
| 856 | // Keep the identity function around for default iterators. | ||
| 857 | _.identity = function(value) { | ||
| 858 | return value; | ||
| 859 | }; | ||
| 860 | |||
| 861 | // Run a function **n** times. | ||
| 862 | _.times = function (n, iterator, context) { | ||
| 863 | for (var i = 0; i < n; i++) iterator.call(context, i); | ||
| 864 | }; | ||
| 865 | |||
| 866 | // Escape a string for HTML interpolation. | ||
| 867 | _.escape = function(string) { | ||
| 868 | return (''+string).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g,'/'); | ||
| 869 | }; | ||
| 870 | |||
| 871 | // Add your own custom functions to the Underscore object, ensuring that | ||
| 872 | // they're correctly added to the OOP wrapper as well. | ||
| 873 | _.mixin = function(obj) { | ||
| 874 | each(_.functions(obj), function(name){ | ||
| 875 | addToWrapper(name, _[name] = obj[name]); | ||
| 876 | }); | ||
| 877 | }; | ||
| 878 | |||
| 879 | // Generate a unique integer id (unique within the entire client session). | ||
| 880 | // Useful for temporary DOM ids. | ||
| 881 | var idCounter = 0; | ||
| 882 | _.uniqueId = function(prefix) { | ||
| 883 | var id = idCounter++; | ||
| 884 | return prefix ? prefix + id : id; | ||
| 885 | }; | ||
| 886 | |||
| 887 | // By default, Underscore uses ERB-style template delimiters, change the | ||
| 888 | // following template settings to use alternative delimiters. | ||
| 889 | _.templateSettings = { | ||
| 890 | evaluate : /<%([\s\S]+?)%>/g, | ||
| 891 | interpolate : /<%=([\s\S]+?)%>/g, | ||
| 892 | escape : /<%-([\s\S]+?)%>/g | ||
| 893 | }; | ||
| 894 | |||
| 895 | // When customizing `templateSettings`, if you don't want to define an | ||
| 896 | // interpolation, evaluation or escaping regex, we need one that is | ||
| 897 | // guaranteed not to match. | ||
| 898 | var noMatch = /.^/; | ||
| 899 | |||
| 900 | // Within an interpolation, evaluation, or escaping, remove HTML escaping | ||
| 901 | // that had been previously added. | ||
| 902 | var unescape = function(code) { | ||
| 903 | return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'"); | ||
| 904 | }; | ||
| 905 | |||
| 906 | // JavaScript micro-templating, similar to John Resig's implementation. | ||
| 907 | // Underscore templating handles arbitrary delimiters, preserves whitespace, | ||
| 908 | // and correctly escapes quotes within interpolated code. | ||
| 909 | _.template = function(str, data) { | ||
| 910 | var c = _.templateSettings; | ||
| 911 | var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' + | ||
| 912 | 'with(obj||{}){__p.push(\'' + | ||
| 913 | str.replace(/\\/g, '\\\\') | ||
| 914 | .replace(/'/g, "\\'") | ||
| 915 | .replace(c.escape || noMatch, function(match, code) { | ||
| 916 | return "',_.escape(" + unescape(code) + "),'"; | ||
| 917 | }) | ||
| 918 | .replace(c.interpolate || noMatch, function(match, code) { | ||
| 919 | return "'," + unescape(code) + ",'"; | ||
| 920 | }) | ||
| 921 | .replace(c.evaluate || noMatch, function(match, code) { | ||
| 922 | return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('"; | ||
| 923 | }) | ||
| 924 | .replace(/\r/g, '\\r') | ||
| 925 | .replace(/\n/g, '\\n') | ||
| 926 | .replace(/\t/g, '\\t') | ||
| 927 | + "');}return __p.join('');"; | ||
| 928 | var func = new Function('obj', '_', tmpl); | ||
| 929 | if (data) return func(data, _); | ||
| 930 | return function(data) { | ||
| 931 | return func.call(this, data, _); | ||
| 932 | }; | ||
| 933 | }; | ||
| 934 | |||
| 935 | // Add a "chain" function, which will delegate to the wrapper. | ||
| 936 | _.chain = function(obj) { | ||
| 937 | return _(obj).chain(); | ||
| 938 | }; | ||
| 939 | |||
| 940 | // The OOP Wrapper | ||
| 941 | // --------------- | ||
| 942 | |||
| 943 | // If Underscore is called as a function, it returns a wrapped object that | ||
| 944 | // can be used OO-style. This wrapper holds altered versions of all the | ||
| 945 | // underscore functions. Wrapped objects may be chained. | ||
| 946 | var wrapper = function(obj) { this._wrapped = obj; }; | ||
| 947 | |||
| 948 | // Expose `wrapper.prototype` as `_.prototype` | ||
| 949 | _.prototype = wrapper.prototype; | ||
| 950 | |||
| 951 | // Helper function to continue chaining intermediate results. | ||
| 952 | var result = function(obj, chain) { | ||
| 953 | return chain ? _(obj).chain() : obj; | ||
| 954 | }; | ||
| 955 | |||
| 956 | // A method to easily add functions to the OOP wrapper. | ||
| 957 | var addToWrapper = function(name, func) { | ||
| 958 | wrapper.prototype[name] = function() { | ||
| 959 | var args = slice.call(arguments); | ||
| 960 | unshift.call(args, this._wrapped); | ||
| 961 | return result(func.apply(_, args), this._chain); | ||
| 962 | }; | ||
| 963 | }; | ||
| 964 | |||
| 965 | // Add all of the Underscore functions to the wrapper object. | ||
| 966 | _.mixin(_); | ||
| 967 | |||
| 968 | // Add all mutator Array functions to the wrapper. | ||
| 969 | each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { | ||
| 970 | var method = ArrayProto[name]; | ||
| 971 | wrapper.prototype[name] = function() { | ||
| 972 | var wrapped = this._wrapped; | ||
| 973 | method.apply(wrapped, arguments); | ||
| 974 | var length = wrapped.length; | ||
| 975 | if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0]; | ||
| 976 | return result(wrapped, this._chain); | ||
| 977 | }; | ||
| 978 | }); | ||
| 979 | |||
| 980 | // Add all accessor Array functions to the wrapper. | ||
| 981 | each(['concat', 'join', 'slice'], function(name) { | ||
| 982 | var method = ArrayProto[name]; | ||
| 983 | wrapper.prototype[name] = function() { | ||
| 984 | return result(method.apply(this._wrapped, arguments), this._chain); | ||
| 985 | }; | ||
| 986 | }); | ||
| 987 | |||
| 988 | // Start chaining a wrapped Underscore object. | ||
| 989 | wrapper.prototype.chain = function() { | ||
| 990 | this._chain = true; | ||
| 991 | return this; | ||
| 992 | }; | ||
| 993 | |||
| 994 | // Extracts the result from a wrapped and chained object. | ||
| 995 | wrapper.prototype.value = function() { | ||
| 996 | return this._wrapped; | ||
| 997 | }; | ||
| 998 | |||
| 999 | }).call(this); | ||
diff --git a/_static/underscore.js b/_static/underscore.js new file mode 100644 index 0000000..5b55f32 --- /dev/null +++ b/_static/underscore.js | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Underscore.js 1.3.1 | ||
| 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. | ||
| 3 | // Underscore is freely distributable under the MIT license. | ||
| 4 | // Portions of Underscore are inspired or borrowed from Prototype, | ||
| 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. | ||
| 6 | // For all details and documentation: | ||
| 7 | // http://documentcloud.github.com/underscore | ||
| 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== | ||
| 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, | ||
| 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= | ||
| 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===n)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===n)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(x&&a.map===x)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a== | ||
| 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= | ||
| 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= | ||
| 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= | ||
| 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})}); | ||
| 16 | return e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){f==0?b[0]=a:(d=Math.floor(Math.random()*(f+1)),b[f]=b[d],b[d]=a)});return b};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,g){return{value:a,criteria:c.call(d,a,b,g)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, | ||
| 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:a.toArray?a.toArray():b.isArray(a)?i.call(a):b.isArguments(a)?i.call(a):b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest= | ||
| 18 | b.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,e=[];b.reduce(d,function(d,g,h){if(0==h||(c===true?b.last(d)!=g:!b.include(d,g)))d[d.length]=g,e[e.length]=a[h];return d},[]); | ||
| 19 | return e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c, | ||
| 20 | d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(p&&a.indexOf===p)return a.indexOf(c);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(D&&a.lastIndexOf===D)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g}; | ||
| 21 | var F=function(){};b.bind=function(a,c){var d,e;if(a.bind===s&&s)return s.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));F.prototype=a.prototype;var b=new F,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a, | ||
| 22 | c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i=b.debounce(function(){h=g=false},c);return function(){d=this;e=arguments;var b;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);i()},c));g?h=true: | ||
| 23 | a.apply(d,e);i();g=true}};b.debounce=function(a,b){var d;return function(){var e=this,f=arguments;clearTimeout(d);d=setTimeout(function(){d=null;a.apply(e,f)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}}; | ||
| 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, | ||
| 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; | ||
| 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; | ||
| 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), | ||
| 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ | ||
| 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= | ||
| 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= | ||
| 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); | ||
diff --git a/_static/up-pressed.png b/_static/up-pressed.png new file mode 100644 index 0000000..99e7210 --- /dev/null +++ b/_static/up-pressed.png | |||
| Binary files differ | |||
diff --git a/_static/up.png b/_static/up.png new file mode 100644 index 0000000..26de002 --- /dev/null +++ b/_static/up.png | |||
| Binary files differ | |||
diff --git a/_static/websupport.js b/_static/websupport.js new file mode 100644 index 0000000..28d65db --- /dev/null +++ b/_static/websupport.js | |||
| @@ -0,0 +1,808 @@ | |||
| 1 | /* | ||
| 2 | * websupport.js | ||
| 3 | * ~~~~~~~~~~~~~ | ||
| 4 | * | ||
| 5 | * sphinx.websupport utilties for all documentation. | ||
| 6 | * | ||
| 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. | ||
| 8 | * :license: BSD, see LICENSE for details. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | (function($) { | ||
| 13 | $.fn.autogrow = function() { | ||
| 14 | return this.each(function() { | ||
| 15 | var textarea = this; | ||
| 16 | |||
| 17 | $.fn.autogrow.resize(textarea); | ||
| 18 | |||
| 19 | $(textarea) | ||
| 20 | .focus(function() { | ||
| 21 | textarea.interval = setInterval(function() { | ||
| 22 | $.fn.autogrow.resize(textarea); | ||
| 23 | }, 500); | ||
| 24 | }) | ||
| 25 | .blur(function() { | ||
| 26 | clearInterval(textarea.interval); | ||
| 27 | }); | ||
| 28 | }); | ||
| 29 | }; | ||
| 30 | |||
| 31 | $.fn.autogrow.resize = function(textarea) { | ||
| 32 | var lineHeight = parseInt($(textarea).css('line-height'), 10); | ||
| 33 | var lines = textarea.value.split('\n'); | ||
| 34 | var columns = textarea.cols; | ||
| 35 | var lineCount = 0; | ||
| 36 | $.each(lines, function() { | ||
| 37 | lineCount += Math.ceil(this.length / columns) || 1; | ||
| 38 | }); | ||
| 39 | var height = lineHeight * (lineCount + 1); | ||
| 40 | $(textarea).css('height', height); | ||
| 41 | }; | ||
| 42 | })(jQuery); | ||
| 43 | |||
| 44 | (function($) { | ||
| 45 | var comp, by; | ||
| 46 | |||
| 47 | function init() { | ||
| 48 | initEvents(); | ||
| 49 | initComparator(); | ||
| 50 | } | ||
| 51 | |||
| 52 | function initEvents() { | ||
| 53 | $(document).on("click", 'a.comment-close', function(event) { | ||
| 54 | event.preventDefault(); | ||
| 55 | hide($(this).attr('id').substring(2)); | ||
| 56 | }); | ||
| 57 | $(document).on("click", 'a.vote', function(event) { | ||
| 58 | event.preventDefault(); | ||
| 59 | handleVote($(this)); | ||
| 60 | }); | ||
| 61 | $(document).on("click", 'a.reply', function(event) { | ||
| 62 | event.preventDefault(); | ||
| 63 | openReply($(this).attr('id').substring(2)); | ||
| 64 | }); | ||
| 65 | $(document).on("click", 'a.close-reply', function(event) { | ||
| 66 | event.preventDefault(); | ||
| 67 | closeReply($(this).attr('id').substring(2)); | ||
| 68 | }); | ||
| 69 | $(document).on("click", 'a.sort-option', function(event) { | ||
| 70 | event.preventDefault(); | ||
| 71 | handleReSort($(this)); | ||
| 72 | }); | ||
| 73 | $(document).on("click", 'a.show-proposal', function(event) { | ||
| 74 | event.preventDefault(); | ||
| 75 | showProposal($(this).attr('id').substring(2)); | ||
| 76 | }); | ||
| 77 | $(document).on("click", 'a.hide-proposal', function(event) { | ||
| 78 | event.preventDefault(); | ||
| 79 | hideProposal($(this).attr('id').substring(2)); | ||
| 80 | }); | ||
| 81 | $(document).on("click", 'a.show-propose-change', function(event) { | ||
| 82 | event.preventDefault(); | ||
| 83 | showProposeChange($(this).attr('id').substring(2)); | ||
| 84 | }); | ||
| 85 | $(document).on("click", 'a.hide-propose-change', function(event) { | ||
| 86 | event.preventDefault(); | ||
| 87 | hideProposeChange($(this).attr('id').substring(2)); | ||
| 88 | }); | ||
| 89 | $(document).on("click", 'a.accept-comment', function(event) { | ||
| 90 | event.preventDefault(); | ||
| 91 | acceptComment($(this).attr('id').substring(2)); | ||
| 92 | }); | ||
| 93 | $(document).on("click", 'a.delete-comment', function(event) { | ||
| 94 | event.preventDefault(); | ||
| 95 | deleteComment($(this).attr('id').substring(2)); | ||
| 96 | }); | ||
| 97 | $(document).on("click", 'a.comment-markup', function(event) { | ||
| 98 | event.preventDefault(); | ||
| 99 | toggleCommentMarkupBox($(this).attr('id').substring(2)); | ||
| 100 | }); | ||
| 101 | } | ||
| 102 | |||
| 103 | /** | ||
| 104 | * Set comp, which is a comparator function used for sorting and | ||
| 105 | * inserting comments into the list. | ||
| 106 | */ | ||
| 107 | function setComparator() { | ||
| 108 | // If the first three letters are "asc", sort in ascending order | ||
| 109 | // and remove the prefix. | ||
| 110 | if (by.substring(0,3) == 'asc') { | ||
| 111 | var i = by.substring(3); | ||
| 112 | comp = function(a, b) { return a[i] - b[i]; }; | ||
| 113 | } else { | ||
| 114 | // Otherwise sort in descending order. | ||
| 115 | comp = function(a, b) { return b[by] - a[by]; }; | ||
| 116 | } | ||
| 117 | |||
| 118 | // Reset link styles and format the selected sort option. | ||
| 119 | $('a.sel').attr('href', '#').removeClass('sel'); | ||
| 120 | $('a.by' + by).removeAttr('href').addClass('sel'); | ||
| 121 | } | ||
| 122 | |||
| 123 | /** | ||
| 124 | * Create a comp function. If the user has preferences stored in | ||
| 125 | * the sortBy cookie, use those, otherwise use the default. | ||
| 126 | */ | ||
| 127 | function initComparator() { | ||
| 128 | by = 'rating'; // Default to sort by rating. | ||
| 129 | // If the sortBy cookie is set, use that instead. | ||
| 130 | if (document.cookie.length > 0) { | ||
| 131 | var start = document.cookie.indexOf('sortBy='); | ||
| 132 | if (start != -1) { | ||
| 133 | start = start + 7; | ||
| 134 | var end = document.cookie.indexOf(";", start); | ||
| 135 | if (end == -1) { | ||
| 136 | end = document.cookie.length; | ||
| 137 | by = unescape(document.cookie.substring(start, end)); | ||
| 138 | } | ||
| 139 | } | ||
| 140 | } | ||
| 141 | setComparator(); | ||
| 142 | } | ||
| 143 | |||
| 144 | /** | ||
| 145 | * Show a comment div. | ||
| 146 | */ | ||
| 147 | function show(id) { | ||
| 148 | $('#ao' + id).hide(); | ||
| 149 | $('#ah' + id).show(); | ||
| 150 | var context = $.extend({id: id}, opts); | ||
| 151 | var popup = $(renderTemplate(popupTemplate, context)).hide(); | ||
| 152 | popup.find('textarea[name="proposal"]').hide(); | ||
| 153 | popup.find('a.by' + by).addClass('sel'); | ||
| 154 | var form = popup.find('#cf' + id); | ||
| 155 | form.submit(function(event) { | ||
| 156 | event.preventDefault(); | ||
| 157 | addComment(form); | ||
| 158 | }); | ||
| 159 | $('#s' + id).after(popup); | ||
| 160 | popup.slideDown('fast', function() { | ||
| 161 | getComments(id); | ||
| 162 | }); | ||
| 163 | } | ||
| 164 | |||
| 165 | /** | ||
| 166 | * Hide a comment div. | ||
| 167 | */ | ||
| 168 | function hide(id) { | ||
| 169 | $('#ah' + id).hide(); | ||
| 170 | $('#ao' + id).show(); | ||
| 171 | var div = $('#sc' + id); | ||
| 172 | div.slideUp('fast', function() { | ||
| 173 | div.remove(); | ||
| 174 | }); | ||
| 175 | } | ||
| 176 | |||
| 177 | /** | ||
| 178 | * Perform an ajax request to get comments for a node | ||
| 179 | * and insert the comments into the comments tree. | ||
| 180 | */ | ||
| 181 | function getComments(id) { | ||
| 182 | $.ajax({ | ||
| 183 | type: 'GET', | ||
| 184 | url: opts.getCommentsURL, | ||
| 185 | data: {node: id}, | ||
| 186 | success: function(data, textStatus, request) { | ||
| 187 | var ul = $('#cl' + id); | ||
| 188 | var speed = 100; | ||
| 189 | $('#cf' + id) | ||
| 190 | .find('textarea[name="proposal"]') | ||
| 191 | .data('source', data.source); | ||
| 192 | |||
| 193 | if (data.comments.length === 0) { | ||
| 194 | ul.html('<li>No comments yet.</li>'); | ||
| 195 | ul.data('empty', true); | ||
| 196 | } else { | ||
| 197 | // If there are comments, sort them and put them in the list. | ||
| 198 | var comments = sortComments(data.comments); | ||
| 199 | speed = data.comments.length * 100; | ||
| 200 | appendComments(comments, ul); | ||
| 201 | ul.data('empty', false); | ||
| 202 | } | ||
| 203 | $('#cn' + id).slideUp(speed + 200); | ||
| 204 | ul.slideDown(speed); | ||
| 205 | }, | ||
| 206 | error: function(request, textStatus, error) { | ||
| 207 | showError('Oops, there was a problem retrieving the comments.'); | ||
| 208 | }, | ||
| 209 | dataType: 'json' | ||
| 210 | }); | ||
| 211 | } | ||
| 212 | |||
| 213 | /** | ||
| 214 | * Add a comment via ajax and insert the comment into the comment tree. | ||
| 215 | */ | ||
| 216 | function addComment(form) { | ||
| 217 | var node_id = form.find('input[name="node"]').val(); | ||
| 218 | var parent_id = form.find('input[name="parent"]').val(); | ||
| 219 | var text = form.find('textarea[name="comment"]').val(); | ||
| 220 | var proposal = form.find('textarea[name="proposal"]').val(); | ||
| 221 | |||
| 222 | if (text == '') { | ||
| 223 | showError('Please enter a comment.'); | ||
| 224 | return; | ||
| 225 | } | ||
| 226 | |||
| 227 | // Disable the form that is being submitted. | ||
| 228 | form.find('textarea,input').attr('disabled', 'disabled'); | ||
| 229 | |||
| 230 | // Send the comment to the server. | ||
| 231 | $.ajax({ | ||
| 232 | type: "POST", | ||
| 233 | url: opts.addCommentURL, | ||
| 234 | dataType: 'json', | ||
| 235 | data: { | ||
| 236 | node: node_id, | ||
| 237 | parent: parent_id, | ||
| 238 | text: text, | ||
| 239 | proposal: proposal | ||
| 240 | }, | ||
| 241 | success: function(data, textStatus, error) { | ||
| 242 | // Reset the form. | ||
| 243 | if (node_id) { | ||
| 244 | hideProposeChange(node_id); | ||
| 245 | } | ||
| 246 | form.find('textarea') | ||
| 247 | .val('') | ||
| 248 | .add(form.find('input')) | ||
| 249 | .removeAttr('disabled'); | ||
| 250 | var ul = $('#cl' + (node_id || parent_id)); | ||
| 251 | if (ul.data('empty')) { | ||
| 252 | $(ul).empty(); | ||
| 253 | ul.data('empty', false); | ||
| 254 | } | ||
| 255 | insertComment(data.comment); | ||
| 256 | var ao = $('#ao' + node_id); | ||
| 257 | ao.find('img').attr({'src': opts.commentBrightImage}); | ||
| 258 | if (node_id) { | ||
| 259 | // if this was a "root" comment, remove the commenting box | ||
| 260 | // (the user can get it back by reopening the comment popup) | ||
| 261 | $('#ca' + node_id).slideUp(); | ||
| 262 | } | ||
| 263 | }, | ||
| 264 | error: function(request, textStatus, error) { | ||
| 265 | form.find('textarea,input').removeAttr('disabled'); | ||
| 266 | showError('Oops, there was a problem adding the comment.'); | ||
| 267 | } | ||
| 268 | }); | ||
| 269 | } | ||
| 270 | |||
| 271 | /** | ||
| 272 | * Recursively append comments to the main comment list and children | ||
| 273 | * lists, creating the comment tree. | ||
| 274 | */ | ||
| 275 | function appendComments(comments, ul) { | ||
| 276 | $.each(comments, function() { | ||
| 277 | var div = createCommentDiv(this); | ||
| 278 | ul.append($(document.createElement('li')).html(div)); | ||
| 279 | appendComments(this.children, div.find('ul.comment-children')); | ||
| 280 | // To avoid stagnating data, don't store the comments children in data. | ||
| 281 | this.children = null; | ||
| 282 | div.data('comment', this); | ||
| 283 | }); | ||
| 284 | } | ||
| 285 | |||
| 286 | /** | ||
| 287 | * After adding a new comment, it must be inserted in the correct | ||
| 288 | * location in the comment tree. | ||
| 289 | */ | ||
| 290 | function insertComment(comment) { | ||
| 291 | var div = createCommentDiv(comment); | ||
| 292 | |||
| 293 | // To avoid stagnating data, don't store the comments children in data. | ||
| 294 | comment.children = null; | ||
| 295 | div.data('comment', comment); | ||
| 296 | |||
| 297 | var ul = $('#cl' + (comment.node || comment.parent)); | ||
| 298 | var siblings = getChildren(ul); | ||
| 299 | |||
| 300 | var li = $(document.createElement('li')); | ||
| 301 | li.hide(); | ||
| 302 | |||
| 303 | // Determine where in the parents children list to insert this comment. | ||
| 304 | for(i=0; i < siblings.length; i++) { | ||
| 305 | if (comp(comment, siblings[i]) <= 0) { | ||
| 306 | $('#cd' + siblings[i].id) | ||
| 307 | .parent() | ||
| 308 | .before(li.html(div)); | ||
| 309 | li.slideDown('fast'); | ||
| 310 | return; | ||
| 311 | } | ||
| 312 | } | ||
| 313 | |||
| 314 | // If we get here, this comment rates lower than all the others, | ||
| 315 | // or it is the only comment in the list. | ||
| 316 | ul.append(li.html(div)); | ||
| 317 | li.slideDown('fast'); | ||
| 318 | } | ||
| 319 | |||
| 320 | function acceptComment(id) { | ||
| 321 | $.ajax({ | ||
| 322 | type: 'POST', | ||
| 323 | url: opts.acceptCommentURL, | ||
| 324 | data: {id: id}, | ||
| 325 | success: function(data, textStatus, request) { | ||
| 326 | $('#cm' + id).fadeOut('fast'); | ||
| 327 | $('#cd' + id).removeClass('moderate'); | ||
| 328 | }, | ||
| 329 | error: function(request, textStatus, error) { | ||
| 330 | showError('Oops, there was a problem accepting the comment.'); | ||
| 331 | } | ||
| 332 | }); | ||
| 333 | } | ||
| 334 | |||
| 335 | function deleteComment(id) { | ||
| 336 | $.ajax({ | ||
| 337 | type: 'POST', | ||
| 338 | url: opts.deleteCommentURL, | ||
| 339 | data: {id: id}, | ||
| 340 | success: function(data, textStatus, request) { | ||
| 341 | var div = $('#cd' + id); | ||
| 342 | if (data == 'delete') { | ||
| 343 | // Moderator mode: remove the comment and all children immediately | ||
| 344 | div.slideUp('fast', function() { | ||
| 345 | div.remove(); | ||
| 346 | }); | ||
| 347 | return; | ||
| 348 | } | ||
| 349 | // User mode: only mark the comment as deleted | ||
| 350 | div | ||
| 351 | .find('span.user-id:first') | ||
| 352 | .text('[deleted]').end() | ||
| 353 | .find('div.comment-text:first') | ||
| 354 | .text('[deleted]').end() | ||
| 355 | .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id + | ||
| 356 | ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id) | ||
| 357 | .remove(); | ||
| 358 | var comment = div.data('comment'); | ||
| 359 | comment.username = '[deleted]'; | ||
| 360 | comment.text = '[deleted]'; | ||
| 361 | div.data('comment', comment); | ||
| 362 | }, | ||
| 363 | error: function(request, textStatus, error) { | ||
| 364 | showError('Oops, there was a problem deleting the comment.'); | ||
| 365 | } | ||
| 366 | }); | ||
| 367 | } | ||
| 368 | |||
| 369 | function showProposal(id) { | ||
| 370 | $('#sp' + id).hide(); | ||
| 371 | $('#hp' + id).show(); | ||
| 372 | $('#pr' + id).slideDown('fast'); | ||
| 373 | } | ||
| 374 | |||
| 375 | function hideProposal(id) { | ||
| 376 | $('#hp' + id).hide(); | ||
| 377 | $('#sp' + id).show(); | ||
| 378 | $('#pr' + id).slideUp('fast'); | ||
| 379 | } | ||
| 380 | |||
| 381 | function showProposeChange(id) { | ||
| 382 | $('#pc' + id).hide(); | ||
| 383 | $('#hc' + id).show(); | ||
| 384 | var textarea = $('#pt' + id); | ||
| 385 | textarea.val(textarea.data('source')); | ||
| 386 | $.fn.autogrow.resize(textarea[0]); | ||
| 387 | textarea.slideDown('fast'); | ||
| 388 | } | ||
| 389 | |||
| 390 | function hideProposeChange(id) { | ||
| 391 | $('#hc' + id).hide(); | ||
| 392 | $('#pc' + id).show(); | ||
| 393 | var textarea = $('#pt' + id); | ||
| 394 | textarea.val('').removeAttr('disabled'); | ||
| 395 | textarea.slideUp('fast'); | ||
| 396 | } | ||
| 397 | |||
| 398 | function toggleCommentMarkupBox(id) { | ||
| 399 | $('#mb' + id).toggle(); | ||
| 400 | } | ||
| 401 | |||
| 402 | /** Handle when the user clicks on a sort by link. */ | ||
| 403 | function handleReSort(link) { | ||
| 404 | var classes = link.attr('class').split(/\s+/); | ||
| 405 | for (var i=0; i<classes.length; i++) { | ||
| 406 | if (classes[i] != 'sort-option') { | ||
| 407 | by = classes[i].substring(2); | ||
| 408 | } | ||
| 409 | } | ||
| 410 | setComparator(); | ||
| 411 | // Save/update the sortBy cookie. | ||
| 412 | var expiration = new Date(); | ||
| 413 | expiration.setDate(expiration.getDate() + 365); | ||
| 414 | document.cookie= 'sortBy=' + escape(by) + | ||
| 415 | ';expires=' + expiration.toUTCString(); | ||
| 416 | $('ul.comment-ul').each(function(index, ul) { | ||
| 417 | var comments = getChildren($(ul), true); | ||
| 418 | comments = sortComments(comments); | ||
| 419 | appendComments(comments, $(ul).empty()); | ||
| 420 | }); | ||
| 421 | } | ||
| 422 | |||
| 423 | /** | ||
| 424 | * Function to process a vote when a user clicks an arrow. | ||
| 425 | */ | ||
| 426 | function handleVote(link) { | ||
| 427 | if (!opts.voting) { | ||
| 428 | showError("You'll need to login to vote."); | ||
| 429 | return; | ||
| 430 | } | ||
| 431 | |||
| 432 | var id = link.attr('id'); | ||
| 433 | if (!id) { | ||
| 434 | // Didn't click on one of the voting arrows. | ||
| 435 | return; | ||
| 436 | } | ||
| 437 | // If it is an unvote, the new vote value is 0, | ||
| 438 | // Otherwise it's 1 for an upvote, or -1 for a downvote. | ||
| 439 | var value = 0; | ||
| 440 | if (id.charAt(1) != 'u') { | ||
| 441 | value = id.charAt(0) == 'u' ? 1 : -1; | ||
| 442 | } | ||
| 443 | // The data to be sent to the server. | ||
| 444 | var d = { | ||
| 445 | comment_id: id.substring(2), | ||
| 446 | value: value | ||
| 447 | }; | ||
| 448 | |||
| 449 | // Swap the vote and unvote links. | ||
| 450 | link.hide(); | ||
| 451 | $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id) | ||
| 452 | .show(); | ||
| 453 | |||
| 454 | // The div the comment is displayed in. | ||
| 455 | var div = $('div#cd' + d.comment_id); | ||
| 456 | var data = div.data('comment'); | ||
| 457 | |||
| 458 | // If this is not an unvote, and the other vote arrow has | ||
| 459 | // already been pressed, unpress it. | ||
| 460 | if ((d.value !== 0) && (data.vote === d.value * -1)) { | ||
| 461 | $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide(); | ||
| 462 | $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show(); | ||
| 463 | } | ||
| 464 | |||
| 465 | // Update the comments rating in the local data. | ||
| 466 | data.rating += (data.vote === 0) ? d.value : (d.value - data.vote); | ||
| 467 | data.vote = d.value; | ||
| 468 | div.data('comment', data); | ||
| 469 | |||
| 470 | // Change the rating text. | ||
| 471 | div.find('.rating:first') | ||
| 472 | .text(data.rating + ' point' + (data.rating == 1 ? '' : 's')); | ||
| 473 | |||
| 474 | // Send the vote information to the server. | ||
| 475 | $.ajax({ | ||
| 476 | type: "POST", | ||
| 477 | url: opts.processVoteURL, | ||
| 478 | data: d, | ||
| 479 | error: function(request, textStatus, error) { | ||
| 480 | showError('Oops, there was a problem casting that vote.'); | ||
| 481 | } | ||
| 482 | }); | ||
| 483 | } | ||
| 484 | |||
| 485 | /** | ||
| 486 | * Open a reply form used to reply to an existing comment. | ||
| 487 | */ | ||
| 488 | function openReply(id) { | ||
| 489 | // Swap out the reply link for the hide link | ||
| 490 | $('#rl' + id).hide(); | ||
| 491 | $('#cr' + id).show(); | ||
| 492 | |||
| 493 | // Add the reply li to the children ul. | ||
| 494 | var div = $(renderTemplate(replyTemplate, {id: id})).hide(); | ||
| 495 | $('#cl' + id) | ||
| 496 | .prepend(div) | ||
| 497 | // Setup the submit handler for the reply form. | ||
| 498 | .find('#rf' + id) | ||
| 499 | .submit(function(event) { | ||
| 500 | event.preventDefault(); | ||
| 501 | addComment($('#rf' + id)); | ||
| 502 | closeReply(id); | ||
| 503 | }) | ||
| 504 | .find('input[type=button]') | ||
| 505 | .click(function() { | ||
| 506 | closeReply(id); | ||
| 507 | }); | ||
| 508 | div.slideDown('fast', function() { | ||
| 509 | $('#rf' + id).find('textarea').focus(); | ||
| 510 | }); | ||
| 511 | } | ||
| 512 | |||
| 513 | /** | ||
| 514 | * Close the reply form opened with openReply. | ||
| 515 | */ | ||
| 516 | function closeReply(id) { | ||
| 517 | // Remove the reply div from the DOM. | ||
| 518 | $('#rd' + id).slideUp('fast', function() { | ||
| 519 | $(this).remove(); | ||
| 520 | }); | ||
| 521 | |||
| 522 | // Swap out the hide link for the reply link | ||
| 523 | $('#cr' + id).hide(); | ||
| 524 | $('#rl' + id).show(); | ||
| 525 | } | ||
| 526 | |||
| 527 | /** | ||
| 528 | * Recursively sort a tree of comments using the comp comparator. | ||
| 529 | */ | ||
| 530 | function sortComments(comments) { | ||
| 531 | comments.sort(comp); | ||
| 532 | $.each(comments, function() { | ||
| 533 | this.children = sortComments(this.children); | ||
| 534 | }); | ||
| 535 | return comments; | ||
| 536 | } | ||
| 537 | |||
| 538 | /** | ||
| 539 | * Get the children comments from a ul. If recursive is true, | ||
| 540 | * recursively include childrens' children. | ||
| 541 | */ | ||
| 542 | function getChildren(ul, recursive) { | ||
| 543 | var children = []; | ||
| 544 | ul.children().children("[id^='cd']") | ||
| 545 | .each(function() { | ||
| 546 | var comment = $(this).data('comment'); | ||
| 547 | if (recursive) | ||
| 548 | comment.children = getChildren($(this).find('#cl' + comment.id), true); | ||
| 549 | children.push(comment); | ||
| 550 | }); | ||
| 551 | return children; | ||
| 552 | } | ||
| 553 | |||
| 554 | /** Create a div to display a comment in. */ | ||
| 555 | function createCommentDiv(comment) { | ||
| 556 | if (!comment.displayed && !opts.moderator) { | ||
| 557 | return $('<div class="moderate">Thank you! Your comment will show up ' | ||
| 558 | + 'once it is has been approved by a moderator.</div>'); | ||
| 559 | } | ||
| 560 | // Prettify the comment rating. | ||
| 561 | comment.pretty_rating = comment.rating + ' point' + | ||
| 562 | (comment.rating == 1 ? '' : 's'); | ||
| 563 | // Make a class (for displaying not yet moderated comments differently) | ||
| 564 | comment.css_class = comment.displayed ? '' : ' moderate'; | ||
| 565 | // Create a div for this comment. | ||
| 566 | var context = $.extend({}, opts, comment); | ||
| 567 | var div = $(renderTemplate(commentTemplate, context)); | ||
| 568 | |||
| 569 | // If the user has voted on this comment, highlight the correct arrow. | ||
| 570 | if (comment.vote) { | ||
| 571 | var direction = (comment.vote == 1) ? 'u' : 'd'; | ||
| 572 | div.find('#' + direction + 'v' + comment.id).hide(); | ||
| 573 | div.find('#' + direction + 'u' + comment.id).show(); | ||
| 574 | } | ||
| 575 | |||
| 576 | if (opts.moderator || comment.text != '[deleted]') { | ||
| 577 | div.find('a.reply').show(); | ||
| 578 | if (comment.proposal_diff) | ||
| 579 | div.find('#sp' + comment.id).show(); | ||
| 580 | if (opts.moderator && !comment.displayed) | ||
| 581 | div.find('#cm' + comment.id).show(); | ||
| 582 | if (opts.moderator || (opts.username == comment.username)) | ||
| 583 | div.find('#dc' + comment.id).show(); | ||
| 584 | } | ||
| 585 | return div; | ||
| 586 | } | ||
| 587 | |||
| 588 | /** | ||
| 589 | * A simple template renderer. Placeholders such as <%id%> are replaced | ||
| 590 | * by context['id'] with items being escaped. Placeholders such as <#id#> | ||
| 591 | * are not escaped. | ||
| 592 | */ | ||
| 593 | function renderTemplate(template, context) { | ||
| 594 | var esc = $(document.createElement('div')); | ||
| 595 | |||
| 596 | function handle(ph, escape) { | ||
| 597 | var cur = context; | ||
| 598 | $.each(ph.split('.'), function() { | ||
| 599 | cur = cur[this]; | ||
| 600 | }); | ||
| 601 | return escape ? esc.text(cur || "").html() : cur; | ||
| 602 | } | ||
| 603 | |||
| 604 | return template.replace(/<([%#])([\w\.]*)\1>/g, function() { | ||
| 605 | return handle(arguments[2], arguments[1] == '%' ? true : false); | ||
| 606 | }); | ||
| 607 | } | ||
| 608 | |||
| 609 | /** Flash an error message briefly. */ | ||
| 610 | function showError(message) { | ||
| 611 | $(document.createElement('div')).attr({'class': 'popup-error'}) | ||
| 612 | .append($(document.createElement('div')) | ||
| 613 | .attr({'class': 'error-message'}).text(message)) | ||
| 614 | .appendTo('body') | ||
| 615 | .fadeIn("slow") | ||
| 616 | .delay(2000) | ||
| 617 | .fadeOut("slow"); | ||
| 618 | } | ||
| 619 | |||
| 620 | /** Add a link the user uses to open the comments popup. */ | ||
| 621 | $.fn.comment = function() { | ||
| 622 | return this.each(function() { | ||
| 623 | var id = $(this).attr('id').substring(1); | ||
| 624 | var count = COMMENT_METADATA[id]; | ||
| 625 | var title = count + ' comment' + (count == 1 ? '' : 's'); | ||
| 626 | var image = count > 0 ? opts.commentBrightImage : opts.commentImage; | ||
| 627 | var addcls = count == 0 ? ' nocomment' : ''; | ||
| 628 | $(this) | ||
| 629 | .append( | ||
| 630 | $(document.createElement('a')).attr({ | ||
| 631 | href: '#', | ||
| 632 | 'class': 'sphinx-comment-open' + addcls, | ||
| 633 | id: 'ao' + id | ||
| 634 | }) | ||
| 635 | .append($(document.createElement('img')).attr({ | ||
| 636 | src: image, | ||
| 637 | alt: 'comment', | ||
| 638 | title: title | ||
| 639 | })) | ||
| 640 | .click(function(event) { | ||
| 641 | event.preventDefault(); | ||
| 642 | show($(this).attr('id').substring(2)); | ||
| 643 | }) | ||
| 644 | ) | ||
| 645 | .append( | ||
| 646 | $(document.createElement('a')).attr({ | ||
| 647 | href: '#', | ||
| 648 | 'class': 'sphinx-comment-close hidden', | ||
| 649 | id: 'ah' + id | ||
| 650 | }) | ||
| 651 | .append($(document.createElement('img')).attr({ | ||
| 652 | src: opts.closeCommentImage, | ||
| 653 | alt: 'close', | ||
| 654 | title: 'close' | ||
| 655 | })) | ||
| 656 | .click(function(event) { | ||
| 657 | event.preventDefault(); | ||
| 658 | hide($(this).attr('id').substring(2)); | ||
| 659 | }) | ||
| 660 | ); | ||
| 661 | }); | ||
| 662 | }; | ||
| 663 | |||
| 664 | var opts = { | ||
| 665 | processVoteURL: '/_process_vote', | ||
| 666 | addCommentURL: '/_add_comment', | ||
| 667 | getCommentsURL: '/_get_comments', | ||
| 668 | acceptCommentURL: '/_accept_comment', | ||
| 669 | deleteCommentURL: '/_delete_comment', | ||
| 670 | commentImage: '/static/_static/comment.png', | ||
| 671 | closeCommentImage: '/static/_static/comment-close.png', | ||
| 672 | loadingImage: '/static/_static/ajax-loader.gif', | ||
| 673 | commentBrightImage: '/static/_static/comment-bright.png', | ||
| 674 | upArrow: '/static/_static/up.png', | ||
| 675 | downArrow: '/static/_static/down.png', | ||
| 676 | upArrowPressed: '/static/_static/up-pressed.png', | ||
| 677 | downArrowPressed: '/static/_static/down-pressed.png', | ||
| 678 | voting: false, | ||
| 679 | moderator: false | ||
| 680 | }; | ||
| 681 | |||
| 682 | if (typeof COMMENT_OPTIONS != "undefined") { | ||
| 683 | opts = jQuery.extend(opts, COMMENT_OPTIONS); | ||
| 684 | } | ||
| 685 | |||
| 686 | var popupTemplate = '\ | ||
| 687 | <div class="sphinx-comments" id="sc<%id%>">\ | ||
| 688 | <p class="sort-options">\ | ||
| 689 | Sort by:\ | ||
| 690 | <a href="#" class="sort-option byrating">best rated</a>\ | ||
| 691 | <a href="#" class="sort-option byascage">newest</a>\ | ||
| 692 | <a href="#" class="sort-option byage">oldest</a>\ | ||
| 693 | </p>\ | ||
| 694 | <div class="comment-header">Comments</div>\ | ||
| 695 | <div class="comment-loading" id="cn<%id%>">\ | ||
| 696 | loading comments... <img src="<%loadingImage%>" alt="" /></div>\ | ||
| 697 | <ul id="cl<%id%>" class="comment-ul"></ul>\ | ||
| 698 | <div id="ca<%id%>">\ | ||
| 699 | <p class="add-a-comment">Add a comment\ | ||
| 700 | (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\ | ||
| 701 | <div class="comment-markup-box" id="mb<%id%>">\ | ||
| 702 | reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \ | ||
| 703 | <code>``code``</code>, \ | ||
| 704 | code blocks: <code>::</code> and an indented block after blank line</div>\ | ||
| 705 | <form method="post" id="cf<%id%>" class="comment-form" action="">\ | ||
| 706 | <textarea name="comment" cols="80"></textarea>\ | ||
| 707 | <p class="propose-button">\ | ||
| 708 | <a href="#" id="pc<%id%>" class="show-propose-change">\ | ||
| 709 | Propose a change ▹\ | ||
| 710 | </a>\ | ||
| 711 | <a href="#" id="hc<%id%>" class="hide-propose-change">\ | ||
| 712 | Propose a change ▿\ | ||
| 713 | </a>\ | ||
| 714 | </p>\ | ||
| 715 | <textarea name="proposal" id="pt<%id%>" cols="80"\ | ||
| 716 | spellcheck="false"></textarea>\ | ||
| 717 | <input type="submit" value="Add comment" />\ | ||
| 718 | <input type="hidden" name="node" value="<%id%>" />\ | ||
| 719 | <input type="hidden" name="parent" value="" />\ | ||
| 720 | </form>\ | ||
| 721 | </div>\ | ||
| 722 | </div>'; | ||
| 723 | |||
| 724 | var commentTemplate = '\ | ||
| 725 | <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\ | ||
| 726 | <div class="vote">\ | ||
| 727 | <div class="arrow">\ | ||
| 728 | <a href="#" id="uv<%id%>" class="vote" title="vote up">\ | ||
| 729 | <img src="<%upArrow%>" />\ | ||
| 730 | </a>\ | ||
| 731 | <a href="#" id="uu<%id%>" class="un vote" title="vote up">\ | ||
| 732 | <img src="<%upArrowPressed%>" />\ | ||
| 733 | </a>\ | ||
| 734 | </div>\ | ||
| 735 | <div class="arrow">\ | ||
| 736 | <a href="#" id="dv<%id%>" class="vote" title="vote down">\ | ||
| 737 | <img src="<%downArrow%>" id="da<%id%>" />\ | ||
| 738 | </a>\ | ||
| 739 | <a href="#" id="du<%id%>" class="un vote" title="vote down">\ | ||
| 740 | <img src="<%downArrowPressed%>" />\ | ||
| 741 | </a>\ | ||
| 742 | </div>\ | ||
| 743 | </div>\ | ||
| 744 | <div class="comment-content">\ | ||
| 745 | <p class="tagline comment">\ | ||
| 746 | <span class="user-id"><%username%></span>\ | ||
| 747 | <span class="rating"><%pretty_rating%></span>\ | ||
| 748 | <span class="delta"><%time.delta%></span>\ | ||
| 749 | </p>\ | ||
| 750 | <div class="comment-text comment"><#text#></div>\ | ||
| 751 | <p class="comment-opts comment">\ | ||
| 752 | <a href="#" class="reply hidden" id="rl<%id%>">reply ▹</a>\ | ||
| 753 | <a href="#" class="close-reply" id="cr<%id%>">reply ▿</a>\ | ||
| 754 | <a href="#" id="sp<%id%>" class="show-proposal">proposal ▹</a>\ | ||
| 755 | <a href="#" id="hp<%id%>" class="hide-proposal">proposal ▿</a>\ | ||
| 756 | <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\ | ||
| 757 | <span id="cm<%id%>" class="moderation hidden">\ | ||
| 758 | <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\ | ||
| 759 | </span>\ | ||
| 760 | </p>\ | ||
| 761 | <pre class="proposal" id="pr<%id%>">\ | ||
| 762 | <#proposal_diff#>\ | ||
| 763 | </pre>\ | ||
| 764 | <ul class="comment-children" id="cl<%id%>"></ul>\ | ||
| 765 | </div>\ | ||
| 766 | <div class="clearleft"></div>\ | ||
| 767 | </div>\ | ||
| 768 | </div>'; | ||
| 769 | |||
| 770 | var replyTemplate = '\ | ||
| 771 | <li>\ | ||
| 772 | <div class="reply-div" id="rd<%id%>">\ | ||
| 773 | <form id="rf<%id%>">\ | ||
| 774 | <textarea name="comment" cols="80"></textarea>\ | ||
| 775 | <input type="submit" value="Add reply" />\ | ||
| 776 | <input type="button" value="Cancel" />\ | ||
| 777 | <input type="hidden" name="parent" value="<%id%>" />\ | ||
| 778 | <input type="hidden" name="node" value="" />\ | ||
| 779 | </form>\ | ||
| 780 | </div>\ | ||
| 781 | </li>'; | ||
| 782 | |||
| 783 | $(document).ready(function() { | ||
| 784 | init(); | ||
| 785 | }); | ||
| 786 | })(jQuery); | ||
| 787 | |||
| 788 | $(document).ready(function() { | ||
| 789 | // add comment anchors for all paragraphs that are commentable | ||
| 790 | $('.sphinx-has-comment').comment(); | ||
| 791 | |||
| 792 | // highlight search words in search results | ||
| 793 | $("div.context").each(function() { | ||
| 794 | var params = $.getQueryParameters(); | ||
| 795 | var terms = (params.q) ? params.q[0].split(/\s+/) : []; | ||
| 796 | var result = $(this); | ||
| 797 | $.each(terms, function() { | ||
| 798 | result.highlightText(this.toLowerCase(), 'highlighted'); | ||
| 799 | }); | ||
| 800 | }); | ||
| 801 | |||
| 802 | // directly open comment window if requested | ||
| 803 | var anchor = document.location.hash; | ||
| 804 | if (anchor.substring(0, 9) == '#comment-') { | ||
| 805 | $('#ao' + anchor.substring(9)).click(); | ||
| 806 | document.location.hash = '#s' + anchor.substring(9); | ||
| 807 | } | ||
| 808 | }); | ||
diff --git a/genindex.html b/genindex.html new file mode 100644 index 0000000..cfe5043 --- /dev/null +++ b/genindex.html | |||
| @@ -0,0 +1,205 @@ | |||
| 1 | |||
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 4 | |||
| 5 | |||
| 6 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 7 | <head> | ||
| 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 9 | |||
| 10 | <title>Index — EventMQ 0 documentation</title> | ||
| 11 | |||
| 12 | <link rel="stylesheet" href="_static/classic.css" type="text/css" /> | ||
| 13 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> | ||
| 14 | |||
| 15 | <script type="text/javascript"> | ||
| 16 | var DOCUMENTATION_OPTIONS = { | ||
| 17 | URL_ROOT: './', | ||
| 18 | VERSION: '0', | ||
| 19 | COLLAPSE_INDEX: false, | ||
| 20 | FILE_SUFFIX: '.html', | ||
| 21 | HAS_SOURCE: true | ||
| 22 | }; | ||
| 23 | </script> | ||
| 24 | <script type="text/javascript" src="_static/jquery.js"></script> | ||
| 25 | <script type="text/javascript" src="_static/underscore.js"></script> | ||
| 26 | <script type="text/javascript" src="_static/doctools.js"></script> | ||
| 27 | <link rel="top" title="EventMQ 0 documentation" href="index.html" /> | ||
| 28 | </head> | ||
| 29 | <body role="document"> | ||
| 30 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 31 | <h3>Navigation</h3> | ||
| 32 | <ul> | ||
| 33 | <li class="right" style="margin-right: 10px"> | ||
| 34 | <a href="#" title="General Index" | ||
| 35 | accesskey="I">index</a></li> | ||
| 36 | <li class="right" > | ||
| 37 | <a href="py-modindex.html" title="Python Module Index" | ||
| 38 | >modules</a> |</li> | ||
| 39 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 40 | </ul> | ||
| 41 | </div> | ||
| 42 | |||
| 43 | <div class="document"> | ||
| 44 | <div class="documentwrapper"> | ||
| 45 | <div class="bodywrapper"> | ||
| 46 | <div class="body" role="main"> | ||
| 47 | |||
| 48 | |||
| 49 | <h1 id="index">Index</h1> | ||
| 50 | |||
| 51 | <div class="genindex-jumpbox"> | ||
| 52 | <a href="#_"><strong>_</strong></a> | ||
| 53 | | <a href="#C"><strong>C</strong></a> | ||
| 54 | | <a href="#L"><strong>L</strong></a> | ||
| 55 | | <a href="#N"><strong>N</strong></a> | ||
| 56 | | <a href="#R"><strong>R</strong></a> | ||
| 57 | | <a href="#S"><strong>S</strong></a> | ||
| 58 | | <a href="#Z"><strong>Z</strong></a> | ||
| 59 | |||
| 60 | </div> | ||
| 61 | <h2 id="_">_</h2> | ||
| 62 | <table style="width: 100%" class="indextable genindextable"><tr> | ||
| 63 | <td style="width: 33%" valign="top"><dl> | ||
| 64 | |||
| 65 | <dt><a href="receiver.html#receiver.Receiver.__init__">__init__() (receiver.Receiver method)</a> | ||
| 66 | </dt> | ||
| 67 | |||
| 68 | </dl></td> | ||
| 69 | <td style="width: 33%" valign="top"><dl> | ||
| 70 | |||
| 71 | <dt><a href="receiver.html#receiver.Receiver.__weakref__">__weakref__ (receiver.Receiver attribute)</a> | ||
| 72 | </dt> | ||
| 73 | |||
| 74 | </dl></td> | ||
| 75 | </tr></table> | ||
| 76 | |||
| 77 | <h2 id="C">C</h2> | ||
| 78 | <table style="width: 100%" class="indextable genindextable"><tr> | ||
| 79 | <td style="width: 33%" valign="top"><dl> | ||
| 80 | |||
| 81 | <dt><a href="receiver.html#receiver.Receiver.connect">connect() (receiver.Receiver method)</a> | ||
| 82 | </dt> | ||
| 83 | |||
| 84 | </dl></td> | ||
| 85 | </tr></table> | ||
| 86 | |||
| 87 | <h2 id="L">L</h2> | ||
| 88 | <table style="width: 100%" class="indextable genindextable"><tr> | ||
| 89 | <td style="width: 33%" valign="top"><dl> | ||
| 90 | |||
| 91 | <dt><a href="receiver.html#receiver.Receiver.listen">listen() (receiver.Receiver method)</a> | ||
| 92 | </dt> | ||
| 93 | |||
| 94 | </dl></td> | ||
| 95 | </tr></table> | ||
| 96 | |||
| 97 | <h2 id="N">N</h2> | ||
| 98 | <table style="width: 100%" class="indextable genindextable"><tr> | ||
| 99 | <td style="width: 33%" valign="top"><dl> | ||
| 100 | |||
| 101 | <dt><a href="receiver.html#receiver.Receiver.name">name (receiver.Receiver attribute)</a> | ||
| 102 | </dt> | ||
| 103 | |||
| 104 | </dl></td> | ||
| 105 | </tr></table> | ||
| 106 | |||
| 107 | <h2 id="R">R</h2> | ||
| 108 | <table style="width: 100%" class="indextable genindextable"><tr> | ||
| 109 | <td style="width: 33%" valign="top"><dl> | ||
| 110 | |||
| 111 | <dt><a href="receiver.html#receiver.Receiver.ready">ready (receiver.Receiver attribute)</a> | ||
| 112 | </dt> | ||
| 113 | |||
| 114 | |||
| 115 | <dt><a href="receiver.html#receiver.Receiver">Receiver (class in receiver)</a> | ||
| 116 | </dt> | ||
| 117 | |||
| 118 | |||
| 119 | <dt><a href="receiver.html#module-receiver">receiver (module)</a> | ||
| 120 | </dt> | ||
| 121 | |||
| 122 | </dl></td> | ||
| 123 | <td style="width: 33%" valign="top"><dl> | ||
| 124 | |||
| 125 | <dt><a href="router.html#router.Router">Router (class in router)</a> | ||
| 126 | </dt> | ||
| 127 | |||
| 128 | |||
| 129 | <dt><a href="router.html#module-router">router (module)</a> | ||
| 130 | </dt> | ||
| 131 | |||
| 132 | </dl></td> | ||
| 133 | </tr></table> | ||
| 134 | |||
| 135 | <h2 id="S">S</h2> | ||
| 136 | <table style="width: 100%" class="indextable genindextable"><tr> | ||
| 137 | <td style="width: 33%" valign="top"><dl> | ||
| 138 | |||
| 139 | <dt><a href="router.html#router.Router.start">start() (router.Router method)</a> | ||
| 140 | </dt> | ||
| 141 | |||
| 142 | </dl></td> | ||
| 143 | </tr></table> | ||
| 144 | |||
| 145 | <h2 id="Z">Z</h2> | ||
| 146 | <table style="width: 100%" class="indextable genindextable"><tr> | ||
| 147 | <td style="width: 33%" valign="top"><dl> | ||
| 148 | |||
| 149 | <dt><a href="receiver.html#receiver.Receiver.zcontext">zcontext (receiver.Receiver attribute)</a> | ||
| 150 | </dt> | ||
| 151 | |||
| 152 | </dl></td> | ||
| 153 | <td style="width: 33%" valign="top"><dl> | ||
| 154 | |||
| 155 | <dt><a href="receiver.html#receiver.Receiver.zsocket">zsocket (receiver.Receiver attribute)</a> | ||
| 156 | </dt> | ||
| 157 | |||
| 158 | </dl></td> | ||
| 159 | </tr></table> | ||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | </div> | ||
| 164 | </div> | ||
| 165 | </div> | ||
| 166 | <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
| 167 | <div class="sphinxsidebarwrapper"> | ||
| 168 | |||
| 169 | |||
| 170 | |||
| 171 | <div id="searchbox" style="display: none" role="search"> | ||
| 172 | <h3>Quick search</h3> | ||
| 173 | <form class="search" action="search.html" method="get"> | ||
| 174 | <input type="text" name="q" /> | ||
| 175 | <input type="submit" value="Go" /> | ||
| 176 | <input type="hidden" name="check_keywords" value="yes" /> | ||
| 177 | <input type="hidden" name="area" value="default" /> | ||
| 178 | </form> | ||
| 179 | <p class="searchtip" style="font-size: 90%"> | ||
| 180 | Enter search terms or a module, class or function name. | ||
| 181 | </p> | ||
| 182 | </div> | ||
| 183 | <script type="text/javascript">$('#searchbox').show(0);</script> | ||
| 184 | </div> | ||
| 185 | </div> | ||
| 186 | <div class="clearer"></div> | ||
| 187 | </div> | ||
| 188 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 189 | <h3>Navigation</h3> | ||
| 190 | <ul> | ||
| 191 | <li class="right" style="margin-right: 10px"> | ||
| 192 | <a href="#" title="General Index" | ||
| 193 | >index</a></li> | ||
| 194 | <li class="right" > | ||
| 195 | <a href="py-modindex.html" title="Python Module Index" | ||
| 196 | >modules</a> |</li> | ||
| 197 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 198 | </ul> | ||
| 199 | </div> | ||
| 200 | <div class="footer" role="contentinfo"> | ||
| 201 | © Copyright 2015, eventboard.io. | ||
| 202 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1. | ||
| 203 | </div> | ||
| 204 | </body> | ||
| 205 | </html> \ No newline at end of file | ||
diff --git a/index.html b/index.html new file mode 100644 index 0000000..a836ba1 --- /dev/null +++ b/index.html | |||
| @@ -0,0 +1,129 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | |||
| 4 | |||
| 5 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 6 | <head> | ||
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 8 | |||
| 9 | <title>Welcome to EventMQ’s documentation! — EventMQ 0 documentation</title> | ||
| 10 | |||
| 11 | <link rel="stylesheet" href="_static/classic.css" type="text/css" /> | ||
| 12 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> | ||
| 13 | |||
| 14 | <script type="text/javascript"> | ||
| 15 | var DOCUMENTATION_OPTIONS = { | ||
| 16 | URL_ROOT: './', | ||
| 17 | VERSION: '0', | ||
| 18 | COLLAPSE_INDEX: false, | ||
| 19 | FILE_SUFFIX: '.html', | ||
| 20 | HAS_SOURCE: true | ||
| 21 | }; | ||
| 22 | </script> | ||
| 23 | <script type="text/javascript" src="_static/jquery.js"></script> | ||
| 24 | <script type="text/javascript" src="_static/underscore.js"></script> | ||
| 25 | <script type="text/javascript" src="_static/doctools.js"></script> | ||
| 26 | <link rel="top" title="EventMQ 0 documentation" href="#" /> | ||
| 27 | <link rel="next" title="receiver – Receiver" href="receiver.html" /> | ||
| 28 | </head> | ||
| 29 | <body role="document"> | ||
| 30 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 31 | <h3>Navigation</h3> | ||
| 32 | <ul> | ||
| 33 | <li class="right" style="margin-right: 10px"> | ||
| 34 | <a href="genindex.html" title="General Index" | ||
| 35 | accesskey="I">index</a></li> | ||
| 36 | <li class="right" > | ||
| 37 | <a href="py-modindex.html" title="Python Module Index" | ||
| 38 | >modules</a> |</li> | ||
| 39 | <li class="right" > | ||
| 40 | <a href="receiver.html" title="receiver – Receiver" | ||
| 41 | accesskey="N">next</a> |</li> | ||
| 42 | <li class="nav-item nav-item-0"><a href="#">EventMQ 0 documentation</a> »</li> | ||
| 43 | </ul> | ||
| 44 | </div> | ||
| 45 | |||
| 46 | <div class="document"> | ||
| 47 | <div class="documentwrapper"> | ||
| 48 | <div class="bodywrapper"> | ||
| 49 | <div class="body" role="main"> | ||
| 50 | |||
| 51 | <div class="section" id="welcome-to-eventmq-s-documentation"> | ||
| 52 | <h1>Welcome to EventMQ’s documentation!<a class="headerlink" href="#welcome-to-eventmq-s-documentation" title="Permalink to this headline">¶</a></h1> | ||
| 53 | <p>Contents:</p> | ||
| 54 | <div class="toctree-wrapper compound"> | ||
| 55 | <ul> | ||
| 56 | <li class="toctree-l1"><a class="reference internal" href="receiver.html"><code class="docutils literal"><span class="pre">receiver</span></code> – Receiver</a></li> | ||
| 57 | <li class="toctree-l1"><a class="reference internal" href="router.html"><code class="docutils literal"><span class="pre">router</span></code> – Router</a></li> | ||
| 58 | </ul> | ||
| 59 | </div> | ||
| 60 | </div> | ||
| 61 | <div class="section" id="indices-and-tables"> | ||
| 62 | <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1> | ||
| 63 | <ul class="simple"> | ||
| 64 | <li><a class="reference internal" href="genindex.html"><span>Index</span></a></li> | ||
| 65 | <li><a class="reference internal" href="py-modindex.html"><span>Module Index</span></a></li> | ||
| 66 | <li><a class="reference internal" href="search.html"><span>Search Page</span></a></li> | ||
| 67 | </ul> | ||
| 68 | </div> | ||
| 69 | |||
| 70 | |||
| 71 | </div> | ||
| 72 | </div> | ||
| 73 | </div> | ||
| 74 | <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
| 75 | <div class="sphinxsidebarwrapper"> | ||
| 76 | <h3><a href="#">Table Of Contents</a></h3> | ||
| 77 | <ul> | ||
| 78 | <li><a class="reference internal" href="#">Welcome to EventMQ’s documentation!</a></li> | ||
| 79 | <li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li> | ||
| 80 | </ul> | ||
| 81 | |||
| 82 | <h4>Next topic</h4> | ||
| 83 | <p class="topless"><a href="receiver.html" | ||
| 84 | title="next chapter"><code class="docutils literal"><span class="pre">receiver</span></code> – Receiver</a></p> | ||
| 85 | <div role="note" aria-label="source link"> | ||
| 86 | <h3>This Page</h3> | ||
| 87 | <ul class="this-page-menu"> | ||
| 88 | <li><a href="_sources/index.txt" | ||
| 89 | rel="nofollow">Show Source</a></li> | ||
| 90 | </ul> | ||
| 91 | </div> | ||
| 92 | <div id="searchbox" style="display: none" role="search"> | ||
| 93 | <h3>Quick search</h3> | ||
| 94 | <form class="search" action="search.html" method="get"> | ||
| 95 | <input type="text" name="q" /> | ||
| 96 | <input type="submit" value="Go" /> | ||
| 97 | <input type="hidden" name="check_keywords" value="yes" /> | ||
| 98 | <input type="hidden" name="area" value="default" /> | ||
| 99 | </form> | ||
| 100 | <p class="searchtip" style="font-size: 90%"> | ||
| 101 | Enter search terms or a module, class or function name. | ||
| 102 | </p> | ||
| 103 | </div> | ||
| 104 | <script type="text/javascript">$('#searchbox').show(0);</script> | ||
| 105 | </div> | ||
| 106 | </div> | ||
| 107 | <div class="clearer"></div> | ||
| 108 | </div> | ||
| 109 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 110 | <h3>Navigation</h3> | ||
| 111 | <ul> | ||
| 112 | <li class="right" style="margin-right: 10px"> | ||
| 113 | <a href="genindex.html" title="General Index" | ||
| 114 | >index</a></li> | ||
| 115 | <li class="right" > | ||
| 116 | <a href="py-modindex.html" title="Python Module Index" | ||
| 117 | >modules</a> |</li> | ||
| 118 | <li class="right" > | ||
| 119 | <a href="receiver.html" title="receiver – Receiver" | ||
| 120 | >next</a> |</li> | ||
| 121 | <li class="nav-item nav-item-0"><a href="#">EventMQ 0 documentation</a> »</li> | ||
| 122 | </ul> | ||
| 123 | </div> | ||
| 124 | <div class="footer" role="contentinfo"> | ||
| 125 | © Copyright 2015, eventboard.io. | ||
| 126 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1. | ||
| 127 | </div> | ||
| 128 | </body> | ||
| 129 | </html> \ No newline at end of file | ||
diff --git a/objects.inv b/objects.inv new file mode 100644 index 0000000..822941c --- /dev/null +++ b/objects.inv | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | # Sphinx inventory version 2 | ||
| 2 | # Project: EventMQ | ||
| 3 | # Version: 0 | ||
| 4 | # The remainder of this file is compressed using zlib. | ||
| 5 | xڝM0Fn!.L'4ִEkyoM'V&=H"ӴLuN@OSSgZ | ||
| 6 | /o%f5rL<$j,cq2ICۖ& 'f=\85X3c.XY*1cG@ƍG#t6$Fhv40u'$ \ No newline at end of file | ||
diff --git a/py-modindex.html b/py-modindex.html new file mode 100644 index 0000000..ee308bd --- /dev/null +++ b/py-modindex.html | |||
| @@ -0,0 +1,117 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | |||
| 4 | |||
| 5 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 6 | <head> | ||
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 8 | |||
| 9 | <title>Python Module Index — EventMQ 0 documentation</title> | ||
| 10 | |||
| 11 | <link rel="stylesheet" href="_static/classic.css" type="text/css" /> | ||
| 12 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> | ||
| 13 | |||
| 14 | <script type="text/javascript"> | ||
| 15 | var DOCUMENTATION_OPTIONS = { | ||
| 16 | URL_ROOT: './', | ||
| 17 | VERSION: '0', | ||
| 18 | COLLAPSE_INDEX: false, | ||
| 19 | FILE_SUFFIX: '.html', | ||
| 20 | HAS_SOURCE: true | ||
| 21 | }; | ||
| 22 | </script> | ||
| 23 | <script type="text/javascript" src="_static/jquery.js"></script> | ||
| 24 | <script type="text/javascript" src="_static/underscore.js"></script> | ||
| 25 | <script type="text/javascript" src="_static/doctools.js"></script> | ||
| 26 | <link rel="top" title="EventMQ 0 documentation" href="index.html" /> | ||
| 27 | |||
| 28 | |||
| 29 | <script type="text/javascript"> | ||
| 30 | DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true; | ||
| 31 | </script> | ||
| 32 | |||
| 33 | |||
| 34 | </head> | ||
| 35 | <body role="document"> | ||
| 36 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 37 | <h3>Navigation</h3> | ||
| 38 | <ul> | ||
| 39 | <li class="right" style="margin-right: 10px"> | ||
| 40 | <a href="genindex.html" title="General Index" | ||
| 41 | accesskey="I">index</a></li> | ||
| 42 | <li class="right" > | ||
| 43 | <a href="#" title="Python Module Index" | ||
| 44 | >modules</a> |</li> | ||
| 45 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 46 | </ul> | ||
| 47 | </div> | ||
| 48 | |||
| 49 | <div class="document"> | ||
| 50 | <div class="documentwrapper"> | ||
| 51 | <div class="bodywrapper"> | ||
| 52 | <div class="body" role="main"> | ||
| 53 | |||
| 54 | |||
| 55 | <h1>Python Module Index</h1> | ||
| 56 | |||
| 57 | <div class="modindex-jumpbox"> | ||
| 58 | <a href="#cap-r"><strong>r</strong></a> | ||
| 59 | </div> | ||
| 60 | |||
| 61 | <table class="indextable modindextable" cellspacing="0" cellpadding="2"> | ||
| 62 | <tr class="pcap"><td></td><td> </td><td></td></tr> | ||
| 63 | <tr class="cap" id="cap-r"><td></td><td> | ||
| 64 | <strong>r</strong></td><td></td></tr> | ||
| 65 | <tr> | ||
| 66 | <td></td> | ||
| 67 | <td> | ||
| 68 | <a href="receiver.html#module-receiver"><code class="xref">receiver</code></a></td><td> | ||
| 69 | <em></em></td></tr> | ||
| 70 | <tr> | ||
| 71 | <td></td> | ||
| 72 | <td> | ||
| 73 | <a href="router.html#module-router"><code class="xref">router</code></a></td><td> | ||
| 74 | <em></em></td></tr> | ||
| 75 | </table> | ||
| 76 | |||
| 77 | |||
| 78 | </div> | ||
| 79 | </div> | ||
| 80 | </div> | ||
| 81 | <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
| 82 | <div class="sphinxsidebarwrapper"> | ||
| 83 | <div id="searchbox" style="display: none" role="search"> | ||
| 84 | <h3>Quick search</h3> | ||
| 85 | <form class="search" action="search.html" method="get"> | ||
| 86 | <input type="text" name="q" /> | ||
| 87 | <input type="submit" value="Go" /> | ||
| 88 | <input type="hidden" name="check_keywords" value="yes" /> | ||
| 89 | <input type="hidden" name="area" value="default" /> | ||
| 90 | </form> | ||
| 91 | <p class="searchtip" style="font-size: 90%"> | ||
| 92 | Enter search terms or a module, class or function name. | ||
| 93 | </p> | ||
| 94 | </div> | ||
| 95 | <script type="text/javascript">$('#searchbox').show(0);</script> | ||
| 96 | </div> | ||
| 97 | </div> | ||
| 98 | <div class="clearer"></div> | ||
| 99 | </div> | ||
| 100 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 101 | <h3>Navigation</h3> | ||
| 102 | <ul> | ||
| 103 | <li class="right" style="margin-right: 10px"> | ||
| 104 | <a href="genindex.html" title="General Index" | ||
| 105 | >index</a></li> | ||
| 106 | <li class="right" > | ||
| 107 | <a href="#" title="Python Module Index" | ||
| 108 | >modules</a> |</li> | ||
| 109 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 110 | </ul> | ||
| 111 | </div> | ||
| 112 | <div class="footer" role="contentinfo"> | ||
| 113 | © Copyright 2015, eventboard.io. | ||
| 114 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1. | ||
| 115 | </div> | ||
| 116 | </body> | ||
| 117 | </html> \ No newline at end of file | ||
diff --git a/receiver.html b/receiver.html new file mode 100644 index 0000000..d81d16d --- /dev/null +++ b/receiver.html | |||
| @@ -0,0 +1,236 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | |||
| 4 | |||
| 5 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 6 | <head> | ||
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 8 | |||
| 9 | <title>receiver – Receiver — EventMQ 0 documentation</title> | ||
| 10 | |||
| 11 | <link rel="stylesheet" href="_static/classic.css" type="text/css" /> | ||
| 12 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> | ||
| 13 | |||
| 14 | <script type="text/javascript"> | ||
| 15 | var DOCUMENTATION_OPTIONS = { | ||
| 16 | URL_ROOT: './', | ||
| 17 | VERSION: '0', | ||
| 18 | COLLAPSE_INDEX: false, | ||
| 19 | FILE_SUFFIX: '.html', | ||
| 20 | HAS_SOURCE: true | ||
| 21 | }; | ||
| 22 | </script> | ||
| 23 | <script type="text/javascript" src="_static/jquery.js"></script> | ||
| 24 | <script type="text/javascript" src="_static/underscore.js"></script> | ||
| 25 | <script type="text/javascript" src="_static/doctools.js"></script> | ||
| 26 | <link rel="top" title="EventMQ 0 documentation" href="index.html" /> | ||
| 27 | <link rel="next" title="router – Router" href="router.html" /> | ||
| 28 | <link rel="prev" title="Welcome to EventMQ’s documentation!" href="index.html" /> | ||
| 29 | </head> | ||
| 30 | <body role="document"> | ||
| 31 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 32 | <h3>Navigation</h3> | ||
| 33 | <ul> | ||
| 34 | <li class="right" style="margin-right: 10px"> | ||
| 35 | <a href="genindex.html" title="General Index" | ||
| 36 | accesskey="I">index</a></li> | ||
| 37 | <li class="right" > | ||
| 38 | <a href="py-modindex.html" title="Python Module Index" | ||
| 39 | >modules</a> |</li> | ||
| 40 | <li class="right" > | ||
| 41 | <a href="router.html" title="router – Router" | ||
| 42 | accesskey="N">next</a> |</li> | ||
| 43 | <li class="right" > | ||
| 44 | <a href="index.html" title="Welcome to EventMQ’s documentation!" | ||
| 45 | accesskey="P">previous</a> |</li> | ||
| 46 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 47 | </ul> | ||
| 48 | </div> | ||
| 49 | |||
| 50 | <div class="document"> | ||
| 51 | <div class="documentwrapper"> | ||
| 52 | <div class="bodywrapper"> | ||
| 53 | <div class="body" role="main"> | ||
| 54 | |||
| 55 | <span class="target" id="module-receiver"></span><div class="section" id="receiver-receiver"> | ||
| 56 | <h1><a class="reference internal" href="#module-receiver" title="receiver"><code class="xref py py-mod docutils literal"><span class="pre">receiver</span></code></a> – Receiver<a class="headerlink" href="#receiver-receiver" title="Permalink to this headline">¶</a></h1> | ||
| 57 | <p>The receiver is responsible for receiveing messages</p> | ||
| 58 | <dl class="class"> | ||
| 59 | <dt id="receiver.Receiver"> | ||
| 60 | <em class="property">class </em><code class="descclassname">receiver.</code><code class="descname">Receiver</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#receiver.Receiver" title="Permalink to this definition">¶</a></dt> | ||
| 61 | <dd><p>Receives messages and pass them to a callable.</p> | ||
| 62 | <div class="admonition note"> | ||
| 63 | <p class="first admonition-title">Note</p> | ||
| 64 | <p class="last">Polling with this reciever is currently only available via an eventloop | ||
| 65 | (<code class="xref py py-mod docutils literal"><span class="pre">zmq.eventloop</span></code>).</p> | ||
| 66 | </div> | ||
| 67 | <dl class="attribute"> | ||
| 68 | <dt id="receiver.Receiver.name"> | ||
| 69 | <code class="descname">name</code><a class="headerlink" href="#receiver.Receiver.name" title="Permalink to this definition">¶</a></dt> | ||
| 70 | <dd><p><em>str</em> – Name of this socket</p> | ||
| 71 | </dd></dl> | ||
| 72 | |||
| 73 | <dl class="attribute"> | ||
| 74 | <dt id="receiver.Receiver.zcontext"> | ||
| 75 | <code class="descname">zcontext</code><a class="headerlink" href="#receiver.Receiver.zcontext" title="Permalink to this definition">¶</a></dt> | ||
| 76 | <dd><p><a class="reference external" href="http://pyzmq.readthedocs.org/en/v15.0.0/api/zmq.html#zmq.Context" title="(in PyZMQ v15.0.0)"><code class="xref py py-class docutils literal"><span class="pre">zmq.Context</span></code></a> – socket context</p> | ||
| 77 | </dd></dl> | ||
| 78 | |||
| 79 | <dl class="attribute"> | ||
| 80 | <dt id="receiver.Receiver.zsocket"> | ||
| 81 | <code class="descname">zsocket</code><a class="headerlink" href="#receiver.Receiver.zsocket" title="Permalink to this definition">¶</a></dt> | ||
| 82 | <dd><p><a class="reference external" href="http://pyzmq.readthedocs.org/en/v15.0.0/api/zmq.html#zmq.Socket" title="(in PyZMQ v15.0.0)"><code class="xref py py-class docutils literal"><span class="pre">zmq.Socket</span></code></a> – socket wrapped up in a | ||
| 83 | <code class="xref py py-class docutils literal"><span class="pre">zmqstream.ZMQStream</span></code></p> | ||
| 84 | </dd></dl> | ||
| 85 | |||
| 86 | <dl class="method"> | ||
| 87 | <dt id="receiver.Receiver.__init__"> | ||
| 88 | <code class="descname">__init__</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#receiver.Receiver.__init__" title="Permalink to this definition">¶</a></dt> | ||
| 89 | <dd><div class="admonition note"> | ||
| 90 | <p class="first admonition-title">Note</p> | ||
| 91 | <p class="last">All args are optional unless otherwise noted.</p> | ||
| 92 | </div> | ||
| 93 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 94 | <col class="field-name" /> | ||
| 95 | <col class="field-body" /> | ||
| 96 | <tbody valign="top"> | ||
| 97 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | ||
| 98 | <li><strong>callable</strong> – REQUIRED A function or method to call when a message is | ||
| 99 | received</li> | ||
| 100 | <li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – name of this socket. By default a uuid will be | ||
| 101 | generated</li> | ||
| 102 | <li><strong>context</strong> (<a class="reference external" href="http://pyzmq.readthedocs.org/en/v15.0.0/api/zmq.html#zmq.Context" title="(in PyZMQ v15.0.0)"><code class="xref py py-class docutils literal"><span class="pre">zmq.Context</span></code></a>) – Context to use when buliding the | ||
| 103 | socket</li> | ||
| 104 | <li><strong>socket</strong> (<a class="reference external" href="http://pyzmq.readthedocs.org/en/v15.0.0/api/zmq.html#zmq.Socket" title="(in PyZMQ v15.0.0)"><code class="xref py py-class docutils literal"><span class="pre">zmq.Socket</span></code></a>) – Should be one of <code class="xref py py-attr docutils literal"><span class="pre">zmq.REP</span></code> or | ||
| 105 | <code class="xref py py-attr docutils literal"><span class="pre">zmq.ROUTER</span></code>. By default a <cite>ROUTER</cite> is used</li> | ||
| 106 | <li><strong>skip_zmqstream</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) – If set to true, skip creating the zmqstream | ||
| 107 | socket. Callable is unused and optional when this is True</li> | ||
| 108 | </ul> | ||
| 109 | </td> | ||
| 110 | </tr> | ||
| 111 | <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">TypeError</span></code> – when <cite>callable</cite> is not callable</p> | ||
| 112 | </td> | ||
| 113 | </tr> | ||
| 114 | </tbody> | ||
| 115 | </table> | ||
| 116 | </dd></dl> | ||
| 117 | |||
| 118 | <dl class="attribute"> | ||
| 119 | <dt id="receiver.Receiver.__weakref__"> | ||
| 120 | <code class="descname">__weakref__</code><a class="headerlink" href="#receiver.Receiver.__weakref__" title="Permalink to this definition">¶</a></dt> | ||
| 121 | <dd><p>list of weak references to the object (if defined)</p> | ||
| 122 | </dd></dl> | ||
| 123 | |||
| 124 | <dl class="method"> | ||
| 125 | <dt id="receiver.Receiver.connect"> | ||
| 126 | <code class="descname">connect</code><span class="sig-paren">(</span><em>addr=None</em><span class="sig-paren">)</span><a class="headerlink" href="#receiver.Receiver.connect" title="Permalink to this definition">¶</a></dt> | ||
| 127 | <dd><p>Connect to address defined by <cite>addr</cite></p> | ||
| 128 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 129 | <col class="field-name" /> | ||
| 130 | <col class="field-body" /> | ||
| 131 | <tbody valign="top"> | ||
| 132 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>addr</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – Address to connect to as a connection string</td> | ||
| 133 | </tr> | ||
| 134 | <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-class docutils literal"><span class="pre">Exception</span></code></td> | ||
| 135 | </tr> | ||
| 136 | </tbody> | ||
| 137 | </table> | ||
| 138 | </dd></dl> | ||
| 139 | |||
| 140 | <dl class="method"> | ||
| 141 | <dt id="receiver.Receiver.listen"> | ||
| 142 | <code class="descname">listen</code><span class="sig-paren">(</span><em>addr=None</em><span class="sig-paren">)</span><a class="headerlink" href="#receiver.Receiver.listen" title="Permalink to this definition">¶</a></dt> | ||
| 143 | <dd><p>start listening on <cite>addr</cite></p> | ||
| 144 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 145 | <col class="field-name" /> | ||
| 146 | <col class="field-body" /> | ||
| 147 | <tbody valign="top"> | ||
| 148 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>addr</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – Address to listen on as a connction string</td> | ||
| 149 | </tr> | ||
| 150 | <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-class docutils literal"><span class="pre">Exception</span></code></td> | ||
| 151 | </tr> | ||
| 152 | </tbody> | ||
| 153 | </table> | ||
| 154 | </dd></dl> | ||
| 155 | |||
| 156 | <dl class="attribute"> | ||
| 157 | <dt id="receiver.Receiver.ready"> | ||
| 158 | <code class="descname">ready</code><a class="headerlink" href="#receiver.Receiver.ready" title="Permalink to this definition">¶</a></dt> | ||
| 159 | <dd><p>Property used to check if this receiver is ready.</p> | ||
| 160 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 161 | <col class="field-name" /> | ||
| 162 | <col class="field-body" /> | ||
| 163 | <tbody valign="top"> | ||
| 164 | <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if the receiver is ready to connect or listen, otherwise | ||
| 165 | False</td> | ||
| 166 | </tr> | ||
| 167 | <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/library/functions.html#bool" title="(in Python v2.7)">bool</a></td> | ||
| 168 | </tr> | ||
| 169 | </tbody> | ||
| 170 | </table> | ||
| 171 | </dd></dl> | ||
| 172 | |||
| 173 | </dd></dl> | ||
| 174 | |||
| 175 | </div> | ||
| 176 | |||
| 177 | |||
| 178 | </div> | ||
| 179 | </div> | ||
| 180 | </div> | ||
| 181 | <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
| 182 | <div class="sphinxsidebarwrapper"> | ||
| 183 | <h4>Previous topic</h4> | ||
| 184 | <p class="topless"><a href="index.html" | ||
| 185 | title="previous chapter">Welcome to EventMQ’s documentation!</a></p> | ||
| 186 | <h4>Next topic</h4> | ||
| 187 | <p class="topless"><a href="router.html" | ||
| 188 | title="next chapter"><code class="docutils literal"><span class="pre">router</span></code> – Router</a></p> | ||
| 189 | <div role="note" aria-label="source link"> | ||
| 190 | <h3>This Page</h3> | ||
| 191 | <ul class="this-page-menu"> | ||
| 192 | <li><a href="_sources/receiver.txt" | ||
| 193 | rel="nofollow">Show Source</a></li> | ||
| 194 | </ul> | ||
| 195 | </div> | ||
| 196 | <div id="searchbox" style="display: none" role="search"> | ||
| 197 | <h3>Quick search</h3> | ||
| 198 | <form class="search" action="search.html" method="get"> | ||
| 199 | <input type="text" name="q" /> | ||
| 200 | <input type="submit" value="Go" /> | ||
| 201 | <input type="hidden" name="check_keywords" value="yes" /> | ||
| 202 | <input type="hidden" name="area" value="default" /> | ||
| 203 | </form> | ||
| 204 | <p class="searchtip" style="font-size: 90%"> | ||
| 205 | Enter search terms or a module, class or function name. | ||
| 206 | </p> | ||
| 207 | </div> | ||
| 208 | <script type="text/javascript">$('#searchbox').show(0);</script> | ||
| 209 | </div> | ||
| 210 | </div> | ||
| 211 | <div class="clearer"></div> | ||
| 212 | </div> | ||
| 213 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 214 | <h3>Navigation</h3> | ||
| 215 | <ul> | ||
| 216 | <li class="right" style="margin-right: 10px"> | ||
| 217 | <a href="genindex.html" title="General Index" | ||
| 218 | >index</a></li> | ||
| 219 | <li class="right" > | ||
| 220 | <a href="py-modindex.html" title="Python Module Index" | ||
| 221 | >modules</a> |</li> | ||
| 222 | <li class="right" > | ||
| 223 | <a href="router.html" title="router – Router" | ||
| 224 | >next</a> |</li> | ||
| 225 | <li class="right" > | ||
| 226 | <a href="index.html" title="Welcome to EventMQ’s documentation!" | ||
| 227 | >previous</a> |</li> | ||
| 228 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 229 | </ul> | ||
| 230 | </div> | ||
| 231 | <div class="footer" role="contentinfo"> | ||
| 232 | © Copyright 2015, eventboard.io. | ||
| 233 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1. | ||
| 234 | </div> | ||
| 235 | </body> | ||
| 236 | </html> \ No newline at end of file | ||
diff --git a/router.html b/router.html new file mode 100644 index 0000000..f43d98e --- /dev/null +++ b/router.html | |||
| @@ -0,0 +1,133 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | |||
| 4 | |||
| 5 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 6 | <head> | ||
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 8 | |||
| 9 | <title>router – Router — EventMQ 0 documentation</title> | ||
| 10 | |||
| 11 | <link rel="stylesheet" href="_static/classic.css" type="text/css" /> | ||
| 12 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> | ||
| 13 | |||
| 14 | <script type="text/javascript"> | ||
| 15 | var DOCUMENTATION_OPTIONS = { | ||
| 16 | URL_ROOT: './', | ||
| 17 | VERSION: '0', | ||
| 18 | COLLAPSE_INDEX: false, | ||
| 19 | FILE_SUFFIX: '.html', | ||
| 20 | HAS_SOURCE: true | ||
| 21 | }; | ||
| 22 | </script> | ||
| 23 | <script type="text/javascript" src="_static/jquery.js"></script> | ||
| 24 | <script type="text/javascript" src="_static/underscore.js"></script> | ||
| 25 | <script type="text/javascript" src="_static/doctools.js"></script> | ||
| 26 | <link rel="top" title="EventMQ 0 documentation" href="index.html" /> | ||
| 27 | <link rel="prev" title="receiver – Receiver" href="receiver.html" /> | ||
| 28 | </head> | ||
| 29 | <body role="document"> | ||
| 30 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 31 | <h3>Navigation</h3> | ||
| 32 | <ul> | ||
| 33 | <li class="right" style="margin-right: 10px"> | ||
| 34 | <a href="genindex.html" title="General Index" | ||
| 35 | accesskey="I">index</a></li> | ||
| 36 | <li class="right" > | ||
| 37 | <a href="py-modindex.html" title="Python Module Index" | ||
| 38 | >modules</a> |</li> | ||
| 39 | <li class="right" > | ||
| 40 | <a href="receiver.html" title="receiver – Receiver" | ||
| 41 | accesskey="P">previous</a> |</li> | ||
| 42 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 43 | </ul> | ||
| 44 | </div> | ||
| 45 | |||
| 46 | <div class="document"> | ||
| 47 | <div class="documentwrapper"> | ||
| 48 | <div class="bodywrapper"> | ||
| 49 | <div class="body" role="main"> | ||
| 50 | |||
| 51 | <span class="target" id="module-router"></span><div class="section" id="router-router"> | ||
| 52 | <h1><a class="reference internal" href="#module-router" title="router"><code class="xref py py-mod docutils literal"><span class="pre">router</span></code></a> – Router<a class="headerlink" href="#router-router" title="Permalink to this headline">¶</a></h1> | ||
| 53 | <p>Routes messages to workers (that are in named queues).</p> | ||
| 54 | <dl class="class"> | ||
| 55 | <dt id="router.Router"> | ||
| 56 | <em class="property">class </em><code class="descclassname">router.</code><code class="descname">Router</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#router.Router" title="Permalink to this definition">¶</a></dt> | ||
| 57 | <dd><p>A simple router of messages</p> | ||
| 58 | <dl class="method"> | ||
| 59 | <dt id="router.Router.start"> | ||
| 60 | <code class="descname">start</code><span class="sig-paren">(</span><em>frontend_addr='tcp://127.0.0.1:47290'</em>, <em>backend_addr='tcp://127.0.0.1:47291'</em><span class="sig-paren">)</span><a class="headerlink" href="#router.Router.start" title="Permalink to this definition">¶</a></dt> | ||
| 61 | <dd><p>Begin listening for connections on the provided connection strings</p> | ||
| 62 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 63 | <col class="field-name" /> | ||
| 64 | <col class="field-body" /> | ||
| 65 | <tbody valign="top"> | ||
| 66 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> | ||
| 67 | <li><strong>frontend_addr</strong> – connection string to listen for requests</li> | ||
| 68 | <li><strong>backend_addr</strong> – connection string to listen for workers</li> | ||
| 69 | </ul> | ||
| 70 | </td> | ||
| 71 | </tr> | ||
| 72 | </tbody> | ||
| 73 | </table> | ||
| 74 | </dd></dl> | ||
| 75 | |||
| 76 | </dd></dl> | ||
| 77 | |||
| 78 | </div> | ||
| 79 | |||
| 80 | |||
| 81 | </div> | ||
| 82 | </div> | ||
| 83 | </div> | ||
| 84 | <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
| 85 | <div class="sphinxsidebarwrapper"> | ||
| 86 | <h4>Previous topic</h4> | ||
| 87 | <p class="topless"><a href="receiver.html" | ||
| 88 | title="previous chapter"><code class="docutils literal"><span class="pre">receiver</span></code> – Receiver</a></p> | ||
| 89 | <div role="note" aria-label="source link"> | ||
| 90 | <h3>This Page</h3> | ||
| 91 | <ul class="this-page-menu"> | ||
| 92 | <li><a href="_sources/router.txt" | ||
| 93 | rel="nofollow">Show Source</a></li> | ||
| 94 | </ul> | ||
| 95 | </div> | ||
| 96 | <div id="searchbox" style="display: none" role="search"> | ||
| 97 | <h3>Quick search</h3> | ||
| 98 | <form class="search" action="search.html" method="get"> | ||
| 99 | <input type="text" name="q" /> | ||
| 100 | <input type="submit" value="Go" /> | ||
| 101 | <input type="hidden" name="check_keywords" value="yes" /> | ||
| 102 | <input type="hidden" name="area" value="default" /> | ||
| 103 | </form> | ||
| 104 | <p class="searchtip" style="font-size: 90%"> | ||
| 105 | Enter search terms or a module, class or function name. | ||
| 106 | </p> | ||
| 107 | </div> | ||
| 108 | <script type="text/javascript">$('#searchbox').show(0);</script> | ||
| 109 | </div> | ||
| 110 | </div> | ||
| 111 | <div class="clearer"></div> | ||
| 112 | </div> | ||
| 113 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 114 | <h3>Navigation</h3> | ||
| 115 | <ul> | ||
| 116 | <li class="right" style="margin-right: 10px"> | ||
| 117 | <a href="genindex.html" title="General Index" | ||
| 118 | >index</a></li> | ||
| 119 | <li class="right" > | ||
| 120 | <a href="py-modindex.html" title="Python Module Index" | ||
| 121 | >modules</a> |</li> | ||
| 122 | <li class="right" > | ||
| 123 | <a href="receiver.html" title="receiver – Receiver" | ||
| 124 | >previous</a> |</li> | ||
| 125 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 126 | </ul> | ||
| 127 | </div> | ||
| 128 | <div class="footer" role="contentinfo"> | ||
| 129 | © Copyright 2015, eventboard.io. | ||
| 130 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1. | ||
| 131 | </div> | ||
| 132 | </body> | ||
| 133 | </html> \ No newline at end of file | ||
diff --git a/search.html b/search.html new file mode 100644 index 0000000..5bc4071 --- /dev/null +++ b/search.html | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | |||
| 4 | |||
| 5 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 6 | <head> | ||
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 8 | |||
| 9 | <title>Search — EventMQ 0 documentation</title> | ||
| 10 | |||
| 11 | <link rel="stylesheet" href="_static/classic.css" type="text/css" /> | ||
| 12 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> | ||
| 13 | |||
| 14 | <script type="text/javascript"> | ||
| 15 | var DOCUMENTATION_OPTIONS = { | ||
| 16 | URL_ROOT: './', | ||
| 17 | VERSION: '0', | ||
| 18 | COLLAPSE_INDEX: false, | ||
| 19 | FILE_SUFFIX: '.html', | ||
| 20 | HAS_SOURCE: true | ||
| 21 | }; | ||
| 22 | </script> | ||
| 23 | <script type="text/javascript" src="_static/jquery.js"></script> | ||
| 24 | <script type="text/javascript" src="_static/underscore.js"></script> | ||
| 25 | <script type="text/javascript" src="_static/doctools.js"></script> | ||
| 26 | <script type="text/javascript" src="_static/searchtools.js"></script> | ||
| 27 | <link rel="top" title="EventMQ 0 documentation" href="index.html" /> | ||
| 28 | <script type="text/javascript"> | ||
| 29 | jQuery(function() { Search.loadIndex("searchindex.js"); }); | ||
| 30 | </script> | ||
| 31 | |||
| 32 | <script type="text/javascript" id="searchindexloader"></script> | ||
| 33 | |||
| 34 | |||
| 35 | </head> | ||
| 36 | <body role="document"> | ||
| 37 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 38 | <h3>Navigation</h3> | ||
| 39 | <ul> | ||
| 40 | <li class="right" style="margin-right: 10px"> | ||
| 41 | <a href="genindex.html" title="General Index" | ||
| 42 | accesskey="I">index</a></li> | ||
| 43 | <li class="right" > | ||
| 44 | <a href="py-modindex.html" title="Python Module Index" | ||
| 45 | >modules</a> |</li> | ||
| 46 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 47 | </ul> | ||
| 48 | </div> | ||
| 49 | |||
| 50 | <div class="document"> | ||
| 51 | <div class="documentwrapper"> | ||
| 52 | <div class="bodywrapper"> | ||
| 53 | <div class="body" role="main"> | ||
| 54 | |||
| 55 | <h1 id="search-documentation">Search</h1> | ||
| 56 | <div id="fallback" class="admonition warning"> | ||
| 57 | <script type="text/javascript">$('#fallback').hide();</script> | ||
| 58 | <p> | ||
| 59 | Please activate JavaScript to enable the search | ||
| 60 | functionality. | ||
| 61 | </p> | ||
| 62 | </div> | ||
| 63 | <p> | ||
| 64 | From here you can search these documents. Enter your search | ||
| 65 | words into the box below and click "search". Note that the search | ||
| 66 | function will automatically search for all of the words. Pages | ||
| 67 | containing fewer words won't appear in the result list. | ||
| 68 | </p> | ||
| 69 | <form action="" method="get"> | ||
| 70 | <input type="text" name="q" value="" /> | ||
| 71 | <input type="submit" value="search" /> | ||
| 72 | <span id="search-progress" style="padding-left: 10px"></span> | ||
| 73 | </form> | ||
| 74 | |||
| 75 | <div id="search-results"> | ||
| 76 | |||
| 77 | </div> | ||
| 78 | |||
| 79 | </div> | ||
| 80 | </div> | ||
| 81 | </div> | ||
| 82 | <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
| 83 | <div class="sphinxsidebarwrapper"> | ||
| 84 | </div> | ||
| 85 | </div> | ||
| 86 | <div class="clearer"></div> | ||
| 87 | </div> | ||
| 88 | <div class="related" role="navigation" aria-label="related navigation"> | ||
| 89 | <h3>Navigation</h3> | ||
| 90 | <ul> | ||
| 91 | <li class="right" style="margin-right: 10px"> | ||
| 92 | <a href="genindex.html" title="General Index" | ||
| 93 | >index</a></li> | ||
| 94 | <li class="right" > | ||
| 95 | <a href="py-modindex.html" title="Python Module Index" | ||
| 96 | >modules</a> |</li> | ||
| 97 | <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> »</li> | ||
| 98 | </ul> | ||
| 99 | </div> | ||
| 100 | <div class="footer" role="contentinfo"> | ||
| 101 | © Copyright 2015, eventboard.io. | ||
| 102 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1. | ||
| 103 | </div> | ||
| 104 | </body> | ||
| 105 | </html> \ No newline at end of file | ||
diff --git a/searchindex.js b/searchindex.js new file mode 100644 index 0000000..31b4ab1 --- /dev/null +++ b/searchindex.js | |||
| @@ -0,0 +1 @@ | |||
| Search.setIndex({envversion:46,filenames:["index","receiver","router"],objects:{"":{receiver:[1,0,0,"-"],router:[2,0,0,"-"]},"receiver.Receiver":{"__init__":[1,3,1,""],"__weakref__":[1,2,1,""],connect:[1,3,1,""],listen:[1,3,1,""],name:[1,2,1,""],ready:[1,2,1,""],zcontext:[1,2,1,""],zsocket:[1,2,1,""]},"router.Router":{start:[2,3,1,""]},receiver:{Receiver:[1,1,1,""]},router:{Router:[2,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","attribute","Python attribute"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:attribute","3":"py:method"},terms:{"__init__":1,"__weakref__":1,"class":[1,2],"default":1,"function":1,"return":1,"true":1,addr:1,address:1,all:1,arg:[1,2],attr:[],attribut:[],avail:1,backend_addr:2,begin:2,bool:1,bulid:1,call:1,callabl:1,check:1,connction:1,connect:[1,2],content:0,context:1,creat:1,current:1,data:[],defin:1,eventloop:1,except:1,fals:1,frontend_addr:2,gener:1,index:0,kwarg:[1,2],list:1,listen:[1,2],messag:[1,2],method:1,modul:0,name:[1,2],none:1,note:1,object:1,onli:1,option:1,otherwis:1,page:0,paramet:[1,2],pass:1,poll:1,properti:1,provid:2,queue:2,rais:1,readi:1,receiv:[],reciev:1,refer:1,rep:1,request:2,requir:1,respons:1,rout:2,router:[],search:0,set:1,should:1,simpl:2,skip:1,skip_zmqstream:1,socket:1,start:[1,2],str:1,string:[1,2],tcp:2,them:1,thi:1,type:1,typeerror:1,unless:1,unus:1,uuid:1,via:1,weak:1,when:1,worker:2,wrap:1,zcontext:1,zmq:1,zmqstream:1,zsocket:1},titles:["Welcome to EventMQ’s documentation!","<code class=\"docutils literal\"><span class=\"pre\">receiver</span></code> – Receiver","<code class=\"docutils literal\"><span class=\"pre\">router</span></code> – Router"],titleterms:{document:0,eventmq:0,indic:0,receiv:1,router:2,tabl:0,welcom:0}}) \ No newline at end of file | |||