vendor: 5,658 bytes, lines 1-200
1/*! 2 * Bootstrap v3.3.7 (http://getbootstrap.com) 3 * Copyright 2011-2016 Twitter, Inc. 4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 */ 6 7/*! 8 * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=6beb4b40af8b483c79607eb8101939cb) 9 * Config saved to config.json and https://gist.github.com/6beb4b40af8b483c79607eb8101939cb 10 */ 11var bootstrapJQuery = null; 12 13if (typeof jQuery === 'undefined') { 14 throw new Error('Bootstrap\'s JavaScript requires jQuery') 15} else { 16 if (typeof r01JQuery === 'undefined') { 17 console.log("r01JQuery is not defined"); 18 bootstrapJQuery = jQuery; 19 } else { 20 bootstrapJQuery = r01JQuery; 21 } 22} 23 24+function ($) { 25 'use strict'; 26 var version = $.fn.jquery.split(' ')[0].split('.'); 27 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 28 throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3') 29 } 30}(bootstrapJQuery); 31 32/* ======================================================================== 33 * Bootstrap: alert.js v3.3.7 34 * http://getbootstrap.com/javascript/#alerts 35 * ======================================================================== 36 * Copyright 2011-2016 Twitter, Inc. 37 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 38 * ======================================================================== */ 39 40 41+function ($) { 42 'use strict'; 43 44 // ALERT CLASS DEFINITION 45 // ====================== 46 47 var dismiss = '[data-dismiss="alert"]' 48 var Alert = function (el) { 49 $(el).on('click', dismiss, this.close) 50 } 51 52 Alert.VERSION = '3.3.7' 53 54 Alert.TRANSITION_DURATION = 150 55 56 Alert.prototype.close = function (e) { 57 var $this = $(this) 58 var selector = $this.attr('data-target') 59 60 if (!selector) { 61 selector = $this.attr('href') 62 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 63 } 64 65 var $parent = $(selector === '#' ? [] : selector) 66 67 if (e) e.preventDefault() 68 69 if (!$parent.length) { 70 $parent = $this.closest('.alert') 71 } 72 73 $parent.trigger(e = $.Event('close.bs.alert')) 74 75 if (e.isDefaultPrevented()) return 76 77 $parent.removeClass('in') 78 79 function removeElement() { 80 // detach from parent, fire event then clean up data 81 $parent.detach().trigger('closed.bs.alert').remove() 82 } 83 84 $.support.transition && $parent.hasClass('fade') ? 85 $parent 86 .one('bsTransitionEnd', removeElement) 87 .emulateTransitionEnd(Alert.TRANSITION_DURATION) : 88 removeElement() 89 } 90 91 92 // ALERT PLUGIN DEFINITION 93 // ======================= 94 95 function Plugin(option) { 96 return this.each(function () { 97 var $this = $(this) 98 var data = $this.data('bs.alert') 99 100 if (!data) $this.data('bs.alert', (data = new Alert(this))) 101 if (typeof option == 'string') data[option].call($this) 102 }) 103 } 104 105 var old = $.fn.alert 106 107 $.fn.alert = Plugin 108 $.fn.alert.Constructor = Alert 109 110 111 // ALERT NO CONFLICT 112 // ================= 113 114 $.fn.alert.noConflict = function () { 115 $.fn.alert = old 116 return this 117 } 118 119 120 // ALERT DATA-API 121 // ============== 122 123 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 124 125}(bootstrapJQuery); 126 127/* ======================================================================== 128 * Bootstrap: button.js v3.3.7 129 * http://getbootstrap.com/javascript/#buttons 130 * ======================================================================== 131 * Copyright 2011-2016 Twitter, Inc. 132 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 133 * ======================================================================== */ 134 135 136+function ($) { 137 'use strict'; 138 139 // BUTTON PUBLIC CLASS DEFINITION 140 // ============================== 141 142 var Button = function (element, options) { 143 this.$element = $(element) 144 this.options = $.extend({}, Button.DEFAULTS, options) 145 this.isLoading = false 146 } 147 148 Button.VERSION = '3.3.7' 149 150 Button.DEFAULTS = { 151 loadingText: 'loading...' 152 } 153 154 Button.prototype.setState = function (state) { 155 var d = 'disabled' 156 var $el = this.$element 157 var val = $el.is('input') ? 'val' : 'html' 158 var data = $el.data() 159 160 state += 'Text' 161 162 if (data.resetText == null) $el.data('resetText', $el[val]()) 163 164 // push to event loop to allow forms to submit 165 setTimeout($.proxy(function () { 166 $el[val](data[state] == null ? this.options[state] : data[state]) 167 168 if (state == 'loadingText') { 169 this.isLoading = true 170 $el.addClass(d).attr(d, d).prop(d, true) 171 } else if (this.isLoading) { 172 this.isLoading = false 173 $el.removeClass(d).removeAttr(d).prop(d, false) 174 } 175 }, this), 0) 176 } 177 178 Button.prototype.toggle = function () { 179 var changed = true 180 var $parent = this.$element.closest('[data-toggle="buttons"]') 181 182 if ($parent.length) { 183 var $input = this.$element.find('input') 184 if ($input.prop('type') == 'radio') { 185 if ($input.prop('checked')) changed = false 186 $parent.find('.active').removeClass('active') 187 this.$element.addClass('active') 188 } else if ($input.prop('type') == 'checkbox') { 189 if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false 190 this.$element.toggleClass('active') 191 } 192 $input.prop('checked', this.$element.hasClass('active')) 193 if (changed) $input.trigger('change') 194 } else { 195 this.$element.attr('aria-pressed', !this.$element.hasClass('active')) 196 this.$element.toggleClass('active') 197 } 198 } 199 200
vendor: 6,040 bytes, lines 201-396
201 // BUTTON PLUGIN DEFINITION 202 // ======================== 203 204 function Plugin(option) { 205 return this.each(function () { 206 var $this = $(this) 207 var data = $this.data('bs.button') 208 var options = typeof option == 'object' && option 209 210 if (!data) $this.data('bs.button', (data = new Button(this, options))) 211 212 if (option == 'toggle') data.toggle() 213 else if (option) data.setState(option) 214 }) 215 } 216 217 var old = $.fn.button 218 219 $.fn.button = Plugin 220 $.fn.button.Constructor = Button 221 222 223 // BUTTON NO CONFLICT 224 // ================== 225 226 $.fn.button.noConflict = function () { 227 $.fn.button = old 228 return this 229 } 230 231 232 // BUTTON DATA-API 233 // =============== 234 235 $(document) 236 .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { 237 var $btn = $(e.target).closest('.btn') 238 Plugin.call($btn, 'toggle') 239 if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { 240 // Prevent double click on radios, and the double selections (so cancellation) on checkboxes 241 e.preventDefault() 242 // The target component still receive the focus 243 if ($btn.is('input,button')) $btn.trigger('focus') 244 else $btn.find('input:visible,button:visible').first().trigger('focus') 245 } 246 }) 247 .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { 248 $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) 249 }) 250 251}(bootstrapJQuery); 252 253/* ======================================================================== 254 * Bootstrap: carousel.js v3.3.7 255 * http://getbootstrap.com/javascript/#carousel 256 * ======================================================================== 257 * Copyright 2011-2016 Twitter, Inc. 258 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 259 * ======================================================================== */ 260 261 262+function ($) { 263 'use strict'; 264 265 // CAROUSEL CLASS DEFINITION 266 // ========================= 267 268 var Carousel = function (element, options) { 269 this.$element = $(element) 270 this.$indicators = this.$element.find('.carousel-indicators') 271 this.options = options 272 this.paused = null 273 this.sliding = null 274 this.interval = null 275 this.$active = null 276 this.$items = null 277 278 this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) 279 280 this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element 281 .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) 282 .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) 283 } 284 285 Carousel.VERSION = '3.3.7' 286 287 Carousel.TRANSITION_DURATION = 600 288 289 Carousel.DEFAULTS = { 290 interval: 5000, 291 pause: 'hover', 292 wrap: true, 293 keyboard: true 294 } 295 296 Carousel.prototype.keydown = function (e) { 297 if (/input|textarea/i.test(e.target.tagName)) return 298 switch (e.which) { 299 case 37: this.prev(); break 300 case 39: this.next(); break 301 default: return 302 } 303 304 e.preventDefault() 305 } 306 307 Carousel.prototype.cycle = function (e) { 308 e || (this.paused = false) 309 310 this.interval && clearInterval(this.interval) 311 312 this.options.interval 313 && !this.paused 314 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) 315 316 return this 317 } 318 319 Carousel.prototype.getItemIndex = function (item) { 320 this.$items = item.parent().children('.item') 321 return this.$items.index(item || this.$active) 322 } 323 324 Carousel.prototype.getItemForDirection = function (direction, active) { 325 var activeIndex = this.getItemIndex(active) 326 var willWrap = (direction == 'prev' && activeIndex === 0) 327 || (direction == 'next' && activeIndex == (this.$items.length - 1)) 328 if (willWrap && !this.options.wrap) return active 329 var delta = direction == 'prev' ? -1 : 1 330 var itemIndex = (activeIndex + delta) % this.$items.length 331 return this.$items.eq(itemIndex) 332 } 333 334 Carousel.prototype.to = function (pos) { 335 var that = this 336 var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) 337 338 if (pos > (this.$items.length - 1) || pos < 0) return 339 340 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" 341 if (activeIndex == pos) return this.pause().cycle() 342 343 return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) 344 } 345 346 Carousel.prototype.pause = function (e) { 347 e || (this.paused = true) 348 349 if (this.$element.find('.next, .prev').length && $.support.transition) { 350 this.$element.trigger($.support.transition.end) 351 this.cycle(true) 352 } 353 354 this.interval = clearInterval(this.interval) 355 356 return this 357 } 358 359 Carousel.prototype.next = function () { 360 if (this.sliding) return 361 return this.slide('next') 362 } 363 364 Carousel.prototype.prev = function () { 365 if (this.sliding) return 366 return this.slide('prev') 367 } 368 369 Carousel.prototype.slide = function (type, next) { 370 var $active = this.$element.find('.item.active') 371 var $next = next || this.getItemForDirection(type, $active) 372 var isCycling = this.interval 373 var direction = type == 'next' ? 'left' : 'right' 374 var that = this 375 376 if ($next.hasClass('active')) return (this.sliding = false) 377 378 var relatedTarget = $next[0] 379 var slideEvent = $.Event('slide.bs.carousel', { 380 relatedTarget: relatedTarget, 381 direction: direction 382 }) 383 this.$element.trigger(slideEvent) 384 if (slideEvent.isDefaultPrevented()) return 385 386 this.sliding = true 387 388 isCycling && this.pause() 389 390 if (this.$indicators.length) { 391 this.$indicators.find('.active').removeClass('active') 392 var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) 393 $nextIndicator && $nextIndicator.addClass('active') 394 } 395 396 var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
vendor: 17,360 bytes, lines 397-995
397 if ($.support.transition && this.$element.hasClass('slide')) { 398 $next.addClass(type) 399 $next[0].offsetWidth // force reflow 400 $active.addClass(direction) 401 $next.addClass(direction) 402 $active 403 .one('bsTransitionEnd', function () { 404 $next.removeClass([type, direction].join(' ')).addClass('active') 405 $active.removeClass(['active', direction].join(' ')) 406 that.sliding = false 407 setTimeout(function () { 408 that.$element.trigger(slidEvent) 409 }, 0) 410 }) 411 .emulateTransitionEnd(Carousel.TRANSITION_DURATION) 412 } else { 413 $active.removeClass('active') 414 $next.addClass('active') 415 this.sliding = false 416 this.$element.trigger(slidEvent) 417 } 418 419 isCycling && this.cycle() 420 421 return this 422 } 423 424 425 // CAROUSEL PLUGIN DEFINITION 426 // ========================== 427 428 function Plugin(option) { 429 return this.each(function () { 430 var $this = $(this) 431 var data = $this.data('bs.carousel') 432 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) 433 var action = typeof option == 'string' ? option : options.slide 434 435 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) 436 if (typeof option == 'number') data.to(option) 437 else if (action) data[action]() 438 else if (options.interval) data.pause().cycle() 439 }) 440 } 441 442 var old = $.fn.carousel 443 444 $.fn.carousel = Plugin 445 $.fn.carousel.Constructor = Carousel 446 447 448 // CAROUSEL NO CONFLICT 449 // ==================== 450 451 $.fn.carousel.noConflict = function () { 452 $.fn.carousel = old 453 return this 454 } 455 456 457 // CAROUSEL DATA-API 458 // ================= 459 460 var clickHandler = function (e) { 461 var href 462 var $this = $(this) 463 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 464 if (!$target.hasClass('carousel')) return 465 var options = $.extend({}, $target.data(), $this.data()) 466 var slideIndex = $this.attr('data-slide-to') 467 if (slideIndex) options.interval = false 468 469 Plugin.call($target, options) 470 471 if (slideIndex) { 472 $target.data('bs.carousel').to(slideIndex) 473 } 474 475 e.preventDefault() 476 } 477 478 $(document) 479 .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) 480 .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) 481 482 $(window).on('load', function () { 483 $('[data-ride="carousel"]').each(function () { 484 var $carousel = $(this) 485 Plugin.call($carousel, $carousel.data()) 486 }) 487 }) 488 489}(bootstrapJQuery); 490 491/* ======================================================================== 492 * Bootstrap: dropdown.js v3.3.7 493 * http://getbootstrap.com/javascript/#dropdowns 494 * ======================================================================== 495 * Copyright 2011-2016 Twitter, Inc. 496 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 497 * ======================================================================== */ 498 499 500+function ($) { 501 'use strict'; 502 503 // DROPDOWN CLASS DEFINITION 504 // ========================= 505 506 var backdrop = '.dropdown-backdrop' 507 var toggle = '[data-toggle="dropdown"]' 508 var Dropdown = function (element) { 509 $(element).on('click.bs.dropdown', this.toggle) 510 } 511 512 Dropdown.VERSION = '3.3.7' 513 514 function getParent($this) { 515 var selector = $this.attr('data-target') 516 517 if (!selector) { 518 selector = $this.attr('href') 519 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 520 } 521 522 var $parent = selector && $(selector) 523 524 return $parent && $parent.length ? $parent : $this.parent() 525 } 526 527 function clearMenus(e) { 528 if (e && e.which === 3) return 529 $(backdrop).remove() 530 $(toggle).each(function () { 531 var $this = $(this) 532 var $parent = getParent($this) 533 var relatedTarget = { relatedTarget: this } 534 535 if (!$parent.hasClass('open')) return 536 537 if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return 538 539 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) 540 541 if (e.isDefaultPrevented()) return 542 543 $this.attr('aria-expanded', 'false') 544 $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) 545 }) 546 } 547 548 Dropdown.prototype.toggle = function (e) { 549 var $this = $(this) 550 551 if ($this.is('.disabled, :disabled')) return 552 553 var $parent = getParent($this) 554 var isActive = $parent.hasClass('open') 555 556 clearMenus() 557 558 if (!isActive) { 559 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 560 // if mobile we use a backdrop because click events don't delegate 561 $(document.createElement('div')) 562 .addClass('dropdown-backdrop') 563 .insertAfter($(this)) 564 .on('click', clearMenus) 565 } 566 567 var relatedTarget = { relatedTarget: this } 568 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) 569 570 if (e.isDefaultPrevented()) return 571 572 $this 573 .trigger('focus') 574 .attr('aria-expanded', 'true') 575 576 $parent 577 .toggleClass('open') 578 .trigger($.Event('shown.bs.dropdown', relatedTarget)) 579 } 580 581 return false 582 } 583 584 Dropdown.prototype.keydown = function (e) { 585 if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return 586 587 var $this = $(this) 588 589 e.preventDefault() 590 e.stopPropagation() 591 592 if ($this.is('.disabled, :disabled')) return 593 594 var $parent = getParent($this) 595 var isActive = $parent.hasClass('open') 596 597 if (!isActive && e.which != 27 || isActive && e.which == 27) { 598 if (e.which == 27) $parent.find(toggle).trigger('focus') 599 return $this.trigger('click') 600 } 601 602 var desc = ' li:not(.disabled):visible a' 603 var $items = $parent.find('.dropdown-menu' + desc) 604 605 if (!$items.length) return 606 607 var index = $items.index(e.target) 608 609 if (e.which == 38 && index > 0) index-- // up 610 if (e.which == 40 && index < $items.length - 1) index++ // down 611 if (!~index) index = 0 612 613 $items.eq(index).trigger('focus') 614 } 615 616 617 // DROPDOWN PLUGIN DEFINITION 618 // ========================== 619 620 function Plugin(option) { 621 return this.each(function () { 622 var $this = $(this) 623 var data = $this.data('bs.dropdown') 624 625 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) 626 if (typeof option == 'string') data[option].call($this) 627 }) 628 } 629 630 var old = $.fn.dropdown 631 632 $.fn.dropdown = Plugin 633 $.fn.dropdown.Constructor = Dropdown 634 635 636 // DROPDOWN NO CONFLICT 637 // ==================== 638 639 $.fn.dropdown.noConflict = function () { 640 $.fn.dropdown = old 641 return this 642 } 643 644 645 // APPLY TO STANDARD DROPDOWN ELEMENTS 646 // =================================== 647 648 $(document) 649 .on('click.bs.dropdown.data-api', clearMenus) 650 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) 651 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) 652 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) 653 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) 654 655}(bootstrapJQuery); 656 657/* ======================================================================== 658 * Bootstrap: modal.js v3.3.7 659 * http://getbootstrap.com/javascript/#modals 660 * ======================================================================== 661 * Copyright 2011-2016 Twitter, Inc. 662 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 663 * ======================================================================== */ 664 665 666+function ($) { 667 'use strict'; 668 669 // MODAL CLASS DEFINITION 670 // ====================== 671 672 var Modal = function (element, options) { 673 this.options = options 674 this.$body = $(document.body) 675 this.$element = $(element) 676 this.$dialog = this.$element.find('.modal-dialog') 677 this.$backdrop = null 678 this.isShown = null 679 this.originalBodyPad = null 680 this.scrollbarWidth = 0 681 this.ignoreBackdropClick = false 682 683 if (this.options.remote) { 684 this.$element 685 .find('.modal-content') 686 .load(this.options.remote, $.proxy(function () { 687 this.$element.trigger('loaded.bs.modal') 688 }, this)) 689 } 690 } 691 692 Modal.VERSION = '3.3.7' 693 694 Modal.TRANSITION_DURATION = 300 695 Modal.BACKDROP_TRANSITION_DURATION = 150 696 697 Modal.DEFAULTS = { 698 backdrop: true, 699 keyboard: true, 700 show: true 701 } 702 703 Modal.prototype.toggle = function (_relatedTarget) { 704 return this.isShown ? this.hide() : this.show(_relatedTarget) 705 } 706 707 Modal.prototype.show = function (_relatedTarget) { 708 var that = this 709 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) 710 711 this.$element.trigger(e) 712 713 if (this.isShown || e.isDefaultPrevented()) return 714 715 this.isShown = true 716 717 this.checkScrollbar() 718 this.setScrollbar() 719 this.$body.addClass('modal-open') 720 721 this.escape() 722 this.resize() 723 724 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) 725 726 this.$dialog.on('mousedown.dismiss.bs.modal', function () { 727 that.$element.one('mouseup.dismiss.bs.modal', function (e) { 728 if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true 729 }) 730 }) 731 732 this.backdrop(function () { 733 var transition = $.support.transition && that.$element.hasClass('fade') 734 735 if (!that.$element.parent().length) { 736 that.$element.appendTo(that.$body) // don't move modals dom position 737 } 738 739 that.$element 740 .show() 741 .scrollTop(0) 742 743 that.adjustDialog() 744 745 if (transition) { 746 that.$element[0].offsetWidth // force reflow 747 } 748 749 that.$element.addClass('in') 750 751 that.enforceFocus() 752 753 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) 754 755 transition ? 756 that.$dialog // wait for modal to slide in 757 .one('bsTransitionEnd', function () { 758 that.$element.trigger('focus').trigger(e) 759 }) 760 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 761 that.$element.trigger('focus').trigger(e) 762 }) 763 } 764 765 Modal.prototype.hide = function (e) { 766 if (e) e.preventDefault() 767 768 e = $.Event('hide.bs.modal') 769 770 this.$element.trigger(e) 771 772 if (!this.isShown || e.isDefaultPrevented()) return 773 774 this.isShown = false 775 776 this.escape() 777 this.resize() 778 779 $(document).off('focusin.bs.modal') 780 781 this.$element 782 .removeClass('in') 783 .off('click.dismiss.bs.modal') 784 .off('mouseup.dismiss.bs.modal') 785 786 this.$dialog.off('mousedown.dismiss.bs.modal') 787 788 $.support.transition && this.$element.hasClass('fade') ? 789 this.$element 790 .one('bsTransitionEnd', $.proxy(this.hideModal, this)) 791 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 792 this.hideModal() 793 } 794 795 Modal.prototype.enforceFocus = function () { 796 $(document) 797 .off('focusin.bs.modal') // guard against infinite focus loop 798 .on('focusin.bs.modal', $.proxy(function (e) { 799 if (document !== e.target && 800 this.$element[0] !== e.target && 801 !this.$element.has(e.target).length) { 802 this.$element.trigger('focus') 803 } 804 }, this)) 805 } 806 807 Modal.prototype.escape = function () { 808 if (this.isShown && this.options.keyboard) { 809 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { 810 e.which == 27 && this.hide() 811 }, this)) 812 } else if (!this.isShown) { 813 this.$element.off('keydown.dismiss.bs.modal') 814 } 815 } 816 817 Modal.prototype.resize = function () { 818 if (this.isShown) { 819 $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) 820 } else { 821 $(window).off('resize.bs.modal') 822 } 823 } 824 825 Modal.prototype.hideModal = function () { 826 var that = this 827 this.$element.hide() 828 this.backdrop(function () { 829 that.$body.removeClass('modal-open') 830 that.resetAdjustments() 831 that.resetScrollbar() 832 that.$element.trigger('hidden.bs.modal') 833 }) 834 } 835 836 Modal.prototype.removeBackdrop = function () { 837 this.$backdrop && this.$backdrop.remove() 838 this.$backdrop = null 839 } 840 841 Modal.prototype.backdrop = function (callback) { 842 var that = this 843 var animate = this.$element.hasClass('fade') ? 'fade' : '' 844 845 if (this.isShown && this.options.backdrop) { 846 var doAnimate = $.support.transition && animate 847 848 this.$backdrop = $(document.createElement('div')) 849 .addClass('modal-backdrop ' + animate) 850 .appendTo(this.$body) 851 852 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { 853 if (this.ignoreBackdropClick) { 854 this.ignoreBackdropClick = false 855 return 856 } 857 if (e.target !== e.currentTarget) return 858 this.options.backdrop == 'static' 859 ? this.$element[0].focus() 860 : this.hide() 861 }, this)) 862 863 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow 864 865 this.$backdrop.addClass('in') 866 867 if (!callback) return 868 869 doAnimate ? 870 this.$backdrop 871 .one('bsTransitionEnd', callback) 872 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 873 callback() 874 875 } else if (!this.isShown && this.$backdrop) { 876 this.$backdrop.removeClass('in') 877 878 var callbackRemove = function () { 879 that.removeBackdrop() 880 callback && callback() 881 } 882 $.support.transition && this.$element.hasClass('fade') ? 883 this.$backdrop 884 .one('bsTransitionEnd', callbackRemove) 885 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 886 callbackRemove() 887 888 } else if (callback) { 889 callback() 890 } 891 } 892 893 // these following methods are used to handle overflowing modals 894 895 Modal.prototype.handleUpdate = function () { 896 this.adjustDialog() 897 } 898 899 Modal.prototype.adjustDialog = function () { 900 var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight 901 902 this.$element.css({ 903 paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', 904 paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' 905 }) 906 } 907 908 Modal.prototype.resetAdjustments = function () { 909 this.$element.css({ 910 paddingLeft: '', 911 paddingRight: '' 912 }) 913 } 914 915 Modal.prototype.checkScrollbar = function () { 916 var fullWindowWidth = window.innerWidth 917 if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 918 var documentElementRect = document.documentElement.getBoundingClientRect() 919 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) 920 } 921 this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth 922 this.scrollbarWidth = this.measureScrollbar() 923 } 924 925 Modal.prototype.setScrollbar = function () { 926 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) 927 this.originalBodyPad = document.body.style.paddingRight || '' 928 if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) 929 } 930 931 Modal.prototype.resetScrollbar = function () { 932 this.$body.css('padding-right', this.originalBodyPad) 933 } 934 935 Modal.prototype.measureScrollbar = function () { // thx walsh 936 var scrollDiv = document.createElement('div') 937 scrollDiv.className = 'modal-scrollbar-measure' 938 this.$body.append(scrollDiv) 939 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth 940 this.$body[0].removeChild(scrollDiv) 941 return scrollbarWidth 942 } 943 944 945 // MODAL PLUGIN DEFINITION 946 // ======================= 947 948 function Plugin(option, _relatedTarget) { 949 return this.each(function () { 950 var $this = $(this) 951 var data = $this.data('bs.modal') 952 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) 953 954 if (!data) $this.data('bs.modal', (data = new Modal(this, options))) 955 if (typeof option == 'string') data[option](_relatedTarget) 956 else if (options.show) data.show(_relatedTarget) 957 }) 958 } 959 960 var old = $.fn.modal 961 962 $.fn.modal = Plugin 963 $.fn.modal.Constructor = Modal 964 965 966 // MODAL NO CONFLICT 967 // ================= 968 969 $.fn.modal.noConflict = function () { 970 $.fn.modal = old 971 return this 972 } 973 974 975 // MODAL DATA-API 976 // ============== 977 978 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { 979 var $this = $(this) 980 var href = $this.attr('href') 981 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 982 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) 983 984 if ($this.is('a')) e.preventDefault() 985 986 $target.one('show.bs.modal', function (showEvent) { 987 if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown 988 $target.one('hidden.bs.modal', function () { 989 $this.is(':visible') && $this.trigger('focus') 990 }) 991 }) 992 Plugin.call($target, option, this) 993 }) 994 995}(bootstrapJ
vendor: 16,719 bytes, lines 995-1516
995Query); 996 997/* ======================================================================== 998 * Bootstrap: tooltip.js v3.3.7 999 * http://getbootstrap.com/javascript/#tooltip 1000 * Inspired by the original jQuery.tipsy by Jason Frame 1001 * ======================================================================== 1002 * Copyright 2011-2016 Twitter, Inc. 1003 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1004 * ======================================================================== */ 1005 1006 1007+function ($) { 1008 'use strict'; 1009 1010 // TOOLTIP PUBLIC CLASS DEFINITION 1011 // =============================== 1012 1013 var Tooltip = function (element, options) { 1014 this.type = null 1015 this.options = null 1016 this.enabled = null 1017 this.timeout = null 1018 this.hoverState = null 1019 this.$element = null 1020 this.inState = null 1021 1022 this.init('tooltip', element, options) 1023 } 1024 1025 Tooltip.VERSION = '3.3.7' 1026 1027 Tooltip.TRANSITION_DURATION = 150 1028 1029 Tooltip.DEFAULTS = { 1030 animation: true, 1031 placement: 'top', 1032 selector: false, 1033 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 1034 trigger: 'hover focus', 1035 title: '', 1036 delay: 0, 1037 html: false, 1038 container: false, 1039 viewport: { 1040 selector: 'body', 1041 padding: 0 1042 } 1043 } 1044 1045 Tooltip.prototype.init = function (type, element, options) { 1046 this.enabled = true 1047 this.type = type 1048 this.$element = $(element) 1049 this.options = this.getOptions(options) 1050 this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) 1051 this.inState = { click: false, hover: false, focus: false } 1052 1053 if (this.$element[0] instanceof document.constructor && !this.options.selector) { 1054 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') 1055 } 1056 1057 var triggers = this.options.trigger.split(' ') 1058 1059 for (var i = triggers.length; i--;) { 1060 var trigger = triggers[i] 1061 1062 if (trigger == 'click') { 1063 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 1064 } else if (trigger != 'manual') { 1065 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' 1066 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' 1067 1068 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 1069 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 1070 } 1071 } 1072 1073 this.options.selector ? 1074 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 1075 this.fixTitle() 1076 } 1077 1078 Tooltip.prototype.getDefaults = function () { 1079 return Tooltip.DEFAULTS 1080 } 1081 1082 Tooltip.prototype.getOptions = function (options) { 1083 options = $.extend({}, this.getDefaults(), this.$element.data(), options) 1084 1085 if (options.delay && typeof options.delay == 'number') { 1086 options.delay = { 1087 show: options.delay, 1088 hide: options.delay 1089 } 1090 } 1091 1092 return options 1093 } 1094 1095 Tooltip.prototype.getDelegateOptions = function () { 1096 var options = {} 1097 var defaults = this.getDefaults() 1098 1099 this._options && $.each(this._options, function (key, value) { 1100 if (defaults[key] != value) options[key] = value 1101 }) 1102 1103 return options 1104 } 1105 1106 Tooltip.prototype.enter = function (obj) { 1107 var self = obj instanceof this.constructor ? 1108 obj : $(obj.currentTarget).data('bs.' + this.type) 1109 1110 if (!self) { 1111 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 1112 $(obj.currentTarget).data('bs.' + this.type, self) 1113 } 1114 1115 if (obj instanceof $.Event) { 1116 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true 1117 } 1118 1119 if (self.tip().hasClass('in') || self.hoverState == 'in') { 1120 self.hoverState = 'in' 1121 return 1122 } 1123 1124 clearTimeout(self.timeout) 1125 1126 self.hoverState = 'in' 1127 1128 if (!self.options.delay || !self.options.delay.show) return self.show() 1129 1130 self.timeout = setTimeout(function () { 1131 if (self.hoverState == 'in') self.show() 1132 }, self.options.delay.show) 1133 } 1134 1135 Tooltip.prototype.isInStateTrue = function () { 1136 for (var key in this.inState) { 1137 if (this.inState[key]) return true 1138 } 1139 1140 return false 1141 } 1142 1143 Tooltip.prototype.leave = function (obj) { 1144 var self = obj instanceof this.constructor ? 1145 obj : $(obj.currentTarget).data('bs.' + this.type) 1146 1147 if (!self) { 1148 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 1149 $(obj.currentTarget).data('bs.' + this.type, self) 1150 } 1151 1152 if (obj instanceof $.Event) { 1153 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false 1154 } 1155 1156 if (self.isInStateTrue()) return 1157 1158 clearTimeout(self.timeout) 1159 1160 self.hoverState = 'out' 1161 1162 if (!self.options.delay || !self.options.delay.hide) return self.hide() 1163 1164 self.timeout = setTimeout(function () { 1165 if (self.hoverState == 'out') self.hide() 1166 }, self.options.delay.hide) 1167 } 1168 1169 Tooltip.prototype.show = function () { 1170 var e = $.Event('show.bs.' + this.type) 1171 1172 if (this.hasContent() && this.enabled) { 1173 this.$element.trigger(e) 1174 1175 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) 1176 if (e.isDefaultPrevented() || !inDom) return 1177 var that = this 1178 1179 var $tip = this.tip() 1180 1181 var tipId = this.getUID(this.type) 1182 1183 this.setContent() 1184 $tip.attr('id', tipId) 1185 this.$element.attr('aria-describedby', tipId) 1186 1187 if (this.options.animation) $tip.addClass('fade') 1188 1189 var placement = typeof this.options.placement == 'function' ? 1190 this.options.placement.call(this, $tip[0], this.$element[0]) : 1191 this.options.placement 1192 1193 var autoToken = /\s?auto?\s?/i 1194 var autoPlace = autoToken.test(placement) 1195 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 1196 1197 $tip 1198 .detach() 1199 .css({ top: 0, left: 0, display: 'block' }) 1200 .addClass(placement) 1201 .data('bs.' + this.type, this) 1202 1203 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) 1204 this.$element.trigger('inserted.bs.' + this.type) 1205 1206 var pos = this.getPosition() 1207 var actualWidth = $tip[0].offsetWidth 1208 var actualHeight = $tip[0].offsetHeight 1209 1210 if (autoPlace) { 1211 var orgPlacement = placement 1212 var viewportDim = this.getPosition(this.$viewport) 1213 1214 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : 1215 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : 1216 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : 1217 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : 1218 placement 1219 1220 $tip 1221 .removeClass(orgPlacement) 1222 .addClass(placement) 1223 } 1224 1225 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 1226 1227 this.applyPlacement(calculatedOffset, placement) 1228 1229 var complete = function () { 1230 var prevHoverState = that.hoverState 1231 that.$element.trigger('shown.bs.' + that.type) 1232 that.hoverState = null 1233 1234 if (prevHoverState == 'out') that.leave(that) 1235 } 1236 1237 $.support.transition && this.$tip.hasClass('fade') ? 1238 $tip 1239 .one('bsTransitionEnd', complete) 1240 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 1241 complete() 1242 } 1243 } 1244 1245 Tooltip.prototype.applyPlacement = function (offset, placement) { 1246 var $tip = this.tip() 1247 var width = $tip[0].offsetWidth 1248 var height = $tip[0].offsetHeight 1249 1250 // manually read margins because getBoundingClientRect includes difference 1251 var marginTop = parseInt($tip.css('margin-top'), 10) 1252 var marginLeft = parseInt($tip.css('margin-left'), 10) 1253 1254 // we must check for NaN for ie 8/9 1255 if (isNaN(marginTop)) marginTop = 0 1256 if (isNaN(marginLeft)) marginLeft = 0 1257 1258 offset.top += marginTop 1259 offset.left += marginLeft 1260 1261 // $.fn.offset doesn't round pixel values 1262 // so we use setOffset directly with our own function B-0 1263 $.offset.setOffset($tip[0], $.extend({ 1264 using: function (props) { 1265 $tip.css({ 1266 top: Math.round(props.top), 1267 left: Math.round(props.left) 1268 }) 1269 } 1270 }, offset), 0) 1271 1272 $tip.addClass('in') 1273 1274 // check to see if placing tip in new offset caused the tip to resize itself 1275 var actualWidth = $tip[0].offsetWidth 1276 var actualHeight = $tip[0].offsetHeight 1277 1278 if (placement == 'top' && actualHeight != height) { 1279 offset.top = offset.top + height - actualHeight 1280 } 1281 1282 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) 1283 1284 if (delta.left) offset.left += delta.left 1285 else offset.top += delta.top 1286 1287 var isVertical = /top|bottom/.test(placement) 1288 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight 1289 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' 1290 1291 $tip.offset(offset) 1292 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) 1293 } 1294 1295 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { 1296 this.arrow() 1297 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') 1298 .css(isVertical ? 'top' : 'left', '') 1299 } 1300 1301 Tooltip.prototype.setContent = function () { 1302 var $tip = this.tip() 1303 var title = this.getTitle() 1304 1305 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) 1306 $tip.removeClass('fade in top bottom left right') 1307 } 1308 1309 Tooltip.prototype.hide = function (callback) { 1310 var that = this 1311 var $tip = $(this.$tip) 1312 var e = $.Event('hide.bs.' + this.type) 1313 1314 function complete() { 1315 if (that.hoverState != 'in') $tip.detach() 1316 if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. 1317 that.$element 1318 .removeAttr('aria-describedby') 1319 .trigger('hidden.bs.' + that.type) 1320 } 1321 callback && callback() 1322 } 1323 1324 this.$element.trigger(e) 1325 1326 if (e.isDefaultPrevented()) return 1327 1328 $tip.removeClass('in') 1329 1330 $.support.transition && $tip.hasClass('fade') ? 1331 $tip 1332 .one('bsTransitionEnd', complete) 1333 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 1334 complete() 1335 1336 this.hoverState = null 1337 1338 return this 1339 } 1340 1341 Tooltip.prototype.fixTitle = function () { 1342 var $e = this.$element 1343 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { 1344 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 1345 } 1346 } 1347 1348 Tooltip.prototype.hasContent = function () { 1349 return this.getTitle() 1350 } 1351 1352 Tooltip.prototype.getPosition = function ($element) { 1353 $element = $element || this.$element 1354 1355 var el = $element[0] 1356 var isBody = el.tagName == 'BODY' 1357 1358 var elRect = el.getBoundingClientRect() 1359 if (elRect.width == null) { 1360 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 1361 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) 1362 } 1363 var isSvg = window.SVGElement && el instanceof window.SVGElement 1364 // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. 1365 // See https://github.com/twbs/bootstrap/issues/20280 1366 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) 1367 var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } 1368 var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null 1369 1370 return $.extend({}, elRect, scroll, outerDims, elOffset) 1371 } 1372 1373 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 1374 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 1375 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 1376 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 1377 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 1378 1379 } 1380 1381 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { 1382 var delta = { top: 0, left: 0 } 1383 if (!this.$viewport) return delta 1384 1385 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 1386 var viewportDimensions = this.getPosition(this.$viewport) 1387 1388 if (/right|left/.test(placement)) { 1389 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll 1390 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight 1391 if (topEdgeOffset < viewportDimensions.top) { // top overflow 1392 delta.top = viewportDimensions.top - topEdgeOffset 1393 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow 1394 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset 1395 } 1396 } else { 1397 var leftEdgeOffset = pos.left - viewportPadding 1398 var rightEdgeOffset = pos.left + viewportPadding + actualWidth 1399 if (leftEdgeOffset < viewportDimensions.left) { // left overflow 1400 delta.left = viewportDimensions.left - leftEdgeOffset 1401 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow 1402 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset 1403 } 1404 } 1405 1406 return delta 1407 } 1408 1409 Tooltip.prototype.getTitle = function () { 1410 var title 1411 var $e = this.$element 1412 var o = this.options 1413 1414 title = $e.attr('data-original-title') 1415 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 1416 1417 return title 1418 } 1419 1420 Tooltip.prototype.getUID = function (prefix) { 1421 do prefix += ~~(Math.random() * 1000000) 1422 while (document.getElementById(prefix)) 1423 return prefix 1424 } 1425 1426 Tooltip.prototype.tip = function () { 1427 if (!this.$tip) { 1428 this.$tip = $(this.options.template) 1429 if (this.$tip.length != 1) { 1430 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') 1431 } 1432 } 1433 return this.$tip 1434 } 1435 1436 Tooltip.prototype.arrow = function () { 1437 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) 1438 } 1439 1440 Tooltip.prototype.enable = function () { 1441 this.enabled = true 1442 } 1443 1444 Tooltip.prototype.disable = function () { 1445 this.enabled = false 1446 } 1447 1448 Tooltip.prototype.toggleEnabled = function () { 1449 this.enabled = !this.enabled 1450 } 1451 1452 Tooltip.prototype.toggle = function (e) { 1453 var self = this 1454 if (e) { 1455 self = $(e.currentTarget).data('bs.' + this.type) 1456 if (!self) { 1457 self = new this.constructor(e.currentTarget, this.getDelegateOptions()) 1458 $(e.currentTarget).data('bs.' + this.type, self) 1459 } 1460 } 1461 1462 if (e) { 1463 self.inState.click = !self.inState.click 1464 if (self.isInStateTrue()) self.enter(self) 1465 else self.leave(self) 1466 } else { 1467 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 1468 } 1469 } 1470 1471 Tooltip.prototype.destroy = function () { 1472 var that = this 1473 clearTimeout(this.timeout) 1474 this.hide(function () { 1475 that.$element.off('.' + that.type).removeData('bs.' + that.type) 1476 if (that.$tip) { 1477 that.$tip.detach() 1478 } 1479 that.$tip = null 1480 that.$arrow = null 1481 that.$viewport = null 1482 that.$element = null 1483 }) 1484 } 1485 1486 1487 // TOOLTIP PLUGIN DEFINITION 1488 // ========================= 1489 1490 function Plugin(option) { 1491 return this.each(function () { 1492 var $this = $(this) 1493 var data = $this.data('bs.tooltip') 1494 var options = typeof option == 'object' && option 1495 1496 if (!data && /destroy|hide/.test(option)) return 1497 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 1498 if (typeof option == 'string') data[option]() 1499 }) 1500 } 1501 1502 var old = $.fn.tooltip 1503 1504 $.fn.tooltip = Plugin 1505 $.fn.tooltip.Constructor = Tooltip 1506 1507 1508 // TOOLTIP NO CONFLICT 1509 // =================== 1510 1511 $.fn.tooltip.noConflict = function () { 1512 $.fn.tooltip = old 1513 return this 1514 } 1515 1516}(
vendor: 24,646 bytes, lines 1516-2394
1516bootstrapJQuery); 1517 1518/* ======================================================================== 1519 * Bootstrap: popover.js v3.3.7 1520 * http://getbootstrap.com/javascript/#popovers 1521 * ======================================================================== 1522 * Copyright 2011-2016 Twitter, Inc. 1523 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1524 * ======================================================================== */ 1525 1526 1527+function ($) { 1528 'use strict'; 1529 1530 // POPOVER PUBLIC CLASS DEFINITION 1531 // =============================== 1532 1533 var Popover = function (element, options) { 1534 this.init('popover', element, options) 1535 } 1536 1537 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') 1538 1539 Popover.VERSION = '3.3.7' 1540 1541 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { 1542 placement: 'right', 1543 trigger: 'click', 1544 content: '', 1545 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' 1546 }) 1547 1548 1549 // NOTE: POPOVER EXTENDS tooltip.js 1550 // ================================ 1551 1552 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) 1553 1554 Popover.prototype.constructor = Popover 1555 1556 Popover.prototype.getDefaults = function () { 1557 return Popover.DEFAULTS 1558 } 1559 1560 Popover.prototype.setContent = function () { 1561 var $tip = this.tip() 1562 var title = this.getTitle() 1563 var content = this.getContent() 1564 1565 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) 1566 $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events 1567 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' 1568 ](content) 1569 1570 $tip.removeClass('fade top bottom left right in') 1571 1572 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do 1573 // this manually by checking the contents. 1574 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() 1575 } 1576 1577 Popover.prototype.hasContent = function () { 1578 return this.getTitle() || this.getContent() 1579 } 1580 1581 Popover.prototype.getContent = function () { 1582 var $e = this.$element 1583 var o = this.options 1584 1585 return $e.attr('data-content') 1586 || (typeof o.content == 'function' ? 1587 o.content.call($e[0]) : 1588 o.content) 1589 } 1590 1591 Popover.prototype.arrow = function () { 1592 return (this.$arrow = this.$arrow || this.tip().find('.arrow')) 1593 } 1594 1595 1596 // POPOVER PLUGIN DEFINITION 1597 // ========================= 1598 1599 function Plugin(option) { 1600 return this.each(function () { 1601 var $this = $(this) 1602 var data = $this.data('bs.popover') 1603 var options = typeof option == 'object' && option 1604 1605 if (!data && /destroy|hide/.test(option)) return 1606 if (!data) $this.data('bs.popover', (data = new Popover(this, options))) 1607 if (typeof option == 'string') data[option]() 1608 }) 1609 } 1610 1611 var old = $.fn.popover 1612 1613 $.fn.popover = Plugin 1614 $.fn.popover.Constructor = Popover 1615 1616 1617 // POPOVER NO CONFLICT 1618 // =================== 1619 1620 $.fn.popover.noConflict = function () { 1621 $.fn.popover = old 1622 return this 1623 } 1624 1625}(bootstrapJQuery); 1626 1627/* ======================================================================== 1628 * Bootstrap: tab.js v3.3.7 1629 * http://getbootstrap.com/javascript/#tabs 1630 * ======================================================================== 1631 * Copyright 2011-2016 Twitter, Inc. 1632 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1633 * ======================================================================== */ 1634 1635 1636+function ($) { 1637 'use strict'; 1638 1639 // TAB CLASS DEFINITION 1640 // ==================== 1641 1642 var Tab = function (element) { 1643 // jscs:disable requireDollarBeforejQueryAssignment 1644 this.element = $(element) 1645 // jscs:enable requireDollarBeforejQueryAssignment 1646 } 1647 1648 Tab.VERSION = '3.3.7' 1649 1650 Tab.TRANSITION_DURATION = 150 1651 1652 Tab.prototype.show = function () { 1653 var $this = this.element 1654 var $ul = $this.closest('ul:not(.dropdown-menu)') 1655 var selector = $this.data('target') 1656 1657 if (!selector) { 1658 selector = $this.attr('href') 1659 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 1660 } 1661 1662 if ($this.parent('li').hasClass('active')) return 1663 1664 var $previous = $ul.find('.active:last a') 1665 var hideEvent = $.Event('hide.bs.tab', { 1666 relatedTarget: $this[0] 1667 }) 1668 var showEvent = $.Event('show.bs.tab', { 1669 relatedTarget: $previous[0] 1670 }) 1671 1672 $previous.trigger(hideEvent) 1673 $this.trigger(showEvent) 1674 1675 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return 1676 1677 var $target = $(selector) 1678 1679 this.activate($this.closest('li'), $ul) 1680 this.activate($target, $target.parent(), function () { 1681 $previous.trigger({ 1682 type: 'hidden.bs.tab', 1683 relatedTarget: $this[0] 1684 }) 1685 $this.trigger({ 1686 type: 'shown.bs.tab', 1687 relatedTarget: $previous[0] 1688 }) 1689 }) 1690 } 1691 1692 Tab.prototype.activate = function (element, container, callback) { 1693 var $active = container.find('> .active') 1694 var transition = callback 1695 && $.support.transition 1696 && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) 1697 1698 function next() { 1699 $active 1700 .removeClass('active') 1701 .find('> .dropdown-menu > .active') 1702 .removeClass('active') 1703 .end() 1704 .find('[data-toggle="tab"]') 1705 .attr('aria-expanded', false) 1706 1707 element 1708 .addClass('active') 1709 .find('[data-toggle="tab"]') 1710 .attr('aria-expanded', true) 1711 1712 if (transition) { 1713 element[0].offsetWidth // reflow for transition 1714 element.addClass('in') 1715 } else { 1716 element.removeClass('fade') 1717 } 1718 1719 if (element.parent('.dropdown-menu').length) { 1720 element 1721 .closest('li.dropdown') 1722 .addClass('active') 1723 .end() 1724 .find('[data-toggle="tab"]') 1725 .attr('aria-expanded', true) 1726 } 1727 1728 callback && callback() 1729 } 1730 1731 $active.length && transition ? 1732 $active 1733 .one('bsTransitionEnd', next) 1734 .emulateTransitionEnd(Tab.TRANSITION_DURATION) : 1735 next() 1736 1737 $active.removeClass('in') 1738 } 1739 1740 1741 // TAB PLUGIN DEFINITION 1742 // ===================== 1743 1744 function Plugin(option) { 1745 return this.each(function () { 1746 var $this = $(this) 1747 var data = $this.data('bs.tab') 1748 1749 if (!data) $this.data('bs.tab', (data = new Tab(this))) 1750 if (typeof option == 'string') data[option]() 1751 }) 1752 } 1753 1754 var old = $.fn.tab 1755 1756 $.fn.tab = Plugin 1757 $.fn.tab.Constructor = Tab 1758 1759 1760 // TAB NO CONFLICT 1761 // =============== 1762 1763 $.fn.tab.noConflict = function () { 1764 $.fn.tab = old 1765 return this 1766 } 1767 1768 1769 // TAB DATA-API 1770 // ============ 1771 1772 var clickHandler = function (e) { 1773 e.preventDefault() 1774 Plugin.call($(this), 'show') 1775 } 1776 1777 $(document) 1778 .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) 1779 .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) 1780 1781}(bootstrapJQuery); 1782 1783/* ======================================================================== 1784 * Bootstrap: affix.js v3.3.7 1785 * http://getbootstrap.com/javascript/#affix 1786 * ======================================================================== 1787 * Copyright 2011-2016 Twitter, Inc. 1788 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1789 * ======================================================================== */ 1790 1791 1792+function ($) { 1793 'use strict'; 1794 1795 // AFFIX CLASS DEFINITION 1796 // ====================== 1797 1798 var Affix = function (element, options) { 1799 this.options = $.extend({}, Affix.DEFAULTS, options) 1800 1801 this.$target = $(this.options.target) 1802 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) 1803 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) 1804 1805 this.$element = $(element) 1806 this.affixed = null 1807 this.unpin = null 1808 this.pinnedOffset = null 1809 1810 this.checkPosition() 1811 } 1812 1813 Affix.VERSION = '3.3.7' 1814 1815 Affix.RESET = 'affix affix-top affix-bottom' 1816 1817 Affix.DEFAULTS = { 1818 offset: 0, 1819 target: window 1820 } 1821 1822 Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { 1823 var scrollTop = this.$target.scrollTop() 1824 var position = this.$element.offset() 1825 var targetHeight = this.$target.height() 1826 1827 if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false 1828 1829 if (this.affixed == 'bottom') { 1830 if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' 1831 return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' 1832 } 1833 1834 var initializing = this.affixed == null 1835 var colliderTop = initializing ? scrollTop : position.top 1836 var colliderHeight = initializing ? targetHeight : height 1837 1838 if (offsetTop != null && scrollTop <= offsetTop) return 'top' 1839 if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' 1840 1841 return false 1842 } 1843 1844 Affix.prototype.getPinnedOffset = function () { 1845 if (this.pinnedOffset) return this.pinnedOffset 1846 this.$element.removeClass(Affix.RESET).addClass('affix') 1847 var scrollTop = this.$target.scrollTop() 1848 var position = this.$element.offset() 1849 return (this.pinnedOffset = position.top - scrollTop) 1850 } 1851 1852 Affix.prototype.checkPositionWithEventLoop = function () { 1853 setTimeout($.proxy(this.checkPosition, this), 1) 1854 } 1855 1856 Affix.prototype.checkPosition = function () { 1857 if (!this.$element.is(':visible')) return 1858 1859 var height = this.$element.height() 1860 var offset = this.options.offset 1861 var offsetTop = offset.top 1862 var offsetBottom = offset.bottom 1863 var scrollHeight = Math.max($(document).height(), $(document.body).height()) 1864 1865 if (typeof offset != 'object') offsetBottom = offsetTop = offset 1866 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) 1867 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) 1868 1869 var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) 1870 1871 if (this.affixed != affix) { 1872 if (this.unpin != null) this.$element.css('top', '') 1873 1874 var affixType = 'affix' + (affix ? '-' + affix : '') 1875 var e = $.Event(affixType + '.bs.affix') 1876 1877 this.$element.trigger(e) 1878 1879 if (e.isDefaultPrevented()) return 1880 1881 this.affixed = affix 1882 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null 1883 1884 this.$element 1885 .removeClass(Affix.RESET) 1886 .addClass(affixType) 1887 .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') 1888 } 1889 1890 if (affix == 'bottom') { 1891 this.$element.offset({ 1892 top: scrollHeight - height - offsetBottom 1893 }) 1894 } 1895 } 1896 1897 1898 // AFFIX PLUGIN DEFINITION 1899 // ======================= 1900 1901 function Plugin(option) { 1902 return this.each(function () { 1903 var $this = $(this) 1904 var data = $this.data('bs.affix') 1905 var options = typeof option == 'object' && option 1906 1907 if (!data) $this.data('bs.affix', (data = new Affix(this, options))) 1908 if (typeof option == 'string') data[option]() 1909 }) 1910 } 1911 1912 var old = $.fn.affix 1913 1914 $.fn.affix = Plugin 1915 $.fn.affix.Constructor = Affix 1916 1917 1918 // AFFIX NO CONFLICT 1919 // ================= 1920 1921 $.fn.affix.noConflict = function () { 1922 $.fn.affix = old 1923 return this 1924 } 1925 1926 1927 // AFFIX DATA-API 1928 // ============== 1929 1930 $(window).on('load', function () { 1931 $('[data-spy="affix"]').each(function () { 1932 var $spy = $(this) 1933 var data = $spy.data() 1934 1935 data.offset = data.offset || {} 1936 1937 if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom 1938 if (data.offsetTop != null) data.offset.top = data.offsetTop 1939 1940 Plugin.call($spy, data) 1941 }) 1942 }) 1943 1944}(bootstrapJQuery); 1945 1946/* ======================================================================== 1947 * Bootstrap: collapse.js v3.3.7 1948 * http://getbootstrap.com/javascript/#collapse 1949 * ======================================================================== 1950 * Copyright 2011-2016 Twitter, Inc. 1951 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1952 * ======================================================================== */ 1953 1954/* jshint latedef: false */ 1955 1956+function ($) { 1957 'use strict'; 1958 1959 // COLLAPSE PUBLIC CLASS DEFINITION 1960 // ================================ 1961 1962 var Collapse = function (element, options) { 1963 this.$element = $(element) 1964 this.options = $.extend({}, Collapse.DEFAULTS, options) 1965 this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + 1966 '[data-toggle="collapse"][data-target="#' + element.id + '"]') 1967 this.transitioning = null 1968 1969 if (this.options.parent) { 1970 this.$parent = this.getParent() 1971 } else { 1972 this.addAriaAndCollapsedClass(this.$element, this.$trigger) 1973 } 1974 1975 if (this.options.toggle) this.toggle() 1976 } 1977 1978 Collapse.VERSION = '3.3.7' 1979 1980 Collapse.TRANSITION_DURATION = 350 1981 1982 Collapse.DEFAULTS = { 1983 toggle: true 1984 } 1985 1986 Collapse.prototype.dimension = function () { 1987 var hasWidth = this.$element.hasClass('width') 1988 return hasWidth ? 'width' : 'height' 1989 } 1990 1991 Collapse.prototype.show = function () { 1992 if (this.transitioning || this.$element.hasClass('in')) return 1993 1994 var activesData 1995 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') 1996 1997 if (actives && actives.length) { 1998 activesData = actives.data('bs.collapse') 1999 if (activesData && activesData.transitioning) return 2000 } 2001 2002 var startEvent = $.Event('show.bs.collapse') 2003 this.$element.trigger(startEvent) 2004 if (startEvent.isDefaultPrevented()) return 2005 2006 if (actives && actives.length) { 2007 Plugin.call(actives, 'hide') 2008 activesData || actives.data('bs.collapse', null) 2009 } 2010 2011 var dimension = this.dimension() 2012 2013 this.$element 2014 .removeClass('collapse') 2015 .addClass('collapsing')[dimension](0) 2016 .attr('aria-expanded', true) 2017 2018 this.$trigger 2019 .removeClass("glyphicon-plus") 2020 .addClass("glyphicon-minus") 2021 .removeClass('collapsed') 2022 .attr('aria-expanded', true) 2023 2024 this.transitioning = 1 2025 2026 var complete = function () { 2027 this.$element 2028 .removeClass('collapsing') 2029 .addClass('collapse in')[dimension]('') 2030 this.transitioning = 0 2031 this.$element 2032 .trigger('shown.bs.collapse') 2033 } 2034 2035 if (!$.support.transition) return complete.call(this) 2036 2037 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 2038 2039 this.$element 2040 .one('bsTransitionEnd', $.proxy(complete, this)) 2041 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) 2042 } 2043 2044 Collapse.prototype.hide = function () { 2045 if (this.transitioning || !this.$element.hasClass('in')) return 2046 2047 var startEvent = $.Event('hide.bs.collapse') 2048 this.$element.trigger(startEvent) 2049 if (startEvent.isDefaultPrevented()) return 2050 2051 var dimension = this.dimension() 2052 2053 this.$element[dimension](this.$element[dimension]())[0].offsetHeight 2054 2055 this.$element 2056 .addClass('collapsing') 2057 .removeClass('collapse in') 2058 .attr('aria-expanded', false) 2059 2060 this.$trigger 2061 .removeClass("glyphicon-minus") 2062 .addClass("glyphicon-plus") 2063 .addClass('collapsed') 2064 .attr('aria-expanded', false) 2065 2066 this.transitioning = 1 2067 2068 var complete = function () { 2069 this.transitioning = 0 2070 this.$element 2071 .removeClass('collapsing') 2072 .addClass('collapse') 2073 .trigger('hidden.bs.collapse') 2074 } 2075 2076 if (!$.support.transition) return complete.call(this) 2077 2078 this.$element 2079 [dimension](0) 2080 .one('bsTransitionEnd', $.proxy(complete, this)) 2081 .emulateTransitionEnd(Collapse.TRANSITION_DURATION) 2082 } 2083 2084 Collapse.prototype.toggle = function () { 2085 this[this.$element.hasClass('in') ? 'hide' : 'show']() 2086 } 2087 2088 Collapse.prototype.getParent = function () { 2089 return $(this.options.parent) 2090 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') 2091 .each($.proxy(function (i, element) { 2092 var $element = $(element) 2093 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) 2094 }, this)) 2095 .end() 2096 } 2097 2098 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { 2099 var isOpen = $element.hasClass('in') 2100 2101 $element.attr('aria-expanded', isOpen) 2102 $trigger 2103 .toggleClass('collapsed', !isOpen) 2104 .attr('aria-expanded', isOpen) 2105 } 2106 2107 function getTargetFromTrigger($trigger) { 2108 var href 2109 var target = $trigger.attr('data-target') 2110 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 2111 2112 return $(target) 2113 } 2114 2115 2116 // COLLAPSE PLUGIN DEFINITION 2117 // ========================== 2118 2119 function Plugin(option) { 2120 return this.each(function () { 2121 var $this = $(this) 2122 var data = $this.data('bs.collapse') 2123 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 2124 2125 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false 2126 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 2127 if (typeof option == 'string') data[option]() 2128 }) 2129 } 2130 2131 var old = $.fn.collapse 2132 2133 $.fn.collapse = Plugin 2134 $.fn.collapse.Constructor = Collapse 2135 2136 2137 // COLLAPSE NO CONFLICT 2138 // ==================== 2139 2140 $.fn.collapse.noConflict = function () { 2141 $.fn.collapse = old 2142 return this 2143 } 2144 2145 2146 // COLLAPSE DATA-API 2147 // ================= 2148 2149 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { 2150 var $this = $(this) 2151 2152 if (!$this.attr('data-target')) e.preventDefault() 2153 2154 var $target = getTargetFromTrigger($this) 2155 var data = $target.data('bs.collapse') 2156 var option = data ? 'toggle' : $this.data() 2157 2158 Plugin.call($target, option) 2159 }) 2160 2161}(bootstrapJQuery); 2162 2163/* ======================================================================== 2164 * Bootstrap: scrollspy.js v3.3.7 2165 * http://getbootstrap.com/javascript/#scrollspy 2166 * ======================================================================== 2167 * Copyright 2011-2016 Twitter, Inc. 2168 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2169 * ======================================================================== */ 2170 2171 2172+function ($) { 2173 'use strict'; 2174 2175 // SCROLLSPY CLASS DEFINITION 2176 // ========================== 2177 2178 function ScrollSpy(element, options) { 2179 this.$body = $(document.body) 2180 this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) 2181 this.options = $.extend({}, ScrollSpy.DEFAULTS, options) 2182 this.selector = (this.options.target || '') + ' .nav li > a' 2183 this.offsets = [] 2184 this.targets = [] 2185 this.activeTarget = null 2186 this.scrollHeight = 0 2187 2188 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) 2189 this.refresh() 2190 this.process() 2191 } 2192 2193 ScrollSpy.VERSION = '3.3.7' 2194 2195 ScrollSpy.DEFAULTS = { 2196 offset: 10 2197 } 2198 2199 ScrollSpy.prototype.getScrollHeight = function () { 2200 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) 2201 } 2202 2203 ScrollSpy.prototype.refresh = function () { 2204 var that = this 2205 var offsetMethod = 'offset' 2206 var offsetBase = 0 2207 2208 this.offsets = [] 2209 this.targets = [] 2210 this.scrollHeight = this.getScrollHeight() 2211 2212 if (!$.isWindow(this.$scrollElement[0])) { 2213 offsetMethod = 'position' 2214 offsetBase = this.$scrollElement.scrollTop() 2215 } 2216 2217 this.$body 2218 .find(this.selector) 2219 .map(function () { 2220 var $el = $(this) 2221 var href = $el.data('target') || $el.attr('href') 2222 var $href = /^#./.test(href) && $(href) 2223 2224 return ($href 2225 && $href.length 2226 && $href.is(':visible') 2227 && [[$href[offsetMethod]().top + offsetBase, href]]) || null 2228 }) 2229 .sort(function (a, b) { return a[0] - b[0] }) 2230 .each(function () { 2231 that.offsets.push(this[0]) 2232 that.targets.push(this[1]) 2233 }) 2234 } 2235 2236 ScrollSpy.prototype.process = function () { 2237 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 2238 var scrollHeight = this.getScrollHeight() 2239 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() 2240 var offsets = this.offsets 2241 var targets = this.targets 2242 var activeTarget = this.activeTarget 2243 var i 2244 2245 if (this.scrollHeight != scrollHeight) { 2246 this.refresh() 2247 } 2248 2249 if (scrollTop >= maxScroll) { 2250 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) 2251 } 2252 2253 if (activeTarget && scrollTop < offsets[0]) { 2254 this.activeTarget = null 2255 return this.clear() 2256 } 2257 2258 for (i = offsets.length; i--;) { 2259 activeTarget != targets[i] 2260 && scrollTop >= offsets[i] 2261 && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) 2262 && this.activate(targets[i]) 2263 } 2264 } 2265 2266 ScrollSpy.prototype.activate = function (target) { 2267 this.activeTarget = target 2268 2269 this.clear() 2270 2271 var selector = this.selector + 2272 '[data-target="' + target + '"],' + 2273 this.selector + '[href="' + target + '"]' 2274 2275 var active = $(selector) 2276 .parents('li') 2277 .addClass('active') 2278 2279 if (active.parent('.dropdown-menu').length) { 2280 active = active 2281 .closest('li.dropdown') 2282 .addClass('active') 2283 } 2284 2285 active.trigger('activate.bs.scrollspy') 2286 } 2287 2288 ScrollSpy.prototype.clear = function () { 2289 $(this.selector) 2290 .parentsUntil(this.options.target, '.active') 2291 .removeClass('active') 2292 } 2293 2294 2295 // SCROLLSPY PLUGIN DEFINITION 2296 // =========================== 2297 2298 function Plugin(option) { 2299 return this.each(function () { 2300 var $this = $(this) 2301 var data = $this.data('bs.scrollspy') 2302 var options = typeof option == 'object' && option 2303 2304 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) 2305 if (typeof option == 'string') data[option]() 2306 }) 2307 } 2308 2309 var old = $.fn.scrollspy 2310 2311 $.fn.scrollspy = Plugin 2312 $.fn.scrollspy.Constructor = ScrollSpy 2313 2314 2315 // SCROLLSPY NO CONFLICT 2316 // ===================== 2317 2318 $.fn.scrollspy.noConflict = function () { 2319 $.fn.scrollspy = old 2320 return this 2321 } 2322 2323 2324 // SCROLLSPY DATA-API 2325 // ================== 2326 2327 $(window).on('load.bs.scrollspy.data-api', function () { 2328 $('[data-spy="scroll"]').each(function () { 2329 var $spy = $(this) 2330 Plugin.call($spy, $spy.data()) 2331 }) 2332 }) 2333 2334}(bootstrapJQuery); 2335 2336/* ======================================================================== 2337 * Bootstrap: transition.js v3.3.7 2338 * http://getbootstrap.com/javascript/#transitions 2339 * ======================================================================== 2340 * Copyright 2011-2016 Twitter, Inc. 2341 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2342 * ======================================================================== */ 2343 2344 2345+function ($) { 2346 'use strict'; 2347 2348 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 2349 // ============================================================ 2350 2351 function transitionEnd() { 2352 var el = document.createElement('bootstrap') 2353 2354 var transEndEventNames = { 2355 WebkitTransition : 'webkitTransitionEnd', 2356 MozTransition : 'transitionend', 2357 OTransition : 'oTransitionEnd otransitionend', 2358 transition : 'transitionend' 2359 } 2360 2361 for (var name in transEndEventNames) { 2362 if (el.style[name] !== undefined) { 2363 return { end: transEndEventNames[name] } 2364 } 2365 } 2366 2367 return false // explicit for ie8 ( ._.) 2368 } 2369 2370 // http://blog.alexmaccaw.com/css-transitions 2371 $.fn.emulateTransitionEnd = function (duration) { 2372 var called = false 2373 var $el = this 2374 $(this).one('bsTransitionEnd', function () { called = true }) 2375 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 2376 setTimeout(callback, duration) 2377 return this 2378 } 2379 2380 $(function () { 2381 $.support.transition = transitionEnd() 2382 2383 if (!$.support.transition) return 2384 2385 $.event.special.bsTransitionEnd = { 2386 bindType: $.support.transition.end, 2387 delegateType: $.support.transition.end, 2388 handle: function (e) { 2389 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 2390 } 2391 } 2392 }) 2393 2394}(bootstrapJQuery);
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.