bootstrap-sass 3.3.1.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +8 -14
- data/CHANGELOG.md +55 -0
- data/CONTRIBUTING.md +8 -1
- data/Gemfile +1 -4
- data/LICENSE +2 -1
- data/README.md +118 -96
- data/Rakefile +58 -12
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +273 -214
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
- data/assets/javascripts/bootstrap/affix.js +11 -9
- data/assets/javascripts/bootstrap/alert.js +6 -5
- data/assets/javascripts/bootstrap/button.js +24 -15
- data/assets/javascripts/bootstrap/carousel.js +24 -18
- data/assets/javascripts/bootstrap/collapse.js +13 -12
- data/assets/javascripts/bootstrap/dropdown.js +50 -46
- data/assets/javascripts/bootstrap/modal.js +77 -43
- data/assets/javascripts/bootstrap/popover.js +31 -27
- data/assets/javascripts/bootstrap/scrollspy.js +19 -22
- data/assets/javascripts/bootstrap/tab.js +14 -12
- data/assets/javascripts/bootstrap/tooltip.js +255 -56
- data/assets/javascripts/bootstrap/transition.js +5 -5
- data/assets/javascripts/bootstrap-sprockets.js +2 -2
- data/assets/javascripts/bootstrap.js +1280 -1004
- data/assets/javascripts/bootstrap.min.js +6 -0
- data/assets/stylesheets/_bootstrap-compass.scss +2 -0
- data/assets/stylesheets/_bootstrap-mincer.scss +4 -2
- data/assets/stylesheets/_bootstrap-sprockets.scss +2 -0
- data/assets/stylesheets/_bootstrap.scss +6 -0
- data/assets/stylesheets/bootstrap/_alerts.scss +8 -3
- data/assets/stylesheets/bootstrap/_badges.scss +9 -4
- data/assets/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
- data/assets/stylesheets/bootstrap/_button-groups.scss +11 -10
- data/assets/stylesheets/bootstrap/_buttons.scss +18 -10
- data/assets/stylesheets/bootstrap/_carousel.scss +40 -36
- data/assets/stylesheets/bootstrap/_close.scss +2 -0
- data/assets/stylesheets/bootstrap/_code.scss +3 -3
- data/assets/stylesheets/bootstrap/_component-animations.scss +2 -2
- data/assets/stylesheets/bootstrap/_dropdowns.scss +24 -24
- data/assets/stylesheets/bootstrap/_forms.scss +143 -84
- data/assets/stylesheets/bootstrap/_glyphicons.scss +85 -12
- data/assets/stylesheets/bootstrap/_grid.scss +10 -0
- data/assets/stylesheets/bootstrap/_input-groups.scss +10 -5
- data/assets/stylesheets/bootstrap/_jumbotron.scss +9 -4
- data/assets/stylesheets/bootstrap/_labels.scss +1 -1
- data/assets/stylesheets/bootstrap/_list-group.scss +30 -26
- data/assets/stylesheets/bootstrap/_media.scss +19 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
- data/assets/stylesheets/bootstrap/_modals.scss +11 -9
- data/assets/stylesheets/bootstrap/_navbar.scss +76 -82
- data/assets/stylesheets/bootstrap/_navs.scss +4 -6
- data/assets/stylesheets/bootstrap/_normalize.scss +13 -13
- data/assets/stylesheets/bootstrap/_pager.scss +2 -2
- data/assets/stylesheets/bootstrap/_pagination.scss +15 -17
- data/assets/stylesheets/bootstrap/_panels.scss +16 -6
- data/assets/stylesheets/bootstrap/_popovers.scss +50 -59
- data/assets/stylesheets/bootstrap/_print.scss +90 -98
- data/assets/stylesheets/bootstrap/_progress-bars.scss +3 -3
- data/assets/stylesheets/bootstrap/_responsive-embed.scss +10 -10
- data/assets/stylesheets/bootstrap/_responsive-utilities.scss +11 -6
- data/assets/stylesheets/bootstrap/_scaffolding.scss +18 -7
- data/assets/stylesheets/bootstrap/_tables.scss +24 -24
- data/assets/stylesheets/bootstrap/_theme.scss +45 -22
- data/assets/stylesheets/bootstrap/_thumbnails.scss +1 -1
- data/assets/stylesheets/bootstrap/_tooltip.scss +42 -33
- data/assets/stylesheets/bootstrap/_type.scss +12 -12
- data/assets/stylesheets/bootstrap/_utilities.scss +0 -1
- data/assets/stylesheets/bootstrap/_variables.scss +27 -17
- data/assets/stylesheets/bootstrap/_wells.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_alerts.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +20 -11
- data/assets/stylesheets/bootstrap/mixins/_center-block.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +6 -8
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +8 -8
- data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_image.scss +5 -10
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
- data/assets/stylesheets/bootstrap/mixins/_opacity.scss +2 -3
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
- data/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +1 -5
- data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +4 -4
- data/bootstrap-sass.gemspec +10 -9
- data/bower.json +6 -20
- data/composer.json +2 -2
- data/eyeglass-exports.js +7 -0
- data/lib/bootstrap-sass/engine.rb +6 -1
- data/lib/bootstrap-sass/version.rb +2 -2
- data/lib/bootstrap-sass.rb +32 -13
- data/package-lock.json +1611 -0
- data/package.json +21 -7
- data/sache.json +1 -1
- data/tasks/bower.rake +2 -5
- data/tasks/converter/fonts_conversion.rb +1 -1
- data/tasks/converter/js_conversion.rb +7 -5
- data/tasks/converter/less_conversion.rb +47 -36
- data/tasks/converter/network.rb +12 -7
- data/tasks/converter.rb +1 -1
- data/templates/project/_bootstrap-variables.sass +27 -18
- data/templates/project/styles.sass +3 -0
- data/test/compilation_test.rb +24 -12
- data/test/dummy_rails/app/assets/stylesheets/{application.css.sass → application.sass} +0 -0
- data/test/dummy_rails/app/views/pages/root.html.slim +43 -0
- data/test/dummy_rails/config/application.rb +2 -1
- data/test/dummy_rails/config/boot.rb +1 -1
- data/test/dummy_rails/config/environments/development.rb +0 -3
- data/test/dummy_rails/config/environments/production.rb +7 -1
- data/test/dummy_rails/config/environments/test.rb +9 -1
- data/test/dummy_sass_only/Gemfile +1 -1
- data/test/dummy_sass_only/compile.rb +14 -7
- data/test/dummy_sass_only/import_all.scss +2 -0
- data/test/gemfiles/default.gemfile +3 -0
- data/test/node_mincer_test.rb +2 -3
- data/test/node_sass_compile_test.sh +4 -3
- data/test/sass_test.rb +10 -7
- data/test/sprockets_rails_test.rb +12 -8
- data/test/support/dummy_rails_integration.rb +1 -1
- data/test/support/reporting.rb +10 -0
- data/test/test_helper.rb +3 -2
- metadata +56 -46
- data/test/compass_test.rb +0 -9
- data/test/dummy_rails/log/development.log +0 -0
- data/test/dummy_sass_only/import_all.sass +0 -2
- data/test/gemfiles/sass_3_2.gemfile +0 -6
- data/test/gemfiles/sass_3_3.gemfile +0 -6
- data/test/gemfiles/sass_3_4.gemfile +0 -7
- data/test/gemfiles/sass_head.gemfile +0 -6
@@ -1,171 +1,86 @@
|
|
1
|
-
|
2
|
-
* Bootstrap
|
3
|
-
*
|
4
|
-
*
|
5
|
-
|
6
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
-
* ======================================================================== */
|
1
|
+
/*!
|
2
|
+
* Bootstrap v3.4.1 (https://getbootstrap.com/)
|
3
|
+
* Copyright 2011-2019 Twitter, Inc.
|
4
|
+
* Licensed under the MIT license
|
5
|
+
*/
|
8
6
|
|
7
|
+
if (typeof jQuery === 'undefined') {
|
8
|
+
throw new Error('Bootstrap\'s JavaScript requires jQuery')
|
9
|
+
}
|
9
10
|
|
10
11
|
+function ($) {
|
11
12
|
'use strict';
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
var Affix = function (element, options) {
|
17
|
-
this.options = $.extend({}, Affix.DEFAULTS, options)
|
18
|
-
|
19
|
-
this.$target = $(this.options.target)
|
20
|
-
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
21
|
-
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
22
|
-
|
23
|
-
this.$element = $(element)
|
24
|
-
this.affixed =
|
25
|
-
this.unpin =
|
26
|
-
this.pinnedOffset = null
|
27
|
-
|
28
|
-
this.checkPosition()
|
29
|
-
}
|
30
|
-
|
31
|
-
Affix.VERSION = '3.3.1'
|
32
|
-
|
33
|
-
Affix.RESET = 'affix affix-top affix-bottom'
|
34
|
-
|
35
|
-
Affix.DEFAULTS = {
|
36
|
-
offset: 0,
|
37
|
-
target: window
|
38
|
-
}
|
39
|
-
|
40
|
-
Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
|
41
|
-
var scrollTop = this.$target.scrollTop()
|
42
|
-
var position = this.$element.offset()
|
43
|
-
var targetHeight = this.$target.height()
|
44
|
-
|
45
|
-
if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
|
46
|
-
|
47
|
-
if (this.affixed == 'bottom') {
|
48
|
-
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
|
49
|
-
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
|
50
|
-
}
|
51
|
-
|
52
|
-
var initializing = this.affixed == null
|
53
|
-
var colliderTop = initializing ? scrollTop : position.top
|
54
|
-
var colliderHeight = initializing ? targetHeight : height
|
55
|
-
|
56
|
-
if (offsetTop != null && colliderTop <= offsetTop) return 'top'
|
57
|
-
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
|
58
|
-
|
59
|
-
return false
|
60
|
-
}
|
61
|
-
|
62
|
-
Affix.prototype.getPinnedOffset = function () {
|
63
|
-
if (this.pinnedOffset) return this.pinnedOffset
|
64
|
-
this.$element.removeClass(Affix.RESET).addClass('affix')
|
65
|
-
var scrollTop = this.$target.scrollTop()
|
66
|
-
var position = this.$element.offset()
|
67
|
-
return (this.pinnedOffset = position.top - scrollTop)
|
68
|
-
}
|
69
|
-
|
70
|
-
Affix.prototype.checkPositionWithEventLoop = function () {
|
71
|
-
setTimeout($.proxy(this.checkPosition, this), 1)
|
13
|
+
var version = $.fn.jquery.split(' ')[0].split('.')
|
14
|
+
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
|
15
|
+
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
|
72
16
|
}
|
17
|
+
}(jQuery);
|
73
18
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
var scrollHeight = $('body').height()
|
82
|
-
|
83
|
-
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
84
|
-
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
85
|
-
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
86
|
-
|
87
|
-
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
|
88
|
-
|
89
|
-
if (this.affixed != affix) {
|
90
|
-
if (this.unpin != null) this.$element.css('top', '')
|
19
|
+
/* ========================================================================
|
20
|
+
* Bootstrap: transition.js v3.4.1
|
21
|
+
* https://getbootstrap.com/docs/3.4/javascript/#transitions
|
22
|
+
* ========================================================================
|
23
|
+
* Copyright 2011-2019 Twitter, Inc.
|
24
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
25
|
+
* ======================================================================== */
|
91
26
|
|
92
|
-
var affixType = 'affix' + (affix ? '-' + affix : '')
|
93
|
-
var e = $.Event(affixType + '.bs.affix')
|
94
27
|
|
95
|
-
|
28
|
+
+function ($) {
|
29
|
+
'use strict';
|
96
30
|
|
97
|
-
|
31
|
+
// CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
|
32
|
+
// ============================================================
|
98
33
|
|
99
|
-
|
100
|
-
|
34
|
+
function transitionEnd() {
|
35
|
+
var el = document.createElement('bootstrap')
|
101
36
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
37
|
+
var transEndEventNames = {
|
38
|
+
WebkitTransition : 'webkitTransitionEnd',
|
39
|
+
MozTransition : 'transitionend',
|
40
|
+
OTransition : 'oTransitionEnd otransitionend',
|
41
|
+
transition : 'transitionend'
|
106
42
|
}
|
107
43
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
}
|
44
|
+
for (var name in transEndEventNames) {
|
45
|
+
if (el.style[name] !== undefined) {
|
46
|
+
return { end: transEndEventNames[name] }
|
47
|
+
}
|
112
48
|
}
|
113
|
-
}
|
114
|
-
|
115
|
-
|
116
|
-
// AFFIX PLUGIN DEFINITION
|
117
|
-
// =======================
|
118
|
-
|
119
|
-
function Plugin(option) {
|
120
|
-
return this.each(function () {
|
121
|
-
var $this = $(this)
|
122
|
-
var data = $this.data('bs.affix')
|
123
|
-
var options = typeof option == 'object' && option
|
124
49
|
|
125
|
-
|
126
|
-
if (typeof option == 'string') data[option]()
|
127
|
-
})
|
50
|
+
return false // explicit for ie8 ( ._.)
|
128
51
|
}
|
129
52
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
// =================
|
138
|
-
|
139
|
-
$.fn.affix.noConflict = function () {
|
140
|
-
$.fn.affix = old
|
53
|
+
// https://blog.alexmaccaw.com/css-transitions
|
54
|
+
$.fn.emulateTransitionEnd = function (duration) {
|
55
|
+
var called = false
|
56
|
+
var $el = this
|
57
|
+
$(this).one('bsTransitionEnd', function () { called = true })
|
58
|
+
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
59
|
+
setTimeout(callback, duration)
|
141
60
|
return this
|
142
61
|
}
|
143
62
|
|
63
|
+
$(function () {
|
64
|
+
$.support.transition = transitionEnd()
|
144
65
|
|
145
|
-
|
146
|
-
// ==============
|
147
|
-
|
148
|
-
$(window).on('load', function () {
|
149
|
-
$('[data-spy="affix"]').each(function () {
|
150
|
-
var $spy = $(this)
|
151
|
-
var data = $spy.data()
|
152
|
-
|
153
|
-
data.offset = data.offset || {}
|
154
|
-
|
155
|
-
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
|
156
|
-
if (data.offsetTop != null) data.offset.top = data.offsetTop
|
66
|
+
if (!$.support.transition) return
|
157
67
|
|
158
|
-
|
159
|
-
|
68
|
+
$.event.special.bsTransitionEnd = {
|
69
|
+
bindType: $.support.transition.end,
|
70
|
+
delegateType: $.support.transition.end,
|
71
|
+
handle: function (e) {
|
72
|
+
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
|
73
|
+
}
|
74
|
+
}
|
160
75
|
})
|
161
76
|
|
162
77
|
}(jQuery);
|
163
78
|
|
164
79
|
/* ========================================================================
|
165
|
-
* Bootstrap: alert.js v3.
|
166
|
-
*
|
80
|
+
* Bootstrap: alert.js v3.4.1
|
81
|
+
* https://getbootstrap.com/docs/3.4/javascript/#alerts
|
167
82
|
* ========================================================================
|
168
|
-
* Copyright 2011-
|
83
|
+
* Copyright 2011-2019 Twitter, Inc.
|
169
84
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
170
85
|
* ======================================================================== */
|
171
86
|
|
@@ -181,7 +96,7 @@
|
|
181
96
|
$(el).on('click', dismiss, this.close)
|
182
97
|
}
|
183
98
|
|
184
|
-
Alert.VERSION = '3.
|
99
|
+
Alert.VERSION = '3.4.1'
|
185
100
|
|
186
101
|
Alert.TRANSITION_DURATION = 150
|
187
102
|
|
@@ -194,7 +109,8 @@
|
|
194
109
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
195
110
|
}
|
196
111
|
|
197
|
-
|
112
|
+
selector = selector === '#' ? [] : selector
|
113
|
+
var $parent = $(document).find(selector)
|
198
114
|
|
199
115
|
if (e) e.preventDefault()
|
200
116
|
|
@@ -257,10 +173,10 @@
|
|
257
173
|
}(jQuery);
|
258
174
|
|
259
175
|
/* ========================================================================
|
260
|
-
* Bootstrap: button.js v3.
|
261
|
-
*
|
176
|
+
* Bootstrap: button.js v3.4.1
|
177
|
+
* https://getbootstrap.com/docs/3.4/javascript/#buttons
|
262
178
|
* ========================================================================
|
263
|
-
* Copyright 2011-
|
179
|
+
* Copyright 2011-2019 Twitter, Inc.
|
264
180
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
265
181
|
* ======================================================================== */
|
266
182
|
|
@@ -277,7 +193,7 @@
|
|
277
193
|
this.isLoading = false
|
278
194
|
}
|
279
195
|
|
280
|
-
Button.VERSION = '3.
|
196
|
+
Button.VERSION = '3.4.1'
|
281
197
|
|
282
198
|
Button.DEFAULTS = {
|
283
199
|
loadingText: 'loading...'
|
@@ -289,7 +205,7 @@
|
|
289
205
|
var val = $el.is('input') ? 'val' : 'html'
|
290
206
|
var data = $el.data()
|
291
207
|
|
292
|
-
state
|
208
|
+
state += 'Text'
|
293
209
|
|
294
210
|
if (data.resetText == null) $el.data('resetText', $el[val]())
|
295
211
|
|
@@ -299,10 +215,10 @@
|
|
299
215
|
|
300
216
|
if (state == 'loadingText') {
|
301
217
|
this.isLoading = true
|
302
|
-
$el.addClass(d).attr(d, d)
|
218
|
+
$el.addClass(d).attr(d, d).prop(d, true)
|
303
219
|
} else if (this.isLoading) {
|
304
220
|
this.isLoading = false
|
305
|
-
$el.removeClass(d).removeAttr(d)
|
221
|
+
$el.removeClass(d).removeAttr(d).prop(d, false)
|
306
222
|
}
|
307
223
|
}, this), 0)
|
308
224
|
}
|
@@ -314,15 +230,19 @@
|
|
314
230
|
if ($parent.length) {
|
315
231
|
var $input = this.$element.find('input')
|
316
232
|
if ($input.prop('type') == 'radio') {
|
317
|
-
if ($input.prop('checked')
|
318
|
-
|
233
|
+
if ($input.prop('checked')) changed = false
|
234
|
+
$parent.find('.active').removeClass('active')
|
235
|
+
this.$element.addClass('active')
|
236
|
+
} else if ($input.prop('type') == 'checkbox') {
|
237
|
+
if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
|
238
|
+
this.$element.toggleClass('active')
|
319
239
|
}
|
320
|
-
|
240
|
+
$input.prop('checked', this.$element.hasClass('active'))
|
241
|
+
if (changed) $input.trigger('change')
|
321
242
|
} else {
|
322
243
|
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
|
244
|
+
this.$element.toggleClass('active')
|
323
245
|
}
|
324
|
-
|
325
|
-
if (changed) this.$element.toggleClass('active')
|
326
246
|
}
|
327
247
|
|
328
248
|
|
@@ -362,10 +282,15 @@
|
|
362
282
|
|
363
283
|
$(document)
|
364
284
|
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
365
|
-
var $btn = $(e.target)
|
366
|
-
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
285
|
+
var $btn = $(e.target).closest('.btn')
|
367
286
|
Plugin.call($btn, 'toggle')
|
368
|
-
e.
|
287
|
+
if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
|
288
|
+
// Prevent double click on radios, and the double selections (so cancellation) on checkboxes
|
289
|
+
e.preventDefault()
|
290
|
+
// The target component still receive the focus
|
291
|
+
if ($btn.is('input,button')) $btn.trigger('focus')
|
292
|
+
else $btn.find('input:visible,button:visible').first().trigger('focus')
|
293
|
+
}
|
369
294
|
})
|
370
295
|
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
371
296
|
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
|
@@ -374,10 +299,10 @@
|
|
374
299
|
}(jQuery);
|
375
300
|
|
376
301
|
/* ========================================================================
|
377
|
-
* Bootstrap: carousel.js v3.
|
378
|
-
*
|
302
|
+
* Bootstrap: carousel.js v3.4.1
|
303
|
+
* https://getbootstrap.com/docs/3.4/javascript/#carousel
|
379
304
|
* ========================================================================
|
380
|
-
* Copyright 2011-
|
305
|
+
* Copyright 2011-2019 Twitter, Inc.
|
381
306
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
382
307
|
* ======================================================================== */
|
383
308
|
|
@@ -392,10 +317,10 @@
|
|
392
317
|
this.$element = $(element)
|
393
318
|
this.$indicators = this.$element.find('.carousel-indicators')
|
394
319
|
this.options = options
|
395
|
-
this.paused =
|
396
|
-
this.sliding =
|
397
|
-
this.interval =
|
398
|
-
this.$active =
|
320
|
+
this.paused = null
|
321
|
+
this.sliding = null
|
322
|
+
this.interval = null
|
323
|
+
this.$active = null
|
399
324
|
this.$items = null
|
400
325
|
|
401
326
|
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
|
@@ -405,7 +330,7 @@
|
|
405
330
|
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
406
331
|
}
|
407
332
|
|
408
|
-
Carousel.VERSION = '3.
|
333
|
+
Carousel.VERSION = '3.4.1'
|
409
334
|
|
410
335
|
Carousel.TRANSITION_DURATION = 600
|
411
336
|
|
@@ -445,8 +370,11 @@
|
|
445
370
|
}
|
446
371
|
|
447
372
|
Carousel.prototype.getItemForDirection = function (direction, active) {
|
448
|
-
var delta = direction == 'prev' ? -1 : 1
|
449
373
|
var activeIndex = this.getItemIndex(active)
|
374
|
+
var willWrap = (direction == 'prev' && activeIndex === 0)
|
375
|
+
|| (direction == 'next' && activeIndex == (this.$items.length - 1))
|
376
|
+
if (willWrap && !this.options.wrap) return active
|
377
|
+
var delta = direction == 'prev' ? -1 : 1
|
450
378
|
var itemIndex = (activeIndex + delta) % this.$items.length
|
451
379
|
return this.$items.eq(itemIndex)
|
452
380
|
}
|
@@ -491,14 +419,8 @@
|
|
491
419
|
var $next = next || this.getItemForDirection(type, $active)
|
492
420
|
var isCycling = this.interval
|
493
421
|
var direction = type == 'next' ? 'left' : 'right'
|
494
|
-
var fallback = type == 'next' ? 'first' : 'last'
|
495
422
|
var that = this
|
496
423
|
|
497
|
-
if (!$next.length) {
|
498
|
-
if (!this.options.wrap) return
|
499
|
-
$next = this.$element.find('.item')[fallback]()
|
500
|
-
}
|
501
|
-
|
502
424
|
if ($next.hasClass('active')) return (this.sliding = false)
|
503
425
|
|
504
426
|
var relatedTarget = $next[0]
|
@@ -522,7 +444,9 @@
|
|
522
444
|
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
523
445
|
if ($.support.transition && this.$element.hasClass('slide')) {
|
524
446
|
$next.addClass(type)
|
525
|
-
$next
|
447
|
+
if (typeof $next === 'object' && $next.length) {
|
448
|
+
$next[0].offsetWidth // force reflow
|
449
|
+
}
|
526
450
|
$active.addClass(direction)
|
527
451
|
$next.addClass(direction)
|
528
452
|
$active
|
@@ -584,10 +508,17 @@
|
|
584
508
|
// =================
|
585
509
|
|
586
510
|
var clickHandler = function (e) {
|
587
|
-
var href
|
588
511
|
var $this = $(this)
|
589
|
-
var
|
512
|
+
var href = $this.attr('href')
|
513
|
+
if (href) {
|
514
|
+
href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
515
|
+
}
|
516
|
+
|
517
|
+
var target = $this.attr('data-target') || href
|
518
|
+
var $target = $(document).find(target)
|
519
|
+
|
590
520
|
if (!$target.hasClass('carousel')) return
|
521
|
+
|
591
522
|
var options = $.extend({}, $target.data(), $this.data())
|
592
523
|
var slideIndex = $this.attr('data-slide-to')
|
593
524
|
if (slideIndex) options.interval = false
|
@@ -615,13 +546,14 @@
|
|
615
546
|
}(jQuery);
|
616
547
|
|
617
548
|
/* ========================================================================
|
618
|
-
* Bootstrap: collapse.js v3.
|
619
|
-
*
|
549
|
+
* Bootstrap: collapse.js v3.4.1
|
550
|
+
* https://getbootstrap.com/docs/3.4/javascript/#collapse
|
620
551
|
* ========================================================================
|
621
|
-
* Copyright 2011-
|
552
|
+
* Copyright 2011-2019 Twitter, Inc.
|
622
553
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
623
554
|
* ======================================================================== */
|
624
555
|
|
556
|
+
/* jshint latedef: false */
|
625
557
|
|
626
558
|
+function ($) {
|
627
559
|
'use strict';
|
@@ -632,7 +564,8 @@
|
|
632
564
|
var Collapse = function (element, options) {
|
633
565
|
this.$element = $(element)
|
634
566
|
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
635
|
-
this.$trigger = $(
|
567
|
+
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
|
568
|
+
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
|
636
569
|
this.transitioning = null
|
637
570
|
|
638
571
|
if (this.options.parent) {
|
@@ -644,13 +577,12 @@
|
|
644
577
|
if (this.options.toggle) this.toggle()
|
645
578
|
}
|
646
579
|
|
647
|
-
Collapse.VERSION = '3.
|
580
|
+
Collapse.VERSION = '3.4.1'
|
648
581
|
|
649
582
|
Collapse.TRANSITION_DURATION = 350
|
650
583
|
|
651
584
|
Collapse.DEFAULTS = {
|
652
|
-
toggle: true
|
653
|
-
trigger: '[data-toggle="collapse"]'
|
585
|
+
toggle: true
|
654
586
|
}
|
655
587
|
|
656
588
|
Collapse.prototype.dimension = function () {
|
@@ -662,7 +594,7 @@
|
|
662
594
|
if (this.transitioning || this.$element.hasClass('in')) return
|
663
595
|
|
664
596
|
var activesData
|
665
|
-
var actives = this.$parent && this.$parent.
|
597
|
+
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
|
666
598
|
|
667
599
|
if (actives && actives.length) {
|
668
600
|
activesData = actives.data('bs.collapse')
|
@@ -752,7 +684,7 @@
|
|
752
684
|
}
|
753
685
|
|
754
686
|
Collapse.prototype.getParent = function () {
|
755
|
-
return $(this.options.parent)
|
687
|
+
return $(document).find(this.options.parent)
|
756
688
|
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
|
757
689
|
.each($.proxy(function (i, element) {
|
758
690
|
var $element = $(element)
|
@@ -775,7 +707,7 @@
|
|
775
707
|
var target = $trigger.attr('data-target')
|
776
708
|
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
777
709
|
|
778
|
-
return $(target)
|
710
|
+
return $(document).find(target)
|
779
711
|
}
|
780
712
|
|
781
713
|
|
@@ -788,7 +720,7 @@
|
|
788
720
|
var data = $this.data('bs.collapse')
|
789
721
|
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
790
722
|
|
791
|
-
if (!data && options.toggle && option
|
723
|
+
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
|
792
724
|
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
793
725
|
if (typeof option == 'string') data[option]()
|
794
726
|
})
|
@@ -819,7 +751,7 @@
|
|
819
751
|
|
820
752
|
var $target = getTargetFromTrigger($this)
|
821
753
|
var data = $target.data('bs.collapse')
|
822
|
-
var option = data ? 'toggle' :
|
754
|
+
var option = data ? 'toggle' : $this.data()
|
823
755
|
|
824
756
|
Plugin.call($target, option)
|
825
757
|
})
|
@@ -827,10 +759,10 @@
|
|
827
759
|
}(jQuery);
|
828
760
|
|
829
761
|
/* ========================================================================
|
830
|
-
* Bootstrap: dropdown.js v3.
|
831
|
-
*
|
762
|
+
* Bootstrap: dropdown.js v3.4.1
|
763
|
+
* https://getbootstrap.com/docs/3.4/javascript/#dropdowns
|
832
764
|
* ========================================================================
|
833
|
-
* Copyright 2011-
|
765
|
+
* Copyright 2011-2019 Twitter, Inc.
|
834
766
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
835
767
|
* ======================================================================== */
|
836
768
|
|
@@ -847,7 +779,41 @@
|
|
847
779
|
$(element).on('click.bs.dropdown', this.toggle)
|
848
780
|
}
|
849
781
|
|
850
|
-
Dropdown.VERSION = '3.
|
782
|
+
Dropdown.VERSION = '3.4.1'
|
783
|
+
|
784
|
+
function getParent($this) {
|
785
|
+
var selector = $this.attr('data-target')
|
786
|
+
|
787
|
+
if (!selector) {
|
788
|
+
selector = $this.attr('href')
|
789
|
+
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
790
|
+
}
|
791
|
+
|
792
|
+
var $parent = selector !== '#' ? $(document).find(selector) : null
|
793
|
+
|
794
|
+
return $parent && $parent.length ? $parent : $this.parent()
|
795
|
+
}
|
796
|
+
|
797
|
+
function clearMenus(e) {
|
798
|
+
if (e && e.which === 3) return
|
799
|
+
$(backdrop).remove()
|
800
|
+
$(toggle).each(function () {
|
801
|
+
var $this = $(this)
|
802
|
+
var $parent = getParent($this)
|
803
|
+
var relatedTarget = { relatedTarget: this }
|
804
|
+
|
805
|
+
if (!$parent.hasClass('open')) return
|
806
|
+
|
807
|
+
if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
|
808
|
+
|
809
|
+
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
810
|
+
|
811
|
+
if (e.isDefaultPrevented()) return
|
812
|
+
|
813
|
+
$this.attr('aria-expanded', 'false')
|
814
|
+
$parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
|
815
|
+
})
|
816
|
+
}
|
851
817
|
|
852
818
|
Dropdown.prototype.toggle = function (e) {
|
853
819
|
var $this = $(this)
|
@@ -862,7 +828,10 @@
|
|
862
828
|
if (!isActive) {
|
863
829
|
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
864
830
|
// if mobile we use a backdrop because click events don't delegate
|
865
|
-
$('
|
831
|
+
$(document.createElement('div'))
|
832
|
+
.addClass('dropdown-backdrop')
|
833
|
+
.insertAfter($(this))
|
834
|
+
.on('click', clearMenus)
|
866
835
|
}
|
867
836
|
|
868
837
|
var relatedTarget = { relatedTarget: this }
|
@@ -876,7 +845,7 @@
|
|
876
845
|
|
877
846
|
$parent
|
878
847
|
.toggleClass('open')
|
879
|
-
.trigger('shown.bs.dropdown', relatedTarget)
|
848
|
+
.trigger($.Event('shown.bs.dropdown', relatedTarget))
|
880
849
|
}
|
881
850
|
|
882
851
|
return false
|
@@ -895,57 +864,25 @@
|
|
895
864
|
var $parent = getParent($this)
|
896
865
|
var isActive = $parent.hasClass('open')
|
897
866
|
|
898
|
-
if (
|
867
|
+
if (!isActive && e.which != 27 || isActive && e.which == 27) {
|
899
868
|
if (e.which == 27) $parent.find(toggle).trigger('focus')
|
900
869
|
return $this.trigger('click')
|
901
870
|
}
|
902
871
|
|
903
|
-
var desc = ' li:not(.
|
904
|
-
var $items = $parent.find('
|
872
|
+
var desc = ' li:not(.disabled):visible a'
|
873
|
+
var $items = $parent.find('.dropdown-menu' + desc)
|
905
874
|
|
906
875
|
if (!$items.length) return
|
907
876
|
|
908
877
|
var index = $items.index(e.target)
|
909
878
|
|
910
|
-
if (e.which == 38 && index > 0) index--
|
911
|
-
if (e.which == 40 && index < $items.length - 1) index++
|
912
|
-
if (!~index)
|
879
|
+
if (e.which == 38 && index > 0) index-- // up
|
880
|
+
if (e.which == 40 && index < $items.length - 1) index++ // down
|
881
|
+
if (!~index) index = 0
|
913
882
|
|
914
883
|
$items.eq(index).trigger('focus')
|
915
884
|
}
|
916
885
|
|
917
|
-
function clearMenus(e) {
|
918
|
-
if (e && e.which === 3) return
|
919
|
-
$(backdrop).remove()
|
920
|
-
$(toggle).each(function () {
|
921
|
-
var $this = $(this)
|
922
|
-
var $parent = getParent($this)
|
923
|
-
var relatedTarget = { relatedTarget: this }
|
924
|
-
|
925
|
-
if (!$parent.hasClass('open')) return
|
926
|
-
|
927
|
-
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
928
|
-
|
929
|
-
if (e.isDefaultPrevented()) return
|
930
|
-
|
931
|
-
$this.attr('aria-expanded', 'false')
|
932
|
-
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
933
|
-
})
|
934
|
-
}
|
935
|
-
|
936
|
-
function getParent($this) {
|
937
|
-
var selector = $this.attr('data-target')
|
938
|
-
|
939
|
-
if (!selector) {
|
940
|
-
selector = $this.attr('href')
|
941
|
-
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
942
|
-
}
|
943
|
-
|
944
|
-
var $parent = selector && $(selector)
|
945
|
-
|
946
|
-
return $parent && $parent.length ? $parent : $this.parent()
|
947
|
-
}
|
948
|
-
|
949
886
|
|
950
887
|
// DROPDOWN PLUGIN DEFINITION
|
951
888
|
// ==========================
|
@@ -983,16 +920,15 @@
|
|
983
920
|
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
984
921
|
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
985
922
|
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
|
986
|
-
.on('keydown.bs.dropdown.data-api', '
|
987
|
-
.on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
|
923
|
+
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
|
988
924
|
|
989
925
|
}(jQuery);
|
990
926
|
|
991
927
|
/* ========================================================================
|
992
|
-
* Bootstrap:
|
993
|
-
*
|
928
|
+
* Bootstrap: modal.js v3.4.1
|
929
|
+
* https://getbootstrap.com/docs/3.4/javascript/#modals
|
994
930
|
* ========================================================================
|
995
|
-
* Copyright 2011-
|
931
|
+
* Copyright 2011-2019 Twitter, Inc.
|
996
932
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
997
933
|
* ======================================================================== */
|
998
934
|
|
@@ -1000,739 +936,514 @@
|
|
1000
936
|
+function ($) {
|
1001
937
|
'use strict';
|
1002
938
|
|
1003
|
-
//
|
1004
|
-
//
|
939
|
+
// MODAL CLASS DEFINITION
|
940
|
+
// ======================
|
1005
941
|
|
1006
|
-
var
|
1007
|
-
this.
|
942
|
+
var Modal = function (element, options) {
|
943
|
+
this.options = options
|
944
|
+
this.$body = $(document.body)
|
945
|
+
this.$element = $(element)
|
946
|
+
this.$dialog = this.$element.find('.modal-dialog')
|
947
|
+
this.$backdrop = null
|
948
|
+
this.isShown = null
|
949
|
+
this.originalBodyPad = null
|
950
|
+
this.scrollbarWidth = 0
|
951
|
+
this.ignoreBackdropClick = false
|
952
|
+
this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom'
|
953
|
+
|
954
|
+
if (this.options.remote) {
|
955
|
+
this.$element
|
956
|
+
.find('.modal-content')
|
957
|
+
.load(this.options.remote, $.proxy(function () {
|
958
|
+
this.$element.trigger('loaded.bs.modal')
|
959
|
+
}, this))
|
960
|
+
}
|
1008
961
|
}
|
1009
962
|
|
1010
|
-
|
963
|
+
Modal.VERSION = '3.4.1'
|
1011
964
|
|
1012
|
-
|
965
|
+
Modal.TRANSITION_DURATION = 300
|
966
|
+
Modal.BACKDROP_TRANSITION_DURATION = 150
|
1013
967
|
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
968
|
+
Modal.DEFAULTS = {
|
969
|
+
backdrop: true,
|
970
|
+
keyboard: true,
|
971
|
+
show: true
|
972
|
+
}
|
1018
973
|
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
}
|
974
|
+
Modal.prototype.toggle = function (_relatedTarget) {
|
975
|
+
return this.isShown ? this.hide() : this.show(_relatedTarget)
|
976
|
+
}
|
1023
977
|
|
1024
|
-
|
978
|
+
Modal.prototype.show = function (_relatedTarget) {
|
979
|
+
var that = this
|
980
|
+
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
1025
981
|
|
1026
|
-
|
1027
|
-
var hideEvent = $.Event('hide.bs.tab', {
|
1028
|
-
relatedTarget: $this[0]
|
1029
|
-
})
|
1030
|
-
var showEvent = $.Event('show.bs.tab', {
|
1031
|
-
relatedTarget: $previous[0]
|
1032
|
-
})
|
982
|
+
this.$element.trigger(e)
|
1033
983
|
|
1034
|
-
|
1035
|
-
$this.trigger(showEvent)
|
984
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
1036
985
|
|
1037
|
-
|
986
|
+
this.isShown = true
|
1038
987
|
|
1039
|
-
|
988
|
+
this.checkScrollbar()
|
989
|
+
this.setScrollbar()
|
990
|
+
this.$body.addClass('modal-open')
|
1040
991
|
|
1041
|
-
this.
|
1042
|
-
this.
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
relatedTarget: $previous[0]
|
992
|
+
this.escape()
|
993
|
+
this.resize()
|
994
|
+
|
995
|
+
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
996
|
+
|
997
|
+
this.$dialog.on('mousedown.dismiss.bs.modal', function () {
|
998
|
+
that.$element.one('mouseup.dismiss.bs.modal', function (e) {
|
999
|
+
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
|
1050
1000
|
})
|
1051
1001
|
})
|
1052
|
-
}
|
1053
1002
|
|
1054
|
-
|
1055
|
-
|
1056
|
-
var transition = callback
|
1057
|
-
&& $.support.transition
|
1058
|
-
&& (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
|
1003
|
+
this.backdrop(function () {
|
1004
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
1059
1005
|
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
.find('> .dropdown-menu > .active')
|
1064
|
-
.removeClass('active')
|
1065
|
-
.end()
|
1066
|
-
.find('[data-toggle="tab"]')
|
1067
|
-
.attr('aria-expanded', false)
|
1006
|
+
if (!that.$element.parent().length) {
|
1007
|
+
that.$element.appendTo(that.$body) // don't move modals dom position
|
1008
|
+
}
|
1068
1009
|
|
1069
|
-
element
|
1070
|
-
.
|
1071
|
-
.
|
1072
|
-
|
1010
|
+
that.$element
|
1011
|
+
.show()
|
1012
|
+
.scrollTop(0)
|
1013
|
+
|
1014
|
+
that.adjustDialog()
|
1073
1015
|
|
1074
1016
|
if (transition) {
|
1075
|
-
element[0].offsetWidth // reflow
|
1076
|
-
element.addClass('in')
|
1077
|
-
} else {
|
1078
|
-
element.removeClass('fade')
|
1017
|
+
that.$element[0].offsetWidth // force reflow
|
1079
1018
|
}
|
1080
1019
|
|
1081
|
-
|
1082
|
-
element
|
1083
|
-
.closest('li.dropdown')
|
1084
|
-
.addClass('active')
|
1085
|
-
.end()
|
1086
|
-
.find('[data-toggle="tab"]')
|
1087
|
-
.attr('aria-expanded', true)
|
1088
|
-
}
|
1020
|
+
that.$element.addClass('in')
|
1089
1021
|
|
1090
|
-
|
1091
|
-
}
|
1022
|
+
that.enforceFocus()
|
1092
1023
|
|
1093
|
-
|
1094
|
-
$active
|
1095
|
-
.one('bsTransitionEnd', next)
|
1096
|
-
.emulateTransitionEnd(Tab.TRANSITION_DURATION) :
|
1097
|
-
next()
|
1024
|
+
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
1098
1025
|
|
1099
|
-
|
1026
|
+
transition ?
|
1027
|
+
that.$dialog // wait for modal to slide in
|
1028
|
+
.one('bsTransitionEnd', function () {
|
1029
|
+
that.$element.trigger('focus').trigger(e)
|
1030
|
+
})
|
1031
|
+
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
1032
|
+
that.$element.trigger('focus').trigger(e)
|
1033
|
+
})
|
1100
1034
|
}
|
1101
1035
|
|
1036
|
+
Modal.prototype.hide = function (e) {
|
1037
|
+
if (e) e.preventDefault()
|
1102
1038
|
|
1103
|
-
|
1104
|
-
// =====================
|
1039
|
+
e = $.Event('hide.bs.modal')
|
1105
1040
|
|
1106
|
-
|
1107
|
-
return this.each(function () {
|
1108
|
-
var $this = $(this)
|
1109
|
-
var data = $this.data('bs.tab')
|
1041
|
+
this.$element.trigger(e)
|
1110
1042
|
|
1111
|
-
|
1112
|
-
if (typeof option == 'string') data[option]()
|
1113
|
-
})
|
1114
|
-
}
|
1043
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
1115
1044
|
|
1116
|
-
|
1045
|
+
this.isShown = false
|
1117
1046
|
|
1118
|
-
|
1119
|
-
|
1047
|
+
this.escape()
|
1048
|
+
this.resize()
|
1120
1049
|
|
1050
|
+
$(document).off('focusin.bs.modal')
|
1121
1051
|
|
1122
|
-
|
1123
|
-
|
1052
|
+
this.$element
|
1053
|
+
.removeClass('in')
|
1054
|
+
.off('click.dismiss.bs.modal')
|
1055
|
+
.off('mouseup.dismiss.bs.modal')
|
1124
1056
|
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1057
|
+
this.$dialog.off('mousedown.dismiss.bs.modal')
|
1058
|
+
|
1059
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
1060
|
+
this.$element
|
1061
|
+
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
|
1062
|
+
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
1063
|
+
this.hideModal()
|
1128
1064
|
}
|
1129
1065
|
|
1066
|
+
Modal.prototype.enforceFocus = function () {
|
1067
|
+
$(document)
|
1068
|
+
.off('focusin.bs.modal') // guard against infinite focus loop
|
1069
|
+
.on('focusin.bs.modal', $.proxy(function (e) {
|
1070
|
+
if (document !== e.target &&
|
1071
|
+
this.$element[0] !== e.target &&
|
1072
|
+
!this.$element.has(e.target).length) {
|
1073
|
+
this.$element.trigger('focus')
|
1074
|
+
}
|
1075
|
+
}, this))
|
1076
|
+
}
|
1130
1077
|
|
1131
|
-
|
1132
|
-
|
1078
|
+
Modal.prototype.escape = function () {
|
1079
|
+
if (this.isShown && this.options.keyboard) {
|
1080
|
+
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
|
1081
|
+
e.which == 27 && this.hide()
|
1082
|
+
}, this))
|
1083
|
+
} else if (!this.isShown) {
|
1084
|
+
this.$element.off('keydown.dismiss.bs.modal')
|
1085
|
+
}
|
1086
|
+
}
|
1133
1087
|
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1088
|
+
Modal.prototype.resize = function () {
|
1089
|
+
if (this.isShown) {
|
1090
|
+
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
|
1091
|
+
} else {
|
1092
|
+
$(window).off('resize.bs.modal')
|
1093
|
+
}
|
1137
1094
|
}
|
1138
1095
|
|
1139
|
-
|
1140
|
-
|
1141
|
-
.
|
1096
|
+
Modal.prototype.hideModal = function () {
|
1097
|
+
var that = this
|
1098
|
+
this.$element.hide()
|
1099
|
+
this.backdrop(function () {
|
1100
|
+
that.$body.removeClass('modal-open')
|
1101
|
+
that.resetAdjustments()
|
1102
|
+
that.resetScrollbar()
|
1103
|
+
that.$element.trigger('hidden.bs.modal')
|
1104
|
+
})
|
1105
|
+
}
|
1142
1106
|
|
1143
|
-
|
1107
|
+
Modal.prototype.removeBackdrop = function () {
|
1108
|
+
this.$backdrop && this.$backdrop.remove()
|
1109
|
+
this.$backdrop = null
|
1110
|
+
}
|
1144
1111
|
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
* ========================================================================
|
1149
|
-
* Copyright 2011-2014 Twitter, Inc.
|
1150
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1151
|
-
* ======================================================================== */
|
1112
|
+
Modal.prototype.backdrop = function (callback) {
|
1113
|
+
var that = this
|
1114
|
+
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
1152
1115
|
|
1116
|
+
if (this.isShown && this.options.backdrop) {
|
1117
|
+
var doAnimate = $.support.transition && animate
|
1153
1118
|
|
1154
|
-
|
1155
|
-
|
1119
|
+
this.$backdrop = $(document.createElement('div'))
|
1120
|
+
.addClass('modal-backdrop ' + animate)
|
1121
|
+
.appendTo(this.$body)
|
1156
1122
|
|
1157
|
-
|
1158
|
-
|
1123
|
+
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
1124
|
+
if (this.ignoreBackdropClick) {
|
1125
|
+
this.ignoreBackdropClick = false
|
1126
|
+
return
|
1127
|
+
}
|
1128
|
+
if (e.target !== e.currentTarget) return
|
1129
|
+
this.options.backdrop == 'static'
|
1130
|
+
? this.$element[0].focus()
|
1131
|
+
: this.hide()
|
1132
|
+
}, this))
|
1159
1133
|
|
1160
|
-
|
1161
|
-
var el = document.createElement('bootstrap')
|
1134
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
1162
1135
|
|
1163
|
-
|
1164
|
-
WebkitTransition : 'webkitTransitionEnd',
|
1165
|
-
MozTransition : 'transitionend',
|
1166
|
-
OTransition : 'oTransitionEnd otransitionend',
|
1167
|
-
transition : 'transitionend'
|
1168
|
-
}
|
1136
|
+
this.$backdrop.addClass('in')
|
1169
1137
|
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1138
|
+
if (!callback) return
|
1139
|
+
|
1140
|
+
doAnimate ?
|
1141
|
+
this.$backdrop
|
1142
|
+
.one('bsTransitionEnd', callback)
|
1143
|
+
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
1144
|
+
callback()
|
1145
|
+
|
1146
|
+
} else if (!this.isShown && this.$backdrop) {
|
1147
|
+
this.$backdrop.removeClass('in')
|
1148
|
+
|
1149
|
+
var callbackRemove = function () {
|
1150
|
+
that.removeBackdrop()
|
1151
|
+
callback && callback()
|
1173
1152
|
}
|
1174
|
-
|
1153
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
1154
|
+
this.$backdrop
|
1155
|
+
.one('bsTransitionEnd', callbackRemove)
|
1156
|
+
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
1157
|
+
callbackRemove()
|
1175
1158
|
|
1176
|
-
|
1159
|
+
} else if (callback) {
|
1160
|
+
callback()
|
1161
|
+
}
|
1177
1162
|
}
|
1178
1163
|
|
1179
|
-
//
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
$(this).one('bsTransitionEnd', function () { called = true })
|
1184
|
-
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
1185
|
-
setTimeout(callback, duration)
|
1186
|
-
return this
|
1164
|
+
// these following methods are used to handle overflowing modals
|
1165
|
+
|
1166
|
+
Modal.prototype.handleUpdate = function () {
|
1167
|
+
this.adjustDialog()
|
1187
1168
|
}
|
1188
1169
|
|
1189
|
-
|
1190
|
-
|
1170
|
+
Modal.prototype.adjustDialog = function () {
|
1171
|
+
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
1191
1172
|
|
1192
|
-
|
1173
|
+
this.$element.css({
|
1174
|
+
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
1175
|
+
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
|
1176
|
+
})
|
1177
|
+
}
|
1193
1178
|
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
}
|
1200
|
-
}
|
1201
|
-
})
|
1202
|
-
|
1203
|
-
}(jQuery);
|
1204
|
-
|
1205
|
-
/* ========================================================================
|
1206
|
-
* Bootstrap: scrollspy.js v3.3.1
|
1207
|
-
* http://getbootstrap.com/javascript/#scrollspy
|
1208
|
-
* ========================================================================
|
1209
|
-
* Copyright 2011-2014 Twitter, Inc.
|
1210
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1211
|
-
* ======================================================================== */
|
1212
|
-
|
1213
|
-
|
1214
|
-
+function ($) {
|
1215
|
-
'use strict';
|
1216
|
-
|
1217
|
-
// SCROLLSPY CLASS DEFINITION
|
1218
|
-
// ==========================
|
1219
|
-
|
1220
|
-
function ScrollSpy(element, options) {
|
1221
|
-
var process = $.proxy(this.process, this)
|
1222
|
-
|
1223
|
-
this.$body = $('body')
|
1224
|
-
this.$scrollElement = $(element).is('body') ? $(window) : $(element)
|
1225
|
-
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
1226
|
-
this.selector = (this.options.target || '') + ' .nav li > a'
|
1227
|
-
this.offsets = []
|
1228
|
-
this.targets = []
|
1229
|
-
this.activeTarget = null
|
1230
|
-
this.scrollHeight = 0
|
1231
|
-
|
1232
|
-
this.$scrollElement.on('scroll.bs.scrollspy', process)
|
1233
|
-
this.refresh()
|
1234
|
-
this.process()
|
1235
|
-
}
|
1236
|
-
|
1237
|
-
ScrollSpy.VERSION = '3.3.1'
|
1238
|
-
|
1239
|
-
ScrollSpy.DEFAULTS = {
|
1240
|
-
offset: 10
|
1241
|
-
}
|
1242
|
-
|
1243
|
-
ScrollSpy.prototype.getScrollHeight = function () {
|
1244
|
-
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
|
1179
|
+
Modal.prototype.resetAdjustments = function () {
|
1180
|
+
this.$element.css({
|
1181
|
+
paddingLeft: '',
|
1182
|
+
paddingRight: ''
|
1183
|
+
})
|
1245
1184
|
}
|
1246
1185
|
|
1247
|
-
|
1248
|
-
var
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
offsetMethod = 'position'
|
1253
|
-
offsetBase = this.$scrollElement.scrollTop()
|
1186
|
+
Modal.prototype.checkScrollbar = function () {
|
1187
|
+
var fullWindowWidth = window.innerWidth
|
1188
|
+
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
|
1189
|
+
var documentElementRect = document.documentElement.getBoundingClientRect()
|
1190
|
+
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
|
1254
1191
|
}
|
1255
|
-
|
1256
|
-
this.
|
1257
|
-
this.targets = []
|
1258
|
-
this.scrollHeight = this.getScrollHeight()
|
1259
|
-
|
1260
|
-
var self = this
|
1261
|
-
|
1262
|
-
this.$body
|
1263
|
-
.find(this.selector)
|
1264
|
-
.map(function () {
|
1265
|
-
var $el = $(this)
|
1266
|
-
var href = $el.data('target') || $el.attr('href')
|
1267
|
-
var $href = /^#./.test(href) && $(href)
|
1268
|
-
|
1269
|
-
return ($href
|
1270
|
-
&& $href.length
|
1271
|
-
&& $href.is(':visible')
|
1272
|
-
&& [[$href[offsetMethod]().top + offsetBase, href]]) || null
|
1273
|
-
})
|
1274
|
-
.sort(function (a, b) { return a[0] - b[0] })
|
1275
|
-
.each(function () {
|
1276
|
-
self.offsets.push(this[0])
|
1277
|
-
self.targets.push(this[1])
|
1278
|
-
})
|
1192
|
+
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
|
1193
|
+
this.scrollbarWidth = this.measureScrollbar()
|
1279
1194
|
}
|
1280
1195
|
|
1281
|
-
|
1282
|
-
var
|
1283
|
-
|
1284
|
-
var
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
if (scrollTop >= maxScroll) {
|
1295
|
-
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
|
1296
|
-
}
|
1297
|
-
|
1298
|
-
if (activeTarget && scrollTop < offsets[0]) {
|
1299
|
-
this.activeTarget = null
|
1300
|
-
return this.clear()
|
1301
|
-
}
|
1302
|
-
|
1303
|
-
for (i = offsets.length; i--;) {
|
1304
|
-
activeTarget != targets[i]
|
1305
|
-
&& scrollTop >= offsets[i]
|
1306
|
-
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
1307
|
-
&& this.activate(targets[i])
|
1196
|
+
Modal.prototype.setScrollbar = function () {
|
1197
|
+
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
1198
|
+
this.originalBodyPad = document.body.style.paddingRight || ''
|
1199
|
+
var scrollbarWidth = this.scrollbarWidth
|
1200
|
+
if (this.bodyIsOverflowing) {
|
1201
|
+
this.$body.css('padding-right', bodyPad + scrollbarWidth)
|
1202
|
+
$(this.fixedContent).each(function (index, element) {
|
1203
|
+
var actualPadding = element.style.paddingRight
|
1204
|
+
var calculatedPadding = $(element).css('padding-right')
|
1205
|
+
$(element)
|
1206
|
+
.data('padding-right', actualPadding)
|
1207
|
+
.css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px')
|
1208
|
+
})
|
1308
1209
|
}
|
1309
1210
|
}
|
1310
1211
|
|
1311
|
-
|
1312
|
-
this.
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
this.selector + '[href="' + target + '"]'
|
1319
|
-
|
1320
|
-
var active = $(selector)
|
1321
|
-
.parents('li')
|
1322
|
-
.addClass('active')
|
1323
|
-
|
1324
|
-
if (active.parent('.dropdown-menu').length) {
|
1325
|
-
active = active
|
1326
|
-
.closest('li.dropdown')
|
1327
|
-
.addClass('active')
|
1328
|
-
}
|
1329
|
-
|
1330
|
-
active.trigger('activate.bs.scrollspy')
|
1212
|
+
Modal.prototype.resetScrollbar = function () {
|
1213
|
+
this.$body.css('padding-right', this.originalBodyPad)
|
1214
|
+
$(this.fixedContent).each(function (index, element) {
|
1215
|
+
var padding = $(element).data('padding-right')
|
1216
|
+
$(element).removeData('padding-right')
|
1217
|
+
element.style.paddingRight = padding ? padding : ''
|
1218
|
+
})
|
1331
1219
|
}
|
1332
1220
|
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1221
|
+
Modal.prototype.measureScrollbar = function () { // thx walsh
|
1222
|
+
var scrollDiv = document.createElement('div')
|
1223
|
+
scrollDiv.className = 'modal-scrollbar-measure'
|
1224
|
+
this.$body.append(scrollDiv)
|
1225
|
+
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
|
1226
|
+
this.$body[0].removeChild(scrollDiv)
|
1227
|
+
return scrollbarWidth
|
1337
1228
|
}
|
1338
1229
|
|
1339
1230
|
|
1340
|
-
//
|
1341
|
-
//
|
1231
|
+
// MODAL PLUGIN DEFINITION
|
1232
|
+
// =======================
|
1342
1233
|
|
1343
|
-
function Plugin(option) {
|
1234
|
+
function Plugin(option, _relatedTarget) {
|
1344
1235
|
return this.each(function () {
|
1345
|
-
var $this
|
1346
|
-
var data
|
1347
|
-
var options = typeof option == 'object' && option
|
1236
|
+
var $this = $(this)
|
1237
|
+
var data = $this.data('bs.modal')
|
1238
|
+
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
1348
1239
|
|
1349
|
-
if (!data) $this.data('bs.
|
1350
|
-
if (typeof option == 'string') data[option]()
|
1240
|
+
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
1241
|
+
if (typeof option == 'string') data[option](_relatedTarget)
|
1242
|
+
else if (options.show) data.show(_relatedTarget)
|
1351
1243
|
})
|
1352
1244
|
}
|
1353
1245
|
|
1354
|
-
var old = $.fn.
|
1246
|
+
var old = $.fn.modal
|
1355
1247
|
|
1356
|
-
$.fn.
|
1357
|
-
$.fn.
|
1248
|
+
$.fn.modal = Plugin
|
1249
|
+
$.fn.modal.Constructor = Modal
|
1358
1250
|
|
1359
1251
|
|
1360
|
-
//
|
1361
|
-
//
|
1252
|
+
// MODAL NO CONFLICT
|
1253
|
+
// =================
|
1362
1254
|
|
1363
|
-
$.fn.
|
1364
|
-
$.fn.
|
1255
|
+
$.fn.modal.noConflict = function () {
|
1256
|
+
$.fn.modal = old
|
1365
1257
|
return this
|
1366
1258
|
}
|
1367
1259
|
|
1368
1260
|
|
1369
|
-
//
|
1370
|
-
//
|
1261
|
+
// MODAL DATA-API
|
1262
|
+
// ==============
|
1371
1263
|
|
1372
|
-
$(
|
1373
|
-
$
|
1374
|
-
|
1375
|
-
|
1264
|
+
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
1265
|
+
var $this = $(this)
|
1266
|
+
var href = $this.attr('href')
|
1267
|
+
var target = $this.attr('data-target') ||
|
1268
|
+
(href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
1269
|
+
|
1270
|
+
var $target = $(document).find(target)
|
1271
|
+
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
1272
|
+
|
1273
|
+
if ($this.is('a')) e.preventDefault()
|
1274
|
+
|
1275
|
+
$target.one('show.bs.modal', function (showEvent) {
|
1276
|
+
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
|
1277
|
+
$target.one('hidden.bs.modal', function () {
|
1278
|
+
$this.is(':visible') && $this.trigger('focus')
|
1279
|
+
})
|
1376
1280
|
})
|
1281
|
+
Plugin.call($target, option, this)
|
1377
1282
|
})
|
1378
1283
|
|
1379
1284
|
}(jQuery);
|
1380
1285
|
|
1381
1286
|
/* ========================================================================
|
1382
|
-
* Bootstrap:
|
1383
|
-
*
|
1287
|
+
* Bootstrap: tooltip.js v3.4.1
|
1288
|
+
* https://getbootstrap.com/docs/3.4/javascript/#tooltip
|
1289
|
+
* Inspired by the original jQuery.tipsy by Jason Frame
|
1384
1290
|
* ========================================================================
|
1385
|
-
* Copyright 2011-
|
1291
|
+
* Copyright 2011-2019 Twitter, Inc.
|
1386
1292
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1387
1293
|
* ======================================================================== */
|
1388
1294
|
|
1389
|
-
|
1390
1295
|
+function ($) {
|
1391
1296
|
'use strict';
|
1392
1297
|
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1298
|
+
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']
|
1299
|
+
|
1300
|
+
var uriAttrs = [
|
1301
|
+
'background',
|
1302
|
+
'cite',
|
1303
|
+
'href',
|
1304
|
+
'itemtype',
|
1305
|
+
'longdesc',
|
1306
|
+
'poster',
|
1307
|
+
'src',
|
1308
|
+
'xlink:href'
|
1309
|
+
]
|
1310
|
+
|
1311
|
+
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
|
1312
|
+
|
1313
|
+
var DefaultWhitelist = {
|
1314
|
+
// Global attributes allowed on any supplied element below.
|
1315
|
+
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
1316
|
+
a: ['target', 'href', 'title', 'rel'],
|
1317
|
+
area: [],
|
1318
|
+
b: [],
|
1319
|
+
br: [],
|
1320
|
+
col: [],
|
1321
|
+
code: [],
|
1322
|
+
div: [],
|
1323
|
+
em: [],
|
1324
|
+
hr: [],
|
1325
|
+
h1: [],
|
1326
|
+
h2: [],
|
1327
|
+
h3: [],
|
1328
|
+
h4: [],
|
1329
|
+
h5: [],
|
1330
|
+
h6: [],
|
1331
|
+
i: [],
|
1332
|
+
img: ['src', 'alt', 'title', 'width', 'height'],
|
1333
|
+
li: [],
|
1334
|
+
ol: [],
|
1335
|
+
p: [],
|
1336
|
+
pre: [],
|
1337
|
+
s: [],
|
1338
|
+
small: [],
|
1339
|
+
span: [],
|
1340
|
+
sub: [],
|
1341
|
+
sup: [],
|
1342
|
+
strong: [],
|
1343
|
+
u: [],
|
1344
|
+
ul: []
|
1345
|
+
}
|
1346
|
+
|
1347
|
+
/**
|
1348
|
+
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
1349
|
+
*
|
1350
|
+
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
1351
|
+
*/
|
1352
|
+
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
|
1353
|
+
|
1354
|
+
/**
|
1355
|
+
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
1356
|
+
*
|
1357
|
+
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
1358
|
+
*/
|
1359
|
+
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
|
1360
|
+
|
1361
|
+
function allowedAttribute(attr, allowedAttributeList) {
|
1362
|
+
var attrName = attr.nodeName.toLowerCase()
|
1363
|
+
|
1364
|
+
if ($.inArray(attrName, allowedAttributeList) !== -1) {
|
1365
|
+
if ($.inArray(attrName, uriAttrs) !== -1) {
|
1366
|
+
return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
|
1367
|
+
}
|
1403
1368
|
|
1404
|
-
|
1405
|
-
this.$element
|
1406
|
-
.find('.modal-content')
|
1407
|
-
.load(this.options.remote, $.proxy(function () {
|
1408
|
-
this.$element.trigger('loaded.bs.modal')
|
1409
|
-
}, this))
|
1369
|
+
return true
|
1410
1370
|
}
|
1411
|
-
}
|
1412
1371
|
|
1413
|
-
|
1372
|
+
var regExp = $(allowedAttributeList).filter(function (index, value) {
|
1373
|
+
return value instanceof RegExp
|
1374
|
+
})
|
1414
1375
|
|
1415
|
-
|
1416
|
-
|
1376
|
+
// Check if a regular expression validates the attribute.
|
1377
|
+
for (var i = 0, l = regExp.length; i < l; i++) {
|
1378
|
+
if (attrName.match(regExp[i])) {
|
1379
|
+
return true
|
1380
|
+
}
|
1381
|
+
}
|
1417
1382
|
|
1418
|
-
|
1419
|
-
backdrop: true,
|
1420
|
-
keyboard: true,
|
1421
|
-
show: true
|
1383
|
+
return false
|
1422
1384
|
}
|
1423
1385
|
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1386
|
+
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
1387
|
+
if (unsafeHtml.length === 0) {
|
1388
|
+
return unsafeHtml
|
1389
|
+
}
|
1427
1390
|
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1391
|
+
if (sanitizeFn && typeof sanitizeFn === 'function') {
|
1392
|
+
return sanitizeFn(unsafeHtml)
|
1393
|
+
}
|
1431
1394
|
|
1432
|
-
|
1395
|
+
// IE 8 and below don't support createHTMLDocument
|
1396
|
+
if (!document.implementation || !document.implementation.createHTMLDocument) {
|
1397
|
+
return unsafeHtml
|
1398
|
+
}
|
1433
1399
|
|
1434
|
-
|
1400
|
+
var createdDocument = document.implementation.createHTMLDocument('sanitization')
|
1401
|
+
createdDocument.body.innerHTML = unsafeHtml
|
1435
1402
|
|
1436
|
-
|
1403
|
+
var whitelistKeys = $.map(whiteList, function (el, i) { return i })
|
1404
|
+
var elements = $(createdDocument.body).find('*')
|
1437
1405
|
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1406
|
+
for (var i = 0, len = elements.length; i < len; i++) {
|
1407
|
+
var el = elements[i]
|
1408
|
+
var elName = el.nodeName.toLowerCase()
|
1441
1409
|
|
1442
|
-
|
1443
|
-
|
1410
|
+
if ($.inArray(elName, whitelistKeys) === -1) {
|
1411
|
+
el.parentNode.removeChild(el)
|
1444
1412
|
|
1445
|
-
|
1413
|
+
continue
|
1414
|
+
}
|
1446
1415
|
|
1447
|
-
|
1448
|
-
var
|
1416
|
+
var attributeList = $.map(el.attributes, function (el) { return el })
|
1417
|
+
var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
|
1449
1418
|
|
1450
|
-
|
1451
|
-
|
1419
|
+
for (var j = 0, len2 = attributeList.length; j < len2; j++) {
|
1420
|
+
if (!allowedAttribute(attributeList[j], whitelistedAttributes)) {
|
1421
|
+
el.removeAttribute(attributeList[j].nodeName)
|
1422
|
+
}
|
1452
1423
|
}
|
1424
|
+
}
|
1453
1425
|
|
1454
|
-
|
1455
|
-
|
1456
|
-
.scrollTop(0)
|
1426
|
+
return createdDocument.body.innerHTML
|
1427
|
+
}
|
1457
1428
|
|
1458
|
-
|
1459
|
-
|
1429
|
+
// TOOLTIP PUBLIC CLASS DEFINITION
|
1430
|
+
// ===============================
|
1460
1431
|
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1432
|
+
var Tooltip = function (element, options) {
|
1433
|
+
this.type = null
|
1434
|
+
this.options = null
|
1435
|
+
this.enabled = null
|
1436
|
+
this.timeout = null
|
1437
|
+
this.hoverState = null
|
1438
|
+
this.$element = null
|
1439
|
+
this.inState = null
|
1464
1440
|
|
1465
|
-
|
1466
|
-
|
1467
|
-
.attr('aria-hidden', false)
|
1441
|
+
this.init('tooltip', element, options)
|
1442
|
+
}
|
1468
1443
|
|
1469
|
-
|
1444
|
+
Tooltip.VERSION = '3.4.1'
|
1470
1445
|
|
1471
|
-
|
1472
|
-
|
1473
|
-
transition ?
|
1474
|
-
that.$element.find('.modal-dialog') // wait for modal to slide in
|
1475
|
-
.one('bsTransitionEnd', function () {
|
1476
|
-
that.$element.trigger('focus').trigger(e)
|
1477
|
-
})
|
1478
|
-
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
1479
|
-
that.$element.trigger('focus').trigger(e)
|
1480
|
-
})
|
1481
|
-
}
|
1482
|
-
|
1483
|
-
Modal.prototype.hide = function (e) {
|
1484
|
-
if (e) e.preventDefault()
|
1485
|
-
|
1486
|
-
e = $.Event('hide.bs.modal')
|
1487
|
-
|
1488
|
-
this.$element.trigger(e)
|
1489
|
-
|
1490
|
-
if (!this.isShown || e.isDefaultPrevented()) return
|
1491
|
-
|
1492
|
-
this.isShown = false
|
1493
|
-
|
1494
|
-
this.escape()
|
1495
|
-
this.resize()
|
1496
|
-
|
1497
|
-
$(document).off('focusin.bs.modal')
|
1498
|
-
|
1499
|
-
this.$element
|
1500
|
-
.removeClass('in')
|
1501
|
-
.attr('aria-hidden', true)
|
1502
|
-
.off('click.dismiss.bs.modal')
|
1503
|
-
|
1504
|
-
$.support.transition && this.$element.hasClass('fade') ?
|
1505
|
-
this.$element
|
1506
|
-
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
|
1507
|
-
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
1508
|
-
this.hideModal()
|
1509
|
-
}
|
1510
|
-
|
1511
|
-
Modal.prototype.enforceFocus = function () {
|
1512
|
-
$(document)
|
1513
|
-
.off('focusin.bs.modal') // guard against infinite focus loop
|
1514
|
-
.on('focusin.bs.modal', $.proxy(function (e) {
|
1515
|
-
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
1516
|
-
this.$element.trigger('focus')
|
1517
|
-
}
|
1518
|
-
}, this))
|
1519
|
-
}
|
1520
|
-
|
1521
|
-
Modal.prototype.escape = function () {
|
1522
|
-
if (this.isShown && this.options.keyboard) {
|
1523
|
-
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
|
1524
|
-
e.which == 27 && this.hide()
|
1525
|
-
}, this))
|
1526
|
-
} else if (!this.isShown) {
|
1527
|
-
this.$element.off('keydown.dismiss.bs.modal')
|
1528
|
-
}
|
1529
|
-
}
|
1530
|
-
|
1531
|
-
Modal.prototype.resize = function () {
|
1532
|
-
if (this.isShown) {
|
1533
|
-
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
|
1534
|
-
} else {
|
1535
|
-
$(window).off('resize.bs.modal')
|
1536
|
-
}
|
1537
|
-
}
|
1538
|
-
|
1539
|
-
Modal.prototype.hideModal = function () {
|
1540
|
-
var that = this
|
1541
|
-
this.$element.hide()
|
1542
|
-
this.backdrop(function () {
|
1543
|
-
that.$body.removeClass('modal-open')
|
1544
|
-
that.resetAdjustments()
|
1545
|
-
that.resetScrollbar()
|
1546
|
-
that.$element.trigger('hidden.bs.modal')
|
1547
|
-
})
|
1548
|
-
}
|
1549
|
-
|
1550
|
-
Modal.prototype.removeBackdrop = function () {
|
1551
|
-
this.$backdrop && this.$backdrop.remove()
|
1552
|
-
this.$backdrop = null
|
1553
|
-
}
|
1554
|
-
|
1555
|
-
Modal.prototype.backdrop = function (callback) {
|
1556
|
-
var that = this
|
1557
|
-
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
1558
|
-
|
1559
|
-
if (this.isShown && this.options.backdrop) {
|
1560
|
-
var doAnimate = $.support.transition && animate
|
1561
|
-
|
1562
|
-
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
1563
|
-
.prependTo(this.$element)
|
1564
|
-
.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
1565
|
-
if (e.target !== e.currentTarget) return
|
1566
|
-
this.options.backdrop == 'static'
|
1567
|
-
? this.$element[0].focus.call(this.$element[0])
|
1568
|
-
: this.hide.call(this)
|
1569
|
-
}, this))
|
1570
|
-
|
1571
|
-
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
1572
|
-
|
1573
|
-
this.$backdrop.addClass('in')
|
1574
|
-
|
1575
|
-
if (!callback) return
|
1576
|
-
|
1577
|
-
doAnimate ?
|
1578
|
-
this.$backdrop
|
1579
|
-
.one('bsTransitionEnd', callback)
|
1580
|
-
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
1581
|
-
callback()
|
1582
|
-
|
1583
|
-
} else if (!this.isShown && this.$backdrop) {
|
1584
|
-
this.$backdrop.removeClass('in')
|
1585
|
-
|
1586
|
-
var callbackRemove = function () {
|
1587
|
-
that.removeBackdrop()
|
1588
|
-
callback && callback()
|
1589
|
-
}
|
1590
|
-
$.support.transition && this.$element.hasClass('fade') ?
|
1591
|
-
this.$backdrop
|
1592
|
-
.one('bsTransitionEnd', callbackRemove)
|
1593
|
-
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
1594
|
-
callbackRemove()
|
1595
|
-
|
1596
|
-
} else if (callback) {
|
1597
|
-
callback()
|
1598
|
-
}
|
1599
|
-
}
|
1600
|
-
|
1601
|
-
// these following methods are used to handle overflowing modals
|
1602
|
-
|
1603
|
-
Modal.prototype.handleUpdate = function () {
|
1604
|
-
if (this.options.backdrop) this.adjustBackdrop()
|
1605
|
-
this.adjustDialog()
|
1606
|
-
}
|
1607
|
-
|
1608
|
-
Modal.prototype.adjustBackdrop = function () {
|
1609
|
-
this.$backdrop
|
1610
|
-
.css('height', 0)
|
1611
|
-
.css('height', this.$element[0].scrollHeight)
|
1612
|
-
}
|
1613
|
-
|
1614
|
-
Modal.prototype.adjustDialog = function () {
|
1615
|
-
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
1616
|
-
|
1617
|
-
this.$element.css({
|
1618
|
-
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
1619
|
-
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
|
1620
|
-
})
|
1621
|
-
}
|
1622
|
-
|
1623
|
-
Modal.prototype.resetAdjustments = function () {
|
1624
|
-
this.$element.css({
|
1625
|
-
paddingLeft: '',
|
1626
|
-
paddingRight: ''
|
1627
|
-
})
|
1628
|
-
}
|
1629
|
-
|
1630
|
-
Modal.prototype.checkScrollbar = function () {
|
1631
|
-
this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
|
1632
|
-
this.scrollbarWidth = this.measureScrollbar()
|
1633
|
-
}
|
1634
|
-
|
1635
|
-
Modal.prototype.setScrollbar = function () {
|
1636
|
-
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
1637
|
-
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
1638
|
-
}
|
1639
|
-
|
1640
|
-
Modal.prototype.resetScrollbar = function () {
|
1641
|
-
this.$body.css('padding-right', '')
|
1642
|
-
}
|
1643
|
-
|
1644
|
-
Modal.prototype.measureScrollbar = function () { // thx walsh
|
1645
|
-
var scrollDiv = document.createElement('div')
|
1646
|
-
scrollDiv.className = 'modal-scrollbar-measure'
|
1647
|
-
this.$body.append(scrollDiv)
|
1648
|
-
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
|
1649
|
-
this.$body[0].removeChild(scrollDiv)
|
1650
|
-
return scrollbarWidth
|
1651
|
-
}
|
1652
|
-
|
1653
|
-
|
1654
|
-
// MODAL PLUGIN DEFINITION
|
1655
|
-
// =======================
|
1656
|
-
|
1657
|
-
function Plugin(option, _relatedTarget) {
|
1658
|
-
return this.each(function () {
|
1659
|
-
var $this = $(this)
|
1660
|
-
var data = $this.data('bs.modal')
|
1661
|
-
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
1662
|
-
|
1663
|
-
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
1664
|
-
if (typeof option == 'string') data[option](_relatedTarget)
|
1665
|
-
else if (options.show) data.show(_relatedTarget)
|
1666
|
-
})
|
1667
|
-
}
|
1668
|
-
|
1669
|
-
var old = $.fn.modal
|
1670
|
-
|
1671
|
-
$.fn.modal = Plugin
|
1672
|
-
$.fn.modal.Constructor = Modal
|
1673
|
-
|
1674
|
-
|
1675
|
-
// MODAL NO CONFLICT
|
1676
|
-
// =================
|
1677
|
-
|
1678
|
-
$.fn.modal.noConflict = function () {
|
1679
|
-
$.fn.modal = old
|
1680
|
-
return this
|
1681
|
-
}
|
1682
|
-
|
1683
|
-
|
1684
|
-
// MODAL DATA-API
|
1685
|
-
// ==============
|
1686
|
-
|
1687
|
-
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
1688
|
-
var $this = $(this)
|
1689
|
-
var href = $this.attr('href')
|
1690
|
-
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
|
1691
|
-
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
1692
|
-
|
1693
|
-
if ($this.is('a')) e.preventDefault()
|
1694
|
-
|
1695
|
-
$target.one('show.bs.modal', function (showEvent) {
|
1696
|
-
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
|
1697
|
-
$target.one('hidden.bs.modal', function () {
|
1698
|
-
$this.is(':visible') && $this.trigger('focus')
|
1699
|
-
})
|
1700
|
-
})
|
1701
|
-
Plugin.call($target, option, this)
|
1702
|
-
})
|
1703
|
-
|
1704
|
-
}(jQuery);
|
1705
|
-
|
1706
|
-
/* ========================================================================
|
1707
|
-
* Bootstrap: tooltip.js v3.3.1
|
1708
|
-
* http://getbootstrap.com/javascript/#tooltip
|
1709
|
-
* Inspired by the original jQuery.tipsy by Jason Frame
|
1710
|
-
* ========================================================================
|
1711
|
-
* Copyright 2011-2014 Twitter, Inc.
|
1712
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1713
|
-
* ======================================================================== */
|
1714
|
-
|
1715
|
-
|
1716
|
-
+function ($) {
|
1717
|
-
'use strict';
|
1718
|
-
|
1719
|
-
// TOOLTIP PUBLIC CLASS DEFINITION
|
1720
|
-
// ===============================
|
1721
|
-
|
1722
|
-
var Tooltip = function (element, options) {
|
1723
|
-
this.type =
|
1724
|
-
this.options =
|
1725
|
-
this.enabled =
|
1726
|
-
this.timeout =
|
1727
|
-
this.hoverState =
|
1728
|
-
this.$element = null
|
1729
|
-
|
1730
|
-
this.init('tooltip', element, options)
|
1731
|
-
}
|
1732
|
-
|
1733
|
-
Tooltip.VERSION = '3.3.1'
|
1734
|
-
|
1735
|
-
Tooltip.TRANSITION_DURATION = 150
|
1446
|
+
Tooltip.TRANSITION_DURATION = 150
|
1736
1447
|
|
1737
1448
|
Tooltip.DEFAULTS = {
|
1738
1449
|
animation: true,
|
@@ -1747,7 +1458,10 @@
|
|
1747
1458
|
viewport: {
|
1748
1459
|
selector: 'body',
|
1749
1460
|
padding: 0
|
1750
|
-
}
|
1461
|
+
},
|
1462
|
+
sanitize : true,
|
1463
|
+
sanitizeFn : null,
|
1464
|
+
whiteList : DefaultWhitelist
|
1751
1465
|
}
|
1752
1466
|
|
1753
1467
|
Tooltip.prototype.init = function (type, element, options) {
|
@@ -1755,7 +1469,12 @@
|
|
1755
1469
|
this.type = type
|
1756
1470
|
this.$element = $(element)
|
1757
1471
|
this.options = this.getOptions(options)
|
1758
|
-
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
|
1472
|
+
this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
|
1473
|
+
this.inState = { click: false, hover: false, focus: false }
|
1474
|
+
|
1475
|
+
if (this.$element[0] instanceof document.constructor && !this.options.selector) {
|
1476
|
+
throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
|
1477
|
+
}
|
1759
1478
|
|
1760
1479
|
var triggers = this.options.trigger.split(' ')
|
1761
1480
|
|
@@ -1783,7 +1502,15 @@
|
|
1783
1502
|
}
|
1784
1503
|
|
1785
1504
|
Tooltip.prototype.getOptions = function (options) {
|
1786
|
-
|
1505
|
+
var dataAttributes = this.$element.data()
|
1506
|
+
|
1507
|
+
for (var dataAttr in dataAttributes) {
|
1508
|
+
if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
|
1509
|
+
delete dataAttributes[dataAttr]
|
1510
|
+
}
|
1511
|
+
}
|
1512
|
+
|
1513
|
+
options = $.extend({}, this.getDefaults(), dataAttributes, options)
|
1787
1514
|
|
1788
1515
|
if (options.delay && typeof options.delay == 'number') {
|
1789
1516
|
options.delay = {
|
@@ -1792,6 +1519,10 @@
|
|
1792
1519
|
}
|
1793
1520
|
}
|
1794
1521
|
|
1522
|
+
if (options.sanitize) {
|
1523
|
+
options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn)
|
1524
|
+
}
|
1525
|
+
|
1795
1526
|
return options
|
1796
1527
|
}
|
1797
1528
|
|
@@ -1810,16 +1541,20 @@
|
|
1810
1541
|
var self = obj instanceof this.constructor ?
|
1811
1542
|
obj : $(obj.currentTarget).data('bs.' + this.type)
|
1812
1543
|
|
1813
|
-
if (self && self.$tip && self.$tip.is(':visible')) {
|
1814
|
-
self.hoverState = 'in'
|
1815
|
-
return
|
1816
|
-
}
|
1817
|
-
|
1818
1544
|
if (!self) {
|
1819
1545
|
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
1820
1546
|
$(obj.currentTarget).data('bs.' + this.type, self)
|
1821
1547
|
}
|
1822
1548
|
|
1549
|
+
if (obj instanceof $.Event) {
|
1550
|
+
self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
|
1551
|
+
}
|
1552
|
+
|
1553
|
+
if (self.tip().hasClass('in') || self.hoverState == 'in') {
|
1554
|
+
self.hoverState = 'in'
|
1555
|
+
return
|
1556
|
+
}
|
1557
|
+
|
1823
1558
|
clearTimeout(self.timeout)
|
1824
1559
|
|
1825
1560
|
self.hoverState = 'in'
|
@@ -1831,6 +1566,14 @@
|
|
1831
1566
|
}, self.options.delay.show)
|
1832
1567
|
}
|
1833
1568
|
|
1569
|
+
Tooltip.prototype.isInStateTrue = function () {
|
1570
|
+
for (var key in this.inState) {
|
1571
|
+
if (this.inState[key]) return true
|
1572
|
+
}
|
1573
|
+
|
1574
|
+
return false
|
1575
|
+
}
|
1576
|
+
|
1834
1577
|
Tooltip.prototype.leave = function (obj) {
|
1835
1578
|
var self = obj instanceof this.constructor ?
|
1836
1579
|
obj : $(obj.currentTarget).data('bs.' + this.type)
|
@@ -1840,6 +1583,12 @@
|
|
1840
1583
|
$(obj.currentTarget).data('bs.' + this.type, self)
|
1841
1584
|
}
|
1842
1585
|
|
1586
|
+
if (obj instanceof $.Event) {
|
1587
|
+
self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
if (self.isInStateTrue()) return
|
1591
|
+
|
1843
1592
|
clearTimeout(self.timeout)
|
1844
1593
|
|
1845
1594
|
self.hoverState = 'out'
|
@@ -1885,7 +1634,8 @@
|
|
1885
1634
|
.addClass(placement)
|
1886
1635
|
.data('bs.' + this.type, this)
|
1887
1636
|
|
1888
|
-
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
1637
|
+
this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element)
|
1638
|
+
this.$element.trigger('inserted.bs.' + this.type)
|
1889
1639
|
|
1890
1640
|
var pos = this.getPosition()
|
1891
1641
|
var actualWidth = $tip[0].offsetWidth
|
@@ -1893,13 +1643,12 @@
|
|
1893
1643
|
|
1894
1644
|
if (autoPlace) {
|
1895
1645
|
var orgPlacement = placement
|
1896
|
-
var
|
1897
|
-
var containerDim = this.getPosition($container)
|
1646
|
+
var viewportDim = this.getPosition(this.$viewport)
|
1898
1647
|
|
1899
|
-
placement = placement == 'bottom' && pos.bottom + actualHeight >
|
1900
|
-
placement == 'top' && pos.top - actualHeight <
|
1901
|
-
placement == 'right' && pos.right + actualWidth >
|
1902
|
-
placement == 'left' && pos.left - actualWidth <
|
1648
|
+
placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
|
1649
|
+
placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
|
1650
|
+
placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
|
1651
|
+
placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
|
1903
1652
|
placement
|
1904
1653
|
|
1905
1654
|
$tip
|
@@ -1940,8 +1689,8 @@
|
|
1940
1689
|
if (isNaN(marginTop)) marginTop = 0
|
1941
1690
|
if (isNaN(marginLeft)) marginLeft = 0
|
1942
1691
|
|
1943
|
-
offset.top
|
1944
|
-
offset.left
|
1692
|
+
offset.top += marginTop
|
1693
|
+
offset.left += marginLeft
|
1945
1694
|
|
1946
1695
|
// $.fn.offset doesn't round pixel values
|
1947
1696
|
// so we use setOffset directly with our own function B-0
|
@@ -1977,30 +1726,41 @@
|
|
1977
1726
|
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
|
1978
1727
|
}
|
1979
1728
|
|
1980
|
-
Tooltip.prototype.replaceArrow = function (delta, dimension,
|
1729
|
+
Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
|
1981
1730
|
this.arrow()
|
1982
|
-
.css(
|
1983
|
-
.css(
|
1731
|
+
.css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
|
1732
|
+
.css(isVertical ? 'top' : 'left', '')
|
1984
1733
|
}
|
1985
1734
|
|
1986
1735
|
Tooltip.prototype.setContent = function () {
|
1987
1736
|
var $tip = this.tip()
|
1988
1737
|
var title = this.getTitle()
|
1989
1738
|
|
1990
|
-
|
1991
|
-
|
1739
|
+
if (this.options.html) {
|
1740
|
+
if (this.options.sanitize) {
|
1741
|
+
title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn)
|
1742
|
+
}
|
1743
|
+
|
1744
|
+
$tip.find('.tooltip-inner').html(title)
|
1745
|
+
} else {
|
1746
|
+
$tip.find('.tooltip-inner').text(title)
|
1747
|
+
}
|
1748
|
+
|
1749
|
+
$tip.removeClass('fade in top bottom left right')
|
1992
1750
|
}
|
1993
1751
|
|
1994
1752
|
Tooltip.prototype.hide = function (callback) {
|
1995
1753
|
var that = this
|
1996
|
-
var $tip = this
|
1754
|
+
var $tip = $(this.$tip)
|
1997
1755
|
var e = $.Event('hide.bs.' + this.type)
|
1998
1756
|
|
1999
1757
|
function complete() {
|
2000
1758
|
if (that.hoverState != 'in') $tip.detach()
|
2001
|
-
that.$element
|
2002
|
-
|
2003
|
-
|
1759
|
+
if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
|
1760
|
+
that.$element
|
1761
|
+
.removeAttr('aria-describedby')
|
1762
|
+
.trigger('hidden.bs.' + that.type)
|
1763
|
+
}
|
2004
1764
|
callback && callback()
|
2005
1765
|
}
|
2006
1766
|
|
@@ -2010,7 +1770,7 @@
|
|
2010
1770
|
|
2011
1771
|
$tip.removeClass('in')
|
2012
1772
|
|
2013
|
-
$.support.transition &&
|
1773
|
+
$.support.transition && $tip.hasClass('fade') ?
|
2014
1774
|
$tip
|
2015
1775
|
.one('bsTransitionEnd', complete)
|
2016
1776
|
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
@@ -2023,7 +1783,7 @@
|
|
2023
1783
|
|
2024
1784
|
Tooltip.prototype.fixTitle = function () {
|
2025
1785
|
var $e = this.$element
|
2026
|
-
if ($e.attr('title') || typeof
|
1786
|
+
if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
|
2027
1787
|
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
2028
1788
|
}
|
2029
1789
|
}
|
@@ -2043,7 +1803,10 @@
|
|
2043
1803
|
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
2044
1804
|
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
|
2045
1805
|
}
|
2046
|
-
var
|
1806
|
+
var isSvg = window.SVGElement && el instanceof window.SVGElement
|
1807
|
+
// Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
|
1808
|
+
// See https://github.com/twbs/bootstrap/issues/20280
|
1809
|
+
var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
|
2047
1810
|
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
2048
1811
|
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
2049
1812
|
|
@@ -2051,10 +1814,10 @@
|
|
2051
1814
|
}
|
2052
1815
|
|
2053
1816
|
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
2054
|
-
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2
|
2055
|
-
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2
|
1817
|
+
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
1818
|
+
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
2056
1819
|
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
2057
|
-
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width
|
1820
|
+
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
2058
1821
|
|
2059
1822
|
}
|
2060
1823
|
|
@@ -2078,7 +1841,7 @@
|
|
2078
1841
|
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
|
2079
1842
|
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
|
2080
1843
|
delta.left = viewportDimensions.left - leftEdgeOffset
|
2081
|
-
} else if (rightEdgeOffset > viewportDimensions.
|
1844
|
+
} else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
|
2082
1845
|
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
|
2083
1846
|
}
|
2084
1847
|
}
|
@@ -2104,89 +1867,558 @@
|
|
2104
1867
|
}
|
2105
1868
|
|
2106
1869
|
Tooltip.prototype.tip = function () {
|
2107
|
-
|
1870
|
+
if (!this.$tip) {
|
1871
|
+
this.$tip = $(this.options.template)
|
1872
|
+
if (this.$tip.length != 1) {
|
1873
|
+
throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
|
1874
|
+
}
|
1875
|
+
}
|
1876
|
+
return this.$tip
|
1877
|
+
}
|
1878
|
+
|
1879
|
+
Tooltip.prototype.arrow = function () {
|
1880
|
+
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
|
1881
|
+
}
|
1882
|
+
|
1883
|
+
Tooltip.prototype.enable = function () {
|
1884
|
+
this.enabled = true
|
1885
|
+
}
|
1886
|
+
|
1887
|
+
Tooltip.prototype.disable = function () {
|
1888
|
+
this.enabled = false
|
1889
|
+
}
|
1890
|
+
|
1891
|
+
Tooltip.prototype.toggleEnabled = function () {
|
1892
|
+
this.enabled = !this.enabled
|
1893
|
+
}
|
1894
|
+
|
1895
|
+
Tooltip.prototype.toggle = function (e) {
|
1896
|
+
var self = this
|
1897
|
+
if (e) {
|
1898
|
+
self = $(e.currentTarget).data('bs.' + this.type)
|
1899
|
+
if (!self) {
|
1900
|
+
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
|
1901
|
+
$(e.currentTarget).data('bs.' + this.type, self)
|
1902
|
+
}
|
1903
|
+
}
|
1904
|
+
|
1905
|
+
if (e) {
|
1906
|
+
self.inState.click = !self.inState.click
|
1907
|
+
if (self.isInStateTrue()) self.enter(self)
|
1908
|
+
else self.leave(self)
|
1909
|
+
} else {
|
1910
|
+
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
1911
|
+
}
|
1912
|
+
}
|
1913
|
+
|
1914
|
+
Tooltip.prototype.destroy = function () {
|
1915
|
+
var that = this
|
1916
|
+
clearTimeout(this.timeout)
|
1917
|
+
this.hide(function () {
|
1918
|
+
that.$element.off('.' + that.type).removeData('bs.' + that.type)
|
1919
|
+
if (that.$tip) {
|
1920
|
+
that.$tip.detach()
|
1921
|
+
}
|
1922
|
+
that.$tip = null
|
1923
|
+
that.$arrow = null
|
1924
|
+
that.$viewport = null
|
1925
|
+
that.$element = null
|
1926
|
+
})
|
1927
|
+
}
|
1928
|
+
|
1929
|
+
Tooltip.prototype.sanitizeHtml = function (unsafeHtml) {
|
1930
|
+
return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn)
|
1931
|
+
}
|
1932
|
+
|
1933
|
+
// TOOLTIP PLUGIN DEFINITION
|
1934
|
+
// =========================
|
1935
|
+
|
1936
|
+
function Plugin(option) {
|
1937
|
+
return this.each(function () {
|
1938
|
+
var $this = $(this)
|
1939
|
+
var data = $this.data('bs.tooltip')
|
1940
|
+
var options = typeof option == 'object' && option
|
1941
|
+
|
1942
|
+
if (!data && /destroy|hide/.test(option)) return
|
1943
|
+
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
1944
|
+
if (typeof option == 'string') data[option]()
|
1945
|
+
})
|
1946
|
+
}
|
1947
|
+
|
1948
|
+
var old = $.fn.tooltip
|
1949
|
+
|
1950
|
+
$.fn.tooltip = Plugin
|
1951
|
+
$.fn.tooltip.Constructor = Tooltip
|
1952
|
+
|
1953
|
+
|
1954
|
+
// TOOLTIP NO CONFLICT
|
1955
|
+
// ===================
|
1956
|
+
|
1957
|
+
$.fn.tooltip.noConflict = function () {
|
1958
|
+
$.fn.tooltip = old
|
1959
|
+
return this
|
1960
|
+
}
|
1961
|
+
|
1962
|
+
}(jQuery);
|
1963
|
+
|
1964
|
+
/* ========================================================================
|
1965
|
+
* Bootstrap: popover.js v3.4.1
|
1966
|
+
* https://getbootstrap.com/docs/3.4/javascript/#popovers
|
1967
|
+
* ========================================================================
|
1968
|
+
* Copyright 2011-2019 Twitter, Inc.
|
1969
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1970
|
+
* ======================================================================== */
|
1971
|
+
|
1972
|
+
|
1973
|
+
+function ($) {
|
1974
|
+
'use strict';
|
1975
|
+
|
1976
|
+
// POPOVER PUBLIC CLASS DEFINITION
|
1977
|
+
// ===============================
|
1978
|
+
|
1979
|
+
var Popover = function (element, options) {
|
1980
|
+
this.init('popover', element, options)
|
1981
|
+
}
|
1982
|
+
|
1983
|
+
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
1984
|
+
|
1985
|
+
Popover.VERSION = '3.4.1'
|
1986
|
+
|
1987
|
+
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
1988
|
+
placement: 'right',
|
1989
|
+
trigger: 'click',
|
1990
|
+
content: '',
|
1991
|
+
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
1992
|
+
})
|
1993
|
+
|
1994
|
+
|
1995
|
+
// NOTE: POPOVER EXTENDS tooltip.js
|
1996
|
+
// ================================
|
1997
|
+
|
1998
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
1999
|
+
|
2000
|
+
Popover.prototype.constructor = Popover
|
2001
|
+
|
2002
|
+
Popover.prototype.getDefaults = function () {
|
2003
|
+
return Popover.DEFAULTS
|
2004
|
+
}
|
2005
|
+
|
2006
|
+
Popover.prototype.setContent = function () {
|
2007
|
+
var $tip = this.tip()
|
2008
|
+
var title = this.getTitle()
|
2009
|
+
var content = this.getContent()
|
2010
|
+
|
2011
|
+
if (this.options.html) {
|
2012
|
+
var typeContent = typeof content
|
2013
|
+
|
2014
|
+
if (this.options.sanitize) {
|
2015
|
+
title = this.sanitizeHtml(title)
|
2016
|
+
|
2017
|
+
if (typeContent === 'string') {
|
2018
|
+
content = this.sanitizeHtml(content)
|
2019
|
+
}
|
2020
|
+
}
|
2021
|
+
|
2022
|
+
$tip.find('.popover-title').html(title)
|
2023
|
+
$tip.find('.popover-content').children().detach().end()[
|
2024
|
+
typeContent === 'string' ? 'html' : 'append'
|
2025
|
+
](content)
|
2026
|
+
} else {
|
2027
|
+
$tip.find('.popover-title').text(title)
|
2028
|
+
$tip.find('.popover-content').children().detach().end().text(content)
|
2029
|
+
}
|
2030
|
+
|
2031
|
+
$tip.removeClass('fade top bottom left right in')
|
2032
|
+
|
2033
|
+
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
2034
|
+
// this manually by checking the contents.
|
2035
|
+
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
2036
|
+
}
|
2037
|
+
|
2038
|
+
Popover.prototype.hasContent = function () {
|
2039
|
+
return this.getTitle() || this.getContent()
|
2040
|
+
}
|
2041
|
+
|
2042
|
+
Popover.prototype.getContent = function () {
|
2043
|
+
var $e = this.$element
|
2044
|
+
var o = this.options
|
2045
|
+
|
2046
|
+
return $e.attr('data-content')
|
2047
|
+
|| (typeof o.content == 'function' ?
|
2048
|
+
o.content.call($e[0]) :
|
2049
|
+
o.content)
|
2050
|
+
}
|
2051
|
+
|
2052
|
+
Popover.prototype.arrow = function () {
|
2053
|
+
return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
|
2054
|
+
}
|
2055
|
+
|
2056
|
+
|
2057
|
+
// POPOVER PLUGIN DEFINITION
|
2058
|
+
// =========================
|
2059
|
+
|
2060
|
+
function Plugin(option) {
|
2061
|
+
return this.each(function () {
|
2062
|
+
var $this = $(this)
|
2063
|
+
var data = $this.data('bs.popover')
|
2064
|
+
var options = typeof option == 'object' && option
|
2065
|
+
|
2066
|
+
if (!data && /destroy|hide/.test(option)) return
|
2067
|
+
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
2068
|
+
if (typeof option == 'string') data[option]()
|
2069
|
+
})
|
2070
|
+
}
|
2071
|
+
|
2072
|
+
var old = $.fn.popover
|
2073
|
+
|
2074
|
+
$.fn.popover = Plugin
|
2075
|
+
$.fn.popover.Constructor = Popover
|
2076
|
+
|
2077
|
+
|
2078
|
+
// POPOVER NO CONFLICT
|
2079
|
+
// ===================
|
2080
|
+
|
2081
|
+
$.fn.popover.noConflict = function () {
|
2082
|
+
$.fn.popover = old
|
2083
|
+
return this
|
2084
|
+
}
|
2085
|
+
|
2086
|
+
}(jQuery);
|
2087
|
+
|
2088
|
+
/* ========================================================================
|
2089
|
+
* Bootstrap: scrollspy.js v3.4.1
|
2090
|
+
* https://getbootstrap.com/docs/3.4/javascript/#scrollspy
|
2091
|
+
* ========================================================================
|
2092
|
+
* Copyright 2011-2019 Twitter, Inc.
|
2093
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2094
|
+
* ======================================================================== */
|
2095
|
+
|
2096
|
+
|
2097
|
+
+function ($) {
|
2098
|
+
'use strict';
|
2099
|
+
|
2100
|
+
// SCROLLSPY CLASS DEFINITION
|
2101
|
+
// ==========================
|
2102
|
+
|
2103
|
+
function ScrollSpy(element, options) {
|
2104
|
+
this.$body = $(document.body)
|
2105
|
+
this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
|
2106
|
+
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
2107
|
+
this.selector = (this.options.target || '') + ' .nav li > a'
|
2108
|
+
this.offsets = []
|
2109
|
+
this.targets = []
|
2110
|
+
this.activeTarget = null
|
2111
|
+
this.scrollHeight = 0
|
2112
|
+
|
2113
|
+
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
|
2114
|
+
this.refresh()
|
2115
|
+
this.process()
|
2116
|
+
}
|
2117
|
+
|
2118
|
+
ScrollSpy.VERSION = '3.4.1'
|
2119
|
+
|
2120
|
+
ScrollSpy.DEFAULTS = {
|
2121
|
+
offset: 10
|
2122
|
+
}
|
2123
|
+
|
2124
|
+
ScrollSpy.prototype.getScrollHeight = function () {
|
2125
|
+
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
|
2126
|
+
}
|
2127
|
+
|
2128
|
+
ScrollSpy.prototype.refresh = function () {
|
2129
|
+
var that = this
|
2130
|
+
var offsetMethod = 'offset'
|
2131
|
+
var offsetBase = 0
|
2132
|
+
|
2133
|
+
this.offsets = []
|
2134
|
+
this.targets = []
|
2135
|
+
this.scrollHeight = this.getScrollHeight()
|
2136
|
+
|
2137
|
+
if (!$.isWindow(this.$scrollElement[0])) {
|
2138
|
+
offsetMethod = 'position'
|
2139
|
+
offsetBase = this.$scrollElement.scrollTop()
|
2140
|
+
}
|
2141
|
+
|
2142
|
+
this.$body
|
2143
|
+
.find(this.selector)
|
2144
|
+
.map(function () {
|
2145
|
+
var $el = $(this)
|
2146
|
+
var href = $el.data('target') || $el.attr('href')
|
2147
|
+
var $href = /^#./.test(href) && $(href)
|
2148
|
+
|
2149
|
+
return ($href
|
2150
|
+
&& $href.length
|
2151
|
+
&& $href.is(':visible')
|
2152
|
+
&& [[$href[offsetMethod]().top + offsetBase, href]]) || null
|
2153
|
+
})
|
2154
|
+
.sort(function (a, b) { return a[0] - b[0] })
|
2155
|
+
.each(function () {
|
2156
|
+
that.offsets.push(this[0])
|
2157
|
+
that.targets.push(this[1])
|
2158
|
+
})
|
2159
|
+
}
|
2160
|
+
|
2161
|
+
ScrollSpy.prototype.process = function () {
|
2162
|
+
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
2163
|
+
var scrollHeight = this.getScrollHeight()
|
2164
|
+
var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
|
2165
|
+
var offsets = this.offsets
|
2166
|
+
var targets = this.targets
|
2167
|
+
var activeTarget = this.activeTarget
|
2168
|
+
var i
|
2169
|
+
|
2170
|
+
if (this.scrollHeight != scrollHeight) {
|
2171
|
+
this.refresh()
|
2172
|
+
}
|
2173
|
+
|
2174
|
+
if (scrollTop >= maxScroll) {
|
2175
|
+
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
|
2176
|
+
}
|
2177
|
+
|
2178
|
+
if (activeTarget && scrollTop < offsets[0]) {
|
2179
|
+
this.activeTarget = null
|
2180
|
+
return this.clear()
|
2181
|
+
}
|
2182
|
+
|
2183
|
+
for (i = offsets.length; i--;) {
|
2184
|
+
activeTarget != targets[i]
|
2185
|
+
&& scrollTop >= offsets[i]
|
2186
|
+
&& (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
|
2187
|
+
&& this.activate(targets[i])
|
2188
|
+
}
|
2189
|
+
}
|
2190
|
+
|
2191
|
+
ScrollSpy.prototype.activate = function (target) {
|
2192
|
+
this.activeTarget = target
|
2193
|
+
|
2194
|
+
this.clear()
|
2195
|
+
|
2196
|
+
var selector = this.selector +
|
2197
|
+
'[data-target="' + target + '"],' +
|
2198
|
+
this.selector + '[href="' + target + '"]'
|
2199
|
+
|
2200
|
+
var active = $(selector)
|
2201
|
+
.parents('li')
|
2202
|
+
.addClass('active')
|
2203
|
+
|
2204
|
+
if (active.parent('.dropdown-menu').length) {
|
2205
|
+
active = active
|
2206
|
+
.closest('li.dropdown')
|
2207
|
+
.addClass('active')
|
2208
|
+
}
|
2209
|
+
|
2210
|
+
active.trigger('activate.bs.scrollspy')
|
2211
|
+
}
|
2212
|
+
|
2213
|
+
ScrollSpy.prototype.clear = function () {
|
2214
|
+
$(this.selector)
|
2215
|
+
.parentsUntil(this.options.target, '.active')
|
2216
|
+
.removeClass('active')
|
2217
|
+
}
|
2218
|
+
|
2219
|
+
|
2220
|
+
// SCROLLSPY PLUGIN DEFINITION
|
2221
|
+
// ===========================
|
2222
|
+
|
2223
|
+
function Plugin(option) {
|
2224
|
+
return this.each(function () {
|
2225
|
+
var $this = $(this)
|
2226
|
+
var data = $this.data('bs.scrollspy')
|
2227
|
+
var options = typeof option == 'object' && option
|
2228
|
+
|
2229
|
+
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
2230
|
+
if (typeof option == 'string') data[option]()
|
2231
|
+
})
|
2232
|
+
}
|
2233
|
+
|
2234
|
+
var old = $.fn.scrollspy
|
2235
|
+
|
2236
|
+
$.fn.scrollspy = Plugin
|
2237
|
+
$.fn.scrollspy.Constructor = ScrollSpy
|
2238
|
+
|
2239
|
+
|
2240
|
+
// SCROLLSPY NO CONFLICT
|
2241
|
+
// =====================
|
2242
|
+
|
2243
|
+
$.fn.scrollspy.noConflict = function () {
|
2244
|
+
$.fn.scrollspy = old
|
2245
|
+
return this
|
2246
|
+
}
|
2247
|
+
|
2248
|
+
|
2249
|
+
// SCROLLSPY DATA-API
|
2250
|
+
// ==================
|
2251
|
+
|
2252
|
+
$(window).on('load.bs.scrollspy.data-api', function () {
|
2253
|
+
$('[data-spy="scroll"]').each(function () {
|
2254
|
+
var $spy = $(this)
|
2255
|
+
Plugin.call($spy, $spy.data())
|
2256
|
+
})
|
2257
|
+
})
|
2258
|
+
|
2259
|
+
}(jQuery);
|
2260
|
+
|
2261
|
+
/* ========================================================================
|
2262
|
+
* Bootstrap: tab.js v3.4.1
|
2263
|
+
* https://getbootstrap.com/docs/3.4/javascript/#tabs
|
2264
|
+
* ========================================================================
|
2265
|
+
* Copyright 2011-2019 Twitter, Inc.
|
2266
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2267
|
+
* ======================================================================== */
|
2268
|
+
|
2269
|
+
|
2270
|
+
+function ($) {
|
2271
|
+
'use strict';
|
2272
|
+
|
2273
|
+
// TAB CLASS DEFINITION
|
2274
|
+
// ====================
|
2275
|
+
|
2276
|
+
var Tab = function (element) {
|
2277
|
+
// jscs:disable requireDollarBeforejQueryAssignment
|
2278
|
+
this.element = $(element)
|
2279
|
+
// jscs:enable requireDollarBeforejQueryAssignment
|
2280
|
+
}
|
2281
|
+
|
2282
|
+
Tab.VERSION = '3.4.1'
|
2283
|
+
|
2284
|
+
Tab.TRANSITION_DURATION = 150
|
2285
|
+
|
2286
|
+
Tab.prototype.show = function () {
|
2287
|
+
var $this = this.element
|
2288
|
+
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
2289
|
+
var selector = $this.data('target')
|
2290
|
+
|
2291
|
+
if (!selector) {
|
2292
|
+
selector = $this.attr('href')
|
2293
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
2294
|
+
}
|
2295
|
+
|
2296
|
+
if ($this.parent('li').hasClass('active')) return
|
2297
|
+
|
2298
|
+
var $previous = $ul.find('.active:last a')
|
2299
|
+
var hideEvent = $.Event('hide.bs.tab', {
|
2300
|
+
relatedTarget: $this[0]
|
2301
|
+
})
|
2302
|
+
var showEvent = $.Event('show.bs.tab', {
|
2303
|
+
relatedTarget: $previous[0]
|
2304
|
+
})
|
2305
|
+
|
2306
|
+
$previous.trigger(hideEvent)
|
2307
|
+
$this.trigger(showEvent)
|
2308
|
+
|
2309
|
+
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
|
2310
|
+
|
2311
|
+
var $target = $(document).find(selector)
|
2312
|
+
|
2313
|
+
this.activate($this.closest('li'), $ul)
|
2314
|
+
this.activate($target, $target.parent(), function () {
|
2315
|
+
$previous.trigger({
|
2316
|
+
type: 'hidden.bs.tab',
|
2317
|
+
relatedTarget: $this[0]
|
2318
|
+
})
|
2319
|
+
$this.trigger({
|
2320
|
+
type: 'shown.bs.tab',
|
2321
|
+
relatedTarget: $previous[0]
|
2322
|
+
})
|
2323
|
+
})
|
2108
2324
|
}
|
2109
2325
|
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2326
|
+
Tab.prototype.activate = function (element, container, callback) {
|
2327
|
+
var $active = container.find('> .active')
|
2328
|
+
var transition = callback
|
2329
|
+
&& $.support.transition
|
2330
|
+
&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
|
2113
2331
|
|
2114
|
-
|
2115
|
-
|
2116
|
-
|
2332
|
+
function next() {
|
2333
|
+
$active
|
2334
|
+
.removeClass('active')
|
2335
|
+
.find('> .dropdown-menu > .active')
|
2336
|
+
.removeClass('active')
|
2337
|
+
.end()
|
2338
|
+
.find('[data-toggle="tab"]')
|
2339
|
+
.attr('aria-expanded', false)
|
2117
2340
|
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2341
|
+
element
|
2342
|
+
.addClass('active')
|
2343
|
+
.find('[data-toggle="tab"]')
|
2344
|
+
.attr('aria-expanded', true)
|
2121
2345
|
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2346
|
+
if (transition) {
|
2347
|
+
element[0].offsetWidth // reflow for transition
|
2348
|
+
element.addClass('in')
|
2349
|
+
} else {
|
2350
|
+
element.removeClass('fade')
|
2351
|
+
}
|
2125
2352
|
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2353
|
+
if (element.parent('.dropdown-menu').length) {
|
2354
|
+
element
|
2355
|
+
.closest('li.dropdown')
|
2356
|
+
.addClass('active')
|
2357
|
+
.end()
|
2358
|
+
.find('[data-toggle="tab"]')
|
2359
|
+
.attr('aria-expanded', true)
|
2133
2360
|
}
|
2361
|
+
|
2362
|
+
callback && callback()
|
2134
2363
|
}
|
2135
2364
|
|
2136
|
-
|
2137
|
-
|
2365
|
+
$active.length && transition ?
|
2366
|
+
$active
|
2367
|
+
.one('bsTransitionEnd', next)
|
2368
|
+
.emulateTransitionEnd(Tab.TRANSITION_DURATION) :
|
2369
|
+
next()
|
2138
2370
|
|
2139
|
-
|
2140
|
-
var that = this
|
2141
|
-
clearTimeout(this.timeout)
|
2142
|
-
this.hide(function () {
|
2143
|
-
that.$element.off('.' + that.type).removeData('bs.' + that.type)
|
2144
|
-
})
|
2371
|
+
$active.removeClass('in')
|
2145
2372
|
}
|
2146
2373
|
|
2147
2374
|
|
2148
|
-
//
|
2149
|
-
//
|
2375
|
+
// TAB PLUGIN DEFINITION
|
2376
|
+
// =====================
|
2150
2377
|
|
2151
2378
|
function Plugin(option) {
|
2152
2379
|
return this.each(function () {
|
2153
|
-
var $this
|
2154
|
-
var data
|
2155
|
-
|
2156
|
-
|
2157
|
-
|
2158
|
-
if (!data && option == 'destroy') return
|
2159
|
-
if (selector) {
|
2160
|
-
if (!data) $this.data('bs.tooltip', (data = {}))
|
2161
|
-
if (!data[selector]) data[selector] = new Tooltip(this, options)
|
2162
|
-
} else {
|
2163
|
-
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
2164
|
-
}
|
2380
|
+
var $this = $(this)
|
2381
|
+
var data = $this.data('bs.tab')
|
2382
|
+
|
2383
|
+
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
2165
2384
|
if (typeof option == 'string') data[option]()
|
2166
2385
|
})
|
2167
2386
|
}
|
2168
2387
|
|
2169
|
-
var old = $.fn.
|
2388
|
+
var old = $.fn.tab
|
2170
2389
|
|
2171
|
-
$.fn.
|
2172
|
-
$.fn.
|
2390
|
+
$.fn.tab = Plugin
|
2391
|
+
$.fn.tab.Constructor = Tab
|
2173
2392
|
|
2174
2393
|
|
2175
|
-
//
|
2176
|
-
//
|
2394
|
+
// TAB NO CONFLICT
|
2395
|
+
// ===============
|
2177
2396
|
|
2178
|
-
$.fn.
|
2179
|
-
$.fn.
|
2397
|
+
$.fn.tab.noConflict = function () {
|
2398
|
+
$.fn.tab = old
|
2180
2399
|
return this
|
2181
2400
|
}
|
2182
2401
|
|
2402
|
+
|
2403
|
+
// TAB DATA-API
|
2404
|
+
// ============
|
2405
|
+
|
2406
|
+
var clickHandler = function (e) {
|
2407
|
+
e.preventDefault()
|
2408
|
+
Plugin.call($(this), 'show')
|
2409
|
+
}
|
2410
|
+
|
2411
|
+
$(document)
|
2412
|
+
.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
|
2413
|
+
.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
|
2414
|
+
|
2183
2415
|
}(jQuery);
|
2184
2416
|
|
2185
2417
|
/* ========================================================================
|
2186
|
-
* Bootstrap:
|
2187
|
-
*
|
2418
|
+
* Bootstrap: affix.js v3.4.1
|
2419
|
+
* https://getbootstrap.com/docs/3.4/javascript/#affix
|
2188
2420
|
* ========================================================================
|
2189
|
-
* Copyright 2011-
|
2421
|
+
* Copyright 2011-2019 Twitter, Inc.
|
2190
2422
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2191
2423
|
* ======================================================================== */
|
2192
2424
|
|
@@ -2194,111 +2426,155 @@
|
|
2194
2426
|
+function ($) {
|
2195
2427
|
'use strict';
|
2196
2428
|
|
2197
|
-
//
|
2198
|
-
//
|
2199
|
-
|
2200
|
-
var Popover = function (element, options) {
|
2201
|
-
this.init('popover', element, options)
|
2202
|
-
}
|
2429
|
+
// AFFIX CLASS DEFINITION
|
2430
|
+
// ======================
|
2203
2431
|
|
2204
|
-
|
2432
|
+
var Affix = function (element, options) {
|
2433
|
+
this.options = $.extend({}, Affix.DEFAULTS, options)
|
2205
2434
|
|
2206
|
-
|
2435
|
+
var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)
|
2207
2436
|
|
2208
|
-
|
2209
|
-
|
2210
|
-
|
2211
|
-
content: '',
|
2212
|
-
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
2213
|
-
})
|
2437
|
+
this.$target = target
|
2438
|
+
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
2439
|
+
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
2214
2440
|
|
2441
|
+
this.$element = $(element)
|
2442
|
+
this.affixed = null
|
2443
|
+
this.unpin = null
|
2444
|
+
this.pinnedOffset = null
|
2215
2445
|
|
2216
|
-
|
2217
|
-
|
2446
|
+
this.checkPosition()
|
2447
|
+
}
|
2218
2448
|
|
2219
|
-
|
2449
|
+
Affix.VERSION = '3.4.1'
|
2220
2450
|
|
2221
|
-
|
2451
|
+
Affix.RESET = 'affix affix-top affix-bottom'
|
2222
2452
|
|
2223
|
-
|
2224
|
-
|
2453
|
+
Affix.DEFAULTS = {
|
2454
|
+
offset: 0,
|
2455
|
+
target: window
|
2225
2456
|
}
|
2226
2457
|
|
2227
|
-
|
2228
|
-
var
|
2229
|
-
var
|
2230
|
-
var
|
2458
|
+
Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
|
2459
|
+
var scrollTop = this.$target.scrollTop()
|
2460
|
+
var position = this.$element.offset()
|
2461
|
+
var targetHeight = this.$target.height()
|
2231
2462
|
|
2232
|
-
|
2233
|
-
$tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
|
2234
|
-
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
2235
|
-
](content)
|
2463
|
+
if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
|
2236
2464
|
|
2237
|
-
|
2465
|
+
if (this.affixed == 'bottom') {
|
2466
|
+
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
|
2467
|
+
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
|
2468
|
+
}
|
2238
2469
|
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
}
|
2470
|
+
var initializing = this.affixed == null
|
2471
|
+
var colliderTop = initializing ? scrollTop : position.top
|
2472
|
+
var colliderHeight = initializing ? targetHeight : height
|
2243
2473
|
|
2244
|
-
|
2245
|
-
|
2246
|
-
}
|
2474
|
+
if (offsetTop != null && scrollTop <= offsetTop) return 'top'
|
2475
|
+
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
|
2247
2476
|
|
2248
|
-
|
2249
|
-
|
2250
|
-
var o = this.options
|
2477
|
+
return false
|
2478
|
+
}
|
2251
2479
|
|
2252
|
-
|
2253
|
-
|
2254
|
-
|
2255
|
-
|
2480
|
+
Affix.prototype.getPinnedOffset = function () {
|
2481
|
+
if (this.pinnedOffset) return this.pinnedOffset
|
2482
|
+
this.$element.removeClass(Affix.RESET).addClass('affix')
|
2483
|
+
var scrollTop = this.$target.scrollTop()
|
2484
|
+
var position = this.$element.offset()
|
2485
|
+
return (this.pinnedOffset = position.top - scrollTop)
|
2256
2486
|
}
|
2257
2487
|
|
2258
|
-
|
2259
|
-
|
2488
|
+
Affix.prototype.checkPositionWithEventLoop = function () {
|
2489
|
+
setTimeout($.proxy(this.checkPosition, this), 1)
|
2260
2490
|
}
|
2261
2491
|
|
2262
|
-
|
2263
|
-
if (!this.$
|
2264
|
-
|
2492
|
+
Affix.prototype.checkPosition = function () {
|
2493
|
+
if (!this.$element.is(':visible')) return
|
2494
|
+
|
2495
|
+
var height = this.$element.height()
|
2496
|
+
var offset = this.options.offset
|
2497
|
+
var offsetTop = offset.top
|
2498
|
+
var offsetBottom = offset.bottom
|
2499
|
+
var scrollHeight = Math.max($(document).height(), $(document.body).height())
|
2500
|
+
|
2501
|
+
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
2502
|
+
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
2503
|
+
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
2504
|
+
|
2505
|
+
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
|
2506
|
+
|
2507
|
+
if (this.affixed != affix) {
|
2508
|
+
if (this.unpin != null) this.$element.css('top', '')
|
2509
|
+
|
2510
|
+
var affixType = 'affix' + (affix ? '-' + affix : '')
|
2511
|
+
var e = $.Event(affixType + '.bs.affix')
|
2512
|
+
|
2513
|
+
this.$element.trigger(e)
|
2514
|
+
|
2515
|
+
if (e.isDefaultPrevented()) return
|
2516
|
+
|
2517
|
+
this.affixed = affix
|
2518
|
+
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
2519
|
+
|
2520
|
+
this.$element
|
2521
|
+
.removeClass(Affix.RESET)
|
2522
|
+
.addClass(affixType)
|
2523
|
+
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
|
2524
|
+
}
|
2525
|
+
|
2526
|
+
if (affix == 'bottom') {
|
2527
|
+
this.$element.offset({
|
2528
|
+
top: scrollHeight - height - offsetBottom
|
2529
|
+
})
|
2530
|
+
}
|
2265
2531
|
}
|
2266
2532
|
|
2267
2533
|
|
2268
|
-
//
|
2269
|
-
//
|
2534
|
+
// AFFIX PLUGIN DEFINITION
|
2535
|
+
// =======================
|
2270
2536
|
|
2271
2537
|
function Plugin(option) {
|
2272
2538
|
return this.each(function () {
|
2273
|
-
var $this
|
2274
|
-
var data
|
2275
|
-
var options
|
2276
|
-
|
2277
|
-
|
2278
|
-
if (!data && option == 'destroy') return
|
2279
|
-
if (selector) {
|
2280
|
-
if (!data) $this.data('bs.popover', (data = {}))
|
2281
|
-
if (!data[selector]) data[selector] = new Popover(this, options)
|
2282
|
-
} else {
|
2283
|
-
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
2284
|
-
}
|
2539
|
+
var $this = $(this)
|
2540
|
+
var data = $this.data('bs.affix')
|
2541
|
+
var options = typeof option == 'object' && option
|
2542
|
+
|
2543
|
+
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
2285
2544
|
if (typeof option == 'string') data[option]()
|
2286
2545
|
})
|
2287
2546
|
}
|
2288
2547
|
|
2289
|
-
var old = $.fn.
|
2548
|
+
var old = $.fn.affix
|
2290
2549
|
|
2291
|
-
$.fn.
|
2292
|
-
$.fn.
|
2550
|
+
$.fn.affix = Plugin
|
2551
|
+
$.fn.affix.Constructor = Affix
|
2293
2552
|
|
2294
2553
|
|
2295
|
-
//
|
2296
|
-
//
|
2554
|
+
// AFFIX NO CONFLICT
|
2555
|
+
// =================
|
2297
2556
|
|
2298
|
-
$.fn.
|
2299
|
-
$.fn.
|
2557
|
+
$.fn.affix.noConflict = function () {
|
2558
|
+
$.fn.affix = old
|
2300
2559
|
return this
|
2301
2560
|
}
|
2302
2561
|
|
2303
|
-
}(jQuery);
|
2304
2562
|
|
2563
|
+
// AFFIX DATA-API
|
2564
|
+
// ==============
|
2565
|
+
|
2566
|
+
$(window).on('load', function () {
|
2567
|
+
$('[data-spy="affix"]').each(function () {
|
2568
|
+
var $spy = $(this)
|
2569
|
+
var data = $spy.data()
|
2570
|
+
|
2571
|
+
data.offset = data.offset || {}
|
2572
|
+
|
2573
|
+
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
|
2574
|
+
if (data.offsetTop != null) data.offset.top = data.offsetTop
|
2575
|
+
|
2576
|
+
Plugin.call($spy, data)
|
2577
|
+
})
|
2578
|
+
})
|
2579
|
+
|
2580
|
+
}(jQuery);
|