638bb18779550f8656f5f28e11f62bd37354940c
[pti/rtp.git] / docs / _build / html / _static / bootstrap-2.3.2 / js / bootstrap.js
1 /* ===================================================
2  * bootstrap-transition.js v2.3.2
3  * http://twitter.github.com/bootstrap/javascript.html#transitions
4  * ===================================================
5  * Copyright 2012 Twitter, Inc.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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  * ========================================================== */
19
20
21 !function ($) {
22
23   "use strict"; // jshint ;_;
24
25
26   /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
27    * ======================================================= */
28
29   $(function () {
30
31     $.support.transition = (function () {
32
33       var transitionEnd = (function () {
34
35         var el = document.createElement('bootstrap')
36           , transEndEventNames = {
37                'WebkitTransition' : 'webkitTransitionEnd'
38             ,  'MozTransition'    : 'transitionend'
39             ,  'OTransition'      : 'oTransitionEnd otransitionend'
40             ,  'transition'       : 'transitionend'
41             }
42           , name
43
44         for (name in transEndEventNames){
45           if (el.style[name] !== undefined) {
46             return transEndEventNames[name]
47           }
48         }
49
50       }())
51
52       return transitionEnd && {
53         end: transitionEnd
54       }
55
56     })()
57
58   })
59
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.
66  *
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
70  *
71  * http://www.apache.org/licenses/LICENSE-2.0
72  *
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  * ========================================================== */
79
80
81 !function ($) {
82
83   "use strict"; // jshint ;_;
84
85
86  /* ALERT CLASS DEFINITION
87   * ====================== */
88
89   var dismiss = '[data-dismiss="alert"]'
90     , Alert = function (el) {
91         $(el).on('click', dismiss, this.close)
92       }
93
94   Alert.prototype.close = function (e) {
95     var $this = $(this)
96       , selector = $this.attr('data-target')
97       , $parent
98
99     if (!selector) {
100       selector = $this.attr('href')
101       selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
102     }
103
104     $parent = $(selector)
105
106     e && e.preventDefault()
107
108     $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
109
110     $parent.trigger(e = $.Event('close'))
111
112     if (e.isDefaultPrevented()) return
113
114     $parent.removeClass('in')
115
116     function removeElement() {
117       $parent
118         .trigger('closed')
119         .remove()
120     }
121
122     $.support.transition && $parent.hasClass('fade') ?
123       $parent.on($.support.transition.end, removeElement) :
124       removeElement()
125   }
126
127
128  /* ALERT PLUGIN DEFINITION
129   * ======================= */
130
131   var old = $.fn.alert
132
133   $.fn.alert = function (option) {
134     return this.each(function () {
135       var $this = $(this)
136         , data = $this.data('alert')
137       if (!data) $this.data('alert', (data = new Alert(this)))
138       if (typeof option == 'string') data[option].call($this)
139     })
140   }
141
142   $.fn.alert.Constructor = Alert
143
144
145  /* ALERT NO CONFLICT
146   * ================= */
147
148   $.fn.alert.noConflict = function () {
149     $.fn.alert = old
150     return this
151   }
152
153
154  /* ALERT DATA-API
155   * ============== */
156
157   $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
158
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.
165  *
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
169  *
170  * http://www.apache.org/licenses/LICENSE-2.0
171  *
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  * ============================================================ */
178
179
180 !function ($) {
181
182   "use strict"; // jshint ;_;
183
184
185  /* BUTTON PUBLIC CLASS DEFINITION
186   * ============================== */
187
188   var Button = function (element, options) {
189     this.$element = $(element)
190     this.options = $.extend({}, $.fn.button.defaults, options)
191   }
192
193   Button.prototype.setState = function (state) {
194     var d = 'disabled'
195       , $el = this.$element
196       , data = $el.data()
197       , val = $el.is('input') ? 'val' : 'html'
198
199     state = state + 'Text'
200     data.resetText || $el.data('resetText', $el[val]())
201
202     $el[val](data[state] || this.options[state])
203
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)
209     }, 0)
210   }
211
212   Button.prototype.toggle = function () {
213     var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
214
215     $parent && $parent
216       .find('.active')
217       .removeClass('active')
218
219     this.$element.toggleClass('active')
220   }
221
222
223  /* BUTTON PLUGIN DEFINITION
224   * ======================== */
225
226   var old = $.fn.button
227
228   $.fn.button = function (option) {
229     return this.each(function () {
230       var $this = $(this)
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)
236     })
237   }
238
239   $.fn.button.defaults = {
240     loadingText: 'loading...'
241   }
242
243   $.fn.button.Constructor = Button
244
245
246  /* BUTTON NO CONFLICT
247   * ================== */
248
249   $.fn.button.noConflict = function () {
250     $.fn.button = old
251     return this
252   }
253
254
255  /* BUTTON DATA-API
256   * =============== */
257
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')
262   })
263
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.
270  *
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
274  *
275  * http://www.apache.org/licenses/LICENSE-2.0
276  *
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  * ========================================================== */
283
284
285 !function ($) {
286
287   "use strict"; // jshint ;_;
288
289
290  /* CAROUSEL CLASS DEFINITION
291   * ========================= */
292
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))
300   }
301
302   Carousel.prototype = {
303
304     cycle: function (e) {
305       if (!e) this.paused = false
306       if (this.interval) clearInterval(this.interval);
307       this.options.interval
308         && !this.paused
309         && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
310       return this
311     }
312
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)
317     }
318
319   , to: function (pos) {
320       var activeIndex = this.getActiveIndex()
321         , that = this
322
323       if (pos > (this.$items.length - 1) || pos < 0) return
324
325       if (this.sliding) {
326         return this.$element.one('slid', function () {
327           that.to(pos)
328         })
329       }
330
331       if (activeIndex == pos) {
332         return this.pause().cycle()
333       }
334
335       return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
336     }
337
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)
342         this.cycle(true)
343       }
344       clearInterval(this.interval)
345       this.interval = null
346       return this
347     }
348
349   , next: function () {
350       if (this.sliding) return
351       return this.slide('next')
352     }
353
354   , prev: function () {
355       if (this.sliding) return
356       return this.slide('prev')
357     }
358
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'
365         , that = this
366         , e
367
368       this.sliding = true
369
370       isCycling && this.pause()
371
372       $next = $next.length ? $next : this.$element.find('.item')[fallback]()
373
374       e = $.Event('slide', {
375         relatedTarget: $next[0]
376       , direction: direction
377       })
378
379       if ($next.hasClass('active')) return
380
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')
386         })
387       }
388
389       if ($.support.transition && this.$element.hasClass('slide')) {
390         this.$element.trigger(e)
391         if (e.isDefaultPrevented()) return
392         $next.addClass(type)
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(' '))
399           that.sliding = false
400           setTimeout(function () { that.$element.trigger('slid') }, 0)
401         })
402       } else {
403         this.$element.trigger(e)
404         if (e.isDefaultPrevented()) return
405         $active.removeClass('active')
406         $next.addClass('active')
407         this.sliding = false
408         this.$element.trigger('slid')
409       }
410
411       isCycling && this.cycle()
412
413       return this
414     }
415
416   }
417
418
419  /* CAROUSEL PLUGIN DEFINITION
420   * ========================== */
421
422   var old = $.fn.carousel
423
424   $.fn.carousel = function (option) {
425     return this.each(function () {
426       var $this = $(this)
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()
434     })
435   }
436
437   $.fn.carousel.defaults = {
438     interval: 5000
439   , pause: 'hover'
440   }
441
442   $.fn.carousel.Constructor = Carousel
443
444
445  /* CAROUSEL NO CONFLICT
446   * ==================== */
447
448   $.fn.carousel.noConflict = function () {
449     $.fn.carousel = old
450     return this
451   }
452
453  /* CAROUSEL DATA-API
454   * ================= */
455
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())
460       , slideIndex
461
462     $target.carousel(options)
463
464     if (slideIndex = $this.attr('data-slide-to')) {
465       $target.data('carousel').pause().to(slideIndex).cycle()
466     }
467
468     e.preventDefault()
469   })
470
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.
477  *
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
481  *
482  * http://www.apache.org/licenses/LICENSE-2.0
483  *
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  * ============================================================ */
490
491
492 !function ($) {
493
494   "use strict"; // jshint ;_;
495
496
497  /* COLLAPSE PUBLIC CLASS DEFINITION
498   * ================================ */
499
500   var Collapse = function (element, options) {
501     this.$element = $(element)
502     this.options = $.extend({}, $.fn.collapse.defaults, options)
503
504     if (this.options.parent) {
505       this.$parent = $(this.options.parent)
506     }
507
508     this.options.toggle && this.toggle()
509   }
510
511   Collapse.prototype = {
512
513     constructor: Collapse
514
515   , dimension: function () {
516       var hasWidth = this.$element.hasClass('width')
517       return hasWidth ? 'width' : 'height'
518     }
519
520   , show: function () {
521       var dimension
522         , scroll
523         , actives
524         , hasData
525
526       if (this.transitioning || this.$element.hasClass('in')) return
527
528       dimension = this.dimension()
529       scroll = $.camelCase(['scroll', dimension].join('-'))
530       actives = this.$parent && this.$parent.find('> .accordion-group > .in')
531
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)
537       }
538
539       this.$element[dimension](0)
540       this.transition('addClass', $.Event('show'), 'shown')
541       $.support.transition && this.$element[dimension](this.$element[0][scroll])
542     }
543
544   , hide: function () {
545       var dimension
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)
551     }
552
553   , reset: function (size) {
554       var dimension = this.dimension()
555
556       this.$element
557         .removeClass('collapse')
558         [dimension](size || 'auto')
559         [0].offsetWidth
560
561       this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
562
563       return this
564     }
565
566   , transition: function (method, startEvent, completeEvent) {
567       var that = this
568         , complete = function () {
569             if (startEvent.type == 'show') that.reset()
570             that.transitioning = 0
571             that.$element.trigger(completeEvent)
572           }
573
574       this.$element.trigger(startEvent)
575
576       if (startEvent.isDefaultPrevented()) return
577
578       this.transitioning = 1
579
580       this.$element[method]('in')
581
582       $.support.transition && this.$element.hasClass('collapse') ?
583         this.$element.one($.support.transition.end, complete) :
584         complete()
585     }
586
587   , toggle: function () {
588       this[this.$element.hasClass('in') ? 'hide' : 'show']()
589     }
590
591   }
592
593
594  /* COLLAPSE PLUGIN DEFINITION
595   * ========================== */
596
597   var old = $.fn.collapse
598
599   $.fn.collapse = function (option) {
600     return this.each(function () {
601       var $this = $(this)
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]()
606     })
607   }
608
609   $.fn.collapse.defaults = {
610     toggle: true
611   }
612
613   $.fn.collapse.Constructor = Collapse
614
615
616  /* COLLAPSE NO CONFLICT
617   * ==================== */
618
619   $.fn.collapse.noConflict = function () {
620     $.fn.collapse = old
621     return this
622   }
623
624
625  /* COLLAPSE DATA-API
626   * ================= */
627
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)
636   })
637
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.
644  *
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
648  *
649  * http://www.apache.org/licenses/LICENSE-2.0
650  *
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  * ============================================================ */
657
658
659 !function ($) {
660
661   "use strict"; // jshint ;_;
662
663
664  /* DROPDOWN CLASS DEFINITION
665   * ========================= */
666
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')
672         })
673       }
674
675   Dropdown.prototype = {
676
677     constructor: Dropdown
678
679   , toggle: function (e) {
680       var $this = $(this)
681         , $parent
682         , isActive
683
684       if ($this.is('.disabled, :disabled')) return
685
686       $parent = getParent($this)
687
688       isActive = $parent.hasClass('open')
689
690       clearMenus()
691
692       if (!isActive) {
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)
696         }
697         $parent.toggleClass('open')
698       }
699
700       $this.focus()
701
702       return false
703     }
704
705   , keydown: function (e) {
706       var $this
707         , $items
708         , $active
709         , $parent
710         , isActive
711         , index
712
713       if (!/(38|40|27)/.test(e.keyCode)) return
714
715       $this = $(this)
716
717       e.preventDefault()
718       e.stopPropagation()
719
720       if ($this.is('.disabled, :disabled')) return
721
722       $parent = getParent($this)
723
724       isActive = $parent.hasClass('open')
725
726       if (!isActive || (isActive && e.keyCode == 27)) {
727         if (e.which == 27) $parent.find(toggle).focus()
728         return $this.click()
729       }
730
731       $items = $('[role=menu] li:not(.divider):visible a', $parent)
732
733       if (!$items.length) return
734
735       index = $items.index($items.filter(':focus'))
736
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
740
741       $items
742         .eq(index)
743         .focus()
744     }
745
746   }
747
748   function clearMenus() {
749     $('.dropdown-backdrop').remove()
750     $(toggle).each(function () {
751       getParent($(this)).removeClass('open')
752     })
753   }
754
755   function getParent($this) {
756     var selector = $this.attr('data-target')
757       , $parent
758
759     if (!selector) {
760       selector = $this.attr('href')
761       selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
762     }
763
764     $parent = selector && $(selector)
765
766     if (!$parent || !$parent.length) $parent = $this.parent()
767
768     return $parent
769   }
770
771
772   /* DROPDOWN PLUGIN DEFINITION
773    * ========================== */
774
775   var old = $.fn.dropdown
776
777   $.fn.dropdown = function (option) {
778     return this.each(function () {
779       var $this = $(this)
780         , data = $this.data('dropdown')
781       if (!data) $this.data('dropdown', (data = new Dropdown(this)))
782       if (typeof option == 'string') data[option].call($this)
783     })
784   }
785
786   $.fn.dropdown.Constructor = Dropdown
787
788
789  /* DROPDOWN NO CONFLICT
790   * ==================== */
791
792   $.fn.dropdown.noConflict = function () {
793     $.fn.dropdown = old
794     return this
795   }
796
797
798   /* APPLY TO STANDARD DROPDOWN ELEMENTS
799    * =================================== */
800
801   $(document)
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)
806
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.
813  *
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
817  *
818  * http://www.apache.org/licenses/LICENSE-2.0
819  *
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  * ========================================================= */
826
827
828 !function ($) {
829
830   "use strict"; // jshint ;_;
831
832
833  /* MODAL CLASS DEFINITION
834   * ====================== */
835
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)
841   }
842
843   Modal.prototype = {
844
845       constructor: Modal
846
847     , toggle: function () {
848         return this[!this.isShown ? 'show' : 'hide']()
849       }
850
851     , show: function () {
852         var that = this
853           , e = $.Event('show')
854
855         this.$element.trigger(e)
856
857         if (this.isShown || e.isDefaultPrevented()) return
858
859         this.isShown = true
860
861         this.escape()
862
863         this.backdrop(function () {
864           var transition = $.support.transition && that.$element.hasClass('fade')
865
866           if (!that.$element.parent().length) {
867             that.$element.appendTo(document.body) //don't move modals dom position
868           }
869
870           that.$element.show()
871
872           if (transition) {
873             that.$element[0].offsetWidth // force reflow
874           }
875
876           that.$element
877             .addClass('in')
878             .attr('aria-hidden', false)
879
880           that.enforceFocus()
881
882           transition ?
883             that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
884             that.$element.focus().trigger('shown')
885
886         })
887       }
888
889     , hide: function (e) {
890         e && e.preventDefault()
891
892         var that = this
893
894         e = $.Event('hide')
895
896         this.$element.trigger(e)
897
898         if (!this.isShown || e.isDefaultPrevented()) return
899
900         this.isShown = false
901
902         this.escape()
903
904         $(document).off('focusin.modal')
905
906         this.$element
907           .removeClass('in')
908           .attr('aria-hidden', true)
909
910         $.support.transition && this.$element.hasClass('fade') ?
911           this.hideWithTransition() :
912           this.hideModal()
913       }
914
915     , enforceFocus: function () {
916         var that = this
917         $(document).on('focusin.modal', function (e) {
918           if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
919             that.$element.focus()
920           }
921         })
922       }
923
924     , escape: function () {
925         var that = this
926         if (this.isShown && this.options.keyboard) {
927           this.$element.on('keyup.dismiss.modal', function ( e ) {
928             e.which == 27 && that.hide()
929           })
930         } else if (!this.isShown) {
931           this.$element.off('keyup.dismiss.modal')
932         }
933       }
934
935     , hideWithTransition: function () {
936         var that = this
937           , timeout = setTimeout(function () {
938               that.$element.off($.support.transition.end)
939               that.hideModal()
940             }, 500)
941
942         this.$element.one($.support.transition.end, function () {
943           clearTimeout(timeout)
944           that.hideModal()
945         })
946       }
947
948     , hideModal: function () {
949         var that = this
950         this.$element.hide()
951         this.backdrop(function () {
952           that.removeBackdrop()
953           that.$element.trigger('hidden')
954         })
955       }
956
957     , removeBackdrop: function () {
958         this.$backdrop && this.$backdrop.remove()
959         this.$backdrop = null
960       }
961
962     , backdrop: function (callback) {
963         var that = this
964           , animate = this.$element.hasClass('fade') ? 'fade' : ''
965
966         if (this.isShown && this.options.backdrop) {
967           var doAnimate = $.support.transition && animate
968
969           this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
970             .appendTo(document.body)
971
972           this.$backdrop.click(
973             this.options.backdrop == 'static' ?
974               $.proxy(this.$element[0].focus, this.$element[0])
975             : $.proxy(this.hide, this)
976           )
977
978           if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
979
980           this.$backdrop.addClass('in')
981
982           if (!callback) return
983
984           doAnimate ?
985             this.$backdrop.one($.support.transition.end, callback) :
986             callback()
987
988         } else if (!this.isShown && this.$backdrop) {
989           this.$backdrop.removeClass('in')
990
991           $.support.transition && this.$element.hasClass('fade')?
992             this.$backdrop.one($.support.transition.end, callback) :
993             callback()
994
995         } else if (callback) {
996           callback()
997         }
998       }
999   }
1000
1001
1002  /* MODAL PLUGIN DEFINITION
1003   * ======================= */
1004
1005   var old = $.fn.modal
1006
1007   $.fn.modal = function (option) {
1008     return this.each(function () {
1009       var $this = $(this)
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()
1015     })
1016   }
1017
1018   $.fn.modal.defaults = {
1019       backdrop: true
1020     , keyboard: true
1021     , show: true
1022   }
1023
1024   $.fn.modal.Constructor = Modal
1025
1026
1027  /* MODAL NO CONFLICT
1028   * ================= */
1029
1030   $.fn.modal.noConflict = function () {
1031     $.fn.modal = old
1032     return this
1033   }
1034
1035
1036  /* MODAL DATA-API
1037   * ============== */
1038
1039   $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
1040     var $this = $(this)
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())
1044
1045     e.preventDefault()
1046
1047     $target
1048       .modal(option)
1049       .one('hide', function () {
1050         $this.focus()
1051       })
1052   })
1053
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.
1061  *
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
1065  *
1066  * http://www.apache.org/licenses/LICENSE-2.0
1067  *
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  * ========================================================== */
1074
1075
1076 !function ($) {
1077
1078   "use strict"; // jshint ;_;
1079
1080
1081  /* TOOLTIP PUBLIC CLASS DEFINITION
1082   * =============================== */
1083
1084   var Tooltip = function (element, options) {
1085     this.init('tooltip', element, options)
1086   }
1087
1088   Tooltip.prototype = {
1089
1090     constructor: Tooltip
1091
1092   , init: function (type, element, options) {
1093       var eventIn
1094         , eventOut
1095         , triggers
1096         , trigger
1097         , i
1098
1099       this.type = type
1100       this.$element = $(element)
1101       this.options = this.getOptions(options)
1102       this.enabled = true
1103
1104       triggers = this.options.trigger.split(' ')
1105
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))
1115         }
1116       }
1117
1118       this.options.selector ?
1119         (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1120         this.fixTitle()
1121     }
1122
1123   , getOptions: function (options) {
1124       options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
1125
1126       if (options.delay && typeof options.delay == 'number') {
1127         options.delay = {
1128           show: options.delay
1129         , hide: options.delay
1130         }
1131       }
1132
1133       return options
1134     }
1135
1136   , enter: function (e) {
1137       var defaults = $.fn[this.type].defaults
1138         , options = {}
1139         , self
1140
1141       this._options && $.each(this._options, function (key, value) {
1142         if (defaults[key] != value) options[key] = value
1143       }, this)
1144
1145       self = $(e.currentTarget)[this.type](options).data(this.type)
1146
1147       if (!self.options.delay || !self.options.delay.show) return self.show()
1148
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)
1154     }
1155
1156   , leave: function (e) {
1157       var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1158
1159       if (this.timeout) clearTimeout(this.timeout)
1160       if (!self.options.delay || !self.options.delay.hide) return self.hide()
1161
1162       self.hoverState = 'out'
1163       this.timeout = setTimeout(function() {
1164         if (self.hoverState == 'out') self.hide()
1165       }, self.options.delay.hide)
1166     }
1167
1168   , show: function () {
1169       var $tip
1170         , pos
1171         , actualWidth
1172         , actualHeight
1173         , placement
1174         , tp
1175         , e = $.Event('show')
1176
1177       if (this.hasContent() && this.enabled) {
1178         this.$element.trigger(e)
1179         if (e.isDefaultPrevented()) return
1180         $tip = this.tip()
1181         this.setContent()
1182
1183         if (this.options.animation) {
1184           $tip.addClass('fade')
1185         }
1186
1187         placement = typeof this.options.placement == 'function' ?
1188           this.options.placement.call(this, $tip[0], this.$element[0]) :
1189           this.options.placement
1190
1191         $tip
1192           .detach()
1193           .css({ top: 0, left: 0, display: 'block' })
1194
1195         this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1196
1197         pos = this.getPosition()
1198
1199         actualWidth = $tip[0].offsetWidth
1200         actualHeight = $tip[0].offsetHeight
1201
1202         switch (placement) {
1203           case 'bottom':
1204             tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1205             break
1206           case 'top':
1207             tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1208             break
1209           case 'left':
1210             tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1211             break
1212           case 'right':
1213             tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1214             break
1215         }
1216
1217         this.applyPlacement(tp, placement)
1218         this.$element.trigger('shown')
1219       }
1220     }
1221
1222   , applyPlacement: function(offset, placement){
1223       var $tip = this.tip()
1224         , width = $tip[0].offsetWidth
1225         , height = $tip[0].offsetHeight
1226         , actualWidth
1227         , actualHeight
1228         , delta
1229         , replace
1230
1231       $tip
1232         .offset(offset)
1233         .addClass(placement)
1234         .addClass('in')
1235
1236       actualWidth = $tip[0].offsetWidth
1237       actualHeight = $tip[0].offsetHeight
1238
1239       if (placement == 'top' && actualHeight != height) {
1240         offset.top = offset.top + height - actualHeight
1241         replace = true
1242       }
1243
1244       if (placement == 'bottom' || placement == 'top') {
1245         delta = 0
1246
1247         if (offset.left < 0){
1248           delta = offset.left * -2
1249           offset.left = 0
1250           $tip.offset(offset)
1251           actualWidth = $tip[0].offsetWidth
1252           actualHeight = $tip[0].offsetHeight
1253         }
1254
1255         this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
1256       } else {
1257         this.replaceArrow(actualHeight - height, actualHeight, 'top')
1258       }
1259
1260       if (replace) $tip.offset(offset)
1261     }
1262
1263   , replaceArrow: function(delta, dimension, position){
1264       this
1265         .arrow()
1266         .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
1267     }
1268
1269   , setContent: function () {
1270       var $tip = this.tip()
1271         , title = this.getTitle()
1272
1273       $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1274       $tip.removeClass('fade in top bottom left right')
1275     }
1276
1277   , hide: function () {
1278       var that = this
1279         , $tip = this.tip()
1280         , e = $.Event('hide')
1281
1282       this.$element.trigger(e)
1283       if (e.isDefaultPrevented()) return
1284
1285       $tip.removeClass('in')
1286
1287       function removeWithAnimation() {
1288         var timeout = setTimeout(function () {
1289           $tip.off($.support.transition.end).detach()
1290         }, 500)
1291
1292         $tip.one($.support.transition.end, function () {
1293           clearTimeout(timeout)
1294           $tip.detach()
1295         })
1296       }
1297
1298       $.support.transition && this.$tip.hasClass('fade') ?
1299         removeWithAnimation() :
1300         $tip.detach()
1301
1302       this.$element.trigger('hidden')
1303
1304       return this
1305     }
1306
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', '')
1311       }
1312     }
1313
1314   , hasContent: function () {
1315       return this.getTitle()
1316     }
1317
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())
1324     }
1325
1326   , getTitle: function () {
1327       var title
1328         , $e = this.$element
1329         , o = this.options
1330
1331       title = $e.attr('data-original-title')
1332         || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
1333
1334       return title
1335     }
1336
1337   , tip: function () {
1338       return this.$tip = this.$tip || $(this.options.template)
1339     }
1340
1341   , arrow: function(){
1342       return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
1343     }
1344
1345   , validate: function () {
1346       if (!this.$element[0].parentNode) {
1347         this.hide()
1348         this.$element = null
1349         this.options = null
1350       }
1351     }
1352
1353   , enable: function () {
1354       this.enabled = true
1355     }
1356
1357   , disable: function () {
1358       this.enabled = false
1359     }
1360
1361   , toggleEnabled: function () {
1362       this.enabled = !this.enabled
1363     }
1364
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()
1368     }
1369
1370   , destroy: function () {
1371       this.hide().$element.off('.' + this.type).removeData(this.type)
1372     }
1373
1374   }
1375
1376
1377  /* TOOLTIP PLUGIN DEFINITION
1378   * ========================= */
1379
1380   var old = $.fn.tooltip
1381
1382   $.fn.tooltip = function ( option ) {
1383     return this.each(function () {
1384       var $this = $(this)
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]()
1389     })
1390   }
1391
1392   $.fn.tooltip.Constructor = Tooltip
1393
1394   $.fn.tooltip.defaults = {
1395     animation: true
1396   , placement: 'top'
1397   , selector: false
1398   , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1399   , trigger: 'hover focus'
1400   , title: ''
1401   , delay: 0
1402   , html: false
1403   , container: false
1404   }
1405
1406
1407  /* TOOLTIP NO CONFLICT
1408   * =================== */
1409
1410   $.fn.tooltip.noConflict = function () {
1411     $.fn.tooltip = old
1412     return this
1413   }
1414
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.
1421  *
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
1425  *
1426  * http://www.apache.org/licenses/LICENSE-2.0
1427  *
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  * =========================================================== */
1434
1435
1436 !function ($) {
1437
1438   "use strict"; // jshint ;_;
1439
1440
1441  /* POPOVER PUBLIC CLASS DEFINITION
1442   * =============================== */
1443
1444   var Popover = function (element, options) {
1445     this.init('popover', element, options)
1446   }
1447
1448
1449   /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1450      ========================================== */
1451
1452   Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1453
1454     constructor: Popover
1455
1456   , setContent: function () {
1457       var $tip = this.tip()
1458         , title = this.getTitle()
1459         , content = this.getContent()
1460
1461       $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1462       $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
1463
1464       $tip.removeClass('fade top bottom left right in')
1465     }
1466
1467   , hasContent: function () {
1468       return this.getTitle() || this.getContent()
1469     }
1470
1471   , getContent: function () {
1472       var content
1473         , $e = this.$element
1474         , o = this.options
1475
1476       content = (typeof o.content == 'function' ? o.content.call($e[0]) :  o.content)
1477         || $e.attr('data-content')
1478
1479       return content
1480     }
1481
1482   , tip: function () {
1483       if (!this.$tip) {
1484         this.$tip = $(this.options.template)
1485       }
1486       return this.$tip
1487     }
1488
1489   , destroy: function () {
1490       this.hide().$element.off('.' + this.type).removeData(this.type)
1491     }
1492
1493   })
1494
1495
1496  /* POPOVER PLUGIN DEFINITION
1497   * ======================= */
1498
1499   var old = $.fn.popover
1500
1501   $.fn.popover = function (option) {
1502     return this.each(function () {
1503       var $this = $(this)
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]()
1508     })
1509   }
1510
1511   $.fn.popover.Constructor = Popover
1512
1513   $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1514     placement: 'right'
1515   , trigger: 'click'
1516   , content: ''
1517   , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1518   })
1519
1520
1521  /* POPOVER NO CONFLICT
1522   * =================== */
1523
1524   $.fn.popover.noConflict = function () {
1525     $.fn.popover = old
1526     return this
1527   }
1528
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.
1535  *
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
1539  *
1540  * http://www.apache.org/licenses/LICENSE-2.0
1541  *
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  * ============================================================== */
1548
1549
1550 !function ($) {
1551
1552   "use strict"; // jshint ;_;
1553
1554
1555  /* SCROLLSPY CLASS DEFINITION
1556   * ========================== */
1557
1558   function ScrollSpy(element, options) {
1559     var process = $.proxy(this.process, this)
1560       , $element = $(element).is('body') ? $(window) : $(element)
1561       , href
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')
1568     this.refresh()
1569     this.process()
1570   }
1571
1572   ScrollSpy.prototype = {
1573
1574       constructor: ScrollSpy
1575
1576     , refresh: function () {
1577         var self = this
1578           , $targets
1579
1580         this.offsets = $([])
1581         this.targets = $([])
1582
1583         $targets = this.$body
1584           .find(this.selector)
1585           .map(function () {
1586             var $el = $(this)
1587               , href = $el.data('target') || $el.attr('href')
1588               , $href = /^#\w/.test(href) && $(href)
1589             return ( $href
1590               && $href.length
1591               && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
1592           })
1593           .sort(function (a, b) { return a[0] - b[0] })
1594           .each(function () {
1595             self.offsets.push(this[0])
1596             self.targets.push(this[1])
1597           })
1598       }
1599
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
1607           , i
1608
1609         if (scrollTop >= maxScroll) {
1610           return activeTarget != (i = targets.last()[0])
1611             && this.activate ( i )
1612         }
1613
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] )
1619         }
1620       }
1621
1622     , activate: function (target) {
1623         var active
1624           , selector
1625
1626         this.activeTarget = target
1627
1628         $(this.selector)
1629           .parent('.active')
1630           .removeClass('active')
1631
1632         selector = this.selector
1633           + '[data-target="' + target + '"],'
1634           + this.selector + '[href="' + target + '"]'
1635
1636         active = $(selector)
1637           .parent('li')
1638           .addClass('active')
1639
1640         if (active.parent('.dropdown-menu').length)  {
1641           active = active.closest('li.dropdown').addClass('active')
1642         }
1643
1644         active.trigger('activate')
1645       }
1646
1647   }
1648
1649
1650  /* SCROLLSPY PLUGIN DEFINITION
1651   * =========================== */
1652
1653   var old = $.fn.scrollspy
1654
1655   $.fn.scrollspy = function (option) {
1656     return this.each(function () {
1657       var $this = $(this)
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]()
1662     })
1663   }
1664
1665   $.fn.scrollspy.Constructor = ScrollSpy
1666
1667   $.fn.scrollspy.defaults = {
1668     offset: 10
1669   }
1670
1671
1672  /* SCROLLSPY NO CONFLICT
1673   * ===================== */
1674
1675   $.fn.scrollspy.noConflict = function () {
1676     $.fn.scrollspy = old
1677     return this
1678   }
1679
1680
1681  /* SCROLLSPY DATA-API
1682   * ================== */
1683
1684   $(window).on('load', function () {
1685     $('[data-spy="scroll"]').each(function () {
1686       var $spy = $(this)
1687       $spy.scrollspy($spy.data())
1688     })
1689   })
1690
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.
1697  *
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
1701  *
1702  * http://www.apache.org/licenses/LICENSE-2.0
1703  *
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  * ======================================================== */
1710
1711
1712 !function ($) {
1713
1714   "use strict"; // jshint ;_;
1715
1716
1717  /* TAB CLASS DEFINITION
1718   * ==================== */
1719
1720   var Tab = function (element) {
1721     this.element = $(element)
1722   }
1723
1724   Tab.prototype = {
1725
1726     constructor: Tab
1727
1728   , show: function () {
1729       var $this = this.element
1730         , $ul = $this.closest('ul:not(.dropdown-menu)')
1731         , selector = $this.attr('data-target')
1732         , previous
1733         , $target
1734         , e
1735
1736       if (!selector) {
1737         selector = $this.attr('href')
1738         selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1739       }
1740
1741       if ( $this.parent('li').hasClass('active') ) return
1742
1743       previous = $ul.find('.active:last a')[0]
1744
1745       e = $.Event('show', {
1746         relatedTarget: previous
1747       })
1748
1749       $this.trigger(e)
1750
1751       if (e.isDefaultPrevented()) return
1752
1753       $target = $(selector)
1754
1755       this.activate($this.parent('li'), $ul)
1756       this.activate($target, $target.parent(), function () {
1757         $this.trigger({
1758           type: 'shown'
1759         , relatedTarget: previous
1760         })
1761       })
1762     }
1763
1764   , activate: function ( element, container, callback) {
1765       var $active = container.find('> .active')
1766         , transition = callback
1767             && $.support.transition
1768             && $active.hasClass('fade')
1769
1770       function next() {
1771         $active
1772           .removeClass('active')
1773           .find('> .dropdown-menu > .active')
1774           .removeClass('active')
1775
1776         element.addClass('active')
1777
1778         if (transition) {
1779           element[0].offsetWidth // reflow for transition
1780           element.addClass('in')
1781         } else {
1782           element.removeClass('fade')
1783         }
1784
1785         if ( element.parent('.dropdown-menu') ) {
1786           element.closest('li.dropdown').addClass('active')
1787         }
1788
1789         callback && callback()
1790       }
1791
1792       transition ?
1793         $active.one($.support.transition.end, next) :
1794         next()
1795
1796       $active.removeClass('in')
1797     }
1798   }
1799
1800
1801  /* TAB PLUGIN DEFINITION
1802   * ===================== */
1803
1804   var old = $.fn.tab
1805
1806   $.fn.tab = function ( option ) {
1807     return this.each(function () {
1808       var $this = $(this)
1809         , data = $this.data('tab')
1810       if (!data) $this.data('tab', (data = new Tab(this)))
1811       if (typeof option == 'string') data[option]()
1812     })
1813   }
1814
1815   $.fn.tab.Constructor = Tab
1816
1817
1818  /* TAB NO CONFLICT
1819   * =============== */
1820
1821   $.fn.tab.noConflict = function () {
1822     $.fn.tab = old
1823     return this
1824   }
1825
1826
1827  /* TAB DATA-API
1828   * ============ */
1829
1830   $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1831     e.preventDefault()
1832     $(this).tab('show')
1833   })
1834
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.
1841  *
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
1845  *
1846  * http://www.apache.org/licenses/LICENSE-2.0
1847  *
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  * ============================================================ */
1854
1855
1856 !function($){
1857
1858   "use strict"; // jshint ;_;
1859
1860
1861  /* TYPEAHEAD PUBLIC CLASS DEFINITION
1862   * ================================= */
1863
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)
1873     this.shown = false
1874     this.listen()
1875   }
1876
1877   Typeahead.prototype = {
1878
1879     constructor: Typeahead
1880
1881   , select: function () {
1882       var val = this.$menu.find('.active').attr('data-value')
1883       this.$element
1884         .val(this.updater(val))
1885         .change()
1886       return this.hide()
1887     }
1888
1889   , updater: function (item) {
1890       return item
1891     }
1892
1893   , show: function () {
1894       var pos = $.extend({}, this.$element.position(), {
1895         height: this.$element[0].offsetHeight
1896       })
1897
1898       this.$menu
1899         .insertAfter(this.$element)
1900         .css({
1901           top: pos.top + pos.height
1902         , left: pos.left
1903         })
1904         .show()
1905
1906       this.shown = true
1907       return this
1908     }
1909
1910   , hide: function () {
1911       this.$menu.hide()
1912       this.shown = false
1913       return this
1914     }
1915
1916   , lookup: function (event) {
1917       var items
1918
1919       this.query = this.$element.val()
1920
1921       if (!this.query || this.query.length < this.options.minLength) {
1922         return this.shown ? this.hide() : this
1923       }
1924
1925       items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
1926
1927       return items ? this.process(items) : this
1928     }
1929
1930   , process: function (items) {
1931       var that = this
1932
1933       items = $.grep(items, function (item) {
1934         return that.matcher(item)
1935       })
1936
1937       items = this.sorter(items)
1938
1939       if (!items.length) {
1940         return this.shown ? this.hide() : this
1941       }
1942
1943       return this.render(items.slice(0, this.options.items)).show()
1944     }
1945
1946   , matcher: function (item) {
1947       return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1948     }
1949
1950   , sorter: function (items) {
1951       var beginswith = []
1952         , caseSensitive = []
1953         , caseInsensitive = []
1954         , item
1955
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)
1960       }
1961
1962       return beginswith.concat(caseSensitive, caseInsensitive)
1963     }
1964
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>'
1969       })
1970     }
1971
1972   , render: function (items) {
1973       var that = this
1974
1975       items = $(items).map(function (i, item) {
1976         i = $(that.options.item).attr('data-value', item)
1977         i.find('a').html(that.highlighter(item))
1978         return i[0]
1979       })
1980
1981       items.first().addClass('active')
1982       this.$menu.html(items)
1983       return this
1984     }
1985
1986   , next: function (event) {
1987       var active = this.$menu.find('.active').removeClass('active')
1988         , next = active.next()
1989
1990       if (!next.length) {
1991         next = $(this.$menu.find('li')[0])
1992       }
1993
1994       next.addClass('active')
1995     }
1996
1997   , prev: function (event) {
1998       var active = this.$menu.find('.active').removeClass('active')
1999         , prev = active.prev()
2000
2001       if (!prev.length) {
2002         prev = this.$menu.find('li').last()
2003       }
2004
2005       prev.addClass('active')
2006     }
2007
2008   , listen: function () {
2009       this.$element
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))
2014
2015       if (this.eventSupported('keydown')) {
2016         this.$element.on('keydown', $.proxy(this.keydown, this))
2017       }
2018
2019       this.$menu
2020         .on('click', $.proxy(this.click, this))
2021         .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
2022         .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
2023     }
2024
2025   , eventSupported: function(eventName) {
2026       var isSupported = eventName in this.$element
2027       if (!isSupported) {
2028         this.$element.setAttribute(eventName, 'return;')
2029         isSupported = typeof this.$element[eventName] === 'function'
2030       }
2031       return isSupported
2032     }
2033
2034   , move: function (e) {
2035       if (!this.shown) return
2036
2037       switch(e.keyCode) {
2038         case 9: // tab
2039         case 13: // enter
2040         case 27: // escape
2041           e.preventDefault()
2042           break
2043
2044         case 38: // up arrow
2045           e.preventDefault()
2046           this.prev()
2047           break
2048
2049         case 40: // down arrow
2050           e.preventDefault()
2051           this.next()
2052           break
2053       }
2054
2055       e.stopPropagation()
2056     }
2057
2058   , keydown: function (e) {
2059       this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
2060       this.move(e)
2061     }
2062
2063   , keypress: function (e) {
2064       if (this.suppressKeyPressRepeat) return
2065       this.move(e)
2066     }
2067
2068   , keyup: function (e) {
2069       switch(e.keyCode) {
2070         case 40: // down arrow
2071         case 38: // up arrow
2072         case 16: // shift
2073         case 17: // ctrl
2074         case 18: // alt
2075           break
2076
2077         case 9: // tab
2078         case 13: // enter
2079           if (!this.shown) return
2080           this.select()
2081           break
2082
2083         case 27: // escape
2084           if (!this.shown) return
2085           this.hide()
2086           break
2087
2088         default:
2089           this.lookup()
2090       }
2091
2092       e.stopPropagation()
2093       e.preventDefault()
2094   }
2095
2096   , focus: function (e) {
2097       this.focused = true
2098     }
2099
2100   , blur: function (e) {
2101       this.focused = false
2102       if (!this.mousedover && this.shown) this.hide()
2103     }
2104
2105   , click: function (e) {
2106       e.stopPropagation()
2107       e.preventDefault()
2108       this.select()
2109       this.$element.focus()
2110     }
2111
2112   , mouseenter: function (e) {
2113       this.mousedover = true
2114       this.$menu.find('.active').removeClass('active')
2115       $(e.currentTarget).addClass('active')
2116     }
2117
2118   , mouseleave: function (e) {
2119       this.mousedover = false
2120       if (!this.focused && this.shown) this.hide()
2121     }
2122
2123   }
2124
2125
2126   /* TYPEAHEAD PLUGIN DEFINITION
2127    * =========================== */
2128
2129   var old = $.fn.typeahead
2130
2131   $.fn.typeahead = function (option) {
2132     return this.each(function () {
2133       var $this = $(this)
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]()
2138     })
2139   }
2140
2141   $.fn.typeahead.defaults = {
2142     source: []
2143   , items: 8
2144   , menu: '<ul class="typeahead dropdown-menu"></ul>'
2145   , item: '<li><a href="#"></a></li>'
2146   , minLength: 1
2147   }
2148
2149   $.fn.typeahead.Constructor = Typeahead
2150
2151
2152  /* TYPEAHEAD NO CONFLICT
2153   * =================== */
2154
2155   $.fn.typeahead.noConflict = function () {
2156     $.fn.typeahead = old
2157     return this
2158   }
2159
2160
2161  /* TYPEAHEAD DATA-API
2162   * ================== */
2163
2164   $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
2165     var $this = $(this)
2166     if ($this.data('typeahead')) return
2167     $this.typeahead($this.data())
2168   })
2169
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.
2176  *
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
2180  *
2181  * http://www.apache.org/licenses/LICENSE-2.0
2182  *
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  * ========================================================== */
2189
2190
2191 !function ($) {
2192
2193   "use strict"; // jshint ;_;
2194
2195
2196  /* AFFIX CLASS DEFINITION
2197   * ====================== */
2198
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()
2206   }
2207
2208   Affix.prototype.checkPosition = function () {
2209     if (!this.$element.is(':visible')) return
2210
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'
2218       , affix
2219
2220     if (typeof offset != 'object') offsetBottom = offsetTop = offset
2221     if (typeof offsetTop == 'function') offsetTop = offset.top()
2222     if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
2223
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 ?
2227       'top'    : false
2228
2229     if (this.affixed === affix) return
2230
2231     this.affixed = affix
2232     this.unpin = affix == 'bottom' ? position.top - scrollTop : null
2233
2234     this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
2235   }
2236
2237
2238  /* AFFIX PLUGIN DEFINITION
2239   * ======================= */
2240
2241   var old = $.fn.affix
2242
2243   $.fn.affix = function (option) {
2244     return this.each(function () {
2245       var $this = $(this)
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]()
2250     })
2251   }
2252
2253   $.fn.affix.Constructor = Affix
2254
2255   $.fn.affix.defaults = {
2256     offset: 0
2257   }
2258
2259
2260  /* AFFIX NO CONFLICT
2261   * ================= */
2262
2263   $.fn.affix.noConflict = function () {
2264     $.fn.affix = old
2265     return this
2266   }
2267
2268
2269  /* AFFIX DATA-API
2270   * ============== */
2271
2272   $(window).on('load', function () {
2273     $('[data-spy="affix"]').each(function () {
2274       var $spy = $(this)
2275         , data = $spy.data()
2276
2277       data.offset = data.offset || {}
2278
2279       data.offsetBottom && (data.offset.bottom = data.offsetBottom)
2280       data.offsetTop && (data.offset.top = data.offsetTop)
2281
2282       $spy.affix(data)
2283     })
2284   })
2285
2286
2287 }(window.$jqTheme || window.jQuery);