[6a3a178] | 1 | /*!
|
---|
[fa375fe] | 2 | * Bootstrap v3.4.1 (https://getbootstrap.com/)
|
---|
| 3 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 4 | * Licensed under the MIT license
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | if (typeof jQuery === 'undefined') {
|
---|
| 8 | throw new Error('Bootstrap\'s JavaScript requires jQuery')
|
---|
| 9 | }
|
---|
| 10 |
|
---|
| 11 | +function ($) {
|
---|
| 12 | 'use strict';
|
---|
| 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')
|
---|
[6a3a178] | 16 | }
|
---|
[fa375fe] | 17 | }(jQuery);
|
---|
[6a3a178] | 18 |
|
---|
[fa375fe] | 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 | * ======================================================================== */
|
---|
[6a3a178] | 26 |
|
---|
| 27 |
|
---|
[fa375fe] | 28 | +function ($) {
|
---|
| 29 | 'use strict';
|
---|
[6a3a178] | 30 |
|
---|
[fa375fe] | 31 | // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
|
---|
| 32 | // ============================================================
|
---|
[6a3a178] | 33 |
|
---|
[fa375fe] | 34 | function transitionEnd() {
|
---|
| 35 | var el = document.createElement('bootstrap')
|
---|
[6a3a178] | 36 |
|
---|
[fa375fe] | 37 | var transEndEventNames = {
|
---|
| 38 | WebkitTransition : 'webkitTransitionEnd',
|
---|
| 39 | MozTransition : 'transitionend',
|
---|
| 40 | OTransition : 'oTransitionEnd otransitionend',
|
---|
| 41 | transition : 'transitionend'
|
---|
[6a3a178] | 42 | }
|
---|
| 43 |
|
---|
[fa375fe] | 44 | for (var name in transEndEventNames) {
|
---|
| 45 | if (el.style[name] !== undefined) {
|
---|
| 46 | return { end: transEndEventNames[name] }
|
---|
| 47 | }
|
---|
[6a3a178] | 48 | }
|
---|
| 49 |
|
---|
[fa375fe] | 50 | return false // explicit for ie8 ( ._.)
|
---|
| 51 | }
|
---|
[6a3a178] | 52 |
|
---|
[fa375fe] | 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)
|
---|
| 60 | return this
|
---|
| 61 | }
|
---|
[6a3a178] | 62 |
|
---|
[fa375fe] | 63 | $(function () {
|
---|
| 64 | $.support.transition = transitionEnd()
|
---|
[6a3a178] | 65 |
|
---|
[fa375fe] | 66 | if (!$.support.transition) return
|
---|
[6a3a178] | 67 |
|
---|
[fa375fe] | 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)
|
---|
[6a3a178] | 73 | }
|
---|
| 74 | }
|
---|
[fa375fe] | 75 | })
|
---|
[6a3a178] | 76 |
|
---|
[fa375fe] | 77 | }(jQuery);
|
---|
[6a3a178] | 78 |
|
---|
[fa375fe] | 79 | /* ========================================================================
|
---|
| 80 | * Bootstrap: alert.js v3.4.1
|
---|
| 81 | * https://getbootstrap.com/docs/3.4/javascript/#alerts
|
---|
| 82 | * ========================================================================
|
---|
| 83 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 84 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
---|
| 85 | * ======================================================================== */
|
---|
[6a3a178] | 86 |
|
---|
| 87 |
|
---|
[fa375fe] | 88 | +function ($) {
|
---|
| 89 | 'use strict';
|
---|
[6a3a178] | 90 |
|
---|
[fa375fe] | 91 | // ALERT CLASS DEFINITION
|
---|
| 92 | // ======================
|
---|
[6a3a178] | 93 |
|
---|
[fa375fe] | 94 | var dismiss = '[data-dismiss="alert"]'
|
---|
| 95 | var Alert = function (el) {
|
---|
| 96 | $(el).on('click', dismiss, this.close)
|
---|
| 97 | }
|
---|
[6a3a178] | 98 |
|
---|
[fa375fe] | 99 | Alert.VERSION = '3.4.1'
|
---|
[6a3a178] | 100 |
|
---|
[fa375fe] | 101 | Alert.TRANSITION_DURATION = 150
|
---|
[6a3a178] | 102 |
|
---|
[fa375fe] | 103 | Alert.prototype.close = function (e) {
|
---|
| 104 | var $this = $(this)
|
---|
| 105 | var selector = $this.attr('data-target')
|
---|
[6a3a178] | 106 |
|
---|
[fa375fe] | 107 | if (!selector) {
|
---|
| 108 | selector = $this.attr('href')
|
---|
| 109 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
---|
[6a3a178] | 110 | }
|
---|
| 111 |
|
---|
[fa375fe] | 112 | selector = selector === '#' ? [] : selector
|
---|
| 113 | var $parent = $(document).find(selector)
|
---|
[6a3a178] | 114 |
|
---|
[fa375fe] | 115 | if (e) e.preventDefault()
|
---|
[6a3a178] | 116 |
|
---|
[fa375fe] | 117 | if (!$parent.length) {
|
---|
| 118 | $parent = $this.closest('.alert')
|
---|
[6a3a178] | 119 | }
|
---|
| 120 |
|
---|
[fa375fe] | 121 | $parent.trigger(e = $.Event('close.bs.alert'))
|
---|
[6a3a178] | 122 |
|
---|
[fa375fe] | 123 | if (e.isDefaultPrevented()) return
|
---|
[6a3a178] | 124 |
|
---|
[fa375fe] | 125 | $parent.removeClass('in')
|
---|
[6a3a178] | 126 |
|
---|
[fa375fe] | 127 | function removeElement() {
|
---|
| 128 | // detach from parent, fire event then clean up data
|
---|
| 129 | $parent.detach().trigger('closed.bs.alert').remove()
|
---|
[6a3a178] | 130 | }
|
---|
| 131 |
|
---|
[fa375fe] | 132 | $.support.transition && $parent.hasClass('fade') ?
|
---|
| 133 | $parent
|
---|
| 134 | .one('bsTransitionEnd', removeElement)
|
---|
| 135 | .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
|
---|
| 136 | removeElement()
|
---|
| 137 | }
|
---|
[6a3a178] | 138 |
|
---|
| 139 |
|
---|
[fa375fe] | 140 | // ALERT PLUGIN DEFINITION
|
---|
| 141 | // =======================
|
---|
[6a3a178] | 142 |
|
---|
[fa375fe] | 143 | function Plugin(option) {
|
---|
| 144 | return this.each(function () {
|
---|
| 145 | var $this = $(this)
|
---|
| 146 | var data = $this.data('bs.alert')
|
---|
[6a3a178] | 147 |
|
---|
[fa375fe] | 148 | if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
---|
| 149 | if (typeof option == 'string') data[option].call($this)
|
---|
| 150 | })
|
---|
| 151 | }
|
---|
[6a3a178] | 152 |
|
---|
[fa375fe] | 153 | var old = $.fn.alert
|
---|
[6a3a178] | 154 |
|
---|
[fa375fe] | 155 | $.fn.alert = Plugin
|
---|
| 156 | $.fn.alert.Constructor = Alert
|
---|
[6a3a178] | 157 |
|
---|
| 158 |
|
---|
[fa375fe] | 159 | // ALERT NO CONFLICT
|
---|
| 160 | // =================
|
---|
[6a3a178] | 161 |
|
---|
[fa375fe] | 162 | $.fn.alert.noConflict = function () {
|
---|
| 163 | $.fn.alert = old
|
---|
| 164 | return this
|
---|
| 165 | }
|
---|
[6a3a178] | 166 |
|
---|
| 167 |
|
---|
[fa375fe] | 168 | // ALERT DATA-API
|
---|
| 169 | // ==============
|
---|
[6a3a178] | 170 |
|
---|
[fa375fe] | 171 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
---|
[6a3a178] | 172 |
|
---|
[fa375fe] | 173 | }(jQuery);
|
---|
[6a3a178] | 174 |
|
---|
[fa375fe] | 175 | /* ========================================================================
|
---|
| 176 | * Bootstrap: button.js v3.4.1
|
---|
| 177 | * https://getbootstrap.com/docs/3.4/javascript/#buttons
|
---|
| 178 | * ========================================================================
|
---|
| 179 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 180 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
---|
| 181 | * ======================================================================== */
|
---|
[6a3a178] | 182 |
|
---|
| 183 |
|
---|
[fa375fe] | 184 | +function ($) {
|
---|
| 185 | 'use strict';
|
---|
[6a3a178] | 186 |
|
---|
[fa375fe] | 187 | // BUTTON PUBLIC CLASS DEFINITION
|
---|
| 188 | // ==============================
|
---|
[6a3a178] | 189 |
|
---|
[fa375fe] | 190 | var Button = function (element, options) {
|
---|
| 191 | this.$element = $(element)
|
---|
| 192 | this.options = $.extend({}, Button.DEFAULTS, options)
|
---|
| 193 | this.isLoading = false
|
---|
[6a3a178] | 194 | }
|
---|
| 195 |
|
---|
[fa375fe] | 196 | Button.VERSION = '3.4.1'
|
---|
[6a3a178] | 197 |
|
---|
[fa375fe] | 198 | Button.DEFAULTS = {
|
---|
| 199 | loadingText: 'loading...'
|
---|
[6a3a178] | 200 | }
|
---|
| 201 |
|
---|
[fa375fe] | 202 | Button.prototype.setState = function (state) {
|
---|
| 203 | var d = 'disabled'
|
---|
| 204 | var $el = this.$element
|
---|
| 205 | var val = $el.is('input') ? 'val' : 'html'
|
---|
| 206 | var data = $el.data()
|
---|
[6a3a178] | 207 |
|
---|
[fa375fe] | 208 | state += 'Text'
|
---|
[6a3a178] | 209 |
|
---|
[fa375fe] | 210 | if (data.resetText == null) $el.data('resetText', $el[val]())
|
---|
[6a3a178] | 211 |
|
---|
[fa375fe] | 212 | // push to event loop to allow forms to submit
|
---|
| 213 | setTimeout($.proxy(function () {
|
---|
| 214 | $el[val](data[state] == null ? this.options[state] : data[state])
|
---|
[6a3a178] | 215 |
|
---|
[fa375fe] | 216 | if (state == 'loadingText') {
|
---|
| 217 | this.isLoading = true
|
---|
| 218 | $el.addClass(d).attr(d, d).prop(d, true)
|
---|
| 219 | } else if (this.isLoading) {
|
---|
| 220 | this.isLoading = false
|
---|
| 221 | $el.removeClass(d).removeAttr(d).prop(d, false)
|
---|
[6a3a178] | 222 | }
|
---|
[fa375fe] | 223 | }, this), 0)
|
---|
[6a3a178] | 224 | }
|
---|
| 225 |
|
---|
[fa375fe] | 226 | Button.prototype.toggle = function () {
|
---|
| 227 | var changed = true
|
---|
| 228 | var $parent = this.$element.closest('[data-toggle="buttons"]')
|
---|
| 229 |
|
---|
| 230 | if ($parent.length) {
|
---|
| 231 | var $input = this.$element.find('input')
|
---|
| 232 | if ($input.prop('type') == 'radio') {
|
---|
| 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')
|
---|
| 239 | }
|
---|
| 240 | $input.prop('checked', this.$element.hasClass('active'))
|
---|
| 241 | if (changed) $input.trigger('change')
|
---|
| 242 | } else {
|
---|
| 243 | this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
|
---|
| 244 | this.$element.toggleClass('active')
|
---|
[6a3a178] | 245 | }
|
---|
| 246 | }
|
---|
| 247 |
|
---|
| 248 |
|
---|
[fa375fe] | 249 | // BUTTON PLUGIN DEFINITION
|
---|
| 250 | // ========================
|
---|
[6a3a178] | 251 |
|
---|
[fa375fe] | 252 | function Plugin(option) {
|
---|
| 253 | return this.each(function () {
|
---|
| 254 | var $this = $(this)
|
---|
| 255 | var data = $this.data('bs.button')
|
---|
| 256 | var options = typeof option == 'object' && option
|
---|
[6a3a178] | 257 |
|
---|
[fa375fe] | 258 | if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
---|
[6a3a178] | 259 |
|
---|
[fa375fe] | 260 | if (option == 'toggle') data.toggle()
|
---|
| 261 | else if (option) data.setState(option)
|
---|
| 262 | })
|
---|
[6a3a178] | 263 | }
|
---|
| 264 |
|
---|
[fa375fe] | 265 | var old = $.fn.button
|
---|
[6a3a178] | 266 |
|
---|
[fa375fe] | 267 | $.fn.button = Plugin
|
---|
| 268 | $.fn.button.Constructor = Button
|
---|
[6a3a178] | 269 |
|
---|
| 270 |
|
---|
[fa375fe] | 271 | // BUTTON NO CONFLICT
|
---|
| 272 | // ==================
|
---|
[6a3a178] | 273 |
|
---|
[fa375fe] | 274 | $.fn.button.noConflict = function () {
|
---|
| 275 | $.fn.button = old
|
---|
| 276 | return this
|
---|
[6a3a178] | 277 | }
|
---|
| 278 |
|
---|
| 279 |
|
---|
[fa375fe] | 280 | // BUTTON DATA-API
|
---|
| 281 | // ===============
|
---|
| 282 |
|
---|
| 283 | $(document)
|
---|
| 284 | .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
---|
| 285 | var $btn = $(e.target).closest('.btn')
|
---|
| 286 | Plugin.call($btn, 'toggle')
|
---|
| 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 | }
|
---|
| 294 | })
|
---|
| 295 | .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
---|
| 296 | $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
|
---|
| 297 | })
|
---|
| 298 |
|
---|
| 299 | }(jQuery);
|
---|
| 300 |
|
---|
| 301 | /* ========================================================================
|
---|
| 302 | * Bootstrap: carousel.js v3.4.1
|
---|
| 303 | * https://getbootstrap.com/docs/3.4/javascript/#carousel
|
---|
| 304 | * ========================================================================
|
---|
| 305 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 306 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
---|
| 307 | * ======================================================================== */
|
---|
| 308 |
|
---|
| 309 |
|
---|
| 310 | +function ($) {
|
---|
| 311 | 'use strict';
|
---|
| 312 |
|
---|
| 313 | // CAROUSEL CLASS DEFINITION
|
---|
| 314 | // =========================
|
---|
| 315 |
|
---|
| 316 | var Carousel = function (element, options) {
|
---|
| 317 | this.$element = $(element)
|
---|
| 318 | this.$indicators = this.$element.find('.carousel-indicators')
|
---|
| 319 | this.options = options
|
---|
| 320 | this.paused = null
|
---|
| 321 | this.sliding = null
|
---|
| 322 | this.interval = null
|
---|
| 323 | this.$active = null
|
---|
| 324 | this.$items = null
|
---|
| 325 |
|
---|
| 326 | this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
|
---|
| 327 |
|
---|
| 328 | this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
|
---|
| 329 | .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
|
---|
| 330 | .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
---|
[6a3a178] | 331 | }
|
---|
| 332 |
|
---|
[fa375fe] | 333 | Carousel.VERSION = '3.4.1'
|
---|
[6a3a178] | 334 |
|
---|
[fa375fe] | 335 | Carousel.TRANSITION_DURATION = 600
|
---|
[6a3a178] | 336 |
|
---|
[fa375fe] | 337 | Carousel.DEFAULTS = {
|
---|
| 338 | interval: 5000,
|
---|
| 339 | pause: 'hover',
|
---|
| 340 | wrap: true,
|
---|
| 341 | keyboard: true
|
---|
| 342 | }
|
---|
[6a3a178] | 343 |
|
---|
[fa375fe] | 344 | Carousel.prototype.keydown = function (e) {
|
---|
| 345 | if (/input|textarea/i.test(e.target.tagName)) return
|
---|
| 346 | switch (e.which) {
|
---|
| 347 | case 37: this.prev(); break
|
---|
| 348 | case 39: this.next(); break
|
---|
| 349 | default: return
|
---|
[6a3a178] | 350 | }
|
---|
| 351 |
|
---|
[fa375fe] | 352 | e.preventDefault()
|
---|
[6a3a178] | 353 | }
|
---|
| 354 |
|
---|
[fa375fe] | 355 | Carousel.prototype.cycle = function (e) {
|
---|
| 356 | e || (this.paused = false)
|
---|
[6a3a178] | 357 |
|
---|
[fa375fe] | 358 | this.interval && clearInterval(this.interval)
|
---|
[6a3a178] | 359 |
|
---|
[fa375fe] | 360 | this.options.interval
|
---|
| 361 | && !this.paused
|
---|
| 362 | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
---|
[6a3a178] | 363 |
|
---|
[fa375fe] | 364 | return this
|
---|
| 365 | }
|
---|
[6a3a178] | 366 |
|
---|
[fa375fe] | 367 | Carousel.prototype.getItemIndex = function (item) {
|
---|
| 368 | this.$items = item.parent().children('.item')
|
---|
| 369 | return this.$items.index(item || this.$active)
|
---|
| 370 | }
|
---|
[6a3a178] | 371 |
|
---|
[fa375fe] | 372 | Carousel.prototype.getItemForDirection = function (direction, active) {
|
---|
| 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
|
---|
| 378 | var itemIndex = (activeIndex + delta) % this.$items.length
|
---|
| 379 | return this.$items.eq(itemIndex)
|
---|
[6a3a178] | 380 | }
|
---|
| 381 |
|
---|
[fa375fe] | 382 | Carousel.prototype.to = function (pos) {
|
---|
| 383 | var that = this
|
---|
| 384 | var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
|
---|
[6a3a178] | 385 |
|
---|
[fa375fe] | 386 | if (pos > (this.$items.length - 1) || pos < 0) return
|
---|
[6a3a178] | 387 |
|
---|
[fa375fe] | 388 | if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
|
---|
| 389 | if (activeIndex == pos) return this.pause().cycle()
|
---|
[6a3a178] | 390 |
|
---|
[fa375fe] | 391 | return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
|
---|
| 392 | }
|
---|
[6a3a178] | 393 |
|
---|
[fa375fe] | 394 | Carousel.prototype.pause = function (e) {
|
---|
| 395 | e || (this.paused = true)
|
---|
[6a3a178] | 396 |
|
---|
[fa375fe] | 397 | if (this.$element.find('.next, .prev').length && $.support.transition) {
|
---|
| 398 | this.$element.trigger($.support.transition.end)
|
---|
| 399 | this.cycle(true)
|
---|
[6a3a178] | 400 | }
|
---|
| 401 |
|
---|
[fa375fe] | 402 | this.interval = clearInterval(this.interval)
|
---|
[6a3a178] | 403 |
|
---|
[fa375fe] | 404 | return this
|
---|
[6a3a178] | 405 | }
|
---|
| 406 |
|
---|
[fa375fe] | 407 | Carousel.prototype.next = function () {
|
---|
| 408 | if (this.sliding) return
|
---|
| 409 | return this.slide('next')
|
---|
[6a3a178] | 410 | }
|
---|
| 411 |
|
---|
[fa375fe] | 412 | Carousel.prototype.prev = function () {
|
---|
| 413 | if (this.sliding) return
|
---|
| 414 | return this.slide('prev')
|
---|
| 415 | }
|
---|
[6a3a178] | 416 |
|
---|
[fa375fe] | 417 | Carousel.prototype.slide = function (type, next) {
|
---|
| 418 | var $active = this.$element.find('.item.active')
|
---|
| 419 | var $next = next || this.getItemForDirection(type, $active)
|
---|
| 420 | var isCycling = this.interval
|
---|
| 421 | var direction = type == 'next' ? 'left' : 'right'
|
---|
| 422 | var that = this
|
---|
| 423 |
|
---|
| 424 | if ($next.hasClass('active')) return (this.sliding = false)
|
---|
| 425 |
|
---|
| 426 | var relatedTarget = $next[0]
|
---|
| 427 | var slideEvent = $.Event('slide.bs.carousel', {
|
---|
| 428 | relatedTarget: relatedTarget,
|
---|
| 429 | direction: direction
|
---|
| 430 | })
|
---|
| 431 | this.$element.trigger(slideEvent)
|
---|
| 432 | if (slideEvent.isDefaultPrevented()) return
|
---|
| 433 |
|
---|
| 434 | this.sliding = true
|
---|
| 435 |
|
---|
| 436 | isCycling && this.pause()
|
---|
| 437 |
|
---|
| 438 | if (this.$indicators.length) {
|
---|
| 439 | this.$indicators.find('.active').removeClass('active')
|
---|
| 440 | var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
|
---|
| 441 | $nextIndicator && $nextIndicator.addClass('active')
|
---|
| 442 | }
|
---|
| 443 |
|
---|
| 444 | var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
---|
| 445 | if ($.support.transition && this.$element.hasClass('slide')) {
|
---|
| 446 | $next.addClass(type)
|
---|
| 447 | if (typeof $next === 'object' && $next.length) {
|
---|
| 448 | $next[0].offsetWidth // force reflow
|
---|
| 449 | }
|
---|
| 450 | $active.addClass(direction)
|
---|
| 451 | $next.addClass(direction)
|
---|
| 452 | $active
|
---|
| 453 | .one('bsTransitionEnd', function () {
|
---|
| 454 | $next.removeClass([type, direction].join(' ')).addClass('active')
|
---|
| 455 | $active.removeClass(['active', direction].join(' '))
|
---|
| 456 | that.sliding = false
|
---|
| 457 | setTimeout(function () {
|
---|
| 458 | that.$element.trigger(slidEvent)
|
---|
| 459 | }, 0)
|
---|
| 460 | })
|
---|
| 461 | .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
|
---|
| 462 | } else {
|
---|
| 463 | $active.removeClass('active')
|
---|
| 464 | $next.addClass('active')
|
---|
| 465 | this.sliding = false
|
---|
| 466 | this.$element.trigger(slidEvent)
|
---|
[6a3a178] | 467 | }
|
---|
| 468 |
|
---|
[fa375fe] | 469 | isCycling && this.cycle()
|
---|
[6a3a178] | 470 |
|
---|
[fa375fe] | 471 | return this
|
---|
| 472 | }
|
---|
[6a3a178] | 473 |
|
---|
| 474 |
|
---|
[fa375fe] | 475 | // CAROUSEL PLUGIN DEFINITION
|
---|
| 476 | // ==========================
|
---|
[6a3a178] | 477 |
|
---|
[fa375fe] | 478 | function Plugin(option) {
|
---|
| 479 | return this.each(function () {
|
---|
| 480 | var $this = $(this)
|
---|
| 481 | var data = $this.data('bs.carousel')
|
---|
| 482 | var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
---|
| 483 | var action = typeof option == 'string' ? option : options.slide
|
---|
[6a3a178] | 484 |
|
---|
[fa375fe] | 485 | if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
---|
| 486 | if (typeof option == 'number') data.to(option)
|
---|
| 487 | else if (action) data[action]()
|
---|
| 488 | else if (options.interval) data.pause().cycle()
|
---|
| 489 | })
|
---|
| 490 | }
|
---|
[6a3a178] | 491 |
|
---|
[fa375fe] | 492 | var old = $.fn.carousel
|
---|
[6a3a178] | 493 |
|
---|
[fa375fe] | 494 | $.fn.carousel = Plugin
|
---|
| 495 | $.fn.carousel.Constructor = Carousel
|
---|
[6a3a178] | 496 |
|
---|
| 497 |
|
---|
[fa375fe] | 498 | // CAROUSEL NO CONFLICT
|
---|
| 499 | // ====================
|
---|
[6a3a178] | 500 |
|
---|
[fa375fe] | 501 | $.fn.carousel.noConflict = function () {
|
---|
| 502 | $.fn.carousel = old
|
---|
| 503 | return this
|
---|
[6a3a178] | 504 | }
|
---|
| 505 |
|
---|
[fa375fe] | 506 |
|
---|
| 507 | // CAROUSEL DATA-API
|
---|
| 508 | // =================
|
---|
| 509 |
|
---|
| 510 | var clickHandler = function (e) {
|
---|
| 511 | var $this = $(this)
|
---|
| 512 | var href = $this.attr('href')
|
---|
| 513 | if (href) {
|
---|
| 514 | href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
---|
[6a3a178] | 515 | }
|
---|
| 516 |
|
---|
[fa375fe] | 517 | var target = $this.attr('data-target') || href
|
---|
| 518 | var $target = $(document).find(target)
|
---|
[6a3a178] | 519 |
|
---|
[fa375fe] | 520 | if (!$target.hasClass('carousel')) return
|
---|
[6a3a178] | 521 |
|
---|
[fa375fe] | 522 | var options = $.extend({}, $target.data(), $this.data())
|
---|
| 523 | var slideIndex = $this.attr('data-slide-to')
|
---|
| 524 | if (slideIndex) options.interval = false
|
---|
[6a3a178] | 525 |
|
---|
[fa375fe] | 526 | Plugin.call($target, options)
|
---|
[6a3a178] | 527 |
|
---|
[fa375fe] | 528 | if (slideIndex) {
|
---|
| 529 | $target.data('bs.carousel').to(slideIndex)
|
---|
[6a3a178] | 530 | }
|
---|
| 531 |
|
---|
[fa375fe] | 532 | e.preventDefault()
|
---|
| 533 | }
|
---|
[6a3a178] | 534 |
|
---|
[fa375fe] | 535 | $(document)
|
---|
| 536 | .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
|
---|
| 537 | .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
|
---|
[6a3a178] | 538 |
|
---|
[fa375fe] | 539 | $(window).on('load', function () {
|
---|
| 540 | $('[data-ride="carousel"]').each(function () {
|
---|
| 541 | var $carousel = $(this)
|
---|
| 542 | Plugin.call($carousel, $carousel.data())
|
---|
| 543 | })
|
---|
| 544 | })
|
---|
[6a3a178] | 545 |
|
---|
[fa375fe] | 546 | }(jQuery);
|
---|
[6a3a178] | 547 |
|
---|
[fa375fe] | 548 | /* ========================================================================
|
---|
| 549 | * Bootstrap: collapse.js v3.4.1
|
---|
| 550 | * https://getbootstrap.com/docs/3.4/javascript/#collapse
|
---|
| 551 | * ========================================================================
|
---|
| 552 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 553 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
---|
| 554 | * ======================================================================== */
|
---|
[6a3a178] | 555 |
|
---|
[fa375fe] | 556 | /* jshint latedef: false */
|
---|
[6a3a178] | 557 |
|
---|
[fa375fe] | 558 | +function ($) {
|
---|
| 559 | 'use strict';
|
---|
[6a3a178] | 560 |
|
---|
[fa375fe] | 561 | // COLLAPSE PUBLIC CLASS DEFINITION
|
---|
| 562 | // ================================
|
---|
[6a3a178] | 563 |
|
---|
[fa375fe] | 564 | var Collapse = function (element, options) {
|
---|
| 565 | this.$element = $(element)
|
---|
| 566 | this.options = $.extend({}, Collapse.DEFAULTS, options)
|
---|
| 567 | this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
|
---|
| 568 | '[data-toggle="collapse"][data-target="#' + element.id + '"]')
|
---|
| 569 | this.transitioning = null
|
---|
[6a3a178] | 570 |
|
---|
[fa375fe] | 571 | if (this.options.parent) {
|
---|
| 572 | this.$parent = this.getParent()
|
---|
| 573 | } else {
|
---|
| 574 | this.addAriaAndCollapsedClass(this.$element, this.$trigger)
|
---|
[6a3a178] | 575 | }
|
---|
| 576 |
|
---|
[fa375fe] | 577 | if (this.options.toggle) this.toggle()
|
---|
[6a3a178] | 578 | }
|
---|
| 579 |
|
---|
[fa375fe] | 580 | Collapse.VERSION = '3.4.1'
|
---|
[6a3a178] | 581 |
|
---|
[fa375fe] | 582 | Collapse.TRANSITION_DURATION = 350
|
---|
[6a3a178] | 583 |
|
---|
[fa375fe] | 584 | Collapse.DEFAULTS = {
|
---|
| 585 | toggle: true
|
---|
| 586 | }
|
---|
[6a3a178] | 587 |
|
---|
[fa375fe] | 588 | Collapse.prototype.dimension = function () {
|
---|
| 589 | var hasWidth = this.$element.hasClass('width')
|
---|
| 590 | return hasWidth ? 'width' : 'height'
|
---|
| 591 | }
|
---|
[6a3a178] | 592 |
|
---|
[fa375fe] | 593 | Collapse.prototype.show = function () {
|
---|
| 594 | if (this.transitioning || this.$element.hasClass('in')) return
|
---|
[6a3a178] | 595 |
|
---|
[fa375fe] | 596 | var activesData
|
---|
| 597 | var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
|
---|
[6a3a178] | 598 |
|
---|
[fa375fe] | 599 | if (actives && actives.length) {
|
---|
| 600 | activesData = actives.data('bs.collapse')
|
---|
| 601 | if (activesData && activesData.transitioning) return
|
---|
| 602 | }
|
---|
[6a3a178] | 603 |
|
---|
[fa375fe] | 604 | var startEvent = $.Event('show.bs.collapse')
|
---|
| 605 | this.$element.trigger(startEvent)
|
---|
| 606 | if (startEvent.isDefaultPrevented()) return
|
---|
[6a3a178] | 607 |
|
---|
[fa375fe] | 608 | if (actives && actives.length) {
|
---|
| 609 | Plugin.call(actives, 'hide')
|
---|
| 610 | activesData || actives.data('bs.collapse', null)
|
---|
| 611 | }
|
---|
[6a3a178] | 612 |
|
---|
[fa375fe] | 613 | var dimension = this.dimension()
|
---|
[6a3a178] | 614 |
|
---|
[fa375fe] | 615 | this.$element
|
---|
| 616 | .removeClass('collapse')
|
---|
| 617 | .addClass('collapsing')[dimension](0)
|
---|
| 618 | .attr('aria-expanded', true)
|
---|
[6a3a178] | 619 |
|
---|
[fa375fe] | 620 | this.$trigger
|
---|
| 621 | .removeClass('collapsed')
|
---|
| 622 | .attr('aria-expanded', true)
|
---|
[6a3a178] | 623 |
|
---|
[fa375fe] | 624 | this.transitioning = 1
|
---|
[6a3a178] | 625 |
|
---|
[fa375fe] | 626 | var complete = function () {
|
---|
| 627 | this.$element
|
---|
| 628 | .removeClass('collapsing')
|
---|
| 629 | .addClass('collapse in')[dimension]('')
|
---|
| 630 | this.transitioning = 0
|
---|
| 631 | this.$element
|
---|
| 632 | .trigger('shown.bs.collapse')
|
---|
| 633 | }
|
---|
[6a3a178] | 634 |
|
---|
[fa375fe] | 635 | if (!$.support.transition) return complete.call(this)
|
---|
[6a3a178] | 636 |
|
---|
[fa375fe] | 637 | var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
---|
[6a3a178] | 638 |
|
---|
[fa375fe] | 639 | this.$element
|
---|
| 640 | .one('bsTransitionEnd', $.proxy(complete, this))
|
---|
| 641 | .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
|
---|
| 642 | }
|
---|
[6a3a178] | 643 |
|
---|
[fa375fe] | 644 | Collapse.prototype.hide = function () {
|
---|
| 645 | if (this.transitioning || !this.$element.hasClass('in')) return
|
---|
[6a3a178] | 646 |
|
---|
[fa375fe] | 647 | var startEvent = $.Event('hide.bs.collapse')
|
---|
| 648 | this.$element.trigger(startEvent)
|
---|
| 649 | if (startEvent.isDefaultPrevented()) return
|
---|
[6a3a178] | 650 |
|
---|
[fa375fe] | 651 | var dimension = this.dimension()
|
---|
[6a3a178] | 652 |
|
---|
[fa375fe] | 653 | this.$element[dimension](this.$element[dimension]())[0].offsetHeight
|
---|
[6a3a178] | 654 |
|
---|
[fa375fe] | 655 | this.$element
|
---|
| 656 | .addClass('collapsing')
|
---|
| 657 | .removeClass('collapse in')
|
---|
| 658 | .attr('aria-expanded', false)
|
---|
[6a3a178] | 659 |
|
---|
[fa375fe] | 660 | this.$trigger
|
---|
| 661 | .addClass('collapsed')
|
---|
| 662 | .attr('aria-expanded', false)
|
---|
[6a3a178] | 663 |
|
---|
[fa375fe] | 664 | this.transitioning = 1
|
---|
[6a3a178] | 665 |
|
---|
[fa375fe] | 666 | var complete = function () {
|
---|
| 667 | this.transitioning = 0
|
---|
| 668 | this.$element
|
---|
| 669 | .removeClass('collapsing')
|
---|
| 670 | .addClass('collapse')
|
---|
| 671 | .trigger('hidden.bs.collapse')
|
---|
| 672 | }
|
---|
[6a3a178] | 673 |
|
---|
[fa375fe] | 674 | if (!$.support.transition) return complete.call(this)
|
---|
[6a3a178] | 675 |
|
---|
[fa375fe] | 676 | this.$element
|
---|
| 677 | [dimension](0)
|
---|
| 678 | .one('bsTransitionEnd', $.proxy(complete, this))
|
---|
| 679 | .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
|
---|
| 680 | }
|
---|
[6a3a178] | 681 |
|
---|
[fa375fe] | 682 | Collapse.prototype.toggle = function () {
|
---|
| 683 | this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
---|
| 684 | }
|
---|
[6a3a178] | 685 |
|
---|
[fa375fe] | 686 | Collapse.prototype.getParent = function () {
|
---|
| 687 | return $(document).find(this.options.parent)
|
---|
| 688 | .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
|
---|
| 689 | .each($.proxy(function (i, element) {
|
---|
| 690 | var $element = $(element)
|
---|
| 691 | this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
|
---|
| 692 | }, this))
|
---|
| 693 | .end()
|
---|
| 694 | }
|
---|
[6a3a178] | 695 |
|
---|
[fa375fe] | 696 | Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
|
---|
| 697 | var isOpen = $element.hasClass('in')
|
---|
[6a3a178] | 698 |
|
---|
[fa375fe] | 699 | $element.attr('aria-expanded', isOpen)
|
---|
| 700 | $trigger
|
---|
| 701 | .toggleClass('collapsed', !isOpen)
|
---|
| 702 | .attr('aria-expanded', isOpen)
|
---|
| 703 | }
|
---|
[6a3a178] | 704 |
|
---|
[fa375fe] | 705 | function getTargetFromTrigger($trigger) {
|
---|
| 706 | var href
|
---|
| 707 | var target = $trigger.attr('data-target')
|
---|
| 708 | || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
---|
[6a3a178] | 709 |
|
---|
[fa375fe] | 710 | return $(document).find(target)
|
---|
| 711 | }
|
---|
[6a3a178] | 712 |
|
---|
| 713 |
|
---|
[fa375fe] | 714 | // COLLAPSE PLUGIN DEFINITION
|
---|
| 715 | // ==========================
|
---|
[6a3a178] | 716 |
|
---|
[fa375fe] | 717 | function Plugin(option) {
|
---|
| 718 | return this.each(function () {
|
---|
| 719 | var $this = $(this)
|
---|
| 720 | var data = $this.data('bs.collapse')
|
---|
| 721 | var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
---|
[6a3a178] | 722 |
|
---|
[fa375fe] | 723 | if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
|
---|
| 724 | if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
---|
| 725 | if (typeof option == 'string') data[option]()
|
---|
| 726 | })
|
---|
| 727 | }
|
---|
[6a3a178] | 728 |
|
---|
[fa375fe] | 729 | var old = $.fn.collapse
|
---|
[6a3a178] | 730 |
|
---|
[fa375fe] | 731 | $.fn.collapse = Plugin
|
---|
| 732 | $.fn.collapse.Constructor = Collapse
|
---|
[6a3a178] | 733 |
|
---|
| 734 |
|
---|
[fa375fe] | 735 | // COLLAPSE NO CONFLICT
|
---|
| 736 | // ====================
|
---|
[6a3a178] | 737 |
|
---|
[fa375fe] | 738 | $.fn.collapse.noConflict = function () {
|
---|
| 739 | $.fn.collapse = old
|
---|
| 740 | return this
|
---|
| 741 | }
|
---|
[6a3a178] | 742 |
|
---|
| 743 |
|
---|
[fa375fe] | 744 | // COLLAPSE DATA-API
|
---|
| 745 | // =================
|
---|
[6a3a178] | 746 |
|
---|
[fa375fe] | 747 | $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
|
---|
| 748 | var $this = $(this)
|
---|
[6a3a178] | 749 |
|
---|
[fa375fe] | 750 | if (!$this.attr('data-target')) e.preventDefault()
|
---|
[6a3a178] | 751 |
|
---|
[fa375fe] | 752 | var $target = getTargetFromTrigger($this)
|
---|
| 753 | var data = $target.data('bs.collapse')
|
---|
| 754 | var option = data ? 'toggle' : $this.data()
|
---|
[6a3a178] | 755 |
|
---|
[fa375fe] | 756 | Plugin.call($target, option)
|
---|
| 757 | })
|
---|
[6a3a178] | 758 |
|
---|
[fa375fe] | 759 | }(jQuery);
|
---|
[6a3a178] | 760 |
|
---|
[fa375fe] | 761 | /* ========================================================================
|
---|
| 762 | * Bootstrap: dropdown.js v3.4.1
|
---|
| 763 | * https://getbootstrap.com/docs/3.4/javascript/#dropdowns
|
---|
| 764 | * ========================================================================
|
---|
| 765 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 766 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
---|
| 767 | * ======================================================================== */
|
---|
[6a3a178] | 768 |
|
---|
| 769 |
|
---|
[fa375fe] | 770 | +function ($) {
|
---|
| 771 | 'use strict';
|
---|
[6a3a178] | 772 |
|
---|
[fa375fe] | 773 | // DROPDOWN CLASS DEFINITION
|
---|
| 774 | // =========================
|
---|
[6a3a178] | 775 |
|
---|
[fa375fe] | 776 | var backdrop = '.dropdown-backdrop'
|
---|
| 777 | var toggle = '[data-toggle="dropdown"]'
|
---|
| 778 | var Dropdown = function (element) {
|
---|
| 779 | $(element).on('click.bs.dropdown', this.toggle)
|
---|
| 780 | }
|
---|
[6a3a178] | 781 |
|
---|
[fa375fe] | 782 | Dropdown.VERSION = '3.4.1'
|
---|
[6a3a178] | 783 |
|
---|
[fa375fe] | 784 | function getParent($this) {
|
---|
| 785 | var selector = $this.attr('data-target')
|
---|
[6a3a178] | 786 |
|
---|
[fa375fe] | 787 | if (!selector) {
|
---|
| 788 | selector = $this.attr('href')
|
---|
| 789 | selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
---|
| 790 | }
|
---|
[6a3a178] | 791 |
|
---|
[fa375fe] | 792 | var $parent = selector !== '#' ? $(document).find(selector) : null
|
---|
[6a3a178] | 793 |
|
---|
[fa375fe] | 794 | return $parent && $parent.length ? $parent : $this.parent()
|
---|
| 795 | }
|
---|
[6a3a178] | 796 |
|
---|
[fa375fe] | 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 }
|
---|
[6a3a178] | 804 |
|
---|
[fa375fe] | 805 | if (!$parent.hasClass('open')) return
|
---|
[6a3a178] | 806 |
|
---|
[fa375fe] | 807 | if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
|
---|
[6a3a178] | 808 |
|
---|
[fa375fe] | 809 | $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
---|
[6a3a178] | 810 |
|
---|
[fa375fe] | 811 | if (e.isDefaultPrevented()) return
|
---|
[6a3a178] | 812 |
|
---|
[fa375fe] | 813 | $this.attr('aria-expanded', 'false')
|
---|
| 814 | $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
|
---|
| 815 | })
|
---|
| 816 | }
|
---|
[6a3a178] | 817 |
|
---|
[fa375fe] | 818 | Dropdown.prototype.toggle = function (e) {
|
---|
| 819 | var $this = $(this)
|
---|
[6a3a178] | 820 |
|
---|
[fa375fe] | 821 | if ($this.is('.disabled, :disabled')) return
|
---|
[6a3a178] | 822 |
|
---|
[fa375fe] | 823 | var $parent = getParent($this)
|
---|
| 824 | var isActive = $parent.hasClass('open')
|
---|
[6a3a178] | 825 |
|
---|
[fa375fe] | 826 | clearMenus()
|
---|
[6a3a178] | 827 |
|
---|
[fa375fe] | 828 | if (!isActive) {
|
---|
| 829 | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
---|
| 830 | // if mobile we use a backdrop because click events don't delegate
|
---|
| 831 | $(document.createElement('div'))
|
---|
| 832 | .addClass('dropdown-backdrop')
|
---|
| 833 | .insertAfter($(this))
|
---|
| 834 | .on('click', clearMenus)
|
---|
[6a3a178] | 835 | }
|
---|
| 836 |
|
---|
[fa375fe] | 837 | var relatedTarget = { relatedTarget: this }
|
---|
| 838 | $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
---|
[6a3a178] | 839 |
|
---|
[fa375fe] | 840 | if (e.isDefaultPrevented()) return
|
---|
[6a3a178] | 841 |
|
---|
[fa375fe] | 842 | $this
|
---|
| 843 | .trigger('focus')
|
---|
| 844 | .attr('aria-expanded', 'true')
|
---|
[6a3a178] | 845 |
|
---|
[fa375fe] | 846 | $parent
|
---|
| 847 | .toggleClass('open')
|
---|
| 848 | .trigger($.Event('shown.bs.dropdown', relatedTarget))
|
---|
| 849 | }
|
---|
[6a3a178] | 850 |
|
---|
[fa375fe] | 851 | return false
|
---|
| 852 | }
|
---|
[6a3a178] | 853 |
|
---|
[fa375fe] | 854 | Dropdown.prototype.keydown = function (e) {
|
---|
| 855 | if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
|
---|
[6a3a178] | 856 |
|
---|
[fa375fe] | 857 | var $this = $(this)
|
---|
[6a3a178] | 858 |
|
---|
[fa375fe] | 859 | e.preventDefault()
|
---|
| 860 | e.stopPropagation()
|
---|
[6a3a178] | 861 |
|
---|
[fa375fe] | 862 | if ($this.is('.disabled, :disabled')) return
|
---|
[6a3a178] | 863 |
|
---|
[fa375fe] | 864 | var $parent = getParent($this)
|
---|
| 865 | var isActive = $parent.hasClass('open')
|
---|
[6a3a178] | 866 |
|
---|
[fa375fe] | 867 | if (!isActive && e.which != 27 || isActive && e.which == 27) {
|
---|
| 868 | if (e.which == 27) $parent.find(toggle).trigger('focus')
|
---|
| 869 | return $this.trigger('click')
|
---|
| 870 | }
|
---|
[6a3a178] | 871 |
|
---|
[fa375fe] | 872 | var desc = ' li:not(.disabled):visible a'
|
---|
| 873 | var $items = $parent.find('.dropdown-menu' + desc)
|
---|
[6a3a178] | 874 |
|
---|
[fa375fe] | 875 | if (!$items.length) return
|
---|
[6a3a178] | 876 |
|
---|
[fa375fe] | 877 | var index = $items.index(e.target)
|
---|
[6a3a178] | 878 |
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 882 |
|
---|
[fa375fe] | 883 | $items.eq(index).trigger('focus')
|
---|
| 884 | }
|
---|
[6a3a178] | 885 |
|
---|
| 886 |
|
---|
[fa375fe] | 887 | // DROPDOWN PLUGIN DEFINITION
|
---|
| 888 | // ==========================
|
---|
[6a3a178] | 889 |
|
---|
[fa375fe] | 890 | function Plugin(option) {
|
---|
| 891 | return this.each(function () {
|
---|
| 892 | var $this = $(this)
|
---|
| 893 | var data = $this.data('bs.dropdown')
|
---|
[6a3a178] | 894 |
|
---|
[fa375fe] | 895 | if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
---|
| 896 | if (typeof option == 'string') data[option].call($this)
|
---|
| 897 | })
|
---|
[6a3a178] | 898 | }
|
---|
| 899 |
|
---|
[fa375fe] | 900 | var old = $.fn.dropdown
|
---|
[6a3a178] | 901 |
|
---|
[fa375fe] | 902 | $.fn.dropdown = Plugin
|
---|
| 903 | $.fn.dropdown.Constructor = Dropdown
|
---|
[6a3a178] | 904 |
|
---|
| 905 |
|
---|
[fa375fe] | 906 | // DROPDOWN NO CONFLICT
|
---|
| 907 | // ====================
|
---|
[6a3a178] | 908 |
|
---|
[fa375fe] | 909 | $.fn.dropdown.noConflict = function () {
|
---|
| 910 | $.fn.dropdown = old
|
---|
| 911 | return this
|
---|
| 912 | }
|
---|
[6a3a178] | 913 |
|
---|
| 914 |
|
---|
[fa375fe] | 915 | // APPLY TO STANDARD DROPDOWN ELEMENTS
|
---|
| 916 | // ===================================
|
---|
| 917 |
|
---|
| 918 | $(document)
|
---|
| 919 | .on('click.bs.dropdown.data-api', clearMenus)
|
---|
| 920 | .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
---|
| 921 | .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
---|
| 922 | .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
|
---|
| 923 | .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
|
---|
| 924 |
|
---|
| 925 | }(jQuery);
|
---|
| 926 |
|
---|
| 927 | /* ========================================================================
|
---|
| 928 | * Bootstrap: modal.js v3.4.1
|
---|
| 929 | * https://getbootstrap.com/docs/3.4/javascript/#modals
|
---|
| 930 | * ========================================================================
|
---|
| 931 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 932 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
---|
| 933 | * ======================================================================== */
|
---|
| 934 |
|
---|
| 935 |
|
---|
| 936 | +function ($) {
|
---|
| 937 | 'use strict';
|
---|
| 938 |
|
---|
| 939 | // MODAL CLASS DEFINITION
|
---|
| 940 | // ======================
|
---|
| 941 |
|
---|
| 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))
|
---|
[6a3a178] | 960 | }
|
---|
[fa375fe] | 961 | }
|
---|
[6a3a178] | 962 |
|
---|
[fa375fe] | 963 | Modal.VERSION = '3.4.1'
|
---|
[6a3a178] | 964 |
|
---|
[fa375fe] | 965 | Modal.TRANSITION_DURATION = 300
|
---|
| 966 | Modal.BACKDROP_TRANSITION_DURATION = 150
|
---|
[6a3a178] | 967 |
|
---|
[fa375fe] | 968 | Modal.DEFAULTS = {
|
---|
[6a3a178] | 969 | backdrop: true,
|
---|
| 970 | keyboard: true,
|
---|
[fa375fe] | 971 | show: true
|
---|
| 972 | }
|
---|
| 973 |
|
---|
| 974 | Modal.prototype.toggle = function (_relatedTarget) {
|
---|
| 975 | return this.isShown ? this.hide() : this.show(_relatedTarget)
|
---|
| 976 | }
|
---|
[6a3a178] | 977 |
|
---|
[fa375fe] | 978 | Modal.prototype.show = function (_relatedTarget) {
|
---|
| 979 | var that = this
|
---|
| 980 | var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
---|
[6a3a178] | 981 |
|
---|
[fa375fe] | 982 | this.$element.trigger(e)
|
---|
[6a3a178] | 983 |
|
---|
[fa375fe] | 984 | if (this.isShown || e.isDefaultPrevented()) return
|
---|
[6a3a178] | 985 |
|
---|
[fa375fe] | 986 | this.isShown = true
|
---|
[6a3a178] | 987 |
|
---|
[fa375fe] | 988 | this.checkScrollbar()
|
---|
| 989 | this.setScrollbar()
|
---|
| 990 | this.$body.addClass('modal-open')
|
---|
[6a3a178] | 991 |
|
---|
[fa375fe] | 992 | this.escape()
|
---|
| 993 | this.resize()
|
---|
[6a3a178] | 994 |
|
---|
[fa375fe] | 995 | this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
---|
[6a3a178] | 996 |
|
---|
[fa375fe] | 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
|
---|
| 1000 | })
|
---|
| 1001 | })
|
---|
[6a3a178] | 1002 |
|
---|
[fa375fe] | 1003 | this.backdrop(function () {
|
---|
| 1004 | var transition = $.support.transition && that.$element.hasClass('fade')
|
---|
[6a3a178] | 1005 |
|
---|
[fa375fe] | 1006 | if (!that.$element.parent().length) {
|
---|
| 1007 | that.$element.appendTo(that.$body) // don't move modals dom position
|
---|
[6a3a178] | 1008 | }
|
---|
| 1009 |
|
---|
[fa375fe] | 1010 | that.$element
|
---|
| 1011 | .show()
|
---|
| 1012 | .scrollTop(0)
|
---|
[6a3a178] | 1013 |
|
---|
[fa375fe] | 1014 | that.adjustDialog()
|
---|
[6a3a178] | 1015 |
|
---|
[fa375fe] | 1016 | if (transition) {
|
---|
| 1017 | that.$element[0].offsetWidth // force reflow
|
---|
[6a3a178] | 1018 | }
|
---|
| 1019 |
|
---|
[fa375fe] | 1020 | that.$element.addClass('in')
|
---|
[6a3a178] | 1021 |
|
---|
[fa375fe] | 1022 | that.enforceFocus()
|
---|
[6a3a178] | 1023 |
|
---|
[fa375fe] | 1024 | var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
---|
[6a3a178] | 1025 |
|
---|
[fa375fe] | 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 | })
|
---|
| 1034 | }
|
---|
[6a3a178] | 1035 |
|
---|
[fa375fe] | 1036 | Modal.prototype.hide = function (e) {
|
---|
| 1037 | if (e) e.preventDefault()
|
---|
[6a3a178] | 1038 |
|
---|
[fa375fe] | 1039 | e = $.Event('hide.bs.modal')
|
---|
[6a3a178] | 1040 |
|
---|
[fa375fe] | 1041 | this.$element.trigger(e)
|
---|
[6a3a178] | 1042 |
|
---|
[fa375fe] | 1043 | if (!this.isShown || e.isDefaultPrevented()) return
|
---|
[6a3a178] | 1044 |
|
---|
[fa375fe] | 1045 | this.isShown = false
|
---|
[6a3a178] | 1046 |
|
---|
[fa375fe] | 1047 | this.escape()
|
---|
| 1048 | this.resize()
|
---|
| 1049 |
|
---|
| 1050 | $(document).off('focusin.bs.modal')
|
---|
| 1051 |
|
---|
| 1052 | this.$element
|
---|
| 1053 | .removeClass('in')
|
---|
| 1054 | .off('click.dismiss.bs.modal')
|
---|
| 1055 | .off('mouseup.dismiss.bs.modal')
|
---|
| 1056 |
|
---|
| 1057 | this.$dialog.off('mousedown.dismiss.bs.modal')
|
---|
[6a3a178] | 1058 |
|
---|
[fa375fe] | 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()
|
---|
| 1064 | }
|
---|
[6a3a178] | 1065 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1077 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1087 |
|
---|
[fa375fe] | 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 | }
|
---|
| 1094 | }
|
---|
[6a3a178] | 1095 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1106 |
|
---|
[fa375fe] | 1107 | Modal.prototype.removeBackdrop = function () {
|
---|
| 1108 | this.$backdrop && this.$backdrop.remove()
|
---|
| 1109 | this.$backdrop = null
|
---|
| 1110 | }
|
---|
[6a3a178] | 1111 |
|
---|
[fa375fe] | 1112 | Modal.prototype.backdrop = function (callback) {
|
---|
| 1113 | var that = this
|
---|
| 1114 | var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
---|
[6a3a178] | 1115 |
|
---|
[fa375fe] | 1116 | if (this.isShown && this.options.backdrop) {
|
---|
| 1117 | var doAnimate = $.support.transition && animate
|
---|
[6a3a178] | 1118 |
|
---|
[fa375fe] | 1119 | this.$backdrop = $(document.createElement('div'))
|
---|
| 1120 | .addClass('modal-backdrop ' + animate)
|
---|
| 1121 | .appendTo(this.$body)
|
---|
[6a3a178] | 1122 |
|
---|
[fa375fe] | 1123 | this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
---|
| 1124 | if (this.ignoreBackdropClick) {
|
---|
| 1125 | this.ignoreBackdropClick = false
|
---|
| 1126 | return
|
---|
[6a3a178] | 1127 | }
|
---|
[fa375fe] | 1128 | if (e.target !== e.currentTarget) return
|
---|
| 1129 | this.options.backdrop == 'static'
|
---|
| 1130 | ? this.$element[0].focus()
|
---|
| 1131 | : this.hide()
|
---|
| 1132 | }, this))
|
---|
[6a3a178] | 1133 |
|
---|
[fa375fe] | 1134 | if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
---|
[6a3a178] | 1135 |
|
---|
[fa375fe] | 1136 | this.$backdrop.addClass('in')
|
---|
[6a3a178] | 1137 |
|
---|
[fa375fe] | 1138 | if (!callback) return
|
---|
[6a3a178] | 1139 |
|
---|
[fa375fe] | 1140 | doAnimate ?
|
---|
| 1141 | this.$backdrop
|
---|
| 1142 | .one('bsTransitionEnd', callback)
|
---|
| 1143 | .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
---|
| 1144 | callback()
|
---|
[6a3a178] | 1145 |
|
---|
[fa375fe] | 1146 | } else if (!this.isShown && this.$backdrop) {
|
---|
| 1147 | this.$backdrop.removeClass('in')
|
---|
[6a3a178] | 1148 |
|
---|
[fa375fe] | 1149 | var callbackRemove = function () {
|
---|
| 1150 | that.removeBackdrop()
|
---|
| 1151 | callback && callback()
|
---|
| 1152 | }
|
---|
| 1153 | $.support.transition && this.$element.hasClass('fade') ?
|
---|
| 1154 | this.$backdrop
|
---|
| 1155 | .one('bsTransitionEnd', callbackRemove)
|
---|
| 1156 | .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
---|
| 1157 | callbackRemove()
|
---|
[6a3a178] | 1158 |
|
---|
[fa375fe] | 1159 | } else if (callback) {
|
---|
| 1160 | callback()
|
---|
[6a3a178] | 1161 | }
|
---|
[fa375fe] | 1162 | }
|
---|
[6a3a178] | 1163 |
|
---|
[fa375fe] | 1164 | // these following methods are used to handle overflowing modals
|
---|
[6a3a178] | 1165 |
|
---|
[fa375fe] | 1166 | Modal.prototype.handleUpdate = function () {
|
---|
| 1167 | this.adjustDialog()
|
---|
| 1168 | }
|
---|
[6a3a178] | 1169 |
|
---|
[fa375fe] | 1170 | Modal.prototype.adjustDialog = function () {
|
---|
| 1171 | var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
---|
[6a3a178] | 1172 |
|
---|
[fa375fe] | 1173 | this.$element.css({
|
---|
| 1174 | paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
---|
| 1175 | paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
|
---|
| 1176 | })
|
---|
| 1177 | }
|
---|
[6a3a178] | 1178 |
|
---|
[fa375fe] | 1179 | Modal.prototype.resetAdjustments = function () {
|
---|
| 1180 | this.$element.css({
|
---|
| 1181 | paddingLeft: '',
|
---|
| 1182 | paddingRight: ''
|
---|
| 1183 | })
|
---|
| 1184 | }
|
---|
[6a3a178] | 1185 |
|
---|
[fa375fe] | 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)
|
---|
| 1191 | }
|
---|
| 1192 | this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
|
---|
| 1193 | this.scrollbarWidth = this.measureScrollbar()
|
---|
| 1194 | }
|
---|
[6a3a178] | 1195 |
|
---|
[fa375fe] | 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 | })
|
---|
[6a3a178] | 1209 | }
|
---|
[fa375fe] | 1210 | }
|
---|
[6a3a178] | 1211 |
|
---|
[fa375fe] | 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 | })
|
---|
[6a3a178] | 1219 | }
|
---|
| 1220 |
|
---|
[fa375fe] | 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
|
---|
| 1228 | }
|
---|
[6a3a178] | 1229 |
|
---|
| 1230 |
|
---|
[fa375fe] | 1231 | // MODAL PLUGIN DEFINITION
|
---|
| 1232 | // =======================
|
---|
[6a3a178] | 1233 |
|
---|
[fa375fe] | 1234 | function Plugin(option, _relatedTarget) {
|
---|
| 1235 | return this.each(function () {
|
---|
| 1236 | var $this = $(this)
|
---|
| 1237 | var data = $this.data('bs.modal')
|
---|
| 1238 | var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
---|
[6a3a178] | 1239 |
|
---|
[fa375fe] | 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)
|
---|
| 1243 | })
|
---|
| 1244 | }
|
---|
[6a3a178] | 1245 |
|
---|
[fa375fe] | 1246 | var old = $.fn.modal
|
---|
[6a3a178] | 1247 |
|
---|
[fa375fe] | 1248 | $.fn.modal = Plugin
|
---|
| 1249 | $.fn.modal.Constructor = Modal
|
---|
[6a3a178] | 1250 |
|
---|
| 1251 |
|
---|
[fa375fe] | 1252 | // MODAL NO CONFLICT
|
---|
| 1253 | // =================
|
---|
[6a3a178] | 1254 |
|
---|
[fa375fe] | 1255 | $.fn.modal.noConflict = function () {
|
---|
| 1256 | $.fn.modal = old
|
---|
| 1257 | return this
|
---|
| 1258 | }
|
---|
[6a3a178] | 1259 |
|
---|
| 1260 |
|
---|
[fa375fe] | 1261 | // MODAL DATA-API
|
---|
| 1262 | // ==============
|
---|
[6a3a178] | 1263 |
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 1269 |
|
---|
[fa375fe] | 1270 | var $target = $(document).find(target)
|
---|
| 1271 | var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
---|
[6a3a178] | 1272 |
|
---|
[fa375fe] | 1273 | if ($this.is('a')) e.preventDefault()
|
---|
[6a3a178] | 1274 |
|
---|
[fa375fe] | 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 | })
|
---|
| 1280 | })
|
---|
| 1281 | Plugin.call($target, option, this)
|
---|
| 1282 | })
|
---|
[6a3a178] | 1283 |
|
---|
[fa375fe] | 1284 | }(jQuery);
|
---|
| 1285 |
|
---|
| 1286 | /* ========================================================================
|
---|
| 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
|
---|
| 1290 | * ========================================================================
|
---|
| 1291 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 1292 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
---|
| 1293 | * ======================================================================== */
|
---|
| 1294 |
|
---|
| 1295 | +function ($) {
|
---|
| 1296 | 'use strict';
|
---|
[6a3a178] | 1297 |
|
---|
[fa375fe] | 1298 | var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']
|
---|
[6a3a178] | 1299 |
|
---|
[fa375fe] | 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 = {
|
---|
[6a3a178] | 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: [],
|
---|
[fa375fe] | 1332 | img: ['src', 'alt', 'title', 'width', 'height'],
|
---|
[6a3a178] | 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 | /**
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 1351 | */
|
---|
[fa375fe] | 1352 | var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
|
---|
[6a3a178] | 1353 |
|
---|
| 1354 | /**
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 1358 | */
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 1360 |
|
---|
[fa375fe] | 1361 | function allowedAttribute(attr, allowedAttributeList) {
|
---|
| 1362 | var attrName = attr.nodeName.toLowerCase()
|
---|
[6a3a178] | 1363 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1368 |
|
---|
[fa375fe] | 1369 | return true
|
---|
[6a3a178] | 1370 | }
|
---|
| 1371 |
|
---|
[fa375fe] | 1372 | var regExp = $(allowedAttributeList).filter(function (index, value) {
|
---|
| 1373 | return value instanceof RegExp
|
---|
| 1374 | })
|
---|
[6a3a178] | 1375 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1381 | }
|
---|
| 1382 |
|
---|
[fa375fe] | 1383 | return false
|
---|
| 1384 | }
|
---|
[6a3a178] | 1385 |
|
---|
[fa375fe] | 1386 | function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
---|
| 1387 | if (unsafeHtml.length === 0) {
|
---|
| 1388 | return unsafeHtml
|
---|
[6a3a178] | 1389 | }
|
---|
| 1390 |
|
---|
[fa375fe] | 1391 | if (sanitizeFn && typeof sanitizeFn === 'function') {
|
---|
| 1392 | return sanitizeFn(unsafeHtml)
|
---|
[6a3a178] | 1393 | }
|
---|
| 1394 |
|
---|
[fa375fe] | 1395 | // IE 8 and below don't support createHTMLDocument
|
---|
| 1396 | if (!document.implementation || !document.implementation.createHTMLDocument) {
|
---|
| 1397 | return unsafeHtml
|
---|
[6a3a178] | 1398 | }
|
---|
| 1399 |
|
---|
[fa375fe] | 1400 | var createdDocument = document.implementation.createHTMLDocument('sanitization')
|
---|
| 1401 | createdDocument.body.innerHTML = unsafeHtml
|
---|
[6a3a178] | 1402 |
|
---|
[fa375fe] | 1403 | var whitelistKeys = $.map(whiteList, function (el, i) { return i })
|
---|
| 1404 | var elements = $(createdDocument.body).find('*')
|
---|
[6a3a178] | 1405 |
|
---|
[fa375fe] | 1406 | for (var i = 0, len = elements.length; i < len; i++) {
|
---|
| 1407 | var el = elements[i]
|
---|
| 1408 | var elName = el.nodeName.toLowerCase()
|
---|
[6a3a178] | 1409 |
|
---|
[fa375fe] | 1410 | if ($.inArray(elName, whitelistKeys) === -1) {
|
---|
| 1411 | el.parentNode.removeChild(el)
|
---|
[6a3a178] | 1412 |
|
---|
[fa375fe] | 1413 | continue
|
---|
[6a3a178] | 1414 | }
|
---|
| 1415 |
|
---|
[fa375fe] | 1416 | var attributeList = $.map(el.attributes, function (el) { return el })
|
---|
| 1417 | var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
|
---|
[6a3a178] | 1418 |
|
---|
[fa375fe] | 1419 | for (var j = 0, len2 = attributeList.length; j < len2; j++) {
|
---|
| 1420 | if (!allowedAttribute(attributeList[j], whitelistedAttributes)) {
|
---|
| 1421 | el.removeAttribute(attributeList[j].nodeName)
|
---|
| 1422 | }
|
---|
[6a3a178] | 1423 | }
|
---|
| 1424 | }
|
---|
| 1425 |
|
---|
[fa375fe] | 1426 | return createdDocument.body.innerHTML
|
---|
| 1427 | }
|
---|
[6a3a178] | 1428 |
|
---|
[fa375fe] | 1429 | // TOOLTIP PUBLIC CLASS DEFINITION
|
---|
| 1430 | // ===============================
|
---|
[6a3a178] | 1431 |
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 1440 |
|
---|
[fa375fe] | 1441 | this.init('tooltip', element, options)
|
---|
| 1442 | }
|
---|
[6a3a178] | 1443 |
|
---|
[fa375fe] | 1444 | Tooltip.VERSION = '3.4.1'
|
---|
[6a3a178] | 1445 |
|
---|
[fa375fe] | 1446 | Tooltip.TRANSITION_DURATION = 150
|
---|
[6a3a178] | 1447 |
|
---|
[fa375fe] | 1448 | Tooltip.DEFAULTS = {
|
---|
| 1449 | animation: true,
|
---|
| 1450 | placement: 'top',
|
---|
| 1451 | selector: false,
|
---|
| 1452 | template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
---|
| 1453 | trigger: 'hover focus',
|
---|
| 1454 | title: '',
|
---|
| 1455 | delay: 0,
|
---|
| 1456 | html: false,
|
---|
| 1457 | container: false,
|
---|
| 1458 | viewport: {
|
---|
| 1459 | selector: 'body',
|
---|
| 1460 | padding: 0
|
---|
| 1461 | },
|
---|
| 1462 | sanitize : true,
|
---|
| 1463 | sanitizeFn : null,
|
---|
| 1464 | whiteList : DefaultWhitelist
|
---|
| 1465 | }
|
---|
[6a3a178] | 1466 |
|
---|
[fa375fe] | 1467 | Tooltip.prototype.init = function (type, element, options) {
|
---|
| 1468 | this.enabled = true
|
---|
| 1469 | this.type = type
|
---|
| 1470 | this.$element = $(element)
|
---|
| 1471 | this.options = this.getOptions(options)
|
---|
| 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 }
|
---|
[6a3a178] | 1474 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1478 |
|
---|
[fa375fe] | 1479 | var triggers = this.options.trigger.split(' ')
|
---|
[6a3a178] | 1480 |
|
---|
[fa375fe] | 1481 | for (var i = triggers.length; i--;) {
|
---|
| 1482 | var trigger = triggers[i]
|
---|
[6a3a178] | 1483 |
|
---|
[fa375fe] | 1484 | if (trigger == 'click') {
|
---|
| 1485 | this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
---|
| 1486 | } else if (trigger != 'manual') {
|
---|
| 1487 | var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
---|
| 1488 | var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
---|
[6a3a178] | 1489 |
|
---|
[fa375fe] | 1490 | this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
---|
| 1491 | this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
---|
[6a3a178] | 1492 | }
|
---|
[fa375fe] | 1493 | }
|
---|
[6a3a178] | 1494 |
|
---|
[fa375fe] | 1495 | this.options.selector ?
|
---|
| 1496 | (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
---|
| 1497 | this.fixTitle()
|
---|
| 1498 | }
|
---|
[6a3a178] | 1499 |
|
---|
[fa375fe] | 1500 | Tooltip.prototype.getDefaults = function () {
|
---|
| 1501 | return Tooltip.DEFAULTS
|
---|
| 1502 | }
|
---|
[6a3a178] | 1503 |
|
---|
[fa375fe] | 1504 | Tooltip.prototype.getOptions = function (options) {
|
---|
| 1505 | var dataAttributes = this.$element.data()
|
---|
[6a3a178] | 1506 |
|
---|
[fa375fe] | 1507 | for (var dataAttr in dataAttributes) {
|
---|
| 1508 | if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
|
---|
| 1509 | delete dataAttributes[dataAttr]
|
---|
[6a3a178] | 1510 | }
|
---|
| 1511 | }
|
---|
| 1512 |
|
---|
[fa375fe] | 1513 | options = $.extend({}, this.getDefaults(), dataAttributes, options)
|
---|
| 1514 |
|
---|
| 1515 | if (options.delay && typeof options.delay == 'number') {
|
---|
| 1516 | options.delay = {
|
---|
| 1517 | show: options.delay,
|
---|
| 1518 | hide: options.delay
|
---|
[6a3a178] | 1519 | }
|
---|
[fa375fe] | 1520 | }
|
---|
[6a3a178] | 1521 |
|
---|
[fa375fe] | 1522 | if (options.sanitize) {
|
---|
| 1523 | options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn)
|
---|
| 1524 | }
|
---|
[6a3a178] | 1525 |
|
---|
[fa375fe] | 1526 | return options
|
---|
| 1527 | }
|
---|
[6a3a178] | 1528 |
|
---|
[fa375fe] | 1529 | Tooltip.prototype.getDelegateOptions = function () {
|
---|
| 1530 | var options = {}
|
---|
| 1531 | var defaults = this.getDefaults()
|
---|
[6a3a178] | 1532 |
|
---|
[fa375fe] | 1533 | this._options && $.each(this._options, function (key, value) {
|
---|
| 1534 | if (defaults[key] != value) options[key] = value
|
---|
| 1535 | })
|
---|
[6a3a178] | 1536 |
|
---|
[fa375fe] | 1537 | return options
|
---|
| 1538 | }
|
---|
[6a3a178] | 1539 |
|
---|
[fa375fe] | 1540 | Tooltip.prototype.enter = function (obj) {
|
---|
| 1541 | var self = obj instanceof this.constructor ?
|
---|
| 1542 | obj : $(obj.currentTarget).data('bs.' + this.type)
|
---|
[6a3a178] | 1543 |
|
---|
[fa375fe] | 1544 | if (!self) {
|
---|
| 1545 | self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
---|
| 1546 | $(obj.currentTarget).data('bs.' + this.type, self)
|
---|
| 1547 | }
|
---|
[6a3a178] | 1548 |
|
---|
[fa375fe] | 1549 | if (obj instanceof $.Event) {
|
---|
| 1550 | self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
|
---|
| 1551 | }
|
---|
[6a3a178] | 1552 |
|
---|
[fa375fe] | 1553 | if (self.tip().hasClass('in') || self.hoverState == 'in') {
|
---|
| 1554 | self.hoverState = 'in'
|
---|
| 1555 | return
|
---|
| 1556 | }
|
---|
[6a3a178] | 1557 |
|
---|
[fa375fe] | 1558 | clearTimeout(self.timeout)
|
---|
[6a3a178] | 1559 |
|
---|
[fa375fe] | 1560 | self.hoverState = 'in'
|
---|
[6a3a178] | 1561 |
|
---|
[fa375fe] | 1562 | if (!self.options.delay || !self.options.delay.show) return self.show()
|
---|
[6a3a178] | 1563 |
|
---|
[fa375fe] | 1564 | self.timeout = setTimeout(function () {
|
---|
| 1565 | if (self.hoverState == 'in') self.show()
|
---|
| 1566 | }, self.options.delay.show)
|
---|
| 1567 | }
|
---|
[6a3a178] | 1568 |
|
---|
[fa375fe] | 1569 | Tooltip.prototype.isInStateTrue = function () {
|
---|
| 1570 | for (var key in this.inState) {
|
---|
| 1571 | if (this.inState[key]) return true
|
---|
[6a3a178] | 1572 | }
|
---|
| 1573 |
|
---|
[fa375fe] | 1574 | return false
|
---|
| 1575 | }
|
---|
[6a3a178] | 1576 |
|
---|
[fa375fe] | 1577 | Tooltip.prototype.leave = function (obj) {
|
---|
| 1578 | var self = obj instanceof this.constructor ?
|
---|
| 1579 | obj : $(obj.currentTarget).data('bs.' + this.type)
|
---|
[6a3a178] | 1580 |
|
---|
[fa375fe] | 1581 | if (!self) {
|
---|
| 1582 | self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
---|
| 1583 | $(obj.currentTarget).data('bs.' + this.type, self)
|
---|
[6a3a178] | 1584 | }
|
---|
| 1585 |
|
---|
[fa375fe] | 1586 | if (obj instanceof $.Event) {
|
---|
| 1587 | self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
|
---|
[6a3a178] | 1588 | }
|
---|
| 1589 |
|
---|
[fa375fe] | 1590 | if (self.isInStateTrue()) return
|
---|
[6a3a178] | 1591 |
|
---|
[fa375fe] | 1592 | clearTimeout(self.timeout)
|
---|
[6a3a178] | 1593 |
|
---|
[fa375fe] | 1594 | self.hoverState = 'out'
|
---|
[6a3a178] | 1595 |
|
---|
[fa375fe] | 1596 | if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
---|
[6a3a178] | 1597 |
|
---|
[fa375fe] | 1598 | self.timeout = setTimeout(function () {
|
---|
| 1599 | if (self.hoverState == 'out') self.hide()
|
---|
| 1600 | }, self.options.delay.hide)
|
---|
| 1601 | }
|
---|
[6a3a178] | 1602 |
|
---|
[fa375fe] | 1603 | Tooltip.prototype.show = function () {
|
---|
| 1604 | var e = $.Event('show.bs.' + this.type)
|
---|
[6a3a178] | 1605 |
|
---|
[fa375fe] | 1606 | if (this.hasContent() && this.enabled) {
|
---|
| 1607 | this.$element.trigger(e)
|
---|
[6a3a178] | 1608 |
|
---|
[fa375fe] | 1609 | var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
|
---|
| 1610 | if (e.isDefaultPrevented() || !inDom) return
|
---|
| 1611 | var that = this
|
---|
[6a3a178] | 1612 |
|
---|
[fa375fe] | 1613 | var $tip = this.tip()
|
---|
[6a3a178] | 1614 |
|
---|
[fa375fe] | 1615 | var tipId = this.getUID(this.type)
|
---|
[6a3a178] | 1616 |
|
---|
[fa375fe] | 1617 | this.setContent()
|
---|
| 1618 | $tip.attr('id', tipId)
|
---|
| 1619 | this.$element.attr('aria-describedby', tipId)
|
---|
[6a3a178] | 1620 |
|
---|
[fa375fe] | 1621 | if (this.options.animation) $tip.addClass('fade')
|
---|
[6a3a178] | 1622 |
|
---|
[fa375fe] | 1623 | var placement = typeof this.options.placement == 'function' ?
|
---|
| 1624 | this.options.placement.call(this, $tip[0], this.$element[0]) :
|
---|
| 1625 | this.options.placement
|
---|
[6a3a178] | 1626 |
|
---|
[fa375fe] | 1627 | var autoToken = /\s?auto?\s?/i
|
---|
| 1628 | var autoPlace = autoToken.test(placement)
|
---|
| 1629 | if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
---|
[6a3a178] | 1630 |
|
---|
[fa375fe] | 1631 | $tip
|
---|
| 1632 | .detach()
|
---|
| 1633 | .css({ top: 0, left: 0, display: 'block' })
|
---|
| 1634 | .addClass(placement)
|
---|
| 1635 | .data('bs.' + this.type, this)
|
---|
[6a3a178] | 1636 |
|
---|
[fa375fe] | 1637 | this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element)
|
---|
| 1638 | this.$element.trigger('inserted.bs.' + this.type)
|
---|
[6a3a178] | 1639 |
|
---|
[fa375fe] | 1640 | var pos = this.getPosition()
|
---|
| 1641 | var actualWidth = $tip[0].offsetWidth
|
---|
| 1642 | var actualHeight = $tip[0].offsetHeight
|
---|
[6a3a178] | 1643 |
|
---|
[fa375fe] | 1644 | if (autoPlace) {
|
---|
| 1645 | var orgPlacement = placement
|
---|
| 1646 | var viewportDim = this.getPosition(this.$viewport)
|
---|
[6a3a178] | 1647 |
|
---|
[fa375fe] | 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' :
|
---|
| 1652 | placement
|
---|
[6a3a178] | 1653 |
|
---|
[fa375fe] | 1654 | $tip
|
---|
| 1655 | .removeClass(orgPlacement)
|
---|
| 1656 | .addClass(placement)
|
---|
[6a3a178] | 1657 | }
|
---|
| 1658 |
|
---|
[fa375fe] | 1659 | var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
---|
[6a3a178] | 1660 |
|
---|
[fa375fe] | 1661 | this.applyPlacement(calculatedOffset, placement)
|
---|
[6a3a178] | 1662 |
|
---|
[fa375fe] | 1663 | var complete = function () {
|
---|
| 1664 | var prevHoverState = that.hoverState
|
---|
| 1665 | that.$element.trigger('shown.bs.' + that.type)
|
---|
| 1666 | that.hoverState = null
|
---|
[6a3a178] | 1667 |
|
---|
[fa375fe] | 1668 | if (prevHoverState == 'out') that.leave(that)
|
---|
| 1669 | }
|
---|
[6a3a178] | 1670 |
|
---|
[fa375fe] | 1671 | $.support.transition && this.$tip.hasClass('fade') ?
|
---|
| 1672 | $tip
|
---|
| 1673 | .one('bsTransitionEnd', complete)
|
---|
| 1674 | .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
---|
| 1675 | complete()
|
---|
[6a3a178] | 1676 | }
|
---|
[fa375fe] | 1677 | }
|
---|
[6a3a178] | 1678 |
|
---|
[fa375fe] | 1679 | Tooltip.prototype.applyPlacement = function (offset, placement) {
|
---|
| 1680 | var $tip = this.tip()
|
---|
| 1681 | var width = $tip[0].offsetWidth
|
---|
| 1682 | var height = $tip[0].offsetHeight
|
---|
[6a3a178] | 1683 |
|
---|
[fa375fe] | 1684 | // manually read margins because getBoundingClientRect includes difference
|
---|
| 1685 | var marginTop = parseInt($tip.css('margin-top'), 10)
|
---|
| 1686 | var marginLeft = parseInt($tip.css('margin-left'), 10)
|
---|
[6a3a178] | 1687 |
|
---|
[fa375fe] | 1688 | // we must check for NaN for ie 8/9
|
---|
| 1689 | if (isNaN(marginTop)) marginTop = 0
|
---|
| 1690 | if (isNaN(marginLeft)) marginLeft = 0
|
---|
[6a3a178] | 1691 |
|
---|
[fa375fe] | 1692 | offset.top += marginTop
|
---|
| 1693 | offset.left += marginLeft
|
---|
[6a3a178] | 1694 |
|
---|
[fa375fe] | 1695 | // $.fn.offset doesn't round pixel values
|
---|
| 1696 | // so we use setOffset directly with our own function B-0
|
---|
| 1697 | $.offset.setOffset($tip[0], $.extend({
|
---|
| 1698 | using: function (props) {
|
---|
| 1699 | $tip.css({
|
---|
| 1700 | top: Math.round(props.top),
|
---|
| 1701 | left: Math.round(props.left)
|
---|
| 1702 | })
|
---|
[6a3a178] | 1703 | }
|
---|
[fa375fe] | 1704 | }, offset), 0)
|
---|
[6a3a178] | 1705 |
|
---|
[fa375fe] | 1706 | $tip.addClass('in')
|
---|
[6a3a178] | 1707 |
|
---|
[fa375fe] | 1708 | // check to see if placing tip in new offset caused the tip to resize itself
|
---|
| 1709 | var actualWidth = $tip[0].offsetWidth
|
---|
| 1710 | var actualHeight = $tip[0].offsetHeight
|
---|
[6a3a178] | 1711 |
|
---|
[fa375fe] | 1712 | if (placement == 'top' && actualHeight != height) {
|
---|
| 1713 | offset.top = offset.top + height - actualHeight
|
---|
| 1714 | }
|
---|
[6a3a178] | 1715 |
|
---|
[fa375fe] | 1716 | var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
|
---|
[6a3a178] | 1717 |
|
---|
[fa375fe] | 1718 | if (delta.left) offset.left += delta.left
|
---|
| 1719 | else offset.top += delta.top
|
---|
[6a3a178] | 1720 |
|
---|
[fa375fe] | 1721 | var isVertical = /top|bottom/.test(placement)
|
---|
| 1722 | var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
|
---|
| 1723 | var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
|
---|
[6a3a178] | 1724 |
|
---|
[fa375fe] | 1725 | $tip.offset(offset)
|
---|
| 1726 | this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
|
---|
| 1727 | }
|
---|
[6a3a178] | 1728 |
|
---|
[fa375fe] | 1729 | Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
|
---|
| 1730 | this.arrow()
|
---|
| 1731 | .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
|
---|
| 1732 | .css(isVertical ? 'top' : 'left', '')
|
---|
| 1733 | }
|
---|
[6a3a178] | 1734 |
|
---|
[fa375fe] | 1735 | Tooltip.prototype.setContent = function () {
|
---|
| 1736 | var $tip = this.tip()
|
---|
| 1737 | var title = this.getTitle()
|
---|
[6a3a178] | 1738 |
|
---|
[fa375fe] | 1739 | if (this.options.html) {
|
---|
| 1740 | if (this.options.sanitize) {
|
---|
| 1741 | title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn)
|
---|
[6a3a178] | 1742 | }
|
---|
| 1743 |
|
---|
[fa375fe] | 1744 | $tip.find('.tooltip-inner').html(title)
|
---|
| 1745 | } else {
|
---|
| 1746 | $tip.find('.tooltip-inner').text(title)
|
---|
[6a3a178] | 1747 | }
|
---|
| 1748 |
|
---|
[fa375fe] | 1749 | $tip.removeClass('fade in top bottom left right')
|
---|
| 1750 | }
|
---|
[6a3a178] | 1751 |
|
---|
[fa375fe] | 1752 | Tooltip.prototype.hide = function (callback) {
|
---|
| 1753 | var that = this
|
---|
| 1754 | var $tip = $(this.$tip)
|
---|
| 1755 | var e = $.Event('hide.bs.' + this.type)
|
---|
[6a3a178] | 1756 |
|
---|
[fa375fe] | 1757 | function complete() {
|
---|
| 1758 | if (that.hoverState != 'in') $tip.detach()
|
---|
| 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)
|
---|
[6a3a178] | 1763 | }
|
---|
[fa375fe] | 1764 | callback && callback()
|
---|
| 1765 | }
|
---|
[6a3a178] | 1766 |
|
---|
[fa375fe] | 1767 | this.$element.trigger(e)
|
---|
[6a3a178] | 1768 |
|
---|
[fa375fe] | 1769 | if (e.isDefaultPrevented()) return
|
---|
[6a3a178] | 1770 |
|
---|
[fa375fe] | 1771 | $tip.removeClass('in')
|
---|
[6a3a178] | 1772 |
|
---|
[fa375fe] | 1773 | $.support.transition && $tip.hasClass('fade') ?
|
---|
| 1774 | $tip
|
---|
| 1775 | .one('bsTransitionEnd', complete)
|
---|
| 1776 | .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
---|
| 1777 | complete()
|
---|
[6a3a178] | 1778 |
|
---|
[fa375fe] | 1779 | this.hoverState = null
|
---|
[6a3a178] | 1780 |
|
---|
[fa375fe] | 1781 | return this
|
---|
| 1782 | }
|
---|
[6a3a178] | 1783 |
|
---|
[fa375fe] | 1784 | Tooltip.prototype.fixTitle = function () {
|
---|
| 1785 | var $e = this.$element
|
---|
| 1786 | if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
|
---|
| 1787 | $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
---|
| 1788 | }
|
---|
| 1789 | }
|
---|
[6a3a178] | 1790 |
|
---|
[fa375fe] | 1791 | Tooltip.prototype.hasContent = function () {
|
---|
| 1792 | return this.getTitle()
|
---|
| 1793 | }
|
---|
[6a3a178] | 1794 |
|
---|
[fa375fe] | 1795 | Tooltip.prototype.getPosition = function ($element) {
|
---|
| 1796 | $element = $element || this.$element
|
---|
[6a3a178] | 1797 |
|
---|
[fa375fe] | 1798 | var el = $element[0]
|
---|
| 1799 | var isBody = el.tagName == 'BODY'
|
---|
[6a3a178] | 1800 |
|
---|
[fa375fe] | 1801 | var elRect = el.getBoundingClientRect()
|
---|
| 1802 | if (elRect.width == null) {
|
---|
| 1803 | // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
---|
| 1804 | elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
|
---|
[6a3a178] | 1805 | }
|
---|
[fa375fe] | 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())
|
---|
| 1810 | var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
---|
| 1811 | var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
---|
[6a3a178] | 1812 |
|
---|
[fa375fe] | 1813 | return $.extend({}, elRect, scroll, outerDims, elOffset)
|
---|
| 1814 | }
|
---|
[6a3a178] | 1815 |
|
---|
[fa375fe] | 1816 | Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
---|
| 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 } :
|
---|
| 1819 | placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
---|
| 1820 | /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
---|
[6a3a178] | 1821 |
|
---|
[fa375fe] | 1822 | }
|
---|
[6a3a178] | 1823 |
|
---|
[fa375fe] | 1824 | Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
|
---|
| 1825 | var delta = { top: 0, left: 0 }
|
---|
| 1826 | if (!this.$viewport) return delta
|
---|
[6a3a178] | 1827 |
|
---|
[fa375fe] | 1828 | var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
|
---|
| 1829 | var viewportDimensions = this.getPosition(this.$viewport)
|
---|
[6a3a178] | 1830 |
|
---|
[fa375fe] | 1831 | if (/right|left/.test(placement)) {
|
---|
| 1832 | var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
|
---|
| 1833 | var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
|
---|
| 1834 | if (topEdgeOffset < viewportDimensions.top) { // top overflow
|
---|
| 1835 | delta.top = viewportDimensions.top - topEdgeOffset
|
---|
| 1836 | } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
|
---|
| 1837 | delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
|
---|
| 1838 | }
|
---|
| 1839 | } else {
|
---|
| 1840 | var leftEdgeOffset = pos.left - viewportPadding
|
---|
| 1841 | var rightEdgeOffset = pos.left + viewportPadding + actualWidth
|
---|
| 1842 | if (leftEdgeOffset < viewportDimensions.left) { // left overflow
|
---|
| 1843 | delta.left = viewportDimensions.left - leftEdgeOffset
|
---|
| 1844 | } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
|
---|
| 1845 | delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
|
---|
[6a3a178] | 1846 | }
|
---|
| 1847 | }
|
---|
| 1848 |
|
---|
[fa375fe] | 1849 | return delta
|
---|
| 1850 | }
|
---|
[6a3a178] | 1851 |
|
---|
[fa375fe] | 1852 | Tooltip.prototype.getTitle = function () {
|
---|
| 1853 | var title
|
---|
| 1854 | var $e = this.$element
|
---|
| 1855 | var o = this.options
|
---|
[6a3a178] | 1856 |
|
---|
[fa375fe] | 1857 | title = $e.attr('data-original-title')
|
---|
| 1858 | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
---|
[6a3a178] | 1859 |
|
---|
[fa375fe] | 1860 | return title
|
---|
| 1861 | }
|
---|
[6a3a178] | 1862 |
|
---|
[fa375fe] | 1863 | Tooltip.prototype.getUID = function (prefix) {
|
---|
| 1864 | do prefix += ~~(Math.random() * 1000000)
|
---|
| 1865 | while (document.getElementById(prefix))
|
---|
| 1866 | return prefix
|
---|
| 1867 | }
|
---|
[6a3a178] | 1868 |
|
---|
[fa375fe] | 1869 | Tooltip.prototype.tip = function () {
|
---|
| 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 | }
|
---|
[6a3a178] | 1875 | }
|
---|
[fa375fe] | 1876 | return this.$tip
|
---|
| 1877 | }
|
---|
[6a3a178] | 1878 |
|
---|
[fa375fe] | 1879 | Tooltip.prototype.arrow = function () {
|
---|
| 1880 | return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
|
---|
| 1881 | }
|
---|
[6a3a178] | 1882 |
|
---|
[fa375fe] | 1883 | Tooltip.prototype.enable = function () {
|
---|
| 1884 | this.enabled = true
|
---|
| 1885 | }
|
---|
[6a3a178] | 1886 |
|
---|
[fa375fe] | 1887 | Tooltip.prototype.disable = function () {
|
---|
| 1888 | this.enabled = false
|
---|
| 1889 | }
|
---|
[6a3a178] | 1890 |
|
---|
[fa375fe] | 1891 | Tooltip.prototype.toggleEnabled = function () {
|
---|
| 1892 | this.enabled = !this.enabled
|
---|
| 1893 | }
|
---|
[6a3a178] | 1894 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1903 | }
|
---|
| 1904 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1912 | }
|
---|
| 1913 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1928 |
|
---|
[fa375fe] | 1929 | Tooltip.prototype.sanitizeHtml = function (unsafeHtml) {
|
---|
| 1930 | return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn)
|
---|
| 1931 | }
|
---|
[6a3a178] | 1932 |
|
---|
[fa375fe] | 1933 | // TOOLTIP PLUGIN DEFINITION
|
---|
| 1934 | // =========================
|
---|
[6a3a178] | 1935 |
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 1941 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 1947 |
|
---|
[fa375fe] | 1948 | var old = $.fn.tooltip
|
---|
[6a3a178] | 1949 |
|
---|
[fa375fe] | 1950 | $.fn.tooltip = Plugin
|
---|
| 1951 | $.fn.tooltip.Constructor = Tooltip
|
---|
[6a3a178] | 1952 |
|
---|
| 1953 |
|
---|
[fa375fe] | 1954 | // TOOLTIP NO CONFLICT
|
---|
| 1955 | // ===================
|
---|
[6a3a178] | 1956 |
|
---|
[fa375fe] | 1957 | $.fn.tooltip.noConflict = function () {
|
---|
| 1958 | $.fn.tooltip = old
|
---|
| 1959 | return this
|
---|
| 1960 | }
|
---|
[6a3a178] | 1961 |
|
---|
[fa375fe] | 1962 | }(jQuery);
|
---|
[6a3a178] | 1963 |
|
---|
[fa375fe] | 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 | * ======================================================================== */
|
---|
[6a3a178] | 1971 |
|
---|
| 1972 |
|
---|
[fa375fe] | 1973 | +function ($) {
|
---|
| 1974 | 'use strict';
|
---|
[6a3a178] | 1975 |
|
---|
[fa375fe] | 1976 | // POPOVER PUBLIC CLASS DEFINITION
|
---|
| 1977 | // ===============================
|
---|
[6a3a178] | 1978 |
|
---|
[fa375fe] | 1979 | var Popover = function (element, options) {
|
---|
| 1980 | this.init('popover', element, options)
|
---|
| 1981 | }
|
---|
[6a3a178] | 1982 |
|
---|
[fa375fe] | 1983 | if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
---|
[6a3a178] | 1984 |
|
---|
[fa375fe] | 1985 | Popover.VERSION = '3.4.1'
|
---|
[6a3a178] | 1986 |
|
---|
[fa375fe] | 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 | })
|
---|
[6a3a178] | 1993 |
|
---|
| 1994 |
|
---|
[fa375fe] | 1995 | // NOTE: POPOVER EXTENDS tooltip.js
|
---|
| 1996 | // ================================
|
---|
[6a3a178] | 1997 |
|
---|
[fa375fe] | 1998 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
---|
[6a3a178] | 1999 |
|
---|
[fa375fe] | 2000 | Popover.prototype.constructor = Popover
|
---|
[6a3a178] | 2001 |
|
---|
[fa375fe] | 2002 | Popover.prototype.getDefaults = function () {
|
---|
| 2003 | return Popover.DEFAULTS
|
---|
| 2004 | }
|
---|
[6a3a178] | 2005 |
|
---|
[fa375fe] | 2006 | Popover.prototype.setContent = function () {
|
---|
| 2007 | var $tip = this.tip()
|
---|
| 2008 | var title = this.getTitle()
|
---|
| 2009 | var content = this.getContent()
|
---|
[6a3a178] | 2010 |
|
---|
[fa375fe] | 2011 | if (this.options.html) {
|
---|
| 2012 | var typeContent = typeof content
|
---|
[6a3a178] | 2013 |
|
---|
[fa375fe] | 2014 | if (this.options.sanitize) {
|
---|
| 2015 | title = this.sanitizeHtml(title)
|
---|
[6a3a178] | 2016 |
|
---|
[fa375fe] | 2017 | if (typeContent === 'string') {
|
---|
| 2018 | content = this.sanitizeHtml(content)
|
---|
[6a3a178] | 2019 | }
|
---|
[fa375fe] | 2020 | }
|
---|
[6a3a178] | 2021 |
|
---|
[fa375fe] | 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)
|
---|
[6a3a178] | 2029 | }
|
---|
| 2030 |
|
---|
[fa375fe] | 2031 | $tip.removeClass('fade top bottom left right in')
|
---|
[6a3a178] | 2032 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 2037 |
|
---|
[fa375fe] | 2038 | Popover.prototype.hasContent = function () {
|
---|
| 2039 | return this.getTitle() || this.getContent()
|
---|
| 2040 | }
|
---|
[6a3a178] | 2041 |
|
---|
[fa375fe] | 2042 | Popover.prototype.getContent = function () {
|
---|
| 2043 | var $e = this.$element
|
---|
| 2044 | var o = this.options
|
---|
[6a3a178] | 2045 |
|
---|
[fa375fe] | 2046 | return $e.attr('data-content')
|
---|
| 2047 | || (typeof o.content == 'function' ?
|
---|
| 2048 | o.content.call($e[0]) :
|
---|
| 2049 | o.content)
|
---|
| 2050 | }
|
---|
[6a3a178] | 2051 |
|
---|
[fa375fe] | 2052 | Popover.prototype.arrow = function () {
|
---|
| 2053 | return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
|
---|
| 2054 | }
|
---|
[6a3a178] | 2055 |
|
---|
| 2056 |
|
---|
[fa375fe] | 2057 | // POPOVER PLUGIN DEFINITION
|
---|
| 2058 | // =========================
|
---|
[6a3a178] | 2059 |
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 2065 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 2071 |
|
---|
[fa375fe] | 2072 | var old = $.fn.popover
|
---|
[6a3a178] | 2073 |
|
---|
[fa375fe] | 2074 | $.fn.popover = Plugin
|
---|
| 2075 | $.fn.popover.Constructor = Popover
|
---|
[6a3a178] | 2076 |
|
---|
| 2077 |
|
---|
[fa375fe] | 2078 | // POPOVER NO CONFLICT
|
---|
| 2079 | // ===================
|
---|
[6a3a178] | 2080 |
|
---|
[fa375fe] | 2081 | $.fn.popover.noConflict = function () {
|
---|
| 2082 | $.fn.popover = old
|
---|
| 2083 | return this
|
---|
| 2084 | }
|
---|
[6a3a178] | 2085 |
|
---|
[fa375fe] | 2086 | }(jQuery);
|
---|
[6a3a178] | 2087 |
|
---|
[fa375fe] | 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 | * ======================================================================== */
|
---|
[6a3a178] | 2095 |
|
---|
| 2096 |
|
---|
[fa375fe] | 2097 | +function ($) {
|
---|
| 2098 | 'use strict';
|
---|
[6a3a178] | 2099 |
|
---|
[fa375fe] | 2100 | // SCROLLSPY CLASS DEFINITION
|
---|
| 2101 | // ==========================
|
---|
[6a3a178] | 2102 |
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 2112 |
|
---|
[fa375fe] | 2113 | this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
|
---|
| 2114 | this.refresh()
|
---|
| 2115 | this.process()
|
---|
| 2116 | }
|
---|
[6a3a178] | 2117 |
|
---|
[fa375fe] | 2118 | ScrollSpy.VERSION = '3.4.1'
|
---|
| 2119 |
|
---|
| 2120 | ScrollSpy.DEFAULTS = {
|
---|
| 2121 | offset: 10
|
---|
| 2122 | }
|
---|
[6a3a178] | 2123 |
|
---|
[fa375fe] | 2124 | ScrollSpy.prototype.getScrollHeight = function () {
|
---|
| 2125 | return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
|
---|
| 2126 | }
|
---|
[6a3a178] | 2127 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 2160 |
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 2169 |
|
---|
[fa375fe] | 2170 | if (this.scrollHeight != scrollHeight) {
|
---|
| 2171 | this.refresh()
|
---|
| 2172 | }
|
---|
[6a3a178] | 2173 |
|
---|
[fa375fe] | 2174 | if (scrollTop >= maxScroll) {
|
---|
| 2175 | return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
|
---|
| 2176 | }
|
---|
[6a3a178] | 2177 |
|
---|
[fa375fe] | 2178 | if (activeTarget && scrollTop < offsets[0]) {
|
---|
| 2179 | this.activeTarget = null
|
---|
| 2180 | return this.clear()
|
---|
[6a3a178] | 2181 | }
|
---|
| 2182 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 2189 | }
|
---|
| 2190 |
|
---|
[fa375fe] | 2191 | ScrollSpy.prototype.activate = function (target) {
|
---|
| 2192 | this.activeTarget = target
|
---|
[6a3a178] | 2193 |
|
---|
[fa375fe] | 2194 | this.clear()
|
---|
[6a3a178] | 2195 |
|
---|
[fa375fe] | 2196 | var selector = this.selector +
|
---|
| 2197 | '[data-target="' + target + '"],' +
|
---|
| 2198 | this.selector + '[href="' + target + '"]'
|
---|
[6a3a178] | 2199 |
|
---|
[fa375fe] | 2200 | var active = $(selector)
|
---|
| 2201 | .parents('li')
|
---|
| 2202 | .addClass('active')
|
---|
[6a3a178] | 2203 |
|
---|
[fa375fe] | 2204 | if (active.parent('.dropdown-menu').length) {
|
---|
| 2205 | active = active
|
---|
| 2206 | .closest('li.dropdown')
|
---|
| 2207 | .addClass('active')
|
---|
| 2208 | }
|
---|
[6a3a178] | 2209 |
|
---|
[fa375fe] | 2210 | active.trigger('activate.bs.scrollspy')
|
---|
| 2211 | }
|
---|
[6a3a178] | 2212 |
|
---|
[fa375fe] | 2213 | ScrollSpy.prototype.clear = function () {
|
---|
| 2214 | $(this.selector)
|
---|
| 2215 | .parentsUntil(this.options.target, '.active')
|
---|
| 2216 | .removeClass('active')
|
---|
| 2217 | }
|
---|
[6a3a178] | 2218 |
|
---|
| 2219 |
|
---|
[fa375fe] | 2220 | // SCROLLSPY PLUGIN DEFINITION
|
---|
| 2221 | // ===========================
|
---|
[6a3a178] | 2222 |
|
---|
[fa375fe] | 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
|
---|
[6a3a178] | 2228 |
|
---|
[fa375fe] | 2229 | if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
---|
| 2230 | if (typeof option == 'string') data[option]()
|
---|
| 2231 | })
|
---|
| 2232 | }
|
---|
[6a3a178] | 2233 |
|
---|
[fa375fe] | 2234 | var old = $.fn.scrollspy
|
---|
[6a3a178] | 2235 |
|
---|
[fa375fe] | 2236 | $.fn.scrollspy = Plugin
|
---|
| 2237 | $.fn.scrollspy.Constructor = ScrollSpy
|
---|
[6a3a178] | 2238 |
|
---|
| 2239 |
|
---|
[fa375fe] | 2240 | // SCROLLSPY NO CONFLICT
|
---|
| 2241 | // =====================
|
---|
[6a3a178] | 2242 |
|
---|
[fa375fe] | 2243 | $.fn.scrollspy.noConflict = function () {
|
---|
| 2244 | $.fn.scrollspy = old
|
---|
| 2245 | return this
|
---|
| 2246 | }
|
---|
[6a3a178] | 2247 |
|
---|
| 2248 |
|
---|
[fa375fe] | 2249 | // SCROLLSPY DATA-API
|
---|
| 2250 | // ==================
|
---|
[6a3a178] | 2251 |
|
---|
[fa375fe] | 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 | })
|
---|
[6a3a178] | 2258 |
|
---|
[fa375fe] | 2259 | }(jQuery);
|
---|
[6a3a178] | 2260 |
|
---|
[fa375fe] | 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 | * ======================================================================== */
|
---|
[6a3a178] | 2268 |
|
---|
| 2269 |
|
---|
[fa375fe] | 2270 | +function ($) {
|
---|
| 2271 | 'use strict';
|
---|
[6a3a178] | 2272 |
|
---|
[fa375fe] | 2273 | // TAB CLASS DEFINITION
|
---|
| 2274 | // ====================
|
---|
[6a3a178] | 2275 |
|
---|
[fa375fe] | 2276 | var Tab = function (element) {
|
---|
| 2277 | // jscs:disable requireDollarBeforejQueryAssignment
|
---|
| 2278 | this.element = $(element)
|
---|
| 2279 | // jscs:enable requireDollarBeforejQueryAssignment
|
---|
| 2280 | }
|
---|
[6a3a178] | 2281 |
|
---|
[fa375fe] | 2282 | Tab.VERSION = '3.4.1'
|
---|
[6a3a178] | 2283 |
|
---|
[fa375fe] | 2284 | Tab.TRANSITION_DURATION = 150
|
---|
[6a3a178] | 2285 |
|
---|
[fa375fe] | 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')
|
---|
[6a3a178] | 2290 |
|
---|
[fa375fe] | 2291 | if (!selector) {
|
---|
| 2292 | selector = $this.attr('href')
|
---|
| 2293 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
---|
| 2294 | }
|
---|
[6a3a178] | 2295 |
|
---|
[fa375fe] | 2296 | if ($this.parent('li').hasClass('active')) return
|
---|
[6a3a178] | 2297 |
|
---|
[fa375fe] | 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 | })
|
---|
[6a3a178] | 2305 |
|
---|
[fa375fe] | 2306 | $previous.trigger(hideEvent)
|
---|
| 2307 | $this.trigger(showEvent)
|
---|
[6a3a178] | 2308 |
|
---|
[fa375fe] | 2309 | if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
|
---|
[6a3a178] | 2310 |
|
---|
[fa375fe] | 2311 | var $target = $(document).find(selector)
|
---|
[6a3a178] | 2312 |
|
---|
[fa375fe] | 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 | })
|
---|
| 2324 | }
|
---|
[6a3a178] | 2325 |
|
---|
[fa375fe] | 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)
|
---|
| 2331 |
|
---|
| 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)
|
---|
| 2340 |
|
---|
| 2341 | element
|
---|
| 2342 | .addClass('active')
|
---|
| 2343 | .find('[data-toggle="tab"]')
|
---|
| 2344 | .attr('aria-expanded', true)
|
---|
| 2345 |
|
---|
| 2346 | if (transition) {
|
---|
| 2347 | element[0].offsetWidth // reflow for transition
|
---|
| 2348 | element.addClass('in')
|
---|
| 2349 | } else {
|
---|
| 2350 | element.removeClass('fade')
|
---|
| 2351 | }
|
---|
[6a3a178] | 2352 |
|
---|
[fa375fe] | 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)
|
---|
| 2360 | }
|
---|
[6a3a178] | 2361 |
|
---|
[fa375fe] | 2362 | callback && callback()
|
---|
[6a3a178] | 2363 | }
|
---|
| 2364 |
|
---|
[fa375fe] | 2365 | $active.length && transition ?
|
---|
| 2366 | $active
|
---|
| 2367 | .one('bsTransitionEnd', next)
|
---|
| 2368 | .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
|
---|
| 2369 | next()
|
---|
| 2370 |
|
---|
| 2371 | $active.removeClass('in')
|
---|
[6a3a178] | 2372 | }
|
---|
| 2373 |
|
---|
| 2374 |
|
---|
[fa375fe] | 2375 | // TAB PLUGIN DEFINITION
|
---|
| 2376 | // =====================
|
---|
[6a3a178] | 2377 |
|
---|
[fa375fe] | 2378 | function Plugin(option) {
|
---|
| 2379 | return this.each(function () {
|
---|
| 2380 | var $this = $(this)
|
---|
| 2381 | var data = $this.data('bs.tab')
|
---|
[6a3a178] | 2382 |
|
---|
[fa375fe] | 2383 | if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
---|
| 2384 | if (typeof option == 'string') data[option]()
|
---|
| 2385 | })
|
---|
| 2386 | }
|
---|
[6a3a178] | 2387 |
|
---|
[fa375fe] | 2388 | var old = $.fn.tab
|
---|
[6a3a178] | 2389 |
|
---|
[fa375fe] | 2390 | $.fn.tab = Plugin
|
---|
| 2391 | $.fn.tab.Constructor = Tab
|
---|
[6a3a178] | 2392 |
|
---|
| 2393 |
|
---|
[fa375fe] | 2394 | // TAB NO CONFLICT
|
---|
| 2395 | // ===============
|
---|
[6a3a178] | 2396 |
|
---|
[fa375fe] | 2397 | $.fn.tab.noConflict = function () {
|
---|
| 2398 | $.fn.tab = old
|
---|
| 2399 | return this
|
---|
| 2400 | }
|
---|
[6a3a178] | 2401 |
|
---|
| 2402 |
|
---|
[fa375fe] | 2403 | // TAB DATA-API
|
---|
| 2404 | // ============
|
---|
[6a3a178] | 2405 |
|
---|
[fa375fe] | 2406 | var clickHandler = function (e) {
|
---|
| 2407 | e.preventDefault()
|
---|
| 2408 | Plugin.call($(this), 'show')
|
---|
| 2409 | }
|
---|
[6a3a178] | 2410 |
|
---|
[fa375fe] | 2411 | $(document)
|
---|
| 2412 | .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
|
---|
| 2413 | .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
|
---|
[6a3a178] | 2414 |
|
---|
[fa375fe] | 2415 | }(jQuery);
|
---|
[6a3a178] | 2416 |
|
---|
[fa375fe] | 2417 | /* ========================================================================
|
---|
| 2418 | * Bootstrap: affix.js v3.4.1
|
---|
| 2419 | * https://getbootstrap.com/docs/3.4/javascript/#affix
|
---|
| 2420 | * ========================================================================
|
---|
| 2421 | * Copyright 2011-2019 Twitter, Inc.
|
---|
| 2422 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
---|
| 2423 | * ======================================================================== */
|
---|
[6a3a178] | 2424 |
|
---|
| 2425 |
|
---|
[fa375fe] | 2426 | +function ($) {
|
---|
| 2427 | 'use strict';
|
---|
[6a3a178] | 2428 |
|
---|
[fa375fe] | 2429 | // AFFIX CLASS DEFINITION
|
---|
| 2430 | // ======================
|
---|
[6a3a178] | 2431 |
|
---|
[fa375fe] | 2432 | var Affix = function (element, options) {
|
---|
| 2433 | this.options = $.extend({}, Affix.DEFAULTS, options)
|
---|
[6a3a178] | 2434 |
|
---|
[fa375fe] | 2435 | var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)
|
---|
[6a3a178] | 2436 |
|
---|
[fa375fe] | 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))
|
---|
[6a3a178] | 2440 |
|
---|
[fa375fe] | 2441 | this.$element = $(element)
|
---|
| 2442 | this.affixed = null
|
---|
| 2443 | this.unpin = null
|
---|
| 2444 | this.pinnedOffset = null
|
---|
[6a3a178] | 2445 |
|
---|
[fa375fe] | 2446 | this.checkPosition()
|
---|
| 2447 | }
|
---|
[6a3a178] | 2448 |
|
---|
[fa375fe] | 2449 | Affix.VERSION = '3.4.1'
|
---|
[6a3a178] | 2450 |
|
---|
[fa375fe] | 2451 | Affix.RESET = 'affix affix-top affix-bottom'
|
---|
[6a3a178] | 2452 |
|
---|
[fa375fe] | 2453 | Affix.DEFAULTS = {
|
---|
| 2454 | offset: 0,
|
---|
| 2455 | target: window
|
---|
| 2456 | }
|
---|
[6a3a178] | 2457 |
|
---|
[fa375fe] | 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()
|
---|
[6a3a178] | 2462 |
|
---|
[fa375fe] | 2463 | if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
|
---|
[6a3a178] | 2464 |
|
---|
[fa375fe] | 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 | }
|
---|
[6a3a178] | 2469 |
|
---|
[fa375fe] | 2470 | var initializing = this.affixed == null
|
---|
| 2471 | var colliderTop = initializing ? scrollTop : position.top
|
---|
| 2472 | var colliderHeight = initializing ? targetHeight : height
|
---|
[6a3a178] | 2473 |
|
---|
[fa375fe] | 2474 | if (offsetTop != null && scrollTop <= offsetTop) return 'top'
|
---|
| 2475 | if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
|
---|
[6a3a178] | 2476 |
|
---|
[fa375fe] | 2477 | return false
|
---|
| 2478 | }
|
---|
[6a3a178] | 2479 |
|
---|
[fa375fe] | 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)
|
---|
| 2486 | }
|
---|
[6a3a178] | 2487 |
|
---|
[fa375fe] | 2488 | Affix.prototype.checkPositionWithEventLoop = function () {
|
---|
| 2489 | setTimeout($.proxy(this.checkPosition, this), 1)
|
---|
| 2490 | }
|
---|
[6a3a178] | 2491 |
|
---|
[fa375fe] | 2492 | Affix.prototype.checkPosition = function () {
|
---|
| 2493 | if (!this.$element.is(':visible')) return
|
---|
[6a3a178] | 2494 |
|
---|
[fa375fe] | 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())
|
---|
[6a3a178] | 2500 |
|
---|
[fa375fe] | 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)
|
---|
[6a3a178] | 2504 |
|
---|
[fa375fe] | 2505 | var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
|
---|
[6a3a178] | 2506 |
|
---|
[fa375fe] | 2507 | if (this.affixed != affix) {
|
---|
| 2508 | if (this.unpin != null) this.$element.css('top', '')
|
---|
[6a3a178] | 2509 |
|
---|
[fa375fe] | 2510 | var affixType = 'affix' + (affix ? '-' + affix : '')
|
---|
| 2511 | var e = $.Event(affixType + '.bs.affix')
|
---|
[6a3a178] | 2512 |
|
---|
[fa375fe] | 2513 | this.$element.trigger(e)
|
---|
[6a3a178] | 2514 |
|
---|
[fa375fe] | 2515 | if (e.isDefaultPrevented()) return
|
---|
[6a3a178] | 2516 |
|
---|
[fa375fe] | 2517 | this.affixed = affix
|
---|
| 2518 | this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
---|
[6a3a178] | 2519 |
|
---|
[fa375fe] | 2520 | this.$element
|
---|
| 2521 | .removeClass(Affix.RESET)
|
---|
| 2522 | .addClass(affixType)
|
---|
| 2523 | .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
|
---|
| 2524 | }
|
---|
[6a3a178] | 2525 |
|
---|
[fa375fe] | 2526 | if (affix == 'bottom') {
|
---|
| 2527 | this.$element.offset({
|
---|
| 2528 | top: scrollHeight - height - offsetBottom
|
---|
| 2529 | })
|
---|
[6a3a178] | 2530 | }
|
---|
[fa375fe] | 2531 | }
|
---|
[6a3a178] | 2532 |
|
---|
| 2533 |
|
---|
[fa375fe] | 2534 | // AFFIX PLUGIN DEFINITION
|
---|
| 2535 | // =======================
|
---|
[6a3a178] | 2536 |
|
---|
[fa375fe] | 2537 | function Plugin(option) {
|
---|
| 2538 | return this.each(function () {
|
---|
| 2539 | var $this = $(this)
|
---|
| 2540 | var data = $this.data('bs.affix')
|
---|
| 2541 | var options = typeof option == 'object' && option
|
---|
[6a3a178] | 2542 |
|
---|
[fa375fe] | 2543 | if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
---|
| 2544 | if (typeof option == 'string') data[option]()
|
---|
| 2545 | })
|
---|
| 2546 | }
|
---|
[6a3a178] | 2547 |
|
---|
[fa375fe] | 2548 | var old = $.fn.affix
|
---|
[6a3a178] | 2549 |
|
---|
[fa375fe] | 2550 | $.fn.affix = Plugin
|
---|
| 2551 | $.fn.affix.Constructor = Affix
|
---|
[6a3a178] | 2552 |
|
---|
| 2553 |
|
---|
[fa375fe] | 2554 | // AFFIX NO CONFLICT
|
---|
| 2555 | // =================
|
---|
[6a3a178] | 2556 |
|
---|
[fa375fe] | 2557 | $.fn.affix.noConflict = function () {
|
---|
| 2558 | $.fn.affix = old
|
---|
| 2559 | return this
|
---|
| 2560 | }
|
---|
[6a3a178] | 2561 |
|
---|
| 2562 |
|
---|
[fa375fe] | 2563 | // AFFIX DATA-API
|
---|
| 2564 | // ==============
|
---|
[6a3a178] | 2565 |
|
---|
[fa375fe] | 2566 | $(window).on('load', function () {
|
---|
| 2567 | $('[data-spy="affix"]').each(function () {
|
---|
| 2568 | var $spy = $(this)
|
---|
| 2569 | var data = $spy.data()
|
---|
[6a3a178] | 2570 |
|
---|
[fa375fe] | 2571 | data.offset = data.offset || {}
|
---|
[6a3a178] | 2572 |
|
---|
[fa375fe] | 2573 | if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
|
---|
| 2574 | if (data.offsetTop != null) data.offset.top = data.offsetTop
|
---|
[6a3a178] | 2575 |
|
---|
[fa375fe] | 2576 | Plugin.call($spy, data)
|
---|
| 2577 | })
|
---|
| 2578 | })
|
---|
[6a3a178] | 2579 |
|
---|
[fa375fe] | 2580 | }(jQuery);
|
---|