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