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