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