PluginProbe
Smart Forms – when you need more than just a contact form / trunk
Smart Forms – when you need more than just a contact form vtrunk
trunk 0.5 0.5.5 0.6 0.7 0.8 0.8.5 0.9.1
smart-forms / js / bootstrap / bootstrap.js

bootstrap.js in Smart Forms – when you need more than just a contact form trunk, at js/bootstrap/bootstrap.js

2,100 lines 58.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1
2
3 if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
4
5 /* ========================================================================
6 * Bootstrap: transition.js v3.2.0
7 * http://getbootstrap.com/javascript/#transitions
8 * ========================================================================
9 * Copyright 2011-2014 Twitter, Inc.
10 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
11 * ======================================================================== */
12
13
14 +function ($) {
15 'use strict';
16
17 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
18 // ============================================================
19
20 function transitionEnd() {
21 var el = document.createElement('bootstrap')
22
23 var transEndEventNames = {
24 WebkitTransition : 'webkitTransitionEnd',
25 MozTransition : 'transitionend',
26 OTransition : 'oTransitionEnd otransitionend',
27 transition : 'transitionend'
28 }
29
30 for (var name in transEndEventNames) {
31 if (el.style[name] !== undefined) {
32 return { end: transEndEventNames[name] }
33 }
34 }
35
36 return false // explicit for ie8 ( ._.)
37 }
38
39 // http://blog.alexmaccaw.com/css-transitions
40 $.fn.emulateTransitionEnd = function (duration) {
41 var called = false
42 var $el = this
43 $(this).one('bsTransitionEnd', function () { called = true })
44 var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
45 setTimeout(callback, duration)
46 return this
47 }
48
49 $(function () {
50 $.support.transition = transitionEnd()
51
52 if (!$.support.transition) return
53
54 $.event.special.bsTransitionEnd = {
55 bindType: $.support.transition.end,
56 delegateType: $.support.transition.end,
57 handle: function (e) {
58 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
59 }
60 }
61 })
62
63 }(rnJQuery);
64
65 /* ========================================================================
66 * Bootstrap: alert.js v3.2.0
67 * http://getbootstrap.com/javascript/#alerts
68 * ========================================================================
69 * Copyright 2011-2014 Twitter, Inc.
70 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
71 * ======================================================================== */
72
73
74 +function ($) {
75 'use strict';
76
77 // ALERT CLASS DEFINITION
78 // ======================
79
80 var dismiss = '[data-dismiss="alert"]'
81 var Alert = function (el) {
82 $(el).on('click', dismiss, this.close)
83 }
84
85 Alert.VERSION = '3.2.0'
86
87 Alert.prototype.close = function (e) {
88 var $this = $(this)
89 var selector = $this.attr('data-target')
90
91 if (!selector) {
92 selector = $this.attr('href')
93 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
94 }
95
96 var $parent = $(selector)
97
98 if (e) e.preventDefault()
99
100 if (!$parent.length) {
101 $parent = $this.hasClass('alert') ? $this : $this.parent()
102 }
103
104 $parent.trigger(e = $.Event('close.bs.alert'))
105
106 if (e.isDefaultPrevented()) return
107
108 $parent.removeClass('in')
109
110 function removeElement() {
111 // detach from parent, fire event then clean up data
112 $parent.detach().trigger('closed.bs.alert').remove()
113 }
114
115 $.support.transition && $parent.hasClass('fade') ?
116 $parent
117 .one('bsTransitionEnd', removeElement)
118 .emulateTransitionEnd(150) :
119 removeElement()
120 }
121
122
123 // ALERT PLUGIN DEFINITION
124 // =======================
125
126 function Plugin(option) {
127 return this.each(function () {
128 var $this = $(this)
129 var data = $this.data('bs.alert')
130
131 if (!data) $this.data('bs.alert', (data = new Alert(this)))
132 if (typeof option == 'string') data[option].call($this)
133 })
134 }
135
136 var old = $.fn.alert
137
138 $.fn.alert = Plugin
139 $.fn.alert.Constructor = Alert
140
141
142 // ALERT NO CONFLICT
143 // =================
144
145 $.fn.alert.noConflict = function () {
146 $.fn.alert = old
147 return this
148 }
149
150
151 // ALERT DATA-API
152 // ==============
153
154 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
155
156 }(rnJQuery);
157
158 /* ========================================================================
159 * Bootstrap: button.js v3.2.0
160 * http://getbootstrap.com/javascript/#buttons
161 * ========================================================================
162 * Copyright 2011-2014 Twitter, Inc.
163 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
164 * ======================================================================== */
165
166
167 +function ($) {
168 'use strict';
169
170 // BUTTON PUBLIC CLASS DEFINITION
171 // ==============================
172
173 var Button = function (element, options) {
174 this.$element = $(element)
175 this.options = $.extend({}, Button.DEFAULTS, options)
176 this.isLoading = false
177 }
178
179 Button.VERSION = '3.2.0'
180
181 Button.DEFAULTS = {
182 loadingText: 'loading...'
183 }
184
185 Button.prototype.setState = function (state) {
186 var d = 'disabled'
187 var $el = this.$element
188 var val = $el.is('input') ? 'val' : 'html'
189 var data = $el.data()
190
191 state = state + 'Text'
192
193 if (data.resetText == null) $el.data('resetText', $el[val]())
194
195 $el[val](data[state] == null ? this.options[state] : data[state])
196
197 // push to event loop to allow forms to submit
198 setTimeout($.proxy(function () {
199 if (state == 'loadingText') {
200 this.isLoading = true
201 $el.addClass(d).attr(d, d)
202 } else if (this.isLoading) {
203 this.isLoading = false
204 $el.removeClass(d).removeAttr(d)
205 }
206 }, this), 0)
207 }
208
209 Button.prototype.toggle = function () {
210 var changed = true
211 var $parent = this.$element.closest('[data-toggle="buttons"]')
212
213 if ($parent.length) {
214 var $input = this.$element.find('input')
215 if ($input.prop('type') == 'radio') {
216 if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
217 else $parent.find('.active').removeClass('active')
218 }
219 if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
220 }
221
222 if (changed) this.$element.toggleClass('active')
223 }
224
225
226 // BUTTON PLUGIN DEFINITION
227 // ========================
228
229 function Plugin(option) {
230 return this.each(function () {
231 var $this = $(this)
232 var data = $this.data('bs.button')
233 var options = typeof option == 'object' && option
234
235 if (!data) $this.data('bs.button', (data = new Button(this, options)))
236
237 if (option == 'toggle') data.toggle()
238 else if (option) data.setState(option)
239 })
240 }
241
242 var old = $.fn.button
243
244 $.fn.button = Plugin
245 $.fn.button.Constructor = Button
246
247
248 // BUTTON NO CONFLICT
249 // ==================
250
251 $.fn.button.noConflict = function () {
252 $.fn.button = old
253 return this
254 }
255
256
257 // BUTTON DATA-API
258 // ===============
259
260 $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
261 var $btn = $(e.target)
262 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
263 Plugin.call($btn, 'toggle')
264 e.preventDefault()
265 })
266
267 }(rnJQuery);
268
269 /* ========================================================================
270 * Bootstrap: carousel.js v3.2.0
271 * http://getbootstrap.com/javascript/#carousel
272 * ========================================================================
273 * Copyright 2011-2014 Twitter, Inc.
274 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
275 * ======================================================================== */
276
277
278 +function ($) {
279 'use strict';
280
281 // CAROUSEL CLASS DEFINITION
282 // =========================
283
284 var Carousel = function (element, options) {
285 this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
286 this.$indicators = this.$element.find('.carousel-indicators')
287 this.options = options
288 this.paused =
289 this.sliding =
290 this.interval =
291 this.$active =
292 this.$items = null
293
294 this.options.pause == 'hover' && this.$element
295 .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
296 .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
297 }
298
299 Carousel.VERSION = '3.2.0'
300
301 Carousel.DEFAULTS = {
302 interval: 5000,
303 pause: 'hover',
304 wrap: true
305 }
306
307 Carousel.prototype.keydown = function (e) {
308 switch (e.which) {
309 case 37: this.prev(); break
310 case 39: this.next(); break
311 default: return
312 }
313
314 e.preventDefault()
315 }
316
317 Carousel.prototype.cycle = function (e) {
318 e || (this.paused = false)
319
320 this.interval && clearInterval(this.interval)
321
322 this.options.interval
323 && !this.paused
324 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
325
326 return this
327 }
328
329 Carousel.prototype.getItemIndex = function (item) {
330 this.$items = item.parent().children('.item')
331 return this.$items.index(item || this.$active)
332 }
333
334 Carousel.prototype.to = function (pos) {
335 var that = this
336 var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
337
338 if (pos > (this.$items.length - 1) || pos < 0) return
339
340 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
341 if (activeIndex == pos) return this.pause().cycle()
342
343 return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
344 }
345
346 Carousel.prototype.pause = function (e) {
347 e || (this.paused = true)
348
349 if (this.$element.find('.next, .prev').length && $.support.transition) {
350 this.$element.trigger($.support.transition.end)
351 this.cycle(true)
352 }
353
354 this.interval = clearInterval(this.interval)
355
356 return this
357 }
358
359 Carousel.prototype.next = function () {
360 if (this.sliding) return
361 return this.slide('next')
362 }
363
364 Carousel.prototype.prev = function () {
365 if (this.sliding) return
366 return this.slide('prev')
367 }
368
369 Carousel.prototype.slide = function (type, next) {
370 var $active = this.$element.find('.item.active')
371 var $next = next || $active[type]()
372 var isCycling = this.interval
373 var direction = type == 'next' ? 'left' : 'right'
374 var fallback = type == 'next' ? 'first' : 'last'
375 var that = this
376
377 if (!$next.length) {
378 if (!this.options.wrap) return
379 $next = this.$element.find('.item')[fallback]()
380 }
381
382 if ($next.hasClass('active')) return (this.sliding = false)
383
384 var relatedTarget = $next[0]
385 var slideEvent = $.Event('slide.bs.carousel', {
386 relatedTarget: relatedTarget,
387 direction: direction
388 })
389 this.$element.trigger(slideEvent)
390 if (slideEvent.isDefaultPrevented()) return
391
392 this.sliding = true
393
394 isCycling && this.pause()
395
396 if (this.$indicators.length) {
397 this.$indicators.find('.active').removeClass('active')
398 var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
399 $nextIndicator && $nextIndicator.addClass('active')
400 }
401
402 var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
403 if ($.support.transition && this.$element.hasClass('slide')) {
404 $next.addClass(type)
405 $next[0].offsetWidth // force reflow
406 $active.addClass(direction)
407 $next.addClass(direction)
408 $active
409 .one('bsTransitionEnd', function () {
410 $next.removeClass([type, direction].join(' ')).addClass('active')
411 $active.removeClass(['active', direction].join(' '))
412 that.sliding = false
413 setTimeout(function () {
414 that.$element.trigger(slidEvent)
415 }, 0)
416 })
417 .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
418 } else {
419 $active.removeClass('active')
420 $next.addClass('active')
421 this.sliding = false
422 this.$element.trigger(slidEvent)
423 }
424
425 isCycling && this.cycle()
426
427 return this
428 }
429
430
431 // CAROUSEL PLUGIN DEFINITION
432 // ==========================
433
434 function Plugin(option) {
435 return this.each(function () {
436 var $this = $(this)
437 var data = $this.data('bs.carousel')
438 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
439 var action = typeof option == 'string' ? option : options.slide
440
441 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
442 if (typeof option == 'number') data.to(option)
443 else if (action) data[action]()
444 else if (options.interval) data.pause().cycle()
445 })
446 }
447
448 var old = $.fn.carousel
449
450 $.fn.carousel = Plugin
451 $.fn.carousel.Constructor = Carousel
452
453
454 // CAROUSEL NO CONFLICT
455 // ====================
456
457 $.fn.carousel.noConflict = function () {
458 $.fn.carousel = old
459 return this
460 }
461
462
463 // CAROUSEL DATA-API
464 // =================
465
466 $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
467 var href
468 var $this = $(this)
469 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
470 if (!$target.hasClass('carousel')) return
471 var options = $.extend({}, $target.data(), $this.data())
472 var slideIndex = $this.attr('data-slide-to')
473 if (slideIndex) options.interval = false
474
475 Plugin.call($target, options)
476
477 if (slideIndex) {
478 $target.data('bs.carousel').to(slideIndex)
479 }
480
481 e.preventDefault()
482 })
483
484 $(window).on('load', function () {
485 $('[data-ride="carousel"]').each(function () {
486 var $carousel = $(this)
487 Plugin.call($carousel, $carousel.data())
488 })
489 })
490
491 }(rnJQuery);
492
493 /* ========================================================================
494 * Bootstrap: collapse.js v3.2.0
495 * http://getbootstrap.com/javascript/#collapse
496 * ========================================================================
497 * Copyright 2011-2014 Twitter, Inc.
498 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
499 * ======================================================================== */
500
501
502 +function ($) {
503 'use strict';
504
505 // COLLAPSE PUBLIC CLASS DEFINITION
506 // ================================
507
508 var Collapse = function (element, options) {
509 this.$element = $(element)
510 this.options = $.extend({}, Collapse.DEFAULTS, options)
511 this.transitioning = null
512
513 if (this.options.parent) this.$parent = $(this.options.parent)
514 if (this.options.toggle) this.toggle()
515 }
516
517 Collapse.VERSION = '3.2.0'
518
519 Collapse.DEFAULTS = {
520 toggle: true
521 }
522
523 Collapse.prototype.dimension = function () {
524 var hasWidth = this.$element.hasClass('width')
525 return hasWidth ? 'width' : 'height'
526 }
527
528 Collapse.prototype.show = function () {
529 if (this.transitioning || this.$element.hasClass('in')) return
530
531 var startEvent = $.Event('show.bs.collapse')
532 this.$element.trigger(startEvent)
533 if (startEvent.isDefaultPrevented()) return
534
535 var actives = this.$parent && this.$parent.find('> .panel > .in')
536
537 if (actives && actives.length) {
538 var hasData = actives.data('bs.collapse')
539 if (hasData && hasData.transitioning) return
540 Plugin.call(actives, 'hide')
541 hasData || actives.data('bs.collapse', null)
542 }
543
544 var dimension = this.dimension()
545
546 this.$element
547 .removeClass('collapse')
548 .addClass('collapsing')[dimension](0)
549
550 this.transitioning = 1
551
552 var complete = function () {
553 this.$element
554 .removeClass('collapsing')
555 .addClass('collapse in')[dimension]('')
556 this.transitioning = 0
557 this.$element
558 .trigger('shown.bs.collapse')
559 }
560
561 if (!$.support.transition) return complete.call(this)
562
563 var scrollSize = $.camelCase(['scroll', dimension].join('-'))
564
565 this.$element
566 .one('bsTransitionEnd', $.proxy(complete, this))
567 .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
568 }
569
570 Collapse.prototype.hide = function () {
571 if (this.transitioning || !this.$element.hasClass('in')) return
572
573 var startEvent = $.Event('hide.bs.collapse')
574 this.$element.trigger(startEvent)
575 if (startEvent.isDefaultPrevented()) return
576
577 var dimension = this.dimension()
578
579 this.$element[dimension](this.$element[dimension]())[0].offsetHeight
580
581 this.$element
582 .addClass('collapsing')
583 .removeClass('collapse')
584 .removeClass('in')
585
586 this.transitioning = 1
587
588 var complete = function () {
589 this.transitioning = 0
590 this.$element
591 .trigger('hidden.bs.collapse')
592 .removeClass('collapsing')
593 .addClass('collapse')
594 }
595
596 if (!$.support.transition) return complete.call(this)
597
598 this.$element
599 [dimension](0)
600 .one('bsTransitionEnd', $.proxy(complete, this))
601 .emulateTransitionEnd(350)
602 }
603
604 Collapse.prototype.toggle = function () {
605 this[this.$element.hasClass('in') ? 'hide' : 'show']()
606 }
607
608
609 // COLLAPSE PLUGIN DEFINITION
610 // ==========================
611
612 function Plugin(option) {
613 return this.each(function () {
614 var $this = $(this)
615 var data = $this.data('bs.collapse')
616 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
617
618 if (!data && options.toggle && option == 'show') option = !option
619 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
620 if (typeof option == 'string') data[option]()
621 })
622 }
623
624 var old = $.fn.collapse
625
626 $.fn.collapse = Plugin
627 $.fn.collapse.Constructor = Collapse
628
629
630 // COLLAPSE NO CONFLICT
631 // ====================
632
633 $.fn.collapse.noConflict = function () {
634 $.fn.collapse = old
635 return this
636 }
637
638
639 // COLLAPSE DATA-API
640 // =================
641
642 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
643 var href
644 var $this = $(this)
645 var target = $this.attr('data-target')
646 || e.preventDefault()
647 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
648 var $target = $(target)
649 var data = $target.data('bs.collapse')
650 var option = data ? 'toggle' : $this.data()
651 var parent = $this.attr('data-parent')
652 var $parent = parent && $(parent)
653
654 if (!data || !data.transitioning) {
655 if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
656 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
657 }
658
659 Plugin.call($target, option)
660 })
661
662 }(rnJQuery);
663
664 /* ========================================================================
665 * Bootstrap: dropdown.js v3.2.0
666 * http://getbootstrap.com/javascript/#dropdowns
667 * ========================================================================
668 * Copyright 2011-2014 Twitter, Inc.
669 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
670 * ======================================================================== */
671
672
673 +function ($) {
674 'use strict';
675
676 // DROPDOWN CLASS DEFINITION
677 // =========================
678
679 var backdrop = '.dropdown-backdrop'
680 var toggle = '[data-toggle="dropdown"]'
681 var Dropdown = function (element) {
682 $(element).on('click.bs.dropdown', this.toggle)
683 }
684
685 Dropdown.VERSION = '3.2.0'
686
687 Dropdown.prototype.toggle = function (e) {
688 var $this = $(this)
689
690 if ($this.is('.disabled, :disabled')) return
691
692 var $parent = getParent($this)
693 var isActive = $parent.hasClass('open')
694
695 clearMenus()
696
697 if (!isActive) {
698 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
699 // if mobile we use a backdrop because click events don't delegate
700 $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
701 }
702
703 var relatedTarget = { relatedTarget: this }
704 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
705
706 if (e.isDefaultPrevented()) return
707
708 $this.trigger('focus')
709
710 $parent
711 .toggleClass('open')
712 .trigger('shown.bs.dropdown', relatedTarget)
713 }
714
715 return false
716 }
717
718 Dropdown.prototype.keydown = function (e) {
719 if (!/(38|40|27)/.test(e.keyCode)) return
720
721 var $this = $(this)
722
723 e.preventDefault()
724 e.stopPropagation()
725
726 if ($this.is('.disabled, :disabled')) return
727
728 var $parent = getParent($this)
729 var isActive = $parent.hasClass('open')
730
731 if (!isActive || (isActive && e.keyCode == 27)) {
732 if (e.which == 27) $parent.find(toggle).trigger('focus')
733 return $this.trigger('click')
734 }
735
736 var desc = ' li:not(.divider):visible a'
737 var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
738
739 if (!$items.length) return
740
741 var index = $items.index($items.filter(':focus'))
742
743 if (e.keyCode == 38 && index > 0) index-- // up
744 if (e.keyCode == 40 && index < $items.length - 1) index++ // down
745 if (!~index) index = 0
746
747 $items.eq(index).trigger('focus')
748 }
749
750 function clearMenus(e) {
751 if (e && e.which === 3) return
752 $(backdrop).remove()
753 $(toggle).each(function () {
754 var $parent = getParent($(this))
755 var relatedTarget = { relatedTarget: this }
756 if (!$parent.hasClass('open')) return
757 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
758 if (e.isDefaultPrevented()) return
759 $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
760 })
761 }
762
763 function getParent($this) {
764 var selector = $this.attr('data-target')
765
766 if (!selector) {
767 selector = $this.attr('href')
768 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
769 }
770
771 var $parent = selector && $(selector)
772
773 return $parent && $parent.length ? $parent : $this.parent()
774 }
775
776
777 // DROPDOWN PLUGIN DEFINITION
778 // ==========================
779
780 function Plugin(option) {
781 return this.each(function () {
782 var $this = $(this)
783 var data = $this.data('bs.dropdown')
784
785 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
786 if (typeof option == 'string') data[option].call($this)
787 })
788 }
789
790 var old = $.fn.dropdown
791
792 $.fn.dropdown = Plugin
793 $.fn.dropdown.Constructor = Dropdown
794
795
796 // DROPDOWN NO CONFLICT
797 // ====================
798
799 $.fn.dropdown.noConflict = function () {
800 $.fn.dropdown = old
801 return this
802 }
803
804
805 // APPLY TO STANDARD DROPDOWN ELEMENTS
806 // ===================================
807
808 $(document)
809 .on('click.bs.dropdown.data-api', clearMenus)
810 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
811 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
812 .on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)
813
814 }(rnJQuery);
815
816 /* ========================================================================
817 * Bootstrap: modal.js v3.2.0
818 * http://getbootstrap.com/javascript/#modals
819 * ========================================================================
820 * Copyright 2011-2014 Twitter, Inc.
821 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
822 * ======================================================================== */
823
824
825 +function ($) {
826 'use strict';
827
828 // MODAL CLASS DEFINITION
829 // ======================
830
831 var Modal = function (element, options) {
832 this.options = options
833 this.$body = $(document.body)
834 this.$element = $(element)
835 this.$backdrop =
836 this.isShown = null
837 this.scrollbarWidth = 0
838
839 if (this.options.remote) {
840 this.$element
841 .find('.modal-content')
842 .load(this.options.remote, $.proxy(function () {
843 this.$element.trigger('loaded.bs.modal')
844 }, this))
845 }
846 }
847
848 Modal.VERSION = '3.2.0'
849
850 Modal.DEFAULTS = {
851 backdrop: true,
852 keyboard: true,
853 show: true
854 }
855
856 Modal.prototype.toggle = function (_relatedTarget) {
857 return this.isShown ? this.hide() : this.show(_relatedTarget)
858 }
859
860 Modal.prototype.show = function (_relatedTarget) {
861 var that = this
862 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
863
864 this.$element.trigger(e)
865
866 if (this.isShown || e.isDefaultPrevented()) return
867
868 this.isShown = true
869
870 this.checkScrollbar()
871 this.$body.addClass('modal-open')
872
873 this.setScrollbar()
874 this.escape()
875
876 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
877
878 this.backdrop(function () {
879 var transition = $.support.transition && that.$element.hasClass('fade')
880
881 if (!that.$element.parent().length) {
882 that.$element.appendTo(that.$body) // don't move modals dom position
883 }
884
885 that.$element
886 .show()
887 .scrollTop(0)
888
889 if (transition) {
890 that.$element[0].offsetWidth // force reflow
891 }
892
893 that.$element
894 .addClass('in')
895 .attr('aria-hidden', false)
896
897 that.enforceFocus()
898
899 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
900
901 transition ?
902 that.$element.find('.modal-dialog') // wait for modal to slide in
903 .one('bsTransitionEnd', function () {
904 that.$element.trigger('focus').trigger(e)
905 })
906 .emulateTransitionEnd(300) :
907 that.$element.trigger('focus').trigger(e)
908 })
909 }
910
911 Modal.prototype.hide = function (e) {
912 if (e) e.preventDefault()
913
914 e = $.Event('hide.bs.modal')
915
916 this.$element.trigger(e)
917
918 if (!this.isShown || e.isDefaultPrevented()) return
919
920 this.isShown = false
921
922 this.$body.removeClass('modal-open')
923
924 this.resetScrollbar()
925 this.escape()
926
927 $(document).off('focusin.bs.modal')
928
929 this.$element
930 .removeClass('in')
931 .attr('aria-hidden', true)
932 .off('click.dismiss.bs.modal')
933
934 $.support.transition && this.$element.hasClass('fade') ?
935 this.$element
936 .one('bsTransitionEnd', $.proxy(this.hideModal, this))
937 .emulateTransitionEnd(300) :
938 this.hideModal()
939 }
940
941 Modal.prototype.enforceFocus = function () {
942 $(document)
943 .off('focusin.bs.modal') // guard against infinite focus loop
944 .on('focusin.bs.modal', $.proxy(function (e) {
945 if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
946 this.$element.trigger('focus')
947 }
948 }, this))
949 }
950
951 Modal.prototype.escape = function () {
952 if (this.isShown && this.options.keyboard) {
953 this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
954 e.which == 27 && this.hide()
955 }, this))
956 } else if (!this.isShown) {
957 this.$element.off('keyup.dismiss.bs.modal')
958 }
959 }
960
961 Modal.prototype.hideModal = function () {
962 var that = this
963 this.$element.hide()
964 this.backdrop(function () {
965 that.$element.trigger('hidden.bs.modal')
966 })
967 }
968
969 Modal.prototype.removeBackdrop = function () {
970 this.$backdrop && this.$backdrop.remove()
971 this.$backdrop = null
972 }
973
974 Modal.prototype.backdrop = function (callback) {
975 var that = this
976 var animate = this.$element.hasClass('fade') ? 'fade' : ''
977
978 if (this.isShown && this.options.backdrop) {
979 var doAnimate = $.support.transition && animate
980
981 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
982 .appendTo(this.$body)
983
984 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
985 if (e.target !== e.currentTarget) return
986 this.options.backdrop == 'static'
987 ? this.$element[0].focus.call(this.$element[0])
988 : this.hide.call(this)
989 }, this))
990
991 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
992
993 this.$backdrop.addClass('in')
994
995 if (!callback) return
996
997 doAnimate ?
998 this.$backdrop
999 .one('bsTransitionEnd', callback)
1000 .emulateTransitionEnd(150) :
1001 callback()
1002
1003 } else if (!this.isShown && this.$backdrop) {
1004 this.$backdrop.removeClass('in')
1005
1006 var callbackRemove = function () {
1007 that.removeBackdrop()
1008 callback && callback()
1009 }
1010 $.support.transition && this.$element.hasClass('fade') ?
1011 this.$backdrop
1012 .one('bsTransitionEnd', callbackRemove)
1013 .emulateTransitionEnd(150) :
1014 callbackRemove()
1015
1016 } else if (callback) {
1017 callback()
1018 }
1019 }
1020
1021 Modal.prototype.checkScrollbar = function () {
1022 if (document.body.clientWidth >= window.innerWidth) return
1023 this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
1024 }
1025
1026 Modal.prototype.setScrollbar = function () {
1027 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
1028 if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
1029 }
1030
1031 Modal.prototype.resetScrollbar = function () {
1032 this.$body.css('padding-right', '')
1033 }
1034
1035 Modal.prototype.measureScrollbar = function () { // thx walsh
1036 var scrollDiv = document.createElement('div')
1037 scrollDiv.className = 'modal-scrollbar-measure'
1038 this.$body.append(scrollDiv)
1039 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
1040 this.$body[0].removeChild(scrollDiv)
1041 return scrollbarWidth
1042 }
1043
1044
1045 // MODAL PLUGIN DEFINITION
1046 // =======================
1047
1048 function Plugin(option, _relatedTarget) {
1049 return this.each(function () {
1050 var $this = $(this)
1051 var data = $this.data('bs.modal')
1052 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
1053
1054 if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
1055 if (typeof option == 'string') data[option](_relatedTarget)
1056 else if (options.show) data.show(_relatedTarget)
1057 })
1058 }
1059
1060 var old = $.fn.modal
1061
1062 $.fn.modal = Plugin
1063 $.fn.modal.Constructor = Modal
1064
1065
1066 // MODAL NO CONFLICT
1067 // =================
1068
1069 $.fn.modal.noConflict = function () {
1070 $.fn.modal = old
1071 return this
1072 }
1073
1074
1075 // MODAL DATA-API
1076 // ==============
1077
1078 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
1079 var $this = $(this)
1080 var href = $this.attr('href')
1081 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
1082 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1083
1084 if ($this.is('a')) e.preventDefault()
1085
1086 $target.one('show.bs.modal', function (showEvent) {
1087 if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
1088 $target.one('hidden.bs.modal', function () {
1089 $this.is(':visible') && $this.trigger('focus')
1090 })
1091 })
1092 Plugin.call($target, option, this)
1093 })
1094
1095 }(rnJQuery);
1096
1097 /* ========================================================================
1098 * Bootstrap: tooltip.js v3.2.0
1099 * http://getbootstrap.com/javascript/#tooltip
1100 * Inspired by the original jQuery.tipsy by Jason Frame
1101 * ========================================================================
1102 * Copyright 2011-2014 Twitter, Inc.
1103 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1104 * ======================================================================== */
1105
1106
1107 +function ($) {
1108 'use strict';
1109
1110 // TOOLTIP PUBLIC CLASS DEFINITION
1111 // ===============================
1112
1113 var Tooltip = function (element, options) {
1114 this.type =
1115 this.options =
1116 this.enabled =
1117 this.timeout =
1118 this.hoverState =
1119 this.$element = null
1120
1121 this.init('tooltip', element, options)
1122 }
1123
1124 Tooltip.VERSION = '3.2.0'
1125
1126 Tooltip.DEFAULTS = {
1127 animation: true,
1128 placement: 'top',
1129 selector: false,
1130 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1131 trigger: 'hover focus',
1132 title: '',
1133 delay: 0,
1134 html: false,
1135 container: false,
1136 viewport: {
1137 selector: 'body',
1138 padding: 0
1139 }
1140 }
1141
1142 Tooltip.prototype.init = function (type, element, options) {
1143 this.enabled = true
1144 this.type = type
1145 this.$element = $(element)
1146 this.options = this.getOptions(options)
1147 this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
1148
1149 var triggers = this.options.trigger.split(' ')
1150
1151 for (var i = triggers.length; i--;) {
1152 var trigger = triggers[i]
1153
1154 if (trigger == 'click') {
1155 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1156 } else if (trigger != 'manual') {
1157 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
1158 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1159
1160 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1161 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1162 }
1163 }
1164
1165 this.options.selector ?
1166 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1167 this.fixTitle()
1168 }
1169
1170 Tooltip.prototype.getDefaults = function () {
1171 return Tooltip.DEFAULTS
1172 }
1173
1174 Tooltip.prototype.getOptions = function (options) {
1175 options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1176
1177 if (options.delay && typeof options.delay == 'number') {
1178 options.delay = {
1179 show: options.delay,
1180 hide: options.delay
1181 }
1182 }
1183
1184 return options
1185 }
1186
1187 Tooltip.prototype.getDelegateOptions = function () {
1188 var options = {}
1189 var defaults = this.getDefaults()
1190
1191 this._options && $.each(this._options, function (key, value) {
1192 if (defaults[key] != value) options[key] = value
1193 })
1194
1195 return options
1196 }
1197
1198 Tooltip.prototype.enter = function (obj) {
1199 var self = obj instanceof this.constructor ?
1200 obj : $(obj.currentTarget).data('bs.' + this.type)
1201
1202 if (!self) {
1203 self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1204 $(obj.currentTarget).data('bs.' + this.type, self)
1205 }
1206
1207 clearTimeout(self.timeout)
1208
1209 self.hoverState = 'in'
1210
1211 if (!self.options.delay || !self.options.delay.show) return self.show()
1212
1213 self.timeout = setTimeout(function () {
1214 if (self.hoverState == 'in') self.show()
1215 }, self.options.delay.show)
1216 }
1217
1218 Tooltip.prototype.leave = function (obj) {
1219 var self = obj instanceof this.constructor ?
1220 obj : $(obj.currentTarget).data('bs.' + this.type)
1221
1222 if (!self) {
1223 self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1224 $(obj.currentTarget).data('bs.' + this.type, self)
1225 }
1226
1227 clearTimeout(self.timeout)
1228
1229 self.hoverState = 'out'
1230
1231 if (!self.options.delay || !self.options.delay.hide) return self.hide()
1232
1233 self.timeout = setTimeout(function () {
1234 if (self.hoverState == 'out') self.hide()
1235 }, self.options.delay.hide)
1236 }
1237
1238 Tooltip.prototype.show = function () {
1239 var e = $.Event('show.bs.' + this.type)
1240
1241 if (this.hasContent() && this.enabled) {
1242 this.$element.trigger(e)
1243
1244 var inDom = $.contains(document.documentElement, this.$element[0])
1245 if (e.isDefaultPrevented() || !inDom) return
1246 var that = this
1247
1248 var $tip = this.tip()
1249
1250 var tipId = this.getUID(this.type)
1251
1252 this.setContent()
1253 $tip.attr('id', tipId)
1254 this.$element.attr('aria-describedby', tipId)
1255
1256 if (this.options.animation) $tip.addClass('fade')
1257
1258 var placement = typeof this.options.placement == 'function' ?
1259 this.options.placement.call(this, $tip[0], this.$element[0]) :
1260 this.options.placement
1261
1262 var autoToken = /\s?auto?\s?/i
1263 var autoPlace = autoToken.test(placement)
1264 if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
1265
1266 $tip
1267 .detach()
1268 .css({ top: 0, left: 0, display: 'block' })
1269 .addClass(placement)
1270 .data('bs.' + this.type, this)
1271
1272 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1273
1274 var pos = this.getPosition()
1275 var actualWidth = $tip[0].offsetWidth
1276 var actualHeight = $tip[0].offsetHeight
1277
1278 if (autoPlace) {
1279 var orgPlacement = placement
1280 var $parent = this.$element.parent()
1281 var parentDim = this.getPosition($parent)
1282
1283 placement = placement == 'bottom' && pos.top + pos.height + actualHeight - parentDim.scroll > parentDim.height ? 'top' :
1284 placement == 'top' && pos.top - parentDim.scroll - actualHeight < 0 ? 'bottom' :
1285 placement == 'right' && pos.right + actualWidth > parentDim.width ? 'left' :
1286 placement == 'left' && pos.left - actualWidth < parentDim.left ? 'right' :
1287 placement
1288
1289 $tip
1290 .removeClass(orgPlacement)
1291 .addClass(placement)
1292 }
1293
1294 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1295
1296 this.applyPlacement(calculatedOffset, placement)
1297
1298 var complete = function () {
1299 that.$element.trigger('shown.bs.' + that.type)
1300 that.hoverState = null
1301 }
1302
1303 $.support.transition && this.$tip.hasClass('fade') ?
1304 $tip
1305 .one('bsTransitionEnd', complete)
1306 .emulateTransitionEnd(150) :
1307 complete()
1308 }
1309 }
1310
1311 Tooltip.prototype.applyPlacement = function (offset, placement) {
1312 var $tip = this.tip()
1313 var width = $tip[0].offsetWidth
1314 var height = $tip[0].offsetHeight
1315
1316 // manually read margins because getBoundingClientRect includes difference
1317 var marginTop = parseInt($tip.css('margin-top'), 10)
1318 var marginLeft = parseInt($tip.css('margin-left'), 10)
1319
1320 // we must check for NaN for ie 8/9
1321 if (isNaN(marginTop)) marginTop = 0
1322 if (isNaN(marginLeft)) marginLeft = 0
1323
1324 offset.top = offset.top + marginTop
1325 offset.left = offset.left + marginLeft
1326
1327 // $.fn.offset doesn't round pixel values
1328 // so we use setOffset directly with our own function B-0
1329 $.offset.setOffset($tip[0], $.extend({
1330 using: function (props) {
1331 $tip.css({
1332 top: Math.round(props.top),
1333 left: Math.round(props.left)
1334 })
1335 }
1336 }, offset), 0)
1337
1338 $tip.addClass('in')
1339
1340 // check to see if placing tip in new offset caused the tip to resize itself
1341 var actualWidth = $tip[0].offsetWidth
1342 var actualHeight = $tip[0].offsetHeight
1343
1344 if (placement == 'top' && actualHeight != height) {
1345 offset.top = offset.top + height - actualHeight
1346 }
1347
1348 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
1349 delta.top=0
1350 if (delta.left) offset.left += delta.left
1351 else offset.top += delta.top
1352
1353 var arrowDelta = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
1354 var arrowPosition = delta.left ? 'left' : 'top'
1355 var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight'
1356
1357 $tip.offset(offset)
1358 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition)
1359 }
1360
1361 Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
1362 this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
1363 }
1364
1365 Tooltip.prototype.setContent = function () {
1366 var $tip = this.tip()
1367 var title = this.getTitle()
1368
1369 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1370 $tip.removeClass('fade in top bottom left right')
1371 }
1372
1373 Tooltip.prototype.hide = function () {
1374 var that = this
1375 var $tip = this.tip()
1376 var e = $.Event('hide.bs.' + this.type)
1377
1378 this.$element.removeAttr('aria-describedby')
1379
1380 function complete() {
1381 if (that.hoverState != 'in') $tip.detach()
1382 that.$element.trigger('hidden.bs.' + that.type)
1383 }
1384
1385 this.$element.trigger(e)
1386
1387 if (e.isDefaultPrevented()) return
1388
1389 $tip.removeClass('in')
1390
1391 $.support.transition && this.$tip.hasClass('fade') ?
1392 $tip
1393 .one('bsTransitionEnd', complete)
1394 .emulateTransitionEnd(150) :
1395 complete()
1396
1397 this.hoverState = null
1398
1399 return this
1400 }
1401
1402 Tooltip.prototype.fixTitle = function () {
1403 var $e = this.$element
1404 if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
1405 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1406 }
1407 }
1408
1409 Tooltip.prototype.hasContent = function () {
1410 return this.getTitle()
1411 }
1412
1413 Tooltip.prototype.getPosition = function ($element) {
1414 $element = $element || this.$element
1415 var el = $element[0]
1416 var isBody = el.tagName == 'BODY'
1417 return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
1418 scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
1419 width: isBody ? $(window).width() : $element.outerWidth(),
1420 height: isBody ? $(window).height() : $element.outerHeight()
1421 }, isBody ? { top: 0, left: 0 } : $element.offset())
1422 }
1423
1424 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1425 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1426 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1427 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1428 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
1429
1430 }
1431
1432 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
1433 var delta = { top: 0, left: 0 }
1434 if (!this.$viewport) return delta
1435
1436 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
1437 var viewportDimensions = this.getPosition(this.$viewport)
1438
1439 if (/right|left/.test(placement)) {
1440 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
1441 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
1442 if (topEdgeOffset < viewportDimensions.top) { // top overflow
1443 delta.top = viewportDimensions.top - topEdgeOffset
1444 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
1445 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
1446 }
1447 } else {
1448 var leftEdgeOffset = pos.left - viewportPadding
1449 var rightEdgeOffset = pos.left + viewportPadding + actualWidth
1450 if (leftEdgeOffset < viewportDimensions.left) { // left overflow
1451 delta.left = viewportDimensions.left - leftEdgeOffset
1452 } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
1453 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
1454 }
1455 }
1456
1457 return delta
1458 }
1459
1460 Tooltip.prototype.getTitle = function () {
1461 var title
1462 var $e = this.$element
1463 var o = this.options
1464
1465 title = $e.attr('data-original-title')
1466 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1467
1468 return title
1469 }
1470
1471 Tooltip.prototype.getUID = function (prefix) {
1472 do prefix += ~~(Math.random() * 1000000)
1473 while (document.getElementById(prefix))
1474 return prefix
1475 }
1476
1477 Tooltip.prototype.tip = function () {
1478 return (this.$tip = this.$tip || $(this.options.template))
1479 }
1480
1481 Tooltip.prototype.arrow = function () {
1482 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
1483 }
1484
1485 Tooltip.prototype.validate = function () {
1486 if (!this.$element[0].parentNode) {
1487 this.hide()
1488 this.$element = null
1489 this.options = null
1490 }
1491 }
1492
1493 Tooltip.prototype.enable = function () {
1494 this.enabled = true
1495 }
1496
1497 Tooltip.prototype.disable = function () {
1498 this.enabled = false
1499 }
1500
1501 Tooltip.prototype.toggleEnabled = function () {
1502 this.enabled = !this.enabled
1503 }
1504
1505 Tooltip.prototype.toggle = function (e) {
1506 var self = this
1507 if (e) {
1508 self = $(e.currentTarget).data('bs.' + this.type)
1509 if (!self) {
1510 self = new this.constructor(e.currentTarget, this.getDelegateOptions())
1511 $(e.currentTarget).data('bs.' + this.type, self)
1512 }
1513 }
1514
1515 self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1516 }
1517
1518 Tooltip.prototype.destroy = function () {
1519 clearTimeout(this.timeout)
1520 this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
1521 }
1522
1523
1524 // TOOLTIP PLUGIN DEFINITION
1525 // =========================
1526
1527 function Plugin(option) {
1528 return this.each(function () {
1529 var $this = $(this)
1530 var data = $this.data('bs.tooltip')
1531 var options = typeof option == 'object' && option
1532
1533 if (!data && option == 'destroy') return
1534 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1535 if (typeof option == 'string') data[option]()
1536 })
1537 }
1538
1539 var old = $.fn.tooltip
1540
1541 $.fn.tooltip = Plugin
1542 $.fn.tooltip.Constructor = Tooltip
1543
1544
1545 // TOOLTIP NO CONFLICT
1546 // ===================
1547
1548 $.fn.tooltip.noConflict = function () {
1549 $.fn.tooltip = old
1550 return this
1551 }
1552
1553 }(rnJQuery);
1554
1555
1556 +function ($) {
1557 'use strict';
1558
1559 // POPOVER PUBLIC CLASS DEFINITION
1560 // ===============================
1561
1562 var Popover = function (element, options) {
1563 this.init('popover', element, options)
1564 }
1565
1566 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1567
1568 Popover.VERSION = '3.2.0'
1569
1570 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1571 placement: 'right',
1572 trigger: 'click',
1573 content: '',
1574 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1575 })
1576
1577
1578 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
1579
1580 Popover.prototype.constructor = Popover
1581
1582 Popover.prototype.getDefaults = function () {
1583 return Popover.DEFAULTS
1584 }
1585
1586 Popover.prototype.setContent = function () {
1587 var $tip = this.tip()
1588 var title = this.getTitle()
1589 var content = this.getContent()
1590
1591 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1592 $tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
1593 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1594 ](content)
1595
1596 $tip.removeClass('fade top bottom left right in')
1597
1598 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1599 // this manually by checking the contents.
1600 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
1601 }
1602
1603 Popover.prototype.hasContent = function () {
1604 return this.getTitle() || this.getContent()
1605 }
1606
1607 Popover.prototype.getContent = function () {
1608 var $e = this.$element
1609 var o = this.options
1610
1611 return $e.attr('data-content')
1612 || (typeof o.content == 'function' ?
1613 o.content.call($e[0]) :
1614 o.content)
1615 }
1616
1617 Popover.prototype.arrow = function () {
1618 return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
1619 }
1620
1621 Popover.prototype.tip = function () {
1622 if (!this.$tip) this.$tip = $(this.options.template)
1623 return this.$tip
1624 }
1625
1626
1627 // POPOVER PLUGIN DEFINITION
1628 // =========================
1629
1630 function Plugin(option) {
1631 return this.each(function () {
1632 var $this = $(this)
1633 var data = $this.data('bs.popover')
1634 var options = typeof option == 'object' && option
1635
1636 if (!data && option == 'destroy') return
1637 if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1638 if (typeof option == 'string') data[option]()
1639 })
1640 }
1641
1642 var old = $.fn.popover
1643
1644 $.fn.popover = Plugin
1645 $.fn.popover.Constructor = Popover
1646
1647
1648 // POPOVER NO CONFLICT
1649 // ===================
1650
1651 $.fn.popover.noConflict = function () {
1652 $.fn.popover = old
1653 return this
1654 }
1655
1656 }(rnJQuery);
1657
1658 /* ========================================================================
1659 * Bootstrap: scrollspy.js v3.2.0
1660 * http://getbootstrap.com/javascript/#scrollspy
1661 * ========================================================================
1662 * Copyright 2011-2014 Twitter, Inc.
1663 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1664 * ======================================================================== */
1665
1666
1667 +function ($) {
1668 'use strict';
1669
1670 // SCROLLSPY CLASS DEFINITION
1671 // ==========================
1672
1673 function ScrollSpy(element, options) {
1674 var process = $.proxy(this.process, this)
1675
1676 this.$body = $('body')
1677 this.$scrollElement = $(element).is('body') ? $(window) : $(element)
1678 this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
1679 this.selector = (this.options.target || '') + ' .nav li > a'
1680 this.offsets = []
1681 this.targets = []
1682 this.activeTarget = null
1683 this.scrollHeight = 0
1684
1685 this.$scrollElement.on('scroll.bs.scrollspy', process)
1686 this.refresh()
1687 this.process()
1688 }
1689
1690 ScrollSpy.VERSION = '3.2.0'
1691
1692 ScrollSpy.DEFAULTS = {
1693 offset: 10
1694 }
1695
1696 ScrollSpy.prototype.getScrollHeight = function () {
1697 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
1698 }
1699
1700 ScrollSpy.prototype.refresh = function () {
1701 var offsetMethod = 'offset'
1702 var offsetBase = 0
1703
1704 if (!$.isWindow(this.$scrollElement[0])) {
1705 offsetMethod = 'position'
1706 offsetBase = this.$scrollElement.scrollTop()
1707 }
1708
1709 this.offsets = []
1710 this.targets = []
1711 this.scrollHeight = this.getScrollHeight()
1712
1713 var self = this
1714
1715 this.$body
1716 .find(this.selector)
1717 .map(function () {
1718 var $el = $(this)
1719 var href = $el.data('target') || $el.attr('href')
1720 var $href = /^#./.test(href) && $(href)
1721
1722 return ($href
1723 && $href.length
1724 && $href.is(':visible')
1725 && [[$href[offsetMethod]().top + offsetBase, href]]) || null
1726 })
1727 .sort(function (a, b) { return a[0] - b[0] })
1728 .each(function () {
1729 self.offsets.push(this[0])
1730 self.targets.push(this[1])
1731 })
1732 }
1733
1734 ScrollSpy.prototype.process = function () {
1735 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1736 var scrollHeight = this.getScrollHeight()
1737 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
1738 var offsets = this.offsets
1739 var targets = this.targets
1740 var activeTarget = this.activeTarget
1741 var i
1742
1743 if (this.scrollHeight != scrollHeight) {
1744 this.refresh()
1745 }
1746
1747 if (scrollTop >= maxScroll) {
1748 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1749 }
1750
1751 if (activeTarget && scrollTop <= offsets[0]) {
1752 return activeTarget != (i = targets[0]) && this.activate(i)
1753 }
1754
1755 for (i = offsets.length; i--;) {
1756 activeTarget != targets[i]
1757 && scrollTop >= offsets[i]
1758 && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1759 && this.activate(targets[i])
1760 }
1761 }
1762
1763 ScrollSpy.prototype.activate = function (target) {
1764 this.activeTarget = target
1765
1766 $(this.selector)
1767 .parentsUntil(this.options.target, '.active')
1768 .removeClass('active')
1769
1770 var selector = this.selector +
1771 '[data-target="' + target + '"],' +
1772 this.selector + '[href="' + target + '"]'
1773
1774 var active = $(selector)
1775 .parents('li')
1776 .addClass('active')
1777
1778 if (active.parent('.dropdown-menu').length) {
1779 active = active
1780 .closest('li.dropdown')
1781 .addClass('active')
1782 }
1783
1784 active.trigger('activate.bs.scrollspy')
1785 }
1786
1787
1788 // SCROLLSPY PLUGIN DEFINITION
1789 // ===========================
1790
1791 function Plugin(option) {
1792 return this.each(function () {
1793 var $this = $(this)
1794 var data = $this.data('bs.scrollspy')
1795 var options = typeof option == 'object' && option
1796
1797 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
1798 if (typeof option == 'string') data[option]()
1799 })
1800 }
1801
1802 var old = $.fn.scrollspy
1803
1804 $.fn.scrollspy = Plugin
1805 $.fn.scrollspy.Constructor = ScrollSpy
1806
1807
1808 // SCROLLSPY NO CONFLICT
1809 // =====================
1810
1811 $.fn.scrollspy.noConflict = function () {
1812 $.fn.scrollspy = old
1813 return this
1814 }
1815
1816
1817 // SCROLLSPY DATA-API
1818 // ==================
1819
1820 $(window).on('load.bs.scrollspy.data-api', function () {
1821 $('[data-spy="scroll"]').each(function () {
1822 var $spy = $(this)
1823 Plugin.call($spy, $spy.data())
1824 })
1825 })
1826
1827 }(rnJQuery);
1828
1829 /* ========================================================================
1830 * Bootstrap: tab.js v3.2.0
1831 * http://getbootstrap.com/javascript/#tabs
1832 * ========================================================================
1833 * Copyright 2011-2014 Twitter, Inc.
1834 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1835 * ======================================================================== */
1836
1837
1838 +function ($) {
1839 'use strict';
1840
1841 // TAB CLASS DEFINITION
1842 // ====================
1843
1844 var Tab = function (element) {
1845 this.element = $(element)
1846 }
1847
1848 Tab.VERSION = '3.2.0'
1849
1850 Tab.prototype.show = function () {
1851 var $this = this.element
1852 var $ul = $this.closest('ul:not(.dropdown-menu)')
1853 var selector = $this.data('target')
1854
1855 if (!selector) {
1856 selector = $this.attr('href')
1857 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
1858 }
1859
1860 if ($this.parent('li').hasClass('active')) return
1861
1862 var previous = $ul.find('.active:last a')[0]
1863 var e = $.Event('show.bs.tab', {
1864 relatedTarget: previous
1865 })
1866
1867 $this.trigger(e)
1868
1869 if (e.isDefaultPrevented()) return
1870
1871 var $target = $(selector)
1872
1873 this.activate($this.closest('li'), $ul)
1874 this.activate($target, $target.parent(), function () {
1875 $this.trigger({
1876 type: 'shown.bs.tab',
1877 relatedTarget: previous
1878 })
1879 })
1880 }
1881
1882 Tab.prototype.activate = function (element, container, callback) {
1883 var $active = container.find('> .active')
1884 var transition = callback
1885 && $.support.transition
1886 && $active.hasClass('fade')
1887
1888 function next() {
1889 $active
1890 .removeClass('active')
1891 .find('> .dropdown-menu > .active')
1892 .removeClass('active')
1893
1894 element.addClass('active')
1895
1896 if (transition) {
1897 element[0].offsetWidth // reflow for transition
1898 element.addClass('in')
1899 } else {
1900 element.removeClass('fade')
1901 }
1902
1903 if (element.parent('.dropdown-menu')) {
1904 element.closest('li.dropdown').addClass('active')
1905 }
1906
1907 callback && callback()
1908 }
1909
1910 transition ?
1911 $active
1912 .one('bsTransitionEnd', next)
1913 .emulateTransitionEnd(150) :
1914 next()
1915
1916 $active.removeClass('in')
1917 }
1918
1919
1920 // TAB PLUGIN DEFINITION
1921 // =====================
1922
1923 function Plugin(option) {
1924 return this.each(function () {
1925 var $this = $(this)
1926 var data = $this.data('bs.tab')
1927
1928 if (!data) $this.data('bs.tab', (data = new Tab(this)))
1929 if (typeof option == 'string') data[option]()
1930 })
1931 }
1932
1933 var old = $.fn.tab
1934
1935 $.fn.tab = Plugin
1936 $.fn.tab.Constructor = Tab
1937
1938
1939 // TAB NO CONFLICT
1940 // ===============
1941
1942 $.fn.tab.noConflict = function () {
1943 $.fn.tab = old
1944 return this
1945 }
1946
1947
1948 // TAB DATA-API
1949 // ============
1950
1951 $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1952 e.preventDefault()
1953 Plugin.call($(this), 'show')
1954 })
1955
1956 }(rnJQuery);
1957
1958 /* ========================================================================
1959 * Bootstrap: affix.js v3.2.0
1960 * http://getbootstrap.com/javascript/#affix
1961 * ========================================================================
1962 * Copyright 2011-2014 Twitter, Inc.
1963 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1964 * ======================================================================== */
1965
1966
1967 +function ($) {
1968 'use strict';
1969
1970 // AFFIX CLASS DEFINITION
1971 // ======================
1972
1973 var Affix = function (element, options) {
1974 this.options = $.extend({}, Affix.DEFAULTS, options)
1975
1976 this.$target = $(this.options.target)
1977 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
1978 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
1979
1980 this.$element = $(element)
1981 this.affixed =
1982 this.unpin =
1983 this.pinnedOffset = null
1984
1985 this.checkPosition()
1986 }
1987
1988 Affix.VERSION = '3.2.0'
1989
1990 Affix.RESET = 'affix affix-top affix-bottom'
1991
1992 Affix.DEFAULTS = {
1993 offset: 0,
1994 target: window
1995 }
1996
1997 Affix.prototype.getPinnedOffset = function () {
1998 if (this.pinnedOffset) return this.pinnedOffset
1999 this.$element.removeClass(Affix.RESET).addClass('affix')
2000 var scrollTop = this.$target.scrollTop()
2001 var position = this.$element.offset()
2002 return (this.pinnedOffset = position.top - scrollTop)
2003 }
2004
2005 Affix.prototype.checkPositionWithEventLoop = function () {
2006 setTimeout($.proxy(this.checkPosition, this), 1)
2007 }
2008
2009 Affix.prototype.checkPosition = function () {
2010 if (!this.$element.is(':visible')) return
2011
2012 var scrollHeight = $(document).height()
2013 var scrollTop = this.$target.scrollTop()
2014 var position = this.$element.offset()
2015 var offset = this.options.offset
2016 var offsetTop = offset.top
2017 var offsetBottom = offset.bottom
2018
2019 if (typeof offset != 'object') offsetBottom = offsetTop = offset
2020 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
2021 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
2022
2023 var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
2024 offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
2025 offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
2026
2027 if (this.affixed === affix) return
2028 if (this.unpin != null) this.$element.css('top', '')
2029
2030 var affixType = 'affix' + (affix ? '-' + affix : '')
2031 var e = $.Event(affixType + '.bs.affix')
2032
2033 this.$element.trigger(e)
2034
2035 if (e.isDefaultPrevented()) return
2036
2037 this.affixed = affix
2038 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
2039
2040 this.$element
2041 .removeClass(Affix.RESET)
2042 .addClass(affixType)
2043 .trigger($.Event(affixType.replace('affix', 'affixed')))
2044
2045 if (affix == 'bottom') {
2046 this.$element.offset({
2047 top: scrollHeight - this.$element.height() - offsetBottom
2048 })
2049 }
2050 }
2051
2052
2053 // AFFIX PLUGIN DEFINITION
2054 // =======================
2055
2056 function Plugin(option) {
2057 return this.each(function () {
2058 var $this = $(this)
2059 var data = $this.data('bs.affix')
2060 var options = typeof option == 'object' && option
2061
2062 if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
2063 if (typeof option == 'string') data[option]()
2064 })
2065 }
2066
2067 var old = $.fn.affix
2068
2069 $.fn.affix = Plugin
2070 $.fn.affix.Constructor = Affix
2071
2072
2073 // AFFIX NO CONFLICT
2074 // =================
2075
2076 $.fn.affix.noConflict = function () {
2077 $.fn.affix = old
2078 return this
2079 }
2080
2081
2082 // AFFIX DATA-API
2083 // ==============
2084
2085 $(window).on('load', function () {
2086 $('[data-spy="affix"]').each(function () {
2087 var $spy = $(this)
2088 var data = $spy.data()
2089
2090 data.offset = data.offset || {}
2091
2092 if (data.offsetBottom) data.offset.bottom = data.offsetBottom
2093 if (data.offsetTop) data.offset.top = data.offsetTop
2094
2095 Plugin.call($spy, data)
2096 })
2097 })
2098
2099 }(rnJQuery);
2100