2 * Bootstrap v3.3.7 (http://getbootstrap.com)
3 * Copyright 2011-2016 Twitter, Inc.
4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
8 * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=a8e01e20fdf5ffe2a0df475294b45f64)
9 * Config saved to config.json and https://gist.github.com/a8e01e20fdf5ffe2a0df475294b45f64
11 if (typeof jQuery === 'undefined') {
12 throw new Error('Bootstrap\'s JavaScript requires jQuery')
16 var version = $.fn.jquery.split(' ')[0].split('.')
17 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
18 throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
22 /* ========================================================================
23 * Bootstrap: alert.js v3.3.7
24 * http://getbootstrap.com/javascript/#alerts
25 * ========================================================================
26 * Copyright 2011-2016 Twitter, Inc.
27 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
28 * ======================================================================== */
34 // ALERT CLASS DEFINITION
35 // ======================
37 var dismiss = '[data-dismiss="alert"]'
38 var Alert = function (el) {
39 $(el).on('click', dismiss, this.close)
42 Alert.VERSION = '3.3.7'
44 Alert.TRANSITION_DURATION = 150
46 Alert.prototype.close = function (e) {
48 var selector = $this.attr('data-target')
51 selector = $this.attr('href')
52 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
55 var $parent = $(selector === '#' ? [] : selector)
57 if (e) e.preventDefault()
59 if (!$parent.length) {
60 $parent = $this.closest('.alert')
63 $parent.trigger(e = $.Event('close.bs.alert'))
65 if (e.isDefaultPrevented()) return
67 $parent.removeClass('in')
69 function removeElement() {
70 // detach from parent, fire event then clean up data
71 $parent.detach().trigger('closed.bs.alert').remove()
74 $.support.transition && $parent.hasClass('fade') ?
76 .one('bsTransitionEnd', removeElement)
77 .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
82 // ALERT PLUGIN DEFINITION
83 // =======================
85 function Plugin(option) {
86 return this.each(function () {
88 var data = $this.data('bs.alert')
90 if (!data) $this.data('bs.alert', (data = new Alert(this)))
91 if (typeof option == 'string') data[option].call($this)
98 $.fn.alert.Constructor = Alert
104 $.fn.alert.noConflict = function () {
113 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
117 /* ========================================================================
118 * Bootstrap: button.js v3.3.7
119 * http://getbootstrap.com/javascript/#buttons
120 * ========================================================================
121 * Copyright 2011-2016 Twitter, Inc.
122 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
123 * ======================================================================== */
129 // BUTTON PUBLIC CLASS DEFINITION
130 // ==============================
132 var Button = function (element, options) {
133 this.$element = $(element)
134 this.options = $.extend({}, Button.DEFAULTS, options)
135 this.isLoading = false
138 Button.VERSION = '3.3.7'
141 loadingText: 'loading...'
144 Button.prototype.setState = function (state) {
146 var $el = this.$element
147 var val = $el.is('input') ? 'val' : 'html'
148 var data = $el.data()
152 if (data.resetText == null) $el.data('resetText', $el[val]())
154 // push to event loop to allow forms to submit
155 setTimeout($.proxy(function () {
156 $el[val](data[state] == null ? this.options[state] : data[state])
158 if (state == 'loadingText') {
159 this.isLoading = true
160 $el.addClass(d).attr(d, d).prop(d, true)
161 } else if (this.isLoading) {
162 this.isLoading = false
163 $el.removeClass(d).removeAttr(d).prop(d, false)
168 Button.prototype.toggle = function () {
170 var $parent = this.$element.closest('[data-toggle="buttons"]')
172 if ($parent.length) {
173 var $input = this.$element.find('input')
174 if ($input.prop('type') == 'radio') {
175 if ($input.prop('checked')) changed = false
176 $parent.find('.active').removeClass('active')
177 this.$element.addClass('active')
178 } else if ($input.prop('type') == 'checkbox') {
179 if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
180 this.$element.toggleClass('active')
182 $input.prop('checked', this.$element.hasClass('active'))
183 if (changed) $input.trigger('change')
185 this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
186 this.$element.toggleClass('active')
191 // BUTTON PLUGIN DEFINITION
192 // ========================
194 function Plugin(option) {
195 return this.each(function () {
197 var data = $this.data('bs.button')
198 var options = typeof option == 'object' && option
200 if (!data) $this.data('bs.button', (data = new Button(this, options)))
202 if (option == 'toggle') data.toggle()
203 else if (option) data.setState(option)
207 var old = $.fn.button
210 $.fn.button.Constructor = Button
213 // BUTTON NO CONFLICT
214 // ==================
216 $.fn.button.noConflict = function () {
226 .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
227 var $btn = $(e.target).closest('.btn')
228 Plugin.call($btn, 'toggle')
229 if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
230 // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
232 // The target component still receive the focus
233 if ($btn.is('input,button')) $btn.trigger('focus')
234 else $btn.find('input:visible,button:visible').first().trigger('focus')
237 .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
238 $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
243 /* ========================================================================
244 * Bootstrap: carousel.js v3.3.7
245 * http://getbootstrap.com/javascript/#carousel
246 * ========================================================================
247 * Copyright 2011-2016 Twitter, Inc.
248 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
249 * ======================================================================== */
255 // CAROUSEL CLASS DEFINITION
256 // =========================
258 var Carousel = function (element, options) {
259 this.$element = $(element)
260 this.$indicators = this.$element.find('.carousel-indicators')
261 this.options = options
268 this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
270 this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
271 .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
272 .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
275 Carousel.VERSION = '3.3.7'
277 Carousel.TRANSITION_DURATION = 600
279 Carousel.DEFAULTS = {
286 Carousel.prototype.keydown = function (e) {
287 if (/input|textarea/i.test(e.target.tagName)) return
289 case 37: this.prev(); break
290 case 39: this.next(); break
297 Carousel.prototype.cycle = function (e) {
298 e || (this.paused = false)
300 this.interval && clearInterval(this.interval)
302 this.options.interval
304 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
309 Carousel.prototype.getItemIndex = function (item) {
310 this.$items = item.parent().children('.item')
311 return this.$items.index(item || this.$active)
314 Carousel.prototype.getItemForDirection = function (direction, active) {
315 var activeIndex = this.getItemIndex(active)
316 var willWrap = (direction == 'prev' && activeIndex === 0)
317 || (direction == 'next' && activeIndex == (this.$items.length - 1))
318 if (willWrap && !this.options.wrap) return active
319 var delta = direction == 'prev' ? -1 : 1
320 var itemIndex = (activeIndex + delta) % this.$items.length
321 return this.$items.eq(itemIndex)
324 Carousel.prototype.to = function (pos) {
326 var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
328 if (pos > (this.$items.length - 1) || pos < 0) return
330 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
331 if (activeIndex == pos) return this.pause().cycle()
333 return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
336 Carousel.prototype.pause = function (e) {
337 e || (this.paused = true)
339 if (this.$element.find('.next, .prev').length && $.support.transition) {
340 this.$element.trigger($.support.transition.end)
344 this.interval = clearInterval(this.interval)
349 Carousel.prototype.next = function () {
350 if (this.sliding) return
351 return this.slide('next')
354 Carousel.prototype.prev = function () {
355 if (this.sliding) return
356 return this.slide('prev')
359 Carousel.prototype.slide = function (type, next) {
360 var $active = this.$element.find('.item.active')
361 var $next = next || this.getItemForDirection(type, $active)
362 var isCycling = this.interval
363 var direction = type == 'next' ? 'left' : 'right'
366 if ($next.hasClass('active')) return (this.sliding = false)
368 var relatedTarget = $next[0]
369 var slideEvent = $.Event('slide.bs.carousel', {
370 relatedTarget: relatedTarget,
373 this.$element.trigger(slideEvent)
374 if (slideEvent.isDefaultPrevented()) return
378 isCycling && this.pause()
380 if (this.$indicators.length) {
381 this.$indicators.find('.active').removeClass('active')
382 var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
383 $nextIndicator && $nextIndicator.addClass('active')
386 var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
387 if ($.support.transition && this.$element.hasClass('slide')) {
389 $next[0].offsetWidth // force reflow
390 $active.addClass(direction)
391 $next.addClass(direction)
393 .one('bsTransitionEnd', function () {
394 $next.removeClass([type, direction].join(' ')).addClass('active')
395 $active.removeClass(['active', direction].join(' '))
397 setTimeout(function () {
398 that.$element.trigger(slidEvent)
401 .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
403 $active.removeClass('active')
404 $next.addClass('active')
406 this.$element.trigger(slidEvent)
409 isCycling && this.cycle()
415 // CAROUSEL PLUGIN DEFINITION
416 // ==========================
418 function Plugin(option) {
419 return this.each(function () {
421 var data = $this.data('bs.carousel')
422 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
423 var action = typeof option == 'string' ? option : options.slide
425 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
426 if (typeof option == 'number') data.to(option)
427 else if (action) data[action]()
428 else if (options.interval) data.pause().cycle()
432 var old = $.fn.carousel
434 $.fn.carousel = Plugin
435 $.fn.carousel.Constructor = Carousel
438 // CAROUSEL NO CONFLICT
439 // ====================
441 $.fn.carousel.noConflict = function () {
450 var clickHandler = function (e) {
453 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
454 if (!$target.hasClass('carousel')) return
455 var options = $.extend({}, $target.data(), $this.data())
456 var slideIndex = $this.attr('data-slide-to')
457 if (slideIndex) options.interval = false
459 Plugin.call($target, options)
462 $target.data('bs.carousel').to(slideIndex)
469 .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
470 .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
472 $(window).on('load', function () {
473 $('[data-ride="carousel"]').each(function () {
474 var $carousel = $(this)
475 Plugin.call($carousel, $carousel.data())
481 /* ========================================================================
482 * Bootstrap: dropdown.js v3.3.7
483 * http://getbootstrap.com/javascript/#dropdowns
484 * ========================================================================
485 * Copyright 2011-2016 Twitter, Inc.
486 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
487 * ======================================================================== */
493 // DROPDOWN CLASS DEFINITION
494 // =========================
496 var backdrop = '.dropdown-backdrop'
497 var toggle = '[data-toggle="dropdown"]'
498 var Dropdown = function (element) {
499 $(element).on('click.bs.dropdown', this.toggle)
502 Dropdown.VERSION = '3.3.7'
504 function getParent($this) {
505 var selector = $this.attr('data-target')
508 selector = $this.attr('href')
509 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
512 var $parent = selector && $(selector)
514 return $parent && $parent.length ? $parent : $this.parent()
517 function clearMenus(e) {
518 if (e && e.which === 3) return
520 $(toggle).each(function () {
522 var $parent = getParent($this)
523 var relatedTarget = { relatedTarget: this }
525 if (!$parent.hasClass('open')) return
527 if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
529 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
531 if (e.isDefaultPrevented()) return
533 $this.attr('aria-expanded', 'false')
534 $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
538 Dropdown.prototype.toggle = function (e) {
541 if ($this.is('.disabled, :disabled')) return
543 var $parent = getParent($this)
544 var isActive = $parent.hasClass('open')
549 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
550 // if mobile we use a backdrop because click events don't delegate
551 $(document.createElement('div'))
552 .addClass('dropdown-backdrop')
553 .insertAfter($(this))
554 .on('click', clearMenus)
557 var relatedTarget = { relatedTarget: this }
558 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
560 if (e.isDefaultPrevented()) return
564 .attr('aria-expanded', 'true')
568 .trigger($.Event('shown.bs.dropdown', relatedTarget))
574 Dropdown.prototype.keydown = function (e) {
575 if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
582 if ($this.is('.disabled, :disabled')) return
584 var $parent = getParent($this)
585 var isActive = $parent.hasClass('open')
587 if (!isActive && e.which != 27 || isActive && e.which == 27) {
588 if (e.which == 27) $parent.find(toggle).trigger('focus')
589 return $this.trigger('click')
592 var desc = ' li:not(.disabled):visible a'
593 var $items = $parent.find('.dropdown-menu' + desc)
595 if (!$items.length) return
597 var index = $items.index(e.target)
599 if (e.which == 38 && index > 0) index-- // up
600 if (e.which == 40 && index < $items.length - 1) index++ // down
601 if (!~index) index = 0
603 $items.eq(index).trigger('focus')
607 // DROPDOWN PLUGIN DEFINITION
608 // ==========================
610 function Plugin(option) {
611 return this.each(function () {
613 var data = $this.data('bs.dropdown')
615 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
616 if (typeof option == 'string') data[option].call($this)
620 var old = $.fn.dropdown
622 $.fn.dropdown = Plugin
623 $.fn.dropdown.Constructor = Dropdown
626 // DROPDOWN NO CONFLICT
627 // ====================
629 $.fn.dropdown.noConflict = function () {
635 // APPLY TO STANDARD DROPDOWN ELEMENTS
636 // ===================================
639 .on('click.bs.dropdown.data-api', clearMenus)
640 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
641 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
642 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
643 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
647 /* ========================================================================
648 * Bootstrap: modal.js v3.3.7
649 * http://getbootstrap.com/javascript/#modals
650 * ========================================================================
651 * Copyright 2011-2016 Twitter, Inc.
652 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
653 * ======================================================================== */
659 // MODAL CLASS DEFINITION
660 // ======================
662 var Modal = function (element, options) {
663 this.options = options
664 this.$body = $(document.body)
665 this.$element = $(element)
666 this.$dialog = this.$element.find('.modal-dialog')
667 this.$backdrop = null
669 this.originalBodyPad = null
670 this.scrollbarWidth = 0
671 this.ignoreBackdropClick = false
673 if (this.options.remote) {
675 .find('.modal-content')
676 .load(this.options.remote, $.proxy(function () {
677 this.$element.trigger('loaded.bs.modal')
682 Modal.VERSION = '3.3.7'
684 Modal.TRANSITION_DURATION = 300
685 Modal.BACKDROP_TRANSITION_DURATION = 150
693 Modal.prototype.toggle = function (_relatedTarget) {
694 return this.isShown ? this.hide() : this.show(_relatedTarget)
697 Modal.prototype.show = function (_relatedTarget) {
699 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
701 this.$element.trigger(e)
703 if (this.isShown || e.isDefaultPrevented()) return
707 this.checkScrollbar()
709 this.$body.addClass('modal-open')
714 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
716 this.$dialog.on('mousedown.dismiss.bs.modal', function () {
717 that.$element.one('mouseup.dismiss.bs.modal', function (e) {
718 if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
722 this.backdrop(function () {
723 var transition = $.support.transition && that.$element.hasClass('fade')
725 if (!that.$element.parent().length) {
726 that.$element.appendTo(that.$body) // don't move modals dom position
736 that.$element[0].offsetWidth // force reflow
739 that.$element.addClass('in')
743 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
746 that.$dialog // wait for modal to slide in
747 .one('bsTransitionEnd', function () {
748 that.$element.trigger('focus').trigger(e)
750 .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
751 that.$element.trigger('focus').trigger(e)
755 Modal.prototype.hide = function (e) {
756 if (e) e.preventDefault()
758 e = $.Event('hide.bs.modal')
760 this.$element.trigger(e)
762 if (!this.isShown || e.isDefaultPrevented()) return
769 $(document).off('focusin.bs.modal')
773 .off('click.dismiss.bs.modal')
774 .off('mouseup.dismiss.bs.modal')
776 this.$dialog.off('mousedown.dismiss.bs.modal')
778 $.support.transition && this.$element.hasClass('fade') ?
780 .one('bsTransitionEnd', $.proxy(this.hideModal, this))
781 .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
785 Modal.prototype.enforceFocus = function () {
787 .off('focusin.bs.modal') // guard against infinite focus loop
788 .on('focusin.bs.modal', $.proxy(function (e) {
789 if (document !== e.target &&
790 this.$element[0] !== e.target &&
791 !this.$element.has(e.target).length) {
792 this.$element.trigger('focus')
797 Modal.prototype.escape = function () {
798 if (this.isShown && this.options.keyboard) {
799 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
800 e.which == 27 && this.hide()
802 } else if (!this.isShown) {
803 this.$element.off('keydown.dismiss.bs.modal')
807 Modal.prototype.resize = function () {
809 $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
811 $(window).off('resize.bs.modal')
815 Modal.prototype.hideModal = function () {
818 this.backdrop(function () {
819 that.$body.removeClass('modal-open')
820 that.resetAdjustments()
821 that.resetScrollbar()
822 that.$element.trigger('hidden.bs.modal')
826 Modal.prototype.removeBackdrop = function () {
827 this.$backdrop && this.$backdrop.remove()
828 this.$backdrop = null
831 Modal.prototype.backdrop = function (callback) {
833 var animate = this.$element.hasClass('fade') ? 'fade' : ''
835 if (this.isShown && this.options.backdrop) {
836 var doAnimate = $.support.transition && animate
838 this.$backdrop = $(document.createElement('div'))
839 .addClass('modal-backdrop ' + animate)
840 .appendTo(this.$body)
842 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
843 if (this.ignoreBackdropClick) {
844 this.ignoreBackdropClick = false
847 if (e.target !== e.currentTarget) return
848 this.options.backdrop == 'static'
849 ? this.$element[0].focus()
853 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
855 this.$backdrop.addClass('in')
857 if (!callback) return
861 .one('bsTransitionEnd', callback)
862 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
865 } else if (!this.isShown && this.$backdrop) {
866 this.$backdrop.removeClass('in')
868 var callbackRemove = function () {
869 that.removeBackdrop()
870 callback && callback()
872 $.support.transition && this.$element.hasClass('fade') ?
874 .one('bsTransitionEnd', callbackRemove)
875 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
878 } else if (callback) {
883 // these following methods are used to handle overflowing modals
885 Modal.prototype.handleUpdate = function () {
889 Modal.prototype.adjustDialog = function () {
890 var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
893 paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
894 paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
898 Modal.prototype.resetAdjustments = function () {
905 Modal.prototype.checkScrollbar = function () {
906 var fullWindowWidth = window.innerWidth
907 if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
908 var documentElementRect = document.documentElement.getBoundingClientRect()
909 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
911 this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
912 this.scrollbarWidth = this.measureScrollbar()
915 Modal.prototype.setScrollbar = function () {
916 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
917 this.originalBodyPad = document.body.style.paddingRight || ''
918 if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
921 Modal.prototype.resetScrollbar = function () {
922 this.$body.css('padding-right', this.originalBodyPad)
925 Modal.prototype.measureScrollbar = function () { // thx walsh
926 var scrollDiv = document.createElement('div')
927 scrollDiv.className = 'modal-scrollbar-measure'
928 this.$body.append(scrollDiv)
929 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
930 this.$body[0].removeChild(scrollDiv)
931 return scrollbarWidth
935 // MODAL PLUGIN DEFINITION
936 // =======================
938 function Plugin(option, _relatedTarget) {
939 return this.each(function () {
941 var data = $this.data('bs.modal')
942 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
944 if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
945 if (typeof option == 'string') data[option](_relatedTarget)
946 else if (options.show) data.show(_relatedTarget)
953 $.fn.modal.Constructor = Modal
959 $.fn.modal.noConflict = function () {
968 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
970 var href = $this.attr('href')
971 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
972 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
974 if ($this.is('a')) e.preventDefault()
976 $target.one('show.bs.modal', function (showEvent) {
977 if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
978 $target.one('hidden.bs.modal', function () {
979 $this.is(':visible') && $this.trigger('focus')
982 Plugin.call($target, option, this)
987 /* ========================================================================
988 * Bootstrap: tooltip.js v3.3.7
989 * http://getbootstrap.com/javascript/#tooltip
990 * Inspired by the original jQuery.tipsy by Jason Frame
991 * ========================================================================
992 * Copyright 2011-2016 Twitter, Inc.
993 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
994 * ======================================================================== */
1000 // TOOLTIP PUBLIC CLASS DEFINITION
1001 // ===============================
1003 var Tooltip = function (element, options) {
1008 this.hoverState = null
1009 this.$element = null
1012 this.init('tooltip', element, options)
1015 Tooltip.VERSION = '3.3.7'
1017 Tooltip.TRANSITION_DURATION = 150
1019 Tooltip.DEFAULTS = {
1023 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1024 trigger: 'hover focus',
1035 Tooltip.prototype.init = function (type, element, options) {
1038 this.$element = $(element)
1039 this.options = this.getOptions(options)
1040 this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
1041 this.inState = { click: false, hover: false, focus: false }
1043 if (this.$element[0] instanceof document.constructor && !this.options.selector) {
1044 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
1047 var triggers = this.options.trigger.split(' ')
1049 for (var i = triggers.length; i--;) {
1050 var trigger = triggers[i]
1052 if (trigger == 'click') {
1053 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1054 } else if (trigger != 'manual') {
1055 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
1056 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1058 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1059 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1063 this.options.selector ?
1064 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1068 Tooltip.prototype.getDefaults = function () {
1069 return Tooltip.DEFAULTS
1072 Tooltip.prototype.getOptions = function (options) {
1073 options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1075 if (options.delay && typeof options.delay == 'number') {
1077 show: options.delay,
1085 Tooltip.prototype.getDelegateOptions = function () {
1087 var defaults = this.getDefaults()
1089 this._options && $.each(this._options, function (key, value) {
1090 if (defaults[key] != value) options[key] = value
1096 Tooltip.prototype.enter = function (obj) {
1097 var self = obj instanceof this.constructor ?
1098 obj : $(obj.currentTarget).data('bs.' + this.type)
1101 self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1102 $(obj.currentTarget).data('bs.' + this.type, self)
1105 if (obj instanceof $.Event) {
1106 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
1109 if (self.tip().hasClass('in') || self.hoverState == 'in') {
1110 self.hoverState = 'in'
1114 clearTimeout(self.timeout)
1116 self.hoverState = 'in'
1118 if (!self.options.delay || !self.options.delay.show) return self.show()
1120 self.timeout = setTimeout(function () {
1121 if (self.hoverState == 'in') self.show()
1122 }, self.options.delay.show)
1125 Tooltip.prototype.isInStateTrue = function () {
1126 for (var key in this.inState) {
1127 if (this.inState[key]) return true
1133 Tooltip.prototype.leave = function (obj) {
1134 var self = obj instanceof this.constructor ?
1135 obj : $(obj.currentTarget).data('bs.' + this.type)
1138 self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1139 $(obj.currentTarget).data('bs.' + this.type, self)
1142 if (obj instanceof $.Event) {
1143 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
1146 if (self.isInStateTrue()) return
1148 clearTimeout(self.timeout)
1150 self.hoverState = 'out'
1152 if (!self.options.delay || !self.options.delay.hide) return self.hide()
1154 self.timeout = setTimeout(function () {
1155 if (self.hoverState == 'out') self.hide()
1156 }, self.options.delay.hide)
1159 Tooltip.prototype.show = function () {
1160 var e = $.Event('show.bs.' + this.type)
1162 if (this.hasContent() && this.enabled) {
1163 this.$element.trigger(e)
1165 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
1166 if (e.isDefaultPrevented() || !inDom) return
1169 var $tip = this.tip()
1171 var tipId = this.getUID(this.type)
1174 $tip.attr('id', tipId)
1175 this.$element.attr('aria-describedby', tipId)
1177 if (this.options.animation) $tip.addClass('fade')
1179 var placement = typeof this.options.placement == 'function' ?
1180 this.options.placement.call(this, $tip[0], this.$element[0]) :
1181 this.options.placement
1183 var autoToken = /\s?auto?\s?/i
1184 var autoPlace = autoToken.test(placement)
1185 if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
1189 .css({ top: 0, left: 0, display: 'block' })
1190 .addClass(placement)
1191 .data('bs.' + this.type, this)
1193 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1194 this.$element.trigger('inserted.bs.' + this.type)
1196 var pos = this.getPosition()
1197 var actualWidth = $tip[0].offsetWidth
1198 var actualHeight = $tip[0].offsetHeight
1201 var orgPlacement = placement
1202 var viewportDim = this.getPosition(this.$viewport)
1204 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
1205 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
1206 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
1207 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
1211 .removeClass(orgPlacement)
1212 .addClass(placement)
1215 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1217 this.applyPlacement(calculatedOffset, placement)
1219 var complete = function () {
1220 var prevHoverState = that.hoverState
1221 that.$element.trigger('shown.bs.' + that.type)
1222 that.hoverState = null
1224 if (prevHoverState == 'out') that.leave(that)
1227 $.support.transition && this.$tip.hasClass('fade') ?
1229 .one('bsTransitionEnd', complete)
1230 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1235 Tooltip.prototype.applyPlacement = function (offset, placement) {
1236 var $tip = this.tip()
1237 var width = $tip[0].offsetWidth
1238 var height = $tip[0].offsetHeight
1240 // manually read margins because getBoundingClientRect includes difference
1241 var marginTop = parseInt($tip.css('margin-top'), 10)
1242 var marginLeft = parseInt($tip.css('margin-left'), 10)
1244 // we must check for NaN for ie 8/9
1245 if (isNaN(marginTop)) marginTop = 0
1246 if (isNaN(marginLeft)) marginLeft = 0
1248 offset.top += marginTop
1249 offset.left += marginLeft
1251 // $.fn.offset doesn't round pixel values
1252 // so we use setOffset directly with our own function B-0
1253 $.offset.setOffset($tip[0], $.extend({
1254 using: function (props) {
1256 top: Math.round(props.top),
1257 left: Math.round(props.left)
1264 // check to see if placing tip in new offset caused the tip to resize itself
1265 var actualWidth = $tip[0].offsetWidth
1266 var actualHeight = $tip[0].offsetHeight
1268 if (placement == 'top' && actualHeight != height) {
1269 offset.top = offset.top + height - actualHeight
1272 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
1274 if (delta.left) offset.left += delta.left
1275 else offset.top += delta.top
1277 var isVertical = /top|bottom/.test(placement)
1278 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
1279 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
1282 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
1285 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
1287 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1288 .css(isVertical ? 'top' : 'left', '')
1291 Tooltip.prototype.setContent = function () {
1292 var $tip = this.tip()
1293 var title = this.getTitle()
1295 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1296 $tip.removeClass('fade in top bottom left right')
1299 Tooltip.prototype.hide = function (callback) {
1301 var $tip = $(this.$tip)
1302 var e = $.Event('hide.bs.' + this.type)
1304 function complete() {
1305 if (that.hoverState != 'in') $tip.detach()
1306 if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
1308 .removeAttr('aria-describedby')
1309 .trigger('hidden.bs.' + that.type)
1311 callback && callback()
1314 this.$element.trigger(e)
1316 if (e.isDefaultPrevented()) return
1318 $tip.removeClass('in')
1320 $.support.transition && $tip.hasClass('fade') ?
1322 .one('bsTransitionEnd', complete)
1323 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1326 this.hoverState = null
1331 Tooltip.prototype.fixTitle = function () {
1332 var $e = this.$element
1333 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
1334 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1338 Tooltip.prototype.hasContent = function () {
1339 return this.getTitle()
1342 Tooltip.prototype.getPosition = function ($element) {
1343 $element = $element || this.$element
1345 var el = $element[0]
1346 var isBody = el.tagName == 'BODY'
1348 var elRect = el.getBoundingClientRect()
1349 if (elRect.width == null) {
1350 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
1351 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
1353 var isSvg = window.SVGElement && el instanceof window.SVGElement
1354 // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
1355 // See https://github.com/twbs/bootstrap/issues/20280
1356 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
1357 var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
1358 var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
1360 return $.extend({}, elRect, scroll, outerDims, elOffset)
1363 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1364 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1365 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1366 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1367 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
1371 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
1372 var delta = { top: 0, left: 0 }
1373 if (!this.$viewport) return delta
1375 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
1376 var viewportDimensions = this.getPosition(this.$viewport)
1378 if (/right|left/.test(placement)) {
1379 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
1380 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
1381 if (topEdgeOffset < viewportDimensions.top) { // top overflow
1382 delta.top = viewportDimensions.top - topEdgeOffset
1383 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
1384 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
1387 var leftEdgeOffset = pos.left - viewportPadding
1388 var rightEdgeOffset = pos.left + viewportPadding + actualWidth
1389 if (leftEdgeOffset < viewportDimensions.left) { // left overflow
1390 delta.left = viewportDimensions.left - leftEdgeOffset
1391 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
1392 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
1399 Tooltip.prototype.getTitle = function () {
1401 var $e = this.$element
1402 var o = this.options
1404 title = $e.attr('data-original-title')
1405 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1410 Tooltip.prototype.getUID = function (prefix) {
1411 do prefix += ~~(Math.random() * 1000000)
1412 while (document.getElementById(prefix))
1416 Tooltip.prototype.tip = function () {
1418 this.$tip = $(this.options.template)
1419 if (this.$tip.length != 1) {
1420 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
1426 Tooltip.prototype.arrow = function () {
1427 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
1430 Tooltip.prototype.enable = function () {
1434 Tooltip.prototype.disable = function () {
1435 this.enabled = false
1438 Tooltip.prototype.toggleEnabled = function () {
1439 this.enabled = !this.enabled
1442 Tooltip.prototype.toggle = function (e) {
1445 self = $(e.currentTarget).data('bs.' + this.type)
1447 self = new this.constructor(e.currentTarget, this.getDelegateOptions())
1448 $(e.currentTarget).data('bs.' + this.type, self)
1453 self.inState.click = !self.inState.click
1454 if (self.isInStateTrue()) self.enter(self)
1455 else self.leave(self)
1457 self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1461 Tooltip.prototype.destroy = function () {
1463 clearTimeout(this.timeout)
1464 this.hide(function () {
1465 that.$element.off('.' + that.type).removeData('bs.' + that.type)
1471 that.$viewport = null
1472 that.$element = null
1477 // TOOLTIP PLUGIN DEFINITION
1478 // =========================
1480 function Plugin(option) {
1481 return this.each(function () {
1483 var data = $this.data('bs.tooltip')
1484 var options = typeof option == 'object' && option
1486 if (!data && /destroy|hide/.test(option)) return
1487 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1488 if (typeof option == 'string') data[option]()
1492 var old = $.fn.tooltip
1494 $.fn.tooltip = Plugin
1495 $.fn.tooltip.Constructor = Tooltip
1498 // TOOLTIP NO CONFLICT
1499 // ===================
1501 $.fn.tooltip.noConflict = function () {
1508 /* ========================================================================
1509 * Bootstrap: popover.js v3.3.7
1510 * http://getbootstrap.com/javascript/#popovers
1511 * ========================================================================
1512 * Copyright 2011-2016 Twitter, Inc.
1513 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1514 * ======================================================================== */
1520 // POPOVER PUBLIC CLASS DEFINITION
1521 // ===============================
1523 var Popover = function (element, options) {
1524 this.init('popover', element, options)
1527 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1529 Popover.VERSION = '3.3.7'
1531 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1535 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1539 // NOTE: POPOVER EXTENDS tooltip.js
1540 // ================================
1542 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
1544 Popover.prototype.constructor = Popover
1546 Popover.prototype.getDefaults = function () {
1547 return Popover.DEFAULTS
1550 Popover.prototype.setContent = function () {
1551 var $tip = this.tip()
1552 var title = this.getTitle()
1553 var content = this.getContent()
1555 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1556 $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
1557 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1560 $tip.removeClass('fade top bottom left right in')
1562 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1563 // this manually by checking the contents.
1564 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
1567 Popover.prototype.hasContent = function () {
1568 return this.getTitle() || this.getContent()
1571 Popover.prototype.getContent = function () {
1572 var $e = this.$element
1573 var o = this.options
1575 return $e.attr('data-content')
1576 || (typeof o.content == 'function' ?
1577 o.content.call($e[0]) :
1581 Popover.prototype.arrow = function () {
1582 return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
1586 // POPOVER PLUGIN DEFINITION
1587 // =========================
1589 function Plugin(option) {
1590 return this.each(function () {
1592 var data = $this.data('bs.popover')
1593 var options = typeof option == 'object' && option
1595 if (!data && /destroy|hide/.test(option)) return
1596 if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1597 if (typeof option == 'string') data[option]()
1601 var old = $.fn.popover
1603 $.fn.popover = Plugin
1604 $.fn.popover.Constructor = Popover
1607 // POPOVER NO CONFLICT
1608 // ===================
1610 $.fn.popover.noConflict = function () {
1617 /* ========================================================================
1618 * Bootstrap: tab.js v3.3.7
1619 * http://getbootstrap.com/javascript/#tabs
1620 * ========================================================================
1621 * Copyright 2011-2016 Twitter, Inc.
1622 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1623 * ======================================================================== */
1629 // TAB CLASS DEFINITION
1630 // ====================
1632 var Tab = function (element) {
1633 // jscs:disable requireDollarBeforejQueryAssignment
1634 this.element = $(element)
1635 // jscs:enable requireDollarBeforejQueryAssignment
1638 Tab.VERSION = '3.3.7'
1640 Tab.TRANSITION_DURATION = 150
1642 Tab.prototype.show = function () {
1643 var $this = this.element
1644 var $ul = $this.closest('ul:not(.dropdown-menu)')
1645 var selector = $this.data('target')
1648 selector = $this.attr('href')
1649 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
1652 if ($this.parent('li').hasClass('active')) return
1654 var $previous = $ul.find('.active:last a')
1655 var hideEvent = $.Event('hide.bs.tab', {
1656 relatedTarget: $this[0]
1658 var showEvent = $.Event('show.bs.tab', {
1659 relatedTarget: $previous[0]
1662 $previous.trigger(hideEvent)
1663 $this.trigger(showEvent)
1665 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
1667 var $target = $(selector)
1669 this.activate($this.closest('li'), $ul)
1670 this.activate($target, $target.parent(), function () {
1672 type: 'hidden.bs.tab',
1673 relatedTarget: $this[0]
1676 type: 'shown.bs.tab',
1677 relatedTarget: $previous[0]
1682 Tab.prototype.activate = function (element, container, callback) {
1683 var $active = container.find('> .active')
1684 var transition = callback
1685 && $.support.transition
1686 && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
1690 .removeClass('active')
1691 .find('> .dropdown-menu > .active')
1692 .removeClass('active')
1694 .find('[data-toggle="tab"]')
1695 .attr('aria-expanded', false)
1699 .find('[data-toggle="tab"]')
1700 .attr('aria-expanded', true)
1703 element[0].offsetWidth // reflow for transition
1704 element.addClass('in')
1706 element.removeClass('fade')
1709 if (element.parent('.dropdown-menu').length) {
1711 .closest('li.dropdown')
1714 .find('[data-toggle="tab"]')
1715 .attr('aria-expanded', true)
1718 callback && callback()
1721 $active.length && transition ?
1723 .one('bsTransitionEnd', next)
1724 .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
1727 $active.removeClass('in')
1731 // TAB PLUGIN DEFINITION
1732 // =====================
1734 function Plugin(option) {
1735 return this.each(function () {
1737 var data = $this.data('bs.tab')
1739 if (!data) $this.data('bs.tab', (data = new Tab(this)))
1740 if (typeof option == 'string') data[option]()
1747 $.fn.tab.Constructor = Tab
1753 $.fn.tab.noConflict = function () {
1762 var clickHandler = function (e) {
1764 Plugin.call($(this), 'show')
1768 .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
1769 .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
1773 /* ========================================================================
1774 * Bootstrap: affix.js v3.3.7
1775 * http://getbootstrap.com/javascript/#affix
1776 * ========================================================================
1777 * Copyright 2011-2016 Twitter, Inc.
1778 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1779 * ======================================================================== */
1785 // AFFIX CLASS DEFINITION
1786 // ======================
1788 var Affix = function (element, options) {
1789 this.options = $.extend({}, Affix.DEFAULTS, options)
1791 this.$target = $(this.options.target)
1792 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
1793 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
1795 this.$element = $(element)
1798 this.pinnedOffset = null
1800 this.checkPosition()
1803 Affix.VERSION = '3.3.7'
1805 Affix.RESET = 'affix affix-top affix-bottom'
1812 Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
1813 var scrollTop = this.$target.scrollTop()
1814 var position = this.$element.offset()
1815 var targetHeight = this.$target.height()
1817 if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
1819 if (this.affixed == 'bottom') {
1820 if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
1821 return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
1824 var initializing = this.affixed == null
1825 var colliderTop = initializing ? scrollTop : position.top
1826 var colliderHeight = initializing ? targetHeight : height
1828 if (offsetTop != null && scrollTop <= offsetTop) return 'top'
1829 if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
1834 Affix.prototype.getPinnedOffset = function () {
1835 if (this.pinnedOffset) return this.pinnedOffset
1836 this.$element.removeClass(Affix.RESET).addClass('affix')
1837 var scrollTop = this.$target.scrollTop()
1838 var position = this.$element.offset()
1839 return (this.pinnedOffset = position.top - scrollTop)
1842 Affix.prototype.checkPositionWithEventLoop = function () {
1843 setTimeout($.proxy(this.checkPosition, this), 1)
1846 Affix.prototype.checkPosition = function () {
1847 if (!this.$element.is(':visible')) return
1849 var height = this.$element.height()
1850 var offset = this.options.offset
1851 var offsetTop = offset.top
1852 var offsetBottom = offset.bottom
1853 var scrollHeight = Math.max($(document).height(), $(document.body).height())
1855 if (typeof offset != 'object') offsetBottom = offsetTop = offset
1856 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
1857 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
1859 var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
1861 if (this.affixed != affix) {
1862 if (this.unpin != null) this.$element.css('top', '')
1864 var affixType = 'affix' + (affix ? '-' + affix : '')
1865 var e = $.Event(affixType + '.bs.affix')
1867 this.$element.trigger(e)
1869 if (e.isDefaultPrevented()) return
1871 this.affixed = affix
1872 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
1875 .removeClass(Affix.RESET)
1876 .addClass(affixType)
1877 .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
1880 if (affix == 'bottom') {
1881 this.$element.offset({
1882 top: scrollHeight - height - offsetBottom
1888 // AFFIX PLUGIN DEFINITION
1889 // =======================
1891 function Plugin(option) {
1892 return this.each(function () {
1894 var data = $this.data('bs.affix')
1895 var options = typeof option == 'object' && option
1897 if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
1898 if (typeof option == 'string') data[option]()
1902 var old = $.fn.affix
1905 $.fn.affix.Constructor = Affix
1908 // AFFIX NO CONFLICT
1909 // =================
1911 $.fn.affix.noConflict = function () {
1920 $(window).on('load', function () {
1921 $('[data-spy="affix"]').each(function () {
1923 var data = $spy.data()
1925 data.offset = data.offset || {}
1927 if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
1928 if (data.offsetTop != null) data.offset.top = data.offsetTop
1930 Plugin.call($spy, data)
1936 /* ========================================================================
1937 * Bootstrap: collapse.js v3.3.7
1938 * http://getbootstrap.com/javascript/#collapse
1939 * ========================================================================
1940 * Copyright 2011-2016 Twitter, Inc.
1941 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1942 * ======================================================================== */
1944 /* jshint latedef: false */
1949 // COLLAPSE PUBLIC CLASS DEFINITION
1950 // ================================
1952 var Collapse = function (element, options) {
1953 this.$element = $(element)
1954 this.options = $.extend({}, Collapse.DEFAULTS, options)
1955 this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
1956 '[data-toggle="collapse"][data-target="#' + element.id + '"]')
1957 this.transitioning = null
1959 if (this.options.parent) {
1960 this.$parent = this.getParent()
1962 this.addAriaAndCollapsedClass(this.$element, this.$trigger)
1965 if (this.options.toggle) this.toggle()
1968 Collapse.VERSION = '3.3.7'
1970 Collapse.TRANSITION_DURATION = 350
1972 Collapse.DEFAULTS = {
1976 Collapse.prototype.dimension = function () {
1977 var hasWidth = this.$element.hasClass('width')
1978 return hasWidth ? 'width' : 'height'
1981 Collapse.prototype.show = function () {
1982 if (this.transitioning || this.$element.hasClass('in')) return
1985 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
1987 if (actives && actives.length) {
1988 activesData = actives.data('bs.collapse')
1989 if (activesData && activesData.transitioning) return
1992 var startEvent = $.Event('show.bs.collapse')
1993 this.$element.trigger(startEvent)
1994 if (startEvent.isDefaultPrevented()) return
1996 if (actives && actives.length) {
1997 Plugin.call(actives, 'hide')
1998 activesData || actives.data('bs.collapse', null)
2001 var dimension = this.dimension()
2004 .removeClass('collapse')
2005 .addClass('collapsing')[dimension](0)
2006 .attr('aria-expanded', true)
2009 .removeClass('collapsed')
2010 .attr('aria-expanded', true)
2012 this.transitioning = 1
2014 var complete = function () {
2016 .removeClass('collapsing')
2017 .addClass('collapse in')[dimension]('')
2018 this.transitioning = 0
2020 .trigger('shown.bs.collapse')
2023 if (!$.support.transition) return complete.call(this)
2025 var scrollSize = $.camelCase(['scroll', dimension].join('-'))
2028 .one('bsTransitionEnd', $.proxy(complete, this))
2029 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
2032 Collapse.prototype.hide = function () {
2033 if (this.transitioning || !this.$element.hasClass('in')) return
2035 var startEvent = $.Event('hide.bs.collapse')
2036 this.$element.trigger(startEvent)
2037 if (startEvent.isDefaultPrevented()) return
2039 var dimension = this.dimension()
2041 this.$element[dimension](this.$element[dimension]())[0].offsetHeight
2044 .addClass('collapsing')
2045 .removeClass('collapse in')
2046 .attr('aria-expanded', false)
2049 .addClass('collapsed')
2050 .attr('aria-expanded', false)
2052 this.transitioning = 1
2054 var complete = function () {
2055 this.transitioning = 0
2057 .removeClass('collapsing')
2058 .addClass('collapse')
2059 .trigger('hidden.bs.collapse')
2062 if (!$.support.transition) return complete.call(this)
2066 .one('bsTransitionEnd', $.proxy(complete, this))
2067 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
2070 Collapse.prototype.toggle = function () {
2071 this[this.$element.hasClass('in') ? 'hide' : 'show']()
2074 Collapse.prototype.getParent = function () {
2075 return $(this.options.parent)
2076 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
2077 .each($.proxy(function (i, element) {
2078 var $element = $(element)
2079 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
2084 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
2085 var isOpen = $element.hasClass('in')
2087 $element.attr('aria-expanded', isOpen)
2089 .toggleClass('collapsed', !isOpen)
2090 .attr('aria-expanded', isOpen)
2093 function getTargetFromTrigger($trigger) {
2095 var target = $trigger.attr('data-target')
2096 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
2102 // COLLAPSE PLUGIN DEFINITION
2103 // ==========================
2105 function Plugin(option) {
2106 return this.each(function () {
2108 var data = $this.data('bs.collapse')
2109 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
2111 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
2112 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
2113 if (typeof option == 'string') data[option]()
2117 var old = $.fn.collapse
2119 $.fn.collapse = Plugin
2120 $.fn.collapse.Constructor = Collapse
2123 // COLLAPSE NO CONFLICT
2124 // ====================
2126 $.fn.collapse.noConflict = function () {
2132 // COLLAPSE DATA-API
2133 // =================
2135 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
2138 if (!$this.attr('data-target')) e.preventDefault()
2140 var $target = getTargetFromTrigger($this)
2141 var data = $target.data('bs.collapse')
2142 var option = data ? 'toggle' : $this.data()
2144 Plugin.call($target, option)
2149 /* ========================================================================
2150 * Bootstrap: scrollspy.js v3.3.7
2151 * http://getbootstrap.com/javascript/#scrollspy
2152 * ========================================================================
2153 * Copyright 2011-2016 Twitter, Inc.
2154 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2155 * ======================================================================== */
2161 // SCROLLSPY CLASS DEFINITION
2162 // ==========================
2164 function ScrollSpy(element, options) {
2165 this.$body = $(document.body)
2166 this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
2167 this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
2168 this.selector = (this.options.target || '') + ' .nav li > a'
2171 this.activeTarget = null
2172 this.scrollHeight = 0
2174 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
2179 ScrollSpy.VERSION = '3.3.7'
2181 ScrollSpy.DEFAULTS = {
2185 ScrollSpy.prototype.getScrollHeight = function () {
2186 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
2189 ScrollSpy.prototype.refresh = function () {
2191 var offsetMethod = 'offset'
2196 this.scrollHeight = this.getScrollHeight()
2198 if (!$.isWindow(this.$scrollElement[0])) {
2199 offsetMethod = 'position'
2200 offsetBase = this.$scrollElement.scrollTop()
2204 .find(this.selector)
2207 var href = $el.data('target') || $el.attr('href')
2208 var $href = /^#./.test(href) && $(href)
2212 && $href.is(':visible')
2213 && [[$href[offsetMethod]().top + offsetBase, href]]) || null
2215 .sort(function (a, b) { return a[0] - b[0] })
2217 that.offsets.push(this[0])
2218 that.targets.push(this[1])
2222 ScrollSpy.prototype.process = function () {
2223 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
2224 var scrollHeight = this.getScrollHeight()
2225 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
2226 var offsets = this.offsets
2227 var targets = this.targets
2228 var activeTarget = this.activeTarget
2231 if (this.scrollHeight != scrollHeight) {
2235 if (scrollTop >= maxScroll) {
2236 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
2239 if (activeTarget && scrollTop < offsets[0]) {
2240 this.activeTarget = null
2244 for (i = offsets.length; i--;) {
2245 activeTarget != targets[i]
2246 && scrollTop >= offsets[i]
2247 && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
2248 && this.activate(targets[i])
2252 ScrollSpy.prototype.activate = function (target) {
2253 this.activeTarget = target
2257 var selector = this.selector +
2258 '[data-target="' + target + '"],' +
2259 this.selector + '[href="' + target + '"]'
2261 var active = $(selector)
2265 if (active.parent('.dropdown-menu').length) {
2267 .closest('li.dropdown')
2271 active.trigger('activate.bs.scrollspy')
2274 ScrollSpy.prototype.clear = function () {
2276 .parentsUntil(this.options.target, '.active')
2277 .removeClass('active')
2281 // SCROLLSPY PLUGIN DEFINITION
2282 // ===========================
2284 function Plugin(option) {
2285 return this.each(function () {
2287 var data = $this.data('bs.scrollspy')
2288 var options = typeof option == 'object' && option
2290 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
2291 if (typeof option == 'string') data[option]()
2295 var old = $.fn.scrollspy
2297 $.fn.scrollspy = Plugin
2298 $.fn.scrollspy.Constructor = ScrollSpy
2301 // SCROLLSPY NO CONFLICT
2302 // =====================
2304 $.fn.scrollspy.noConflict = function () {
2305 $.fn.scrollspy = old
2310 // SCROLLSPY DATA-API
2311 // ==================
2313 $(window).on('load.bs.scrollspy.data-api', function () {
2314 $('[data-spy="scroll"]').each(function () {
2316 Plugin.call($spy, $spy.data())
2322 /* ========================================================================
2323 * Bootstrap: transition.js v3.3.7
2324 * http://getbootstrap.com/javascript/#transitions
2325 * ========================================================================
2326 * Copyright 2011-2016 Twitter, Inc.
2327 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2328 * ======================================================================== */
2334 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
2335 // ============================================================
2337 function transitionEnd() {
2338 var el = document.createElement('bootstrap')
2340 var transEndEventNames = {
2341 WebkitTransition : 'webkitTransitionEnd',
2342 MozTransition : 'transitionend',
2343 OTransition : 'oTransitionEnd otransitionend',
2344 transition : 'transitionend'
2347 for (var name in transEndEventNames) {
2348 if (el.style[name] !== undefined) {
2349 return { end: transEndEventNames[name] }
2353 return false // explicit for ie8 ( ._.)
2356 // http://blog.alexmaccaw.com/css-transitions
2357 $.fn.emulateTransitionEnd = function (duration) {
2360 $(this).one('bsTransitionEnd', function () { called = true })
2361 var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
2362 setTimeout(callback, duration)
2367 $.support.transition = transitionEnd()
2369 if (!$.support.transition) return
2371 $.event.special.bsTransitionEnd = {
2372 bindType: $.support.transition.end,
2373 delegateType: $.support.transition.end,
2374 handle: function (e) {
2375 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)