diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2018-01-19 02:02:42 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2018-01-19 02:02:42 +0300 |
commit | bbb8b796ca6225ce90e53665edb4f370535c45a8 (patch) | |
tree | c72b65dc83c43851ea10e158dde77e289d33f73e /assets/javascripts/bootstrap | |
parent | 176cbf4fbf07e29783b0726f8426da0a7ebe5ead (diff) |
rake update[v4.0.0]
Diffstat (limited to 'assets/javascripts/bootstrap')
-rw-r--r-- | assets/javascripts/bootstrap/alert.js | 12 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/button.js | 10 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/carousel.js | 19 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/collapse.js | 34 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/dropdown.js | 33 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/modal.js | 22 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/popover.js | 16 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/scrollspy.js | 18 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/tab.js | 14 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/tooltip.js | 26 | ||||
-rw-r--r-- | assets/javascripts/bootstrap/util.js | 12 |
11 files changed, 109 insertions, 107 deletions
diff --git a/assets/javascripts/bootstrap/alert.js b/assets/javascripts/bootstrap/alert.js index 3e8cc35..3de9f13 100644 --- a/assets/javascripts/bootstrap/alert.js +++ b/assets/javascripts/bootstrap/alert.js @@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): alert.js + * Bootstrap (v4.0.0): alert.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -15,7 +15,7 @@ var Alert = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'alert'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.alert'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -46,12 +46,12 @@ var Alert = function ($) { function () { function Alert(element) { this._element = element; - } // getters + } // Getters var _proto = Alert.prototype; - // public + // Public _proto.close = function close(element) { element = element || this._element; @@ -69,7 +69,7 @@ var Alert = function ($) { _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY); this._element = null; - }; // private + }; // Private _proto._getRootElement = function _getRootElement(element) { @@ -111,7 +111,7 @@ var Alert = function ($) { _proto._destroyElement = function _destroyElement(element) { $(element).detach().trigger(Event.CLOSED).remove(); - }; // static + }; // Static Alert._jQueryInterface = function _jQueryInterface(config) { diff --git a/assets/javascripts/bootstrap/button.js b/assets/javascripts/bootstrap/button.js index 34dda7a..7d23bbe 100644 --- a/assets/javascripts/bootstrap/button.js +++ b/assets/javascripts/bootstrap/button.js @@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): button.js + * Bootstrap (v4.0.0): button.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -15,7 +15,7 @@ var Button = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'button'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.button'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -48,12 +48,12 @@ var Button = function ($) { function () { function Button(element) { this._element = element; - } // getters + } // Getters var _proto = Button.prototype; - // public + // Public _proto.toggle = function toggle() { var triggerChangeEvent = true; var addAriaPressed = true; @@ -101,7 +101,7 @@ var Button = function ($) { _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY); this._element = null; - }; // static + }; // Static Button._jQueryInterface = function _jQueryInterface(config) { diff --git a/assets/javascripts/bootstrap/carousel.js b/assets/javascripts/bootstrap/carousel.js index b90add3..f5dd28c 100644 --- a/assets/javascripts/bootstrap/carousel.js +++ b/assets/javascripts/bootstrap/carousel.js @@ -6,7 +6,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): carousel.js + * Bootstrap (v4.0.0): carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ var Carousel = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'carousel'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.carousel'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -100,12 +100,12 @@ var Carousel = function ($) { this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]; this._addEventListeners(); - } // getters + } // Getters var _proto = Carousel.prototype; - // public + // Public _proto.next = function next() { if (!this._isSliding) { this._slide(Direction.NEXT); @@ -195,7 +195,7 @@ var Carousel = function ($) { this._isSliding = null; this._activeElement = null; this._indicatorsElement = null; - }; // private + }; // Private _proto._getConfig = function _getConfig(config) { @@ -221,7 +221,7 @@ var Carousel = function ($) { }); if ('ontouchstart' in document.documentElement) { - // if it's a touch-enabled device, mouseenter/leave are fired as + // If it's a touch-enabled device, mouseenter/leave are fired as // part of the mouse compatibility events on first tap - the carousel // would stop cycling until user tapped out of it; // here, we listen for touchend, explicitly pause the carousel @@ -260,7 +260,6 @@ var Carousel = function ($) { break; default: - return; } }; @@ -352,7 +351,7 @@ var Carousel = function ($) { } if (!activeElement || !nextElement) { - // some weirdness is happening, so we bail + // Some weirdness is happening, so we bail return; } @@ -394,7 +393,7 @@ var Carousel = function ($) { if (isCycling) { this.cycle(); } - }; // static + }; // Static Carousel._jQueryInterface = function _jQueryInterface(config) { @@ -418,7 +417,7 @@ var Carousel = function ($) { data.to(config); } else if (typeof action === 'string') { if (typeof data[action] === 'undefined') { - throw new Error("No method named \"" + action + "\""); + throw new TypeError("No method named \"" + action + "\""); } data[action](); diff --git a/assets/javascripts/bootstrap/collapse.js b/assets/javascripts/bootstrap/collapse.js index 3291dfa..39f4b88 100644 --- a/assets/javascripts/bootstrap/collapse.js +++ b/assets/javascripts/bootstrap/collapse.js @@ -6,7 +6,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): collapse.js + * Bootstrap (v4.0.0): collapse.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ var Collapse = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'collapse'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.collapse'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -74,6 +74,8 @@ var Collapse = function ($) { var selector = Util.getSelectorFromElement(elem); if (selector !== null && $(selector).filter(element).length > 0) { + this._selector = selector; + this._triggerArray.push(elem); } } @@ -87,12 +89,12 @@ var Collapse = function ($) { if (this._config.toggle) { this.toggle(); } - } // getters + } // Getters var _proto = Collapse.prototype; - // public + // Public _proto.toggle = function toggle() { if ($(this._element).hasClass(ClassName.SHOW)) { this.hide(); @@ -112,15 +114,15 @@ var Collapse = function ($) { var activesData; if (this._parent) { - actives = $.makeArray($(this._parent).children().children(Selector.ACTIVES)); + actives = $.makeArray($(this._parent).find(Selector.ACTIVES).filter("[data-parent=\"" + this._config.parent + "\"]")); - if (!actives.length) { + if (actives.length === 0) { actives = null; } } if (actives) { - activesData = $(actives).data(DATA_KEY); + activesData = $(actives).not(this._selector).data(DATA_KEY); if (activesData && activesData._isTransitioning) { return; @@ -135,7 +137,7 @@ var Collapse = function ($) { } if (actives) { - Collapse._jQueryInterface.call($(actives), 'hide'); + Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide'); if (!activesData) { $(actives).data(DATA_KEY, null); @@ -147,7 +149,7 @@ var Collapse = function ($) { $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); this._element.style[dimension] = 0; - if (this._triggerArray.length) { + if (this._triggerArray.length > 0) { $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); } @@ -193,7 +195,7 @@ var Collapse = function ($) { Util.reflow(this._element); $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW); - if (this._triggerArray.length) { + if (this._triggerArray.length > 0) { for (var i = 0; i < this._triggerArray.length; i++) { var trigger = this._triggerArray[i]; var selector = Util.getSelectorFromElement(trigger); @@ -237,12 +239,12 @@ var Collapse = function ($) { this._element = null; this._triggerArray = null; this._isTransitioning = null; - }; // private + }; // Private _proto._getConfig = function _getConfig(config) { config = _extends({}, Default, config); - config.toggle = Boolean(config.toggle); // coerce string values + config.toggle = Boolean(config.toggle); // Coerce string values Util.typeCheckConfig(NAME, config, DefaultType); return config; @@ -259,7 +261,7 @@ var Collapse = function ($) { var parent = null; if (Util.isElement(this._config.parent)) { - parent = this._config.parent; // it's a jQuery object + parent = this._config.parent; // It's a jQuery object if (typeof this._config.parent.jquery !== 'undefined') { parent = this._config.parent[0]; @@ -279,11 +281,11 @@ var Collapse = function ($) { if (element) { var isOpen = $(element).hasClass(ClassName.SHOW); - if (triggerArray.length) { + if (triggerArray.length > 0) { $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); } } - }; // static + }; // Static Collapse._getTargetFromElement = function _getTargetFromElement(element) { @@ -309,7 +311,7 @@ var Collapse = function ($) { if (typeof config === 'string') { if (typeof data[config] === 'undefined') { - throw new Error("No method named \"" + config + "\""); + throw new TypeError("No method named \"" + config + "\""); } data[config](); diff --git a/assets/javascripts/bootstrap/dropdown.js b/assets/javascripts/bootstrap/dropdown.js index 5250119..a4f73fe 100644 --- a/assets/javascripts/bootstrap/dropdown.js +++ b/assets/javascripts/bootstrap/dropdown.js @@ -6,7 +6,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): dropdown.js + * Bootstrap (v4.0.0): dropdown.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ var Dropdown = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'dropdown'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.dropdown'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -100,12 +100,12 @@ var Dropdown = function ($) { this._inNavbar = this._detectNavbar(); this._addEventListeners(); - } // getters + } // Getters var _proto = Dropdown.prototype; - // public + // Public _proto.toggle = function toggle() { if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) { return; @@ -138,10 +138,10 @@ var Dropdown = function ($) { * Popper - https://popper.js.org */ if (typeof Popper === 'undefined') { - throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)'); + throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)'); } - var element = this._element; // for dropup with alignment we use the parent as popper container + var element = this._element; // For dropup with alignment we use the parent as popper container if ($(parent).hasClass(ClassName.DROPUP)) { if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) { @@ -157,13 +157,13 @@ var Dropdown = function ($) { } this._popper = new Popper(element, this._menu, this._getPopperConfig()); - } // if this is a touch-enabled device we add extra + } // If this is a touch-enabled device we add extra // empty mouseover listeners to the body's immediate children; // only needed because of broken event delegation on iOS // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { + if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) { $('body').children().on('mouseover', null, $.noop); } @@ -194,7 +194,7 @@ var Dropdown = function ($) { if (this._popper !== null) { this._popper.scheduleUpdate(); } - }; // private + }; // Private _proto._addEventListeners = function _addEventListeners() { @@ -276,7 +276,7 @@ var Dropdown = function ($) { } }; return popperConfig; - }; // static + }; // Static Dropdown._jQueryInterface = function _jQueryInterface(config) { @@ -292,7 +292,7 @@ var Dropdown = function ($) { if (typeof config === 'string') { if (typeof data[config] === 'undefined') { - throw new Error("No method named \"" + config + "\""); + throw new TypeError("No method named \"" + config + "\""); } data[config](); @@ -334,7 +334,7 @@ var Dropdown = function ($) { if (hideEvent.isDefaultPrevented()) { continue; - } // if this is a touch-enabled device we remove the extra + } // If this is a touch-enabled device we remove the extra // empty mouseover listeners we added for iOS support @@ -357,7 +357,8 @@ var Dropdown = function ($) { } return parent || element.parentNode; - }; + }; // eslint-disable-next-line complexity + Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { // If not input/textarea: @@ -394,19 +395,19 @@ var Dropdown = function ($) { var items = $(parent).find(Selector.VISIBLE_ITEMS).get(); - if (!items.length) { + if (items.length === 0) { return; } var index = items.indexOf(event.target); if (event.which === ARROW_UP_KEYCODE && index > 0) { - // up + // Up index--; } if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { - // down + // Down index++; } diff --git a/assets/javascripts/bootstrap/modal.js b/assets/javascripts/bootstrap/modal.js index 525ea85..8e3c886 100644 --- a/assets/javascripts/bootstrap/modal.js +++ b/assets/javascripts/bootstrap/modal.js @@ -6,7 +6,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): modal.js + * Bootstrap (v4.0.0): modal.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ var Modal = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'modal'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.modal'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -86,12 +86,12 @@ var Modal = function ($) { this._ignoreBackdropClick = false; this._originalBodyPadding = 0; this._scrollbarWidth = 0; - } // getters + } // Getters var _proto = Modal.prototype; - // public + // Public _proto.toggle = function toggle(relatedTarget) { return this._isShown ? this.hide() : this.show(relatedTarget); }; @@ -204,7 +204,7 @@ var Modal = function ($) { _proto.handleUpdate = function handleUpdate() { this._adjustDialog(); - }; // private + }; // Private _proto._getConfig = function _getConfig(config) { @@ -219,7 +219,7 @@ var Modal = function ($) { var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { - // don't move modals dom position + // Don't move modal's DOM position document.body.appendChild(this._element); } @@ -262,9 +262,9 @@ var Modal = function ($) { _proto._enforceFocus = function _enforceFocus() { var _this4 = this; - $(document).off(Event.FOCUSIN) // guard against infinite focus loop + $(document).off(Event.FOCUSIN) // Guard against infinite focus loop .on(Event.FOCUSIN, function (event) { - if (document !== event.target && _this4._element !== event.target && !$(_this4._element).has(event.target).length) { + if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) { _this4._element.focus(); } }); @@ -485,7 +485,7 @@ var Modal = function ($) { var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarWidth; - }; // static + }; // Static Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { @@ -501,7 +501,7 @@ var Modal = function ($) { if (typeof config === 'string') { if (typeof data[config] === 'undefined') { - throw new Error("No method named \"" + config + "\""); + throw new TypeError("No method named \"" + config + "\""); } data[config](relatedTarget); @@ -550,7 +550,7 @@ var Modal = function ($) { var $target = $(target).one(Event.SHOW, function (showEvent) { if (showEvent.isDefaultPrevented()) { - // only register focus restorer if modal will actually get shown + // Only register focus restorer if modal will actually get shown return; } diff --git a/assets/javascripts/bootstrap/popover.js b/assets/javascripts/bootstrap/popover.js index f733a1e..ee53fcd 100644 --- a/assets/javascripts/bootstrap/popover.js +++ b/assets/javascripts/bootstrap/popover.js @@ -8,7 +8,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): popover.js + * Bootstrap (v4.0.0): popover.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -19,7 +19,7 @@ var Popover = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'popover'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.popover'; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; @@ -75,7 +75,7 @@ var Popover = function ($) { var _proto = Popover.prototype; - // overrides + // Overrides _proto.isWithContent = function isWithContent() { return this.getTitle() || this._getContent(); }; @@ -90,7 +90,7 @@ var Popover = function ($) { }; _proto.setContent = function setContent() { - var $tip = $(this.getTipElement()); // we use append for html objects to maintain js events + var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); @@ -102,7 +102,7 @@ var Popover = function ($) { this.setElementContent($tip.find(Selector.CONTENT), content); $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW); - }; // private + }; // Private _proto._getContent = function _getContent() { @@ -116,7 +116,7 @@ var Popover = function ($) { if (tabClass !== null && tabClass.length > 0) { $tip.removeClass(tabClass.join('')); } - }; // static + }; // Static Popover._jQueryInterface = function _jQueryInterface(config) { @@ -136,7 +136,7 @@ var Popover = function ($) { if (typeof config === 'string') { if (typeof data[config] === 'undefined') { - throw new Error("No method named \"" + config + "\""); + throw new TypeError("No method named \"" + config + "\""); } data[config](); @@ -146,7 +146,7 @@ var Popover = function ($) { _createClass(Popover, null, [{ key: "VERSION", - // getters + // Getters get: function get() { return VERSION; } diff --git a/assets/javascripts/bootstrap/scrollspy.js b/assets/javascripts/bootstrap/scrollspy.js index 99f7a41..616bb03 100644 --- a/assets/javascripts/bootstrap/scrollspy.js +++ b/assets/javascripts/bootstrap/scrollspy.js @@ -6,7 +6,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): scrollspy.js + * Bootstrap (v4.0.0): scrollspy.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ var ScrollSpy = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'scrollspy'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.scrollspy'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -84,16 +84,16 @@ var ScrollSpy = function ($) { this.refresh(); this._process(); - } // getters + } // Getters var _proto = ScrollSpy.prototype; - // public + // Public _proto.refresh = function refresh() { var _this2 = this; - var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; + var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; this._offsets = []; @@ -112,7 +112,7 @@ var ScrollSpy = function ($) { var targetBCR = target.getBoundingClientRect(); if (targetBCR.width || targetBCR.height) { - // todo (fat): remove sketch reliance on jQuery position/offset + // TODO (fat): remove sketch reliance on jQuery position/offset return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; } } @@ -140,7 +140,7 @@ var ScrollSpy = function ($) { this._targets = null; this._activeTarget = null; this._scrollHeight = null; - }; // private + }; // Private _proto._getConfig = function _getConfig(config) { @@ -244,7 +244,7 @@ var ScrollSpy = function ($) { _proto._clear = function _clear() { $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE); - }; // static + }; // Static ScrollSpy._jQueryInterface = function _jQueryInterface(config) { @@ -260,7 +260,7 @@ var ScrollSpy = function ($) { if (typeof config === 'string') { if (typeof data[config] === 'undefined') { - throw new Error("No method named \"" + config + "\""); + throw new TypeError("No method named \"" + config + "\""); } data[config](); diff --git a/assets/javascripts/bootstrap/tab.js b/assets/javascripts/bootstrap/tab.js index a135130..b8aa5a8 100644 --- a/assets/javascripts/bootstrap/tab.js +++ b/assets/javascripts/bootstrap/tab.js @@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): tab.js + * Bootstrap (v4.0.0): tab.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -15,7 +15,7 @@ var Tab = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'tab'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.tab'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -56,12 +56,12 @@ var Tab = function ($) { function () { function Tab(element) { this._element = element; - } // getters + } // Getters var _proto = Tab.prototype; - // public + // Public _proto.show = function show() { var _this = this; @@ -124,7 +124,7 @@ var Tab = function ($) { _proto.dispose = function dispose() { $.removeData(this._element, DATA_KEY); this._element = null; - }; // private + }; // Private _proto._activate = function _activate(element, container, callback) { @@ -188,7 +188,7 @@ var Tab = function ($) { if (callback) { callback(); } - }; // static + }; // Static Tab._jQueryInterface = function _jQueryInterface(config) { @@ -203,7 +203,7 @@ var Tab = function ($) { if (typeof config === 'string') { if (typeof data[config] === 'undefined') { - throw new Error("No method named \"" + config + "\""); + throw new TypeError("No method named \"" + config + "\""); } data[config](); diff --git a/assets/javascripts/bootstrap/tooltip.js b/assets/javascripts/bootstrap/tooltip.js index 162ea92..edb2c96 100644 --- a/assets/javascripts/bootstrap/tooltip.js +++ b/assets/javascripts/bootstrap/tooltip.js @@ -6,7 +6,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): tooltip.js + * Bootstrap (v4.0.0): tooltip.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ var Tooltip = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'tooltip'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.tooltip'; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; @@ -106,7 +106,7 @@ var Tooltip = function ($) { * Popper - https://popper.js.org */ if (typeof Popper === 'undefined') { - throw new Error('Bootstrap tooltips require Popper.js (https://popper.js.org)'); + throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)'); } // private @@ -114,19 +114,19 @@ var Tooltip = function ($) { this._timeout = 0; this._hoverState = ''; this._activeTrigger = {}; - this._popper = null; // protected + this._popper = null; // Protected this.element = element; this.config = this._getConfig(config); this.tip = null; this._setListeners(); - } // getters + } // Getters var _proto = Tooltip.prototype; - // public + // Public _proto.enable = function enable() { this._isEnabled = true; }; @@ -261,7 +261,7 @@ var Tooltip = function ($) { _this._handlePopperPlacementChange(data); } }); - $(tip).addClass(ClassName.SHOW); // if this is a touch-enabled device we add extra + $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra // empty mouseover listeners to the body's immediate children; // only needed because of broken event delegation on iOS // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html @@ -324,7 +324,7 @@ var Tooltip = function ($) { return; } - $(tip).removeClass(ClassName.SHOW); // if this is a touch-enabled device we remove the extra + $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra // empty mouseover listeners we added for iOS support if ('ontouchstart' in document.documentElement) { @@ -348,7 +348,7 @@ var Tooltip = function ($) { if (this._popper !== null) { this._popper.scheduleUpdate(); } - }; // protected + }; // Protected _proto.isWithContent = function isWithContent() { @@ -374,7 +374,7 @@ var Tooltip = function ($) { var html = this.config.html; if (typeof content === 'object' && (content.nodeType || content.jquery)) { - // content is a DOM node or a jQuery + // Content is a DOM node or a jQuery if (html) { if (!$(content).parent().is($element)) { $element.empty().append(content); @@ -395,7 +395,7 @@ var Tooltip = function ($) { } return title; - }; // private + }; // Private _proto._getAttachment = function _getAttachment(placement) { @@ -584,7 +584,7 @@ var Tooltip = function ($) { this.hide(); this.show(); this.config.animation = initConfigAnimation; - }; // static + }; // Static Tooltip._jQueryInterface = function _jQueryInterface(config) { @@ -604,7 +604,7 @@ var Tooltip = function ($) { if (typeof config === 'string') { if (typeof data[config] === 'undefined') { - throw new Error("No method named \"" + config + "\""); + throw new TypeError("No method named \"" + config + "\""); } data[config](); diff --git a/assets/javascripts/bootstrap/util.js b/assets/javascripts/bootstrap/util.js index f51988e..1e33eb8 100644 --- a/assets/javascripts/bootstrap/util.js +++ b/assets/javascripts/bootstrap/util.js @@ -1,6 +1,6 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): util.js + * Bootstrap (v4.0.0): util.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -11,7 +11,7 @@ var Util = function ($) { * ------------------------------------------------------------------------ */ var transition = false; - var MAX_UID = 1000000; // shoutout AngusCroll (https://goo.gl/pxwQGp) + var MAX_UID = 1000000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) function toType(obj) { return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); @@ -32,7 +32,7 @@ var Util = function ($) { } function transitionEndTest() { - if (window.QUnit) { + if (typeof window !== 'undefined' && window.QUnit) { return false; } @@ -66,7 +66,7 @@ var Util = function ($) { } function escapeId(selector) { - // we escape IDs in case of special selectors (selector = '#myId:something') + // We escape IDs in case of special selectors (selector = '#myId:something') // $.escapeSelector does not exist in jQuery < 3 selector = typeof $.escapeSelector === 'function' ? $.escapeSelector(selector).substr(1) : selector.replace(/(:|\.|\[|\]|,|=|@)/g, '\\$1'); return selector; @@ -93,7 +93,7 @@ var Util = function ($) { if (!selector || selector === '#') { selector = element.getAttribute('href') || ''; - } // if it's an ID + } // If it's an ID if (selector.charAt(0) === '#') { @@ -103,7 +103,7 @@ var Util = function ($) { try { var $selector = $(document).find(selector); return $selector.length > 0 ? selector : null; - } catch (error) { + } catch (err) { return null; } }, |