1 /* ===================================================
2 * bootstrap-transition.js v2.3.2
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.$jqTheme || window.jQuery);
61 /* ==========================================================
62 * bootstrap-alert.js v2.3.2
63 * http://twitter.github.com/bootstrap/javascript.html#alerts
64 * ==========================================================
65 * Copyright 2012 Twitter, Inc.
67 * Licensed under the Apache License, Version 2.0 (the "License");
68 * you may not use this file except in compliance with the License.
69 * You may obtain a copy of the License at
71 * http://www.apache.org/licenses/LICENSE-2.0
73 * Unless required by applicable law or agreed to in writing, software
74 * distributed under the License is distributed on an "AS IS" BASIS,
75 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
76 * See the License for the specific language governing permissions and
77 * limitations under the License.
78 * ========================================================== */
83 "use strict"; // jshint ;_;
86 /* ALERT CLASS DEFINITION
87 * ====================== */
89 var dismiss = '[data-dismiss="alert"]'
90 , Alert = function (el) {
91 $(el).on('click', dismiss, this.close)
94 Alert.prototype.close = function (e) {
96 , selector = $this.attr('data-target')
100 selector = $this.attr('href')
101 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
104 $parent = $(selector)
106 e && e.preventDefault()
108 $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
110 $parent.trigger(e = $.Event('close'))
112 if (e.isDefaultPrevented()) return
114 $parent.removeClass('in')
116 function removeElement() {
122 $.support.transition && $parent.hasClass('fade') ?
123 $parent.on($.support.transition.end, removeElement) :
128 /* ALERT PLUGIN DEFINITION
129 * ======================= */
133 $.fn.alert = function (option) {
134 return this.each(function () {
136 , data = $this.data('alert')
137 if (!data) $this.data('alert', (data = new Alert(this)))
138 if (typeof option == 'string') data[option].call($this)
142 $.fn.alert.Constructor = Alert
146 * ================= */
148 $.fn.alert.noConflict = function () {
157 $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
159 }(window.$jqTheme || window.jQuery);
160 /* ============================================================
161 * bootstrap-button.js v2.3.2
162 * http://twitter.github.com/bootstrap/javascript.html#buttons
163 * ============================================================
164 * Copyright 2012 Twitter, Inc.
166 * Licensed under the Apache License, Version 2.0 (the "License");
167 * you may not use this file except in compliance with the License.
168 * You may obtain a copy of the License at
170 * http://www.apache.org/licenses/LICENSE-2.0
172 * Unless required by applicable law or agreed to in writing, software
173 * distributed under the License is distributed on an "AS IS" BASIS,
174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
175 * See the License for the specific language governing permissions and
176 * limitations under the License.
177 * ============================================================ */
182 "use strict"; // jshint ;_;
185 /* BUTTON PUBLIC CLASS DEFINITION
186 * ============================== */
188 var Button = function (element, options) {
189 this.$element = $(element)
190 this.options = $.extend({}, $.fn.button.defaults, options)
193 Button.prototype.setState = function (state) {
195 , $el = this.$element
197 , val = $el.is('input') ? 'val' : 'html'
199 state = state + 'Text'
200 data.resetText || $el.data('resetText', $el[val]())
202 $el[val](data[state] || this.options[state])
204 // push to event loop to allow forms to submit
205 setTimeout(function () {
206 state == 'loadingText' ?
207 $el.addClass(d).attr(d, d) :
208 $el.removeClass(d).removeAttr(d)
212 Button.prototype.toggle = function () {
213 var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
217 .removeClass('active')
219 this.$element.toggleClass('active')
223 /* BUTTON PLUGIN DEFINITION
224 * ======================== */
226 var old = $.fn.button
228 $.fn.button = function (option) {
229 return this.each(function () {
231 , data = $this.data('button')
232 , options = typeof option == 'object' && option
233 if (!data) $this.data('button', (data = new Button(this, options)))
234 if (option == 'toggle') data.toggle()
235 else if (option) data.setState(option)
239 $.fn.button.defaults = {
240 loadingText: 'loading...'
243 $.fn.button.Constructor = Button
246 /* BUTTON NO CONFLICT
247 * ================== */
249 $.fn.button.noConflict = function () {
258 $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
259 var $btn = $(e.target)
260 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
261 $btn.button('toggle')
264 }(window.$jqTheme || window.jQuery);
265 /* ==========================================================
266 * bootstrap-carousel.js v2.3.2
267 * http://twitter.github.com/bootstrap/javascript.html#carousel
268 * ==========================================================
269 * Copyright 2012 Twitter, Inc.
271 * Licensed under the Apache License, Version 2.0 (the "License");
272 * you may not use this file except in compliance with the License.
273 * You may obtain a copy of the License at
275 * http://www.apache.org/licenses/LICENSE-2.0
277 * Unless required by applicable law or agreed to in writing, software
278 * distributed under the License is distributed on an "AS IS" BASIS,
279 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
280 * See the License for the specific language governing permissions and
281 * limitations under the License.
282 * ========================================================== */
287 "use strict"; // jshint ;_;
290 /* CAROUSEL CLASS DEFINITION
291 * ========================= */
293 var Carousel = function (element, options) {
294 this.$element = $(element)
295 this.$indicators = this.$element.find('.carousel-indicators')
296 this.options = options
297 this.options.pause == 'hover' && this.$element
298 .on('mouseenter', $.proxy(this.pause, this))
299 .on('mouseleave', $.proxy(this.cycle, this))
302 Carousel.prototype = {
304 cycle: function (e) {
305 if (!e) this.paused = false
306 if (this.interval) clearInterval(this.interval);
307 this.options.interval
309 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
313 , getActiveIndex: function () {
314 this.$active = this.$element.find('.item.active')
315 this.$items = this.$active.parent().children()
316 return this.$items.index(this.$active)
319 , to: function (pos) {
320 var activeIndex = this.getActiveIndex()
323 if (pos > (this.$items.length - 1) || pos < 0) return
326 return this.$element.one('slid', function () {
331 if (activeIndex == pos) {
332 return this.pause().cycle()
335 return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
338 , pause: function (e) {
339 if (!e) this.paused = true
340 if (this.$element.find('.next, .prev').length && $.support.transition.end) {
341 this.$element.trigger($.support.transition.end)
344 clearInterval(this.interval)
349 , next: function () {
350 if (this.sliding) return
351 return this.slide('next')
354 , prev: function () {
355 if (this.sliding) return
356 return this.slide('prev')
359 , slide: function (type, next) {
360 var $active = this.$element.find('.item.active')
361 , $next = next || $active[type]()
362 , isCycling = this.interval
363 , direction = type == 'next' ? 'left' : 'right'
364 , fallback = type == 'next' ? 'first' : 'last'
370 isCycling && this.pause()
372 $next = $next.length ? $next : this.$element.find('.item')[fallback]()
374 e = $.Event('slide', {
375 relatedTarget: $next[0]
376 , direction: direction
379 if ($next.hasClass('active')) return
381 if (this.$indicators.length) {
382 this.$indicators.find('.active').removeClass('active')
383 this.$element.one('slid', function () {
384 var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
385 $nextIndicator && $nextIndicator.addClass('active')
389 if ($.support.transition && this.$element.hasClass('slide')) {
390 this.$element.trigger(e)
391 if (e.isDefaultPrevented()) return
393 $next[0].offsetWidth // force reflow
394 $active.addClass(direction)
395 $next.addClass(direction)
396 this.$element.one($.support.transition.end, function () {
397 $next.removeClass([type, direction].join(' ')).addClass('active')
398 $active.removeClass(['active', direction].join(' '))
400 setTimeout(function () { that.$element.trigger('slid') }, 0)
403 this.$element.trigger(e)
404 if (e.isDefaultPrevented()) return
405 $active.removeClass('active')
406 $next.addClass('active')
408 this.$element.trigger('slid')
411 isCycling && this.cycle()
419 /* CAROUSEL PLUGIN DEFINITION
420 * ========================== */
422 var old = $.fn.carousel
424 $.fn.carousel = function (option) {
425 return this.each(function () {
427 , data = $this.data('carousel')
428 , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
429 , action = typeof option == 'string' ? option : options.slide
430 if (!data) $this.data('carousel', (data = new Carousel(this, options)))
431 if (typeof option == 'number') data.to(option)
432 else if (action) data[action]()
433 else if (options.interval) data.pause().cycle()
437 $.fn.carousel.defaults = {
442 $.fn.carousel.Constructor = Carousel
445 /* CAROUSEL NO CONFLICT
446 * ==================== */
448 $.fn.carousel.noConflict = function () {
454 * ================= */
456 $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
457 var $this = $(this), href
458 , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
459 , options = $.extend({}, $target.data(), $this.data())
462 $target.carousel(options)
464 if (slideIndex = $this.attr('data-slide-to')) {
465 $target.data('carousel').pause().to(slideIndex).cycle()
471 }(window.$jqTheme || window.jQuery);
472 /* =============================================================
473 * bootstrap-collapse.js v2.3.2
474 * http://twitter.github.com/bootstrap/javascript.html#collapse
475 * =============================================================
476 * Copyright 2012 Twitter, Inc.
478 * Licensed under the Apache License, Version 2.0 (the "License");
479 * you may not use this file except in compliance with the License.
480 * You may obtain a copy of the License at
482 * http://www.apache.org/licenses/LICENSE-2.0
484 * Unless required by applicable law or agreed to in writing, software
485 * distributed under the License is distributed on an "AS IS" BASIS,
486 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
487 * See the License for the specific language governing permissions and
488 * limitations under the License.
489 * ============================================================ */
494 "use strict"; // jshint ;_;
497 /* COLLAPSE PUBLIC CLASS DEFINITION
498 * ================================ */
500 var Collapse = function (element, options) {
501 this.$element = $(element)
502 this.options = $.extend({}, $.fn.collapse.defaults, options)
504 if (this.options.parent) {
505 this.$parent = $(this.options.parent)
508 this.options.toggle && this.toggle()
511 Collapse.prototype = {
513 constructor: Collapse
515 , dimension: function () {
516 var hasWidth = this.$element.hasClass('width')
517 return hasWidth ? 'width' : 'height'
520 , show: function () {
526 if (this.transitioning || this.$element.hasClass('in')) return
528 dimension = this.dimension()
529 scroll = $.camelCase(['scroll', dimension].join('-'))
530 actives = this.$parent && this.$parent.find('> .accordion-group > .in')
532 if (actives && actives.length) {
533 hasData = actives.data('collapse')
534 if (hasData && hasData.transitioning) return
535 actives.collapse('hide')
536 hasData || actives.data('collapse', null)
539 this.$element[dimension](0)
540 this.transition('addClass', $.Event('show'), 'shown')
541 $.support.transition && this.$element[dimension](this.$element[0][scroll])
544 , hide: function () {
546 if (this.transitioning || !this.$element.hasClass('in')) return
547 dimension = this.dimension()
548 this.reset(this.$element[dimension]())
549 this.transition('removeClass', $.Event('hide'), 'hidden')
550 this.$element[dimension](0)
553 , reset: function (size) {
554 var dimension = this.dimension()
557 .removeClass('collapse')
558 [dimension](size || 'auto')
561 this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
566 , transition: function (method, startEvent, completeEvent) {
568 , complete = function () {
569 if (startEvent.type == 'show') that.reset()
570 that.transitioning = 0
571 that.$element.trigger(completeEvent)
574 this.$element.trigger(startEvent)
576 if (startEvent.isDefaultPrevented()) return
578 this.transitioning = 1
580 this.$element[method]('in')
582 $.support.transition && this.$element.hasClass('collapse') ?
583 this.$element.one($.support.transition.end, complete) :
587 , toggle: function () {
588 this[this.$element.hasClass('in') ? 'hide' : 'show']()
594 /* COLLAPSE PLUGIN DEFINITION
595 * ========================== */
597 var old = $.fn.collapse
599 $.fn.collapse = function (option) {
600 return this.each(function () {
602 , data = $this.data('collapse')
603 , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
604 if (!data) $this.data('collapse', (data = new Collapse(this, options)))
605 if (typeof option == 'string') data[option]()
609 $.fn.collapse.defaults = {
613 $.fn.collapse.Constructor = Collapse
616 /* COLLAPSE NO CONFLICT
617 * ==================== */
619 $.fn.collapse.noConflict = function () {
626 * ================= */
628 $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
629 var $this = $(this), href
630 , target = $this.attr('data-target')
631 || e.preventDefault()
632 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
633 , option = $(target).data('collapse') ? 'toggle' : $this.data()
634 $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
635 $(target).collapse(option)
638 }(window.$jqTheme || window.jQuery);
639 /* ============================================================
640 * bootstrap-dropdown.js v2.3.2
641 * http://twitter.github.com/bootstrap/javascript.html#dropdowns
642 * ============================================================
643 * Copyright 2012 Twitter, Inc.
645 * Licensed under the Apache License, Version 2.0 (the "License");
646 * you may not use this file except in compliance with the License.
647 * You may obtain a copy of the License at
649 * http://www.apache.org/licenses/LICENSE-2.0
651 * Unless required by applicable law or agreed to in writing, software
652 * distributed under the License is distributed on an "AS IS" BASIS,
653 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
654 * See the License for the specific language governing permissions and
655 * limitations under the License.
656 * ============================================================ */
661 "use strict"; // jshint ;_;
664 /* DROPDOWN CLASS DEFINITION
665 * ========================= */
667 var toggle = '[data-toggle=dropdown]'
668 , Dropdown = function (element) {
669 var $el = $(element).on('click.dropdown.data-api', this.toggle)
670 $('html').on('click.dropdown.data-api', function () {
671 $el.parent().removeClass('open')
675 Dropdown.prototype = {
677 constructor: Dropdown
679 , toggle: function (e) {
684 if ($this.is('.disabled, :disabled')) return
686 $parent = getParent($this)
688 isActive = $parent.hasClass('open')
693 if ('ontouchstart' in document.documentElement) {
694 // if mobile we we use a backdrop because click events don't delegate
695 $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
697 $parent.toggleClass('open')
705 , keydown: function (e) {
713 if (!/(38|40|27)/.test(e.keyCode)) return
720 if ($this.is('.disabled, :disabled')) return
722 $parent = getParent($this)
724 isActive = $parent.hasClass('open')
726 if (!isActive || (isActive && e.keyCode == 27)) {
727 if (e.which == 27) $parent.find(toggle).focus()
731 $items = $('[role=menu] li:not(.divider):visible a', $parent)
733 if (!$items.length) return
735 index = $items.index($items.filter(':focus'))
737 if (e.keyCode == 38 && index > 0) index-- // up
738 if (e.keyCode == 40 && index < $items.length - 1) index++ // down
739 if (!~index) index = 0
748 function clearMenus() {
749 $('.dropdown-backdrop').remove()
750 $(toggle).each(function () {
751 getParent($(this)).removeClass('open')
755 function getParent($this) {
756 var selector = $this.attr('data-target')
760 selector = $this.attr('href')
761 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
764 $parent = selector && $(selector)
766 if (!$parent || !$parent.length) $parent = $this.parent()
772 /* DROPDOWN PLUGIN DEFINITION
773 * ========================== */
775 var old = $.fn.dropdown
777 $.fn.dropdown = function (option) {
778 return this.each(function () {
780 , data = $this.data('dropdown')
781 if (!data) $this.data('dropdown', (data = new Dropdown(this)))
782 if (typeof option == 'string') data[option].call($this)
786 $.fn.dropdown.Constructor = Dropdown
789 /* DROPDOWN NO CONFLICT
790 * ==================== */
792 $.fn.dropdown.noConflict = function () {
798 /* APPLY TO STANDARD DROPDOWN ELEMENTS
799 * =================================== */
802 .on('click.dropdown.data-api', clearMenus)
803 .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
804 .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
805 .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
807 }(window.$jqTheme || window.jQuery);
808 /* =========================================================
809 * bootstrap-modal.js v2.3.2
810 * http://twitter.github.com/bootstrap/javascript.html#modals
811 * =========================================================
812 * Copyright 2012 Twitter, Inc.
814 * Licensed under the Apache License, Version 2.0 (the "License");
815 * you may not use this file except in compliance with the License.
816 * You may obtain a copy of the License at
818 * http://www.apache.org/licenses/LICENSE-2.0
820 * Unless required by applicable law or agreed to in writing, software
821 * distributed under the License is distributed on an "AS IS" BASIS,
822 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
823 * See the License for the specific language governing permissions and
824 * limitations under the License.
825 * ========================================================= */
830 "use strict"; // jshint ;_;
833 /* MODAL CLASS DEFINITION
834 * ====================== */
836 var Modal = function (element, options) {
837 this.options = options
838 this.$element = $(element)
839 .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
840 this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
847 , toggle: function () {
848 return this[!this.isShown ? 'show' : 'hide']()
851 , show: function () {
853 , e = $.Event('show')
855 this.$element.trigger(e)
857 if (this.isShown || e.isDefaultPrevented()) return
863 this.backdrop(function () {
864 var transition = $.support.transition && that.$element.hasClass('fade')
866 if (!that.$element.parent().length) {
867 that.$element.appendTo(document.body) //don't move modals dom position
873 that.$element[0].offsetWidth // force reflow
878 .attr('aria-hidden', false)
883 that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
884 that.$element.focus().trigger('shown')
889 , hide: function (e) {
890 e && e.preventDefault()
896 this.$element.trigger(e)
898 if (!this.isShown || e.isDefaultPrevented()) return
904 $(document).off('focusin.modal')
908 .attr('aria-hidden', true)
910 $.support.transition && this.$element.hasClass('fade') ?
911 this.hideWithTransition() :
915 , enforceFocus: function () {
917 $(document).on('focusin.modal', function (e) {
918 if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
919 that.$element.focus()
924 , escape: function () {
926 if (this.isShown && this.options.keyboard) {
927 this.$element.on('keyup.dismiss.modal', function ( e ) {
928 e.which == 27 && that.hide()
930 } else if (!this.isShown) {
931 this.$element.off('keyup.dismiss.modal')
935 , hideWithTransition: function () {
937 , timeout = setTimeout(function () {
938 that.$element.off($.support.transition.end)
942 this.$element.one($.support.transition.end, function () {
943 clearTimeout(timeout)
948 , hideModal: function () {
951 this.backdrop(function () {
952 that.removeBackdrop()
953 that.$element.trigger('hidden')
957 , removeBackdrop: function () {
958 this.$backdrop && this.$backdrop.remove()
959 this.$backdrop = null
962 , backdrop: function (callback) {
964 , animate = this.$element.hasClass('fade') ? 'fade' : ''
966 if (this.isShown && this.options.backdrop) {
967 var doAnimate = $.support.transition && animate
969 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
970 .appendTo(document.body)
972 this.$backdrop.click(
973 this.options.backdrop == 'static' ?
974 $.proxy(this.$element[0].focus, this.$element[0])
975 : $.proxy(this.hide, this)
978 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
980 this.$backdrop.addClass('in')
982 if (!callback) return
985 this.$backdrop.one($.support.transition.end, callback) :
988 } else if (!this.isShown && this.$backdrop) {
989 this.$backdrop.removeClass('in')
991 $.support.transition && this.$element.hasClass('fade')?
992 this.$backdrop.one($.support.transition.end, callback) :
995 } else if (callback) {
1002 /* MODAL PLUGIN DEFINITION
1003 * ======================= */
1005 var old = $.fn.modal
1007 $.fn.modal = function (option) {
1008 return this.each(function () {
1010 , data = $this.data('modal')
1011 , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
1012 if (!data) $this.data('modal', (data = new Modal(this, options)))
1013 if (typeof option == 'string') data[option]()
1014 else if (options.show) data.show()
1018 $.fn.modal.defaults = {
1024 $.fn.modal.Constructor = Modal
1027 /* MODAL NO CONFLICT
1028 * ================= */
1030 $.fn.modal.noConflict = function () {
1039 $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
1041 , href = $this.attr('href')
1042 , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
1043 , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
1049 .one('hide', function () {
1054 }(window.$jqTheme || window.jQuery);
1055 /* ===========================================================
1056 * bootstrap-tooltip.js v2.3.2
1057 * http://twitter.github.com/bootstrap/javascript.html#tooltips
1058 * Inspired by the original jQuery.tipsy by Jason Frame
1059 * ===========================================================
1060 * Copyright 2012 Twitter, Inc.
1062 * Licensed under the Apache License, Version 2.0 (the "License");
1063 * you may not use this file except in compliance with the License.
1064 * You may obtain a copy of the License at
1066 * http://www.apache.org/licenses/LICENSE-2.0
1068 * Unless required by applicable law or agreed to in writing, software
1069 * distributed under the License is distributed on an "AS IS" BASIS,
1070 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1071 * See the License for the specific language governing permissions and
1072 * limitations under the License.
1073 * ========================================================== */
1078 "use strict"; // jshint ;_;
1081 /* TOOLTIP PUBLIC CLASS DEFINITION
1082 * =============================== */
1084 var Tooltip = function (element, options) {
1085 this.init('tooltip', element, options)
1088 Tooltip.prototype = {
1090 constructor: Tooltip
1092 , init: function (type, element, options) {
1100 this.$element = $(element)
1101 this.options = this.getOptions(options)
1104 triggers = this.options.trigger.split(' ')
1106 for (i = triggers.length; i--;) {
1107 trigger = triggers[i]
1108 if (trigger == 'click') {
1109 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1110 } else if (trigger != 'manual') {
1111 eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
1112 eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
1113 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1114 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1118 this.options.selector ?
1119 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1123 , getOptions: function (options) {
1124 options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
1126 if (options.delay && typeof options.delay == 'number') {
1129 , hide: options.delay
1136 , enter: function (e) {
1137 var defaults = $.fn[this.type].defaults
1141 this._options && $.each(this._options, function (key, value) {
1142 if (defaults[key] != value) options[key] = value
1145 self = $(e.currentTarget)[this.type](options).data(this.type)
1147 if (!self.options.delay || !self.options.delay.show) return self.show()
1149 clearTimeout(this.timeout)
1150 self.hoverState = 'in'
1151 this.timeout = setTimeout(function() {
1152 if (self.hoverState == 'in') self.show()
1153 }, self.options.delay.show)
1156 , leave: function (e) {
1157 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1159 if (this.timeout) clearTimeout(this.timeout)
1160 if (!self.options.delay || !self.options.delay.hide) return self.hide()
1162 self.hoverState = 'out'
1163 this.timeout = setTimeout(function() {
1164 if (self.hoverState == 'out') self.hide()
1165 }, self.options.delay.hide)
1168 , show: function () {
1175 , e = $.Event('show')
1177 if (this.hasContent() && this.enabled) {
1178 this.$element.trigger(e)
1179 if (e.isDefaultPrevented()) return
1183 if (this.options.animation) {
1184 $tip.addClass('fade')
1187 placement = typeof this.options.placement == 'function' ?
1188 this.options.placement.call(this, $tip[0], this.$element[0]) :
1189 this.options.placement
1193 .css({ top: 0, left: 0, display: 'block' })
1195 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1197 pos = this.getPosition()
1199 actualWidth = $tip[0].offsetWidth
1200 actualHeight = $tip[0].offsetHeight
1202 switch (placement) {
1204 tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1207 tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1210 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1213 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1217 this.applyPlacement(tp, placement)
1218 this.$element.trigger('shown')
1222 , applyPlacement: function(offset, placement){
1223 var $tip = this.tip()
1224 , width = $tip[0].offsetWidth
1225 , height = $tip[0].offsetHeight
1233 .addClass(placement)
1236 actualWidth = $tip[0].offsetWidth
1237 actualHeight = $tip[0].offsetHeight
1239 if (placement == 'top' && actualHeight != height) {
1240 offset.top = offset.top + height - actualHeight
1244 if (placement == 'bottom' || placement == 'top') {
1247 if (offset.left < 0){
1248 delta = offset.left * -2
1251 actualWidth = $tip[0].offsetWidth
1252 actualHeight = $tip[0].offsetHeight
1255 this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
1257 this.replaceArrow(actualHeight - height, actualHeight, 'top')
1260 if (replace) $tip.offset(offset)
1263 , replaceArrow: function(delta, dimension, position){
1266 .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
1269 , setContent: function () {
1270 var $tip = this.tip()
1271 , title = this.getTitle()
1273 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1274 $tip.removeClass('fade in top bottom left right')
1277 , hide: function () {
1280 , e = $.Event('hide')
1282 this.$element.trigger(e)
1283 if (e.isDefaultPrevented()) return
1285 $tip.removeClass('in')
1287 function removeWithAnimation() {
1288 var timeout = setTimeout(function () {
1289 $tip.off($.support.transition.end).detach()
1292 $tip.one($.support.transition.end, function () {
1293 clearTimeout(timeout)
1298 $.support.transition && this.$tip.hasClass('fade') ?
1299 removeWithAnimation() :
1302 this.$element.trigger('hidden')
1307 , fixTitle: function () {
1308 var $e = this.$element
1309 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1310 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1314 , hasContent: function () {
1315 return this.getTitle()
1318 , getPosition: function () {
1319 var el = this.$element[0]
1320 return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
1321 width: el.offsetWidth
1322 , height: el.offsetHeight
1323 }, this.$element.offset())
1326 , getTitle: function () {
1328 , $e = this.$element
1331 title = $e.attr('data-original-title')
1332 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1337 , tip: function () {
1338 return this.$tip = this.$tip || $(this.options.template)
1341 , arrow: function(){
1342 return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
1345 , validate: function () {
1346 if (!this.$element[0].parentNode) {
1348 this.$element = null
1353 , enable: function () {
1357 , disable: function () {
1358 this.enabled = false
1361 , toggleEnabled: function () {
1362 this.enabled = !this.enabled
1365 , toggle: function (e) {
1366 var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
1367 self.tip().hasClass('in') ? self.hide() : self.show()
1370 , destroy: function () {
1371 this.hide().$element.off('.' + this.type).removeData(this.type)
1377 /* TOOLTIP PLUGIN DEFINITION
1378 * ========================= */
1380 var old = $.fn.tooltip
1382 $.fn.tooltip = function ( option ) {
1383 return this.each(function () {
1385 , data = $this.data('tooltip')
1386 , options = typeof option == 'object' && option
1387 if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1388 if (typeof option == 'string') data[option]()
1392 $.fn.tooltip.Constructor = Tooltip
1394 $.fn.tooltip.defaults = {
1398 , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1399 , trigger: 'hover focus'
1407 /* TOOLTIP NO CONFLICT
1408 * =================== */
1410 $.fn.tooltip.noConflict = function () {
1415 }(window.$jqTheme || window.jQuery);
1416 /* ===========================================================
1417 * bootstrap-popover.js v2.3.2
1418 * http://twitter.github.com/bootstrap/javascript.html#popovers
1419 * ===========================================================
1420 * Copyright 2012 Twitter, Inc.
1422 * Licensed under the Apache License, Version 2.0 (the "License");
1423 * you may not use this file except in compliance with the License.
1424 * You may obtain a copy of the License at
1426 * http://www.apache.org/licenses/LICENSE-2.0
1428 * Unless required by applicable law or agreed to in writing, software
1429 * distributed under the License is distributed on an "AS IS" BASIS,
1430 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1431 * See the License for the specific language governing permissions and
1432 * limitations under the License.
1433 * =========================================================== */
1438 "use strict"; // jshint ;_;
1441 /* POPOVER PUBLIC CLASS DEFINITION
1442 * =============================== */
1444 var Popover = function (element, options) {
1445 this.init('popover', element, options)
1449 /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1450 ========================================== */
1452 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1454 constructor: Popover
1456 , setContent: function () {
1457 var $tip = this.tip()
1458 , title = this.getTitle()
1459 , content = this.getContent()
1461 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1462 $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
1464 $tip.removeClass('fade top bottom left right in')
1467 , hasContent: function () {
1468 return this.getTitle() || this.getContent()
1471 , getContent: function () {
1473 , $e = this.$element
1476 content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1477 || $e.attr('data-content')
1482 , tip: function () {
1484 this.$tip = $(this.options.template)
1489 , destroy: function () {
1490 this.hide().$element.off('.' + this.type).removeData(this.type)
1496 /* POPOVER PLUGIN DEFINITION
1497 * ======================= */
1499 var old = $.fn.popover
1501 $.fn.popover = function (option) {
1502 return this.each(function () {
1504 , data = $this.data('popover')
1505 , options = typeof option == 'object' && option
1506 if (!data) $this.data('popover', (data = new Popover(this, options)))
1507 if (typeof option == 'string') data[option]()
1511 $.fn.popover.Constructor = Popover
1513 $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1517 , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1521 /* POPOVER NO CONFLICT
1522 * =================== */
1524 $.fn.popover.noConflict = function () {
1529 }(window.$jqTheme || window.jQuery);
1530 /* =============================================================
1531 * bootstrap-scrollspy.js v2.3.2
1532 * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1533 * =============================================================
1534 * Copyright 2012 Twitter, Inc.
1536 * Licensed under the Apache License, Version 2.0 (the "License");
1537 * you may not use this file except in compliance with the License.
1538 * You may obtain a copy of the License at
1540 * http://www.apache.org/licenses/LICENSE-2.0
1542 * Unless required by applicable law or agreed to in writing, software
1543 * distributed under the License is distributed on an "AS IS" BASIS,
1544 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1545 * See the License for the specific language governing permissions and
1546 * limitations under the License.
1547 * ============================================================== */
1552 "use strict"; // jshint ;_;
1555 /* SCROLLSPY CLASS DEFINITION
1556 * ========================== */
1558 function ScrollSpy(element, options) {
1559 var process = $.proxy(this.process, this)
1560 , $element = $(element).is('body') ? $(window) : $(element)
1562 this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1563 this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
1564 this.selector = (this.options.target
1565 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1566 || '') + ' .nav li > a'
1567 this.$body = $('body')
1572 ScrollSpy.prototype = {
1574 constructor: ScrollSpy
1576 , refresh: function () {
1580 this.offsets = $([])
1581 this.targets = $([])
1583 $targets = this.$body
1584 .find(this.selector)
1587 , href = $el.data('target') || $el.attr('href')
1588 , $href = /^#\w/.test(href) && $(href)
1591 && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
1593 .sort(function (a, b) { return a[0] - b[0] })
1595 self.offsets.push(this[0])
1596 self.targets.push(this[1])
1600 , process: function () {
1601 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1602 , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1603 , maxScroll = scrollHeight - this.$scrollElement.height()
1604 , offsets = this.offsets
1605 , targets = this.targets
1606 , activeTarget = this.activeTarget
1609 if (scrollTop >= maxScroll) {
1610 return activeTarget != (i = targets.last()[0])
1611 && this.activate ( i )
1614 for (i = offsets.length; i--;) {
1615 activeTarget != targets[i]
1616 && scrollTop >= offsets[i]
1617 && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1618 && this.activate( targets[i] )
1622 , activate: function (target) {
1626 this.activeTarget = target
1630 .removeClass('active')
1632 selector = this.selector
1633 + '[data-target="' + target + '"],'
1634 + this.selector + '[href="' + target + '"]'
1636 active = $(selector)
1640 if (active.parent('.dropdown-menu').length) {
1641 active = active.closest('li.dropdown').addClass('active')
1644 active.trigger('activate')
1650 /* SCROLLSPY PLUGIN DEFINITION
1651 * =========================== */
1653 var old = $.fn.scrollspy
1655 $.fn.scrollspy = function (option) {
1656 return this.each(function () {
1658 , data = $this.data('scrollspy')
1659 , options = typeof option == 'object' && option
1660 if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1661 if (typeof option == 'string') data[option]()
1665 $.fn.scrollspy.Constructor = ScrollSpy
1667 $.fn.scrollspy.defaults = {
1672 /* SCROLLSPY NO CONFLICT
1673 * ===================== */
1675 $.fn.scrollspy.noConflict = function () {
1676 $.fn.scrollspy = old
1681 /* SCROLLSPY DATA-API
1682 * ================== */
1684 $(window).on('load', function () {
1685 $('[data-spy="scroll"]').each(function () {
1687 $spy.scrollspy($spy.data())
1691 }(window.$jqTheme || window.jQuery);
1692 /* ========================================================
1693 * bootstrap-tab.js v2.3.2
1694 * http://twitter.github.com/bootstrap/javascript.html#tabs
1695 * ========================================================
1696 * Copyright 2012 Twitter, Inc.
1698 * Licensed under the Apache License, Version 2.0 (the "License");
1699 * you may not use this file except in compliance with the License.
1700 * You may obtain a copy of the License at
1702 * http://www.apache.org/licenses/LICENSE-2.0
1704 * Unless required by applicable law or agreed to in writing, software
1705 * distributed under the License is distributed on an "AS IS" BASIS,
1706 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1707 * See the License for the specific language governing permissions and
1708 * limitations under the License.
1709 * ======================================================== */
1714 "use strict"; // jshint ;_;
1717 /* TAB CLASS DEFINITION
1718 * ==================== */
1720 var Tab = function (element) {
1721 this.element = $(element)
1728 , show: function () {
1729 var $this = this.element
1730 , $ul = $this.closest('ul:not(.dropdown-menu)')
1731 , selector = $this.attr('data-target')
1737 selector = $this.attr('href')
1738 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1741 if ( $this.parent('li').hasClass('active') ) return
1743 previous = $ul.find('.active:last a')[0]
1745 e = $.Event('show', {
1746 relatedTarget: previous
1751 if (e.isDefaultPrevented()) return
1753 $target = $(selector)
1755 this.activate($this.parent('li'), $ul)
1756 this.activate($target, $target.parent(), function () {
1759 , relatedTarget: previous
1764 , activate: function ( element, container, callback) {
1765 var $active = container.find('> .active')
1766 , transition = callback
1767 && $.support.transition
1768 && $active.hasClass('fade')
1772 .removeClass('active')
1773 .find('> .dropdown-menu > .active')
1774 .removeClass('active')
1776 element.addClass('active')
1779 element[0].offsetWidth // reflow for transition
1780 element.addClass('in')
1782 element.removeClass('fade')
1785 if ( element.parent('.dropdown-menu') ) {
1786 element.closest('li.dropdown').addClass('active')
1789 callback && callback()
1793 $active.one($.support.transition.end, next) :
1796 $active.removeClass('in')
1801 /* TAB PLUGIN DEFINITION
1802 * ===================== */
1806 $.fn.tab = function ( option ) {
1807 return this.each(function () {
1809 , data = $this.data('tab')
1810 if (!data) $this.data('tab', (data = new Tab(this)))
1811 if (typeof option == 'string') data[option]()
1815 $.fn.tab.Constructor = Tab
1819 * =============== */
1821 $.fn.tab.noConflict = function () {
1830 $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1835 }(window.$jqTheme || window.jQuery);
1836 /* =============================================================
1837 * bootstrap-typeahead.js v2.3.2
1838 * http://twitter.github.com/bootstrap/javascript.html#typeahead
1839 * =============================================================
1840 * Copyright 2012 Twitter, Inc.
1842 * Licensed under the Apache License, Version 2.0 (the "License");
1843 * you may not use this file except in compliance with the License.
1844 * You may obtain a copy of the License at
1846 * http://www.apache.org/licenses/LICENSE-2.0
1848 * Unless required by applicable law or agreed to in writing, software
1849 * distributed under the License is distributed on an "AS IS" BASIS,
1850 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1851 * See the License for the specific language governing permissions and
1852 * limitations under the License.
1853 * ============================================================ */
1858 "use strict"; // jshint ;_;
1861 /* TYPEAHEAD PUBLIC CLASS DEFINITION
1862 * ================================= */
1864 var Typeahead = function (element, options) {
1865 this.$element = $(element)
1866 this.options = $.extend({}, $.fn.typeahead.defaults, options)
1867 this.matcher = this.options.matcher || this.matcher
1868 this.sorter = this.options.sorter || this.sorter
1869 this.highlighter = this.options.highlighter || this.highlighter
1870 this.updater = this.options.updater || this.updater
1871 this.source = this.options.source
1872 this.$menu = $(this.options.menu)
1877 Typeahead.prototype = {
1879 constructor: Typeahead
1881 , select: function () {
1882 var val = this.$menu.find('.active').attr('data-value')
1884 .val(this.updater(val))
1889 , updater: function (item) {
1893 , show: function () {
1894 var pos = $.extend({}, this.$element.position(), {
1895 height: this.$element[0].offsetHeight
1899 .insertAfter(this.$element)
1901 top: pos.top + pos.height
1910 , hide: function () {
1916 , lookup: function (event) {
1919 this.query = this.$element.val()
1921 if (!this.query || this.query.length < this.options.minLength) {
1922 return this.shown ? this.hide() : this
1925 items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
1927 return items ? this.process(items) : this
1930 , process: function (items) {
1933 items = $.grep(items, function (item) {
1934 return that.matcher(item)
1937 items = this.sorter(items)
1939 if (!items.length) {
1940 return this.shown ? this.hide() : this
1943 return this.render(items.slice(0, this.options.items)).show()
1946 , matcher: function (item) {
1947 return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1950 , sorter: function (items) {
1952 , caseSensitive = []
1953 , caseInsensitive = []
1956 while (item = items.shift()) {
1957 if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1958 else if (~item.indexOf(this.query)) caseSensitive.push(item)
1959 else caseInsensitive.push(item)
1962 return beginswith.concat(caseSensitive, caseInsensitive)
1965 , highlighter: function (item) {
1966 var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1967 return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1968 return '<strong>' + match + '</strong>'
1972 , render: function (items) {
1975 items = $(items).map(function (i, item) {
1976 i = $(that.options.item).attr('data-value', item)
1977 i.find('a').html(that.highlighter(item))
1981 items.first().addClass('active')
1982 this.$menu.html(items)
1986 , next: function (event) {
1987 var active = this.$menu.find('.active').removeClass('active')
1988 , next = active.next()
1991 next = $(this.$menu.find('li')[0])
1994 next.addClass('active')
1997 , prev: function (event) {
1998 var active = this.$menu.find('.active').removeClass('active')
1999 , prev = active.prev()
2002 prev = this.$menu.find('li').last()
2005 prev.addClass('active')
2008 , listen: function () {
2010 .on('focus', $.proxy(this.focus, this))
2011 .on('blur', $.proxy(this.blur, this))
2012 .on('keypress', $.proxy(this.keypress, this))
2013 .on('keyup', $.proxy(this.keyup, this))
2015 if (this.eventSupported('keydown')) {
2016 this.$element.on('keydown', $.proxy(this.keydown, this))
2020 .on('click', $.proxy(this.click, this))
2021 .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
2022 .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
2025 , eventSupported: function(eventName) {
2026 var isSupported = eventName in this.$element
2028 this.$element.setAttribute(eventName, 'return;')
2029 isSupported = typeof this.$element[eventName] === 'function'
2034 , move: function (e) {
2035 if (!this.shown) return
2044 case 38: // up arrow
2049 case 40: // down arrow
2058 , keydown: function (e) {
2059 this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
2063 , keypress: function (e) {
2064 if (this.suppressKeyPressRepeat) return
2068 , keyup: function (e) {
2070 case 40: // down arrow
2071 case 38: // up arrow
2079 if (!this.shown) return
2084 if (!this.shown) return
2096 , focus: function (e) {
2100 , blur: function (e) {
2101 this.focused = false
2102 if (!this.mousedover && this.shown) this.hide()
2105 , click: function (e) {
2109 this.$element.focus()
2112 , mouseenter: function (e) {
2113 this.mousedover = true
2114 this.$menu.find('.active').removeClass('active')
2115 $(e.currentTarget).addClass('active')
2118 , mouseleave: function (e) {
2119 this.mousedover = false
2120 if (!this.focused && this.shown) this.hide()
2126 /* TYPEAHEAD PLUGIN DEFINITION
2127 * =========================== */
2129 var old = $.fn.typeahead
2131 $.fn.typeahead = function (option) {
2132 return this.each(function () {
2134 , data = $this.data('typeahead')
2135 , options = typeof option == 'object' && option
2136 if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
2137 if (typeof option == 'string') data[option]()
2141 $.fn.typeahead.defaults = {
2144 , menu: '<ul class="typeahead dropdown-menu"></ul>'
2145 , item: '<li><a href="#"></a></li>'
2149 $.fn.typeahead.Constructor = Typeahead
2152 /* TYPEAHEAD NO CONFLICT
2153 * =================== */
2155 $.fn.typeahead.noConflict = function () {
2156 $.fn.typeahead = old
2161 /* TYPEAHEAD DATA-API
2162 * ================== */
2164 $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
2166 if ($this.data('typeahead')) return
2167 $this.typeahead($this.data())
2170 }(window.$jqTheme || window.jQuery);
2171 /* ==========================================================
2172 * bootstrap-affix.js v2.3.2
2173 * http://twitter.github.com/bootstrap/javascript.html#affix
2174 * ==========================================================
2175 * Copyright 2012 Twitter, Inc.
2177 * Licensed under the Apache License, Version 2.0 (the "License");
2178 * you may not use this file except in compliance with the License.
2179 * You may obtain a copy of the License at
2181 * http://www.apache.org/licenses/LICENSE-2.0
2183 * Unless required by applicable law or agreed to in writing, software
2184 * distributed under the License is distributed on an "AS IS" BASIS,
2185 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2186 * See the License for the specific language governing permissions and
2187 * limitations under the License.
2188 * ========================================================== */
2193 "use strict"; // jshint ;_;
2196 /* AFFIX CLASS DEFINITION
2197 * ====================== */
2199 var Affix = function (element, options) {
2200 this.options = $.extend({}, $.fn.affix.defaults, options)
2201 this.$window = $(window)
2202 .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
2203 .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
2204 this.$element = $(element)
2205 this.checkPosition()
2208 Affix.prototype.checkPosition = function () {
2209 if (!this.$element.is(':visible')) return
2211 var scrollHeight = $(document).height()
2212 , scrollTop = this.$window.scrollTop()
2213 , position = this.$element.offset()
2214 , offset = this.options.offset
2215 , offsetBottom = offset.bottom
2216 , offsetTop = offset.top
2217 , reset = 'affix affix-top affix-bottom'
2220 if (typeof offset != 'object') offsetBottom = offsetTop = offset
2221 if (typeof offsetTop == 'function') offsetTop = offset.top()
2222 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
2224 affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
2225 false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
2226 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
2229 if (this.affixed === affix) return
2231 this.affixed = affix
2232 this.unpin = affix == 'bottom' ? position.top - scrollTop : null
2234 this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
2238 /* AFFIX PLUGIN DEFINITION
2239 * ======================= */
2241 var old = $.fn.affix
2243 $.fn.affix = function (option) {
2244 return this.each(function () {
2246 , data = $this.data('affix')
2247 , options = typeof option == 'object' && option
2248 if (!data) $this.data('affix', (data = new Affix(this, options)))
2249 if (typeof option == 'string') data[option]()
2253 $.fn.affix.Constructor = Affix
2255 $.fn.affix.defaults = {
2260 /* AFFIX NO CONFLICT
2261 * ================= */
2263 $.fn.affix.noConflict = function () {
2272 $(window).on('load', function () {
2273 $('[data-spy="affix"]').each(function () {
2275 , data = $spy.data()
2277 data.offset = data.offset || {}
2279 data.offsetBottom && (data.offset.bottom = data.offsetBottom)
2280 data.offsetTop && (data.offset.top = data.offsetTop)
2287 }(window.$jqTheme || window.jQuery);