1 /* ===================================================
2 * bootstrap-transition.js v2.2.1
3 * http://twitter.github.com/bootstrap/javascript.html#transitions
4 * ===================================================
5 * Copyright 2012 Twitter, Inc.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ========================================================== */
23 "use strict"; // jshint ;_;
26 /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
27 * ======================================================= */
31 $.support.transition = (function () {
33 var transitionEnd = (function () {
35 var el = document.createElement('bootstrap')
36 , transEndEventNames = {
37 'WebkitTransition' : 'webkitTransitionEnd'
38 , 'MozTransition' : 'transitionend'
39 , 'OTransition' : 'oTransitionEnd otransitionend'
40 , 'transition' : 'transitionend'
44 for (name in transEndEventNames){
45 if (el.style[name] !== undefined) {
46 return transEndEventNames[name]
52 return transitionEnd && {
60 }(window.jQuery);/* ==========================================================
61 * bootstrap-alert.js v2.2.1
62 * http://twitter.github.com/bootstrap/javascript.html#alerts
63 * ==========================================================
64 * Copyright 2012 Twitter, Inc.
66 * Licensed under the Apache License, Version 2.0 (the "License");
67 * you may not use this file except in compliance with the License.
68 * You may obtain a copy of the License at
70 * http://www.apache.org/licenses/LICENSE-2.0
72 * Unless required by applicable law or agreed to in writing, software
73 * distributed under the License is distributed on an "AS IS" BASIS,
74 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75 * See the License for the specific language governing permissions and
76 * limitations under the License.
77 * ========================================================== */
82 "use strict"; // jshint ;_;
85 /* ALERT CLASS DEFINITION
86 * ====================== */
88 var dismiss = '[data-dismiss="alert"]'
89 , Alert = function (el) {
90 $(el).on('click', dismiss, this.close)
93 Alert.prototype.close = function (e) {
95 , selector = $this.attr('data-target')
99 selector = $this.attr('href')
100 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
103 $parent = $(selector)
105 e && e.preventDefault()
107 $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
109 $parent.trigger(e = $.Event('close'))
111 if (e.isDefaultPrevented()) return
113 $parent.removeClass('in')
115 function removeElement() {
121 $.support.transition && $parent.hasClass('fade') ?
122 $parent.on($.support.transition.end, removeElement) :
127 /* ALERT PLUGIN DEFINITION
128 * ======================= */
130 $.fn.alert = function (option) {
131 return this.each(function () {
133 , data = $this.data('alert')
134 if (!data) $this.data('alert', (data = new Alert(this)))
135 if (typeof option == 'string') data[option].call($this)
139 $.fn.alert.Constructor = Alert
145 $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
147 }(window.jQuery);/* ============================================================
148 * bootstrap-button.js v2.2.1
149 * http://twitter.github.com/bootstrap/javascript.html#buttons
150 * ============================================================
151 * Copyright 2012 Twitter, Inc.
153 * Licensed under the Apache License, Version 2.0 (the "License");
154 * you may not use this file except in compliance with the License.
155 * You may obtain a copy of the License at
157 * http://www.apache.org/licenses/LICENSE-2.0
159 * Unless required by applicable law or agreed to in writing, software
160 * distributed under the License is distributed on an "AS IS" BASIS,
161 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
162 * See the License for the specific language governing permissions and
163 * limitations under the License.
164 * ============================================================ */
169 "use strict"; // jshint ;_;
172 /* BUTTON PUBLIC CLASS DEFINITION
173 * ============================== */
175 var Button = function (element, options) {
176 this.$element = $(element)
177 this.options = $.extend({}, $.fn.button.defaults, options)
180 Button.prototype.setState = function (state) {
182 , $el = this.$element
184 , val = $el.is('input') ? 'val' : 'html'
186 state = state + 'Text'
187 data.resetText || $el.data('resetText', $el[val]())
189 $el[val](data[state] || this.options[state])
191 // push to event loop to allow forms to submit
192 setTimeout(function () {
193 state == 'loadingText' ?
194 $el.addClass(d).attr(d, d) :
195 $el.removeClass(d).removeAttr(d)
199 Button.prototype.toggle = function () {
200 var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
204 .removeClass('active')
206 this.$element.toggleClass('active')
210 /* BUTTON PLUGIN DEFINITION
211 * ======================== */
213 $.fn.button = function (option) {
214 return this.each(function () {
216 , data = $this.data('button')
217 , options = typeof option == 'object' && option
218 if (!data) $this.data('button', (data = new Button(this, options)))
219 if (option == 'toggle') data.toggle()
220 else if (option) data.setState(option)
224 $.fn.button.defaults = {
225 loadingText: 'loading...'
228 $.fn.button.Constructor = Button
234 $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
235 var $btn = $(e.target)
236 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
237 $btn.button('toggle')
240 }(window.jQuery);/* ==========================================================
241 * bootstrap-carousel.js v2.2.1
242 * http://twitter.github.com/bootstrap/javascript.html#carousel
243 * ==========================================================
244 * Copyright 2012 Twitter, Inc.
246 * Licensed under the Apache License, Version 2.0 (the "License");
247 * you may not use this file except in compliance with the License.
248 * You may obtain a copy of the License at
250 * http://www.apache.org/licenses/LICENSE-2.0
252 * Unless required by applicable law or agreed to in writing, software
253 * distributed under the License is distributed on an "AS IS" BASIS,
254 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
255 * See the License for the specific language governing permissions and
256 * limitations under the License.
257 * ========================================================== */
262 "use strict"; // jshint ;_;
265 /* CAROUSEL CLASS DEFINITION
266 * ========================= */
268 var Carousel = function (element, options) {
269 this.$element = $(element)
270 this.options = options
271 this.options.slide && this.slide(this.options.slide)
272 this.options.pause == 'hover' && this.$element
273 .on('mouseenter', $.proxy(this.pause, this))
274 .on('mouseleave', $.proxy(this.cycle, this))
277 Carousel.prototype = {
279 cycle: function (e) {
280 if (!e) this.paused = false
281 this.options.interval
283 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
287 , to: function (pos) {
288 var $active = this.$element.find('.item.active')
289 , children = $active.parent().children()
290 , activePos = children.index($active)
293 if (pos > (children.length - 1) || pos < 0) return
296 return this.$element.one('slid', function () {
301 if (activePos == pos) {
302 return this.pause().cycle()
305 return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
308 , pause: function (e) {
309 if (!e) this.paused = true
310 if (this.$element.find('.next, .prev').length && $.support.transition.end) {
311 this.$element.trigger($.support.transition.end)
314 clearInterval(this.interval)
319 , next: function () {
320 if (this.sliding) return
321 return this.slide('next')
324 , prev: function () {
325 if (this.sliding) return
326 return this.slide('prev')
329 , slide: function (type, next) {
330 var $active = this.$element.find('.item.active')
331 , $next = next || $active[type]()
332 , isCycling = this.interval
333 , direction = type == 'next' ? 'left' : 'right'
334 , fallback = type == 'next' ? 'first' : 'last'
340 isCycling && this.pause()
342 $next = $next.length ? $next : this.$element.find('.item')[fallback]()
344 e = $.Event('slide', {
345 relatedTarget: $next[0]
348 if ($next.hasClass('active')) return
350 if ($.support.transition && this.$element.hasClass('slide')) {
351 this.$element.trigger(e)
352 if (e.isDefaultPrevented()) return
354 $next[0].offsetWidth // force reflow
355 $active.addClass(direction)
356 $next.addClass(direction)
357 this.$element.one($.support.transition.end, function () {
358 $next.removeClass([type, direction].join(' ')).addClass('active')
359 $active.removeClass(['active', direction].join(' '))
361 setTimeout(function () { that.$element.trigger('slid') }, 0)
364 this.$element.trigger(e)
365 if (e.isDefaultPrevented()) return
366 $active.removeClass('active')
367 $next.addClass('active')
369 this.$element.trigger('slid')
372 isCycling && this.cycle()
380 /* CAROUSEL PLUGIN DEFINITION
381 * ========================== */
383 $.fn.carousel = function (option) {
384 return this.each(function () {
386 , data = $this.data('carousel')
387 , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
388 , action = typeof option == 'string' ? option : options.slide
389 if (!data) $this.data('carousel', (data = new Carousel(this, options)))
390 if (typeof option == 'number') data.to(option)
391 else if (action) data[action]()
392 else if (options.interval) data.cycle()
396 $.fn.carousel.defaults = {
401 $.fn.carousel.Constructor = Carousel
405 * ================= */
407 $(document).on('click.carousel.data-api', '[data-slide]', function (e) {
408 var $this = $(this), href
409 , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
410 , options = $.extend({}, $target.data(), $this.data())
411 $target.carousel(options)
415 }(window.jQuery);/* =============================================================
416 * bootstrap-collapse.js v2.2.1
417 * http://twitter.github.com/bootstrap/javascript.html#collapse
418 * =============================================================
419 * Copyright 2012 Twitter, Inc.
421 * Licensed under the Apache License, Version 2.0 (the "License");
422 * you may not use this file except in compliance with the License.
423 * You may obtain a copy of the License at
425 * http://www.apache.org/licenses/LICENSE-2.0
427 * Unless required by applicable law or agreed to in writing, software
428 * distributed under the License is distributed on an "AS IS" BASIS,
429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
430 * See the License for the specific language governing permissions and
431 * limitations under the License.
432 * ============================================================ */
437 "use strict"; // jshint ;_;
440 /* COLLAPSE PUBLIC CLASS DEFINITION
441 * ================================ */
443 var Collapse = function (element, options) {
444 this.$element = $(element)
445 this.options = $.extend({}, $.fn.collapse.defaults, options)
447 if (this.options.parent) {
448 this.$parent = $(this.options.parent)
451 this.options.toggle && this.toggle()
454 Collapse.prototype = {
456 constructor: Collapse
458 , dimension: function () {
459 var hasWidth = this.$element.hasClass('width')
460 return hasWidth ? 'width' : 'height'
463 , show: function () {
469 if (this.transitioning) return
471 dimension = this.dimension()
472 scroll = $.camelCase(['scroll', dimension].join('-'))
473 actives = this.$parent && this.$parent.find('> .accordion-group > .in')
475 if (actives && actives.length) {
476 hasData = actives.data('collapse')
477 if (hasData && hasData.transitioning) return
478 actives.collapse('hide')
479 hasData || actives.data('collapse', null)
482 this.$element[dimension](0)
483 this.transition('addClass', $.Event('show'), 'shown')
484 // $.support.transition && this.$element[dimension](this.$element[0][scroll])
485 $.support.transition && this.$element[dimension]('auto')
488 , hide: function () {
490 if (this.transitioning) return
491 dimension = this.dimension()
492 this.reset(this.$element[dimension]())
493 this.transition('removeClass', $.Event('hide'), 'hidden')
494 this.$element[dimension](0)
497 , reset: function (size) {
498 var dimension = this.dimension()
501 .removeClass('collapse')
502 [dimension](size || 'auto')
505 this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
510 , transition: function (method, startEvent, completeEvent) {
512 , complete = function () {
513 if (startEvent.type == 'show') that.reset()
514 that.transitioning = 0
515 that.$element.trigger(completeEvent)
518 this.$element.trigger(startEvent)
520 if (startEvent.isDefaultPrevented()) return
522 this.transitioning = 1
524 this.$element[method]('in')
526 $.support.transition && this.$element.hasClass('collapse') ?
527 this.$element.one($.support.transition.end, complete) :
531 , toggle: function () {
532 this[this.$element.hasClass('in') ? 'hide' : 'show']()
538 /* COLLAPSIBLE PLUGIN DEFINITION
539 * ============================== */
541 $.fn.collapse = function (option) {
542 return this.each(function () {
544 , data = $this.data('collapse')
545 , options = typeof option == 'object' && option
546 if (!data) $this.data('collapse', (data = new Collapse(this, options)))
547 if (typeof option == 'string') data[option]()
551 $.fn.collapse.defaults = {
555 $.fn.collapse.Constructor = Collapse
558 /* COLLAPSIBLE DATA-API
559 * ==================== */
561 $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
562 var $this = $(this), href
563 , target = $this.attr('data-target')
564 || e.preventDefault()
565 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
566 , option = $(target).data('collapse') ? 'toggle' : $this.data()
567 $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
568 $(target).collapse(option)
571 }(window.jQuery);/* ============================================================
572 * bootstrap-dropdown.js v2.2.1
573 * http://twitter.github.com/bootstrap/javascript.html#dropdowns
574 * ============================================================
575 * Copyright 2012 Twitter, Inc.
577 * Licensed under the Apache License, Version 2.0 (the "License");
578 * you may not use this file except in compliance with the License.
579 * You may obtain a copy of the License at
581 * http://www.apache.org/licenses/LICENSE-2.0
583 * Unless required by applicable law or agreed to in writing, software
584 * distributed under the License is distributed on an "AS IS" BASIS,
585 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
586 * See the License for the specific language governing permissions and
587 * limitations under the License.
588 * ============================================================ */
593 "use strict"; // jshint ;_;
596 /* DROPDOWN CLASS DEFINITION
597 * ========================= */
599 var toggle = '[data-toggle=dropdown]'
600 , Dropdown = function (element) {
601 var $el = $(element).on('click.dropdown.data-api', this.toggle)
602 $('html').on('click.dropdown.data-api', function () {
603 $el.parent().removeClass('open')
607 Dropdown.prototype = {
609 constructor: Dropdown
611 , toggle: function (e) {
616 if ($this.is('.disabled, :disabled')) return
618 $parent = getParent($this)
620 isActive = $parent.hasClass('open')
625 $parent.toggleClass('open')
632 , keydown: function (e) {
640 if (!/(38|40|27)/.test(e.keyCode)) return
647 if ($this.is('.disabled, :disabled')) return
649 $parent = getParent($this)
651 isActive = $parent.hasClass('open')
653 if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
655 $items = $('[role=menu] li:not(.divider) a', $parent)
657 if (!$items.length) return
659 index = $items.index($items.filter(':focus'))
661 if (e.keyCode == 38 && index > 0) index-- // up
662 if (e.keyCode == 40 && index < $items.length - 1) index++ // down
663 if (!~index) index = 0
672 function clearMenus() {
673 $(toggle).each(function () {
674 getParent($(this)).removeClass('open')
678 function getParent($this) {
679 var selector = $this.attr('data-target')
683 selector = $this.attr('href')
684 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
687 $parent = $(selector)
688 $parent.length || ($parent = $this.parent())
694 /* DROPDOWN PLUGIN DEFINITION
695 * ========================== */
697 $.fn.dropdown = function (option) {
698 return this.each(function () {
700 , data = $this.data('dropdown')
701 if (!data) $this.data('dropdown', (data = new Dropdown(this)))
702 if (typeof option == 'string') data[option].call($this)
706 $.fn.dropdown.Constructor = Dropdown
709 /* APPLY TO STANDARD DROPDOWN ELEMENTS
710 * =================================== */
713 // .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
714 // .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
715 // .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
716 // .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
718 .on('click.dropdown.data-api', clearMenus)
719 .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
720 .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
721 .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
723 }(window.jQuery);/* =========================================================
724 * bootstrap-modal.js v2.2.1
725 * http://twitter.github.com/bootstrap/javascript.html#modals
726 * =========================================================
727 * Copyright 2012 Twitter, Inc.
729 * Licensed under the Apache License, Version 2.0 (the "License");
730 * you may not use this file except in compliance with the License.
731 * You may obtain a copy of the License at
733 * http://www.apache.org/licenses/LICENSE-2.0
735 * Unless required by applicable law or agreed to in writing, software
736 * distributed under the License is distributed on an "AS IS" BASIS,
737 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
738 * See the License for the specific language governing permissions and
739 * limitations under the License.
740 * ========================================================= */
745 "use strict"; // jshint ;_;
748 /* MODAL CLASS DEFINITION
749 * ====================== */
751 var Modal = function (element, options) {
752 this.options = options
753 this.$element = $(element)
754 .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
755 this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
762 , toggle: function () {
763 return this[!this.isShown ? 'show' : 'hide']()
766 , show: function () {
768 , e = $.Event('show')
770 this.$element.trigger(e)
772 if (this.isShown || e.isDefaultPrevented()) return
778 this.backdrop(function () {
779 var transition = $.support.transition && that.$element.hasClass('fade')
781 if (!that.$element.parent().length) {
782 that.$element.appendTo(document.body) //don't move modals dom position
789 that.$element[0].offsetWidth // force reflow
794 .attr('aria-hidden', false)
799 that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
800 that.$element.focus().trigger('shown')
805 , hide: function (e) {
806 e && e.preventDefault()
812 this.$element.trigger(e)
814 if (!this.isShown || e.isDefaultPrevented()) return
820 $(document).off('focusin.modal')
824 .attr('aria-hidden', true)
826 $.support.transition && this.$element.hasClass('fade') ?
827 this.hideWithTransition() :
831 , enforceFocus: function () {
833 $(document).on('focusin.modal', function (e) {
834 if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
835 that.$element.focus()
840 , escape: function () {
842 if (this.isShown && this.options.keyboard) {
843 this.$element.on('keyup.dismiss.modal', function ( e ) {
844 e.which == 27 && that.hide()
846 } else if (!this.isShown) {
847 this.$element.off('keyup.dismiss.modal')
851 , hideWithTransition: function () {
853 , timeout = setTimeout(function () {
854 that.$element.off($.support.transition.end)
858 this.$element.one($.support.transition.end, function () {
859 clearTimeout(timeout)
864 , hideModal: function (that) {
872 , removeBackdrop: function () {
873 this.$backdrop.remove()
874 this.$backdrop = null
877 , backdrop: function (callback) {
879 , animate = this.$element.hasClass('fade') ? 'fade' : ''
881 if (this.isShown && this.options.backdrop) {
882 var doAnimate = $.support.transition && animate
884 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
885 .appendTo(document.body)
887 this.$backdrop.click(
888 this.options.backdrop == 'static' ?
889 $.proxy(this.$element[0].focus, this.$element[0])
890 : $.proxy(this.hide, this)
893 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
895 this.$backdrop.addClass('in')
898 this.$backdrop.one($.support.transition.end, callback) :
901 } else if (!this.isShown && this.$backdrop) {
902 this.$backdrop.removeClass('in')
904 $.support.transition && this.$element.hasClass('fade')?
905 this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
906 this.removeBackdrop()
908 } else if (callback) {
915 /* MODAL PLUGIN DEFINITION
916 * ======================= */
918 $.fn.modal = function (option) {
919 return this.each(function () {
921 , data = $this.data('modal')
922 , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
923 if (!data) $this.data('modal', (data = new Modal(this, options)))
924 if (typeof option == 'string') data[option]()
925 else if (options.show) data.show()
929 $.fn.modal.defaults = {
935 $.fn.modal.Constructor = Modal
941 $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
943 , href = $this.attr('href')
944 , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
945 , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
951 .one('hide', function () {
957 /* ===========================================================
958 * bootstrap-tooltip.js v2.2.1
959 * http://twitter.github.com/bootstrap/javascript.html#tooltips
960 * Inspired by the original jQuery.tipsy by Jason Frame
961 * ===========================================================
962 * Copyright 2012 Twitter, Inc.
964 * Licensed under the Apache License, Version 2.0 (the "License");
965 * you may not use this file except in compliance with the License.
966 * You may obtain a copy of the License at
968 * http://www.apache.org/licenses/LICENSE-2.0
970 * Unless required by applicable law or agreed to in writing, software
971 * distributed under the License is distributed on an "AS IS" BASIS,
972 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
973 * See the License for the specific language governing permissions and
974 * limitations under the License.
975 * ========================================================== */
980 "use strict"; // jshint ;_;
983 /* TOOLTIP PUBLIC CLASS DEFINITION
984 * =============================== */
986 var Tooltip = function (element, options) {
987 this.init('tooltip', element, options)
990 Tooltip.prototype = {
994 , init: function (type, element, options) {
999 this.$element = $(element)
1000 this.options = this.getOptions(options)
1003 if (this.options.trigger == 'click') {
1004 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1005 } else if (this.options.trigger != 'manual') {
1006 eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
1007 eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
1008 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1009 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1012 this.options.selector ?
1013 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1017 , getOptions: function (options) {
1018 options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
1020 if (options.delay && typeof options.delay == 'number') {
1023 , hide: options.delay
1030 , enter: function (e) {
1031 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1033 if (!self.options.delay || !self.options.delay.show) return self.show()
1035 clearTimeout(this.timeout)
1036 self.hoverState = 'in'
1037 this.timeout = setTimeout(function() {
1038 if (self.hoverState == 'in') self.show()
1039 }, self.options.delay.show)
1042 , leave: function (e) {
1043 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1045 if (this.timeout) clearTimeout(this.timeout)
1046 if (!self.options.delay || !self.options.delay.hide) return self.hide()
1048 self.hoverState = 'out'
1049 this.timeout = setTimeout(function() {
1050 if (self.hoverState == 'out') self.hide()
1051 }, self.options.delay.hide)
1054 , show: function () {
1063 if (this.hasContent() && this.enabled) {
1067 if (this.options.animation) {
1068 $tip.addClass('fade')
1071 placement = typeof this.options.placement == 'function' ?
1072 this.options.placement.call(this, $tip[0], this.$element[0]) :
1073 this.options.placement
1075 inside = /in/.test(placement)
1079 .css({ top: 0, left: 0, display: 'block' })
1080 .insertAfter(this.$element)
1082 pos = this.getPosition(inside)
1084 actualWidth = $tip[0].offsetWidth
1085 actualHeight = $tip[0].offsetHeight
1087 switch (inside ? placement.split(' ')[1] : placement) {
1089 tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1092 tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1095 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1098 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1104 .addClass(placement)
1109 , setContent: function () {
1110 var $tip = this.tip()
1111 , title = this.getTitle()
1113 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1114 $tip.removeClass('fade in top bottom left right')
1117 , hide: function () {
1121 $tip.removeClass('in')
1123 function removeWithAnimation() {
1124 var timeout = setTimeout(function () {
1125 $tip.off($.support.transition.end).detach()
1128 $tip.one($.support.transition.end, function () {
1129 clearTimeout(timeout)
1134 $.support.transition && this.$tip.hasClass('fade') ?
1135 removeWithAnimation() :
1141 , fixTitle: function () {
1142 var $e = this.$element
1143 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1144 $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
1148 , hasContent: function () {
1149 return this.getTitle()
1152 , getPosition: function (inside) {
1153 return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
1154 width: this.$element[0].offsetWidth
1155 , height: this.$element[0].offsetHeight
1159 , getTitle: function () {
1161 , $e = this.$element
1164 title = $e.attr('data-original-title')
1165 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1170 , tip: function () {
1171 return this.$tip = this.$tip || $(this.options.template)
1174 , validate: function () {
1175 if (!this.$element[0].parentNode) {
1177 this.$element = null
1182 , enable: function () {
1186 , disable: function () {
1187 this.enabled = false
1190 , toggleEnabled: function () {
1191 this.enabled = !this.enabled
1194 , toggle: function (e) {
1195 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1196 self[self.tip().hasClass('in') ? 'hide' : 'show']()
1199 , destroy: function () {
1200 this.hide().$element.off('.' + this.type).removeData(this.type)
1206 /* TOOLTIP PLUGIN DEFINITION
1207 * ========================= */
1209 $.fn.tooltip = function ( option ) {
1210 return this.each(function () {
1212 , data = $this.data('tooltip')
1213 , options = typeof option == 'object' && option
1214 if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1215 if (typeof option == 'string') data[option]()
1219 $.fn.tooltip.Constructor = Tooltip
1221 $.fn.tooltip.defaults = {
1225 , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1232 }(window.jQuery);/* ===========================================================
1233 * bootstrap-popover.js v2.2.1
1234 * http://twitter.github.com/bootstrap/javascript.html#popovers
1235 * ===========================================================
1236 * Copyright 2012 Twitter, Inc.
1238 * Licensed under the Apache License, Version 2.0 (the "License");
1239 * you may not use this file except in compliance with the License.
1240 * You may obtain a copy of the License at
1242 * http://www.apache.org/licenses/LICENSE-2.0
1244 * Unless required by applicable law or agreed to in writing, software
1245 * distributed under the License is distributed on an "AS IS" BASIS,
1246 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1247 * See the License for the specific language governing permissions and
1248 * limitations under the License.
1249 * =========================================================== */
1254 "use strict"; // jshint ;_;
1257 /* POPOVER PUBLIC CLASS DEFINITION
1258 * =============================== */
1260 var Popover = function (element, options) {
1261 this.init('popover', element, options)
1265 /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1266 ========================================== */
1268 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1270 constructor: Popover
1272 , setContent: function () {
1273 var $tip = this.tip()
1274 , title = this.getTitle()
1275 , content = this.getContent()
1277 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1278 $tip.find('.popover-content > *')[this.options.html ? 'html' : 'text'](content)
1280 $tip.removeClass('fade top bottom left right in')
1283 , hasContent: function () {
1284 return this.getTitle() || this.getContent()
1287 , getContent: function () {
1289 , $e = this.$element
1292 content = $e.attr('data-content')
1293 || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1298 , tip: function () {
1300 this.$tip = $(this.options.template)
1305 , destroy: function () {
1306 this.hide().$element.off('.' + this.type).removeData(this.type)
1312 /* POPOVER PLUGIN DEFINITION
1313 * ======================= */
1315 $.fn.popover = function (option) {
1316 return this.each(function () {
1318 , data = $this.data('popover')
1319 , options = typeof option == 'object' && option
1320 if (!data) $this.data('popover', (data = new Popover(this, options)))
1321 if (typeof option == 'string') data[option]()
1325 $.fn.popover.Constructor = Popover
1327 $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1331 , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
1334 }(window.jQuery);/* =============================================================
1335 * bootstrap-scrollspy.js v2.2.1
1336 * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1337 * =============================================================
1338 * Copyright 2012 Twitter, Inc.
1340 * Licensed under the Apache License, Version 2.0 (the "License");
1341 * you may not use this file except in compliance with the License.
1342 * You may obtain a copy of the License at
1344 * http://www.apache.org/licenses/LICENSE-2.0
1346 * Unless required by applicable law or agreed to in writing, software
1347 * distributed under the License is distributed on an "AS IS" BASIS,
1348 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1349 * See the License for the specific language governing permissions and
1350 * limitations under the License.
1351 * ============================================================== */
1356 "use strict"; // jshint ;_;
1359 /* SCROLLSPY CLASS DEFINITION
1360 * ========================== */
1362 function ScrollSpy(element, options) {
1363 var process = $.proxy(this.process, this)
1364 , $element = $(element).is('body') ? $(window) : $(element)
1366 this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1367 this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
1368 this.selector = (this.options.target
1369 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1370 || '') + ' .nav li > a'
1371 this.$body = $('body')
1376 ScrollSpy.prototype = {
1378 constructor: ScrollSpy
1380 , refresh: function () {
1384 this.offsets = $([])
1385 this.targets = $([])
1387 $targets = this.$body
1388 .find(this.selector)
1391 , href = $el.data('target') || $el.attr('href')
1392 , $href = /^#\w/.test(href) && $(href)
1395 && [[ $href.position().top, href ]] ) || null
1397 .sort(function (a, b) { return a[0] - b[0] })
1399 self.offsets.push(this[0])
1400 self.targets.push(this[1])
1404 , process: function () {
1405 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1406 , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1407 , maxScroll = scrollHeight - this.$scrollElement.height()
1408 , offsets = this.offsets
1409 , targets = this.targets
1410 , activeTarget = this.activeTarget
1413 if (scrollTop >= maxScroll) {
1414 return activeTarget != (i = targets.last()[0])
1415 && this.activate ( i )
1418 for (i = offsets.length; i--;) {
1419 activeTarget != targets[i]
1420 && scrollTop >= offsets[i]
1421 && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1422 && this.activate( targets[i] )
1426 , activate: function (target) {
1430 this.activeTarget = target
1434 .removeClass('active')
1436 selector = this.selector
1437 + '[data-target="' + target + '"],'
1438 + this.selector + '[href="' + target + '"]'
1440 active = $(selector)
1444 if (active.parent('.dropdown-menu').length) {
1445 active = active.closest('li.dropdown').addClass('active')
1448 active.trigger('activate')
1454 /* SCROLLSPY PLUGIN DEFINITION
1455 * =========================== */
1457 $.fn.scrollspy = function (option) {
1458 return this.each(function () {
1460 , data = $this.data('scrollspy')
1461 , options = typeof option == 'object' && option
1462 if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1463 if (typeof option == 'string') data[option]()
1467 $.fn.scrollspy.Constructor = ScrollSpy
1469 $.fn.scrollspy.defaults = {
1474 /* SCROLLSPY DATA-API
1475 * ================== */
1477 $(window).on('load', function () {
1478 $('[data-spy="scroll"]').each(function () {
1480 $spy.scrollspy($spy.data())
1484 }(window.jQuery);/* ========================================================
1485 * bootstrap-tab.js v2.2.1
1486 * http://twitter.github.com/bootstrap/javascript.html#tabs
1487 * ========================================================
1488 * Copyright 2012 Twitter, Inc.
1490 * Licensed under the Apache License, Version 2.0 (the "License");
1491 * you may not use this file except in compliance with the License.
1492 * You may obtain a copy of the License at
1494 * http://www.apache.org/licenses/LICENSE-2.0
1496 * Unless required by applicable law or agreed to in writing, software
1497 * distributed under the License is distributed on an "AS IS" BASIS,
1498 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1499 * See the License for the specific language governing permissions and
1500 * limitations under the License.
1501 * ======================================================== */
1506 "use strict"; // jshint ;_;
1509 /* TAB CLASS DEFINITION
1510 * ==================== */
1512 var Tab = function (element) {
1513 this.element = $(element)
1520 , show: function () {
1521 var $this = this.element
1522 , $ul = $this.closest('ul:not(.dropdown-menu)')
1523 , selector = $this.attr('data-target')
1529 selector = $this.attr('href')
1530 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1533 if ( $this.parent('li').hasClass('active') ) return
1535 previous = $ul.find('.active:last a')[0]
1537 e = $.Event('show', {
1538 relatedTarget: previous
1543 if (e.isDefaultPrevented()) return
1545 $target = $(selector)
1547 this.activate($this.parent('li'), $ul)
1548 this.activate($target, $target.parent(), function () {
1551 , relatedTarget: previous
1556 , activate: function ( element, container, callback) {
1557 var $active = container.find('> .active')
1558 , transition = callback
1559 && $.support.transition
1560 && $active.hasClass('fade')
1564 .removeClass('active')
1565 .find('> .dropdown-menu > .active')
1566 .removeClass('active')
1568 element.addClass('active')
1571 element[0].offsetWidth // reflow for transition
1572 element.addClass('in')
1574 element.removeClass('fade')
1577 if ( element.parent('.dropdown-menu') ) {
1578 element.closest('li.dropdown').addClass('active')
1581 callback && callback()
1585 $active.one($.support.transition.end, next) :
1588 $active.removeClass('in')
1593 /* TAB PLUGIN DEFINITION
1594 * ===================== */
1596 $.fn.tab = function ( option ) {
1597 return this.each(function () {
1599 , data = $this.data('tab')
1600 if (!data) $this.data('tab', (data = new Tab(this)))
1601 if (typeof option == 'string') data[option]()
1605 $.fn.tab.Constructor = Tab
1611 $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1616 }(window.jQuery);/* =============================================================
1617 * bootstrap-typeahead.js v2.2.1
1618 * http://twitter.github.com/bootstrap/javascript.html#typeahead
1619 * =============================================================
1620 * Copyright 2012 Twitter, Inc.
1622 * Licensed under the Apache License, Version 2.0 (the "License");
1623 * you may not use this file except in compliance with the License.
1624 * You may obtain a copy of the License at
1626 * http://www.apache.org/licenses/LICENSE-2.0
1628 * Unless required by applicable law or agreed to in writing, software
1629 * distributed under the License is distributed on an "AS IS" BASIS,
1630 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1631 * See the License for the specific language governing permissions and
1632 * limitations under the License.
1633 * ============================================================ */
1638 "use strict"; // jshint ;_;
1641 /* TYPEAHEAD PUBLIC CLASS DEFINITION
1642 * ================================= */
1644 var Typeahead = function (element, options) {
1645 this.$element = $(element)
1646 this.options = $.extend({}, $.fn.typeahead.defaults, options)
1647 this.matcher = this.options.matcher || this.matcher
1648 this.sorter = this.options.sorter || this.sorter
1649 this.highlighter = this.options.highlighter || this.highlighter
1650 this.updater = this.options.updater || this.updater
1651 this.$menu = $(this.options.menu).appendTo('body')
1652 this.source = this.options.source
1657 Typeahead.prototype = {
1659 constructor: Typeahead
1661 , select: function () {
1662 var val = this.$menu.find('.active').attr('data-value')
1664 .val(this.updater(val))
1669 , updater: function (item) {
1673 , show: function () {
1674 var pos = $.extend({}, this.$element.offset(), {
1675 height: this.$element[0].offsetHeight
1679 top: pos.top + pos.height
1688 , hide: function () {
1694 , lookup: function (event) {
1697 this.query = this.$element.val()
1699 if (!this.query || this.query.length < this.options.minLength) {
1700 return this.shown ? this.hide() : this
1703 items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
1705 return items ? this.process(items) : this
1708 , process: function (items) {
1711 items = $.grep(items, function (item) {
1712 return that.matcher(item)
1715 items = this.sorter(items)
1717 if (!items.length) {
1718 return this.shown ? this.hide() : this
1721 return this.render(items.slice(0, this.options.items)).show()
1724 , matcher: function (item) {
1725 return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1728 , sorter: function (items) {
1730 , caseSensitive = []
1731 , caseInsensitive = []
1734 while (item = items.shift()) {
1735 if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1736 else if (~item.indexOf(this.query)) caseSensitive.push(item)
1737 else caseInsensitive.push(item)
1740 return beginswith.concat(caseSensitive, caseInsensitive)
1743 , highlighter: function (item) {
1744 var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1745 return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1746 return '<strong>' + match + '</strong>'
1750 , render: function (items) {
1753 items = $(items).map(function (i, item) {
1754 i = $(that.options.item).attr('data-value', item)
1755 i.find('a').html(that.highlighter(item))
1759 items.first().addClass('active')
1760 this.$menu.html(items)
1764 , next: function (event) {
1765 var active = this.$menu.find('.active').removeClass('active')
1766 , next = active.next()
1769 next = $(this.$menu.find('li')[0])
1772 next.addClass('active')
1775 , prev: function (event) {
1776 var active = this.$menu.find('.active').removeClass('active')
1777 , prev = active.prev()
1780 prev = this.$menu.find('li').last()
1783 prev.addClass('active')
1786 , listen: function () {
1788 .on('blur', $.proxy(this.blur, this))
1789 .on('keypress', $.proxy(this.keypress, this))
1790 .on('keyup', $.proxy(this.keyup, this))
1792 if (this.eventSupported('keydown')) {
1793 this.$element.on('keydown', $.proxy(this.keydown, this))
1797 .on('click', $.proxy(this.click, this))
1798 .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1801 , eventSupported: function(eventName) {
1802 var isSupported = eventName in this.$element
1804 this.$element.setAttribute(eventName, 'return;')
1805 isSupported = typeof this.$element[eventName] === 'function'
1810 , move: function (e) {
1811 if (!this.shown) return
1820 case 38: // up arrow
1825 case 40: // down arrow
1834 , keydown: function (e) {
1835 this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
1839 , keypress: function (e) {
1840 if (this.suppressKeyPressRepeat) return
1844 , keyup: function (e) {
1846 case 40: // down arrow
1847 case 38: // up arrow
1855 if (!this.shown) return
1860 if (!this.shown) return
1872 , blur: function (e) {
1874 setTimeout(function () { that.hide() }, 150)
1877 , click: function (e) {
1883 , mouseenter: function (e) {
1884 this.$menu.find('.active').removeClass('active')
1885 $(e.currentTarget).addClass('active')
1891 /* TYPEAHEAD PLUGIN DEFINITION
1892 * =========================== */
1894 $.fn.typeahead = function (option) {
1895 return this.each(function () {
1897 , data = $this.data('typeahead')
1898 , options = typeof option == 'object' && option
1899 if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1900 if (typeof option == 'string') data[option]()
1904 $.fn.typeahead.defaults = {
1907 , menu: '<ul class="typeahead dropdown-menu"></ul>'
1908 , item: '<li><a href="#"></a></li>'
1912 $.fn.typeahead.Constructor = Typeahead
1915 /* TYPEAHEAD DATA-API
1916 * ================== */
1918 $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1920 if ($this.data('typeahead')) return
1922 $this.typeahead($this.data())
1926 /* ==========================================================
1927 * bootstrap-affix.js v2.2.1
1928 * http://twitter.github.com/bootstrap/javascript.html#affix
1929 * ==========================================================
1930 * Copyright 2012 Twitter, Inc.
1932 * Licensed under the Apache License, Version 2.0 (the "License");
1933 * you may not use this file except in compliance with the License.
1934 * You may obtain a copy of the License at
1936 * http://www.apache.org/licenses/LICENSE-2.0
1938 * Unless required by applicable law or agreed to in writing, software
1939 * distributed under the License is distributed on an "AS IS" BASIS,
1940 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1941 * See the License for the specific language governing permissions and
1942 * limitations under the License.
1943 * ========================================================== */
1948 "use strict"; // jshint ;_;
1951 /* AFFIX CLASS DEFINITION
1952 * ====================== */
1954 var Affix = function (element, options) {
1955 this.options = $.extend({}, $.fn.affix.defaults, options)
1956 this.$window = $(window)
1957 .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
1958 .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
1959 this.$element = $(element)
1960 this.checkPosition()
1963 Affix.prototype.checkPosition = function () {
1964 if (!this.$element.is(':visible')) return
1966 var scrollHeight = $(document).height()
1967 , scrollTop = this.$window.scrollTop()
1968 , position = this.$element.offset()
1969 , offset = this.options.offset
1970 , offsetBottom = offset.bottom
1971 , offsetTop = offset.top
1972 , reset = 'affix affix-top affix-bottom'
1975 if (typeof offset != 'object') offsetBottom = offsetTop = offset
1976 if (typeof offsetTop == 'function') offsetTop = offset.top()
1977 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
1979 affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
1980 false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
1981 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
1984 if (this.affixed === affix) return
1986 this.affixed = affix
1987 this.unpin = affix == 'bottom' ? position.top - scrollTop : null
1989 this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
1993 /* AFFIX PLUGIN DEFINITION
1994 * ======================= */
1996 $.fn.affix = function (option) {
1997 return this.each(function () {
1999 , data = $this.data('affix')
2000 , options = typeof option == 'object' && option
2001 if (!data) $this.data('affix', (data = new Affix(this, options)))
2002 if (typeof option == 'string') data[option]()
2006 $.fn.affix.Constructor = Affix
2008 $.fn.affix.defaults = {
2016 $(window).on('load', function () {
2017 $('[data-spy="affix"]').each(function () {
2019 , data = $spy.data()
2021 data.offset = data.offset || {}
2023 data.offsetBottom && (data.offset.bottom = data.offsetBottom)
2024 data.offsetTop && (data.offset.top = data.offsetTop)