/* ========================================================================
* bootstrap: alert.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#alerts
* ========================================================================
* copyright 2013 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// alert class definition
// ======================
var dismiss = '[data-dismiss="alert"]'
var alert = function (el) {
$(el).on('click', dismiss, this.close)
}
alert.prototype.close = function (e) {
var $this = $(this)
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = $(selector)
if (e) e.preventdefault()
if (!$parent.length) {
$parent = $this.hasclass('alert') ? $this : $this.parent()
}
$parent.trigger(e = $.event('close.bs.alert'))
if (e.isdefaultprevented()) return
$parent.removeclass('in')
function removeelement() {
$parent.trigger('closed.bs.alert').remove()
}
$.support.transition && $parent.hasclass('fade') ?
$parent
.one($.support.transition.end, removeelement)
.emulatetransitionend(150) :
removeelement()
}
// alert plugin definition
// =======================
var old = $.fn.alert
$.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.alert')
if (!data) $this.data('bs.alert', (data = new alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$.fn.alert.constructor = alert
// alert no conflict
// =================
$.fn.alert.noconflict = function () {
$.fn.alert = old
return this
}
// alert data-api
// ==============
$(document).on('click.bs.alert.data-api', dismiss, alert.prototype.close)
}(window.jquery);
/* ========================================================================
* bootstrap: button.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#buttons
* ========================================================================
* copyright 2013 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// button public class definition
// ==============================
var button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, button.defaults, options)
}
button.defaults = {
loadingtext: 'loading...'
}
button.prototype.setstate = function (state) {
var d = 'disabled'
var $el = this.$element
var val = $el.is('input') ? 'val' : 'html'
var data = $el.data()
state = state + 'text'
if (!data.resettext) $el.data('resettext', $el[val]())
$el[val](data[state] || this.options[state])
// push to event loop to allow forms to submit
settimeout(function () {
state == 'loadingtext' ?
$el.addclass(d).attr(d, d) :
$el.removeclass(d).removeattr(d);
}, 0)
}
button.prototype.toggle = function () {
var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) {
var $input = this.$element.find('input')
.prop('checked', !this.$element.hasclass('active'))
.trigger('change')
if ($input.prop('type') === 'radio') $parent.find('.active').removeclass('active')
}
this.$element.toggleclass('active')
}
// button plugin definition
// ========================
var old = $.fn.button
$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.button')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setstate(option)
})
}
$.fn.button.constructor = button
// button no conflict
// ==================
$.fn.button.noconflict = function () {
$.fn.button = old
return this
}
// button data-api
// ===============
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
var $btn = $(e.target)
if (!$btn.hasclass('btn')) $btn = $btn.closest('.btn')
$btn.button('toggle')
e.preventdefault()
})
}(window.jquery);
/* ========================================================================
* bootstrap: carousel.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#carousel
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// carousel class definition
// =========================
var carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused =
this.sliding =
this.interval =
this.$active =
this.$items = null
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this))
}
carousel.defaults = {
interval: 5000
, pause: 'hover'
, wrap: true
}
carousel.prototype.cycle = function (e) {
e || (this.paused = false)
this.interval && clearinterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval = setinterval($.proxy(this.next, this), this.options.interval))
return this
}
carousel.prototype.getactiveindex = function () {
this.$active = this.$element.find('.item.active')
this.$items = this.$active.parent().children()
return this.$items.index(this.$active)
}
carousel.prototype.to = function (pos) {
var that = this
var activeindex = this.getactiveindex()
if (pos > (this.$items.length - 1) || pos < 0) return
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
if (activeindex == pos) return this.pause().cycle()
return this.slide(pos > activeindex ? 'next' : 'prev', $(this.$items[pos]))
}
carousel.prototype.pause = function (e) {
e || (this.paused = true)
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval = clearinterval(this.interval)
return this
}
carousel.prototype.next = function () {
if (this.sliding) return
return this.slide('next')
}
carousel.prototype.prev = function () {
if (this.sliding) return
return this.slide('prev')
}
carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || $active[type]()
var iscycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
var fallback = type == 'next' ? 'first' : 'last'
var that = this
if (!$next.length) {
if (!this.options.wrap) return
$next = this.$element.find('.item')[fallback]()
}
this.sliding = true
iscycling && this.pause()
var e = $.event('slide.bs.carousel', { relatedtarget: $next[0], direction: direction })
if ($next.hasclass('active')) return
if (this.$indicators.length) {
this.$indicators.find('.active').removeclass('active')
this.$element.one('slid', function () {
var $nextindicator = $(that.$indicators.children()[that.getactiveindex()])
$nextindicator && $nextindicator.addclass('active')
})
}
if ($.support.transition && this.$element.hasclass('slide')) {
this.$element.trigger(e)
if (e.isdefaultprevented()) return
$next.addclass(type)
$next[0].offsetwidth // force reflow
$active.addclass(direction)
$next.addclass(direction)
$active
.one($.support.transition.end, function () {
$next.removeclass([type, direction].join(' ')).addclass('active')
$active.removeclass(['active', direction].join(' '))
that.sliding = false
settimeout(function () { that.$element.trigger('slid') }, 0)
})
.emulatetransitionend(600)
} else {
this.$element.trigger(e)
if (e.isdefaultprevented()) return
$active.removeclass('active')
$next.addclass('active')
this.sliding = false
this.$element.trigger('slid')
}
iscycling && this.cycle()
return this
}
// carousel plugin definition
// ==========================
var old = $.fn.carousel
$.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.carousel')
var options = $.extend({}, carousel.defaults, $this.data(), typeof option == 'object' && option)
var action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('bs.carousel', (data = new carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.pause().cycle()
})
}
$.fn.carousel.constructor = carousel
// carousel no conflict
// ====================
$.fn.carousel.noconflict = function () {
$.fn.carousel = old
return this
}
// carousel data-api
// =================
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
var options = $.extend({}, $target.data(), $this.data())
var slideindex = $this.attr('data-slide-to')
if (slideindex) options.interval = false
$target.carousel(options)
if (slideindex = $this.attr('data-slide-to')) {
$target.data('bs.carousel').to(slideindex)
}
e.preventdefault()
})
$(window).on('load', function () {
$('[data-ride="carousel"]').each(function () {
var $carousel = $(this)
$carousel.carousel($carousel.data())
})
})
}(window.jquery);
/* ========================================================================
* bootstrap: dropdown.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#dropdowns
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// dropdown class definition
// =========================
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle=dropdown]'
var dropdown = function (element) {
var $el = $(element).on('click.bs.dropdown', this.toggle)
}
dropdown.prototype.toggle = function (e) {
var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getparent($this)
var isactive = $parent.hasclass('open')
clearmenus()
if (!isactive) {
if ('ontouchstart' in document.documentelement && !$parent.closest('.navbar-nav').length) {
// if mobile we we use a backdrop because click events don't delegate
$('
').insertafter($(this)).on('click', clearmenus)
}
$parent.trigger(e = $.event('show.bs.dropdown'))
if (e.isdefaultprevented()) return
$parent
.toggleclass('open')
.trigger('shown.bs.dropdown')
$this.focus()
}
return false
}
dropdown.prototype.keydown = function (e) {
if (!/(38|40|27)/.test(e.keycode)) return
var $this = $(this)
e.preventdefault()
e.stoppropagation()
if ($this.is('.disabled, :disabled')) return
var $parent = getparent($this)
var isactive = $parent.hasclass('open')
if (!isactive || (isactive && e.keycode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
}
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
if (!$items.length) return
var index = $items.index($items.filter(':focus'))
if (e.keycode == 38 && index > 0) index-- // up
if (e.keycode == 40 && index < $items.length - 1) index++ // down
if (!~index) index=0
$items.eq(index).focus()
}
function clearmenus() {
$(backdrop).remove()
$(toggle).each(function (e) {
var $parent = getparent($(this))
if (!$parent.hasclass('open')) return
$parent.trigger(e = $.event('hide.bs.dropdown'))
if (e.isdefaultprevented()) return
$parent.removeclass('open').trigger('hidden.bs.dropdown')
})
}
function getparent($this) {
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}
// dropdown plugin definition
// ==========================
var old = $.fn.dropdown
$.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('dropdown')
if (!data) $this.data('dropdown', (data = new dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$.fn.dropdown.constructor = dropdown
// dropdown no conflict
// ====================
$.fn.dropdown.noconflict = function () {
$.fn.dropdown = old
return this
}
// apply to standard dropdown elements
// ===================================
$(document)
.on('click.bs.dropdown.data-api', clearmenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stoppropagation() })
.on('click.bs.dropdown.data-api' , toggle, dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , dropdown.prototype.keydown)
}(window.jquery);
/* ========================================================================
* bootstrap: modal.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#modals
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// modal class definition
// ======================
var modal = function (element, options) {
this.options = options
this.$element = $(element)
this.$backdrop =
this.isshown = null
if (this.options.remote) this.$element.load(this.options.remote)
}
modal.defaults = {
backdrop: true
, keyboard: true
, show: true
}
modal.prototype.toggle = function (_relatedtarget) {
return this[!this.isshown ? 'show' : 'hide'](_relatedtarget)
}
modal.prototype.show = function (_relatedtarget) {
var that = this
var e = $.event('show.bs.modal', { relatedtarget: _relatedtarget })
this.$element.trigger(e)
if (this.isshown || e.isdefaultprevented()) return
this.isshown = true
this.escape()
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasclass('fade')
if (!that.$element.parent().length) {
that.$element.appendto(document.body) // don't move modals dom position
}
that.$element.show()
if (transition) {
that.$element[0].offsetwidth // force reflow
}
that.$element
.addclass('in')
.attr('aria-hidden', false)
that.enforcefocus()
var e = $.event('shown.bs.modal', { relatedtarget: _relatedtarget })
transition ?
that.$element.find('.modal-dialog') // wait for modal to slide in
.one($.support.transition.end, function () {
that.$element.focus().trigger(e)
})
.emulatetransitionend(300) :
that.$element.focus().trigger(e)
})
}
modal.prototype.hide = function (e) {
if (e) e.preventdefault()
e = $.event('hide.bs.modal')
this.$element.trigger(e)
if (!this.isshown || e.isdefaultprevented()) return
this.isshown = false
this.escape()
$(document).off('focusin.bs.modal')
this.$element
.removeclass('in')
.attr('aria-hidden', true)
.off('click.dismiss.modal')
$.support.transition && this.$element.hasclass('fade') ?
this.$element
.one($.support.transition.end, $.proxy(this.hidemodal, this))
.emulatetransitionend(300) :
this.hidemodal()
}
modal.prototype.enforcefocus = function () {
$(document)
.off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.focus()
}
}, this))
}
modal.prototype.escape = function () {
if (this.isshown && this.options.keyboard) {
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide()
}, this))
} else if (!this.isshown) {
this.$element.off('keyup.dismiss.bs.modal')
}
}
modal.prototype.hidemodal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.removebackdrop()
that.$element.trigger('hidden.bs.modal')
})
}
modal.prototype.removebackdrop = function () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasclass('fade') ? 'fade' : ''
if (this.isshown && this.options.backdrop) {
var doanimate = $.support.transition && animate
this.$backdrop = $('')
.appendto(document.body)
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
if (e.target !== e.currenttarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
: this.hide.call(this)
}, this))
if (doanimate) this.$backdrop[0].offsetwidth // force reflow
this.$backdrop.addclass('in')
if (!callback) return
doanimate ?
this.$backdrop
.one($.support.transition.end, callback)
.emulatetransitionend(150) :
callback()
} else if (!this.isshown && this.$backdrop) {
this.$backdrop.removeclass('in')
$.support.transition && this.$element.hasclass('fade')?
this.$backdrop
.one($.support.transition.end, callback)
.emulatetransitionend(150) :
callback()
} else if (callback) {
callback()
}
}
// modal plugin definition
// =======================
var old = $.fn.modal
$.fn.modal = function (option, _relatedtarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, modal.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new modal(this, options)))
if (typeof option == 'string') data[option](_relatedtarget)
else if (options.show) data.show(_relatedtarget)
})
}
$.fn.modal.constructor = modal
// modal no conflict
// =================
$.fn.modal.noconflict = function () {
$.fn.modal = old
return this
}
// modal data-api
// ==============
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
e.preventdefault()
$target
.modal(option, this)
.one('hide', function () {
$this.is(':visible') && $this.focus()
})
})
$(document)
.on('show.bs.modal', '.modal', function () { $(document.body).addclass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeclass('modal-open') })
}(window.jquery);
/* ========================================================================
* bootstrap: tooltip.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#tooltip
* inspired by the original jquery.tipsy by jason frame
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// tooltip public class definition
// ===============================
var tooltip = function (element, options) {
this.type =
this.options =
this.enabled =
this.timeout =
this.hoverstate =
this.$element = null
this.init('tooltip', element, options)
}
tooltip.defaults = {
animation: true
, placement: 'top'
, selector: false
, template: ''
, trigger: 'hover focus'
, title: ''
, delay: 0
, html: false
, container: false
}
tooltip.prototype.init = function (type, element, options) {
this.enabled = true
this.type = type
this.$element = $(element)
this.options = this.getoptions(options)
var triggers = this.options.trigger.split(' ')
for (var i = triggers.length; i--;) {
var trigger = triggers[i]
if (trigger == 'click') {
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (trigger != 'manual') {
var eventin = trigger == 'hover' ? 'mouseenter' : 'focus'
var eventout = trigger == 'hover' ? 'mouseleave' : 'blur'
this.$element.on(eventin + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventout + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
this.options.selector ?
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixtitle()
}
tooltip.prototype.getdefaults = function () {
return tooltip.defaults
}
tooltip.prototype.getoptions = function (options) {
options = $.extend({}, this.getdefaults(), this.$element.data(), options)
if (options.delay && typeof options.delay == 'number') {
options.delay = {
show: options.delay
, hide: options.delay
}
}
return options
}
tooltip.prototype.getdelegateoptions = function () {
var options = {}
var defaults = this.getdefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
return options
}
tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currenttarget)[this.type](this.getdelegateoptions()).data('bs.' + this.type)
cleartimeout(self.timeout)
self.hoverstate = 'in'
if (!self.options.delay || !self.options.delay.show) return self.show()
self.timeout = settimeout(function () {
if (self.hoverstate == 'in') self.show()
}, self.options.delay.show)
}
tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currenttarget)[this.type](this.getdelegateoptions()).data('bs.' + this.type)
cleartimeout(self.timeout)
self.hoverstate = 'out'
if (!self.options.delay || !self.options.delay.hide) return self.hide()
self.timeout = settimeout(function () {
if (self.hoverstate == 'out') self.hide()
}, self.options.delay.hide)
}
tooltip.prototype.show = function () {
var e = $.event('show.bs.'+ this.type)
if (this.hascontent() && this.enabled) {
this.$element.trigger(e)
if (e.isdefaultprevented()) return
var $tip = this.tip()
this.setcontent()
if (this.options.animation) $tip.addclass('fade')
var placement = typeof this.options.placement == 'function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
var autotoken = /\s?auto?\s?/i
var autoplace = autotoken.test(placement)
if (autoplace) placement = placement.replace(autotoken, '') || 'top'
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.addclass(placement)
this.options.container ? $tip.appendto(this.options.container) : $tip.insertafter(this.$element)
var pos = this.getposition()
var actualwidth = $tip[0].offsetwidth
var actualheight = $tip[0].offsetheight
if (autoplace) {
var $parent = this.$element.parent()
var orgplacement = placement
var docscroll = document.documentelement.scrolltop || document.body.scrolltop
var parentwidth = this.options.container == 'body' ? window.innerwidth : $parent.outerwidth()
var parentheight = this.options.container == 'body' ? window.innerheight : $parent.outerheight()
var parentleft = this.options.container == 'body' ? 0 : $parent.offset().left
placement = placement == 'bottom' && pos.top + pos.height + actualheight - docscroll > parentheight ? 'top' :
placement == 'top' && pos.top - docscroll - actualheight < 0 ? 'bottom' :
placement == 'right' && pos.right + actualwidth > parentwidth ? 'left' :
placement == 'left' && pos.left - actualwidth < parentleft ? 'right' :
placement
$tip
.removeclass(orgplacement)
.addclass(placement)
}
var calculatedoffset = this.getcalculatedoffset(placement, pos, actualwidth, actualheight)
this.applyplacement(calculatedoffset, placement)
this.$element.trigger('shown.bs.' + this.type)
}
}
tooltip.prototype.applyplacement = function(offset, placement) {
var replace
var $tip = this.tip()
var width = $tip[0].offsetwidth
var height = $tip[0].offsetheight
// manually read margins because getboundingclientrect includes difference
var margintop = parseint($tip.css('margin-top'), 10)
var marginleft = parseint($tip.css('margin-left'), 10)
// we must check for nan for ie 8/9
if (isnan(margintop)) margintop = 0
if (isnan(marginleft)) marginleft = 0
offset.top = offset.top + margintop
offset.left = offset.left + marginleft
$tip
.offset(offset)
.addclass('in')
// check to see if placing tip in new offset caused the tip to resize itself
var actualwidth = $tip[0].offsetwidth
var actualheight = $tip[0].offsetheight
if (placement == 'top' && actualheight != height) {
replace = true
offset.top = offset.top + height - actualheight
}
if (/bottom|top/.test(placement)) {
var delta = 0
if (offset.left < 0) {
delta = offset.left * -2
offset.left = 0
$tip.offset(offset)
actualwidth = $tip[0].offsetwidth
actualheight = $tip[0].offsetheight
}
this.replacearrow(delta - width + actualwidth, actualwidth, 'left')
} else {
this.replacearrow(actualheight - height, actualheight, 'top')
}
if (replace) $tip.offset(offset)
}
tooltip.prototype.replacearrow = function(delta, dimension, position) {
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
}
tooltip.prototype.setcontent = function () {
var $tip = this.tip()
var title = this.gettitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.removeclass('fade in top bottom left right')
}
tooltip.prototype.hide = function () {
var that = this
var $tip = this.tip()
var e = $.event('hide.bs.' + this.type)
function complete() {
if (that.hoverstate != 'in') $tip.detach()
}
this.$element.trigger(e)
if (e.isdefaultprevented()) return
$tip.removeclass('in')
$.support.transition && this.$tip.hasclass('fade') ?
$tip
.one($.support.transition.end, complete)
.emulatetransitionend(150) :
complete()
this.$element.trigger('hidden.bs.' + this.type)
return this
}
tooltip.prototype.fixtitle = function () {
var $e = this.$element
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
tooltip.prototype.hascontent = function () {
return this.gettitle()
}
tooltip.prototype.getposition = function () {
var el = this.$element[0]
return $.extend({}, (typeof el.getboundingclientrect == 'function') ? el.getboundingclientrect() : {
width: el.offsetwidth
, height: el.offsetheight
}, this.$element.offset())
}
tooltip.prototype.getcalculatedoffset = function (placement, pos, actualwidth, actualheight) {
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualwidth / 2 } :
placement == 'top' ? { top: pos.top - actualheight, left: pos.left + pos.width / 2 - actualwidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualheight / 2, left: pos.left - actualwidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualheight / 2, left: pos.left + pos.width }
}
tooltip.prototype.gettitle = function () {
var title
var $e = this.$element
var o = this.options
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title
}
tooltip.prototype.tip = function () {
return this.$tip = this.$tip || $(this.options.template)
}
tooltip.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
}
tooltip.prototype.validate = function () {
if (!this.$element[0].parentnode) {
this.hide()
this.$element = null
this.options = null
}
}
tooltip.prototype.enable = function () {
this.enabled = true
}
tooltip.prototype.disable = function () {
this.enabled = false
}
tooltip.prototype.toggleenabled = function () {
this.enabled = !this.enabled
}
tooltip.prototype.toggle = function (e) {
var self = e ? $(e.currenttarget)[this.type](this.getdelegateoptions()).data('bs.' + this.type) : this
self.tip().hasclass('in') ? self.leave(self) : self.enter(self)
}
tooltip.prototype.destroy = function () {
this.hide().$element.off('.' + this.type).removedata('bs.' + this.type)
}
// tooltip plugin definition
// =========================
var old = $.fn.tooltip
$.fn.tooltip = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.tooltip', (data = new tooltip(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tooltip.constructor = tooltip
// tooltip no conflict
// ===================
$.fn.tooltip.noconflict = function () {
$.fn.tooltip = old
return this
}
}(window.jquery);
/* ========================================================================
* bootstrap: popover.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#popovers
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// popover public class definition
// ===============================
var popover = function (element, options) {
this.init('popover', element, options)
}
if (!$.fn.tooltip) throw new error('popover requires tooltip.js')
popover.defaults = $.extend({} , $.fn.tooltip.constructor.defaults, {
placement: 'right'
, trigger: 'click'
, content: ''
, template: ''
})
// note: popover extends tooltip.js
// ================================
popover.prototype = $.extend({}, $.fn.tooltip.constructor.prototype)
popover.prototype.constructor = popover
popover.prototype.getdefaults = function () {
return popover.defaults
}
popover.prototype.setcontent = function () {
var $tip = this.tip()
var title = this.gettitle()
var content = this.getcontent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
$tip.removeclass('fade top bottom left right in')
// ie8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
// this manually by checking the contents.
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
popover.prototype.hascontent = function () {
return this.gettitle() || this.getcontent()
}
popover.prototype.getcontent = function () {
var $e = this.$element
var o = this.options
return $e.attr('data-content')
|| (typeof o.content == 'function' ?
o.content.call($e[0]) :
o.content)
}
popover.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find('.arrow')
}
popover.prototype.tip = function () {
if (!this.$tip) this.$tip = $(this.options.template)
return this.$tip
}
// popover plugin definition
// =========================
var old = $.fn.popover
$.fn.popover = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.popover')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.popover', (data = new popover(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.popover.constructor = popover
// popover no conflict
// ===================
$.fn.popover.noconflict = function () {
$.fn.popover = old
return this
}
}(window.jquery);
/* ========================================================================
* bootstrap: tab.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#tabs
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// tab class definition
// ====================
var tab = function (element) {
this.element = $(element)
}
tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
if ($this.parent('li').hasclass('active')) return
var previous = $ul.find('.active:last a')[0]
var e = $.event('show.bs.tab', {
relatedtarget: previous
})
$this.trigger(e)
if (e.isdefaultprevented()) return
var $target = $(selector)
this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function () {
$this.trigger({
type: 'shown.bs.tab'
, relatedtarget: previous
})
})
}
tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& $active.hasclass('fade')
function next() {
$active
.removeclass('active')
.find('> .dropdown-menu > .active')
.removeclass('active')
element.addclass('active')
if (transition) {
element[0].offsetwidth // reflow for transition
element.addclass('in')
} else {
element.removeclass('fade')
}
if (element.parent('.dropdown-menu')) {
element.closest('li.dropdown').addclass('active')
}
callback && callback()
}
transition ?
$active
.one($.support.transition.end, next)
.emulatetransitionend(150) :
next()
$active.removeclass('in')
}
// tab plugin definition
// =====================
var old = $.fn.tab
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tab')
if (!data) $this.data('bs.tab', (data = new tab(this)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tab.constructor = tab
// tab no conflict
// ===============
$.fn.tab.noconflict = function () {
$.fn.tab = old
return this
}
// tab data-api
// ============
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventdefault()
$(this).tab('show')
})
}(window.jquery);
/* ========================================================================
* bootstrap: affix.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#affix
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// affix class definition
// ======================
var affix = function (element, options) {
this.options = $.extend({}, affix.defaults, options)
this.$window = $(window)
.on('scroll.bs.affix.data-api', $.proxy(this.checkposition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkpositionwitheventloop, this))
this.$element = $(element)
this.affixed =
this.unpin = null
this.checkposition()
}
affix.reset = 'affix affix-top affix-bottom'
affix.defaults = {
offset: 0
}
affix.prototype.checkpositionwitheventloop = function () {
settimeout($.proxy(this.checkposition, this), 1)
}
affix.prototype.checkposition = function () {
if (!this.$element.is(':visible')) return
var scrollheight = $(document).height()
var scrolltop = this.$window.scrolltop()
var position = this.$element.offset()
var offset = this.options.offset
var offsettop = offset.top
var offsetbottom = offset.bottom
if (typeof offset != 'object') offsetbottom = offsettop = offset
if (typeof offsettop == 'function') offsettop = offset.top()
if (typeof offsetbottom == 'function') offsetbottom = offset.bottom()
var affix = this.unpin != null && (scrolltop + this.unpin <= position.top) ? false :
offsetbottom != null && (position.top + this.$element.height() >= scrollheight - offsetbottom) ? 'bottom' :
offsettop != null && (scrolltop <= offsettop) ? 'top' : false
if (this.affixed === affix) return
if (this.unpin) this.$element.css('top', '')
this.affixed = affix
this.unpin = affix == 'bottom' ? position.top - scrolltop : null
this.$element.removeclass(affix.reset).addclass('affix' + (affix ? '-' + affix : ''))
if (affix == 'bottom') {
this.$element.offset({ top: document.body.offsetheight - offsetbottom - this.$element.height() })
}
}
// affix plugin definition
// =======================
var old = $.fn.affix
$.fn.affix = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.affix', (data = new affix(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.affix.constructor = affix
// affix no conflict
// =================
$.fn.affix.noconflict = function () {
$.fn.affix = old
return this
}
// affix data-api
// ==============
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
var data = $spy.data()
data.offset = data.offset || {}
if (data.offsetbottom) data.offset.bottom = data.offsetbottom
if (data.offsettop) data.offset.top = data.offsettop
$spy.affix(data)
})
})
}(window.jquery);
/* ========================================================================
* bootstrap: collapse.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#collapse
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// collapse public class definition
// ================================
var collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, collapse.defaults, options)
this.transitioning = null
if (this.options.parent) this.$parent = $(this.options.parent)
if (this.options.toggle) this.toggle()
}
collapse.defaults = {
toggle: true
}
collapse.prototype.dimension = function () {
var haswidth = this.$element.hasclass('width')
return haswidth ? 'width' : 'height'
}
collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasclass('in')) return
var startevent = $.event('show.bs.collapse')
this.$element.trigger(startevent)
if (startevent.isdefaultprevented()) return
var actives = this.$parent && this.$parent.find('> .panel > .in')
if (actives && actives.length) {
var hasdata = actives.data('bs.collapse')
if (hasdata && hasdata.transitioning) return
actives.collapse('hide')
hasdata || actives.data('bs.collapse', null)
}
var dimension = this.dimension()
this.$element
.removeclass('collapse')
.addclass('collapsing')
[dimension](0)
this.transitioning = 1
var complete = function () {
this.$element
.removeclass('collapsing')
.addclass('in')
[dimension]('auto')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollsize = $.camelcase(['scroll', dimension].join('-'))
this.$element
.one($.support.transition.end, $.proxy(complete, this))
.emulatetransitionend(350)
[dimension](this.$element[0][scrollsize])
}
collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasclass('in')) return
var startevent = $.event('hide.bs.collapse')
this.$element.trigger(startevent)
if (startevent.isdefaultprevented()) return
var dimension = this.dimension()
this.$element
[dimension](this.$element[dimension]())
[0].offsetheight
this.$element
.addclass('collapsing')
.removeclass('collapse')
.removeclass('in')
this.transitioning = 1
var complete = function () {
this.transitioning = 0
this.$element
.trigger('hidden.bs.collapse')
.removeclass('collapsing')
.addclass('collapse')
}
if (!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one($.support.transition.end, $.proxy(complete, this))
.emulatetransitionend(350)
}
collapse.prototype.toggle = function () {
this[this.$element.hasclass('in') ? 'hide' : 'show']()
}
// collapse plugin definition
// ==========================
var old = $.fn.collapse
$.fn.collapse = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.collapse')
var options = $.extend({}, collapse.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.collapse', (data = new collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.collapse.constructor = collapse
// collapse no conflict
// ====================
$.fn.collapse.noconflict = function () {
$.fn.collapse = old
return this
}
// collapse data-api
// =================
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href
var target = $this.attr('data-target')
|| e.preventdefault()
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
var $target = $(target)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $this.data()
var parent = $this.attr('data-parent')
var $parent = parent && $(parent)
if (!data || !data.transitioning) {
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addclass('collapsed')
$this[$target.hasclass('in') ? 'addclass' : 'removeclass']('collapsed')
}
$target.collapse(option)
})
}(window.jquery);
/* ========================================================================
* bootstrap: scrollspy.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#scrollspy
* ========================================================================
* copyright 2012 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// scrollspy class definition
// ==========================
function scrollspy(element, options) {
var href
var process = $.proxy(this.process, this)
this.$element = $(element).is('body') ? $(window) : $(element)
this.$body = $('body')
this.$scrollelement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
this.options = $.extend({}, scrollspy.defaults, options)
this.selector = (this.options.target
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|| '') + ' .nav li > a'
this.offsets = $([])
this.targets = $([])
this.activetarget = null
this.refresh()
this.process()
}
scrollspy.defaults = {
offset: 10
}
scrollspy.prototype.refresh = function () {
var offsetmethod = this.$element[0] == window ? 'offset' : 'position'
this.offsets = $([])
this.targets = $([])
var self = this
var $targets = this.$body
.find(this.selector)
.map(function () {
var $el = $(this)
var href = $el.data('target') || $el.attr('href')
var $href = /^#\w/.test(href) && $(href)
return ($href
&& $href.length
&& [[ $href[offsetmethod]().top + (!$.iswindow(self.$scrollelement.get(0)) && self.$scrollelement.scrolltop()), href ]]) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
self.offsets.push(this[0])
self.targets.push(this[1])
})
}
scrollspy.prototype.process = function () {
var scrolltop = this.$scrollelement.scrolltop() + this.options.offset
var scrollheight = this.$scrollelement[0].scrollheight || this.$body[0].scrollheight
var maxscroll = scrollheight - this.$scrollelement.height()
var offsets = this.offsets
var targets = this.targets
var activetarget = this.activetarget
var i
if (scrolltop >= maxscroll) {
return activetarget != (i = targets.last()[0]) && this.activate(i)
}
for (i = offsets.length; i--;) {
activetarget != targets[i]
&& scrolltop >= offsets[i]
&& (!offsets[i + 1] || scrolltop <= offsets[i + 1])
&& this.activate( targets[i] )
}
}
scrollspy.prototype.activate = function (target) {
this.activetarget = target
$(this.selector)
.parents('.active')
.removeclass('active')
var selector = this.selector
+ '[data-target="' + target + '"],'
+ this.selector + '[href="' + target + '"]'
var active = $(selector)
.parents('li')
.addclass('active')
if (active.parent('.dropdown-menu').length) {
active = active
.closest('li.dropdown')
.addclass('active')
}
active.trigger('activate')
}
// scrollspy plugin definition
// ===========================
var old = $.fn.scrollspy
$.fn.scrollspy = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.scrollspy')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.scrollspy', (data = new scrollspy(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.scrollspy.constructor = scrollspy
// scrollspy no conflict
// =====================
$.fn.scrollspy.noconflict = function () {
$.fn.scrollspy = old
return this
}
// scrollspy data-api
// ==================
$(window).on('load', function () {
$('[data-spy="scroll"]').each(function () {
var $spy = $(this)
$spy.scrollspy($spy.data())
})
})
}(window.jquery);
/* ========================================================================
* bootstrap: transition.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#transitions
* ========================================================================
* copyright 2013 twitter, inc.
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
*
* http://www.apache.org/licenses/license-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* ======================================================================== */
+function ($) { "use strict";
// css transition support (shoutout: http://www.modernizr.com/)
// ============================================================
function transitionend() {
var el = document.createelement('bootstrap')
var transendeventnames = {
'webkittransition' : 'webkittransitionend'
, 'moztransition' : 'transitionend'
, 'otransition' : 'otransitionend otransitionend'
, 'transition' : 'transitionend'
}
for (var name in transendeventnames) {
if (el.style[name] !== undefined) {
return { end: transendeventnames[name] }
}
}
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulatetransitionend = function (duration) {
var called = false, $el = this
$(this).one($.support.transition.end, function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
settimeout(callback, duration)
return this
}
$(function () {
$.support.transition = transitionend()
})
}(window.jquery);