Path: blob/master/web-gui/buildyourownbotnet/assets/js/bootstrap.js
1292 views
/*!1* Bootstrap v3.3.5 (http://getbootstrap.com)2* Copyright 2011-2015 Twitter, Inc.3* Licensed under the MIT license4*/56if (typeof jQuery === 'undefined') {7throw new Error('Bootstrap\'s JavaScript requires jQuery')8}910+function ($) {11'use strict';12var version = $.fn.jquery.split(' ')[0].split('.')13if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {14throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')15}16}(jQuery);1718/* ========================================================================19* Bootstrap: transition.js v3.3.520* http://getbootstrap.com/javascript/#transitions21* ========================================================================22* Copyright 2011-2015 Twitter, Inc.23* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)24* ======================================================================== */252627+function ($) {28'use strict';2930// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)31// ============================================================3233function transitionEnd() {34var el = document.createElement('bootstrap')3536var transEndEventNames = {37WebkitTransition : 'webkitTransitionEnd',38MozTransition : 'transitionend',39OTransition : 'oTransitionEnd otransitionend',40transition : 'transitionend'41}4243for (var name in transEndEventNames) {44if (el.style[name] !== undefined) {45return { end: transEndEventNames[name] }46}47}4849return false // explicit for ie8 ( ._.)50}5152// http://blog.alexmaccaw.com/css-transitions53$.fn.emulateTransitionEnd = function (duration) {54var called = false55var $el = this56$(this).one('bsTransitionEnd', function () { called = true })57var callback = function () { if (!called) $($el).trigger($.support.transition.end) }58setTimeout(callback, duration)59return this60}6162$(function () {63$.support.transition = transitionEnd()6465if (!$.support.transition) return6667$.event.special.bsTransitionEnd = {68bindType: $.support.transition.end,69delegateType: $.support.transition.end,70handle: function (e) {71if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)72}73}74})7576}(jQuery);7778/* ========================================================================79* Bootstrap: alert.js v3.3.580* http://getbootstrap.com/javascript/#alerts81* ========================================================================82* Copyright 2011-2015 Twitter, Inc.83* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)84* ======================================================================== */858687+function ($) {88'use strict';8990// ALERT CLASS DEFINITION91// ======================9293var dismiss = '[data-dismiss="alert"]'94var Alert = function (el) {95$(el).on('click', dismiss, this.close)96}9798Alert.VERSION = '3.3.5'99100Alert.TRANSITION_DURATION = 150101102Alert.prototype.close = function (e) {103var $this = $(this)104var selector = $this.attr('data-target')105106if (!selector) {107selector = $this.attr('href')108selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7109}110111var $parent = $(selector)112113if (e) e.preventDefault()114115if (!$parent.length) {116$parent = $this.closest('.alert')117}118119$parent.trigger(e = $.Event('close.bs.alert'))120121if (e.isDefaultPrevented()) return122123$parent.removeClass('in')124125function removeElement() {126// detach from parent, fire event then clean up data127$parent.detach().trigger('closed.bs.alert').remove()128}129130$.support.transition && $parent.hasClass('fade') ?131$parent132.one('bsTransitionEnd', removeElement)133.emulateTransitionEnd(Alert.TRANSITION_DURATION) :134removeElement()135}136137138// ALERT PLUGIN DEFINITION139// =======================140141function Plugin(option) {142return this.each(function () {143var $this = $(this)144var data = $this.data('bs.alert')145146if (!data) $this.data('bs.alert', (data = new Alert(this)))147if (typeof option == 'string') data[option].call($this)148})149}150151var old = $.fn.alert152153$.fn.alert = Plugin154$.fn.alert.Constructor = Alert155156157// ALERT NO CONFLICT158// =================159160$.fn.alert.noConflict = function () {161$.fn.alert = old162return this163}164165166// ALERT DATA-API167// ==============168169$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)170171}(jQuery);172173/* ========================================================================174* Bootstrap: button.js v3.3.5175* http://getbootstrap.com/javascript/#buttons176* ========================================================================177* Copyright 2011-2015 Twitter, Inc.178* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)179* ======================================================================== */180181182+function ($) {183'use strict';184185// BUTTON PUBLIC CLASS DEFINITION186// ==============================187188var Button = function (element, options) {189this.$element = $(element)190this.options = $.extend({}, Button.DEFAULTS, options)191this.isLoading = false192}193194Button.VERSION = '3.3.5'195196Button.DEFAULTS = {197loadingText: 'loading...'198}199200Button.prototype.setState = function (state) {201var d = 'disabled'202var $el = this.$element203var val = $el.is('input') ? 'val' : 'html'204var data = $el.data()205206state += 'Text'207208if (data.resetText == null) $el.data('resetText', $el[val]())209210// push to event loop to allow forms to submit211setTimeout($.proxy(function () {212$el[val](data[state] == null ? this.options[state] : data[state])213214if (state == 'loadingText') {215this.isLoading = true216$el.addClass(d).attr(d, d)217} else if (this.isLoading) {218this.isLoading = false219$el.removeClass(d).removeAttr(d)220}221}, this), 0)222}223224Button.prototype.toggle = function () {225var changed = true226var $parent = this.$element.closest('[data-toggle="buttons"]')227228if ($parent.length) {229var $input = this.$element.find('input')230if ($input.prop('type') == 'radio') {231if ($input.prop('checked')) changed = false232$parent.find('.active').removeClass('active')233this.$element.addClass('active')234} else if ($input.prop('type') == 'checkbox') {235if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false236this.$element.toggleClass('active')237}238$input.prop('checked', this.$element.hasClass('active'))239if (changed) $input.trigger('change')240} else {241this.$element.attr('aria-pressed', !this.$element.hasClass('active'))242this.$element.toggleClass('active')243}244}245246247// BUTTON PLUGIN DEFINITION248// ========================249250function Plugin(option) {251return this.each(function () {252var $this = $(this)253var data = $this.data('bs.button')254var options = typeof option == 'object' && option255256if (!data) $this.data('bs.button', (data = new Button(this, options)))257258if (option == 'toggle') data.toggle()259else if (option) data.setState(option)260})261}262263var old = $.fn.button264265$.fn.button = Plugin266$.fn.button.Constructor = Button267268269// BUTTON NO CONFLICT270// ==================271272$.fn.button.noConflict = function () {273$.fn.button = old274return this275}276277278// BUTTON DATA-API279// ===============280281$(document)282.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {283var $btn = $(e.target)284if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')285Plugin.call($btn, 'toggle')286if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()287})288.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {289$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))290})291292}(jQuery);293294/* ========================================================================295* Bootstrap: carousel.js v3.3.5296* http://getbootstrap.com/javascript/#carousel297* ========================================================================298* Copyright 2011-2015 Twitter, Inc.299* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)300* ======================================================================== */301302303+function ($) {304'use strict';305306// CAROUSEL CLASS DEFINITION307// =========================308309var Carousel = function (element, options) {310this.$element = $(element)311this.$indicators = this.$element.find('.carousel-indicators')312this.options = options313this.paused = null314this.sliding = null315this.interval = null316this.$active = null317this.$items = null318319this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))320321this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element322.on('mouseenter.bs.carousel', $.proxy(this.pause, this))323.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))324}325326Carousel.VERSION = '3.3.5'327328Carousel.TRANSITION_DURATION = 600329330Carousel.DEFAULTS = {331interval: 5000,332pause: 'hover',333wrap: true,334keyboard: true335}336337Carousel.prototype.keydown = function (e) {338if (/input|textarea/i.test(e.target.tagName)) return339switch (e.which) {340case 37: this.prev(); break341case 39: this.next(); break342default: return343}344345e.preventDefault()346}347348Carousel.prototype.cycle = function (e) {349e || (this.paused = false)350351this.interval && clearInterval(this.interval)352353this.options.interval354&& !this.paused355&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))356357return this358}359360Carousel.prototype.getItemIndex = function (item) {361this.$items = item.parent().children('.item')362return this.$items.index(item || this.$active)363}364365Carousel.prototype.getItemForDirection = function (direction, active) {366var activeIndex = this.getItemIndex(active)367var willWrap = (direction == 'prev' && activeIndex === 0)368|| (direction == 'next' && activeIndex == (this.$items.length - 1))369if (willWrap && !this.options.wrap) return active370var delta = direction == 'prev' ? -1 : 1371var itemIndex = (activeIndex + delta) % this.$items.length372return this.$items.eq(itemIndex)373}374375Carousel.prototype.to = function (pos) {376var that = this377var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))378379if (pos > (this.$items.length - 1) || pos < 0) return380381if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"382if (activeIndex == pos) return this.pause().cycle()383384return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))385}386387Carousel.prototype.pause = function (e) {388e || (this.paused = true)389390if (this.$element.find('.next, .prev').length && $.support.transition) {391this.$element.trigger($.support.transition.end)392this.cycle(true)393}394395this.interval = clearInterval(this.interval)396397return this398}399400Carousel.prototype.next = function () {401if (this.sliding) return402return this.slide('next')403}404405Carousel.prototype.prev = function () {406if (this.sliding) return407return this.slide('prev')408}409410Carousel.prototype.slide = function (type, next) {411var $active = this.$element.find('.item.active')412var $next = next || this.getItemForDirection(type, $active)413var isCycling = this.interval414var direction = type == 'next' ? 'left' : 'right'415var that = this416417if ($next.hasClass('active')) return (this.sliding = false)418419var relatedTarget = $next[0]420var slideEvent = $.Event('slide.bs.carousel', {421relatedTarget: relatedTarget,422direction: direction423})424this.$element.trigger(slideEvent)425if (slideEvent.isDefaultPrevented()) return426427this.sliding = true428429isCycling && this.pause()430431if (this.$indicators.length) {432this.$indicators.find('.active').removeClass('active')433var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])434$nextIndicator && $nextIndicator.addClass('active')435}436437var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"438if ($.support.transition && this.$element.hasClass('slide')) {439$next.addClass(type)440$next[0].offsetWidth // force reflow441$active.addClass(direction)442$next.addClass(direction)443$active444.one('bsTransitionEnd', function () {445$next.removeClass([type, direction].join(' ')).addClass('active')446$active.removeClass(['active', direction].join(' '))447that.sliding = false448setTimeout(function () {449that.$element.trigger(slidEvent)450}, 0)451})452.emulateTransitionEnd(Carousel.TRANSITION_DURATION)453} else {454$active.removeClass('active')455$next.addClass('active')456this.sliding = false457this.$element.trigger(slidEvent)458}459460isCycling && this.cycle()461462return this463}464465466// CAROUSEL PLUGIN DEFINITION467// ==========================468469function Plugin(option) {470return this.each(function () {471var $this = $(this)472var data = $this.data('bs.carousel')473var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)474var action = typeof option == 'string' ? option : options.slide475476if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))477if (typeof option == 'number') data.to(option)478else if (action) data[action]()479else if (options.interval) data.pause().cycle()480})481}482483var old = $.fn.carousel484485$.fn.carousel = Plugin486$.fn.carousel.Constructor = Carousel487488489// CAROUSEL NO CONFLICT490// ====================491492$.fn.carousel.noConflict = function () {493$.fn.carousel = old494return this495}496497498// CAROUSEL DATA-API499// =================500501var clickHandler = function (e) {502var href503var $this = $(this)504var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7505if (!$target.hasClass('carousel')) return506var options = $.extend({}, $target.data(), $this.data())507var slideIndex = $this.attr('data-slide-to')508if (slideIndex) options.interval = false509510Plugin.call($target, options)511512if (slideIndex) {513$target.data('bs.carousel').to(slideIndex)514}515516e.preventDefault()517}518519$(document)520.on('click.bs.carousel.data-api', '[data-slide]', clickHandler)521.on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)522523$(window).on('load', function () {524$('[data-ride="carousel"]').each(function () {525var $carousel = $(this)526Plugin.call($carousel, $carousel.data())527})528})529530}(jQuery);531532/* ========================================================================533* Bootstrap: collapse.js v3.3.5534* http://getbootstrap.com/javascript/#collapse535* ========================================================================536* Copyright 2011-2015 Twitter, Inc.537* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)538* ======================================================================== */539540541+function ($) {542'use strict';543544// COLLAPSE PUBLIC CLASS DEFINITION545// ================================546547var Collapse = function (element, options) {548this.$element = $(element)549this.options = $.extend({}, Collapse.DEFAULTS, options)550this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +551'[data-toggle="collapse"][data-target="#' + element.id + '"]')552this.transitioning = null553554if (this.options.parent) {555this.$parent = this.getParent()556} else {557this.addAriaAndCollapsedClass(this.$element, this.$trigger)558}559560if (this.options.toggle) this.toggle()561}562563Collapse.VERSION = '3.3.5'564565Collapse.TRANSITION_DURATION = 350566567Collapse.DEFAULTS = {568toggle: true569}570571Collapse.prototype.dimension = function () {572var hasWidth = this.$element.hasClass('width')573return hasWidth ? 'width' : 'height'574}575576Collapse.prototype.show = function () {577if (this.transitioning || this.$element.hasClass('in')) return578579var activesData580var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')581582if (actives && actives.length) {583activesData = actives.data('bs.collapse')584if (activesData && activesData.transitioning) return585}586587var startEvent = $.Event('show.bs.collapse')588this.$element.trigger(startEvent)589if (startEvent.isDefaultPrevented()) return590591if (actives && actives.length) {592Plugin.call(actives, 'hide')593activesData || actives.data('bs.collapse', null)594}595596var dimension = this.dimension()597598this.$element599.removeClass('collapse')600.addClass('collapsing')[dimension](0)601.attr('aria-expanded', true)602603this.$trigger604.removeClass('collapsed')605.attr('aria-expanded', true)606607this.transitioning = 1608609var complete = function () {610this.$element611.removeClass('collapsing')612.addClass('collapse in')[dimension]('')613this.transitioning = 0614this.$element615.trigger('shown.bs.collapse')616}617618if (!$.support.transition) return complete.call(this)619620var scrollSize = $.camelCase(['scroll', dimension].join('-'))621622this.$element623.one('bsTransitionEnd', $.proxy(complete, this))624.emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])625}626627Collapse.prototype.hide = function () {628if (this.transitioning || !this.$element.hasClass('in')) return629630var startEvent = $.Event('hide.bs.collapse')631this.$element.trigger(startEvent)632if (startEvent.isDefaultPrevented()) return633634var dimension = this.dimension()635636this.$element[dimension](this.$element[dimension]())[0].offsetHeight637638this.$element639.addClass('collapsing')640.removeClass('collapse in')641.attr('aria-expanded', false)642643this.$trigger644.addClass('collapsed')645.attr('aria-expanded', false)646647this.transitioning = 1648649var complete = function () {650this.transitioning = 0651this.$element652.removeClass('collapsing')653.addClass('collapse')654.trigger('hidden.bs.collapse')655}656657if (!$.support.transition) return complete.call(this)658659this.$element660[dimension](0)661.one('bsTransitionEnd', $.proxy(complete, this))662.emulateTransitionEnd(Collapse.TRANSITION_DURATION)663}664665Collapse.prototype.toggle = function () {666this[this.$element.hasClass('in') ? 'hide' : 'show']()667}668669Collapse.prototype.getParent = function () {670return $(this.options.parent)671.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')672.each($.proxy(function (i, element) {673var $element = $(element)674this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)675}, this))676.end()677}678679Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {680var isOpen = $element.hasClass('in')681682$element.attr('aria-expanded', isOpen)683$trigger684.toggleClass('collapsed', !isOpen)685.attr('aria-expanded', isOpen)686}687688function getTargetFromTrigger($trigger) {689var href690var target = $trigger.attr('data-target')691|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7692693return $(target)694}695696697// COLLAPSE PLUGIN DEFINITION698// ==========================699700function Plugin(option) {701return this.each(function () {702var $this = $(this)703var data = $this.data('bs.collapse')704var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)705706if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false707if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))708if (typeof option == 'string') data[option]()709})710}711712var old = $.fn.collapse713714$.fn.collapse = Plugin715$.fn.collapse.Constructor = Collapse716717718// COLLAPSE NO CONFLICT719// ====================720721$.fn.collapse.noConflict = function () {722$.fn.collapse = old723return this724}725726727// COLLAPSE DATA-API728// =================729730$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {731var $this = $(this)732733if (!$this.attr('data-target')) e.preventDefault()734735var $target = getTargetFromTrigger($this)736var data = $target.data('bs.collapse')737var option = data ? 'toggle' : $this.data()738739Plugin.call($target, option)740})741742}(jQuery);743744/* ========================================================================745* Bootstrap: dropdown.js v3.3.5746* http://getbootstrap.com/javascript/#dropdowns747* ========================================================================748* Copyright 2011-2015 Twitter, Inc.749* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)750* ======================================================================== */751752753+function ($) {754'use strict';755756// DROPDOWN CLASS DEFINITION757// =========================758759var backdrop = '.dropdown-backdrop'760var toggle = '[data-toggle="dropdown"]'761var Dropdown = function (element) {762$(element).on('click.bs.dropdown', this.toggle)763}764765Dropdown.VERSION = '3.3.5'766767function getParent($this) {768var selector = $this.attr('data-target')769770if (!selector) {771selector = $this.attr('href')772selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7773}774775var $parent = selector && $(selector)776777return $parent && $parent.length ? $parent : $this.parent()778}779780function clearMenus(e) {781if (e && e.which === 3) return782$(backdrop).remove()783$(toggle).each(function () {784var $this = $(this)785var $parent = getParent($this)786var relatedTarget = { relatedTarget: this }787788if (!$parent.hasClass('open')) return789790if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return791792$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))793794if (e.isDefaultPrevented()) return795796$this.attr('aria-expanded', 'false')797$parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))798})799}800801Dropdown.prototype.toggle = function (e) {802var $this = $(this)803804if ($this.is('.disabled, :disabled')) return805806var $parent = getParent($this)807var isActive = $parent.hasClass('open')808809clearMenus()810811if (!isActive) {812if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {813// if mobile we use a backdrop because click events don't delegate814$(document.createElement('div'))815.addClass('dropdown-backdrop')816.insertAfter($(this))817.on('click', clearMenus)818}819820var relatedTarget = { relatedTarget: this }821$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))822823if (e.isDefaultPrevented()) return824825$this826.trigger('focus')827.attr('aria-expanded', 'true')828829$parent830.toggleClass('open')831.trigger($.Event('shown.bs.dropdown', relatedTarget))832}833834return false835}836837Dropdown.prototype.keydown = function (e) {838if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return839840var $this = $(this)841842e.preventDefault()843e.stopPropagation()844845if ($this.is('.disabled, :disabled')) return846847var $parent = getParent($this)848var isActive = $parent.hasClass('open')849850if (!isActive && e.which != 27 || isActive && e.which == 27) {851if (e.which == 27) $parent.find(toggle).trigger('focus')852return $this.trigger('click')853}854855var desc = ' li:not(.disabled):visible a'856var $items = $parent.find('.dropdown-menu' + desc)857858if (!$items.length) return859860var index = $items.index(e.target)861862if (e.which == 38 && index > 0) index-- // up863if (e.which == 40 && index < $items.length - 1) index++ // down864if (!~index) index = 0865866$items.eq(index).trigger('focus')867}868869870// DROPDOWN PLUGIN DEFINITION871// ==========================872873function Plugin(option) {874return this.each(function () {875var $this = $(this)876var data = $this.data('bs.dropdown')877878if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))879if (typeof option == 'string') data[option].call($this)880})881}882883var old = $.fn.dropdown884885$.fn.dropdown = Plugin886$.fn.dropdown.Constructor = Dropdown887888889// DROPDOWN NO CONFLICT890// ====================891892$.fn.dropdown.noConflict = function () {893$.fn.dropdown = old894return this895}896897898// APPLY TO STANDARD DROPDOWN ELEMENTS899// ===================================900901$(document)902.on('click.bs.dropdown.data-api', clearMenus)903.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })904.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)905.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)906.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)907908}(jQuery);909910/* ========================================================================911* Bootstrap: modal.js v3.3.5912* http://getbootstrap.com/javascript/#modals913* ========================================================================914* Copyright 2011-2015 Twitter, Inc.915* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)916* ======================================================================== */917918919+function ($) {920'use strict';921922// MODAL CLASS DEFINITION923// ======================924925var Modal = function (element, options) {926this.options = options927this.$body = $(document.body)928this.$element = $(element)929this.$dialog = this.$element.find('.modal-dialog')930this.$backdrop = null931this.isShown = null932this.originalBodyPad = null933this.scrollbarWidth = 0934this.ignoreBackdropClick = false935936if (this.options.remote) {937this.$element938.find('.modal-content')939.load(this.options.remote, $.proxy(function () {940this.$element.trigger('loaded.bs.modal')941}, this))942}943}944945Modal.VERSION = '3.3.5'946947Modal.TRANSITION_DURATION = 300948Modal.BACKDROP_TRANSITION_DURATION = 150949950Modal.DEFAULTS = {951backdrop: true,952keyboard: true,953show: true954}955956Modal.prototype.toggle = function (_relatedTarget) {957return this.isShown ? this.hide() : this.show(_relatedTarget)958}959960Modal.prototype.show = function (_relatedTarget) {961var that = this962var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })963964this.$element.trigger(e)965966if (this.isShown || e.isDefaultPrevented()) return967968this.isShown = true969970this.checkScrollbar()971this.setScrollbar()972this.$body.addClass('modal-open')973974this.escape()975this.resize()976977this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))978979this.$dialog.on('mousedown.dismiss.bs.modal', function () {980that.$element.one('mouseup.dismiss.bs.modal', function (e) {981if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true982})983})984985this.backdrop(function () {986var transition = $.support.transition && that.$element.hasClass('fade')987988if (!that.$element.parent().length) {989that.$element.appendTo(that.$body) // don't move modals dom position990}991992that.$element993.show()994.scrollTop(0)995996that.adjustDialog()997998if (transition) {999that.$element[0].offsetWidth // force reflow1000}10011002that.$element.addClass('in')10031004that.enforceFocus()10051006var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })10071008transition ?1009that.$dialog // wait for modal to slide in1010.one('bsTransitionEnd', function () {1011that.$element.trigger('focus').trigger(e)1012})1013.emulateTransitionEnd(Modal.TRANSITION_DURATION) :1014that.$element.trigger('focus').trigger(e)1015})1016}10171018Modal.prototype.hide = function (e) {1019if (e) e.preventDefault()10201021e = $.Event('hide.bs.modal')10221023this.$element.trigger(e)10241025if (!this.isShown || e.isDefaultPrevented()) return10261027this.isShown = false10281029this.escape()1030this.resize()10311032$(document).off('focusin.bs.modal')10331034this.$element1035.removeClass('in')1036.off('click.dismiss.bs.modal')1037.off('mouseup.dismiss.bs.modal')10381039this.$dialog.off('mousedown.dismiss.bs.modal')10401041$.support.transition && this.$element.hasClass('fade') ?1042this.$element1043.one('bsTransitionEnd', $.proxy(this.hideModal, this))1044.emulateTransitionEnd(Modal.TRANSITION_DURATION) :1045this.hideModal()1046}10471048Modal.prototype.enforceFocus = function () {1049$(document)1050.off('focusin.bs.modal') // guard against infinite focus loop1051.on('focusin.bs.modal', $.proxy(function (e) {1052if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {1053this.$element.trigger('focus')1054}1055}, this))1056}10571058Modal.prototype.escape = function () {1059if (this.isShown && this.options.keyboard) {1060this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {1061e.which == 27 && this.hide()1062}, this))1063} else if (!this.isShown) {1064this.$element.off('keydown.dismiss.bs.modal')1065}1066}10671068Modal.prototype.resize = function () {1069if (this.isShown) {1070$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))1071} else {1072$(window).off('resize.bs.modal')1073}1074}10751076Modal.prototype.hideModal = function () {1077var that = this1078this.$element.hide()1079this.backdrop(function () {1080that.$body.removeClass('modal-open')1081that.resetAdjustments()1082that.resetScrollbar()1083that.$element.trigger('hidden.bs.modal')1084})1085}10861087Modal.prototype.removeBackdrop = function () {1088this.$backdrop && this.$backdrop.remove()1089this.$backdrop = null1090}10911092Modal.prototype.backdrop = function (callback) {1093var that = this1094var animate = this.$element.hasClass('fade') ? 'fade' : ''10951096if (this.isShown && this.options.backdrop) {1097var doAnimate = $.support.transition && animate10981099this.$backdrop = $(document.createElement('div'))1100.addClass('modal-backdrop ' + animate)1101.appendTo(this.$body)11021103this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {1104if (this.ignoreBackdropClick) {1105this.ignoreBackdropClick = false1106return1107}1108if (e.target !== e.currentTarget) return1109this.options.backdrop == 'static'1110? this.$element[0].focus()1111: this.hide()1112}, this))11131114if (doAnimate) this.$backdrop[0].offsetWidth // force reflow11151116this.$backdrop.addClass('in')11171118if (!callback) return11191120doAnimate ?1121this.$backdrop1122.one('bsTransitionEnd', callback)1123.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :1124callback()11251126} else if (!this.isShown && this.$backdrop) {1127this.$backdrop.removeClass('in')11281129var callbackRemove = function () {1130that.removeBackdrop()1131callback && callback()1132}1133$.support.transition && this.$element.hasClass('fade') ?1134this.$backdrop1135.one('bsTransitionEnd', callbackRemove)1136.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :1137callbackRemove()11381139} else if (callback) {1140callback()1141}1142}11431144// these following methods are used to handle overflowing modals11451146Modal.prototype.handleUpdate = function () {1147this.adjustDialog()1148}11491150Modal.prototype.adjustDialog = function () {1151var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight11521153this.$element.css({1154paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',1155paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''1156})1157}11581159Modal.prototype.resetAdjustments = function () {1160this.$element.css({1161paddingLeft: '',1162paddingRight: ''1163})1164}11651166Modal.prototype.checkScrollbar = function () {1167var fullWindowWidth = window.innerWidth1168if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE81169var documentElementRect = document.documentElement.getBoundingClientRect()1170fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)1171}1172this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth1173this.scrollbarWidth = this.measureScrollbar()1174}11751176Modal.prototype.setScrollbar = function () {1177var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)1178this.originalBodyPad = document.body.style.paddingRight || ''1179if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)1180}11811182Modal.prototype.resetScrollbar = function () {1183this.$body.css('padding-right', this.originalBodyPad)1184}11851186Modal.prototype.measureScrollbar = function () { // thx walsh1187var scrollDiv = document.createElement('div')1188scrollDiv.className = 'modal-scrollbar-measure'1189this.$body.append(scrollDiv)1190var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth1191this.$body[0].removeChild(scrollDiv)1192return scrollbarWidth1193}119411951196// MODAL PLUGIN DEFINITION1197// =======================11981199function Plugin(option, _relatedTarget) {1200return this.each(function () {1201var $this = $(this)1202var data = $this.data('bs.modal')1203var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)12041205if (!data) $this.data('bs.modal', (data = new Modal(this, options)))1206if (typeof option == 'string') data[option](_relatedTarget)1207else if (options.show) data.show(_relatedTarget)1208})1209}12101211var old = $.fn.modal12121213$.fn.modal = Plugin1214$.fn.modal.Constructor = Modal121512161217// MODAL NO CONFLICT1218// =================12191220$.fn.modal.noConflict = function () {1221$.fn.modal = old1222return this1223}122412251226// MODAL DATA-API1227// ==============12281229$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {1230var $this = $(this)1231var href = $this.attr('href')1232var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie71233var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())12341235if ($this.is('a')) e.preventDefault()12361237$target.one('show.bs.modal', function (showEvent) {1238if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown1239$target.one('hidden.bs.modal', function () {1240$this.is(':visible') && $this.trigger('focus')1241})1242})1243Plugin.call($target, option, this)1244})12451246}(jQuery);12471248/* ========================================================================1249* Bootstrap: tooltip.js v3.3.51250* http://getbootstrap.com/javascript/#tooltip1251* Inspired by the original jQuery.tipsy by Jason Frame1252* ========================================================================1253* Copyright 2011-2015 Twitter, Inc.1254* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)1255* ======================================================================== */125612571258+function ($) {1259'use strict';12601261// TOOLTIP PUBLIC CLASS DEFINITION1262// ===============================12631264var Tooltip = function (element, options) {1265this.type = null1266this.options = null1267this.enabled = null1268this.timeout = null1269this.hoverState = null1270this.$element = null1271this.inState = null12721273this.init('tooltip', element, options)1274}12751276Tooltip.VERSION = '3.3.5'12771278Tooltip.TRANSITION_DURATION = 15012791280Tooltip.DEFAULTS = {1281animation: true,1282placement: 'top',1283selector: false,1284template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',1285trigger: 'hover focus',1286title: '',1287delay: 0,1288html: false,1289container: false,1290viewport: {1291selector: 'body',1292padding: 01293}1294}12951296Tooltip.prototype.init = function (type, element, options) {1297this.enabled = true1298this.type = type1299this.$element = $(element)1300this.options = this.getOptions(options)1301this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))1302this.inState = { click: false, hover: false, focus: false }13031304if (this.$element[0] instanceof document.constructor && !this.options.selector) {1305throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')1306}13071308var triggers = this.options.trigger.split(' ')13091310for (var i = triggers.length; i--;) {1311var trigger = triggers[i]13121313if (trigger == 'click') {1314this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))1315} else if (trigger != 'manual') {1316var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'1317var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'13181319this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))1320this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))1321}1322}13231324this.options.selector ?1325(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :1326this.fixTitle()1327}13281329Tooltip.prototype.getDefaults = function () {1330return Tooltip.DEFAULTS1331}13321333Tooltip.prototype.getOptions = function (options) {1334options = $.extend({}, this.getDefaults(), this.$element.data(), options)13351336if (options.delay && typeof options.delay == 'number') {1337options.delay = {1338show: options.delay,1339hide: options.delay1340}1341}13421343return options1344}13451346Tooltip.prototype.getDelegateOptions = function () {1347var options = {}1348var defaults = this.getDefaults()13491350this._options && $.each(this._options, function (key, value) {1351if (defaults[key] != value) options[key] = value1352})13531354return options1355}13561357Tooltip.prototype.enter = function (obj) {1358var self = obj instanceof this.constructor ?1359obj : $(obj.currentTarget).data('bs.' + this.type)13601361if (!self) {1362self = new this.constructor(obj.currentTarget, this.getDelegateOptions())1363$(obj.currentTarget).data('bs.' + this.type, self)1364}13651366if (obj instanceof $.Event) {1367self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true1368}13691370if (self.tip().hasClass('in') || self.hoverState == 'in') {1371self.hoverState = 'in'1372return1373}13741375clearTimeout(self.timeout)13761377self.hoverState = 'in'13781379if (!self.options.delay || !self.options.delay.show) return self.show()13801381self.timeout = setTimeout(function () {1382if (self.hoverState == 'in') self.show()1383}, self.options.delay.show)1384}13851386Tooltip.prototype.isInStateTrue = function () {1387for (var key in this.inState) {1388if (this.inState[key]) return true1389}13901391return false1392}13931394Tooltip.prototype.leave = function (obj) {1395var self = obj instanceof this.constructor ?1396obj : $(obj.currentTarget).data('bs.' + this.type)13971398if (!self) {1399self = new this.constructor(obj.currentTarget, this.getDelegateOptions())1400$(obj.currentTarget).data('bs.' + this.type, self)1401}14021403if (obj instanceof $.Event) {1404self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false1405}14061407if (self.isInStateTrue()) return14081409clearTimeout(self.timeout)14101411self.hoverState = 'out'14121413if (!self.options.delay || !self.options.delay.hide) return self.hide()14141415self.timeout = setTimeout(function () {1416if (self.hoverState == 'out') self.hide()1417}, self.options.delay.hide)1418}14191420Tooltip.prototype.show = function () {1421var e = $.Event('show.bs.' + this.type)14221423if (this.hasContent() && this.enabled) {1424this.$element.trigger(e)14251426var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])1427if (e.isDefaultPrevented() || !inDom) return1428var that = this14291430var $tip = this.tip()14311432var tipId = this.getUID(this.type)14331434this.setContent()1435$tip.attr('id', tipId)1436this.$element.attr('aria-describedby', tipId)14371438if (this.options.animation) $tip.addClass('fade')14391440var placement = typeof this.options.placement == 'function' ?1441this.options.placement.call(this, $tip[0], this.$element[0]) :1442this.options.placement14431444var autoToken = /\s?auto?\s?/i1445var autoPlace = autoToken.test(placement)1446if (autoPlace) placement = placement.replace(autoToken, '') || 'top'14471448$tip1449.detach()1450.css({ top: 0, left: 0, display: 'block' })1451.addClass(placement)1452.data('bs.' + this.type, this)14531454this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)1455this.$element.trigger('inserted.bs.' + this.type)14561457var pos = this.getPosition()1458var actualWidth = $tip[0].offsetWidth1459var actualHeight = $tip[0].offsetHeight14601461if (autoPlace) {1462var orgPlacement = placement1463var viewportDim = this.getPosition(this.$viewport)14641465placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :1466placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :1467placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :1468placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :1469placement14701471$tip1472.removeClass(orgPlacement)1473.addClass(placement)1474}14751476var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)14771478this.applyPlacement(calculatedOffset, placement)14791480var complete = function () {1481var prevHoverState = that.hoverState1482that.$element.trigger('shown.bs.' + that.type)1483that.hoverState = null14841485if (prevHoverState == 'out') that.leave(that)1486}14871488$.support.transition && this.$tip.hasClass('fade') ?1489$tip1490.one('bsTransitionEnd', complete)1491.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :1492complete()1493}1494}14951496Tooltip.prototype.applyPlacement = function (offset, placement) {1497var $tip = this.tip()1498var width = $tip[0].offsetWidth1499var height = $tip[0].offsetHeight15001501// manually read margins because getBoundingClientRect includes difference1502var marginTop = parseInt($tip.css('margin-top'), 10)1503var marginLeft = parseInt($tip.css('margin-left'), 10)15041505// we must check for NaN for ie 8/91506if (isNaN(marginTop)) marginTop = 01507if (isNaN(marginLeft)) marginLeft = 015081509offset.top += marginTop1510offset.left += marginLeft15111512// $.fn.offset doesn't round pixel values1513// so we use setOffset directly with our own function B-01514$.offset.setOffset($tip[0], $.extend({1515using: function (props) {1516$tip.css({1517top: Math.round(props.top),1518left: Math.round(props.left)1519})1520}1521}, offset), 0)15221523$tip.addClass('in')15241525// check to see if placing tip in new offset caused the tip to resize itself1526var actualWidth = $tip[0].offsetWidth1527var actualHeight = $tip[0].offsetHeight15281529if (placement == 'top' && actualHeight != height) {1530offset.top = offset.top + height - actualHeight1531}15321533var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)15341535if (delta.left) offset.left += delta.left1536else offset.top += delta.top15371538var isVertical = /top|bottom/.test(placement)1539var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight1540var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'15411542$tip.offset(offset)1543this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)1544}15451546Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {1547this.arrow()1548.css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')1549.css(isVertical ? 'top' : 'left', '')1550}15511552Tooltip.prototype.setContent = function () {1553var $tip = this.tip()1554var title = this.getTitle()15551556$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)1557$tip.removeClass('fade in top bottom left right')1558}15591560Tooltip.prototype.hide = function (callback) {1561var that = this1562var $tip = $(this.$tip)1563var e = $.Event('hide.bs.' + this.type)15641565function complete() {1566if (that.hoverState != 'in') $tip.detach()1567that.$element1568.removeAttr('aria-describedby')1569.trigger('hidden.bs.' + that.type)1570callback && callback()1571}15721573this.$element.trigger(e)15741575if (e.isDefaultPrevented()) return15761577$tip.removeClass('in')15781579$.support.transition && $tip.hasClass('fade') ?1580$tip1581.one('bsTransitionEnd', complete)1582.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :1583complete()15841585this.hoverState = null15861587return this1588}15891590Tooltip.prototype.fixTitle = function () {1591var $e = this.$element1592if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {1593$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')1594}1595}15961597Tooltip.prototype.hasContent = function () {1598return this.getTitle()1599}16001601Tooltip.prototype.getPosition = function ($element) {1602$element = $element || this.$element16031604var el = $element[0]1605var isBody = el.tagName == 'BODY'16061607var elRect = el.getBoundingClientRect()1608if (elRect.width == null) {1609// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/140931610elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })1611}1612var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()1613var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }1614var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null16151616return $.extend({}, elRect, scroll, outerDims, elOffset)1617}16181619Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {1620return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :1621placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :1622placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :1623/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }16241625}16261627Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {1628var delta = { top: 0, left: 0 }1629if (!this.$viewport) return delta16301631var viewportPadding = this.options.viewport && this.options.viewport.padding || 01632var viewportDimensions = this.getPosition(this.$viewport)16331634if (/right|left/.test(placement)) {1635var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll1636var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight1637if (topEdgeOffset < viewportDimensions.top) { // top overflow1638delta.top = viewportDimensions.top - topEdgeOffset1639} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow1640delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset1641}1642} else {1643var leftEdgeOffset = pos.left - viewportPadding1644var rightEdgeOffset = pos.left + viewportPadding + actualWidth1645if (leftEdgeOffset < viewportDimensions.left) { // left overflow1646delta.left = viewportDimensions.left - leftEdgeOffset1647} else if (rightEdgeOffset > viewportDimensions.right) { // right overflow1648delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset1649}1650}16511652return delta1653}16541655Tooltip.prototype.getTitle = function () {1656var title1657var $e = this.$element1658var o = this.options16591660title = $e.attr('data-original-title')1661|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)16621663return title1664}16651666Tooltip.prototype.getUID = function (prefix) {1667do prefix += ~~(Math.random() * 1000000)1668while (document.getElementById(prefix))1669return prefix1670}16711672Tooltip.prototype.tip = function () {1673if (!this.$tip) {1674this.$tip = $(this.options.template)1675if (this.$tip.length != 1) {1676throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')1677}1678}1679return this.$tip1680}16811682Tooltip.prototype.arrow = function () {1683return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))1684}16851686Tooltip.prototype.enable = function () {1687this.enabled = true1688}16891690Tooltip.prototype.disable = function () {1691this.enabled = false1692}16931694Tooltip.prototype.toggleEnabled = function () {1695this.enabled = !this.enabled1696}16971698Tooltip.prototype.toggle = function (e) {1699var self = this1700if (e) {1701self = $(e.currentTarget).data('bs.' + this.type)1702if (!self) {1703self = new this.constructor(e.currentTarget, this.getDelegateOptions())1704$(e.currentTarget).data('bs.' + this.type, self)1705}1706}17071708if (e) {1709self.inState.click = !self.inState.click1710if (self.isInStateTrue()) self.enter(self)1711else self.leave(self)1712} else {1713self.tip().hasClass('in') ? self.leave(self) : self.enter(self)1714}1715}17161717Tooltip.prototype.destroy = function () {1718var that = this1719clearTimeout(this.timeout)1720this.hide(function () {1721that.$element.off('.' + that.type).removeData('bs.' + that.type)1722if (that.$tip) {1723that.$tip.detach()1724}1725that.$tip = null1726that.$arrow = null1727that.$viewport = null1728})1729}173017311732// TOOLTIP PLUGIN DEFINITION1733// =========================17341735function Plugin(option) {1736return this.each(function () {1737var $this = $(this)1738var data = $this.data('bs.tooltip')1739var options = typeof option == 'object' && option17401741if (!data && /destroy|hide/.test(option)) return1742if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))1743if (typeof option == 'string') data[option]()1744})1745}17461747var old = $.fn.tooltip17481749$.fn.tooltip = Plugin1750$.fn.tooltip.Constructor = Tooltip175117521753// TOOLTIP NO CONFLICT1754// ===================17551756$.fn.tooltip.noConflict = function () {1757$.fn.tooltip = old1758return this1759}17601761}(jQuery);17621763/* ========================================================================1764* Bootstrap: popover.js v3.3.51765* http://getbootstrap.com/javascript/#popovers1766* ========================================================================1767* Copyright 2011-2015 Twitter, Inc.1768* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)1769* ======================================================================== */177017711772+function ($) {1773'use strict';17741775// POPOVER PUBLIC CLASS DEFINITION1776// ===============================17771778var Popover = function (element, options) {1779this.init('popover', element, options)1780}17811782if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')17831784Popover.VERSION = '3.3.5'17851786Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {1787placement: 'right',1788trigger: 'click',1789content: '',1790template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'1791})179217931794// NOTE: POPOVER EXTENDS tooltip.js1795// ================================17961797Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)17981799Popover.prototype.constructor = Popover18001801Popover.prototype.getDefaults = function () {1802return Popover.DEFAULTS1803}18041805Popover.prototype.setContent = function () {1806var $tip = this.tip()1807var title = this.getTitle()1808var content = this.getContent()18091810$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)1811$tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events1812this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'1813](content)18141815$tip.removeClass('fade top bottom left right in')18161817// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do1818// this manually by checking the contents.1819if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()1820}18211822Popover.prototype.hasContent = function () {1823return this.getTitle() || this.getContent()1824}18251826Popover.prototype.getContent = function () {1827var $e = this.$element1828var o = this.options18291830return $e.attr('data-content')1831|| (typeof o.content == 'function' ?1832o.content.call($e[0]) :1833o.content)1834}18351836Popover.prototype.arrow = function () {1837return (this.$arrow = this.$arrow || this.tip().find('.arrow'))1838}183918401841// POPOVER PLUGIN DEFINITION1842// =========================18431844function Plugin(option) {1845return this.each(function () {1846var $this = $(this)1847var data = $this.data('bs.popover')1848var options = typeof option == 'object' && option18491850if (!data && /destroy|hide/.test(option)) return1851if (!data) $this.data('bs.popover', (data = new Popover(this, options)))1852if (typeof option == 'string') data[option]()1853})1854}18551856var old = $.fn.popover18571858$.fn.popover = Plugin1859$.fn.popover.Constructor = Popover186018611862// POPOVER NO CONFLICT1863// ===================18641865$.fn.popover.noConflict = function () {1866$.fn.popover = old1867return this1868}18691870}(jQuery);18711872/* ========================================================================1873* Bootstrap: scrollspy.js v3.3.51874* http://getbootstrap.com/javascript/#scrollspy1875* ========================================================================1876* Copyright 2011-2015 Twitter, Inc.1877* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)1878* ======================================================================== */187918801881+function ($) {1882'use strict';18831884// SCROLLSPY CLASS DEFINITION1885// ==========================18861887function ScrollSpy(element, options) {1888this.$body = $(document.body)1889this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)1890this.options = $.extend({}, ScrollSpy.DEFAULTS, options)1891this.selector = (this.options.target || '') + ' .nav li > a'1892this.offsets = []1893this.targets = []1894this.activeTarget = null1895this.scrollHeight = 018961897this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))1898this.refresh()1899this.process()1900}19011902ScrollSpy.VERSION = '3.3.5'19031904ScrollSpy.DEFAULTS = {1905offset: 101906}19071908ScrollSpy.prototype.getScrollHeight = function () {1909return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)1910}19111912ScrollSpy.prototype.refresh = function () {1913var that = this1914var offsetMethod = 'offset'1915var offsetBase = 019161917this.offsets = []1918this.targets = []1919this.scrollHeight = this.getScrollHeight()19201921if (!$.isWindow(this.$scrollElement[0])) {1922offsetMethod = 'position'1923offsetBase = this.$scrollElement.scrollTop()1924}19251926this.$body1927.find(this.selector)1928.map(function () {1929var $el = $(this)1930var href = $el.data('target') || $el.attr('href')1931var $href = /^#./.test(href) && $(href)19321933return ($href1934&& $href.length1935&& $href.is(':visible')1936&& [[$href[offsetMethod]().top + offsetBase, href]]) || null1937})1938.sort(function (a, b) { return a[0] - b[0] })1939.each(function () {1940that.offsets.push(this[0])1941that.targets.push(this[1])1942})1943}19441945ScrollSpy.prototype.process = function () {1946var scrollTop = this.$scrollElement.scrollTop() + this.options.offset1947var scrollHeight = this.getScrollHeight()1948var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()1949var offsets = this.offsets1950var targets = this.targets1951var activeTarget = this.activeTarget1952var i19531954if (this.scrollHeight != scrollHeight) {1955this.refresh()1956}19571958if (scrollTop >= maxScroll) {1959return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)1960}19611962if (activeTarget && scrollTop < offsets[0]) {1963this.activeTarget = null1964return this.clear()1965}19661967for (i = offsets.length; i--;) {1968activeTarget != targets[i]1969&& scrollTop >= offsets[i]1970&& (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])1971&& this.activate(targets[i])1972}1973}19741975ScrollSpy.prototype.activate = function (target) {1976this.activeTarget = target19771978this.clear()19791980var selector = this.selector +1981'[data-target="' + target + '"],' +1982this.selector + '[href="' + target + '"]'19831984var active = $(selector)1985.parents('li')1986.addClass('active')19871988if (active.parent('.dropdown-menu').length) {1989active = active1990.closest('li.dropdown')1991.addClass('active')1992}19931994active.trigger('activate.bs.scrollspy')1995}19961997ScrollSpy.prototype.clear = function () {1998$(this.selector)1999.parentsUntil(this.options.target, '.active')2000.removeClass('active')2001}200220032004// SCROLLSPY PLUGIN DEFINITION2005// ===========================20062007function Plugin(option) {2008return this.each(function () {2009var $this = $(this)2010var data = $this.data('bs.scrollspy')2011var options = typeof option == 'object' && option20122013if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))2014if (typeof option == 'string') data[option]()2015})2016}20172018var old = $.fn.scrollspy20192020$.fn.scrollspy = Plugin2021$.fn.scrollspy.Constructor = ScrollSpy202220232024// SCROLLSPY NO CONFLICT2025// =====================20262027$.fn.scrollspy.noConflict = function () {2028$.fn.scrollspy = old2029return this2030}203120322033// SCROLLSPY DATA-API2034// ==================20352036$(window).on('load.bs.scrollspy.data-api', function () {2037$('[data-spy="scroll"]').each(function () {2038var $spy = $(this)2039Plugin.call($spy, $spy.data())2040})2041})20422043}(jQuery);20442045/* ========================================================================2046* Bootstrap: tab.js v3.3.52047* http://getbootstrap.com/javascript/#tabs2048* ========================================================================2049* Copyright 2011-2015 Twitter, Inc.2050* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)2051* ======================================================================== */205220532054+function ($) {2055'use strict';20562057// TAB CLASS DEFINITION2058// ====================20592060var Tab = function (element) {2061// jscs:disable requireDollarBeforejQueryAssignment2062this.element = $(element)2063// jscs:enable requireDollarBeforejQueryAssignment2064}20652066Tab.VERSION = '3.3.5'20672068Tab.TRANSITION_DURATION = 15020692070Tab.prototype.show = function () {2071var $this = this.element2072var $ul = $this.closest('ul:not(.dropdown-menu)')2073var selector = $this.data('target')20742075if (!selector) {2076selector = $this.attr('href')2077selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie72078}20792080if ($this.parent('li').hasClass('active')) return20812082var $previous = $ul.find('.active:last a')2083var hideEvent = $.Event('hide.bs.tab', {2084relatedTarget: $this[0]2085})2086var showEvent = $.Event('show.bs.tab', {2087relatedTarget: $previous[0]2088})20892090$previous.trigger(hideEvent)2091$this.trigger(showEvent)20922093if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return20942095var $target = $(selector)20962097this.activate($this.closest('li'), $ul)2098this.activate($target, $target.parent(), function () {2099$previous.trigger({2100type: 'hidden.bs.tab',2101relatedTarget: $this[0]2102})2103$this.trigger({2104type: 'shown.bs.tab',2105relatedTarget: $previous[0]2106})2107})2108}21092110Tab.prototype.activate = function (element, container, callback) {2111var $active = container.find('> .active')2112var transition = callback2113&& $.support.transition2114&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)21152116function next() {2117$active2118.removeClass('active')2119.find('> .dropdown-menu > .active')2120.removeClass('active')2121.end()2122.find('[data-toggle="tab"]')2123.attr('aria-expanded', false)21242125element2126.addClass('active')2127.find('[data-toggle="tab"]')2128.attr('aria-expanded', true)21292130if (transition) {2131element[0].offsetWidth // reflow for transition2132element.addClass('in')2133} else {2134element.removeClass('fade')2135}21362137if (element.parent('.dropdown-menu').length) {2138element2139.closest('li.dropdown')2140.addClass('active')2141.end()2142.find('[data-toggle="tab"]')2143.attr('aria-expanded', true)2144}21452146callback && callback()2147}21482149$active.length && transition ?2150$active2151.one('bsTransitionEnd', next)2152.emulateTransitionEnd(Tab.TRANSITION_DURATION) :2153next()21542155$active.removeClass('in')2156}215721582159// TAB PLUGIN DEFINITION2160// =====================21612162function Plugin(option) {2163return this.each(function () {2164var $this = $(this)2165var data = $this.data('bs.tab')21662167if (!data) $this.data('bs.tab', (data = new Tab(this)))2168if (typeof option == 'string') data[option]()2169})2170}21712172var old = $.fn.tab21732174$.fn.tab = Plugin2175$.fn.tab.Constructor = Tab217621772178// TAB NO CONFLICT2179// ===============21802181$.fn.tab.noConflict = function () {2182$.fn.tab = old2183return this2184}218521862187// TAB DATA-API2188// ============21892190var clickHandler = function (e) {2191e.preventDefault()2192Plugin.call($(this), 'show')2193}21942195$(document)2196.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)2197.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)21982199}(jQuery);22002201/* ========================================================================2202* Bootstrap: affix.js v3.3.52203* http://getbootstrap.com/javascript/#affix2204* ========================================================================2205* Copyright 2011-2015 Twitter, Inc.2206* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)2207* ======================================================================== */220822092210+function ($) {2211'use strict';22122213// AFFIX CLASS DEFINITION2214// ======================22152216var Affix = function (element, options) {2217this.options = $.extend({}, Affix.DEFAULTS, options)22182219this.$target = $(this.options.target)2220.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))2221.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))22222223this.$element = $(element)2224this.affixed = null2225this.unpin = null2226this.pinnedOffset = null22272228this.checkPosition()2229}22302231Affix.VERSION = '3.3.5'22322233Affix.RESET = 'affix affix-top affix-bottom'22342235Affix.DEFAULTS = {2236offset: 0,2237target: window2238}22392240Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {2241var scrollTop = this.$target.scrollTop()2242var position = this.$element.offset()2243var targetHeight = this.$target.height()22442245if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false22462247if (this.affixed == 'bottom') {2248if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'2249return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'2250}22512252var initializing = this.affixed == null2253var colliderTop = initializing ? scrollTop : position.top2254var colliderHeight = initializing ? targetHeight : height22552256if (offsetTop != null && scrollTop <= offsetTop) return 'top'2257if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'22582259return false2260}22612262Affix.prototype.getPinnedOffset = function () {2263if (this.pinnedOffset) return this.pinnedOffset2264this.$element.removeClass(Affix.RESET).addClass('affix')2265var scrollTop = this.$target.scrollTop()2266var position = this.$element.offset()2267return (this.pinnedOffset = position.top - scrollTop)2268}22692270Affix.prototype.checkPositionWithEventLoop = function () {2271setTimeout($.proxy(this.checkPosition, this), 1)2272}22732274Affix.prototype.checkPosition = function () {2275if (!this.$element.is(':visible')) return22762277var height = this.$element.height()2278var offset = this.options.offset2279var offsetTop = offset.top2280var offsetBottom = offset.bottom2281var scrollHeight = Math.max($(document).height(), $(document.body).height())22822283if (typeof offset != 'object') offsetBottom = offsetTop = offset2284if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)2285if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)22862287var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)22882289if (this.affixed != affix) {2290if (this.unpin != null) this.$element.css('top', '')22912292var affixType = 'affix' + (affix ? '-' + affix : '')2293var e = $.Event(affixType + '.bs.affix')22942295this.$element.trigger(e)22962297if (e.isDefaultPrevented()) return22982299this.affixed = affix2300this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null23012302this.$element2303.removeClass(Affix.RESET)2304.addClass(affixType)2305.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')2306}23072308if (affix == 'bottom') {2309this.$element.offset({2310top: scrollHeight - height - offsetBottom2311})2312}2313}231423152316// AFFIX PLUGIN DEFINITION2317// =======================23182319function Plugin(option) {2320return this.each(function () {2321var $this = $(this)2322var data = $this.data('bs.affix')2323var options = typeof option == 'object' && option23242325if (!data) $this.data('bs.affix', (data = new Affix(this, options)))2326if (typeof option == 'string') data[option]()2327})2328}23292330var old = $.fn.affix23312332$.fn.affix = Plugin2333$.fn.affix.Constructor = Affix233423352336// AFFIX NO CONFLICT2337// =================23382339$.fn.affix.noConflict = function () {2340$.fn.affix = old2341return this2342}234323442345// AFFIX DATA-API2346// ==============23472348$(window).on('load', function () {2349$('[data-spy="affix"]').each(function () {2350var $spy = $(this)2351var data = $spy.data()23522353data.offset = data.offset || {}23542355if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom2356if (data.offsetTop != null) data.offset.top = data.offsetTop23572358Plugin.call($spy, data)2359})2360})23612362}(jQuery);236323642365