mcloud 0.1.0

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