2 * Copyright 2016 ZTE, Inc. and others.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
18 /* ========================================================================
19 * Bootstrap: transition.js v3.1.1
20 * http://getbootstrap.com/javascript/#transitions
21 * ========================================================================
22 * Copyright 2011-2014 Twitter, Inc.
23 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
24 * ======================================================================== */
30 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
31 // ============================================================
33 function transitionEnd() {
34 var el = document.createElement('bootstrap')
36 var transEndEventNames = {
37 'WebkitTransition' : 'webkitTransitionEnd',
38 'MozTransition' : 'transitionend',
39 'OTransition' : 'oTransitionEnd otransitionend',
40 'transition' : 'transitionend'
43 for (var name in transEndEventNames) {
44 if (el.style[name] !== undefined) {
45 return { end: transEndEventNames[name] }
49 return false // explicit for ie8 ( ._.)
52 // http://blog.alexmaccaw.com/css-transitions
53 $.fn.emulateTransitionEnd = function (duration) {
54 var called = false, $el = this
55 $(this).one($.support.transition.end, function () { called = true })
56 var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
57 setTimeout(callback, duration)
62 $.support.transition = transitionEnd()
67 /* ========================================================================
68 * Bootstrap: alert.js v3.1.1
69 * http://getbootstrap.com/javascript/#alerts
70 * ========================================================================
71 * Copyright 2011-2014 Twitter, Inc.
72 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
73 * ======================================================================== */
79 // ALERT CLASS DEFINITION
80 // ======================
82 var dismiss = '[data-dismiss="alert"]'
83 var Alert = function (el) {
84 $(el).on('click', dismiss, this.close)
87 Alert.prototype.close = function (e) {
89 var selector = $this.attr('data-target')
92 selector = $this.attr('href')
93 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
96 var $parent = $(selector)
98 if (e) e.preventDefault()
100 if (!$parent.length) {
101 $parent = $this.hasClass('alert') ? $this : $this.parent()
104 $parent.trigger(e = $.Event('close.bs.alert'))
106 if (e.isDefaultPrevented()) return
108 $parent.removeClass('in')
110 function removeElement() {
111 $parent.trigger('closed.bs.alert').remove()
114 $.support.transition && $parent.hasClass('fade') ?
116 .one($.support.transition.end, removeElement)
117 .emulateTransitionEnd(150) :
122 // ALERT PLUGIN DEFINITION
123 // =======================
127 $.fn.alert = function (option) {
128 return this.each(function () {
130 var data = $this.data('bs.alert')
132 if (!data) $this.data('bs.alert', (data = new Alert(this)))
133 if (typeof option == 'string') data[option].call($this)
137 $.fn.alert.Constructor = Alert
143 $.fn.alert.noConflict = function () {
152 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
156 /* ========================================================================
157 * Bootstrap: button.js v3.1.1
158 * http://getbootstrap.com/javascript/#buttons
159 * ========================================================================
160 * Copyright 2011-2014 Twitter, Inc.
161 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
162 * ======================================================================== */
168 // BUTTON PUBLIC CLASS DEFINITION
169 // ==============================
171 var Button = function (element, options) {
172 this.$element = $(element)
173 this.options = $.extend({}, Button.DEFAULTS, options)
174 this.isLoading = false
178 loadingText: 'loading...'
181 Button.prototype.setState = function (state) {
183 var $el = this.$element
184 var val = $el.is('input') ? 'val' : 'html'
185 var data = $el.data()
187 state = state + 'Text'
189 if (!data.resetText) $el.data('resetText', $el[val]())
191 $el[val](data[state] || this.options[state])
193 // push to event loop to allow forms to submit
194 setTimeout($.proxy(function () {
195 if (state == 'loadingText') {
196 this.isLoading = true
197 $el.addClass(d).attr(d, d)
198 } else if (this.isLoading) {
199 this.isLoading = false
200 $el.removeClass(d).removeAttr(d)
205 Button.prototype.toggle = function () {
207 var $parent = this.$element.closest('[data-toggle="buttons"]')
209 if ($parent.length) {
210 var $input = this.$element.find('input')
211 if ($input.prop('type') == 'radio') {
212 if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
213 else $parent.find('.active').removeClass('active')
215 if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
218 if (changed) this.$element.toggleClass('active')
222 // BUTTON PLUGIN DEFINITION
223 // ========================
225 var old = $.fn.button
227 $.fn.button = function (option) {
228 return this.each(function () {
230 var data = $this.data('bs.button')
231 var options = typeof option == 'object' && option
233 if (!data) $this.data('bs.button', (data = new Button(this, options)))
235 if (option == 'toggle') data.toggle()
236 else if (option) data.setState(option)
240 $.fn.button.Constructor = Button
243 // BUTTON NO CONFLICT
244 // ==================
246 $.fn.button.noConflict = function () {
255 $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
256 var $btn = $(e.target)
257 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
258 $btn.button('toggle')
264 /* ========================================================================
265 * Bootstrap: carousel.js v3.1.1
266 * http://getbootstrap.com/javascript/#carousel
267 * ========================================================================
268 * Copyright 2011-2014 Twitter, Inc.
269 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
270 * ======================================================================== */
276 // CAROUSEL CLASS DEFINITION
277 // =========================
279 var Carousel = function (element, options) {
280 this.$element = $(element)
281 this.$indicators = this.$element.find('.carousel-indicators')
282 this.options = options
289 this.options.pause == 'hover' && this.$element
290 .on('mouseenter', $.proxy(this.pause, this))
291 .on('mouseleave', $.proxy(this.cycle, this))
294 Carousel.DEFAULTS = {
300 Carousel.prototype.cycle = function (e) {
301 e || (this.paused = false)
303 this.interval && clearInterval(this.interval)
305 this.options.interval
307 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
312 Carousel.prototype.getActiveIndex = function () {
313 this.$active = this.$element.find('.item.active')
314 this.$items = this.$active.parent().children()
316 return this.$items.index(this.$active)
319 Carousel.prototype.to = function (pos) {
321 var activeIndex = this.getActiveIndex()
323 if (pos > (this.$items.length - 1) || pos < 0) return
325 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
326 if (activeIndex == pos) return this.pause().cycle()
328 return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
331 Carousel.prototype.pause = function (e) {
332 e || (this.paused = true)
334 if (this.$element.find('.next, .prev').length && $.support.transition) {
335 this.$element.trigger($.support.transition.end)
339 this.interval = clearInterval(this.interval)
344 Carousel.prototype.next = function () {
345 if (this.sliding) return
346 return this.slide('next')
349 Carousel.prototype.prev = function () {
350 if (this.sliding) return
351 return this.slide('prev')
354 Carousel.prototype.slide = function (type, next) {
355 var $active = this.$element.find('.item.active')
356 var $next = next || $active[type]()
357 var isCycling = this.interval
358 var direction = type == 'next' ? 'left' : 'right'
359 var fallback = type == 'next' ? 'first' : 'last'
363 if (!this.options.wrap) return
364 $next = this.$element.find('.item')[fallback]()
367 if ($next.hasClass('active')) return this.sliding = false
369 var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
370 this.$element.trigger(e)
371 if (e.isDefaultPrevented()) return
375 isCycling && this.pause()
377 if (this.$indicators.length) {
378 this.$indicators.find('.active').removeClass('active')
379 this.$element.one('slid.bs.carousel', function () {
380 var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
381 $nextIndicator && $nextIndicator.addClass('active')
385 if ($.support.transition && this.$element.hasClass('slide')) {
387 $next[0].offsetWidth // force reflow
388 $active.addClass(direction)
389 $next.addClass(direction)
391 .one($.support.transition.end, function () {
392 $next.removeClass([type, direction].join(' ')).addClass('active')
393 $active.removeClass(['active', direction].join(' '))
395 setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
397 .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
399 $active.removeClass('active')
400 $next.addClass('active')
402 this.$element.trigger('slid.bs.carousel')
405 isCycling && this.cycle()
411 // CAROUSEL PLUGIN DEFINITION
412 // ==========================
414 var old = $.fn.carousel
416 $.fn.carousel = function (option) {
417 return this.each(function () {
419 var data = $this.data('bs.carousel')
420 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
421 var action = typeof option == 'string' ? option : options.slide
423 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
424 if (typeof option == 'number') data.to(option)
425 else if (action) data[action]()
426 else if (options.interval) data.pause().cycle()
430 $.fn.carousel.Constructor = Carousel
433 // CAROUSEL NO CONFLICT
434 // ====================
436 $.fn.carousel.noConflict = function () {
445 $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
446 var $this = $(this), href
447 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
448 var options = $.extend({}, $target.data(), $this.data())
449 var slideIndex = $this.attr('data-slide-to')
450 if (slideIndex) options.interval = false
452 $target.carousel(options)
454 if (slideIndex = $this.attr('data-slide-to')) {
455 $target.data('bs.carousel').to(slideIndex)
461 $(window).on('load', function () {
462 $('[data-ride="carousel"]').each(function () {
463 var $carousel = $(this)
464 $carousel.carousel($carousel.data())
470 /* ========================================================================
471 * Bootstrap: collapse.js v3.1.1
472 * http://getbootstrap.com/javascript/#collapse
473 * ========================================================================
474 * Copyright 2011-2014 Twitter, Inc.
475 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
476 * ======================================================================== */
482 // COLLAPSE PUBLIC CLASS DEFINITION
483 // ================================
485 var Collapse = function (element, options) {
486 this.$element = $(element)
487 this.options = $.extend({}, Collapse.DEFAULTS, options)
488 this.transitioning = null
490 if (this.options.parent) this.$parent = $(this.options.parent)
491 if (this.options.toggle) this.toggle()
494 Collapse.DEFAULTS = {
498 Collapse.prototype.dimension = function () {
499 var hasWidth = this.$element.hasClass('width')
500 return hasWidth ? 'width' : 'height'
503 Collapse.prototype.show = function () {
504 if (this.transitioning || this.$element.hasClass('in')) return
506 var startEvent = $.Event('show.bs.collapse')
507 this.$element.trigger(startEvent)
508 if (startEvent.isDefaultPrevented()) return
510 var actives = this.$parent && this.$parent.find('> .panel > .in')
512 if (actives && actives.length) {
513 var hasData = actives.data('bs.collapse')
514 if (hasData && hasData.transitioning) return
515 actives.collapse('hide')
516 hasData || actives.data('bs.collapse', null)
519 var dimension = this.dimension()
522 .removeClass('collapse')
523 .addClass('collapsing')
526 this.transitioning = 1
528 var complete = function () {
530 .removeClass('collapsing')
531 .addClass('collapse in')
533 this.transitioning = 0
534 this.$element.trigger('shown.bs.collapse')
537 if (!$.support.transition) return complete.call(this)
539 var scrollSize = $.camelCase(['scroll', dimension].join('-'))
542 .one($.support.transition.end, $.proxy(complete, this))
543 .emulateTransitionEnd(350)
544 [dimension](this.$element[0][scrollSize])
547 Collapse.prototype.hide = function () {
548 if (this.transitioning || !this.$element.hasClass('in')) return
550 var startEvent = $.Event('hide.bs.collapse')
551 this.$element.trigger(startEvent)
552 if (startEvent.isDefaultPrevented()) return
554 var dimension = this.dimension()
557 [dimension](this.$element[dimension]())
561 .addClass('collapsing')
562 .removeClass('collapse')
565 this.transitioning = 1
567 var complete = function () {
568 this.transitioning = 0
570 .trigger('hidden.bs.collapse')
571 .removeClass('collapsing')
572 .addClass('collapse')
575 if (!$.support.transition) return complete.call(this)
579 .one($.support.transition.end, $.proxy(complete, this))
580 .emulateTransitionEnd(350)
583 Collapse.prototype.toggle = function () {
584 this[this.$element.hasClass('in') ? 'hide' : 'show']()
588 // COLLAPSE PLUGIN DEFINITION
589 // ==========================
591 var old = $.fn.collapse
593 $.fn.collapse = function (option) {
594 return this.each(function () {
596 var data = $this.data('bs.collapse')
597 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
599 if (!data && options.toggle && option == 'show') option = !option
600 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
601 if (typeof option == 'string') data[option]()
605 $.fn.collapse.Constructor = Collapse
608 // COLLAPSE NO CONFLICT
609 // ====================
611 $.fn.collapse.noConflict = function () {
620 $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
621 var $this = $(this), href
622 var target = $this.attr('data-target')
623 || e.preventDefault()
624 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
625 var $target = $(target)
626 var data = $target.data('bs.collapse')
627 var option = data ? 'toggle' : $this.data()
628 var parent = $this.attr('data-parent')
629 var $parent = parent && $(parent)
631 if (!data || !data.transitioning) {
632 if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
633 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
636 $target.collapse(option)
641 /* ========================================================================
642 * Bootstrap: dropdown.js v3.1.1
643 * http://getbootstrap.com/javascript/#dropdowns
644 * ========================================================================
645 * Copyright 2011-2014 Twitter, Inc.
646 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
647 * ======================================================================== */
653 // DROPDOWN CLASS DEFINITION
654 // =========================
656 var backdrop = '.dropdown-backdrop'
657 var toggle = '[data-toggle=dropdown]'
658 var Dropdown = function (element) {
659 $(element).on('click.bs.dropdown', this.toggle)
662 Dropdown.prototype.toggle = function (e) {
665 if ($this.is('.disabled, :disabled')) return
667 var $parent = getParent($this)
668 var isActive = $parent.hasClass('open')
673 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
674 // if mobile we use a backdrop because click events don't delegate
675 $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
678 var relatedTarget = { relatedTarget: this }
679 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
681 if (e.isDefaultPrevented()) return
685 .trigger('shown.bs.dropdown', relatedTarget)
693 Dropdown.prototype.keydown = function (e) {
694 if (!/(38|40|27)/.test(e.keyCode)) return
701 if ($this.is('.disabled, :disabled')) return
703 var $parent = getParent($this)
704 var isActive = $parent.hasClass('open')
706 if (!isActive || (isActive && e.keyCode == 27)) {
707 if (e.which == 27) $parent.find(toggle).focus()
711 var desc = ' li:not(.divider):visible a'
712 var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
714 if (!$items.length) return
716 var index = $items.index($items.filter(':focus'))
718 if (e.keyCode == 38 && index > 0) index-- // up
719 if (e.keyCode == 40 && index < $items.length - 1) index++ // down
720 if (!~index) index = 0
722 $items.eq(index).focus()
725 function clearMenus(e) {
727 $(toggle).each(function () {
728 var $parent = getParent($(this))
729 var relatedTarget = { relatedTarget: this }
730 if (!$parent.hasClass('open')) return
731 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
732 if (e.isDefaultPrevented()) return
733 $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
737 function getParent($this) {
738 var selector = $this.attr('data-target')
741 selector = $this.attr('href')
742 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
745 var $parent = selector && $(selector)
747 return $parent && $parent.length ? $parent : $this.parent()
751 // DROPDOWN PLUGIN DEFINITION
752 // ==========================
754 var old = $.fn.dropdown
756 $.fn.dropdown = function (option) {
757 return this.each(function () {
759 var data = $this.data('bs.dropdown')
761 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
762 if (typeof option == 'string') data[option].call($this)
766 $.fn.dropdown.Constructor = Dropdown
769 // DROPDOWN NO CONFLICT
770 // ====================
772 $.fn.dropdown.noConflict = function () {
778 // APPLY TO STANDARD DROPDOWN ELEMENTS
779 // ===================================
782 .on('click.bs.dropdown.data-api', clearMenus)
783 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
784 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
785 .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
789 /* ========================================================================
790 * Bootstrap: modal.js v3.1.1
791 * http://getbootstrap.com/javascript/#modals
792 * ========================================================================
793 * Copyright 2011-2014 Twitter, Inc.
794 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
795 * ======================================================================== */
801 // MODAL CLASS DEFINITION
802 // ======================
804 var Modal = function (element, options) {
805 this.options = options
806 this.$element = $(element)
810 if (this.options.remote) {
812 .find('.modal-content')
813 .load(this.options.remote, $.proxy(function () {
814 this.$element.trigger('loaded.bs.modal')
825 Modal.prototype.toggle = function (_relatedTarget) {
826 return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
829 Modal.prototype.show = function (_relatedTarget) {
831 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
833 this.$element.trigger(e)
835 if (this.isShown || e.isDefaultPrevented()) return
841 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
843 this.backdrop(function () {
844 var transition = $.support.transition && that.$element.hasClass('fade')
846 if (!that.$element.parent().length) {
847 that.$element.appendTo(document.body) // don't move modals dom position
855 that.$element[0].offsetWidth // force reflow
860 .attr('aria-hidden', false)
864 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
867 that.$element.find('.modal-dialog') // wait for modal to slide in
868 .one($.support.transition.end, function () {
869 that.$element.focus().trigger(e)
871 .emulateTransitionEnd(300) :
872 that.$element.focus().trigger(e)
876 Modal.prototype.hide = function (e) {
877 if (e) e.preventDefault()
879 e = $.Event('hide.bs.modal')
881 this.$element.trigger(e)
883 if (!this.isShown || e.isDefaultPrevented()) return
889 $(document).off('focusin.bs.modal')
893 .attr('aria-hidden', true)
894 .off('click.dismiss.bs.modal')
896 $.support.transition && this.$element.hasClass('fade') ?
898 .one($.support.transition.end, $.proxy(this.hideModal, this))
899 .emulateTransitionEnd(300) :
903 Modal.prototype.enforceFocus = function () {
905 .off('focusin.bs.modal') // guard against infinite focus loop
906 .on('focusin.bs.modal', $.proxy(function (e) {
907 if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
908 this.$element.focus()
913 Modal.prototype.escape = function () {
914 if (this.isShown && this.options.keyboard) {
915 this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
916 e.which == 27 && this.hide()
918 } else if (!this.isShown) {
919 this.$element.off('keyup.dismiss.bs.modal')
923 Modal.prototype.hideModal = function () {
926 this.backdrop(function () {
927 that.removeBackdrop()
928 that.$element.trigger('hidden.bs.modal')
932 Modal.prototype.removeBackdrop = function () {
933 this.$backdrop && this.$backdrop.remove()
934 this.$backdrop = null
937 Modal.prototype.backdrop = function (callback) {
938 var animate = this.$element.hasClass('fade') ? 'fade' : ''
940 if (this.isShown && this.options.backdrop) {
941 var doAnimate = $.support.transition && animate
943 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
944 .appendTo(document.body)
946 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
947 if (e.target !== e.currentTarget) return
948 this.options.backdrop == 'static'
949 ? this.$element[0].focus.call(this.$element[0])
950 : this.hide.call(this)
953 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
955 this.$backdrop.addClass('in')
957 if (!callback) return
961 .one($.support.transition.end, callback)
962 .emulateTransitionEnd(150) :
965 } else if (!this.isShown && this.$backdrop) {
966 this.$backdrop.removeClass('in')
968 $.support.transition && this.$element.hasClass('fade') ?
970 .one($.support.transition.end, callback)
971 .emulateTransitionEnd(150) :
974 } else if (callback) {
980 // MODAL PLUGIN DEFINITION
981 // =======================
985 $.fn.modal = function (option, _relatedTarget) {
986 return this.each(function () {
988 var data = $this.data('bs.modal')
989 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
991 if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
992 if (typeof option == 'string') data[option](_relatedTarget)
993 else if (options.show) data.show(_relatedTarget)
997 $.fn.modal.Constructor = Modal
1000 // MODAL NO CONFLICT
1001 // =================
1003 $.fn.modal.noConflict = function () {
1012 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
1014 var href = $this.attr('href')
1015 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
1016 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1018 if ($this.is('a')) e.preventDefault()
1021 .modal(option, this)
1022 .one('hide', function () {
1023 $this.is(':visible') && $this.focus()
1028 .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
1029 .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
1033 /* ========================================================================
1034 * Bootstrap: tooltip.js v3.1.1
1035 * http://getbootstrap.com/javascript/#tooltip
1036 * Inspired by the original jQuery.tipsy by Jason Frame
1037 * ========================================================================
1038 * Copyright 2011-2014 Twitter, Inc.
1039 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1040 * ======================================================================== */
1046 // TOOLTIP PUBLIC CLASS DEFINITION
1047 // ===============================
1049 var Tooltip = function (element, options) {
1055 this.$element = null
1057 this.init('tooltip', element, options)
1060 Tooltip.DEFAULTS = {
1064 template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1065 trigger: 'hover focus',
1072 Tooltip.prototype.init = function (type, element, options) {
1075 this.$element = $(element)
1076 this.options = this.getOptions(options)
1078 var triggers = this.options.trigger.split(' ')
1080 for (var i = triggers.length; i--;) {
1081 var trigger = triggers[i]
1083 if (trigger == 'click') {
1084 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1085 } else if (trigger != 'manual') {
1086 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
1087 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1089 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1090 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1094 this.options.selector ?
1095 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1099 Tooltip.prototype.getDefaults = function () {
1100 return Tooltip.DEFAULTS
1103 Tooltip.prototype.getOptions = function (options) {
1104 options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1106 if (options.delay && typeof options.delay == 'number') {
1108 show: options.delay,
1116 Tooltip.prototype.getDelegateOptions = function () {
1118 var defaults = this.getDefaults()
1120 this._options && $.each(this._options, function (key, value) {
1121 if (defaults[key] != value) options[key] = value
1127 Tooltip.prototype.enter = function (obj) {
1128 var self = obj instanceof this.constructor ?
1129 obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
1131 clearTimeout(self.timeout)
1133 self.hoverState = 'in'
1135 if (!self.options.delay || !self.options.delay.show) return self.show()
1137 self.timeout = setTimeout(function () {
1138 if (self.hoverState == 'in') self.show()
1139 }, self.options.delay.show)
1142 Tooltip.prototype.leave = function (obj) {
1143 var self = obj instanceof this.constructor ?
1144 obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
1146 clearTimeout(self.timeout)
1148 self.hoverState = 'out'
1150 if (!self.options.delay || !self.options.delay.hide) return self.hide()
1152 self.timeout = setTimeout(function () {
1153 if (self.hoverState == 'out') self.hide()
1154 }, self.options.delay.hide)
1157 Tooltip.prototype.show = function () {
1158 var e = $.Event('show.bs.' + this.type)
1160 if (this.hasContent() && this.enabled) {
1161 this.$element.trigger(e)
1163 if (e.isDefaultPrevented()) return
1166 var $tip = this.tip()
1170 if (this.options.animation) $tip.addClass('fade')
1172 var placement = typeof this.options.placement == 'function' ?
1173 this.options.placement.call(this, $tip[0], this.$element[0]) :
1174 this.options.placement
1176 var autoToken = /\s?auto?\s?/i
1177 var autoPlace = autoToken.test(placement)
1178 if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
1182 .css({ top: 0, left: 0, display: 'block' })
1183 .addClass(placement)
1185 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1187 var pos = this.getPosition()
1188 var actualWidth = $tip[0].offsetWidth
1189 var actualHeight = $tip[0].offsetHeight
1192 var $parent = this.$element.parent()
1194 var orgPlacement = placement
1195 var docScroll = document.documentElement.scrollTop || document.body.scrollTop
1196 var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
1197 var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
1198 var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
1200 placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
1201 placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
1202 placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
1203 placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
1207 .removeClass(orgPlacement)
1208 .addClass(placement)
1211 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1213 this.applyPlacement(calculatedOffset, placement)
1214 this.hoverState = null
1216 var complete = function() {
1217 that.$element.trigger('shown.bs.' + that.type)
1220 $.support.transition && this.$tip.hasClass('fade') ?
1222 .one($.support.transition.end, complete)
1223 .emulateTransitionEnd(150) :
1228 Tooltip.prototype.applyPlacement = function (offset, placement) {
1230 var $tip = this.tip()
1231 var width = $tip[0].offsetWidth
1232 var height = $tip[0].offsetHeight
1234 // manually read margins because getBoundingClientRect includes difference
1235 var marginTop = parseInt($tip.css('margin-top'), 10)
1236 var marginLeft = parseInt($tip.css('margin-left'), 10)
1238 // we must check for NaN for ie 8/9
1239 if (isNaN(marginTop)) marginTop = 0
1240 if (isNaN(marginLeft)) marginLeft = 0
1242 offset.top = offset.top + marginTop
1243 offset.left = offset.left + marginLeft
1245 // $.fn.offset doesn't round pixel values
1246 // so we use setOffset directly with our own function B-0
1247 $.offset.setOffset($tip[0], $.extend({
1248 using: function (props) {
1250 top: Math.round(props.top),
1251 left: Math.round(props.left)
1258 // check to see if placing tip in new offset caused the tip to resize itself
1259 var actualWidth = $tip[0].offsetWidth
1260 var actualHeight = $tip[0].offsetHeight
1262 if (placement == 'top' && actualHeight != height) {
1264 offset.top = offset.top + height - actualHeight
1267 if (/bottom|top/.test(placement)) {
1270 if (offset.left < 0) {
1271 delta = offset.left * -2
1276 actualWidth = $tip[0].offsetWidth
1277 actualHeight = $tip[0].offsetHeight
1280 this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
1282 this.replaceArrow(actualHeight - height, actualHeight, 'top')
1285 if (replace) $tip.offset(offset)
1288 Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
1289 this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
1292 Tooltip.prototype.setContent = function () {
1293 var $tip = this.tip()
1294 var title = this.getTitle()
1296 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1297 $tip.removeClass('fade in top bottom left right')
1300 Tooltip.prototype.hide = function () {
1302 var $tip = this.tip()
1303 var e = $.Event('hide.bs.' + this.type)
1305 function complete() {
1306 if (that.hoverState != 'in') $tip.detach()
1307 that.$element.trigger('hidden.bs.' + that.type)
1310 this.$element.trigger(e)
1312 if (e.isDefaultPrevented()) return
1314 $tip.removeClass('in')
1316 $.support.transition && this.$tip.hasClass('fade') ?
1318 .one($.support.transition.end, complete)
1319 .emulateTransitionEnd(150) :
1322 this.hoverState = null
1327 Tooltip.prototype.fixTitle = function () {
1328 var $e = this.$element
1329 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1330 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1334 Tooltip.prototype.hasContent = function () {
1335 return this.getTitle()
1338 Tooltip.prototype.getPosition = function () {
1339 var el = this.$element[0]
1340 return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
1341 width: el.offsetWidth,
1342 height: el.offsetHeight
1343 }, this.$element.offset())
1346 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1347 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1348 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1349 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1350 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
1353 Tooltip.prototype.getTitle = function () {
1355 var $e = this.$element
1356 var o = this.options
1358 title = $e.attr('data-original-title')
1359 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1364 Tooltip.prototype.tip = function () {
1365 return this.$tip = this.$tip || $(this.options.template)
1368 Tooltip.prototype.arrow = function () {
1369 return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
1372 Tooltip.prototype.validate = function () {
1373 if (!this.$element[0].parentNode) {
1375 this.$element = null
1380 Tooltip.prototype.enable = function () {
1384 Tooltip.prototype.disable = function () {
1385 this.enabled = false
1388 Tooltip.prototype.toggleEnabled = function () {
1389 this.enabled = !this.enabled
1392 Tooltip.prototype.toggle = function (e) {
1393 var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
1394 self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1397 Tooltip.prototype.destroy = function () {
1398 clearTimeout(this.timeout)
1399 this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
1403 // TOOLTIP PLUGIN DEFINITION
1404 // =========================
1406 var old = $.fn.tooltip
1408 $.fn.tooltip = function (option) {
1409 return this.each(function () {
1411 var data = $this.data('bs.tooltip')
1412 var options = typeof option == 'object' && option
1414 if (!data && option == 'destroy') return
1415 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1416 if (typeof option == 'string') data[option]()
1420 $.fn.tooltip.Constructor = Tooltip
1423 // TOOLTIP NO CONFLICT
1424 // ===================
1426 $.fn.tooltip.noConflict = function () {
1433 /* ========================================================================
1434 * Bootstrap: popover.js v3.1.1
1435 * http://getbootstrap.com/javascript/#popovers
1436 * ========================================================================
1437 * Copyright 2011-2014 Twitter, Inc.
1438 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1439 * ======================================================================== */
1445 // POPOVER PUBLIC CLASS DEFINITION
1446 // ===============================
1448 var Popover = function (element, options) {
1449 this.init('popover', element, options)
1452 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1454 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1458 template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1462 // NOTE: POPOVER EXTENDS tooltip.js
1463 // ================================
1465 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
1467 Popover.prototype.constructor = Popover
1469 Popover.prototype.getDefaults = function () {
1470 return Popover.DEFAULTS
1473 Popover.prototype.setContent = function () {
1474 var $tip = this.tip()
1475 var title = this.getTitle()
1476 var content = this.getContent()
1478 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1479 $tip.find('.popover-content')[ // we use append for html objects to maintain js events
1480 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1483 $tip.removeClass('fade top bottom left right in')
1485 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1486 // this manually by checking the contents.
1487 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
1490 Popover.prototype.hasContent = function () {
1491 return this.getTitle() || this.getContent()
1494 Popover.prototype.getContent = function () {
1495 var $e = this.$element
1496 var o = this.options
1498 return $e.attr('data-content')
1499 || (typeof o.content == 'function' ?
1500 o.content.call($e[0]) :
1504 Popover.prototype.arrow = function () {
1505 return this.$arrow = this.$arrow || this.tip().find('.arrow')
1508 Popover.prototype.tip = function () {
1509 if (!this.$tip) this.$tip = $(this.options.template)
1514 // POPOVER PLUGIN DEFINITION
1515 // =========================
1517 var old = $.fn.popover
1519 $.fn.popover = function (option) {
1520 return this.each(function () {
1522 var data = $this.data('bs.popover')
1523 var options = typeof option == 'object' && option
1525 if (!data && option == 'destroy') return
1526 if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1527 if (typeof option == 'string') data[option]()
1531 $.fn.popover.Constructor = Popover
1534 // POPOVER NO CONFLICT
1535 // ===================
1537 $.fn.popover.noConflict = function () {
1544 /* ========================================================================
1545 * Bootstrap: scrollspy.js v3.1.1
1546 * http://getbootstrap.com/javascript/#scrollspy
1547 * ========================================================================
1548 * Copyright 2011-2014 Twitter, Inc.
1549 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1550 * ======================================================================== */
1556 // SCROLLSPY CLASS DEFINITION
1557 // ==========================
1559 function ScrollSpy(element, options) {
1561 var process = $.proxy(this.process, this)
1563 this.$element = $(element).is('body') ? $(window) : $(element)
1564 this.$body = $('body')
1565 this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
1566 this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
1567 this.selector = (this.options.target
1568 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1569 || '') + ' .nav li > a'
1570 this.offsets = $([])
1571 this.targets = $([])
1572 this.activeTarget = null
1578 ScrollSpy.DEFAULTS = {
1582 ScrollSpy.prototype.refresh = function () {
1583 var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
1585 this.offsets = $([])
1586 this.targets = $([])
1589 var $targets = this.$body
1590 .find(this.selector)
1593 var href = $el.data('target') || $el.attr('href')
1594 var $href = /^#./.test(href) && $(href)
1598 && $href.is(':visible')
1599 && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
1601 .sort(function (a, b) { return a[0] - b[0] })
1603 self.offsets.push(this[0])
1604 self.targets.push(this[1])
1608 ScrollSpy.prototype.process = function () {
1609 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1610 var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1611 var maxScroll = scrollHeight - this.$scrollElement.height()
1612 var offsets = this.offsets
1613 var targets = this.targets
1614 var activeTarget = this.activeTarget
1617 if (scrollTop >= maxScroll) {
1618 return activeTarget != (i = targets.last()[0]) && this.activate(i)
1621 if (activeTarget && scrollTop <= offsets[0]) {
1622 return activeTarget != (i = targets[0]) && this.activate(i)
1625 for (i = offsets.length; i--;) {
1626 activeTarget != targets[i]
1627 && scrollTop >= offsets[i]
1628 && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1629 && this.activate( targets[i] )
1633 ScrollSpy.prototype.activate = function (target) {
1634 this.activeTarget = target
1637 .parentsUntil(this.options.target, '.active')
1638 .removeClass('active')
1640 var selector = this.selector +
1641 '[data-target="' + target + '"],' +
1642 this.selector + '[href="' + target + '"]'
1644 var active = $(selector)
1648 if (active.parent('.dropdown-menu').length) {
1650 .closest('li.dropdown')
1654 active.trigger('activate.bs.scrollspy')
1658 // SCROLLSPY PLUGIN DEFINITION
1659 // ===========================
1661 var old = $.fn.scrollspy
1663 $.fn.scrollspy = function (option) {
1664 return this.each(function () {
1666 var data = $this.data('bs.scrollspy')
1667 var options = typeof option == 'object' && option
1669 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
1670 if (typeof option == 'string') data[option]()
1674 $.fn.scrollspy.Constructor = ScrollSpy
1677 // SCROLLSPY NO CONFLICT
1678 // =====================
1680 $.fn.scrollspy.noConflict = function () {
1681 $.fn.scrollspy = old
1686 // SCROLLSPY DATA-API
1687 // ==================
1689 $(window).on('load', function () {
1690 $('[data-spy="scroll"]').each(function () {
1692 $spy.scrollspy($spy.data())
1698 /* ========================================================================
1699 * Bootstrap: tab.js v3.1.1
1700 * http://getbootstrap.com/javascript/#tabs
1701 * ========================================================================
1702 * Copyright 2011-2014 Twitter, Inc.
1703 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1704 * ======================================================================== */
1710 // TAB CLASS DEFINITION
1711 // ====================
1713 var Tab = function (element) {
1714 this.element = $(element)
1717 Tab.prototype.show = function () {
1718 var $this = this.element
1719 var $ul = $this.closest('ul:not(.dropdown-menu)')
1720 var selector = $this.data('target')
1723 selector = $this.attr('href')
1724 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1727 if ($this.parent('li').hasClass('active')) return
1729 var previous = $ul.find('.active:last a')[0]
1730 var e = $.Event('show.bs.tab', {
1731 relatedTarget: previous
1736 if (e.isDefaultPrevented()) return
1738 var $target = $(selector)
1740 this.activate($this.parent('li'), $ul)
1741 this.activate($target, $target.parent(), function () {
1743 type: 'shown.bs.tab',
1744 relatedTarget: previous
1749 Tab.prototype.activate = function (element, container, callback) {
1750 var $active = container.find('> .active')
1751 var transition = callback
1752 && $.support.transition
1753 && $active.hasClass('fade')
1757 .removeClass('active')
1758 .find('> .dropdown-menu > .active')
1759 .removeClass('active')
1761 element.addClass('active')
1764 element[0].offsetWidth // reflow for transition
1765 element.addClass('in')
1767 element.removeClass('fade')
1770 if (element.parent('.dropdown-menu')) {
1771 element.closest('li.dropdown').addClass('active')
1774 callback && callback()
1779 .one($.support.transition.end, next)
1780 .emulateTransitionEnd(150) :
1783 $active.removeClass('in')
1787 // TAB PLUGIN DEFINITION
1788 // =====================
1792 $.fn.tab = function ( option ) {
1793 return this.each(function () {
1795 var data = $this.data('bs.tab')
1797 if (!data) $this.data('bs.tab', (data = new Tab(this)))
1798 if (typeof option == 'string') data[option]()
1802 $.fn.tab.Constructor = Tab
1808 $.fn.tab.noConflict = function () {
1817 $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1824 /* ========================================================================
1825 * Bootstrap: affix.js v3.1.1
1826 * http://getbootstrap.com/javascript/#affix
1827 * ========================================================================
1828 * Copyright 2011-2014 Twitter, Inc.
1829 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1830 * ======================================================================== */
1836 // AFFIX CLASS DEFINITION
1837 // ======================
1839 var Affix = function (element, options) {
1840 this.options = $.extend({}, Affix.DEFAULTS, options)
1841 this.$window = $(window)
1842 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
1843 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
1845 this.$element = $(element)
1848 this.pinnedOffset = null
1850 this.checkPosition()
1853 Affix.RESET = 'affix affix-top affix-bottom'
1859 Affix.prototype.getPinnedOffset = function () {
1860 if (this.pinnedOffset) return this.pinnedOffset
1861 this.$element.removeClass(Affix.RESET).addClass('affix')
1862 var scrollTop = this.$window.scrollTop()
1863 var position = this.$element.offset()
1864 return (this.pinnedOffset = position.top - scrollTop)
1867 Affix.prototype.checkPositionWithEventLoop = function () {
1868 setTimeout($.proxy(this.checkPosition, this), 1)
1871 Affix.prototype.checkPosition = function () {
1872 if (!this.$element.is(':visible')) return
1874 var scrollHeight = $(document).height()
1875 var scrollTop = this.$window.scrollTop()
1876 var position = this.$element.offset()
1877 var offset = this.options.offset
1878 var offsetTop = offset.top
1879 var offsetBottom = offset.bottom
1881 if (this.affixed == 'top') position.top += scrollTop
1883 if (typeof offset != 'object') offsetBottom = offsetTop = offset
1884 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
1885 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
1887 var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
1888 offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
1889 offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
1891 if (this.affixed === affix) return
1892 if (this.unpin) this.$element.css('top', '')
1894 var affixType = 'affix' + (affix ? '-' + affix : '')
1895 var e = $.Event(affixType + '.bs.affix')
1897 this.$element.trigger(e)
1899 if (e.isDefaultPrevented()) return
1901 this.affixed = affix
1902 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
1905 .removeClass(Affix.RESET)
1906 .addClass(affixType)
1907 .trigger($.Event(affixType.replace('affix', 'affixed')))
1909 if (affix == 'bottom') {
1910 this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
1915 // AFFIX PLUGIN DEFINITION
1916 // =======================
1918 var old = $.fn.affix
1920 $.fn.affix = function (option) {
1921 return this.each(function () {
1923 var data = $this.data('bs.affix')
1924 var options = typeof option == 'object' && option
1926 if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
1927 if (typeof option == 'string') data[option]()
1931 $.fn.affix.Constructor = Affix
1934 // AFFIX NO CONFLICT
1935 // =================
1937 $.fn.affix.noConflict = function () {
1946 $(window).on('load', function () {
1947 $('[data-spy="affix"]').each(function () {
1949 var data = $spy.data()
1951 data.offset = data.offset || {}
1953 if (data.offsetBottom) data.offset.bottom = data.offsetBottom
1954 if (data.offsetTop) data.offset.top = data.offsetTop