1
/* ===================================================
2
* bootstrap-transition.js v2.0.1
3
* http://twitter.github.com/bootstrap/javascript.html#transitions
4
* ===================================================
5
* Copyright 2012 Twitter, Inc.
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* You may obtain a copy of the License at
11
* http://www.apache.org/licenses/LICENSE-2.0
13
* Unless required by applicable law or agreed to in writing, software
14
* distributed under the License is distributed on an "AS IS" BASIS,
15
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
* See the License for the specific language governing permissions and
17
* limitations under the License.
18
* ========================================================== */
26
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
27
* ======================================================= */
29
$.support.transition = (function () {
30
var thisBody = document.body || document.documentElement
31
, thisStyle = thisBody.style
32
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
36
var transitionEnd = "TransitionEnd"
37
if ( $.browser.webkit ) {
38
transitionEnd = "webkitTransitionEnd"
39
} else if ( $.browser.mozilla ) {
40
transitionEnd = "transitionend"
41
} else if ( $.browser.opera ) {
42
transitionEnd = "oTransitionEnd"
51
}( window.jQuery );/* ==========================================================
52
* bootstrap-alert.js v2.0.1
53
* http://twitter.github.com/bootstrap/javascript.html#alerts
54
* ==========================================================
55
* Copyright 2012 Twitter, Inc.
57
* Licensed under the Apache License, Version 2.0 (the "License");
58
* you may not use this file except in compliance with the License.
59
* You may obtain a copy of the License at
61
* http://www.apache.org/licenses/LICENSE-2.0
63
* Unless required by applicable law or agreed to in writing, software
64
* distributed under the License is distributed on an "AS IS" BASIS,
65
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66
* See the License for the specific language governing permissions and
67
* limitations under the License.
68
* ========================================================== */
75
/* ALERT CLASS DEFINITION
76
* ====================== */
78
var dismiss = '[data-dismiss="alert"]'
79
, Alert = function ( el ) {
80
$(el).on('click', dismiss, this.close)
87
, close: function ( e ) {
89
, selector = $this.attr('data-target')
93
selector = $this.attr('href')
94
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
98
$parent.trigger('close')
100
e && e.preventDefault()
102
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
108
function removeElement() {
114
$.support.transition && $parent.hasClass('fade') ?
115
$parent.on($.support.transition.end, removeElement) :
122
/* ALERT PLUGIN DEFINITION
123
* ======================= */
125
$.fn.alert = function ( option ) {
126
return this.each(function () {
128
, data = $this.data('alert')
129
if (!data) $this.data('alert', (data = new Alert(this)))
130
if (typeof option == 'string') data[option].call($this)
134
$.fn.alert.Constructor = Alert
141
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
144
}( window.jQuery );/* ============================================================
145
* bootstrap-button.js v2.0.1
146
* http://twitter.github.com/bootstrap/javascript.html#buttons
147
* ============================================================
148
* Copyright 2012 Twitter, Inc.
150
* Licensed under the Apache License, Version 2.0 (the "License");
151
* you may not use this file except in compliance with the License.
152
* You may obtain a copy of the License at
154
* http://www.apache.org/licenses/LICENSE-2.0
156
* Unless required by applicable law or agreed to in writing, software
157
* distributed under the License is distributed on an "AS IS" BASIS,
158
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
159
* See the License for the specific language governing permissions and
160
* limitations under the License.
161
* ============================================================ */
167
/* BUTTON PUBLIC CLASS DEFINITION
168
* ============================== */
170
var Button = function ( element, options ) {
171
this.$element = $(element)
172
this.options = $.extend({}, $.fn.button.defaults, options)
179
, setState: function ( state ) {
181
, $el = this.$element
183
, val = $el.is('input') ? 'val' : 'html'
185
state = state + 'Text'
186
data.resetText || $el.data('resetText', $el[val]())
188
$el[val](data[state] || this.options[state])
190
// push to event loop to allow forms to submit
191
setTimeout(function () {
192
state == 'loadingText' ?
193
$el.addClass(d).attr(d, d) :
194
$el.removeClass(d).removeAttr(d)
198
, toggle: function () {
199
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
203
.removeClass('active')
205
this.$element.toggleClass('active')
211
/* BUTTON PLUGIN DEFINITION
212
* ======================== */
214
$.fn.button = function ( option ) {
215
return this.each(function () {
217
, data = $this.data('button')
218
, options = typeof option == 'object' && option
219
if (!data) $this.data('button', (data = new Button(this, options)))
220
if (option == 'toggle') data.toggle()
221
else if (option) data.setState(option)
225
$.fn.button.defaults = {
226
loadingText: 'loading...'
229
$.fn.button.Constructor = Button
236
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
237
var $btn = $(e.target)
238
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
239
$btn.button('toggle')
243
}( window.jQuery );/* ==========================================================
244
* bootstrap-carousel.js v2.0.1
245
* http://twitter.github.com/bootstrap/javascript.html#carousel
246
* ==========================================================
247
* Copyright 2012 Twitter, Inc.
249
* Licensed under the Apache License, Version 2.0 (the "License");
250
* you may not use this file except in compliance with the License.
251
* You may obtain a copy of the License at
253
* http://www.apache.org/licenses/LICENSE-2.0
255
* Unless required by applicable law or agreed to in writing, software
256
* distributed under the License is distributed on an "AS IS" BASIS,
257
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
258
* See the License for the specific language governing permissions and
259
* limitations under the License.
260
* ========================================================== */
267
/* CAROUSEL CLASS DEFINITION
268
* ========================= */
270
var Carousel = function (element, options) {
271
this.$element = $(element)
272
this.options = $.extend({}, $.fn.carousel.defaults, options)
273
this.options.slide && this.slide(this.options.slide)
276
Carousel.prototype = {
279
this.interval = setInterval($.proxy(this.next, this), this.options.interval)
283
, to: function (pos) {
284
var $active = this.$element.find('.active')
285
, children = $active.parent().children()
286
, activePos = children.index($active)
289
if (pos > (children.length - 1) || pos < 0) return
292
return this.$element.one('slid', function () {
297
if (activePos == pos) {
298
return this.pause().cycle()
301
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
304
, pause: function () {
305
clearInterval(this.interval)
310
, next: function () {
311
if (this.sliding) return
312
return this.slide('next')
315
, prev: function () {
316
if (this.sliding) return
317
return this.slide('prev')
320
, slide: function (type, next) {
321
var $active = this.$element.find('.active')
322
, $next = next || $active[type]()
323
, isCycling = this.interval
324
, direction = type == 'next' ? 'left' : 'right'
325
, fallback = type == 'next' ? 'first' : 'last'
328
if (!$next.length) return
332
isCycling && this.pause()
334
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
336
if (!$.support.transition && this.$element.hasClass('slide')) {
337
this.$element.trigger('slide')
338
$active.removeClass('active')
339
$next.addClass('active')
341
this.$element.trigger('slid')
344
$next[0].offsetWidth // force reflow
345
$active.addClass(direction)
346
$next.addClass(direction)
347
this.$element.trigger('slide')
348
this.$element.one($.support.transition.end, function () {
349
$next.removeClass([type, direction].join(' ')).addClass('active')
350
$active.removeClass(['active', direction].join(' '))
352
setTimeout(function () { that.$element.trigger('slid') }, 0)
356
isCycling && this.cycle()
364
/* CAROUSEL PLUGIN DEFINITION
365
* ========================== */
367
$.fn.carousel = function ( option ) {
368
return this.each(function () {
370
, data = $this.data('carousel')
371
, options = typeof option == 'object' && option
372
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
373
if (typeof option == 'number') data.to(option)
374
else if (typeof option == 'string' || (option = options.slide)) data[option]()
379
$.fn.carousel.defaults = {
383
$.fn.carousel.Constructor = Carousel
387
* ================= */
390
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
391
var $this = $(this), href
392
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
393
, options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
394
$target.carousel(options)
399
}( window.jQuery );/* =============================================================
400
* bootstrap-collapse.js v2.0.1
401
* http://twitter.github.com/bootstrap/javascript.html#collapse
402
* =============================================================
403
* Copyright 2012 Twitter, Inc.
405
* Licensed under the Apache License, Version 2.0 (the "License");
406
* you may not use this file except in compliance with the License.
407
* You may obtain a copy of the License at
409
* http://www.apache.org/licenses/LICENSE-2.0
411
* Unless required by applicable law or agreed to in writing, software
412
* distributed under the License is distributed on an "AS IS" BASIS,
413
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
414
* See the License for the specific language governing permissions and
415
* limitations under the License.
416
* ============================================================ */
422
var Collapse = function ( element, options ) {
423
this.$element = $(element)
424
this.options = $.extend({}, $.fn.collapse.defaults, options)
426
if (this.options["parent"]) {
427
this.$parent = $(this.options["parent"])
430
this.options.toggle && this.toggle()
433
Collapse.prototype = {
435
constructor: Collapse
437
, dimension: function () {
438
var hasWidth = this.$element.hasClass('width')
439
return hasWidth ? 'width' : 'height'
442
, show: function () {
443
var dimension = this.dimension()
444
, scroll = $.camelCase(['scroll', dimension].join('-'))
445
, actives = this.$parent && this.$parent.find('.in')
448
if (actives && actives.length) {
449
hasData = actives.data('collapse')
450
actives.collapse('hide')
451
hasData || actives.data('collapse', null)
454
this.$element[dimension](0)
455
this.transition('addClass', 'show', 'shown')
456
this.$element[dimension](this.$element[0][scroll])
460
, hide: function () {
461
var dimension = this.dimension()
462
this.reset(this.$element[dimension]())
463
this.transition('removeClass', 'hide', 'hidden')
464
this.$element[dimension](0)
467
, reset: function ( size ) {
468
var dimension = this.dimension()
471
.removeClass('collapse')
472
[dimension](size || 'auto')
475
this.$element.addClass('collapse')
478
, transition: function ( method, startEvent, completeEvent ) {
480
, complete = function () {
481
if (startEvent == 'show') that.reset()
482
that.$element.trigger(completeEvent)
489
$.support.transition && this.$element.hasClass('collapse') ?
490
this.$element.one($.support.transition.end, complete) :
494
, toggle: function () {
495
this[this.$element.hasClass('in') ? 'hide' : 'show']()
500
/* COLLAPSIBLE PLUGIN DEFINITION
501
* ============================== */
503
$.fn.collapse = function ( option ) {
504
return this.each(function () {
506
, data = $this.data('collapse')
507
, options = typeof option == 'object' && option
508
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
509
if (typeof option == 'string') data[option]()
513
$.fn.collapse.defaults = {
517
$.fn.collapse.Constructor = Collapse
520
/* COLLAPSIBLE DATA-API
521
* ==================== */
524
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
525
var $this = $(this), href
526
, target = $this.attr('data-target')
527
|| e.preventDefault()
528
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
529
, option = $(target).data('collapse') ? 'toggle' : $this.data()
530
$(target).collapse(option)
534
}( window.jQuery );/* ============================================================
535
* bootstrap-dropdown.js v2.0.1
536
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
537
* ============================================================
538
* Copyright 2012 Twitter, Inc.
540
* Licensed under the Apache License, Version 2.0 (the "License");
541
* you may not use this file except in compliance with the License.
542
* You may obtain a copy of the License at
544
* http://www.apache.org/licenses/LICENSE-2.0
546
* Unless required by applicable law or agreed to in writing, software
547
* distributed under the License is distributed on an "AS IS" BASIS,
548
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
549
* See the License for the specific language governing permissions and
550
* limitations under the License.
551
* ============================================================ */
558
/* DROPDOWN CLASS DEFINITION
559
* ========================= */
561
var toggle = '[data-toggle="dropdown"]'
562
, Dropdown = function ( element ) {
563
var $el = $(element).on('click.dropdown.data-api', this.toggle)
564
$('html').on('click.dropdown.data-api', function () {
565
$el.parent().removeClass('open')
569
Dropdown.prototype = {
571
constructor: Dropdown
573
, toggle: function ( e ) {
575
, selector = $this.attr('data-target')
580
selector = $this.attr('href')
581
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
584
$parent = $(selector)
585
$parent.length || ($parent = $this.parent())
587
isActive = $parent.hasClass('open')
590
!isActive && $parent.toggleClass('open')
597
function clearMenus() {
598
$(toggle).parent().removeClass('open')
602
/* DROPDOWN PLUGIN DEFINITION
603
* ========================== */
605
$.fn.dropdown = function ( option ) {
606
return this.each(function () {
608
, data = $this.data('dropdown')
609
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
610
if (typeof option == 'string') data[option].call($this)
614
$.fn.dropdown.Constructor = Dropdown
617
/* APPLY TO STANDARD DROPDOWN ELEMENTS
618
* =================================== */
621
$('html').on('click.dropdown.data-api', clearMenus)
622
$('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
625
}( window.jQuery );/* =========================================================
626
* bootstrap-modal.js v2.0.1
627
* http://twitter.github.com/bootstrap/javascript.html#modals
628
* =========================================================
629
* Copyright 2012 Twitter, Inc.
631
* Licensed under the Apache License, Version 2.0 (the "License");
632
* you may not use this file except in compliance with the License.
633
* You may obtain a copy of the License at
635
* http://www.apache.org/licenses/LICENSE-2.0
637
* Unless required by applicable law or agreed to in writing, software
638
* distributed under the License is distributed on an "AS IS" BASIS,
639
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
640
* See the License for the specific language governing permissions and
641
* limitations under the License.
642
* ========================================================= */
649
/* MODAL CLASS DEFINITION
650
* ====================== */
652
var Modal = function ( content, options ) {
653
this.options = options
654
this.$element = $(content)
655
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
662
, toggle: function () {
663
return this[!this.isShown ? 'show' : 'hide']()
666
, show: function () {
669
if (this.isShown) return
671
$('body').addClass('modal-open')
674
this.$element.trigger('show')
677
backdrop.call(this, function () {
678
var transition = $.support.transition && that.$element.hasClass('fade')
680
!that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
686
that.$element[0].offsetWidth // force reflow
689
that.$element.addClass('in')
692
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
693
that.$element.trigger('shown')
698
, hide: function ( e ) {
699
e && e.preventDefault()
701
if (!this.isShown) return
706
$('body').removeClass('modal-open')
714
$.support.transition && this.$element.hasClass('fade') ?
715
hideWithTransition.call(this) :
722
/* MODAL PRIVATE METHODS
723
* ===================== */
725
function hideWithTransition() {
727
, timeout = setTimeout(function () {
728
that.$element.off($.support.transition.end)
732
this.$element.one($.support.transition.end, function () {
733
clearTimeout(timeout)
738
function hideModal( that ) {
746
function backdrop( callback ) {
748
, animate = this.$element.hasClass('fade') ? 'fade' : ''
750
if (this.isShown && this.options.backdrop) {
751
var doAnimate = $.support.transition && animate
753
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
754
.appendTo(document.body)
756
if (this.options.backdrop != 'static') {
757
this.$backdrop.click($.proxy(this.hide, this))
760
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
762
this.$backdrop.addClass('in')
765
this.$backdrop.one($.support.transition.end, callback) :
768
} else if (!this.isShown && this.$backdrop) {
769
this.$backdrop.removeClass('in')
771
$.support.transition && this.$element.hasClass('fade')?
772
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
773
removeBackdrop.call(this)
775
} else if (callback) {
780
function removeBackdrop() {
781
this.$backdrop.remove()
782
this.$backdrop = null
787
if (this.isShown && this.options.keyboard) {
788
$(document).on('keyup.dismiss.modal', function ( e ) {
789
e.which == 27 && that.hide()
791
} else if (!this.isShown) {
792
$(document).off('keyup.dismiss.modal')
797
/* MODAL PLUGIN DEFINITION
798
* ======================= */
800
$.fn.modal = function ( option ) {
801
return this.each(function () {
803
, data = $this.data('modal')
804
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
805
if (!data) $this.data('modal', (data = new Modal(this, options)))
806
if (typeof option == 'string') data[option]()
807
else if (options.show) data.show()
811
$.fn.modal.defaults = {
817
$.fn.modal.Constructor = Modal
824
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
825
var $this = $(this), href
826
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
827
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
830
$target.modal(option)
834
}( window.jQuery );/* ===========================================================
835
* bootstrap-tooltip.js v2.0.1
836
* http://twitter.github.com/bootstrap/javascript.html#tooltips
837
* Inspired by the original jQuery.tipsy by Jason Frame
838
* ===========================================================
839
* Copyright 2012 Twitter, Inc.
841
* Licensed under the Apache License, Version 2.0 (the "License");
842
* you may not use this file except in compliance with the License.
843
* You may obtain a copy of the License at
845
* http://www.apache.org/licenses/LICENSE-2.0
847
* Unless required by applicable law or agreed to in writing, software
848
* distributed under the License is distributed on an "AS IS" BASIS,
849
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
850
* See the License for the specific language governing permissions and
851
* limitations under the License.
852
* ========================================================== */
858
/* TOOLTIP PUBLIC CLASS DEFINITION
859
* =============================== */
861
var Tooltip = function ( element, options ) {
862
this.init('tooltip', element, options)
865
Tooltip.prototype = {
869
, init: function ( type, element, options ) {
874
this.$element = $(element)
875
this.options = this.getOptions(options)
878
if (this.options.trigger != 'manual') {
879
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
880
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
881
this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
882
this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
885
this.options.selector ?
886
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
890
, getOptions: function ( options ) {
891
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
893
if (options.delay && typeof options.delay == 'number') {
896
, hide: options.delay
903
, enter: function ( e ) {
904
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
906
if (!self.options.delay || !self.options.delay.show) {
909
self.hoverState = 'in'
910
setTimeout(function() {
911
if (self.hoverState == 'in') {
914
}, self.options.delay.show)
918
, leave: function ( e ) {
919
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
921
if (!self.options.delay || !self.options.delay.hide) {
924
self.hoverState = 'out'
925
setTimeout(function() {
926
if (self.hoverState == 'out') {
929
}, self.options.delay.hide)
933
, show: function () {
942
if (this.hasContent() && this.enabled) {
946
if (this.options.animation) {
947
$tip.addClass('fade')
950
placement = typeof this.options.placement == 'function' ?
951
this.options.placement.call(this, $tip[0], this.$element[0]) :
952
this.options.placement
954
inside = /in/.test(placement)
958
.css({ top: 0, left: 0, display: 'block' })
959
.appendTo(inside ? this.$element : document.body)
961
pos = this.getPosition(inside)
963
actualWidth = $tip[0].offsetWidth
964
actualHeight = $tip[0].offsetHeight
966
switch (inside ? placement.split(' ')[1] : placement) {
968
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
971
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
974
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
977
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
988
, setContent: function () {
989
var $tip = this.tip()
990
$tip.find('.tooltip-inner').html(this.getTitle())
991
$tip.removeClass('fade in top bottom left right')
994
, hide: function () {
998
$tip.removeClass('in')
1000
function removeWithAnimation() {
1001
var timeout = setTimeout(function () {
1002
$tip.off($.support.transition.end).remove()
1005
$tip.one($.support.transition.end, function () {
1006
clearTimeout(timeout)
1011
$.support.transition && this.$tip.hasClass('fade') ?
1012
removeWithAnimation() :
1016
, fixTitle: function () {
1017
var $e = this.$element
1018
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1019
$e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
1023
, hasContent: function () {
1024
return this.getTitle()
1027
, getPosition: function (inside) {
1028
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
1029
width: this.$element[0].offsetWidth
1030
, height: this.$element[0].offsetHeight
1034
, getTitle: function () {
1036
, $e = this.$element
1039
title = $e.attr('data-original-title')
1040
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1042
title = title.toString().replace(/(^\s*|\s*$)/, "")
1047
, tip: function () {
1048
return this.$tip = this.$tip || $(this.options.template)
1051
, validate: function () {
1052
if (!this.$element[0].parentNode) {
1054
this.$element = null
1059
, enable: function () {
1063
, disable: function () {
1064
this.enabled = false
1067
, toggleEnabled: function () {
1068
this.enabled = !this.enabled
1071
, toggle: function () {
1072
this[this.tip().hasClass('in') ? 'hide' : 'show']()
1078
/* TOOLTIP PLUGIN DEFINITION
1079
* ========================= */
1081
$.fn.tooltip = function ( option ) {
1082
return this.each(function () {
1084
, data = $this.data('tooltip')
1085
, options = typeof option == 'object' && option
1086
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1087
if (typeof option == 'string') data[option]()
1091
$.fn.tooltip.Constructor = Tooltip
1093
$.fn.tooltip.defaults = {
1100
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1103
}( window.jQuery );/* ===========================================================
1104
* bootstrap-popover.js v2.0.1
1105
* http://twitter.github.com/bootstrap/javascript.html#popovers
1106
* ===========================================================
1107
* Copyright 2012 Twitter, Inc.
1109
* Licensed under the Apache License, Version 2.0 (the "License");
1110
* you may not use this file except in compliance with the License.
1111
* You may obtain a copy of the License at
1113
* http://www.apache.org/licenses/LICENSE-2.0
1115
* Unless required by applicable law or agreed to in writing, software
1116
* distributed under the License is distributed on an "AS IS" BASIS,
1117
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1118
* See the License for the specific language governing permissions and
1119
* limitations under the License.
1120
* =========================================================== */
1127
var Popover = function ( element, options ) {
1128
this.init('popover', element, options)
1131
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1132
========================================== */
1134
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1136
constructor: Popover
1138
, setContent: function () {
1139
var $tip = this.tip()
1140
, title = this.getTitle()
1141
, content = this.getContent()
1143
$tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title)
1144
$tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content)
1146
$tip.removeClass('fade top bottom left right in')
1149
, hasContent: function () {
1150
return this.getTitle() || this.getContent()
1153
, getContent: function () {
1155
, $e = this.$element
1158
content = $e.attr('data-content')
1159
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1161
content = content.toString().replace(/(^\s*|\s*$)/, "")
1168
this.$tip = $(this.options.template)
1176
/* POPOVER PLUGIN DEFINITION
1177
* ======================= */
1179
$.fn.popover = function ( option ) {
1180
return this.each(function () {
1182
, data = $this.data('popover')
1183
, options = typeof option == 'object' && option
1184
if (!data) $this.data('popover', (data = new Popover(this, options)))
1185
if (typeof option == 'string') data[option]()
1189
$.fn.popover.Constructor = Popover
1191
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1194
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
1197
}( window.jQuery );/* =============================================================
1198
* bootstrap-scrollspy.js v2.0.1
1199
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
1200
* =============================================================
1201
* Copyright 2012 Twitter, Inc.
1203
* Licensed under the Apache License, Version 2.0 (the "License");
1204
* you may not use this file except in compliance with the License.
1205
* You may obtain a copy of the License at
1207
* http://www.apache.org/licenses/LICENSE-2.0
1209
* Unless required by applicable law or agreed to in writing, software
1210
* distributed under the License is distributed on an "AS IS" BASIS,
1211
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
* See the License for the specific language governing permissions and
1213
* limitations under the License.
1214
* ============================================================== */
1220
/* SCROLLSPY CLASS DEFINITION
1221
* ========================== */
1223
function ScrollSpy( element, options) {
1224
var process = $.proxy(this.process, this)
1225
, $element = $(element).is('body') ? $(window) : $(element)
1227
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1228
this.$scrollElement = $element.on('scroll.scroll.data-api', process)
1229
this.selector = (this.options.target
1230
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1231
|| '') + ' .nav li > a'
1232
this.$body = $('body').on('click.scroll.data-api', this.selector, process)
1237
ScrollSpy.prototype = {
1239
constructor: ScrollSpy
1241
, refresh: function () {
1242
this.targets = this.$body
1243
.find(this.selector)
1245
var href = $(this).attr('href')
1246
return /^#\w/.test(href) && $(href).length ? href : null
1249
this.offsets = $.map(this.targets, function (id) {
1250
return $(id).position().top
1254
, process: function () {
1255
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1256
, offsets = this.offsets
1257
, targets = this.targets
1258
, activeTarget = this.activeTarget
1261
for (i = offsets.length; i--;) {
1262
activeTarget != targets[i]
1263
&& scrollTop >= offsets[i]
1264
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1265
&& this.activate( targets[i] )
1269
, activate: function (target) {
1272
this.activeTarget = target
1275
.find(this.selector).parent('.active')
1276
.removeClass('active')
1279
.find(this.selector + '[href="' + target + '"]')
1283
if ( active.parent('.dropdown-menu') ) {
1284
active.closest('li.dropdown').addClass('active')
1291
/* SCROLLSPY PLUGIN DEFINITION
1292
* =========================== */
1294
$.fn.scrollspy = function ( option ) {
1295
return this.each(function () {
1297
, data = $this.data('scrollspy')
1298
, options = typeof option == 'object' && option
1299
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1300
if (typeof option == 'string') data[option]()
1304
$.fn.scrollspy.Constructor = ScrollSpy
1306
$.fn.scrollspy.defaults = {
1311
/* SCROLLSPY DATA-API
1312
* ================== */
1315
$('[data-spy="scroll"]').each(function () {
1317
$spy.scrollspy($spy.data())
1321
}( window.jQuery );/* ========================================================
1322
* bootstrap-tab.js v2.0.1
1323
* http://twitter.github.com/bootstrap/javascript.html#tabs
1324
* ========================================================
1325
* Copyright 2012 Twitter, Inc.
1327
* Licensed under the Apache License, Version 2.0 (the "License");
1328
* you may not use this file except in compliance with the License.
1329
* You may obtain a copy of the License at
1331
* http://www.apache.org/licenses/LICENSE-2.0
1333
* Unless required by applicable law or agreed to in writing, software
1334
* distributed under the License is distributed on an "AS IS" BASIS,
1335
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1336
* See the License for the specific language governing permissions and
1337
* limitations under the License.
1338
* ======================================================== */
1345
/* TAB CLASS DEFINITION
1346
* ==================== */
1348
var Tab = function ( element ) {
1349
this.element = $(element)
1356
, show: function () {
1357
var $this = this.element
1358
, $ul = $this.closest('ul:not(.dropdown-menu)')
1359
, selector = $this.attr('data-target')
1364
selector = $this.attr('href')
1365
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1368
if ( $this.parent('li').hasClass('active') ) return
1370
previous = $ul.find('.active a').last()[0]
1374
, relatedTarget: previous
1377
$target = $(selector)
1379
this.activate($this.parent('li'), $ul)
1380
this.activate($target, $target.parent(), function () {
1383
, relatedTarget: previous
1388
, activate: function ( element, container, callback) {
1389
var $active = container.find('> .active')
1390
, transition = callback
1391
&& $.support.transition
1392
&& $active.hasClass('fade')
1396
.removeClass('active')
1397
.find('> .dropdown-menu > .active')
1398
.removeClass('active')
1400
element.addClass('active')
1403
element[0].offsetWidth // reflow for transition
1404
element.addClass('in')
1406
element.removeClass('fade')
1409
if ( element.parent('.dropdown-menu') ) {
1410
element.closest('li.dropdown').addClass('active')
1413
callback && callback()
1417
$active.one($.support.transition.end, next) :
1420
$active.removeClass('in')
1425
/* TAB PLUGIN DEFINITION
1426
* ===================== */
1428
$.fn.tab = function ( option ) {
1429
return this.each(function () {
1431
, data = $this.data('tab')
1432
if (!data) $this.data('tab', (data = new Tab(this)))
1433
if (typeof option == 'string') data[option]()
1437
$.fn.tab.Constructor = Tab
1444
$('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1450
}( window.jQuery );/* =============================================================
1451
* bootstrap-typeahead.js v2.0.1
1452
* http://twitter.github.com/bootstrap/javascript.html#typeahead
1453
* =============================================================
1454
* Copyright 2012 Twitter, Inc.
1456
* Licensed under the Apache License, Version 2.0 (the "License");
1457
* you may not use this file except in compliance with the License.
1458
* You may obtain a copy of the License at
1460
* http://www.apache.org/licenses/LICENSE-2.0
1462
* Unless required by applicable law or agreed to in writing, software
1463
* distributed under the License is distributed on an "AS IS" BASIS,
1464
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1465
* See the License for the specific language governing permissions and
1466
* limitations under the License.
1467
* ============================================================ */
1473
var Typeahead = function ( element, options ) {
1474
this.$element = $(element)
1475
this.options = $.extend({}, $.fn.typeahead.defaults, options)
1476
this.matcher = this.options.matcher || this.matcher
1477
this.sorter = this.options.sorter || this.sorter
1478
this.highlighter = this.options.highlighter || this.highlighter
1479
this.$menu = $(this.options.menu).appendTo('body')
1480
this.source = this.options.source
1485
Typeahead.prototype = {
1487
constructor: Typeahead
1489
, select: function () {
1490
var val = this.$menu.find('.active').attr('data-value')
1491
this.$element.val(val)
1495
, show: function () {
1496
var pos = $.extend({}, this.$element.offset(), {
1497
height: this.$element[0].offsetHeight
1501
top: pos.top + pos.height
1510
, hide: function () {
1516
, lookup: function (event) {
1521
this.query = this.$element.val()
1524
return this.shown ? this.hide() : this
1527
items = $.grep(this.source, function (item) {
1528
if (that.matcher(item)) return item
1531
items = this.sorter(items)
1533
if (!items.length) {
1534
return this.shown ? this.hide() : this
1537
return this.render(items.slice(0, this.options.items)).show()
1540
, matcher: function (item) {
1541
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1544
, sorter: function (items) {
1546
, caseSensitive = []
1547
, caseInsensitive = []
1550
while (item = items.shift()) {
1551
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1552
else if (~item.indexOf(this.query)) caseSensitive.push(item)
1553
else caseInsensitive.push(item)
1556
return beginswith.concat(caseSensitive, caseInsensitive)
1559
, highlighter: function (item) {
1560
return item.replace(new RegExp('(' + this.query + ')', 'ig'), function ($1, match) {
1561
return '<strong>' + match + '</strong>'
1565
, render: function (items) {
1568
items = $(items).map(function (i, item) {
1569
i = $(that.options.item).attr('data-value', item)
1570
i.find('a').html(that.highlighter(item))
1574
items.first().addClass('active')
1575
this.$menu.html(items)
1579
, next: function (event) {
1580
var active = this.$menu.find('.active').removeClass('active')
1581
, next = active.next()
1584
next = $(this.$menu.find('li')[0])
1587
next.addClass('active')
1590
, prev: function (event) {
1591
var active = this.$menu.find('.active').removeClass('active')
1592
, prev = active.prev()
1595
prev = this.$menu.find('li').last()
1598
prev.addClass('active')
1601
, listen: function () {
1603
.on('blur', $.proxy(this.blur, this))
1604
.on('keypress', $.proxy(this.keypress, this))
1605
.on('keyup', $.proxy(this.keyup, this))
1607
if ($.browser.webkit || $.browser.msie) {
1608
this.$element.on('keydown', $.proxy(this.keypress, this))
1612
.on('click', $.proxy(this.click, this))
1613
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1616
, keyup: function (e) {
1621
case 40: // down arrow
1622
case 38: // up arrow
1627
if (!this.shown) return
1641
, keypress: function (e) {
1643
if (!this.shown) return
1652
case 38: // up arrow
1657
case 40: // down arrow
1664
, blur: function (e) {
1668
setTimeout(function () { that.hide() }, 150)
1671
, click: function (e) {
1677
, mouseenter: function (e) {
1678
this.$menu.find('.active').removeClass('active')
1679
$(e.currentTarget).addClass('active')
1685
/* TYPEAHEAD PLUGIN DEFINITION
1686
* =========================== */
1688
$.fn.typeahead = function ( option ) {
1689
return this.each(function () {
1691
, data = $this.data('typeahead')
1692
, options = typeof option == 'object' && option
1693
if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1694
if (typeof option == 'string') data[option]()
1698
$.fn.typeahead.defaults = {
1701
, menu: '<ul class="typeahead dropdown-menu"></ul>'
1702
, item: '<li><a href="#"></a></li>'
1705
$.fn.typeahead.Constructor = Typeahead
1708
/* TYPEAHEAD DATA-API
1709
* ================== */
1712
$('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1714
if ($this.data('typeahead')) return
1716
$this.typeahead($this.data())
b'\\ No newline at end of file'