flipper-ui 0.12.2 → 0.13.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/ui/README.md +21 -3
- data/docs/ui/images/configured-ui.png +0 -0
- data/docs/ui/images/environment-banner.png +0 -0
- data/docs/ui/images/feature.png +0 -0
- data/docs/ui/images/features.png +0 -0
- data/lib/flipper/ui/assets/javascripts/application.coffee +3 -0
- data/lib/flipper/ui/assets/stylesheets/.DS_Store +0 -0
- data/lib/flipper/ui/assets/stylesheets/application.scss +9 -48
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_alert.scss +51 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_badge.scss +47 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumb.scss +38 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_button-group.scss +166 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_buttons.scss +78 -95
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_card.scss +270 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_carousel.scss +122 -200
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_close.scss +12 -14
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_code.scss +15 -28
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_custom-forms.scss +297 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_dropdown.scss +131 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_forms.scss +210 -455
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_functions.scss +86 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_grid.scss +29 -61
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_images.scss +42 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_input-group.scss +159 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_jumbotron.scss +8 -42
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_list-group.scss +64 -73
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_media.scss +3 -56
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_mixins.scss +21 -18
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_modal.scss +168 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_nav.scss +118 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_navbar.scss +203 -554
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_pagination.scss +58 -69
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_popover.scss +183 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_print.scss +71 -54
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_progress.scss +33 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_reboot.scss +482 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_root.scss +19 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_tables.scss +109 -163
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_tooltip.scss +97 -84
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_transitions.scss +36 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_type.scss +66 -239
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_utilities.scss +14 -55
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_variables.scss +726 -698
- data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap-grid.scss +32 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap-reboot.scss +12 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap.scss +42 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alert.scss +13 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_background-variant.scss +14 -4
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_badge.scss +12 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_border-radius.scss +25 -8
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +5 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +123 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_buttons.scss +89 -32
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_caret.scss +65 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_clearfix.scss +3 -18
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_float.scss +11 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_forms.scss +115 -66
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_gradients.scss +14 -27
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +52 -66
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid.scss +37 -107
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hover.scss +39 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_image.scss +18 -15
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_list-group.scss +10 -20
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_lists.scss +7 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +3 -3
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_navbar-align.scss +10 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_pagination.scss +10 -11
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-text.scss +17 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +35 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_size.scss +1 -5
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_table-row.scss +16 -14
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +7 -4
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-hide.scss +9 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/{_text-overflow.scss → _text-truncate.scss} +2 -2
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_transition.scss +9 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_visibility.scss +7 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_align.scss +8 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_background.scss +19 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_borders.scss +59 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_clearfix.scss +3 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_display.scss +38 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/{_responsive-embed.scss → utilities/_embed.scss} +26 -9
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_flex.scss +46 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_float.scss +9 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_position.scss +36 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +11 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_sizing.scss +12 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_spacing.scss +51 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_text.scss +52 -0
- data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_visibility.scss +11 -0
- data/lib/flipper/ui/configuration.rb +24 -0
- data/lib/flipper/ui/decorators/feature.rb +3 -3
- data/lib/flipper/ui/public/css/application.css +6237 -2339
- data/lib/flipper/ui/public/js/application.js +3 -2
- data/lib/flipper/ui/views/add_actor.erb +7 -9
- data/lib/flipper/ui/views/add_feature.erb +8 -10
- data/lib/flipper/ui/views/add_group.erb +7 -9
- data/lib/flipper/ui/views/feature.erb +181 -141
- data/lib/flipper/ui/views/feature_creation_disabled.erb +1 -1
- data/lib/flipper/ui/views/feature_removal_disabled.erb +1 -1
- data/lib/flipper/ui/views/features.erb +12 -15
- data/lib/flipper/ui/views/layout.erb +25 -15
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/ui/actions/actors_gate_spec.rb +2 -1
- data/spec/flipper/ui/actions/add_feature_spec.rb +2 -1
- data/spec/flipper/ui/actions/groups_gate_spec.rb +2 -1
- data/spec/flipper/ui/configuration_spec.rb +27 -0
- data/spec/flipper/ui_spec.rb +24 -0
- metadata +58 -64
- data/lib/flipper/ui/assets/stylesheets/_bootstrap-compass.scss +0 -9
- data/lib/flipper/ui/assets/stylesheets/_bootstrap-mincer.scss +0 -19
- data/lib/flipper/ui/assets/stylesheets/_bootstrap-sprockets.scss +0 -9
- data/lib/flipper/ui/assets/stylesheets/_bootstrap.scss +0 -50
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_alerts.scss +0 -73
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_badges.scss +0 -68
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumbs.scss +0 -26
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_button-groups.scss +0 -243
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_component-animations.scss +0 -37
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_dropdowns.scss +0 -214
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_glyphicons.scss +0 -305
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_input-groups.scss +0 -166
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_labels.scss +0 -66
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_modals.scss +0 -150
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_navs.scss +0 -242
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_normalize.scss +0 -427
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_pager.scss +0 -54
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_panels.scss +0 -265
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_popovers.scss +0 -135
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_progress-bars.scss +0 -87
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_responsive-utilities.scss +0 -177
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_scaffolding.scss +0 -162
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_theme.scss +0 -273
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_thumbnails.scss +0 -38
- data/lib/flipper/ui/assets/stylesheets/bootstrap/_wells.scss +0 -29
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alerts.scss +0 -14
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_center-block.scss +0 -7
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hide-text.scss +0 -21
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_labels.scss +0 -12
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -9
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_opacity.scss +0 -8
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_panels.scss +0 -24
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +0 -10
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -8
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -21
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -9
- data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +0 -222
- data/lib/flipper/ui/public/css/primer.css +0 -1
- data/lib/flipper/ui/public/css/primer/primer.css +0 -1933
- data/lib/flipper/ui/public/css/scss/primer.css +0 -1933
- data/lib/flipper/ui/public/js/bootstrap-sprockets.js +0 -12
- data/lib/flipper/ui/public/js/bootstrap.js +0 -2317
- data/lib/flipper/ui/public/js/bootstrap.min.js +0 -7
- data/lib/flipper/ui/public/js/bootstrap/affix.js +0 -162
- data/lib/flipper/ui/public/js/bootstrap/alert.js +0 -94
- data/lib/flipper/ui/public/js/bootstrap/button.js +0 -116
- data/lib/flipper/ui/public/js/bootstrap/carousel.js +0 -237
- data/lib/flipper/ui/public/js/bootstrap/collapse.js +0 -211
- data/lib/flipper/ui/public/js/bootstrap/dropdown.js +0 -161
- data/lib/flipper/ui/public/js/bootstrap/modal.js +0 -339
- data/lib/flipper/ui/public/js/bootstrap/popover.js +0 -108
- data/lib/flipper/ui/public/js/bootstrap/scrollspy.js +0 -172
- data/lib/flipper/ui/public/js/bootstrap/tab.js +0 -153
- data/lib/flipper/ui/public/js/bootstrap/tooltip.js +0 -476
- data/lib/flipper/ui/public/js/bootstrap/transition.js +0 -59
@@ -1,108 +0,0 @@
|
|
1
|
-
/* ========================================================================
|
2
|
-
* Bootstrap: popover.js v3.3.4
|
3
|
-
* http://getbootstrap.com/javascript/#popovers
|
4
|
-
* ========================================================================
|
5
|
-
* Copyright 2011-2015 Twitter, Inc.
|
6
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
-
* ======================================================================== */
|
8
|
-
|
9
|
-
|
10
|
-
+function ($) {
|
11
|
-
'use strict';
|
12
|
-
|
13
|
-
// POPOVER PUBLIC CLASS DEFINITION
|
14
|
-
// ===============================
|
15
|
-
|
16
|
-
var Popover = function (element, options) {
|
17
|
-
this.init('popover', element, options)
|
18
|
-
}
|
19
|
-
|
20
|
-
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
21
|
-
|
22
|
-
Popover.VERSION = '3.3.4'
|
23
|
-
|
24
|
-
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
25
|
-
placement: 'right',
|
26
|
-
trigger: 'click',
|
27
|
-
content: '',
|
28
|
-
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
29
|
-
})
|
30
|
-
|
31
|
-
|
32
|
-
// NOTE: POPOVER EXTENDS tooltip.js
|
33
|
-
// ================================
|
34
|
-
|
35
|
-
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
36
|
-
|
37
|
-
Popover.prototype.constructor = Popover
|
38
|
-
|
39
|
-
Popover.prototype.getDefaults = function () {
|
40
|
-
return Popover.DEFAULTS
|
41
|
-
}
|
42
|
-
|
43
|
-
Popover.prototype.setContent = function () {
|
44
|
-
var $tip = this.tip()
|
45
|
-
var title = this.getTitle()
|
46
|
-
var content = this.getContent()
|
47
|
-
|
48
|
-
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
49
|
-
$tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
|
50
|
-
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
51
|
-
](content)
|
52
|
-
|
53
|
-
$tip.removeClass('fade top bottom left right in')
|
54
|
-
|
55
|
-
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
56
|
-
// this manually by checking the contents.
|
57
|
-
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
58
|
-
}
|
59
|
-
|
60
|
-
Popover.prototype.hasContent = function () {
|
61
|
-
return this.getTitle() || this.getContent()
|
62
|
-
}
|
63
|
-
|
64
|
-
Popover.prototype.getContent = function () {
|
65
|
-
var $e = this.$element
|
66
|
-
var o = this.options
|
67
|
-
|
68
|
-
return $e.attr('data-content')
|
69
|
-
|| (typeof o.content == 'function' ?
|
70
|
-
o.content.call($e[0]) :
|
71
|
-
o.content)
|
72
|
-
}
|
73
|
-
|
74
|
-
Popover.prototype.arrow = function () {
|
75
|
-
return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
|
76
|
-
}
|
77
|
-
|
78
|
-
|
79
|
-
// POPOVER PLUGIN DEFINITION
|
80
|
-
// =========================
|
81
|
-
|
82
|
-
function Plugin(option) {
|
83
|
-
return this.each(function () {
|
84
|
-
var $this = $(this)
|
85
|
-
var data = $this.data('bs.popover')
|
86
|
-
var options = typeof option == 'object' && option
|
87
|
-
|
88
|
-
if (!data && /destroy|hide/.test(option)) return
|
89
|
-
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
90
|
-
if (typeof option == 'string') data[option]()
|
91
|
-
})
|
92
|
-
}
|
93
|
-
|
94
|
-
var old = $.fn.popover
|
95
|
-
|
96
|
-
$.fn.popover = Plugin
|
97
|
-
$.fn.popover.Constructor = Popover
|
98
|
-
|
99
|
-
|
100
|
-
// POPOVER NO CONFLICT
|
101
|
-
// ===================
|
102
|
-
|
103
|
-
$.fn.popover.noConflict = function () {
|
104
|
-
$.fn.popover = old
|
105
|
-
return this
|
106
|
-
}
|
107
|
-
|
108
|
-
}(jQuery);
|
@@ -1,172 +0,0 @@
|
|
1
|
-
/* ========================================================================
|
2
|
-
* Bootstrap: scrollspy.js v3.3.4
|
3
|
-
* http://getbootstrap.com/javascript/#scrollspy
|
4
|
-
* ========================================================================
|
5
|
-
* Copyright 2011-2015 Twitter, Inc.
|
6
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
-
* ======================================================================== */
|
8
|
-
|
9
|
-
|
10
|
-
+function ($) {
|
11
|
-
'use strict';
|
12
|
-
|
13
|
-
// SCROLLSPY CLASS DEFINITION
|
14
|
-
// ==========================
|
15
|
-
|
16
|
-
function ScrollSpy(element, options) {
|
17
|
-
this.$body = $(document.body)
|
18
|
-
this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
|
19
|
-
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
20
|
-
this.selector = (this.options.target || '') + ' .nav li > a'
|
21
|
-
this.offsets = []
|
22
|
-
this.targets = []
|
23
|
-
this.activeTarget = null
|
24
|
-
this.scrollHeight = 0
|
25
|
-
|
26
|
-
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
|
27
|
-
this.refresh()
|
28
|
-
this.process()
|
29
|
-
}
|
30
|
-
|
31
|
-
ScrollSpy.VERSION = '3.3.4'
|
32
|
-
|
33
|
-
ScrollSpy.DEFAULTS = {
|
34
|
-
offset: 10
|
35
|
-
}
|
36
|
-
|
37
|
-
ScrollSpy.prototype.getScrollHeight = function () {
|
38
|
-
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
|
39
|
-
}
|
40
|
-
|
41
|
-
ScrollSpy.prototype.refresh = function () {
|
42
|
-
var that = this
|
43
|
-
var offsetMethod = 'offset'
|
44
|
-
var offsetBase = 0
|
45
|
-
|
46
|
-
this.offsets = []
|
47
|
-
this.targets = []
|
48
|
-
this.scrollHeight = this.getScrollHeight()
|
49
|
-
|
50
|
-
if (!$.isWindow(this.$scrollElement[0])) {
|
51
|
-
offsetMethod = 'position'
|
52
|
-
offsetBase = this.$scrollElement.scrollTop()
|
53
|
-
}
|
54
|
-
|
55
|
-
this.$body
|
56
|
-
.find(this.selector)
|
57
|
-
.map(function () {
|
58
|
-
var $el = $(this)
|
59
|
-
var href = $el.data('target') || $el.attr('href')
|
60
|
-
var $href = /^#./.test(href) && $(href)
|
61
|
-
|
62
|
-
return ($href
|
63
|
-
&& $href.length
|
64
|
-
&& $href.is(':visible')
|
65
|
-
&& [[$href[offsetMethod]().top + offsetBase, href]]) || null
|
66
|
-
})
|
67
|
-
.sort(function (a, b) { return a[0] - b[0] })
|
68
|
-
.each(function () {
|
69
|
-
that.offsets.push(this[0])
|
70
|
-
that.targets.push(this[1])
|
71
|
-
})
|
72
|
-
}
|
73
|
-
|
74
|
-
ScrollSpy.prototype.process = function () {
|
75
|
-
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
76
|
-
var scrollHeight = this.getScrollHeight()
|
77
|
-
var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
|
78
|
-
var offsets = this.offsets
|
79
|
-
var targets = this.targets
|
80
|
-
var activeTarget = this.activeTarget
|
81
|
-
var i
|
82
|
-
|
83
|
-
if (this.scrollHeight != scrollHeight) {
|
84
|
-
this.refresh()
|
85
|
-
}
|
86
|
-
|
87
|
-
if (scrollTop >= maxScroll) {
|
88
|
-
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
|
89
|
-
}
|
90
|
-
|
91
|
-
if (activeTarget && scrollTop < offsets[0]) {
|
92
|
-
this.activeTarget = null
|
93
|
-
return this.clear()
|
94
|
-
}
|
95
|
-
|
96
|
-
for (i = offsets.length; i--;) {
|
97
|
-
activeTarget != targets[i]
|
98
|
-
&& scrollTop >= offsets[i]
|
99
|
-
&& (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
|
100
|
-
&& this.activate(targets[i])
|
101
|
-
}
|
102
|
-
}
|
103
|
-
|
104
|
-
ScrollSpy.prototype.activate = function (target) {
|
105
|
-
this.activeTarget = target
|
106
|
-
|
107
|
-
this.clear()
|
108
|
-
|
109
|
-
var selector = this.selector +
|
110
|
-
'[data-target="' + target + '"],' +
|
111
|
-
this.selector + '[href="' + target + '"]'
|
112
|
-
|
113
|
-
var active = $(selector)
|
114
|
-
.parents('li')
|
115
|
-
.addClass('active')
|
116
|
-
|
117
|
-
if (active.parent('.dropdown-menu').length) {
|
118
|
-
active = active
|
119
|
-
.closest('li.dropdown')
|
120
|
-
.addClass('active')
|
121
|
-
}
|
122
|
-
|
123
|
-
active.trigger('activate.bs.scrollspy')
|
124
|
-
}
|
125
|
-
|
126
|
-
ScrollSpy.prototype.clear = function () {
|
127
|
-
$(this.selector)
|
128
|
-
.parentsUntil(this.options.target, '.active')
|
129
|
-
.removeClass('active')
|
130
|
-
}
|
131
|
-
|
132
|
-
|
133
|
-
// SCROLLSPY PLUGIN DEFINITION
|
134
|
-
// ===========================
|
135
|
-
|
136
|
-
function Plugin(option) {
|
137
|
-
return this.each(function () {
|
138
|
-
var $this = $(this)
|
139
|
-
var data = $this.data('bs.scrollspy')
|
140
|
-
var options = typeof option == 'object' && option
|
141
|
-
|
142
|
-
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
143
|
-
if (typeof option == 'string') data[option]()
|
144
|
-
})
|
145
|
-
}
|
146
|
-
|
147
|
-
var old = $.fn.scrollspy
|
148
|
-
|
149
|
-
$.fn.scrollspy = Plugin
|
150
|
-
$.fn.scrollspy.Constructor = ScrollSpy
|
151
|
-
|
152
|
-
|
153
|
-
// SCROLLSPY NO CONFLICT
|
154
|
-
// =====================
|
155
|
-
|
156
|
-
$.fn.scrollspy.noConflict = function () {
|
157
|
-
$.fn.scrollspy = old
|
158
|
-
return this
|
159
|
-
}
|
160
|
-
|
161
|
-
|
162
|
-
// SCROLLSPY DATA-API
|
163
|
-
// ==================
|
164
|
-
|
165
|
-
$(window).on('load.bs.scrollspy.data-api', function () {
|
166
|
-
$('[data-spy="scroll"]').each(function () {
|
167
|
-
var $spy = $(this)
|
168
|
-
Plugin.call($spy, $spy.data())
|
169
|
-
})
|
170
|
-
})
|
171
|
-
|
172
|
-
}(jQuery);
|
@@ -1,153 +0,0 @@
|
|
1
|
-
/* ========================================================================
|
2
|
-
* Bootstrap: tab.js v3.3.4
|
3
|
-
* http://getbootstrap.com/javascript/#tabs
|
4
|
-
* ========================================================================
|
5
|
-
* Copyright 2011-2015 Twitter, Inc.
|
6
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
-
* ======================================================================== */
|
8
|
-
|
9
|
-
|
10
|
-
+function ($) {
|
11
|
-
'use strict';
|
12
|
-
|
13
|
-
// TAB CLASS DEFINITION
|
14
|
-
// ====================
|
15
|
-
|
16
|
-
var Tab = function (element) {
|
17
|
-
this.element = $(element)
|
18
|
-
}
|
19
|
-
|
20
|
-
Tab.VERSION = '3.3.4'
|
21
|
-
|
22
|
-
Tab.TRANSITION_DURATION = 150
|
23
|
-
|
24
|
-
Tab.prototype.show = function () {
|
25
|
-
var $this = this.element
|
26
|
-
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
27
|
-
var selector = $this.data('target')
|
28
|
-
|
29
|
-
if (!selector) {
|
30
|
-
selector = $this.attr('href')
|
31
|
-
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
32
|
-
}
|
33
|
-
|
34
|
-
if ($this.parent('li').hasClass('active')) return
|
35
|
-
|
36
|
-
var $previous = $ul.find('.active:last a')
|
37
|
-
var hideEvent = $.Event('hide.bs.tab', {
|
38
|
-
relatedTarget: $this[0]
|
39
|
-
})
|
40
|
-
var showEvent = $.Event('show.bs.tab', {
|
41
|
-
relatedTarget: $previous[0]
|
42
|
-
})
|
43
|
-
|
44
|
-
$previous.trigger(hideEvent)
|
45
|
-
$this.trigger(showEvent)
|
46
|
-
|
47
|
-
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
|
48
|
-
|
49
|
-
var $target = $(selector)
|
50
|
-
|
51
|
-
this.activate($this.closest('li'), $ul)
|
52
|
-
this.activate($target, $target.parent(), function () {
|
53
|
-
$previous.trigger({
|
54
|
-
type: 'hidden.bs.tab',
|
55
|
-
relatedTarget: $this[0]
|
56
|
-
})
|
57
|
-
$this.trigger({
|
58
|
-
type: 'shown.bs.tab',
|
59
|
-
relatedTarget: $previous[0]
|
60
|
-
})
|
61
|
-
})
|
62
|
-
}
|
63
|
-
|
64
|
-
Tab.prototype.activate = function (element, container, callback) {
|
65
|
-
var $active = container.find('> .active')
|
66
|
-
var transition = callback
|
67
|
-
&& $.support.transition
|
68
|
-
&& (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
|
69
|
-
|
70
|
-
function next() {
|
71
|
-
$active
|
72
|
-
.removeClass('active')
|
73
|
-
.find('> .dropdown-menu > .active')
|
74
|
-
.removeClass('active')
|
75
|
-
.end()
|
76
|
-
.find('[data-toggle="tab"]')
|
77
|
-
.attr('aria-expanded', false)
|
78
|
-
|
79
|
-
element
|
80
|
-
.addClass('active')
|
81
|
-
.find('[data-toggle="tab"]')
|
82
|
-
.attr('aria-expanded', true)
|
83
|
-
|
84
|
-
if (transition) {
|
85
|
-
element[0].offsetWidth // reflow for transition
|
86
|
-
element.addClass('in')
|
87
|
-
} else {
|
88
|
-
element.removeClass('fade')
|
89
|
-
}
|
90
|
-
|
91
|
-
if (element.parent('.dropdown-menu').length) {
|
92
|
-
element
|
93
|
-
.closest('li.dropdown')
|
94
|
-
.addClass('active')
|
95
|
-
.end()
|
96
|
-
.find('[data-toggle="tab"]')
|
97
|
-
.attr('aria-expanded', true)
|
98
|
-
}
|
99
|
-
|
100
|
-
callback && callback()
|
101
|
-
}
|
102
|
-
|
103
|
-
$active.length && transition ?
|
104
|
-
$active
|
105
|
-
.one('bsTransitionEnd', next)
|
106
|
-
.emulateTransitionEnd(Tab.TRANSITION_DURATION) :
|
107
|
-
next()
|
108
|
-
|
109
|
-
$active.removeClass('in')
|
110
|
-
}
|
111
|
-
|
112
|
-
|
113
|
-
// TAB PLUGIN DEFINITION
|
114
|
-
// =====================
|
115
|
-
|
116
|
-
function Plugin(option) {
|
117
|
-
return this.each(function () {
|
118
|
-
var $this = $(this)
|
119
|
-
var data = $this.data('bs.tab')
|
120
|
-
|
121
|
-
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
122
|
-
if (typeof option == 'string') data[option]()
|
123
|
-
})
|
124
|
-
}
|
125
|
-
|
126
|
-
var old = $.fn.tab
|
127
|
-
|
128
|
-
$.fn.tab = Plugin
|
129
|
-
$.fn.tab.Constructor = Tab
|
130
|
-
|
131
|
-
|
132
|
-
// TAB NO CONFLICT
|
133
|
-
// ===============
|
134
|
-
|
135
|
-
$.fn.tab.noConflict = function () {
|
136
|
-
$.fn.tab = old
|
137
|
-
return this
|
138
|
-
}
|
139
|
-
|
140
|
-
|
141
|
-
// TAB DATA-API
|
142
|
-
// ============
|
143
|
-
|
144
|
-
var clickHandler = function (e) {
|
145
|
-
e.preventDefault()
|
146
|
-
Plugin.call($(this), 'show')
|
147
|
-
}
|
148
|
-
|
149
|
-
$(document)
|
150
|
-
.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
|
151
|
-
.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
|
152
|
-
|
153
|
-
}(jQuery);
|
@@ -1,476 +0,0 @@
|
|
1
|
-
/* ========================================================================
|
2
|
-
* Bootstrap: tooltip.js v3.3.4
|
3
|
-
* http://getbootstrap.com/javascript/#tooltip
|
4
|
-
* Inspired by the original jQuery.tipsy by Jason Frame
|
5
|
-
* ========================================================================
|
6
|
-
* Copyright 2011-2015 Twitter, Inc.
|
7
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
8
|
-
* ======================================================================== */
|
9
|
-
|
10
|
-
|
11
|
-
+function ($) {
|
12
|
-
'use strict';
|
13
|
-
|
14
|
-
// TOOLTIP PUBLIC CLASS DEFINITION
|
15
|
-
// ===============================
|
16
|
-
|
17
|
-
var Tooltip = function (element, options) {
|
18
|
-
this.type = null
|
19
|
-
this.options = null
|
20
|
-
this.enabled = null
|
21
|
-
this.timeout = null
|
22
|
-
this.hoverState = null
|
23
|
-
this.$element = null
|
24
|
-
|
25
|
-
this.init('tooltip', element, options)
|
26
|
-
}
|
27
|
-
|
28
|
-
Tooltip.VERSION = '3.3.4'
|
29
|
-
|
30
|
-
Tooltip.TRANSITION_DURATION = 150
|
31
|
-
|
32
|
-
Tooltip.DEFAULTS = {
|
33
|
-
animation: true,
|
34
|
-
placement: 'top',
|
35
|
-
selector: false,
|
36
|
-
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
37
|
-
trigger: 'hover focus',
|
38
|
-
title: '',
|
39
|
-
delay: 0,
|
40
|
-
html: false,
|
41
|
-
container: false,
|
42
|
-
viewport: {
|
43
|
-
selector: 'body',
|
44
|
-
padding: 0
|
45
|
-
}
|
46
|
-
}
|
47
|
-
|
48
|
-
Tooltip.prototype.init = function (type, element, options) {
|
49
|
-
this.enabled = true
|
50
|
-
this.type = type
|
51
|
-
this.$element = $(element)
|
52
|
-
this.options = this.getOptions(options)
|
53
|
-
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
|
54
|
-
|
55
|
-
if (this.$element[0] instanceof document.constructor && !this.options.selector) {
|
56
|
-
throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
|
57
|
-
}
|
58
|
-
|
59
|
-
var triggers = this.options.trigger.split(' ')
|
60
|
-
|
61
|
-
for (var i = triggers.length; i--;) {
|
62
|
-
var trigger = triggers[i]
|
63
|
-
|
64
|
-
if (trigger == 'click') {
|
65
|
-
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
66
|
-
} else if (trigger != 'manual') {
|
67
|
-
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
68
|
-
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
69
|
-
|
70
|
-
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
71
|
-
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
this.options.selector ?
|
76
|
-
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
77
|
-
this.fixTitle()
|
78
|
-
}
|
79
|
-
|
80
|
-
Tooltip.prototype.getDefaults = function () {
|
81
|
-
return Tooltip.DEFAULTS
|
82
|
-
}
|
83
|
-
|
84
|
-
Tooltip.prototype.getOptions = function (options) {
|
85
|
-
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
86
|
-
|
87
|
-
if (options.delay && typeof options.delay == 'number') {
|
88
|
-
options.delay = {
|
89
|
-
show: options.delay,
|
90
|
-
hide: options.delay
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
return options
|
95
|
-
}
|
96
|
-
|
97
|
-
Tooltip.prototype.getDelegateOptions = function () {
|
98
|
-
var options = {}
|
99
|
-
var defaults = this.getDefaults()
|
100
|
-
|
101
|
-
this._options && $.each(this._options, function (key, value) {
|
102
|
-
if (defaults[key] != value) options[key] = value
|
103
|
-
})
|
104
|
-
|
105
|
-
return options
|
106
|
-
}
|
107
|
-
|
108
|
-
Tooltip.prototype.enter = function (obj) {
|
109
|
-
var self = obj instanceof this.constructor ?
|
110
|
-
obj : $(obj.currentTarget).data('bs.' + this.type)
|
111
|
-
|
112
|
-
if (self && self.$tip && self.$tip.is(':visible')) {
|
113
|
-
self.hoverState = 'in'
|
114
|
-
return
|
115
|
-
}
|
116
|
-
|
117
|
-
if (!self) {
|
118
|
-
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
119
|
-
$(obj.currentTarget).data('bs.' + this.type, self)
|
120
|
-
}
|
121
|
-
|
122
|
-
clearTimeout(self.timeout)
|
123
|
-
|
124
|
-
self.hoverState = 'in'
|
125
|
-
|
126
|
-
if (!self.options.delay || !self.options.delay.show) return self.show()
|
127
|
-
|
128
|
-
self.timeout = setTimeout(function () {
|
129
|
-
if (self.hoverState == 'in') self.show()
|
130
|
-
}, self.options.delay.show)
|
131
|
-
}
|
132
|
-
|
133
|
-
Tooltip.prototype.leave = function (obj) {
|
134
|
-
var self = obj instanceof this.constructor ?
|
135
|
-
obj : $(obj.currentTarget).data('bs.' + this.type)
|
136
|
-
|
137
|
-
if (!self) {
|
138
|
-
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
139
|
-
$(obj.currentTarget).data('bs.' + this.type, self)
|
140
|
-
}
|
141
|
-
|
142
|
-
clearTimeout(self.timeout)
|
143
|
-
|
144
|
-
self.hoverState = 'out'
|
145
|
-
|
146
|
-
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
147
|
-
|
148
|
-
self.timeout = setTimeout(function () {
|
149
|
-
if (self.hoverState == 'out') self.hide()
|
150
|
-
}, self.options.delay.hide)
|
151
|
-
}
|
152
|
-
|
153
|
-
Tooltip.prototype.show = function () {
|
154
|
-
var e = $.Event('show.bs.' + this.type)
|
155
|
-
|
156
|
-
if (this.hasContent() && this.enabled) {
|
157
|
-
this.$element.trigger(e)
|
158
|
-
|
159
|
-
var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
|
160
|
-
if (e.isDefaultPrevented() || !inDom) return
|
161
|
-
var that = this
|
162
|
-
|
163
|
-
var $tip = this.tip()
|
164
|
-
|
165
|
-
var tipId = this.getUID(this.type)
|
166
|
-
|
167
|
-
this.setContent()
|
168
|
-
$tip.attr('id', tipId)
|
169
|
-
this.$element.attr('aria-describedby', tipId)
|
170
|
-
|
171
|
-
if (this.options.animation) $tip.addClass('fade')
|
172
|
-
|
173
|
-
var placement = typeof this.options.placement == 'function' ?
|
174
|
-
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
175
|
-
this.options.placement
|
176
|
-
|
177
|
-
var autoToken = /\s?auto?\s?/i
|
178
|
-
var autoPlace = autoToken.test(placement)
|
179
|
-
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
180
|
-
|
181
|
-
$tip
|
182
|
-
.detach()
|
183
|
-
.css({ top: 0, left: 0, display: 'block' })
|
184
|
-
.addClass(placement)
|
185
|
-
.data('bs.' + this.type, this)
|
186
|
-
|
187
|
-
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
188
|
-
|
189
|
-
var pos = this.getPosition()
|
190
|
-
var actualWidth = $tip[0].offsetWidth
|
191
|
-
var actualHeight = $tip[0].offsetHeight
|
192
|
-
|
193
|
-
if (autoPlace) {
|
194
|
-
var orgPlacement = placement
|
195
|
-
var $container = this.options.container ? $(this.options.container) : this.$element.parent()
|
196
|
-
var containerDim = this.getPosition($container)
|
197
|
-
|
198
|
-
placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
|
199
|
-
placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
|
200
|
-
placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
|
201
|
-
placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
|
202
|
-
placement
|
203
|
-
|
204
|
-
$tip
|
205
|
-
.removeClass(orgPlacement)
|
206
|
-
.addClass(placement)
|
207
|
-
}
|
208
|
-
|
209
|
-
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
210
|
-
|
211
|
-
this.applyPlacement(calculatedOffset, placement)
|
212
|
-
|
213
|
-
var complete = function () {
|
214
|
-
var prevHoverState = that.hoverState
|
215
|
-
that.$element.trigger('shown.bs.' + that.type)
|
216
|
-
that.hoverState = null
|
217
|
-
|
218
|
-
if (prevHoverState == 'out') that.leave(that)
|
219
|
-
}
|
220
|
-
|
221
|
-
$.support.transition && this.$tip.hasClass('fade') ?
|
222
|
-
$tip
|
223
|
-
.one('bsTransitionEnd', complete)
|
224
|
-
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
225
|
-
complete()
|
226
|
-
}
|
227
|
-
}
|
228
|
-
|
229
|
-
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
230
|
-
var $tip = this.tip()
|
231
|
-
var width = $tip[0].offsetWidth
|
232
|
-
var height = $tip[0].offsetHeight
|
233
|
-
|
234
|
-
// manually read margins because getBoundingClientRect includes difference
|
235
|
-
var marginTop = parseInt($tip.css('margin-top'), 10)
|
236
|
-
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
237
|
-
|
238
|
-
// we must check for NaN for ie 8/9
|
239
|
-
if (isNaN(marginTop)) marginTop = 0
|
240
|
-
if (isNaN(marginLeft)) marginLeft = 0
|
241
|
-
|
242
|
-
offset.top = offset.top + marginTop
|
243
|
-
offset.left = offset.left + marginLeft
|
244
|
-
|
245
|
-
// $.fn.offset doesn't round pixel values
|
246
|
-
// so we use setOffset directly with our own function B-0
|
247
|
-
$.offset.setOffset($tip[0], $.extend({
|
248
|
-
using: function (props) {
|
249
|
-
$tip.css({
|
250
|
-
top: Math.round(props.top),
|
251
|
-
left: Math.round(props.left)
|
252
|
-
})
|
253
|
-
}
|
254
|
-
}, offset), 0)
|
255
|
-
|
256
|
-
$tip.addClass('in')
|
257
|
-
|
258
|
-
// check to see if placing tip in new offset caused the tip to resize itself
|
259
|
-
var actualWidth = $tip[0].offsetWidth
|
260
|
-
var actualHeight = $tip[0].offsetHeight
|
261
|
-
|
262
|
-
if (placement == 'top' && actualHeight != height) {
|
263
|
-
offset.top = offset.top + height - actualHeight
|
264
|
-
}
|
265
|
-
|
266
|
-
var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
|
267
|
-
|
268
|
-
if (delta.left) offset.left += delta.left
|
269
|
-
else offset.top += delta.top
|
270
|
-
|
271
|
-
var isVertical = /top|bottom/.test(placement)
|
272
|
-
var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
|
273
|
-
var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
|
274
|
-
|
275
|
-
$tip.offset(offset)
|
276
|
-
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
|
277
|
-
}
|
278
|
-
|
279
|
-
Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
|
280
|
-
this.arrow()
|
281
|
-
.css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
|
282
|
-
.css(isVertical ? 'top' : 'left', '')
|
283
|
-
}
|
284
|
-
|
285
|
-
Tooltip.prototype.setContent = function () {
|
286
|
-
var $tip = this.tip()
|
287
|
-
var title = this.getTitle()
|
288
|
-
|
289
|
-
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
290
|
-
$tip.removeClass('fade in top bottom left right')
|
291
|
-
}
|
292
|
-
|
293
|
-
Tooltip.prototype.hide = function (callback) {
|
294
|
-
var that = this
|
295
|
-
var $tip = $(this.$tip)
|
296
|
-
var e = $.Event('hide.bs.' + this.type)
|
297
|
-
|
298
|
-
function complete() {
|
299
|
-
if (that.hoverState != 'in') $tip.detach()
|
300
|
-
that.$element
|
301
|
-
.removeAttr('aria-describedby')
|
302
|
-
.trigger('hidden.bs.' + that.type)
|
303
|
-
callback && callback()
|
304
|
-
}
|
305
|
-
|
306
|
-
this.$element.trigger(e)
|
307
|
-
|
308
|
-
if (e.isDefaultPrevented()) return
|
309
|
-
|
310
|
-
$tip.removeClass('in')
|
311
|
-
|
312
|
-
$.support.transition && $tip.hasClass('fade') ?
|
313
|
-
$tip
|
314
|
-
.one('bsTransitionEnd', complete)
|
315
|
-
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
316
|
-
complete()
|
317
|
-
|
318
|
-
this.hoverState = null
|
319
|
-
|
320
|
-
return this
|
321
|
-
}
|
322
|
-
|
323
|
-
Tooltip.prototype.fixTitle = function () {
|
324
|
-
var $e = this.$element
|
325
|
-
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
|
326
|
-
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
327
|
-
}
|
328
|
-
}
|
329
|
-
|
330
|
-
Tooltip.prototype.hasContent = function () {
|
331
|
-
return this.getTitle()
|
332
|
-
}
|
333
|
-
|
334
|
-
Tooltip.prototype.getPosition = function ($element) {
|
335
|
-
$element = $element || this.$element
|
336
|
-
|
337
|
-
var el = $element[0]
|
338
|
-
var isBody = el.tagName == 'BODY'
|
339
|
-
|
340
|
-
var elRect = el.getBoundingClientRect()
|
341
|
-
if (elRect.width == null) {
|
342
|
-
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
343
|
-
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
|
344
|
-
}
|
345
|
-
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
|
346
|
-
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
347
|
-
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
348
|
-
|
349
|
-
return $.extend({}, elRect, scroll, outerDims, elOffset)
|
350
|
-
}
|
351
|
-
|
352
|
-
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
353
|
-
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
354
|
-
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
355
|
-
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
356
|
-
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
357
|
-
|
358
|
-
}
|
359
|
-
|
360
|
-
Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
|
361
|
-
var delta = { top: 0, left: 0 }
|
362
|
-
if (!this.$viewport) return delta
|
363
|
-
|
364
|
-
var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
|
365
|
-
var viewportDimensions = this.getPosition(this.$viewport)
|
366
|
-
|
367
|
-
if (/right|left/.test(placement)) {
|
368
|
-
var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
|
369
|
-
var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
|
370
|
-
if (topEdgeOffset < viewportDimensions.top) { // top overflow
|
371
|
-
delta.top = viewportDimensions.top - topEdgeOffset
|
372
|
-
} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
|
373
|
-
delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
|
374
|
-
}
|
375
|
-
} else {
|
376
|
-
var leftEdgeOffset = pos.left - viewportPadding
|
377
|
-
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
|
378
|
-
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
|
379
|
-
delta.left = viewportDimensions.left - leftEdgeOffset
|
380
|
-
} else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
|
381
|
-
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
|
382
|
-
}
|
383
|
-
}
|
384
|
-
|
385
|
-
return delta
|
386
|
-
}
|
387
|
-
|
388
|
-
Tooltip.prototype.getTitle = function () {
|
389
|
-
var title
|
390
|
-
var $e = this.$element
|
391
|
-
var o = this.options
|
392
|
-
|
393
|
-
title = $e.attr('data-original-title')
|
394
|
-
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
395
|
-
|
396
|
-
return title
|
397
|
-
}
|
398
|
-
|
399
|
-
Tooltip.prototype.getUID = function (prefix) {
|
400
|
-
do prefix += ~~(Math.random() * 1000000)
|
401
|
-
while (document.getElementById(prefix))
|
402
|
-
return prefix
|
403
|
-
}
|
404
|
-
|
405
|
-
Tooltip.prototype.tip = function () {
|
406
|
-
return (this.$tip = this.$tip || $(this.options.template))
|
407
|
-
}
|
408
|
-
|
409
|
-
Tooltip.prototype.arrow = function () {
|
410
|
-
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
|
411
|
-
}
|
412
|
-
|
413
|
-
Tooltip.prototype.enable = function () {
|
414
|
-
this.enabled = true
|
415
|
-
}
|
416
|
-
|
417
|
-
Tooltip.prototype.disable = function () {
|
418
|
-
this.enabled = false
|
419
|
-
}
|
420
|
-
|
421
|
-
Tooltip.prototype.toggleEnabled = function () {
|
422
|
-
this.enabled = !this.enabled
|
423
|
-
}
|
424
|
-
|
425
|
-
Tooltip.prototype.toggle = function (e) {
|
426
|
-
var self = this
|
427
|
-
if (e) {
|
428
|
-
self = $(e.currentTarget).data('bs.' + this.type)
|
429
|
-
if (!self) {
|
430
|
-
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
|
431
|
-
$(e.currentTarget).data('bs.' + this.type, self)
|
432
|
-
}
|
433
|
-
}
|
434
|
-
|
435
|
-
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
436
|
-
}
|
437
|
-
|
438
|
-
Tooltip.prototype.destroy = function () {
|
439
|
-
var that = this
|
440
|
-
clearTimeout(this.timeout)
|
441
|
-
this.hide(function () {
|
442
|
-
that.$element.off('.' + that.type).removeData('bs.' + that.type)
|
443
|
-
})
|
444
|
-
}
|
445
|
-
|
446
|
-
|
447
|
-
// TOOLTIP PLUGIN DEFINITION
|
448
|
-
// =========================
|
449
|
-
|
450
|
-
function Plugin(option) {
|
451
|
-
return this.each(function () {
|
452
|
-
var $this = $(this)
|
453
|
-
var data = $this.data('bs.tooltip')
|
454
|
-
var options = typeof option == 'object' && option
|
455
|
-
|
456
|
-
if (!data && /destroy|hide/.test(option)) return
|
457
|
-
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
458
|
-
if (typeof option == 'string') data[option]()
|
459
|
-
})
|
460
|
-
}
|
461
|
-
|
462
|
-
var old = $.fn.tooltip
|
463
|
-
|
464
|
-
$.fn.tooltip = Plugin
|
465
|
-
$.fn.tooltip.Constructor = Tooltip
|
466
|
-
|
467
|
-
|
468
|
-
// TOOLTIP NO CONFLICT
|
469
|
-
// ===================
|
470
|
-
|
471
|
-
$.fn.tooltip.noConflict = function () {
|
472
|
-
$.fn.tooltip = old
|
473
|
-
return this
|
474
|
-
}
|
475
|
-
|
476
|
-
}(jQuery);
|