From 36219f638ccdb3364b32cc2d415ffe718dac55e4 Mon Sep 17 00:00:00 2001 From: Bruno Cavaleiro Date: Tue, 23 Jul 2024 14:57:29 +0100 Subject: [PATCH] Revert "[PPP-4305] Upgrade boostsrap.js to 3.4.1" This reverts commit 4d539a4bc7ced33b5f7272afd86059f55faf32f4. --- js/vendor/bootstrap.js | 1895 +++++++++++++----------------------- js/vendor/bootstrap.min.js | 12 +- 2 files changed, 663 insertions(+), 1244 deletions(-) diff --git a/js/vendor/bootstrap.js b/js/vendor/bootstrap.js index 170bd608f..2c6425714 100644 --- a/js/vendor/bootstrap.js +++ b/js/vendor/bootstrap.js @@ -1,44 +1,43 @@ -/*! - * Bootstrap v3.4.1 (https://getbootstrap.com/) - * Copyright 2011-2019 Twitter, Inc. - * Licensed under the MIT license - */ - -if (typeof jQuery === 'undefined') { - throw new Error('Bootstrap\'s JavaScript requires jQuery') -} - -+function ($) { - 'use strict'; - var version = $.fn.jquery.split(' ')[0].split('.') - if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { - throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') - } -}(jQuery); +/** +* bootstrap.js v3.0.0 by @fat and @mdo +* Copyright 2013 Twitter Inc. +* http://www.apache.org/licenses/LICENSE-2.0 +*/ +if (!jQuery) { throw new Error("Bootstrap requires jQuery") } /* ======================================================================== - * Bootstrap: transition.js v3.4.1 - * https://getbootstrap.com/docs/3.4/javascript/#transitions + * Bootstrap: transition.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#transitions * ======================================================================== - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ======================================================================== */ -+function ($) { - 'use strict'; ++function ($) { "use strict"; - // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/) + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) // ============================================================ function transitionEnd() { var el = document.createElement('bootstrap') var transEndEventNames = { - WebkitTransition : 'webkitTransitionEnd', - MozTransition : 'transitionend', - OTransition : 'oTransitionEnd otransitionend', - transition : 'transitionend' + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' } for (var name in transEndEventNames) { @@ -46,15 +45,12 @@ if (typeof jQuery === 'undefined') { return { end: transEndEventNames[name] } } } - - return false // explicit for ie8 ( ._.) } - // https://blog.alexmaccaw.com/css-transitions + // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { - var called = false - var $el = this - $(this).one('bsTransitionEnd', function () { called = true }) + var called = false, $el = this + $(this).one($.support.transition.end, function () { called = true }) var callback = function () { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this @@ -62,31 +58,31 @@ if (typeof jQuery === 'undefined') { $(function () { $.support.transition = transitionEnd() - - if (!$.support.transition) return - - $.event.special.bsTransitionEnd = { - bindType: $.support.transition.end, - delegateType: $.support.transition.end, - handle: function (e) { - if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) - } - } }) -}(jQuery); +}(window.jQuery); /* ======================================================================== - * Bootstrap: alert.js v3.4.1 - * https://getbootstrap.com/docs/3.4/javascript/#alerts + * Bootstrap: alert.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#alerts * ======================================================================== - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ======================================================================== */ -+function ($) { - 'use strict'; ++function ($) { "use strict"; // ALERT CLASS DEFINITION // ====================== @@ -96,10 +92,6 @@ if (typeof jQuery === 'undefined') { $(el).on('click', dismiss, this.close) } - Alert.VERSION = '3.4.1' - - Alert.TRANSITION_DURATION = 150 - Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') @@ -109,13 +101,12 @@ if (typeof jQuery === 'undefined') { selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } - selector = selector === '#' ? [] : selector - var $parent = $(document).find(selector) + var $parent = $(selector) if (e) e.preventDefault() if (!$parent.length) { - $parent = $this.closest('.alert') + $parent = $this.hasClass('alert') ? $this : $this.parent() } $parent.trigger(e = $.Event('close.bs.alert')) @@ -125,14 +116,13 @@ if (typeof jQuery === 'undefined') { $parent.removeClass('in') function removeElement() { - // detach from parent, fire event then clean up data - $parent.detach().trigger('closed.bs.alert').remove() + $parent.trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? $parent - .one('bsTransitionEnd', removeElement) - .emulateTransitionEnd(Alert.TRANSITION_DURATION) : + .one($.support.transition.end, removeElement) + .emulateTransitionEnd(150) : removeElement() } @@ -140,7 +130,9 @@ if (typeof jQuery === 'undefined') { // ALERT PLUGIN DEFINITION // ======================= - function Plugin(option) { + var old = $.fn.alert + + $.fn.alert = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert') @@ -150,9 +142,6 @@ if (typeof jQuery === 'undefined') { }) } - var old = $.fn.alert - - $.fn.alert = Plugin $.fn.alert.Constructor = Alert @@ -170,31 +159,38 @@ if (typeof jQuery === 'undefined') { $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) -}(jQuery); +}(window.jQuery); /* ======================================================================== - * Bootstrap: button.js v3.4.1 - * https://getbootstrap.com/docs/3.4/javascript/#buttons + * Bootstrap: button.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#buttons * ======================================================================== - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ======================================================================== */ -+function ($) { - 'use strict'; ++function ($) { "use strict"; // BUTTON PUBLIC CLASS DEFINITION // ============================== var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) - this.isLoading = false + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) } - Button.VERSION = '3.4.1' - Button.DEFAULTS = { loadingText: 'loading...' } @@ -205,51 +201,40 @@ if (typeof jQuery === 'undefined') { var val = $el.is('input') ? 'val' : 'html' var data = $el.data() - state += 'Text' + state = state + 'Text' - if (data.resetText == null) $el.data('resetText', $el[val]()) + if (!data.resetText) $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) // push to event loop to allow forms to submit - setTimeout($.proxy(function () { - $el[val](data[state] == null ? this.options[state] : data[state]) - - if (state == 'loadingText') { - this.isLoading = true - $el.addClass(d).attr(d, d).prop(d, true) - } else if (this.isLoading) { - this.isLoading = false - $el.removeClass(d).removeAttr(d).prop(d, false) - } - }, this), 0) + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d); + }, 0) } Button.prototype.toggle = function () { - var changed = true var $parent = this.$element.closest('[data-toggle="buttons"]') if ($parent.length) { var $input = this.$element.find('input') - if ($input.prop('type') == 'radio') { - if ($input.prop('checked')) changed = false - $parent.find('.active').removeClass('active') - this.$element.addClass('active') - } else if ($input.prop('type') == 'checkbox') { - if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false - this.$element.toggleClass('active') - } - $input.prop('checked', this.$element.hasClass('active')) - if (changed) $input.trigger('change') - } else { - this.$element.attr('aria-pressed', !this.$element.hasClass('active')) - this.$element.toggleClass('active') + .prop('checked', !this.$element.hasClass('active')) + .trigger('change') + if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') } + + this.$element.toggleClass('active') } // BUTTON PLUGIN DEFINITION // ======================== - function Plugin(option) { + var old = $.fn.button + + $.fn.button = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') @@ -262,9 +247,6 @@ if (typeof jQuery === 'undefined') { }) } - var old = $.fn.button - - $.fn.button = Plugin $.fn.button.Constructor = Button @@ -280,35 +262,36 @@ if (typeof jQuery === 'undefined') { // BUTTON DATA-API // =============== - $(document) - .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { - var $btn = $(e.target).closest('.btn') - Plugin.call($btn, 'toggle') - if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { - // Prevent double click on radios, and the double selections (so cancellation) on checkboxes - e.preventDefault() - // The target component still receive the focus - if ($btn.is('input,button')) $btn.trigger('focus') - else $btn.find('input:visible,button:visible').first().trigger('focus') - } - }) - .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { - $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) - }) + $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + e.preventDefault() + }) -}(jQuery); +}(window.jQuery); /* ======================================================================== - * Bootstrap: carousel.js v3.4.1 - * https://getbootstrap.com/docs/3.4/javascript/#carousel + * Bootstrap: carousel.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#carousel * ======================================================================== - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ======================================================================== */ -+function ($) { - 'use strict'; ++function ($) { "use strict"; // CAROUSEL CLASS DEFINITION // ========================= @@ -317,42 +300,24 @@ if (typeof jQuery === 'undefined') { this.$element = $(element) this.$indicators = this.$element.find('.carousel-indicators') this.options = options - this.paused = null - this.sliding = null - this.interval = null - this.$active = null + this.paused = + this.sliding = + this.interval = + this.$active = this.$items = null - this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) - - this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element - .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) - .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) } - Carousel.VERSION = '3.4.1' - - Carousel.TRANSITION_DURATION = 600 - Carousel.DEFAULTS = { - interval: 5000, - pause: 'hover', - wrap: true, - keyboard: true - } - - Carousel.prototype.keydown = function (e) { - if (/input|textarea/i.test(e.target.tagName)) return - switch (e.which) { - case 37: this.prev(); break - case 39: this.next(); break - default: return - } - - e.preventDefault() + interval: 5000 + , pause: 'hover' + , wrap: true } - Carousel.prototype.cycle = function (e) { + Carousel.prototype.cycle = function (e) { e || (this.paused = false) this.interval && clearInterval(this.interval) @@ -364,37 +329,29 @@ if (typeof jQuery === 'undefined') { return this } - Carousel.prototype.getItemIndex = function (item) { - this.$items = item.parent().children('.item') - return this.$items.index(item || this.$active) - } + Carousel.prototype.getActiveIndex = function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() - Carousel.prototype.getItemForDirection = function (direction, active) { - var activeIndex = this.getItemIndex(active) - var willWrap = (direction == 'prev' && activeIndex === 0) - || (direction == 'next' && activeIndex == (this.$items.length - 1)) - if (willWrap && !this.options.wrap) return active - var delta = direction == 'prev' ? -1 : 1 - var itemIndex = (activeIndex + delta) % this.$items.length - return this.$items.eq(itemIndex) + return this.$items.index(this.$active) } Carousel.prototype.to = function (pos) { var that = this - var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) + var activeIndex = this.getActiveIndex() if (pos > (this.$items.length - 1) || pos < 0) return - if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" + if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) if (activeIndex == pos) return this.pause().cycle() - return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) } Carousel.prototype.pause = function (e) { e || (this.paused = true) - if (this.$element.find('.next, .prev').length && $.support.transition) { + if (this.$element.find('.next, .prev').length && $.support.transition.end) { this.$element.trigger($.support.transition.end) this.cycle(true) } @@ -416,54 +373,55 @@ if (typeof jQuery === 'undefined') { Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') - var $next = next || this.getItemForDirection(type, $active) + var $next = next || $active[type]() var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' + var fallback = type == 'next' ? 'first' : 'last' var that = this - if ($next.hasClass('active')) return (this.sliding = false) - - var relatedTarget = $next[0] - var slideEvent = $.Event('slide.bs.carousel', { - relatedTarget: relatedTarget, - direction: direction - }) - this.$element.trigger(slideEvent) - if (slideEvent.isDefaultPrevented()) return + if (!$next.length) { + if (!this.options.wrap) return + $next = this.$element.find('.item')[fallback]() + } this.sliding = true isCycling && this.pause() + var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) + + if ($next.hasClass('active')) return + if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') - var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) - $nextIndicator && $nextIndicator.addClass('active') + this.$element.one('slid', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) } - var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return $next.addClass(type) - if (typeof $next === 'object' && $next.length) { - $next[0].offsetWidth // force reflow - } + $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) $active - .one('bsTransitionEnd', function () { + .one($.support.transition.end, function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false - setTimeout(function () { - that.$element.trigger(slidEvent) - }, 0) + setTimeout(function () { that.$element.trigger('slid') }, 0) }) - .emulateTransitionEnd(Carousel.TRANSITION_DURATION) + .emulateTransitionEnd(600) } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return $active.removeClass('active') $next.addClass('active') this.sliding = false - this.$element.trigger(slidEvent) + this.$element.trigger('slid') } isCycling && this.cycle() @@ -475,7 +433,9 @@ if (typeof jQuery === 'undefined') { // CAROUSEL PLUGIN DEFINITION // ========================== - function Plugin(option) { + var old = $.fn.carousel + + $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') @@ -489,9 +449,6 @@ if (typeof jQuery === 'undefined') { }) } - var old = $.fn.carousel - - $.fn.carousel = Plugin $.fn.carousel.Constructor = Carousel @@ -507,56 +464,52 @@ if (typeof jQuery === 'undefined') { // CAROUSEL DATA-API // ================= - var clickHandler = function (e) { - var $this = $(this) - var href = $this.attr('href') - if (href) { - href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 - } - - var target = $this.attr('data-target') || href - var $target = $(document).find(target) - - if (!$target.hasClass('carousel')) return - + $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false - Plugin.call($target, options) + $target.carousel(options) - if (slideIndex) { + if (slideIndex = $this.attr('data-slide-to')) { $target.data('bs.carousel').to(slideIndex) } e.preventDefault() - } - - $(document) - .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) - .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) + }) $(window).on('load', function () { $('[data-ride="carousel"]').each(function () { var $carousel = $(this) - Plugin.call($carousel, $carousel.data()) + $carousel.carousel($carousel.data()) }) }) -}(jQuery); +}(window.jQuery); /* ======================================================================== - * Bootstrap: collapse.js v3.4.1 - * https://getbootstrap.com/docs/3.4/javascript/#collapse + * Bootstrap: collapse.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#collapse * ======================================================================== - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ======================================================================== */ -/* jshint latedef: false */ -+function ($) { - 'use strict'; ++function ($) { "use strict"; // COLLAPSE PUBLIC CLASS DEFINITION // ================================ @@ -564,23 +517,12 @@ if (typeof jQuery === 'undefined') { var Collapse = function (element, options) { this.$element = $(element) this.options = $.extend({}, Collapse.DEFAULTS, options) - this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + - '[data-toggle="collapse"][data-target="#' + element.id + '"]') this.transitioning = null - if (this.options.parent) { - this.$parent = this.getParent() - } else { - this.addAriaAndCollapsedClass(this.$element, this.$trigger) - } - + if (this.options.parent) this.$parent = $(this.options.parent) if (this.options.toggle) this.toggle() } - Collapse.VERSION = '3.4.1' - - Collapse.TRANSITION_DURATION = 350 - Collapse.DEFAULTS = { toggle: true } @@ -593,43 +535,35 @@ if (typeof jQuery === 'undefined') { Collapse.prototype.show = function () { if (this.transitioning || this.$element.hasClass('in')) return - var activesData - var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') - - if (actives && actives.length) { - activesData = actives.data('bs.collapse') - if (activesData && activesData.transitioning) return - } - var startEvent = $.Event('show.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return + var actives = this.$parent && this.$parent.find('> .panel > .in') + if (actives && actives.length) { - Plugin.call(actives, 'hide') - activesData || actives.data('bs.collapse', null) + var hasData = actives.data('bs.collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('bs.collapse', null) } var dimension = this.dimension() this.$element .removeClass('collapse') - .addClass('collapsing')[dimension](0) - .attr('aria-expanded', true) - - this.$trigger - .removeClass('collapsed') - .attr('aria-expanded', true) + .addClass('collapsing') + [dimension](0) this.transitioning = 1 var complete = function () { this.$element .removeClass('collapsing') - .addClass('collapse in')[dimension]('') + .addClass('in') + [dimension]('auto') this.transitioning = 0 - this.$element - .trigger('shown.bs.collapse') + this.$element.trigger('shown.bs.collapse') } if (!$.support.transition) return complete.call(this) @@ -637,8 +571,9 @@ if (typeof jQuery === 'undefined') { var scrollSize = $.camelCase(['scroll', dimension].join('-')) this.$element - .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + [dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { @@ -650,85 +585,54 @@ if (typeof jQuery === 'undefined') { var dimension = this.dimension() - this.$element[dimension](this.$element[dimension]())[0].offsetHeight + this.$element + [dimension](this.$element[dimension]()) + [0].offsetHeight this.$element .addClass('collapsing') - .removeClass('collapse in') - .attr('aria-expanded', false) - - this.$trigger - .addClass('collapsed') - .attr('aria-expanded', false) + .removeClass('collapse') + .removeClass('in') this.transitioning = 1 var complete = function () { this.transitioning = 0 this.$element + .trigger('hidden.bs.collapse') .removeClass('collapsing') .addClass('collapse') - .trigger('hidden.bs.collapse') } if (!$.support.transition) return complete.call(this) this.$element [dimension](0) - .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(Collapse.TRANSITION_DURATION) + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) } Collapse.prototype.toggle = function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() } - Collapse.prototype.getParent = function () { - return $(document).find(this.options.parent) - .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') - .each($.proxy(function (i, element) { - var $element = $(element) - this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) - }, this)) - .end() - } - - Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { - var isOpen = $element.hasClass('in') - - $element.attr('aria-expanded', isOpen) - $trigger - .toggleClass('collapsed', !isOpen) - .attr('aria-expanded', isOpen) - } - - function getTargetFromTrigger($trigger) { - var href - var target = $trigger.attr('data-target') - || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 - - return $(document).find(target) - } - // COLLAPSE PLUGIN DEFINITION // ========================== - function Plugin(option) { + var old = $.fn.collapse + + $.fn.collapse = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } - var old = $.fn.collapse - - $.fn.collapse = Plugin $.fn.collapse.Constructor = Collapse @@ -744,75 +648,56 @@ if (typeof jQuery === 'undefined') { // COLLAPSE DATA-API // ================= - $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { - var $this = $(this) - - if (!$this.attr('data-target')) e.preventDefault() - - var $target = getTargetFromTrigger($this) + $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + var target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + var $target = $(target) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() + var parent = $this.attr('data-parent') + var $parent = parent && $(parent) - Plugin.call($target, option) + if (!data || !data.transitioning) { + if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') + $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + } + + $target.collapse(option) }) -}(jQuery); +}(window.jQuery); /* ======================================================================== - * Bootstrap: dropdown.js v3.4.1 - * https://getbootstrap.com/docs/3.4/javascript/#dropdowns + * Bootstrap: dropdown.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#dropdowns * ======================================================================== - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ======================================================================== */ -+function ($) { - 'use strict'; ++function ($) { "use strict"; // DROPDOWN CLASS DEFINITION // ========================= var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle="dropdown"]' + var toggle = '[data-toggle=dropdown]' var Dropdown = function (element) { - $(element).on('click.bs.dropdown', this.toggle) - } - - Dropdown.VERSION = '3.4.1' - - function getParent($this) { - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - var $parent = selector !== '#' ? $(document).find(selector) : null - - return $parent && $parent.length ? $parent : $this.parent() - } - - function clearMenus(e) { - if (e && e.which === 3) return - $(backdrop).remove() - $(toggle).each(function () { - var $this = $(this) - var $parent = getParent($this) - var relatedTarget = { relatedTarget: this } - - if (!$parent.hasClass('open')) return - - if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return - - $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) - - if (e.isDefaultPrevented()) return - - $this.attr('aria-expanded', 'false') - $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) - }) + var $el = $(element).on('click.bs.dropdown', this.toggle) } Dropdown.prototype.toggle = function (e) { @@ -827,32 +712,26 @@ if (typeof jQuery === 'undefined') { if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we use a backdrop because click events don't delegate - $(document.createElement('div')) - .addClass('dropdown-backdrop') - .insertAfter($(this)) - .on('click', clearMenus) + // if mobile we we use a backdrop because click events don't delegate + $('