1;(function($) {var _proto = String.prototype; 2 3if (typeof _proto.regxMatch !== 'function') { 4 _proto.regxMatch = function regxMatch() { 5 var content = (arguments.length > 1) ? arguments[1] : arguments[0] || "", 6 regxStr = (typeof this === "string" || this instanceof String) ? this : ""; 7 return (content.match(new RegExp(regxStr, "g")) || []).map(function (x) { 8 return x.trim(); 9 }).join(' '); 10 } 11}/** 12 * å·²ç¶æ¹è®äºæ´å scrollPosStyler çå §æ ¸ï¼è«å¿è¦è 13 * ======================================================================== */ 14 15/** 16 * @license 17 * ======================================================================== 18 * ScrollPos-Styler v0.7.1 19 * https://github.com/acch/scrollpos-styler 20 * ======================================================================== 21 * Copyright 2015 Achim Christ 22 * Licensed under MIT (https://github.com/acch/scrollpos-styler/blob/master/LICENSE) 23 * ======================================================================== */ 24 25// JSHint directives 26/* exported ScrollPosStyler */ 27if (typeof window.ScrollOverSelfStyler === "undefined") { 28 var ScrollOverSelfStyler = (function (document, window, $) { 29 "use strict"; 30 31 /* ==================== 32 * private variables 33 * ==================== */ 34 var scrollPosY = 0, 35 busy = false, 36 37 // toggle style / class when scrolling below this position (in px) 38 scrollOffsetY = 1, 39 40 // class used to apply scrollPosStyler to 41 spsClass = "soss", 42 43 // choose elements to apply style / class to 44 elements = document.getElementsByClassName(spsClass), 45 46 // style / class to apply to elements when above scroll position 47 classAbove = "soss--abv", 48 49 // style / class to apply to elements when below scroll position 50 classBelow = "soss--blw", 51 52 // tag to set custom scroll offset per element 53 offsetTag = "data-soss-offset"; 54 55 56 var BlockSel = '.block-item', 57 ShadowKey = "ScrollOverSelfStyler"; 58 59 /* ==================== 60 * private function to check scroll position 61 * ==================== */ 62 function onScroll() { 63 64 // ensure that events don't stack 65 if (!busy) { 66 67 // find elements to update 68 var elementsToUpdate = getElementsToUpdate(false); 69 if (elementsToUpdate.length > 0) { 70 71 // suspend accepting scroll events 72 busy = true; 73 74 // asynchronuously update elements 75 window.requestAnimationFrame(function () { 76 updateElements(elementsToUpdate); 77 }); 78 } 79 } 80 } 81 82 /* ==================== 83 * copy Element Shadow 84 * ==================== */ 85 function copyElementShadow(init) { 86 for (var i = 0; elements[i]; ++i) { 87 var element = elements[i]; 88 if (!$(element).data(ShadowKey)) { 89 $(element).data(ShadowKey, $('<div>').insertBefore(element)); 90 } 91 } 92 } 93 94 /* ==================== 95 * private function to find elements to update 96 * ==================== */ 97 function getElementsToUpdate(init) { 98 var elementsToUpdate = []; 99 copyElementShadow(init); 100 101 // get current scroll position from window 102 scrollPosY = window.pageYOffset; 103 104 // iterate over elements 105 // for (var elem of elements) { 106 for (var i = 0; elements[i]; ++i) { // chrome workaround 107 var element = elements[i], 108 $shadow = $(element).data(ShadowKey); 109 110 // get offset from element, default to global option 111 var offsetTop = parseInt(element.getAttribute(offsetTag), 10); 112 var elScrollOffsetY = isNaN(offsetTop) ? scrollOffsetY : offsetTop, 113 shScrollOffsetY = $shadow.offset().top; 114 115 // check current state of element 116 var elOnTop = element.classList.contains(classAbove); 117 118 // check current is visible 119 var elVisible = $(element).closest(BlockSel).is(':visible'); 120 121 // cols regx 122 var regxMatchCol = "col-([lg-|md-]*)([0-9]+\\s|[0-9]+$)".regxMatch($(element).closest(BlockSel).attr('class')); 123 124 // if we were above, and are now below scroll position...
125 if (elVisible && (init || elOnTop) && scrollPosY > (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 126 127 element.style.top = offsetTop + "px"; 128 $shadow.css('height', $(element).css('height')); 129 130 // remember element 131 elementsToUpdate.push({ 132 element: element, 133 addClass: classBelow + " " + regxMatchCol, 134 removeClass: classAbove 135 }); 136 137 // if we were below, and are now above scroll position... 138 } else if (!elVisible || (init || !elOnTop) && scrollPosY <= (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 139 140 141 // remember element 142 elementsToUpdate.push({ 143 element: element, 144 addClass: classAbove, 145 removeClass: classBelow + " " + regxMatchCol 146 }); 147 148 $shadow.get(0).style.height = null; 149 element.style.top = null; 150 } 151 } 152 153 return elementsToUpdate; 154 } 155 156 /* ==================== 157 * private function to update elements 158 * ==================== */ 159 function updateElements(elementsToUpdate) { 160 161 // iterate over elements 162 // for (var elem of elements) { 163 for (var i = 0; elementsToUpdate[i]; ++i) { // chrome workaround 164 var map = elementsToUpdate[i]; 165 166 // add style / class to element 167 //map.element.classList.add(map.addClass); 168 //map.element.classList.remove(map.removeClass); 169 $(map.element).addClass(map.addClass); 170 $(map.element).removeClass(map.removeClass); 171 } 172 173 // resume accepting scroll events 174 busy = false; 175 } 176 177 /* ==================== 178 * public function to initially style elements based on scroll position 179 * 180 * options: 181 * scrollOffsetY (number): default scroll position in px to trigger the style. Default is 1. 182 * spsClass (string): classname used to determine which elements to style. Default is 'sps'. 183 * classAbove (string): classname added to the elements when the window is scrolled above the defined position. Default is 'sps--abv'. 184 * classBelow (string): classname added to the elements when the window is scrolled below the defined position. Default is 'sps--blw'. 185 * offsetTag (string): HTML tag used on the element to specify a scrollOffsetY other than the default. 186 * 187 * ==================== */ 188 var pub = { 189 init: function (options) { 190 191 // suspend accepting scroll events 192 busy = true; 193 194 // merge options object with global options 195 if (options) { 196 if (options.spsClass) { 197 spsClass = options.spsClass; 198 elements = document.getElementsByClassName(spsClass); 199 } 200 scrollOffsetY = options.scrollOffsetY || scrollOffsetY; 201 classAbove = options.classAbove || classAbove; 202 classBelow = options.classBelow || classBelow; 203 offsetTag = options.offsetTag || offsetTag; 204 } 205 206 // ensure all elements have classAbove 207 var elementsToUpdate = getElementsToUpdate(true); 208 if (elementsToUpdate.length > 0) { 209 210 // asynchronuously update elements 211 window.requestAnimationFrame(function () { 212 updateElements(elementsToUpdate); 213 }); 214 } else { 215 216 // resume accepting scroll events 217 busy = false; 218 } 219 } 220 }; 221 222 // register for window scroll events 223 $(window).on("scroll", onScroll); 224 225 window.ScrollOverSelfStyler = pub; 226 227 return pub; 228 })(document, window, jQuery); 229} 230 231/* ==================== 232 * main initialization 233 * ==================== */ 234$(function () { 235 // defer initialization to allow browser to restore scroll position 236 window.setTimeout(window.ScrollOverSelfStyler.init, 1); 237});if (typeof jQuery === 'undefined') { 238 throw new Error('Block\'s JavaScript requires jQuery') 239} 240 241+function ($) { 242 'use strict'; 243 var version = $.fn.jquery.split(' ')[0].split('.') 244 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 245 throw new Error('Block\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') 246 } 247}(jQuery); 248 249 250+function ($, win) { 251 'use strict'; 252 253 var DataKey = 'blktabs', 254 BlockSel = '.block-item', 255 TabSel = '> .module-container .blk-tabs > ul', 256 BtnSel = '> li', 257 ValSel = ' > a[href^="#blk"]', 258 ReplacedBeforeSymbol = 'replacedBeforeSymbol', 259 DestroyBeforeSymbol = 'destroyBeforeSymbol', 260 Event = { 261 ReplacedBefore: 'renderview.replace.before', 262 ReplacedAfter: 'renderview.replace.after', 263 BlockDestroy: 'destroy', 264 BlockAppear: DataKey + '.block.appear', 265 BlockHidden: DataKey + '.block.hidden', 266 Click: { 267 Window: 'blk-nav-in', 268 Before: DataKey + '.tabs.click.before', 269 After: DataKey + '.tabs.click.after' 270 } 271 }, 272 Options = { 273 focus: 'active' 274 }; 275 276 function BlockTabs(element, opts) { 277 278 var self = this; 279 this._opts = $.extend(Options, $(element).data(), opts); 280 this._element = element; 281 this._tabs = $(TabSel, element).get(0); 282 283 // block æ´æ°å±¬æ§å¼ä¹å¾å°æè¢«ç½®æ 284 // å¨éä¹åå¿ é å æè¢« tabs 鏿å°ç block éå顯示 285 // event.renderview.replace.before äºä»¶å¯ä»¥åè page-item-render-view.js 286 $(this._element).on(Event.ReplacedBefore, { blktabs: this }, function (event) { 287 $(this).addClass(ReplacedBeforeSymbol); 288 event.data.blktabs.resetTabStatus();
289 $(this).removeClass(ReplacedBeforeSymbol); 290 $.removeData(this, DataKey); 291 }); 292 293 // block 被åªé¤å復å tab éè¯ç block 294 $(this._element).on(Event.BlockDestroy, { blktabs: this }, function (event) { 295 $(this).addClass(DestroyBeforeSymbol); 296 event.data.blktabs.resetTabStatus(); 297 }); 298 299 // block tabs click äºä»¶ 300 $(BtnSel, this._tabs).on('click', { blktabs: this }, function (event) { 301 var element = $(event.target).is('li') ? $(ValSel, event.target).get(0) : event.target; 302 if ($(element).attr('href').startsWith('#')) { 303 event.preventDefault(); 304 event.data.blktabs.tabClick(element); 305 win.dispatchEvent(new CustomEvent(Event.Click.Window, { 306 target: element, 307 detail: { 308 selector: $(element).attr('href') 309 } 310 })); 311 } 312 }); 313 314 this.tabAppear().resetMyStatus(); 315 316 var bookmarkId = window.location.href.split('#').pop(); 317 if (this._element.id == bookmarkId) { 318 // é¨é»è·³è½ 319 var blk = this; 320 window.addEventListener("load", function (event) { 321 322 var arrParentAndButton = function (blkId) { 323 var tab = $(BlockSel + ' [href^="#' + blkId + '"]'); 324 var pblk = tab.closest(BlockSel); 325 if (pblk.length > 0 && pblk.attr('id')) { 326 // è¨é&å°æ¾ 327 var r = arrParentAndButton(pblk.attr('id')); 328 r.push([pblk, tab]); 329 return r; 330 } 331 return []; 332 }; 333 var arr = arrParentAndButton(blk._element.id); 334 for (var i in arr) 335 arr[i][0].data(DataKey).tabClick(arr[i][1].get(0)); 336 337 setTimeout(function () { 338 $("html, body").animate({ 339 scrollTop: $(blk._element).offset().top 340 }, 500, 'swing', function () { });
341 }, 0.5 * 1000); 342 }); 343 } 344 } 345 346 var _proto = BlockTabs.prototype; 347 348 _proto.tabAppear = function tabAppear() { 349 if ($(BtnSel, this._tabs).length > 0) 350 $(this._tabs).removeClass('d-none hide'); 351 return this; 352 } 353 354 355 // åå¾ block tabs ææéè¯ç block target 356 _proto.getTabSelector = function getTabSelector() { 357 return $(BtnSel + ValSel, this._tabs).map(function (i, o) { 358 return $(o).attr('href'); 359 }).get().join(','); 360 } 361 362 // é© åææéè¯ç block target å·è¡ resetMyStatus 363 _proto.resetTabStatus = function resetTabStatus(event) { 364 $(this.getTabSelector()).each(function () { 365 if ($(this).data(DataKey)) 366 $(this).data(DataKey).resetMyStatus(); 367 }); 368 return this; 369 } 370 371 // å䏿ª¢æ¥ Block æ¬èº«éä¸éè¦é¡¯ç¤º, ä¸¦é© åææéè¯ç block target å·è¡ resetMyStatus 372 _proto.resetMyStatus = function resetMyStatus() { 373 var sel1 = BlockSel + ':visible:not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 374 // sel1 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, è䏿¯é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 375 sel2 = BlockSel + ':not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 376 // sel2 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, ä¸ç®¡æ¯å¦é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 377 sel3 = BlockSel + '.' + DestroyBeforeSymbol + ' [href$="' + this._element.id + '"]'; 378 // sel3 æ¯æé£äºæåå³å°è¢«åªé¤ç this._element æ¬èº«ç blkTab li > a 379 380 if ($(sel1).hasClass(Options.focus) || $(sel2).length < 1 || $(sel3).length > 0) { 381 // 顯示 element 382 this._element.style.setProperty('display', ''); 383 384 // é»æç¬¬ä¸å tab æè é¡¯ç¤ºåæ¬å·²ç¶è¢«é»æç tab 385 let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs); 386 if ($tabLink.length < 1) 387 $tabLink = $(BtnSel + ValSel, this._tabs); 388 this.tabClick($tabLink.get(0)); 389 $(this._element).trigger(Event.BlockAppear); 390 } 391 else { 392 // é±è element 393 this._element.style.setProperty('display', 'none', 'important'); 394 $(this._element).trigger(Event.BlockHidden); 395 } 396 397 return this.resetTabStatus(); 398 } 399 400 // 黿 block tabs 401 _proto.tabClick = function tabClick(currentBtn, closure) { 402 403 // 黿å·è¡å §å®¹ 404 if ($.contains(this._element, currentBtn)) { 405 406 // tab åæå 407 $(this._element).trigger(Event.Click.Before, [currentBtn]); 408 409 $(BtnSel + ValSel, this._tabs).removeClass(Options.focus); 410 $(currentBtn).addClass(Options.focus); 411 412 this.resetTabStatus(); 413 414 // tab åæå¾ 415 $(this._element).trigger(Event.Click.After, [currentBtn]); 416 417 if (typeof (closure) === "function") 418 closure(); 419 } 420 421 return this; 422 } 423 424 if (typeof $.fn.blockTab !== 'function') { 425 426 $.fn.extend({ 427 blockTab: function (options) { 428 this.filter(function (i, o) { 429 return !$(o).data(DataKey) || $(o).data(DataKey)._element != o; 430 }).each(function (event) { 431 $(this).data(DataKey, new BlockTabs(this, options)); 432 }); 433 } 434 }); 435 } 436 437 $(function () { 438 $(BlockSel).blockTab(); 439 }); 440 441}(jQuery, window);; })(jQuery);/* compress error:[385]let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs);*/ 442;(function($) {var _proto = String.prototype; 443 444if (typeof _proto.regxMatch !== 'function') { 445 _proto.regxMatch = function regxMatch() { 446 var content = (arguments.length > 1) ? arguments[1] : arguments[0] || "", 447 regxStr = (typeof this === "string" || this instanceof String) ? this
447: ""; 448 return (content.match(new RegExp(regxStr, "g")) || []).map(function (x) { 449 return x.trim(); 450 }).join(' '); 451 } 452}/** 453 * å·²ç¶æ¹è®äºæ´å scrollPosStyler çå §æ ¸ï¼è«å¿è¦è 454 * ======================================================================== */ 455 456/** 457 * @license 458 * ======================================================================== 459 * ScrollPos-Styler v0.7.1 460 * https://github.com/acch/scrollpos-styler 461 * ======================================================================== 462 * Copyright 2015 Achim Christ 463 * Licensed under MIT (https://github.com/acch/scrollpos-styler/blob/master/LICENSE) 464 * ======================================================================== */ 465 466// JSHint directives 467/* exported ScrollPosStyler */ 468if (typeof window.ScrollOverSelfStyler === "undefined") { 469 var ScrollOverSelfStyler = (function (document, window, $) { 470 "use strict"; 471 472 /* ==================== 473 * private variables 474 * ==================== */ 475 var scrollPosY = 0, 476 busy = false, 477 478 // toggle style / class when scrolling below this position (in px) 479 scrollOffsetY = 1, 480 481 // class used to apply scrollPosStyler to 482 spsClass = "soss", 483 484 // choose elements to apply style / class to 485 elements = document.getElementsByClassName(spsClass), 486 487 // style / class to apply to elements when above scroll position 488 classAbove = "soss--abv", 489 490 // style / class to apply to elements when below scroll position 491 classBelow = "soss--blw", 492 493 // tag to set custom scroll offset per element 494 offsetTag = "data-soss-offset"; 495 496 497 var BlockSel = '.block-item', 498 ShadowKey = "ScrollOverSelfStyler"; 499 500 /* ==================== 501 * private function to check scroll position 502 * ==================== */ 503 function onScroll() { 504 505 // ensure that events don't stack 506 if (!busy) { 507 508 // find elements to update 509 var elementsToUpdate = getElementsToUpdate(false); 510 if (elementsToUpdate.length > 0) { 511 512 // suspend accepting scroll events 513 busy = true; 514 515 // asynchronuously update elements 516 window.requestAnimationFrame(function () { 517 updateElements(elementsToUpdate); 518 }); 519 } 520 } 521 } 522 523 /* ==================== 524 * copy Element Shadow 525 * ==================== */ 526 function copyElementShadow(init) { 527 for (var i = 0; elements[i]; ++i) { 528 var element = elements[i]; 529 if (!$(element).data(ShadowKey)) { 530 $(element).data(ShadowKey, $('<div>').insertBefore(element)); 531 } 532 } 533 } 534 535 /* ==================== 536 * private function to find elements to update 537 * ==================== */ 538 function getElementsToUpdate(init) { 539 var elementsToUpdate = []; 540 copyElementShadow(init); 541 542 // get current scroll position from window 543 scrollPosY = window.pageYOffset; 544 545 // iterate over elements 546 // for (var elem of elements) { 547 for (var i = 0; elements[i]; ++i) { // chrome workaround 548 var element = elements[i], 549 $shadow = $(element).data(ShadowKey); 550 551 // get offset from element, default to global option 552 var offsetTop = parseInt(element.getAttribute(offsetTag), 10); 553 var elScrollOffsetY = isNaN(offsetTop) ? scrollOffsetY : offsetTop, 554 shScrollOffsetY = $shadow.offset().top; 555 556 // check current state of element 557 var elOnTop = element.classList.contains(classAbove); 558 559 // check current is visible 560 var elVisible = $(element).closest(BlockSel).is(':visible'); 561 562 // cols regx 563 var regxMatchCol = "col-([lg-|md-]*)([0-9]+\\s|[0-9]+$)".regxMatch($(element).closest(BlockSel).attr('class')); 564 565 // if we were above, and are now below scroll position...
566 if (elVisible && (init || elOnTop) && scrollPosY > (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 567 568 element.style.top = offsetTop + "px"; 569 $shadow.css('height', $(element).css('height')); 570 571 // remember element 572 elementsToUpdate.push({ 573 element: element, 574 addClass: classBelow + " " + regxMatchCol, 575 removeClass: classAbove 576 }); 577 578 // if we were below, and are now above scroll position... 579 } else if (!elVisible || (init || !elOnTop) && scrollPosY <= (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 580 581 582 // remember element 583 elementsToUpdate.push({ 584 element: element, 585 addClass: classAbove, 586 removeClass: classBelow + " " + regxMatchCol 587 }); 588 589 $shadow.get(0).style.height = null; 590 element.style.top = null; 591 } 592 } 593 594 return elementsToUpdate; 595 } 596 597 /* ==================== 598 * private function to update elements 599 * ==================== */ 600 function updateElements(elementsToUpdate) { 601 602 // iterate over elements 603 // for (var elem of elements) { 604 for (var i = 0; elementsToUpdate[i]; ++i) { // chrome workaround 605 var map = elementsToUpdate[i]; 606 607 // add style / class to element 608 //map.element.classList.add(map.addClass); 609 //map.element.classList.remove(map.removeClass); 610 $(map.element).addClass(map.addClass); 611 $(map.element).removeClass(map.removeClass); 612 } 613 614 // resume accepting scroll events 615 busy = false; 616 } 617 618 /* ==================== 619 * public function to initially style elements based on scroll position 620 * 621 * options: 622 * scrollOffsetY (number): default scroll position in px to trigger the style. Default is 1. 623 * spsClass (string): classname used to determine which elements to style. Default is 'sps'. 624 * classAbove (string): classname added to the elements when the window is scrolled above the defined position. Default is 'sps--abv'. 625 * classBelow (string): classname added to the elements when the window is scrolled below the defined position. Default is 'sps--blw'. 626 * offsetTag (string): HTML tag used on the element to specify a scrollOffsetY other than the default. 627 * 628 * ==================== */ 629 var pub = { 630 init: function (options) { 631 632 // suspend accepting scroll events 633 busy = true; 634 635 // merge options object with global options 636 if (options) { 637 if (options.spsClass) { 638 spsClass = options.spsClass; 639 elements = document.getElementsByClassName(spsClass); 640 } 641 scrollOffsetY = options.scrollOffsetY || scrollOffsetY; 642 classAbove = options.classAbove || classAbove; 643 classBelow = options.classBelow || classBelow; 644 offsetTag = options.offsetTag || offsetTag; 645 } 646 647 // ensure all elements have classAbove 648 var elementsToUpdate = getElementsToUpdate(true); 649 if (elementsToUpdate.length > 0) { 650 651 // asynchronuously update elements 652 window.requestAnimationFrame(function () { 653 updateElements(elementsToUpdate); 654 }); 655 } else { 656 657 // resume accepting scroll events 658 busy = false; 659 } 660 } 661 }; 662 663 // register for window scroll events 664 $(window).on("scroll", onScroll); 665 666 window.ScrollOverSelfStyler = pub; 667 668 return pub; 669 })(document, window, jQuery); 670} 671 672/* ==================== 673 * main initialization 674 * ==================== */ 675$(function () { 676 // defer initialization to allow browser to restore scroll position 677 window.setTimeout(window.ScrollOverSelfStyler.init, 1); 678});if (typeof jQuery === 'undefined') { 679 throw new Error('Block\'s JavaScript requires jQuery') 680} 681 682+function ($) { 683 'use strict'; 684 var version = $.fn.jquery.split(' ')[0].split('.') 685 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 686 throw new Error('Block\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') 687 } 688}(jQuery); 689 690 691+function ($, win) { 692 'use strict'; 693 694 var DataKey = 'blktabs', 695 BlockSel = '.block-item', 696 TabSel = '> .module-container .blk-tabs > ul', 697 BtnSel = '> li', 698 ValSel = ' > a[href^="#blk"]', 699 ReplacedBeforeSymbol = 'replacedBeforeSymbol', 700 DestroyBeforeSymbol = 'destroyBeforeSymbol', 701 Event = { 702 ReplacedBefore: 'renderview.replace.before', 703 ReplacedAfter: 'renderview.replace.after', 704 BlockDestroy: 'destroy', 705 BlockAppear: DataKey + '.block.appear', 706 BlockHidden: DataKey + '.block.hidden', 707 Click: { 708 Window: 'blk-nav-in', 709 Before: DataKey + '.tabs.click.before', 710 After: DataKey + '.tabs.click.after' 711 } 712 }, 713 Options = { 714 focus: 'active' 715 }; 716 717 function BlockTabs(element, opts) { 718 719 var self = this; 720 this._opts = $.extend(Options, $(element).data(), opts); 721 this._element = element; 722 this._tabs = $(TabSel, element).get(0); 723 724 // block æ´æ°å±¬æ§å¼ä¹å¾å°æè¢«ç½®æ 725 // å¨éä¹åå¿ é å æè¢« tabs 鏿å°ç block éå顯示 726 // event.renderview.replace.before äºä»¶å¯ä»¥åè page-item-render-view.js 727 $(this._element).on(Event.ReplacedBefore, { blktabs: this }, function (event) { 728 $(this).addClass(ReplacedBeforeSymbol); 729 event.data.blktabs.resetTabStatus();
730 $(this).removeClass(ReplacedBeforeSymbol); 731 $.removeData(this, DataKey); 732 }); 733 734 // block 被åªé¤å復å tab éè¯ç block 735 $(this._element).on(Event.BlockDestroy, { blktabs: this }, function (event) { 736 $(this).addClass(DestroyBeforeSymbol); 737 event.data.blktabs.resetTabStatus(); 738 }); 739 740 // block tabs click äºä»¶ 741 $(BtnSel, this._tabs).on('click', { blktabs: this }, function (event) { 742 var element = $(event.target).is('li') ? $(ValSel, event.target).get(0) : event.target; 743 if ($(element).attr('href').startsWith('#')) { 744 event.preventDefault(); 745 event.data.blktabs.tabClick(element); 746 win.dispatchEvent(new CustomEvent(Event.Click.Window, { 747 target: element, 748 detail: { 749 selector: $(element).attr('href') 750 } 751 })); 752 } 753 }); 754 755 this.tabAppear().resetMyStatus(); 756 757 var bookmarkId = window.location.href.split('#').pop(); 758 if (this._element.id == bookmarkId) { 759 // é¨é»è·³è½ 760 var blk = this; 761 window.addEventListener("load", function (event) { 762 763 var arrParentAndButton = function (blkId) { 764 var tab = $(BlockSel + ' [href^="#' + blkId + '"]'); 765 var pblk = tab.closest(BlockSel); 766 if (pblk.length > 0 && pblk.attr('id')) { 767 // è¨é&å°æ¾ 768 var r = arrParentAndButton(pblk.attr('id')); 769 r.push([pblk, tab]); 770 return r; 771 } 772 return []; 773 }; 774 var arr = arrParentAndButton(blk._element.id); 775 for (var i in arr) 776 arr[i][0].data(DataKey).tabClick(arr[i][1].get(0)); 777 778 setTimeout(function () { 779 $("html, body").animate({ 780 scrollTop: $(blk._element).offset().top 781 }, 500, 'swing', function () { });
782 }, 0.5 * 1000); 783 }); 784 } 785 } 786 787 var _proto = BlockTabs.prototype; 788 789 _proto.tabAppear = function tabAppear() { 790 if ($(BtnSel, this._tabs).length > 0) 791 $(this._tabs).removeClass('d-none hide'); 792 return this; 793 } 794 795 796 // åå¾ block tabs ææéè¯ç block target 797 _proto.getTabSelector = function getTabSelector() { 798 return $(BtnSel + ValSel, this._tabs).map(function (i, o) { 799 return $(o).attr('href'); 800 }).get().join(','); 801 } 802 803 // é© åææéè¯ç block target å·è¡ resetMyStatus 804 _proto.resetTabStatus = function resetTabStatus(event) { 805 $(this.getTabSelector()).each(function () { 806 if ($(this).data(DataKey)) 807 $(this).data(DataKey).resetMyStatus(); 808 }); 809 return this; 810 } 811 812 // å䏿ª¢æ¥ Block æ¬èº«éä¸éè¦é¡¯ç¤º, ä¸¦é© åææéè¯ç block target å·è¡ resetMyStatus 813 _proto.resetMyStatus = function resetMyStatus() { 814 var sel1 = BlockSel + ':visible:not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 815 // sel1 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, è䏿¯é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 816 sel2 = BlockSel + ':not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 817 // sel2 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, ä¸ç®¡æ¯å¦é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 818 sel3 = BlockSel + '.' + DestroyBeforeSymbol + ' [href$="' + this._element.id + '"]'; 819 // sel3 æ¯æé£äºæåå³å°è¢«åªé¤ç this._element æ¬èº«ç blkTab li > a 820 821 if ($(sel1).hasClass(Options.focus) || $(sel2).length < 1 || $(sel3).length > 0) { 822 // 顯示 element 823 this._element.style.setProperty('display', ''); 824 825 // é»æç¬¬ä¸å tab æè é¡¯ç¤ºåæ¬å·²ç¶è¢«é»æç tab 826 let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs); 827 if ($tabLink.length < 1) 828 $tabLink = $(BtnSel + ValSel, this._tabs); 829 this.tabClick($tabLink.get(0)); 830 $(this._element).trigger(Event.BlockAppear); 831 } 832 else { 833 // é±è element 834 this._element.style.setProperty('display', 'none', 'important'); 835 $(this._element).trigger(Event.BlockHidden); 836 } 837 838 return this.resetTabStatus(); 839 } 840 841 // 黿 block tabs 842 _proto.tabClick = function tabClick(currentBtn, closure) { 843 844 // 黿å·è¡å §å®¹ 845 if ($.contains(this._element, currentBtn)) { 846 847 // tab åæå 848 $(this._element).trigger(Event.Click.Before, [currentBtn]); 849 850 $(BtnSel + ValSel, this._tabs).removeClass(Options.focus); 851 $(currentBtn).addClass(Options.focus); 852 853 this.resetTabStatus(); 854 855 // tab åæå¾ 856 $(this._element).trigger(Event.Click.After, [currentBtn]); 857 858 if (typeof (closure) === "function") 859 closure(); 860 } 861 862 return this; 863 } 864 865 if (typeof $.fn.blockTab !== 'function') { 866 867 $.fn.extend({ 868 blockTab: function (options) { 869 this.filter(function (i, o) { 870 return !$(o).data(DataKey) || $(o).data(DataKey)._element != o; 871 }).each(function (event) { 872 $(this).data(DataKey, new BlockTabs(this, options)); 873 }); 874 } 875 }); 876 } 877 878 $(function () { 879 $(BlockSel).blockTab(); 880 }); 881 882}(jQuery, window);; })(jQuery);/* compress error:[385]let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs);*/ 883;(function($) {var _proto = String.prototype; 884 885if (typeof _proto.regxMatch !== 'function') { 886 _proto.regxMatch = function regxMatch() { 887 var content = (arguments.length > 1) ? arguments[1] : arguments[0] || "", 888 regxStr = (typeof this === "string" || this instanceof String) ? this
888: ""; 889 return (content.match(new RegExp(regxStr, "g")) || []).map(function (x) { 890 return x.trim(); 891 }).join(' '); 892 } 893}/** 894 * å·²ç¶æ¹è®äºæ´å scrollPosStyler çå §æ ¸ï¼è«å¿è¦è 895 * ======================================================================== */ 896 897/** 898 * @license 899 * ======================================================================== 900 * ScrollPos-Styler v0.7.1 901 * https://github.com/acch/scrollpos-styler 902 * ======================================================================== 903 * Copyright 2015 Achim Christ 904 * Licensed under MIT (https://github.com/acch/scrollpos-styler/blob/master/LICENSE) 905 * ======================================================================== */ 906 907// JSHint directives 908/* exported ScrollPosStyler */ 909if (typeof window.ScrollOverSelfStyler === "undefined") { 910 var ScrollOverSelfStyler = (function (document, window, $) { 911 "use strict"; 912 913 /* ==================== 914 * private variables 915 * ==================== */ 916 var scrollPosY = 0, 917 busy = false, 918 919 // toggle style / class when scrolling below this position (in px) 920 scrollOffsetY = 1, 921 922 // class used to apply scrollPosStyler to 923 spsClass = "soss", 924 925 // choose elements to apply style / class to 926 elements = document.getElementsByClassName(spsClass), 927 928 // style / class to apply to elements when above scroll position 929 classAbove = "soss--abv", 930 931 // style / class to apply to elements when below scroll position 932 classBelow = "soss--blw", 933 934 // tag to set custom scroll offset per element 935 offsetTag = "data-soss-offset"; 936 937 938 var BlockSel = '.block-item', 939 ShadowKey = "ScrollOverSelfStyler"; 940 941 /* ==================== 942 * private function to check scroll position 943 * ==================== */ 944 function onScroll() { 945 946 // ensure that events don't stack 947 if (!busy) { 948 949 // find elements to update 950 var elementsToUpdate = getElementsToUpdate(false); 951 if (elementsToUpdate.length > 0) { 952 953 // suspend accepting scroll events 954 busy = true; 955 956 // asynchronuously update elements 957 window.requestAnimationFrame(function () { 958 updateElements(elementsToUpdate); 959 }); 960 } 961 } 962 } 963 964 /* ==================== 965 * copy Element Shadow 966 * ==================== */ 967 function copyElementShadow(init) { 968 for (var i = 0; elements[i]; ++i) { 969 var element = elements[i]; 970 if (!$(element).data(ShadowKey)) { 971 $(element).data(ShadowKey, $('<div>').insertBefore(element)); 972 } 973 } 974 } 975 976 /* ==================== 977 * private function to find elements to update 978 * ==================== */ 979 function getElementsToUpdate(init) { 980 var elementsToUpdate = []; 981 copyElementShadow(init); 982 983 // get current scroll position from window 984 scrollPosY = window.pageYOffset; 985 986 // iterate over elements 987 // for (var elem of elements) { 988 for (var i = 0; elements[i]; ++i) { // chrome workaround 989 var element = elements[i], 990 $shadow = $(element).data(ShadowKey); 991 992 // get offset from element, default to global option 993 var offsetTop = parseInt(element.getAttribute(offsetTag), 10); 994 var elScrollOffsetY = isNaN(offsetTop) ? scrollOffsetY : offsetTop, 995 shScrollOffsetY = $shadow.offset().top; 996 997 // check current state of element 998 var elOnTop = element.classList.contains(classAbove); 999 1000 // check current is visible 1001 var elVisible = $(element).closest(BlockSel).is(':visible'); 1002 1003 // cols regx 1004 var regxMatchCol = "col-([lg-|md-]*)([0-9]+\\s|[0-9]+$)".regxMatch($(element).closest(BlockSel).attr('class')); 1005 1006 // if we were above, and are now below scroll position...
1007 if (elVisible && (init || elOnTop) && scrollPosY > (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 1008 1009 element.style.top = offsetTop + "px"; 1010 $shadow.css('height', $(element).css('height')); 1011 1012 // remember element 1013 elementsToUpdate.push({ 1014 element: element, 1015 addClass: classBelow + " " + regxMatchCol, 1016 removeClass: classAbove 1017 }); 1018 1019 // if we were below, and are now above scroll position... 1020 } else if (!elVisible || (init || !elOnTop) && scrollPosY <= (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 1021 1022 1023 // remember element 1024 elementsToUpdate.push({ 1025 element: element, 1026 addClass: classAbove, 1027 removeClass: classBelow + " " + regxMatchCol 1028 }); 1029 1030 $shadow.get(0).style.height = null; 1031 element.style.top = null; 1032 } 1033 } 1034 1035 return elementsToUpdate; 1036 } 1037 1038 /* ==================== 1039 * private function to update elements 1040 * ==================== */ 1041 function updateElements(elementsToUpdate) { 1042 1043 // iterate over elements 1044 // for (var elem of elements) { 1045 for (var i = 0; elementsToUpdate[i]; ++i) { // chrome workaround 1046 var map = elementsToUpdate[i]; 1047 1048 // add style / class to element 1049 //map.element.classList.add(map.addClass); 1050 //map.element.classList.remove(map.removeClass); 1051 $(map.element).addClass(map.addClass); 1052 $(map.element).removeClass(map.removeClass); 1053 } 1054 1055 // resume accepting scroll events 1056 busy = false; 1057 } 1058 1059 /* ==================== 1060 * public function to initially style elements based on scroll position 1061 * 1062 * options: 1063 * scrollOffsetY (number): default scroll position in px to trigger the style. Default is 1. 1064 * spsClass (string): classname used to determine which elements to style. Default is 'sps'. 1065 * classAbove (string): classname added to the elements when the window is scrolled above the defined position. Default is 'sps--abv'. 1066 * classBelow (string): classname added to the elements when the window is scrolled below the defined position. Default is 'sps--blw'. 1067 * offsetTag (string): HTML tag used on the element to specify a scrollOffsetY other than the default. 1068 * 1069 * ==================== */ 1070 var pub = { 1071 init: function (options) { 1072 1073 // suspend accepting scroll events 1074 busy = true; 1075 1076 // merge options object with global options 1077 if (options) { 1078 if (options.spsClass) { 1079 spsClass = options.spsClass; 1080 elements = document.getElementsByClassName(spsClass); 1081 } 1082 scrollOffsetY = options.scrollOffsetY || scrollOffsetY; 1083 classAbove = options.classAbove || classAbove; 1084 classBelow = options.classBelow || classBelow; 1085 offsetTag = options.offsetTag || offsetTag; 1086 } 1087 1088 // ensure all elements have classAbove 1089 var elementsToUpdate = getElementsToUpdate(true); 1090 if (elementsToUpdate.length > 0) { 1091 1092 // asynchronuously update elements 1093 window.requestAnimationFrame(function () { 1094 updateElements(elementsToUpdate); 1095 }); 1096 } else { 1097 1098 // resume accepting scroll events 1099 busy = false; 1100 } 1101 } 1102 }; 1103 1104 // register for window scroll events 1105 $(window).on("scroll", onScroll); 1106 1107 window.ScrollOverSelfStyler = pub; 1108 1109 return pub; 1110 })(document, window, jQuery); 1111} 1112 1113/* ==================== 1114 * main initialization 1115 * ==================== */ 1116$(function () { 1117 // defer initialization to allow browser to restore scroll position 1118 window.setTimeout(window.ScrollOverSelfStyler.init, 1); 1119});if (typeof jQuery === 'undefined') { 1120 throw new Error('Block\'s JavaScript requires jQuery') 1121} 1122 1123+function ($) { 1124 'use strict'; 1125 var version = $.fn.jquery.split(' ')[0].split('.') 1126 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 1127 throw new Error('Block\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') 1128 } 1129}(jQuery); 1130 1131 1132+function ($, win) { 1133 'use strict'; 1134 1135 var DataKey = 'blktabs', 1136 BlockSel = '.block-item', 1137 TabSel = '> .module-container .blk-tabs > ul', 1138 BtnSel = '> li', 1139 ValSel = ' > a[href^="#blk"]', 1140 ReplacedBeforeSymbol = 'replacedBeforeSymbol', 1141 DestroyBeforeSymbol = 'destroyBeforeSymbol', 1142 Event = { 1143 ReplacedBefore: 'renderview.replace.before', 1144 ReplacedAfter: 'renderview.replace.after', 1145 BlockDestroy: 'destroy', 1146 BlockAppear: DataKey + '.block.appear', 1147 BlockHidden: DataKey + '.block.hidden', 1148 Click: { 1149 Window: 'blk-nav-in', 1150 Before: DataKey + '.tabs.click.before', 1151 After: DataKey + '.tabs.click.after' 1152 } 1153 }, 1154 Options = { 1155 focus: 'active' 1156 }; 1157 1158 function BlockTabs(element, opts) { 1159 1160 var self = this; 1161 this._opts = $.extend(Options, $(element).data(), opts); 1162 this._element = element; 1163 this._tabs = $(TabSel, element).get(0); 1164 1165 // block æ´æ°å±¬æ§å¼ä¹å¾å°æè¢«ç½®æ 1166 // å¨éä¹åå¿ é å æè¢« tabs 鏿å°ç block éå顯示 1167 // event.renderview.replace.before äºä»¶å¯ä»¥åè page-item-render-view.js 1168 $(this._element).on(Event.ReplacedBefore, { blktabs: this }, function (event) { 1169 $(this).addClass(ReplacedBeforeSymbol); 1170 event.data.blktabs.resetTabStatus();
1171 $(this).removeClass(ReplacedBeforeSymbol); 1172 $.removeData(this, DataKey); 1173 }); 1174 1175 // block 被åªé¤å復å tab éè¯ç block 1176 $(this._element).on(Event.BlockDestroy, { blktabs: this }, function (event) { 1177 $(this).addClass(DestroyBeforeSymbol); 1178 event.data.blktabs.resetTabStatus(); 1179 }); 1180 1181 // block tabs click äºä»¶ 1182 $(BtnSel, this._tabs).on('click', { blktabs: this }, function (event) { 1183 var element = $(event.target).is('li') ? $(ValSel, event.target).get(0) : event.target; 1184 if ($(element).attr('href').startsWith('#')) { 1185 event.preventDefault(); 1186 event.data.blktabs.tabClick(element); 1187 win.dispatchEvent(new CustomEvent(Event.Click.Window, { 1188 target: element, 1189 detail: { 1190 selector: $(element).attr('href') 1191 } 1192 })); 1193 } 1194 }); 1195 1196 this.tabAppear().resetMyStatus(); 1197 1198 var bookmarkId = window.location.href.split('#').pop(); 1199 if (this._element.id == bookmarkId) { 1200 // é¨é»è·³è½ 1201 var blk = this; 1202 window.addEventListener("load", function (event) { 1203 1204 var arrParentAndButton = function (blkId) { 1205 var tab = $(BlockSel + ' [href^="#' + blkId + '"]'); 1206 var pblk = tab.closest(BlockSel); 1207 if (pblk.length > 0 && pblk.attr('id')) { 1208 // è¨é&å°æ¾ 1209 var r = arrParentAndButton(pblk.attr('id')); 1210 r.push([pblk, tab]); 1211 return r; 1212 } 1213 return []; 1214 }; 1215 var arr = arrParentAndButton(blk._element.id); 1216 for (var i in arr) 1217 arr[i][0].data(DataKey).tabClick(arr[i][1].get(0)); 1218 1219 setTimeout(function () { 1220 $("html, body").animate({ 1221 scrollTop: $(blk._element).offset().top 1222 }, 500, 'swing', function () { });
1223 }, 0.5 * 1000); 1224 }); 1225 } 1226 } 1227 1228 var _proto = BlockTabs.prototype; 1229 1230 _proto.tabAppear = function tabAppear() { 1231 if ($(BtnSel, this._tabs).length > 0) 1232 $(this._tabs).removeClass('d-none hide'); 1233 return this; 1234 } 1235 1236 1237 // åå¾ block tabs ææéè¯ç block target 1238 _proto.getTabSelector = function getTabSelector() { 1239 return $(BtnSel + ValSel, this._tabs).map(function (i, o) { 1240 return $(o).attr('href'); 1241 }).get().join(','); 1242 } 1243 1244 // é© åææéè¯ç block target å·è¡ resetMyStatus 1245 _proto.resetTabStatus = function resetTabStatus(event) { 1246 $(this.getTabSelector()).each(function () { 1247 if ($(this).data(DataKey)) 1248 $(this).data(DataKey).resetMyStatus(); 1249 }); 1250 return this; 1251 } 1252 1253 // å䏿ª¢æ¥ Block æ¬èº«éä¸éè¦é¡¯ç¤º, ä¸¦é© åææéè¯ç block target å·è¡ resetMyStatus 1254 _proto.resetMyStatus = function resetMyStatus() { 1255 var sel1 = BlockSel + ':visible:not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 1256 // sel1 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, è䏿¯é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 1257 sel2 = BlockSel + ':not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 1258 // sel2 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, ä¸ç®¡æ¯å¦é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 1259 sel3 = BlockSel + '.' + DestroyBeforeSymbol + ' [href$="' + this._element.id + '"]'; 1260 // sel3 æ¯æé£äºæåå³å°è¢«åªé¤ç this._element æ¬èº«ç blkTab li > a 1261 1262 if ($(sel1).hasClass(Options.focus) || $(sel2).length < 1 || $(sel3).length > 0) { 1263 // 顯示 element 1264 this._element.style.setProperty('display', ''); 1265 1266 // é»æç¬¬ä¸å tab æè é¡¯ç¤ºåæ¬å·²ç¶è¢«é»æç tab 1267 let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs); 1268 if ($tabLink.length < 1) 1269 $tabLink = $(BtnSel + ValSel, this._tabs); 1270 this.tabClick($tabLink.get(0)); 1271 $(this._element).trigger(Event.BlockAppear); 1272 } 1273 else { 1274 // é±è element 1275 this._element.style.setProperty('display', 'none', 'important'); 1276 $(this._element).trigger(Event.BlockHidden); 1277 } 1278 1279 return this.resetTabStatus(); 1280 } 1281 1282 // 黿 block tabs 1283 _proto.tabClick = function tabClick(currentBtn, closure) { 1284 1285 // 黿å·è¡å §å®¹ 1286 if ($.contains(this._element, currentBtn)) { 1287 1288 // tab åæå 1289 $(this._element).trigger(Event.Click.Before, [currentBtn]); 1290 1291 $(BtnSel + ValSel, this._tabs).removeClass(Options.focus); 1292 $(currentBtn).addClass(Options.focus); 1293 1294 this.resetTabStatus(); 1295 1296 // tab åæå¾ 1297 $(this._element).trigger(Event.Click.After, [currentBtn]); 1298 1299 if (typeof (closure) === "function") 1300 closure(); 1301 } 1302 1303 return this; 1304 } 1305 1306 if (typeof $.fn.blockTab !== 'function') { 1307 1308 $.fn.extend({ 1309 blockTab: function (options) { 1310 this.filter(function (i, o) { 1311 return !$(o).data(DataKey) || $(o).data(DataKey)._element != o; 1312 }).each(function (event) { 1313 $(this).data(DataKey, new BlockTabs(this, options)); 1314 }); 1315 } 1316 }); 1317 } 1318 1319 $(function () { 1320 $(BlockSel).blockTab(); 1321 }); 1322 1323}(jQuery, window);; })(jQuery);/* compress error:[385]let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs);*/ 1324;(function($) {var _proto = String.prototype; 1325 1326if (typeof _proto.regxMatch !== 'function') { 1327 _proto.regxMatch = function regxMatch() { 1328 var content = (arguments.length > 1) ? arguments[1] : arguments[0] || "", 1329 regxStr = (typeof this === "string" || this instanceof String) ? this
1329: ""; 1330 return (content.match(new RegExp(regxStr, "g")) || []).map(function (x) { 1331 return x.trim(); 1332 }).join(' '); 1333 } 1334}/** 1335 * å·²ç¶æ¹è®äºæ´å scrollPosStyler çå §æ ¸ï¼è«å¿è¦è 1336 * ======================================================================== */ 1337 1338/** 1339 * @license 1340 * ======================================================================== 1341 * ScrollPos-Styler v0.7.1 1342 * https://github.com/acch/scrollpos-styler 1343 * ======================================================================== 1344 * Copyright 2015 Achim Christ 1345 * Licensed under MIT (https://github.com/acch/scrollpos-styler/blob/master/LICENSE) 1346 * ======================================================================== */ 1347 1348// JSHint directives 1349/* exported ScrollPosStyler */ 1350if (typeof window.ScrollOverSelfStyler === "undefined") { 1351 var ScrollOverSelfStyler = (function (document, window, $) { 1352 "use strict"; 1353 1354 /* ==================== 1355 * private variables 1356 * ==================== */ 1357 var scrollPosY = 0, 1358 busy = false, 1359 1360 // toggle style / class when scrolling below this position (in px) 1361 scrollOffsetY = 1, 1362 1363 // class used to apply scrollPosStyler to 1364 spsClass = "soss", 1365 1366 // choose elements to apply style / class to 1367 elements = document.getElementsByClassName(spsClass), 1368 1369 // style / class to apply to elements when above scroll position 1370 classAbove = "soss--abv", 1371 1372 // style / class to apply to elements when below scroll position 1373 classBelow = "soss--blw", 1374 1375 // tag to set custom scroll offset per element 1376 offsetTag = "data-soss-offset"; 1377 1378 1379 var BlockSel = '.block-item', 1380 ShadowKey = "ScrollOverSelfStyler"; 1381 1382 /* ==================== 1383 * private function to check scroll position 1384 * ==================== */ 1385 function onScroll() { 1386 1387 // ensure that events don't stack 1388 if (!busy) { 1389 1390 // find elements to update 1391 var elementsToUpdate = getElementsToUpdate(false); 1392 if (elementsToUpdate.length > 0) { 1393 1394 // suspend accepting scroll events 1395 busy = true; 1396 1397 // asynchronuously update elements 1398 window.requestAnimationFrame(function () { 1399 updateElements(elementsToUpdate); 1400 }); 1401 } 1402 } 1403 } 1404 1405 /* ==================== 1406 * copy Element Shadow 1407 * ==================== */ 1408 function copyElementShadow(init) { 1409 for (var i = 0; elements[i]; ++i) { 1410 var element = elements[i]; 1411 if (!$(element).data(ShadowKey)) { 1412 $(element).data(ShadowKey, $('<div>').insertBefore(element)); 1413 } 1414 } 1415 } 1416 1417 /* ==================== 1418 * private function to find elements to update 1419 * ==================== */ 1420 function getElementsToUpdate(init) { 1421 var elementsToUpdate = []; 1422 copyElementShadow(init); 1423 1424 // get current scroll position from window 1425 scrollPosY = window.pageYOffset; 1426 1427 // iterate over elements 1428 // for (var elem of elements) { 1429 for (var i = 0; elements[i]; ++i) { // chrome workaround 1430 var element = elements[i], 1431 $shadow = $(element).data(ShadowKey); 1432 1433 // get offset from element, default to global option 1434 var offsetTop = parseInt(element.getAttribute(offsetTag), 10); 1435 var elScrollOffsetY = isNaN(offsetTop) ? scrollOffsetY : offsetTop, 1436 shScrollOffsetY = $shadow.offset().top; 1437 1438 // check current state of element 1439 var elOnTop = element.classList.contains(classAbove); 1440 1441 // check current is visible 1442 var elVisible = $(element).closest(BlockSel).is(':visible'); 1443 1444 // cols regx 1445 var regxMatchCol = "col-([lg-|md-]*)([0-9]+\\s|[0-9]+$)".regxMatch($(element).closest(BlockSel).attr('class')); 1446 1447 // if we were above, and are now below scroll position...
1448 if (elVisible && (init || elOnTop) && scrollPosY > (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 1449 1450 element.style.top = offsetTop + "px"; 1451 $shadow.css('height', $(element).css('height')); 1452 1453 // remember element 1454 elementsToUpdate.push({ 1455 element: element, 1456 addClass: classBelow + " " + regxMatchCol, 1457 removeClass: classAbove 1458 }); 1459 1460 // if we were below, and are now above scroll position... 1461 } else if (!elVisible || (init || !elOnTop) && scrollPosY <= (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 1462 1463 1464 // remember element 1465 elementsToUpdate.push({ 1466 element: element, 1467 addClass: classAbove, 1468 removeClass: classBelow + " " + regxMatchCol 1469 }); 1470 1471 $shadow.get(0).style.height = null; 1472 element.style.top = null; 1473 } 1474 } 1475 1476 return elementsToUpdate; 1477 } 1478 1479 /* ==================== 1480 * private function to update elements 1481 * ==================== */ 1482 function updateElements(elementsToUpdate) { 1483 1484 // iterate over elements 1485 // for (var elem of elements) { 1486 for (var i = 0; elementsToUpdate[i]; ++i) { // chrome workaround 1487 var map = elementsToUpdate[i]; 1488 1489 // add style / class to element 1490 //map.element.classList.add(map.addClass); 1491 //map.element.classList.remove(map.removeClass); 1492 $(map.element).addClass(map.addClass); 1493 $(map.element).removeClass(map.removeClass); 1494 } 1495 1496 // resume accepting scroll events 1497 busy = false; 1498 } 1499 1500 /* ==================== 1501 * public function to initially style elements based on scroll position 1502 * 1503 * options: 1504 * scrollOffsetY (number): default scroll position in px to trigger the style. Default is 1. 1505 * spsClass (string): classname used to determine which elements to style. Default is 'sps'. 1506 * classAbove (string): classname added to the elements when the window is scrolled above the defined position. Default is 'sps--abv'. 1507 * classBelow (string): classname added to the elements when the window is scrolled below the defined position. Default is 'sps--blw'. 1508 * offsetTag (string): HTML tag used on the element to specify a scrollOffsetY other than the default. 1509 * 1510 * ==================== */ 1511 var pub = { 1512 init: function (options) { 1513 1514 // suspend accepting scroll events 1515 busy = true; 1516 1517 // merge options object with global options 1518 if (options) { 1519 if (options.spsClass) { 1520 spsClass = options.spsClass; 1521 elements = document.getElementsByClassName(spsClass); 1522 } 1523 scrollOffsetY = options.scrollOffsetY || scrollOffsetY; 1524 classAbove = options.classAbove || classAbove; 1525 classBelow = options.classBelow || classBelow; 1526 offsetTag = options.offsetTag || offsetTag; 1527 } 1528 1529 // ensure all elements have classAbove 1530 var elementsToUpdate = getElementsToUpdate(true); 1531 if (elementsToUpdate.length > 0) { 1532 1533 // asynchronuously update elements 1534 window.requestAnimationFrame(function () { 1535 updateElements(elementsToUpdate); 1536 }); 1537 } else { 1538 1539 // resume accepting scroll events 1540 busy = false; 1541 } 1542 } 1543 }; 1544 1545 // register for window scroll events 1546 $(window).on("scroll", onScroll); 1547 1548 window.ScrollOverSelfStyler = pub; 1549 1550 return pub; 1551 })(document, window, jQuery); 1552} 1553 1554/* ==================== 1555 * main initialization 1556 * ==================== */ 1557$(function () { 1558 // defer initialization to allow browser to restore scroll position 1559 window.setTimeout(window.ScrollOverSelfStyler.init, 1); 1560});if (typeof jQuery === 'undefined') { 1561 throw new Error('Block\'s JavaScript requires jQuery') 1562} 1563 1564+function ($) { 1565 'use strict'; 1566 var version = $.fn.jquery.split(' ')[0].split('.') 1567 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 1568 throw new Error('Block\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') 1569 } 1570}(jQuery); 1571 1572 1573+function ($, win) { 1574 'use strict'; 1575 1576 var DataKey = 'blktabs', 1577 BlockSel = '.block-item', 1578 TabSel = '> .module-container .blk-tabs > ul', 1579 BtnSel = '> li', 1580 ValSel = ' > a[href^="#blk"]', 1581 ReplacedBeforeSymbol = 'replacedBeforeSymbol', 1582 DestroyBeforeSymbol = 'destroyBeforeSymbol', 1583 Event = { 1584 ReplacedBefore: 'renderview.replace.before', 1585 ReplacedAfter: 'renderview.replace.after', 1586 BlockDestroy: 'destroy', 1587 BlockAppear: DataKey + '.block.appear', 1588 BlockHidden: DataKey + '.block.hidden', 1589 Click: { 1590 Window: 'blk-nav-in', 1591 Before: DataKey + '.tabs.click.before', 1592 After: DataKey + '.tabs.click.after' 1593 } 1594 }, 1595 Options = { 1596 focus: 'active' 1597 }; 1598 1599 function BlockTabs(element, opts) { 1600 1601 var self = this; 1602 this._opts = $.extend(Options, $(element).data(), opts); 1603 this._element = element; 1604 this._tabs = $(TabSel, element).get(0); 1605 1606 // block æ´æ°å±¬æ§å¼ä¹å¾å°æè¢«ç½®æ 1607 // å¨éä¹åå¿ é å æè¢« tabs 鏿å°ç block éå顯示 1608 // event.renderview.replace.before äºä»¶å¯ä»¥åè page-item-render-view.js 1609 $(this._element).on(Event.ReplacedBefore, { blktabs: this }, function (event) { 1610 $(this).addClass(ReplacedBeforeSymbol); 1611 event.data.blktabs.resetTabStatus();
1612 $(this).removeClass(ReplacedBeforeSymbol); 1613 $.removeData(this, DataKey); 1614 }); 1615 1616 // block 被åªé¤å復å tab éè¯ç block 1617 $(this._element).on(Event.BlockDestroy, { blktabs: this }, function (event) { 1618 $(this).addClass(DestroyBeforeSymbol); 1619 event.data.blktabs.resetTabStatus(); 1620 }); 1621 1622 // block tabs click äºä»¶ 1623 $(BtnSel, this._tabs).on('click', { blktabs: this }, function (event) { 1624 var element = $(event.target).is('li') ? $(ValSel, event.target).get(0) : event.target; 1625 if ($(element).attr('href').startsWith('#')) { 1626 event.preventDefault(); 1627 event.data.blktabs.tabClick(element); 1628 win.dispatchEvent(new CustomEvent(Event.Click.Window, { 1629 target: element, 1630 detail: { 1631 selector: $(element).attr('href') 1632 } 1633 })); 1634 } 1635 }); 1636 1637 this.tabAppear().resetMyStatus(); 1638 1639 var bookmarkId = window.location.href.split('#').pop(); 1640 if (this._element.id == bookmarkId) { 1641 // é¨é»è·³è½ 1642 var blk = this; 1643 window.addEventListener("load", function (event) { 1644 1645 var arrParentAndButton = function (blkId) { 1646 var tab = $(BlockSel + ' [href^="#' + blkId + '"]'); 1647 var pblk = tab.closest(BlockSel); 1648 if (pblk.length > 0 && pblk.attr('id')) { 1649 // è¨é&å°æ¾ 1650 var r = arrParentAndButton(pblk.attr('id')); 1651 r.push([pblk, tab]); 1652 return r; 1653 } 1654 return []; 1655 }; 1656 var arr = arrParentAndButton(blk._element.id); 1657 for (var i in arr) 1658 arr[i][0].data(DataKey).tabClick(arr[i][1].get(0)); 1659 1660 setTimeout(function () { 1661 $("html, body").animate({ 1662 scrollTop: $(blk._element).offset().top 1663 }, 500, 'swing', function () { });
1664 }, 0.5 * 1000); 1665 }); 1666 } 1667 } 1668 1669 var _proto = BlockTabs.prototype; 1670 1671 _proto.tabAppear = function tabAppear() { 1672 if ($(BtnSel, this._tabs).length > 0) 1673 $(this._tabs).removeClass('d-none hide'); 1674 return this; 1675 } 1676 1677 1678 // åå¾ block tabs ææéè¯ç block target 1679 _proto.getTabSelector = function getTabSelector() { 1680 return $(BtnSel + ValSel, this._tabs).map(function (i, o) { 1681 return $(o).attr('href'); 1682 }).get().join(','); 1683 } 1684 1685 // é© åææéè¯ç block target å·è¡ resetMyStatus 1686 _proto.resetTabStatus = function resetTabStatus(event) { 1687 $(this.getTabSelector()).each(function () { 1688 if ($(this).data(DataKey)) 1689 $(this).data(DataKey).resetMyStatus(); 1690 }); 1691 return this; 1692 } 1693 1694 // å䏿ª¢æ¥ Block æ¬èº«éä¸éè¦é¡¯ç¤º, ä¸¦é© åææéè¯ç block target å·è¡ resetMyStatus 1695 _proto.resetMyStatus = function resetMyStatus() { 1696 var sel1 = BlockSel + ':visible:not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 1697 // sel1 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, è䏿¯é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 1698 sel2 = BlockSel + ':not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 1699 // sel2 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, ä¸ç®¡æ¯å¦é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 1700 sel3 = BlockSel + '.' + DestroyBeforeSymbol + ' [href$="' + this._element.id + '"]'; 1701 // sel3 æ¯æé£äºæåå³å°è¢«åªé¤ç this._element æ¬èº«ç blkTab li > a 1702 1703 if ($(sel1).hasClass(Options.focus) || $(sel2).length < 1 || $(sel3).length > 0) { 1704 // 顯示 element 1705 this._element.style.setProperty('display', ''); 1706 1707 // é»æç¬¬ä¸å tab æè é¡¯ç¤ºåæ¬å·²ç¶è¢«é»æç tab 1708 let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs); 1709 if ($tabLink.length < 1) 1710 $tabLink = $(BtnSel + ValSel, this._tabs); 1711 this.tabClick($tabLink.get(0)); 1712 $(this._element).trigger(Event.BlockAppear); 1713 } 1714 else { 1715 // é±è element 1716 this._element.style.setProperty('display', 'none', 'important'); 1717 $(this._element).trigger(Event.BlockHidden); 1718 } 1719 1720 return this.resetTabStatus(); 1721 } 1722 1723 // 黿 block tabs 1724 _proto.tabClick = function tabClick(currentBtn, closure) { 1725 1726 // 黿å·è¡å §å®¹ 1727 if ($.contains(this._element, currentBtn)) { 1728 1729 // tab åæå 1730 $(this._element).trigger(Event.Click.Before, [currentBtn]); 1731 1732 $(BtnSel + ValSel, this._tabs).removeClass(Options.focus); 1733 $(currentBtn).addClass(Options.focus); 1734 1735 this.resetTabStatus(); 1736 1737 // tab åæå¾ 1738 $(this._element).trigger(Event.Click.After, [currentBtn]); 1739 1740 if (typeof (closure) === "function") 1741 closure(); 1742 } 1743 1744 return this; 1745 } 1746 1747 if (typeof $.fn.blockTab !== 'function') { 1748 1749 $.fn.extend({ 1750 blockTab: function (options) { 1751 this.filter(function (i, o) { 1752 return !$(o).data(DataKey) || $(o).data(DataKey)._element != o; 1753 }).each(function (event) { 1754 $(this).data(DataKey, new BlockTabs(this, options)); 1755 }); 1756 } 1757 }); 1758 } 1759 1760 $(function () { 1761 $(BlockSel).blockTab(); 1762 }); 1763 1764}(jQuery, window);; })(jQuery);/* compress error:[385]let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs);*/ 1765;(function($) {var _proto = String.prototype; 1766 1767if (typeof _proto.regxMatch !== 'function') { 1768 _proto.regxMatch = function regxMatch() { 1769 var content = (arguments.length > 1) ? arguments[1] : arguments[0] || "", 1770 regxStr = (typeof this === "string" || this instanceof String) ? this
1770: ""; 1771 return (content.match(new RegExp(regxStr, "g")) || []).map(function (x) { 1772 return x.trim(); 1773 }).join(' '); 1774 } 1775}/** 1776 * å·²ç¶æ¹è®äºæ´å scrollPosStyler çå §æ ¸ï¼è«å¿è¦è 1777 * ======================================================================== */ 1778 1779/** 1780 * @license 1781 * ======================================================================== 1782 * ScrollPos-Styler v0.7.1 1783 * https://github.com/acch/scrollpos-styler 1784 * ======================================================================== 1785 * Copyright 2015 Achim Christ 1786 * Licensed under MIT (https://github.com/acch/scrollpos-styler/blob/master/LICENSE) 1787 * ======================================================================== */ 1788 1789// JSHint directives 1790/* exported ScrollPosStyler */ 1791if (typeof window.ScrollOverSelfStyler === "undefined") { 1792 var ScrollOverSelfStyler = (function (document, window, $) { 1793 "use strict"; 1794 1795 /* ==================== 1796 * private variables 1797 * ==================== */ 1798 var scrollPosY = 0, 1799 busy = false, 1800 1801 // toggle style / class when scrolling below this position (in px) 1802 scrollOffsetY = 1, 1803 1804 // class used to apply scrollPosStyler to 1805 spsClass = "soss", 1806 1807 // choose elements to apply style / class to 1808 elements = document.getElementsByClassName(spsClass), 1809 1810 // style / class to apply to elements when above scroll position 1811 classAbove = "soss--abv", 1812 1813 // style / class to apply to elements when below scroll position 1814 classBelow = "soss--blw", 1815 1816 // tag to set custom scroll offset per element 1817 offsetTag = "data-soss-offset"; 1818 1819 1820 var BlockSel = '.block-item', 1821 ShadowKey = "ScrollOverSelfStyler"; 1822 1823 /* ==================== 1824 * private function to check scroll position 1825 * ==================== */ 1826 function onScroll() { 1827 1828 // ensure that events don't stack 1829 if (!busy) { 1830 1831 // find elements to update 1832 var elementsToUpdate = getElementsToUpdate(false); 1833 if (elementsToUpdate.length > 0) { 1834 1835 // suspend accepting scroll events 1836 busy = true; 1837 1838 // asynchronuously update elements 1839 window.requestAnimationFrame(function () { 1840 updateElements(elementsToUpdate); 1841 }); 1842 } 1843 } 1844 } 1845 1846 /* ==================== 1847 * copy Element Shadow 1848 * ==================== */ 1849 function copyElementShadow(init) { 1850 for (var i = 0; elements[i]; ++i) { 1851 var element = elements[i]; 1852 if (!$(element).data(ShadowKey)) { 1853 $(element).data(ShadowKey, $('<div>').insertBefore(element)); 1854 } 1855 } 1856 } 1857 1858 /* ==================== 1859 * private function to find elements to update 1860 * ==================== */ 1861 function getElementsToUpdate(init) { 1862 var elementsToUpdate = []; 1863 copyElementShadow(init); 1864 1865 // get current scroll position from window 1866 scrollPosY = window.pageYOffset; 1867 1868 // iterate over elements 1869 // for (var elem of elements) { 1870 for (var i = 0; elements[i]; ++i) { // chrome workaround 1871 var element = elements[i], 1872 $shadow = $(element).data(ShadowKey); 1873 1874 // get offset from element, default to global option 1875 var offsetTop = parseInt(element.getAttribute(offsetTag), 10); 1876 var elScrollOffsetY = isNaN(offsetTop) ? scrollOffsetY : offsetTop, 1877 shScrollOffsetY = $shadow.offset().top; 1878 1879 // check current state of element 1880 var elOnTop = element.classList.contains(classAbove); 1881 1882 // check current is visible 1883 var elVisible = $(element).closest(BlockSel).is(':visible'); 1884 1885 // cols regx 1886 var regxMatchCol = "col-([lg-|md-]*)([0-9]+\\s|[0-9]+$)".regxMatch($(element).closest(BlockSel).attr('class')); 1887 1888 // if we were above, and are now below scroll position...
1889 if (elVisible && (init || elOnTop) && scrollPosY > (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 1890 1891 element.style.top = offsetTop + "px"; 1892 $shadow.css('height', $(element).css('height')); 1893 1894 // remember element 1895 elementsToUpdate.push({ 1896 element: element, 1897 addClass: classBelow + " " + regxMatchCol, 1898 removeClass: classAbove 1899 }); 1900 1901 // if we were below, and are now above scroll position... 1902 } else if (!elVisible || (init || !elOnTop) && scrollPosY <= (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 1903 1904 1905 // remember element 1906 elementsToUpdate.push({ 1907 element: element, 1908 addClass: classAbove, 1909 removeClass: classBelow + " " + regxMatchCol 1910 }); 1911 1912 $shadow.get(0).style.height = null; 1913 element.style.top = null; 1914 } 1915 } 1916 1917 return elementsToUpdate; 1918 } 1919 1920 /* ==================== 1921 * private function to update elements 1922 * ==================== */ 1923 function updateElements(elementsToUpdate) { 1924 1925 // iterate over elements 1926 // for (var elem of elements) { 1927 for (var i = 0; elementsToUpdate[i]; ++i) { // chrome workaround 1928 var map = elementsToUpdate[i]; 1929 1930 // add style / class to element 1931 //map.element.classList.add(map.addClass); 1932 //map.element.classList.remove(map.removeClass); 1933 $(map.element).addClass(map.addClass); 1934 $(map.element).removeClass(map.removeClass); 1935 } 1936 1937 // resume accepting scroll events 1938 busy = false; 1939 } 1940 1941 /* ==================== 1942 * public function to initially style elements based on scroll position 1943 * 1944 * options: 1945 * scrollOffsetY (number): default scroll position in px to trigger the style. Default is 1. 1946 * spsClass (string): classname used to determine which elements to style. Default is 'sps'. 1947 * classAbove (string): classname added to the elements when the window is scrolled above the defined position. Default is 'sps--abv'. 1948 * classBelow (string): classname added to the elements when the window is scrolled below the defined position. Default is 'sps--blw'. 1949 * offsetTag (string): HTML tag used on the element to specify a scrollOffsetY other than the default. 1950 * 1951 * ==================== */ 1952 var pub = { 1953 init: function (options) { 1954 1955 // suspend accepting scroll events 1956 busy = true; 1957 1958 // merge options object with global options 1959 if (options) { 1960 if (options.spsClass) { 1961 spsClass = options.spsClass; 1962 elements = document.getElementsByClassName(spsClass); 1963 } 1964 scrollOffsetY = options.scrollOffsetY || scrollOffsetY; 1965 classAbove = options.classAbove || classAbove; 1966 classBelow = options.classBelow || classBelow; 1967 offsetTag = options.offsetTag || offsetTag; 1968 } 1969 1970 // ensure all elements have classAbove 1971 var elementsToUpdate = getElementsToUpdate(true); 1972 if (elementsToUpdate.length > 0) { 1973 1974 // asynchronuously update elements 1975 window.requestAnimationFrame(function () { 1976 updateElements(elementsToUpdate); 1977 }); 1978 } else { 1979 1980 // resume accepting scroll events 1981 busy = false; 1982 } 1983 } 1984 }; 1985 1986 // register for window scroll events 1987 $(window).on("scroll", onScroll); 1988 1989 window.ScrollOverSelfStyler = pub; 1990 1991 return pub; 1992 })(document, window, jQuery); 1993} 1994 1995/* ==================== 1996 * main initialization 1997 * ==================== */ 1998$(function () { 1999 // defer initialization to allow browser to restore scroll position 2000 window.setTimeout(window.ScrollOverSelfStyler.init, 1); 2001});if (typeof jQuery === 'undefined') { 2002 throw new Error('Block\'s JavaScript requires jQuery') 2003} 2004 2005+function ($) { 2006 'use strict'; 2007 var version = $.fn.jquery.split(' ')[0].split('.') 2008 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 2009 throw new Error('Block\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') 2010 } 2011}(jQuery); 2012 2013 2014+function ($, win) { 2015 'use strict'; 2016 2017 var DataKey = 'blktabs', 2018 BlockSel = '.block-item', 2019 TabSel = '> .module-container .blk-tabs > ul', 2020 BtnSel = '> li', 2021 ValSel = ' > a[href^="#blk"]', 2022 ReplacedBeforeSymbol = 'replacedBeforeSymbol', 2023 DestroyBeforeSymbol = 'destroyBeforeSymbol', 2024 Event = { 2025 ReplacedBefore: 'renderview.replace.before', 2026 ReplacedAfter: 'renderview.replace.after', 2027 BlockDestroy: 'destroy', 2028 BlockAppear: DataKey + '.block.appear', 2029 BlockHidden: DataKey + '.block.hidden', 2030 Click: { 2031 Window: 'blk-nav-in', 2032 Before: DataKey + '.tabs.click.before', 2033 After: DataKey + '.tabs.click.after' 2034 } 2035 }, 2036 Options = { 2037 focus: 'active' 2038 }; 2039 2040 function BlockTabs(element, opts) { 2041 2042 var self = this; 2043 this._opts = $.extend(Options, $(element).data(), opts); 2044 this._element = element; 2045 this._tabs = $(TabSel, element).get(0); 2046 2047 // block æ´æ°å±¬æ§å¼ä¹å¾å°æè¢«ç½®æ 2048 // å¨éä¹åå¿ é å æè¢« tabs 鏿å°ç block éå顯示 2049 // event.renderview.replace.before äºä»¶å¯ä»¥åè page-item-render-view.js 2050 $(this._element).on(Event.ReplacedBefore, { blktabs: this }, function (event) { 2051 $(this).addClass(ReplacedBeforeSymbol); 2052 event.data.blktabs.resetTabStatus();
2053 $(this).removeClass(ReplacedBeforeSymbol); 2054 $.removeData(this, DataKey); 2055 }); 2056 2057 // block 被åªé¤å復å tab éè¯ç block 2058 $(this._element).on(Event.BlockDestroy, { blktabs: this }, function (event) { 2059 $(this).addClass(DestroyBeforeSymbol); 2060 event.data.blktabs.resetTabStatus(); 2061 }); 2062 2063 // block tabs click äºä»¶ 2064 $(BtnSel, this._tabs).on('click', { blktabs: this }, function (event) { 2065 var element = $(event.target).is('li') ? $(ValSel, event.target).get(0) : event.target; 2066 if ($(element).attr('href').startsWith('#')) { 2067 event.preventDefault(); 2068 event.data.blktabs.tabClick(element); 2069 win.dispatchEvent(new CustomEvent(Event.Click.Window, { 2070 target: element, 2071 detail: { 2072 selector: $(element).attr('href') 2073 } 2074 })); 2075 } 2076 }); 2077 2078 this.tabAppear().resetMyStatus(); 2079 2080 var bookmarkId = window.location.href.split('#').pop(); 2081 if (this._element.id == bookmarkId) { 2082 // é¨é»è·³è½ 2083 var blk = this; 2084 window.addEventListener("load", function (event) { 2085 2086 var arrParentAndButton = function (blkId) { 2087 var tab = $(BlockSel + ' [href^="#' + blkId + '"]'); 2088 var pblk = tab.closest(BlockSel); 2089 if (pblk.length > 0 && pblk.attr('id')) { 2090 // è¨é&å°æ¾ 2091 var r = arrParentAndButton(pblk.attr('id')); 2092 r.push([pblk, tab]); 2093 return r; 2094 } 2095 return []; 2096 }; 2097 var arr = arrParentAndButton(blk._element.id); 2098 for (var i in arr) 2099 arr[i][0].data(DataKey).tabClick(arr[i][1].get(0)); 2100 2101 setTimeout(function () { 2102 $("html, body").animate({ 2103 scrollTop: $(blk._element).offset().top 2104 }, 500, 'swing', function () { });
2105 }, 0.5 * 1000); 2106 }); 2107 } 2108 } 2109 2110 var _proto = BlockTabs.prototype; 2111 2112 _proto.tabAppear = function tabAppear() { 2113 if ($(BtnSel, this._tabs).length > 0) 2114 $(this._tabs).removeClass('d-none hide'); 2115 return this; 2116 } 2117 2118 2119 // åå¾ block tabs ææéè¯ç block target 2120 _proto.getTabSelector = function getTabSelector() { 2121 return $(BtnSel + ValSel, this._tabs).map(function (i, o) { 2122 return $(o).attr('href'); 2123 }).get().join(','); 2124 } 2125 2126 // é© åææéè¯ç block target å·è¡ resetMyStatus 2127 _proto.resetTabStatus = function resetTabStatus(event) { 2128 $(this.getTabSelector()).each(function () { 2129 if ($(this).data(DataKey)) 2130 $(this).data(DataKey).resetMyStatus(); 2131 }); 2132 return this; 2133 } 2134 2135 // å䏿ª¢æ¥ Block æ¬èº«éä¸éè¦é¡¯ç¤º, ä¸¦é© åææéè¯ç block target å·è¡ resetMyStatus 2136 _proto.resetMyStatus = function resetMyStatus() { 2137 var sel1 = BlockSel + ':visible:not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 2138 // sel1 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, è䏿¯é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 2139 sel2 = BlockSel + ':not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 2140 // sel2 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, ä¸ç®¡æ¯å¦é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 2141 sel3 = BlockSel + '.' + DestroyBeforeSymbol + ' [href$="' + this._element.id + '"]'; 2142 // sel3 æ¯æé£äºæåå³å°è¢«åªé¤ç this._element æ¬èº«ç blkTab li > a 2143 2144 if ($(sel1).hasClass(Options.focus) || $(sel2).length < 1 || $(sel3).length > 0) { 2145 // 顯示 element 2146 this._element.style.setProperty('display', ''); 2147 2148 // é»æç¬¬ä¸å tab æè é¡¯ç¤ºåæ¬å·²ç¶è¢«é»æç tab 2149 let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs); 2150 if ($tabLink.length < 1) 2151 $tabLink = $(BtnSel + ValSel, this._tabs); 2152 this.tabClick($tabLink.get(0)); 2153 $(this._element).trigger(Event.BlockAppear); 2154 } 2155 else { 2156 // é±è element 2157 this._element.style.setProperty('display', 'none', 'important'); 2158 $(this._element).trigger(Event.BlockHidden); 2159 } 2160 2161 return this.resetTabStatus(); 2162 } 2163 2164 // 黿 block tabs 2165 _proto.tabClick = function tabClick(currentBtn, closure) { 2166 2167 // 黿å·è¡å §å®¹ 2168 if ($.contains(this._element, currentBtn)) { 2169 2170 // tab åæå 2171 $(this._element).trigger(Event.Click.Before, [currentBtn]); 2172 2173 $(BtnSel + ValSel, this._tabs).removeClass(Options.focus); 2174 $(currentBtn).addClass(Options.focus); 2175 2176 this.resetTabStatus(); 2177 2178 // tab åæå¾ 2179 $(this._element).trigger(Event.Click.After, [currentBtn]); 2180 2181 if (typeof (closure) === "function") 2182 closure(); 2183 } 2184 2185 return this; 2186 } 2187 2188 if (typeof $.fn.blockTab !== 'function') { 2189 2190 $.fn.extend({ 2191 blockTab: function (options) { 2192 this.filter(function (i, o) { 2193 return !$(o).data(DataKey) || $(o).data(DataKey)._element != o; 2194 }).each(function (event) { 2195 $(this).data(DataKey, new BlockTabs(this, options)); 2196 }); 2197 } 2198 }); 2199 } 2200 2201 $(function () { 2202 $(BlockSel).blockTab(); 2203 }); 2204 2205}(jQuery, window);; })(jQuery);/* compress error:[385]let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs);*/ 2206;(function($) {var _proto = String.prototype; 2207 2208if (typeof _proto.regxMatch !== 'function') { 2209 _proto.regxMatch = function regxMatch() { 2210 var content = (arguments.length > 1) ? arguments[1] : arguments[0] || "", 2211 regxStr = (typeof this === "string" || this instanceof String) ? this
2211: ""; 2212 return (content.match(new RegExp(regxStr, "g")) || []).map(function (x) { 2213 return x.trim(); 2214 }).join(' '); 2215 } 2216}/** 2217 * å·²ç¶æ¹è®äºæ´å scrollPosStyler çå §æ ¸ï¼è«å¿è¦è 2218 * ======================================================================== */ 2219 2220/** 2221 * @license 2222 * ======================================================================== 2223 * ScrollPos-Styler v0.7.1 2224 * https://github.com/acch/scrollpos-styler 2225 * ======================================================================== 2226 * Copyright 2015 Achim Christ 2227 * Licensed under MIT (https://github.com/acch/scrollpos-styler/blob/master/LICENSE) 2228 * ======================================================================== */ 2229 2230// JSHint directives 2231/* exported ScrollPosStyler */ 2232if (typeof window.ScrollOverSelfStyler === "undefined") { 2233 var ScrollOverSelfStyler = (function (document, window, $) { 2234 "use strict"; 2235 2236 /* ==================== 2237 * private variables 2238 * ==================== */ 2239 var scrollPosY = 0, 2240 busy = false, 2241 2242 // toggle style / class when scrolling below this position (in px) 2243 scrollOffsetY = 1, 2244 2245 // class used to apply scrollPosStyler to 2246 spsClass = "soss", 2247 2248 // choose elements to apply style / class to 2249 elements = document.getElementsByClassName(spsClass), 2250 2251 // style / class to apply to elements when above scroll position 2252 classAbove = "soss--abv", 2253 2254 // style / class to apply to elements when below scroll position 2255 classBelow = "soss--blw", 2256 2257 // tag to set custom scroll offset per element 2258 offsetTag = "data-soss-offset"; 2259 2260 2261 var BlockSel = '.block-item', 2262 ShadowKey = "ScrollOverSelfStyler"; 2263 2264 /* ==================== 2265 * private function to check scroll position 2266 * ==================== */ 2267 function onScroll() { 2268 2269 // ensure that events don't stack 2270 if (!busy) { 2271 2272 // find elements to update 2273 var elementsToUpdate = getElementsToUpdate(false); 2274 if (elementsToUpdate.length > 0) { 2275 2276 // suspend accepting scroll events 2277 busy = true; 2278 2279 // asynchronuously update elements 2280 window.requestAnimationFrame(function () { 2281 updateElements(elementsToUpdate); 2282 }); 2283 } 2284 } 2285 } 2286 2287 /* ==================== 2288 * copy Element Shadow 2289 * ==================== */ 2290 function copyElementShadow(init) { 2291 for (var i = 0; elements[i]; ++i) { 2292 var element = elements[i]; 2293 if (!$(element).data(ShadowKey)) { 2294 $(element).data(ShadowKey, $('<div>').insertBefore(element)); 2295 } 2296 } 2297 } 2298 2299 /* ==================== 2300 * private function to find elements to update 2301 * ==================== */ 2302 function getElementsToUpdate(init) { 2303 var elementsToUpdate = []; 2304 copyElementShadow(init); 2305 2306 // get current scroll position from window 2307 scrollPosY = window.pageYOffset; 2308 2309 // iterate over elements 2310 // for (var elem of elements) { 2311 for (var i = 0; elements[i]; ++i) { // chrome workaround 2312 var element = elements[i], 2313 $shadow = $(element).data(ShadowKey); 2314 2315 // get offset from element, default to global option 2316 var offsetTop = parseInt(element.getAttribute(offsetTag), 10); 2317 var elScrollOffsetY = isNaN(offsetTop) ? scrollOffsetY : offsetTop, 2318 shScrollOffsetY = $shadow.offset().top; 2319 2320 // check current state of element 2321 var elOnTop = element.classList.contains(classAbove); 2322 2323 // check current is visible 2324 var elVisible = $(element).closest(BlockSel).is(':visible'); 2325 2326 // cols regx 2327 var regxMatchCol = "col-([lg-|md-]*)([0-9]+\\s|[0-9]+$)".regxMatch($(element).closest(BlockSel).attr('class')); 2328 2329 // if we were above, and are now below scroll position...
2330 if (elVisible && (init || elOnTop) && scrollPosY > (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 2331 2332 element.style.top = offsetTop + "px"; 2333 $shadow.css('height', $(element).css('height')); 2334 2335 // remember element 2336 elementsToUpdate.push({ 2337 element: element, 2338 addClass: classBelow + " " + regxMatchCol, 2339 removeClass: classAbove 2340 }); 2341 2342 // if we were below, and are now above scroll position... 2343 } else if (!elVisible || (init || !elOnTop) && scrollPosY <= (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 2344 2345 2346 // remember element 2347 elementsToUpdate.push({ 2348 element: element, 2349 addClass: classAbove, 2350 removeClass: classBelow + " " + regxMatchCol 2351 }); 2352 2353 $shadow.get(0).style.height = null; 2354 element.style.top = null; 2355 } 2356 } 2357 2358 return elementsToUpdate; 2359 } 2360 2361 /* ==================== 2362 * private function to update elements 2363 * ==================== */ 2364 function updateElements(elementsToUpdate) { 2365 2366 // iterate over elements 2367 // for (var elem of elements) { 2368 for (var i = 0; elementsToUpdate[i]; ++i) { // chrome workaround 2369 var map = elementsToUpdate[i]; 2370 2371 // add style / class to element 2372 //map.element.classList.add(map.addClass); 2373 //map.element.classList.remove(map.removeClass); 2374 $(map.element).addClass(map.addClass); 2375 $(map.element).removeClass(map.removeClass); 2376 } 2377 2378 // resume accepting scroll events 2379 busy = false; 2380 } 2381 2382 /* ==================== 2383 * public function to initially style elements based on scroll position 2384 * 2385 * options: 2386 * scrollOffsetY (number): default scroll position in px to trigger the style. Default is 1. 2387 * spsClass (string): classname used to determine which elements to style. Default is 'sps'. 2388 * classAbove (string): classname added to the elements when the window is scrolled above the defined position. Default is 'sps--abv'. 2389 * classBelow (string): classname added to the elements when the window is scrolled below the defined position. Default is 'sps--blw'. 2390 * offsetTag (string): HTML tag used on the element to specify a scrollOffsetY other than the default. 2391 * 2392 * ==================== */ 2393 var pub = { 2394 init: function (options) { 2395 2396 // suspend accepting scroll events 2397 busy = true; 2398 2399 // merge options object with global options 2400 if (options) { 2401 if (options.spsClass) { 2402 spsClass = options.spsClass; 2403 elements = document.getElementsByClassName(spsClass); 2404 } 2405 scrollOffsetY = options.scrollOffsetY || scrollOffsetY; 2406 classAbove = options.classAbove || classAbove; 2407 classBelow = options.classBelow || classBelow; 2408 offsetTag = options.offsetTag || offsetTag; 2409 } 2410 2411 // ensure all elements have classAbove 2412 var elementsToUpdate = getElementsToUpdate(true); 2413 if (elementsToUpdate.length > 0) { 2414 2415 // asynchronuously update elements 2416 window.requestAnimationFrame(function () { 2417 updateElements(elementsToUpdate); 2418 }); 2419 } else { 2420 2421 // resume accepting scroll events 2422 busy = false; 2423 } 2424 } 2425 }; 2426 2427 // register for window scroll events 2428 $(window).on("scroll", onScroll); 2429 2430 window.ScrollOverSelfStyler = pub; 2431 2432 return pub; 2433 })(document, window, jQuery); 2434} 2435 2436/* ==================== 2437 * main initialization 2438 * ==================== */ 2439$(function () { 2440 // defer initialization to allow browser to restore scroll position 2441 window.setTimeout(window.ScrollOverSelfStyler.init, 1); 2442});if (typeof jQuery === 'undefined') { 2443 throw new Error('Block\'s JavaScript requires jQuery') 2444} 2445 2446+function ($) { 2447 'use strict'; 2448 var version = $.fn.jquery.split(' ')[0].split('.') 2449 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 2450 throw new Error('Block\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') 2451 } 2452}(jQuery); 2453 2454 2455+function ($, win) { 2456 'use strict'; 2457 2458 var DataKey = 'blktabs', 2459 BlockSel = '.block-item', 2460 TabSel = '> .module-container .blk-tabs > ul', 2461 BtnSel = '> li', 2462 ValSel = ' > a[href^="#blk"]', 2463 ReplacedBeforeSymbol = 'replacedBeforeSymbol', 2464 DestroyBeforeSymbol = 'destroyBeforeSymbol', 2465 Event = { 2466 ReplacedBefore: 'renderview.replace.before', 2467 ReplacedAfter: 'renderview.replace.after', 2468 BlockDestroy: 'destroy', 2469 BlockAppear: DataKey + '.block.appear', 2470 BlockHidden: DataKey + '.block.hidden', 2471 Click: { 2472 Window: 'blk-nav-in', 2473 Before: DataKey + '.tabs.click.before', 2474 After: DataKey + '.tabs.click.after' 2475 } 2476 }, 2477 Options = { 2478 focus: 'active' 2479 }; 2480 2481 function BlockTabs(element, opts) { 2482 2483 var self = this; 2484 this._opts = $.extend(Options, $(element).data(), opts); 2485 this._element = element; 2486 this._tabs = $(TabSel, element).get(0); 2487 2488 // block æ´æ°å±¬æ§å¼ä¹å¾å°æè¢«ç½®æ 2489 // å¨éä¹åå¿ é å æè¢« tabs 鏿å°ç block éå顯示 2490 // event.renderview.replace.before äºä»¶å¯ä»¥åè page-item-render-view.js 2491 $(this._element).on(Event.ReplacedBefore, { blktabs: this }, function (event) { 2492 $(this).addClass(ReplacedBeforeSymbol); 2493 event.data.blktabs.resetTabStatus();
2494 $(this).removeClass(ReplacedBeforeSymbol); 2495 $.removeData(this, DataKey); 2496 }); 2497 2498 // block 被åªé¤å復å tab éè¯ç block 2499 $(this._element).on(Event.BlockDestroy, { blktabs: this }, function (event) { 2500 $(this).addClass(DestroyBeforeSymbol); 2501 event.data.blktabs.resetTabStatus(); 2502 }); 2503 2504 // block tabs click äºä»¶ 2505 $(BtnSel, this._tabs).on('click', { blktabs: this }, function (event) { 2506 var element = $(event.target).is('li') ? $(ValSel, event.target).get(0) : event.target; 2507 if ($(element).attr('href').startsWith('#')) { 2508 event.preventDefault(); 2509 event.data.blktabs.tabClick(element); 2510 win.dispatchEvent(new CustomEvent(Event.Click.Window, { 2511 target: element, 2512 detail: { 2513 selector: $(element).attr('href') 2514 } 2515 })); 2516 } 2517 }); 2518 2519 this.tabAppear().resetMyStatus(); 2520 2521 var bookmarkId = window.location.href.split('#').pop(); 2522 if (this._element.id == bookmarkId) { 2523 // é¨é»è·³è½ 2524 var blk = this; 2525 window.addEventListener("load", function (event) { 2526 2527 var arrParentAndButton = function (blkId) { 2528 var tab = $(BlockSel + ' [href^="#' + blkId + '"]'); 2529 var pblk = tab.closest(BlockSel); 2530 if (pblk.length > 0 && pblk.attr('id')) { 2531 // è¨é&å°æ¾ 2532 var r = arrParentAndButton(pblk.attr('id')); 2533 r.push([pblk, tab]); 2534 return r; 2535 } 2536 return []; 2537 }; 2538 var arr = arrParentAndButton(blk._element.id); 2539 for (var i in arr) 2540 arr[i][0].data(DataKey).tabClick(arr[i][1].get(0)); 2541 2542 setTimeout(function () { 2543 $("html, body").animate({ 2544 scrollTop: $(blk._element).offset().top 2545 }, 500, 'swing', function () { });
2546 }, 0.5 * 1000); 2547 }); 2548 } 2549 } 2550 2551 var _proto = BlockTabs.prototype; 2552 2553 _proto.tabAppear = function tabAppear() { 2554 if ($(BtnSel, this._tabs).length > 0) 2555 $(this._tabs).removeClass('d-none hide'); 2556 return this; 2557 } 2558 2559 2560 // åå¾ block tabs ææéè¯ç block target 2561 _proto.getTabSelector = function getTabSelector() { 2562 return $(BtnSel + ValSel, this._tabs).map(function (i, o) { 2563 return $(o).attr('href'); 2564 }).get().join(','); 2565 } 2566 2567 // é© åææéè¯ç block target å·è¡ resetMyStatus 2568 _proto.resetTabStatus = function resetTabStatus(event) { 2569 $(this.getTabSelector()).each(function () { 2570 if ($(this).data(DataKey)) 2571 $(this).data(DataKey).resetMyStatus(); 2572 }); 2573 return this; 2574 } 2575 2576 // å䏿ª¢æ¥ Block æ¬èº«éä¸éè¦é¡¯ç¤º, ä¸¦é© åææéè¯ç block target å·è¡ resetMyStatus 2577 _proto.resetMyStatus = function resetMyStatus() { 2578 var sel1 = BlockSel + ':visible:not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 2579 // sel1 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, è䏿¯é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 2580 sel2 = BlockSel + ':not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 2581 // sel2 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, ä¸ç®¡æ¯å¦é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 2582 sel3 = BlockSel + '.' + DestroyBeforeSymbol + ' [href$="' + this._element.id + '"]'; 2583 // sel3 æ¯æé£äºæåå³å°è¢«åªé¤ç this._element æ¬èº«ç blkTab li > a 2584 2585 if ($(sel1).hasClass(Options.focus) || $(sel2).length < 1 || $(sel3).length > 0) { 2586 // 顯示 element 2587 this._element.style.setProperty('display', ''); 2588 2589 // é»æç¬¬ä¸å tab æè é¡¯ç¤ºåæ¬å·²ç¶è¢«é»æç tab 2590 let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs); 2591 if ($tabLink.length < 1) 2592 $tabLink = $(BtnSel + ValSel, this._tabs); 2593 this.tabClick($tabLink.get(0)); 2594 $(this._element).trigger(Event.BlockAppear); 2595 } 2596 else { 2597 // é±è element 2598 this._element.style.setProperty('display', 'none', 'important'); 2599 $(this._element).trigger(Event.BlockHidden); 2600 } 2601 2602 return this.resetTabStatus(); 2603 } 2604 2605 // 黿 block tabs 2606 _proto.tabClick = function tabClick(currentBtn, closure) { 2607 2608 // 黿å·è¡å §å®¹ 2609 if ($.contains(this._element, currentBtn)) { 2610 2611 // tab åæå 2612 $(this._element).trigger(Event.Click.Before, [currentBtn]); 2613 2614 $(BtnSel + ValSel, this._tabs).removeClass(Options.focus); 2615 $(currentBtn).addClass(Options.focus); 2616 2617 this.resetTabStatus(); 2618 2619 // tab åæå¾ 2620 $(this._element).trigger(Event.Click.After, [currentBtn]); 2621 2622 if (typeof (closure) === "function") 2623 closure(); 2624 } 2625 2626 return this; 2627 } 2628 2629 if (typeof $.fn.blockTab !== 'function') { 2630 2631 $.fn.extend({ 2632 blockTab: function (options) { 2633 this.filter(function (i, o) { 2634 return !$(o).data(DataKey) || $(o).data(DataKey)._element != o; 2635 }).each(function (event) { 2636 $(this).data(DataKey, new BlockTabs(this, options)); 2637 }); 2638 } 2639 }); 2640 } 2641 2642 $(function () { 2643 $(BlockSel).blockTab(); 2644 }); 2645 2646}(jQuery, window);; })(jQuery);/* compress error:[385]let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs);*/ 2647;(function($) {var _proto = String.prototype; 2648 2649if (typeof _proto.regxMatch !== 'function') { 2650 _proto.regxMatch = function regxMatch() { 2651 var content = (arguments.length > 1) ? arguments[1] : arguments[0] || "", 2652 regxStr = (typeof this === "string" || this instanceof String) ? this
2652: ""; 2653 return (content.match(new RegExp(regxStr, "g")) || []).map(function (x) { 2654 return x.trim(); 2655 }).join(' '); 2656 } 2657}/** 2658 * å·²ç¶æ¹è®äºæ´å scrollPosStyler çå §æ ¸ï¼è«å¿è¦è 2659 * ======================================================================== */ 2660 2661/** 2662 * @license 2663 * ======================================================================== 2664 * ScrollPos-Styler v0.7.1 2665 * https://github.com/acch/scrollpos-styler 2666 * ======================================================================== 2667 * Copyright 2015 Achim Christ 2668 * Licensed under MIT (https://github.com/acch/scrollpos-styler/blob/master/LICENSE) 2669 * ======================================================================== */ 2670 2671// JSHint directives 2672/* exported ScrollPosStyler */ 2673if (typeof window.ScrollOverSelfStyler === "undefined") { 2674 var ScrollOverSelfStyler = (function (document, window, $) { 2675 "use strict"; 2676 2677 /* ==================== 2678 * private variables 2679 * ==================== */ 2680 var scrollPosY = 0, 2681 busy = false, 2682 2683 // toggle style / class when scrolling below this position (in px) 2684 scrollOffsetY = 1, 2685 2686 // class used to apply scrollPosStyler to 2687 spsClass = "soss", 2688 2689 // choose elements to apply style / class to 2690 elements = document.getElementsByClassName(spsClass), 2691 2692 // style / class to apply to elements when above scroll position 2693 classAbove = "soss--abv", 2694 2695 // style / class to apply to elements when below scroll position 2696 classBelow = "soss--blw", 2697 2698 // tag to set custom scroll offset per element 2699 offsetTag = "data-soss-offset"; 2700 2701 2702 var BlockSel = '.block-item', 2703 ShadowKey = "ScrollOverSelfStyler"; 2704 2705 /* ==================== 2706 * private function to check scroll position 2707 * ==================== */ 2708 function onScroll() { 2709 2710 // ensure that events don't stack 2711 if (!busy) { 2712 2713 // find elements to update 2714 var elementsToUpdate = getElementsToUpdate(false); 2715 if (elementsToUpdate.length > 0) { 2716 2717 // suspend accepting scroll events 2718 busy = true; 2719 2720 // asynchronuously update elements 2721 window.requestAnimationFrame(function () { 2722 updateElements(elementsToUpdate); 2723 }); 2724 } 2725 } 2726 } 2727 2728 /* ==================== 2729 * copy Element Shadow 2730 * ==================== */ 2731 function copyElementShadow(init) { 2732 for (var i = 0; elements[i]; ++i) { 2733 var element = elements[i]; 2734 if (!$(element).data(ShadowKey)) { 2735 $(element).data(ShadowKey, $('<div>').insertBefore(element)); 2736 } 2737 } 2738 } 2739 2740 /* ==================== 2741 * private function to find elements to update 2742 * ==================== */ 2743 function getElementsToUpdate(init) { 2744 var elementsToUpdate = []; 2745 copyElementShadow(init); 2746 2747 // get current scroll position from window 2748 scrollPosY = window.pageYOffset; 2749 2750 // iterate over elements 2751 // for (var elem of elements) { 2752 for (var i = 0; elements[i]; ++i) { // chrome workaround 2753 var element = elements[i], 2754 $shadow = $(element).data(ShadowKey); 2755 2756 // get offset from element, default to global option 2757 var offsetTop = parseInt(element.getAttribute(offsetTag), 10); 2758 var elScrollOffsetY = isNaN(offsetTop) ? scrollOffsetY : offsetTop, 2759 shScrollOffsetY = $shadow.offset().top; 2760 2761 // check current state of element 2762 var elOnTop = element.classList.contains(classAbove); 2763 2764 // check current is visible 2765 var elVisible = $(element).closest(BlockSel).is(':visible'); 2766 2767 // cols regx 2768 var regxMatchCol = "col-([lg-|md-]*)([0-9]+\\s|[0-9]+$)".regxMatch($(element).closest(BlockSel).attr('class')); 2769 2770 // if we were above, and are now below scroll position...
2771 if (elVisible && (init || elOnTop) && scrollPosY > (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 2772 2773 element.style.top = offsetTop + "px"; 2774 $shadow.css('height', $(element).css('height')); 2775 2776 // remember element 2777 elementsToUpdate.push({ 2778 element: element, 2779 addClass: classBelow + " " + regxMatchCol, 2780 removeClass: classAbove 2781 }); 2782 2783 // if we were below, and are now above scroll position... 2784 } else if (!elVisible || (init || !elOnTop) && scrollPosY <= (shScrollOffsetY - parseInt(elScrollOffsetY, 10))) { 2785 2786 2787 // remember element 2788 elementsToUpdate.push({ 2789 element: element, 2790 addClass: classAbove, 2791 removeClass: classBelow + " " + regxMatchCol 2792 }); 2793 2794 $shadow.get(0).style.height = null; 2795 element.style.top = null; 2796 } 2797 } 2798 2799 return elementsToUpdate; 2800 } 2801 2802 /* ==================== 2803 * private function to update elements 2804 * ==================== */ 2805 function updateElements(elementsToUpdate) { 2806 2807 // iterate over elements 2808 // for (var elem of elements) { 2809 for (var i = 0; elementsToUpdate[i]; ++i) { // chrome workaround 2810 var map = elementsToUpdate[i]; 2811 2812 // add style / class to element 2813 //map.element.classList.add(map.addClass); 2814 //map.element.classList.remove(map.removeClass); 2815 $(map.element).addClass(map.addClass); 2816 $(map.element).removeClass(map.removeClass); 2817 } 2818 2819 // resume accepting scroll events 2820 busy = false; 2821 } 2822 2823 /* ==================== 2824 * public function to initially style elements based on scroll position 2825 * 2826 * options: 2827 * scrollOffsetY (number): default scroll position in px to trigger the style. Default is 1. 2828 * spsClass (string): classname used to determine which elements to style. Default is 'sps'. 2829 * classAbove (string): classname added to the elements when the window is scrolled above the defined position. Default is 'sps--abv'. 2830 * classBelow (string): classname added to the elements when the window is scrolled below the defined position. Default is 'sps--blw'. 2831 * offsetTag (string): HTML tag used on the element to specify a scrollOffsetY other than the default. 2832 * 2833 * ==================== */ 2834 var pub = { 2835 init: function (options) { 2836 2837 // suspend accepting scroll events 2838 busy = true; 2839 2840 // merge options object with global options 2841 if (options) { 2842 if (options.spsClass) { 2843 spsClass = options.spsClass; 2844 elements = document.getElementsByClassName(spsClass); 2845 } 2846 scrollOffsetY = options.scrollOffsetY || scrollOffsetY; 2847 classAbove = options.classAbove || classAbove; 2848 classBelow = options.classBelow || classBelow; 2849 offsetTag = options.offsetTag || offsetTag; 2850 } 2851 2852 // ensure all elements have classAbove 2853 var elementsToUpdate = getElementsToUpdate(true); 2854 if (elementsToUpdate.length > 0) { 2855 2856 // asynchronuously update elements 2857 window.requestAnimationFrame(function () { 2858 updateElements(elementsToUpdate); 2859 }); 2860 } else { 2861 2862 // resume accepting scroll events 2863 busy = false; 2864 } 2865 } 2866 }; 2867 2868 // register for window scroll events 2869 $(window).on("scroll", onScroll); 2870 2871 window.ScrollOverSelfStyler = pub; 2872 2873 return pub; 2874 })(document, window, jQuery); 2875} 2876 2877/* ==================== 2878 * main initialization 2879 * ==================== */ 2880$(function () { 2881 // defer initialization to allow browser to restore scroll position 2882 window.setTimeout(window.ScrollOverSelfStyler.init, 1); 2883});if (typeof jQuery === 'undefined') { 2884 throw new Error('Block\'s JavaScript requires jQuery') 2885} 2886 2887+function ($) { 2888 'use strict'; 2889 var version = $.fn.jquery.split(' ')[0].split('.') 2890 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 2891 throw new Error('Block\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') 2892 } 2893}(jQuery); 2894 2895 2896+function ($, win) { 2897 'use strict'; 2898 2899 var DataKey = 'blktabs', 2900 BlockSel = '.block-item', 2901 TabSel = '> .module-container .blk-tabs > ul', 2902 BtnSel = '> li', 2903 ValSel = ' > a[href^="#blk"]', 2904 ReplacedBeforeSymbol = 'replacedBeforeSymbol', 2905 DestroyBeforeSymbol = 'destroyBeforeSymbol', 2906 Event = { 2907 ReplacedBefore: 'renderview.replace.before', 2908 ReplacedAfter: 'renderview.replace.after', 2909 BlockDestroy: 'destroy', 2910 BlockAppear: DataKey + '.block.appear', 2911 BlockHidden: DataKey + '.block.hidden', 2912 Click: { 2913 Window: 'blk-nav-in', 2914 Before: DataKey + '.tabs.click.before', 2915 After: DataKey + '.tabs.click.after' 2916 } 2917 }, 2918 Options = { 2919 focus: 'active' 2920 }; 2921 2922 function BlockTabs(element, opts) { 2923 2924 var self = this; 2925 this._opts = $.extend(Options, $(element).data(), opts); 2926 this._element = element; 2927 this._tabs = $(TabSel, element).get(0); 2928 2929 // block æ´æ°å±¬æ§å¼ä¹å¾å°æè¢«ç½®æ 2930 // å¨éä¹åå¿ é å æè¢« tabs 鏿å°ç block éå顯示 2931 // event.renderview.replace.before äºä»¶å¯ä»¥åè page-item-render-view.js 2932 $(this._element).on(Event.ReplacedBefore, { blktabs: this }, function (event) { 2933 $(this).addClass(ReplacedBeforeSymbol); 2934 event.data.blktabs.resetTabStatus();
2935 $(this).removeClass(ReplacedBeforeSymbol); 2936 $.removeData(this, DataKey); 2937 }); 2938 2939 // block 被åªé¤å復å tab éè¯ç block 2940 $(this._element).on(Event.BlockDestroy, { blktabs: this }, function (event) { 2941 $(this).addClass(DestroyBeforeSymbol); 2942 event.data.blktabs.resetTabStatus(); 2943 }); 2944 2945 // block tabs click äºä»¶ 2946 $(BtnSel, this._tabs).on('click', { blktabs: this }, function (event) { 2947 var element = $(event.target).is('li') ? $(ValSel, event.target).get(0) : event.target; 2948 if ($(element).attr('href').startsWith('#')) { 2949 event.preventDefault(); 2950 event.data.blktabs.tabClick(element); 2951 win.dispatchEvent(new CustomEvent(Event.Click.Window, { 2952 target: element, 2953 detail: { 2954 selector: $(element).attr('href') 2955 } 2956 })); 2957 } 2958 }); 2959 2960 this.tabAppear().resetMyStatus(); 2961 2962 var bookmarkId = window.location.href.split('#').pop(); 2963 if (this._element.id == bookmarkId) { 2964 // é¨é»è·³è½ 2965 var blk = this; 2966 window.addEventListener("load", function (event) { 2967 2968 var arrParentAndButton = function (blkId) { 2969 var tab = $(BlockSel + ' [href^="#' + blkId + '"]'); 2970 var pblk = tab.closest(BlockSel); 2971 if (pblk.length > 0 && pblk.attr('id')) { 2972 // è¨é&å°æ¾ 2973 var r = arrParentAndButton(pblk.attr('id')); 2974 r.push([pblk, tab]); 2975 return r; 2976 } 2977 return []; 2978 }; 2979 var arr = arrParentAndButton(blk._element.id); 2980 for (var i in arr) 2981 arr[i][0].data(DataKey).tabClick(arr[i][1].get(0)); 2982 2983 setTimeout(function () { 2984 $("html, body").animate({ 2985 scrollTop: $(blk._element).offset().top 2986 }, 500, 'swing', function () { });
2987 }, 0.5 * 1000); 2988 }); 2989 } 2990 } 2991 2992 var _proto = BlockTabs.prototype; 2993 2994 _proto.tabAppear = function tabAppear() { 2995 if ($(BtnSel, this._tabs).length > 0) 2996 $(this._tabs).removeClass('d-none hide'); 2997 return this; 2998 } 2999 3000 3001 // åå¾ block tabs ææéè¯ç block target 3002 _proto.getTabSelector = function getTabSelector() { 3003 return $(BtnSel + ValSel, this._tabs).map(function (i, o) { 3004 return $(o).attr('href'); 3005 }).get().join(','); 3006 } 3007 3008 // é© åææéè¯ç block target å·è¡ resetMyStatus 3009 _proto.resetTabStatus = function resetTabStatus(event) { 3010 $(this.getTabSelector()).each(function () { 3011 if ($(this).data(DataKey)) 3012 $(this).data(DataKey).resetMyStatus(); 3013 }); 3014 return this; 3015 } 3016 3017 // å䏿ª¢æ¥ Block æ¬èº«éä¸éè¦é¡¯ç¤º, ä¸¦é© åææéè¯ç block target å·è¡ resetMyStatus 3018 _proto.resetMyStatus = function resetMyStatus() { 3019 var sel1 = BlockSel + ':visible:not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 3020 // sel1 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, è䏿¯é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 3021 sel2 = BlockSel + ':not(.' + ReplacedBeforeSymbol + ') [href$="' + this._element.id + '"]', 3022 // sel2 æ¯æé£äºæå this._element(éReplacedBeforeSymbol) æ¬èº«, ä¸ç®¡æ¯å¦é¡¯ç¤ºå¨ç«é¢ç blkTab li > a 3023 sel3 = BlockSel + '.' + DestroyBeforeSymbol + ' [href$="' + this._element.id + '"]'; 3024 // sel3 æ¯æé£äºæåå³å°è¢«åªé¤ç this._element æ¬èº«ç blkTab li > a 3025 3026 if ($(sel1).hasClass(Options.focus) || $(sel2).length < 1 || $(sel3).length > 0) { 3027 // 顯示 element 3028 this._element.style.setProperty('display', ''); 3029 3030 // é»æç¬¬ä¸å tab æè é¡¯ç¤ºåæ¬å·²ç¶è¢«é»æç tab 3031 let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs); 3032 if ($tabLink.length < 1) 3033 $tabLink = $(BtnSel + ValSel, this._tabs); 3034 this.tabClick($tabLink.get(0)); 3035 $(this._element).trigger(Event.BlockAppear); 3036 } 3037 else { 3038 // é±è element 3039 this._element.style.setProperty('display', 'none', 'important'); 3040 $(this._element).trigger(Event.BlockHidden); 3041 } 3042 3043 return this.resetTabStatus(); 3044 } 3045 3046 // 黿 block tabs 3047 _proto.tabClick = function tabClick(currentBtn, closure) { 3048 3049 // 黿å·è¡å §å®¹ 3050 if ($.contains(this._element, currentBtn)) { 3051 3052 // tab åæå 3053 $(this._element).trigger(Event.Click.Before, [currentBtn]); 3054 3055 $(BtnSel + ValSel, this._tabs).removeClass(Options.focus); 3056 $(currentBtn).addClass(Options.focus); 3057 3058 this.resetTabStatus(); 3059 3060 // tab åæå¾ 3061 $(this._element).trigger(Event.Click.After, [currentBtn]); 3062 3063 if (typeof (closure) === "function") 3064 closure(); 3065 } 3066 3067 return this; 3068 } 3069 3070 if (typeof $.fn.blockTab !== 'function') { 3071 3072 $.fn.extend({ 3073 blockTab: function (options) { 3074 this.filter(function (i, o) { 3075 return !$(o).data(DataKey) || $(o).data(DataKey)._element != o; 3076 }).each(function (event) { 3077 $(this).data(DataKey, new BlockTabs(this, options)); 3078 }); 3079 } 3080 }); 3081 } 3082 3083 $(function () { 3084 $(BlockSel).blockTab(); 3085 }); 3086 3087}(jQuery, window);; })(jQuery);/* compress error:[385]let $tabLink = $(BtnSel + ValSel + '.' + Options.focus, this._tabs);*/ 3088/* MODULE d0435c91-6b4a-44c2-8210-77336a6f6d9d, Version: 1.4.4 */ 3089;(function($) {var CHARSET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); 3090 3091// NB: does not validate input 3092function encode(int) { 3093 if (int === 0) { 3094 return CHARSET[0]; 3095 } 3096 3097 var res = ""; 3098 while (int > 0) { 3099 res = CHARSET[int % 62] + res; 3100 int = Math.floor(int / 62); 3101 } 3102 return res; 3103}; 3104 3105function decode(str) { 3106 var res = 0, 3107 length = str.length, 3108 i, char; 3109 for (i = 0; i < length; i++) { 3110 char = str.charCodeAt(i); 3111 if (char < 58) { // 0-9 3112 char = char - 48; 3113 } else if (char < 91) { // A-Z 3114 char = char - 29; 3115 } else { // a-z 3116 char = char - 87; 3117 } 3118 res += char * Math.pow(62, length - i - 1); 3119 } 3120 return res; 3121}; 3122 3123function base62() { 3124 var id; //base62 3125 do { 3126 id = encode(Math.floor(Math.random() * Math.pow(1000, 4) + 1)); 3127 } while (id.match(/^[0-9]/i) !== null); 3128 return id; 3129}(function($) { 3130 $(function() { 3131 // æ¯ä¸æ¯è¡åè£ç½® 3132 var isMobile = false; 3133 if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 3134 isMobile = true; 3135 } 3136 3137 $('[data-unicode="mdu_Q6t8oZsA0qJ3bFN6EWoLA"]').each (function () { 3138 $sel = $(this); 3139 var $id = base62(); 3140 $sel.attr('id',$id); 3141
3142 var $navbarHoverBg = $sel.data('navbarHoverBg'); 3143 var $navbarHoverColor = $sel.data('navbarHoverColor'); 3144 var $dropdownHover = $sel.data('dropdownHover'); 3145 $sel.find('[data-toggle="collapse"]').attr('data-target','#collapse_'+$id); 3146 $sel.find('#navbarSupportedContent').attr('id','collapse_'+$id); 3147 3148 $sel.prepend('<style type="text/css">'+ 3149 '@media (any-hover: hover){'+ 3150 '#'+$id+' .header-part .navbar-nav li a:hover {color:'+$navbarHoverColor+' !important;} '+ 3151 '#'+$id+' .header-part .navbar-nav li a:hover {background-color:'+$navbarHoverBg+' !important;} '+ 3152 '#'+$id+' .header-part .dropdown.show a:hover {background-color:'+$dropdownHover+' !important;}'+ 3153 '}'+ 3154 '#'+$id+' .header-part .dropdown.show {color:'+$navbarHoverColor+' !important;} '+ 3155 '#'+$id+' .header-part .dropdown.show {background-color:'+$navbarHoverBg+' !important;} '+ 3156 '#'+$id+' .dropdown-toggle::after{display: none;}'+ 3157 '</style>'); 3158 3159 function onthescroll() { 3160 var $sel = $(this); 3161 var scroll = $(window).scrollTop(); 3162 $sel.children('nav').each(function () { 3163 var $nav = $(this); 3164 if(Math.round(scroll) == 0) { 3165 $nav.css('max-width', '') 3166 $nav.parent().css('min-height', '') 3167 $nav.removeClass('fixed-top').removeClass('m-auto'); 3168 } 3169 else if(Math.round(scroll) > Math.round($nav.offset().top)) { 3170 $nav.parent().css('min-height', $nav.height() + "px") 3171 $nav.css('max-width', $nav.outerWidth() + "px") 3172 $nav.addClass('fixed-top m-auto'); 3173 } 3174 }); 3175 } 3176 3177 $(window).scroll(onthescroll.bind(this)); 3178 3179 if (isMobile){ 3180 $sel.find('li.dropdown a').each(function(){ 3181 var $hyperlink = $(this); 3182 $hyperlink.append('<div class="mobileTriggerButton"></div>'); 3183 }); 3184 } 3185 3186 $('.mobileTriggerButton').on('click',function(){ 3187 $mobTriBtn = $(this); 3188 var $dorpMenu = $mobTriBtn.closest('.nav-item').find('.dropdown-menu'); 3189 console.log('hihihi') 3190 console.log($dorpMenu) 3191 console.log($dorpMenu.is(':hidden')) 3192 if ($dorpMenu.is(':hidden')){ 3193 $dorpMenu.show(); 3194 }else{ 3195 $dorpMenu.hide(); 3196 } 3197 }); 3198 //$sel.find('li.dropdown a').click(function(){ 3199 // var $hyperlink = $(this); 3200 // // é»è ¦çæ¬(æ»é¼ ç§»é廿å±é) || æ²æåé ç® || å±éçæ => è·³è½ 3201 // if (!isMobile || !$hyperlink.siblings('.dropdown-menu').lengtn || $hyperlink.siblings('.dropdown-menu.show').lengtn) 3202 // $('<a />').attr('target',$('#test').attr('target')).attr('href',$('#test').attr('href'))[0].click() 3203 //}) 3204 }); 3205 }); 3206})(jQuery);; })(jQuery);/* compress error:[4]function encode(int) {*/ 3207 3208/* MODULE 2efbc2f9-9f72-4e00-97ef-13398ef7c6f5, Version: 1.1.11 */ 3209;(function($) {var CHARSET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); 3210 3211// NB: does not validate input 3212function encode(int) { 3213 if (int === 0) { 3214 return CHARSET[0]; 3215 } 3216 3217 var res = ""; 3218 while (int > 0) { 3219 res = CHARSET[int % 62] + res; 3220 int = Math.floor(int / 62); 3221 } 3222 return res; 3223}; 3224 3225function decode(str) { 3226 var res = 0, 3227 length = str.length, 3228 i, char; 3229 for (i = 0; i < length; i++) { 3230 char = str.charCodeAt(i); 3231 if (char < 58) { // 0-9 3232 char = char - 48; 3233 } else if (char < 91) { // A-Z 3234 char = char - 29; 3235 } else { // a-z 3236 char = char - 87; 3237 } 3238 res += char * Math.pow(62, length - i - 1); 3239 } 3240 return res; 3241}; 3242 3243function base62() { 3244 var id; //base62 3245 do { 3246 id = encode(Math.floor(Math.random() * Math.pow(1000, 4) + 1)); 3247 } while (id.match(/^[0-9]/i) !== null); 3248 return id; 3249}/*! 3250 * jQuery1113 JavaScript Library v1.11.3 3251 * http://jQuery1113.com/ 3252 * 3253 * Includes Sizzle.js 3254 * http://sizzlejs.com/ 3255 * 3256 * Copyright 2005, 2014 jQuery1113 Foundation, Inc. and other contributors 3257 * Released under the MIT license 3258 * http://jQuery1113.org/license 3259 * 3260 * Date: 2015-04-28T16:19Z 3261 */ 3262 3263(function( global, factory ) { 3264 3265 if ( typeof module === "object" && typeof module.exports === "object" ) { 3266 // For CommonJS and CommonJS-like environments where a proper window is present, 3267 // execute the factory and get jQuery1113 3268 // For environments that do not inherently posses a window with a document 3269 // (such as Node.js), expose a jQuery1113-making factory as module.exports 3270 // This accentuates the need for the creation of a real window 3271 // e.g. var jQuery1113 = require("jQuery1113")(window); 3272 // See ticket #14549 for more info 3273 module.exports = global.document ? 3274 factory( global, true ) : 3275 function( w ) { 3276 if ( !w.document ) { 3277 throw new Error( "jQuery1113 requires a window with a document" ); 3278 } 3279 return factory( w ); 3280 }; 3281 } else { 3282 factory( global ); 3283 } 3284 3285// Pass this if window is not defined yet 3286}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 3287 3288// Can't do this because several apps including ASP.NET trace 3289// the stack via arguments.caller.callee and Firefox dies if 3290// you try to trace through "use strict" call chains. (#13335) 3291// Support: Firefox 18+ 3292// 3293 3294var deletedIds = []; 3295 3296var slice = deletedIds.slice; 3297 3298var concat = deletedIds.concat; 3299 3300var push = deletedIds.push; 3301 3302var indexOf = deletedIds.indexOf; 3303 3304var class2type = {}; 3305 3306var toString = class2type.toString; 3307 3308var hasOwn = class2type.hasOwnProperty; 3309 3310var support = {}; 3311 3312 3313 3314var 3315 version = "1.11.3", 3316 3317 // Define a local copy of jQuery1113 3318 jQuery1113 = function( selector, context ) { 3319 // The jQuery1113 object is actually just the init constructor 'enhanced' 3320 // Need init if jQuery1113 is called (just allow error to be thrown if not included) 3321 return new jQuery1113.fn.init( selector, context ); 3322 }, 3323 3324 // Support: Android<4.1, IE<9 3325 // Make sure we trim BOM and NBSP 3326 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 3327 3328 // Matches dashed string for camelizing 3329 rmsPrefix = /^-ms-/, 3330 rdashAlpha = /-([\da-z])/gi, 3331 3332 // Used by jQuery1113.camelCase as callback to replace() 3333 fcamelCase = function( all, letter ) { 3334 return letter.toUpperCase(); 3335 }; 3336 3337jQuery1113.fn = jQuery1113.prototype = { 3338 // The current version of jQuery1113 being used 3339 jQuery1113: version, 3340 3341 constructor: jQuery1113, 3342 3343 // Start with an empty selector 3344 selector: "", 3345 3346 // The default length of a jQuery1113 object is 0 3347 length: 0, 3348 3349 toArray: function() { 3350 return slice.call( this ); 3351 }, 3352 3353 // Get the Nth element in the matched element set OR 3354 // Get the whole matched element set as a clean array 3355 get: function( num ) { 3356 return num != null ? 3357 3358 // Return just the one element from the set 3359 ( num < 0 ? this[ num + this.length ] : this[ num ] ) : 3360 3361 // Return all the elements in a clean array 3362 slice.call( this ); 3363 }, 3364 3365 // Take an array of elements and push it onto the stack 3366 // (returning the new matched element set) 3367 pushStack: function( elems ) { 3368 3369 // Build a new jQuery1113 matched element set 3370 var ret = jQuery1113.merge( this.constructor(), elems ); 3371 3372 // Add the old object onto the stack (as a reference)
vendor: 9,364 bytes, lines 3373-3753
3373 ret.prevObject = this; 3374 ret.context = this.context; 3375 3376 // Return the newly-formed element set 3377 return ret; 3378 }, 3379 3380 // Execute a callback for every element in the matched set. 3381 // (You can seed the arguments with an array of args, but this is 3382 // only used internally.) 3383 each: function( callback, args ) { 3384 return jQuery1113.each( this, callback, args ); 3385 }, 3386 3387 map: function( callback ) { 3388 return this.pushStack( jQuery1113.map(this, function( elem, i ) { 3389 return callback.call( elem, i, elem ); 3390 })); 3391 }, 3392 3393 slice: function() { 3394 return this.pushStack( slice.apply( this, arguments ) ); 3395 }, 3396 3397 first: function() { 3398 return this.eq( 0 ); 3399 }, 3400 3401 last: function() { 3402 return this.eq( -1 ); 3403 }, 3404 3405 eq: function( i ) { 3406 var len = this.length, 3407 j = +i + ( i < 0 ? len : 0 ); 3408 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); 3409 }, 3410 3411 end: function() { 3412 return this.prevObject || this.constructor(null); 3413 }, 3414 3415 // For internal use only. 3416 // Behaves like an Array's method, not like a jQuery1113 method. 3417 push: push, 3418 sort: deletedIds.sort, 3419 splice: deletedIds.splice 3420}; 3421 3422jQuery1113.extend = jQuery1113.fn.extend = function() { 3423 var src, copyIsArray, copy, name, options, clone, 3424 target = arguments[0] || {}, 3425 i = 1, 3426 length = arguments.length, 3427 deep = false; 3428 3429 // Handle a deep copy situation 3430 if ( typeof target === "boolean" ) { 3431 deep = target; 3432 3433 // skip the boolean and the target 3434 target = arguments[ i ] || {}; 3435 i++; 3436 } 3437 3438 // Handle case when target is a string or something (possible in deep copy) 3439 if ( typeof target !== "object" && !jQuery1113.isFunction(target) ) { 3440 target = {}; 3441 } 3442 3443 // extend jQuery1113 itself if only one argument is passed 3444 if ( i === length ) { 3445 target = this; 3446 i--; 3447 } 3448 3449 for ( ; i < length; i++ ) { 3450 // Only deal with non-null/undefined values 3451 if ( (options = arguments[ i ]) != null ) { 3452 // Extend the base object 3453 for ( name in options ) { 3454 src = target[ name ]; 3455 copy = options[ name ]; 3456 3457 // Prevent never-ending loop 3458 if ( target === copy ) { 3459 continue; 3460 } 3461 3462 // Recurse if we're merging plain objects or arrays 3463 if ( deep && copy && ( jQuery1113.isPlainObject(copy) || (copyIsArray = jQuery1113.isArray(copy)) ) ) { 3464 if ( copyIsArray ) { 3465 copyIsArray = false; 3466 clone = src && jQuery1113.isArray(src) ? src : []; 3467 3468 } else { 3469 clone = src && jQuery1113.isPlainObject(src) ? src : {}; 3470 } 3471 3472 // Never move original objects, clone them 3473 target[ name ] = jQuery1113.extend( deep, clone, copy ); 3474 3475 // Don't bring in undefined values 3476 } else if ( copy !== undefined ) { 3477 target[ name ] = copy; 3478 } 3479 } 3480 } 3481 } 3482 3483 // Return the modified object 3484 return target; 3485}; 3486 3487jQuery1113.extend({ 3488 // Unique for each copy of jQuery1113 on the page 3489 expando: "jQuery1113" + ( version + Math.random() ).replace( /\D/g, "" ), 3490 3491 // Assume jQuery1113 is ready without the ready module 3492 isReady: true, 3493 3494 error: function( msg ) { 3495 throw new Error( msg ); 3496 }, 3497 3498 noop: function() {}, 3499 3500 // See test/unit/core.js for details concerning isFunction. 3501 // Since version 1.3, DOM methods and functions like alert 3502 // aren't supported. They return false on IE (#2968). 3503 isFunction: function( obj ) { 3504 return jQuery1113.type(obj) === "function"; 3505 }, 3506 3507 isArray: Array.isArray || function( obj ) { 3508 return jQuery1113.type(obj) === "array"; 3509 }, 3510 3511 isWindow: function( obj ) { 3512 /* jshint eqeqeq: false */ 3513 return obj != null && obj == obj.window; 3514 }, 3515 3516 isNumeric: function( obj ) { 3517 // parseFloat NaNs numeric-cast false positives (null|true|false|"") 3518 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 3519 // subtraction forces infinities to NaN 3520 // adding 1 corrects loss of precision from parseFloat (#15100) 3521 return !jQuery1113.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; 3522 }, 3523 3524 isEmptyObject: function( obj ) { 3525 var name; 3526 for ( name in obj ) { 3527 return false; 3528 } 3529 return true; 3530 }, 3531 3532 isPlainObject: function( obj ) { 3533 var key; 3534 3535 // Must be an Object. 3536 // Because of IE, we also have to check the presence of the constructor property. 3537 // Make sure that DOM nodes and window objects don't pass through, as well 3538 if ( !obj || jQuery1113.type(obj) !== "object" || obj.nodeType || jQuery1113.isWindow( obj ) ) { 3539 return false; 3540 } 3541 3542 try { 3543 // Not own constructor property must be Object 3544 if ( obj.constructor && 3545 !hasOwn.call(obj, "constructor") && 3546 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { 3547 return false; 3548 } 3549 } catch ( e ) { 3550 // IE8,9 Will throw exceptions on certain host objects #9897 3551 return false; 3552 } 3553 3554 // Support: IE<9 3555 // Handle iteration over inherited properties before own properties. 3556 if ( support.ownLast ) { 3557 for ( key in obj ) { 3558 return hasOwn.call( obj, key ); 3559 } 3560 } 3561 3562 // Own properties are enumerated firstly, so to speed up, 3563 // if last one is own, then all properties are own. 3564 for ( key in obj ) {} 3565 3566 return key === undefined || hasOwn.call( obj, key ); 3567 }, 3568 3569 type: function( obj ) { 3570 if ( obj == null ) { 3571 return obj + ""; 3572 } 3573 return typeof obj === "object" || typeof obj === "function" ? 3574 class2type[ toString.call(obj) ] || "object" : 3575 typeof obj; 3576 }, 3577 3578 // Evaluates a script in a global context 3579 // Workarounds based on findings by Jim Driscoll 3580 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context 3581 globalEval: function( data ) { 3582 if ( data && jQuery1113.trim( data ) ) { 3583 // We use execScript on Internet Explorer 3584 // We use an anonymous function so that context is window 3585 // rather than jQuery1113 in Firefox 3586 ( window.execScript || function( data ) { 3587 window[ "eval" ].call( window, data ); 3588 } )( data ); 3589 } 3590 }, 3591 3592 // Convert dashed to camelCase; used by the css and data modules 3593 // Microsoft forgot to hump their vendor prefix (#9572) 3594 camelCase: function( string ) { 3595 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 3596 }, 3597 3598 nodeName: function( elem, name ) { 3599 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 3600 }, 3601 3602 // args is for internal usage only 3603 each: function( obj, callback, args ) { 3604 var value, 3605 i = 0, 3606 length = obj.length, 3607 isArray = isArraylike( obj ); 3608 3609 if ( args ) { 3610 if ( isArray ) { 3611 for ( ; i < length; i++ ) { 3612 value = callback.apply( obj[ i ], args ); 3613 3614 if ( value === false ) { 3615 break; 3616 } 3617 } 3618 } else { 3619 for ( i in obj ) { 3620 value = callback.apply( obj[ i ], args ); 3621 3622 if ( value === false ) { 3623 break; 3624 } 3625 } 3626 } 3627 3628 // A special, fast, case for the most common use of each 3629 } else { 3630 if ( isArray ) { 3631 for ( ; i < length; i++ ) { 3632 value = callback.call( obj[ i ], i, obj[ i ] ); 3633 3634 if ( value === false ) { 3635 break; 3636 } 3637 } 3638 } else { 3639 for ( i in obj ) { 3640 value = callback.call( obj[ i ], i, obj[ i ] ); 3641 3642 if ( value === false ) { 3643 break; 3644 } 3645 } 3646 } 3647 } 3648 3649 return obj; 3650 }, 3651 3652 // Support: Android<4.1, IE<9 3653 trim: function( text ) { 3654 return text == null ? 3655 "" : 3656 ( text + "" ).replace( rtrim, "" ); 3657 }, 3658 3659 // results is for internal usage only 3660 makeArray: function( arr, results ) { 3661 var ret = results || []; 3662 3663 if ( arr != null ) { 3664 if ( isArraylike( Object(arr) ) ) { 3665 jQuery1113.merge( ret, 3666 typeof arr === "string" ? 3667 [ arr ] : arr 3668 ); 3669 } else { 3670 push.call( ret, arr ); 3671 } 3672 } 3673 3674 return ret; 3675 }, 3676 3677 inArray: function( elem, arr, i ) { 3678 var len; 3679 3680 if ( arr ) { 3681 if ( indexOf ) { 3682 return indexOf.call( arr, elem, i ); 3683 } 3684 3685 len = arr.length; 3686 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; 3687 3688 for ( ; i < len; i++ ) { 3689 // Skip accessing in sparse arrays 3690 if ( i in arr && arr[ i ] === elem ) { 3691 return i; 3692 } 3693 } 3694 } 3695 3696 return -1; 3697 }, 3698 3699 merge: function( first, second ) { 3700 var len = +second.length, 3701 j = 0, 3702 i = first.length; 3703 3704 while ( j < len ) { 3705 first[ i++ ] = second[ j++ ]; 3706 } 3707 3708 // Support: IE<9 3709 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) 3710 if ( len !== len ) { 3711 while ( second[j] !== undefined ) { 3712 first[ i++ ] = second[ j++ ]; 3713 } 3714 } 3715 3716 first.length = i; 3717 3718 return first; 3719 }, 3720 3721 grep: function( elems, callback, invert ) { 3722 var callbackInverse, 3723 matches = [], 3724 i = 0, 3725 length = elems.length, 3726 callbackExpect = !invert; 3727 3728 // Go through the array, only saving the items 3729 // that pass the validator function 3730 for ( ; i < length; i++ ) { 3731 callbackInverse = !callback( elems[ i ], i ); 3732 if ( callbackInverse !== callbackExpect ) { 3733 matches.push( elems[ i ] ); 3734 } 3735 } 3736 3737 return matches; 3738 }, 3739 3740 // arg is for internal usage only 3741 map: function( elems, callback, arg ) { 3742 var value, 3743 i = 0, 3744 length = elems.length, 3745 isArray = isArraylike( elems ), 3746 ret = []; 3747 3748 // Go through the array, translating each of the items to their new values 3749 if ( isArray ) { 3750 for ( ; i < length; i++ ) { 3751 value = callback( elems[ i ], i, arg ); 3752 3753 if ( value != null ) {
vendor: 27,588 bytes, lines 3754-4679
3754 ret.push( value ); 3755 } 3756 } 3757 3758 // Go through every key on the object, 3759 } else { 3760 for ( i in elems ) { 3761 value = callback( elems[ i ], i, arg ); 3762 3763 if ( value != null ) { 3764 ret.push( value ); 3765 } 3766 } 3767 } 3768 3769 // Flatten any nested arrays 3770 return concat.apply( [], ret ); 3771 }, 3772 3773 // A global GUID counter for objects 3774 guid: 1, 3775 3776 // Bind a function to a context, optionally partially applying any 3777 // arguments. 3778 proxy: function( fn, context ) { 3779 var args, proxy, tmp; 3780 3781 if ( typeof context === "string" ) { 3782 tmp = fn[ context ]; 3783 context = fn; 3784 fn = tmp; 3785 } 3786 3787 // Quick check to determine if target is callable, in the spec 3788 // this throws a TypeError, but we will just return undefined. 3789 if ( !jQuery1113.isFunction( fn ) ) { 3790 return undefined; 3791 } 3792 3793 // Simulated bind 3794 args = slice.call( arguments, 2 ); 3795 proxy = function() { 3796 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 3797 }; 3798 3799 // Set the guid of unique handler to the same of original handler, so it can be removed 3800 proxy.guid = fn.guid = fn.guid || jQuery1113.guid++; 3801 3802 return proxy; 3803 }, 3804 3805 now: function() { 3806 return +( new Date() ); 3807 }, 3808 3809 // jQuery1113.support is not used in Core but other projects attach their 3810 // properties to it so it needs to exist. 3811 support: support 3812}); 3813 3814// Populate the class2type map 3815jQuery1113.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { 3816 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 3817}); 3818 3819function isArraylike( obj ) { 3820 3821 // Support: iOS 8.2 (not reproducible in simulator) 3822 // `in` check used to prevent JIT error (gh-2145) 3823 // hasOwn isn't used here due to false negatives 3824 // regarding Nodelist length in IE 3825 var length = "length" in obj && obj.length, 3826 type = jQuery1113.type( obj ); 3827 3828 if ( type === "function" || jQuery1113.isWindow( obj ) ) { 3829 return false; 3830 } 3831 3832 if ( obj.nodeType === 1 && length ) { 3833 return true; 3834 } 3835 3836 return type === "array" || length === 0 || 3837 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 3838} 3839var Sizzle = 3840/*! 3841 * Sizzle CSS Selector Engine v2.2.0-pre 3842 * http://sizzlejs.com/ 3843 * 3844 * Copyright 2008, 2014 jQuery1113 Foundation, Inc. and other contributors 3845 * Released under the MIT license 3846 * http://jQuery1113.org/license 3847 * 3848 * Date: 2014-12-16 3849 */ 3850(function( window ) { 3851 3852var i, 3853 support, 3854 Expr, 3855 getText, 3856 isXML, 3857 tokenize, 3858 compile, 3859 select, 3860 outermostContext, 3861 sortInput, 3862 hasDuplicate, 3863 3864 // Local document vars 3865 setDocument, 3866 document, 3867 docElem, 3868 documentIsHTML, 3869 rbuggyQSA, 3870 rbuggyMatches, 3871 matches, 3872 contains, 3873 3874 // Instance-specific data 3875 expando = "sizzle" + 1 * new Date(), 3876 preferredDoc = window.document, 3877 dirruns = 0, 3878 done = 0, 3879 classCache = createCache(), 3880 tokenCache = createCache(), 3881 compilerCache = createCache(), 3882 sortOrder = function( a, b ) { 3883 if ( a === b ) { 3884 hasDuplicate = true; 3885 } 3886 return 0; 3887 }, 3888 3889 // General-purpose constants 3890 MAX_NEGATIVE = 1 << 31, 3891 3892 // Instance methods 3893 hasOwn = ({}).hasOwnProperty, 3894 arr = [], 3895 pop = arr.pop, 3896 push_native = arr.push, 3897 push = arr.push, 3898 slice = arr.slice, 3899 // Use a stripped-down indexOf as it's faster than native 3900 // http://jsperf.com/thor-indexof-vs-for/5 3901 indexOf = function( list, elem ) { 3902 var i = 0, 3903 len = list.length; 3904 for ( ; i < len; i++ ) { 3905 if ( list[i] === elem ) { 3906 return i; 3907 } 3908 } 3909 return -1; 3910 }, 3911 3912 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 3913 3914 // Regular expressions 3915 3916 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace 3917 whitespace = "[\\x20\\t\\r\\n\\f]", 3918 // http://www.w3.org/TR/css3-syntax/#characters 3919 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 3920 3921 // Loosely modeled on CSS identifier characters 3922 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors 3923 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 3924 identifier = characterEncoding.replace( "w", "w#" ), 3925 3926 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 3927 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + 3928 // Operator (capture 2) 3929 "*([*^$|!~]?=)" + whitespace + 3930 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 3931 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 3932 "*\\]", 3933 3934 pseudos = ":(" + characterEncoding + ")(?:\\((" + 3935 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 3936 // 1. quoted (capture 3; capture 4 or capture 5) 3937 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 3938 // 2. simple (capture 6) 3939 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 3940 // 3. anything else (capture 2) 3941 ".*" + 3942 ")\\)|)", 3943 3944 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 3945 rwhitespace = new RegExp( whitespace + "+", "g" ), 3946 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 3947 3948 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 3949 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 3950 3951 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), 3952 3953 rpseudo = new RegExp( pseudos ), 3954 ridentifier = new RegExp( "^" + identifier + "$" ), 3955 3956 matchExpr = { 3957 "ID": new RegExp( "^#(" + characterEncoding + ")" ), 3958 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), 3959 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), 3960 "ATTR": new RegExp( "^" + attributes ), 3961 "PSEUDO": new RegExp( "^" + pseudos ), 3962 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 3963 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 3964 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 3965 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 3966 // For use in libraries implementing .is() 3967 // We use this for POS matching in `select` 3968 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 3969 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 3970 }, 3971 3972 rinputs = /^(?:input|select|textarea|button)$/i, 3973 rheader = /^h\d$/i, 3974 3975 rnative = /^[^{]+\{\s*\[native \w/, 3976 3977 // Easily-parseable/retrievable ID or TAG or CLASS selectors 3978 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 3979 3980 rsibling = /[+~]/, 3981 rescape = /'|\\/g, 3982 3983 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 3984 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 3985 funescape = function( _, escaped, escapedWhitespace ) { 3986 var high = "0x" + escaped - 0x10000; 3987 // NaN means non-codepoint 3988 // Support: Firefox<24 3989 // Workaround erroneous numeric interpretation of +"0x" 3990 return high !== high || escapedWhitespace ? 3991 escaped : 3992 high < 0 ? 3993 // BMP codepoint 3994 String.fromCharCode( high + 0x10000 ) : 3995 // Supplemental Plane codepoint (surrogate pair) 3996 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 3997 }, 3998 3999 // Used for iframes 4000 // See setDocument() 4001 // Removing the function wrapper causes a "Permission Denied" 4002 // error in IE 4003 unloadHandler = function() { 4004 setDocument(); 4005 }; 4006 4007// Optimize for push.apply( _, NodeList ) 4008try { 4009 push.apply( 4010 (arr = slice.call( preferredDoc.childNodes )), 4011 preferredDoc.childNodes 4012 ); 4013 // Support: Android<4.0 4014 // Detect silently failing push.apply 4015 arr[ preferredDoc.childNodes.length ].nodeType; 4016} catch ( e ) { 4017 push = { apply: arr.length ? 4018 4019 // Leverage slice if possible 4020 function( target, els ) { 4021 push_native.apply( target, slice.call(els) ); 4022 } : 4023 4024 // Support: IE<9 4025 // Otherwise append directly 4026 function( target, els ) { 4027 var j = target.length, 4028 i = 0; 4029 // Can't trust NodeList.length 4030 while ( (target[j++] = els[i++]) ) {} 4031 target.length = j - 1; 4032 } 4033 }; 4034} 4035 4036function Sizzle( selector, context, results, seed ) { 4037 var match, elem, m, nodeType, 4038 // QSA vars 4039 i, groups, old, nid, newContext, newSelector; 4040 4041 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 4042 setDocument( context ); 4043 } 4044 4045 context = context || document; 4046 results = results || []; 4047 nodeType = context.nodeType; 4048 4049 if ( typeof selector !== "string" || !selector || 4050 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 4051 4052 return results; 4053 } 4054 4055 if ( !seed && documentIsHTML ) { 4056 4057 // Try to shortcut find operations when possible (e.g., not under DocumentFragment) 4058 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 4059 // Speed-up: Sizzle("#ID") 4060 if ( (m = match[1]) ) { 4061 if ( nodeType === 9 ) { 4062 elem = context.getElementById( m ); 4063 // Check parentNode to catch when Blackberry 4.6 returns 4064 // nodes that are no longer in the document (jQuery1113 #6963) 4065 if ( elem && elem.parentNode ) { 4066 // Handle the case where IE, Opera, and Webkit return items 4067 // by name instead of ID 4068 if ( elem.id === m ) { 4069 results.push( elem ); 4070 return results; 4071 } 4072 } else { 4073 return results; 4074 } 4075 } else { 4076 // Context is not a document 4077 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && 4078 contains( context, elem ) && elem.id === m ) { 4079 results.push( elem ); 4080 return results; 4081 } 4082 } 4083 4084 // Speed-up: Sizzle("TAG") 4085 } else if ( match[2] ) { 4086 push.apply( results, context.getElementsByTagName( selector ) ); 4087 return results; 4088 4089 // Speed-up: Sizzle(".CLASS") 4090 } else if ( (m = match[3]) && support.getElementsByClassName ) { 4091 push.apply( results, context.getElementsByClassName( m ) ); 4092 return results; 4093 } 4094 } 4095 4096 // QSA path 4097 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { 4098 nid = old = expando; 4099 newContext = context; 4100 newSelector = nodeType !== 1 && selector; 4101 4102 // qSA works strangely on Element-rooted queries 4103 // We can work around this by specifying an extra ID on the root 4104 // and working up from there (Thanks to Andrew Dupont for the technique) 4105 // IE 8 doesn't work on object elements 4106 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { 4107 groups = tokenize( selector ); 4108 4109 if ( (old = context.getAttribute("id")) ) { 4110 nid = old.replace( rescape, "\\$&" ); 4111 } else { 4112 context.setAttribute( "id", nid ); 4113 } 4114 nid = "[id='" + nid + "'] "; 4115 4116 i = groups.length; 4117 while ( i-- ) { 4118 groups[i] = nid + toSelector( groups[i] ); 4119 } 4120 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; 4121 newSelector = groups.join(","); 4122 } 4123 4124 if ( newSelector ) { 4125 try { 4126 push.apply( results, 4127 newContext.querySelectorAll( newSelector ) 4128 ); 4129 return results; 4130 } catch(qsaError) { 4131 } finally { 4132 if ( !old ) { 4133 context.removeAttribute("id"); 4134 } 4135 } 4136 } 4137 } 4138 } 4139 4140 // All others 4141 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 4142} 4143 4144/** 4145 * Create key-value caches of limited size 4146 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with 4147 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 4148 * deleting the oldest entry 4149 */ 4150function createCache() { 4151 var keys = []; 4152 4153 function cache( key, value ) { 4154 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 4155 if ( keys.push( key + " " ) > Expr.cacheLength ) { 4156 // Only keep the most recent entries 4157 delete cache[ keys.shift() ]; 4158 } 4159 return (cache[ key + " " ] = value); 4160 } 4161 return cache; 4162} 4163 4164/** 4165 * Mark a function for special use by Sizzle 4166 * @param {Function} fn The function to mark 4167 */ 4168function markFunction( fn ) { 4169 fn[ expando ] = true; 4170 return fn; 4171} 4172 4173/** 4174 * Support testing using an element 4175 * @param {Function} fn Passed the created div and expects a boolean result 4176 */ 4177function assert( fn ) { 4178 var div = document.createElement("div"); 4179 4180 try { 4181 return !!fn( div ); 4182 } catch (e) { 4183 return false; 4184 } finally { 4185 // Remove from its parent by default 4186 if ( div.parentNode ) { 4187 div.parentNode.removeChild( div ); 4188 } 4189 // release memory in IE 4190 div = null; 4191 } 4192} 4193 4194/** 4195 * Adds the same handler for all of the specified attrs 4196 * @param {String} attrs Pipe-separated list of attributes 4197 * @param {Function} handler The method that will be applied 4198 */ 4199function addHandle( attrs, handler ) { 4200 var arr = attrs.split("|"), 4201 i = attrs.length; 4202 4203 while ( i-- ) { 4204 Expr.attrHandle[ arr[i] ] = handler; 4205 } 4206} 4207 4208/** 4209 * Checks document order of two siblings 4210 * @param {Element} a 4211 * @param {Element} b 4212 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 4213 */ 4214function siblingCheck( a, b ) { 4215 var cur = b && a, 4216 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 4217 ( ~b.sourceIndex || MAX_NEGATIVE ) - 4218 ( ~a.sourceIndex || MAX_NEGATIVE ); 4219 4220 // Use IE sourceIndex if available on both nodes 4221 if ( diff ) { 4222 return diff; 4223 } 4224 4225 // Check if b follows a 4226 if ( cur ) { 4227 while ( (cur = cur.nextSibling) ) { 4228 if ( cur === b ) { 4229 return -1; 4230 } 4231 } 4232 } 4233 4234 return a ? 1 : -1; 4235} 4236 4237/** 4238 * Returns a function to use in pseudos for input types 4239 * @param {String} type 4240 */ 4241function createInputPseudo( type ) { 4242 return function( elem ) { 4243 var name = elem.nodeName.toLowerCase(); 4244 return name === "input" && elem.type === type; 4245 }; 4246} 4247 4248/** 4249 * Returns a function to use in pseudos for buttons 4250 * @param {String} type 4251 */ 4252function createButtonPseudo( type ) { 4253 return function( elem ) { 4254 var name = elem.nodeName.toLowerCase(); 4255 return (name === "input" || name === "button") && elem.type === type; 4256 }; 4257} 4258 4259/** 4260 * Returns a function to use in pseudos for positionals 4261 * @param {Function} fn 4262 */ 4263function createPositionalPseudo( fn ) { 4264 return markFunction(function( argument ) { 4265 argument = +argument; 4266 return markFunction(function( seed, matches ) { 4267 var j, 4268 matchIndexes = fn( [], seed.length, argument ), 4269 i = matchIndexes.length; 4270 4271 // Match elements found at the specified indexes 4272 while ( i-- ) { 4273 if ( seed[ (j = matchIndexes[i]) ] ) { 4274 seed[j] = !(matches[j] = seed[j]); 4275 } 4276 } 4277 }); 4278 }); 4279} 4280 4281/** 4282 * Checks a node for validity as a Sizzle context 4283 * @param {Element|Object=} context 4284 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 4285 */ 4286function testContext( context ) { 4287 return context && typeof context.getElementsByTagName !== "undefined" && context; 4288} 4289 4290// Expose support vars for convenience 4291support = Sizzle.support = {}; 4292 4293/** 4294 * Detects XML nodes 4295 * @param {Element|Object} elem An element or a document 4296 * @returns {Boolean} True iff elem is a non-HTML XML node 4297 */ 4298isXML = Sizzle.isXML = function( elem ) { 4299 // documentElement is verified for cases where it doesn't yet exist 4300 // (such as loading iframes in IE - #4833) 4301 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 4302 return documentElement ? documentElement.nodeName !== "HTML" : false; 4303}; 4304 4305/** 4306 * Sets document-related variables once based on the current document 4307 * @param {Element|Object} [doc] An element or document object to use to set the document 4308 * @returns {Object} Returns the current document 4309 */ 4310setDocument = Sizzle.setDocument = function( node ) { 4311 var hasCompare, parent, 4312 doc = node ? node.ownerDocument || node : preferredDoc; 4313 4314 // If no document and documentElement is available, return 4315 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 4316 return document; 4317 } 4318 4319 // Set our document 4320 document = doc; 4321 docElem = doc.documentElement; 4322 parent = doc.defaultView; 4323 4324 // Support: IE>8 4325 // If iframe document is assigned to "document" variable and if iframe has been reloaded, 4326 // IE will throw "permission denied" error when accessing "document" variable, see jQuery1113 #13936 4327 // IE6-8 do not support the defaultView property so parent will be undefined 4328 if ( parent && parent !== parent.top ) { 4329 // IE11 does not have attachEvent, so all must suffer 4330 if ( parent.addEventListener ) { 4331 parent.addEventListener( "unload", unloadHandler, false ); 4332 } else if ( parent.attachEvent ) { 4333 parent.attachEvent( "onunload", unloadHandler ); 4334 } 4335 } 4336 4337 /* Support tests 4338 ---------------------------------------------------------------------- */ 4339 documentIsHTML = !isXML( doc ); 4340 4341 /* Attributes 4342 ---------------------------------------------------------------------- */ 4343 4344 // Support: IE<8 4345 // Verify that getAttribute really returns attributes and not properties 4346 // (excepting IE8 booleans) 4347 support.attributes = assert(function( div ) { 4348 div.className = "i"; 4349 return !div.getAttribute("className"); 4350 }); 4351 4352 /* getElement(s)By* 4353 ---------------------------------------------------------------------- */ 4354 4355 // Check if getElementsByTagName("*") returns only elements 4356 support.getElementsByTagName = assert(function( div ) { 4357 div.appendChild( doc.createComment("") ); 4358 return !div.getElementsByTagName("*").length; 4359 }); 4360 4361 // Support: IE<9 4362 support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); 4363 4364 // Support: IE<10 4365 // Check if getElementById returns elements by name 4366 // The broken getElementById methods don't pick up programatically-set names, 4367 // so use a roundabout getElementsByName test 4368 support.getById = assert(function( div ) { 4369 docElem.appendChild( div ).id = expando; 4370 return !doc.getElementsByName || !doc.getElementsByName( expando ).length; 4371 }); 4372 4373 // ID find and filter 4374 if ( support.getById ) { 4375 Expr.find["ID"] = function( id, context ) { 4376 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 4377 var m = context.getElementById( id ); 4378 // Check parentNode to catch when Blackberry 4.6 returns 4379 // nodes that are no longer in the document #6963 4380 return m && m.parentNode ? [ m ] : []; 4381 } 4382 }; 4383 Expr.filter["ID"] = function( id ) { 4384 var attrId = id.replace( runescape, funescape ); 4385 return function( elem ) { 4386 return elem.getAttribute("id") === attrId; 4387 }; 4388 }; 4389 } else { 4390 // Support: IE6/7 4391 // getElementById is not reliable as a find shortcut 4392 delete Expr.find["ID"]; 4393 4394 Expr.filter["ID"] = function( id ) { 4395 var attrId = id.replace( runescape, funescape ); 4396 return function( elem ) { 4397 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); 4398 return node && node.value === attrId; 4399 }; 4400 }; 4401 } 4402 4403 // Tag 4404 Expr.find["TAG"] = support.getElementsByTagName ? 4405 function( tag, context ) { 4406 if ( typeof context.getElementsByTagName !== "undefined" ) { 4407 return context.getElementsByTagName( tag ); 4408 4409 // DocumentFragment nodes don't have gEBTN 4410 } else if ( support.qsa ) { 4411 return context.querySelectorAll( tag ); 4412 } 4413 } : 4414 4415 function( tag, context ) { 4416 var elem, 4417 tmp = [], 4418 i = 0, 4419 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 4420 results = context.getElementsByTagName( tag ); 4421 4422 // Filter out possible comments 4423 if ( tag === "*" ) { 4424 while ( (elem = results[i++]) ) { 4425 if ( elem.nodeType === 1 ) { 4426 tmp.push( elem ); 4427 } 4428 } 4429 4430 return tmp; 4431 } 4432 return results; 4433 }; 4434 4435 // Class 4436 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 4437 if ( documentIsHTML ) { 4438 return context.getElementsByClassName( className ); 4439 } 4440 }; 4441 4442 /* QSA/matchesSelector 4443 ---------------------------------------------------------------------- */ 4444 4445 // QSA and matchesSelector support 4446 4447 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 4448 rbuggyMatches = []; 4449 4450 // qSa(:focus) reports false when true (Chrome 21) 4451 // We allow this because of a bug in IE8/9 that throws an error 4452 // whenever `document.activeElement` is accessed on an iframe 4453 // So, we allow :focus to pass through QSA all the time to avoid the IE error 4454 // See http://bugs.jQuery1113.com/ticket/13378 4455 rbuggyQSA = []; 4456 4457 if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { 4458 // Build QSA regex 4459 // Regex strategy adopted from Diego Perini 4460 assert(function( div ) { 4461 // Select is set to empty string on purpose 4462 // This is to test IE's treatment of not explicitly 4463 // setting a boolean content attribute, 4464 // since its presence should be enough 4465 // http://bugs.jQuery1113.com/ticket/12359 4466 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + 4467 "<select id='" + expando + "-\f]' msallowcapture=''>" + 4468 "<option selected=''></option></select>"; 4469 4470 // Support: IE8, Opera 11-12.16 4471 // Nothing should be selected when empty strings follow ^= or $= or *= 4472 // The test attribute must be unknown in Opera but "safe" for WinRT 4473 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 4474 if ( div.querySelectorAll("[msallowcapture^='']").length ) { 4475 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 4476 } 4477 4478 // Support: IE8 4479 // Boolean attributes and "value" are not treated correctly 4480 if ( !div.querySelectorAll("[selected]").length ) { 4481 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 4482 } 4483 4484 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ 4485 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 4486 rbuggyQSA.push("~="); 4487 } 4488 4489 // Webkit/Opera - :checked should return selected option elements 4490 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 4491 // IE8 throws error here and will not see later tests 4492 if ( !div.querySelectorAll(":checked").length ) { 4493 rbuggyQSA.push(":checked"); 4494 } 4495 4496 // Support: Safari 8+, iOS 8+ 4497 // https://bugs.webkit.org/show_bug.cgi?id=136851 4498 // In-page `selector#id sibing-combinator selector` fails 4499 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { 4500 rbuggyQSA.push(".#.+[+~]"); 4501 } 4502 }); 4503 4504 assert(function( div ) { 4505 // Support: Windows 8 Native Apps 4506 // The type and name attributes are restricted during .innerHTML assignment 4507 var input = doc.createElement("input"); 4508 input.setAttribute( "type", "hidden" ); 4509 div.appendChild( input ).setAttribute( "name", "D" ); 4510 4511 // Support: IE8 4512 // Enforce case-sensitivity of name attribute 4513 if ( div.querySelectorAll("[name=d]").length ) { 4514 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 4515 } 4516 4517 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 4518 // IE8 throws error here and will not see later tests 4519 if ( !div.querySelectorAll(":enabled").length ) { 4520 rbuggyQSA.push( ":enabled", ":disabled" ); 4521 } 4522 4523 // Opera 10-11 does not throw on post-comma invalid pseudos 4524 div.querySelectorAll("*,:x"); 4525 rbuggyQSA.push(",.*:"); 4526 }); 4527 } 4528 4529 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 4530 docElem.webkitMatchesSelector || 4531 docElem.mozMatchesSelector || 4532 docElem.oMatchesSelector || 4533 docElem.msMatchesSelector) )) ) { 4534 4535 assert(function( div ) { 4536 // Check to see if it's possible to do matchesSelector 4537 // on a disconnected node (IE 9) 4538 support.disconnectedMatch = matches.call( div, "div" ); 4539 4540 // This should fail with an exception 4541 // Gecko does not error, returns false instead 4542 matches.call( div, "[s!='']:x" ); 4543 rbuggyMatches.push( "!=", pseudos ); 4544 }); 4545 } 4546 4547 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 4548 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 4549 4550 /* Contains 4551 ---------------------------------------------------------------------- */ 4552 hasCompare = rnative.test( docElem.compareDocumentPosition ); 4553 4554 // Element contains another 4555 // Purposefully does not implement inclusive descendent 4556 // As in, an element does not contain itself 4557 contains = hasCompare || rnative.test( docElem.contains ) ? 4558 function( a, b ) { 4559 var adown = a.nodeType === 9 ? a.documentElement : a, 4560 bup = b && b.parentNode; 4561 return a === bup || !!( bup && bup.nodeType === 1 && ( 4562 adown.contains ? 4563 adown.contains( bup ) : 4564 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 4565 )); 4566 } : 4567 function( a, b ) { 4568 if ( b ) { 4569 while ( (b = b.parentNode) ) { 4570 if ( b === a ) { 4571 return true; 4572 } 4573 } 4574 } 4575 return false; 4576 }; 4577 4578 /* Sorting 4579 ---------------------------------------------------------------------- */ 4580 4581 // Document order sorting 4582 sortOrder = hasCompare ? 4583 function( a, b ) { 4584 4585 // Flag for duplicate removal 4586 if ( a === b ) { 4587 hasDuplicate = true; 4588 return 0; 4589 } 4590 4591 // Sort on method existence if only one input has compareDocumentPosition 4592 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 4593 if ( compare ) { 4594 return compare; 4595 } 4596 4597 // Calculate position if both inputs belong to the same document 4598 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 4599 a.compareDocumentPosition( b ) : 4600 4601 // Otherwise we know they are disconnected 4602 1; 4603 4604 // Disconnected nodes 4605 if ( compare & 1 || 4606 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 4607 4608 // Choose the first element that is related to our preferred document 4609 if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 4610 return -1; 4611 } 4612 if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 4613 return 1; 4614 } 4615 4616 // Maintain original order 4617 return sortInput ? 4618 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 4619 0; 4620 } 4621 4622 return compare & 4 ? -1 : 1; 4623 } : 4624 function( a, b ) { 4625 // Exit early if the nodes are identical 4626 if ( a === b ) { 4627 hasDuplicate = true; 4628 return 0; 4629 } 4630 4631 var cur, 4632 i = 0, 4633 aup = a.parentNode, 4634 bup = b.parentNode, 4635 ap = [ a ], 4636 bp = [ b ]; 4637 4638 // Parentless nodes are either documents or disconnected 4639 if ( !aup || !bup ) { 4640 return a === doc ? -1 : 4641 b === doc ? 1 : 4642 aup ? -1 : 4643 bup ? 1 : 4644 sortInput ? 4645 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 4646 0; 4647 4648 // If the nodes are siblings, we can do a quick check 4649 } else if ( aup === bup ) { 4650 return siblingCheck( a, b ); 4651 } 4652 4653 // Otherwise we need full lists of their ancestors for comparison 4654 cur = a; 4655 while ( (cur = cur.parentNode) ) { 4656 ap.unshift( cur ); 4657 } 4658 cur = b; 4659 while ( (cur = cur.parentNode) ) { 4660 bp.unshift( cur ); 4661 } 4662 4663 // Walk down the tree looking for a discrepancy 4664 while ( ap[i] === bp[i] ) { 4665 i++; 4666 } 4667 4668 return i ? 4669 // Do a sibling check if the nodes have a common ancestor 4670 siblingCheck( ap[i], bp[i] ) : 4671 4672 // Otherwise nodes in our document sort first 4673 ap[i] === preferredDoc ? -1 : 4674 bp[i] === preferredDoc ? 1 : 4675 0; 4676 }; 4677 4678 return doc; 4679};
vendor: 4,496 bytes, lines 4680-4852
4680 4681Sizzle.matches = function( expr, elements ) { 4682 return Sizzle( expr, null, null, elements ); 4683}; 4684 4685Sizzle.matchesSelector = function( elem, expr ) { 4686 // Set document vars if needed 4687 if ( ( elem.ownerDocument || elem ) !== document ) { 4688 setDocument( elem ); 4689 } 4690 4691 // Make sure that attribute selectors are quoted 4692 expr = expr.replace( rattributeQuotes, "='$1']" ); 4693 4694 if ( support.matchesSelector && documentIsHTML && 4695 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 4696 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 4697 4698 try { 4699 var ret = matches.call( elem, expr ); 4700 4701 // IE 9's matchesSelector returns false on disconnected nodes 4702 if ( ret || support.disconnectedMatch || 4703 // As well, disconnected nodes are said to be in a document 4704 // fragment in IE 9 4705 elem.document && elem.document.nodeType !== 11 ) { 4706 return ret; 4707 } 4708 } catch (e) {} 4709 } 4710 4711 return Sizzle( expr, document, null, [ elem ] ).length > 0; 4712}; 4713 4714Sizzle.contains = function( context, elem ) { 4715 // Set document vars if needed 4716 if ( ( context.ownerDocument || context ) !== document ) { 4717 setDocument( context ); 4718 } 4719 return contains( context, elem ); 4720}; 4721 4722Sizzle.attr = function( elem, name ) { 4723 // Set document vars if needed 4724 if ( ( elem.ownerDocument || elem ) !== document ) { 4725 setDocument( elem ); 4726 } 4727 4728 var fn = Expr.attrHandle[ name.toLowerCase() ], 4729 // Don't get fooled by Object.prototype properties (jQuery1113 #13807) 4730 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 4731 fn( elem, name, !documentIsHTML ) : 4732 undefined; 4733 4734 return val !== undefined ? 4735 val : 4736 support.attributes || !documentIsHTML ? 4737 elem.getAttribute( name ) : 4738 (val = elem.getAttributeNode(name)) && val.specified ? 4739 val.value : 4740 null; 4741}; 4742 4743Sizzle.error = function( msg ) { 4744 throw new Error( "Syntax error, unrecognized expression: " + msg ); 4745}; 4746 4747/** 4748 * Document sorting and removing duplicates 4749 * @param {ArrayLike} results 4750 */ 4751Sizzle.uniqueSort = function( results ) { 4752 var elem, 4753 duplicates = [], 4754 j = 0, 4755 i = 0; 4756 4757 // Unless we *know* we can detect duplicates, assume their presence 4758 hasDuplicate = !support.detectDuplicates; 4759 sortInput = !support.sortStable && results.slice( 0 ); 4760 results.sort( sortOrder ); 4761 4762 if ( hasDuplicate ) { 4763 while ( (elem = results[i++]) ) { 4764 if ( elem === results[ i ] ) { 4765 j = duplicates.push( i ); 4766 } 4767 } 4768 while ( j-- ) { 4769 results.splice( duplicates[ j ], 1 ); 4770 } 4771 } 4772 4773 // Clear input after sorting to release objects 4774 // See https://github.com/jQuery1113/sizzle/pull/225 4775 sortInput = null; 4776 4777 return results; 4778}; 4779 4780/** 4781 * Utility function for retrieving the text value of an array of DOM nodes 4782 * @param {Array|Element} elem 4783 */ 4784getText = Sizzle.getText = function( elem ) { 4785 var node, 4786 ret = "", 4787 i = 0, 4788 nodeType = elem.nodeType; 4789 4790 if ( !nodeType ) { 4791 // If no nodeType, this is expected to be an array 4792 while ( (node = elem[i++]) ) { 4793 // Do not traverse comment nodes 4794 ret += getText( node ); 4795 } 4796 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 4797 // Use textContent for elements 4798 // innerText usage removed for consistency of new lines (jQuery1113 #11153) 4799 if ( typeof elem.textContent === "string" ) { 4800 return elem.textContent; 4801 } else { 4802 // Traverse its children 4803 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 4804 ret += getText( elem ); 4805 } 4806 } 4807 } else if ( nodeType === 3 || nodeType === 4 ) { 4808 return elem.nodeValue; 4809 } 4810 // Do not include comment or processing instruction nodes 4811 4812 return ret; 4813}; 4814 4815Expr = Sizzle.selectors = { 4816 4817 // Can be adjusted by the user 4818 cacheLength: 50, 4819 4820 createPseudo: markFunction, 4821 4822 match: matchExpr, 4823 4824 attrHandle: {}, 4825 4826 find: {}, 4827 4828 relative: { 4829 ">": { dir: "parentNode", first: true }, 4830 " ": { dir: "parentNode" }, 4831 "+": { dir: "previousSibling", first: true }, 4832 "~": { dir: "previousSibling" } 4833 }, 4834 4835 preFilter: { 4836 "ATTR": function( match ) { 4837 match[1] = match[1].replace( runescape, funescape ); 4838 4839 // Move the given value to match[3] whether quoted or unquoted 4840 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 4841 4842 if ( match[2] === "~=" ) { 4843 match[3] = " " + match[3] + " "; 4844 } 4845 4846 return match.slice( 0, 4 ); 4847 }, 4848 4849 "CHILD": function( match ) { 4850 /* matches from matchExpr["CHILD"] 4851 1 type (only|nth|...) 4852 2 what (child|of-type)
vendor: 10,120 bytes, lines 4853-5164
4853 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4854 4 xn-component of xn+y argument ([+-]?\d*n|) 4855 5 sign of xn-component 4856 6 x of xn-component 4857 7 sign of y-component 4858 8 y of y-component 4859 */ 4860 match[1] = match[1].toLowerCase(); 4861 4862 if ( match[1].slice( 0, 3 ) === "nth" ) { 4863 // nth-* requires argument 4864 if ( !match[3] ) { 4865 Sizzle.error( match[0] ); 4866 } 4867 4868 // numeric x and y parameters for Expr.filter.CHILD 4869 // remember that false/true cast respectively to 0/1 4870 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 4871 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 4872 4873 // other types prohibit arguments 4874 } else if ( match[3] ) { 4875 Sizzle.error( match[0] ); 4876 } 4877 4878 return match; 4879 }, 4880 4881 "PSEUDO": function( match ) { 4882 var excess, 4883 unquoted = !match[6] && match[2]; 4884 4885 if ( matchExpr["CHILD"].test( match[0] ) ) { 4886 return null; 4887 } 4888 4889 // Accept quoted arguments as-is 4890 if ( match[3] ) { 4891 match[2] = match[4] || match[5] || ""; 4892 4893 // Strip excess characters from unquoted arguments 4894 } else if ( unquoted && rpseudo.test( unquoted ) && 4895 // Get excess from tokenize (recursively) 4896 (excess = tokenize( unquoted, true )) && 4897 // advance to the next closing parenthesis 4898 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 4899 4900 // excess is a negative index 4901 match[0] = match[0].slice( 0, excess ); 4902 match[2] = unquoted.slice( 0, excess ); 4903 } 4904 4905 // Return only captures needed by the pseudo filter method (type and argument) 4906 return match.slice( 0, 3 ); 4907 } 4908 }, 4909 4910 filter: { 4911 4912 "TAG": function( nodeNameSelector ) { 4913 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 4914 return nodeNameSelector === "*" ? 4915 function() { return true; } : 4916 function( elem ) { 4917 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 4918 }; 4919 }, 4920 4921 "CLASS": function( className ) { 4922 var pattern = classCache[ className + " " ]; 4923 4924 return pattern || 4925 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 4926 classCache( className, function( elem ) { 4927 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 4928 }); 4929 }, 4930 4931 "ATTR": function( name, operator, check ) { 4932 return function( elem ) { 4933 var result = Sizzle.attr( elem, name ); 4934 4935 if ( result == null ) { 4936 return operator === "!="; 4937 } 4938 if ( !operator ) { 4939 return true; 4940 } 4941 4942 result += ""; 4943 4944 return operator === "=" ? result === check : 4945 operator === "!=" ? result !== check : 4946 operator === "^=" ? check && result.indexOf( check ) === 0 : 4947 operator === "*=" ? check && result.indexOf( check ) > -1 : 4948 operator === "$=" ? check && result.slice( -check.length ) === check : 4949 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 4950 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 4951 false; 4952 }; 4953 }, 4954 4955 "CHILD": function( type, what, argument, first, last ) { 4956 var simple = type.slice( 0, 3 ) !== "nth", 4957 forward = type.slice( -4 ) !== "last", 4958 ofType = what === "of-type"; 4959 4960 return first === 1 && last === 0 ? 4961 4962 // Shortcut for :nth-*(n) 4963 function( elem ) { 4964 return !!elem.parentNode; 4965 } : 4966 4967 function( elem, context, xml ) { 4968 var cache, outerCache, node, diff, nodeIndex, start, 4969 dir = simple !== forward ? "nextSibling" : "previousSibling", 4970 parent = elem.parentNode, 4971 name = ofType && elem.nodeName.toLowerCase(), 4972 useCache = !xml && !ofType; 4973 4974 if ( parent ) { 4975 4976 // :(first|last|only)-(child|of-type) 4977 if ( simple ) { 4978 while ( dir ) { 4979 node = elem; 4980 while ( (node = node[ dir ]) ) { 4981 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { 4982 return false; 4983 } 4984 } 4985 // Reverse direction for :only-* (if we haven't yet done so) 4986 start = dir = type === "only" && !start && "nextSibling"; 4987 } 4988 return true; 4989 } 4990 4991 start = [ forward ? parent.firstChild : parent.lastChild ]; 4992 4993 // non-xml :nth-child(...) stores cache data on `parent` 4994 if ( forward && useCache ) { 4995 // Seek `elem` from a previously-cached index 4996 outerCache = parent[ expando ] || (parent[ expando ] = {}); 4997 cache = outerCache[ type ] || []; 4998 nodeIndex = cache[0] === dirruns && cache[1]; 4999 diff = cache[0] === dirruns && cache[2]; 5000 node = nodeIndex && parent.childNodes[ nodeIndex ]; 5001 5002 while ( (node = ++nodeIndex && node && node[ dir ] || 5003 5004 // Fallback to seeking `elem` from the start 5005 (diff = nodeIndex = 0) || start.pop()) ) { 5006 5007 // When found, cache indexes on `parent` and break 5008 if ( node.nodeType === 1 && ++diff && node === elem ) { 5009 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 5010 break; 5011 } 5012 } 5013 5014 // Use previously-cached element index if available 5015 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { 5016 diff = cache[1]; 5017 5018 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) 5019 } else { 5020 // Use the same loop as above to seek `elem` from the start 5021 while ( (node = ++nodeIndex && node && node[ dir ] || 5022 (diff = nodeIndex = 0) || start.pop()) ) { 5023 5024 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { 5025 // Cache the index of each encountered element 5026 if ( useCache ) { 5027 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; 5028 } 5029 5030 if ( node === elem ) { 5031 break; 5032 } 5033 } 5034 } 5035 } 5036 5037 // Incorporate the offset, then check against cycle size 5038 diff -= last; 5039 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 5040 } 5041 }; 5042 }, 5043 5044 "PSEUDO": function( pseudo, argument ) { 5045 // pseudo-class names are case-insensitive 5046 // http://www.w3.org/TR/selectors/#pseudo-classes 5047 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 5048 // Remember that setFilters inherits from pseudos 5049 var args, 5050 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 5051 Sizzle.error( "unsupported pseudo: " + pseudo ); 5052 5053 // The user may use createPseudo to indicate that 5054 // arguments are needed to create the filter function 5055 // just as Sizzle does 5056 if ( fn[ expando ] ) { 5057 return fn( argument ); 5058 } 5059 5060 // But maintain support for old signatures 5061 if ( fn.length > 1 ) { 5062 args = [ pseudo, pseudo, "", argument ]; 5063 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 5064 markFunction(function( seed, matches ) { 5065 var idx, 5066 matched = fn( seed, argument ), 5067 i = matched.length; 5068 while ( i-- ) { 5069 idx = indexOf( seed, matched[i] ); 5070 seed[ idx ] = !( matches[ idx ] = matched[i] ); 5071 } 5072 }) : 5073 function( elem ) { 5074 return fn( elem, 0, args ); 5075 }; 5076 } 5077 5078 return fn; 5079 } 5080 }, 5081 5082 pseudos: { 5083 // Potentially complex pseudos 5084 "not": markFunction(function( selector ) { 5085 // Trim the selector passed to compile 5086 // to avoid treating leading and trailing 5087 // spaces as combinators 5088 var input = [], 5089 results = [], 5090 matcher = compile( selector.replace( rtrim, "$1" ) ); 5091 5092 return matcher[ expando ] ? 5093 markFunction(function( seed, matches, context, xml ) { 5094 var elem, 5095 unmatched = matcher( seed, null, xml, [] ), 5096 i = seed.length; 5097 5098 // Match elements unmatched by `matcher` 5099 while ( i-- ) { 5100 if ( (elem = unmatched[i]) ) { 5101 seed[i] = !(matches[i] = elem); 5102 } 5103 } 5104 }) : 5105 function( elem, context, xml ) { 5106 input[0] = elem; 5107 matcher( input, null, xml, results ); 5108 // Don't keep the element (issue #299) 5109 input[0] = null; 5110 return !results.pop(); 5111 }; 5112 }), 5113 5114 "has": markFunction(function( selector ) { 5115 return function( elem ) { 5116 return Sizzle( selector, elem ).length > 0; 5117 }; 5118 }), 5119 5120 "contains": markFunction(function( text ) { 5121 text = text.replace( runescape, funescape ); 5122 return function( elem ) { 5123 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 5124 }; 5125 }), 5126 5127 // "Whether an element is represented by a :lang() selector 5128 // is based solely on the element's language value 5129 // being equal to the identifier C, 5130 // or beginning with the identifier C immediately followed by "-". 5131 // The matching of C against the element's language value is performed case-insensitively. 5132 // The identifier C does not have to be a valid language name." 5133 // http://www.w3.org/TR/selectors/#lang-pseudo 5134 "lang": markFunction( function( lang ) { 5135 // lang value must be a valid identifier 5136 if ( !ridentifier.test(lang || "") ) { 5137 Sizzle.error( "unsupported lang: " + lang ); 5138 } 5139 lang = lang.replace( runescape, funescape ).toLowerCase(); 5140 return function( elem ) { 5141 var elemLang; 5142 do { 5143 if ( (elemLang = documentIsHTML ? 5144 elem.lang : 5145 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 5146 5147 elemLang = elemLang.toLowerCase(); 5148 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 5149 } 5150 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 5151 return false; 5152 }; 5153 }), 5154 5155 // Miscellaneous 5156 "target": function( elem ) { 5157 var hash = window.location && window.location.hash; 5158 return hash && hash.slice( 1 ) === elem.id; 5159 }, 5160 5161 "root": function( elem ) { 5162 return elem === docElem; 5163 }, 5164
vendor: 5,418 bytes, lines 5165-5364
5165 "focus": function( elem ) { 5166 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 5167 }, 5168 5169 // Boolean properties 5170 "enabled": function( elem ) { 5171 return elem.disabled === false; 5172 }, 5173 5174 "disabled": function( elem ) { 5175 return elem.disabled === true; 5176 }, 5177 5178 "checked": function( elem ) { 5179 // In CSS3, :checked should return both checked and selected elements 5180 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 5181 var nodeName = elem.nodeName.toLowerCase(); 5182 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 5183 }, 5184 5185 "selected": function( elem ) { 5186 // Accessing this property makes selected-by-default 5187 // options in Safari work properly 5188 if ( elem.parentNode ) { 5189 elem.parentNode.selectedIndex; 5190 } 5191 5192 return elem.selected === true; 5193 }, 5194 5195 // Contents 5196 "empty": function( elem ) { 5197 // http://www.w3.org/TR/selectors/#empty-pseudo 5198 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 5199 // but not by others (comment: 8; processing instruction: 7; etc.) 5200 // nodeType < 6 works because attributes (2) do not appear as children 5201 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 5202 if ( elem.nodeType < 6 ) { 5203 return false; 5204 } 5205 } 5206 return true; 5207 }, 5208 5209 "parent": function( elem ) { 5210 return !Expr.pseudos["empty"]( elem ); 5211 }, 5212 5213 // Element/input types 5214 "header": function( elem ) { 5215 return rheader.test( elem.nodeName ); 5216 }, 5217 5218 "input": function( elem ) { 5219 return rinputs.test( elem.nodeName ); 5220 }, 5221 5222 "button": function( elem ) { 5223 var name = elem.nodeName.toLowerCase(); 5224 return name === "input" && elem.type === "button" || name === "button"; 5225 }, 5226 5227 "text": function( elem ) { 5228 var attr; 5229 return elem.nodeName.toLowerCase() === "input" && 5230 elem.type === "text" && 5231 5232 // Support: IE<8 5233 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 5234 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 5235 }, 5236 5237 // Position-in-collection 5238 "first": createPositionalPseudo(function() { 5239 return [ 0 ]; 5240 }), 5241 5242 "last": createPositionalPseudo(function( matchIndexes, length ) { 5243 return [ length - 1 ]; 5244 }), 5245 5246 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 5247 return [ argument < 0 ? argument + length : argument ]; 5248 }), 5249 5250 "even": createPositionalPseudo(function( matchIndexes, length ) { 5251 var i = 0; 5252 for ( ; i < length; i += 2 ) { 5253 matchIndexes.push( i ); 5254 } 5255 return matchIndexes; 5256 }), 5257 5258 "odd": createPositionalPseudo(function( matchIndexes, length ) { 5259 var i = 1; 5260 for ( ; i < length; i += 2 ) { 5261 matchIndexes.push( i ); 5262 } 5263 return matchIndexes; 5264 }), 5265 5266 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 5267 var i = argument < 0 ? argument + length : argument; 5268 for ( ; --i >= 0; ) { 5269 matchIndexes.push( i ); 5270 } 5271 return matchIndexes; 5272 }), 5273 5274 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 5275 var i = argument < 0 ? argument + length : argument; 5276 for ( ; ++i < length; ) { 5277 matchIndexes.push( i ); 5278 } 5279 return matchIndexes; 5280 }) 5281 } 5282}; 5283 5284Expr.pseudos["nth"] = Expr.pseudos["eq"]; 5285 5286// Add button/input type pseudos 5287for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 5288 Expr.pseudos[ i ] = createInputPseudo( i ); 5289} 5290for ( i in { submit: true, reset: true } ) { 5291 Expr.pseudos[ i ] = createButtonPseudo( i ); 5292} 5293 5294// Easy API for creating new setFilters 5295function setFilters() {} 5296setFilters.prototype = Expr.filters = Expr.pseudos; 5297Expr.setFilters = new setFilters(); 5298 5299tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 5300 var matched, match, tokens, type, 5301 soFar, groups, preFilters, 5302 cached = tokenCache[ selector + " " ]; 5303 5304 if ( cached ) { 5305 return parseOnly ? 0 : cached.slice( 0 ); 5306 } 5307 5308 soFar = selector; 5309 groups = []; 5310 preFilters = Expr.preFilter; 5311 5312 while ( soFar ) { 5313 5314 // Comma and first run 5315 if ( !matched || (match = rcomma.exec( soFar )) ) { 5316 if ( match ) { 5317 // Don't consume trailing commas as valid 5318 soFar = soFar.slice( match[0].length ) || soFar; 5319 } 5320 groups.push( (tokens = []) ); 5321 } 5322 5323 matched = false; 5324 5325 // Combinators 5326 if ( (match = rcombinators.exec( soFar )) ) { 5327 matched = match.shift(); 5328 tokens.push({ 5329 value: matched, 5330 // Cast descendant combinators to space 5331 type: match[0].replace( rtrim, " " ) 5332 }); 5333 soFar = soFar.slice( matched.length ); 5334 } 5335 5336 // Filters 5337 for ( type in Expr.filter ) { 5338 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 5339 (match = preFilters[ type ]( match ))) ) { 5340 matched = match.shift(); 5341 tokens.push({ 5342 value: matched, 5343 type: type, 5344 matches: match 5345 }); 5346 soFar = soFar.slice( matched.length ); 5347 } 5348 } 5349 5350 if ( !matched ) { 5351 break; 5352 } 5353 } 5354 5355 // Return the length of the invalid excess 5356 // if we're just parsing 5357 // Otherwise, throw an error or return tokens 5358 return parseOnly ? 5359 soFar.length : 5360 soFar ? 5361 Sizzle.error( selector ) : 5362 // Cache the tokens 5363 tokenCache( selector, groups ).slice( 0 ); 5364};
vendor: 11,230 bytes, lines 5365-5751
5365 5366function toSelector( tokens ) { 5367 var i = 0, 5368 len = tokens.length, 5369 selector = ""; 5370 for ( ; i < len; i++ ) { 5371 selector += tokens[i].value; 5372 } 5373 return selector; 5374} 5375 5376function addCombinator( matcher, combinator, base ) { 5377 var dir = combinator.dir, 5378 checkNonElements = base && dir === "parentNode", 5379 doneName = done++; 5380 5381 return combinator.first ? 5382 // Check against closest ancestor/preceding element 5383 function( elem, context, xml ) { 5384 while ( (elem = elem[ dir ]) ) { 5385 if ( elem.nodeType === 1 || checkNonElements ) { 5386 return matcher( elem, context, xml ); 5387 } 5388 } 5389 } : 5390 5391 // Check against all ancestor/preceding elements 5392 function( elem, context, xml ) { 5393 var oldCache, outerCache, 5394 newCache = [ dirruns, doneName ]; 5395 5396 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching 5397 if ( xml ) { 5398 while ( (elem = elem[ dir ]) ) { 5399 if ( elem.nodeType === 1 || checkNonElements ) { 5400 if ( matcher( elem, context, xml ) ) { 5401 return true; 5402 } 5403 } 5404 } 5405 } else { 5406 while ( (elem = elem[ dir ]) ) { 5407 if ( elem.nodeType === 1 || checkNonElements ) { 5408 outerCache = elem[ expando ] || (elem[ expando ] = {}); 5409 if ( (oldCache = outerCache[ dir ]) && 5410 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 5411 5412 // Assign to newCache so results back-propagate to previous elements 5413 return (newCache[ 2 ] = oldCache[ 2 ]); 5414 } else { 5415 // Reuse newcache so results back-propagate to previous elements 5416 outerCache[ dir ] = newCache; 5417 5418 // A match means we're done; a fail means we have to keep checking 5419 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 5420 return true; 5421 } 5422 } 5423 } 5424 } 5425 } 5426 }; 5427} 5428 5429function elementMatcher( matchers ) { 5430 return matchers.length > 1 ? 5431 function( elem, context, xml ) { 5432 var i = matchers.length; 5433 while ( i-- ) { 5434 if ( !matchers[i]( elem, context, xml ) ) { 5435 return false; 5436 } 5437 } 5438 return true; 5439 } : 5440 matchers[0]; 5441} 5442 5443function multipleContexts( selector, contexts, results ) { 5444 var i = 0, 5445 len = contexts.length; 5446 for ( ; i < len; i++ ) { 5447 Sizzle( selector, contexts[i], results ); 5448 } 5449 return results; 5450} 5451 5452function condense( unmatched, map, filter, context, xml ) { 5453 var elem, 5454 newUnmatched = [], 5455 i = 0, 5456 len = unmatched.length, 5457 mapped = map != null; 5458 5459 for ( ; i < len; i++ ) { 5460 if ( (elem = unmatched[i]) ) { 5461 if ( !filter || filter( elem, context, xml ) ) { 5462 newUnmatched.push( elem ); 5463 if ( mapped ) { 5464 map.push( i ); 5465 } 5466 } 5467 } 5468 } 5469 5470 return newUnmatched; 5471} 5472 5473function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 5474 if ( postFilter && !postFilter[ expando ] ) { 5475 postFilter = setMatcher( postFilter ); 5476 } 5477 if ( postFinder && !postFinder[ expando ] ) { 5478 postFinder = setMatcher( postFinder, postSelector ); 5479 } 5480 return markFunction(function( seed, results, context, xml ) { 5481 var temp, i, elem, 5482 preMap = [], 5483 postMap = [], 5484 preexisting = results.length, 5485 5486 // Get initial elements from seed or context 5487 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 5488 5489 // Prefilter to get matcher input, preserving a map for seed-results synchronization 5490 matcherIn = preFilter && ( seed || !selector ) ? 5491 condense( elems, preMap, preFilter, context, xml ) : 5492 elems, 5493 5494 matcherOut = matcher ? 5495 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 5496 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 5497 5498 // ...intermediate processing is necessary 5499 [] : 5500 5501 // ...otherwise use results directly 5502 results : 5503 matcherIn; 5504 5505 // Find primary matches 5506 if ( matcher ) { 5507 matcher( matcherIn, matcherOut, context, xml ); 5508 } 5509 5510 // Apply postFilter 5511 if ( postFilter ) { 5512 temp = condense( matcherOut, postMap ); 5513 postFilter( temp, [], context, xml ); 5514 5515 // Un-match failing elements by moving them back to matcherIn 5516 i = temp.length; 5517 while ( i-- ) { 5518 if ( (elem = temp[i]) ) { 5519 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 5520 } 5521 } 5522 } 5523 5524 if ( seed ) { 5525 if ( postFinder || preFilter ) { 5526 if ( postFinder ) { 5527 // Get the final matcherOut by condensing this intermediate into postFinder contexts 5528 temp = []; 5529 i = matcherOut.length; 5530 while ( i-- ) { 5531 if ( (elem = matcherOut[i]) ) { 5532 // Restore matcherIn since elem is not yet a final match 5533 temp.push( (matcherIn[i] = elem) ); 5534 } 5535 } 5536 postFinder( null, (matcherOut = []), temp, xml ); 5537 } 5538 5539 // Move matched elements from seed to results to keep them synchronized 5540 i = matcherOut.length; 5541 while ( i-- ) { 5542 if ( (elem = matcherOut[i]) && 5543 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 5544 5545 seed[temp] = !(results[temp] = elem); 5546 } 5547 } 5548 } 5549 5550 // Add elements to results, through postFinder if defined 5551 } else { 5552 matcherOut = condense( 5553 matcherOut === results ? 5554 matcherOut.splice( preexisting, matcherOut.length ) : 5555 matcherOut 5556 ); 5557 if ( postFinder ) { 5558 postFinder( null, results, matcherOut, xml ); 5559 } else { 5560 push.apply( results, matcherOut ); 5561 } 5562 } 5563 }); 5564} 5565 5566function matcherFromTokens( tokens ) { 5567 var checkContext, matcher, j, 5568 len = tokens.length, 5569 leadingRelative = Expr.relative[ tokens[0].type ], 5570 implicitRelative = leadingRelative || Expr.relative[" "], 5571 i = leadingRelative ? 1 : 0, 5572 5573 // The foundational matcher ensures that elements are reachable from top-level context(s) 5574 matchContext = addCombinator( function( elem ) { 5575 return elem === checkContext; 5576 }, implicitRelative, true ), 5577 matchAnyContext = addCombinator( function( elem ) { 5578 return indexOf( checkContext, elem ) > -1; 5579 }, implicitRelative, true ), 5580 matchers = [ function( elem, context, xml ) { 5581 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 5582 (checkContext = context).nodeType ? 5583 matchContext( elem, context, xml ) : 5584 matchAnyContext( elem, context, xml ) ); 5585 // Avoid hanging onto element (issue #299) 5586 checkContext = null; 5587 return ret; 5588 } ]; 5589 5590 for ( ; i < len; i++ ) { 5591 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 5592 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 5593 } else { 5594 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 5595 5596 // Return special upon seeing a positional matcher 5597 if ( matcher[ expando ] ) { 5598 // Find the next relative operator (if any) for proper handling 5599 j = ++i; 5600 for ( ; j < len; j++ ) { 5601 if ( Expr.relative[ tokens[j].type ] ) { 5602 break; 5603 } 5604 } 5605 return setMatcher( 5606 i > 1 && elementMatcher( matchers ), 5607 i > 1 && toSelector( 5608 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 5609 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 5610 ).replace( rtrim, "$1" ), 5611 matcher, 5612 i < j && matcherFromTokens( tokens.slice( i, j ) ), 5613 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 5614 j < len && toSelector( tokens ) 5615 ); 5616 } 5617 matchers.push( matcher ); 5618 } 5619 } 5620 5621 return elementMatcher( matchers ); 5622} 5623 5624function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 5625 var bySet = setMatchers.length > 0, 5626 byElement = elementMatchers.length > 0, 5627 superMatcher = function( seed, context, xml, results, outermost ) { 5628 var elem, j, matcher, 5629 matchedCount = 0, 5630 i = "0", 5631 unmatched = seed && [], 5632 setMatched = [], 5633 contextBackup = outermostContext, 5634 // We must always have either seed elements or outermost context 5635 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 5636 // Use integer dirruns iff this is the outermost matcher 5637 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 5638 len = elems.length; 5639 5640 if ( outermost ) { 5641 outermostContext = context !== document && context; 5642 } 5643 5644 // Add elements passing elementMatchers directly to results 5645 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below 5646 // Support: IE<9, Safari 5647 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 5648 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 5649 if ( byElement && elem ) { 5650 j = 0; 5651 while ( (matcher = elementMatchers[j++]) ) { 5652 if ( matcher( elem, context, xml ) ) { 5653 results.push( elem ); 5654 break; 5655 } 5656 } 5657 if ( outermost ) { 5658 dirruns = dirrunsUnique; 5659 } 5660 } 5661 5662 // Track unmatched elements for set filters 5663 if ( bySet ) { 5664 // They will have gone through all possible matchers 5665 if ( (elem = !matcher && elem) ) { 5666 matchedCount--; 5667 } 5668 5669 // Lengthen the array for every element, matched or not 5670 if ( seed ) { 5671 unmatched.push( elem ); 5672 } 5673 } 5674 } 5675 5676 // Apply set filters to unmatched elements 5677 matchedCount += i; 5678 if ( bySet && i !== matchedCount ) { 5679 j = 0; 5680 while ( (matcher = setMatchers[j++]) ) { 5681 matcher( unmatched, setMatched, context, xml ); 5682 } 5683 5684 if ( seed ) { 5685 // Reintegrate element matches to eliminate the need for sorting 5686 if ( matchedCount > 0 ) { 5687 while ( i-- ) { 5688 if ( !(unmatched[i] || setMatched[i]) ) { 5689 setMatched[i] = pop.call( results ); 5690 } 5691 } 5692 } 5693 5694 // Discard index placeholder values to get only actual matches 5695 setMatched = condense( setMatched ); 5696 } 5697 5698 // Add matches to results 5699 push.apply( results, setMatched ); 5700 5701 // Seedless set matches succeeding multiple successful matchers stipulate sorting 5702 if ( outermost && !seed && setMatched.length > 0 && 5703 ( matchedCount + setMatchers.length ) > 1 ) { 5704 5705 Sizzle.uniqueSort( results ); 5706 } 5707 } 5708 5709 // Override manipulation of globals by nested matchers 5710 if ( outermost ) { 5711 dirruns = dirrunsUnique; 5712 outermostContext = contextBackup; 5713 } 5714 5715 return unmatched; 5716 }; 5717 5718 return bySet ? 5719 markFunction( superMatcher ) : 5720 superMatcher; 5721} 5722 5723compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 5724 var i, 5725 setMatchers = [], 5726 elementMatchers = [], 5727 cached = compilerCache[ selector + " " ]; 5728 5729 if ( !cached ) { 5730 // Generate a function of recursive functions that can be used to check each element 5731 if ( !match ) { 5732 match = tokenize( selector ); 5733 } 5734 i = match.length; 5735 while ( i-- ) { 5736 cached = matcherFromTokens( match[i] ); 5737 if ( cached[ expando ] ) { 5738 setMatchers.push( cached ); 5739 } else { 5740 elementMatchers.push( cached ); 5741 } 5742 } 5743 5744 // Cache the compiled function 5745 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 5746 5747 // Save selector and tokenization 5748 cached.selector = selector; 5749 } 5750 return cached; 5751};
vendor: 185,445 bytes, lines 5752-12178
5752 5753/** 5754 * A low-level selection function that works with Sizzle's compiled 5755 * selector functions 5756 * @param {String|Function} selector A selector or a pre-compiled 5757 * selector function built with Sizzle.compile 5758 * @param {Element} context 5759 * @param {Array} [results] 5760 * @param {Array} [seed] A set of elements to match against 5761 */ 5762select = Sizzle.select = function( selector, context, results, seed ) { 5763 var i, tokens, token, type, find, 5764 compiled = typeof selector === "function" && selector, 5765 match = !seed && tokenize( (selector = compiled.selector || selector) ); 5766 5767 results = results || []; 5768 5769 // Try to minimize operations if there is no seed and only one group 5770 if ( match.length === 1 ) { 5771 5772 // Take a shortcut and set the context if the root selector is an ID 5773 tokens = match[0] = match[0].slice( 0 ); 5774 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 5775 support.getById && context.nodeType === 9 && documentIsHTML && 5776 Expr.relative[ tokens[1].type ] ) { 5777 5778 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 5779 if ( !context ) { 5780 return results; 5781 5782 // Precompiled matchers will still verify ancestry, so step up a level 5783 } else if ( compiled ) { 5784 context = context.parentNode; 5785 } 5786 5787 selector = selector.slice( tokens.shift().value.length ); 5788 } 5789 5790 // Fetch a seed set for right-to-left matching 5791 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 5792 while ( i-- ) { 5793 token = tokens[i]; 5794 5795 // Abort if we hit a combinator 5796 if ( Expr.relative[ (type = token.type) ] ) { 5797 break; 5798 } 5799 if ( (find = Expr.find[ type ]) ) { 5800 // Search, expanding context for leading sibling combinators 5801 if ( (seed = find( 5802 token.matches[0].replace( runescape, funescape ), 5803 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 5804 )) ) { 5805 5806 // If seed is empty or no tokens remain, we can return early 5807 tokens.splice( i, 1 ); 5808 selector = seed.length && toSelector( tokens ); 5809 if ( !selector ) { 5810 push.apply( results, seed ); 5811 return results; 5812 } 5813 5814 break; 5815 } 5816 } 5817 } 5818 } 5819 5820 // Compile and execute a filtering function if one is not provided 5821 // Provide `match` to avoid retokenization if we modified the selector above 5822 ( compiled || compile( selector, match ) )( 5823 seed, 5824 context, 5825 !documentIsHTML, 5826 results, 5827 rsibling.test( selector ) && testContext( context.parentNode ) || context 5828 ); 5829 return results; 5830}; 5831 5832// One-time assignments 5833 5834// Sort stability 5835support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 5836 5837// Support: Chrome 14-35+ 5838// Always assume duplicates if they aren't passed to the comparison function 5839support.detectDuplicates = !!hasDuplicate; 5840 5841// Initialize against the default document 5842setDocument(); 5843 5844// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 5845// Detached nodes confoundingly follow *each other* 5846support.sortDetached = assert(function( div1 ) { 5847 // Should return 1, but returns 4 (following) 5848 return div1.compareDocumentPosition( document.createElement("div") ) & 1; 5849}); 5850 5851// Support: IE<8 5852// Prevent attribute/property "interpolation" 5853// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 5854if ( !assert(function( div ) { 5855 div.innerHTML = "<a href='#'></a>"; 5856 return div.firstChild.getAttribute("href") === "#" ; 5857}) ) { 5858 addHandle( "type|href|height|width", function( elem, name, isXML ) { 5859 if ( !isXML ) { 5860 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 5861 } 5862 }); 5863} 5864 5865// Support: IE<9 5866// Use defaultValue in place of getAttribute("value") 5867if ( !support.attributes || !assert(function( div ) { 5868 div.innerHTML = "<input/>"; 5869 div.firstChild.setAttribute( "value", "" ); 5870 return div.firstChild.getAttribute( "value" ) === ""; 5871}) ) { 5872 addHandle( "value", function( elem, name, isXML ) { 5873 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 5874 return elem.defaultValue; 5875 } 5876 }); 5877} 5878 5879// Support: IE<9 5880// Use getAttributeNode to fetch booleans when getAttribute lies 5881if ( !assert(function( div ) { 5882 return div.getAttribute("disabled") == null; 5883}) ) { 5884 addHandle( booleans, function( elem, name, isXML ) { 5885 var val; 5886 if ( !isXML ) { 5887 return elem[ name ] === true ? name.toLowerCase() : 5888 (val = elem.getAttributeNode( name )) && val.specified ? 5889 val.value : 5890 null; 5891 } 5892 }); 5893} 5894 5895return Sizzle; 5896 5897})( window ); 5898 5899 5900 5901jQuery1113.find = Sizzle; 5902jQuery1113.expr = Sizzle.selectors; 5903jQuery1113.expr[":"] = jQuery1113.expr.pseudos; 5904jQuery1113.unique = Sizzle.uniqueSort; 5905jQuery1113.text = Sizzle.getText; 5906jQuery1113.isXMLDoc = Sizzle.isXML; 5907jQuery1113.contains = Sizzle.contains; 5908 5909 5910 5911var rneedsContext = jQuery1113.expr.match.needsContext; 5912 5913var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); 5914 5915 5916 5917var risSimple = /^.[^:#\[\.,]*$/; 5918 5919// Implement the identical functionality for filter and not 5920function winnow( elements, qualifier, not ) { 5921 if ( jQuery1113.isFunction( qualifier ) ) { 5922 return jQuery1113.grep( elements, function( elem, i ) { 5923 /* jshint -W018 */ 5924 return !!qualifier.call( elem, i, elem ) !== not; 5925 }); 5926 5927 } 5928 5929 if ( qualifier.nodeType ) { 5930 return jQuery1113.grep( elements, function( elem ) { 5931 return ( elem === qualifier ) !== not; 5932 }); 5933 5934 } 5935 5936 if ( typeof qualifier === "string" ) { 5937 if ( risSimple.test( qualifier ) ) { 5938 return jQuery1113.filter( qualifier, elements, not ); 5939 } 5940 5941 qualifier = jQuery1113.filter( qualifier, elements ); 5942 } 5943 5944 return jQuery1113.grep( elements, function( elem ) { 5945 return ( jQuery1113.inArray( elem, qualifier ) >= 0 ) !== not; 5946 }); 5947} 5948 5949jQuery1113.filter = function( expr, elems, not ) { 5950 var elem = elems[ 0 ]; 5951 5952 if ( not ) { 5953 expr = ":not(" + expr + ")"; 5954 } 5955 5956 return elems.length === 1 && elem.nodeType === 1 ? 5957 jQuery1113.find.matchesSelector( elem, expr ) ? [ elem ] : [] : 5958 jQuery1113.find.matches( expr, jQuery1113.grep( elems, function( elem ) { 5959 return elem.nodeType === 1; 5960 })); 5961}; 5962 5963jQuery1113.fn.extend({ 5964 find: function( selector ) { 5965 var i, 5966 ret = [], 5967 self = this, 5968 len = self.length; 5969 5970 if ( typeof selector !== "string" ) { 5971 return this.pushStack( jQuery1113( selector ).filter(function() { 5972 for ( i = 0; i < len; i++ ) { 5973 if ( jQuery1113.contains( self[ i ], this ) ) { 5974 return true; 5975 } 5976 } 5977 }) ); 5978 } 5979 5980 for ( i = 0; i < len; i++ ) { 5981 jQuery1113.find( selector, self[ i ], ret ); 5982 } 5983 5984 // Needed because $( selector, context ) becomes $( context ).find( selector ) 5985 ret = this.pushStack( len > 1 ? jQuery1113.unique( ret ) : ret ); 5986 ret.selector = this.selector ? this.selector + " " + selector : selector; 5987 return ret; 5988 }, 5989 filter: function( selector ) { 5990 return this.pushStack( winnow(this, selector || [], false) ); 5991 }, 5992 not: function( selector ) { 5993 return this.pushStack( winnow(this, selector || [], true) ); 5994 }, 5995 is: function( selector ) { 5996 return !!winnow( 5997 this, 5998 5999 // If this is a positional/relative selector, check membership in the returned set 6000 // so $("p:first").is("p:last") won't return true for a doc with two "p". 6001 typeof selector === "string" && rneedsContext.test( selector ) ? 6002 jQuery1113( selector ) : 6003 selector || [], 6004 false 6005 ).length; 6006 } 6007}); 6008 6009 6010// Initialize a jQuery1113 object 6011 6012 6013// A central reference to the root jQuery1113(document) 6014var rootjQuery1113, 6015 6016 // Use the correct document accordingly with window argument (sandbox) 6017 document = window.document, 6018 6019 // A simple way to check for HTML strings 6020 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 6021 // Strict HTML recognition (#11290: must start with <) 6022 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 6023 6024 init = jQuery1113.fn.init = function( selector, context ) { 6025 var match, elem; 6026 6027 // HANDLE: $(""), $(null), $(undefined), $(false) 6028 if ( !selector ) { 6029 return this; 6030 } 6031 6032 // Handle HTML strings 6033 if ( typeof selector === "string" ) { 6034 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { 6035 // Assume that strings that start and end with <> are HTML and skip the regex check 6036 match = [ null, selector, null ]; 6037 6038 } else { 6039 match = rquickExpr.exec( selector ); 6040 } 6041 6042 // Match html or make sure no context is specified for #id 6043 if ( match && (match[1] || !context) ) { 6044 6045 // HANDLE: $(html) -> $(array) 6046 if ( match[1] ) { 6047 context = context instanceof jQuery1113 ? context[0] : context; 6048 6049 // scripts is true for back-compat 6050 // Intentionally let the error be thrown if parseHTML is not present 6051 jQuery1113.merge( this, jQuery1113.parseHTML( 6052 match[1], 6053 context && context.nodeType ? context.ownerDocument || context : document, 6054 true 6055 ) ); 6056 6057 // HANDLE: $(html, props) 6058 if ( rsingleTag.test( match[1] ) && jQuery1113.isPlainObject( context ) ) { 6059 for ( match in context ) { 6060 // Properties of context are called as methods if possible 6061 if ( jQuery1113.isFunction( this[ match ] ) ) { 6062 this[ match ]( context[ match ] ); 6063 6064 // ...and otherwise set as attributes 6065 } else { 6066 this.attr( match, context[ match ] ); 6067 } 6068 } 6069 } 6070 6071 return this; 6072 6073 // HANDLE: $(#id) 6074 } else { 6075 elem = document.getElementById( match[2] ); 6076 6077 // Check parentNode to catch when Blackberry 4.6 returns 6078 // nodes that are no longer in the document #6963 6079 if ( elem && elem.parentNode ) { 6080 // Handle the case where IE and Opera return items 6081 // by name instead of ID 6082 if ( elem.id !== match[2] ) { 6083 return rootjQuery1113.find( selector ); 6084 } 6085 6086 // Otherwise, we inject the element directly into the jQuery1113 object 6087 this.length = 1; 6088 this[0] = elem; 6089 } 6090 6091 this.context = document; 6092 this.selector = selector; 6093 return this; 6094 } 6095 6096 // HANDLE: $(expr, $(...)) 6097 } else if ( !context || context.jQuery1113 ) { 6098 return ( context || rootjQuery1113 ).find( selector ); 6099 6100 // HANDLE: $(expr, context) 6101 // (which is just equivalent to: $(context).find(expr) 6102 } else { 6103 return this.constructor( context ).find( selector ); 6104 } 6105 6106 // HANDLE: $(DOMElement) 6107 } else if ( selector.nodeType ) { 6108 this.context = this[0] = selector; 6109 this.length = 1; 6110 return this; 6111 6112 // HANDLE: $(function) 6113 // Shortcut for document ready 6114 } else if ( jQuery1113.isFunction( selector ) ) { 6115 return typeof rootjQuery1113.ready !== "undefined" ? 6116 rootjQuery1113.ready( selector ) : 6117 // Execute immediately if ready is not present 6118 selector( jQuery1113 ); 6119 } 6120 6121 if ( selector.selector !== undefined ) { 6122 this.selector = selector.selector; 6123 this.context = selector.context; 6124 } 6125 6126 return jQuery1113.makeArray( selector, this ); 6127 }; 6128 6129// Give the init function the jQuery1113 prototype for later instantiation 6130init.prototype = jQuery1113.fn; 6131 6132// Initialize central reference 6133rootjQuery1113 = jQuery1113( document ); 6134 6135 6136var rparentsprev = /^(?:parents|prev(?:Until|All))/, 6137 // methods guaranteed to produce a unique set when starting from a unique set 6138 guaranteedUnique = { 6139 children: true, 6140 contents: true, 6141 next: true, 6142 prev: true 6143 }; 6144 6145jQuery1113.extend({ 6146 dir: function( elem, dir, until ) { 6147 var matched = [], 6148 cur = elem[ dir ]; 6149 6150 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery1113( cur ).is( until )) ) { 6151 if ( cur.nodeType === 1 ) { 6152 matched.push( cur ); 6153 } 6154 cur = cur[dir]; 6155 } 6156 return matched; 6157 }, 6158 6159 sibling: function( n, elem ) { 6160 var r = []; 6161 6162 for ( ; n; n = n.nextSibling ) { 6163 if ( n.nodeType === 1 && n !== elem ) { 6164 r.push( n ); 6165 } 6166 } 6167 6168 return r; 6169 } 6170}); 6171 6172jQuery1113.fn.extend({ 6173 has: function( target ) { 6174 var i, 6175 targets = jQuery1113( target, this ), 6176 len = targets.length; 6177 6178 return this.filter(function() { 6179 for ( i = 0; i < len; i++ ) { 6180 if ( jQuery1113.contains( this, targets[i] ) ) { 6181 return true; 6182 } 6183 } 6184 }); 6185 }, 6186 6187 closest: function( selectors, context ) { 6188 var cur, 6189 i = 0, 6190 l = this.length, 6191 matched = [], 6192 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? 6193 jQuery1113( selectors, context || this.context ) : 6194 0; 6195 6196 for ( ; i < l; i++ ) { 6197 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { 6198 // Always skip document fragments 6199 if ( cur.nodeType < 11 && (pos ? 6200 pos.index(cur) > -1 : 6201 6202 // Don't pass non-elements to Sizzle 6203 cur.nodeType === 1 && 6204 jQuery1113.find.matchesSelector(cur, selectors)) ) { 6205 6206 matched.push( cur ); 6207 break; 6208 } 6209 } 6210 } 6211 6212 return this.pushStack( matched.length > 1 ? jQuery1113.unique( matched ) : matched ); 6213 }, 6214 6215 // Determine the position of an element within 6216 // the matched set of elements 6217 index: function( elem ) { 6218 6219 // No argument, return index in parent 6220 if ( !elem ) { 6221 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; 6222 } 6223 6224 // index in selector 6225 if ( typeof elem === "string" ) { 6226 return jQuery1113.inArray( this[0], jQuery1113( elem ) ); 6227 } 6228 6229 // Locate the position of the desired element 6230 return jQuery1113.inArray( 6231 // If it receives a jQuery1113 object, the first element is used 6232 elem.jQuery1113 ? elem[0] : elem, this ); 6233 }, 6234 6235 add: function( selector, context ) { 6236 return this.pushStack( 6237 jQuery1113.unique( 6238 jQuery1113.merge( this.get(), jQuery1113( selector, context ) ) 6239 ) 6240 ); 6241 }, 6242 6243 addBack: function( selector ) { 6244 return this.add( selector == null ? 6245 this.prevObject : this.prevObject.filter(selector) 6246 ); 6247 } 6248}); 6249 6250function sibling( cur, dir ) { 6251 do { 6252 cur = cur[ dir ]; 6253 } while ( cur && cur.nodeType !== 1 ); 6254 6255 return cur; 6256} 6257 6258jQuery1113.each({ 6259 parent: function( elem ) { 6260 var parent = elem.parentNode; 6261 return parent && parent.nodeType !== 11 ? parent : null; 6262 }, 6263 parents: function( elem ) { 6264 return jQuery1113.dir( elem, "parentNode" ); 6265 }, 6266 parentsUntil: function( elem, i, until ) { 6267 return jQuery1113.dir( elem, "parentNode", until ); 6268 }, 6269 next: function( elem ) { 6270 return sibling( elem, "nextSibling" ); 6271 }, 6272 prev: function( elem ) { 6273 return sibling( elem, "previousSibling" ); 6274 }, 6275 nextAll: function( elem ) { 6276 return jQuery1113.dir( elem, "nextSibling" ); 6277 }, 6278 prevAll: function( elem ) { 6279 return jQuery1113.dir( elem, "previousSibling" ); 6280 }, 6281 nextUntil: function( elem, i, until ) { 6282 return jQuery1113.dir( elem, "nextSibling", until ); 6283 }, 6284 prevUntil: function( elem, i, until ) { 6285 return jQuery1113.dir( elem, "previousSibling", until ); 6286 }, 6287 siblings: function( elem ) { 6288 return jQuery1113.sibling( ( elem.parentNode || {} ).firstChild, elem ); 6289 }, 6290 children: function( elem ) { 6291 return jQuery1113.sibling( elem.firstChild ); 6292 }, 6293 contents: function( elem ) { 6294 return jQuery1113.nodeName( elem, "iframe" ) ? 6295 elem.contentDocument || elem.contentWindow.document : 6296 jQuery1113.merge( [], elem.childNodes ); 6297 } 6298}, function( name, fn ) { 6299 jQuery1113.fn[ name ] = function( until, selector ) { 6300 var ret = jQuery1113.map( this, fn, until ); 6301 6302 if ( name.slice( -5 ) !== "Until" ) { 6303 selector = until; 6304 } 6305 6306 if ( selector && typeof selector === "string" ) { 6307 ret = jQuery1113.filter( selector, ret ); 6308 } 6309 6310 if ( this.length > 1 ) { 6311 // Remove duplicates 6312 if ( !guaranteedUnique[ name ] ) { 6313 ret = jQuery1113.unique( ret ); 6314 } 6315 6316 // Reverse order for parents* and prev-derivatives 6317 if ( rparentsprev.test( name ) ) { 6318 ret = ret.reverse(); 6319 } 6320 } 6321 6322 return this.pushStack( ret ); 6323 }; 6324}); 6325var rnotwhite = (/\S+/g); 6326 6327 6328 6329// String to Object options format cache 6330var optionsCache = {}; 6331 6332// Convert String-formatted options into Object-formatted ones and store in cache 6333function createOptions( options ) { 6334 var object = optionsCache[ options ] = {}; 6335 jQuery1113.each( options.match( rnotwhite ) || [], function( _, flag ) { 6336 object[ flag ] = true; 6337 }); 6338 return object; 6339} 6340 6341/* 6342 * Create a callback list using the following parameters: 6343 * 6344 * options: an optional list of space-separated options that will change how 6345 * the callback list behaves or a more traditional option object 6346 * 6347 * By default a callback list will act like an event callback list and can be 6348 * "fired" multiple times. 6349 * 6350 * Possible options: 6351 * 6352 * once: will ensure the callback list can only be fired once (like a Deferred) 6353 * 6354 * memory: will keep track of previous values and will call any callback added 6355 * after the list has been fired right away with the latest "memorized" 6356 * values (like a Deferred) 6357 * 6358 * unique: will ensure a callback can only be added once (no duplicate in the list) 6359 * 6360 * stopOnFalse: interrupt callings when a callback returns false 6361 * 6362 */ 6363jQuery1113.Callbacks = function( options ) { 6364 6365 // Convert options from String-formatted to Object-formatted if needed 6366 // (we check in cache first) 6367 options = typeof options === "string" ? 6368 ( optionsCache[ options ] || createOptions( options ) ) : 6369 jQuery1113.extend( {}, options ); 6370 6371 var // Flag to know if list is currently firing 6372 firing, 6373 // Last fire value (for non-forgettable lists) 6374 memory, 6375 // Flag to know if list was already fired 6376 fired, 6377 // End of the loop when firing 6378 firingLength, 6379 // Index of currently firing callback (modified by remove if needed) 6380 firingIndex, 6381 // First callback to fire (used internally by add and fireWith) 6382 firingStart, 6383 // Actual callback list 6384 list = [], 6385 // Stack of fire calls for repeatable lists 6386 stack = !options.once && [], 6387 // Fire callbacks 6388 fire = function( data ) { 6389 memory = options.memory && data; 6390 fired = true; 6391 firingIndex = firingStart || 0; 6392 firingStart = 0; 6393 firingLength = list.length; 6394 firing = true; 6395 for ( ; list && firingIndex < firingLength; firingIndex++ ) { 6396 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { 6397 memory = false; // To prevent further calls using add 6398 break; 6399 } 6400 } 6401 firing = false; 6402 if ( list ) { 6403 if ( stack ) { 6404 if ( stack.length ) { 6405 fire( stack.shift() ); 6406 } 6407 } else if ( memory ) { 6408 list = []; 6409 } else { 6410 self.disable(); 6411 } 6412 } 6413 }, 6414 // Actual Callbacks object 6415 self = { 6416 // Add a callback or a collection of callbacks to the list 6417 add: function() { 6418 if ( list ) { 6419 // First, we save the current length 6420 var start = list.length; 6421 (function add( args ) { 6422 jQuery1113.each( args, function( _, arg ) { 6423 var type = jQuery1113.type( arg ); 6424 if ( type === "function" ) { 6425 if ( !options.unique || !self.has( arg ) ) { 6426 list.push( arg ); 6427 } 6428 } else if ( arg && arg.length && type !== "string" ) { 6429 // Inspect recursively 6430 add( arg ); 6431 } 6432 }); 6433 })( arguments ); 6434 // Do we need to add the callbacks to the 6435 // current firing batch? 6436 if ( firing ) { 6437 firingLength = list.length; 6438 // With memory, if we're not firing then 6439 // we should call right away 6440 } else if ( memory ) { 6441 firingStart = start; 6442 fire( memory ); 6443 } 6444 } 6445 return this; 6446 }, 6447 // Remove a callback from the list 6448 remove: function() { 6449 if ( list ) { 6450 jQuery1113.each( arguments, function( _, arg ) { 6451 var index; 6452 while ( ( index = jQuery1113.inArray( arg, list, index ) ) > -1 ) { 6453 list.splice( index, 1 ); 6454 // Handle firing indexes 6455 if ( firing ) { 6456 if ( index <= firingLength ) { 6457 firingLength--; 6458 } 6459 if ( index <= firingIndex ) { 6460 firingIndex--; 6461 } 6462 } 6463 } 6464 }); 6465 } 6466 return this; 6467 }, 6468 // Check if a given callback is in the list. 6469 // If no argument is given, return whether or not list has callbacks attached. 6470 has: function( fn ) { 6471 return fn ? jQuery1113.inArray( fn, list ) > -1 : !!( list && list.length ); 6472 }, 6473 // Remove all callbacks from the list 6474 empty: function() { 6475 list = []; 6476 firingLength = 0; 6477 return this; 6478 }, 6479 // Have the list do nothing anymore 6480 disable: function() { 6481 list = stack = memory = undefined; 6482 return this; 6483 }, 6484 // Is it disabled? 6485 disabled: function() { 6486 return !list; 6487 }, 6488 // Lock the list in its current state 6489 lock: function() { 6490 stack = undefined; 6491 if ( !memory ) { 6492 self.disable(); 6493 } 6494 return this; 6495 }, 6496 // Is it locked? 6497 locked: function() { 6498 return !stack; 6499 }, 6500 // Call all callbacks with the given context and arguments 6501 fireWith: function( context, args ) { 6502 if ( list && ( !fired || stack ) ) { 6503 args = args || []; 6504 args = [ context, args.slice ? args.slice() : args ]; 6505 if ( firing ) { 6506 stack.push( args ); 6507 } else { 6508 fire( args ); 6509 } 6510 } 6511 return this; 6512 }, 6513 // Call all the callbacks with the given arguments 6514 fire: function() { 6515 self.fireWith( this, arguments ); 6516 return this; 6517 }, 6518 // To know if the callbacks have already been called at least once 6519 fired: function() { 6520 return !!fired; 6521 } 6522 }; 6523 6524 return self; 6525}; 6526 6527 6528jQuery1113.extend({ 6529 6530 Deferred: function( func ) { 6531 var tuples = [ 6532 // action, add listener, listener list, final state 6533 [ "resolve", "done", jQuery1113.Callbacks("once memory"), "resolved" ], 6534 [ "reject", "fail", jQuery1113.Callbacks("once memory"), "rejected" ], 6535 [ "notify", "progress", jQuery1113.Callbacks("memory") ] 6536 ], 6537 state = "pending", 6538 promise = { 6539 state: function() { 6540 return state; 6541 }, 6542 always: function() { 6543 deferred.done( arguments ).fail( arguments ); 6544 return this; 6545 }, 6546 then: function( /* fnDone, fnFail, fnProgress */ ) { 6547 var fns = arguments; 6548 return jQuery1113.Deferred(function( newDefer ) { 6549 jQuery1113.each( tuples, function( i, tuple ) { 6550 var fn = jQuery1113.isFunction( fns[ i ] ) && fns[ i ]; 6551 // deferred[ done | fail | progress ] for forwarding actions to newDefer 6552 deferred[ tuple[1] ](function() { 6553 var returned = fn && fn.apply( this, arguments ); 6554 if ( returned && jQuery1113.isFunction( returned.promise ) ) { 6555 returned.promise() 6556 .done( newDefer.resolve ) 6557 .fail( newDefer.reject ) 6558 .progress( newDefer.notify ); 6559 } else { 6560 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); 6561 } 6562 }); 6563 }); 6564 fns = null; 6565 }).promise(); 6566 }, 6567 // Get a promise for this deferred 6568 // If obj is provided, the promise aspect is added to the object 6569 promise: function( obj ) { 6570 return obj != null ? jQuery1113.extend( obj, promise ) : promise; 6571 } 6572 }, 6573 deferred = {}; 6574 6575 // Keep pipe for back-compat 6576 promise.pipe = promise.then; 6577 6578 // Add list-specific methods 6579 jQuery1113.each( tuples, function( i, tuple ) { 6580 var list = tuple[ 2 ], 6581 stateString = tuple[ 3 ]; 6582 6583 // promise[ done | fail | progress ] = list.add 6584 promise[ tuple[1] ] = list.add; 6585 6586 // Handle state 6587 if ( stateString ) { 6588 list.add(function() { 6589 // state = [ resolved | rejected ] 6590 state = stateString; 6591 6592 // [ reject_list | resolve_list ].disable; progress_list.lock 6593 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 6594 } 6595 6596 // deferred[ resolve | reject | notify ] 6597 deferred[ tuple[0] ] = function() { 6598 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); 6599 return this; 6600 }; 6601 deferred[ tuple[0] + "With" ] = list.fireWith; 6602 }); 6603 6604 // Make the deferred a promise 6605 promise.promise( deferred ); 6606 6607 // Call given func if any 6608 if ( func ) { 6609 func.call( deferred, deferred ); 6610 } 6611 6612 // All done! 6613 return deferred; 6614 }, 6615 6616 // Deferred helper 6617 when: function( subordinate /* , ..., subordinateN */ ) { 6618 var i = 0, 6619 resolveValues = slice.call( arguments ), 6620 length = resolveValues.length, 6621 6622 // the count of uncompleted subordinates 6623 remaining = length !== 1 || ( subordinate && jQuery1113.isFunction( subordinate.promise ) ) ? length : 0, 6624 6625 // the master Deferred. If resolveValues consist of only a single Deferred, just use that. 6626 deferred = remaining === 1 ? subordinate : jQuery1113.Deferred(), 6627 6628 // Update function for both resolve and progress values 6629 updateFunc = function( i, contexts, values ) { 6630 return function( value ) { 6631 contexts[ i ] = this; 6632 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 6633 if ( values === progressValues ) { 6634 deferred.notifyWith( contexts, values ); 6635 6636 } else if ( !(--remaining) ) { 6637 deferred.resolveWith( contexts, values ); 6638 } 6639 }; 6640 }, 6641 6642 progressValues, progressContexts, resolveContexts; 6643 6644 // add listeners to Deferred subordinates; treat others as resolved 6645 if ( length > 1 ) { 6646 progressValues = new Array( length ); 6647 progressContexts = new Array( length ); 6648 resolveContexts = new Array( length ); 6649 for ( ; i < length; i++ ) { 6650 if ( resolveValues[ i ] && jQuery1113.isFunction( resolveValues[ i ].promise ) ) { 6651 resolveValues[ i ].promise() 6652 .done( updateFunc( i, resolveContexts, resolveValues ) ) 6653 .fail( deferred.reject ) 6654 .progress( updateFunc( i, progressContexts, progressValues ) ); 6655 } else { 6656 --remaining; 6657 } 6658 } 6659 } 6660 6661 // if we're not waiting on anything, resolve the master 6662 if ( !remaining ) { 6663 deferred.resolveWith( resolveContexts, resolveValues ); 6664 } 6665 6666 return deferred.promise(); 6667 } 6668}); 6669 6670 6671// The deferred used on DOM ready 6672var readyList; 6673 6674jQuery1113.fn.ready = function( fn ) { 6675 // Add the callback 6676 jQuery1113.ready.promise().done( fn ); 6677 6678 return this; 6679}; 6680 6681jQuery1113.extend({ 6682 // Is the DOM ready to be used? Set to true once it occurs. 6683 isReady: false, 6684 6685 // A counter to track how many items to wait for before 6686 // the ready event fires. See #6781 6687 readyWait: 1, 6688 6689 // Hold (or release) the ready event 6690 holdReady: function( hold ) { 6691 if ( hold ) { 6692 jQuery1113.readyWait++; 6693 } else { 6694 jQuery1113.ready( true ); 6695 } 6696 }, 6697 6698 // Handle when the DOM is ready 6699 ready: function( wait ) { 6700 6701 // Abort if there are pending holds or we're already ready 6702 if ( wait === true ? --jQuery1113.readyWait : jQuery1113.isReady ) { 6703 return; 6704 } 6705 6706 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). 6707 if ( !document.body ) { 6708 return setTimeout( jQuery1113.ready ); 6709 } 6710 6711 // Remember that the DOM is ready 6712 jQuery1113.isReady = true; 6713 6714 // If a normal DOM Ready event fired, decrement, and wait if need be 6715 if ( wait !== true && --jQuery1113.readyWait > 0 ) { 6716 return; 6717 } 6718 6719 // If there are functions bound, to execute 6720 readyList.resolveWith( document, [ jQuery1113 ] ); 6721 6722 // Trigger any bound ready events 6723 if ( jQuery1113.fn.triggerHandler ) { 6724 jQuery1113( document ).triggerHandler( "ready" ); 6725 jQuery1113( document ).off( "ready" ); 6726 } 6727 } 6728}); 6729 6730/** 6731 * Clean-up method for dom ready events 6732 */ 6733function detach() { 6734 if ( document.addEventListener ) { 6735 document.removeEventListener( "DOMContentLoaded", completed, false ); 6736 window.removeEventListener( "load", completed, false ); 6737 6738 } else { 6739 document.detachEvent( "onreadystatechange", completed ); 6740 window.detachEvent( "onload", completed ); 6741 } 6742} 6743 6744/** 6745 * The ready event handler and self cleanup method 6746 */ 6747function completed() { 6748 // readyState === "complete" is good enough for us to call the dom ready in oldIE 6749 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { 6750 detach(); 6751 jQuery1113.ready(); 6752 } 6753} 6754 6755jQuery1113.ready.promise = function( obj ) { 6756 if ( !readyList ) { 6757 6758 readyList = jQuery1113.Deferred(); 6759 6760 // Catch cases where $(document).ready() is called after the browser event has already occurred. 6761 // we once tried to use readyState "interactive" here, but it caused issues like the one 6762 // discovered by ChrisS here: http://bugs.jQuery1113.com/ticket/12282#comment:15 6763 if ( document.readyState === "complete" ) { 6764 // Handle it asynchronously to allow scripts the opportunity to delay ready 6765 setTimeout( jQuery1113.ready ); 6766 6767 // Standards-based browsers support DOMContentLoaded 6768 } else if ( document.addEventListener ) { 6769 // Use the handy event callback 6770 document.addEventListener( "DOMContentLoaded", completed, false ); 6771 6772 // A fallback to window.onload, that will always work 6773 window.addEventListener( "load", completed, false ); 6774 6775 // If IE event model is used 6776 } else { 6777 // Ensure firing before onload, maybe late but safe also for iframes 6778 document.attachEvent( "onreadystatechange", completed ); 6779 6780 // A fallback to window.onload, that will always work 6781 window.attachEvent( "onload", completed ); 6782 6783 // If IE and not a frame 6784 // continually check to see if the document is ready 6785 var top = false; 6786 6787 try { 6788 top = window.frameElement == null && document.documentElement; 6789 } catch(e) {} 6790 6791 if ( top && top.doScroll ) { 6792 (function doScrollCheck() { 6793 if ( !jQuery1113.isReady ) { 6794 6795 try { 6796 // Use the trick by Diego Perini 6797 // http://javascript.nwbox.com/IEContentLoaded/ 6798 top.doScroll("left"); 6799 } catch(e) { 6800 return setTimeout( doScrollCheck, 50 ); 6801 } 6802 6803 // detach all dom ready events 6804 detach(); 6805 6806 // and execute any waiting functions 6807 jQuery1113.ready(); 6808 } 6809 })(); 6810 } 6811 } 6812 } 6813 return readyList.promise( obj ); 6814}; 6815 6816 6817var strundefined = typeof undefined; 6818 6819 6820 6821// Support: IE<9 6822// Iteration over object's inherited properties before its own 6823var i; 6824for ( i in jQuery1113( support ) ) { 6825 break; 6826} 6827support.ownLast = i !== "0"; 6828 6829// Note: most support tests are defined in their respective modules. 6830// false until the test is run 6831support.inlineBlockNeedsLayout = false; 6832 6833// Execute ASAP in case we need to set body.style.zoom 6834jQuery1113(function() { 6835 // Minified: var a,b,c,d 6836 var val, div, body, container; 6837 6838 body = document.getElementsByTagName( "body" )[ 0 ]; 6839 if ( !body || !body.style ) { 6840 // Return for frameset docs that don't have a body 6841 return; 6842 } 6843 6844 // Setup 6845 div = document.createElement( "div" ); 6846 container = document.createElement( "div" ); 6847 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 6848 body.appendChild( container ).appendChild( div ); 6849 6850 if ( typeof div.style.zoom !== strundefined ) { 6851 // Support: IE<8 6852 // Check if natively block-level elements act like inline-block 6853 // elements when setting their display to 'inline' and giving 6854 // them layout 6855 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; 6856 6857 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; 6858 if ( val ) { 6859 // Prevent IE 6 from affecting layout for positioned elements #11048 6860 // Prevent IE from shrinking the body in IE 7 mode #12869 6861 // Support: IE<8 6862 body.style.zoom = 1; 6863 } 6864 } 6865 6866 body.removeChild( container ); 6867}); 6868 6869 6870 6871 6872(function() { 6873 var div = document.createElement( "div" ); 6874 6875 // Execute the test only if not already executed in another module. 6876 if (support.deleteExpando == null) { 6877 // Support: IE<9 6878 support.deleteExpando = true; 6879 try { 6880 delete div.test; 6881 } catch( e ) { 6882 support.deleteExpando = false; 6883 } 6884 } 6885 6886 // Null elements to avoid leaks in IE. 6887 div = null; 6888})(); 6889 6890 6891/** 6892 * Determines whether an object can have data 6893 */ 6894jQuery1113.acceptData = function( elem ) { 6895 var noData = jQuery1113.noData[ (elem.nodeName + " ").toLowerCase() ], 6896 nodeType = +elem.nodeType || 1; 6897 6898 // Do not set data on non-element DOM nodes because it will not be cleared (#8335). 6899 return nodeType !== 1 && nodeType !== 9 ? 6900 false : 6901 6902 // Nodes accept data unless otherwise specified; rejection can be conditional 6903 !noData || noData !== true && elem.getAttribute("classid") === noData; 6904}; 6905 6906 6907var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 6908 rmultiDash = /([A-Z])/g; 6909 6910function dataAttr( elem, key, data ) { 6911 // If nothing was found internally, try to fetch any 6912 // data from the HTML5 data-* attribute 6913 if ( data === undefined && elem.nodeType === 1 ) { 6914 6915 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 6916 6917 data = elem.getAttribute( name ); 6918 6919 if ( typeof data === "string" ) { 6920 try { 6921 data = data === "true" ? true : 6922 data === "false" ? false : 6923 data === "null" ? null : 6924 // Only convert to a number if it doesn't change the string 6925 +data + "" === data ? +data : 6926 rbrace.test( data ) ? jQuery1113.parseJSON( data ) : 6927 data; 6928 } catch( e ) {} 6929 6930 // Make sure we set the data so it isn't changed later 6931 jQuery1113.data( elem, key, data ); 6932 6933 } else { 6934 data = undefined; 6935 } 6936 } 6937 6938 return data; 6939} 6940 6941// checks a cache object for emptiness 6942function isEmptyDataObject( obj ) { 6943 var name; 6944 for ( name in obj ) { 6945 6946 // if the public data object is empty, the private is still empty 6947 if ( name === "data" && jQuery1113.isEmptyObject( obj[name] ) ) { 6948 continue; 6949 } 6950 if ( name !== "toJSON" ) { 6951 return false; 6952 } 6953 } 6954 6955 return true; 6956} 6957 6958function internalData( elem, name, data, pvt /* Internal Use Only */ ) { 6959 if ( !jQuery1113.acceptData( elem ) ) { 6960 return; 6961 } 6962 6963 var ret, thisCache, 6964 internalKey = jQuery1113.expando, 6965 6966 // We have to handle DOM nodes and JS objects differently because IE6-7 6967 // can't GC object references properly across the DOM-JS boundary 6968 isNode = elem.nodeType, 6969 6970 // Only DOM nodes need the global jQuery1113 cache; JS object data is 6971 // attached directly to the object so GC can occur automatically 6972 cache = isNode ? jQuery1113.cache : elem, 6973 6974 // Only defining an ID for JS objects if its cache already exists allows 6975 // the code to shortcut on the same path as a DOM node with no cache 6976 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; 6977 6978 // Avoid doing any more work than we need to when trying to get data on an 6979 // object that has no data at all 6980 if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { 6981 return; 6982 } 6983 6984 if ( !id ) { 6985 // Only DOM nodes need a new unique ID for each element since their data 6986 // ends up in the global cache 6987 if ( isNode ) { 6988 id = elem[ internalKey ] = deletedIds.pop() || jQuery1113.guid++; 6989 } else { 6990 id = internalKey; 6991 } 6992 } 6993 6994 if ( !cache[ id ] ) { 6995 // Avoid exposing jQuery1113 metadata on plain JS objects when the object 6996 // is serialized using JSON.stringify 6997 cache[ id ] = isNode ? {} : { toJSON: jQuery1113.noop }; 6998 } 6999 7000 // An object can be passed to jQuery1113.data instead of a key/value pair; this gets 7001 // shallow copied over onto the existing cache 7002 if ( typeof name === "object" || typeof name === "function" ) { 7003 if ( pvt ) { 7004 cache[ id ] = jQuery1113.extend( cache[ id ], name ); 7005 } else { 7006 cache[ id ].data = jQuery1113.extend( cache[ id ].data, name ); 7007 } 7008 } 7009 7010 thisCache = cache[ id ]; 7011 7012 // jQuery1113 data() is stored in a separate object inside the object's internal data 7013 // cache in order to avoid key collisions between internal data and user-defined 7014 // data. 7015 if ( !pvt ) { 7016 if ( !thisCache.data ) { 7017 thisCache.data = {}; 7018 } 7019 7020 thisCache = thisCache.data; 7021 } 7022 7023 if ( data !== undefined ) { 7024 thisCache[ jQuery1113.camelCase( name ) ] = data; 7025 } 7026 7027 // Check for both converted-to-camel and non-converted data property names 7028 // If a data property was specified 7029 if ( typeof name === "string" ) { 7030 7031 // First Try to find as-is property data 7032 ret = thisCache[ name ]; 7033 7034 // Test for null|undefined property data 7035 if ( ret == null ) { 7036 7037 // Try to find the camelCased property 7038 ret = thisCache[ jQuery1113.camelCase( name ) ]; 7039 } 7040 } else { 7041 ret = thisCache; 7042 } 7043 7044 return ret; 7045} 7046 7047function internalRemoveData( elem, name, pvt ) { 7048 if ( !jQuery1113.acceptData( elem ) ) { 7049 return; 7050 } 7051 7052 var thisCache, i, 7053 isNode = elem.nodeType, 7054 7055 // See jQuery1113.data for more information 7056 cache = isNode ? jQuery1113.cache : elem, 7057 id = isNode ? elem[ jQuery1113.expando ] : jQuery1113.expando; 7058 7059 // If there is already no cache entry for this object, there is no 7060 // purpose in continuing 7061 if ( !cache[ id ] ) { 7062 return; 7063 } 7064 7065 if ( name ) { 7066 7067 thisCache = pvt ? cache[ id ] : cache[ id ].data; 7068 7069 if ( thisCache ) { 7070 7071 // Support array or space separated string names for data keys 7072 if ( !jQuery1113.isArray( name ) ) { 7073 7074 // try the string as a key before any manipulation 7075 if ( name in thisCache ) { 7076 name = [ name ]; 7077 } else { 7078 7079 // split the camel cased version by spaces unless a key with the spaces exists 7080 name = jQuery1113.camelCase( name ); 7081 if ( name in thisCache ) { 7082 name = [ name ]; 7083 } else { 7084 name = name.split(" "); 7085 } 7086 } 7087 } else { 7088 // If "name" is an array of keys... 7089 // When data is initially created, via ("key", "val") signature, 7090 // keys will be converted to camelCase. 7091 // Since there is no way to tell _how_ a key was added, remove 7092 // both plain key and camelCase key. #12786 7093 // This will only penalize the array argument path. 7094 name = name.concat( jQuery1113.map( name, jQuery1113.camelCase ) ); 7095 } 7096 7097 i = name.length; 7098 while ( i-- ) { 7099 delete thisCache[ name[i] ]; 7100 } 7101 7102 // If there is no data left in the cache, we want to continue 7103 // and let the cache object itself get destroyed 7104 if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery1113.isEmptyObject(thisCache) ) { 7105 return; 7106 } 7107 } 7108 } 7109 7110 // See jQuery1113.data for more information 7111 if ( !pvt ) { 7112 delete cache[ id ].data; 7113 7114 // Don't destroy the parent cache unless the internal data object 7115 // had been the only thing left in it 7116 if ( !isEmptyDataObject( cache[ id ] ) ) { 7117 return; 7118 } 7119 } 7120 7121 // Destroy the cache 7122 if ( isNode ) { 7123 jQuery1113.cleanData( [ elem ], true ); 7124 7125 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) 7126 /* jshint eqeqeq: false */ 7127 } else if ( support.deleteExpando || cache != cache.window ) { 7128 /* jshint eqeqeq: true */ 7129 delete cache[ id ]; 7130 7131 // When all else fails, null 7132 } else { 7133 cache[ id ] = null; 7134 } 7135} 7136 7137jQuery1113.extend({ 7138 cache: {}, 7139 7140 // The following elements (space-suffixed to avoid Object.prototype collisions) 7141 // throw uncatchable exceptions if you attempt to set expando properties 7142 noData: { 7143 "applet ": true, 7144 "embed ": true, 7145 // ...but Flash objects (which have this classid) *can* handle expandos 7146 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 7147 }, 7148 7149 hasData: function( elem ) { 7150 elem = elem.nodeType ? jQuery1113.cache[ elem[jQuery1113.expando] ] : elem[ jQuery1113.expando ]; 7151 return !!elem && !isEmptyDataObject( elem ); 7152 }, 7153 7154 data: function( elem, name, data ) { 7155 return internalData( elem, name, data ); 7156 }, 7157 7158 removeData: function( elem, name ) { 7159 return internalRemoveData( elem, name ); 7160 }, 7161 7162 // For internal use only. 7163 _data: function( elem, name, data ) { 7164 return internalData( elem, name, data, true ); 7165 }, 7166 7167 _removeData: function( elem, name ) { 7168 return internalRemoveData( elem, name, true ); 7169 } 7170}); 7171 7172jQuery1113.fn.extend({ 7173 data: function( key, value ) { 7174 var i, name, data, 7175 elem = this[0], 7176 attrs = elem && elem.attributes; 7177 7178 // Special expections of .data basically thwart jQuery1113.access, 7179 // so implement the relevant behavior ourselves 7180 7181 // Gets all values 7182 if ( key === undefined ) { 7183 if ( this.length ) { 7184 data = jQuery1113.data( elem ); 7185 7186 if ( elem.nodeType === 1 && !jQuery1113._data( elem, "parsedAttrs" ) ) { 7187 i = attrs.length; 7188 while ( i-- ) { 7189 7190 // Support: IE11+ 7191 // The attrs elements can be null (#14894) 7192 if ( attrs[ i ] ) { 7193 name = attrs[ i ].name; 7194 if ( name.indexOf( "data-" ) === 0 ) { 7195 name = jQuery1113.camelCase( name.slice(5) ); 7196 dataAttr( elem, name, data[ name ] ); 7197 } 7198 } 7199 } 7200 jQuery1113._data( elem, "parsedAttrs", true ); 7201 } 7202 } 7203 7204 return data; 7205 } 7206 7207 // Sets multiple values 7208 if ( typeof key === "object" ) { 7209 return this.each(function() { 7210 jQuery1113.data( this, key ); 7211 }); 7212 } 7213 7214 return arguments.length > 1 ? 7215 7216 // Sets one value 7217 this.each(function() { 7218 jQuery1113.data( this, key, value ); 7219 }) : 7220 7221 // Gets one value 7222 // Try to fetch any internally stored data first 7223 elem ? dataAttr( elem, key, jQuery1113.data( elem, key ) ) : undefined; 7224 }, 7225 7226 removeData: function( key ) { 7227 return this.each(function() { 7228 jQuery1113.removeData( this, key ); 7229 }); 7230 } 7231}); 7232 7233 7234jQuery1113.extend({ 7235 queue: function( elem, type, data ) { 7236 var queue; 7237 7238 if ( elem ) { 7239 type = ( type || "fx" ) + "queue"; 7240 queue = jQuery1113._data( elem, type ); 7241 7242 // Speed up dequeue by getting out quickly if this is just a lookup 7243 if ( data ) { 7244 if ( !queue || jQuery1113.isArray(data) ) { 7245 queue = jQuery1113._data( elem, type, jQuery1113.makeArray(data) ); 7246 } else { 7247 queue.push( data ); 7248 } 7249 } 7250 return queue || []; 7251 } 7252 }, 7253 7254 dequeue: function( elem, type ) { 7255 type = type || "fx"; 7256 7257 var queue = jQuery1113.queue( elem, type ), 7258 startLength = queue.length, 7259 fn = queue.shift(), 7260 hooks = jQuery1113._queueHooks( elem, type ), 7261 next = function() { 7262 jQuery1113.dequeue( elem, type ); 7263 }; 7264 7265 // If the fx queue is dequeued, always remove the progress sentinel 7266 if ( fn === "inprogress" ) { 7267 fn = queue.shift(); 7268 startLength--; 7269 } 7270 7271 if ( fn ) { 7272 7273 // Add a progress sentinel to prevent the fx queue from being 7274 // automatically dequeued 7275 if ( type === "fx" ) { 7276 queue.unshift( "inprogress" ); 7277 } 7278 7279 // clear up the last queue stop function 7280 delete hooks.stop; 7281 fn.call( elem, next, hooks ); 7282 } 7283 7284 if ( !startLength && hooks ) { 7285 hooks.empty.fire(); 7286 } 7287 }, 7288 7289 // not intended for public consumption - generates a queueHooks object, or returns the current one 7290 _queueHooks: function( elem, type ) { 7291 var key = type + "queueHooks"; 7292 return jQuery1113._data( elem, key ) || jQuery1113._data( elem, key, { 7293 empty: jQuery1113.Callbacks("once memory").add(function() { 7294 jQuery1113._removeData( elem, type + "queue" ); 7295 jQuery1113._removeData( elem, key ); 7296 }) 7297 }); 7298 } 7299}); 7300 7301jQuery1113.fn.extend({ 7302 queue: function( type, data ) { 7303 var setter = 2; 7304 7305 if ( typeof type !== "string" ) { 7306 data = type; 7307 type = "fx"; 7308 setter--; 7309 } 7310 7311 if ( arguments.length < setter ) { 7312 return jQuery1113.queue( this[0], type ); 7313 } 7314 7315 return data === undefined ? 7316 this : 7317 this.each(function() { 7318 var queue = jQuery1113.queue( this, type, data ); 7319 7320 // ensure a hooks for this queue 7321 jQuery1113._queueHooks( this, type ); 7322 7323 if ( type === "fx" && queue[0] !== "inprogress" ) { 7324 jQuery1113.dequeue( this, type ); 7325 } 7326 }); 7327 }, 7328 dequeue: function( type ) { 7329 return this.each(function() { 7330 jQuery1113.dequeue( this, type ); 7331 }); 7332 }, 7333 clearQueue: function( type ) { 7334 return this.queue( type || "fx", [] ); 7335 }, 7336 // Get a promise resolved when queues of a certain type 7337 // are emptied (fx is the type by default) 7338 promise: function( type, obj ) { 7339 var tmp, 7340 count = 1, 7341 defer = jQuery1113.Deferred(), 7342 elements = this, 7343 i = this.length, 7344 resolve = function() { 7345 if ( !( --count ) ) { 7346 defer.resolveWith( elements, [ elements ] ); 7347 } 7348 }; 7349 7350 if ( typeof type !== "string" ) { 7351 obj = type; 7352 type = undefined; 7353 } 7354 type = type || "fx"; 7355 7356 while ( i-- ) { 7357 tmp = jQuery1113._data( elements[ i ], type + "queueHooks" ); 7358 if ( tmp && tmp.empty ) { 7359 count++; 7360 tmp.empty.add( resolve ); 7361 } 7362 } 7363 resolve(); 7364 return defer.promise( obj ); 7365 } 7366}); 7367var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; 7368 7369var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 7370 7371var isHidden = function( elem, el ) { 7372 // isHidden might be called from jQuery1113#filter function; 7373 // in that case, element will be second argument 7374 elem = el || elem; 7375 return jQuery1113.css( elem, "display" ) === "none" || !jQuery1113.contains( elem.ownerDocument, elem ); 7376 }; 7377 7378 7379 7380// Multifunctional method to get and set values of a collection 7381// The value/s can optionally be executed if it's a function 7382var access = jQuery1113.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 7383 var i = 0, 7384 length = elems.length, 7385 bulk = key == null; 7386 7387 // Sets many values 7388 if ( jQuery1113.type( key ) === "object" ) { 7389 chainable = true; 7390 for ( i in key ) { 7391 jQuery1113.access( elems, fn, i, key[i], true, emptyGet, raw ); 7392 } 7393 7394 // Sets one value 7395 } else if ( value !== undefined ) { 7396 chainable = true; 7397 7398 if ( !jQuery1113.isFunction( value ) ) { 7399 raw = true; 7400 } 7401 7402 if ( bulk ) { 7403 // Bulk operations run against the entire set 7404 if ( raw ) { 7405 fn.call( elems, value ); 7406 fn = null; 7407 7408 // ...except when executing function values 7409 } else { 7410 bulk = fn; 7411 fn = function( elem, key, value ) { 7412 return bulk.call( jQuery1113( elem ), value ); 7413 }; 7414 } 7415 } 7416 7417 if ( fn ) { 7418 for ( ; i < length; i++ ) { 7419 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); 7420 } 7421 } 7422 } 7423 7424 return chainable ? 7425 elems : 7426 7427 // Gets 7428 bulk ? 7429 fn.call( elems ) : 7430 length ? fn( elems[0], key ) : emptyGet; 7431}; 7432var rcheckableType = (/^(?:checkbox|radio)$/i); 7433 7434 7435 7436(function() { 7437 // Minified: var a,b,c 7438 var input = document.createElement( "input" ), 7439 div = document.createElement( "div" ), 7440 fragment = document.createDocumentFragment(); 7441 7442 // Setup 7443 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 7444 7445 // IE strips leading whitespace when .innerHTML is used 7446 support.leadingWhitespace = div.firstChild.nodeType === 3; 7447 7448 // Make sure that tbody elements aren't automatically inserted 7449 // IE will insert them into empty tables 7450 support.tbody = !div.getElementsByTagName( "tbody" ).length; 7451 7452 // Make sure that link elements get serialized correctly by innerHTML 7453 // This requires a wrapper element in IE 7454 support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; 7455 7456 // Makes sure cloning an html5 element does not cause problems 7457 // Where outerHTML is undefined, this still works 7458 support.html5Clone = 7459 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; 7460 7461 // Check if a disconnected checkbox will retain its checked 7462 // value of true after appended to the DOM (IE6/7) 7463 input.type = "checkbox"; 7464 input.checked = true; 7465 fragment.appendChild( input ); 7466 support.appendChecked = input.checked; 7467 7468 // Make sure textarea (and checkbox) defaultValue is properly cloned 7469 // Support: IE6-IE11+ 7470 div.innerHTML = "<textarea>x</textarea>"; 7471 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 7472 7473 // #11217 - WebKit loses check when the name is after the checked attribute 7474 fragment.appendChild( div ); 7475 div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; 7476 7477 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 7478 // old WebKit doesn't clone checked state correctly in fragments 7479 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 7480 7481 // Support: IE<9 7482 // Opera does not clone events (and typeof div.attachEvent === undefined). 7483 // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() 7484 support.noCloneEvent = true; 7485 if ( div.attachEvent ) { 7486 div.attachEvent( "onclick", function() { 7487 support.noCloneEvent = false; 7488 }); 7489 7490 div.cloneNode( true ).click(); 7491 } 7492 7493 // Execute the test only if not already executed in another module. 7494 if (support.deleteExpando == null) { 7495 // Support: IE<9 7496 support.deleteExpando = true; 7497 try { 7498 delete div.test; 7499 } catch( e ) { 7500 support.deleteExpando = false; 7501 } 7502 } 7503})(); 7504 7505 7506(function() { 7507 var i, eventName, 7508 div = document.createElement( "div" ); 7509 7510 // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) 7511 for ( i in { submit: true, change: true, focusin: true }) { 7512 eventName = "on" + i; 7513 7514 if ( !(support[ i + "Bubbles" ] = eventName in window) ) { 7515 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) 7516 div.setAttribute( eventName, "t" ); 7517 support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; 7518 } 7519 } 7520 7521 // Null elements to avoid leaks in IE. 7522 div = null; 7523})(); 7524 7525 7526var rformElems = /^(?:input|select|textarea)$/i, 7527 rkeyEvent = /^key/, 7528 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, 7529 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 7530 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; 7531 7532function returnTrue() { 7533 return true; 7534} 7535 7536function returnFalse() { 7537 return false; 7538} 7539 7540function safeActiveElement() { 7541 try { 7542 return document.activeElement; 7543 } catch ( err ) { } 7544} 7545 7546/* 7547 * Helper functions for managing events -- not part of the public interface. 7548 * Props to Dean Edwards' addEvent library for many of the ideas. 7549 */ 7550jQuery1113.event = { 7551 7552 global: {}, 7553 7554 add: function( elem, types, handler, data, selector ) { 7555 var tmp, events, t, handleObjIn, 7556 special, eventHandle, handleObj, 7557 handlers, type, namespaces, origType, 7558 elemData = jQuery1113._data( elem ); 7559 7560 // Don't attach events to noData or text/comment nodes (but allow plain objects) 7561 if ( !elemData ) { 7562 return; 7563 } 7564 7565 // Caller can pass in an object of custom data in lieu of the handler 7566 if ( handler.handler ) { 7567 handleObjIn = handler; 7568 handler = handleObjIn.handler; 7569 selector = handleObjIn.selector; 7570 } 7571 7572 // Make sure that the handler has a unique ID, used to find/remove it later 7573 if ( !handler.guid ) { 7574 handler.guid = jQuery1113.guid++; 7575 } 7576 7577 // Init the element's event structure and main handler, if this is the first 7578 if ( !(events = elemData.events) ) { 7579 events = elemData.events = {}; 7580 } 7581 if ( !(eventHandle = elemData.handle) ) { 7582 eventHandle = elemData.handle = function( e ) { 7583 // Discard the second event of a jQuery1113.event.trigger() and 7584 // when an event is called after a page has unloaded 7585 return typeof jQuery1113 !== strundefined && (!e || jQuery1113.event.triggered !== e.type) ? 7586 jQuery1113.event.dispatch.apply( eventHandle.elem, arguments ) : 7587 undefined; 7588 }; 7589 // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events 7590 eventHandle.elem = elem; 7591 } 7592 7593 // Handle multiple events separated by a space 7594 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 7595 t = types.length; 7596 while ( t-- ) { 7597 tmp = rtypenamespace.exec( types[t] ) || []; 7598 type = origType = tmp[1]; 7599 namespaces = ( tmp[2] || "" ).split( "." ).sort(); 7600 7601 // There *must* be a type, no attaching namespace-only handlers 7602 if ( !type ) { 7603 continue; 7604 } 7605 7606 // If event changes its type, use the special event handlers for the changed type 7607 special = jQuery1113.event.special[ type ] || {}; 7608 7609 // If selector defined, determine special event api type, otherwise given type 7610 type = ( selector ? special.delegateType : special.bindType ) || type; 7611 7612 // Update special based on newly reset type 7613 special = jQuery1113.event.special[ type ] || {}; 7614 7615 // handleObj is passed to all event handlers 7616 handleObj = jQuery1113.extend({ 7617 type: type, 7618 origType: origType, 7619 data: data, 7620 handler: handler, 7621 guid: handler.guid, 7622 selector: selector, 7623 needsContext: selector && jQuery1113.expr.match.needsContext.test( selector ), 7624 namespace: namespaces.join(".") 7625 }, handleObjIn ); 7626 7627 // Init the event handler queue if we're the first 7628 if ( !(handlers = events[ type ]) ) { 7629 handlers = events[ type ] = []; 7630 handlers.delegateCount = 0; 7631 7632 // Only use addEventListener/attachEvent if the special events handler returns false 7633 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 7634 // Bind the global event handler to the element 7635 if ( elem.addEventListener ) { 7636 elem.addEventListener( type, eventHandle, false ); 7637 7638 } else if ( elem.attachEvent ) { 7639 elem.attachEvent( "on" + type, eventHandle ); 7640 } 7641 } 7642 } 7643 7644 if ( special.add ) { 7645 special.add.call( elem, handleObj ); 7646 7647 if ( !handleObj.handler.guid ) { 7648 handleObj.handler.guid = handler.guid; 7649 } 7650 } 7651 7652 // Add to the element's handler list, delegates in front 7653 if ( selector ) { 7654 handlers.splice( handlers.delegateCount++, 0, handleObj ); 7655 } else { 7656 handlers.push( handleObj ); 7657 } 7658 7659 // Keep track of which events have ever been used, for event optimization 7660 jQuery1113.event.global[ type ] = true; 7661 } 7662 7663 // Nullify elem to prevent memory leaks in IE 7664 elem = null; 7665 }, 7666 7667 // Detach an event or set of events from an element 7668 remove: function( elem, types, handler, selector, mappedTypes ) { 7669 var j, handleObj, tmp, 7670 origCount, t, events, 7671 special, handlers, type, 7672 namespaces, origType, 7673 elemData = jQuery1113.hasData( elem ) && jQuery1113._data( elem ); 7674 7675 if ( !elemData || !(events = elemData.events) ) { 7676 return; 7677 } 7678 7679 // Once for each type.namespace in types; type may be omitted 7680 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 7681 t = types.length; 7682 while ( t-- ) { 7683 tmp = rtypenamespace.exec( types[t] ) || []; 7684 type = origType = tmp[1]; 7685 namespaces = ( tmp[2] || "" ).split( "." ).sort(); 7686 7687 // Unbind all events (on this namespace, if provided) for the element 7688 if ( !type ) { 7689 for ( type in events ) { 7690 jQuery1113.event.remove( elem, type + types[ t ], handler, selector, true ); 7691 } 7692 continue; 7693 } 7694 7695 special = jQuery1113.event.special[ type ] || {}; 7696 type = ( selector ? special.delegateType : special.bindType ) || type; 7697 handlers = events[ type ] || []; 7698 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); 7699 7700 // Remove matching events 7701 origCount = j = handlers.length; 7702 while ( j-- ) { 7703 handleObj = handlers[ j ]; 7704 7705 if ( ( mappedTypes || origType === handleObj.origType ) && 7706 ( !handler || handler.guid === handleObj.guid ) && 7707 ( !tmp || tmp.test( handleObj.namespace ) ) && 7708 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { 7709 handlers.splice( j, 1 ); 7710 7711 if ( handleObj.selector ) { 7712 handlers.delegateCount--; 7713 } 7714 if ( special.remove ) { 7715 special.remove.call( elem, handleObj ); 7716 } 7717 } 7718 } 7719 7720 // Remove generic event handler if we removed something and no more handlers exist 7721 // (avoids potential for endless recursion during removal of special event handlers) 7722 if ( origCount && !handlers.length ) { 7723 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 7724 jQuery1113.removeEvent( elem, type, elemData.handle ); 7725 } 7726 7727 delete events[ type ]; 7728 } 7729 } 7730 7731 // Remove the expando if it's no longer used 7732 if ( jQuery1113.isEmptyObject( events ) ) { 7733 delete elemData.handle; 7734 7735 // removeData also checks for emptiness and clears the expando if empty 7736 // so use it instead of delete 7737 jQuery1113._removeData( elem, "events" ); 7738 } 7739 }, 7740 7741 trigger: function( event, data, elem, onlyHandlers ) { 7742 var handle, ontype, cur, 7743 bubbleType, special, tmp, i, 7744 eventPath = [ elem || document ], 7745 type = hasOwn.call( event, "type" ) ? event.type : event, 7746 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; 7747 7748 cur = tmp = elem = elem || document; 7749 7750 // Don't do events on text and comment nodes 7751 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 7752 return; 7753 } 7754 7755 // focus/blur morphs to focusin/out; ensure we're not firing them right now 7756 if ( rfocusMorph.test( type + jQuery1113.event.triggered ) ) { 7757 return; 7758 } 7759 7760 if ( type.indexOf(".") >= 0 ) { 7761 // Namespaced trigger; create a regexp to match event type in handle() 7762 namespaces = type.split("."); 7763 type = namespaces.shift(); 7764 namespaces.sort(); 7765 } 7766 ontype = type.indexOf(":") < 0 && "on" + type; 7767 7768 // Caller can pass in a jQuery1113.Event object, Object, or just an event type string 7769 event = event[ jQuery1113.expando ] ? 7770 event : 7771 new jQuery1113.Event( type, typeof event === "object" && event ); 7772 7773 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery1113 (always true) 7774 event.isTrigger = onlyHandlers ? 2 : 3; 7775 event.namespace = namespaces.join("."); 7776 event.namespace_re = event.namespace ? 7777 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : 7778 null; 7779 7780 // Clean up the event in case it is being reused 7781 event.result = undefined; 7782 if ( !event.target ) { 7783 event.target = elem; 7784 } 7785 7786 // Clone any incoming data and prepend the event, creating the handler arg list 7787 data = data == null ? 7788 [ event ] : 7789 jQuery1113.makeArray( data, [ event ] ); 7790 7791 // Allow special events to draw outside the lines 7792 special = jQuery1113.event.special[ type ] || {}; 7793 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 7794 return; 7795 } 7796 7797 // Determine event propagation path in advance, per W3C events spec (#9951) 7798 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 7799 if ( !onlyHandlers && !special.noBubble && !jQuery1113.isWindow( elem ) ) { 7800 7801 bubbleType = special.delegateType || type; 7802 if ( !rfocusMorph.test( bubbleType + type ) ) { 7803 cur = cur.parentNode; 7804 } 7805 for ( ; cur; cur = cur.parentNode ) { 7806 eventPath.push( cur ); 7807 tmp = cur; 7808 } 7809 7810 // Only add window if we got to document (e.g., not plain obj or detached DOM) 7811 if ( tmp === (elem.ownerDocument || document) ) { 7812 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 7813 } 7814 } 7815 7816 // Fire handlers on the event path 7817 i = 0; 7818 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { 7819 7820 event.type = i > 1 ? 7821 bubbleType : 7822 special.bindType || type; 7823 7824 // jQuery1113 handler 7825 handle = ( jQuery1113._data( cur, "events" ) || {} )[ event.type ] && jQuery1113._data( cur, "handle" ); 7826 if ( handle ) { 7827 handle.apply( cur, data ); 7828 } 7829 7830 // Native handler 7831 handle = ontype && cur[ ontype ]; 7832 if ( handle && handle.apply && jQuery1113.acceptData( cur ) ) { 7833 event.result = handle.apply( cur, data ); 7834 if ( event.result === false ) { 7835 event.preventDefault(); 7836 } 7837 } 7838 } 7839 event.type = type; 7840 7841 // If nobody prevented the default action, do it now 7842 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 7843 7844 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && 7845 jQuery1113.acceptData( elem ) ) { 7846 7847 // Call a native DOM method on the target with the same name name as the event. 7848 // Can't use an .isFunction() check here because IE6/7 fails that test. 7849 // Don't do default actions on window, that's where global variables be (#6170) 7850 if ( ontype && elem[ type ] && !jQuery1113.isWindow( elem ) ) { 7851 7852 // Don't re-trigger an onFOO event when we call its FOO() method 7853 tmp = elem[ ontype ]; 7854 7855 if ( tmp ) { 7856 elem[ ontype ] = null; 7857 } 7858 7859 // Prevent re-triggering of the same event, since we already bubbled it above 7860 jQuery1113.event.triggered = type; 7861 try { 7862 elem[ type ](); 7863 } catch ( e ) { 7864 // IE<9 dies on focus/blur to hidden element (#1486,#12518) 7865 // only reproducible on winXP IE8 native, not IE9 in IE8 mode 7866 } 7867 jQuery1113.event.triggered = undefined; 7868 7869 if ( tmp ) { 7870 elem[ ontype ] = tmp; 7871 } 7872 } 7873 } 7874 } 7875 7876 return event.result; 7877 }, 7878 7879 dispatch: function( event ) { 7880 7881 // Make a writable jQuery1113.Event from the native event object 7882 event = jQuery1113.event.fix( event ); 7883 7884 var i, ret, handleObj, matched, j, 7885 handlerQueue = [], 7886 args = slice.call( arguments ), 7887 handlers = ( jQuery1113._data( this, "events" ) || {} )[ event.type ] || [], 7888 special = jQuery1113.event.special[ event.type ] || {}; 7889 7890 // Use the fix-ed jQuery1113.Event rather than the (read-only) native event 7891 args[0] = event; 7892 event.delegateTarget = this; 7893 7894 // Call the preDispatch hook for the mapped type, and let it bail if desired 7895 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 7896 return; 7897 } 7898 7899 // Determine handlers 7900 handlerQueue = jQuery1113.event.handlers.call( this, event, handlers ); 7901 7902 // Run delegates first; they may want to stop propagation beneath us 7903 i = 0; 7904 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { 7905 event.currentTarget = matched.elem; 7906 7907 j = 0; 7908 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { 7909 7910 // Triggered event must either 1) have no namespace, or 7911 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). 7912 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { 7913 7914 event.handleObj = handleObj; 7915 event.data = handleObj.data; 7916 7917 ret = ( (jQuery1113.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) 7918 .apply( matched.elem, args ); 7919 7920 if ( ret !== undefined ) { 7921 if ( (event.result = ret) === false ) { 7922 event.preventDefault(); 7923 event.stopPropagation(); 7924 } 7925 } 7926 } 7927 } 7928 } 7929 7930 // Call the postDispatch hook for the mapped type 7931 if ( special.postDispatch ) { 7932 special.postDispatch.call( this, event ); 7933 } 7934 7935 return event.result; 7936 }, 7937 7938 handlers: function( event, handlers ) { 7939 var sel, handleObj, matches, i, 7940 handlerQueue = [], 7941 delegateCount = handlers.delegateCount, 7942 cur = event.target; 7943 7944 // Find delegate handlers 7945 // Black-hole SVG <use> instance trees (#13180) 7946 // Avoid non-left-click bubbling in Firefox (#3861) 7947 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { 7948 7949 /* jshint eqeqeq: false */ 7950 for ( ; cur != this; cur = cur.parentNode || this ) { 7951 /* jshint eqeqeq: true */ 7952 7953 // Don't check non-elements (#13208) 7954 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 7955 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { 7956 matches = []; 7957 for ( i = 0; i < delegateCount; i++ ) { 7958 handleObj = handlers[ i ]; 7959 7960 // Don't conflict with Object.prototype properties (#13203) 7961 sel = handleObj.selector + " "; 7962 7963 if ( matches[ sel ] === undefined ) { 7964 matches[ sel ] = handleObj.needsContext ? 7965 jQuery1113( sel, this ).index( cur ) >= 0 : 7966 jQuery1113.find( sel, this, null, [ cur ] ).length; 7967 } 7968 if ( matches[ sel ] ) { 7969 matches.push( handleObj ); 7970 } 7971 } 7972 if ( matches.length ) { 7973 handlerQueue.push({ elem: cur, handlers: matches }); 7974 } 7975 } 7976 } 7977 } 7978 7979 // Add the remaining (directly-bound) handlers 7980 if ( delegateCount < handlers.length ) { 7981 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); 7982 } 7983 7984 return handlerQueue; 7985 }, 7986 7987 fix: function( event ) { 7988 if ( event[ jQuery1113.expando ] ) { 7989 return event; 7990 } 7991 7992 // Create a writable copy of the event object and normalize some properties 7993 var i, prop, copy, 7994 type = event.type, 7995 originalEvent = event, 7996 fixHook = this.fixHooks[ type ]; 7997 7998 if ( !fixHook ) { 7999 this.fixHooks[ type ] = fixHook = 8000 rmouseEvent.test( type ) ? this.mouseHooks : 8001 rkeyEvent.test( type ) ? this.keyHooks : 8002 {}; 8003 } 8004 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 8005 8006 event = new jQuery1113.Event( originalEvent ); 8007 8008 i = copy.length; 8009 while ( i-- ) { 8010 prop = copy[ i ]; 8011 event[ prop ] = originalEvent[ prop ]; 8012 } 8013 8014 // Support: IE<9 8015 // Fix target property (#1925) 8016 if ( !event.target ) { 8017 event.target = originalEvent.srcElement || document; 8018 } 8019 8020 // Support: Chrome 23+, Safari? 8021 // Target should not be a text node (#504, #13143) 8022 if ( event.target.nodeType === 3 ) { 8023 event.target = event.target.parentNode; 8024 } 8025 8026 // Support: IE<9 8027 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) 8028 event.metaKey = !!event.metaKey; 8029 8030 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 8031 }, 8032 8033 // Includes some event props shared by KeyEvent and MouseEvent 8034 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), 8035 8036 fixHooks: {}, 8037 8038 keyHooks: { 8039 props: "char charCode key keyCode".split(" "), 8040 filter: function( event, original ) { 8041 8042 // Add which for key events 8043 if ( event.which == null ) { 8044 event.which = original.charCode != null ? original.charCode : original.keyCode; 8045 } 8046 8047 return event; 8048 } 8049 }, 8050 8051 mouseHooks: { 8052 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), 8053 filter: function( event, original ) { 8054 var body, eventDoc, doc, 8055 button = original.button, 8056 fromElement = original.fromElement; 8057 8058 // Calculate pageX/Y if missing and clientX/Y available 8059 if ( event.pageX == null && original.clientX != null ) { 8060 eventDoc = event.target.ownerDocument || document; 8061 doc = eventDoc.documentElement; 8062 body = eventDoc.body; 8063 8064 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 8065 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); 8066 } 8067 8068 // Add relatedTarget, if necessary 8069 if ( !event.relatedTarget && fromElement ) { 8070 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; 8071 } 8072 8073 // Add which for click: 1 === left; 2 === middle; 3 === right 8074 // Note: button is not normalized, so don't use it 8075 if ( !event.which && button !== undefined ) { 8076 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 8077 } 8078 8079 return event; 8080 } 8081 }, 8082 8083 special: { 8084 load: { 8085 // Prevent triggered image.load events from bubbling to window.load 8086 noBubble: true 8087 }, 8088 focus: { 8089 // Fire native event if possible so blur/focus sequence is correct 8090 trigger: function() { 8091 if ( this !== safeActiveElement() && this.focus ) { 8092 try { 8093 this.focus(); 8094 return false; 8095 } catch ( e ) { 8096 // Support: IE<9 8097 // If we error on focus to hidden element (#1486, #12518), 8098 // let .trigger() run the handlers 8099 } 8100 } 8101 }, 8102 delegateType: "focusin" 8103 }, 8104 blur: { 8105 trigger: function() { 8106 if ( this === safeActiveElement() && this.blur ) { 8107 this.blur(); 8108 return false; 8109 } 8110 }, 8111 delegateType: "focusout" 8112 }, 8113 click: { 8114 // For checkbox, fire native event so checked state will be right 8115 trigger: function() { 8116 if ( jQuery1113.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { 8117 this.click(); 8118 return false; 8119 } 8120 }, 8121 8122 // For cross-browser consistency, don't fire native .click() on links 8123 _default: function( event ) { 8124 return jQuery1113.nodeName( event.target, "a" ); 8125 } 8126 }, 8127 8128 beforeunload: { 8129 postDispatch: function( event ) { 8130 8131 // Support: Firefox 20+ 8132 // Firefox doesn't alert if the returnValue field is not set. 8133 if ( event.result !== undefined && event.originalEvent ) { 8134 event.originalEvent.returnValue = event.result; 8135 } 8136 } 8137 } 8138 }, 8139 8140 simulate: function( type, elem, event, bubble ) { 8141 // Piggyback on a donor event to simulate a different one. 8142 // Fake originalEvent to avoid donor's stopPropagation, but if the 8143 // simulated event prevents default then we do the same on the donor. 8144 var e = jQuery1113.extend( 8145 new jQuery1113.Event(), 8146 event, 8147 { 8148 type: type, 8149 isSimulated: true, 8150 originalEvent: {} 8151 } 8152 ); 8153 if ( bubble ) { 8154 jQuery1113.event.trigger( e, null, elem ); 8155 } else { 8156 jQuery1113.event.dispatch.call( elem, e ); 8157 } 8158 if ( e.isDefaultPrevented() ) { 8159 event.preventDefault(); 8160 } 8161 } 8162}; 8163 8164jQuery1113.removeEvent = document.removeEventListener ? 8165 function( elem, type, handle ) { 8166 if ( elem.removeEventListener ) { 8167 elem.removeEventListener( type, handle, false ); 8168 } 8169 } : 8170 function( elem, type, handle ) { 8171 var name = "on" + type; 8172 8173 if ( elem.detachEvent ) { 8174 8175 // #8545, #7054, preventing memory leaks for custom events in IE6-8 8176 // detachEvent needed property on element, by name of that event, to properly expose it to GC 8177 if ( typeof elem[ name ] === strundefined ) { 8178 elem[ name ] = null; 8179 } 8180 8181 elem.detachEvent( name, handle ); 8182 } 8183 }; 8184 8185jQuery1113.Event = function( src, props ) { 8186 // Allow instantiation without the 'new' keyword 8187 if ( !(this instanceof jQuery1113.Event) ) { 8188 return new jQuery1113.Event( src, props ); 8189 } 8190 8191 // Event object 8192 if ( src && src.type ) { 8193 this.originalEvent = src; 8194 this.type = src.type; 8195 8196 // Events bubbling up the document may have been marked as prevented 8197 // by a handler lower down the tree; reflect the correct value. 8198 this.isDefaultPrevented = src.defaultPrevented || 8199 src.defaultPrevented === undefined && 8200 // Support: IE < 9, Android < 4.0 8201 src.returnValue === false ? 8202 returnTrue : 8203 returnFalse; 8204 8205 // Event type 8206 } else { 8207 this.type = src; 8208 } 8209 8210 // Put explicitly provided properties onto the event object 8211 if ( props ) { 8212 jQuery1113.extend( this, props ); 8213 } 8214 8215 // Create a timestamp if incoming event doesn't have one 8216 this.timeStamp = src && src.timeStamp || jQuery1113.now(); 8217 8218 // Mark it as fixed 8219 this[ jQuery1113.expando ] = true; 8220}; 8221 8222// jQuery1113.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 8223// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 8224jQuery1113.Event.prototype = { 8225 isDefaultPrevented: returnFalse, 8226 isPropagationStopped: returnFalse, 8227 isImmediatePropagationStopped: returnFalse, 8228 8229 preventDefault: function() { 8230 var e = this.originalEvent; 8231 8232 this.isDefaultPrevented = returnTrue; 8233 if ( !e ) { 8234 return; 8235 } 8236 8237 // If preventDefault exists, run it on the original event 8238 if ( e.preventDefault ) { 8239 e.preventDefault(); 8240 8241 // Support: IE 8242 // Otherwise set the returnValue property of the original event to false 8243 } else { 8244 e.returnValue = false; 8245 } 8246 }, 8247 stopPropagation: function() { 8248 var e = this.originalEvent; 8249 8250 this.isPropagationStopped = returnTrue; 8251 if ( !e ) { 8252 return; 8253 } 8254 // If stopPropagation exists, run it on the original event 8255 if ( e.stopPropagation ) { 8256 e.stopPropagation(); 8257 } 8258 8259 // Support: IE 8260 // Set the cancelBubble property of the original event to true 8261 e.cancelBubble = true; 8262 }, 8263 stopImmediatePropagation: function() { 8264 var e = this.originalEvent; 8265 8266 this.isImmediatePropagationStopped = returnTrue; 8267 8268 if ( e && e.stopImmediatePropagation ) { 8269 e.stopImmediatePropagation(); 8270 } 8271 8272 this.stopPropagation(); 8273 } 8274}; 8275 8276// Create mouseenter/leave events using mouseover/out and event-time checks 8277jQuery1113.each({ 8278 mouseenter: "mouseover", 8279 mouseleave: "mouseout", 8280 pointerenter: "pointerover", 8281 pointerleave: "pointerout" 8282}, function( orig, fix ) { 8283 jQuery1113.event.special[ orig ] = { 8284 delegateType: fix, 8285 bindType: fix, 8286 8287 handle: function( event ) { 8288 var ret, 8289 target = this, 8290 related = event.relatedTarget, 8291 handleObj = event.handleObj; 8292 8293 // For mousenter/leave call the handler if related is outside the target. 8294 // NB: No relatedTarget if the mouse left/entered the browser window 8295 if ( !related || (related !== target && !jQuery1113.contains( target, related )) ) { 8296 event.type = handleObj.origType; 8297 ret = handleObj.handler.apply( this, arguments ); 8298 event.type = fix; 8299 } 8300 return ret; 8301 } 8302 }; 8303}); 8304 8305// IE submit delegation 8306if ( !support.submitBubbles ) { 8307 8308 jQuery1113.event.special.submit = { 8309 setup: function() { 8310 // Only need this for delegated form submit events 8311 if ( jQuery1113.nodeName( this, "form" ) ) { 8312 return false; 8313 } 8314 8315 // Lazy-add a submit handler when a descendant form may potentially be submitted 8316 jQuery1113.event.add( this, "click._submit keypress._submit", function( e ) { 8317 // Node name check avoids a VML-related crash in IE (#9807) 8318 var elem = e.target, 8319 form = jQuery1113.nodeName( elem, "input" ) || jQuery1113.nodeName( elem, "button" ) ? elem.form : undefined; 8320 if ( form && !jQuery1113._data( form, "submitBubbles" ) ) { 8321 jQuery1113.event.add( form, "submit._submit", function( event ) { 8322 event._submit_bubble = true; 8323 }); 8324 jQuery1113._data( form, "submitBubbles", true ); 8325 } 8326 }); 8327 // return undefined since we don't need an event listener 8328 }, 8329 8330 postDispatch: function( event ) { 8331 // If form was submitted by the user, bubble the event up the tree 8332 if ( event._submit_bubble ) { 8333 delete event._submit_bubble; 8334 if ( this.parentNode && !event.isTrigger ) { 8335 jQuery1113.event.simulate( "submit", this.parentNode, event, true ); 8336 } 8337 } 8338 }, 8339 8340 teardown: function() { 8341 // Only need this for delegated form submit events 8342 if ( jQuery1113.nodeName( this, "form" ) ) { 8343 return false; 8344 } 8345 8346 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above 8347 jQuery1113.event.remove( this, "._submit" ); 8348 } 8349 }; 8350} 8351 8352// IE change delegation and checkbox/radio fix 8353if ( !support.changeBubbles ) { 8354 8355 jQuery1113.event.special.change = { 8356 8357 setup: function() { 8358 8359 if ( rformElems.test( this.nodeName ) ) { 8360 // IE doesn't fire change on a check/radio until blur; trigger it on click 8361 // after a propertychange. Eat the blur-change in special.change.handle. 8362 // This still fires onchange a second time for check/radio after blur. 8363 if ( this.type === "checkbox" || this.type === "radio" ) { 8364 jQuery1113.event.add( this, "propertychange._change", function( event ) { 8365 if ( event.originalEvent.propertyName === "checked" ) { 8366 this._just_changed = true; 8367 } 8368 }); 8369 jQuery1113.event.add( this, "click._change", function( event ) { 8370 if ( this._just_changed && !event.isTrigger ) { 8371 this._just_changed = false; 8372 } 8373 // Allow triggered, simulated change events (#11500) 8374 jQuery1113.event.simulate( "change", this, event, true ); 8375 }); 8376 } 8377 return false; 8378 } 8379 // Delegated event; lazy-add a change handler on descendant inputs 8380 jQuery1113.event.add( this, "beforeactivate._change", function( e ) { 8381 var elem = e.target; 8382 8383 if ( rformElems.test( elem.nodeName ) && !jQuery1113._data( elem, "changeBubbles" ) ) { 8384 jQuery1113.event.add( elem, "change._change", function( event ) { 8385 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { 8386 jQuery1113.event.simulate( "change", this.parentNode, event, true ); 8387 } 8388 }); 8389 jQuery1113._data( elem, "changeBubbles", true ); 8390 } 8391 }); 8392 }, 8393 8394 handle: function( event ) { 8395 var elem = event.target; 8396 8397 // Swallow native change events from checkbox/radio, we already triggered them above 8398 if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { 8399 return event.handleObj.handler.apply( this, arguments ); 8400 } 8401 }, 8402 8403 teardown: function() { 8404 jQuery1113.event.remove( this, "._change" ); 8405 8406 return !rformElems.test( this.nodeName ); 8407 } 8408 }; 8409} 8410 8411// Create "bubbling" focus and blur events 8412if ( !support.focusinBubbles ) { 8413 jQuery1113.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { 8414 8415 // Attach a single capturing handler on the document while someone wants focusin/focusout 8416 var handler = function( event ) { 8417 jQuery1113.event.simulate( fix, event.target, jQuery1113.event.fix( event ), true ); 8418 }; 8419 8420 jQuery1113.event.special[ fix ] = { 8421 setup: function() { 8422 var doc = this.ownerDocument || this, 8423 attaches = jQuery1113._data( doc, fix ); 8424 8425 if ( !attaches ) { 8426 doc.addEventListener( orig, handler, true ); 8427 } 8428 jQuery1113._data( doc, fix, ( attaches || 0 ) + 1 ); 8429 }, 8430 teardown: function() { 8431 var doc = this.ownerDocument || this, 8432 attaches = jQuery1113._data( doc, fix ) - 1; 8433 8434 if ( !attaches ) { 8435 doc.removeEventListener( orig, handler, true ); 8436 jQuery1113._removeData( doc, fix ); 8437 } else { 8438 jQuery1113._data( doc, fix, attaches ); 8439 } 8440 } 8441 }; 8442 }); 8443} 8444 8445jQuery1113.fn.extend({ 8446 8447 on: function( types, selector, data, fn, /*INTERNAL*/ one ) { 8448 var type, origFn; 8449 8450 // Types can be a map of types/handlers 8451 if ( typeof types === "object" ) { 8452 // ( types-Object, selector, data ) 8453 if ( typeof selector !== "string" ) { 8454 // ( types-Object, data ) 8455 data = data || selector; 8456 selector = undefined; 8457 } 8458 for ( type in types ) { 8459 this.on( type, selector, data, types[ type ], one ); 8460 } 8461 return this; 8462 } 8463 8464 if ( data == null && fn == null ) { 8465 // ( types, fn ) 8466 fn = selector; 8467 data = selector = undefined; 8468 } else if ( fn == null ) { 8469 if ( typeof selector === "string" ) { 8470 // ( types, selector, fn ) 8471 fn = data; 8472 data = undefined; 8473 } else { 8474 // ( types, data, fn ) 8475 fn = data; 8476 data = selector; 8477 selector = undefined; 8478 } 8479 } 8480 if ( fn === false ) { 8481 fn = returnFalse; 8482 } else if ( !fn ) { 8483 return this; 8484 } 8485 8486 if ( one === 1 ) { 8487 origFn = fn; 8488 fn = function( event ) { 8489 // Can use an empty set, since event contains the info 8490 jQuery1113().off( event ); 8491 return origFn.apply( this, arguments ); 8492 }; 8493 // Use same guid so caller can remove using origFn 8494 fn.guid = origFn.guid || ( origFn.guid = jQuery1113.guid++ ); 8495 } 8496 return this.each( function() { 8497 jQuery1113.event.add( this, types, fn, data, selector ); 8498 }); 8499 }, 8500 one: function( types, selector, data, fn ) { 8501 return this.on( types, selector, data, fn, 1 ); 8502 }, 8503 off: function( types, selector, fn ) { 8504 var handleObj, type; 8505 if ( types && types.preventDefault && types.handleObj ) { 8506 // ( event ) dispatched jQuery1113.Event 8507 handleObj = types.handleObj; 8508 jQuery1113( types.delegateTarget ).off( 8509 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, 8510 handleObj.selector, 8511 handleObj.handler 8512 ); 8513 return this; 8514 } 8515 if ( typeof types === "object" ) { 8516 // ( types-object [, selector] ) 8517 for ( type in types ) { 8518 this.off( type, selector, types[ type ] ); 8519 } 8520 return this; 8521 } 8522 if ( selector === false || typeof selector === "function" ) { 8523 // ( types [, fn] ) 8524 fn = selector; 8525 selector = undefined; 8526 } 8527 if ( fn === false ) { 8528 fn = returnFalse; 8529 } 8530 return this.each(function() { 8531 jQuery1113.event.remove( this, types, fn, selector ); 8532 }); 8533 }, 8534 8535 trigger: function( type, data ) { 8536 return this.each(function() { 8537 jQuery1113.event.trigger( type, data, this ); 8538 }); 8539 }, 8540 triggerHandler: function( type, data ) { 8541 var elem = this[0]; 8542 if ( elem ) { 8543 return jQuery1113.event.trigger( type, data, elem, true ); 8544 } 8545 } 8546}); 8547 8548 8549function createSafeFragment( document ) { 8550 var list = nodeNames.split( "|" ), 8551 safeFrag = document.createDocumentFragment(); 8552 8553 if ( safeFrag.createElement ) { 8554 while ( list.length ) { 8555 safeFrag.createElement( 8556 list.pop() 8557 ); 8558 } 8559 } 8560 return safeFrag; 8561} 8562 8563var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + 8564 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", 8565 rinlinejQuery1113 = / jQuery1113\d+="(?:null|\d+)"/g, 8566 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), 8567 rleadingWhitespace = /^\s+/, 8568 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, 8569 rtagName = /<([\w:]+)/, 8570 rtbody = /<tbody/i, 8571 rhtml = /<|&#?\w+;/, 8572 rnoInnerhtml = /<(?:script|style|link)/i, 8573 // checked="checked" or checked 8574 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 8575 rscriptType = /^$|\/(?:java|ecma)script/i, 8576 rscriptTypeMasked = /^true\/(.*)/, 8577 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, 8578 8579 // We have to close these tags to support XHTML (#13200) 8580 wrapMap = { 8581 option: [ 1, "<select multiple='multiple'>", "</select>" ], 8582 legend: [ 1, "<fieldset>", "</fieldset>" ], 8583 area: [ 1, "<map>", "</map>" ], 8584 param: [ 1, "<object>", "</object>" ], 8585 thead: [ 1, "<table>", "</table>" ], 8586 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 8587 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], 8588 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 8589 8590 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, 8591 // unless wrapped in a div with non-breaking characters in front of it. 8592 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] 8593 }, 8594 safeFragment = createSafeFragment( document ), 8595 fragmentDiv = safeFragment.appendChild( document.createElement("div") ); 8596 8597wrapMap.optgroup = wrapMap.option; 8598wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 8599wrapMap.th = wrapMap.td; 8600 8601function getAll( context, tag ) { 8602 var elems, elem, 8603 i = 0, 8604 found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : 8605 typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : 8606 undefined; 8607 8608 if ( !found ) { 8609 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { 8610 if ( !tag || jQuery1113.nodeName( elem, tag ) ) { 8611 found.push( elem ); 8612 } else { 8613 jQuery1113.merge( found, getAll( elem, tag ) ); 8614 } 8615 } 8616 } 8617 8618 return tag === undefined || tag && jQuery1113.nodeName( context, tag ) ? 8619 jQuery1113.merge( [ context ], found ) : 8620 found; 8621} 8622 8623// Used in buildFragment, fixes the defaultChecked property 8624function fixDefaultChecked( elem ) { 8625 if ( rcheckableType.test( elem.type ) ) { 8626 elem.defaultChecked = elem.checked; 8627 } 8628} 8629 8630// Support: IE<8 8631// Manipulating tables requires a tbody 8632function manipulationTarget( elem, content ) { 8633 return jQuery1113.nodeName( elem, "table" ) && 8634 jQuery1113.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? 8635 8636 elem.getElementsByTagName("tbody")[0] || 8637 elem.appendChild( elem.ownerDocument.createElement("tbody") ) : 8638 elem; 8639} 8640 8641// Replace/restore the type attribute of script elements for safe DOM manipulation 8642function disableScript( elem ) { 8643 elem.type = (jQuery1113.find.attr( elem, "type" ) !== null) + "/" + elem.type; 8644 return elem; 8645} 8646function restoreScript( elem ) { 8647 var match = rscriptTypeMasked.exec( elem.type ); 8648 if ( match ) { 8649 elem.type = match[1]; 8650 } else { 8651 elem.removeAttribute("type"); 8652 } 8653 return elem; 8654} 8655 8656// Mark scripts as having already been evaluated 8657function setGlobalEval( elems, refElements ) { 8658 var elem, 8659 i = 0; 8660 for ( ; (elem = elems[i]) != null; i++ ) { 8661 jQuery1113._data( elem, "globalEval", !refElements || jQuery1113._data( refElements[i], "globalEval" ) ); 8662 } 8663} 8664 8665function cloneCopyEvent( src, dest ) { 8666 8667 if ( dest.nodeType !== 1 || !jQuery1113.hasData( src ) ) { 8668 return; 8669 } 8670 8671 var type, i, l, 8672 oldData = jQuery1113._data( src ), 8673 curData = jQuery1113._data( dest, oldData ), 8674 events = oldData.events; 8675 8676 if ( events ) { 8677 delete curData.handle; 8678 curData.events = {}; 8679 8680 for ( type in events ) { 8681 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 8682 jQuery1113.event.add( dest, type, events[ type ][ i ] ); 8683 } 8684 } 8685 } 8686 8687 // make the cloned public data object a copy from the original 8688 if ( curData.data ) { 8689 curData.data = jQuery1113.extend( {}, curData.data ); 8690 } 8691} 8692 8693function fixCloneNodeIssues( src, dest ) { 8694 var nodeName, e, data; 8695 8696 // We do not need to do anything for non-Elements 8697 if ( dest.nodeType !== 1 ) { 8698 return; 8699 } 8700 8701 nodeName = dest.nodeName.toLowerCase(); 8702 8703 // IE6-8 copies events bound via attachEvent when using cloneNode. 8704 if ( !support.noCloneEvent && dest[ jQuery1113.expando ] ) { 8705 data = jQuery1113._data( dest ); 8706 8707 for ( e in data.events ) { 8708 jQuery1113.removeEvent( dest, e, data.handle ); 8709 } 8710 8711 // Event data gets referenced instead of copied if the expando gets copied too 8712 dest.removeAttribute( jQuery1113.expando ); 8713 } 8714 8715 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text 8716 if ( nodeName === "script" && dest.text !== src.text ) { 8717 disableScript( dest ).text = src.text; 8718 restoreScript( dest ); 8719 8720 // IE6-10 improperly clones children of object elements using classid. 8721 // IE10 throws NoModificationAllowedError if parent is null, #12132. 8722 } else if ( nodeName === "object" ) { 8723 if ( dest.parentNode ) { 8724 dest.outerHTML = src.outerHTML; 8725 } 8726 8727 // This path appears unavoidable for IE9. When cloning an object 8728 // element in IE9, the outerHTML strategy above is not sufficient. 8729 // If the src has innerHTML and the destination does not, 8730 // copy the src.innerHTML into the dest.innerHTML. #10324 8731 if ( support.html5Clone && ( src.innerHTML && !jQuery1113.trim(dest.innerHTML) ) ) { 8732 dest.innerHTML = src.innerHTML; 8733 } 8734 8735 } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 8736 // IE6-8 fails to persist the checked state of a cloned checkbox 8737 // or radio button. Worse, IE6-7 fail to give the cloned element 8738 // a checked appearance if the defaultChecked value isn't also set 8739 8740 dest.defaultChecked = dest.checked = src.checked; 8741 8742 // IE6-7 get confused and end up setting the value of a cloned 8743 // checkbox/radio button to an empty string instead of "on" 8744 if ( dest.value !== src.value ) { 8745 dest.value = src.value; 8746 } 8747 8748 // IE6-8 fails to return the selected option to the default selected 8749 // state when cloning options 8750 } else if ( nodeName === "option" ) { 8751 dest.defaultSelected = dest.selected = src.defaultSelected; 8752 8753 // IE6-8 fails to set the defaultValue to the correct value when 8754 // cloning other types of input fields 8755 } else if ( nodeName === "input" || nodeName === "textarea" ) { 8756 dest.defaultValue = src.defaultValue; 8757 } 8758} 8759 8760jQuery1113.extend({ 8761 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 8762 var destElements, node, clone, i, srcElements, 8763 inPage = jQuery1113.contains( elem.ownerDocument, elem ); 8764 8765 if ( support.html5Clone || jQuery1113.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { 8766 clone = elem.cloneNode( true ); 8767 8768 // IE<=8 does not properly clone detached, unknown element nodes 8769 } else { 8770 fragmentDiv.innerHTML = elem.outerHTML; 8771 fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); 8772 } 8773 8774 if ( (!support.noCloneEvent || !support.noCloneChecked) && 8775 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery1113.isXMLDoc(elem) ) { 8776 8777 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 8778 destElements = getAll( clone ); 8779 srcElements = getAll( elem ); 8780 8781 // Fix all IE cloning issues 8782 for ( i = 0; (node = srcElements[i]) != null; ++i ) { 8783 // Ensure that the destination node is not null; Fixes #9587 8784 if ( destElements[i] ) { 8785 fixCloneNodeIssues( node, destElements[i] ); 8786 } 8787 } 8788 } 8789 8790 // Copy the events from the original to the clone 8791 if ( dataAndEvents ) { 8792 if ( deepDataAndEvents ) { 8793 srcElements = srcElements || getAll( elem ); 8794 destElements = destElements || getAll( clone ); 8795 8796 for ( i = 0; (node = srcElements[i]) != null; i++ ) { 8797 cloneCopyEvent( node, destElements[i] ); 8798 } 8799 } else { 8800 cloneCopyEvent( elem, clone ); 8801 } 8802 } 8803 8804 // Preserve script evaluation history 8805 destElements = getAll( clone, "script" ); 8806 if ( destElements.length > 0 ) { 8807 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 8808 } 8809 8810 destElements = srcElements = node = null; 8811 8812 // Return the cloned set 8813 return clone; 8814 }, 8815 8816 buildFragment: function( elems, context, scripts, selection ) { 8817 var j, elem, contains, 8818 tmp, tag, tbody, wrap, 8819 l = elems.length, 8820 8821 // Ensure a safe fragment 8822 safe = createSafeFragment( context ), 8823 8824 nodes = [], 8825 i = 0; 8826 8827 for ( ; i < l; i++ ) { 8828 elem = elems[ i ]; 8829 8830 if ( elem || elem === 0 ) { 8831 8832 // Add nodes directly 8833 if ( jQuery1113.type( elem ) === "object" ) { 8834 jQuery1113.merge( nodes, elem.nodeType ? [ elem ] : elem ); 8835 8836 // Convert non-html into a text node 8837 } else if ( !rhtml.test( elem ) ) { 8838 nodes.push( context.createTextNode( elem ) ); 8839 8840 // Convert html into DOM nodes 8841 } else { 8842 tmp = tmp || safe.appendChild( context.createElement("div") ); 8843 8844 // Deserialize a standard representation 8845 tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); 8846 wrap = wrapMap[ tag ] || wrapMap._default; 8847 8848 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; 8849 8850 // Descend through wrappers to the right content 8851 j = wrap[0]; 8852 while ( j-- ) { 8853 tmp = tmp.lastChild; 8854 } 8855 8856 // Manually add leading whitespace removed by IE 8857 if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { 8858 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); 8859 } 8860 8861 // Remove IE's autoinserted <tbody> from table fragments 8862 if ( !support.tbody ) { 8863 8864 // String was a <table>, *may* have spurious <tbody> 8865 elem = tag === "table" && !rtbody.test( elem ) ? 8866 tmp.firstChild : 8867 8868 // String was a bare <thead> or <tfoot> 8869 wrap[1] === "<table>" && !rtbody.test( elem ) ? 8870 tmp : 8871 0; 8872 8873 j = elem && elem.childNodes.length; 8874 while ( j-- ) { 8875 if ( jQuery1113.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { 8876 elem.removeChild( tbody ); 8877 } 8878 } 8879 } 8880 8881 jQuery1113.merge( nodes, tmp.childNodes ); 8882 8883 // Fix #12392 for WebKit and IE > 9 8884 tmp.textContent = ""; 8885 8886 // Fix #12392 for oldIE 8887 while ( tmp.firstChild ) { 8888 tmp.removeChild( tmp.firstChild ); 8889 } 8890 8891 // Remember the top-level container for proper cleanup 8892 tmp = safe.lastChild; 8893 } 8894 } 8895 } 8896 8897 // Fix #11356: Clear elements from fragment 8898 if ( tmp ) { 8899 safe.removeChild( tmp ); 8900 } 8901 8902 // Reset defaultChecked for any radios and checkboxes 8903 // about to be appended to the DOM in IE 6/7 (#8060) 8904 if ( !support.appendChecked ) { 8905 jQuery1113.grep( getAll( nodes, "input" ), fixDefaultChecked ); 8906 } 8907 8908 i = 0; 8909 while ( (elem = nodes[ i++ ]) ) { 8910 8911 // #4087 - If origin and destination elements are the same, and this is 8912 // that element, do not do anything 8913 if ( selection && jQuery1113.inArray( elem, selection ) !== -1 ) { 8914 continue; 8915 } 8916 8917 contains = jQuery1113.contains( elem.ownerDocument, elem ); 8918 8919 // Append to fragment 8920 tmp = getAll( safe.appendChild( elem ), "script" ); 8921 8922 // Preserve script evaluation history 8923 if ( contains ) { 8924 setGlobalEval( tmp ); 8925 } 8926 8927 // Capture executables 8928 if ( scripts ) { 8929 j = 0; 8930 while ( (elem = tmp[ j++ ]) ) { 8931 if ( rscriptType.test( elem.type || "" ) ) { 8932 scripts.push( elem ); 8933 } 8934 } 8935 } 8936 } 8937 8938 tmp = null; 8939 8940 return safe; 8941 }, 8942 8943 cleanData: function( elems, /* internal */ acceptData ) { 8944 var elem, type, id, data, 8945 i = 0, 8946 internalKey = jQuery1113.expando, 8947 cache = jQuery1113.cache, 8948 deleteExpando = support.deleteExpando, 8949 special = jQuery1113.event.special; 8950 8951 for ( ; (elem = elems[i]) != null; i++ ) { 8952 if ( acceptData || jQuery1113.acceptData( elem ) ) { 8953 8954 id = elem[ internalKey ]; 8955 data = id && cache[ id ]; 8956 8957 if ( data ) { 8958 if ( data.events ) { 8959 for ( type in data.events ) { 8960 if ( special[ type ] ) { 8961 jQuery1113.event.remove( elem, type ); 8962 8963 // This is a shortcut to avoid jQuery1113.event.remove's overhead 8964 } else { 8965 jQuery1113.removeEvent( elem, type, data.handle ); 8966 } 8967 } 8968 } 8969 8970 // Remove cache only if it was not already removed by jQuery1113.event.remove 8971 if ( cache[ id ] ) { 8972 8973 delete cache[ id ]; 8974 8975 // IE does not allow us to delete expando properties from nodes, 8976 // nor does it have a removeAttribute function on Document nodes; 8977 // we must handle all of these cases 8978 if ( deleteExpando ) { 8979 delete elem[ internalKey ]; 8980 8981 } else if ( typeof elem.removeAttribute !== strundefined ) { 8982 elem.removeAttribute( internalKey ); 8983 8984 } else { 8985 elem[ internalKey ] = null; 8986 } 8987 8988 deletedIds.push( id ); 8989 } 8990 } 8991 } 8992 } 8993 } 8994}); 8995 8996jQuery1113.fn.extend({ 8997 text: function( value ) { 8998 return access( this, function( value ) { 8999 return value === undefined ? 9000 jQuery1113.text( this ) : 9001 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); 9002 }, null, value, arguments.length ); 9003 }, 9004 9005 append: function() { 9006 return this.domManip( arguments, function( elem ) { 9007 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 9008 var target = manipulationTarget( this, elem ); 9009 target.appendChild( elem ); 9010 } 9011 }); 9012 }, 9013 9014 prepend: function() { 9015 return this.domManip( arguments, function( elem ) { 9016 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 9017 var target = manipulationTarget( this, elem ); 9018 target.insertBefore( elem, target.firstChild ); 9019 } 9020 }); 9021 }, 9022 9023 before: function() { 9024 return this.domManip( arguments, function( elem ) { 9025 if ( this.parentNode ) { 9026 this.parentNode.insertBefore( elem, this ); 9027 } 9028 }); 9029 }, 9030 9031 after: function() { 9032 return this.domManip( arguments, function( elem ) { 9033 if ( this.parentNode ) { 9034 this.parentNode.insertBefore( elem, this.nextSibling ); 9035 } 9036 }); 9037 }, 9038 9039 remove: function( selector, keepData /* Internal Use Only */ ) { 9040 var elem, 9041 elems = selector ? jQuery1113.filter( selector, this ) : this, 9042 i = 0; 9043 9044 for ( ; (elem = elems[i]) != null; i++ ) { 9045 9046 if ( !keepData && elem.nodeType === 1 ) { 9047 jQuery1113.cleanData( getAll( elem ) ); 9048 } 9049 9050 if ( elem.parentNode ) { 9051 if ( keepData && jQuery1113.contains( elem.ownerDocument, elem ) ) { 9052 setGlobalEval( getAll( elem, "script" ) ); 9053 } 9054 elem.parentNode.removeChild( elem ); 9055 } 9056 } 9057 9058 return this; 9059 }, 9060 9061 empty: function() { 9062 var elem, 9063 i = 0; 9064 9065 for ( ; (elem = this[i]) != null; i++ ) { 9066 // Remove element nodes and prevent memory leaks 9067 if ( elem.nodeType === 1 ) { 9068 jQuery1113.cleanData( getAll( elem, false ) ); 9069 } 9070 9071 // Remove any remaining nodes 9072 while ( elem.firstChild ) { 9073 elem.removeChild( elem.firstChild ); 9074 } 9075 9076 // If this is a select, ensure that it displays empty (#12336) 9077 // Support: IE<9 9078 if ( elem.options && jQuery1113.nodeName( elem, "select" ) ) { 9079 elem.options.length = 0; 9080 } 9081 } 9082 9083 return this; 9084 }, 9085 9086 clone: function( dataAndEvents, deepDataAndEvents ) { 9087 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 9088 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 9089 9090 return this.map(function() { 9091 return jQuery1113.clone( this, dataAndEvents, deepDataAndEvents ); 9092 }); 9093 }, 9094 9095 html: function( value ) { 9096 return access( this, function( value ) { 9097 var elem = this[ 0 ] || {}, 9098 i = 0, 9099 l = this.length; 9100 9101 if ( value === undefined ) { 9102 return elem.nodeType === 1 ? 9103 elem.innerHTML.replace( rinlinejQuery1113, "" ) : 9104 undefined; 9105 } 9106 9107 // See if we can take a shortcut and just use innerHTML 9108 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 9109 ( support.htmlSerialize || !rnoshimcache.test( value ) ) && 9110 ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && 9111 !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { 9112 9113 value = value.replace( rxhtmlTag, "<$1></$2>" ); 9114 9115 try { 9116 for (; i < l; i++ ) { 9117 // Remove element nodes and prevent memory leaks 9118 elem = this[i] || {}; 9119 if ( elem.nodeType === 1 ) { 9120 jQuery1113.cleanData( getAll( elem, false ) ); 9121 elem.innerHTML = value; 9122 } 9123 } 9124 9125 elem = 0; 9126 9127 // If using innerHTML throws an exception, use the fallback method 9128 } catch(e) {} 9129 } 9130 9131 if ( elem ) { 9132 this.empty().append( value ); 9133 } 9134 }, null, value, arguments.length ); 9135 }, 9136 9137 replaceWith: function() { 9138 var arg = arguments[ 0 ]; 9139 9140 // Make the changes, replacing each context element with the new content 9141 this.domManip( arguments, function( elem ) { 9142 arg = this.parentNode; 9143 9144 jQuery1113.cleanData( getAll( this ) ); 9145 9146 if ( arg ) { 9147 arg.replaceChild( elem, this ); 9148 } 9149 }); 9150 9151 // Force removal if there was no new content (e.g., from empty arguments) 9152 return arg && (arg.length || arg.nodeType) ? this : this.remove(); 9153 }, 9154 9155 detach: function( selector ) { 9156 return this.remove( selector, true ); 9157 }, 9158 9159 domManip: function( args, callback ) { 9160 9161 // Flatten any nested arrays 9162 args = concat.apply( [], args ); 9163 9164 var first, node, hasScripts, 9165 scripts, doc, fragment, 9166 i = 0, 9167 l = this.length, 9168 set = this, 9169 iNoClone = l - 1, 9170 value = args[0], 9171 isFunction = jQuery1113.isFunction( value ); 9172 9173 // We can't cloneNode fragments that contain checked, in WebKit 9174 if ( isFunction || 9175 ( l > 1 && typeof value === "string" && 9176 !support.checkClone && rchecked.test( value ) ) ) { 9177 return this.each(function( index ) { 9178 var self = set.eq( index ); 9179 if ( isFunction ) { 9180 args[0] = value.call( this, index, self.html() ); 9181 } 9182 self.domManip( args, callback ); 9183 }); 9184 } 9185 9186 if ( l ) { 9187 fragment = jQuery1113.buildFragment( args, this[ 0 ].ownerDocument, false, this ); 9188 first = fragment.firstChild; 9189 9190 if ( fragment.childNodes.length === 1 ) { 9191 fragment = first; 9192 } 9193 9194 if ( first ) { 9195 scripts = jQuery1113.map( getAll( fragment, "script" ), disableScript ); 9196 hasScripts = scripts.length; 9197 9198 // Use the original fragment for the last item instead of the first because it can end up 9199 // being emptied incorrectly in certain situations (#8070). 9200 for ( ; i < l; i++ ) { 9201 node = fragment; 9202 9203 if ( i !== iNoClone ) { 9204 node = jQuery1113.clone( node, true, true ); 9205 9206 // Keep references to cloned scripts for later restoration 9207 if ( hasScripts ) { 9208 jQuery1113.merge( scripts, getAll( node, "script" ) ); 9209 } 9210 } 9211 9212 callback.call( this[i], node, i ); 9213 } 9214 9215 if ( hasScripts ) { 9216 doc = scripts[ scripts.length - 1 ].ownerDocument; 9217 9218 // Reenable scripts 9219 jQuery1113.map( scripts, restoreScript ); 9220 9221 // Evaluate executable scripts on first document insertion 9222 for ( i = 0; i < hasScripts; i++ ) { 9223 node = scripts[ i ]; 9224 if ( rscriptType.test( node.type || "" ) && 9225 !jQuery1113._data( node, "globalEval" ) && jQuery1113.contains( doc, node ) ) { 9226 9227 if ( node.src ) { 9228 // Optional AJAX dependency, but won't run scripts if not present 9229 if ( jQuery1113._evalUrl ) { 9230 jQuery1113._evalUrl( node.src ); 9231 } 9232 } else { 9233 jQuery1113.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); 9234 } 9235 } 9236 } 9237 } 9238 9239 // Fix #11809: Avoid leaking memory 9240 fragment = first = null; 9241 } 9242 } 9243 9244 return this; 9245 } 9246}); 9247 9248jQuery1113.each({ 9249 appendTo: "append", 9250 prependTo: "prepend", 9251 insertBefore: "before", 9252 insertAfter: "after", 9253 replaceAll: "replaceWith" 9254}, function( name, original ) { 9255 jQuery1113.fn[ name ] = function( selector ) { 9256 var elems, 9257 i = 0, 9258 ret = [], 9259 insert = jQuery1113( selector ), 9260 last = insert.length - 1; 9261 9262 for ( ; i <= last; i++ ) { 9263 elems = i === last ? this : this.clone(true); 9264 jQuery1113( insert[i] )[ original ]( elems ); 9265 9266 // Modern browsers can apply jQuery1113 collections as arrays, but oldIE needs a .get() 9267 push.apply( ret, elems.get() ); 9268 } 9269 9270 return this.pushStack( ret ); 9271 }; 9272}); 9273 9274 9275var iframe, 9276 elemdisplay = {}; 9277 9278/** 9279 * Retrieve the actual display of a element 9280 * @param {String} name nodeName of the element 9281 * @param {Object} doc Document object 9282 */ 9283// Called only from within defaultDisplay 9284function actualDisplay( name, doc ) { 9285 var style, 9286 elem = jQuery1113( doc.createElement( name ) ).appendTo( doc.body ), 9287 9288 // getDefaultComputedStyle might be reliably used only on attached element 9289 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? 9290 9291 // Use of this method is a temporary fix (more like optmization) until something better comes along, 9292 // since it was removed from specification and supported only in FF 9293 style.display : jQuery1113.css( elem[ 0 ], "display" ); 9294 9295 // We don't have any data stored on the element, 9296 // so use "detach" method as fast way to get rid of the element 9297 elem.detach(); 9298 9299 return display; 9300} 9301 9302/** 9303 * Try to determine the default display value of an element 9304 * @param {String} nodeName 9305 */ 9306function defaultDisplay( nodeName ) { 9307 var doc = document, 9308 display = elemdisplay[ nodeName ]; 9309 9310 if ( !display ) { 9311 display = actualDisplay( nodeName, doc ); 9312 9313 // If the simple way fails, read from inside an iframe 9314 if ( display === "none" || !display ) { 9315 9316 // Use the already-created iframe if possible 9317 iframe = (iframe || jQuery1113( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); 9318 9319 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 9320 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; 9321 9322 // Support: IE 9323 doc.write(); 9324 doc.close(); 9325 9326 display = actualDisplay( nodeName, doc ); 9327 iframe.detach(); 9328 } 9329 9330 // Store the correct default display 9331 elemdisplay[ nodeName ] = display; 9332 } 9333 9334 return display; 9335} 9336 9337 9338(function() { 9339 var shrinkWrapBlocksVal; 9340 9341 support.shrinkWrapBlocks = function() { 9342 if ( shrinkWrapBlocksVal != null ) { 9343 return shrinkWrapBlocksVal; 9344 } 9345 9346 // Will be changed later if needed. 9347 shrinkWrapBlocksVal = false; 9348 9349 // Minified: var b,c,d 9350 var div, body, container; 9351 9352 body = document.getElementsByTagName( "body" )[ 0 ]; 9353 if ( !body || !body.style ) { 9354 // Test fired too early or in an unsupported environment, exit. 9355 return; 9356 } 9357 9358 // Setup 9359 div = document.createElement( "div" ); 9360 container = document.createElement( "div" ); 9361 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 9362 body.appendChild( container ).appendChild( div ); 9363 9364 // Support: IE6 9365 // Check if elements with layout shrink-wrap their children 9366 if ( typeof div.style.zoom !== strundefined ) { 9367 // Reset CSS: box-sizing; display; margin; border 9368 div.style.cssText = 9369 // Support: Firefox<29, Android 2.3 9370 // Vendor-prefix box-sizing 9371 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 9372 "box-sizing:content-box;display:block;margin:0;border:0;" + 9373 "padding:1px;width:1px;zoom:1"; 9374 div.appendChild( document.createElement( "div" ) ).style.width = "5px"; 9375 shrinkWrapBlocksVal = div.offsetWidth !== 3; 9376 } 9377 9378 body.removeChild( container ); 9379 9380 return shrinkWrapBlocksVal; 9381 }; 9382 9383})(); 9384var rmargin = (/^margin/); 9385 9386var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 9387 9388 9389 9390var getStyles, curCSS, 9391 rposition = /^(top|right|bottom|left)$/; 9392 9393if ( window.getComputedStyle ) { 9394 getStyles = function( elem ) { 9395 // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 9396 // IE throws on elements created in popups 9397 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 9398 if ( elem.ownerDocument.defaultView.opener ) { 9399 return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); 9400 } 9401 9402 return window.getComputedStyle( elem, null ); 9403 }; 9404 9405 curCSS = function( elem, name, computed ) { 9406 var width, minWidth, maxWidth, ret, 9407 style = elem.style; 9408 9409 computed = computed || getStyles( elem ); 9410 9411 // getPropertyValue is only needed for .css('filter') in IE9, see #12537 9412 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; 9413 9414 if ( computed ) { 9415 9416 if ( ret === "" && !jQuery1113.contains( elem.ownerDocument, elem ) ) { 9417 ret = jQuery1113.style( elem, name ); 9418 } 9419 9420 // A tribute to the "awesome hack by Dean Edwards" 9421 // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right 9422 // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels 9423 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values 9424 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { 9425 9426 // Remember the original values 9427 width = style.width; 9428 minWidth = style.minWidth; 9429 maxWidth = style.maxWidth; 9430 9431 // Put in the new values to get a computed value out 9432 style.minWidth = style.maxWidth = style.width = ret; 9433 ret = computed.width; 9434 9435 // Revert the changed values 9436 style.width = width; 9437 style.minWidth = minWidth; 9438 style.maxWidth = maxWidth; 9439 } 9440 } 9441 9442 // Support: IE 9443 // IE returns zIndex value as an integer. 9444 return ret === undefined ? 9445 ret : 9446 ret + ""; 9447 }; 9448} else if ( document.documentElement.currentStyle ) { 9449 getStyles = function( elem ) { 9450 return elem.currentStyle; 9451 }; 9452 9453 curCSS = function( elem, name, computed ) { 9454 var left, rs, rsLeft, ret, 9455 style = elem.style; 9456 9457 computed = computed || getStyles( elem ); 9458 ret = computed ? computed[ name ] : undefined; 9459 9460 // Avoid setting ret to empty string here 9461 // so we don't default to auto 9462 if ( ret == null && style && style[ name ] ) { 9463 ret = style[ name ]; 9464 } 9465 9466 // From the awesome hack by Dean Edwards 9467 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 9468 9469 // If we're not dealing with a regular pixel number 9470 // but a number that has a weird ending, we need to convert it to pixels 9471 // but not position css attributes, as those are proportional to the parent element instead 9472 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem 9473 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { 9474 9475 // Remember the original values 9476 left = style.left; 9477 rs = elem.runtimeStyle; 9478 rsLeft = rs && rs.left; 9479 9480 // Put in the new values to get a computed value out 9481 if ( rsLeft ) { 9482 rs.left = elem.currentStyle.left; 9483 } 9484 style.left = name === "fontSize" ? "1em" : ret; 9485 ret = style.pixelLeft + "px"; 9486 9487 // Revert the changed values 9488 style.left = left; 9489 if ( rsLeft ) { 9490 rs.left = rsLeft; 9491 } 9492 } 9493 9494 // Support: IE 9495 // IE returns zIndex value as an integer. 9496 return ret === undefined ? 9497 ret : 9498 ret + "" || "auto"; 9499 }; 9500} 9501 9502 9503 9504 9505function addGetHookIf( conditionFn, hookFn ) { 9506 // Define the hook, we'll check on the first run if it's really needed. 9507 return { 9508 get: function() { 9509 var condition = conditionFn(); 9510 9511 if ( condition == null ) { 9512 // The test was not ready at this point; screw the hook this time 9513 // but check again when needed next time. 9514 return; 9515 } 9516 9517 if ( condition ) { 9518 // Hook not needed (or it's not possible to use it due to missing dependency), 9519 // remove it. 9520 // Since there are no other hooks for marginRight, remove the whole object. 9521 delete this.get; 9522 return; 9523 } 9524 9525 // Hook needed; redefine it so that the support test is not executed again. 9526 9527 return (this.get = hookFn).apply( this, arguments ); 9528 } 9529 }; 9530} 9531 9532 9533(function() { 9534 // Minified: var b,c,d,e,f,g, h,i 9535 var div, style, a, pixelPositionVal, boxSizingReliableVal, 9536 reliableHiddenOffsetsVal, reliableMarginRightVal; 9537 9538 // Setup 9539 div = document.createElement( "div" ); 9540 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 9541 a = div.getElementsByTagName( "a" )[ 0 ]; 9542 style = a && a.style; 9543 9544 // Finish early in limited (non-browser) environments 9545 if ( !style ) { 9546 return; 9547 } 9548 9549 style.cssText = "float:left;opacity:.5"; 9550 9551 // Support: IE<9 9552 // Make sure that element opacity exists (as opposed to filter) 9553 support.opacity = style.opacity === "0.5"; 9554 9555 // Verify style float existence 9556 // (IE uses styleFloat instead of cssFloat) 9557 support.cssFloat = !!style.cssFloat; 9558 9559 div.style.backgroundClip = "content-box"; 9560 div.cloneNode( true ).style.backgroundClip = ""; 9561 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 9562 9563 // Support: Firefox<29, Android 2.3 9564 // Vendor-prefix box-sizing 9565 support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || 9566 style.WebkitBoxSizing === ""; 9567 9568 jQuery1113.extend(support, { 9569 reliableHiddenOffsets: function() { 9570 if ( reliableHiddenOffsetsVal == null ) { 9571 computeStyleTests(); 9572 } 9573 return reliableHiddenOffsetsVal; 9574 }, 9575 9576 boxSizingReliable: function() { 9577 if ( boxSizingReliableVal == null ) { 9578 computeStyleTests(); 9579 } 9580 return boxSizingReliableVal; 9581 }, 9582 9583 pixelPosition: function() { 9584 if ( pixelPositionVal == null ) { 9585 computeStyleTests(); 9586 } 9587 return pixelPositionVal; 9588 }, 9589 9590 // Support: Android 2.3 9591 reliableMarginRight: function() { 9592 if ( reliableMarginRightVal == null ) { 9593 computeStyleTests(); 9594 } 9595 return reliableMarginRightVal; 9596 } 9597 }); 9598 9599 function computeStyleTests() { 9600 // Minified: var b,c,d,j 9601 var div, body, container, contents; 9602 9603 body = document.getElementsByTagName( "body" )[ 0 ]; 9604 if ( !body || !body.style ) { 9605 // Test fired too early or in an unsupported environment, exit. 9606 return; 9607 } 9608 9609 // Setup 9610 div = document.createElement( "div" ); 9611 container = document.createElement( "div" ); 9612 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 9613 body.appendChild( container ).appendChild( div ); 9614 9615 div.style.cssText = 9616 // Support: Firefox<29, Android 2.3 9617 // Vendor-prefix box-sizing 9618 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + 9619 "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + 9620 "border:1px;padding:1px;width:4px;position:absolute"; 9621 9622 // Support: IE<9 9623 // Assume reasonable values in the absence of getComputedStyle 9624 pixelPositionVal = boxSizingReliableVal = false; 9625 reliableMarginRightVal = true; 9626 9627 // Check for getComputedStyle so that this code is not run in IE<9. 9628 if ( window.getComputedStyle ) { 9629 pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; 9630 boxSizingReliableVal = 9631 ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; 9632 9633 // Support: Android 2.3 9634 // Div with explicit width and no margin-right incorrectly 9635 // gets computed margin-right based on width of container (#3333) 9636 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 9637 contents = div.appendChild( document.createElement( "div" ) ); 9638 9639 // Reset CSS: box-sizing; display; margin; border; padding 9640 contents.style.cssText = div.style.cssText = 9641 // Support: Firefox<29, Android 2.3 9642 // Vendor-prefix box-sizing 9643 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 9644 "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; 9645 contents.style.marginRight = contents.style.width = "0"; 9646 div.style.width = "1px"; 9647 9648 reliableMarginRightVal = 9649 !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight ); 9650 9651 div.removeChild( contents ); 9652 } 9653 9654 // Support: IE8 9655 // Check if table cells still have offsetWidth/Height when they are set 9656 // to display:none and there are still other visible table cells in a 9657 // table row; if so, offsetWidth/Height are not reliable for use when 9658 // determining if an element has been hidden directly using 9659 // display:none (it is still safe to use offsets if a parent element is 9660 // hidden; don safety goggles and see bug #4512 for more information). 9661 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; 9662 contents = div.getElementsByTagName( "td" ); 9663 contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; 9664 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; 9665 if ( reliableHiddenOffsetsVal ) { 9666 contents[ 0 ].style.display = ""; 9667 contents[ 1 ].style.display = "none"; 9668 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; 9669 } 9670 9671 body.removeChild( container ); 9672 } 9673 9674})(); 9675 9676 9677// A method for quickly swapping in/out CSS properties to get correct calculations. 9678jQuery1113.swap = function( elem, options, callback, args ) { 9679 var ret, name, 9680 old = {}; 9681 9682 // Remember the old values, and insert the new ones 9683 for ( name in options ) { 9684 old[ name ] = elem.style[ name ]; 9685 elem.style[ name ] = options[ name ]; 9686 } 9687 9688 ret = callback.apply( elem, args || [] ); 9689 9690 // Revert the old values 9691 for ( name in options ) { 9692 elem.style[ name ] = old[ name ]; 9693 } 9694 9695 return ret; 9696}; 9697 9698 9699var 9700 ralpha = /alpha\([^)]*\)/i, 9701 ropacity = /opacity\s*=\s*([^)]*)/, 9702 9703 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" 9704 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 9705 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 9706 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), 9707 rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ), 9708 9709 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 9710 cssNormalTransform = { 9711 letterSpacing: "0", 9712 fontWeight: "400" 9713 }, 9714 9715 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; 9716 9717 9718// return a css property mapped to a potentially vendor prefixed property 9719function vendorPropName( style, name ) { 9720 9721 // shortcut for names that are not vendor prefixed 9722 if ( name in style ) { 9723 return name; 9724 } 9725 9726 // check for vendor prefixed names 9727 var capName = name.charAt(0).toUpperCase() + name.slice(1), 9728 origName = name, 9729 i = cssPrefixes.length; 9730 9731 while ( i-- ) { 9732 name = cssPrefixes[ i ] + capName; 9733 if ( name in style ) { 9734 return name; 9735 } 9736 } 9737 9738 return origName; 9739} 9740 9741function showHide( elements, show ) { 9742 var display, elem, hidden, 9743 values = [], 9744 index = 0, 9745 length = elements.length; 9746 9747 for ( ; index < length; index++ ) { 9748 elem = elements[ index ]; 9749 if ( !elem.style ) { 9750 continue; 9751 } 9752 9753 values[ index ] = jQuery1113._data( elem, "olddisplay" ); 9754 display = elem.style.display; 9755 if ( show ) { 9756 // Reset the inline display of this element to learn if it is 9757 // being hidden by cascaded rules or not 9758 if ( !values[ index ] && display === "none" ) { 9759 elem.style.display = ""; 9760 } 9761 9762 // Set elements which have been overridden with display: none 9763 // in a stylesheet to whatever the default browser style is 9764 // for such an element 9765 if ( elem.style.display === "" && isHidden( elem ) ) { 9766 values[ index ] = jQuery1113._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); 9767 } 9768 } else { 9769 hidden = isHidden( elem ); 9770 9771 if ( display && display !== "none" || !hidden ) { 9772 jQuery1113._data( elem, "olddisplay", hidden ? display : jQuery1113.css( elem, "display" ) ); 9773 } 9774 } 9775 } 9776 9777 // Set the display of most of the elements in a second loop 9778 // to avoid the constant reflow 9779 for ( index = 0; index < length; index++ ) { 9780 elem = elements[ index ]; 9781 if ( !elem.style ) { 9782 continue; 9783 } 9784 if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 9785 elem.style.display = show ? values[ index ] || "" : "none"; 9786 } 9787 } 9788 9789 return elements; 9790} 9791 9792function setPositiveNumber( elem, value, subtract ) { 9793 var matches = rnumsplit.exec( value ); 9794 return matches ? 9795 // Guard against undefined "subtract", e.g., when used as in cssHooks 9796 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : 9797 value; 9798} 9799 9800function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 9801 var i = extra === ( isBorderBox ? "border" : "content" ) ? 9802 // If we already have the right measurement, avoid augmentation 9803 4 : 9804 // Otherwise initialize for horizontal or vertical properties 9805 name === "width" ? 1 : 0, 9806 9807 val = 0; 9808 9809 for ( ; i < 4; i += 2 ) { 9810 // both box models exclude margin, so add it if we want it 9811 if ( extra === "margin" ) { 9812 val += jQuery1113.css( elem, extra + cssExpand[ i ], true, styles ); 9813 } 9814 9815 if ( isBorderBox ) { 9816 // border-box includes padding, so remove it if we want content 9817 if ( extra === "content" ) { 9818 val -= jQuery1113.css( elem, "padding" + cssExpand[ i ], true, styles ); 9819 } 9820 9821 // at this point, extra isn't border nor margin, so remove border 9822 if ( extra !== "margin" ) { 9823 val -= jQuery1113.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 9824 } 9825 } else { 9826 // at this point, extra isn't content, so add padding 9827 val += jQuery1113.css( elem, "padding" + cssExpand[ i ], true, styles ); 9828 9829 // at this point, extra isn't content nor padding, so add border 9830 if ( extra !== "padding" ) { 9831 val += jQuery1113.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 9832 } 9833 } 9834 } 9835 9836 return val; 9837} 9838 9839function getWidthOrHeight( elem, name, extra ) { 9840 9841 // Start with offset property, which is equivalent to the border-box value 9842 var valueIsBorderBox = true, 9843 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 9844 styles = getStyles( elem ), 9845 isBorderBox = support.boxSizing && jQuery1113.css( elem, "boxSizing", false, styles ) === "border-box"; 9846 9847 // some non-html elements return undefined for offsetWidth, so check for null/undefined 9848 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 9849 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 9850 if ( val <= 0 || val == null ) { 9851 // Fall back to computed then uncomputed css if necessary 9852 val = curCSS( elem, name, styles ); 9853 if ( val < 0 || val == null ) { 9854 val = elem.style[ name ]; 9855 } 9856 9857 // Computed unit is not pixels. Stop here and return. 9858 if ( rnumnonpx.test(val) ) { 9859 return val; 9860 } 9861 9862 // we need the check for style in case a browser which returns unreliable values 9863 // for getComputedStyle silently falls back to the reliable elem.style 9864 valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); 9865 9866 // Normalize "", auto, and prepare for extra 9867 val = parseFloat( val ) || 0; 9868 } 9869 9870 // use the active box-sizing model to add/subtract irrelevant styles 9871 return ( val + 9872 augmentWidthOrHeight( 9873 elem, 9874 name, 9875 extra || ( isBorderBox ? "border" : "content" ), 9876 valueIsBorderBox, 9877 styles 9878 ) 9879 ) + "px"; 9880} 9881 9882jQuery1113.extend({ 9883 // Add in style property hooks for overriding the default 9884 // behavior of getting and setting a style property 9885 cssHooks: { 9886 opacity: { 9887 get: function( elem, computed ) { 9888 if ( computed ) { 9889 // We should always get a number back from opacity 9890 var ret = curCSS( elem, "opacity" ); 9891 return ret === "" ? "1" : ret; 9892 } 9893 } 9894 } 9895 }, 9896 9897 // Don't automatically add "px" to these possibly-unitless properties 9898 cssNumber: { 9899 "columnCount": true, 9900 "fillOpacity": true, 9901 "flexGrow": true, 9902 "flexShrink": true, 9903 "fontWeight": true, 9904 "lineHeight": true, 9905 "opacity": true, 9906 "order": true, 9907 "orphans": true, 9908 "widows": true, 9909 "zIndex": true, 9910 "zoom": true 9911 }, 9912 9913 // Add in properties whose names you wish to fix before 9914 // setting or getting the value 9915 cssProps: { 9916 // normalize float css property 9917 "float": support.cssFloat ? "cssFloat" : "styleFloat" 9918 }, 9919 9920 // Get and set the style property on a DOM Node 9921 style: function( elem, name, value, extra ) { 9922 // Don't set styles on text and comment nodes 9923 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 9924 return; 9925 } 9926 9927 // Make sure that we're working with the right name 9928 var ret, type, hooks, 9929 origName = jQuery1113.camelCase( name ), 9930 style = elem.style; 9931 9932 name = jQuery1113.cssProps[ origName ] || ( jQuery1113.cssProps[ origName ] = vendorPropName( style, origName ) ); 9933 9934 // gets hook for the prefixed version 9935 // followed by the unprefixed version 9936 hooks = jQuery1113.cssHooks[ name ] || jQuery1113.cssHooks[ origName ]; 9937 9938 // Check if we're setting a value 9939 if ( value !== undefined ) { 9940 type = typeof value; 9941 9942 // convert relative number strings (+= or -=) to relative numbers. #7345 9943 if ( type === "string" && (ret = rrelNum.exec( value )) ) { 9944 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery1113.css( elem, name ) ); 9945 // Fixes bug #9237 9946 type = "number"; 9947 } 9948 9949 // Make sure that null and NaN values aren't set. See: #7116 9950 if ( value == null || value !== value ) { 9951 return; 9952 } 9953 9954 // If a number was passed in, add 'px' to the (except for certain CSS properties) 9955 if ( type === "number" && !jQuery1113.cssNumber[ origName ] ) { 9956 value += "px"; 9957 } 9958 9959 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, 9960 // but it would mean to define eight (for every problematic property) identical functions 9961 if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { 9962 style[ name ] = "inherit"; 9963 } 9964 9965 // If a hook was provided, use that value, otherwise just set the specified value 9966 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { 9967 9968 // Support: IE 9969 // Swallow errors from 'invalid' CSS values (#5509) 9970 try { 9971 style[ name ] = value; 9972 } catch(e) {} 9973 } 9974 9975 } else { 9976 // If a hook was provided get the non-computed value from there 9977 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { 9978 return ret; 9979 } 9980 9981 // Otherwise just get the value from the style object 9982 return style[ name ]; 9983 } 9984 }, 9985 9986 css: function( elem, name, extra, styles ) { 9987 var num, val, hooks, 9988 origName = jQuery1113.camelCase( name ); 9989 9990 // Make sure that we're working with the right name 9991 name = jQuery1113.cssProps[ origName ] || ( jQuery1113.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); 9992 9993 // gets hook for the prefixed version 9994 // followed by the unprefixed version 9995 hooks = jQuery1113.cssHooks[ name ] || jQuery1113.cssHooks[ origName ]; 9996 9997 // If a hook was provided get the computed value from there 9998 if ( hooks && "get" in hooks ) { 9999 val = hooks.get( elem, true, extra ); 10000 } 10001 10002 // Otherwise, if a way to get the computed value exists, use that 10003 if ( val === undefined ) { 10004 val = curCSS( elem, name, styles ); 10005 } 10006 10007 //convert "normal" to computed value 10008 if ( val === "normal" && name in cssNormalTransform ) { 10009 val = cssNormalTransform[ name ]; 10010 } 10011 10012 // Return, converting to number if forced or a qualifier was provided and val looks numeric 10013 if ( extra === "" || extra ) { 10014 num = parseFloat( val ); 10015 return extra === true || jQuery1113.isNumeric( num ) ? num || 0 : val; 10016 } 10017 return val; 10018 } 10019}); 10020 10021jQuery1113.each([ "height", "width" ], function( i, name ) { 10022 jQuery1113.cssHooks[ name ] = { 10023 get: function( elem, computed, extra ) { 10024 if ( computed ) { 10025 // certain elements can have dimension info if we invisibly show them 10026 // however, it must have a current display style that would benefit from this 10027 return rdisplayswap.test( jQuery1113.css( elem, "display" ) ) && elem.offsetWidth === 0 ? 10028 jQuery1113.swap( elem, cssShow, function() { 10029 return getWidthOrHeight( elem, name, extra ); 10030 }) : 10031 getWidthOrHeight( elem, name, extra ); 10032 } 10033 }, 10034 10035 set: function( elem, value, extra ) { 10036 var styles = extra && getStyles( elem ); 10037 return setPositiveNumber( elem, value, extra ? 10038 augmentWidthOrHeight( 10039 elem, 10040 name, 10041 extra, 10042 support.boxSizing && jQuery1113.css( elem, "boxSizing", false, styles ) === "border-box", 10043 styles 10044 ) : 0 10045 ); 10046 } 10047 }; 10048}); 10049 10050if ( !support.opacity ) { 10051 jQuery1113.cssHooks.opacity = { 10052 get: function( elem, computed ) { 10053 // IE uses filters for opacity 10054 return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? 10055 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : 10056 computed ? "1" : ""; 10057 }, 10058 10059 set: function( elem, value ) { 10060 var style = elem.style, 10061 currentStyle = elem.currentStyle, 10062 opacity = jQuery1113.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", 10063 filter = currentStyle && currentStyle.filter || style.filter || ""; 10064 10065 // IE has trouble with opacity if it does not have layout 10066 // Force it by setting the zoom level 10067 style.zoom = 1; 10068 10069 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 10070 // if value === "", then remove inline opacity #12685 10071 if ( ( value >= 1 || value === "" ) && 10072 jQuery1113.trim( filter.replace( ralpha, "" ) ) === "" && 10073 style.removeAttribute ) { 10074 10075 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText 10076 // if "filter:" is present at all, clearType is disabled, we want to avoid this 10077 // style.removeAttribute is IE Only, but so apparently is this code path... 10078 style.removeAttribute( "filter" ); 10079 10080 // if there is no filter style applied in a css rule or unset inline opacity, we are done 10081 if ( value === "" || currentStyle && !currentStyle.filter ) { 10082 return; 10083 } 10084 } 10085 10086 // otherwise, set new filter values 10087 style.filter = ralpha.test( filter ) ? 10088 filter.replace( ralpha, opacity ) : 10089 filter + " " + opacity; 10090 } 10091 }; 10092} 10093 10094jQuery1113.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, 10095 function( elem, computed ) { 10096 if ( computed ) { 10097 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 10098 // Work around by temporarily setting element display to inline-block 10099 return jQuery1113.swap( elem, { "display": "inline-block" }, 10100 curCSS, [ elem, "marginRight" ] ); 10101 } 10102 } 10103); 10104 10105// These hooks are used by animate to expand properties 10106jQuery1113.each({ 10107 margin: "", 10108 padding: "", 10109 border: "Width" 10110}, function( prefix, suffix ) { 10111 jQuery1113.cssHooks[ prefix + suffix ] = { 10112 expand: function( value ) { 10113 var i = 0, 10114 expanded = {}, 10115 10116 // assumes a single number if not a string 10117 parts = typeof value === "string" ? value.split(" ") : [ value ]; 10118 10119 for ( ; i < 4; i++ ) { 10120 expanded[ prefix + cssExpand[ i ] + suffix ] = 10121 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 10122 } 10123 10124 return expanded; 10125 } 10126 }; 10127 10128 if ( !rmargin.test( prefix ) ) { 10129 jQuery1113.cssHooks[ prefix + suffix ].set = setPositiveNumber; 10130 } 10131}); 10132 10133jQuery1113.fn.extend({ 10134 css: function( name, value ) { 10135 return access( this, function( elem, name, value ) { 10136 var styles, len, 10137 map = {}, 10138 i = 0; 10139 10140 if ( jQuery1113.isArray( name ) ) { 10141 styles = getStyles( elem ); 10142 len = name.length; 10143 10144 for ( ; i < len; i++ ) { 10145 map[ name[ i ] ] = jQuery1113.css( elem, name[ i ], false, styles ); 10146 } 10147 10148 return map; 10149 } 10150 10151 return value !== undefined ? 10152 jQuery1113.style( elem, name, value ) : 10153 jQuery1113.css( elem, name ); 10154 }, name, value, arguments.length > 1 ); 10155 }, 10156 show: function() { 10157 return showHide( this, true ); 10158 }, 10159 hide: function() { 10160 return showHide( this ); 10161 }, 10162 toggle: function( state ) { 10163 if ( typeof state === "boolean" ) { 10164 return state ? this.show() : this.hide(); 10165 } 10166 10167 return this.each(function() { 10168 if ( isHidden( this ) ) { 10169 jQuery1113( this ).show(); 10170 } else { 10171 jQuery1113( this ).hide(); 10172 } 10173 }); 10174 } 10175}); 10176 10177 10178function Tween( elem, options, prop, end, easing ) { 10179 return new Tween.prototype.init( elem, options, prop, end, easing ); 10180} 10181jQuery1113.Tween = Tween; 10182 10183Tween.prototype = { 10184 constructor: Tween, 10185 init: function( elem, options, prop, end, easing, unit ) { 10186 this.elem = elem; 10187 this.prop = prop; 10188 this.easing = easing || "swing"; 10189 this.options = options; 10190 this.start = this.now = this.cur(); 10191 this.end = end; 10192 this.unit = unit || ( jQuery1113.cssNumber[ prop ] ? "" : "px" ); 10193 }, 10194 cur: function() { 10195 var hooks = Tween.propHooks[ this.prop ]; 10196 10197 return hooks && hooks.get ? 10198 hooks.get( this ) : 10199 Tween.propHooks._default.get( this ); 10200 }, 10201 run: function( percent ) { 10202 var eased, 10203 hooks = Tween.propHooks[ this.prop ]; 10204 10205 if ( this.options.duration ) { 10206 this.pos = eased = jQuery1113.easing[ this.easing ]( 10207 percent, this.options.duration * percent, 0, 1, this.options.duration 10208 ); 10209 } else { 10210 this.pos = eased = percent; 10211 } 10212 this.now = ( this.end - this.start ) * eased + this.start; 10213 10214 if ( this.options.step ) { 10215 this.options.step.call( this.elem, this.now, this ); 10216 } 10217 10218 if ( hooks && hooks.set ) { 10219 hooks.set( this ); 10220 } else { 10221 Tween.propHooks._default.set( this ); 10222 } 10223 return this; 10224 } 10225}; 10226 10227Tween.prototype.init.prototype = Tween.prototype; 10228 10229Tween.propHooks = { 10230 _default: { 10231 get: function( tween ) { 10232 var result; 10233 10234 if ( tween.elem[ tween.prop ] != null && 10235 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { 10236 return tween.elem[ tween.prop ]; 10237 } 10238 10239 // passing an empty string as a 3rd parameter to .css will automatically 10240 // attempt a parseFloat and fallback to a string if the parse fails 10241 // so, simple values such as "10px" are parsed to Float. 10242 // complex values such as "rotate(1rad)" are returned as is. 10243 result = jQuery1113.css( tween.elem, tween.prop, "" ); 10244 // Empty strings, null, undefined and "auto" are converted to 0. 10245 return !result || result === "auto" ? 0 : result; 10246 }, 10247 set: function( tween ) { 10248 // use step hook for back compat - use cssHook if its there - use .style if its 10249 // available and use plain properties where available 10250 if ( jQuery1113.fx.step[ tween.prop ] ) { 10251 jQuery1113.fx.step[ tween.prop ]( tween ); 10252 } else if ( tween.elem.style && ( tween.elem.style[ jQuery1113.cssProps[ tween.prop ] ] != null || jQuery1113.cssHooks[ tween.prop ] ) ) { 10253 jQuery1113.style( tween.elem, tween.prop, tween.now + tween.unit ); 10254 } else { 10255 tween.elem[ tween.prop ] = tween.now; 10256 } 10257 } 10258 } 10259}; 10260 10261// Support: IE <=9 10262// Panic based approach to setting things on disconnected nodes 10263 10264Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 10265 set: function( tween ) { 10266 if ( tween.elem.nodeType && tween.elem.parentNode ) { 10267 tween.elem[ tween.prop ] = tween.now; 10268 } 10269 } 10270}; 10271 10272jQuery1113.easing = { 10273 linear: function( p ) { 10274 return p; 10275 }, 10276 swing: function( p ) { 10277 return 0.5 - Math.cos( p * Math.PI ) / 2; 10278 } 10279}; 10280 10281jQuery1113.fx = Tween.prototype.init; 10282 10283// Back Compat <1.8 extension point 10284jQuery1113.fx.step = {}; 10285 10286 10287 10288 10289var 10290 fxNow, timerId, 10291 rfxtypes = /^(?:toggle|show|hide)$/, 10292 rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ), 10293 rrun = /queueHooks$/, 10294 animationPrefilters = [ defaultPrefilter ], 10295 tweeners = { 10296 "*": [ function( prop, value ) { 10297 var tween = this.createTween( prop, value ), 10298 target = tween.cur(), 10299 parts = rfxnum.exec( value ), 10300 unit = parts && parts[ 3 ] || ( jQuery1113.cssNumber[ prop ] ? "" : "px" ), 10301 10302 // Starting value computation is required for potential unit mismatches 10303 start = ( jQuery1113.cssNumber[ prop ] || unit !== "px" && +target ) && 10304 rfxnum.exec( jQuery1113.css( tween.elem, prop ) ), 10305 scale = 1, 10306 maxIterations = 20; 10307 10308 if ( start && start[ 3 ] !== unit ) { 10309 // Trust units reported by jQuery1113.css 10310 unit = unit || start[ 3 ]; 10311 10312 // Make sure we update the tween properties later on 10313 parts = parts || []; 10314 10315 // Iteratively approximate from a nonzero starting point 10316 start = +target || 1; 10317 10318 do { 10319 // If previous iteration zeroed out, double until we get *something* 10320 // Use a string for doubling factor so we don't accidentally see scale as unchanged below 10321 scale = scale || ".5"; 10322 10323 // Adjust and apply 10324 start = start / scale; 10325 jQuery1113.style( tween.elem, prop, start + unit ); 10326 10327 // Update scale, tolerating zero or NaN from tween.cur() 10328 // And breaking the loop if scale is unchanged or perfect, or if we've just had enough 10329 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); 10330 } 10331 10332 // Update tween properties 10333 if ( parts ) { 10334 start = tween.start = +start || +target || 0; 10335 tween.unit = unit; 10336 // If a +=/-= token was provided, we're doing a relative animation 10337 tween.end = parts[ 1 ] ? 10338 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : 10339 +parts[ 2 ]; 10340 } 10341 10342 return tween; 10343 } ] 10344 }; 10345 10346// Animations created synchronously will run synchronously 10347function createFxNow() { 10348 setTimeout(function() { 10349 fxNow = undefined; 10350 }); 10351 return ( fxNow = jQuery1113.now() ); 10352} 10353 10354// Generate parameters to create a standard animation 10355function genFx( type, includeWidth ) { 10356 var which, 10357 attrs = { height: type }, 10358 i = 0; 10359 10360 // if we include width, step value is 1 to do all cssExpand values, 10361 // if we don't include width, step value is 2 to skip over Left and Right 10362 includeWidth = includeWidth ? 1 : 0; 10363 for ( ; i < 4 ; i += 2 - includeWidth ) { 10364 which = cssExpand[ i ]; 10365 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 10366 } 10367 10368 if ( includeWidth ) { 10369 attrs.opacity = attrs.width = type; 10370 } 10371 10372 return attrs; 10373} 10374 10375function createTween( value, prop, animation ) { 10376 var tween, 10377 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), 10378 index = 0, 10379 length = collection.length; 10380 for ( ; index < length; index++ ) { 10381 if ( (tween = collection[ index ].call( animation, prop, value )) ) { 10382 10383 // we're done with this property 10384 return tween; 10385 } 10386 } 10387} 10388 10389function defaultPrefilter( elem, props, opts ) { 10390 /* jshint validthis: true */ 10391 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, 10392 anim = this, 10393 orig = {}, 10394 style = elem.style, 10395 hidden = elem.nodeType && isHidden( elem ), 10396 dataShow = jQuery1113._data( elem, "fxshow" ); 10397 10398 // handle queue: false promises 10399 if ( !opts.queue ) { 10400 hooks = jQuery1113._queueHooks( elem, "fx" ); 10401 if ( hooks.unqueued == null ) { 10402 hooks.unqueued = 0; 10403 oldfire = hooks.empty.fire; 10404 hooks.empty.fire = function() { 10405 if ( !hooks.unqueued ) { 10406 oldfire(); 10407 } 10408 }; 10409 } 10410 hooks.unqueued++; 10411 10412 anim.always(function() { 10413 // doing this makes sure that the complete handler will be called 10414 // before this completes 10415 anim.always(function() { 10416 hooks.unqueued--; 10417 if ( !jQuery1113.queue( elem, "fx" ).length ) { 10418 hooks.empty.fire(); 10419 } 10420 }); 10421 }); 10422 } 10423 10424 // height/width overflow pass 10425 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { 10426 // Make sure that nothing sneaks out 10427 // Record all 3 overflow attributes because IE does not 10428 // change the overflow attribute when overflowX and 10429 // overflowY are set to the same value 10430 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 10431 10432 // Set display property to inline-block for height/width 10433 // animations on inline elements that are having width/height animated 10434 display = jQuery1113.css( elem, "display" ); 10435 10436 // Test default display if display is currently "none" 10437 checkDisplay = display === "none" ? 10438 jQuery1113._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; 10439 10440 if ( checkDisplay === "inline" && jQuery1113.css( elem, "float" ) === "none" ) { 10441 10442 // inline-level elements accept inline-block; 10443 // block-level elements need to be inline with layout 10444 if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { 10445 style.display = "inline-block"; 10446 } else { 10447 style.zoom = 1; 10448 } 10449 } 10450 } 10451 10452 if ( opts.overflow ) { 10453 style.overflow = "hidden"; 10454 if ( !support.shrinkWrapBlocks() ) { 10455 anim.always(function() { 10456 style.overflow = opts.overflow[ 0 ]; 10457 style.overflowX = opts.overflow[ 1 ]; 10458 style.overflowY = opts.overflow[ 2 ]; 10459 }); 10460 } 10461 } 10462 10463 // show/hide pass 10464 for ( prop in props ) { 10465 value = props[ prop ]; 10466 if ( rfxtypes.exec( value ) ) { 10467 delete props[ prop ]; 10468 toggle = toggle || value === "toggle"; 10469 if ( value === ( hidden ? "hide" : "show" ) ) { 10470 10471 // 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 10472 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 10473 hidden = true; 10474 } else { 10475 continue; 10476 } 10477 } 10478 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery1113.style( elem, prop ); 10479 10480 // Any non-fx value stops us from restoring the original display value 10481 } else { 10482 display = undefined; 10483 } 10484 } 10485 10486 if ( !jQuery1113.isEmptyObject( orig ) ) { 10487 if ( dataShow ) { 10488 if ( "hidden" in dataShow ) { 10489 hidden = dataShow.hidden; 10490 } 10491 } else { 10492 dataShow = jQuery1113._data( elem, "fxshow", {} ); 10493 } 10494 10495 // store state if its toggle - enables .stop().toggle() to "reverse" 10496 if ( toggle ) { 10497 dataShow.hidden = !hidden; 10498 } 10499 if ( hidden ) { 10500 jQuery1113( elem ).show(); 10501 } else { 10502 anim.done(function() { 10503 jQuery1113( elem ).hide(); 10504 }); 10505 } 10506 anim.done(function() { 10507 var prop; 10508 jQuery1113._removeData( elem, "fxshow" ); 10509 for ( prop in orig ) { 10510 jQuery1113.style( elem, prop, orig[ prop ] ); 10511 } 10512 }); 10513 for ( prop in orig ) { 10514 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 10515 10516 if ( !( prop in dataShow ) ) { 10517 dataShow[ prop ] = tween.start; 10518 if ( hidden ) { 10519 tween.end = tween.start; 10520 tween.start = prop === "width" || prop === "height" ? 1 : 0; 10521 } 10522 } 10523 } 10524 10525 // If this is a noop like .hide().hide(), restore an overwritten display value 10526 } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) { 10527 style.display = display; 10528 } 10529} 10530 10531function propFilter( props, specialEasing ) { 10532 var index, name, easing, value, hooks; 10533 10534 // camelCase, specialEasing and expand cssHook pass 10535 for ( index in props ) { 10536 name = jQuery1113.camelCase( index ); 10537 easing = specialEasing[ name ]; 10538 value = props[ index ]; 10539 if ( jQuery1113.isArray( value ) ) { 10540 easing = value[ 1 ]; 10541 value = props[ index ] = value[ 0 ]; 10542 } 10543 10544 if ( index !== name ) { 10545 props[ name ] = value; 10546 delete props[ index ]; 10547 } 10548 10549 hooks = jQuery1113.cssHooks[ name ]; 10550 if ( hooks && "expand" in hooks ) { 10551 value = hooks.expand( value ); 10552 delete props[ name ]; 10553 10554 // not quite $.extend, this wont overwrite keys already present. 10555 // also - reusing 'index' from above because we have the correct "name" 10556 for ( index in value ) { 10557 if ( !( index in props ) ) { 10558 props[ index ] = value[ index ]; 10559 specialEasing[ index ] = easing; 10560 } 10561 } 10562 } else { 10563 specialEasing[ name ] = easing; 10564 } 10565 } 10566} 10567 10568function Animation( elem, properties, options ) { 10569 var result, 10570 stopped, 10571 index = 0, 10572 length = animationPrefilters.length, 10573 deferred = jQuery1113.Deferred().always( function() { 10574 // don't match elem in the :animated selector 10575 delete tick.elem; 10576 }), 10577 tick = function() { 10578 if ( stopped ) { 10579 return false; 10580 } 10581 var currentTime = fxNow || createFxNow(), 10582 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 10583 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) 10584 temp = remaining / animation.duration || 0, 10585 percent = 1 - temp, 10586 index = 0, 10587 length = animation.tweens.length; 10588 10589 for ( ; index < length ; index++ ) { 10590 animation.tweens[ index ].run( percent ); 10591 } 10592 10593 deferred.notifyWith( elem, [ animation, percent, remaining ]); 10594 10595 if ( percent < 1 && length ) { 10596 return remaining; 10597 } else { 10598 deferred.resolveWith( elem, [ animation ] ); 10599 return false; 10600 } 10601 }, 10602 animation = deferred.promise({ 10603 elem: elem, 10604 props: jQuery1113.extend( {}, properties ), 10605 opts: jQuery1113.extend( true, { specialEasing: {} }, options ), 10606 originalProperties: properties, 10607 originalOptions: options, 10608 startTime: fxNow || createFxNow(), 10609 duration: options.duration, 10610 tweens: [], 10611 createTween: function( prop, end ) { 10612 var tween = jQuery1113.Tween( elem, animation.opts, prop, end, 10613 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 10614 animation.tweens.push( tween ); 10615 return tween; 10616 }, 10617 stop: function( gotoEnd ) { 10618 var index = 0, 10619 // if we are going to the end, we want to run all the tweens 10620 // otherwise we skip this part 10621 length = gotoEnd ? animation.tweens.length : 0; 10622 if ( stopped ) { 10623 return this; 10624 } 10625 stopped = true; 10626 for ( ; index < length ; index++ ) { 10627 animation.tweens[ index ].run( 1 ); 10628 } 10629 10630 // resolve when we played the last frame 10631 // otherwise, reject 10632 if ( gotoEnd ) { 10633 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 10634 } else { 10635 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 10636 } 10637 return this; 10638 } 10639 }), 10640 props = animation.props; 10641 10642 propFilter( props, animation.opts.specialEasing ); 10643 10644 for ( ; index < length ; index++ ) { 10645 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); 10646 if ( result ) { 10647 return result; 10648 } 10649 } 10650 10651 jQuery1113.map( props, createTween, animation ); 10652 10653 if ( jQuery1113.isFunction( animation.opts.start ) ) { 10654 animation.opts.start.call( elem, animation ); 10655 } 10656 10657 jQuery1113.fx.timer( 10658 jQuery1113.extend( tick, { 10659 elem: elem, 10660 anim: animation, 10661 queue: animation.opts.queue 10662 }) 10663 ); 10664 10665 // attach callbacks from options 10666 return animation.progress( animation.opts.progress ) 10667 .done( animation.opts.done, animation.opts.complete ) 10668 .fail( animation.opts.fail ) 10669 .always( animation.opts.always ); 10670} 10671 10672jQuery1113.Animation = jQuery1113.extend( Animation, { 10673 tweener: function( props, callback ) { 10674 if ( jQuery1113.isFunction( props ) ) { 10675 callback = props; 10676 props = [ "*" ]; 10677 } else { 10678 props = props.split(" "); 10679 } 10680 10681 var prop, 10682 index = 0, 10683 length = props.length; 10684 10685 for ( ; index < length ; index++ ) { 10686 prop = props[ index ]; 10687 tweeners[ prop ] = tweeners[ prop ] || []; 10688 tweeners[ prop ].unshift( callback ); 10689 } 10690 }, 10691 10692 prefilter: function( callback, prepend ) { 10693 if ( prepend ) { 10694 animationPrefilters.unshift( callback ); 10695 } else { 10696 animationPrefilters.push( callback ); 10697 } 10698 } 10699}); 10700 10701jQuery1113.speed = function( speed, easing, fn ) { 10702 var opt = speed && typeof speed === "object" ? jQuery1113.extend( {}, speed ) : { 10703 complete: fn || !fn && easing || 10704 jQuery1113.isFunction( speed ) && speed, 10705 duration: speed, 10706 easing: fn && easing || easing && !jQuery1113.isFunction( easing ) && easing 10707 }; 10708 10709 opt.duration = jQuery1113.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : 10710 opt.duration in jQuery1113.fx.speeds ? jQuery1113.fx.speeds[ opt.duration ] : jQuery1113.fx.speeds._default; 10711 10712 // normalize opt.queue - true/undefined/null -> "fx" 10713 if ( opt.queue == null || opt.queue === true ) { 10714 opt.queue = "fx"; 10715 } 10716 10717 // Queueing 10718 opt.old = opt.complete; 10719 10720 opt.complete = function() { 10721 if ( jQuery1113.isFunction( opt.old ) ) { 10722 opt.old.call( this ); 10723 } 10724 10725 if ( opt.queue ) { 10726 jQuery1113.dequeue( this, opt.queue ); 10727 } 10728 }; 10729 10730 return opt; 10731}; 10732 10733jQuery1113.fn.extend({ 10734 fadeTo: function( speed, to, easing, callback ) { 10735 10736 // show any hidden elements after setting opacity to 0 10737 return this.filter( isHidden ).css( "opacity", 0 ).show() 10738 10739 // animate to the value specified 10740 .end().animate({ opacity: to }, speed, easing, callback ); 10741 }, 10742 animate: function( prop, speed, easing, callback ) { 10743 var empty = jQuery1113.isEmptyObject( prop ), 10744 optall = jQuery1113.speed( speed, easing, callback ), 10745 doAnimation = function() { 10746 // Operate on a copy of prop so per-property easing won't be lost 10747 var anim = Animation( this, jQuery1113.extend( {}, prop ), optall ); 10748 10749 // Empty animations, or finishing resolves immediately 10750 if ( empty || jQuery1113._data( this, "finish" ) ) { 10751 anim.stop( true ); 10752 } 10753 }; 10754 doAnimation.finish = doAnimation; 10755 10756 return empty || optall.queue === false ? 10757 this.each( doAnimation ) : 10758 this.queue( optall.queue, doAnimation ); 10759 }, 10760 stop: function( type, clearQueue, gotoEnd ) { 10761 var stopQueue = function( hooks ) { 10762 var stop = hooks.stop; 10763 delete hooks.stop; 10764 stop( gotoEnd ); 10765 }; 10766 10767 if ( typeof type !== "string" ) { 10768 gotoEnd = clearQueue; 10769 clearQueue = type; 10770 type = undefined; 10771 } 10772 if ( clearQueue && type !== false ) { 10773 this.queue( type || "fx", [] ); 10774 } 10775 10776 return this.each(function() { 10777 var dequeue = true, 10778 index = type != null && type + "queueHooks", 10779 timers = jQuery1113.timers, 10780 data = jQuery1113._data( this ); 10781 10782 if ( index ) { 10783 if ( data[ index ] && data[ index ].stop ) { 10784 stopQueue( data[ index ] ); 10785 } 10786 } else { 10787 for ( index in data ) { 10788 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 10789 stopQueue( data[ index ] ); 10790 } 10791 } 10792 } 10793 10794 for ( index = timers.length; index--; ) { 10795 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { 10796 timers[ index ].anim.stop( gotoEnd ); 10797 dequeue = false; 10798 timers.splice( index, 1 ); 10799 } 10800 } 10801 10802 // start the next in the queue if the last step wasn't forced 10803 // timers currently will call their complete callbacks, which will dequeue 10804 // but only if they were gotoEnd 10805 if ( dequeue || !gotoEnd ) { 10806 jQuery1113.dequeue( this, type ); 10807 } 10808 }); 10809 }, 10810 finish: function( type ) { 10811 if ( type !== false ) { 10812 type = type || "fx"; 10813 } 10814 return this.each(function() { 10815 var index, 10816 data = jQuery1113._data( this ), 10817 queue = data[ type + "queue" ], 10818 hooks = data[ type + "queueHooks" ], 10819 timers = jQuery1113.timers, 10820 length = queue ? queue.length : 0; 10821 10822 // enable finishing flag on private data 10823 data.finish = true; 10824 10825 // empty the queue first 10826 jQuery1113.queue( this, type, [] ); 10827 10828 if ( hooks && hooks.stop ) { 10829 hooks.stop.call( this, true ); 10830 } 10831 10832 // look for any active animations, and finish them 10833 for ( index = timers.length; index--; ) { 10834 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 10835 timers[ index ].anim.stop( true ); 10836 timers.splice( index, 1 ); 10837 } 10838 } 10839 10840 // look for any animations in the old queue and finish them 10841 for ( index = 0; index < length; index++ ) { 10842 if ( queue[ index ] && queue[ index ].finish ) { 10843 queue[ index ].finish.call( this ); 10844 } 10845 } 10846 10847 // turn off finishing flag 10848 delete data.finish; 10849 }); 10850 } 10851}); 10852 10853jQuery1113.each([ "toggle", "show", "hide" ], function( i, name ) { 10854 var cssFn = jQuery1113.fn[ name ]; 10855 jQuery1113.fn[ name ] = function( speed, easing, callback ) { 10856 return speed == null || typeof speed === "boolean" ? 10857 cssFn.apply( this, arguments ) : 10858 this.animate( genFx( name, true ), speed, easing, callback ); 10859 }; 10860}); 10861 10862// Generate shortcuts for custom animations 10863jQuery1113.each({ 10864 slideDown: genFx("show"), 10865 slideUp: genFx("hide"), 10866 slideToggle: genFx("toggle"), 10867 fadeIn: { opacity: "show" }, 10868 fadeOut: { opacity: "hide" }, 10869 fadeToggle: { opacity: "toggle" } 10870}, function( name, props ) { 10871 jQuery1113.fn[ name ] = function( speed, easing, callback ) { 10872 return this.animate( props, speed, easing, callback ); 10873 }; 10874}); 10875 10876jQuery1113.timers = []; 10877jQuery1113.fx.tick = function() { 10878 var timer, 10879 timers = jQuery1113.timers, 10880 i = 0; 10881 10882 fxNow = jQuery1113.now(); 10883 10884 for ( ; i < timers.length; i++ ) { 10885 timer = timers[ i ]; 10886 // Checks the timer has not already been removed 10887 if ( !timer() && timers[ i ] === timer ) { 10888 timers.splice( i--, 1 ); 10889 } 10890 } 10891 10892 if ( !timers.length ) { 10893 jQuery1113.fx.stop(); 10894 } 10895 fxNow = undefined; 10896}; 10897 10898jQuery1113.fx.timer = function( timer ) { 10899 jQuery1113.timers.push( timer ); 10900 if ( timer() ) { 10901 jQuery1113.fx.start(); 10902 } else { 10903 jQuery1113.timers.pop(); 10904 } 10905}; 10906 10907jQuery1113.fx.interval = 13; 10908 10909jQuery1113.fx.start = function() { 10910 if ( !timerId ) { 10911 timerId = setInterval( jQuery1113.fx.tick, jQuery1113.fx.interval ); 10912 } 10913}; 10914 10915jQuery1113.fx.stop = function() { 10916 clearInterval( timerId ); 10917 timerId = null; 10918}; 10919 10920jQuery1113.fx.speeds = { 10921 slow: 600, 10922 fast: 200, 10923 // Default speed 10924 _default: 400 10925}; 10926 10927 10928// Based off of the plugin by Clint Helfers, with permission. 10929// http://blindsignals.com/index.php/2009/07/jQuery1113-delay/ 10930jQuery1113.fn.delay = function( time, type ) { 10931 time = jQuery1113.fx ? jQuery1113.fx.speeds[ time ] || time : time; 10932 type = type || "fx"; 10933 10934 return this.queue( type, function( next, hooks ) { 10935 var timeout = setTimeout( next, time ); 10936 hooks.stop = function() { 10937 clearTimeout( timeout ); 10938 }; 10939 }); 10940}; 10941 10942 10943(function() { 10944 // Minified: var a,b,c,d,e 10945 var input, div, select, a, opt; 10946 10947 // Setup 10948 div = document.createElement( "div" ); 10949 div.setAttribute( "className", "t" ); 10950 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 10951 a = div.getElementsByTagName("a")[ 0 ]; 10952 10953 // First batch of tests. 10954 select = document.createElement("select"); 10955 opt = select.appendChild( document.createElement("option") ); 10956 input = div.getElementsByTagName("input")[ 0 ]; 10957 10958 a.style.cssText = "top:1px"; 10959 10960 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) 10961 support.getSetAttribute = div.className !== "t"; 10962 10963 // Get the style information from getAttribute 10964 // (IE uses .cssText instead) 10965 support.style = /top/.test( a.getAttribute("style") ); 10966 10967 // Make sure that URLs aren't manipulated 10968 // (IE normalizes it by default) 10969 support.hrefNormalized = a.getAttribute("href") === "/a"; 10970 10971 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) 10972 support.checkOn = !!input.value; 10973 10974 // Make sure that a selected-by-default option has a working selected property. 10975 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) 10976 support.optSelected = opt.selected; 10977 10978 // Tests for enctype support on a form (#6743) 10979 support.enctype = !!document.createElement("form").enctype; 10980 10981 // Make sure that the options inside disabled selects aren't marked as disabled 10982 // (WebKit marks them as disabled) 10983 select.disabled = true; 10984 support.optDisabled = !opt.disabled; 10985 10986 // Support: IE8 only 10987 // Check if we can trust getAttribute("value") 10988 input = document.createElement( "input" ); 10989 input.setAttribute( "value", "" ); 10990 support.input = input.getAttribute( "value" ) === ""; 10991 10992 // Check if an input maintains its value after becoming a radio 10993 input.value = "t"; 10994 input.setAttribute( "type", "radio" ); 10995 support.radioValue = input.value === "t"; 10996})(); 10997 10998 10999var rreturn = /\r/g; 11000 11001jQuery1113.fn.extend({ 11002 val: function( value ) { 11003 var hooks, ret, isFunction, 11004 elem = this[0]; 11005 11006 if ( !arguments.length ) { 11007 if ( elem ) { 11008 hooks = jQuery1113.valHooks[ elem.type ] || jQuery1113.valHooks[ elem.nodeName.toLowerCase() ]; 11009 11010 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { 11011 return ret; 11012 } 11013 11014 ret = elem.value; 11015 11016 return typeof ret === "string" ? 11017 // handle most common string cases 11018 ret.replace(rreturn, "") : 11019 // handle cases where value is null/undef or number 11020 ret == null ? "" : ret; 11021 } 11022 11023 return; 11024 } 11025 11026 isFunction = jQuery1113.isFunction( value ); 11027 11028 return this.each(function( i ) { 11029 var val; 11030 11031 if ( this.nodeType !== 1 ) { 11032 return; 11033 } 11034 11035 if ( isFunction ) { 11036 val = value.call( this, i, jQuery1113( this ).val() ); 11037 } else { 11038 val = value; 11039 } 11040 11041 // Treat null/undefined as ""; convert numbers to string 11042 if ( val == null ) { 11043 val = ""; 11044 } else if ( typeof val === "number" ) { 11045 val += ""; 11046 } else if ( jQuery1113.isArray( val ) ) { 11047 val = jQuery1113.map( val, function( value ) { 11048 return value == null ? "" : value + ""; 11049 }); 11050 } 11051 11052 hooks = jQuery1113.valHooks[ this.type ] || jQuery1113.valHooks[ this.nodeName.toLowerCase() ]; 11053 11054 // If set returns undefined, fall back to normal setting 11055 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { 11056 this.value = val; 11057 } 11058 }); 11059 } 11060}); 11061 11062jQuery1113.extend({ 11063 valHooks: { 11064 option: { 11065 get: function( elem ) { 11066 var val = jQuery1113.find.attr( elem, "value" ); 11067 return val != null ? 11068 val : 11069 // Support: IE10-11+ 11070 // option.text throws exceptions (#14686, #14858) 11071 jQuery1113.trim( jQuery1113.text( elem ) ); 11072 } 11073 }, 11074 select: { 11075 get: function( elem ) { 11076 var value, option, 11077 options = elem.options, 11078 index = elem.selectedIndex, 11079 one = elem.type === "select-one" || index < 0, 11080 values = one ? null : [], 11081 max = one ? index + 1 : options.length, 11082 i = index < 0 ? 11083 max : 11084 one ? index : 0; 11085 11086 // Loop through all the selected options 11087 for ( ; i < max; i++ ) { 11088 option = options[ i ]; 11089 11090 // oldIE doesn't update selected after form reset (#2551) 11091 if ( ( option.selected || i === index ) && 11092 // Don't return options that are disabled or in a disabled optgroup 11093 ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && 11094 ( !option.parentNode.disabled || !jQuery1113.nodeName( option.parentNode, "optgroup" ) ) ) { 11095 11096 // Get the specific value for the option 11097 value = jQuery1113( option ).val(); 11098 11099 // We don't need an array for one selects 11100 if ( one ) { 11101 return value; 11102 } 11103 11104 // Multi-Selects return an array 11105 values.push( value ); 11106 } 11107 } 11108 11109 return values; 11110 }, 11111 11112 set: function( elem, value ) { 11113 var optionSet, option, 11114 options = elem.options, 11115 values = jQuery1113.makeArray( value ), 11116 i = options.length; 11117 11118 while ( i-- ) { 11119 option = options[ i ]; 11120 11121 if ( jQuery1113.inArray( jQuery1113.valHooks.option.get( option ), values ) >= 0 ) { 11122 11123 // Support: IE6 11124 // When new option element is added to select box we need to 11125 // force reflow of newly added node in order to workaround delay 11126 // of initialization properties 11127 try { 11128 option.selected = optionSet = true; 11129 11130 } catch ( _ ) { 11131 11132 // Will be executed only in IE6 11133 option.scrollHeight; 11134 } 11135 11136 } else { 11137 option.selected = false; 11138 } 11139 } 11140 11141 // Force browsers to behave consistently when non-matching value is set 11142 if ( !optionSet ) { 11143 elem.selectedIndex = -1; 11144 } 11145 11146 return options; 11147 } 11148 } 11149 } 11150}); 11151 11152// Radios and checkboxes getter/setter 11153jQuery1113.each([ "radio", "checkbox" ], function() { 11154 jQuery1113.valHooks[ this ] = { 11155 set: function( elem, value ) { 11156 if ( jQuery1113.isArray( value ) ) { 11157 return ( elem.checked = jQuery1113.inArray( jQuery1113(elem).val(), value ) >= 0 ); 11158 } 11159 } 11160 }; 11161 if ( !support.checkOn ) { 11162 jQuery1113.valHooks[ this ].get = function( elem ) { 11163 // Support: Webkit 11164 // "" is returned instead of "on" if a value isn't specified 11165 return elem.getAttribute("value") === null ? "on" : elem.value; 11166 }; 11167 } 11168}); 11169 11170 11171 11172 11173var nodeHook, boolHook, 11174 attrHandle = jQuery1113.expr.attrHandle, 11175 ruseDefault = /^(?:checked|selected)$/i, 11176 getSetAttribute = support.getSetAttribute, 11177 getSetInput = support.input; 11178 11179jQuery1113.fn.extend({ 11180 attr: function( name, value ) { 11181 return access( this, jQuery1113.attr, name, value, arguments.length > 1 ); 11182 }, 11183 11184 removeAttr: function( name ) { 11185 return this.each(function() { 11186 jQuery1113.removeAttr( this, name ); 11187 }); 11188 } 11189}); 11190 11191jQuery1113.extend({ 11192 attr: function( elem, name, value ) { 11193 var hooks, ret, 11194 nType = elem.nodeType; 11195 11196 // don't get/set attributes on text, comment and attribute nodes 11197 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 11198 return; 11199 } 11200 11201 // Fallback to prop when attributes are not supported 11202 if ( typeof elem.getAttribute === strundefined ) { 11203 return jQuery1113.prop( elem, name, value ); 11204 } 11205 11206 // All attributes are lowercase 11207 // Grab necessary hook if one is defined 11208 if ( nType !== 1 || !jQuery1113.isXMLDoc( elem ) ) { 11209 name = name.toLowerCase(); 11210 hooks = jQuery1113.attrHooks[ name ] || 11211 ( jQuery1113.expr.match.bool.test( name ) ? boolHook : nodeHook ); 11212 } 11213 11214 if ( value !== undefined ) { 11215 11216 if ( value === null ) { 11217 jQuery1113.removeAttr( elem, name ); 11218 11219 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { 11220 return ret; 11221 11222 } else { 11223 elem.setAttribute( name, value + "" ); 11224 return value; 11225 } 11226 11227 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { 11228 return ret; 11229 11230 } else { 11231 ret = jQuery1113.find.attr( elem, name ); 11232 11233 // Non-existent attributes return null, we normalize to undefined 11234 return ret == null ? 11235 undefined : 11236 ret; 11237 } 11238 }, 11239 11240 removeAttr: function( elem, value ) { 11241 var name, propName, 11242 i = 0, 11243 attrNames = value && value.match( rnotwhite ); 11244 11245 if ( attrNames && elem.nodeType === 1 ) { 11246 while ( (name = attrNames[i++]) ) { 11247 propName = jQuery1113.propFix[ name ] || name; 11248 11249 // Boolean attributes get special treatment (#10870) 11250 if ( jQuery1113.expr.match.bool.test( name ) ) { 11251 // Set corresponding property to false 11252 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 11253 elem[ propName ] = false; 11254 // Support: IE<9 11255 // Also clear defaultChecked/defaultSelected (if appropriate) 11256 } else { 11257 elem[ jQuery1113.camelCase( "default-" + name ) ] = 11258 elem[ propName ] = false; 11259 } 11260 11261 // See #9699 for explanation of this approach (setting first, then removal) 11262 } else { 11263 jQuery1113.attr( elem, name, "" ); 11264 } 11265 11266 elem.removeAttribute( getSetAttribute ? name : propName ); 11267 } 11268 } 11269 }, 11270 11271 attrHooks: { 11272 type: { 11273 set: function( elem, value ) { 11274 if ( !support.radioValue && value === "radio" && jQuery1113.nodeName(elem, "input") ) { 11275 // Setting the type on a radio button after the value resets the value in IE6-9 11276 // Reset value to default in case type is set after value during creation 11277 var val = elem.value; 11278 elem.setAttribute( "type", value ); 11279 if ( val ) { 11280 elem.value = val; 11281 } 11282 return value; 11283 } 11284 } 11285 } 11286 } 11287}); 11288 11289// Hook for boolean attributes 11290boolHook = { 11291 set: function( elem, value, name ) { 11292 if ( value === false ) { 11293 // Remove boolean attributes when set to false 11294 jQuery1113.removeAttr( elem, name ); 11295 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 11296 // IE<8 needs the *property* name 11297 elem.setAttribute( !getSetAttribute && jQuery1113.propFix[ name ] || name, name ); 11298 11299 // Use defaultChecked and defaultSelected for oldIE 11300 } else { 11301 elem[ jQuery1113.camelCase( "default-" + name ) ] = elem[ name ] = true; 11302 } 11303 11304 return name; 11305 } 11306}; 11307 11308// Retrieve booleans specially 11309jQuery1113.each( jQuery1113.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 11310 11311 var getter = attrHandle[ name ] || jQuery1113.find.attr; 11312 11313 attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? 11314 function( elem, name, isXML ) { 11315 var ret, handle; 11316 if ( !isXML ) { 11317 // Avoid an infinite loop by temporarily removing this function from the getter 11318 handle = attrHandle[ name ]; 11319 attrHandle[ name ] = ret; 11320 ret = getter( elem, name, isXML ) != null ? 11321 name.toLowerCase() : 11322 null; 11323 attrHandle[ name ] = handle; 11324 } 11325 return ret; 11326 } : 11327 function( elem, name, isXML ) { 11328 if ( !isXML ) { 11329 return elem[ jQuery1113.camelCase( "default-" + name ) ] ? 11330 name.toLowerCase() : 11331 null; 11332 } 11333 }; 11334}); 11335 11336// fix oldIE attroperties 11337if ( !getSetInput || !getSetAttribute ) { 11338 jQuery1113.attrHooks.value = { 11339 set: function( elem, value, name ) { 11340 if ( jQuery1113.nodeName( elem, "input" ) ) { 11341 // Does not return so that setAttribute is also used 11342 elem.defaultValue = value; 11343 } else { 11344 // Use nodeHook if defined (#1954); otherwise setAttribute is fine 11345 return nodeHook && nodeHook.set( elem, value, name ); 11346 } 11347 } 11348 }; 11349} 11350 11351// IE6/7 do not support getting/setting some attributes with get/setAttribute 11352if ( !getSetAttribute ) { 11353 11354 // Use this for any attribute in IE6/7 11355 // This fixes almost every IE6/7 issue 11356 nodeHook = { 11357 set: function( elem, value, name ) { 11358 // Set the existing or create a new attribute node 11359 var ret = elem.getAttributeNode( name ); 11360 if ( !ret ) { 11361 elem.setAttributeNode( 11362 (ret = elem.ownerDocument.createAttribute( name )) 11363 ); 11364 } 11365 11366 ret.value = value += ""; 11367 11368 // Break association with cloned elements by also using setAttribute (#9646) 11369 if ( name === "value" || value === elem.getAttribute( name ) ) { 11370 return value; 11371 } 11372 } 11373 }; 11374 11375 // Some attributes are constructed with empty-string values when not defined 11376 attrHandle.id = attrHandle.name = attrHandle.coords = 11377 function( elem, name, isXML ) { 11378 var ret; 11379 if ( !isXML ) { 11380 return (ret = elem.getAttributeNode( name )) && ret.value !== "" ? 11381 ret.value : 11382 null; 11383 } 11384 }; 11385 11386 // Fixing value retrieval on a button requires this module 11387 jQuery1113.valHooks.button = { 11388 get: function( elem, name ) { 11389 var ret = elem.getAttributeNode( name ); 11390 if ( ret && ret.specified ) { 11391 return ret.value; 11392 } 11393 }, 11394 set: nodeHook.set 11395 }; 11396 11397 // Set contenteditable to false on removals(#10429) 11398 // Setting to empty string throws an error as an invalid value 11399 jQuery1113.attrHooks.contenteditable = { 11400 set: function( elem, value, name ) { 11401 nodeHook.set( elem, value === "" ? false : value, name ); 11402 } 11403 }; 11404 11405 // Set width and height to auto instead of 0 on empty string( Bug #8150 ) 11406 // This is for removals 11407 jQuery1113.each([ "width", "height" ], function( i, name ) { 11408 jQuery1113.attrHooks[ name ] = { 11409 set: function( elem, value ) { 11410 if ( value === "" ) { 11411 elem.setAttribute( name, "auto" ); 11412 return value; 11413 } 11414 } 11415 }; 11416 }); 11417} 11418 11419if ( !support.style ) { 11420 jQuery1113.attrHooks.style = { 11421 get: function( elem ) { 11422 // Return undefined in the case of empty string 11423 // Note: IE uppercases css property names, but if we were to .toLowerCase() 11424 // .cssText, that would destroy case senstitivity in URL's, like in "background" 11425 return elem.style.cssText || undefined; 11426 }, 11427 set: function( elem, value ) { 11428 return ( elem.style.cssText = value + "" ); 11429 } 11430 }; 11431} 11432 11433 11434 11435 11436var rfocusable = /^(?:input|select|textarea|button|object)$/i, 11437 rclickable = /^(?:a|area)$/i; 11438 11439jQuery1113.fn.extend({ 11440 prop: function( name, value ) { 11441 return access( this, jQuery1113.prop, name, value, arguments.length > 1 ); 11442 }, 11443 11444 removeProp: function( name ) { 11445 name = jQuery1113.propFix[ name ] || name; 11446 return this.each(function() { 11447 // try/catch handles cases where IE balks (such as removing a property on window) 11448 try { 11449 this[ name ] = undefined; 11450 delete this[ name ]; 11451 } catch( e ) {} 11452 }); 11453 } 11454}); 11455 11456jQuery1113.extend({ 11457 propFix: { 11458 "for": "htmlFor", 11459 "class": "className" 11460 }, 11461 11462 prop: function( elem, name, value ) { 11463 var ret, hooks, notxml, 11464 nType = elem.nodeType; 11465 11466 // don't get/set properties on text, comment and attribute nodes 11467 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 11468 return; 11469 } 11470 11471 notxml = nType !== 1 || !jQuery1113.isXMLDoc( elem ); 11472 11473 if ( notxml ) { 11474 // Fix name and attach hooks 11475 name = jQuery1113.propFix[ name ] || name; 11476 hooks = jQuery1113.propHooks[ name ]; 11477 } 11478 11479 if ( value !== undefined ) { 11480 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? 11481 ret : 11482 ( elem[ name ] = value ); 11483 11484 } else { 11485 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? 11486 ret : 11487 elem[ name ]; 11488 } 11489 }, 11490 11491 propHooks: { 11492 tabIndex: { 11493 get: function( elem ) { 11494 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set 11495 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 11496 // Use proper attribute retrieval(#12072) 11497 var tabindex = jQuery1113.find.attr( elem, "tabindex" ); 11498 11499 return tabindex ? 11500 parseInt( tabindex, 10 ) : 11501 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 11502 0 : 11503 -1; 11504 } 11505 } 11506 } 11507}); 11508 11509// Some attributes require a special call on IE 11510// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 11511if ( !support.hrefNormalized ) { 11512 // href/src property should get the full normalized URL (#10299/#12915) 11513 jQuery1113.each([ "href", "src" ], function( i, name ) { 11514 jQuery1113.propHooks[ name ] = { 11515 get: function( elem ) { 11516 return elem.getAttribute( name, 4 ); 11517 } 11518 }; 11519 }); 11520} 11521 11522// Support: Safari, IE9+ 11523// mis-reports the default selected property of an option 11524// Accessing the parent's selectedIndex property fixes it 11525if ( !support.optSelected ) { 11526 jQuery1113.propHooks.selected = { 11527 get: function( elem ) { 11528 var parent = elem.parentNode; 11529 11530 if ( parent ) { 11531 parent.selectedIndex; 11532 11533 // Make sure that it also works with optgroups, see #5701 11534 if ( parent.parentNode ) { 11535 parent.parentNode.selectedIndex; 11536 } 11537 } 11538 return null; 11539 } 11540 }; 11541} 11542 11543jQuery1113.each([ 11544 "tabIndex", 11545 "readOnly", 11546 "maxLength", 11547 "cellSpacing", 11548 "cellPadding", 11549 "rowSpan", 11550 "colSpan", 11551 "useMap", 11552 "frameBorder", 11553 "contentEditable" 11554], function() { 11555 jQuery1113.propFix[ this.toLowerCase() ] = this; 11556}); 11557 11558// IE6/7 call enctype encoding 11559if ( !support.enctype ) { 11560 jQuery1113.propFix.enctype = "encoding"; 11561} 11562 11563 11564 11565 11566var rclass = /[\t\r\n\f]/g; 11567 11568jQuery1113.fn.extend({ 11569 addClass: function( value ) { 11570 var classes, elem, cur, clazz, j, finalValue, 11571 i = 0, 11572 len = this.length, 11573 proceed = typeof value === "string" && value; 11574 11575 if ( jQuery1113.isFunction( value ) ) { 11576 return this.each(function( j ) { 11577 jQuery1113( this ).addClass( value.call( this, j, this.className ) ); 11578 }); 11579 } 11580 11581 if ( proceed ) { 11582 // The disjunction here is for better compressibility (see removeClass) 11583 classes = ( value || "" ).match( rnotwhite ) || []; 11584 11585 for ( ; i < len; i++ ) { 11586 elem = this[ i ]; 11587 cur = elem.nodeType === 1 && ( elem.className ? 11588 ( " " + elem.className + " " ).replace( rclass, " " ) : 11589 " " 11590 ); 11591 11592 if ( cur ) { 11593 j = 0; 11594 while ( (clazz = classes[j++]) ) { 11595 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 11596 cur += clazz + " "; 11597 } 11598 } 11599 11600 // only assign if different to avoid unneeded rendering. 11601 finalValue = jQuery1113.trim( cur ); 11602 if ( elem.className !== finalValue ) { 11603 elem.className = finalValue; 11604 } 11605 } 11606 } 11607 } 11608 11609 return this; 11610 }, 11611 11612 removeClass: function( value ) { 11613 var classes, elem, cur, clazz, j, finalValue, 11614 i = 0, 11615 len = this.length, 11616 proceed = arguments.length === 0 || typeof value === "string" && value; 11617 11618 if ( jQuery1113.isFunction( value ) ) { 11619 return this.each(function( j ) { 11620 jQuery1113( this ).removeClass( value.call( this, j, this.className ) ); 11621 }); 11622 } 11623 if ( proceed ) { 11624 classes = ( value || "" ).match( rnotwhite ) || []; 11625 11626 for ( ; i < len; i++ ) { 11627 elem = this[ i ]; 11628 // This expression is here for better compressibility (see addClass) 11629 cur = elem.nodeType === 1 && ( elem.className ? 11630 ( " " + elem.className + " " ).replace( rclass, " " ) : 11631 "" 11632 ); 11633 11634 if ( cur ) { 11635 j = 0; 11636 while ( (clazz = classes[j++]) ) { 11637 // Remove *all* instances 11638 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { 11639 cur = cur.replace( " " + clazz + " ", " " ); 11640 } 11641 } 11642 11643 // only assign if different to avoid unneeded rendering. 11644 finalValue = value ? jQuery1113.trim( cur ) : ""; 11645 if ( elem.className !== finalValue ) { 11646 elem.className = finalValue; 11647 } 11648 } 11649 } 11650 } 11651 11652 return this; 11653 }, 11654 11655 toggleClass: function( value, stateVal ) { 11656 var type = typeof value; 11657 11658 if ( typeof stateVal === "boolean" && type === "string" ) { 11659 return stateVal ? this.addClass( value ) : this.removeClass( value ); 11660 } 11661 11662 if ( jQuery1113.isFunction( value ) ) { 11663 return this.each(function( i ) { 11664 jQuery1113( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); 11665 }); 11666 } 11667 11668 return this.each(function() { 11669 if ( type === "string" ) { 11670 // toggle individual class names 11671 var className, 11672 i = 0, 11673 self = jQuery1113( this ), 11674 classNames = value.match( rnotwhite ) || []; 11675 11676 while ( (className = classNames[ i++ ]) ) { 11677 // check each className given, space separated list 11678 if ( self.hasClass( className ) ) { 11679 self.removeClass( className ); 11680 } else { 11681 self.addClass( className ); 11682 } 11683 } 11684 11685 // Toggle whole class name 11686 } else if ( type === strundefined || type === "boolean" ) { 11687 if ( this.className ) { 11688 // store className if set 11689 jQuery1113._data( this, "__className__", this.className ); 11690 } 11691 11692 // If the element has a class name or if we're passed "false", 11693 // then remove the whole classname (if there was one, the above saved it). 11694 // Otherwise bring back whatever was previously saved (if anything), 11695 // falling back to the empty string if nothing was stored. 11696 this.className = this.className || value === false ? "" : jQuery1113._data( this, "__className__" ) || ""; 11697 } 11698 }); 11699 }, 11700 11701 hasClass: function( selector ) { 11702 var className = " " + selector + " ", 11703 i = 0, 11704 l = this.length; 11705 for ( ; i < l; i++ ) { 11706 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { 11707 return true; 11708 } 11709 } 11710 11711 return false; 11712 } 11713}); 11714 11715 11716 11717 11718// Return jQuery1113 for attributes-only inclusion 11719 11720 11721jQuery1113.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + 11722 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 11723 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { 11724 11725 // Handle event binding 11726 jQuery1113.fn[ name ] = function( data, fn ) { 11727 return arguments.length > 0 ? 11728 this.on( name, null, data, fn ) : 11729 this.trigger( name ); 11730 }; 11731}); 11732 11733jQuery1113.fn.extend({ 11734 hover: function( fnOver, fnOut ) { 11735 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 11736 }, 11737 11738 bind: function( types, data, fn ) { 11739 return this.on( types, null, data, fn ); 11740 }, 11741 unbind: function( types, fn ) { 11742 return this.off( types, null, fn ); 11743 }, 11744 11745 delegate: function( selector, types, data, fn ) { 11746 return this.on( types, selector, data, fn ); 11747 }, 11748 undelegate: function( selector, types, fn ) { 11749 // ( namespace ) or ( selector, types [, fn] ) 11750 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); 11751 } 11752}); 11753 11754 11755var nonce = jQuery1113.now(); 11756 11757var rquery = (/\?/); 11758 11759 11760 11761var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; 11762 11763jQuery1113.parseJSON = function( data ) { 11764 // Attempt to parse using the native JSON parser first 11765 if ( window.JSON && window.JSON.parse ) { 11766 // Support: Android 2.3 11767 // Workaround failure to string-cast null input 11768 return window.JSON.parse( data + "" ); 11769 } 11770 11771 var requireNonComma, 11772 depth = null, 11773 str = jQuery1113.trim( data + "" ); 11774 11775 // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains 11776 // after removing valid tokens 11777 return str && !jQuery1113.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { 11778 11779 // Force termination if we see a misplaced comma 11780 if ( requireNonComma && comma ) { 11781 depth = 0; 11782 } 11783 11784 // Perform no more replacements after returning to outermost depth 11785 if ( depth === 0 ) { 11786 return token; 11787 } 11788 11789 // Commas must not follow "[", "{", or "," 11790 requireNonComma = open || comma; 11791 11792 // Determine new depth 11793 // array/object open ("[" or "{"): depth += true - false (increment) 11794 // array/object close ("]" or "}"): depth += false - true (decrement) 11795 // other cases ("," or primitive): depth += true - true (numeric cast) 11796 depth += !close - !open; 11797 11798 // Remove this token 11799 return ""; 11800 }) ) ? 11801 ( Function( "return " + str ) )() : 11802 jQuery1113.error( "Invalid JSON: " + data ); 11803}; 11804 11805 11806// Cross-browser xml parsing 11807jQuery1113.parseXML = function( data ) { 11808 var xml, tmp; 11809 if ( !data || typeof data !== "string" ) { 11810 return null; 11811 } 11812 try { 11813 if ( window.DOMParser ) { // Standard 11814 tmp = new DOMParser(); 11815 xml = tmp.parseFromString( data, "text/xml" ); 11816 } else { // IE 11817 xml = new ActiveXObject( "Microsoft.XMLDOM" ); 11818 xml.async = "false"; 11819 xml.loadXML( data ); 11820 } 11821 } catch( e ) { 11822 xml = undefined; 11823 } 11824 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { 11825 jQuery1113.error( "Invalid XML: " + data ); 11826 } 11827 return xml; 11828}; 11829 11830 11831var 11832 // Document location 11833 ajaxLocParts, 11834 ajaxLocation, 11835 11836 rhash = /#.*$/, 11837 rts = /([?&])_=[^&]*/, 11838 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL 11839 // #7653, #8125, #8152: local protocol detection 11840 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 11841 rnoContent = /^(?:GET|HEAD)$/, 11842 rprotocol = /^\/\//, 11843 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, 11844 11845 /* Prefilters 11846 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 11847 * 2) These are called: 11848 * - BEFORE asking for a transport 11849 * - AFTER param serialization (s.data is a string if s.processData is true) 11850 * 3) key is the dataType 11851 * 4) the catchall symbol "*" can be used 11852 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 11853 */ 11854 prefilters = {}, 11855 11856 /* Transports bindings 11857 * 1) key is the dataType 11858 * 2) the catchall symbol "*" can be used 11859 * 3) selection will start with transport dataType and THEN go to "*" if needed 11860 */ 11861 transports = {}, 11862 11863 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 11864 allTypes = "*/".concat("*"); 11865 11866// #8138, IE may throw an exception when accessing 11867// a field from window.location if document.domain has been set 11868try { 11869 ajaxLocation = location.href; 11870} catch( e ) { 11871 // Use the href attribute of an A element 11872 // since IE will modify it given document.location 11873 ajaxLocation = document.createElement( "a" ); 11874 ajaxLocation.href = ""; 11875 ajaxLocation = ajaxLocation.href; 11876} 11877 11878// Segment location into parts 11879ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; 11880 11881// Base "constructor" for jQuery1113.ajaxPrefilter and jQuery1113.ajaxTransport 11882function addToPrefiltersOrTransports( structure ) { 11883 11884 // dataTypeExpression is optional and defaults to "*" 11885 return function( dataTypeExpression, func ) { 11886 11887 if ( typeof dataTypeExpression !== "string" ) { 11888 func = dataTypeExpression; 11889 dataTypeExpression = "*"; 11890 } 11891 11892 var dataType, 11893 i = 0, 11894 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; 11895 11896 if ( jQuery1113.isFunction( func ) ) { 11897 // For each dataType in the dataTypeExpression 11898 while ( (dataType = dataTypes[i++]) ) { 11899 // Prepend if requested 11900 if ( dataType.charAt( 0 ) === "+" ) { 11901 dataType = dataType.slice( 1 ) || "*"; 11902 (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); 11903 11904 // Otherwise append 11905 } else { 11906 (structure[ dataType ] = structure[ dataType ] || []).push( func ); 11907 } 11908 } 11909 } 11910 }; 11911} 11912 11913// Base inspection function for prefilters and transports 11914function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 11915 11916 var inspected = {}, 11917 seekingTransport = ( structure === transports ); 11918 11919 function inspect( dataType ) { 11920 var selected; 11921 inspected[ dataType ] = true; 11922 jQuery1113.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 11923 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 11924 if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 11925 options.dataTypes.unshift( dataTypeOrTransport ); 11926 inspect( dataTypeOrTransport ); 11927 return false; 11928 } else if ( seekingTransport ) { 11929 return !( selected = dataTypeOrTransport ); 11930 } 11931 }); 11932 return selected; 11933 } 11934 11935 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 11936} 11937 11938// A special extend for ajax options 11939// that takes "flat" options (not to be deep extended) 11940// Fixes #9887 11941function ajaxExtend( target, src ) { 11942 var deep, key, 11943 flatOptions = jQuery1113.ajaxSettings.flatOptions || {}; 11944 11945 for ( key in src ) { 11946 if ( src[ key ] !== undefined ) { 11947 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; 11948 } 11949 } 11950 if ( deep ) { 11951 jQuery1113.extend( true, target, deep ); 11952 } 11953 11954 return target; 11955} 11956 11957/* Handles responses to an ajax request: 11958 * - finds the right dataType (mediates between content-type and expected dataType) 11959 * - returns the corresponding response 11960 */ 11961function ajaxHandleResponses( s, jqXHR, responses ) { 11962 var firstDataType, ct, finalDataType, type, 11963 contents = s.contents, 11964 dataTypes = s.dataTypes; 11965 11966 // Remove auto dataType and get content-type in the process 11967 while ( dataTypes[ 0 ] === "*" ) { 11968 dataTypes.shift(); 11969 if ( ct === undefined ) { 11970 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); 11971 } 11972 } 11973 11974 // Check if we're dealing with a known content-type 11975 if ( ct ) { 11976 for ( type in contents ) { 11977 if ( contents[ type ] && contents[ type ].test( ct ) ) { 11978 dataTypes.unshift( type ); 11979 break; 11980 } 11981 } 11982 } 11983 11984 // Check to see if we have a response for the expected dataType 11985 if ( dataTypes[ 0 ] in responses ) { 11986 finalDataType = dataTypes[ 0 ]; 11987 } else { 11988 // Try convertible dataTypes 11989 for ( type in responses ) { 11990 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { 11991 finalDataType = type; 11992 break; 11993 } 11994 if ( !firstDataType ) { 11995 firstDataType = type; 11996 } 11997 } 11998 // Or just use first one 11999 finalDataType = finalDataType || firstDataType; 12000 } 12001 12002 // If we found a dataType 12003 // We add the dataType to the list if needed 12004 // and return the corresponding response 12005 if ( finalDataType ) { 12006 if ( finalDataType !== dataTypes[ 0 ] ) { 12007 dataTypes.unshift( finalDataType ); 12008 } 12009 return responses[ finalDataType ]; 12010 } 12011} 12012 12013/* Chain conversions given the request and the original response 12014 * Also sets the responseXXX fields on the jqXHR instance 12015 */ 12016function ajaxConvert( s, response, jqXHR, isSuccess ) { 12017 var conv2, current, conv, tmp, prev, 12018 converters = {}, 12019 // Work with a copy of dataTypes in case we need to modify it for conversion 12020 dataTypes = s.dataTypes.slice(); 12021 12022 // Create converters map with lowercased keys 12023 if ( dataTypes[ 1 ] ) { 12024 for ( conv in s.converters ) { 12025 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 12026 } 12027 } 12028 12029 current = dataTypes.shift(); 12030 12031 // Convert to each sequential dataType 12032 while ( current ) { 12033 12034 if ( s.responseFields[ current ] ) { 12035 jqXHR[ s.responseFields[ current ] ] = response; 12036 } 12037 12038 // Apply the dataFilter if provided 12039 if ( !prev && isSuccess && s.dataFilter ) { 12040 response = s.dataFilter( response, s.dataType ); 12041 } 12042 12043 prev = current; 12044 current = dataTypes.shift(); 12045 12046 if ( current ) { 12047 12048 // There's only work to do if current dataType is non-auto 12049 if ( current === "*" ) { 12050 12051 current = prev; 12052 12053 // Convert response if prev dataType is non-auto and differs from current 12054 } else if ( prev !== "*" && prev !== current ) { 12055 12056 // Seek a direct converter 12057 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 12058 12059 // If none found, seek a pair 12060 if ( !conv ) { 12061 for ( conv2 in converters ) { 12062 12063 // If conv2 outputs current 12064 tmp = conv2.split( " " ); 12065 if ( tmp[ 1 ] === current ) { 12066 12067 // If prev can be converted to accepted input 12068 conv = converters[ prev + " " + tmp[ 0 ] ] || 12069 converters[ "* " + tmp[ 0 ] ]; 12070 if ( conv ) { 12071 // Condense equivalence converters 12072 if ( conv === true ) { 12073 conv = converters[ conv2 ]; 12074 12075 // Otherwise, insert the intermediate dataType 12076 } else if ( converters[ conv2 ] !== true ) { 12077 current = tmp[ 0 ]; 12078 dataTypes.unshift( tmp[ 1 ] ); 12079 } 12080 break; 12081 } 12082 } 12083 } 12084 } 12085 12086 // Apply converter (if not an equivalence) 12087 if ( conv !== true ) { 12088 12089 // Unless errors are allowed to bubble, catch and return them 12090 if ( conv && s[ "throws" ] ) { 12091 response = conv( response ); 12092 } else { 12093 try { 12094 response = conv( response ); 12095 } catch ( e ) { 12096 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; 12097 } 12098 } 12099 } 12100 } 12101 } 12102 } 12103 12104 return { state: "success", data: response }; 12105} 12106 12107jQuery1113.extend({ 12108 12109 // Counter for holding the number of active queries 12110 active: 0, 12111 12112 // Last-Modified header cache for next request 12113 lastModified: {}, 12114 etag: {}, 12115 12116 ajaxSettings: { 12117 url: ajaxLocation, 12118 type: "GET", 12119 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), 12120 global: true, 12121 processData: true, 12122 async: true, 12123 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 12124 /* 12125 timeout: 0, 12126 data: null, 12127 dataType: null, 12128 username: null, 12129 password: null, 12130 cache: null, 12131 throws: false, 12132 traditional: false, 12133 headers: {}, 12134 */ 12135 12136 accepts: { 12137 "*": allTypes, 12138 text: "text/plain", 12139 html: "text/html", 12140 xml: "application/xml, text/xml", 12141 json: "application/json, text/javascript" 12142 }, 12143 12144 contents: { 12145 xml: /xml/, 12146 html: /html/, 12147 json: /json/ 12148 }, 12149 12150 responseFields: { 12151 xml: "responseXML", 12152 text: "responseText", 12153 json: "responseJSON" 12154 }, 12155 12156 // Data converters 12157 // Keys separate source (or catchall "*") and destination types with a single space 12158 converters: { 12159 12160 // Convert anything to text 12161 "* text": String, 12162 12163 // Text to html (true = no transformation) 12164 "text html": true, 12165 12166 // Evaluate text as a json expression 12167 "text json": jQuery1113.parseJSON, 12168 12169 // Parse text as xml 12170 "text xml": jQuery1113.parseXML 12171 }, 12172 12173 // For options that shouldn't be deep extended: 12174 // you can add your own custom options here if 12175 // and when you create one that shouldn't be 12176 // deep extended (see ajaxExtend) 12177 flatOptions: { 12178 url: true,
vendor: 6,167 bytes, lines 12179-12381
12179 context: true 12180 } 12181 }, 12182 12183 // Creates a full fledged settings object into target 12184 // with both ajaxSettings and settings fields. 12185 // If target is omitted, writes into ajaxSettings. 12186 ajaxSetup: function( target, settings ) { 12187 return settings ? 12188 12189 // Building a settings object 12190 ajaxExtend( ajaxExtend( target, jQuery1113.ajaxSettings ), settings ) : 12191 12192 // Extending ajaxSettings 12193 ajaxExtend( jQuery1113.ajaxSettings, target ); 12194 }, 12195 12196 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 12197 ajaxTransport: addToPrefiltersOrTransports( transports ), 12198 12199 // Main method 12200 ajax: function( url, options ) { 12201 12202 // If url is an object, simulate pre-1.5 signature 12203 if ( typeof url === "object" ) { 12204 options = url; 12205 url = undefined; 12206 } 12207 12208 // Force options to be an object 12209 options = options || {}; 12210 12211 var // Cross-domain detection vars 12212 parts, 12213 // Loop variable 12214 i, 12215 // URL without anti-cache param 12216 cacheURL, 12217 // Response headers as string 12218 responseHeadersString, 12219 // timeout handle 12220 timeoutTimer, 12221 12222 // To know if global events are to be dispatched 12223 fireGlobals, 12224 12225 transport, 12226 // Response headers 12227 responseHeaders, 12228 // Create the final options object 12229 s = jQuery1113.ajaxSetup( {}, options ), 12230 // Callbacks context 12231 callbackContext = s.context || s, 12232 // Context for global events is callbackContext if it is a DOM node or jQuery1113 collection 12233 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jQuery1113 ) ? 12234 jQuery1113( callbackContext ) : 12235 jQuery1113.event, 12236 // Deferreds 12237 deferred = jQuery1113.Deferred(), 12238 completeDeferred = jQuery1113.Callbacks("once memory"), 12239 // Status-dependent callbacks 12240 statusCode = s.statusCode || {}, 12241 // Headers (they are sent all at once) 12242 requestHeaders = {}, 12243 requestHeadersNames = {}, 12244 // The jqXHR state 12245 state = 0, 12246 // Default abort message 12247 strAbort = "canceled", 12248 // Fake xhr 12249 jqXHR = { 12250 readyState: 0, 12251 12252 // Builds headers hashtable if needed 12253 getResponseHeader: function( key ) { 12254 var match; 12255 if ( state === 2 ) { 12256 if ( !responseHeaders ) { 12257 responseHeaders = {}; 12258 while ( (match = rheaders.exec( responseHeadersString )) ) { 12259 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; 12260 } 12261 } 12262 match = responseHeaders[ key.toLowerCase() ]; 12263 } 12264 return match == null ? null : match; 12265 }, 12266 12267 // Raw string 12268 getAllResponseHeaders: function() { 12269 return state === 2 ? responseHeadersString : null; 12270 }, 12271 12272 // Caches the header 12273 setRequestHeader: function( name, value ) { 12274 var lname = name.toLowerCase(); 12275 if ( !state ) { 12276 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 12277 requestHeaders[ name ] = value; 12278 } 12279 return this; 12280 }, 12281 12282 // Overrides response content-type header 12283 overrideMimeType: function( type ) { 12284 if ( !state ) { 12285 s.mimeType = type; 12286 } 12287 return this; 12288 }, 12289 12290 // Status-dependent callbacks 12291 statusCode: function( map ) { 12292 var code; 12293 if ( map ) { 12294 if ( state < 2 ) { 12295 for ( code in map ) { 12296 // Lazy-add the new callback in a way that preserves old ones 12297 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 12298 } 12299 } else { 12300 // Execute the appropriate callbacks 12301 jqXHR.always( map[ jqXHR.status ] ); 12302 } 12303 } 12304 return this; 12305 }, 12306 12307 // Cancel the request 12308 abort: function( statusText ) { 12309 var finalText = statusText || strAbort; 12310 if ( transport ) { 12311 transport.abort( finalText ); 12312 } 12313 done( 0, finalText ); 12314 return this; 12315 } 12316 }; 12317 12318 // Attach deferreds 12319 deferred.promise( jqXHR ).complete = completeDeferred.add; 12320 jqXHR.success = jqXHR.done; 12321 jqXHR.error = jqXHR.fail; 12322 12323 // Remove hash character (#7531: and string promotion) 12324 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) 12325 // Handle falsy url in the settings object (#10093: consistency with old signature) 12326 // We also use the url parameter if available 12327 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); 12328 12329 // Alias method option to type as per ticket #12004 12330 s.type = options.method || options.type || s.method || s.type; 12331 12332 // Extract dataTypes list 12333 s.dataTypes = jQuery1113.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; 12334 12335 // A cross-domain request is in order when we have a protocol:host:port mismatch 12336 if ( s.crossDomain == null ) { 12337 parts = rurl.exec( s.url.toLowerCase() ); 12338 s.crossDomain = !!( parts && 12339 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || 12340 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== 12341 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) 12342 ); 12343 } 12344 12345 // Convert data if not already a string 12346 if ( s.data && s.processData && typeof s.data !== "string" ) { 12347 s.data = jQuery1113.param( s.data, s.traditional ); 12348 } 12349 12350 // Apply prefilters 12351 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 12352 12353 // If request was aborted inside a prefilter, stop there 12354 if ( state === 2 ) { 12355 return jqXHR; 12356 } 12357 12358 // We can fire global events as of now if asked to 12359 // Don't fire events if jQuery1113.event is undefined in an AMD-usage scenario (#15118) 12360 fireGlobals = jQuery1113.event && s.global; 12361 12362 // Watch for a new set of requests 12363 if ( fireGlobals && jQuery1113.active++ === 0 ) { 12364 jQuery1113.event.trigger("ajaxStart"); 12365 } 12366 12367 // Uppercase the type 12368 s.type = s.type.toUpperCase(); 12369 12370 // Determine if request has content 12371 s.hasContent = !rnoContent.test( s.type ); 12372 12373 // Save the URL in case we're toying with the If-Modified-Since 12374 // and/or If-None-Match header later on 12375 cacheURL = s.url; 12376 12377 // More options handling for requests with no content 12378 if ( !s.hasContent ) { 12379 12380 // If data is available, append data to url 12381 if ( s.data ) {
vendor: 36,256 bytes, lines 12382-13645
12382 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); 12383 // #9682: remove data so that it's not used in an eventual retry 12384 delete s.data; 12385 } 12386 12387 // Add anti-cache in url if needed 12388 if ( s.cache === false ) { 12389 s.url = rts.test( cacheURL ) ? 12390 12391 // If there is already a '_' parameter, set its value 12392 cacheURL.replace( rts, "$1_=" + nonce++ ) : 12393 12394 // Otherwise add one to the end 12395 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; 12396 } 12397 } 12398 12399 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 12400 if ( s.ifModified ) { 12401 if ( jQuery1113.lastModified[ cacheURL ] ) { 12402 jqXHR.setRequestHeader( "If-Modified-Since", jQuery1113.lastModified[ cacheURL ] ); 12403 } 12404 if ( jQuery1113.etag[ cacheURL ] ) { 12405 jqXHR.setRequestHeader( "If-None-Match", jQuery1113.etag[ cacheURL ] ); 12406 } 12407 } 12408 12409 // Set the correct header, if data is being sent 12410 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 12411 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 12412 } 12413 12414 // Set the Accepts header for the server, depending on the dataType 12415 jqXHR.setRequestHeader( 12416 "Accept", 12417 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? 12418 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 12419 s.accepts[ "*" ] 12420 ); 12421 12422 // Check for headers option 12423 for ( i in s.headers ) { 12424 jqXHR.setRequestHeader( i, s.headers[ i ] ); 12425 } 12426 12427 // Allow custom headers/mimetypes and early abort 12428 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 12429 // Abort if not done already and return 12430 return jqXHR.abort(); 12431 } 12432 12433 // aborting is no longer a cancellation 12434 strAbort = "abort"; 12435 12436 // Install callbacks on deferreds 12437 for ( i in { success: 1, error: 1, complete: 1 } ) { 12438 jqXHR[ i ]( s[ i ] ); 12439 } 12440 12441 // Get transport 12442 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 12443 12444 // If no transport, we auto-abort 12445 if ( !transport ) { 12446 done( -1, "No Transport" ); 12447 } else { 12448 jqXHR.readyState = 1; 12449 12450 // Send global event 12451 if ( fireGlobals ) { 12452 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 12453 } 12454 // Timeout 12455 if ( s.async && s.timeout > 0 ) { 12456 timeoutTimer = setTimeout(function() { 12457 jqXHR.abort("timeout"); 12458 }, s.timeout ); 12459 } 12460 12461 try { 12462 state = 1; 12463 transport.send( requestHeaders, done ); 12464 } catch ( e ) { 12465 // Propagate exception as error if not done 12466 if ( state < 2 ) { 12467 done( -1, e ); 12468 // Simply rethrow otherwise 12469 } else { 12470 throw e; 12471 } 12472 } 12473 } 12474 12475 // Callback for when everything is done 12476 function done( status, nativeStatusText, responses, headers ) { 12477 var isSuccess, success, error, response, modified, 12478 statusText = nativeStatusText; 12479 12480 // Called once 12481 if ( state === 2 ) { 12482 return; 12483 } 12484 12485 // State is "done" now 12486 state = 2; 12487 12488 // Clear timeout if it exists 12489 if ( timeoutTimer ) { 12490 clearTimeout( timeoutTimer ); 12491 } 12492 12493 // Dereference transport for early garbage collection 12494 // (no matter how long the jqXHR object will be used) 12495 transport = undefined; 12496 12497 // Cache response headers 12498 responseHeadersString = headers || ""; 12499 12500 // Set readyState 12501 jqXHR.readyState = status > 0 ? 4 : 0; 12502 12503 // Determine if successful 12504 isSuccess = status >= 200 && status < 300 || status === 304; 12505 12506 // Get response data 12507 if ( responses ) { 12508 response = ajaxHandleResponses( s, jqXHR, responses ); 12509 } 12510 12511 // Convert no matter what (that way responseXXX fields are always set) 12512 response = ajaxConvert( s, response, jqXHR, isSuccess ); 12513 12514 // If successful, handle type chaining 12515 if ( isSuccess ) { 12516 12517 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 12518 if ( s.ifModified ) { 12519 modified = jqXHR.getResponseHeader("Last-Modified"); 12520 if ( modified ) { 12521 jQuery1113.lastModified[ cacheURL ] = modified; 12522 } 12523 modified = jqXHR.getResponseHeader("etag"); 12524 if ( modified ) { 12525 jQuery1113.etag[ cacheURL ] = modified; 12526 } 12527 } 12528 12529 // if no content 12530 if ( status === 204 || s.type === "HEAD" ) { 12531 statusText = "nocontent"; 12532 12533 // if not modified 12534 } else if ( status === 304 ) { 12535 statusText = "notmodified"; 12536 12537 // If we have data, let's convert it 12538 } else { 12539 statusText = response.state; 12540 success = response.data; 12541 error = response.error; 12542 isSuccess = !error; 12543 } 12544 } else { 12545 // We extract error from statusText 12546 // then normalize statusText and status for non-aborts 12547 error = statusText; 12548 if ( status || !statusText ) { 12549 statusText = "error"; 12550 if ( status < 0 ) { 12551 status = 0; 12552 } 12553 } 12554 } 12555 12556 // Set data for the fake xhr object 12557 jqXHR.status = status; 12558 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 12559 12560 // Success/Error 12561 if ( isSuccess ) { 12562 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 12563 } else { 12564 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 12565 } 12566 12567 // Status-dependent callbacks 12568 jqXHR.statusCode( statusCode ); 12569 statusCode = undefined; 12570 12571 if ( fireGlobals ) { 12572 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 12573 [ jqXHR, s, isSuccess ? success : error ] ); 12574 } 12575 12576 // Complete 12577 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 12578 12579 if ( fireGlobals ) { 12580 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 12581 // Handle the global AJAX counter 12582 if ( !( --jQuery1113.active ) ) { 12583 jQuery1113.event.trigger("ajaxStop"); 12584 } 12585 } 12586 } 12587 12588 return jqXHR; 12589 }, 12590 12591 getJSON: function( url, data, callback ) { 12592 return jQuery1113.get( url, data, callback, "json" ); 12593 }, 12594 12595 getScript: function( url, callback ) { 12596 return jQuery1113.get( url, undefined, callback, "script" ); 12597 } 12598}); 12599 12600jQuery1113.each( [ "get", "post" ], function( i, method ) { 12601 jQuery1113[ method ] = function( url, data, callback, type ) { 12602 // shift arguments if data argument was omitted 12603 if ( jQuery1113.isFunction( data ) ) { 12604 type = type || callback; 12605 callback = data; 12606 data = undefined; 12607 } 12608 12609 return jQuery1113.ajax({ 12610 url: url, 12611 type: method, 12612 dataType: type, 12613 data: data, 12614 success: callback 12615 }); 12616 }; 12617}); 12618 12619 12620jQuery1113._evalUrl = function( url ) { 12621 return jQuery1113.ajax({ 12622 url: url, 12623 type: "GET", 12624 dataType: "script", 12625 async: false, 12626 global: false, 12627 "throws": true 12628 }); 12629}; 12630 12631 12632jQuery1113.fn.extend({ 12633 wrapAll: function( html ) { 12634 if ( jQuery1113.isFunction( html ) ) { 12635 return this.each(function(i) { 12636 jQuery1113(this).wrapAll( html.call(this, i) ); 12637 }); 12638 } 12639 12640 if ( this[0] ) { 12641 // The elements to wrap the target around 12642 var wrap = jQuery1113( html, this[0].ownerDocument ).eq(0).clone(true); 12643 12644 if ( this[0].parentNode ) { 12645 wrap.insertBefore( this[0] ); 12646 } 12647 12648 wrap.map(function() { 12649 var elem = this; 12650 12651 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { 12652 elem = elem.firstChild; 12653 } 12654 12655 return elem; 12656 }).append( this ); 12657 } 12658 12659 return this; 12660 }, 12661 12662 wrapInner: function( html ) { 12663 if ( jQuery1113.isFunction( html ) ) { 12664 return this.each(function(i) { 12665 jQuery1113(this).wrapInner( html.call(this, i) ); 12666 }); 12667 } 12668 12669 return this.each(function() { 12670 var self = jQuery1113( this ), 12671 contents = self.contents(); 12672 12673 if ( contents.length ) { 12674 contents.wrapAll( html ); 12675 12676 } else { 12677 self.append( html ); 12678 } 12679 }); 12680 }, 12681 12682 wrap: function( html ) { 12683 var isFunction = jQuery1113.isFunction( html ); 12684 12685 return this.each(function(i) { 12686 jQuery1113( this ).wrapAll( isFunction ? html.call(this, i) : html ); 12687 }); 12688 }, 12689 12690 unwrap: function() { 12691 return this.parent().each(function() { 12692 if ( !jQuery1113.nodeName( this, "body" ) ) { 12693 jQuery1113( this ).replaceWith( this.childNodes ); 12694 } 12695 }).end(); 12696 } 12697}); 12698 12699 12700jQuery1113.expr.filters.hidden = function( elem ) { 12701 // Support: Opera <= 12.12 12702 // Opera reports offsetWidths and offsetHeights less than zero on some elements 12703 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || 12704 (!support.reliableHiddenOffsets() && 12705 ((elem.style && elem.style.display) || jQuery1113.css( elem, "display" )) === "none"); 12706}; 12707 12708jQuery1113.expr.filters.visible = function( elem ) { 12709 return !jQuery1113.expr.filters.hidden( elem ); 12710}; 12711 12712 12713 12714 12715var r20 = /%20/g, 12716 rbracket = /\[\]$/, 12717 rCRLF = /\r?\n/g, 12718 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 12719 rsubmittable = /^(?:input|select|textarea|keygen)/i; 12720 12721function buildParams( prefix, obj, traditional, add ) { 12722 var name; 12723 12724 if ( jQuery1113.isArray( obj ) ) { 12725 // Serialize array item. 12726 jQuery1113.each( obj, function( i, v ) { 12727 if ( traditional || rbracket.test( prefix ) ) { 12728 // Treat each array item as a scalar. 12729 add( prefix, v ); 12730 12731 } else { 12732 // Item is non-scalar (array or object), encode its numeric index. 12733 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); 12734 } 12735 }); 12736 12737 } else if ( !traditional && jQuery1113.type( obj ) === "object" ) { 12738 // Serialize object item. 12739 for ( name in obj ) { 12740 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 12741 } 12742 12743 } else { 12744 // Serialize scalar item. 12745 add( prefix, obj ); 12746 } 12747} 12748 12749// Serialize an array of form elements or a set of 12750// key/values into a query string 12751jQuery1113.param = function( a, traditional ) { 12752 var prefix, 12753 s = [], 12754 add = function( key, value ) { 12755 // If value is a function, invoke it and return its value 12756 value = jQuery1113.isFunction( value ) ? value() : ( value == null ? "" : value ); 12757 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 12758 }; 12759 12760 // Set traditional to true for jQuery1113 <= 1.3.2 behavior. 12761 if ( traditional === undefined ) { 12762 traditional = jQuery1113.ajaxSettings && jQuery1113.ajaxSettings.traditional; 12763 } 12764 12765 // If an array was passed in, assume that it is an array of form elements. 12766 if ( jQuery1113.isArray( a ) || ( a.jQuery1113 && !jQuery1113.isPlainObject( a ) ) ) { 12767 // Serialize the form elements 12768 jQuery1113.each( a, function() { 12769 add( this.name, this.value ); 12770 }); 12771 12772 } else { 12773 // If traditional, encode the "old" way (the way 1.3.2 or older 12774 // did it), otherwise encode params recursively. 12775 for ( prefix in a ) { 12776 buildParams( prefix, a[ prefix ], traditional, add ); 12777 } 12778 } 12779 12780 // Return the resulting serialization 12781 return s.join( "&" ).replace( r20, "+" ); 12782}; 12783 12784jQuery1113.fn.extend({ 12785 serialize: function() { 12786 return jQuery1113.param( this.serializeArray() ); 12787 }, 12788 serializeArray: function() { 12789 return this.map(function() { 12790 // Can add propHook for "elements" to filter or add form elements 12791 var elements = jQuery1113.prop( this, "elements" ); 12792 return elements ? jQuery1113.makeArray( elements ) : this; 12793 }) 12794 .filter(function() { 12795 var type = this.type; 12796 // Use .is(":disabled") so that fieldset[disabled] works 12797 return this.name && !jQuery1113( this ).is( ":disabled" ) && 12798 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 12799 ( this.checked || !rcheckableType.test( type ) ); 12800 }) 12801 .map(function( i, elem ) { 12802 var val = jQuery1113( this ).val(); 12803 12804 return val == null ? 12805 null : 12806 jQuery1113.isArray( val ) ? 12807 jQuery1113.map( val, function( val ) { 12808 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 12809 }) : 12810 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 12811 }).get(); 12812 } 12813}); 12814 12815 12816// Create the request object 12817// (This is still attached to ajaxSettings for backward compatibility) 12818jQuery1113.ajaxSettings.xhr = window.ActiveXObject !== undefined ? 12819 // Support: IE6+ 12820 function() { 12821 12822 // XHR cannot access local files, always use ActiveX for that case 12823 return !this.isLocal && 12824 12825 // Support: IE7-8 12826 // oldIE XHR does not support non-RFC2616 methods (#13240) 12827 // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx 12828 // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 12829 // Although this check for six methods instead of eight 12830 // since IE also does not support "trace" and "connect" 12831 /^(get|post|head|put|delete|options)$/i.test( this.type ) && 12832 12833 createStandardXHR() || createActiveXHR(); 12834 } : 12835 // For all other browsers, use the standard XMLHttpRequest object 12836 createStandardXHR; 12837 12838var xhrId = 0, 12839 xhrCallbacks = {}, 12840 xhrSupported = jQuery1113.ajaxSettings.xhr(); 12841 12842// Support: IE<10 12843// Open requests must be manually aborted on unload (#5280) 12844// See https://support.microsoft.com/kb/2856746 for more info 12845if ( window.attachEvent ) { 12846 window.attachEvent( "onunload", function() { 12847 for ( var key in xhrCallbacks ) { 12848 xhrCallbacks[ key ]( undefined, true ); 12849 } 12850 }); 12851} 12852 12853// Determine support properties 12854support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 12855xhrSupported = support.ajax = !!xhrSupported; 12856 12857// Create transport if the browser can provide an xhr 12858if ( xhrSupported ) { 12859 12860 jQuery1113.ajaxTransport(function( options ) { 12861 // Cross domain only allowed if supported through XMLHttpRequest 12862 if ( !options.crossDomain || support.cors ) { 12863 12864 var callback; 12865 12866 return { 12867 send: function( headers, complete ) { 12868 var i, 12869 xhr = options.xhr(), 12870 id = ++xhrId; 12871 12872 // Open the socket 12873 xhr.open( options.type, options.url, options.async, options.username, options.password ); 12874 12875 // Apply custom fields if provided 12876 if ( options.xhrFields ) { 12877 for ( i in options.xhrFields ) { 12878 xhr[ i ] = options.xhrFields[ i ]; 12879 } 12880 } 12881 12882 // Override mime type if needed 12883 if ( options.mimeType && xhr.overrideMimeType ) { 12884 xhr.overrideMimeType( options.mimeType ); 12885 } 12886 12887 // X-Requested-With header 12888 // For cross-domain requests, seeing as conditions for a preflight are 12889 // akin to a jigsaw puzzle, we simply never set it to be sure. 12890 // (it can always be set on a per-request basis or even using ajaxSetup) 12891 // For same-domain requests, won't change header if already provided. 12892 if ( !options.crossDomain && !headers["X-Requested-With"] ) { 12893 headers["X-Requested-With"] = "XMLHttpRequest"; 12894 } 12895 12896 // Set headers 12897 for ( i in headers ) { 12898 // Support: IE<9 12899 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting 12900 // request header to a null-value. 12901 // 12902 // To keep consistent with other XHR implementations, cast the value 12903 // to string and ignore `undefined`. 12904 if ( headers[ i ] !== undefined ) { 12905 xhr.setRequestHeader( i, headers[ i ] + "" ); 12906 } 12907 } 12908 12909 // Do send the request 12910 // This may raise an exception which is actually 12911 // handled in jQuery1113.ajax (so no try/catch here) 12912 xhr.send( ( options.hasContent && options.data ) || null ); 12913 12914 // Listener 12915 callback = function( _, isAbort ) { 12916 var status, statusText, responses; 12917 12918 // Was never called and is aborted or complete 12919 if ( callback && ( isAbort || xhr.readyState === 4 ) ) { 12920 // Clean up 12921 delete xhrCallbacks[ id ]; 12922 callback = undefined; 12923 xhr.onreadystatechange = jQuery1113.noop; 12924 12925 // Abort manually if needed 12926 if ( isAbort ) { 12927 if ( xhr.readyState !== 4 ) { 12928 xhr.abort(); 12929 } 12930 } else { 12931 responses = {}; 12932 status = xhr.status; 12933 12934 // Support: IE<10 12935 // Accessing binary-data responseText throws an exception 12936 // (#11426) 12937 if ( typeof xhr.responseText === "string" ) { 12938 responses.text = xhr.responseText; 12939 } 12940 12941 // Firefox throws an exception when accessing 12942 // statusText for faulty cross-domain requests 12943 try { 12944 statusText = xhr.statusText; 12945 } catch( e ) { 12946 // We normalize with Webkit giving an empty statusText 12947 statusText = ""; 12948 } 12949 12950 // Filter status for non standard behaviors 12951 12952 // If the request is local and we have data: assume a success 12953 // (success with no data won't get notified, that's the best we 12954 // can do given current implementations) 12955 if ( !status && options.isLocal && !options.crossDomain ) { 12956 status = responses.text ? 200 : 404; 12957 // IE - #1450: sometimes returns 1223 when it should be 204 12958 } else if ( status === 1223 ) { 12959 status = 204; 12960 } 12961 } 12962 } 12963 12964 // Call complete if needed 12965 if ( responses ) { 12966 complete( status, statusText, responses, xhr.getAllResponseHeaders() ); 12967 } 12968 }; 12969 12970 if ( !options.async ) { 12971 // if we're in sync mode we fire the callback 12972 callback(); 12973 } else if ( xhr.readyState === 4 ) { 12974 // (IE6 & IE7) if it's in cache and has been 12975 // retrieved directly we need to fire the callback 12976 setTimeout( callback ); 12977 } else { 12978 // Add to the list of active xhr callbacks 12979 xhr.onreadystatechange = xhrCallbacks[ id ] = callback; 12980 } 12981 }, 12982 12983 abort: function() { 12984 if ( callback ) { 12985 callback( undefined, true ); 12986 } 12987 } 12988 }; 12989 } 12990 }); 12991} 12992 12993// Functions to create xhrs 12994function createStandardXHR() { 12995 try { 12996 return new window.XMLHttpRequest(); 12997 } catch( e ) {} 12998} 12999 13000function createActiveXHR() { 13001 try { 13002 return new window.ActiveXObject( "Microsoft.XMLHTTP" ); 13003 } catch( e ) {} 13004} 13005 13006 13007 13008 13009// Install script dataType 13010jQuery1113.ajaxSetup({ 13011 accepts: { 13012 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 13013 }, 13014 contents: { 13015 script: /(?:java|ecma)script/ 13016 }, 13017 converters: { 13018 "text script": function( text ) { 13019 jQuery1113.globalEval( text ); 13020 return text; 13021 } 13022 } 13023}); 13024 13025// Handle cache's special case and global 13026jQuery1113.ajaxPrefilter( "script", function( s ) { 13027 if ( s.cache === undefined ) { 13028 s.cache = false; 13029 } 13030 if ( s.crossDomain ) { 13031 s.type = "GET"; 13032 s.global = false; 13033 } 13034}); 13035 13036// Bind script tag hack transport 13037jQuery1113.ajaxTransport( "script", function(s) { 13038 13039 // This transport only deals with cross domain requests 13040 if ( s.crossDomain ) { 13041 13042 var script, 13043 head = document.head || jQuery1113("head")[0] || document.documentElement; 13044 13045 return { 13046 13047 send: function( _, callback ) { 13048 13049 script = document.createElement("script"); 13050 13051 script.async = true; 13052 13053 if ( s.scriptCharset ) { 13054 script.charset = s.scriptCharset; 13055 } 13056 13057 script.src = s.url; 13058 13059 // Attach handlers for all browsers 13060 script.onload = script.onreadystatechange = function( _, isAbort ) { 13061 13062 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { 13063 13064 // Handle memory leak in IE 13065 script.onload = script.onreadystatechange = null; 13066 13067 // Remove the script 13068 if ( script.parentNode ) { 13069 script.parentNode.removeChild( script ); 13070 } 13071 13072 // Dereference the script 13073 script = null; 13074 13075 // Callback if not abort 13076 if ( !isAbort ) { 13077 callback( 200, "success" ); 13078 } 13079 } 13080 }; 13081 13082 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending 13083 // Use native DOM manipulation to avoid our domManip AJAX trickery 13084 head.insertBefore( script, head.firstChild ); 13085 }, 13086 13087 abort: function() { 13088 if ( script ) { 13089 script.onload( undefined, true ); 13090 } 13091 } 13092 }; 13093 } 13094}); 13095 13096 13097 13098 13099var oldCallbacks = [], 13100 rjsonp = /(=)\?(?=&|$)|\?\?/; 13101 13102// Default jsonp settings 13103jQuery1113.ajaxSetup({ 13104 jsonp: "callback", 13105 jsonpCallback: function() { 13106 var callback = oldCallbacks.pop() || ( jQuery1113.expando + "_" + ( nonce++ ) ); 13107 this[ callback ] = true; 13108 return callback; 13109 } 13110}); 13111 13112// Detect, normalize options and install callbacks for jsonp requests 13113jQuery1113.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 13114 13115 var callbackName, overwritten, responseContainer, 13116 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 13117 "url" : 13118 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" 13119 ); 13120 13121 // Handle iff the expected data type is "jsonp" or we have a parameter to set 13122 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 13123 13124 // Get callback name, remembering preexisting value associated with it 13125 callbackName = s.jsonpCallback = jQuery1113.isFunction( s.jsonpCallback ) ? 13126 s.jsonpCallback() : 13127 s.jsonpCallback; 13128 13129 // Insert callback into url or form data 13130 if ( jsonProp ) { 13131 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 13132 } else if ( s.jsonp !== false ) { 13133 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 13134 } 13135 13136 // Use data converter to retrieve json after script execution 13137 s.converters["script json"] = function() { 13138 if ( !responseContainer ) { 13139 jQuery1113.error( callbackName + " was not called" ); 13140 } 13141 return responseContainer[ 0 ]; 13142 }; 13143 13144 // force json dataType 13145 s.dataTypes[ 0 ] = "json"; 13146 13147 // Install callback 13148 overwritten = window[ callbackName ]; 13149 window[ callbackName ] = function() { 13150 responseContainer = arguments; 13151 }; 13152 13153 // Clean-up function (fires after converters) 13154 jqXHR.always(function() { 13155 // Restore preexisting value 13156 window[ callbackName ] = overwritten; 13157 13158 // Save back as free 13159 if ( s[ callbackName ] ) { 13160 // make sure that re-using the options doesn't screw things around 13161 s.jsonpCallback = originalSettings.jsonpCallback; 13162 13163 // save the callback name for future use 13164 oldCallbacks.push( callbackName ); 13165 } 13166 13167 // Call if it was a function and we have a response 13168 if ( responseContainer && jQuery1113.isFunction( overwritten ) ) { 13169 overwritten( responseContainer[ 0 ] ); 13170 } 13171 13172 responseContainer = overwritten = undefined; 13173 }); 13174 13175 // Delegate to script 13176 return "script"; 13177 } 13178}); 13179 13180 13181 13182 13183// data: string of html 13184// context (optional): If specified, the fragment will be created in this context, defaults to document 13185// keepScripts (optional): If true, will include scripts passed in the html string 13186jQuery1113.parseHTML = function( data, context, keepScripts ) { 13187 if ( !data || typeof data !== "string" ) { 13188 return null; 13189 } 13190 if ( typeof context === "boolean" ) { 13191 keepScripts = context; 13192 context = false; 13193 } 13194 context = context || document; 13195 13196 var parsed = rsingleTag.exec( data ), 13197 scripts = !keepScripts && []; 13198 13199 // Single tag 13200 if ( parsed ) { 13201 return [ context.createElement( parsed[1] ) ]; 13202 } 13203 13204 parsed = jQuery1113.buildFragment( [ data ], context, scripts ); 13205 13206 if ( scripts && scripts.length ) { 13207 jQuery1113( scripts ).remove(); 13208 } 13209 13210 return jQuery1113.merge( [], parsed.childNodes ); 13211}; 13212 13213 13214// Keep a copy of the old load method 13215var _load = jQuery1113.fn.load; 13216 13217/** 13218 * Load a url into a page 13219 */ 13220jQuery1113.fn.load = function( url, params, callback ) { 13221 if ( typeof url !== "string" && _load ) { 13222 return _load.apply( this, arguments ); 13223 } 13224 13225 var selector, response, type, 13226 self = this, 13227 off = url.indexOf(" "); 13228 13229 if ( off >= 0 ) { 13230 selector = jQuery1113.trim( url.slice( off, url.length ) ); 13231 url = url.slice( 0, off ); 13232 } 13233 13234 // If it's a function 13235 if ( jQuery1113.isFunction( params ) ) { 13236 13237 // We assume that it's the callback 13238 callback = params; 13239 params = undefined; 13240 13241 // Otherwise, build a param string 13242 } else if ( params && typeof params === "object" ) { 13243 type = "POST"; 13244 } 13245 13246 // If we have elements to modify, make the request 13247 if ( self.length > 0 ) { 13248 jQuery1113.ajax({ 13249 url: url, 13250 13251 // if "type" variable is undefined, then "GET" method will be used 13252 type: type, 13253 dataType: "html", 13254 data: params 13255 }).done(function( responseText ) { 13256 13257 // Save response for use in complete callback 13258 response = arguments; 13259 13260 self.html( selector ? 13261 13262 // If a selector was specified, locate the right elements in a dummy div 13263 // Exclude scripts to avoid IE 'Permission Denied' errors 13264 jQuery1113("<div>").append( jQuery1113.parseHTML( responseText ) ).find( selector ) : 13265 13266 // Otherwise use the full result 13267 responseText ); 13268 13269 }).complete( callback && function( jqXHR, status ) { 13270 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); 13271 }); 13272 } 13273 13274 return this; 13275}; 13276 13277 13278 13279 13280// Attach a bunch of functions for handling common AJAX events 13281jQuery1113.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { 13282 jQuery1113.fn[ type ] = function( fn ) { 13283 return this.on( type, fn ); 13284 }; 13285}); 13286 13287 13288 13289 13290jQuery1113.expr.filters.animated = function( elem ) { 13291 return jQuery1113.grep(jQuery1113.timers, function( fn ) { 13292 return elem === fn.elem; 13293 }).length; 13294}; 13295 13296 13297 13298 13299 13300var docElem = window.document.documentElement; 13301 13302/** 13303 * Gets a window from an element 13304 */ 13305function getWindow( elem ) { 13306 return jQuery1113.isWindow( elem ) ? 13307 elem : 13308 elem.nodeType === 9 ? 13309 elem.defaultView || elem.parentWindow : 13310 false; 13311} 13312 13313jQuery1113.offset = { 13314 setOffset: function( elem, options, i ) { 13315 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 13316 position = jQuery1113.css( elem, "position" ), 13317 curElem = jQuery1113( elem ), 13318 props = {}; 13319 13320 // set position first, in-case top/left are set even on static elem 13321 if ( position === "static" ) { 13322 elem.style.position = "relative"; 13323 } 13324 13325 curOffset = curElem.offset(); 13326 curCSSTop = jQuery1113.css( elem, "top" ); 13327 curCSSLeft = jQuery1113.css( elem, "left" ); 13328 calculatePosition = ( position === "absolute" || position === "fixed" ) && 13329 jQuery1113.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1; 13330 13331 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed 13332 if ( calculatePosition ) { 13333 curPosition = curElem.position(); 13334 curTop = curPosition.top; 13335 curLeft = curPosition.left; 13336 } else { 13337 curTop = parseFloat( curCSSTop ) || 0; 13338 curLeft = parseFloat( curCSSLeft ) || 0; 13339 } 13340 13341 if ( jQuery1113.isFunction( options ) ) { 13342 options = options.call( elem, i, curOffset ); 13343 } 13344 13345 if ( options.top != null ) { 13346 props.top = ( options.top - curOffset.top ) + curTop; 13347 } 13348 if ( options.left != null ) { 13349 props.left = ( options.left - curOffset.left ) + curLeft; 13350 } 13351 13352 if ( "using" in options ) { 13353 options.using.call( elem, props ); 13354 } else { 13355 curElem.css( props ); 13356 } 13357 } 13358}; 13359 13360jQuery1113.fn.extend({ 13361 offset: function( options ) { 13362 if ( arguments.length ) { 13363 return options === undefined ? 13364 this : 13365 this.each(function( i ) { 13366 jQuery1113.offset.setOffset( this, options, i ); 13367 }); 13368 } 13369 13370 var docElem, win, 13371 box = { top: 0, left: 0 }, 13372 elem = this[ 0 ], 13373 doc = elem && elem.ownerDocument; 13374 13375 if ( !doc ) { 13376 return; 13377 } 13378 13379 docElem = doc.documentElement; 13380 13381 // Make sure it's not a disconnected DOM node 13382 if ( !jQuery1113.contains( docElem, elem ) ) { 13383 return box; 13384 } 13385 13386 // If we don't have gBCR, just use 0,0 rather than error 13387 // BlackBerry 5, iOS 3 (original iPhone) 13388 if ( typeof elem.getBoundingClientRect !== strundefined ) { 13389 box = elem.getBoundingClientRect(); 13390 } 13391 win = getWindow( doc ); 13392 return { 13393 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), 13394 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) 13395 }; 13396 }, 13397 13398 position: function() { 13399 if ( !this[ 0 ] ) { 13400 return; 13401 } 13402 13403 var offsetParent, offset, 13404 parentOffset = { top: 0, left: 0 }, 13405 elem = this[ 0 ]; 13406 13407 // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent 13408 if ( jQuery1113.css( elem, "position" ) === "fixed" ) { 13409 // we assume that getBoundingClientRect is available when computed position is fixed 13410 offset = elem.getBoundingClientRect(); 13411 } else { 13412 // Get *real* offsetParent 13413 offsetParent = this.offsetParent(); 13414 13415 // Get correct offsets 13416 offset = this.offset(); 13417 if ( !jQuery1113.nodeName( offsetParent[ 0 ], "html" ) ) { 13418 parentOffset = offsetParent.offset(); 13419 } 13420 13421 // Add offsetParent borders 13422 parentOffset.top += jQuery1113.css( offsetParent[ 0 ], "borderTopWidth", true ); 13423 parentOffset.left += jQuery1113.css( offsetParent[ 0 ], "borderLeftWidth", true ); 13424 } 13425 13426 // Subtract parent offsets and element margins 13427 // note: when an element has margin: auto the offsetLeft and marginLeft 13428 // are the same in Safari causing offset.left to incorrectly be 0 13429 return { 13430 top: offset.top - parentOffset.top - jQuery1113.css( elem, "marginTop", true ), 13431 left: offset.left - parentOffset.left - jQuery1113.css( elem, "marginLeft", true) 13432 }; 13433 }, 13434 13435 offsetParent: function() { 13436 return this.map(function() { 13437 var offsetParent = this.offsetParent || docElem; 13438 13439 while ( offsetParent && ( !jQuery1113.nodeName( offsetParent, "html" ) && jQuery1113.css( offsetParent, "position" ) === "static" ) ) { 13440 offsetParent = offsetParent.offsetParent; 13441 } 13442 return offsetParent || docElem; 13443 }); 13444 } 13445}); 13446 13447// Create scrollLeft and scrollTop methods 13448jQuery1113.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 13449 var top = /Y/.test( prop ); 13450 13451 jQuery1113.fn[ method ] = function( val ) { 13452 return access( this, function( elem, method, val ) { 13453 var win = getWindow( elem ); 13454 13455 if ( val === undefined ) { 13456 return win ? (prop in win) ? win[ prop ] : 13457 win.document.documentElement[ method ] : 13458 elem[ method ]; 13459 } 13460 13461 if ( win ) { 13462 win.scrollTo( 13463 !top ? val : jQuery1113( win ).scrollLeft(), 13464 top ? val : jQuery1113( win ).scrollTop() 13465 ); 13466 13467 } else { 13468 elem[ method ] = val; 13469 } 13470 }, method, val, arguments.length, null ); 13471 }; 13472}); 13473 13474// Add the top/left cssHooks using jQuery1113.fn.position 13475// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 13476// getComputedStyle returns percent when specified for top/left/bottom/right 13477// rather than make the css module depend on the offset module, we just check for it here 13478jQuery1113.each( [ "top", "left" ], function( i, prop ) { 13479 jQuery1113.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 13480 function( elem, computed ) { 13481 if ( computed ) { 13482 computed = curCSS( elem, prop ); 13483 // if curCSS returns percentage, fallback to offset 13484 return rnumnonpx.test( computed ) ? 13485 jQuery1113( elem ).position()[ prop ] + "px" : 13486 computed; 13487 } 13488 } 13489 ); 13490}); 13491 13492 13493// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 13494jQuery1113.each( { Height: "height", Width: "width" }, function( name, type ) { 13495 jQuery1113.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { 13496 // margin is only for outerHeight, outerWidth 13497 jQuery1113.fn[ funcName ] = function( margin, value ) { 13498 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 13499 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 13500 13501 return access( this, function( elem, type, value ) { 13502 var doc; 13503 13504 if ( jQuery1113.isWindow( elem ) ) { 13505 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 13506 // isn't a whole lot we can do. See pull request at this URL for discussion: 13507 // https://github.com/jQuery1113/jQuery1113/pull/764 13508 return elem.document.documentElement[ "client" + name ]; 13509 } 13510 13511 // Get document width or height 13512 if ( elem.nodeType === 9 ) { 13513 doc = elem.documentElement; 13514 13515 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest 13516 // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. 13517 return Math.max( 13518 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 13519 elem.body[ "offset" + name ], doc[ "offset" + name ], 13520 doc[ "client" + name ] 13521 ); 13522 } 13523 13524 return value === undefined ? 13525 // Get width or height on the element, requesting but not forcing parseFloat 13526 jQuery1113.css( elem, type, extra ) : 13527 13528 // Set width or height on the element 13529 jQuery1113.style( elem, type, value, extra ); 13530 }, type, chainable ? margin : undefined, chainable, null ); 13531 }; 13532 }); 13533}); 13534 13535 13536// The number of elements contained in the matched element set 13537jQuery1113.fn.size = function() { 13538 return this.length; 13539}; 13540 13541jQuery1113.fn.andSelf = jQuery1113.fn.addBack; 13542 13543 13544 13545 13546// Register as a named AMD module, since jQuery1113 can be concatenated with other 13547// files that may use define, but not via a proper concatenation script that 13548// understands anonymous AMD modules. A named AMD is safest and most robust 13549// way to register. Lowercase jQuery1113 is used because AMD module names are 13550// derived from file names, and jQuery1113 is normally delivered in a lowercase 13551// file name. Do this after creating the global so that if an AMD module wants 13552// to call noConflict to hide this version of jQuery1113, it will work. 13553 13554// Note that for maximum portability, libraries that are not jQuery1113 should 13555// declare themselves as anonymous modules, and avoid setting a global if an 13556// AMD loader is present. jQuery1113 is a special case. For more information, see 13557// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 13558 13559if ( typeof define === "function" && define.amd ) { 13560 define( "jQuery1113", [], function() { 13561 return jQuery1113; 13562 }); 13563} 13564 13565 13566 13567 13568var 13569 // Map over jQuery1113 in case of overwrite 13570 _jQuery1113 = window.jQuery1113, 13571 13572 // Map over the $ in case of overwrite 13573 _$ = window.$; 13574 13575jQuery1113.noConflict = function( deep ) { 13576 if ( window.$ === jQuery1113 ) { 13577 window.$ = _$; 13578 } 13579 13580 if ( deep && window.jQuery1113 === jQuery1113 ) { 13581 window.jQuery1113 = _jQuery1113; 13582 } 13583 13584 return jQuery1113; 13585}; 13586 13587// Expose jQuery1113 and $ identifiers, even in 13588// AMD (#7102#comment:10, https://github.com/jQuery1113/jQuery1113/pull/557) 13589// and CommonJS for browser emulators (#13566) 13590if ( typeof noGlobal === strundefined ) { 13591 window.jQuery1113 = window.$ = jQuery1113; 13592} 13593 13594 13595 13596 13597return jQuery1113; 13598 13599})); 13600 13601 13602var j = jQuery1113.noConflict();! function(e) { 13603 var i = { 13604 logo_align: "left", 13605 links_align: "left", 13606 socialBar_align: "left", 13607 searchBar_align: "right", 13608 trigger: "hover", 13609 effect: "fade", 13610 effect_speed: 400, 13611 sibling: !0, 13612 outside_click_close: !0, 13613 top_fixed: !1, 13614 sticky_header: !1, 13615 sticky_header_height: 200, 13616 menu_position: "horizontal", 13617 full_width: !0, 13618 mobile_settings: { 13619 collapse: !1, 13620 sibling: !0, 13621 scrollBar: !0, 13622 scrollBar_height: 400, 13623 top_fixed: !1, 13624 sticky_header: !1, 13625 sticky_header_height: 200 13626 } 13627 }; 13628 e.fn.megaMenu = function(o) { 13629 return o = e.extend({}, i, o || {}), this.each(function() { 13630 var i, s = e(this), 13631 t = "ul", 13632 n = "li", 13633 a = "a", 13634 r = s.find(".menu-logo"), 13635 l = r.children(n), 13636 d = s.find(".menu-links"), 13637 c = d.children(n), 13638 f = s.find(".menu-social-bar"), 13639 _ = s.find(".menu-search-bar"), 13640 p = ".menu-mobile-collapse-trigger", 13641 g = ".mobileTriggerButton", 13642 u = ".desktopTriggerButton", 13643 h = "active", 13644 m = "activeTrigger", 13645 b = "activeTriggerMobile",
13646 v = ".mg-drop-down-multilevel, .mg-drop-down, .mg-drop-down-tab-bar", 13647 C = "desktopTopFixed", 13648 w = "mobileTopFixed", 13649 k = "menuFullWidth", 13650 y = s.find(".menu-contact-form"), 13651 x = y.find(".nav_form_notification"); 13652 i = { 13653 contact_form_ajax: function() { 13654 e(y).submit(function(i) { 13655 var o = e(this); 13656 i.preventDefault(); 13657 var s = e(this).serialize(); 13658 o.find("button i.fa").css("display", "inline-block"), e.ajax({ 13659 type: "POST", 13660 url: e(this).attr("action"), 13661 data: s 13662 }).done(function(e) { 13663 x.text(e), o.find('input[type="text"]').val(""), o.find('input[type="email"]').val(""), o.find("textarea").val(""), o.find("button i.fa").css("display", "none") 13664 }).fail(function(e) { 13665 "" !== e.responseText && x.text("Error"), o.find("button i.fa").css("display", "none") 13666 }) 13667 }) 13668 }, 13669 menu_full_width: function() { 13670 o.full_width === !0 && s.addClass(k) 13671 }, 13672 logo_Align: function() { 13673 "right" === o.logo_align ? r.addClass("menu-logo-align-right") : r.removeClass("menu-logo-align-right") 13674 }, 13675 links_Align: function() { 13676 "right" === o.links_align ? d.addClass("menu-links-align-right") : d.removeClass("menu-links-align-right") 13677 }, 13678 social_bar_Align: function() { 13679 "right" === o.socialBar_align ? f.addClass("menu-social-bar-right") : f.removeClass("menu-social-bar-right") 13680 }, 13681 search_bar_Align: function() { 13682 "left" === o.searchBar_align ? _.addClass("menu-search-bar-left") : _.removeClass("menu-search-bar-left") 13683 }, 13684 collapse_trigger_button: function() { 13685 if (o.mobile_settings.collapse === !0) { 13686 l.append('<div class="menu-mobile-collapse-trigger"><span></span></div>'); 13687 var i = d.add(f); 13688 i.hide(0), _.addClass(h), s.find(p).on("click", function() { 13689 return i.is(":hidden") ? (e(this).addClass(h), i.show(0)) : (e(this).removeClass(h), i.hide(0)), !1 13690 }) 13691 } 13692 }, 13693 switch_effect_remove: function() { 13694 s.find(v).removeClass("effect-fade effect-scale effect-expand-top effect-expand-bottom effect-expand-left effect-expand-right") 13695 }, 13696 switch_effects: function() { 13697 switch (o.effect) { 13698 case "fade": 13699 this.switch_effect_remove(), s.find(v).addClass("effect-fade"); 13700 break; 13701 case "scale": 13702 this.switch_effect_remove(), s.find(v).addClass("effect-scale"); 13703 break; 13704 case "expand-top": 13705 this.switch_effect_remove(), s.find(v).addClass("effect-expand-top"); 13706 break; 13707 case "expand-bottom": 13708 this.switch_effect_remove(), s.find(v).addClass("effect-expand-bottom"); 13709 break; 13710 case "expand-left": 13711 this.switch_effect_remove(), s.find(v).addClass("effect-expand-left"); 13712 break; 13713 case "expand-right": 13714 this.switch_effect_remove(), s.find(v).addClass("effect-expand-right") 13715 } 13716 }, 13717 transition_delay: function() { 13718 s.find(v).css({ 13719 webkitTransition: "all " + o.effect_speed + "ms ease ", 13720 transition: "all " + o.effect_speed + "ms ease " 13721 }) 13722 }, 13723 hover_trigger: function() { 13724 "hover" === o.trigger && (i.transition_delay(), s.find(v).parents(n).addClass("hoverTrigger"), i.switch_effects()) 13725 }, 13726 mobile_trigger: function() { 13727 0 === s.find(".mobileTriggerButton").length && s.find(v).prev(a).append('<div class="mobileTriggerButton"></div>'), 13728 s.find(g).each(function(){ 13729 $this=$(this); 13730 $menuBox = $(this).parents('li').find('.megamenu_box'); 13731 //æª¢æ¥ææ²æå¯æ¸ å®çå §å®¹ 13732 var menuBoxChildCount = 0; 13733 $menuBox.children().each(function(){ 13734 if($(this).attr('class').toLowerCase() !== 'clearfix'){ 13735 menuBoxChildCount = menuBoxChildCount + 1; 13736 return; 13737 } 13738 }); 13739 if (menuBoxChildCount === 0) 13740 $this.parent().siblings('.mg-drop-down').removeClass('effect-fade'); 13741 $this.off("click").on("click", function() { 13742 var i = e(this), 13743 r = i.parents(a), 13744 l = r.next(v); 13745 //坿¸ 宿²ææ±è¥¿æï¼é»éådivä¹è§¸ç¼ç¶node a 13746 menuBoxChildCount === 0 ? r[0].click():""; 13747 return l.is(":hidden") ? (o.mobile_settings.sibling === !0 && (i.parents(s).siblings(t + "," + n).find(v).hide(0), i.parents(s).siblings(n).removeClass(b), i.parents(s).siblings(t).find(n).removeClass(b)), r.parent(n).addClass(b), l.show(0)) : (r.parent(n).removeClass(b), l.hide(0)), !1 13748 }); 13749 }), s.find("i.fa.fa-indicator").on("click", function() { 13750 return !1 13751 }),s.find(v).prev(a).on("click", function(el) { 13752 var i = e(this), 13753 l = i.next(v); 13754 var iUrl = i.attr('href').trim().toLowerCase(); 13755 if (iUrl.startsWith('#') || iUrl.startsWith('javascript')) 13756 return l.is(":hidden") ? (o.mobile_settings.sibling === !0 && (i.parents(s).siblings(t + "," + n).find(v).hide(0), i.parents(s).siblings(n).removeClass(b), i.parents(s).siblings(t).find(n).removeClass(b)), i.parent(n).addClass(b), l.show(0)) : (i.parent(n).removeClass(b), l.hide(0)), !1 13757 }) 13758 }, 13759 click_trigger: function() { 13760 "click" === o.trigger && (s.find(v).prev(a).append('<div class="desktopTriggerButton"></div>'), s.find(v).parents(n).addClass("ClickTrigger"), i.switch_effects(), i.transition_delay(), s.find(u).off("click").on("click", function(i) { 13761 i.stopPropagation(), i.stopImmediatePropagation(); 13762 var r = e(this), 13763 l = r.parents(a), 13764 d = l.next(v); 13765 d.hasClass(h) ? (l.parent(n).removeClass(m), d.removeClass(h)) : (o.sibling === !0 && (r.parents(s).siblings(t + "," + n).find(v).removeClass(h), r.parents(s).siblings(n).removeClass(m), r.parents(s).siblings(t).find(n).removeClass(m)), l.parent(n).addClass(m), d.addClass(h)) 13766 })) 13767 }, 13768 outside_close: function() { 13769 o.outside_click_close === !0 && "click" === o.trigger && s.find(v).is(":visible") ? e(document).off("
13769click").on("click", function(e) { 13770 s.is(e.target) || 0 !== s.has(e.target).length || (s.find(v).removeClass(h), c.removeClass("activeTrigger")) 13771 }) : e(document).off("click") 13772 }, 13773 scroll_bar: function() { 13774 o.mobile_settings.scrollBar === !0 && d.css({ 13775 maxHeight: o.mobile_settings.scrollBar_height + "px", 13776 overflow: "auto" 13777 }) 13778 }, 13779 top_Fixed: function() { 13780 o.top_fixed === !0 ? s.addClass(C) : s.removeClass(C), o.mobile_settings.top_fixed ? s.addClass(w) : s.removeClass(w) 13781 }, 13782 sticky_Header: function() { 13783 var i = e(window), 13784 t = !0, 13785 n = !0; 13786 s.find(v).is(":hidden") ? (i.off("scroll"), o.mobile_settings.sticky_header === !0 && o.top_fixed === !1 && i.on("scroll", function() { 13787 i.scrollTop() > o.mobile_settings.sticky_header_height ? n === !0 && (s.addClass(w), n = !1) : n === !1 && (s.removeClass(w), n = !0) 13788 })) : (i.off("scroll"), o.sticky_header === !0 && "horizontal" === o.menu_position && o.top_fixed === !1 && i.on("scroll", function() { 13789 i.scrollTop() > o.sticky_header_height ? t === !0 && (s.fadeOut(200, function() { 13790 e(this).addClass(C).fadeIn(200) 13791 }), t = !1) : t === !1 && (s.fadeOut(200, function() { 13792 e(this).removeClass(C).fadeIn(200) 13793 }), t = !0) 13794 })) 13795 }, 13796 position: function() { 13797 "vertical-left" === o.menu_position ? s.addClass("vertical-left") : s.removeClass("vertical-left"), "vertical-right" === o.menu_position ? s.addClass("vertical-right") : s.removeClass("vertical-right") 13798 }, 13799 destroy_menu: function() { 13800 s.find(v).parents(n).removeClass("hoverTrigger"), s.find(v).parents(n).removeClass("ClickTrigger") 13801 } 13802 }, i.destroy_menu(), i.menu_full_width(), i.logo_Align(), i.links_Align(), i.social_bar_Align(), i.search_bar_Align(), i.collapse_trigger_button(), i.hover_trigger(), i.mobile_trigger(), i.click_trigger(), i.outside_close(), i.scroll_bar(), i.top_Fixed(), i.sticky_Header(), i.position(), i.contact_form_ajax(), e(window).resize(function() { 13803 i.outside_close(), i.sticky_Header() 13804 }) 13805 }) 13806 } 13807}(jQuery1113);(function($) { 13808 $(function() { 13809 13810 var $sel = $('[data-unicode="mdu_pNa85ktWg0qrVtwJHB0Ow"]'); 13811 13812 $sel.find('.menu-links > li.main-hover').hover(function () { 13813 if($(this).data('main-hover')) 13814 $(this).css('background', $(this).data('main-hover')); 13815 }, function () { 13816 if($(this).data('main-recovery')) 13817 $(this).css('background', $(this).data('main-recovery')); 13818 else 13819 $(this).css('background', ''); 13820 }) 13821 13822 $sel.find('.menu-links > li .list_box ul li a.sub-hover').hover(function () { 13823 if($(this).data('sub-hover')) 13824 $(this).css('color', $(this).data('sub-hover')); 13825 }, function () { 13826 if($(this).data('sub-recovery')) 13827 $(this).css('color', $(this).data('sub-recovery')); 13828 else 13829 $(this).css('color', ''); 13830 }); 13831 13832 //䏿é¸å®æ²æå §å®¹å°±ä¸é¡¯ç¤º 13833 $sel.find('.menu-links > li').each(function(){ 13834 //Ëç®é çicon 13835 $icon = $(this).children('a').first().children('.fa-angle-down'); 13836 $dropdown = $(this).find('.mg-drop-down'); 13837 $menuBox = $(this).find('.megamenu_box'); 13838 //menuBox空ç話ä¸éè¦é¡¯ç¤º 13839 if($menuBox.children().length == 0) 13840 { 13841 $dropdown.addClass('d-none') 13842 $icon.addClass('d-none'); 13843 return; 13844 }else { 13845 var menuBoxChildCount = 0; 13846 $menuBox.children().each(function(){ 13847 if($(this).attr('class').toLowerCase() !== 'clearfix'){ 13848 menuBoxChildCount = menuBoxChildCount + 1; 13849 return; 13850 } 13851 }); 13852 //é¤äº<div class='clearfix'></div>以夿²ææ±è¥¿ç話ä¸éè¦é¡¯ç¤ºã(å註:.clearfixéåç®åä¸ç®¡ææ¨£é½æçæ20221004) 13853 if (menuBoxChildCount == 0){ 13854 $dropdown.addClass('d-none') 13855 $icon.addClass('d-none'); 13856 } 13857 } 13858 }); 13859 13860 // menu initialize 13861 $sel.children('nav.mega-menu').megaMenu({ 13862 // MOBILE MODE SETTINGS 13863 mobile_settings: { 13864 collapse: true, 13865 sibling: true, 13866 scrollBar: true, 13867 scrollBar_height: 400, 13868 top_fixed: false, 13869 sticky_header: false, 13870 sticky_header_height: 200 13871 } 13872 }); 13873 13874 });
13875})(jQuery1113); 13876 13877; })(jQuery);/* compress error:[4]function encode(int) {*/ 13878 13879/* MODULE dce45b27-edda-4f3d-a6b9-98a7405ac84c, Version: 1.9.5 */ 13880(function(a){(function(b){b(function(){b('[data-unicode="mdu_fna16nElo0ODi8DRwzxSg"]').each(function(){$sel=b(this);$hover=$sel.data("hover");if($hover){$sel.find(".tail_wrapper .ul1 > li a, .tail_wrapper .btn-default.btn2").hover(function(){b(this).css("color",$hover)},function(){b(this).css("color","")})}})})})(jQuery)})(jQuery); 13881/* MODULE 51efd658-95fe-4b29-bc4c-603c6613e893, Version: 1.0.8 */ 13882(function(a){(function(b){b(function(){var e=b('[data-unicode="mdu_Bem4EHyy20iyAIsa3I6Cg"]');var d=e.attr("data-unicode");var c=b("#"+d+"_btn");b(window).scroll(function(){if(b(window).scrollTop()>=100){c.css("z-index","99999999").fadeIn(300)}else{c.fadeOut(300)}});c.click(function(){b("html,body").animate({scrollTop:"0px"},800)})})})(jQuery)})(jQuery); 13883/* MODULE 5ae12c42-3612-4326-9e0b-0276415acf10, Version: 1.1.2 */ 13884(function(a){(function(b){b(function(){b(".bgfixed").each(function(){var f=b(this);var h=f.attr("data-bg");if(!h||!h.startsWith("url(")){return}var j=h.trim().replace(/^url\(["']?/,"").replace(/["']?\)$/,"");var g=f.css("background-image");var i=!g||g==="none";if(i&&j){j=j.replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/ /g,"%20");f.css("background-image","url("+j+")")}});var e=new LazyLoad({elements_selector:".bgfixed"});var d=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),c=/iPhone/i.test(navigator.userAgent);if(c){b(".bgfixed").removeClass("fixed")}})})(jQuery)})(jQuery); 13885/* MODULE 4d5d14c2-5508-4ce2-907f-f7133f76da2a, Version: 1.1.1 */ 13886(function(a){a(function(){a(".mdu_nI9ZpyAGU28Yv84gDFzg").each(function(b){})})})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.