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])
487 , hide: function () {
489 if (this.transitioning) return
490 dimension = this.dimension()
491 this.reset(this.$element[dimension]())
492 this.transition('removeClass', $.Event('hide'), 'hidden')
493 this.$element[dimension](0)
496 , reset: function (size) {
497 var dimension = this.dimension()
500 .removeClass('collapse')
501 [dimension](size || 'auto')
504 this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
509 , transition: function (method, startEvent, completeEvent) {
511 , complete = function () {
512 if (startEvent.type == 'show') that.reset()
513 that.transitioning = 0
514 that.$element.trigger(completeEvent)
517 this.$element.trigger(startEvent)
519 if (startEvent.isDefaultPrevented()) return
521 this.transitioning = 1
523 this.$element[method]('in')
525 $.support.transition && this.$element.hasClass('collapse') ?
526 this.$element.one($.support.transition.end, complete) :
530 , toggle: function () {
531 this[this.$element.hasClass('in') ? 'hide' : 'show']()
537 /* COLLAPSIBLE PLUGIN DEFINITION
538 * ============================== */
540 $.fn.collapse = function (option) {
541 return this.each(function () {
543 , data = $this.data('collapse')
544 , options = typeof option == 'object' && option
545 if (!data) $this.data('collapse', (data = new Collapse(this, options)))
546 if (typeof option == 'string') data[option]()
550 $.fn.collapse.defaults = {
554 $.fn.collapse.Constructor = Collapse
557 /* COLLAPSIBLE DATA-API
558 * ==================== */
560 $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
561 var $this = $(this), href
562 , target = $this.attr('data-target')
563 || e.preventDefault()
564 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
565 , option = $(target).data('collapse') ? 'toggle' : $this.data()
566 $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
567 $(target).collapse(option)
570 }(window.jQuery);/* ============================================================
571 * bootstrap-dropdown.js v2.2.1
572 * http://twitter.github.com/bootstrap/javascript.html#dropdowns
573 * ============================================================
574 * Copyright 2012 Twitter, Inc.
576 * Licensed under the Apache License, Version 2.0 (the "License");
577 * you may not use this file except in compliance with the License.
578 * You may obtain a copy of the License at
580 * http://www.apache.org/licenses/LICENSE-2.0
582 * Unless required by applicable law or agreed to in writing, software
583 * distributed under the License is distributed on an "AS IS" BASIS,
584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
585 * See the License for the specific language governing permissions and
586 * limitations under the License.
587 * ============================================================ */
592 "use strict"; // jshint ;_;
595 /* DROPDOWN CLASS DEFINITION
596 * ========================= */
598 var toggle = '[data-toggle=dropdown]'
599 , Dropdown = function (element) {
600 var $el = $(element).on('click.dropdown.data-api', this.toggle)
601 $('html').on('click.dropdown.data-api', function () {
602 $el.parent().removeClass('open')
606 Dropdown.prototype = {
608 constructor: Dropdown
610 , toggle: function (e) {
615 if ($this.is('.disabled, :disabled')) return
617 $parent = getParent($this)
619 isActive = $parent.hasClass('open')
624 $parent.toggleClass('open')
631 , keydown: function (e) {
639 if (!/(38|40|27)/.test(e.keyCode)) return
646 if ($this.is('.disabled, :disabled')) return
648 $parent = getParent($this)
650 isActive = $parent.hasClass('open')
652 if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
654 $items = $('[role=menu] li:not(.divider) a', $parent)
656 if (!$items.length) return
658 index = $items.index($items.filter(':focus'))
660 if (e.keyCode == 38 && index > 0) index-- // up
661 if (e.keyCode == 40 && index < $items.length - 1) index++ // down
662 if (!~index) index = 0
671 function clearMenus() {
672 $(toggle).each(function () {
673 getParent($(this)).removeClass('open')
677 function getParent($this) {
678 var selector = $this.attr('data-target')
682 selector = $this.attr('href')
683 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
686 $parent = $(selector)
687 $parent.length || ($parent = $this.parent())
693 /* DROPDOWN PLUGIN DEFINITION
694 * ========================== */
696 $.fn.dropdown = function (option) {
697 return this.each(function () {
699 , data = $this.data('dropdown')
700 if (!data) $this.data('dropdown', (data = new Dropdown(this)))
701 if (typeof option == 'string') data[option].call($this)
705 $.fn.dropdown.Constructor = Dropdown
708 /* APPLY TO STANDARD DROPDOWN ELEMENTS
709 * =================================== */
712 // .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
713 // .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
714 // .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
715 // .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
717 .on('click.dropdown.data-api', clearMenus)
718 .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
719 .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
720 .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
722 }(window.jQuery);/* =========================================================
723 * bootstrap-modal.js v2.2.1
724 * http://twitter.github.com/bootstrap/javascript.html#modals
725 * =========================================================
726 * Copyright 2012 Twitter, Inc.
728 * Licensed under the Apache License, Version 2.0 (the "License");
729 * you may not use this file except in compliance with the License.
730 * You may obtain a copy of the License at
732 * http://www.apache.org/licenses/LICENSE-2.0
734 * Unless required by applicable law or agreed to in writing, software
735 * distributed under the License is distributed on an "AS IS" BASIS,
736 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
737 * See the License for the specific language governing permissions and
738 * limitations under the License.
739 * ========================================================= */
744 "use strict"; // jshint ;_;
747 /* MODAL CLASS DEFINITION
748 * ====================== */
750 var Modal = function (element, options) {
751 this.options = options
752 this.$element = $(element)
753 .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
754 this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
761 , toggle: function () {
762 return this[!this.isShown ? 'show' : 'hide']()
765 , show: function () {
767 , e = $.Event('show')
769 this.$element.trigger(e)
771 if (this.isShown || e.isDefaultPrevented()) return
777 this.backdrop(function () {
778 var transition = $.support.transition && that.$element.hasClass('fade')
780 if (!that.$element.parent().length) {
781 that.$element.appendTo(document.body) //don't move modals dom position
788 that.$element[0].offsetWidth // force reflow
793 .attr('aria-hidden', false)
798 that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
799 that.$element.focus().trigger('shown')
804 , hide: function (e) {
805 e && e.preventDefault()
811 this.$element.trigger(e)
813 if (!this.isShown || e.isDefaultPrevented()) return
819 $(document).off('focusin.modal')
823 .attr('aria-hidden', true)
825 $.support.transition && this.$element.hasClass('fade') ?
826 this.hideWithTransition() :
830 , enforceFocus: function () {
832 $(document).on('focusin.modal', function (e) {
833 if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
834 that.$element.focus()
839 , escape: function () {
841 if (this.isShown && this.options.keyboard) {
842 this.$element.on('keyup.dismiss.modal', function ( e ) {
843 e.which == 27 && that.hide()
845 } else if (!this.isShown) {
846 this.$element.off('keyup.dismiss.modal')
850 , hideWithTransition: function () {
852 , timeout = setTimeout(function () {
853 that.$element.off($.support.transition.end)
857 this.$element.one($.support.transition.end, function () {
858 clearTimeout(timeout)
863 , hideModal: function (that) {
871 , removeBackdrop: function () {
872 this.$backdrop.remove()
873 this.$backdrop = null
876 , backdrop: function (callback) {
878 , animate = this.$element.hasClass('fade') ? 'fade' : ''
880 if (this.isShown && this.options.backdrop) {
881 var doAnimate = $.support.transition && animate
883 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
884 .appendTo(document.body)
886 this.$backdrop.click(
887 this.options.backdrop == 'static' ?
888 $.proxy(this.$element[0].focus, this.$element[0])
889 : $.proxy(this.hide, this)
892 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
894 this.$backdrop.addClass('in')
897 this.$backdrop.one($.support.transition.end, callback) :
900 } else if (!this.isShown && this.$backdrop) {
901 this.$backdrop.removeClass('in')
903 $.support.transition && this.$element.hasClass('fade')?
904 this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
905 this.removeBackdrop()
907 } else if (callback) {
914 /* MODAL PLUGIN DEFINITION
915 * ======================= */
917 $.fn.modal = function (option) {
918 return this.each(function () {
920 , data = $this.data('modal')
921 , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
922 if (!data) $this.data('modal', (data = new Modal(this, options)))
923 if (typeof option == 'string') data[option]()
924 else if (options.show) data.show()
928 $.fn.modal.defaults = {
934 $.fn.modal.Constructor = Modal
940 $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
942 , href = $this.attr('href')
943 , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
944 , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
950 .one('hide', function () {
956 /* ===========================================================
957 * bootstrap-tooltip.js v2.2.1
958 * http://twitter.github.com/bootstrap/javascript.html#tooltips
959 * Inspired by the original jQuery.tipsy by Jason Frame
960 * ===========================================================
961 * Copyright 2012 Twitter, Inc.
963 * Licensed under the Apache License, Version 2.0 (the "License");
964 * you may not use this file except in compliance with the License.
965 * You may obtain a copy of the License at
967 * http://www.apache.org/licenses/LICENSE-2.0
969 * Unless required by applicable law or agreed to in writing, software
970 * distributed under the License is distributed on an "AS IS" BASIS,
971 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
972 * See the License for the specific language governing permissions and
973 * limitations under the License.
974 * ========================================================== */
979 "use strict"; // jshint ;_;
982 /* TOOLTIP PUBLIC CLASS DEFINITION
983 * =============================== */
985 var Tooltip = function (element, options) {
986 this.init('tooltip', element, options)
989 Tooltip.prototype = {
993 , init: function (type, element, options) {
998 this.$element = $(element)
999 this.options = this.getOptions(options)
1002 if (this.options.trigger == 'click') {
1003 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1004 } else if (this.options.trigger != 'manual') {
1005 eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
1006 eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
1007 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1008 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1011 this.options.selector ?
1012 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1016 , getOptions: function (options) {
1017 options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
1019 if (options.delay && typeof options.delay == 'number') {
1022 , hide: options.delay
1029 , enter: function (e) {
1030 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1032 if (!self.options.delay || !self.options.delay.show) return self.show()
1034 clearTimeout(this.timeout)
1035 self.hoverState = 'in'
1036 this.timeout = setTimeout(function() {
1037 if (self.hoverState == 'in') self.show()
1038 }, self.options.delay.show)
1041 , leave: function (e) {
1042 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1044 if (this.timeout) clearTimeout(this.timeout)
1045 if (!self.options.delay || !self.options.delay.hide) return self.hide()
1047 self.hoverState = 'out'
1048 this.timeout = setTimeout(function() {
1049 if (self.hoverState == 'out') self.hide()
1050 }, self.options.delay.hide)
1053 , show: function () {
1062 if (this.hasContent() && this.enabled) {
1066 if (this.options.animation) {
1067 $tip.addClass('fade')
1070 placement = typeof this.options.placement == 'function' ?
1071 this.options.placement.call(this, $tip[0], this.$element[0]) :
1072 this.options.placement
1074 inside = /in/.test(placement)
1078 .css({ top: 0, left: 0, display: 'block' })
1079 .insertAfter(this.$element)
1081 pos = this.getPosition(inside)
1083 actualWidth = $tip[0].offsetWidth
1084 actualHeight = $tip[0].offsetHeight
1086 switch (inside ? placement.split(' ')[1] : placement) {
1088 tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1091 tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1094 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1097 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1103 .addClass(placement)
1108 , setContent: function () {
1109 var $tip = this.tip()
1110 , title = this.getTitle()
1112 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1113 $tip.removeClass('fade in top bottom left right')
1116 , hide: function () {
1120 $tip.removeClass('in')
1122 function removeWithAnimation() {
1123 var timeout = setTimeout(function () {
1124 $tip.off($.support.transition.end).detach()
1127 $tip.one($.support.transition.end, function () {
1128 clearTimeout(timeout)
1133 $.support.transition && this.$tip.hasClass('fade') ?
1134 removeWithAnimation() :
1140 , fixTitle: function () {
1141 var $e = this.$element
1142 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1143 $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
1147 , hasContent: function () {
1148 return this.getTitle()
1151 , getPosition: function (inside) {
1152 return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
1153 width: this.$element[0].offsetWidth
1154 , height: this.$element[0].offsetHeight
1158 , getTitle: function () {
1160 , $e = this.$element
1163 title = $e.attr('data-original-title')
1164 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1169 , tip: function () {
1170 return this.$tip = this.$tip || $(this.options.template)
1173 , validate: function () {
1174 if (!this.$element[0].parentNode) {
1176 this.$element = null
1181 , enable: function () {
1185 , disable: function () {
1186 this.enabled = false
1189 , toggleEnabled: function () {
1190 this.enabled = !this.enabled
1193 , toggle: function (e) {
1194 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1195 self[self.tip().hasClass('in') ? 'hide' : 'show']()
1198 , destroy: function () {
1199 this.hide().$element.off('.' + this.type).removeData(this.type)
1205 /* TOOLTIP PLUGIN DEFINITION
1206 * ========================= */
1208 $.fn.tooltip = function ( option ) {
1209 return this.each(function () {
1211 , data = $this.data('tooltip')
1212 , options = typeof option == 'object' && option
1213 if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1214 if (typeof option == 'string') data[option]()
1218 $.fn.tooltip.Constructor = Tooltip
1220 $.fn.tooltip.defaults = {
1224 , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1231 }(window.jQuery);/* ===========================================================
1232 * bootstrap-popover.js v2.2.1
1233 * http://twitter.github.com/bootstrap/javascript.html#popovers
1234 * ===========================================================
1235 * Copyright 2012 Twitter, Inc.
1237 * Licensed under the Apache License, Version 2.0 (the "License");
1238 * you may not use this file except in compliance with the License.
1239 * You may obtain a copy of the License at
1241 * http://www.apache.org/licenses/LICENSE-2.0
1243 * Unless required by applicable law or agreed to in writing, software
1244 * distributed under the License is distributed on an "AS IS" BASIS,
1245 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1246 * See the License for the specific language governing permissions and
1247 * limitations under the License.
1248 * =========================================================== */
1253 "use strict"; // jshint ;_;
1256 /* POPOVER PUBLIC CLASS DEFINITION
1257 * =============================== */
1259 var Popover = function (element, options) {
1260 this.init('popover', element, options)
1264 /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1265 ========================================== */
1267 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1269 constructor: Popover
1271 , setContent: function () {
1272 var $tip = this.tip()
1273 , title = this.getTitle()
1274 , content = this.getContent()
1276 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1277 $tip.find('.popover-content > *')[this.options.html ? 'html' : 'text'](content)
1279 $tip.removeClass('fade top bottom left right in')
1282 , hasContent: function () {
1283 return this.getTitle() || this.getContent()
1286 , getContent: function () {
1288 , $e = this.$element
1291 content = $e.attr('data-content')
1292 || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1297 , tip: function () {
1299 this.$tip = $(this.options.template)
1304 , destroy: function () {
1305 this.hide().$element.off('.' + this.type).removeData(this.type)
1311 /* POPOVER PLUGIN DEFINITION
1312 * ======================= */
1314 $.fn.popover = function (option) {
1315 return this.each(function () {
1317 , data = $this.data('popover')
1318 , options = typeof option == 'object' && option
1319 if (!data) $this.data('popover', (data = new Popover(this, options)))
1320 if (typeof option == 'string') data[option]()
1324 $.fn.popover.Constructor = Popover
1326 $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1330 , 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>'
1333 }(window.jQuery);/* =============================================================
1334 * bootstrap-scrollspy.js v2.2.1
1335 * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1336 * =============================================================
1337 * Copyright 2012 Twitter, Inc.
1339 * Licensed under the Apache License, Version 2.0 (the "License");
1340 * you may not use this file except in compliance with the License.
1341 * You may obtain a copy of the License at
1343 * http://www.apache.org/licenses/LICENSE-2.0
1345 * Unless required by applicable law or agreed to in writing, software
1346 * distributed under the License is distributed on an "AS IS" BASIS,
1347 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1348 * See the License for the specific language governing permissions and
1349 * limitations under the License.
1350 * ============================================================== */
1355 "use strict"; // jshint ;_;
1358 /* SCROLLSPY CLASS DEFINITION
1359 * ========================== */
1361 function ScrollSpy(element, options) {
1362 var process = $.proxy(this.process, this)
1363 , $element = $(element).is('body') ? $(window) : $(element)
1365 this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1366 this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
1367 this.selector = (this.options.target
1368 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1369 || '') + ' .nav li > a'
1370 this.$body = $('body')
1375 ScrollSpy.prototype = {
1377 constructor: ScrollSpy
1379 , refresh: function () {
1383 this.offsets = $([])
1384 this.targets = $([])
1386 $targets = this.$body
1387 .find(this.selector)
1390 , href = $el.data('target') || $el.attr('href')
1391 , $href = /^#\w/.test(href) && $(href)
1394 && [[ $href.position().top, href ]] ) || null
1396 .sort(function (a, b) { return a[0] - b[0] })
1398 self.offsets.push(this[0])
1399 self.targets.push(this[1])
1403 , process: function () {
1404 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1405 , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1406 , maxScroll = scrollHeight - this.$scrollElement.height()
1407 , offsets = this.offsets
1408 , targets = this.targets
1409 , activeTarget = this.activeTarget
1412 if (scrollTop >= maxScroll) {
1413 return activeTarget != (i = targets.last()[0])
1414 && this.activate ( i )
1417 for (i = offsets.length; i--;) {
1418 activeTarget != targets[i]
1419 && scrollTop >= offsets[i]
1420 && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1421 && this.activate( targets[i] )
1425 , activate: function (target) {
1429 this.activeTarget = target
1433 .removeClass('active')
1435 selector = this.selector
1436 + '[data-target="' + target + '"],'
1437 + this.selector + '[href="' + target + '"]'
1439 active = $(selector)
1443 if (active.parent('.dropdown-menu').length) {
1444 active = active.closest('li.dropdown').addClass('active')
1447 active.trigger('activate')
1453 /* SCROLLSPY PLUGIN DEFINITION
1454 * =========================== */
1456 $.fn.scrollspy = function (option) {
1457 return this.each(function () {
1459 , data = $this.data('scrollspy')
1460 , options = typeof option == 'object' && option
1461 if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1462 if (typeof option == 'string') data[option]()
1466 $.fn.scrollspy.Constructor = ScrollSpy
1468 $.fn.scrollspy.defaults = {
1473 /* SCROLLSPY DATA-API
1474 * ================== */
1476 $(window).on('load', function () {
1477 $('[data-spy="scroll"]').each(function () {
1479 $spy.scrollspy($spy.data())
1483 }(window.jQuery);/* ========================================================
1484 * bootstrap-tab.js v2.2.1
1485 * http://twitter.github.com/bootstrap/javascript.html#tabs
1486 * ========================================================
1487 * Copyright 2012 Twitter, Inc.
1489 * Licensed under the Apache License, Version 2.0 (the "License");
1490 * you may not use this file except in compliance with the License.
1491 * You may obtain a copy of the License at
1493 * http://www.apache.org/licenses/LICENSE-2.0
1495 * Unless required by applicable law or agreed to in writing, software
1496 * distributed under the License is distributed on an "AS IS" BASIS,
1497 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1498 * See the License for the specific language governing permissions and
1499 * limitations under the License.
1500 * ======================================================== */
1505 "use strict"; // jshint ;_;
1508 /* TAB CLASS DEFINITION
1509 * ==================== */
1511 var Tab = function (element) {
1512 this.element = $(element)
1519 , show: function () {
1520 var $this = this.element
1521 , $ul = $this.closest('ul:not(.dropdown-menu)')
1522 , selector = $this.attr('data-target')
1528 selector = $this.attr('href')
1529 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1532 if ( $this.parent('li').hasClass('active') ) return
1534 previous = $ul.find('.active:last a')[0]
1536 e = $.Event('show', {
1537 relatedTarget: previous
1542 if (e.isDefaultPrevented()) return
1544 $target = $(selector)
1546 this.activate($this.parent('li'), $ul)
1547 this.activate($target, $target.parent(), function () {
1550 , relatedTarget: previous
1555 , activate: function ( element, container, callback) {
1556 var $active = container.find('> .active')
1557 , transition = callback
1558 && $.support.transition
1559 && $active.hasClass('fade')
1563 .removeClass('active')
1564 .find('> .dropdown-menu > .active')
1565 .removeClass('active')
1567 element.addClass('active')
1570 element[0].offsetWidth // reflow for transition
1571 element.addClass('in')
1573 element.removeClass('fade')
1576 if ( element.parent('.dropdown-menu') ) {
1577 element.closest('li.dropdown').addClass('active')
1580 callback && callback()
1584 $active.one($.support.transition.end, next) :
1587 $active.removeClass('in')
1592 /* TAB PLUGIN DEFINITION
1593 * ===================== */
1595 $.fn.tab = function ( option ) {
1596 return this.each(function () {
1598 , data = $this.data('tab')
1599 if (!data) $this.data('tab', (data = new Tab(this)))
1600 if (typeof option == 'string') data[option]()
1604 $.fn.tab.Constructor = Tab
1610 $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1615 }(window.jQuery);/* =============================================================
1616 * bootstrap-typeahead.js v2.2.1
1617 * http://twitter.github.com/bootstrap/javascript.html#typeahead
1618 * =============================================================
1619 * Copyright 2012 Twitter, Inc.
1621 * Licensed under the Apache License, Version 2.0 (the "License");
1622 * you may not use this file except in compliance with the License.
1623 * You may obtain a copy of the License at
1625 * http://www.apache.org/licenses/LICENSE-2.0
1627 * Unless required by applicable law or agreed to in writing, software
1628 * distributed under the License is distributed on an "AS IS" BASIS,
1629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1630 * See the License for the specific language governing permissions and
1631 * limitations under the License.
1632 * ============================================================ */
1637 "use strict"; // jshint ;_;
1640 /* TYPEAHEAD PUBLIC CLASS DEFINITION
1641 * ================================= */
1643 var Typeahead = function (element, options) {
1644 this.$element = $(element)
1645 this.options = $.extend({}, $.fn.typeahead.defaults, options)
1646 this.matcher = this.options.matcher || this.matcher
1647 this.sorter = this.options.sorter || this.sorter
1648 this.highlighter = this.options.highlighter || this.highlighter
1649 this.updater = this.options.updater || this.updater
1650 this.$menu = $(this.options.menu).appendTo('body')
1651 this.source = this.options.source
1656 Typeahead.prototype = {
1658 constructor: Typeahead
1660 , select: function () {
1661 var val = this.$menu.find('.active').attr('data-value')
1663 .val(this.updater(val))
1668 , updater: function (item) {
1672 , show: function () {
1673 var pos = $.extend({}, this.$element.offset(), {
1674 height: this.$element[0].offsetHeight
1678 top: pos.top + pos.height
1687 , hide: function () {
1693 , lookup: function (event) {
1696 this.query = this.$element.val()
1698 if (!this.query || this.query.length < this.options.minLength) {
1699 return this.shown ? this.hide() : this
1702 items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
1704 return items ? this.process(items) : this
1707 , process: function (items) {
1710 items = $.grep(items, function (item) {
1711 return that.matcher(item)
1714 items = this.sorter(items)
1716 if (!items.length) {
1717 return this.shown ? this.hide() : this
1720 return this.render(items.slice(0, this.options.items)).show()
1723 , matcher: function (item) {
1724 return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1727 , sorter: function (items) {
1729 , caseSensitive = []
1730 , caseInsensitive = []
1733 while (item = items.shift()) {
1734 if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1735 else if (~item.indexOf(this.query)) caseSensitive.push(item)
1736 else caseInsensitive.push(item)
1739 return beginswith.concat(caseSensitive, caseInsensitive)
1742 , highlighter: function (item) {
1743 var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1744 return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1745 return '<strong>' + match + '</strong>'
1749 , render: function (items) {
1752 items = $(items).map(function (i, item) {
1753 i = $(that.options.item).attr('data-value', item)
1754 i.find('a').html(that.highlighter(item))
1758 items.first().addClass('active')
1759 this.$menu.html(items)
1763 , next: function (event) {
1764 var active = this.$menu.find('.active').removeClass('active')
1765 , next = active.next()
1768 next = $(this.$menu.find('li')[0])
1771 next.addClass('active')
1774 , prev: function (event) {
1775 var active = this.$menu.find('.active').removeClass('active')
1776 , prev = active.prev()
1779 prev = this.$menu.find('li').last()
1782 prev.addClass('active')
1785 , listen: function () {
1787 .on('blur', $.proxy(this.blur, this))
1788 .on('keypress', $.proxy(this.keypress, this))
1789 .on('keyup', $.proxy(this.keyup, this))
1791 if (this.eventSupported('keydown')) {
1792 this.$element.on('keydown', $.proxy(this.keydown, this))
1796 .on('click', $.proxy(this.click, this))
1797 .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1800 , eventSupported: function(eventName) {
1801 var isSupported = eventName in this.$element
1803 this.$element.setAttribute(eventName, 'return;')
1804 isSupported = typeof this.$element[eventName] === 'function'
1809 , move: function (e) {
1810 if (!this.shown) return
1819 case 38: // up arrow
1824 case 40: // down arrow
1833 , keydown: function (e) {
1834 this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
1838 , keypress: function (e) {
1839 if (this.suppressKeyPressRepeat) return
1843 , keyup: function (e) {
1845 case 40: // down arrow
1846 case 38: // up arrow
1854 if (!this.shown) return
1859 if (!this.shown) return
1871 , blur: function (e) {
1873 setTimeout(function () { that.hide() }, 150)
1876 , click: function (e) {
1882 , mouseenter: function (e) {
1883 this.$menu.find('.active').removeClass('active')
1884 $(e.currentTarget).addClass('active')
1890 /* TYPEAHEAD PLUGIN DEFINITION
1891 * =========================== */
1893 $.fn.typeahead = function (option) {
1894 return this.each(function () {
1896 , data = $this.data('typeahead')
1897 , options = typeof option == 'object' && option
1898 if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1899 if (typeof option == 'string') data[option]()
1903 $.fn.typeahead.defaults = {
1906 , menu: '<ul class="typeahead dropdown-menu"></ul>'
1907 , item: '<li><a href="#"></a></li>'
1911 $.fn.typeahead.Constructor = Typeahead
1914 /* TYPEAHEAD DATA-API
1915 * ================== */
1917 $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1919 if ($this.data('typeahead')) return
1921 $this.typeahead($this.data())
1925 /* ==========================================================
1926 * bootstrap-affix.js v2.2.1
1927 * http://twitter.github.com/bootstrap/javascript.html#affix
1928 * ==========================================================
1929 * Copyright 2012 Twitter, Inc.
1931 * Licensed under the Apache License, Version 2.0 (the "License");
1932 * you may not use this file except in compliance with the License.
1933 * You may obtain a copy of the License at
1935 * http://www.apache.org/licenses/LICENSE-2.0
1937 * Unless required by applicable law or agreed to in writing, software
1938 * distributed under the License is distributed on an "AS IS" BASIS,
1939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1940 * See the License for the specific language governing permissions and
1941 * limitations under the License.
1942 * ========================================================== */
1947 "use strict"; // jshint ;_;
1950 /* AFFIX CLASS DEFINITION
1951 * ====================== */
1953 var Affix = function (element, options) {
1954 this.options = $.extend({}, $.fn.affix.defaults, options)
1955 this.$window = $(window)
1956 .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
1957 .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
1958 this.$element = $(element)
1959 this.checkPosition()
1962 Affix.prototype.checkPosition = function () {
1963 if (!this.$element.is(':visible')) return
1965 var scrollHeight = $(document).height()
1966 , scrollTop = this.$window.scrollTop()
1967 , position = this.$element.offset()
1968 , offset = this.options.offset
1969 , offsetBottom = offset.bottom
1970 , offsetTop = offset.top
1971 , reset = 'affix affix-top affix-bottom'
1974 if (typeof offset != 'object') offsetBottom = offsetTop = offset
1975 if (typeof offsetTop == 'function') offsetTop = offset.top()
1976 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
1978 affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
1979 false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
1980 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
1983 if (this.affixed === affix) return
1985 this.affixed = affix
1986 this.unpin = affix == 'bottom' ? position.top - scrollTop : null
1988 this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
1992 /* AFFIX PLUGIN DEFINITION
1993 * ======================= */
1995 $.fn.affix = function (option) {
1996 return this.each(function () {
1998 , data = $this.data('affix')
1999 , options = typeof option == 'object' && option
2000 if (!data) $this.data('affix', (data = new Affix(this, options)))
2001 if (typeof option == 'string') data[option]()
2005 $.fn.affix.Constructor = Affix
2007 $.fn.affix.defaults = {
2015 $(window).on('load', function () {
2016 $('[data-spy="affix"]').each(function () {
2018 , data = $spy.data()
2020 data.offset = data.offset || {}
2022 data.offsetBottom && (data.offset.bottom = data.offsetBottom)
2023 data.offsetTop && (data.offset.top = data.offsetTop)