bootstrap-intel-theme 0.1.4 → 0.1.5

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