Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4C8B2200BAC for ; Wed, 26 Oct 2016 21:37:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4B346160AE1; Wed, 26 Oct 2016 19:37:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 83755160B05 for ; Wed, 26 Oct 2016 21:37:31 +0200 (CEST) Received: (qmail 55307 invoked by uid 500); 26 Oct 2016 19:37:30 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 54942 invoked by uid 99); 26 Oct 2016 19:37:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2016 19:37:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EFDEBE08AB; Wed, 26 Oct 2016 19:37:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Wed, 26 Oct 2016 19:37:31 -0000 Message-Id: <9ff79a84d43f47558cdcc3171331bc3a@git.apache.org> In-Reply-To: <18acd6ed33d2446eabeec4938b66fada@git.apache.org> References: <18acd6ed33d2446eabeec4938b66fada@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/31] accumulo git commit: ACCUMULO-4503 Upgraded Bootstrap and changed theme archived-at: Wed, 26 Oct 2016 19:37:34 -0000 http://git-wip-us.apache.org/repos/asf/accumulo/blob/b7f105ff/fonts/glyphicons-halflings-regular.woff ---------------------------------------------------------------------- diff --git a/fonts/glyphicons-halflings-regular.woff b/fonts/glyphicons-halflings-regular.woff index 8c54182..9e61285 100644 Binary files a/fonts/glyphicons-halflings-regular.woff and b/fonts/glyphicons-halflings-regular.woff differ http://git-wip-us.apache.org/repos/asf/accumulo/blob/b7f105ff/fonts/glyphicons-halflings-regular.woff2 ---------------------------------------------------------------------- diff --git a/fonts/glyphicons-halflings-regular.woff2 b/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000..64539b5 Binary files /dev/null and b/fonts/glyphicons-halflings-regular.woff2 differ http://git-wip-us.apache.org/repos/asf/accumulo/blob/b7f105ff/js/bootstrap.js ---------------------------------------------------------------------- diff --git a/js/bootstrap.js b/js/bootstrap.js index 8ae571b..8a2e99a 100644 --- a/js/bootstrap.js +++ b/js/bootstrap.js @@ -1,16 +1,26 @@ /*! - * Bootstrap v3.1.1 (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license */ -if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } +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: transition.js v3.1.1 + * Bootstrap: transition.js v3.3.7 * http://getbootstrap.com/javascript/#transitions * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -25,10 +35,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re 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) { @@ -42,8 +52,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { - var called = false, $el = this - $(this).one($.support.transition.end, function () { called = true }) + var called = false + var $el = this + $(this).one('bsTransitionEnd', function () { called = true }) var callback = function () { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this @@ -51,15 +62,25 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re $(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); /* ======================================================================== - * Bootstrap: alert.js v3.1.1 + * Bootstrap: alert.js v3.3.7 * http://getbootstrap.com/javascript/#alerts * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -75,6 +96,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re $(el).on('click', dismiss, this.close) } + Alert.VERSION = '3.3.7' + + Alert.TRANSITION_DURATION = 150 + Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') @@ -84,12 +109,12 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } - var $parent = $(selector) + var $parent = $(selector === '#' ? [] : selector) if (e) e.preventDefault() if (!$parent.length) { - $parent = $this.hasClass('alert') ? $this : $this.parent() + $parent = $this.closest('.alert') } $parent.trigger(e = $.Event('close.bs.alert')) @@ -99,13 +124,14 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re $parent.removeClass('in') function removeElement() { - $parent.trigger('closed.bs.alert').remove() + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? $parent - .one($.support.transition.end, removeElement) - .emulateTransitionEnd(150) : + .one('bsTransitionEnd', removeElement) + .emulateTransitionEnd(Alert.TRANSITION_DURATION) : removeElement() } @@ -113,9 +139,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // ALERT PLUGIN DEFINITION // ======================= - var old = $.fn.alert - - $.fn.alert = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert') @@ -125,6 +149,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re }) } + var old = $.fn.alert + + $.fn.alert = Plugin $.fn.alert.Constructor = Alert @@ -145,10 +172,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re }(jQuery); /* ======================================================================== - * Bootstrap: button.js v3.1.1 + * Bootstrap: button.js v3.3.7 * http://getbootstrap.com/javascript/#buttons * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -165,6 +192,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.isLoading = false } + Button.VERSION = '3.3.7' + Button.DEFAULTS = { loadingText: 'loading...' } @@ -175,20 +204,20 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re var val = $el.is('input') ? 'val' : 'html' var data = $el.data() - state = state + 'Text' - - if (!data.resetText) $el.data('resetText', $el[val]()) + state += 'Text' - $el[val](data[state] || this.options[state]) + if (data.resetText == null) $el.data('resetText', $el[val]()) // 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) + $el.addClass(d).attr(d, d).prop(d, true) } else if (this.isLoading) { this.isLoading = false - $el.removeClass(d).removeAttr(d) + $el.removeClass(d).removeAttr(d).prop(d, false) } }, this), 0) } @@ -200,22 +229,26 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re if ($parent.length) { var $input = this.$element.find('input') if ($input.prop('type') == 'radio') { - if ($input.prop('checked') && this.$element.hasClass('active')) changed = false - else $parent.find('.active').removeClass('active') + 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') } - if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + $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') } - - if (changed) this.$element.toggleClass('active') } // BUTTON PLUGIN DEFINITION // ======================== - var old = $.fn.button - - $.fn.button = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') @@ -228,6 +261,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re }) } + var old = $.fn.button + + $.fn.button = Plugin $.fn.button.Constructor = Button @@ -243,20 +279,29 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // BUTTON DATA-API // =============== - $(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() - }) + $(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)) + }) }(jQuery); /* ======================================================================== - * Bootstrap: carousel.js v3.1.1 + * Bootstrap: carousel.js v3.3.7 * http://getbootstrap.com/javascript/#carousel * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -271,24 +316,42 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.$element = $(element) this.$indicators = this.$element.find('.carousel-indicators') this.options = options - this.paused = - this.sliding = - this.interval = - this.$active = + this.paused = null + this.sliding = null + this.interval = null + this.$active = null this.$items = null - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) + 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)) } + Carousel.VERSION = '3.3.7' + + Carousel.TRANSITION_DURATION = 600 + Carousel.DEFAULTS = { interval: 5000, pause: 'hover', - wrap: true + 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() } - Carousel.prototype.cycle = function (e) { + Carousel.prototype.cycle = function (e) { e || (this.paused = false) this.interval && clearInterval(this.interval) @@ -300,23 +363,31 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re return this } - Carousel.prototype.getActiveIndex = function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() + Carousel.prototype.getItemIndex = function (item) { + this.$items = item.parent().children('.item') + return this.$items.index(item || this.$active) + } - return this.$items.index(this.$active) + 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) } Carousel.prototype.to = function (pos) { var that = this - var activeIndex = this.getActiveIndex() + var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) if (pos > (this.$items.length - 1) || pos < 0) return - if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" if (activeIndex == pos) return this.pause().cycle() - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } Carousel.prototype.pause = function (e) { @@ -344,22 +415,20 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') - var $next = next || $active[type]() + var $next = next || this.getItemForDirection(type, $active) var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' - var fallback = type == 'next' ? 'first' : 'last' var that = this - if (!$next.length) { - if (!this.options.wrap) return - $next = this.$element.find('.item')[fallback]() - } - - if ($next.hasClass('active')) return this.sliding = false + if ($next.hasClass('active')) return (this.sliding = false) - var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) - this.$element.trigger(e) - if (e.isDefaultPrevented()) return + var relatedTarget = $next[0] + var slideEvent = $.Event('slide.bs.carousel', { + relatedTarget: relatedTarget, + direction: direction + }) + this.$element.trigger(slideEvent) + if (slideEvent.isDefaultPrevented()) return this.sliding = true @@ -367,30 +436,31 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') - this.$element.one('slid.bs.carousel', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) + var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) + $nextIndicator && $nextIndicator.addClass('active') } + var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" if ($.support.transition && this.$element.hasClass('slide')) { $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) $active - .one($.support.transition.end, function () { + .one('bsTransitionEnd', function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false - setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) + setTimeout(function () { + that.$element.trigger(slidEvent) + }, 0) }) - .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) + .emulateTransitionEnd(Carousel.TRANSITION_DURATION) } else { $active.removeClass('active') $next.addClass('active') this.sliding = false - this.$element.trigger('slid.bs.carousel') + this.$element.trigger(slidEvent) } isCycling && this.cycle() @@ -402,9 +472,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // CAROUSEL PLUGIN DEFINITION // ========================== - var old = $.fn.carousel - - $.fn.carousel = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') @@ -418,6 +486,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re }) } + var old = $.fn.carousel + + $.fn.carousel = Plugin $.fn.carousel.Constructor = Carousel @@ -433,39 +504,46 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // CAROUSEL DATA-API // ================= - $(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 clickHandler = function (e) { + var href + var $this = $(this) + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 + if (!$target.hasClass('carousel')) return var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false - $target.carousel(options) + Plugin.call($target, options) - if (slideIndex = $this.attr('data-slide-to')) { + if (slideIndex) { $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) - $carousel.carousel($carousel.data()) + Plugin.call($carousel, $carousel.data()) }) }) }(jQuery); /* ======================================================================== - * Bootstrap: collapse.js v3.1.1 + * Bootstrap: collapse.js v3.3.7 * http://getbootstrap.com/javascript/#collapse * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +/* jshint latedef: false */ +function ($) { 'use strict'; @@ -476,12 +554,23 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re 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.options.parent) + if (this.options.parent) { + this.$parent = this.getParent() + } else { + this.addAriaAndCollapsedClass(this.$element, this.$trigger) + } + if (this.options.toggle) this.toggle() } + Collapse.VERSION = '3.3.7' + + Collapse.TRANSITION_DURATION = 350 + Collapse.DEFAULTS = { toggle: true } @@ -494,35 +583,43 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re 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) { - var hasData = actives.data('bs.collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('bs.collapse', null) + Plugin.call(actives, 'hide') + activesData || actives.data('bs.collapse', null) } var dimension = this.dimension() this.$element .removeClass('collapse') - .addClass('collapsing') - [dimension](0) + .addClass('collapsing')[dimension](0) + .attr('aria-expanded', true) + + this.$trigger + .removeClass('collapsed') + .attr('aria-expanded', true) this.transitioning = 1 var complete = function () { this.$element .removeClass('collapsing') - .addClass('collapse in') - [dimension]('auto') + .addClass('collapse in')[dimension]('') this.transitioning = 0 - this.$element.trigger('shown.bs.collapse') + this.$element + .trigger('shown.bs.collapse') } if (!$.support.transition) return complete.call(this) @@ -530,9 +627,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re var scrollSize = $.camelCase(['scroll', dimension].join('-')) this.$element - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - [dimension](this.$element[0][scrollSize]) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { @@ -544,55 +640,85 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re 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') - .removeClass('in') + .removeClass('collapse in') + .attr('aria-expanded', false) + + this.$trigger + .addClass('collapsed') + .attr('aria-expanded', false) 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($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION) } Collapse.prototype.toggle = function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() } + Collapse.prototype.getParent = function () { + return $(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 $(target) + } + // COLLAPSE PLUGIN DEFINITION // ========================== - var old = $.fn.collapse - - $.fn.collapse = function (option) { + function Plugin(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 && option == 'show') option = !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 @@ -608,32 +734,25 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // COLLAPSE DATA-API // ================= - $(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) + $(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) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() - var parent = $this.attr('data-parent') - var $parent = parent && $(parent) - - 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) + Plugin.call($target, option) }) }(jQuery); /* ======================================================================== - * Bootstrap: dropdown.js v3.1.1 + * Bootstrap: dropdown.js v3.3.7 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -645,11 +764,47 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // ========================= 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.3.7' + + 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 && $(selector) + + 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)) + }) + } + Dropdown.prototype.toggle = function (e) { var $this = $(this) @@ -663,7 +818,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we use a backdrop because click events don't delegate - $('