From 816d5bd2e3268aac543ecfe534290879ee59da1d Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Sat, 17 Jun 2017 15:07:49 +0200 Subject: [PATCH 01/10] Docs: accessibility and IE fixes for SVG-based top navigation (#22848) * Add explicit aria-label attributes to based links As some browser/AT combinations don't seem to fully support grabbing the `` from inside the `` as the link text/name to announce (e.g. Firefox+NVDA) * Add to Bootstrap logo * Add to menu * Add explicit focusable="false" to icons Due to a bug/"feature" in IE, `` elements are usually separately focusable, which then results in links with `` icons being essentially focused twice (once for the link, and once for the `` inside, which is then also non-interactive) --- _includes/docs-navbar.html | 8 ++++---- _includes/icons/bootstrap.svg | 2 +- _includes/icons/github.svg | 2 +- _includes/icons/menu.svg | 2 +- _includes/icons/slack.svg | 2 +- _includes/icons/twitter.svg | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/_includes/docs-navbar.html b/_includes/docs-navbar.html index 0b2401d4db..89960f0ac5 100644 --- a/_includes/docs-navbar.html +++ b/_includes/docs-navbar.html @@ -1,5 +1,5 @@ diff --git a/_includes/icons/bootstrap.svg b/_includes/icons/bootstrap.svg index f482312e9c..ce8df77388 100644 --- a/_includes/icons/bootstrap.svg +++ b/_includes/icons/bootstrap.svg @@ -1 +1 @@ - +Bootstrap diff --git a/_includes/icons/github.svg b/_includes/icons/github.svg index b582b78f31..5d6ad18040 100644 --- a/_includes/icons/github.svg +++ b/_includes/icons/github.svg @@ -1 +1 @@ -GitHub +GitHub diff --git a/_includes/icons/menu.svg b/_includes/icons/menu.svg index 883713c19b..03e15dc492 100644 --- a/_includes/icons/menu.svg +++ b/_includes/icons/menu.svg @@ -1 +1 @@ - +Menu diff --git a/_includes/icons/slack.svg b/_includes/icons/slack.svg index 1631260f7a..3927fa458b 100644 --- a/_includes/icons/slack.svg +++ b/_includes/icons/slack.svg @@ -1 +1 @@ -Slack +Slack diff --git a/_includes/icons/twitter.svg b/_includes/icons/twitter.svg index 0265e9767c..450c393b92 100644 --- a/_includes/icons/twitter.svg +++ b/_includes/icons/twitter.svg @@ -1 +1 @@ -Twitter +Twitter From ce98a1da5bd8f50153c9924c34fd465f87814117 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 17 Jun 2017 10:13:43 -0700 Subject: [PATCH 02/10] build --- dist/js/bootstrap.js | 267 +++++++++++++++++++-------------------- dist/js/bootstrap.min.js | 2 +- js/dist/alert.js | 18 +-- js/dist/alert.js.map | 2 +- js/dist/button.js | 18 +-- js/dist/button.js.map | 2 +- js/dist/carousel.js | 18 +-- js/dist/carousel.js.map | 2 +- js/dist/collapse.js | 22 ++-- js/dist/collapse.js.map | 2 +- js/dist/dropdown.js | 25 ++-- js/dist/dropdown.js.map | 2 +- js/dist/modal.js | 38 +++--- js/dist/modal.js.map | 2 +- js/dist/popover.js | 18 +-- js/dist/popover.js.map | 2 +- js/dist/scrollspy.js | 22 ++-- js/dist/scrollspy.js.map | 2 +- js/dist/tab.js | 18 +-- js/dist/tab.js.map | 2 +- js/dist/tooltip.js | 22 ++-- js/dist/tooltip.js.map | 2 +- js/dist/util.js | 8 +- js/dist/util.js.map | 2 +- 24 files changed, 258 insertions(+), 260 deletions(-) diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 8056641fb2..dae6c65d9f 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -50,10 +50,9 @@ var Util = function ($) { MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', transition: 'transitionend' - }; - // shoutout AngusCroll (https://goo.gl/pxwQGp) - function toType(obj) { + // shoutout AngusCroll (https://goo.gl/pxwQGp) + };function toType(obj) { return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); } @@ -67,7 +66,8 @@ var Util = function ($) { delegateType: transition.end, handle: function handle(event) { if ($(event.target).is(this)) { - return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params + return event.handleObj.handler.apply(this, arguments // eslint-disable-line prefer-rest-params + ); } return undefined; } @@ -177,7 +177,7 @@ var Util = function ($) { setTransitionEndSupport(); return Util; -}(jQuery); +}(jQuery /** * -------------------------------------------------------------------------- @@ -186,7 +186,7 @@ var Util = function ($) { * -------------------------------------------------------------------------- */ -var Alert = function ($) { +);var Alert = function ($) { /** * ------------------------------------------------------------------------ @@ -216,14 +216,14 @@ var Alert = function ($) { ALERT: 'alert', FADE: 'fade', SHOW: 'show' + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - var Alert = function () { function Alert(element) { _classCallCheck(this, Alert); @@ -340,7 +340,7 @@ var Alert = function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); + $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()) /** * ------------------------------------------------------------------------ @@ -348,7 +348,7 @@ var Alert = function ($) { * ------------------------------------------------------------------------ */ - $.fn[NAME] = Alert._jQueryInterface; + );$.fn[NAME] = Alert._jQueryInterface; $.fn[NAME].Constructor = Alert; $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT; @@ -356,7 +356,7 @@ var Alert = function ($) { }; return Alert; -}(jQuery); +}(jQuery /** * -------------------------------------------------------------------------- @@ -365,7 +365,7 @@ var Alert = function ($) { * -------------------------------------------------------------------------- */ -var Button = function ($) { +);var Button = function ($) { /** * ------------------------------------------------------------------------ @@ -397,14 +397,14 @@ var Button = function ($) { var Event = { CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY) + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - var Button = function () { function Button(element) { _classCallCheck(this, Button); @@ -510,7 +510,7 @@ var Button = function ($) { }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { var button = $(event.target).closest(Selector.BUTTON)[0]; $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); - }); + } /** * ------------------------------------------------------------------------ @@ -518,7 +518,7 @@ var Button = function ($) { * ------------------------------------------------------------------------ */ - $.fn[NAME] = Button._jQueryInterface; + );$.fn[NAME] = Button._jQueryInterface; $.fn[NAME].Constructor = Button; $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT; @@ -526,7 +526,7 @@ var Button = function ($) { }; return Button; -}(jQuery); +}(jQuery /** * -------------------------------------------------------------------------- @@ -535,7 +535,7 @@ var Button = function ($) { * -------------------------------------------------------------------------- */ -var Carousel = function ($) { +);var Carousel = function ($) { /** * ------------------------------------------------------------------------ @@ -607,14 +607,14 @@ var Carousel = function ($) { INDICATORS: '.carousel-indicators', DATA_SLIDE: '[data-slide], [data-slide-to]', DATA_RIDE: '[data-ride="carousel"]' + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - var Carousel = function () { function Carousel(element, config) { _classCallCheck(this, Carousel); @@ -1017,7 +1017,7 @@ var Carousel = function ($) { var $carousel = $(this); Carousel._jQueryInterface.call($carousel, $carousel.data()); }); - }); + } /** * ------------------------------------------------------------------------ @@ -1025,7 +1025,7 @@ var Carousel = function ($) { * ------------------------------------------------------------------------ */ - $.fn[NAME] = Carousel._jQueryInterface; + );$.fn[NAME] = Carousel._jQueryInterface; $.fn[NAME].Constructor = Carousel; $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT; @@ -1033,7 +1033,7 @@ var Carousel = function ($) { }; return Carousel; -}(jQuery); +}(jQuery /** * -------------------------------------------------------------------------- @@ -1042,7 +1042,7 @@ var Carousel = function ($) { * -------------------------------------------------------------------------- */ -var Collapse = function ($) { +);var Collapse = function ($) { /** * ------------------------------------------------------------------------ @@ -1091,14 +1091,14 @@ var Collapse = function ($) { var Selector = { ACTIVES: '.show, .collapsing', DATA_TOGGLE: '[data-toggle="collapse"]' + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - var Collapse = function () { function Collapse(element, config) { _classCallCheck(this, Collapse); @@ -1280,8 +1280,8 @@ var Collapse = function ($) { Collapse.prototype._getConfig = function _getConfig(config) { config = $.extend({}, Default, config); - config.toggle = Boolean(config.toggle); // coerce string values - Util.typeCheckConfig(NAME, config, DefaultType); + config.toggle = Boolean(config.toggle // coerce string values + );Util.typeCheckConfig(NAME, config, DefaultType); return config; }; @@ -1378,7 +1378,7 @@ var Collapse = function ($) { var config = data ? 'toggle' : $trigger.data(); Collapse._jQueryInterface.call($target, config); }); - }); + } /** * ------------------------------------------------------------------------ @@ -1386,7 +1386,7 @@ var Collapse = function ($) { * ------------------------------------------------------------------------ */ - $.fn[NAME] = Collapse._jQueryInterface; + );$.fn[NAME] = Collapse._jQueryInterface; $.fn[NAME].Constructor = Collapse; $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT; @@ -1394,7 +1394,7 @@ var Collapse = function ($) { }; return Collapse; -}(jQuery); +}(jQuery /* global Popper */ @@ -1405,7 +1405,7 @@ var Collapse = function ($) { * -------------------------------------------------------------------------- */ -var Dropdown = function ($) { +);var Dropdown = function ($) { /** * Check for Popper dependency @@ -1479,14 +1479,14 @@ var Dropdown = function ($) { placement: 'string', offset: '(number|string)', flip: 'boolean' + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - var Dropdown = function () { function Dropdown(element, config) { _classCallCheck(this, Dropdown); @@ -1622,11 +1622,10 @@ var Dropdown = function ($) { if ($(this._menu).hasClass(ClassName.MENURIGHT)) { placement = AttachmentMap.TOPEND; } - } else { - if ($(this._menu).hasClass(ClassName.MENURIGHT)) { - placement = AttachmentMap.BOTTOMEND; - } + } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.BOTTOMEND; } + return placement; }; @@ -1790,7 +1789,7 @@ var Dropdown = function ($) { Dropdown._jQueryInterface.call($(this), 'toggle'); }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { e.stopPropagation(); - }); + } /** * ------------------------------------------------------------------------ @@ -1798,7 +1797,7 @@ var Dropdown = function ($) { * ------------------------------------------------------------------------ */ - $.fn[NAME] = Dropdown._jQueryInterface; + );$.fn[NAME] = Dropdown._jQueryInterface; $.fn[NAME].Constructor = Dropdown; $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT; @@ -1806,7 +1805,7 @@ var Dropdown = function ($) { }; return Dropdown; -}(jQuery); +}(jQuery /** * -------------------------------------------------------------------------- @@ -1815,7 +1814,7 @@ var Dropdown = function ($) { * -------------------------------------------------------------------------- */ -var Modal = function ($) { +);var Modal = function ($) { /** * ------------------------------------------------------------------------ @@ -1875,14 +1874,14 @@ var Modal = function ($) { DATA_DISMISS: '[data-dismiss="modal"]', FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', NAVBAR_TOGGLER: '.navbar-toggler' + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - var Modal = function () { function Modal(element, config) { _classCallCheck(this, Modal); @@ -2074,8 +2073,8 @@ var Modal = function ($) { Modal.prototype._enforceFocus = function _enforceFocus() { var _this13 = this; - $(document).off(Event.FOCUSIN) // guard against infinite focus loop - .on(Event.FOCUSIN, function (event) { + $(document).off(Event.FOCUSIN // guard against infinite focus loop + ).on(Event.FOCUSIN, function (event) { if (document !== event.target && _this13._element !== event.target && !$(_this13._element).has(event.target).length) { _this13._element.focus(); } @@ -2237,17 +2236,17 @@ var Modal = function ($) { var actualPadding = $(element)[0].style.paddingRight; var calculatedPadding = $(element).css('padding-right'); $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this18._scrollbarWidth + 'px'); - }); + } // Adjust navbar-toggler margin - $(Selector.NAVBAR_TOGGLER).each(function (index, element) { + );$(Selector.NAVBAR_TOGGLER).each(function (index, element) { var actualMargin = $(element)[0].style.marginRight; var calculatedMargin = $(element).css('margin-right'); $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this18._scrollbarWidth + 'px'); - }); + } // Adjust body padding - var actualPadding = document.body.style.paddingRight; + );var actualPadding = document.body.style.paddingRight; var calculatedPadding = $('body').css('padding-right'); $('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + 'px'); } @@ -2260,18 +2259,18 @@ var Modal = function ($) { if (typeof padding !== 'undefined') { $(element).css('padding-right', padding).removeData('padding-right'); } - }); + } // Restore navbar-toggler margin - $(Selector.NAVBAR_TOGGLER).each(function (index, element) { + );$(Selector.NAVBAR_TOGGLER).each(function (index, element) { var margin = $(element).data('margin-right'); if (typeof margin !== 'undefined') { $(element).css('margin-right', margin).removeData('margin-right'); } - }); + } // Restore body padding - var padding = $('body').data('padding-right'); + );var padding = $('body').data('padding-right'); if (typeof padding !== 'undefined') { $('body').css('padding-right', padding).removeData('padding-right'); } @@ -2361,7 +2360,7 @@ var Modal = function ($) { }); Modal._jQueryInterface.call($(target), config, this); - }); + } /** * ------------------------------------------------------------------------ @@ -2369,7 +2368,7 @@ var Modal = function ($) { * ------------------------------------------------------------------------ */ - $.fn[NAME] = Modal._jQueryInterface; + );$.fn[NAME] = Modal._jQueryInterface; $.fn[NAME].Constructor = Modal; $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT; @@ -2377,7 +2376,7 @@ var Modal = function ($) { }; return Modal; -}(jQuery); +}(jQuery /** * -------------------------------------------------------------------------- @@ -2386,7 +2385,7 @@ var Modal = function ($) { * -------------------------------------------------------------------------- */ -var ScrollSpy = function ($) { +);var ScrollSpy = function ($) { /** * ------------------------------------------------------------------------ @@ -2439,14 +2438,14 @@ var ScrollSpy = function ($) { var OffsetMethod = { OFFSET: 'offset', POSITION: 'position' + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; - - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - var ScrollSpy = function () { function ScrollSpy(element, config) { var _this20 = this; @@ -2611,10 +2610,10 @@ var ScrollSpy = function ($) { $link.addClass(ClassName.ACTIVE); } else { // Set triggered link as active - $link.addClass(ClassName.ACTIVE); + $link.addClass(ClassName.ACTIVE // Set triggered links parents as active // With both
    and