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