diff options
Diffstat (limited to 'themes/docsy/assets/vendor/bootstrap/js')
62 files changed, 16633 insertions, 0 deletions
diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/alert.js b/themes/docsy/assets/vendor/bootstrap/js/dist/alert.js new file mode 100644 index 0000000..a7d1721 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/alert.js @@ -0,0 +1,204 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : + typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : + (global.Alert = factory(global.jQuery,global.Util)); +}(this, (function ($,Util) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): alert.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Alert = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'alert'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.alert'; + var EVENT_KEY = "." + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var Selector = { + DISMISS: '[data-dismiss="alert"]' + }; + var Event = { + CLOSE: "close" + EVENT_KEY, + CLOSED: "closed" + EVENT_KEY, + CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY + }; + var ClassName = { + ALERT: 'alert', + FADE: 'fade', + SHOW: 'show' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var Alert = + /*#__PURE__*/ + function () { + function Alert(element) { + this._element = element; + } // Getters + + + var _proto = Alert.prototype; + + // Public + _proto.close = function close(element) { + var rootElement = this._element; + + if (element) { + rootElement = this._getRootElement(element); + } + + var customEvent = this._triggerCloseEvent(rootElement); + + if (customEvent.isDefaultPrevented()) { + return; + } + + this._removeElement(rootElement); + }; + + _proto.dispose = function dispose() { + $$$1.removeData(this._element, DATA_KEY); + this._element = null; + }; // Private + + + _proto._getRootElement = function _getRootElement(element) { + var selector = Util.getSelectorFromElement(element); + var parent = false; + + if (selector) { + parent = document.querySelector(selector); + } + + if (!parent) { + parent = $$$1(element).closest("." + ClassName.ALERT)[0]; + } + + return parent; + }; + + _proto._triggerCloseEvent = function _triggerCloseEvent(element) { + var closeEvent = $$$1.Event(Event.CLOSE); + $$$1(element).trigger(closeEvent); + return closeEvent; + }; + + _proto._removeElement = function _removeElement(element) { + var _this = this; + + $$$1(element).removeClass(ClassName.SHOW); + + if (!$$$1(element).hasClass(ClassName.FADE)) { + this._destroyElement(element); + + return; + } + + var transitionDuration = Util.getTransitionDurationFromElement(element); + $$$1(element).one(Util.TRANSITION_END, function (event) { + return _this._destroyElement(element, event); + }).emulateTransitionEnd(transitionDuration); + }; + + _proto._destroyElement = function _destroyElement(element) { + $$$1(element).detach().trigger(Event.CLOSED).remove(); + }; // Static + + + Alert._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var $element = $$$1(this); + var data = $element.data(DATA_KEY); + + if (!data) { + data = new Alert(this); + $element.data(DATA_KEY, data); + } + + if (config === 'close') { + data[config](this); + } + }); + }; + + Alert._handleDismiss = function _handleDismiss(alertInstance) { + return function (event) { + if (event) { + event.preventDefault(); + } + + alertInstance.close(this); + }; + }; + + _createClass(Alert, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }]); + + return Alert; + }(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + + $$$1(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $$$1.fn[NAME] = Alert._jQueryInterface; + $$$1.fn[NAME].Constructor = Alert; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Alert._jQueryInterface; + }; + + return Alert; + }($); + + return Alert; + +}))); +//# sourceMappingURL=alert.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/alert.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/alert.js.map new file mode 100644 index 0000000..6c4236b --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/alert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"alert.js","sources":["../src/alert.js"],"sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Alert = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'alert'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.alert'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Selector = {\n DISMISS : '[data-dismiss=\"alert\"]'\n }\n\n const Event = {\n CLOSE : `close${EVENT_KEY}`,\n CLOSED : `closed${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n ALERT : 'alert',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Alert {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n close(element) {\n let rootElement = this._element\n if (element) {\n rootElement = this._getRootElement(element)\n }\n\n const customEvent = this._triggerCloseEvent(rootElement)\n\n if (customEvent.isDefaultPrevented()) {\n return\n }\n\n this._removeElement(rootElement)\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Private\n\n _getRootElement(element) {\n const selector = Util.getSelectorFromElement(element)\n let parent = false\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n if (!parent) {\n parent = $(element).closest(`.${ClassName.ALERT}`)[0]\n }\n\n return parent\n }\n\n _triggerCloseEvent(element) {\n const closeEvent = $.Event(Event.CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(ClassName.SHOW)\n\n if (!$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element)\n return\n }\n\n const transitionDuration = Util.getTransitionDurationFromElement(element)\n\n $(element)\n .one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))\n .emulateTransitionEnd(transitionDuration)\n }\n\n _destroyElement(element) {\n $(element)\n .detach()\n .trigger(Event.CLOSED)\n .remove()\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Alert(this)\n $element.data(DATA_KEY, data)\n }\n\n if (config === 'close') {\n data[config](this)\n }\n })\n }\n\n static _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault()\n }\n\n alertInstance.close(this)\n }\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(\n Event.CLICK_DATA_API,\n Selector.DISMISS,\n Alert._handleDismiss(new Alert())\n )\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Alert._jQueryInterface\n $.fn[NAME].Constructor = Alert\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Alert._jQueryInterface\n }\n\n return Alert\n})($)\n\nexport default Alert\n"],"names":["Alert","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","Selector","DISMISS","Event","CLOSE","CLOSED","CLICK_DATA_API","ClassName","ALERT","FADE","SHOW","element","_element","close","rootElement","_getRootElement","customEvent","_triggerCloseEvent","isDefaultPrevented","_removeElement","dispose","removeData","selector","Util","getSelectorFromElement","parent","document","querySelector","closest","closeEvent","trigger","removeClass","hasClass","_destroyElement","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","event","emulateTransitionEnd","detach","remove","_jQueryInterface","config","each","$element","data","_handleDismiss","alertInstance","preventDefault","on","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAGA;;;;;;;EAOA,IAAMA,QAAS,UAACC,IAAD,EAAO;EACpB;;;;;EAMA,MAAMC,OAAsB,OAA5B;EACA,MAAMC,UAAsB,OAA5B;EACA,MAAMC,WAAsB,UAA5B;EACA,MAAMC,kBAA0BD,QAAhC;EACA,MAAME,eAAsB,WAA5B;EACA,MAAMC,qBAAsBN,KAAEO,EAAF,CAAKN,IAAL,CAA5B;EAEA,MAAMO,WAAW;EACfC,aAAU;EADK,GAAjB;EAIA,MAAMC,QAAQ;EACZC,qBAAyBP,SADb;EAEZQ,uBAA0BR,SAFd;EAGZS,8BAAyBT,SAAzB,GAAqCC;EAHzB,GAAd;EAMA,MAAMS,YAAY;EAChBC,WAAQ,OADQ;EAEhBC,UAAQ,MAFQ;EAGhBC,UAAQ;EAGV;;;;;;EANkB,GAAlB;;EAxBoB,MAoCdlB,KApCc;EAAA;EAAA;EAqClB,mBAAYmB,OAAZ,EAAqB;EACnB,WAAKC,QAAL,GAAgBD,OAAhB;EACD,KAvCiB;;;EAAA;;EA+ClB;EA/CkB,W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,CAAqB,IAAIvD,KAAJ,EAArB,CAHF;EAMA;;;;;;EAMAC,OAAEO,EAAF,CAAKN,IAAL,IAAyBF,MAAMkD,gBAA/B;EACAjD,OAAEO,EAAF,CAAKN,IAAL,EAAWyD,WAAX,GAAyB3D,KAAzB;;EACAC,OAAEO,EAAF,CAAKN,IAAL,EAAW0D,UAAX,GAAyB,YAAY;EACnC3D,SAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;EACA,WAAOP,MAAMkD,gBAAb;EACD,GAHD;;EAKA,SAAOlD,KAAP;EACD,CA1Ka,CA0KXC,CA1KW,CAAd;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/button.js b/themes/docsy/assets/vendor/bootstrap/js/dist/button.js new file mode 100644 index 0000000..73b97a7 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/button.js @@ -0,0 +1,192 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : + typeof define === 'function' && define.amd ? define(['jquery'], factory) : + (global.Button = factory(global.jQuery)); +}(this, (function ($) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): button.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Button = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'button'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.button'; + var EVENT_KEY = "." + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var ClassName = { + ACTIVE: 'active', + BUTTON: 'btn', + FOCUS: 'focus' + }; + var Selector = { + DATA_TOGGLE_CARROT: '[data-toggle^="button"]', + DATA_TOGGLE: '[data-toggle="buttons"]', + INPUT: 'input', + ACTIVE: '.active', + BUTTON: '.btn' + }; + 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 + * ------------------------------------------------------------------------ + */ + + }; + + var Button = + /*#__PURE__*/ + function () { + function Button(element) { + this._element = element; + } // Getters + + + var _proto = Button.prototype; + + // Public + _proto.toggle = function toggle() { + var triggerChangeEvent = true; + var addAriaPressed = true; + var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0]; + + if (rootElement) { + var input = this._element.querySelector(Selector.INPUT); + + if (input) { + if (input.type === 'radio') { + if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) { + triggerChangeEvent = false; + } else { + var activeElement = rootElement.querySelector(Selector.ACTIVE); + + if (activeElement) { + $$$1(activeElement).removeClass(ClassName.ACTIVE); + } + } + } + + if (triggerChangeEvent) { + if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { + return; + } + + input.checked = !this._element.classList.contains(ClassName.ACTIVE); + $$$1(input).trigger('change'); + } + + input.focus(); + addAriaPressed = false; + } + } + + if (addAriaPressed) { + this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE)); + } + + if (triggerChangeEvent) { + $$$1(this._element).toggleClass(ClassName.ACTIVE); + } + }; + + _proto.dispose = function dispose() { + $$$1.removeData(this._element, DATA_KEY); + this._element = null; + }; // Static + + + Button._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $$$1(this).data(DATA_KEY); + + if (!data) { + data = new Button(this); + $$$1(this).data(DATA_KEY, data); + } + + if (config === 'toggle') { + data[config](); + } + }); + }; + + _createClass(Button, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }]); + + return Button; + }(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + + $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { + event.preventDefault(); + var button = event.target; + + if (!$$$1(button).hasClass(ClassName.BUTTON)) { + button = $$$1(button).closest(Selector.BUTTON); + } + + Button._jQueryInterface.call($$$1(button), 'toggle'); + }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { + var button = $$$1(event.target).closest(Selector.BUTTON)[0]; + $$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); + }); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $$$1.fn[NAME] = Button._jQueryInterface; + $$$1.fn[NAME].Constructor = Button; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Button._jQueryInterface; + }; + + return Button; + }($); + + return Button; + +}))); +//# sourceMappingURL=button.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/button.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/button.js.map new file mode 100644 index 0000000..06ab3fd --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/button.js.map @@ -0,0 +1 @@ +{"version":3,"file":"button.js","sources":["../src/button.js"],"sourcesContent":["import $ from 'jquery'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Button = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'button'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.button'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const ClassName = {\n ACTIVE : 'active',\n BUTTON : 'btn',\n FOCUS : 'focus'\n }\n\n const Selector = {\n DATA_TOGGLE_CARROT : '[data-toggle^=\"button\"]',\n DATA_TOGGLE : '[data-toggle=\"buttons\"]',\n INPUT : 'input',\n ACTIVE : '.active',\n BUTTON : '.btn'\n }\n\n const Event = {\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} ` +\n `blur${EVENT_KEY}${DATA_API_KEY}`\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Button {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n const rootElement = $(this._element).closest(\n Selector.DATA_TOGGLE\n )[0]\n\n if (rootElement) {\n const input = this._element.querySelector(Selector.INPUT)\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked &&\n this._element.classList.contains(ClassName.ACTIVE)) {\n triggerChangeEvent = false\n } else {\n const activeElement = rootElement.querySelector(Selector.ACTIVE)\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE)\n }\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') ||\n rootElement.hasAttribute('disabled') ||\n input.classList.contains('disabled') ||\n rootElement.classList.contains('disabled')) {\n return\n }\n input.checked = !this._element.classList.contains(ClassName.ACTIVE)\n $(input).trigger('change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !this._element.classList.contains(ClassName.ACTIVE))\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName.ACTIVE)\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n event.preventDefault()\n\n let button = event.target\n\n if (!$(button).hasClass(ClassName.BUTTON)) {\n button = $(button).closest(Selector.BUTTON)\n }\n\n Button._jQueryInterface.call($(button), 'toggle')\n })\n .on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n const button = $(event.target).closest(Selector.BUTTON)[0]\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Button._jQueryInterface\n $.fn[NAME].Constructor = Button\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button._jQueryInterface\n }\n\n return Button\n})($)\n\nexport default Button\n"],"names":["Button","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ClassName","ACTIVE","BUTTON","FOCUS","Selector","DATA_TOGGLE_CARROT","DATA_TOGGLE","INPUT","Event","CLICK_DATA_API","FOCUS_BLUR_DATA_API","element","_element","toggle","triggerChangeEvent","addAriaPressed","rootElement","closest","input","querySelector","type","checked","classList","contains","activeElement","removeClass","hasAttribute","trigger","focus","setAttribute","toggleClass","dispose","removeData","_jQueryInterface","config","each","data","document","on","event","preventDefault","button","target","hasClass","call","test","Constructor","noConflict"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EACAC,OAAEO,EAAF,CAAKN,IAAL,EAAWsD,UAAX,GAAwB,YAAY;EAClCvD,SAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;EACA,WAAOP,OAAO0C,gBAAd;EACD,GAHD;;EAKA,SAAO1C,MAAP;EACD,CAnKc,CAmKZC,CAnKY,CAAf;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/carousel.js b/themes/docsy/assets/vendor/bootstrap/js/dist/carousel.js new file mode 100644 index 0000000..877d0b9 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/carousel.js @@ -0,0 +1,567 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : + typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : + (global.Carousel = factory(global.jQuery,global.Util)); +}(this, (function ($,Util) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } + + return target; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): carousel.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Carousel = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'carousel'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.carousel'; + var EVENT_KEY = "." + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key + + var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key + + var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch + + var Default = { + interval: 5000, + keyboard: true, + slide: false, + pause: 'hover', + wrap: true + }; + var DefaultType = { + interval: '(number|boolean)', + keyboard: 'boolean', + slide: '(boolean|string)', + pause: '(string|boolean)', + wrap: 'boolean' + }; + var Direction = { + NEXT: 'next', + PREV: 'prev', + LEFT: 'left', + RIGHT: 'right' + }; + var Event = { + SLIDE: "slide" + EVENT_KEY, + SLID: "slid" + EVENT_KEY, + KEYDOWN: "keydown" + EVENT_KEY, + MOUSEENTER: "mouseenter" + EVENT_KEY, + MOUSELEAVE: "mouseleave" + EVENT_KEY, + TOUCHEND: "touchend" + EVENT_KEY, + LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY, + CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY + }; + var ClassName = { + CAROUSEL: 'carousel', + ACTIVE: 'active', + SLIDE: 'slide', + RIGHT: 'carousel-item-right', + LEFT: 'carousel-item-left', + NEXT: 'carousel-item-next', + PREV: 'carousel-item-prev', + ITEM: 'carousel-item' + }; + var Selector = { + ACTIVE: '.active', + ACTIVE_ITEM: '.active.carousel-item', + ITEM: '.carousel-item', + NEXT_PREV: '.carousel-item-next, .carousel-item-prev', + INDICATORS: '.carousel-indicators', + DATA_SLIDE: '[data-slide], [data-slide-to]', + DATA_RIDE: '[data-ride="carousel"]' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var Carousel = + /*#__PURE__*/ + function () { + function Carousel(element, config) { + this._items = null; + this._interval = null; + this._activeElement = null; + this._isPaused = false; + this._isSliding = false; + this.touchTimeout = null; + this._config = this._getConfig(config); + this._element = $$$1(element)[0]; + this._indicatorsElement = this._element.querySelector(Selector.INDICATORS); + + this._addEventListeners(); + } // Getters + + + var _proto = Carousel.prototype; + + // Public + _proto.next = function next() { + if (!this._isSliding) { + this._slide(Direction.NEXT); + } + }; + + _proto.nextWhenVisible = function nextWhenVisible() { + // Don't call next when the page isn't visible + // or the carousel or its parent isn't visible + if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') { + this.next(); + } + }; + + _proto.prev = function prev() { + if (!this._isSliding) { + this._slide(Direction.PREV); + } + }; + + _proto.pause = function pause(event) { + if (!event) { + this._isPaused = true; + } + + if (this._element.querySelector(Selector.NEXT_PREV)) { + Util.triggerTransitionEnd(this._element); + this.cycle(true); + } + + clearInterval(this._interval); + this._interval = null; + }; + + _proto.cycle = function cycle(event) { + if (!event) { + this._isPaused = false; + } + + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } + + if (this._config.interval && !this._isPaused) { + this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); + } + }; + + _proto.to = function to(index) { + var _this = this; + + this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM); + + var activeIndex = this._getItemIndex(this._activeElement); + + if (index > this._items.length - 1 || index < 0) { + return; + } + + if (this._isSliding) { + $$$1(this._element).one(Event.SLID, function () { + return _this.to(index); + }); + return; + } + + if (activeIndex === index) { + this.pause(); + this.cycle(); + return; + } + + var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; + + this._slide(direction, this._items[index]); + }; + + _proto.dispose = function dispose() { + $$$1(this._element).off(EVENT_KEY); + $$$1.removeData(this._element, DATA_KEY); + this._items = null; + this._config = null; + this._element = null; + this._interval = null; + this._isPaused = null; + this._isSliding = null; + this._activeElement = null; + this._indicatorsElement = null; + }; // Private + + + _proto._getConfig = function _getConfig(config) { + config = _objectSpread({}, Default, config); + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + }; + + _proto._addEventListeners = function _addEventListeners() { + var _this2 = this; + + if (this._config.keyboard) { + $$$1(this._element).on(Event.KEYDOWN, function (event) { + return _this2._keydown(event); + }); + } + + if (this._config.pause === 'hover') { + $$$1(this._element).on(Event.MOUSEENTER, function (event) { + return _this2.pause(event); + }).on(Event.MOUSELEAVE, function (event) { + return _this2.cycle(event); + }); + + if ('ontouchstart' in document.documentElement) { + // 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 + // (as if it's the second time we tap on it, mouseenter compat event + // is NOT fired) and after a timeout (to allow for mouse compatibility + // events to fire) we explicitly restart cycling + $$$1(this._element).on(Event.TOUCHEND, function () { + _this2.pause(); + + if (_this2.touchTimeout) { + clearTimeout(_this2.touchTimeout); + } + + _this2.touchTimeout = setTimeout(function (event) { + return _this2.cycle(event); + }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval); + }); + } + } + }; + + _proto._keydown = function _keydown(event) { + if (/input|textarea/i.test(event.target.tagName)) { + return; + } + + switch (event.which) { + case ARROW_LEFT_KEYCODE: + event.preventDefault(); + this.prev(); + break; + + case ARROW_RIGHT_KEYCODE: + event.preventDefault(); + this.next(); + break; + + default: + } + }; + + _proto._getItemIndex = function _getItemIndex(element) { + this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : []; + return this._items.indexOf(element); + }; + + _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { + var isNextDirection = direction === Direction.NEXT; + var isPrevDirection = direction === Direction.PREV; + + var activeIndex = this._getItemIndex(activeElement); + + var lastItemIndex = this._items.length - 1; + var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; + + if (isGoingToWrap && !this._config.wrap) { + return activeElement; + } + + var delta = direction === Direction.PREV ? -1 : 1; + var itemIndex = (activeIndex + delta) % this._items.length; + return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; + }; + + _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { + var targetIndex = this._getItemIndex(relatedTarget); + + var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM)); + + var slideEvent = $$$1.Event(Event.SLIDE, { + relatedTarget: relatedTarget, + direction: eventDirectionName, + from: fromIndex, + to: targetIndex + }); + $$$1(this._element).trigger(slideEvent); + return slideEvent; + }; + + _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { + if (this._indicatorsElement) { + var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE)); + $$$1(indicators).removeClass(ClassName.ACTIVE); + + var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; + + if (nextIndicator) { + $$$1(nextIndicator).addClass(ClassName.ACTIVE); + } + } + }; + + _proto._slide = function _slide(direction, element) { + var _this3 = this; + + var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM); + + var activeElementIndex = this._getItemIndex(activeElement); + + var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); + + var nextElementIndex = this._getItemIndex(nextElement); + + var isCycling = Boolean(this._interval); + var directionalClassName; + var orderClassName; + var eventDirectionName; + + if (direction === Direction.NEXT) { + directionalClassName = ClassName.LEFT; + orderClassName = ClassName.NEXT; + eventDirectionName = Direction.LEFT; + } else { + directionalClassName = ClassName.RIGHT; + orderClassName = ClassName.PREV; + eventDirectionName = Direction.RIGHT; + } + + if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) { + this._isSliding = false; + return; + } + + var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); + + if (slideEvent.isDefaultPrevented()) { + return; + } + + if (!activeElement || !nextElement) { + // Some weirdness is happening, so we bail + return; + } + + this._isSliding = true; + + if (isCycling) { + this.pause(); + } + + this._setActiveIndicatorElement(nextElement); + + var slidEvent = $$$1.Event(Event.SLID, { + relatedTarget: nextElement, + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex + }); + + if ($$$1(this._element).hasClass(ClassName.SLIDE)) { + $$$1(nextElement).addClass(orderClassName); + Util.reflow(nextElement); + $$$1(activeElement).addClass(directionalClassName); + $$$1(nextElement).addClass(directionalClassName); + var transitionDuration = Util.getTransitionDurationFromElement(activeElement); + $$$1(activeElement).one(Util.TRANSITION_END, function () { + $$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE); + $$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName); + _this3._isSliding = false; + setTimeout(function () { + return $$$1(_this3._element).trigger(slidEvent); + }, 0); + }).emulateTransitionEnd(transitionDuration); + } else { + $$$1(activeElement).removeClass(ClassName.ACTIVE); + $$$1(nextElement).addClass(ClassName.ACTIVE); + this._isSliding = false; + $$$1(this._element).trigger(slidEvent); + } + + if (isCycling) { + this.cycle(); + } + }; // Static + + + Carousel._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $$$1(this).data(DATA_KEY); + + var _config = _objectSpread({}, Default, $$$1(this).data()); + + if (typeof config === 'object') { + _config = _objectSpread({}, _config, config); + } + + var action = typeof config === 'string' ? config : _config.slide; + + if (!data) { + data = new Carousel(this, _config); + $$$1(this).data(DATA_KEY, data); + } + + if (typeof config === 'number') { + data.to(config); + } else if (typeof action === 'string') { + if (typeof data[action] === 'undefined') { + throw new TypeError("No method named \"" + action + "\""); + } + + data[action](); + } else if (_config.interval) { + data.pause(); + data.cycle(); + } + }); + }; + + Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { + var selector = Util.getSelectorFromElement(this); + + if (!selector) { + return; + } + + var target = $$$1(selector)[0]; + + if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) { + return; + } + + var config = _objectSpread({}, $$$1(target).data(), $$$1(this).data()); + + var slideIndex = this.getAttribute('data-slide-to'); + + if (slideIndex) { + config.interval = false; + } + + Carousel._jQueryInterface.call($$$1(target), config); + + if (slideIndex) { + $$$1(target).data(DATA_KEY).to(slideIndex); + } + + event.preventDefault(); + }; + + _createClass(Carousel, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }, { + key: "Default", + get: function get() { + return Default; + } + }]); + + return Carousel; + }(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + + $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); + $$$1(window).on(Event.LOAD_DATA_API, function () { + var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE)); + + for (var i = 0, len = carousels.length; i < len; i++) { + var $carousel = $$$1(carousels[i]); + + Carousel._jQueryInterface.call($carousel, $carousel.data()); + } + }); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $$$1.fn[NAME] = Carousel._jQueryInterface; + $$$1.fn[NAME].Constructor = Carousel; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Carousel._jQueryInterface; + }; + + return Carousel; + }($); + + return Carousel; + +}))); +//# sourceMappingURL=carousel.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/carousel.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/carousel.js.map new file mode 100644 index 0000000..22e48e4 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/carousel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"carousel.js","sources":["../src/carousel.js"],"sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Carousel = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'carousel'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.carousel'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key\n const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key\n const TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\n\n const Default = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true\n }\n\n const DefaultType = {\n interval : '(number|boolean)',\n keyboard : 'boolean',\n slide : '(boolean|string)',\n pause : '(string|boolean)',\n wrap : 'boolean'\n }\n\n const Direction = {\n NEXT : 'next',\n PREV : 'prev',\n LEFT : 'left',\n RIGHT : 'right'\n }\n\n const Event = {\n SLIDE : `slide${EVENT_KEY}`,\n SLID : `slid${EVENT_KEY}`,\n KEYDOWN : `keydown${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`,\n TOUCHEND : `touchend${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n CAROUSEL : 'carousel',\n ACTIVE : 'active',\n SLIDE : 'slide',\n RIGHT : 'carousel-item-right',\n LEFT : 'carousel-item-left',\n NEXT : 'carousel-item-next',\n PREV : 'carousel-item-prev',\n ITEM : 'carousel-item'\n }\n\n const Selector = {\n ACTIVE : '.active',\n ACTIVE_ITEM : '.active.carousel-item',\n ITEM : '.carousel-item',\n NEXT_PREV : '.carousel-item-next, .carousel-item-prev',\n INDICATORS : '.carousel-indicators',\n DATA_SLIDE : '[data-slide], [data-slide-to]',\n DATA_RIDE : '[data-ride=\"carousel\"]'\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Carousel {\n constructor(element, config) {\n this._items = null\n this._interval = null\n this._activeElement = null\n\n this._isPaused = false\n this._isSliding = false\n\n this.touchTimeout = null\n\n this._config = this._getConfig(config)\n this._element = $(element)[0]\n this._indicatorsElement = this._element.querySelector(Selector.INDICATORS)\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT)\n }\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden &&\n ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV)\n }\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if (this._element.querySelector(Selector.NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)\n\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const direction = index > activeIndex\n ? Direction.NEXT\n : Direction.PREV\n\n this._slide(direction, this._items[index])\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n $.removeData(this._element, DATA_KEY)\n\n this._items = null\n this._config = null\n this._element = null\n this._interval = null\n this._isPaused = null\n this._isSliding = null\n this._activeElement = null\n this._indicatorsElement = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on(Event.KEYDOWN, (event) => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n $(this._element)\n .on(Event.MOUSEENTER, (event) => this.pause(event))\n .on(Event.MOUSELEAVE, (event) => this.cycle(event))\n if ('ontouchstart' in document.documentElement) {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n $(this._element).on(Event.TOUCHEND, () => {\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n })\n }\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault()\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault()\n this.next()\n break\n default:\n }\n }\n\n _getItemIndex(element) {\n this._items = element && element.parentNode\n ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM))\n : []\n return this._items.indexOf(element)\n }\n\n _getItemByDirection(direction, activeElement) {\n const isNextDirection = direction === Direction.NEXT\n const isPrevDirection = direction === Direction.PREV\n const activeIndex = this._getItemIndex(activeElement)\n const lastItemIndex = this._items.length - 1\n const isGoingToWrap = isPrevDirection && activeIndex === 0 ||\n isNextDirection && activeIndex === lastItemIndex\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n const delta = direction === Direction.PREV ? -1 : 1\n const itemIndex = (activeIndex + delta) % this._items.length\n\n return itemIndex === -1\n ? this._items[this._items.length - 1] : this._items[itemIndex]\n }\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget)\n const fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM))\n const slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n })\n\n $(this._element).trigger(slideEvent)\n\n return slideEvent\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE))\n $(indicators)\n .removeClass(ClassName.ACTIVE)\n\n const nextIndicator = this._indicatorsElement.children[\n this._getItemIndex(element)\n ]\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE)\n }\n }\n }\n\n _slide(direction, element) {\n const activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)\n const activeElementIndex = this._getItemIndex(activeElement)\n const nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n const nextElementIndex = this._getItemIndex(nextElement)\n const isCycling = Boolean(this._interval)\n\n let directionalClassName\n let orderClassName\n let eventDirectionName\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT\n orderClassName = ClassName.NEXT\n eventDirectionName = Direction.LEFT\n } else {\n directionalClassName = ClassName.RIGHT\n orderClassName = ClassName.PREV\n eventDirectionName = Direction.RIGHT\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.isDefaultPrevented()) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n\n const slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n })\n\n if ($(this._element).hasClass(ClassName.SLIDE)) {\n $(nextElement).addClass(orderClassName)\n\n Util.reflow(nextElement)\n\n $(activeElement).addClass(directionalClassName)\n $(nextElement).addClass(directionalClassName)\n\n const transitionDuration = Util.getTransitionDurationFromElement(activeElement)\n\n $(activeElement)\n .one(Util.TRANSITION_END, () => {\n $(nextElement)\n .removeClass(`${directionalClassName} ${orderClassName}`)\n .addClass(ClassName.ACTIVE)\n\n $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)\n\n this._isSliding = false\n\n setTimeout(() => $(this._element).trigger(slidEvent), 0)\n })\n .emulateTransitionEnd(transitionDuration)\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE)\n $(nextElement).addClass(ClassName.ACTIVE)\n\n this._isSliding = false\n $(this._element).trigger(slidEvent)\n }\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n let _config = {\n ...Default,\n ...$(this).data()\n }\n\n if (typeof config === 'object') {\n _config = {\n ..._config,\n ...config\n }\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (!data) {\n data = new Carousel(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(`No method named \"${action}\"`)\n }\n data[action]()\n } else if (_config.interval) {\n data.pause()\n data.cycle()\n }\n })\n }\n\n static _dataApiClickHandler(event) {\n const selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n const target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n const config = {\n ...$(target).data(),\n ...$(this).data()\n }\n const slideIndex = this.getAttribute('data-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel._jQueryInterface.call($(target), config)\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex)\n }\n\n event.preventDefault()\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n $(window).on(Event.LOAD_DATA_API, () => {\n const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE))\n for (let i = 0, len = carousels.length; i < len; i++) {\n const $carousel = $(carousels[i])\n Carousel._jQueryInterface.call($carousel, $carousel.data())\n }\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Carousel._jQueryInterface\n $.fn[NAME].Constructor = Carousel\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Carousel._jQueryInterface\n }\n\n return Carousel\n})($)\n\nexport default Carousel\n"],"names":["Carousel","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","TOUCHEVENT_COMPAT_WAIT","Default","interval","keyboard","slide","pause","wrap","DefaultType","Direction","NEXT","PREV","LEFT","RIGHT","Event","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","TOUCHEND","LOAD_DATA_API","CLICK_DATA_API","ClassName","CAROUSEL","ACTIVE","ITEM","Selector","ACTIVE_ITEM","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","element","config","_items","_interval","_activeElement","_isPaused","_isSliding","touchTimeout","_config","_getConfig","_element","_indicatorsElement","querySelector","_addEventListeners","next","_slide","nextWhenVisible","document","hidden","is","css","prev","event","Util","triggerTransitionEnd","cycle","clearInterval","setInterval","visibilityState","bind","to","index","activeIndex","_getItemIndex","length","one","direction","dispose","off","removeData","typeCheckConfig","on","_keydown","documentElement","clearTimeout","setTimeout","test","target","tagName","which","preventDefault","parentNode","slice","call","querySelectorAll","indexOf","_getItemByDirection","activeElement","isNextDirection","isPrevDirection","lastItemIndex","isGoingToWrap","delta","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","trigger","_setActiveIndicatorElement","indicators","removeClass","nextIndicator","children","addClass","activeElementIndex","nextElement","nextElementIndex","isCycling","Boolean","directionalClassName","orderClassName","hasClass","isDefaultPrevented","slidEvent","reflow","transitionDuration","getTransitionDurationFromElement","TRANSITION_END","emulateTransitionEnd","_jQueryInterface","each","data","action","TypeError","_dataApiClickHandler","selector","getSelectorFromElement","slideIndex","getAttribute","window","carousels","i","len","$carousel","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;;;;;;;EAOA,IAAMA,WAAY,UAACC,IAAD,EAAO;EACvB;;;;;EAMA,MAAMC,OAAyB,UAA/B;EACA,MAAMC,UAAyB,OAA/B;EACA,MAAMC,WAAyB,aAA/B;EACA,MAAMC,kBAA6BD,QAAnC;EACA,MAAME,eAAyB,WAA/B;EACA,MAAMC,qBAAyBN,KAAEO,EAAF,CAAKN,IAAL,CAA/B;EACA,MAAMO,qBAAyB,EAA/B,CAbuB;;EAcvB,MAAMC,sBAAyB,EAA/B,CAduB;;EAevB,MAAMC,yBAAyB,GAA/B,CAfuB;;EAiBvB,MAAMC,UAAU;EACdC,cAAW,IADG;EAEdC,cAAW,IAFG;EAGdC,WAAW,KAHG;EAIdC,WAAW,OAJG;EAKdC,UAAW;EALG,GAAhB;EAQA,MAAMC,cAAc;EAClBL,c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AAEkJ,UAAUC,CAAV,CAAF,CAAlB;;EACApJ,eAASwI,gBAAT,CAA0BxC,IAA1B,CAA+BsD,SAA/B,EAA0CA,UAAUZ,IAAV,EAA1C;EACD;EACF,GAND;EAQA;;;;;;EAMAzI,OAAEO,EAAF,CAAKN,IAAL,IAAaF,SAASwI,gBAAtB;EACAvI,OAAEO,EAAF,CAAKN,IAAL,EAAWqJ,WAAX,GAAyBvJ,QAAzB;;EACAC,OAAEO,EAAF,CAAKN,IAAL,EAAWsJ,UAAX,GAAwB,YAAY;EAClCvJ,SAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;EACA,WAAOP,SAASwI,gBAAhB;EACD,GAHD;;EAKA,SAAOxI,QAAP;EACD,CA3fgB,CA2fdC,CA3fc,CAAjB;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/collapse.js b/themes/docsy/assets/vendor/bootstrap/js/dist/collapse.js new file mode 100644 index 0000000..94819cc --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/collapse.js @@ -0,0 +1,431 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : + typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : + (global.Collapse = factory(global.jQuery,global.Util)); +}(this, (function ($,Util) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } + + return target; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): collapse.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Collapse = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'collapse'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.collapse'; + var EVENT_KEY = "." + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var Default = { + toggle: true, + parent: '' + }; + var DefaultType = { + toggle: 'boolean', + parent: '(string|element)' + }; + var Event = { + SHOW: "show" + EVENT_KEY, + SHOWN: "shown" + EVENT_KEY, + HIDE: "hide" + EVENT_KEY, + HIDDEN: "hidden" + EVENT_KEY, + CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY + }; + var ClassName = { + SHOW: 'show', + COLLAPSE: 'collapse', + COLLAPSING: 'collapsing', + COLLAPSED: 'collapsed' + }; + var Dimension = { + WIDTH: 'width', + HEIGHT: 'height' + }; + var Selector = { + ACTIVES: '.show, .collapsing', + DATA_TOGGLE: '[data-toggle="collapse"]' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var Collapse = + /*#__PURE__*/ + function () { + function Collapse(element, config) { + this._isTransitioning = false; + this._element = element; + this._config = this._getConfig(config); + this._triggerArray = $$$1.makeArray(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); + var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)); + + for (var i = 0, len = toggleList.length; i < len; i++) { + var elem = toggleList[i]; + var selector = Util.getSelectorFromElement(elem); + var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { + return foundElem === element; + }); + + if (selector !== null && filterElement.length > 0) { + this._selector = selector; + + this._triggerArray.push(elem); + } + } + + this._parent = this._config.parent ? this._getParent() : null; + + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._element, this._triggerArray); + } + + if (this._config.toggle) { + this.toggle(); + } + } // Getters + + + var _proto = Collapse.prototype; + + // Public + _proto.toggle = function toggle() { + if ($$$1(this._element).hasClass(ClassName.SHOW)) { + this.hide(); + } else { + this.show(); + } + }; + + _proto.show = function show() { + var _this = this; + + if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) { + return; + } + + var actives; + var activesData; + + if (this._parent) { + actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) { + return elem.getAttribute('data-parent') === _this._config.parent; + }); + + if (actives.length === 0) { + actives = null; + } + } + + if (actives) { + activesData = $$$1(actives).not(this._selector).data(DATA_KEY); + + if (activesData && activesData._isTransitioning) { + return; + } + } + + var startEvent = $$$1.Event(Event.SHOW); + $$$1(this._element).trigger(startEvent); + + if (startEvent.isDefaultPrevented()) { + return; + } + + if (actives) { + Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide'); + + if (!activesData) { + $$$1(actives).data(DATA_KEY, null); + } + } + + var dimension = this._getDimension(); + + $$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); + this._element.style[dimension] = 0; + + if (this._triggerArray.length) { + $$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); + } + + this.setTransitioning(true); + + var complete = function complete() { + $$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW); + _this._element.style[dimension] = ''; + + _this.setTransitioning(false); + + $$$1(_this._element).trigger(Event.SHOWN); + }; + + var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + var scrollSize = "scroll" + capitalizedDimension; + var transitionDuration = Util.getTransitionDurationFromElement(this._element); + $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + this._element.style[dimension] = this._element[scrollSize] + "px"; + }; + + _proto.hide = function hide() { + var _this2 = this; + + if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) { + return; + } + + var startEvent = $$$1.Event(Event.HIDE); + $$$1(this._element).trigger(startEvent); + + if (startEvent.isDefaultPrevented()) { + return; + } + + var dimension = this._getDimension(); + + this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; + Util.reflow(this._element); + $$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW); + var triggerArrayLength = this._triggerArray.length; + + if (triggerArrayLength > 0) { + for (var i = 0; i < triggerArrayLength; i++) { + var trigger = this._triggerArray[i]; + var selector = Util.getSelectorFromElement(trigger); + + if (selector !== null) { + var $elem = $$$1([].slice.call(document.querySelectorAll(selector))); + + if (!$elem.hasClass(ClassName.SHOW)) { + $$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + } + } + } + } + + this.setTransitioning(true); + + var complete = function complete() { + _this2.setTransitioning(false); + + $$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); + }; + + this._element.style[dimension] = ''; + var transitionDuration = Util.getTransitionDurationFromElement(this._element); + $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + }; + + _proto.setTransitioning = function setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning; + }; + + _proto.dispose = function dispose() { + $$$1.removeData(this._element, DATA_KEY); + this._config = null; + this._parent = null; + this._element = null; + this._triggerArray = null; + this._isTransitioning = null; + }; // Private + + + _proto._getConfig = function _getConfig(config) { + config = _objectSpread({}, Default, config); + config.toggle = Boolean(config.toggle); // Coerce string values + + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + }; + + _proto._getDimension = function _getDimension() { + var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH); + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; + }; + + _proto._getParent = function _getParent() { + var _this3 = this; + + var parent = null; + + if (Util.isElement(this._config.parent)) { + parent = this._config.parent; // It's a jQuery object + + if (typeof this._config.parent.jquery !== 'undefined') { + parent = this._config.parent[0]; + } + } else { + parent = document.querySelector(this._config.parent); + } + + var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; + var children = [].slice.call(parent.querySelectorAll(selector)); + $$$1(children).each(function (i, element) { + _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); + }); + return parent; + }; + + _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { + if (element) { + var isOpen = $$$1(element).hasClass(ClassName.SHOW); + + if (triggerArray.length) { + $$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); + } + } + }; // Static + + + Collapse._getTargetFromElement = function _getTargetFromElement(element) { + var selector = Util.getSelectorFromElement(element); + return selector ? document.querySelector(selector) : null; + }; + + Collapse._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var $this = $$$1(this); + var data = $this.data(DATA_KEY); + + var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {}); + + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false; + } + + if (!data) { + data = new Collapse(this, _config); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + _createClass(Collapse, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }, { + key: "Default", + get: function get() { + return Default; + } + }]); + + return Collapse; + }(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + + $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + // preventDefault only for <a> elements (which change the URL) not inside the collapsible element + if (event.currentTarget.tagName === 'A') { + event.preventDefault(); + } + + var $trigger = $$$1(this); + var selector = Util.getSelectorFromElement(this); + var selectors = [].slice.call(document.querySelectorAll(selector)); + $$$1(selectors).each(function () { + var $target = $$$1(this); + var data = $target.data(DATA_KEY); + var config = data ? 'toggle' : $trigger.data(); + + Collapse._jQueryInterface.call($target, config); + }); + }); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $$$1.fn[NAME] = Collapse._jQueryInterface; + $$$1.fn[NAME].Constructor = Collapse; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Collapse._jQueryInterface; + }; + + return Collapse; + }($); + + return Collapse; + +}))); +//# sourceMappingURL=collapse.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/collapse.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/collapse.js.map new file mode 100644 index 0000000..0b22ceb --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/collapse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"collapse.js","sources":["../src/collapse.js"],"sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Collapse = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'collapse'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.collapse'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n toggle : true,\n parent : ''\n }\n\n const DefaultType = {\n toggle : 'boolean',\n parent : '(string|element)'\n }\n\n const Event = {\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SHOW : 'show',\n COLLAPSE : 'collapse',\n COLLAPSING : 'collapsing',\n COLLAPSED : 'collapsed'\n }\n\n const Dimension = {\n WIDTH : 'width',\n HEIGHT : 'height'\n }\n\n const Selector = {\n ACTIVES : '.show, .collapsing',\n DATA_TOGGLE : '[data-toggle=\"collapse\"]'\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse {\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = $.makeArray(document.querySelectorAll(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n for (let i = 0, len = toggleList.length; i < len; i++) {\n const elem = toggleList[i]\n const selector = Util.getSelectorFromElement(elem)\n const filterElement = [].slice.call(document.querySelectorAll(selector))\n .filter((foundElem) => foundElem === element)\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector\n this._triggerArray.push(elem)\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES))\n .filter((elem) => elem.getAttribute('data-parent') === this._config.parent)\n\n if (actives.length === 0) {\n actives = null\n }\n }\n\n if (actives) {\n activesData = $(actives).not(this._selector).data(DATA_KEY)\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = $.Event(Event.SHOW)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide')\n if (!activesData) {\n $(actives).data(DATA_KEY, null)\n }\n }\n\n const dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .removeClass(ClassName.COLLAPSED)\n .attr('aria-expanded', true)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.SHOW)\n\n this._element.style[dimension] = ''\n\n this.setTransitioning(false)\n\n $(this._element).trigger(Event.SHOWN)\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning ||\n !$(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n const startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.SHOW)\n\n const triggerArrayLength = this._triggerArray.length\n if (triggerArrayLength > 0) {\n for (let i = 0; i < triggerArrayLength; i++) {\n const trigger = this._triggerArray[i]\n const selector = Util.getSelectorFromElement(trigger)\n if (selector !== null) {\n const $elem = $([].slice.call(document.querySelectorAll(selector)))\n if (!$elem.hasClass(ClassName.SHOW)) {\n $(trigger).addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n }\n }\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n this.setTransitioning(false)\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .trigger(Event.HIDDEN)\n }\n\n this._element.style[dimension] = ''\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n }\n\n setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._parent = null\n this._element = null\n this._triggerArray = null\n this._isTransitioning = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n config.toggle = Boolean(config.toggle) // Coerce string values\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n const hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n let parent = null\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent\n\n // It's a jQuery object\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0]\n }\n } else {\n parent = document.querySelector(this._config.parent)\n }\n\n const selector =\n `[data-toggle=\"collapse\"][data-parent=\"${this._config.parent}\"]`\n\n const children = [].slice.call(parent.querySelectorAll(selector))\n $(children).each((i, element) => {\n this._addAriaAndCollapsedClass(\n Collapse._getTargetFromElement(element),\n [element]\n )\n })\n\n return parent\n }\n\n _addAriaAndCollapsedClass(element, triggerArray) {\n if (element) {\n const isOpen = $(element).hasClass(ClassName.SHOW)\n\n if (triggerArray.length) {\n $(triggerArray)\n .toggleClass(ClassName.COLLAPSED, !isOpen)\n .attr('aria-expanded', isOpen)\n }\n }\n }\n\n // Static\n\n static _getTargetFromElement(element) {\n const selector = Util.getSelectorFromElement(element)\n return selector ? document.querySelector(selector) : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n const _config = {\n ...Default,\n ...$this.data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n if (!data) {\n data = new Collapse(this, _config)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault()\n }\n\n const $trigger = $(this)\n const selector = Util.getSelectorFromElement(this)\n const selectors = [].slice.call(document.querySelectorAll(selector))\n $(selectors).each(function () {\n const $target = $(this)\n const data = $target.data(DATA_KEY)\n const config = data ? 'toggle' : $trigger.data()\n Collapse._jQueryInterface.call($target, config)\n })\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface\n $.fn[NAME].Constructor = Collapse\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n }\n\n return Collapse\n})($)\n\nexport default Collapse\n"],"names":["Collapse","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","Default","toggle","parent","DefaultType","Event","SHOW","SHOWN","HIDE","HIDDEN","CLICK_DATA_API","ClassName","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","Selector","ACTIVES","DATA_TOGGLE","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","makeArray","document","querySelectorAll","id","toggleList","slice","call","i","len","length","elem","selector","Util","getSelectorFromElement","filterElement","filter","foundElem","_selector","push","_parent","_getParent","_addAriaAndCollapsedClass","hasClass","hide","show","actives","activesData","getAttribute","not","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","dimension","_getDimension","removeClass","addClass","style","attr","setTransitioning","complete","capitalizedDimension","toUpperCase","scrollSize","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","getBoundingClientRect","reflow","triggerArrayLength","$elem","isTransitioning","dispose","removeData","Boolean","typeCheckConfig","hasWidth","isElement","jquery","querySelector","children","each","_getTargetFromElement","triggerArray","isOpen","toggleClass","$this","test","TypeError","on","event","currentTarget","tagName","preventDefault","$trigger","selectors","$target","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;;;;;;;EAOA,IAAMA,WAAY,UAACC,IAAD,EAAO;EACvB;;;;;EAMA,MAAMC,OAAsB,UAA5B;EACA,MAAMC,UAAsB,OAA5B;EACA,MAAMC,WAAsB,aAA5B;EACA,MAAMC,kBAA0BD,QAAhC;EACA,MAAME,eAAsB,WAA5B;EACA,MAAMC,qBAAsBN,KAAEO,EAAF,CAAKN,IAAL,CAA5B;EAEA,MAAMO,UAAU;EACdC,YAAS,IADK;EAEdC,YAAS;EAFK,GAAhB;EAK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;EACA,UAAM0B,SAAUmC,OAAO,QAAP,GAAkBgD,SAAShD,IAAT,EAAlC;;EACAjE,eAASqE,gBAAT,CAA0B3B,IAA1B,CAA+ByE,OAA/B,EAAwCrF,MAAxC;EACD,KALD;EAMD,GAfD;EAiBA;;;;;;EAMA7B,OAAEO,EAAF,CAAKN,IAAL,IAAaF,SAASqE,gBAAtB;EACApE,OAAEO,EAAF,CAAKN,IAAL,EAAWkH,WAAX,GAAyBpH,QAAzB;;EACAC,OAAEO,EAAF,CAAKN,IAAL,EAAWmH,UAAX,GAAwB,YAAY;EAClCpH,SAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;EACA,WAAOP,SAASqE,gBAAhB;EACD,GAHD;;EAKA,SAAOrE,QAAP;EACD,CAjYgB,CAiYdC,CAjYc,CAAjB;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/dropdown.js b/themes/docsy/assets/vendor/bootstrap/js/dist/dropdown.js new file mode 100644 index 0000000..7149606 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/dropdown.js @@ -0,0 +1,552 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) : + typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) : + (global.Dropdown = factory(global.jQuery,global.Popper,global.Util)); +}(this, (function ($,Popper,Util) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; + Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } + + return target; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): dropdown.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Dropdown = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'dropdown'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.dropdown'; + var EVENT_KEY = "." + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key + + var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key + + var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key + + var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key + + var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key + + var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) + + var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); + var Event = { + HIDE: "hide" + EVENT_KEY, + HIDDEN: "hidden" + EVENT_KEY, + SHOW: "show" + EVENT_KEY, + SHOWN: "shown" + EVENT_KEY, + CLICK: "click" + EVENT_KEY, + CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY, + KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY, + KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY + }; + var ClassName = { + DISABLED: 'disabled', + SHOW: 'show', + DROPUP: 'dropup', + DROPRIGHT: 'dropright', + DROPLEFT: 'dropleft', + MENURIGHT: 'dropdown-menu-right', + MENULEFT: 'dropdown-menu-left', + POSITION_STATIC: 'position-static' + }; + var Selector = { + DATA_TOGGLE: '[data-toggle="dropdown"]', + FORM_CHILD: '.dropdown form', + MENU: '.dropdown-menu', + NAVBAR_NAV: '.navbar-nav', + VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' + }; + var AttachmentMap = { + TOP: 'top-start', + TOPEND: 'top-end', + BOTTOM: 'bottom-start', + BOTTOMEND: 'bottom-end', + RIGHT: 'right-start', + RIGHTEND: 'right-end', + LEFT: 'left-start', + LEFTEND: 'left-end' + }; + var Default = { + offset: 0, + flip: true, + boundary: 'scrollParent', + reference: 'toggle', + display: 'dynamic' + }; + var DefaultType = { + offset: '(number|string|function)', + flip: 'boolean', + boundary: '(string|element)', + reference: '(string|element)', + display: 'string' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var Dropdown = + /*#__PURE__*/ + function () { + function Dropdown(element, config) { + this._element = element; + this._popper = null; + this._config = this._getConfig(config); + this._menu = this._getMenuElement(); + this._inNavbar = this._detectNavbar(); + + this._addEventListeners(); + } // Getters + + + var _proto = Dropdown.prototype; + + // Public + _proto.toggle = function toggle() { + if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) { + return; + } + + var parent = Dropdown._getParentFromElement(this._element); + + var isActive = $$$1(this._menu).hasClass(ClassName.SHOW); + + Dropdown._clearMenus(); + + if (isActive) { + return; + } + + var relatedTarget = { + relatedTarget: this._element + }; + var showEvent = $$$1.Event(Event.SHOW, relatedTarget); + $$$1(parent).trigger(showEvent); + + if (showEvent.isDefaultPrevented()) { + return; + } // Disable totally Popper.js for Dropdown in Navbar + + + if (!this._inNavbar) { + /** + * Check for Popper dependency + * Popper - https://popper.js.org + */ + if (typeof Popper === 'undefined') { + throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)'); + } + + var referenceElement = this._element; + + if (this._config.reference === 'parent') { + referenceElement = parent; + } else if (Util.isElement(this._config.reference)) { + referenceElement = this._config.reference; // Check if it's jQuery element + + if (typeof this._config.reference.jquery !== 'undefined') { + referenceElement = this._config.reference[0]; + } + } // If boundary is not `scrollParent`, then set position to `static` + // to allow the menu to "escape" the scroll parent's boundaries + // https://github.com/twbs/bootstrap/issues/24251 + + + if (this._config.boundary !== 'scrollParent') { + $$$1(parent).addClass(ClassName.POSITION_STATIC); + } + + this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); + } // 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 && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) { + $$$1(document.body).children().on('mouseover', null, $$$1.noop); + } + + this._element.focus(); + + this._element.setAttribute('aria-expanded', true); + + $$$1(this._menu).toggleClass(ClassName.SHOW); + $$$1(parent).toggleClass(ClassName.SHOW).trigger($$$1.Event(Event.SHOWN, relatedTarget)); + }; + + _proto.dispose = function dispose() { + $$$1.removeData(this._element, DATA_KEY); + $$$1(this._element).off(EVENT_KEY); + this._element = null; + this._menu = null; + + if (this._popper !== null) { + this._popper.destroy(); + + this._popper = null; + } + }; + + _proto.update = function update() { + this._inNavbar = this._detectNavbar(); + + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } + }; // Private + + + _proto._addEventListeners = function _addEventListeners() { + var _this = this; + + $$$1(this._element).on(Event.CLICK, function (event) { + event.preventDefault(); + event.stopPropagation(); + + _this.toggle(); + }); + }; + + _proto._getConfig = function _getConfig(config) { + config = _objectSpread({}, this.constructor.Default, $$$1(this._element).data(), config); + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); + return config; + }; + + _proto._getMenuElement = function _getMenuElement() { + if (!this._menu) { + var parent = Dropdown._getParentFromElement(this._element); + + if (parent) { + this._menu = parent.querySelector(Selector.MENU); + } + } + + return this._menu; + }; + + _proto._getPlacement = function _getPlacement() { + var $parentDropdown = $$$1(this._element.parentNode); + var placement = AttachmentMap.BOTTOM; // Handle dropup + + if ($parentDropdown.hasClass(ClassName.DROPUP)) { + placement = AttachmentMap.TOP; + + if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.TOPEND; + } + } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) { + placement = AttachmentMap.RIGHT; + } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) { + placement = AttachmentMap.LEFT; + } else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.BOTTOMEND; + } + + return placement; + }; + + _proto._detectNavbar = function _detectNavbar() { + return $$$1(this._element).closest('.navbar').length > 0; + }; + + _proto._getPopperConfig = function _getPopperConfig() { + var _this2 = this; + + var offsetConf = {}; + + if (typeof this._config.offset === 'function') { + offsetConf.fn = function (data) { + data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {}); + return data; + }; + } else { + offsetConf.offset = this._config.offset; + } + + var popperConfig = { + placement: this._getPlacement(), + modifiers: { + offset: offsetConf, + flip: { + enabled: this._config.flip + }, + preventOverflow: { + boundariesElement: this._config.boundary + } + } // Disable Popper.js if we have a static display + + }; + + if (this._config.display === 'static') { + popperConfig.modifiers.applyStyle = { + enabled: false + }; + } + + return popperConfig; + }; // Static + + + Dropdown._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $$$1(this).data(DATA_KEY); + + var _config = typeof config === 'object' ? config : null; + + if (!data) { + data = new Dropdown(this, _config); + $$$1(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + Dropdown._clearMenus = function _clearMenus(event) { + if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { + return; + } + + var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)); + + for (var i = 0, len = toggles.length; i < len; i++) { + var parent = Dropdown._getParentFromElement(toggles[i]); + + var context = $$$1(toggles[i]).data(DATA_KEY); + var relatedTarget = { + relatedTarget: toggles[i] + }; + + if (event && event.type === 'click') { + relatedTarget.clickEvent = event; + } + + if (!context) { + continue; + } + + var dropdownMenu = context._menu; + + if (!$$$1(parent).hasClass(ClassName.SHOW)) { + continue; + } + + if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) { + continue; + } + + var hideEvent = $$$1.Event(Event.HIDE, relatedTarget); + $$$1(parent).trigger(hideEvent); + + if (hideEvent.isDefaultPrevented()) { + continue; + } // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + + + if ('ontouchstart' in document.documentElement) { + $$$1(document.body).children().off('mouseover', null, $$$1.noop); + } + + toggles[i].setAttribute('aria-expanded', 'false'); + $$$1(dropdownMenu).removeClass(ClassName.SHOW); + $$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget)); + } + }; + + Dropdown._getParentFromElement = function _getParentFromElement(element) { + var parent; + var selector = Util.getSelectorFromElement(element); + + if (selector) { + parent = document.querySelector(selector); + } + + return parent || element.parentNode; + }; // eslint-disable-next-line complexity + + + Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { + // If not input/textarea: + // - And not a key in REGEXP_KEYDOWN => not a dropdown command + // If input/textarea: + // - If space key => not a dropdown command + // - If key is other than escape + // - If key is not up or down => not a dropdown command + // - If trigger inside the menu => not a dropdown command + if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $$$1(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { + return; + } + + event.preventDefault(); + event.stopPropagation(); + + if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) { + return; + } + + var parent = Dropdown._getParentFromElement(this); + + var isActive = $$$1(parent).hasClass(ClassName.SHOW); + + if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { + if (event.which === ESCAPE_KEYCODE) { + var toggle = parent.querySelector(Selector.DATA_TOGGLE); + $$$1(toggle).trigger('focus'); + } + + $$$1(this).trigger('click'); + return; + } + + var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS)); + + if (items.length === 0) { + return; + } + + var index = items.indexOf(event.target); + + if (event.which === ARROW_UP_KEYCODE && index > 0) { + // Up + index--; + } + + if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { + // Down + index++; + } + + if (index < 0) { + index = 0; + } + + items[index].focus(); + }; + + _createClass(Dropdown, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }, { + key: "Default", + get: function get() { + return Default; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType; + } + }]); + + return Dropdown; + }(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + + $$$1(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + event.stopPropagation(); + + Dropdown._jQueryInterface.call($$$1(this), 'toggle'); + }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { + e.stopPropagation(); + }); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $$$1.fn[NAME] = Dropdown._jQueryInterface; + $$$1.fn[NAME].Constructor = Dropdown; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Dropdown._jQueryInterface; + }; + + return Dropdown; + }($, Popper); + + return Dropdown; + +}))); +//# sourceMappingURL=dropdown.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/dropdown.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/dropdown.js.map new file mode 100644 index 0000000..d6e2807 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/dropdown.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dropdown.js","sources":["../src/dropdown.js"],"sourcesContent":["import $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Dropdown = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'dropdown'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.dropdown'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key\n const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key\n const ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key\n const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key\n const RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)\n const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,\n KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DISABLED : 'disabled',\n SHOW : 'show',\n DROPUP : 'dropup',\n DROPRIGHT : 'dropright',\n DROPLEFT : 'dropleft',\n MENURIGHT : 'dropdown-menu-right',\n MENULEFT : 'dropdown-menu-left',\n POSITION_STATIC : 'position-static'\n }\n\n const Selector = {\n DATA_TOGGLE : '[data-toggle=\"dropdown\"]',\n FORM_CHILD : '.dropdown form',\n MENU : '.dropdown-menu',\n NAVBAR_NAV : '.navbar-nav',\n VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n }\n\n const AttachmentMap = {\n TOP : 'top-start',\n TOPEND : 'top-end',\n BOTTOM : 'bottom-start',\n BOTTOMEND : 'bottom-end',\n RIGHT : 'right-start',\n RIGHTEND : 'right-end',\n LEFT : 'left-start',\n LEFTEND : 'left-end'\n }\n\n const Default = {\n offset : 0,\n flip : true,\n boundary : 'scrollParent',\n reference : 'toggle',\n display : 'dynamic'\n }\n\n const DefaultType = {\n offset : '(number|string|function)',\n flip : 'boolean',\n boundary : '(string|element)',\n reference : '(string|element)',\n display : 'string'\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Dropdown {\n constructor(element, config) {\n this._element = element\n this._popper = null\n this._config = this._getConfig(config)\n this._menu = this._getMenuElement()\n this._inNavbar = this._detectNavbar()\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this._element)\n const isActive = $(this._menu).hasClass(ClassName.SHOW)\n\n Dropdown._clearMenus()\n\n if (isActive) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n const showEvent = $.Event(Event.SHOW, relatedTarget)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return\n }\n\n // Disable totally Popper.js for Dropdown in Navbar\n if (!this._inNavbar) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)')\n }\n\n let referenceElement = this._element\n\n if (this._config.reference === 'parent') {\n referenceElement = parent\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference\n\n // Check if it's jQuery element\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0]\n }\n }\n\n // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n if (this._config.boundary !== 'scrollParent') {\n $(parent).addClass(ClassName.POSITION_STATIC)\n }\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())\n }\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement &&\n $(parent).closest(Selector.NAVBAR_NAV).length === 0) {\n $(document.body).children().on('mouseover', null, $.noop)\n }\n\n this._element.focus()\n this._element.setAttribute('aria-expanded', true)\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.SHOWN, relatedTarget))\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._element).off(EVENT_KEY)\n this._element = null\n this._menu = null\n if (this._popper !== null) {\n this._popper.destroy()\n this._popper = null\n }\n }\n\n update() {\n this._inNavbar = this._detectNavbar()\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // Private\n\n _addEventListeners() {\n $(this._element).on(Event.CLICK, (event) => {\n event.preventDefault()\n event.stopPropagation()\n this.toggle()\n })\n }\n\n _getConfig(config) {\n config = {\n ...this.constructor.Default,\n ...$(this._element).data(),\n ...config\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getMenuElement() {\n if (!this._menu) {\n const parent = Dropdown._getParentFromElement(this._element)\n if (parent) {\n this._menu = parent.querySelector(Selector.MENU)\n }\n }\n return this._menu\n }\n\n _getPlacement() {\n const $parentDropdown = $(this._element.parentNode)\n let placement = AttachmentMap.BOTTOM\n\n // Handle dropup\n if ($parentDropdown.hasClass(ClassName.DROPUP)) {\n placement = AttachmentMap.TOP\n if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND\n }\n } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT\n } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {\n placement = AttachmentMap.LEFT\n } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND\n }\n return placement\n }\n\n _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0\n }\n\n _getPopperConfig() {\n const offsetConf = {}\n if (typeof this._config.offset === 'function') {\n offsetConf.fn = (data) => {\n data.offsets = {\n ...data.offsets,\n ...this._config.offset(data.offsets) || {}\n }\n return data\n }\n } else {\n offsetConf.offset = this._config.offset\n }\n\n const popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: offsetConf,\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n }\n }\n\n // Disable Popper.js if we have a static display\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n }\n }\n return popperConfig\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data) {\n data = new Dropdown(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n static _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH ||\n event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return\n }\n\n const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n for (let i = 0, len = toggles.length; i < len; i++) {\n const parent = Dropdown._getParentFromElement(toggles[i])\n const context = $(toggles[i]).data(DATA_KEY)\n const relatedTarget = {\n relatedTarget: toggles[i]\n }\n\n if (event && event.type === 'click') {\n relatedTarget.clickEvent = event\n }\n\n if (!context) {\n continue\n }\n\n const dropdownMenu = context._menu\n if (!$(parent).hasClass(ClassName.SHOW)) {\n continue\n }\n\n if (event && (event.type === 'click' &&\n /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) &&\n $.contains(parent, event.target)) {\n continue\n }\n\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n $(parent).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n continue\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop)\n }\n\n toggles[i].setAttribute('aria-expanded', 'false')\n\n $(dropdownMenu).removeClass(ClassName.SHOW)\n $(parent)\n .removeClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n }\n\n static _getParentFromElement(element) {\n let parent\n const selector = Util.getSelectorFromElement(element)\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n return parent || element.parentNode\n }\n\n // eslint-disable-next-line complexity\n static _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName)\n ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE &&\n (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE ||\n $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this)\n const isActive = $(parent).hasClass(ClassName.SHOW)\n\n if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) ||\n isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n const toggle = parent.querySelector(Selector.DATA_TOGGLE)\n $(toggle).trigger('focus')\n }\n\n $(this).trigger('click')\n return\n }\n\n const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS))\n\n if (items.length === 0) {\n return\n }\n\n let index = items.indexOf(event.target)\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) { // Up\n index--\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // Down\n index++\n }\n\n if (index < 0) {\n index = 0\n }\n\n items[index].focus()\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)\n .on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)\n .on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n event.stopPropagation()\n Dropdown._jQueryInterface.call($(this), 'toggle')\n })\n .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {\n e.stopPropagation()\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Dropdown._jQueryInterface\n $.fn[NAME].Constructor = Dropdown\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Dropdown._jQueryInterface\n }\n\n return Dropdown\n})($, Popper)\n\nexport default Dropdown\n"],"names":["Dropdown","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ESCAPE_KEYCODE","SPACE_KEYCODE","TAB_KEYCODE","ARROW_UP_KEYCODE","ARROW_DOWN_KEYCODE","RIGHT_MOUSE_BUTTON_WHICH","REGEXP_KEYDOWN","RegExp","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK","CLICK_DATA_API","KEYDOWN_DATA_API","KEYUP_DATA_API","ClassName","DISABLED","DROPUP","DROPRIGHT","DROPLEFT","MENURIGHT","MENULEFT","POSITION_STATIC","Selector","DATA_TOGGLE","FORM_CHILD","MENU","NAVBAR_NAV","VISIBLE_ITEMS","AttachmentMap","TOP","TOPEND","BOTTOM","BOTTOMEND","RIGHT","RIGHTEND","LEFT","LEFTEND","Default","offset","flip","boundary","reference","display","DefaultType","element","config","_element","_popper","_config","_getConfig","_menu","_getMenuElement","_inNavbar","_detectNavbar","_addEventListeners","toggle","disabled","hasClass","parent","_getParentFromElement","isActive","_clearMenus","relatedTarget","showEvent","trigger","isDefaultPrevented","Popper","TypeError","referenceElement","Util","isElement","jquery","addClass","_getPopperConfig","document","documentElement","closest","length","body","children","on","noop","focus","setAttribute","toggleClass","dispose","removeData","off","destroy","update","scheduleUpdate","event","preventDefault","stopPropagation","constructor","data","typeCheckConfig","querySelector","_getPlacement","$parentDropdown","parentNode","placement","offsetConf","offsets","popperConfig","modifiers","enabled","preventOverflow","boundariesElement","applyStyle","_jQueryInterface","each","which","type","toggles","slice","call","querySelectorAll","i","len","context","clickEvent","dropdownMenu","test","target","tagName","contains","hideEvent","removeClass","selector","getSelectorFromElement","_dataApiKeydownHandler","items","index","indexOf","e","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIA;;;;;;;EAOA,IAAMA,WAAY,UAACC,IAAD,EAAO;EACvB;;;;;EAMA,MAAMC,OAA2B,UAAjC;EACA,MAAMC,UAA2B,OAAjC;EACA,MAAMC,WAA2B,aAAjC;EACA,MAAMC,kBAA+BD,QAArC;EACA,MAAME,eAA2B,WAAjC;EACA,MAAMC,qBAA2BN,KAAEO,EAAF,CAAKN,IAAL,CAAjC;EACA,MAAMO,iBAA2B,EAAjC,CAbuB;;EAcvB,MAAMC,gBAA2B,EAAjC,CAduB;;EAevB,MAAMC,cAA2B,CAAjC,CAfuB;;EAgBvB,MAAMC,mBAA2B,EAAjC,CAhBuB;;EAiBvB,MAAMC,qBAA2B,EAAjC,CAjBuB;;EAkBvB,MAAMC,2BAA2B,CAAjC,CAlBuB;;EAmBvB,MAAMC,iBAA2B,IAAIC,MAAJ,CAAcJ,gBAAd,SAAkCC,kBAAlC,SAAwDJ,cAAxD,CAAjC;EAEA,MAAMQ,QAAQ;EACZC,mBAA0Bb,SADd;EAEZc,uBAA4Bd,SAFhB;EAGZe,mBAA0Bf,SAHd;EAIZgB,qB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;EA+bvB;;;;;;;EAMAtD,OAAEqF,QAAF,EACGM,EADH,CACM3E,MAAMO,gBADZ,EAC8BU,SAASC,WADvC,EACoDnC,SAAS+I,sBAD7D,EAEGnD,EAFH,CAEM3E,MAAMO,gBAFZ,EAE8BU,SAASG,IAFvC,EAE6CrC,SAAS+I,sBAFtD,EAGGnD,EAHH,CAGS3E,MAAMM,cAHf,SAGiCN,MAAMQ,cAHvC,EAGyDzB,SAASyE,WAHlE,EAIGmB,EAJH,CAIM3E,MAAMM,cAJZ,EAI4BW,SAASC,WAJrC,EAIkD,UAAUoE,KAAV,EAAiB;EAC/DA,UAAMC,cAAN;EACAD,UAAME,eAAN;;EACAzG,aAAS0H,gBAAT,CAA0BM,IAA1B,CAA+B/H,KAAE,IAAF,CAA/B,EAAwC,QAAxC;EACD,GARH,EASG2F,EATH,CASM3E,MAAMM,cATZ,EAS4BW,SAASE,UATrC,EASiD,UAAC+G,CAAD,EAAO;EACpDA,MAAE1C,eAAF;EACD,GAXH;EAaA;;;;;;EAMAxG,OAAEO,EAAF,CAAKN,IAAL,IAAaF,SAAS0H,gBAAtB;EACAzH,OAAEO,EAAF,CAAKN,IAAL,EAAWkJ,WAAX,GAAyBpJ,QAAzB;;EACAC,OAAEO,EAAF,CAAKN,IAAL,EAAWmJ,UAAX,GAAwB,YAAY;EAClCpJ,SAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;EACA,WAAOP,SAAS0H,gBAAhB;EACD,GAHD;;EAKA,SAAO1H,QAAP;EACD,CAhegB,CAgedC,CAhec,EAgeX6E,MAheW,CAAjB;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/index.js b/themes/docsy/assets/vendor/bootstrap/js/dist/index.js new file mode 100644 index 0000000..e36eca1 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/index.js @@ -0,0 +1,23 @@ +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): index.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ +(function ($) { + if (typeof $ === 'undefined') { + throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); + } + + var version = $.fn.jquery.split(' ')[0].split('.'); + var minMajor = 1; + var ltMajor = 2; + var minMinor = 9; + var minPatch = 1; + var maxMajor = 4; + + if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { + throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); + } +})($); +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/index.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/index.js.map new file mode 100644 index 0000000..cbf7033 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/index.js"],"names":["$","TypeError","version","fn","jquery","split","minMajor","ltMajor","minMinor","minPatch","maxMajor","Error"],"mappings":"AAaA;;;;;;AAOA,CAAC,UAACA,CAAD,EAAO;AACN,MAAI,OAAOA,CAAP,KAAa,WAAjB,EAA8B;AAC5B,UAAM,IAAIC,SAAJ,CAAc,kGAAd,CAAN;AACD;;AAED,MAAMC,UAAUF,EAAEG,EAAF,CAAKC,MAAL,CAAYC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,UAAU,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;;AAEA,MAAIR,QAAQ,CAAR,IAAaK,OAAb,IAAwBL,QAAQ,CAAR,IAAaM,QAArC,IAAiDN,QAAQ,CAAR,MAAeI,QAAf,IAA2BJ,QAAQ,CAAR,MAAeM,QAA1C,IAAsDN,QAAQ,CAAR,IAAaO,QAApH,IAAgIP,QAAQ,CAAR,KAAcQ,QAAlJ,EAA4J;AAC1J,UAAM,IAAIC,KAAJ,CAAU,8EAAV,CAAN;AACD;AACF,CAfD,EAeGX,CAfH","sourcesContent":["import $ from 'jquery'\nimport Alert from './alert'\nimport Button from './button'\nimport Carousel from './carousel'\nimport Collapse from './collapse'\nimport Dropdown from './dropdown'\nimport Modal from './modal'\nimport Popover from './popover'\nimport Scrollspy from './scrollspy'\nimport Tab from './tab'\nimport Tooltip from './tooltip'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.2): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n(($) => {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n})($)\n\nexport {\n Util,\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Popover,\n Scrollspy,\n Tab,\n Tooltip\n}\n"],"file":"index.js"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/modal.js b/themes/docsy/assets/vendor/bootstrap/js/dist/modal.js new file mode 100644 index 0000000..ff5e82d --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/modal.js @@ -0,0 +1,634 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : + typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : + (global.Modal = factory(global.jQuery,global.Util)); +}(this, (function ($,Util) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } + + return target; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): modal.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Modal = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'modal'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.modal'; + var EVENT_KEY = "." + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key + + var Default = { + backdrop: true, + keyboard: true, + focus: true, + show: true + }; + var DefaultType = { + backdrop: '(boolean|string)', + keyboard: 'boolean', + focus: 'boolean', + show: 'boolean' + }; + var Event = { + HIDE: "hide" + EVENT_KEY, + HIDDEN: "hidden" + EVENT_KEY, + SHOW: "show" + EVENT_KEY, + SHOWN: "shown" + EVENT_KEY, + FOCUSIN: "focusin" + EVENT_KEY, + RESIZE: "resize" + EVENT_KEY, + CLICK_DISMISS: "click.dismiss" + EVENT_KEY, + KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY, + MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY, + MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY, + CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY + }; + var ClassName = { + SCROLLBAR_MEASURER: 'modal-scrollbar-measure', + BACKDROP: 'modal-backdrop', + OPEN: 'modal-open', + FADE: 'fade', + SHOW: 'show' + }; + var Selector = { + DIALOG: '.modal-dialog', + DATA_TOGGLE: '[data-toggle="modal"]', + DATA_DISMISS: '[data-dismiss="modal"]', + FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', + STICKY_CONTENT: '.sticky-top' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var Modal = + /*#__PURE__*/ + function () { + function Modal(element, config) { + this._config = this._getConfig(config); + this._element = element; + this._dialog = element.querySelector(Selector.DIALOG); + this._backdrop = null; + this._isShown = false; + this._isBodyOverflowing = false; + this._ignoreBackdropClick = false; + this._scrollbarWidth = 0; + } // Getters + + + var _proto = Modal.prototype; + + // Public + _proto.toggle = function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + }; + + _proto.show = function show(relatedTarget) { + var _this = this; + + if (this._isTransitioning || this._isShown) { + return; + } + + if ($$$1(this._element).hasClass(ClassName.FADE)) { + this._isTransitioning = true; + } + + var showEvent = $$$1.Event(Event.SHOW, { + relatedTarget: relatedTarget + }); + $$$1(this._element).trigger(showEvent); + + if (this._isShown || showEvent.isDefaultPrevented()) { + return; + } + + this._isShown = true; + + this._checkScrollbar(); + + this._setScrollbar(); + + this._adjustDialog(); + + $$$1(document.body).addClass(ClassName.OPEN); + + this._setEscapeEvent(); + + this._setResizeEvent(); + + $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) { + return _this.hide(event); + }); + $$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { + $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) { + if ($$$1(event.target).is(_this._element)) { + _this._ignoreBackdropClick = true; + } + }); + }); + + this._showBackdrop(function () { + return _this._showElement(relatedTarget); + }); + }; + + _proto.hide = function hide(event) { + var _this2 = this; + + if (event) { + event.preventDefault(); + } + + if (this._isTransitioning || !this._isShown) { + return; + } + + var hideEvent = $$$1.Event(Event.HIDE); + $$$1(this._element).trigger(hideEvent); + + if (!this._isShown || hideEvent.isDefaultPrevented()) { + return; + } + + this._isShown = false; + var transition = $$$1(this._element).hasClass(ClassName.FADE); + + if (transition) { + this._isTransitioning = true; + } + + this._setEscapeEvent(); + + this._setResizeEvent(); + + $$$1(document).off(Event.FOCUSIN); + $$$1(this._element).removeClass(ClassName.SHOW); + $$$1(this._element).off(Event.CLICK_DISMISS); + $$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS); + + if (transition) { + var transitionDuration = Util.getTransitionDurationFromElement(this._element); + $$$1(this._element).one(Util.TRANSITION_END, function (event) { + return _this2._hideModal(event); + }).emulateTransitionEnd(transitionDuration); + } else { + this._hideModal(); + } + }; + + _proto.dispose = function dispose() { + $$$1.removeData(this._element, DATA_KEY); + $$$1(window, document, this._element, this._backdrop).off(EVENT_KEY); + this._config = null; + this._element = null; + this._dialog = null; + this._backdrop = null; + this._isShown = null; + this._isBodyOverflowing = null; + this._ignoreBackdropClick = null; + this._scrollbarWidth = null; + }; + + _proto.handleUpdate = function handleUpdate() { + this._adjustDialog(); + }; // Private + + + _proto._getConfig = function _getConfig(config) { + config = _objectSpread({}, Default, config); + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + }; + + _proto._showElement = function _showElement(relatedTarget) { + var _this3 = this; + + var transition = $$$1(this._element).hasClass(ClassName.FADE); + + if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + // Don't move modal's DOM position + document.body.appendChild(this._element); + } + + this._element.style.display = 'block'; + + this._element.removeAttribute('aria-hidden'); + + this._element.scrollTop = 0; + + if (transition) { + Util.reflow(this._element); + } + + $$$1(this._element).addClass(ClassName.SHOW); + + if (this._config.focus) { + this._enforceFocus(); + } + + var shownEvent = $$$1.Event(Event.SHOWN, { + relatedTarget: relatedTarget + }); + + var transitionComplete = function transitionComplete() { + if (_this3._config.focus) { + _this3._element.focus(); + } + + _this3._isTransitioning = false; + $$$1(_this3._element).trigger(shownEvent); + }; + + if (transition) { + var transitionDuration = Util.getTransitionDurationFromElement(this._element); + $$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); + } else { + transitionComplete(); + } + }; + + _proto._enforceFocus = function _enforceFocus() { + var _this4 = this; + + $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop + .on(Event.FOCUSIN, function (event) { + if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) { + _this4._element.focus(); + } + }); + }; + + _proto._setEscapeEvent = function _setEscapeEvent() { + var _this5 = this; + + if (this._isShown && this._config.keyboard) { + $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) { + if (event.which === ESCAPE_KEYCODE) { + event.preventDefault(); + + _this5.hide(); + } + }); + } else if (!this._isShown) { + $$$1(this._element).off(Event.KEYDOWN_DISMISS); + } + }; + + _proto._setResizeEvent = function _setResizeEvent() { + var _this6 = this; + + if (this._isShown) { + $$$1(window).on(Event.RESIZE, function (event) { + return _this6.handleUpdate(event); + }); + } else { + $$$1(window).off(Event.RESIZE); + } + }; + + _proto._hideModal = function _hideModal() { + var _this7 = this; + + this._element.style.display = 'none'; + + this._element.setAttribute('aria-hidden', true); + + this._isTransitioning = false; + + this._showBackdrop(function () { + $$$1(document.body).removeClass(ClassName.OPEN); + + _this7._resetAdjustments(); + + _this7._resetScrollbar(); + + $$$1(_this7._element).trigger(Event.HIDDEN); + }); + }; + + _proto._removeBackdrop = function _removeBackdrop() { + if (this._backdrop) { + $$$1(this._backdrop).remove(); + this._backdrop = null; + } + }; + + _proto._showBackdrop = function _showBackdrop(callback) { + var _this8 = this; + + var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; + + if (this._isShown && this._config.backdrop) { + this._backdrop = document.createElement('div'); + this._backdrop.className = ClassName.BACKDROP; + + if (animate) { + this._backdrop.classList.add(animate); + } + + $$$1(this._backdrop).appendTo(document.body); + $$$1(this._element).on(Event.CLICK_DISMISS, function (event) { + if (_this8._ignoreBackdropClick) { + _this8._ignoreBackdropClick = false; + return; + } + + if (event.target !== event.currentTarget) { + return; + } + + if (_this8._config.backdrop === 'static') { + _this8._element.focus(); + } else { + _this8.hide(); + } + }); + + if (animate) { + Util.reflow(this._backdrop); + } + + $$$1(this._backdrop).addClass(ClassName.SHOW); + + if (!callback) { + return; + } + + if (!animate) { + callback(); + return; + } + + var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); + $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); + } else if (!this._isShown && this._backdrop) { + $$$1(this._backdrop).removeClass(ClassName.SHOW); + + var callbackRemove = function callbackRemove() { + _this8._removeBackdrop(); + + if (callback) { + callback(); + } + }; + + if ($$$1(this._element).hasClass(ClassName.FADE)) { + var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); + + $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); + } else { + callbackRemove(); + } + } else if (callback) { + callback(); + } + }; // ---------------------------------------------------------------------- + // the following methods are used to handle overflowing modals + // todo (fat): these should probably be refactored out of modal.js + // ---------------------------------------------------------------------- + + + _proto._adjustDialog = function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + + if (!this._isBodyOverflowing && isModalOverflowing) { + this._element.style.paddingLeft = this._scrollbarWidth + "px"; + } + + if (this._isBodyOverflowing && !isModalOverflowing) { + this._element.style.paddingRight = this._scrollbarWidth + "px"; + } + }; + + _proto._resetAdjustments = function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + }; + + _proto._checkScrollbar = function _checkScrollbar() { + var rect = document.body.getBoundingClientRect(); + this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; + this._scrollbarWidth = this._getScrollbarWidth(); + }; + + _proto._setScrollbar = function _setScrollbar() { + var _this9 = this; + + if (this._isBodyOverflowing) { + // Note: DOMNode.style.paddingRight returns the actual value or '' if not set + // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set + var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)); + var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding + + $$$1(fixedContent).each(function (index, element) { + var actualPadding = element.style.paddingRight; + var calculatedPadding = $$$1(element).css('padding-right'); + $$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"); + }); // Adjust sticky content margin + + $$$1(stickyContent).each(function (index, element) { + var actualMargin = element.style.marginRight; + var calculatedMargin = $$$1(element).css('margin-right'); + $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"); + }); // Adjust body padding + + var actualPadding = document.body.style.paddingRight; + var calculatedPadding = $$$1(document.body).css('padding-right'); + $$$1(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); + } + }; + + _proto._resetScrollbar = function _resetScrollbar() { + // Restore fixed content padding + var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)); + $$$1(fixedContent).each(function (index, element) { + var padding = $$$1(element).data('padding-right'); + $$$1(element).removeData('padding-right'); + element.style.paddingRight = padding ? padding : ''; + }); // Restore sticky content + + var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT)); + $$$1(elements).each(function (index, element) { + var margin = $$$1(element).data('margin-right'); + + if (typeof margin !== 'undefined') { + $$$1(element).css('margin-right', margin).removeData('margin-right'); + } + }); // Restore body padding + + var padding = $$$1(document.body).data('padding-right'); + $$$1(document.body).removeData('padding-right'); + document.body.style.paddingRight = padding ? padding : ''; + }; + + _proto._getScrollbarWidth = function _getScrollbarWidth() { + // thx d.walsh + var scrollDiv = document.createElement('div'); + scrollDiv.className = ClassName.SCROLLBAR_MEASURER; + document.body.appendChild(scrollDiv); + var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return scrollbarWidth; + }; // Static + + + Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { + return this.each(function () { + var data = $$$1(this).data(DATA_KEY); + + var _config = _objectSpread({}, Default, $$$1(this).data(), typeof config === 'object' && config ? config : {}); + + if (!data) { + data = new Modal(this, _config); + $$$1(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](relatedTarget); + } else if (_config.show) { + data.show(relatedTarget); + } + }); + }; + + _createClass(Modal, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }, { + key: "Default", + get: function get() { + return Default; + } + }]); + + return Modal; + }(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + + $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + var _this10 = this; + + var target; + var selector = Util.getSelectorFromElement(this); + + if (selector) { + target = document.querySelector(selector); + } + + var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $$$1(target).data(), $$$1(this).data()); + + if (this.tagName === 'A' || this.tagName === 'AREA') { + event.preventDefault(); + } + + var $target = $$$1(target).one(Event.SHOW, function (showEvent) { + if (showEvent.isDefaultPrevented()) { + // Only register focus restorer if modal will actually get shown + return; + } + + $target.one(Event.HIDDEN, function () { + if ($$$1(_this10).is(':visible')) { + _this10.focus(); + } + }); + }); + + Modal._jQueryInterface.call($$$1(target), config, this); + }); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $$$1.fn[NAME] = Modal._jQueryInterface; + $$$1.fn[NAME].Constructor = Modal; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Modal._jQueryInterface; + }; + + return Modal; + }($); + + return Modal; + +}))); +//# sourceMappingURL=modal.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/modal.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/modal.js.map new file mode 100644 index 0000000..6585a60 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/modal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modal.js","sources":["../src/modal.js"],"sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Modal = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'modal'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.modal'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n\n const Default = {\n backdrop : true,\n keyboard : true,\n focus : true,\n show : true\n }\n\n const DefaultType = {\n backdrop : '(boolean|string)',\n keyboard : 'boolean',\n focus : 'boolean',\n show : 'boolean'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n RESIZE : `resize${EVENT_KEY}`,\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,\n MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,\n MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SCROLLBAR_MEASURER : 'modal-scrollbar-measure',\n BACKDROP : 'modal-backdrop',\n OPEN : 'modal-open',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n DIALOG : '.modal-dialog',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT : '.sticky-top'\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Modal {\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n this._dialog = element.querySelector(Selector.DIALOG)\n this._backdrop = null\n this._isShown = false\n this._isBodyOverflowing = false\n this._ignoreBackdropClick = false\n this._scrollbarWidth = 0\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isTransitioning || this._isShown) {\n return\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n }\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget\n })\n\n $(this._element).trigger(showEvent)\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = true\n\n this._checkScrollbar()\n this._setScrollbar()\n\n this._adjustDialog()\n\n $(document.body).addClass(ClassName.OPEN)\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n (event) => this.hide(event)\n )\n\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {\n $(this._element).one(Event.MOUSEUP_DISMISS, (event) => {\n if ($(event.target).is(this._element)) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n if (this._isTransitioning || !this._isShown) {\n return\n }\n\n const hideEvent = $.Event(Event.HIDE)\n\n $(this._element).trigger(hideEvent)\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = false\n const transition = $(this._element).hasClass(ClassName.FADE)\n\n if (transition) {\n this._isTransitioning = true\n }\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(document).off(Event.FOCUSIN)\n\n $(this._element).removeClass(ClassName.SHOW)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n\n if (transition) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, (event) => this._hideModal(event))\n .emulateTransitionEnd(transitionDuration)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n $(window, document, this._element, this._backdrop).off(EVENT_KEY)\n\n this._config = null\n this._element = null\n this._dialog = null\n this._backdrop = null\n this._isShown = null\n this._isBodyOverflowing = null\n this._ignoreBackdropClick = null\n this._scrollbarWidth = null\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _showElement(relatedTarget) {\n const transition = $(this._element).hasClass(ClassName.FADE)\n\n if (!this._element.parentNode ||\n this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.scrollTop = 0\n\n if (transition) {\n Util.reflow(this._element)\n }\n\n $(this._element).addClass(ClassName.SHOW)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\n this._isTransitioning = false\n $(this._element).trigger(shownEvent)\n }\n\n if (transition) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._dialog)\n .one(Util.TRANSITION_END, transitionComplete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n transitionComplete()\n }\n }\n\n _enforceFocus() {\n $(document)\n .off(Event.FOCUSIN) // Guard against infinite focus loop\n .on(Event.FOCUSIN, (event) => {\n if (document !== event.target &&\n this._element !== event.target &&\n $(this._element).has(event.target).length === 0) {\n this._element.focus()\n }\n })\n }\n\n _setEscapeEvent() {\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, (event) => {\n if (event.which === ESCAPE_KEYCODE) {\n event.preventDefault()\n this.hide()\n }\n })\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n $(window).on(Event.RESIZE, (event) => this.handleUpdate(event))\n } else {\n $(window).off(Event.RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._isTransitioning = false\n this._showBackdrop(() => {\n $(document.body).removeClass(ClassName.OPEN)\n this._resetAdjustments()\n this._resetScrollbar()\n $(this._element).trigger(Event.HIDDEN)\n })\n }\n\n _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove()\n this._backdrop = null\n }\n }\n\n _showBackdrop(callback) {\n const animate = $(this._element).hasClass(ClassName.FADE)\n ? ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div')\n this._backdrop.className = ClassName.BACKDROP\n\n if (animate) {\n this._backdrop.classList.add(animate)\n }\n\n $(this._backdrop).appendTo(document.body)\n\n $(this._element).on(Event.CLICK_DISMISS, (event) => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n if (event.target !== event.currentTarget) {\n return\n }\n if (this._config.backdrop === 'static') {\n this._element.focus()\n } else {\n this.hide()\n }\n })\n\n if (animate) {\n Util.reflow(this._backdrop)\n }\n\n $(this._backdrop).addClass(ClassName.SHOW)\n\n if (!callback) {\n return\n }\n\n if (!animate) {\n callback()\n return\n }\n\n const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callback)\n .emulateTransitionEnd(backdropTransitionDuration)\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW)\n\n const callbackRemove = () => {\n this._removeBackdrop()\n if (callback) {\n callback()\n }\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callbackRemove)\n .emulateTransitionEnd(backdropTransitionDuration)\n } else {\n callbackRemove()\n }\n } else if (callback) {\n callback()\n }\n }\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n _adjustDialog() {\n const isModalOverflowing =\n this._element.scrollHeight > document.documentElement.clientHeight\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = `${this._scrollbarWidth}px`\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = `${this._scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n _checkScrollbar() {\n const rect = document.body.getBoundingClientRect()\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth\n this._scrollbarWidth = this._getScrollbarWidth()\n }\n\n _setScrollbar() {\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))\n const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))\n\n // Adjust fixed content padding\n $(fixedContent).each((index, element) => {\n const actualPadding = element.style.paddingRight\n const calculatedPadding = $(element).css('padding-right')\n $(element)\n .data('padding-right', actualPadding)\n .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n })\n\n // Adjust sticky content margin\n $(stickyContent).each((index, element) => {\n const actualMargin = element.style.marginRight\n const calculatedMargin = $(element).css('margin-right')\n $(element)\n .data('margin-right', actualMargin)\n .css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)\n })\n\n // Adjust body padding\n const actualPadding = document.body.style.paddingRight\n const calculatedPadding = $(document.body).css('padding-right')\n $(document.body)\n .data('padding-right', actualPadding)\n .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n }\n }\n\n _resetScrollbar() {\n // Restore fixed content padding\n const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))\n $(fixedContent).each((index, element) => {\n const padding = $(element).data('padding-right')\n $(element).removeData('padding-right')\n element.style.paddingRight = padding ? padding : ''\n })\n\n // Restore sticky content\n const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`))\n $(elements).each((index, element) => {\n const margin = $(element).data('margin-right')\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right')\n }\n })\n\n // Restore body padding\n const padding = $(document.body).data('padding-right')\n $(document.body).removeData('padding-right')\n document.body.style.paddingRight = padding ? padding : ''\n }\n\n _getScrollbarWidth() { // thx d.walsh\n const scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\n document.body.removeChild(scrollDiv)\n return scrollbarWidth\n }\n\n // Static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = {\n ...Default,\n ...$(this).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data) {\n data = new Modal(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config](relatedTarget)\n } else if (_config.show) {\n data.show(relatedTarget)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n let target\n const selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = document.querySelector(selector)\n }\n\n const config = $(target).data(DATA_KEY)\n ? 'toggle' : {\n ...$(target).data(),\n ...$(this).data()\n }\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault()\n }\n\n const $target = $(target).one(Event.SHOW, (showEvent) => {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return\n }\n\n $target.one(Event.HIDDEN, () => {\n if ($(this).is(':visible')) {\n this.focus()\n }\n })\n })\n\n Modal._jQueryInterface.call($(target), config, this)\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Modal._jQueryInterface\n $.fn[NAME].Constructor = Modal\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Modal._jQueryInterface\n }\n\n return Modal\n})($)\n\nexport default Modal\n"],"names":["Modal","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ESCAPE_KEYCODE","Default","backdrop","keyboard","focus","show","DefaultType","Event","HIDE","HIDDEN","SHOW","SHOWN","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","CLICK_DATA_API","ClassName","SCROLLBAR_MEASURER","BACKDROP","OPEN","FADE","Selector","DIALOG","DATA_TOGGLE","DATA_DISMISS","FIXED_CONTENT","STICKY_CONTENT","element","config","_config","_getConfig","_element","_dialog","querySelector","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_scrollbarWidth","toggle","relatedTarget","hide","_isTransitioning","hasClass","showEvent","trigger","isDefaultPrevented","_checkScrollbar","_setScrollbar","_adjustDialog","document","body","addClass","_setEscapeEvent","_setResizeEvent","on","event","one","target","is","_showBackdrop","_showElement","preventDefault","hideEvent","transition","off","removeClass","transitionDuration","Util","getTransitionDurationFromElement","TRANSITION_END","_hideModal","emulateTransitionEnd","dispose","removeData","window","handleUpdate","typeCheckConfig","parentNode","nodeType","Node","ELEMENT_NODE","appendChild","style","display","removeAttribute","scrollTop","reflow","_enforceFocus","shownEvent","transitionComplete","has","length","which","setAttribute","_resetAdjustments","_resetScrollbar","_removeBackdrop","remove","callback","animate","createElement","className","classList","add","appendTo","currentTarget","backdropTransitionDuration","callbackRemove","isModalOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","paddingRight","rect","getBoundingClientRect","left","right","innerWidth","_getScrollbarWidth","fixedContent","slice","call","querySelectorAll","stickyContent","each","index","actualPadding","calculatedPadding","css","data","parseFloat","actualMargin","marginRight","calculatedMargin","padding","elements","margin","scrollDiv","scrollbarWidth","width","clientWidth","removeChild","_jQueryInterface","TypeError","selector","getSelectorFromElement","tagName","$target","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AtjBW,CAAd;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/popover.js b/themes/docsy/assets/vendor/bootstrap/js/dist/popover.js new file mode 100644 index 0000000..331b814 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/popover.js @@ -0,0 +1,266 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) : + typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) : + (global.Popover = factory(global.jQuery,global.Tooltip)); +}(this, (function ($,Tooltip) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Tooltip = Tooltip && Tooltip.hasOwnProperty('default') ? Tooltip['default'] : Tooltip; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } + + return target; + } + + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): popover.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Popover = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'popover'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.popover'; + var EVENT_KEY = "." + DATA_KEY; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var CLASS_PREFIX = 'bs-popover'; + var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); + + var Default = _objectSpread({}, Tooltip.Default, { + placement: 'right', + trigger: 'click', + content: '', + template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' + }); + + var DefaultType = _objectSpread({}, Tooltip.DefaultType, { + content: '(string|element|function)' + }); + + var ClassName = { + FADE: 'fade', + SHOW: 'show' + }; + var Selector = { + TITLE: '.popover-header', + CONTENT: '.popover-body' + }; + var Event = { + HIDE: "hide" + EVENT_KEY, + HIDDEN: "hidden" + EVENT_KEY, + SHOW: "show" + EVENT_KEY, + SHOWN: "shown" + EVENT_KEY, + INSERTED: "inserted" + EVENT_KEY, + CLICK: "click" + EVENT_KEY, + FOCUSIN: "focusin" + EVENT_KEY, + FOCUSOUT: "focusout" + EVENT_KEY, + MOUSEENTER: "mouseenter" + EVENT_KEY, + MOUSELEAVE: "mouseleave" + EVENT_KEY + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var Popover = + /*#__PURE__*/ + function (_Tooltip) { + _inheritsLoose(Popover, _Tooltip); + + function Popover() { + return _Tooltip.apply(this, arguments) || this; + } + + var _proto = Popover.prototype; + + // Overrides + _proto.isWithContent = function isWithContent() { + return this.getTitle() || this._getContent(); + }; + + _proto.addAttachmentClass = function addAttachmentClass(attachment) { + $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); + }; + + _proto.getTipElement = function getTipElement() { + this.tip = this.tip || $$$1(this.config.template)[0]; + return this.tip; + }; + + _proto.setContent = function setContent() { + var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events + + this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); + + var content = this._getContent(); + + if (typeof content === 'function') { + content = content.call(this.element); + } + + this.setElementContent($tip.find(Selector.CONTENT), content); + $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW); + }; // Private + + + _proto._getContent = function _getContent() { + return this.element.getAttribute('data-content') || this.config.content; + }; + + _proto._cleanTipClass = function _cleanTipClass() { + var $tip = $$$1(this.getTipElement()); + var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); + + if (tabClass !== null && tabClass.length > 0) { + $tip.removeClass(tabClass.join('')); + } + }; // Static + + + Popover._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $$$1(this).data(DATA_KEY); + + var _config = typeof config === 'object' ? config : null; + + if (!data && /destroy|hide/.test(config)) { + return; + } + + if (!data) { + data = new Popover(this, _config); + $$$1(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + _createClass(Popover, null, [{ + key: "VERSION", + // Getters + get: function get() { + return VERSION; + } + }, { + key: "Default", + get: function get() { + return Default; + } + }, { + key: "NAME", + get: function get() { + return NAME; + } + }, { + key: "DATA_KEY", + get: function get() { + return DATA_KEY; + } + }, { + key: "Event", + get: function get() { + return Event; + } + }, { + key: "EVENT_KEY", + get: function get() { + return EVENT_KEY; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType; + } + }]); + + return Popover; + }(Tooltip); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + + $$$1.fn[NAME] = Popover._jQueryInterface; + $$$1.fn[NAME].Constructor = Popover; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Popover._jQueryInterface; + }; + + return Popover; + }($); + + return Popover; + +}))); +//# sourceMappingURL=popover.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/popover.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/popover.js.map new file mode 100644 index 0000000..ea26307 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/popover.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popover.js","sources":["../src/popover.js"],"sourcesContent":["import $ from 'jquery'\nimport Tooltip from './tooltip'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Popover = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'popover'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.popover'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const CLASS_PREFIX = 'bs-popover'\n const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\n\n const Default = {\n ...Tooltip.Default,\n placement : 'right',\n trigger : 'click',\n content : '',\n template : '<div class=\"popover\" role=\"tooltip\">' +\n '<div class=\"arrow\"></div>' +\n '<h3 class=\"popover-header\"></h3>' +\n '<div class=\"popover-body\"></div></div>'\n }\n\n const DefaultType = {\n ...Tooltip.DefaultType,\n content : '(string|element|function)'\n }\n\n const ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n TITLE : '.popover-header',\n CONTENT : '.popover-body'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Popover extends Tooltip {\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n this.tip = this.tip || $(this.config.template)[0]\n return this.tip\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n // We use append for html objects to maintain js events\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle())\n let content = this._getContent()\n if (typeof content === 'function') {\n content = content.call(this.element)\n }\n this.setElementContent($tip.find(Selector.CONTENT), content)\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n // Private\n\n _getContent() {\n return this.element.getAttribute('data-content') ||\n this.config.content\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data && /destroy|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Popover(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Popover._jQueryInterface\n $.fn[NAME].Constructor = Popover\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Popover._jQueryInterface\n }\n\n return Popover\n})($)\n\nexport default Popover\n"],"names":["Popover","$","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","CLASS_PREFIX","BSCLS_PREFIX_REGEX","RegExp","Default","Tooltip","placement","trigger","content","template","DefaultType","ClassName","FADE","SHOW","Selector","TITLE","CONTENT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","isWithContent","getTitle","_getContent","addAttachmentClass","attachment","getTipElement","addClass","tip","config","setContent","$tip","setElementContent","find","call","element","removeClass","getAttribute","_cleanTipClass","tabClass","attr","match","length","join","_jQueryInterface","each","data","_config","test","TypeError","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;;;;;;;EAOA,IAAMA,UAAW,UAACC,IAAD,EAAO;EACtB;;;;;EAMA,MAAMC,OAAsB,SAA5B;EACA,MAAMC,UAAsB,OAA5B;EACA,MAAMC,WAAsB,YAA5B;EACA,MAAMC,kBAA0BD,QAAhC;EACA,MAAME,qBAAsBL,KAAEM,EAAF,CAAKL,IAAL,CAA5B;EACA,MAAMM,eAAsB,YAA5B;EACA,MAAMC,qBAAsB,IAAIC,MAAJ,aAAqBF,YAArB,WAAyC,GAAzC,CAA5B;;EAEA,MAAMG,4BACDC,QAAQD,OADP;EAEJE,eAAY,OAFR;EAGJC,aAAY,OAHR;EAIJC,aAAY,EAJR;EAKJC,cAAY,yCACA,2BADA,GAE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,YAAI,OAAOjB,MAAP,KAAkB,QAAtB,EAAgC;EAC9B,cAAI,OAAOiB,KAAKjB,MAAL,CAAP,KAAwB,WAA5B,EAAyC;EACvC,kBAAM,IAAIoB,SAAJ,wBAAkCpB,MAAlC,QAAN;EACD;;EACDiB,eAAKjB,MAAL;EACD;EACF,OAnBM,CAAP;EAoBD,KA9JmB;;EAAA;EAAA;EA6DpB;EA7DoB,0BA+DC;EACnB,eAAOvC,OAAP;EACD;EAjEmB;EAAA;EAAA,0BAmEC;EACnB,eAAOQ,OAAP;EACD;EArEmB;EAAA;EAAA,0BAuEF;EAChB,eAAOT,IAAP;EACD;EAzEmB;EAAA;EAAA,0BA2EE;EACpB,eAAOE,QAAP;EACD;EA7EmB;EAAA;EAAA,0BA+ED;EACjB,eAAOoB,KAAP;EACD;EAjFmB;EAAA;EAAA,0BAmFG;EACrB,eAAOnB,SAAP;EACD;EArFmB;EAAA;EAAA,0BAuFK;EACvB,eAAOY,WAAP;EACD;EAzFmB;;EAAA;EAAA,IA4DAL,OA5DA;EAiKtB;;;;;;;EAMAX,OAAEM,EAAF,CAAKL,IAAL,IAAaF,QAAQyD,gBAArB;EACAxD,OAAEM,EAAF,CAAKL,IAAL,EAAW6D,WAAX,GAAyB/D,OAAzB;;EACAC,OAAEM,EAAF,CAAKL,IAAL,EAAW8D,UAAX,GAAwB,YAAY;EAClC/D,SAAEM,EAAF,CAAKL,IAAL,IAAaI,kBAAb;EACA,WAAON,QAAQyD,gBAAf;EACD,GAHD;;EAKA,SAAOzD,OAAP;EACD,CA/Ke,CA+KbC,CA/Ka,CAAhB;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/scrollspy.js b/themes/docsy/assets/vendor/bootstrap/js/dist/scrollspy.js new file mode 100644 index 0000000..177369b --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/scrollspy.js @@ -0,0 +1,379 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : + typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : + (global.ScrollSpy = factory(global.jQuery,global.Util)); +}(this, (function ($,Util) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } + + return target; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): scrollspy.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var ScrollSpy = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'scrollspy'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.scrollspy'; + var EVENT_KEY = "." + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var Default = { + offset: 10, + method: 'auto', + target: '' + }; + var DefaultType = { + offset: 'number', + method: 'string', + target: '(string|element)' + }; + var Event = { + ACTIVATE: "activate" + EVENT_KEY, + SCROLL: "scroll" + EVENT_KEY, + LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY + }; + var ClassName = { + DROPDOWN_ITEM: 'dropdown-item', + DROPDOWN_MENU: 'dropdown-menu', + ACTIVE: 'active' + }; + var Selector = { + DATA_SPY: '[data-spy="scroll"]', + ACTIVE: '.active', + NAV_LIST_GROUP: '.nav, .list-group', + NAV_LINKS: '.nav-link', + NAV_ITEMS: '.nav-item', + LIST_ITEMS: '.list-group-item', + DROPDOWN: '.dropdown', + DROPDOWN_ITEMS: '.dropdown-item', + DROPDOWN_TOGGLE: '.dropdown-toggle' + }; + var OffsetMethod = { + OFFSET: 'offset', + POSITION: 'position' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var ScrollSpy = + /*#__PURE__*/ + function () { + function ScrollSpy(element, config) { + var _this = this; + + this._element = element; + this._scrollElement = element.tagName === 'BODY' ? window : element; + this._config = this._getConfig(config); + this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS); + this._offsets = []; + this._targets = []; + this._activeTarget = null; + this._scrollHeight = 0; + $$$1(this._scrollElement).on(Event.SCROLL, function (event) { + return _this._process(event); + }); + this.refresh(); + + this._process(); + } // Getters + + + var _proto = ScrollSpy.prototype; + + // Public + _proto.refresh = function refresh() { + var _this2 = this; + + 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 = []; + this._targets = []; + this._scrollHeight = this._getScrollHeight(); + var targets = [].slice.call(document.querySelectorAll(this._selector)); + targets.map(function (element) { + var target; + var targetSelector = Util.getSelectorFromElement(element); + + if (targetSelector) { + target = document.querySelector(targetSelector); + } + + if (target) { + var targetBCR = target.getBoundingClientRect(); + + if (targetBCR.width || targetBCR.height) { + // TODO (fat): remove sketch reliance on jQuery position/offset + return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector]; + } + } + + return null; + }).filter(function (item) { + return item; + }).sort(function (a, b) { + return a[0] - b[0]; + }).forEach(function (item) { + _this2._offsets.push(item[0]); + + _this2._targets.push(item[1]); + }); + }; + + _proto.dispose = function dispose() { + $$$1.removeData(this._element, DATA_KEY); + $$$1(this._scrollElement).off(EVENT_KEY); + this._element = null; + this._scrollElement = null; + this._config = null; + this._selector = null; + this._offsets = null; + this._targets = null; + this._activeTarget = null; + this._scrollHeight = null; + }; // Private + + + _proto._getConfig = function _getConfig(config) { + config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {}); + + if (typeof config.target !== 'string') { + var id = $$$1(config.target).attr('id'); + + if (!id) { + id = Util.getUID(NAME); + $$$1(config.target).attr('id', id); + } + + config.target = "#" + id; + } + + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + }; + + _proto._getScrollTop = function _getScrollTop() { + return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; + }; + + _proto._getScrollHeight = function _getScrollHeight() { + return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); + }; + + _proto._getOffsetHeight = function _getOffsetHeight() { + return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; + }; + + _proto._process = function _process() { + var scrollTop = this._getScrollTop() + this._config.offset; + + var scrollHeight = this._getScrollHeight(); + + var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); + + if (this._scrollHeight !== scrollHeight) { + this.refresh(); + } + + if (scrollTop >= maxScroll) { + var target = this._targets[this._targets.length - 1]; + + if (this._activeTarget !== target) { + this._activate(target); + } + + return; + } + + if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { + this._activeTarget = null; + + this._clear(); + + return; + } + + var offsetLength = this._offsets.length; + + for (var i = offsetLength; i--;) { + var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); + + if (isActiveTarget) { + this._activate(this._targets[i]); + } + } + }; + + _proto._activate = function _activate(target) { + this._activeTarget = target; + + this._clear(); + + var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style + + + queries = queries.map(function (selector) { + return selector + "[data-target=\"" + target + "\"]," + (selector + "[href=\"" + target + "\"]"); + }); + var $link = $$$1([].slice.call(document.querySelectorAll(queries.join(',')))); + + if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { + $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); + $link.addClass(ClassName.ACTIVE); + } else { + // Set triggered link as active + $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active + // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor + + $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item + + $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE); + } + + $$$1(this._scrollElement).trigger(Event.ACTIVATE, { + relatedTarget: target + }); + }; + + _proto._clear = function _clear() { + var nodes = [].slice.call(document.querySelectorAll(this._selector)); + $$$1(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + }; // Static + + + ScrollSpy._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $$$1(this).data(DATA_KEY); + + var _config = typeof config === 'object' && config; + + if (!data) { + data = new ScrollSpy(this, _config); + $$$1(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + _createClass(ScrollSpy, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }, { + key: "Default", + get: function get() { + return Default; + } + }]); + + return ScrollSpy; + }(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + + $$$1(window).on(Event.LOAD_DATA_API, function () { + var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY)); + var scrollSpysLength = scrollSpys.length; + + for (var i = scrollSpysLength; i--;) { + var $spy = $$$1(scrollSpys[i]); + + ScrollSpy._jQueryInterface.call($spy, $spy.data()); + } + }); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $$$1.fn[NAME] = ScrollSpy._jQueryInterface; + $$$1.fn[NAME].Constructor = ScrollSpy; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return ScrollSpy._jQueryInterface; + }; + + return ScrollSpy; + }($); + + return ScrollSpy; + +}))); +//# sourceMappingURL=scrollspy.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/scrollspy.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/scrollspy.js.map new file mode 100644 index 0000000..8db2171 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/scrollspy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scrollspy.js","sources":["../src/scrollspy.js"],"sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst ScrollSpy = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'scrollspy'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.scrollspy'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n offset : 10,\n method : 'auto',\n target : ''\n }\n\n const DefaultType = {\n offset : 'number',\n method : 'string',\n target : '(string|element)'\n }\n\n const Event = {\n ACTIVATE : `activate${EVENT_KEY}`,\n SCROLL : `scroll${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DROPDOWN_ITEM : 'dropdown-item',\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active'\n }\n\n const Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n NAV_LIST_GROUP : '.nav, .list-group',\n NAV_LINKS : '.nav-link',\n NAV_ITEMS : '.nav-item',\n LIST_ITEMS : '.list-group-item',\n DROPDOWN : '.dropdown',\n DROPDOWN_ITEMS : '.dropdown-item',\n DROPDOWN_TOGGLE : '.dropdown-toggle'\n }\n\n const OffsetMethod = {\n OFFSET : 'offset',\n POSITION : 'position'\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class ScrollSpy {\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},` +\n `${this._config.target} ${Selector.LIST_ITEMS},` +\n `${this._config.target} ${Selector.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))\n\n this.refresh()\n this._process()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n refresh() {\n const autoMethod = this._scrollElement === this._scrollElement.window\n ? OffsetMethod.OFFSET : OffsetMethod.POSITION\n\n const offsetMethod = this._config.method === 'auto'\n ? autoMethod : this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION\n ? this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = [].slice.call(document.querySelectorAll(this._selector))\n\n targets\n .map((element) => {\n let target\n const targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = document.querySelector(targetSelector)\n }\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\n ]\n }\n }\n return null\n })\n .filter((item) => item)\n .sort((a, b) => a[0] - b[0])\n .forEach((item) => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._scrollElement).off(EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.target !== 'string') {\n let id = $(config.target).attr('id')\n if (!id) {\n id = Util.getUID(NAME)\n $(config.target).attr('id', id)\n }\n config.target = `#${id}`\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window\n ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window\n ? window.innerHeight : this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset +\n scrollHeight -\n this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n const offsetLength = this._offsets.length\n for (let i = offsetLength; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i] &&\n scrollTop >= this._offsets[i] &&\n (typeof this._offsets[i + 1] === 'undefined' ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n let queries = this._selector.split(',')\n // eslint-disable-next-line arrow-body-style\n queries = queries.map((selector) => {\n return `${selector}[data-target=\"${target}\"],` +\n `${selector}[href=\"${target}\"]`\n })\n\n const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n $link.addClass(ClassName.ACTIVE)\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE)\n // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n $link.parents(Selector.NAV_LIST_GROUP).prev(`${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`).addClass(ClassName.ACTIVE)\n // Handle special case when .nav-link is inside .nav-item\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE)\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n })\n }\n\n _clear() {\n const nodes = [].slice.call(document.querySelectorAll(this._selector))\n $(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE)\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data) {\n data = new ScrollSpy(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(window).on(Event.LOAD_DATA_API, () => {\n const scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY))\n\n const scrollSpysLength = scrollSpys.length\n for (let i = scrollSpysLength; i--;) {\n const $spy = $(scrollSpys[i])\n ScrollSpy._jQueryInterface.call($spy, $spy.data())\n }\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = ScrollSpy._jQueryInterface\n $.fn[NAME].Constructor = ScrollSpy\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ScrollSpy._jQueryInterface\n }\n\n return ScrollSpy\n})($)\n\nexport default ScrollSpy\n"],"names":["ScrollSpy","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","Default","offset","method","target","DefaultType","Event","ACTIVATE","SCROLL","LOAD_DATA_API","ClassName","DROPDOWN_ITEM","DROPDOWN_MENU","ACTIVE","Selector","DATA_SPY","NAV_LIST_GROUP","NAV_LINKS","NAV_ITEMS","LIST_ITEMS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","element","config","_element","_scrollElement","tagName","window","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","on","event","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","slice","call","document","querySelectorAll","map","targetSelector","Util","getSelectorFromElement","querySelector","targetBCR","getBoundingClientRect","width","height","top","filter","item","sort","a","b","forEach","push","dispose","removeData","off","id","attr","getUID","typeCheckConfig","pageYOffset","scrollTop","scrollHeight","Math","max","body","documentElement","_getOffsetHeight","innerHeight","maxScroll","length","_activate","_clear","offsetLength","i","isActiveTarget","queries","split","selector","$link","join","hasClass","closest","find","addClass","parents","prev","children","trigger","relatedTarget","nodes","removeClass","_jQueryInterface","each","data","TypeError","scrollSpys","scrollSpysLength","$spy","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;;;;;;;EAOA,IAAMA,YAAa,UAACC,IAAD,EAAO;EACxB;;;;;EAMA,MAAMC,OAAqB,WAA3B;EACA,MAAMC,UAAqB,OAA3B;EACA,MAAMC,WAAqB,cAA3B;EACA,MAAMC,kBAAyBD,QAA/B;EACA,MAAME,eAAqB,WAA3B;EACA,MAAMC,qBAAqBN,KAAEO,EAAF,CAAKN,IAAL,CAA3B;EAEA,MAAMO,UAAU;EACdC,YAAS,EADK;EAEdC,YAAS,MAFK;EAGdC,YAAS;EAHK,GAAhB;EAMA,MAAMC,cAAc;EAClBH,YAAS,QADS;EAElBC,YAAS,QAFS;EAGlBC,YAAS;EAHS,GAApB;EAMA,MAAME,QAAQ;EACZC,2BAA2BV,SADf;EAEZW,uBAAyBX,SAFb;EAGZY,4BAAuBZ,SAAvB,GAAmCC;EAHvB,GAAd;EAMA,MAAMY,YAAY;EAChBC,mBAAgB,eADA;EAEhBC,mBAAgB,eAFA;EAGhBC,YAAgB;EAHA,GAAlB;EAMA,MAAMC,WAAW;EACfC,cAAkB,qBADH;EAEfF,YAAkB,SAFH;EAGfG,oBAAkB,mBAHH;EAIfC,eAAkB,WAJH;EAKfC,eAAkB,WALH;EAMfC,gBAAkB,kBANH;EAOfC,cAAkB,WAPH;EAQfC,oBAAkB,gBARH;EASfC,qBAAkB;EATH,GAAjB;EAYA,MAAMC,eAAe;EACnBC,YAAW,QADQ;EAEnBC,cAAW;EAGb;;;;;;EALqB,GAArB;;EAlDwB,MA6DlBjC,SA7DkB;EAAA;EAAA;EA8DtB,uB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AII,IAAIuB,gBAAb,EAA+BvB,GAA/B,GAAqC;EACnC,UAAMwB,OAAO1H,KAAEwH,WAAWtB,CAAX,CAAF,CAAb;;EACAnG,gBAAUqH,gBAAV,CAA2B3D,IAA3B,CAAgCiE,IAAhC,EAAsCA,KAAKJ,IAAL,EAAtC;EACD;EACF,GARD;EAUA;;;;;;EAMAtH,OAAEO,EAAF,CAAKN,IAAL,IAAaF,UAAUqH,gBAAvB;EACApH,OAAEO,EAAF,CAAKN,IAAL,EAAW0H,WAAX,GAAyB5H,SAAzB;;EACAC,OAAEO,EAAF,CAAKN,IAAL,EAAW2H,UAAX,GAAwB,YAAY;EAClC5H,SAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;EACA,WAAOP,UAAUqH,gBAAjB;EACD,GAHD;;EAKA,SAAOrH,SAAP;EACD,CA/TiB,CA+TfC,CA/Te,CAAlB;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/tab.js b/themes/docsy/assets/vendor/bootstrap/js/dist/tab.js new file mode 100644 index 0000000..0c7efd1 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/tab.js @@ -0,0 +1,278 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : + typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : + (global.Tab = factory(global.jQuery,global.Util)); +}(this, (function ($,Util) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): tab.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Tab = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'tab'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.tab'; + var EVENT_KEY = "." + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var Event = { + HIDE: "hide" + EVENT_KEY, + HIDDEN: "hidden" + EVENT_KEY, + SHOW: "show" + EVENT_KEY, + SHOWN: "shown" + EVENT_KEY, + CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY + }; + var ClassName = { + DROPDOWN_MENU: 'dropdown-menu', + ACTIVE: 'active', + DISABLED: 'disabled', + FADE: 'fade', + SHOW: 'show' + }; + var Selector = { + DROPDOWN: '.dropdown', + NAV_LIST_GROUP: '.nav, .list-group', + ACTIVE: '.active', + ACTIVE_UL: '> li > .active', + DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', + DROPDOWN_TOGGLE: '.dropdown-toggle', + DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var Tab = + /*#__PURE__*/ + function () { + function Tab(element) { + this._element = element; + } // Getters + + + var _proto = Tab.prototype; + + // Public + _proto.show = function show() { + var _this = this; + + if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) { + return; + } + + var target; + var previous; + var listElement = $$$1(this._element).closest(Selector.NAV_LIST_GROUP)[0]; + var selector = Util.getSelectorFromElement(this._element); + + if (listElement) { + var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE; + previous = $$$1.makeArray($$$1(listElement).find(itemSelector)); + previous = previous[previous.length - 1]; + } + + var hideEvent = $$$1.Event(Event.HIDE, { + relatedTarget: this._element + }); + var showEvent = $$$1.Event(Event.SHOW, { + relatedTarget: previous + }); + + if (previous) { + $$$1(previous).trigger(hideEvent); + } + + $$$1(this._element).trigger(showEvent); + + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { + return; + } + + if (selector) { + target = document.querySelector(selector); + } + + this._activate(this._element, listElement); + + var complete = function complete() { + var hiddenEvent = $$$1.Event(Event.HIDDEN, { + relatedTarget: _this._element + }); + var shownEvent = $$$1.Event(Event.SHOWN, { + relatedTarget: previous + }); + $$$1(previous).trigger(hiddenEvent); + $$$1(_this._element).trigger(shownEvent); + }; + + if (target) { + this._activate(target, target.parentNode, complete); + } else { + complete(); + } + }; + + _proto.dispose = function dispose() { + $$$1.removeData(this._element, DATA_KEY); + this._element = null; + }; // Private + + + _proto._activate = function _activate(element, container, callback) { + var _this2 = this; + + var activeElements; + + if (container.nodeName === 'UL') { + activeElements = $$$1(container).find(Selector.ACTIVE_UL); + } else { + activeElements = $$$1(container).children(Selector.ACTIVE); + } + + var active = activeElements[0]; + var isTransitioning = callback && active && $$$1(active).hasClass(ClassName.FADE); + + var complete = function complete() { + return _this2._transitionComplete(element, active, callback); + }; + + if (active && isTransitioning) { + var transitionDuration = Util.getTransitionDurationFromElement(active); + $$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + } else { + complete(); + } + }; + + _proto._transitionComplete = function _transitionComplete(element, active, callback) { + if (active) { + $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE); + var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; + + if (dropdownChild) { + $$$1(dropdownChild).removeClass(ClassName.ACTIVE); + } + + if (active.getAttribute('role') === 'tab') { + active.setAttribute('aria-selected', false); + } + } + + $$$1(element).addClass(ClassName.ACTIVE); + + if (element.getAttribute('role') === 'tab') { + element.setAttribute('aria-selected', true); + } + + Util.reflow(element); + $$$1(element).addClass(ClassName.SHOW); + + if (element.parentNode && $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { + var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0]; + + if (dropdownElement) { + var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE)); + $$$1(dropdownToggleList).addClass(ClassName.ACTIVE); + } + + element.setAttribute('aria-expanded', true); + } + + if (callback) { + callback(); + } + }; // Static + + + Tab._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var $this = $$$1(this); + var data = $this.data(DATA_KEY); + + if (!data) { + data = new Tab(this); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + _createClass(Tab, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }]); + + return Tab; + }(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + + $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + + Tab._jQueryInterface.call($$$1(this), 'show'); + }); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $$$1.fn[NAME] = Tab._jQueryInterface; + $$$1.fn[NAME].Constructor = Tab; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Tab._jQueryInterface; + }; + + return Tab; + }($); + + return Tab; + +}))); +//# sourceMappingURL=tab.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/tab.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/tab.js.map new file mode 100644 index 0000000..4473d69 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/tab.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tab.js","sources":["../src/tab.js"],"sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tab = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tab'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.tab'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active',\n DISABLED : 'disabled',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n DROPDOWN : '.dropdown',\n NAV_LIST_GROUP : '.nav, .list-group',\n ACTIVE : '.active',\n ACTIVE_UL : '> li > .active',\n DATA_TOGGLE : '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE : '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active'\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tab {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n show() {\n if (this._element.parentNode &&\n this._element.parentNode.nodeType === Node.ELEMENT_NODE &&\n $(this._element).hasClass(ClassName.ACTIVE) ||\n $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n let target\n let previous\n const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]\n const selector = Util.getSelectorFromElement(this._element)\n\n if (listElement) {\n const itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE\n previous = $.makeArray($(listElement).find(itemSelector))\n previous = previous[previous.length - 1]\n }\n\n const hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n })\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget: previous\n })\n\n if (previous) {\n $(previous).trigger(hideEvent)\n }\n\n $(this._element).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented() ||\n hideEvent.isDefaultPrevented()) {\n return\n }\n\n if (selector) {\n target = document.querySelector(selector)\n }\n\n this._activate(\n this._element,\n listElement\n )\n\n const complete = () => {\n const hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: this._element\n })\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n })\n\n $(previous).trigger(hiddenEvent)\n $(this._element).trigger(shownEvent)\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Private\n\n _activate(element, container, callback) {\n let activeElements\n if (container.nodeName === 'UL') {\n activeElements = $(container).find(Selector.ACTIVE_UL)\n } else {\n activeElements = $(container).children(Selector.ACTIVE)\n }\n\n const active = activeElements[0]\n const isTransitioning = callback &&\n (active && $(active).hasClass(ClassName.FADE))\n\n const complete = () => this._transitionComplete(\n element,\n active,\n callback\n )\n\n if (active && isTransitioning) {\n const transitionDuration = Util.getTransitionDurationFromElement(active)\n\n $(active)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n\n _transitionComplete(element, active, callback) {\n if (active) {\n $(active).removeClass(`${ClassName.SHOW} ${ClassName.ACTIVE}`)\n\n const dropdownChild = $(active.parentNode).find(\n Selector.DROPDOWN_ACTIVE_CHILD\n )[0]\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(ClassName.ACTIVE)\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false)\n }\n }\n\n $(element).addClass(ClassName.ACTIVE)\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true)\n }\n\n Util.reflow(element)\n $(element).addClass(ClassName.SHOW)\n\n if (element.parentNode &&\n $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {\n const dropdownElement = $(element).closest(Selector.DROPDOWN)[0]\n if (dropdownElement) {\n const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE))\n $(dropdownToggleList).addClass(ClassName.ACTIVE)\n }\n\n element.setAttribute('aria-expanded', true)\n }\n\n if (callback) {\n callback()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n\n if (!data) {\n data = new Tab(this)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n Tab._jQueryInterface.call($(this), 'show')\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tab._jQueryInterface\n $.fn[NAME].Constructor = Tab\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tab._jQueryInterface\n }\n\n return Tab\n})($)\n\nexport default Tab\n"],"names":["Tab","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK_DATA_API","ClassName","DROPDOWN_MENU","ACTIVE","DISABLED","FADE","Selector","DROPDOWN","NAV_LIST_GROUP","ACTIVE_UL","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","element","_element","show","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","listElement","closest","selector","Util","getSelectorFromElement","itemSelector","nodeName","makeArray","find","length","hideEvent","relatedTarget","showEvent","trigger","isDefaultPrevented","document","querySelector","_activate","complete","hiddenEvent","shownEvent","dispose","removeData","container","callback","activeElements","children","active","isTransitioning","_transitionComplete","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","removeClass","dropdownChild","getAttribute","setAttribute","addClass","reflow","dropdownElement","dropdownToggleList","slice","call","querySelectorAll","_jQueryInterface","config","each","$this","data","TypeError","on","event","preventDefault","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAGA;;;;;;;EAOA,IAAMA,MAAO,UAACC,IAAD,EAAO;EAClB;;;;;EAMA,MAAMC,OAAqB,KAA3B;EACA,MAAMC,UAAqB,OAA3B;EACA,MAAMC,WAAqB,QAA3B;EACA,MAAMC,kBAAyBD,QAA/B;EACA,MAAME,eAAqB,WAA3B;EACA,MAAMC,qBAAqBN,KAAEO,EAAF,CAAKN,IAAL,CAA3B;EAEA,MAAMO,QAAQ;EACZC,mBAAwBL,SADZ;EAEZM,uBAA0BN,SAFd;EAGZO,mBAAwBP,SAHZ;EAIZQ,qBAAyBR,SAJb;EAKZS,8BAAyBT,SAAzB,GAAqCC;EALzB,GAAd;EAQA,MAAMS,YAAY;EAChBC,mBAAgB,eADA;EAEhBC,YAAgB,QAFA;EAGhBC,cAAgB,UAHA;EAIhBC,UAAgB,MAJA;EAKhBP,UAAgB;EALA,GAAlB;EAQA,MAAMQ,WAAW;EACfC,cAAwB,WADT;EAEfC,oBAAwB,mBAFT;EAGfL,YAAwB,SAHT;EAIfM,eAAwB,gBAJT;EAKfC,iBAAwB,iEALT;EAMfC,qBAAwB,kBANT;EAOfC,2BAA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De;;EAAA;EAAA;EAiOlB;;;;;;;EAMAF,OAAEmD,QAAF,EACGqC,EADH,CACMhF,MAAMK,cADZ,EAC4BM,SAASI,WADrC,EACkD,UAAUkE,KAAV,EAAiB;EAC/DA,UAAMC,cAAN;;EACA3F,QAAImF,gBAAJ,CAAqBF,IAArB,CAA0BhF,KAAE,IAAF,CAA1B,EAAmC,MAAnC;EACD,GAJH;EAMA;;;;;;EAMAA,OAAEO,EAAF,CAAKN,IAAL,IAAaF,IAAImF,gBAAjB;EACAlF,OAAEO,EAAF,CAAKN,IAAL,EAAW0F,WAAX,GAAyB5F,GAAzB;;EACAC,OAAEO,EAAF,CAAKN,IAAL,EAAW2F,UAAX,GAAwB,YAAY;EAClC5F,SAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;EACA,WAAOP,IAAImF,gBAAX;EACD,GAHD;;EAKA,SAAOnF,GAAP;EACD,CA3PW,CA2PTC,CA3PS,CAAZ;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/tooltip.js b/themes/docsy/assets/vendor/bootstrap/js/dist/tooltip.js new file mode 100644 index 0000000..b39eba4 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/tooltip.js @@ -0,0 +1,734 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) : + typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) : + (global.Tooltip = factory(global.jQuery,global.Popper,global.Util)); +}(this, (function ($,Popper,Util) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; + Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } + + return target; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): tooltip.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Tooltip = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + var NAME = 'tooltip'; + var VERSION = '4.1.3'; + var DATA_KEY = 'bs.tooltip'; + var EVENT_KEY = "." + DATA_KEY; + var JQUERY_NO_CONFLICT = $$$1.fn[NAME]; + var CLASS_PREFIX = 'bs-tooltip'; + var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); + var DefaultType = { + animation: 'boolean', + template: 'string', + title: '(string|element|function)', + trigger: 'string', + delay: '(number|object)', + html: 'boolean', + selector: '(string|boolean)', + placement: '(string|function)', + offset: '(number|string)', + container: '(string|element|boolean)', + fallbackPlacement: '(string|array)', + boundary: '(string|element)' + }; + var AttachmentMap = { + AUTO: 'auto', + TOP: 'top', + RIGHT: 'right', + BOTTOM: 'bottom', + LEFT: 'left' + }; + var Default = { + animation: true, + template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', + trigger: 'hover focus', + title: '', + delay: 0, + html: false, + selector: false, + placement: 'top', + offset: 0, + container: false, + fallbackPlacement: 'flip', + boundary: 'scrollParent' + }; + var HoverState = { + SHOW: 'show', + OUT: 'out' + }; + var Event = { + HIDE: "hide" + EVENT_KEY, + HIDDEN: "hidden" + EVENT_KEY, + SHOW: "show" + EVENT_KEY, + SHOWN: "shown" + EVENT_KEY, + INSERTED: "inserted" + EVENT_KEY, + CLICK: "click" + EVENT_KEY, + FOCUSIN: "focusin" + EVENT_KEY, + FOCUSOUT: "focusout" + EVENT_KEY, + MOUSEENTER: "mouseenter" + EVENT_KEY, + MOUSELEAVE: "mouseleave" + EVENT_KEY + }; + var ClassName = { + FADE: 'fade', + SHOW: 'show' + }; + var Selector = { + TOOLTIP: '.tooltip', + TOOLTIP_INNER: '.tooltip-inner', + ARROW: '.arrow' + }; + var Trigger = { + HOVER: 'hover', + FOCUS: 'focus', + CLICK: 'click', + MANUAL: 'manual' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; + + var Tooltip = + /*#__PURE__*/ + function () { + function Tooltip(element, config) { + /** + * Check for Popper dependency + * Popper - https://popper.js.org + */ + if (typeof Popper === 'undefined') { + throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)'); + } // private + + + this._isEnabled = true; + this._timeout = 0; + this._hoverState = ''; + this._activeTrigger = {}; + this._popper = null; // Protected + + this.element = element; + this.config = this._getConfig(config); + this.tip = null; + + this._setListeners(); + } // Getters + + + var _proto = Tooltip.prototype; + + // Public + _proto.enable = function enable() { + this._isEnabled = true; + }; + + _proto.disable = function disable() { + this._isEnabled = false; + }; + + _proto.toggleEnabled = function toggleEnabled() { + this._isEnabled = !this._isEnabled; + }; + + _proto.toggle = function toggle(event) { + if (!this._isEnabled) { + return; + } + + if (event) { + var dataKey = this.constructor.DATA_KEY; + var context = $$$1(event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $$$1(event.currentTarget).data(dataKey, context); + } + + context._activeTrigger.click = !context._activeTrigger.click; + + if (context._isWithActiveTrigger()) { + context._enter(null, context); + } else { + context._leave(null, context); + } + } else { + if ($$$1(this.getTipElement()).hasClass(ClassName.SHOW)) { + this._leave(null, this); + + return; + } + + this._enter(null, this); + } + }; + + _proto.dispose = function dispose() { + clearTimeout(this._timeout); + $$$1.removeData(this.element, this.constructor.DATA_KEY); + $$$1(this.element).off(this.constructor.EVENT_KEY); + $$$1(this.element).closest('.modal').off('hide.bs.modal'); + + if (this.tip) { + $$$1(this.tip).remove(); + } + + this._isEnabled = null; + this._timeout = null; + this._hoverState = null; + this._activeTrigger = null; + + if (this._popper !== null) { + this._popper.destroy(); + } + + this._popper = null; + this.element = null; + this.config = null; + this.tip = null; + }; + + _proto.show = function show() { + var _this = this; + + if ($$$1(this.element).css('display') === 'none') { + throw new Error('Please use show on visible elements'); + } + + var showEvent = $$$1.Event(this.constructor.Event.SHOW); + + if (this.isWithContent() && this._isEnabled) { + $$$1(this.element).trigger(showEvent); + var isInTheDom = $$$1.contains(this.element.ownerDocument.documentElement, this.element); + + if (showEvent.isDefaultPrevented() || !isInTheDom) { + return; + } + + var tip = this.getTipElement(); + var tipId = Util.getUID(this.constructor.NAME); + tip.setAttribute('id', tipId); + this.element.setAttribute('aria-describedby', tipId); + this.setContent(); + + if (this.config.animation) { + $$$1(tip).addClass(ClassName.FADE); + } + + var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; + + var attachment = this._getAttachment(placement); + + this.addAttachmentClass(attachment); + var container = this.config.container === false ? document.body : $$$1(document).find(this.config.container); + $$$1(tip).data(this.constructor.DATA_KEY, this); + + if (!$$$1.contains(this.element.ownerDocument.documentElement, this.tip)) { + $$$1(tip).appendTo(container); + } + + $$$1(this.element).trigger(this.constructor.Event.INSERTED); + this._popper = new Popper(this.element, tip, { + placement: attachment, + modifiers: { + offset: { + offset: this.config.offset + }, + flip: { + behavior: this.config.fallbackPlacement + }, + arrow: { + element: Selector.ARROW + }, + preventOverflow: { + boundariesElement: this.config.boundary + } + }, + onCreate: function onCreate(data) { + if (data.originalPlacement !== data.placement) { + _this._handlePopperPlacementChange(data); + } + }, + onUpdate: function onUpdate(data) { + _this._handlePopperPlacementChange(data); + } + }); + $$$1(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 + + if ('ontouchstart' in document.documentElement) { + $$$1(document.body).children().on('mouseover', null, $$$1.noop); + } + + var complete = function complete() { + if (_this.config.animation) { + _this._fixTransition(); + } + + var prevHoverState = _this._hoverState; + _this._hoverState = null; + $$$1(_this.element).trigger(_this.constructor.Event.SHOWN); + + if (prevHoverState === HoverState.OUT) { + _this._leave(null, _this); + } + }; + + if ($$$1(this.tip).hasClass(ClassName.FADE)) { + var transitionDuration = Util.getTransitionDurationFromElement(this.tip); + $$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + } else { + complete(); + } + } + }; + + _proto.hide = function hide(callback) { + var _this2 = this; + + var tip = this.getTipElement(); + var hideEvent = $$$1.Event(this.constructor.Event.HIDE); + + var complete = function complete() { + if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { + tip.parentNode.removeChild(tip); + } + + _this2._cleanTipClass(); + + _this2.element.removeAttribute('aria-describedby'); + + $$$1(_this2.element).trigger(_this2.constructor.Event.HIDDEN); + + if (_this2._popper !== null) { + _this2._popper.destroy(); + } + + if (callback) { + callback(); + } + }; + + $$$1(this.element).trigger(hideEvent); + + if (hideEvent.isDefaultPrevented()) { + return; + } + + $$$1(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) { + $$$1(document.body).children().off('mouseover', null, $$$1.noop); + } + + this._activeTrigger[Trigger.CLICK] = false; + this._activeTrigger[Trigger.FOCUS] = false; + this._activeTrigger[Trigger.HOVER] = false; + + if ($$$1(this.tip).hasClass(ClassName.FADE)) { + var transitionDuration = Util.getTransitionDurationFromElement(tip); + $$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); + } else { + complete(); + } + + this._hoverState = ''; + }; + + _proto.update = function update() { + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } + }; // Protected + + + _proto.isWithContent = function isWithContent() { + return Boolean(this.getTitle()); + }; + + _proto.addAttachmentClass = function addAttachmentClass(attachment) { + $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); + }; + + _proto.getTipElement = function getTipElement() { + this.tip = this.tip || $$$1(this.config.template)[0]; + return this.tip; + }; + + _proto.setContent = function setContent() { + var tip = this.getTipElement(); + this.setElementContent($$$1(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle()); + $$$1(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW); + }; + + _proto.setElementContent = function setElementContent($element, content) { + var html = this.config.html; + + if (typeof content === 'object' && (content.nodeType || content.jquery)) { + // Content is a DOM node or a jQuery + if (html) { + if (!$$$1(content).parent().is($element)) { + $element.empty().append(content); + } + } else { + $element.text($$$1(content).text()); + } + } else { + $element[html ? 'html' : 'text'](content); + } + }; + + _proto.getTitle = function getTitle() { + var title = this.element.getAttribute('data-original-title'); + + if (!title) { + title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; + } + + return title; + }; // Private + + + _proto._getAttachment = function _getAttachment(placement) { + return AttachmentMap[placement.toUpperCase()]; + }; + + _proto._setListeners = function _setListeners() { + var _this3 = this; + + var triggers = this.config.trigger.split(' '); + triggers.forEach(function (trigger) { + if (trigger === 'click') { + $$$1(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) { + return _this3.toggle(event); + }); + } else if (trigger !== Trigger.MANUAL) { + var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN; + var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT; + $$$1(_this3.element).on(eventIn, _this3.config.selector, function (event) { + return _this3._enter(event); + }).on(eventOut, _this3.config.selector, function (event) { + return _this3._leave(event); + }); + } + + $$$1(_this3.element).closest('.modal').on('hide.bs.modal', function () { + return _this3.hide(); + }); + }); + + if (this.config.selector) { + this.config = _objectSpread({}, this.config, { + trigger: 'manual', + selector: '' + }); + } else { + this._fixTitle(); + } + }; + + _proto._fixTitle = function _fixTitle() { + var titleType = typeof this.element.getAttribute('data-original-title'); + + if (this.element.getAttribute('title') || titleType !== 'string') { + this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); + this.element.setAttribute('title', ''); + } + }; + + _proto._enter = function _enter(event, context) { + var dataKey = this.constructor.DATA_KEY; + context = context || $$$1(event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $$$1(event.currentTarget).data(dataKey, context); + } + + if (event) { + context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; + } + + if ($$$1(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) { + context._hoverState = HoverState.SHOW; + return; + } + + clearTimeout(context._timeout); + context._hoverState = HoverState.SHOW; + + if (!context.config.delay || !context.config.delay.show) { + context.show(); + return; + } + + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.SHOW) { + context.show(); + } + }, context.config.delay.show); + }; + + _proto._leave = function _leave(event, context) { + var dataKey = this.constructor.DATA_KEY; + context = context || $$$1(event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $$$1(event.currentTarget).data(dataKey, context); + } + + if (event) { + context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; + } + + if (context._isWithActiveTrigger()) { + return; + } + + clearTimeout(context._timeout); + context._hoverState = HoverState.OUT; + + if (!context.config.delay || !context.config.delay.hide) { + context.hide(); + return; + } + + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.OUT) { + context.hide(); + } + }, context.config.delay.hide); + }; + + _proto._isWithActiveTrigger = function _isWithActiveTrigger() { + for (var trigger in this._activeTrigger) { + if (this._activeTrigger[trigger]) { + return true; + } + } + + return false; + }; + + _proto._getConfig = function _getConfig(config) { + config = _objectSpread({}, this.constructor.Default, $$$1(this.element).data(), typeof config === 'object' && config ? config : {}); + + if (typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + }; + } + + if (typeof config.title === 'number') { + config.title = config.title.toString(); + } + + if (typeof config.content === 'number') { + config.content = config.content.toString(); + } + + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); + return config; + }; + + _proto._getDelegateConfig = function _getDelegateConfig() { + var config = {}; + + if (this.config) { + for (var key in this.config) { + if (this.constructor.Default[key] !== this.config[key]) { + config[key] = this.config[key]; + } + } + } + + return config; + }; + + _proto._cleanTipClass = function _cleanTipClass() { + var $tip = $$$1(this.getTipElement()); + var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); + + if (tabClass !== null && tabClass.length) { + $tip.removeClass(tabClass.join('')); + } + }; + + _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { + var popperInstance = popperData.instance; + this.tip = popperInstance.popper; + + this._cleanTipClass(); + + this.addAttachmentClass(this._getAttachment(popperData.placement)); + }; + + _proto._fixTransition = function _fixTransition() { + var tip = this.getTipElement(); + var initConfigAnimation = this.config.animation; + + if (tip.getAttribute('x-placement') !== null) { + return; + } + + $$$1(tip).removeClass(ClassName.FADE); + this.config.animation = false; + this.hide(); + this.show(); + this.config.animation = initConfigAnimation; + }; // Static + + + Tooltip._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $$$1(this).data(DATA_KEY); + + var _config = typeof config === 'object' && config; + + if (!data && /dispose|hide/.test(config)) { + return; + } + + if (!data) { + data = new Tooltip(this, _config); + $$$1(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"" + config + "\""); + } + + data[config](); + } + }); + }; + + _createClass(Tooltip, null, [{ + key: "VERSION", + get: function get() { + return VERSION; + } + }, { + key: "Default", + get: function get() { + return Default; + } + }, { + key: "NAME", + get: function get() { + return NAME; + } + }, { + key: "DATA_KEY", + get: function get() { + return DATA_KEY; + } + }, { + key: "Event", + get: function get() { + return Event; + } + }, { + key: "EVENT_KEY", + get: function get() { + return EVENT_KEY; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType; + } + }]); + + return Tooltip; + }(); + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + + $$$1.fn[NAME] = Tooltip._jQueryInterface; + $$$1.fn[NAME].Constructor = Tooltip; + + $$$1.fn[NAME].noConflict = function () { + $$$1.fn[NAME] = JQUERY_NO_CONFLICT; + return Tooltip._jQueryInterface; + }; + + return Tooltip; + }($, Popper); + + return Tooltip; + +}))); +//# sourceMappingURL=tooltip.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/tooltip.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/tooltip.js.map new file mode 100644 index 0000000..c47da99 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/tooltip.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tooltip.js","sources":["../src/tooltip.js"],"sourcesContent":["import $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tooltip = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tooltip'\n const VERSION = '4.1.3'\n const DATA_KEY = 'bs.tooltip'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const CLASS_PREFIX = 'bs-tooltip'\n const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\n\n const DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : '(number|string)',\n container : '(string|element|boolean)',\n fallbackPlacement : '(string|array)',\n boundary : '(string|element)'\n }\n\n const AttachmentMap = {\n AUTO : 'auto',\n TOP : 'top',\n RIGHT : 'right',\n BOTTOM : 'bottom',\n LEFT : 'left'\n }\n\n const Default = {\n animation : true,\n template : '<div class=\"tooltip\" role=\"tooltip\">' +\n '<div class=\"arrow\"></div>' +\n '<div class=\"tooltip-inner\"></div></div>',\n trigger : 'hover focus',\n title : '',\n delay : 0,\n html : false,\n selector : false,\n placement : 'top',\n offset : 0,\n container : false,\n fallbackPlacement : 'flip',\n boundary : 'scrollParent'\n }\n\n const HoverState = {\n SHOW : 'show',\n OUT : 'out'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n const ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner',\n ARROW : '.arrow'\n }\n\n const Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip {\n constructor(element, config) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)')\n }\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._popper = null\n\n // Protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (!this._isEnabled) {\n return\n }\n\n if (event) {\n const dataKey = this.constructor.DATA_KEY\n let context = $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n $(this.element).closest('.modal').off('hide.bs.modal')\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n if (this._popper !== null) {\n this._popper.destroy()\n }\n\n this._popper = null\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n const showEvent = $.Event(this.constructor.Event.SHOW)\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n const isInTheDom = $.contains(\n this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n const tip = this.getTipElement()\n const tipId = Util.getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this.element.setAttribute('aria-describedby', tipId)\n\n this.setContent()\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE)\n }\n\n const placement = typeof this.config.placement === 'function'\n ? this.config.placement.call(this, tip, this.element)\n : this.config.placement\n\n const attachment = this._getAttachment(placement)\n this.addAttachmentClass(attachment)\n\n const container = this.config.container === false ? document.body : $(document).find(this.config.container)\n\n $(tip).data(this.constructor.DATA_KEY, this)\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container)\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._popper = new Popper(this.element, tip, {\n placement: attachment,\n modifiers: {\n offset: {\n offset: this.config.offset\n },\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: (data) => {\n if (data.originalPlacement !== data.placement) {\n this._handlePopperPlacementChange(data)\n }\n },\n onUpdate: (data) => {\n this._handlePopperPlacementChange(data)\n }\n })\n\n $(tip).addClass(ClassName.SHOW)\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop)\n }\n\n const complete = () => {\n if (this.config.animation) {\n this._fixTransition()\n }\n const prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n const transitionDuration = Util.getTransitionDurationFromElement(this.tip)\n\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n }\n\n hide(callback) {\n const tip = this.getTipElement()\n const hideEvent = $.Event(this.constructor.Event.HIDE)\n const complete = () => {\n if (this._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this._cleanTipClass()\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n if (this._popper !== null) {\n this._popper.destroy()\n }\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.SHOW)\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop)\n }\n\n this._activeTrigger[Trigger.CLICK] = false\n this._activeTrigger[Trigger.FOCUS] = false\n this._activeTrigger[Trigger.HOVER] = false\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n const transitionDuration = Util.getTransitionDurationFromElement(tip)\n\n $(tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n\n this._hoverState = ''\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // Protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n this.tip = this.tip || $(this.config.template)[0]\n return this.tip\n }\n\n setContent() {\n const tip = this.getTipElement()\n this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle())\n $(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n setElementContent($element, content) {\n const html = this.config.html\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n } else {\n $element[html ? 'html' : 'text'](content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function'\n ? this.config.title.call(this.element)\n : this.config.title\n }\n\n return title\n }\n\n // Private\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n const triggers = this.config.trigger.split(' ')\n\n triggers.forEach((trigger) => {\n if (trigger === 'click') {\n $(this.element).on(\n this.constructor.Event.CLICK,\n this.config.selector,\n (event) => this.toggle(event)\n )\n } else if (trigger !== Trigger.MANUAL) {\n const eventIn = trigger === Trigger.HOVER\n ? this.constructor.Event.MOUSEENTER\n : this.constructor.Event.FOCUSIN\n const eventOut = trigger === Trigger.HOVER\n ? this.constructor.Event.MOUSELEAVE\n : this.constructor.Event.FOCUSOUT\n\n $(this.element)\n .on(\n eventIn,\n this.config.selector,\n (event) => this._enter(event)\n )\n .on(\n eventOut,\n this.config.selector,\n (event) => this._leave(event)\n )\n }\n\n $(this.element).closest('.modal').on(\n 'hide.bs.modal',\n () => this.hide()\n )\n })\n\n if (this.config.selector) {\n this.config = {\n ...this.config,\n trigger: 'manual',\n selector: ''\n }\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const titleType = typeof this.element.getAttribute('data-original-title')\n if (this.element.getAttribute('title') ||\n titleType !== 'string') {\n this.element.setAttribute(\n 'data-original-title',\n this.element.getAttribute('title') || ''\n )\n this.element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER\n ] = true\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) ||\n context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.SHOW\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.SHOW) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER\n ] = false\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.OUT\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.OUT) {\n context.hide()\n }\n }, context.config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n config = {\n ...this.constructor.Default,\n ...$(this.element).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n }\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n if (this.config) {\n for (const key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n _handlePopperPlacementChange(popperData) {\n const popperInstance = popperData.instance\n this.tip = popperInstance.popper\n this._cleanTipClass()\n this.addAttachmentClass(this._getAttachment(popperData.placement))\n }\n\n _fixTransition() {\n const tip = this.getTipElement()\n const initConfigAnimation = this.config.animation\n if (tip.getAttribute('x-placement') !== null) {\n return\n }\n $(tip).removeClass(ClassName.FADE)\n this.config.animation = false\n this.hide()\n this.show()\n this.config.animation = initConfigAnimation\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Tooltip(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tooltip._jQueryInterface\n $.fn[NAME].Constructor = Tooltip\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tooltip._jQueryInterface\n }\n\n return Tooltip\n})($, Popper)\n\nexport default Tooltip\n"],"names":["Tooltip","$","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","CLASS_PREFIX","BSCLS_PREFIX_REGEX","RegExp","DefaultType","animation","template","title","trigger","delay","html","selector","placement","offset","container","fallbackPlacement","boundary","AttachmentMap","AUTO","TOP","RIGHT","BOTTOM","LEFT","Default","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","ARROW","Trigger","HOVER","FOCUS","MANUAL","element","config","Popper","TypeError","_isEnabled","_timeout","_hoverState","_activeTrigger","_popper","_getConfig","tip","_setListeners","enable","disable","toggleEnabled","toggle","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","dispose","clearTimeout","removeData","off","closest","remove","destroy","show","css","Error","showEvent","isWithContent","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","Util","getUID","setAttribute","setContent","addClass","call","attachment","_getAttachment","addAttachmentClass","document","body","find","appendTo","modifiers","flip","behavior","arrow","preventOverflow","boundariesElement","onCreate","originalPlacement","_handlePopperPlacementChange","onUpdate","children","on","noop","complete","_fixTransition","prevHoverState","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","hide","callback","hideEvent","parentNode","removeChild","_cleanTipClass","removeAttribute","removeClass","update","scheduleUpdate","Boolean","getTitle","setElementContent","querySelectorAll","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","toUpperCase","triggers","split","forEach","eventIn","eventOut","_fixTitle","titleType","type","setTimeout","toString","typeCheckConfig","key","$tip","tabClass","attr","match","length","join","popperData","popperInstance","instance","popper","initConfigAnimation","_jQueryInterface","each","_config","test","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIA;;;;;;;EAOA,IAAMA,UAAW,UAACC,IAAD,EAAO;EACtB;;;;;EAMA,MAAMC,OAAqB,SAA3B;EACA,MAAMC,UAAqB,OAA3B;EACA,MAAMC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AAX,GAAyB3L,OAAzB;;EACAC,OAAEM,EAAF,CAAKL,IAAL,EAAW0L,UAAX,GAAwB,YAAY;EAClC3L,SAAEM,EAAF,CAAKL,IAAL,IAAaI,kBAAb;EACA,WAAON,QAAQuL,gBAAf;EACD,GAHD;;EAKA,SAAOvL,OAAP;EACD,CAvsBe,CAusBbC,CAvsBa,EAusBVuD,MAvsBU,CAAhB;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/util.js b/themes/docsy/assets/vendor/bootstrap/js/dist/util.js new file mode 100644 index 0000000..2468212 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/util.js @@ -0,0 +1,144 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : + typeof define === 'function' && define.amd ? define(['jquery'], factory) : + (global.Util = factory(global.jQuery)); +}(this, (function ($) { 'use strict'; + + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): util.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Util = function ($$$1) { + /** + * ------------------------------------------------------------------------ + * Private TransitionEnd Helpers + * ------------------------------------------------------------------------ + */ + var TRANSITION_END = 'transitionend'; + var MAX_UID = 1000000; + var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) + + function toType(obj) { + return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); + } + + function getSpecialTransitionEndEvent() { + return { + bindType: TRANSITION_END, + delegateType: TRANSITION_END, + handle: function handle(event) { + if ($$$1(event.target).is(this)) { + return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params + } + + return undefined; // eslint-disable-line no-undefined + } + }; + } + + function transitionEndEmulator(duration) { + var _this = this; + + var called = false; + $$$1(this).one(Util.TRANSITION_END, function () { + called = true; + }); + setTimeout(function () { + if (!called) { + Util.triggerTransitionEnd(_this); + } + }, duration); + return this; + } + + function setTransitionEndSupport() { + $$$1.fn.emulateTransitionEnd = transitionEndEmulator; + $$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); + } + /** + * -------------------------------------------------------------------------- + * Public Util Api + * -------------------------------------------------------------------------- + */ + + + var Util = { + TRANSITION_END: 'bsTransitionEnd', + getUID: function getUID(prefix) { + do { + // eslint-disable-next-line no-bitwise + prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here + } while (document.getElementById(prefix)); + + return prefix; + }, + getSelectorFromElement: function getSelectorFromElement(element) { + var selector = element.getAttribute('data-target'); + + if (!selector || selector === '#') { + selector = element.getAttribute('href') || ''; + } + + try { + return document.querySelector(selector) ? selector : null; + } catch (err) { + return null; + } + }, + getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { + if (!element) { + return 0; + } // Get transition-duration of the element + + + var transitionDuration = $$$1(element).css('transition-duration'); + var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found + + if (!floatTransitionDuration) { + return 0; + } // If multiple durations are defined, take the first + + + transitionDuration = transitionDuration.split(',')[0]; + return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER; + }, + reflow: function reflow(element) { + return element.offsetHeight; + }, + triggerTransitionEnd: function triggerTransitionEnd(element) { + $$$1(element).trigger(TRANSITION_END); + }, + // TODO: Remove in v5 + supportsTransitionEnd: function supportsTransitionEnd() { + return Boolean(TRANSITION_END); + }, + isElement: function isElement(obj) { + return (obj[0] || obj).nodeType; + }, + typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { + for (var property in configTypes) { + if (Object.prototype.hasOwnProperty.call(configTypes, property)) { + var expectedTypes = configTypes[property]; + var value = config[property]; + var valueType = value && Util.isElement(value) ? 'element' : toType(value); + + if (!new RegExp(expectedTypes).test(valueType)) { + throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); + } + } + } + } + }; + setTransitionEndSupport(); + return Util; + }($); + + return Util; + +}))); +//# sourceMappingURL=util.js.map diff --git a/themes/docsy/assets/vendor/bootstrap/js/dist/util.js.map b/themes/docsy/assets/vendor/bootstrap/js/dist/util.js.map new file mode 100644 index 0000000..fded9bf --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/dist/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sources":["../src/util.js"],"sourcesContent":["import $ from 'jquery'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Util = (($) => {\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n const TRANSITION_END = 'transitionend'\n const MAX_UID = 1000000\n const MILLISECONDS_MULTIPLIER = 1000\n\n // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined // eslint-disable-line no-undefined\n }\n }\n }\n\n function transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n }\n\n function setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n }\n\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n const Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || ''\n }\n\n try {\n return document.querySelector(selector) ? selector : null\n } catch (err) {\n return null\n }\n },\n\n getTransitionDurationFromElement(element) {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let transitionDuration = $(element).css('transition-duration')\n const floatTransitionDuration = parseFloat(transitionDuration)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n\n return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END)\n },\n\n // TODO: Remove in v5\n supportsTransitionEnd() {\n return Boolean(TRANSITION_END)\n },\n\n isElement(obj) {\n return (obj[0] || obj).nodeType\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && Util.isElement(value)\n ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n }\n }\n\n setTransitionEndSupport()\n\n return Util\n})($)\n\nexport default Util\n"],"names":["Util","$","TRANSITION_END","MAX_UID","MILLISECONDS_MULTIPLIER","toType","obj","toString","call","match","toLowerCase","getSpecialTransitionEndEvent","bindType","delegateType","handle","event","target","is","handleObj","handler","apply","arguments","undefined","transitionEndEmulator","duration","called","one","setTimeout","triggerTransitionEnd","setTransitionEndSupport","fn","emulateTransitionEnd","special","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","querySelector","err","getTransitionDurationFromElement","transitionDuration","css","floatTransitionDuration","parseFloat","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","nodeType","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase"],"mappings":";;;;;;;;EAEA;;;;;;;EAOA,IAAMA,OAAQ,UAACC,IAAD,EAAO;EACnB;;;;;EAMA,MAAMC,iBAAiB,eAAvB;EACA,MAAMC,UAAU,OAAhB;EACA,MAAMC,0BAA0B,IAAhC,CATmB;;EAYnB,WAASC,MAAT,CAAgBC,GAAhB,EAAqB;EACnB,WAAO,GAAGC,QAAH,CAAYC,IAAZ,CAAiBF,GAAjB,EAAsBG,KAAtB,CAA4B,aAA5B,EAA2C,CAA3C,EAA8CC,WAA9C,EAAP;EACD;;EAED,WAASC,4BAAT,GAAwC;EACtC,WAAO;EACLC,gBAAUV,cADL;EAELW,oBAAcX,cAFT;EAGLY,YAHK,kBAGEC,KAHF,EAGS;EACZ,YAAId,KAAEc,MAAMC,MAAR,EAAgBC,EAAhB,CAAmB,IAAnB,CAAJ,EAA8B;EAC5B,iBAAOF,MAAMG,SAAN,CAAgBC,OAAhB,CAAwBC,KAAxB,CAA8B,IAA9B,EAAoCC,SAApC,CAAP,CAD4B;EAE7B;;EACD,eAAOC,SAAP,CAJY;EAKb;EARI,KAAP;EAUD;;EAED,WAASC,qBAAT,CAA+BC,QAA/B,EAAyC;EAAA;;EACvC,QAAIC,SAAS,KAAb;EAEAxB,SAAE,IAAF,EAAQyB,GAAR,CAAY1B,KAAKE,cAAjB,EAAiC,YAAM;EACrCuB,eAAS,IAAT;EACD,KAFD;EAIAE,eAAW,YAAM;EACf,UAAI,CAACF,MAAL,EAAa;EACXzB,aAAK4B,oBAAL,CAA0B,KAA1B;EACD;EACF,KAJD,EAIG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;EA6CX+C,UA7CW,kBA6CJX,OA7CI,EA6CK;EACd,aAAOA,QAAQY,YAAf;EACD,KA/CU;EAiDXxB,wBAjDW,gCAiDUY,OAjDV,EAiDmB;EAC5BvC,WAAEuC,OAAF,EAAWa,OAAX,CAAmBnD,cAAnB;EACD,KAnDU;EAqDX;EACAoD,yBAtDW,mCAsDa;EACtB,aAAOC,QAAQrD,cAAR,CAAP;EACD,KAxDU;EA0DXsD,aA1DW,qBA0DDlD,GA1DC,EA0DI;EACb,aAAO,CAACA,IAAI,CAAJ,KAAUA,GAAX,EAAgBmD,QAAvB;EACD,KA5DU;EA8DXC,mBA9DW,2BA8DKC,aA9DL,EA8DoBC,MA9DpB,EA8D4BC,WA9D5B,EA8DyC;EAClD,WAAK,IAAMC,QAAX,IAAuBD,WAAvB,EAAoC;EAClC,YAAIE,OAAOC,SAAP,CAAiBC,cAAjB,CAAgCzD,IAAhC,CAAqCqD,WAArC,EAAkDC,QAAlD,CAAJ,EAAiE;EAC/D,cAAMI,gBAAgBL,YAAYC,QAAZ,CAAtB;EACA,cAAMK,QAAgBP,OAAOE,QAAP,CAAtB;EACA,cAAMM,YAAgBD,SAASnE,KAAKwD,SAAL,CAAeW,KAAf,CAAT,GAClB,SADkB,GACN9D,OAAO8D,KAAP,CADhB;;EAGA,cAAI,CAAC,IAAIE,MAAJ,CAAWH,aAAX,EAA0BI,IAA1B,CAA+BF,SAA/B,CAAL,EAAgD;EAC9C,kBAAM,IAAIG,KAAJ,CACDZ,cAAca,WAAd,EAAH,yBACWV,QADX,2BACuCM,SADvC,sCAEsBF,aAFtB,SADI,CAAN;EAID;EACF;EACF;EACF;EA9EU,GAAb;EAiFArC;EAEA,SAAO7B,IAAP;EACD,CA5IY,CA4IVC,CA5IU,CAAb;;;;;;;;"}
\ No newline at end of file diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/alert.js b/themes/docsy/assets/vendor/bootstrap/js/src/alert.js new file mode 100644 index 0000000..f39d9d9 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/alert.js @@ -0,0 +1,183 @@ +import $ from 'jquery' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): alert.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Alert = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'alert' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.alert' + const EVENT_KEY = `.${DATA_KEY}` + const DATA_API_KEY = '.data-api' + const JQUERY_NO_CONFLICT = $.fn[NAME] + + const Selector = { + DISMISS : '[data-dismiss="alert"]' + } + + const Event = { + CLOSE : `close${EVENT_KEY}`, + CLOSED : `closed${EVENT_KEY}`, + CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}` + } + + const ClassName = { + ALERT : 'alert', + FADE : 'fade', + SHOW : 'show' + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Alert { + constructor(element) { + this._element = element + } + + // Getters + + static get VERSION() { + return VERSION + } + + // Public + + close(element) { + let rootElement = this._element + if (element) { + rootElement = this._getRootElement(element) + } + + const customEvent = this._triggerCloseEvent(rootElement) + + if (customEvent.isDefaultPrevented()) { + return + } + + this._removeElement(rootElement) + } + + dispose() { + $.removeData(this._element, DATA_KEY) + this._element = null + } + + // Private + + _getRootElement(element) { + const selector = Util.getSelectorFromElement(element) + let parent = false + + if (selector) { + parent = document.querySelector(selector) + } + + if (!parent) { + parent = $(element).closest(`.${ClassName.ALERT}`)[0] + } + + return parent + } + + _triggerCloseEvent(element) { + const closeEvent = $.Event(Event.CLOSE) + + $(element).trigger(closeEvent) + return closeEvent + } + + _removeElement(element) { + $(element).removeClass(ClassName.SHOW) + + if (!$(element).hasClass(ClassName.FADE)) { + this._destroyElement(element) + return + } + + const transitionDuration = Util.getTransitionDurationFromElement(element) + + $(element) + .one(Util.TRANSITION_END, (event) => this._destroyElement(element, event)) + .emulateTransitionEnd(transitionDuration) + } + + _destroyElement(element) { + $(element) + .detach() + .trigger(Event.CLOSED) + .remove() + } + + // Static + + static _jQueryInterface(config) { + return this.each(function () { + const $element = $(this) + let data = $element.data(DATA_KEY) + + if (!data) { + data = new Alert(this) + $element.data(DATA_KEY, data) + } + + if (config === 'close') { + data[config](this) + } + }) + } + + static _handleDismiss(alertInstance) { + return function (event) { + if (event) { + event.preventDefault() + } + + alertInstance.close(this) + } + } + } + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on( + Event.CLICK_DATA_API, + Selector.DISMISS, + Alert._handleDismiss(new Alert()) + ) + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Alert._jQueryInterface + $.fn[NAME].Constructor = Alert + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Alert._jQueryInterface + } + + return Alert +})($) + +export default Alert diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/button.js b/themes/docsy/assets/vendor/bootstrap/js/src/button.js new file mode 100644 index 0000000..cf181d3 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/button.js @@ -0,0 +1,175 @@ +import $ from 'jquery' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): button.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Button = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'button' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.button' + const EVENT_KEY = `.${DATA_KEY}` + const DATA_API_KEY = '.data-api' + const JQUERY_NO_CONFLICT = $.fn[NAME] + + const ClassName = { + ACTIVE : 'active', + BUTTON : 'btn', + FOCUS : 'focus' + } + + const Selector = { + DATA_TOGGLE_CARROT : '[data-toggle^="button"]', + DATA_TOGGLE : '[data-toggle="buttons"]', + INPUT : 'input', + ACTIVE : '.active', + BUTTON : '.btn' + } + + const 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 Button { + constructor(element) { + this._element = element + } + + // Getters + + static get VERSION() { + return VERSION + } + + // Public + + toggle() { + let triggerChangeEvent = true + let addAriaPressed = true + const rootElement = $(this._element).closest( + Selector.DATA_TOGGLE + )[0] + + if (rootElement) { + const input = this._element.querySelector(Selector.INPUT) + + if (input) { + if (input.type === 'radio') { + if (input.checked && + this._element.classList.contains(ClassName.ACTIVE)) { + triggerChangeEvent = false + } else { + const activeElement = rootElement.querySelector(Selector.ACTIVE) + + if (activeElement) { + $(activeElement).removeClass(ClassName.ACTIVE) + } + } + } + + if (triggerChangeEvent) { + if (input.hasAttribute('disabled') || + rootElement.hasAttribute('disabled') || + input.classList.contains('disabled') || + rootElement.classList.contains('disabled')) { + return + } + input.checked = !this._element.classList.contains(ClassName.ACTIVE) + $(input).trigger('change') + } + + input.focus() + addAriaPressed = false + } + } + + if (addAriaPressed) { + this._element.setAttribute('aria-pressed', + !this._element.classList.contains(ClassName.ACTIVE)) + } + + if (triggerChangeEvent) { + $(this._element).toggleClass(ClassName.ACTIVE) + } + } + + dispose() { + $.removeData(this._element, DATA_KEY) + this._element = null + } + + // Static + + static _jQueryInterface(config) { + return this.each(function () { + let data = $(this).data(DATA_KEY) + + if (!data) { + data = new Button(this) + $(this).data(DATA_KEY, data) + } + + if (config === 'toggle') { + data[config]() + } + }) + } + } + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document) + .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => { + event.preventDefault() + + let button = event.target + + if (!$(button).hasClass(ClassName.BUTTON)) { + button = $(button).closest(Selector.BUTTON) + } + + Button._jQueryInterface.call($(button), 'toggle') + }) + .on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => { + const button = $(event.target).closest(Selector.BUTTON)[0] + $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)) + }) + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Button._jQueryInterface + $.fn[NAME].Constructor = Button + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Button._jQueryInterface + } + + return Button +})($) + +export default Button diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/carousel.js b/themes/docsy/assets/vendor/bootstrap/js/src/carousel.js new file mode 100644 index 0000000..62af5cd --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/carousel.js @@ -0,0 +1,520 @@ +import $ from 'jquery' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): carousel.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Carousel = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'carousel' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.carousel' + const EVENT_KEY = `.${DATA_KEY}` + const DATA_API_KEY = '.data-api' + const JQUERY_NO_CONFLICT = $.fn[NAME] + const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key + const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key + const TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch + + const Default = { + interval : 5000, + keyboard : true, + slide : false, + pause : 'hover', + wrap : true + } + + const DefaultType = { + interval : '(number|boolean)', + keyboard : 'boolean', + slide : '(boolean|string)', + pause : '(string|boolean)', + wrap : 'boolean' + } + + const Direction = { + NEXT : 'next', + PREV : 'prev', + LEFT : 'left', + RIGHT : 'right' + } + + const Event = { + SLIDE : `slide${EVENT_KEY}`, + SLID : `slid${EVENT_KEY}`, + KEYDOWN : `keydown${EVENT_KEY}`, + MOUSEENTER : `mouseenter${EVENT_KEY}`, + MOUSELEAVE : `mouseleave${EVENT_KEY}`, + TOUCHEND : `touchend${EVENT_KEY}`, + LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`, + CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}` + } + + const ClassName = { + CAROUSEL : 'carousel', + ACTIVE : 'active', + SLIDE : 'slide', + RIGHT : 'carousel-item-right', + LEFT : 'carousel-item-left', + NEXT : 'carousel-item-next', + PREV : 'carousel-item-prev', + ITEM : 'carousel-item' + } + + const Selector = { + ACTIVE : '.active', + ACTIVE_ITEM : '.active.carousel-item', + ITEM : '.carousel-item', + NEXT_PREV : '.carousel-item-next, .carousel-item-prev', + INDICATORS : '.carousel-indicators', + DATA_SLIDE : '[data-slide], [data-slide-to]', + DATA_RIDE : '[data-ride="carousel"]' + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Carousel { + constructor(element, config) { + this._items = null + this._interval = null + this._activeElement = null + + this._isPaused = false + this._isSliding = false + + this.touchTimeout = null + + this._config = this._getConfig(config) + this._element = $(element)[0] + this._indicatorsElement = this._element.querySelector(Selector.INDICATORS) + + this._addEventListeners() + } + + // Getters + + static get VERSION() { + return VERSION + } + + static get Default() { + return Default + } + + // Public + + next() { + if (!this._isSliding) { + this._slide(Direction.NEXT) + } + } + + nextWhenVisible() { + // Don't call next when the page isn't visible + // or the carousel or its parent isn't visible + if (!document.hidden && + ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) { + this.next() + } + } + + prev() { + if (!this._isSliding) { + this._slide(Direction.PREV) + } + } + + pause(event) { + if (!event) { + this._isPaused = true + } + + if (this._element.querySelector(Selector.NEXT_PREV)) { + Util.triggerTransitionEnd(this._element) + this.cycle(true) + } + + clearInterval(this._interval) + this._interval = null + } + + cycle(event) { + if (!event) { + this._isPaused = false + } + + if (this._interval) { + clearInterval(this._interval) + this._interval = null + } + + if (this._config.interval && !this._isPaused) { + this._interval = setInterval( + (document.visibilityState ? this.nextWhenVisible : this.next).bind(this), + this._config.interval + ) + } + } + + to(index) { + this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM) + + const activeIndex = this._getItemIndex(this._activeElement) + + if (index > this._items.length - 1 || index < 0) { + return + } + + if (this._isSliding) { + $(this._element).one(Event.SLID, () => this.to(index)) + return + } + + if (activeIndex === index) { + this.pause() + this.cycle() + return + } + + const direction = index > activeIndex + ? Direction.NEXT + : Direction.PREV + + this._slide(direction, this._items[index]) + } + + dispose() { + $(this._element).off(EVENT_KEY) + $.removeData(this._element, DATA_KEY) + + this._items = null + this._config = null + this._element = null + this._interval = null + this._isPaused = null + this._isSliding = null + this._activeElement = null + this._indicatorsElement = null + } + + // Private + + _getConfig(config) { + config = { + ...Default, + ...config + } + Util.typeCheckConfig(NAME, config, DefaultType) + return config + } + + _addEventListeners() { + if (this._config.keyboard) { + $(this._element) + .on(Event.KEYDOWN, (event) => this._keydown(event)) + } + + if (this._config.pause === 'hover') { + $(this._element) + .on(Event.MOUSEENTER, (event) => this.pause(event)) + .on(Event.MOUSELEAVE, (event) => this.cycle(event)) + if ('ontouchstart' in document.documentElement) { + // 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 + // (as if it's the second time we tap on it, mouseenter compat event + // is NOT fired) and after a timeout (to allow for mouse compatibility + // events to fire) we explicitly restart cycling + $(this._element).on(Event.TOUCHEND, () => { + this.pause() + if (this.touchTimeout) { + clearTimeout(this.touchTimeout) + } + this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval) + }) + } + } + } + + _keydown(event) { + if (/input|textarea/i.test(event.target.tagName)) { + return + } + + switch (event.which) { + case ARROW_LEFT_KEYCODE: + event.preventDefault() + this.prev() + break + case ARROW_RIGHT_KEYCODE: + event.preventDefault() + this.next() + break + default: + } + } + + _getItemIndex(element) { + this._items = element && element.parentNode + ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) + : [] + return this._items.indexOf(element) + } + + _getItemByDirection(direction, activeElement) { + const isNextDirection = direction === Direction.NEXT + const isPrevDirection = direction === Direction.PREV + const activeIndex = this._getItemIndex(activeElement) + const lastItemIndex = this._items.length - 1 + const isGoingToWrap = isPrevDirection && activeIndex === 0 || + isNextDirection && activeIndex === lastItemIndex + + if (isGoingToWrap && !this._config.wrap) { + return activeElement + } + + const delta = direction === Direction.PREV ? -1 : 1 + const itemIndex = (activeIndex + delta) % this._items.length + + return itemIndex === -1 + ? this._items[this._items.length - 1] : this._items[itemIndex] + } + + _triggerSlideEvent(relatedTarget, eventDirectionName) { + const targetIndex = this._getItemIndex(relatedTarget) + const fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM)) + const slideEvent = $.Event(Event.SLIDE, { + relatedTarget, + direction: eventDirectionName, + from: fromIndex, + to: targetIndex + }) + + $(this._element).trigger(slideEvent) + + return slideEvent + } + + _setActiveIndicatorElement(element) { + if (this._indicatorsElement) { + const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE)) + $(indicators) + .removeClass(ClassName.ACTIVE) + + const nextIndicator = this._indicatorsElement.children[ + this._getItemIndex(element) + ] + + if (nextIndicator) { + $(nextIndicator).addClass(ClassName.ACTIVE) + } + } + } + + _slide(direction, element) { + const activeElement = this._element.querySelector(Selector.ACTIVE_ITEM) + const activeElementIndex = this._getItemIndex(activeElement) + const nextElement = element || activeElement && + this._getItemByDirection(direction, activeElement) + const nextElementIndex = this._getItemIndex(nextElement) + const isCycling = Boolean(this._interval) + + let directionalClassName + let orderClassName + let eventDirectionName + + if (direction === Direction.NEXT) { + directionalClassName = ClassName.LEFT + orderClassName = ClassName.NEXT + eventDirectionName = Direction.LEFT + } else { + directionalClassName = ClassName.RIGHT + orderClassName = ClassName.PREV + eventDirectionName = Direction.RIGHT + } + + if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { + this._isSliding = false + return + } + + const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName) + if (slideEvent.isDefaultPrevented()) { + return + } + + if (!activeElement || !nextElement) { + // Some weirdness is happening, so we bail + return + } + + this._isSliding = true + + if (isCycling) { + this.pause() + } + + this._setActiveIndicatorElement(nextElement) + + const slidEvent = $.Event(Event.SLID, { + relatedTarget: nextElement, + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex + }) + + if ($(this._element).hasClass(ClassName.SLIDE)) { + $(nextElement).addClass(orderClassName) + + Util.reflow(nextElement) + + $(activeElement).addClass(directionalClassName) + $(nextElement).addClass(directionalClassName) + + const transitionDuration = Util.getTransitionDurationFromElement(activeElement) + + $(activeElement) + .one(Util.TRANSITION_END, () => { + $(nextElement) + .removeClass(`${directionalClassName} ${orderClassName}`) + .addClass(ClassName.ACTIVE) + + $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`) + + this._isSliding = false + + setTimeout(() => $(this._element).trigger(slidEvent), 0) + }) + .emulateTransitionEnd(transitionDuration) + } else { + $(activeElement).removeClass(ClassName.ACTIVE) + $(nextElement).addClass(ClassName.ACTIVE) + + this._isSliding = false + $(this._element).trigger(slidEvent) + } + + if (isCycling) { + this.cycle() + } + } + + // Static + + static _jQueryInterface(config) { + return this.each(function () { + let data = $(this).data(DATA_KEY) + let _config = { + ...Default, + ...$(this).data() + } + + if (typeof config === 'object') { + _config = { + ..._config, + ...config + } + } + + const action = typeof config === 'string' ? config : _config.slide + + if (!data) { + data = new Carousel(this, _config) + $(this).data(DATA_KEY, data) + } + + if (typeof config === 'number') { + data.to(config) + } else if (typeof action === 'string') { + if (typeof data[action] === 'undefined') { + throw new TypeError(`No method named "${action}"`) + } + data[action]() + } else if (_config.interval) { + data.pause() + data.cycle() + } + }) + } + + static _dataApiClickHandler(event) { + const selector = Util.getSelectorFromElement(this) + + if (!selector) { + return + } + + const target = $(selector)[0] + + if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { + return + } + + const config = { + ...$(target).data(), + ...$(this).data() + } + const slideIndex = this.getAttribute('data-slide-to') + + if (slideIndex) { + config.interval = false + } + + Carousel._jQueryInterface.call($(target), config) + + if (slideIndex) { + $(target).data(DATA_KEY).to(slideIndex) + } + + event.preventDefault() + } + } + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document) + .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler) + + $(window).on(Event.LOAD_DATA_API, () => { + const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE)) + for (let i = 0, len = carousels.length; i < len; i++) { + const $carousel = $(carousels[i]) + Carousel._jQueryInterface.call($carousel, $carousel.data()) + } + }) + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Carousel._jQueryInterface + $.fn[NAME].Constructor = Carousel + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Carousel._jQueryInterface + } + + return Carousel +})($) + +export default Carousel diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/collapse.js b/themes/docsy/assets/vendor/bootstrap/js/src/collapse.js new file mode 100644 index 0000000..9277420 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/collapse.js @@ -0,0 +1,398 @@ +import $ from 'jquery' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): collapse.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Collapse = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'collapse' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.collapse' + const EVENT_KEY = `.${DATA_KEY}` + const DATA_API_KEY = '.data-api' + const JQUERY_NO_CONFLICT = $.fn[NAME] + + const Default = { + toggle : true, + parent : '' + } + + const DefaultType = { + toggle : 'boolean', + parent : '(string|element)' + } + + const Event = { + SHOW : `show${EVENT_KEY}`, + SHOWN : `shown${EVENT_KEY}`, + HIDE : `hide${EVENT_KEY}`, + HIDDEN : `hidden${EVENT_KEY}`, + CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}` + } + + const ClassName = { + SHOW : 'show', + COLLAPSE : 'collapse', + COLLAPSING : 'collapsing', + COLLAPSED : 'collapsed' + } + + const Dimension = { + WIDTH : 'width', + HEIGHT : 'height' + } + + const Selector = { + ACTIVES : '.show, .collapsing', + DATA_TOGGLE : '[data-toggle="collapse"]' + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Collapse { + constructor(element, config) { + this._isTransitioning = false + this._element = element + this._config = this._getConfig(config) + this._triggerArray = $.makeArray(document.querySelectorAll( + `[data-toggle="collapse"][href="#${element.id}"],` + + `[data-toggle="collapse"][data-target="#${element.id}"]` + )) + const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)) + for (let i = 0, len = toggleList.length; i < len; i++) { + const elem = toggleList[i] + const selector = Util.getSelectorFromElement(elem) + const filterElement = [].slice.call(document.querySelectorAll(selector)) + .filter((foundElem) => foundElem === element) + + if (selector !== null && filterElement.length > 0) { + this._selector = selector + this._triggerArray.push(elem) + } + } + + this._parent = this._config.parent ? this._getParent() : null + + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._element, this._triggerArray) + } + + if (this._config.toggle) { + this.toggle() + } + } + + // Getters + + static get VERSION() { + return VERSION + } + + static get Default() { + return Default + } + + // Public + + toggle() { + if ($(this._element).hasClass(ClassName.SHOW)) { + this.hide() + } else { + this.show() + } + } + + show() { + if (this._isTransitioning || + $(this._element).hasClass(ClassName.SHOW)) { + return + } + + let actives + let activesData + + if (this._parent) { + actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)) + .filter((elem) => elem.getAttribute('data-parent') === this._config.parent) + + if (actives.length === 0) { + actives = null + } + } + + if (actives) { + activesData = $(actives).not(this._selector).data(DATA_KEY) + if (activesData && activesData._isTransitioning) { + return + } + } + + const startEvent = $.Event(Event.SHOW) + $(this._element).trigger(startEvent) + if (startEvent.isDefaultPrevented()) { + return + } + + if (actives) { + Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide') + if (!activesData) { + $(actives).data(DATA_KEY, null) + } + } + + const dimension = this._getDimension() + + $(this._element) + .removeClass(ClassName.COLLAPSE) + .addClass(ClassName.COLLAPSING) + + this._element.style[dimension] = 0 + + if (this._triggerArray.length) { + $(this._triggerArray) + .removeClass(ClassName.COLLAPSED) + .attr('aria-expanded', true) + } + + this.setTransitioning(true) + + const complete = () => { + $(this._element) + .removeClass(ClassName.COLLAPSING) + .addClass(ClassName.COLLAPSE) + .addClass(ClassName.SHOW) + + this._element.style[dimension] = '' + + this.setTransitioning(false) + + $(this._element).trigger(Event.SHOWN) + } + + const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1) + const scrollSize = `scroll${capitalizedDimension}` + const transitionDuration = Util.getTransitionDurationFromElement(this._element) + + $(this._element) + .one(Util.TRANSITION_END, complete) + .emulateTransitionEnd(transitionDuration) + + this._element.style[dimension] = `${this._element[scrollSize]}px` + } + + hide() { + if (this._isTransitioning || + !$(this._element).hasClass(ClassName.SHOW)) { + return + } + + const startEvent = $.Event(Event.HIDE) + $(this._element).trigger(startEvent) + if (startEvent.isDefaultPrevented()) { + return + } + + const dimension = this._getDimension() + + this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px` + + Util.reflow(this._element) + + $(this._element) + .addClass(ClassName.COLLAPSING) + .removeClass(ClassName.COLLAPSE) + .removeClass(ClassName.SHOW) + + const triggerArrayLength = this._triggerArray.length + if (triggerArrayLength > 0) { + for (let i = 0; i < triggerArrayLength; i++) { + const trigger = this._triggerArray[i] + const selector = Util.getSelectorFromElement(trigger) + if (selector !== null) { + const $elem = $([].slice.call(document.querySelectorAll(selector))) + if (!$elem.hasClass(ClassName.SHOW)) { + $(trigger).addClass(ClassName.COLLAPSED) + .attr('aria-expanded', false) + } + } + } + } + + this.setTransitioning(true) + + const complete = () => { + this.setTransitioning(false) + $(this._element) + .removeClass(ClassName.COLLAPSING) + .addClass(ClassName.COLLAPSE) + .trigger(Event.HIDDEN) + } + + this._element.style[dimension] = '' + const transitionDuration = Util.getTransitionDurationFromElement(this._element) + + $(this._element) + .one(Util.TRANSITION_END, complete) + .emulateTransitionEnd(transitionDuration) + } + + setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning + } + + dispose() { + $.removeData(this._element, DATA_KEY) + + this._config = null + this._parent = null + this._element = null + this._triggerArray = null + this._isTransitioning = null + } + + // Private + + _getConfig(config) { + config = { + ...Default, + ...config + } + config.toggle = Boolean(config.toggle) // Coerce string values + Util.typeCheckConfig(NAME, config, DefaultType) + return config + } + + _getDimension() { + const hasWidth = $(this._element).hasClass(Dimension.WIDTH) + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT + } + + _getParent() { + let parent = null + if (Util.isElement(this._config.parent)) { + parent = this._config.parent + + // It's a jQuery object + if (typeof this._config.parent.jquery !== 'undefined') { + parent = this._config.parent[0] + } + } else { + parent = document.querySelector(this._config.parent) + } + + const selector = + `[data-toggle="collapse"][data-parent="${this._config.parent}"]` + + const children = [].slice.call(parent.querySelectorAll(selector)) + $(children).each((i, element) => { + this._addAriaAndCollapsedClass( + Collapse._getTargetFromElement(element), + [element] + ) + }) + + return parent + } + + _addAriaAndCollapsedClass(element, triggerArray) { + if (element) { + const isOpen = $(element).hasClass(ClassName.SHOW) + + if (triggerArray.length) { + $(triggerArray) + .toggleClass(ClassName.COLLAPSED, !isOpen) + .attr('aria-expanded', isOpen) + } + } + } + + // Static + + static _getTargetFromElement(element) { + const selector = Util.getSelectorFromElement(element) + return selector ? document.querySelector(selector) : null + } + + static _jQueryInterface(config) { + return this.each(function () { + const $this = $(this) + let data = $this.data(DATA_KEY) + const _config = { + ...Default, + ...$this.data(), + ...typeof config === 'object' && config ? config : {} + } + + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false + } + + if (!data) { + data = new Collapse(this, _config) + $this.data(DATA_KEY, data) + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`) + } + data[config]() + } + }) + } + } + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + // preventDefault only for <a> elements (which change the URL) not inside the collapsible element + if (event.currentTarget.tagName === 'A') { + event.preventDefault() + } + + const $trigger = $(this) + const selector = Util.getSelectorFromElement(this) + const selectors = [].slice.call(document.querySelectorAll(selector)) + $(selectors).each(function () { + const $target = $(this) + const data = $target.data(DATA_KEY) + const config = data ? 'toggle' : $trigger.data() + Collapse._jQueryInterface.call($target, config) + }) + }) + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Collapse._jQueryInterface + $.fn[NAME].Constructor = Collapse + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Collapse._jQueryInterface + } + + return Collapse +})($) + +export default Collapse diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/dropdown.js b/themes/docsy/assets/vendor/bootstrap/js/src/dropdown.js new file mode 100644 index 0000000..072bce6 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/dropdown.js @@ -0,0 +1,494 @@ +import $ from 'jquery' +import Popper from 'popper.js' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): dropdown.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Dropdown = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'dropdown' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.dropdown' + const EVENT_KEY = `.${DATA_KEY}` + const DATA_API_KEY = '.data-api' + const JQUERY_NO_CONFLICT = $.fn[NAME] + const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key + const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key + const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key + const ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key + const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key + const RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse) + const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`) + + const Event = { + HIDE : `hide${EVENT_KEY}`, + HIDDEN : `hidden${EVENT_KEY}`, + SHOW : `show${EVENT_KEY}`, + SHOWN : `shown${EVENT_KEY}`, + CLICK : `click${EVENT_KEY}`, + CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`, + KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`, + KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}` + } + + const ClassName = { + DISABLED : 'disabled', + SHOW : 'show', + DROPUP : 'dropup', + DROPRIGHT : 'dropright', + DROPLEFT : 'dropleft', + MENURIGHT : 'dropdown-menu-right', + MENULEFT : 'dropdown-menu-left', + POSITION_STATIC : 'position-static' + } + + const Selector = { + DATA_TOGGLE : '[data-toggle="dropdown"]', + FORM_CHILD : '.dropdown form', + MENU : '.dropdown-menu', + NAVBAR_NAV : '.navbar-nav', + VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' + } + + const AttachmentMap = { + TOP : 'top-start', + TOPEND : 'top-end', + BOTTOM : 'bottom-start', + BOTTOMEND : 'bottom-end', + RIGHT : 'right-start', + RIGHTEND : 'right-end', + LEFT : 'left-start', + LEFTEND : 'left-end' + } + + const Default = { + offset : 0, + flip : true, + boundary : 'scrollParent', + reference : 'toggle', + display : 'dynamic' + } + + const DefaultType = { + offset : '(number|string|function)', + flip : 'boolean', + boundary : '(string|element)', + reference : '(string|element)', + display : 'string' + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Dropdown { + constructor(element, config) { + this._element = element + this._popper = null + this._config = this._getConfig(config) + this._menu = this._getMenuElement() + this._inNavbar = this._detectNavbar() + + this._addEventListeners() + } + + // Getters + + static get VERSION() { + return VERSION + } + + static get Default() { + return Default + } + + static get DefaultType() { + return DefaultType + } + + // Public + + toggle() { + if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) { + return + } + + const parent = Dropdown._getParentFromElement(this._element) + const isActive = $(this._menu).hasClass(ClassName.SHOW) + + Dropdown._clearMenus() + + if (isActive) { + return + } + + const relatedTarget = { + relatedTarget: this._element + } + const showEvent = $.Event(Event.SHOW, relatedTarget) + + $(parent).trigger(showEvent) + + if (showEvent.isDefaultPrevented()) { + return + } + + // Disable totally Popper.js for Dropdown in Navbar + if (!this._inNavbar) { + /** + * Check for Popper dependency + * Popper - https://popper.js.org + */ + if (typeof Popper === 'undefined') { + throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)') + } + + let referenceElement = this._element + + if (this._config.reference === 'parent') { + referenceElement = parent + } else if (Util.isElement(this._config.reference)) { + referenceElement = this._config.reference + + // Check if it's jQuery element + if (typeof this._config.reference.jquery !== 'undefined') { + referenceElement = this._config.reference[0] + } + } + + // If boundary is not `scrollParent`, then set position to `static` + // to allow the menu to "escape" the scroll parent's boundaries + // https://github.com/twbs/bootstrap/issues/24251 + if (this._config.boundary !== 'scrollParent') { + $(parent).addClass(ClassName.POSITION_STATIC) + } + this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()) + } + + // 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 === 0) { + $(document.body).children().on('mouseover', null, $.noop) + } + + this._element.focus() + this._element.setAttribute('aria-expanded', true) + + $(this._menu).toggleClass(ClassName.SHOW) + $(parent) + .toggleClass(ClassName.SHOW) + .trigger($.Event(Event.SHOWN, relatedTarget)) + } + + dispose() { + $.removeData(this._element, DATA_KEY) + $(this._element).off(EVENT_KEY) + this._element = null + this._menu = null + if (this._popper !== null) { + this._popper.destroy() + this._popper = null + } + } + + update() { + this._inNavbar = this._detectNavbar() + if (this._popper !== null) { + this._popper.scheduleUpdate() + } + } + + // Private + + _addEventListeners() { + $(this._element).on(Event.CLICK, (event) => { + event.preventDefault() + event.stopPropagation() + this.toggle() + }) + } + + _getConfig(config) { + config = { + ...this.constructor.Default, + ...$(this._element).data(), + ...config + } + + Util.typeCheckConfig( + NAME, + config, + this.constructor.DefaultType + ) + + return config + } + + _getMenuElement() { + if (!this._menu) { + const parent = Dropdown._getParentFromElement(this._element) + if (parent) { + this._menu = parent.querySelector(Selector.MENU) + } + } + return this._menu + } + + _getPlacement() { + const $parentDropdown = $(this._element.parentNode) + let placement = AttachmentMap.BOTTOM + + // Handle dropup + if ($parentDropdown.hasClass(ClassName.DROPUP)) { + placement = AttachmentMap.TOP + if ($(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.TOPEND + } + } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) { + placement = AttachmentMap.RIGHT + } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) { + placement = AttachmentMap.LEFT + } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.BOTTOMEND + } + return placement + } + + _detectNavbar() { + return $(this._element).closest('.navbar').length > 0 + } + + _getPopperConfig() { + const offsetConf = {} + if (typeof this._config.offset === 'function') { + offsetConf.fn = (data) => { + data.offsets = { + ...data.offsets, + ...this._config.offset(data.offsets) || {} + } + return data + } + } else { + offsetConf.offset = this._config.offset + } + + const popperConfig = { + placement: this._getPlacement(), + modifiers: { + offset: offsetConf, + flip: { + enabled: this._config.flip + }, + preventOverflow: { + boundariesElement: this._config.boundary + } + } + } + + // Disable Popper.js if we have a static display + if (this._config.display === 'static') { + popperConfig.modifiers.applyStyle = { + enabled: false + } + } + return popperConfig + } + + // Static + + static _jQueryInterface(config) { + return this.each(function () { + let data = $(this).data(DATA_KEY) + const _config = typeof config === 'object' ? config : null + + if (!data) { + data = new Dropdown(this, _config) + $(this).data(DATA_KEY, data) + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`) + } + data[config]() + } + }) + } + + static _clearMenus(event) { + if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || + event.type === 'keyup' && event.which !== TAB_KEYCODE)) { + return + } + + const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)) + for (let i = 0, len = toggles.length; i < len; i++) { + const parent = Dropdown._getParentFromElement(toggles[i]) + const context = $(toggles[i]).data(DATA_KEY) + const relatedTarget = { + relatedTarget: toggles[i] + } + + if (event && event.type === 'click') { + relatedTarget.clickEvent = event + } + + if (!context) { + continue + } + + const dropdownMenu = context._menu + if (!$(parent).hasClass(ClassName.SHOW)) { + continue + } + + if (event && (event.type === 'click' && + /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && + $.contains(parent, event.target)) { + continue + } + + const hideEvent = $.Event(Event.HIDE, relatedTarget) + $(parent).trigger(hideEvent) + if (hideEvent.isDefaultPrevented()) { + continue + } + + // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + $(document.body).children().off('mouseover', null, $.noop) + } + + toggles[i].setAttribute('aria-expanded', 'false') + + $(dropdownMenu).removeClass(ClassName.SHOW) + $(parent) + .removeClass(ClassName.SHOW) + .trigger($.Event(Event.HIDDEN, relatedTarget)) + } + } + + static _getParentFromElement(element) { + let parent + const selector = Util.getSelectorFromElement(element) + + if (selector) { + parent = document.querySelector(selector) + } + + return parent || element.parentNode + } + + // eslint-disable-next-line complexity + static _dataApiKeydownHandler(event) { + // If not input/textarea: + // - And not a key in REGEXP_KEYDOWN => not a dropdown command + // If input/textarea: + // - If space key => not a dropdown command + // - If key is other than escape + // - If key is not up or down => not a dropdown command + // - If trigger inside the menu => not a dropdown command + if (/input|textarea/i.test(event.target.tagName) + ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && + (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || + $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { + return + } + + event.preventDefault() + event.stopPropagation() + + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return + } + + const parent = Dropdown._getParentFromElement(this) + const isActive = $(parent).hasClass(ClassName.SHOW) + + if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || + isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { + if (event.which === ESCAPE_KEYCODE) { + const toggle = parent.querySelector(Selector.DATA_TOGGLE) + $(toggle).trigger('focus') + } + + $(this).trigger('click') + return + } + + const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS)) + + if (items.length === 0) { + return + } + + let index = items.indexOf(event.target) + + if (event.which === ARROW_UP_KEYCODE && index > 0) { // Up + index-- + } + + if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // Down + index++ + } + + if (index < 0) { + index = 0 + } + + items[index].focus() + } + } + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document) + .on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler) + .on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler) + .on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus) + .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + event.preventDefault() + event.stopPropagation() + Dropdown._jQueryInterface.call($(this), 'toggle') + }) + .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => { + e.stopPropagation() + }) + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Dropdown._jQueryInterface + $.fn[NAME].Constructor = Dropdown + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Dropdown._jQueryInterface + } + + return Dropdown +})($, Popper) + +export default Dropdown diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/index.js b/themes/docsy/assets/vendor/bootstrap/js/src/index.js new file mode 100644 index 0000000..7304b69 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/index.js @@ -0,0 +1,50 @@ +import $ from 'jquery' +import Alert from './alert' +import Button from './button' +import Carousel from './carousel' +import Collapse from './collapse' +import Dropdown from './dropdown' +import Modal from './modal' +import Popover from './popover' +import Scrollspy from './scrollspy' +import Tab from './tab' +import Tooltip from './tooltip' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): index.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +(($) => { + if (typeof $ === 'undefined') { + throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.') + } + + const version = $.fn.jquery.split(' ')[0].split('.') + const minMajor = 1 + const ltMajor = 2 + const minMinor = 9 + const minPatch = 1 + const maxMajor = 4 + + if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { + throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0') + } +})($) + +export { + Util, + Alert, + Button, + Carousel, + Collapse, + Dropdown, + Modal, + Popover, + Scrollspy, + Tab, + Tooltip +} diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/modal.js b/themes/docsy/assets/vendor/bootstrap/js/src/modal.js new file mode 100644 index 0000000..ddcf370 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/modal.js @@ -0,0 +1,579 @@ +import $ from 'jquery' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): modal.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Modal = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'modal' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.modal' + const EVENT_KEY = `.${DATA_KEY}` + const DATA_API_KEY = '.data-api' + const JQUERY_NO_CONFLICT = $.fn[NAME] + const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key + + const Default = { + backdrop : true, + keyboard : true, + focus : true, + show : true + } + + const DefaultType = { + backdrop : '(boolean|string)', + keyboard : 'boolean', + focus : 'boolean', + show : 'boolean' + } + + const Event = { + HIDE : `hide${EVENT_KEY}`, + HIDDEN : `hidden${EVENT_KEY}`, + SHOW : `show${EVENT_KEY}`, + SHOWN : `shown${EVENT_KEY}`, + FOCUSIN : `focusin${EVENT_KEY}`, + RESIZE : `resize${EVENT_KEY}`, + CLICK_DISMISS : `click.dismiss${EVENT_KEY}`, + KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`, + MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`, + MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`, + CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}` + } + + const ClassName = { + SCROLLBAR_MEASURER : 'modal-scrollbar-measure', + BACKDROP : 'modal-backdrop', + OPEN : 'modal-open', + FADE : 'fade', + SHOW : 'show' + } + + const Selector = { + DIALOG : '.modal-dialog', + DATA_TOGGLE : '[data-toggle="modal"]', + DATA_DISMISS : '[data-dismiss="modal"]', + FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', + STICKY_CONTENT : '.sticky-top' + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Modal { + constructor(element, config) { + this._config = this._getConfig(config) + this._element = element + this._dialog = element.querySelector(Selector.DIALOG) + this._backdrop = null + this._isShown = false + this._isBodyOverflowing = false + this._ignoreBackdropClick = false + this._scrollbarWidth = 0 + } + + // Getters + + static get VERSION() { + return VERSION + } + + static get Default() { + return Default + } + + // Public + + toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget) + } + + show(relatedTarget) { + if (this._isTransitioning || this._isShown) { + return + } + + if ($(this._element).hasClass(ClassName.FADE)) { + this._isTransitioning = true + } + + const showEvent = $.Event(Event.SHOW, { + relatedTarget + }) + + $(this._element).trigger(showEvent) + + if (this._isShown || showEvent.isDefaultPrevented()) { + return + } + + this._isShown = true + + this._checkScrollbar() + this._setScrollbar() + + this._adjustDialog() + + $(document.body).addClass(ClassName.OPEN) + + this._setEscapeEvent() + this._setResizeEvent() + + $(this._element).on( + Event.CLICK_DISMISS, + Selector.DATA_DISMISS, + (event) => this.hide(event) + ) + + $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => { + $(this._element).one(Event.MOUSEUP_DISMISS, (event) => { + if ($(event.target).is(this._element)) { + this._ignoreBackdropClick = true + } + }) + }) + + this._showBackdrop(() => this._showElement(relatedTarget)) + } + + hide(event) { + if (event) { + event.preventDefault() + } + + if (this._isTransitioning || !this._isShown) { + return + } + + const hideEvent = $.Event(Event.HIDE) + + $(this._element).trigger(hideEvent) + + if (!this._isShown || hideEvent.isDefaultPrevented()) { + return + } + + this._isShown = false + const transition = $(this._element).hasClass(ClassName.FADE) + + if (transition) { + this._isTransitioning = true + } + + this._setEscapeEvent() + this._setResizeEvent() + + $(document).off(Event.FOCUSIN) + + $(this._element).removeClass(ClassName.SHOW) + + $(this._element).off(Event.CLICK_DISMISS) + $(this._dialog).off(Event.MOUSEDOWN_DISMISS) + + + if (transition) { + const transitionDuration = Util.getTransitionDurationFromElement(this._element) + + $(this._element) + .one(Util.TRANSITION_END, (event) => this._hideModal(event)) + .emulateTransitionEnd(transitionDuration) + } else { + this._hideModal() + } + } + + dispose() { + $.removeData(this._element, DATA_KEY) + + $(window, document, this._element, this._backdrop).off(EVENT_KEY) + + this._config = null + this._element = null + this._dialog = null + this._backdrop = null + this._isShown = null + this._isBodyOverflowing = null + this._ignoreBackdropClick = null + this._scrollbarWidth = null + } + + handleUpdate() { + this._adjustDialog() + } + + // Private + + _getConfig(config) { + config = { + ...Default, + ...config + } + Util.typeCheckConfig(NAME, config, DefaultType) + return config + } + + _showElement(relatedTarget) { + const transition = $(this._element).hasClass(ClassName.FADE) + + if (!this._element.parentNode || + this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + // Don't move modal's DOM position + document.body.appendChild(this._element) + } + + this._element.style.display = 'block' + this._element.removeAttribute('aria-hidden') + this._element.scrollTop = 0 + + if (transition) { + Util.reflow(this._element) + } + + $(this._element).addClass(ClassName.SHOW) + + if (this._config.focus) { + this._enforceFocus() + } + + const shownEvent = $.Event(Event.SHOWN, { + relatedTarget + }) + + const transitionComplete = () => { + if (this._config.focus) { + this._element.focus() + } + this._isTransitioning = false + $(this._element).trigger(shownEvent) + } + + if (transition) { + const transitionDuration = Util.getTransitionDurationFromElement(this._element) + + $(this._dialog) + .one(Util.TRANSITION_END, transitionComplete) + .emulateTransitionEnd(transitionDuration) + } else { + transitionComplete() + } + } + + _enforceFocus() { + $(document) + .off(Event.FOCUSIN) // Guard against infinite focus loop + .on(Event.FOCUSIN, (event) => { + if (document !== event.target && + this._element !== event.target && + $(this._element).has(event.target).length === 0) { + this._element.focus() + } + }) + } + + _setEscapeEvent() { + if (this._isShown && this._config.keyboard) { + $(this._element).on(Event.KEYDOWN_DISMISS, (event) => { + if (event.which === ESCAPE_KEYCODE) { + event.preventDefault() + this.hide() + } + }) + } else if (!this._isShown) { + $(this._element).off(Event.KEYDOWN_DISMISS) + } + } + + _setResizeEvent() { + if (this._isShown) { + $(window).on(Event.RESIZE, (event) => this.handleUpdate(event)) + } else { + $(window).off(Event.RESIZE) + } + } + + _hideModal() { + this._element.style.display = 'none' + this._element.setAttribute('aria-hidden', true) + this._isTransitioning = false + this._showBackdrop(() => { + $(document.body).removeClass(ClassName.OPEN) + this._resetAdjustments() + this._resetScrollbar() + $(this._element).trigger(Event.HIDDEN) + }) + } + + _removeBackdrop() { + if (this._backdrop) { + $(this._backdrop).remove() + this._backdrop = null + } + } + + _showBackdrop(callback) { + const animate = $(this._element).hasClass(ClassName.FADE) + ? ClassName.FADE : '' + + if (this._isShown && this._config.backdrop) { + this._backdrop = document.createElement('div') + this._backdrop.className = ClassName.BACKDROP + + if (animate) { + this._backdrop.classList.add(animate) + } + + $(this._backdrop).appendTo(document.body) + + $(this._element).on(Event.CLICK_DISMISS, (event) => { + if (this._ignoreBackdropClick) { + this._ignoreBackdropClick = false + return + } + if (event.target !== event.currentTarget) { + return + } + if (this._config.backdrop === 'static') { + this._element.focus() + } else { + this.hide() + } + }) + + if (animate) { + Util.reflow(this._backdrop) + } + + $(this._backdrop).addClass(ClassName.SHOW) + + if (!callback) { + return + } + + if (!animate) { + callback() + return + } + + const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop) + + $(this._backdrop) + .one(Util.TRANSITION_END, callback) + .emulateTransitionEnd(backdropTransitionDuration) + } else if (!this._isShown && this._backdrop) { + $(this._backdrop).removeClass(ClassName.SHOW) + + const callbackRemove = () => { + this._removeBackdrop() + if (callback) { + callback() + } + } + + if ($(this._element).hasClass(ClassName.FADE)) { + const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop) + + $(this._backdrop) + .one(Util.TRANSITION_END, callbackRemove) + .emulateTransitionEnd(backdropTransitionDuration) + } else { + callbackRemove() + } + } else if (callback) { + callback() + } + } + + // ---------------------------------------------------------------------- + // the following methods are used to handle overflowing modals + // todo (fat): these should probably be refactored out of modal.js + // ---------------------------------------------------------------------- + + _adjustDialog() { + const isModalOverflowing = + this._element.scrollHeight > document.documentElement.clientHeight + + if (!this._isBodyOverflowing && isModalOverflowing) { + this._element.style.paddingLeft = `${this._scrollbarWidth}px` + } + + if (this._isBodyOverflowing && !isModalOverflowing) { + this._element.style.paddingRight = `${this._scrollbarWidth}px` + } + } + + _resetAdjustments() { + this._element.style.paddingLeft = '' + this._element.style.paddingRight = '' + } + + _checkScrollbar() { + const rect = document.body.getBoundingClientRect() + this._isBodyOverflowing = rect.left + rect.right < window.innerWidth + this._scrollbarWidth = this._getScrollbarWidth() + } + + _setScrollbar() { + if (this._isBodyOverflowing) { + // Note: DOMNode.style.paddingRight returns the actual value or '' if not set + // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set + const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)) + const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)) + + // Adjust fixed content padding + $(fixedContent).each((index, element) => { + const actualPadding = element.style.paddingRight + const calculatedPadding = $(element).css('padding-right') + $(element) + .data('padding-right', actualPadding) + .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`) + }) + + // Adjust sticky content margin + $(stickyContent).each((index, element) => { + const actualMargin = element.style.marginRight + const calculatedMargin = $(element).css('margin-right') + $(element) + .data('margin-right', actualMargin) + .css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`) + }) + + // Adjust body padding + const actualPadding = document.body.style.paddingRight + const calculatedPadding = $(document.body).css('padding-right') + $(document.body) + .data('padding-right', actualPadding) + .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`) + } + } + + _resetScrollbar() { + // Restore fixed content padding + const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)) + $(fixedContent).each((index, element) => { + const padding = $(element).data('padding-right') + $(element).removeData('padding-right') + element.style.paddingRight = padding ? padding : '' + }) + + // Restore sticky content + const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`)) + $(elements).each((index, element) => { + const margin = $(element).data('margin-right') + if (typeof margin !== 'undefined') { + $(element).css('margin-right', margin).removeData('margin-right') + } + }) + + // Restore body padding + const padding = $(document.body).data('padding-right') + $(document.body).removeData('padding-right') + document.body.style.paddingRight = padding ? padding : '' + } + + _getScrollbarWidth() { // thx d.walsh + const scrollDiv = document.createElement('div') + scrollDiv.className = ClassName.SCROLLBAR_MEASURER + document.body.appendChild(scrollDiv) + const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth + document.body.removeChild(scrollDiv) + return scrollbarWidth + } + + // Static + + static _jQueryInterface(config, relatedTarget) { + return this.each(function () { + let data = $(this).data(DATA_KEY) + const _config = { + ...Default, + ...$(this).data(), + ...typeof config === 'object' && config ? config : {} + } + + if (!data) { + data = new Modal(this, _config) + $(this).data(DATA_KEY, data) + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`) + } + data[config](relatedTarget) + } else if (_config.show) { + data.show(relatedTarget) + } + }) + } + } + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + let target + const selector = Util.getSelectorFromElement(this) + + if (selector) { + target = document.querySelector(selector) + } + + const config = $(target).data(DATA_KEY) + ? 'toggle' : { + ...$(target).data(), + ...$(this).data() + } + + if (this.tagName === 'A' || this.tagName === 'AREA') { + event.preventDefault() + } + + const $target = $(target).one(Event.SHOW, (showEvent) => { + if (showEvent.isDefaultPrevented()) { + // Only register focus restorer if modal will actually get shown + return + } + + $target.one(Event.HIDDEN, () => { + if ($(this).is(':visible')) { + this.focus() + } + }) + }) + + Modal._jQueryInterface.call($(target), config, this) + }) + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Modal._jQueryInterface + $.fn[NAME].Constructor = Modal + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Modal._jQueryInterface + } + + return Modal +})($) + +export default Modal diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/popover.js b/themes/docsy/assets/vendor/bootstrap/js/src/popover.js new file mode 100644 index 0000000..eade7cf --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/popover.js @@ -0,0 +1,188 @@ +import $ from 'jquery' +import Tooltip from './tooltip' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): popover.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Popover = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'popover' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.popover' + const EVENT_KEY = `.${DATA_KEY}` + const JQUERY_NO_CONFLICT = $.fn[NAME] + const CLASS_PREFIX = 'bs-popover' + const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g') + + const Default = { + ...Tooltip.Default, + placement : 'right', + trigger : 'click', + content : '', + template : '<div class="popover" role="tooltip">' + + '<div class="arrow"></div>' + + '<h3 class="popover-header"></h3>' + + '<div class="popover-body"></div></div>' + } + + const DefaultType = { + ...Tooltip.DefaultType, + content : '(string|element|function)' + } + + const ClassName = { + FADE : 'fade', + SHOW : 'show' + } + + const Selector = { + TITLE : '.popover-header', + CONTENT : '.popover-body' + } + + const Event = { + HIDE : `hide${EVENT_KEY}`, + HIDDEN : `hidden${EVENT_KEY}`, + SHOW : `show${EVENT_KEY}`, + SHOWN : `shown${EVENT_KEY}`, + INSERTED : `inserted${EVENT_KEY}`, + CLICK : `click${EVENT_KEY}`, + FOCUSIN : `focusin${EVENT_KEY}`, + FOCUSOUT : `focusout${EVENT_KEY}`, + MOUSEENTER : `mouseenter${EVENT_KEY}`, + MOUSELEAVE : `mouseleave${EVENT_KEY}` + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Popover extends Tooltip { + // Getters + + static get VERSION() { + return VERSION + } + + static get Default() { + return Default + } + + static get NAME() { + return NAME + } + + static get DATA_KEY() { + return DATA_KEY + } + + static get Event() { + return Event + } + + static get EVENT_KEY() { + return EVENT_KEY + } + + static get DefaultType() { + return DefaultType + } + + // Overrides + + isWithContent() { + return this.getTitle() || this._getContent() + } + + addAttachmentClass(attachment) { + $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`) + } + + getTipElement() { + this.tip = this.tip || $(this.config.template)[0] + return this.tip + } + + setContent() { + const $tip = $(this.getTipElement()) + + // We use append for html objects to maintain js events + this.setElementContent($tip.find(Selector.TITLE), this.getTitle()) + let content = this._getContent() + if (typeof content === 'function') { + content = content.call(this.element) + } + this.setElementContent($tip.find(Selector.CONTENT), content) + + $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`) + } + + // Private + + _getContent() { + return this.element.getAttribute('data-content') || + this.config.content + } + + _cleanTipClass() { + const $tip = $(this.getTipElement()) + const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX) + if (tabClass !== null && tabClass.length > 0) { + $tip.removeClass(tabClass.join('')) + } + } + + // Static + + static _jQueryInterface(config) { + return this.each(function () { + let data = $(this).data(DATA_KEY) + const _config = typeof config === 'object' ? config : null + + if (!data && /destroy|hide/.test(config)) { + return + } + + if (!data) { + data = new Popover(this, _config) + $(this).data(DATA_KEY, data) + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`) + } + data[config]() + } + }) + } + } + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Popover._jQueryInterface + $.fn[NAME].Constructor = Popover + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Popover._jQueryInterface + } + + return Popover +})($) + +export default Popover diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/scrollspy.js b/themes/docsy/assets/vendor/bootstrap/js/src/scrollspy.js new file mode 100644 index 0000000..5cbffc6 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/scrollspy.js @@ -0,0 +1,332 @@ +import $ from 'jquery' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): scrollspy.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const ScrollSpy = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'scrollspy' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.scrollspy' + const EVENT_KEY = `.${DATA_KEY}` + const DATA_API_KEY = '.data-api' + const JQUERY_NO_CONFLICT = $.fn[NAME] + + const Default = { + offset : 10, + method : 'auto', + target : '' + } + + const DefaultType = { + offset : 'number', + method : 'string', + target : '(string|element)' + } + + const Event = { + ACTIVATE : `activate${EVENT_KEY}`, + SCROLL : `scroll${EVENT_KEY}`, + LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}` + } + + const ClassName = { + DROPDOWN_ITEM : 'dropdown-item', + DROPDOWN_MENU : 'dropdown-menu', + ACTIVE : 'active' + } + + const Selector = { + DATA_SPY : '[data-spy="scroll"]', + ACTIVE : '.active', + NAV_LIST_GROUP : '.nav, .list-group', + NAV_LINKS : '.nav-link', + NAV_ITEMS : '.nav-item', + LIST_ITEMS : '.list-group-item', + DROPDOWN : '.dropdown', + DROPDOWN_ITEMS : '.dropdown-item', + DROPDOWN_TOGGLE : '.dropdown-toggle' + } + + const OffsetMethod = { + OFFSET : 'offset', + POSITION : 'position' + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class ScrollSpy { + constructor(element, config) { + this._element = element + this._scrollElement = element.tagName === 'BODY' ? window : element + this._config = this._getConfig(config) + this._selector = `${this._config.target} ${Selector.NAV_LINKS},` + + `${this._config.target} ${Selector.LIST_ITEMS},` + + `${this._config.target} ${Selector.DROPDOWN_ITEMS}` + this._offsets = [] + this._targets = [] + this._activeTarget = null + this._scrollHeight = 0 + + $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event)) + + this.refresh() + this._process() + } + + // Getters + + static get VERSION() { + return VERSION + } + + static get Default() { + return Default + } + + // Public + + refresh() { + const autoMethod = this._scrollElement === this._scrollElement.window + ? OffsetMethod.OFFSET : OffsetMethod.POSITION + + const offsetMethod = this._config.method === 'auto' + ? autoMethod : this._config.method + + const offsetBase = offsetMethod === OffsetMethod.POSITION + ? this._getScrollTop() : 0 + + this._offsets = [] + this._targets = [] + + this._scrollHeight = this._getScrollHeight() + + const targets = [].slice.call(document.querySelectorAll(this._selector)) + + targets + .map((element) => { + let target + const targetSelector = Util.getSelectorFromElement(element) + + if (targetSelector) { + target = document.querySelector(targetSelector) + } + + if (target) { + const targetBCR = target.getBoundingClientRect() + if (targetBCR.width || targetBCR.height) { + // TODO (fat): remove sketch reliance on jQuery position/offset + return [ + $(target)[offsetMethod]().top + offsetBase, + targetSelector + ] + } + } + return null + }) + .filter((item) => item) + .sort((a, b) => a[0] - b[0]) + .forEach((item) => { + this._offsets.push(item[0]) + this._targets.push(item[1]) + }) + } + + dispose() { + $.removeData(this._element, DATA_KEY) + $(this._scrollElement).off(EVENT_KEY) + + this._element = null + this._scrollElement = null + this._config = null + this._selector = null + this._offsets = null + this._targets = null + this._activeTarget = null + this._scrollHeight = null + } + + // Private + + _getConfig(config) { + config = { + ...Default, + ...typeof config === 'object' && config ? config : {} + } + + if (typeof config.target !== 'string') { + let id = $(config.target).attr('id') + if (!id) { + id = Util.getUID(NAME) + $(config.target).attr('id', id) + } + config.target = `#${id}` + } + + Util.typeCheckConfig(NAME, config, DefaultType) + + return config + } + + _getScrollTop() { + return this._scrollElement === window + ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop + } + + _getScrollHeight() { + return this._scrollElement.scrollHeight || Math.max( + document.body.scrollHeight, + document.documentElement.scrollHeight + ) + } + + _getOffsetHeight() { + return this._scrollElement === window + ? window.innerHeight : this._scrollElement.getBoundingClientRect().height + } + + _process() { + const scrollTop = this._getScrollTop() + this._config.offset + const scrollHeight = this._getScrollHeight() + const maxScroll = this._config.offset + + scrollHeight - + this._getOffsetHeight() + + if (this._scrollHeight !== scrollHeight) { + this.refresh() + } + + if (scrollTop >= maxScroll) { + const target = this._targets[this._targets.length - 1] + + if (this._activeTarget !== target) { + this._activate(target) + } + return + } + + if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { + this._activeTarget = null + this._clear() + return + } + + const offsetLength = this._offsets.length + for (let i = offsetLength; i--;) { + const isActiveTarget = this._activeTarget !== this._targets[i] && + scrollTop >= this._offsets[i] && + (typeof this._offsets[i + 1] === 'undefined' || + scrollTop < this._offsets[i + 1]) + + if (isActiveTarget) { + this._activate(this._targets[i]) + } + } + } + + _activate(target) { + this._activeTarget = target + + this._clear() + + let queries = this._selector.split(',') + // eslint-disable-next-line arrow-body-style + queries = queries.map((selector) => { + return `${selector}[data-target="${target}"],` + + `${selector}[href="${target}"]` + }) + + const $link = $([].slice.call(document.querySelectorAll(queries.join(',')))) + + if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { + $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE) + $link.addClass(ClassName.ACTIVE) + } else { + // Set triggered link as active + $link.addClass(ClassName.ACTIVE) + // Set triggered links parents as active + // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor + $link.parents(Selector.NAV_LIST_GROUP).prev(`${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`).addClass(ClassName.ACTIVE) + // Handle special case when .nav-link is inside .nav-item + $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE) + } + + $(this._scrollElement).trigger(Event.ACTIVATE, { + relatedTarget: target + }) + } + + _clear() { + const nodes = [].slice.call(document.querySelectorAll(this._selector)) + $(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE) + } + + // Static + + static _jQueryInterface(config) { + return this.each(function () { + let data = $(this).data(DATA_KEY) + const _config = typeof config === 'object' && config + + if (!data) { + data = new ScrollSpy(this, _config) + $(this).data(DATA_KEY, data) + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`) + } + data[config]() + } + }) + } + } + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(window).on(Event.LOAD_DATA_API, () => { + const scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY)) + + const scrollSpysLength = scrollSpys.length + for (let i = scrollSpysLength; i--;) { + const $spy = $(scrollSpys[i]) + ScrollSpy._jQueryInterface.call($spy, $spy.data()) + } + }) + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = ScrollSpy._jQueryInterface + $.fn[NAME].Constructor = ScrollSpy + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return ScrollSpy._jQueryInterface + } + + return ScrollSpy +})($) + +export default ScrollSpy diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/tab.js b/themes/docsy/assets/vendor/bootstrap/js/src/tab.js new file mode 100644 index 0000000..a91b088 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/tab.js @@ -0,0 +1,264 @@ +import $ from 'jquery' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): tab.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Tab = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'tab' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.tab' + const EVENT_KEY = `.${DATA_KEY}` + const DATA_API_KEY = '.data-api' + const JQUERY_NO_CONFLICT = $.fn[NAME] + + const Event = { + HIDE : `hide${EVENT_KEY}`, + HIDDEN : `hidden${EVENT_KEY}`, + SHOW : `show${EVENT_KEY}`, + SHOWN : `shown${EVENT_KEY}`, + CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}` + } + + const ClassName = { + DROPDOWN_MENU : 'dropdown-menu', + ACTIVE : 'active', + DISABLED : 'disabled', + FADE : 'fade', + SHOW : 'show' + } + + const Selector = { + DROPDOWN : '.dropdown', + NAV_LIST_GROUP : '.nav, .list-group', + ACTIVE : '.active', + ACTIVE_UL : '> li > .active', + DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', + DROPDOWN_TOGGLE : '.dropdown-toggle', + DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active' + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Tab { + constructor(element) { + this._element = element + } + + // Getters + + static get VERSION() { + return VERSION + } + + // Public + + show() { + if (this._element.parentNode && + this._element.parentNode.nodeType === Node.ELEMENT_NODE && + $(this._element).hasClass(ClassName.ACTIVE) || + $(this._element).hasClass(ClassName.DISABLED)) { + return + } + + let target + let previous + const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0] + const selector = Util.getSelectorFromElement(this._element) + + if (listElement) { + const itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE + previous = $.makeArray($(listElement).find(itemSelector)) + previous = previous[previous.length - 1] + } + + const hideEvent = $.Event(Event.HIDE, { + relatedTarget: this._element + }) + + const showEvent = $.Event(Event.SHOW, { + relatedTarget: previous + }) + + if (previous) { + $(previous).trigger(hideEvent) + } + + $(this._element).trigger(showEvent) + + if (showEvent.isDefaultPrevented() || + hideEvent.isDefaultPrevented()) { + return + } + + if (selector) { + target = document.querySelector(selector) + } + + this._activate( + this._element, + listElement + ) + + const complete = () => { + const hiddenEvent = $.Event(Event.HIDDEN, { + relatedTarget: this._element + }) + + const shownEvent = $.Event(Event.SHOWN, { + relatedTarget: previous + }) + + $(previous).trigger(hiddenEvent) + $(this._element).trigger(shownEvent) + } + + if (target) { + this._activate(target, target.parentNode, complete) + } else { + complete() + } + } + + dispose() { + $.removeData(this._element, DATA_KEY) + this._element = null + } + + // Private + + _activate(element, container, callback) { + let activeElements + if (container.nodeName === 'UL') { + activeElements = $(container).find(Selector.ACTIVE_UL) + } else { + activeElements = $(container).children(Selector.ACTIVE) + } + + const active = activeElements[0] + const isTransitioning = callback && + (active && $(active).hasClass(ClassName.FADE)) + + const complete = () => this._transitionComplete( + element, + active, + callback + ) + + if (active && isTransitioning) { + const transitionDuration = Util.getTransitionDurationFromElement(active) + + $(active) + .one(Util.TRANSITION_END, complete) + .emulateTransitionEnd(transitionDuration) + } else { + complete() + } + } + + _transitionComplete(element, active, callback) { + if (active) { + $(active).removeClass(`${ClassName.SHOW} ${ClassName.ACTIVE}`) + + const dropdownChild = $(active.parentNode).find( + Selector.DROPDOWN_ACTIVE_CHILD + )[0] + + if (dropdownChild) { + $(dropdownChild).removeClass(ClassName.ACTIVE) + } + + if (active.getAttribute('role') === 'tab') { + active.setAttribute('aria-selected', false) + } + } + + $(element).addClass(ClassName.ACTIVE) + if (element.getAttribute('role') === 'tab') { + element.setAttribute('aria-selected', true) + } + + Util.reflow(element) + $(element).addClass(ClassName.SHOW) + + if (element.parentNode && + $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { + const dropdownElement = $(element).closest(Selector.DROPDOWN)[0] + if (dropdownElement) { + const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE)) + $(dropdownToggleList).addClass(ClassName.ACTIVE) + } + + element.setAttribute('aria-expanded', true) + } + + if (callback) { + callback() + } + } + + // Static + + static _jQueryInterface(config) { + return this.each(function () { + const $this = $(this) + let data = $this.data(DATA_KEY) + + if (!data) { + data = new Tab(this) + $this.data(DATA_KEY, data) + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`) + } + data[config]() + } + }) + } + } + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document) + .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + event.preventDefault() + Tab._jQueryInterface.call($(this), 'show') + }) + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Tab._jQueryInterface + $.fn[NAME].Constructor = Tab + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Tab._jQueryInterface + } + + return Tab +})($) + +export default Tab diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/tooltip.js b/themes/docsy/assets/vendor/bootstrap/js/src/tooltip.js new file mode 100644 index 0000000..72d9ba1 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/tooltip.js @@ -0,0 +1,725 @@ +import $ from 'jquery' +import Popper from 'popper.js' +import Util from './util' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): tooltip.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Tooltip = (($) => { + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'tooltip' + const VERSION = '4.1.3' + const DATA_KEY = 'bs.tooltip' + const EVENT_KEY = `.${DATA_KEY}` + const JQUERY_NO_CONFLICT = $.fn[NAME] + const CLASS_PREFIX = 'bs-tooltip' + const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g') + + const DefaultType = { + animation : 'boolean', + template : 'string', + title : '(string|element|function)', + trigger : 'string', + delay : '(number|object)', + html : 'boolean', + selector : '(string|boolean)', + placement : '(string|function)', + offset : '(number|string)', + container : '(string|element|boolean)', + fallbackPlacement : '(string|array)', + boundary : '(string|element)' + } + + const AttachmentMap = { + AUTO : 'auto', + TOP : 'top', + RIGHT : 'right', + BOTTOM : 'bottom', + LEFT : 'left' + } + + const Default = { + animation : true, + template : '<div class="tooltip" role="tooltip">' + + '<div class="arrow"></div>' + + '<div class="tooltip-inner"></div></div>', + trigger : 'hover focus', + title : '', + delay : 0, + html : false, + selector : false, + placement : 'top', + offset : 0, + container : false, + fallbackPlacement : 'flip', + boundary : 'scrollParent' + } + + const HoverState = { + SHOW : 'show', + OUT : 'out' + } + + const Event = { + HIDE : `hide${EVENT_KEY}`, + HIDDEN : `hidden${EVENT_KEY}`, + SHOW : `show${EVENT_KEY}`, + SHOWN : `shown${EVENT_KEY}`, + INSERTED : `inserted${EVENT_KEY}`, + CLICK : `click${EVENT_KEY}`, + FOCUSIN : `focusin${EVENT_KEY}`, + FOCUSOUT : `focusout${EVENT_KEY}`, + MOUSEENTER : `mouseenter${EVENT_KEY}`, + MOUSELEAVE : `mouseleave${EVENT_KEY}` + } + + const ClassName = { + FADE : 'fade', + SHOW : 'show' + } + + const Selector = { + TOOLTIP : '.tooltip', + TOOLTIP_INNER : '.tooltip-inner', + ARROW : '.arrow' + } + + const Trigger = { + HOVER : 'hover', + FOCUS : 'focus', + CLICK : 'click', + MANUAL : 'manual' + } + + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Tooltip { + constructor(element, config) { + /** + * Check for Popper dependency + * Popper - https://popper.js.org + */ + if (typeof Popper === 'undefined') { + throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)') + } + + // private + this._isEnabled = true + this._timeout = 0 + this._hoverState = '' + this._activeTrigger = {} + this._popper = null + + // Protected + this.element = element + this.config = this._getConfig(config) + this.tip = null + + this._setListeners() + } + + // Getters + + static get VERSION() { + return VERSION + } + + static get Default() { + return Default + } + + static get NAME() { + return NAME + } + + static get DATA_KEY() { + return DATA_KEY + } + + static get Event() { + return Event + } + + static get EVENT_KEY() { + return EVENT_KEY + } + + static get DefaultType() { + return DefaultType + } + + // Public + + enable() { + this._isEnabled = true + } + + disable() { + this._isEnabled = false + } + + toggleEnabled() { + this._isEnabled = !this._isEnabled + } + + toggle(event) { + if (!this._isEnabled) { + return + } + + if (event) { + const dataKey = this.constructor.DATA_KEY + let context = $(event.currentTarget).data(dataKey) + + if (!context) { + context = new this.constructor( + event.currentTarget, + this._getDelegateConfig() + ) + $(event.currentTarget).data(dataKey, context) + } + + context._activeTrigger.click = !context._activeTrigger.click + + if (context._isWithActiveTrigger()) { + context._enter(null, context) + } else { + context._leave(null, context) + } + } else { + if ($(this.getTipElement()).hasClass(ClassName.SHOW)) { + this._leave(null, this) + return + } + + this._enter(null, this) + } + } + + dispose() { + clearTimeout(this._timeout) + + $.removeData(this.element, this.constructor.DATA_KEY) + + $(this.element).off(this.constructor.EVENT_KEY) + $(this.element).closest('.modal').off('hide.bs.modal') + + if (this.tip) { + $(this.tip).remove() + } + + this._isEnabled = null + this._timeout = null + this._hoverState = null + this._activeTrigger = null + if (this._popper !== null) { + this._popper.destroy() + } + + this._popper = null + this.element = null + this.config = null + this.tip = null + } + + show() { + if ($(this.element).css('display') === 'none') { + throw new Error('Please use show on visible elements') + } + + const showEvent = $.Event(this.constructor.Event.SHOW) + if (this.isWithContent() && this._isEnabled) { + $(this.element).trigger(showEvent) + + const isInTheDom = $.contains( + this.element.ownerDocument.documentElement, + this.element + ) + + if (showEvent.isDefaultPrevented() || !isInTheDom) { + return + } + + const tip = this.getTipElement() + const tipId = Util.getUID(this.constructor.NAME) + + tip.setAttribute('id', tipId) + this.element.setAttribute('aria-describedby', tipId) + + this.setContent() + + if (this.config.animation) { + $(tip).addClass(ClassName.FADE) + } + + const placement = typeof this.config.placement === 'function' + ? this.config.placement.call(this, tip, this.element) + : this.config.placement + + const attachment = this._getAttachment(placement) + this.addAttachmentClass(attachment) + + const container = this.config.container === false ? document.body : $(document).find(this.config.container) + + $(tip).data(this.constructor.DATA_KEY, this) + + if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { + $(tip).appendTo(container) + } + + $(this.element).trigger(this.constructor.Event.INSERTED) + + this._popper = new Popper(this.element, tip, { + placement: attachment, + modifiers: { + offset: { + offset: this.config.offset + }, + flip: { + behavior: this.config.fallbackPlacement + }, + arrow: { + element: Selector.ARROW + }, + preventOverflow: { + boundariesElement: this.config.boundary + } + }, + onCreate: (data) => { + if (data.originalPlacement !== data.placement) { + this._handlePopperPlacementChange(data) + } + }, + onUpdate: (data) => { + this._handlePopperPlacementChange(data) + } + }) + + $(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 + if ('ontouchstart' in document.documentElement) { + $(document.body).children().on('mouseover', null, $.noop) + } + + const complete = () => { + if (this.config.animation) { + this._fixTransition() + } + const prevHoverState = this._hoverState + this._hoverState = null + + $(this.element).trigger(this.constructor.Event.SHOWN) + + if (prevHoverState === HoverState.OUT) { + this._leave(null, this) + } + } + + if ($(this.tip).hasClass(ClassName.FADE)) { + const transitionDuration = Util.getTransitionDurationFromElement(this.tip) + + $(this.tip) + .one(Util.TRANSITION_END, complete) + .emulateTransitionEnd(transitionDuration) + } else { + complete() + } + } + } + + hide(callback) { + const tip = this.getTipElement() + const hideEvent = $.Event(this.constructor.Event.HIDE) + const complete = () => { + if (this._hoverState !== HoverState.SHOW && tip.parentNode) { + tip.parentNode.removeChild(tip) + } + + this._cleanTipClass() + this.element.removeAttribute('aria-describedby') + $(this.element).trigger(this.constructor.Event.HIDDEN) + if (this._popper !== null) { + this._popper.destroy() + } + + if (callback) { + callback() + } + } + + $(this.element).trigger(hideEvent) + + if (hideEvent.isDefaultPrevented()) { + return + } + + $(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) { + $(document.body).children().off('mouseover', null, $.noop) + } + + this._activeTrigger[Trigger.CLICK] = false + this._activeTrigger[Trigger.FOCUS] = false + this._activeTrigger[Trigger.HOVER] = false + + if ($(this.tip).hasClass(ClassName.FADE)) { + const transitionDuration = Util.getTransitionDurationFromElement(tip) + + $(tip) + .one(Util.TRANSITION_END, complete) + .emulateTransitionEnd(transitionDuration) + } else { + complete() + } + + this._hoverState = '' + } + + update() { + if (this._popper !== null) { + this._popper.scheduleUpdate() + } + } + + // Protected + + isWithContent() { + return Boolean(this.getTitle()) + } + + addAttachmentClass(attachment) { + $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`) + } + + getTipElement() { + this.tip = this.tip || $(this.config.template)[0] + return this.tip + } + + setContent() { + const tip = this.getTipElement() + this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle()) + $(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`) + } + + setElementContent($element, content) { + const html = this.config.html + if (typeof content === 'object' && (content.nodeType || content.jquery)) { + // Content is a DOM node or a jQuery + if (html) { + if (!$(content).parent().is($element)) { + $element.empty().append(content) + } + } else { + $element.text($(content).text()) + } + } else { + $element[html ? 'html' : 'text'](content) + } + } + + getTitle() { + let title = this.element.getAttribute('data-original-title') + + if (!title) { + title = typeof this.config.title === 'function' + ? this.config.title.call(this.element) + : this.config.title + } + + return title + } + + // Private + + _getAttachment(placement) { + return AttachmentMap[placement.toUpperCase()] + } + + _setListeners() { + const triggers = this.config.trigger.split(' ') + + triggers.forEach((trigger) => { + if (trigger === 'click') { + $(this.element).on( + this.constructor.Event.CLICK, + this.config.selector, + (event) => this.toggle(event) + ) + } else if (trigger !== Trigger.MANUAL) { + const eventIn = trigger === Trigger.HOVER + ? this.constructor.Event.MOUSEENTER + : this.constructor.Event.FOCUSIN + const eventOut = trigger === Trigger.HOVER + ? this.constructor.Event.MOUSELEAVE + : this.constructor.Event.FOCUSOUT + + $(this.element) + .on( + eventIn, + this.config.selector, + (event) => this._enter(event) + ) + .on( + eventOut, + this.config.selector, + (event) => this._leave(event) + ) + } + + $(this.element).closest('.modal').on( + 'hide.bs.modal', + () => this.hide() + ) + }) + + if (this.config.selector) { + this.config = { + ...this.config, + trigger: 'manual', + selector: '' + } + } else { + this._fixTitle() + } + } + + _fixTitle() { + const titleType = typeof this.element.getAttribute('data-original-title') + if (this.element.getAttribute('title') || + titleType !== 'string') { + this.element.setAttribute( + 'data-original-title', + this.element.getAttribute('title') || '' + ) + this.element.setAttribute('title', '') + } + } + + _enter(event, context) { + const dataKey = this.constructor.DATA_KEY + + context = context || $(event.currentTarget).data(dataKey) + + if (!context) { + context = new this.constructor( + event.currentTarget, + this._getDelegateConfig() + ) + $(event.currentTarget).data(dataKey, context) + } + + if (event) { + context._activeTrigger[ + event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER + ] = true + } + + if ($(context.getTipElement()).hasClass(ClassName.SHOW) || + context._hoverState === HoverState.SHOW) { + context._hoverState = HoverState.SHOW + return + } + + clearTimeout(context._timeout) + + context._hoverState = HoverState.SHOW + + if (!context.config.delay || !context.config.delay.show) { + context.show() + return + } + + context._timeout = setTimeout(() => { + if (context._hoverState === HoverState.SHOW) { + context.show() + } + }, context.config.delay.show) + } + + _leave(event, context) { + const dataKey = this.constructor.DATA_KEY + + context = context || $(event.currentTarget).data(dataKey) + + if (!context) { + context = new this.constructor( + event.currentTarget, + this._getDelegateConfig() + ) + $(event.currentTarget).data(dataKey, context) + } + + if (event) { + context._activeTrigger[ + event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER + ] = false + } + + if (context._isWithActiveTrigger()) { + return + } + + clearTimeout(context._timeout) + + context._hoverState = HoverState.OUT + + if (!context.config.delay || !context.config.delay.hide) { + context.hide() + return + } + + context._timeout = setTimeout(() => { + if (context._hoverState === HoverState.OUT) { + context.hide() + } + }, context.config.delay.hide) + } + + _isWithActiveTrigger() { + for (const trigger in this._activeTrigger) { + if (this._activeTrigger[trigger]) { + return true + } + } + + return false + } + + _getConfig(config) { + config = { + ...this.constructor.Default, + ...$(this.element).data(), + ...typeof config === 'object' && config ? config : {} + } + + if (typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + } + } + + if (typeof config.title === 'number') { + config.title = config.title.toString() + } + + if (typeof config.content === 'number') { + config.content = config.content.toString() + } + + Util.typeCheckConfig( + NAME, + config, + this.constructor.DefaultType + ) + + return config + } + + _getDelegateConfig() { + const config = {} + + if (this.config) { + for (const key in this.config) { + if (this.constructor.Default[key] !== this.config[key]) { + config[key] = this.config[key] + } + } + } + + return config + } + + _cleanTipClass() { + const $tip = $(this.getTipElement()) + const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX) + if (tabClass !== null && tabClass.length) { + $tip.removeClass(tabClass.join('')) + } + } + + _handlePopperPlacementChange(popperData) { + const popperInstance = popperData.instance + this.tip = popperInstance.popper + this._cleanTipClass() + this.addAttachmentClass(this._getAttachment(popperData.placement)) + } + + _fixTransition() { + const tip = this.getTipElement() + const initConfigAnimation = this.config.animation + if (tip.getAttribute('x-placement') !== null) { + return + } + $(tip).removeClass(ClassName.FADE) + this.config.animation = false + this.hide() + this.show() + this.config.animation = initConfigAnimation + } + + // Static + + static _jQueryInterface(config) { + return this.each(function () { + let data = $(this).data(DATA_KEY) + const _config = typeof config === 'object' && config + + if (!data && /dispose|hide/.test(config)) { + return + } + + if (!data) { + data = new Tooltip(this, _config) + $(this).data(DATA_KEY, data) + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`) + } + data[config]() + } + }) + } + } + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Tooltip._jQueryInterface + $.fn[NAME].Constructor = Tooltip + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Tooltip._jQueryInterface + } + + return Tooltip +})($, Popper) + +export default Tooltip diff --git a/themes/docsy/assets/vendor/bootstrap/js/src/util.js b/themes/docsy/assets/vendor/bootstrap/js/src/util.js new file mode 100644 index 0000000..eb98d44 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/src/util.js @@ -0,0 +1,152 @@ +import $ from 'jquery' + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.1.3): util.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Util = (($) => { + /** + * ------------------------------------------------------------------------ + * Private TransitionEnd Helpers + * ------------------------------------------------------------------------ + */ + + const TRANSITION_END = 'transitionend' + const MAX_UID = 1000000 + const MILLISECONDS_MULTIPLIER = 1000 + + // Shoutout AngusCroll (https://goo.gl/pxwQGp) + function toType(obj) { + return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase() + } + + function getSpecialTransitionEndEvent() { + return { + bindType: TRANSITION_END, + delegateType: TRANSITION_END, + handle(event) { + if ($(event.target).is(this)) { + return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params + } + return undefined // eslint-disable-line no-undefined + } + } + } + + function transitionEndEmulator(duration) { + let called = false + + $(this).one(Util.TRANSITION_END, () => { + called = true + }) + + setTimeout(() => { + if (!called) { + Util.triggerTransitionEnd(this) + } + }, duration) + + return this + } + + function setTransitionEndSupport() { + $.fn.emulateTransitionEnd = transitionEndEmulator + $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent() + } + + /** + * -------------------------------------------------------------------------- + * Public Util Api + * -------------------------------------------------------------------------- + */ + + const Util = { + + TRANSITION_END: 'bsTransitionEnd', + + getUID(prefix) { + do { + // eslint-disable-next-line no-bitwise + prefix += ~~(Math.random() * MAX_UID) // "~~" acts like a faster Math.floor() here + } while (document.getElementById(prefix)) + return prefix + }, + + getSelectorFromElement(element) { + let selector = element.getAttribute('data-target') + if (!selector || selector === '#') { + selector = element.getAttribute('href') || '' + } + + try { + return document.querySelector(selector) ? selector : null + } catch (err) { + return null + } + }, + + getTransitionDurationFromElement(element) { + if (!element) { + return 0 + } + + // Get transition-duration of the element + let transitionDuration = $(element).css('transition-duration') + const floatTransitionDuration = parseFloat(transitionDuration) + + // Return 0 if element or transition duration is not found + if (!floatTransitionDuration) { + return 0 + } + + // If multiple durations are defined, take the first + transitionDuration = transitionDuration.split(',')[0] + + return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER + }, + + reflow(element) { + return element.offsetHeight + }, + + triggerTransitionEnd(element) { + $(element).trigger(TRANSITION_END) + }, + + // TODO: Remove in v5 + supportsTransitionEnd() { + return Boolean(TRANSITION_END) + }, + + isElement(obj) { + return (obj[0] || obj).nodeType + }, + + typeCheckConfig(componentName, config, configTypes) { + for (const property in configTypes) { + if (Object.prototype.hasOwnProperty.call(configTypes, property)) { + const expectedTypes = configTypes[property] + const value = config[property] + const valueType = value && Util.isElement(value) + ? 'element' : toType(value) + + if (!new RegExp(expectedTypes).test(valueType)) { + throw new Error( + `${componentName.toUpperCase()}: ` + + `Option "${property}" provided type "${valueType}" ` + + `but expected type "${expectedTypes}".`) + } + } + } + } + } + + setTransitionEndSupport() + + return Util +})($) + +export default Util diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/README.md b/themes/docsy/assets/vendor/bootstrap/js/tests/README.md new file mode 100644 index 0000000..1ba3d69 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/README.md @@ -0,0 +1,69 @@ +## How does Bootstrap's test suite work? + +Bootstrap uses [QUnit](https://qunitjs.com/) and [Sinon](http://sinonjs.org/). Each plugin has a file dedicated to its tests in `unit/<plugin-name>.js`. + +* `unit/` contains the unit test files for each Bootstrap plugin. +* `vendor/` contains third-party testing-related code (QUnit, jQuery and Sinon). +* `visual/` contains "visual" tests which are run interactively in real browsers and require manual verification by humans. + +To run the unit test suite via [Karma](https://karma-runner.github.io/), run `npm run js-test`. + +To run the unit test suite via a real web browser, open `index.html` in the browser. + + +## How do I add a new unit test? + +1. Locate and open the file dedicated to the plugin which you need to add tests to (`unit/<plugin-name>.js`). +2. Review the [QUnit API Documentation](https://api.qunitjs.com/) and use the existing tests as references for how to structure your new tests. +3. Write the necessary unit test(s) for the new or revised functionality. +4. Run `npm run js-test` to see the results of your newly-added test(s). + +**Note:** Your new unit tests should fail before your changes are applied to the plugin, and should pass after your changes are applied to the plugin. + +## What should a unit test look like? + +* Each test should have a unique name clearly stating what unit is being tested. +* Each test should test only one unit per test, although one test can include several assertions. Create multiple tests for multiple units of functionality. +* Each test should begin with [`assert.expect`](https://api.qunitjs.com/assert/expect/) to ensure that the expected assertions are run. +* Each test should follow the project's [JavaScript Code Guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js) + +## Code coverage + +Currently we're aiming for at least 80% test coverage for our code. To ensure your changes meet or exceed this limit, run `npm run js-compile && npm run js-test` and open the file in `js/coverage/lcov-report/index.html` to see the code coverage for each plugin. See more details when you select a plugin and ensure your change is fully covered by unit tests. + +### Example tests + +```js +// Synchronous test +QUnit.test('should describe the unit being tested', function (assert) { + assert.expect(1) + var templateHTML = '<div class="alert alert-danger fade show">' + + '<a class="close" href="#" data-dismiss="alert">×</a>' + + '<p><strong>Template necessary for the test.</p>' + + '</div>' + var $alert = $(templateHTML).appendTo('#qunit-fixture').bootstrapAlert() + + $alert.find('.close').trigger('click') + + // Make assertion + assert.strictEqual($alert.hasClass('show'), false, 'remove .show class on .close click') +}) + +// Asynchronous test +QUnit.test('should describe the unit being tested', function (assert) { + assert.expect(2) + var done = assert.async() + + var $tooltip = $('<div title="tooltip title"></div>').bootstrapTooltip() + var tooltipInstance = $tooltip.data('bs.tooltip') + var spyShow = sinon.spy(tooltipInstance, 'show') + + $tooltip.appendTo('#qunit-fixture') + .on('shown.bs.tooltip', function () { + assert.ok(true, '"shown" event was fired after calling "show"') + assert.ok(spyShow.called, 'show called') + done() + }) + .bootstrapTooltip('show') +}) +``` diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/index.html b/themes/docsy/assets/vendor/bootstrap/js/tests/index.html new file mode 100644 index 0000000..95d72d8 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/index.html @@ -0,0 +1,140 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <title>Bootstrap Plugin Test Suite</title> + + <!-- jQuery --> + <script> + (function () { + var path = '../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js' + // get jquery param from the query string. + var jQueryVersion = location.search.match(/[?&]jquery=(.*?)(?=&|$)/) + + // If a version was specified, use that version from jQuery CDN + if (jQueryVersion) { + path = 'https://code.jquery.com/jquery-' + jQueryVersion[1] + '.min.js' + } + document.write('<script src="' + path + '"><\/script>') + }()) + </script> + <script src="../../site/docs/4.1/assets/js/vendor/popper.min.js"></script> + + <!-- QUnit --> + <link rel="stylesheet" href="../../node_modules/qunit/qunit/qunit.css" media="screen"> + <script src="../../node_modules/qunit/qunit/qunit.js"></script> + + <!-- Sinon --> + <script src="../../node_modules/sinon/pkg/sinon-no-sourcemaps.js"></script> + + <script> + // Disable jQuery event aliases to ensure we don't accidentally use any of them + [ + 'blur', + 'focus', + 'focusin', + 'focusout', + 'resize', + 'scroll', + 'click', + 'dblclick', + 'mousedown', + 'mouseup', + 'mousemove', + 'mouseover', + 'mouseout', + 'mouseenter', + 'mouseleave', + 'change', + 'select', + 'submit', + 'keydown', + 'keypress', + 'keyup', + 'contextmenu' + ].forEach(function(eventAlias) { + $.fn[eventAlias] = function() { + throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js') + } + }) + + // Require assert.expect in each test + QUnit.config.requireExpects = true + + // See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit + var log = [] + var testName + + QUnit.done(function(testResults) { + var tests = [] + for (var i = 0; i < log.length; i++) { + var details = log[i] + tests.push({ + name: details.name, + result: details.result, + expected: details.expected, + actual: details.actual, + source: details.source + }) + } + testResults.tests = tests + + window.global_test_results = testResults + }) + + QUnit.testStart(function(testDetails) { + QUnit.log(function(details) { + if (!details.result) { + details.name = testDetails.name + log.push(details) + } + }) + }) + + // Display fixture on-screen on iOS to avoid false positives + // See https://github.com/twbs/bootstrap/pull/15955 + if (/iPhone|iPad|iPod/.test(navigator.userAgent)) { + QUnit.begin(function() { + $('#qunit-fixture').css({ top: 0, left: 0 }) + }) + + QUnit.done(function() { + $('#qunit-fixture').css({ top: '', left: '' }) + }) + } + </script> + + <!-- Transpiled Plugins --> + <script src="../dist/util.js"></script> + <script src="../dist/alert.js"></script> + <script src="../dist/button.js"></script> + <script src="../dist/carousel.js"></script> + <script src="../dist/collapse.js"></script> + <script src="../dist/dropdown.js"></script> + <script src="../dist/modal.js"></script> + <script src="../dist/scrollspy.js"></script> + <script src="../dist/tab.js"></script> + <script src="../dist/tooltip.js"></script> + <script src="../dist/popover.js"></script> + + <!-- Unit Tests --> + <script src="unit/alert.js"></script> + <script src="unit/button.js"></script> + <script src="unit/carousel.js"></script> + <script src="unit/collapse.js"></script> + <script src="unit/dropdown.js"></script> + <script src="unit/modal.js"></script> + <script src="unit/scrollspy.js"></script> + <script src="unit/tab.js"></script> + <script src="unit/tooltip.js"></script> + <script src="unit/popover.js"></script> + <script src="unit/util.js"></script> + </head> + <body> + <div id="qunit-container"> + <div id="qunit"></div> + <div id="qunit-fixture"></div> + </div> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/karma-bundle.conf.js b/themes/docsy/assets/vendor/bootstrap/js/tests/karma-bundle.conf.js new file mode 100644 index 0000000..50c500f --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/karma-bundle.conf.js @@ -0,0 +1,53 @@ +/* eslint-env node */ +/* eslint no-process-env: 0 */ + +module.exports = (config) => { + const jqueryFile = process.env.USE_OLD_JQUERY ? 'https://code.jquery.com/jquery-1.9.1.min.js' : 'site/docs/4.1/assets/js/vendor/jquery-slim.min.js' + + config.set({ + basePath: '../..', + frameworks: ['qunit', 'sinon', 'detectBrowsers'], + plugins: [ + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-qunit', + 'karma-sinon', + 'karma-detect-browsers' + ], + // list of files / patterns to load in the browser + files: [ + jqueryFile, + 'site/docs/4.1/assets/js/vendor/popper.min.js', + 'dist/js/bootstrap.js', + 'js/tests/unit/*.js' + ], + reporters: ['dots'], + port: 9876, + colors: true, + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_ERROR || config.LOG_WARN, + autoWatch: false, + customLaunchers: { + FirefoxHeadless: { + base: 'Firefox', + flags: ['-headless'] + } + }, + singleRun: true, + concurrency: Infinity, + detectBrowsers: { + usePhantomJS: false, + postDetection(availableBrowser) { + if (typeof process.env.TRAVIS_JOB_ID !== 'undefined' || availableBrowser.includes('Chrome')) { + return ['ChromeHeadless'] + } + + if (availableBrowser.includes('Firefox')) { + return ['FirefoxHeadless'] + } + + throw new Error('Please install Firefox or Chrome') + } + } + }) +} diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/karma.conf.js b/themes/docsy/assets/vendor/bootstrap/js/tests/karma.conf.js new file mode 100644 index 0000000..397f8b8 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/karma.conf.js @@ -0,0 +1,76 @@ +/* eslint-env node */ +/* eslint no-process-env: 0 */ +const path = require('path') +const jsCoveragePath = path.resolve(__dirname, '../coverage') + +module.exports = (config) => { + const jqueryFile = process.env.USE_OLD_JQUERY ? 'https://code.jquery.com/jquery-1.9.1.min.js' : 'site/docs/4.1/assets/js/vendor/jquery-slim.min.js' + + config.set({ + basePath: '../..', + frameworks: ['qunit', 'sinon', 'detectBrowsers'], + plugins: [ + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-qunit', + 'karma-sinon', + 'karma-detect-browsers', + 'karma-coverage-istanbul-reporter' + ], + // list of files / patterns to load in the browser + files: [ + jqueryFile, + 'site/docs/4.1/assets/js/vendor/popper.min.js', + 'js/coverage/dist/util.js', + 'js/coverage/dist/tooltip.js', + 'js/coverage/dist/!(util|index|tooltip).js', // include all of our js/dist files except util.js, index.js and tooltip.js + 'js/tests/unit/*.js' + ], + reporters: ['dots', 'coverage-istanbul'], + port: 9876, + colors: true, + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_ERROR || config.LOG_WARN, + autoWatch: false, + customLaunchers: { + FirefoxHeadless: { + base: 'Firefox', + flags: ['-headless'] + } + }, + singleRun: true, + concurrency: Infinity, + detectBrowsers: { + usePhantomJS: false, + postDetection(availableBrowser) { + if (typeof process.env.TRAVIS_JOB_ID !== 'undefined' || availableBrowser.includes('Chrome')) { + return ['ChromeHeadless'] + } + + if (availableBrowser.includes('Firefox')) { + return ['FirefoxHeadless'] + } + + throw new Error('Please install Firefox or Chrome') + } + }, + coverageIstanbulReporter: { + dir: jsCoveragePath, + reports: ['lcov', 'text-summary'], + thresholds: { + emitWarning: false, + global: { + statements: 90, + branches: 84, + functions: 87, + lines: 90 + } + } + }, + client: { + qunit: { + showUI: true + } + } + }) +} diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/.eslintrc.json b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/.eslintrc.json new file mode 100644 index 0000000..0896f40 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/.eslintrc.json @@ -0,0 +1,37 @@ +{ + "env": { + "es6": false, + "jquery": true, + "qunit": true + }, + "globals": { + "bootstrap": false, + "sinon": false, + "Util": false, + "Alert": false, + "Button": false + }, + "parserOptions": { + "ecmaVersion": 5, + "sourceType": "script" + }, + "extends": "../../../.eslintrc.json", + "rules": { + "no-console": "off", + // Best Practices + "consistent-return": "off", + "no-magic-numbers": "off", + "vars-on-top": "off", + + // Stylistic Issues + "func-style": "off", + "spaced-comment": "off", + + // ECMAScript 6 + "no-var": "off", + "object-shorthand": "off", + "prefer-arrow-callback": "off", + "prefer-template": "off", + "prefer-rest-params": "off" + } +} diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/alert.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/alert.js new file mode 100644 index 0000000..65a8f9e --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/alert.js @@ -0,0 +1,123 @@ +$(function () { + 'use strict' + + QUnit.module('alert plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).alert, 'alert method is defined') + }) + + QUnit.module('alert', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapAlert = $.fn.alert.noConflict() + }, + afterEach: function () { + $.fn.alert = $.fn.bootstrapAlert + delete $.fn.bootstrapAlert + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.alert, 'undefined', 'alert was set back to undefined (org value)') + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>') + var $alert = $el.bootstrapAlert() + assert.ok($alert instanceof $, 'returns jquery collection') + assert.strictEqual($alert[0], $el[0], 'collection contains element') + }) + + QUnit.test('should fade element out on clicking .close', function (assert) { + assert.expect(1) + var alertHTML = '<div class="alert alert-danger fade show">' + + '<a class="close" href="#" data-dismiss="alert">×</a>' + + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + + '</div>' + + var $alert = $(alertHTML).bootstrapAlert().appendTo($('#qunit-fixture')) + + $alert.find('.close').trigger('click') + + assert.strictEqual($alert.hasClass('show'), false, 'remove .show class on .close click') + }) + + QUnit.test('should remove element when clicking .close', function (assert) { + assert.expect(2) + var done = assert.async() + var alertHTML = '<div class="alert alert-danger fade show">' + + '<a class="close" href="#" data-dismiss="alert">×</a>' + + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + + '</div>' + var $alert = $(alertHTML).appendTo('#qunit-fixture').bootstrapAlert() + + assert.notEqual($('#qunit-fixture').find('.alert').length, 0, 'element added to dom') + + $alert + .one('closed.bs.alert', function () { + assert.strictEqual($('#qunit-fixture').find('.alert').length, 0, 'element removed from dom') + done() + }) + .find('.close') + .trigger('click') + }) + + QUnit.test('should not fire closed when close is prevented', function (assert) { + assert.expect(1) + var done = assert.async() + $('<div class="alert"/>') + .on('close.bs.alert', function (e) { + e.preventDefault() + assert.ok(true, 'close event fired') + done() + }) + .on('closed.bs.alert', function () { + assert.ok(false, 'closed event fired') + }) + .bootstrapAlert('close') + }) + + QUnit.test('close should use internal _element if no element provided', function (assert) { + assert.expect(1) + + var done = assert.async() + var $el = $('<div/>') + var $alert = $el.bootstrapAlert() + var alertInstance = $alert.data('bs.alert') + + $alert.one('closed.bs.alert', function () { + assert.ok('alert closed') + done() + }) + + alertInstance.close() + }) + + QUnit.test('dispose should remove data and the element', function (assert) { + assert.expect(2) + + var $el = $('<div/>') + var $alert = $el.bootstrapAlert() + + assert.ok(typeof $alert.data('bs.alert') !== 'undefined') + + $alert.data('bs.alert').dispose() + + assert.ok(typeof $alert.data('bs.button') === 'undefined') + }) + + QUnit.test('should return alert version', function (assert) { + assert.expect(1) + + if (typeof Alert !== 'undefined') { + assert.ok(typeof Alert.VERSION === 'string') + } else { + assert.notOk() + } + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/button.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/button.js new file mode 100644 index 0000000..9576dd2 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/button.js @@ -0,0 +1,199 @@ +$(function () { + 'use strict' + + QUnit.module('button plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).button, 'button method is defined') + }) + + QUnit.module('button', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapButton = $.fn.button.noConflict() + }, + afterEach: function () { + $.fn.button = $.fn.bootstrapButton + delete $.fn.bootstrapButton + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.button, 'undefined', 'button was set back to undefined (org value)') + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>') + var $button = $el.bootstrapButton() + assert.ok($button instanceof $, 'returns jquery collection') + assert.strictEqual($button[0], $el[0], 'collection contains element') + }) + + QUnit.test('should toggle active', function (assert) { + assert.expect(2) + var $btn = $('<button class="btn" data-toggle="button">mdo</button>') + assert.ok(!$btn.hasClass('active'), 'btn does not have active class') + $btn.bootstrapButton('toggle') + assert.ok($btn.hasClass('active'), 'btn has class active') + }) + + QUnit.test('should toggle active when btn children are clicked', function (assert) { + assert.expect(2) + var $btn = $('<button class="btn" data-toggle="button">mdo</button>') + var $inner = $('<i/>') + $btn + .append($inner) + .appendTo('#qunit-fixture') + assert.ok(!$btn.hasClass('active'), 'btn does not have active class') + $inner.trigger('click') + assert.ok($btn.hasClass('active'), 'btn has class active') + }) + + QUnit.test('should toggle aria-pressed', function (assert) { + assert.expect(2) + var $btn = $('<button class="btn" data-toggle="button" aria-pressed="false">redux</button>') + assert.strictEqual($btn.attr('aria-pressed'), 'false', 'btn aria-pressed state is false') + $btn.bootstrapButton('toggle') + assert.strictEqual($btn.attr('aria-pressed'), 'true', 'btn aria-pressed state is true') + }) + + QUnit.test('should toggle aria-pressed on buttons with container', function (assert) { + assert.expect(1) + var groupHTML = '<div class="btn-group" data-toggle="buttons">' + + '<button id="btn1" class="btn btn-secondary" type="button">One</button>' + + '<button class="btn btn-secondary" type="button">Two</button>' + + '</div>' + $('#qunit-fixture').append(groupHTML) + $('#btn1').bootstrapButton('toggle') + assert.strictEqual($('#btn1').attr('aria-pressed'), 'true') + }) + + QUnit.test('should toggle aria-pressed when btn children are clicked', function (assert) { + assert.expect(2) + var $btn = $('<button class="btn" data-toggle="button" aria-pressed="false">redux</button>') + var $inner = $('<i/>') + $btn + .append($inner) + .appendTo('#qunit-fixture') + assert.strictEqual($btn.attr('aria-pressed'), 'false', 'btn aria-pressed state is false') + $inner.trigger('click') + assert.strictEqual($btn.attr('aria-pressed'), 'true', 'btn aria-pressed state is true') + }) + + QUnit.test('should trigger input change event when toggled button has input field', function (assert) { + assert.expect(1) + var done = assert.async() + + var groupHTML = '<div class="btn-group" data-toggle="buttons">' + + '<label class="btn btn-primary">' + + '<input type="radio" id="radio" autocomplete="off">Radio' + + '</label>' + + '</div>' + var $group = $(groupHTML).appendTo('#qunit-fixture') + + $group.find('input').on('change', function (e) { + e.preventDefault() + assert.ok(true, 'change event fired') + done() + }) + + $group.find('label').trigger('click') + }) + + QUnit.test('should check for closest matching toggle', function (assert) { + assert.expect(12) + var groupHTML = '<div class="btn-group" data-toggle="buttons">' + + '<label class="btn btn-primary active">' + + '<input type="radio" name="options" id="option1" checked="true"> Option 1' + + '</label>' + + '<label class="btn btn-primary">' + + '<input type="radio" name="options" id="option2"> Option 2' + + '</label>' + + '<label class="btn btn-primary">' + + '<input type="radio" name="options" id="option3"> Option 3' + + '</label>' + + '</div>' + var $group = $(groupHTML).appendTo('#qunit-fixture') + + var $btn1 = $group.children().eq(0) + var $btn2 = $group.children().eq(1) + + assert.ok($btn1.hasClass('active'), 'btn1 has active class') + assert.ok($btn1.find('input').prop('checked'), 'btn1 is checked') + assert.ok(!$btn2.hasClass('active'), 'btn2 does not have active class') + assert.ok(!$btn2.find('input').prop('checked'), 'btn2 is not checked') + $btn2.find('input').trigger('click') + assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class') + assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked') + assert.ok($btn2.hasClass('active'), 'btn2 has active class') + assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked') + + $btn2.find('input').trigger('click') // Clicking an already checked radio should not un-check it + assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class') + assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked') + assert.ok($btn2.hasClass('active'), 'btn2 has active class') + assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked') + }) + + QUnit.test('should not add aria-pressed on labels for radio/checkbox inputs in a data-toggle="buttons" group', function (assert) { + assert.expect(2) + var groupHTML = '<div class="btn-group" data-toggle="buttons">' + + '<label class="btn btn-primary"><input type="checkbox" autocomplete="off"> Checkbox</label>' + + '<label class="btn btn-primary"><input type="radio" name="options" autocomplete="off"> Radio</label>' + + '</div>' + var $group = $(groupHTML).appendTo('#qunit-fixture') + + var $btn1 = $group.children().eq(0) + var $btn2 = $group.children().eq(1) + + $btn1.find('input').trigger('click') + assert.ok($btn1.is(':not([aria-pressed])'), 'label for nested checkbox input has not been given an aria-pressed attribute') + + $btn2.find('input').trigger('click') + assert.ok($btn2.is(':not([aria-pressed])'), 'label for nested radio input has not been given an aria-pressed attribute') + }) + + QUnit.test('should handle disabled attribute on non-button elements', function (assert) { + assert.expect(2) + var groupHTML = '<div class="btn-group disabled" data-toggle="buttons" aria-disabled="true" disabled>' + + '<label class="btn btn-danger disabled" aria-disabled="true" disabled>' + + '<input type="checkbox" aria-disabled="true" autocomplete="off" disabled class="disabled"/>' + + '</label>' + + '</div>' + var $group = $(groupHTML).appendTo('#qunit-fixture') + + var $btn = $group.children().eq(0) + var $input = $btn.children().eq(0) + + $btn.trigger('click') + assert.ok($btn.is(':not(.active)'), 'button did not become active') + assert.ok(!$input.is(':checked'), 'checkbox did not get checked') + }) + + QUnit.test('dispose should remove data and the element', function (assert) { + assert.expect(2) + + var $el = $('<div/>') + var $button = $el.bootstrapButton() + + assert.ok(typeof $button.data('bs.button') !== 'undefined') + + $button.data('bs.button').dispose() + + assert.ok(typeof $button.data('bs.button') === 'undefined') + }) + + QUnit.test('should return button version', function (assert) { + assert.expect(1) + + if (typeof Button !== 'undefined') { + assert.ok(typeof Button.VERSION === 'string') + } else { + assert.notOk() + } + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/carousel.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/carousel.js new file mode 100644 index 0000000..baabcf4 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/carousel.js @@ -0,0 +1,944 @@ +$(function () { + 'use strict' + + QUnit.module('carousel plugin') + + QUnit.test('should be defined on jQuery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).carousel, 'carousel method is defined') + }) + + QUnit.module('carousel', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapCarousel = $.fn.carousel.noConflict() + }, + afterEach: function () { + $.fn.carousel = $.fn.bootstrapCarousel + delete $.fn.bootstrapCarousel + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.carousel, 'undefined', 'carousel was set back to undefined (orig value)') + }) + + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div/>') + $el.bootstrapCarousel() + try { + $el.bootstrapCarousel('noMethod') + } catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>') + var $carousel = $el.bootstrapCarousel() + assert.ok($carousel instanceof $, 'returns jquery collection') + assert.strictEqual($carousel[0], $el[0], 'collection contains element') + }) + + QUnit.test('should type check config options', function (assert) { + assert.expect(2) + + var message + var expectedMessage = 'CAROUSEL: Option "interval" provided type "string" but expected type "(number|boolean)".' + var config = { + interval: 'fat sux' + } + + try { + $('<div/>').bootstrapCarousel(config) + } catch (err) { + message = err.message + } + + assert.ok(message === expectedMessage, 'correct error message') + + config = { + keyboard: document.createElement('div') + } + expectedMessage = 'CAROUSEL: Option "keyboard" provided type "element" but expected type "boolean".' + + try { + $('<div/>').bootstrapCarousel(config) + } catch (err) { + message = err.message + } + + assert.ok(message === expectedMessage, 'correct error message') + }) + + QUnit.test('should not fire slid when slide is prevented', function (assert) { + assert.expect(1) + var done = assert.async() + $('<div class="carousel"/>') + .on('slide.bs.carousel', function (e) { + e.preventDefault() + assert.ok(true, 'slide event fired') + done() + }) + .on('slid.bs.carousel', function () { + assert.ok(false, 'slid event fired') + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should reset when slide is prevented', function (assert) { + assert.expect(6) + var carouselHTML = '<div id="carousel-example-generic" class="carousel slide">' + + '<ol class="carousel-indicators">' + + '<li data-target="#carousel-example-generic" data-slide-to="0" class="active"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="1"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="2"/>' + + '</ol>' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item">' + + '<div class="carousel-caption"/>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"/>' + + '<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"/>' + + '</div>' + var $carousel = $(carouselHTML) + + var done = assert.async() + $carousel + .one('slide.bs.carousel', function (e) { + e.preventDefault() + setTimeout(function () { + assert.ok($carousel.find('.carousel-item:nth-child(1)').is('.active'), 'first item still active') + assert.ok($carousel.find('.carousel-indicators li:nth-child(1)').is('.active'), 'first indicator still active') + $carousel.bootstrapCarousel('next') + }, 0) + }) + .one('slid.bs.carousel', function () { + setTimeout(function () { + assert.ok(!$carousel.find('.carousel-item:nth-child(1)').is('.active'), 'first item still active') + assert.ok(!$carousel.find('.carousel-indicators li:nth-child(1)').is('.active'), 'first indicator still active') + assert.ok($carousel.find('.carousel-item:nth-child(2)').is('.active'), 'second item active') + assert.ok($carousel.find('.carousel-indicators li:nth-child(2)').is('.active'), 'second indicator active') + done() + }, 0) + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should fire slide event with direction', function (assert) { + assert.expect(4) + var carouselHTML = '<div id="myCarousel" class="carousel slide">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>First Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Second Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Third Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>' + + '</div>' + var $carousel = $(carouselHTML) + + var done = assert.async() + + $carousel + .one('slide.bs.carousel', function (e) { + assert.ok(e.direction, 'direction present on next') + assert.strictEqual(e.direction, 'left', 'direction is left on next') + + $carousel + .one('slide.bs.carousel', function (e) { + assert.ok(e.direction, 'direction present on prev') + assert.strictEqual(e.direction, 'right', 'direction is right on prev') + done() + }) + .bootstrapCarousel('prev') + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should fire slid event with direction', function (assert) { + assert.expect(4) + var carouselHTML = '<div id="myCarousel" class="carousel slide">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>First Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Second Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Third Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>' + + '</div>' + var $carousel = $(carouselHTML) + + var done = assert.async() + + $carousel + .one('slid.bs.carousel', function (e) { + assert.ok(e.direction, 'direction present on next') + assert.strictEqual(e.direction, 'left', 'direction is left on next') + + $carousel + .one('slid.bs.carousel', function (e) { + assert.ok(e.direction, 'direction present on prev') + assert.strictEqual(e.direction, 'right', 'direction is right on prev') + done() + }) + .bootstrapCarousel('prev') + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should fire slide event with relatedTarget', function (assert) { + assert.expect(2) + var template = '<div id="myCarousel" class="carousel slide">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>First Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Second Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Third Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>' + + '</div>' + + var done = assert.async() + + $(template) + .on('slide.bs.carousel', function (e) { + assert.ok(e.relatedTarget, 'relatedTarget present') + assert.ok($(e.relatedTarget).hasClass('carousel-item'), 'relatedTarget has class "item"') + done() + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should fire slid event with relatedTarget', function (assert) { + assert.expect(2) + var template = '<div id="myCarousel" class="carousel slide">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>First Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Second Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Third Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>' + + '</div>' + + var done = assert.async() + + $(template) + .on('slid.bs.carousel', function (e) { + assert.ok(e.relatedTarget, 'relatedTarget present') + assert.ok($(e.relatedTarget).hasClass('carousel-item'), 'relatedTarget has class "item"') + done() + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should fire slid and slide events with from and to', function (assert) { + assert.expect(4) + var template = '<div id="myCarousel" class="carousel slide">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>First Thumbnail label</h4>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Second Thumbnail label</h4>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Third Thumbnail label</h4>' + + '</div>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>' + + '</div>' + + var done = assert.async() + $(template) + .on('slid.bs.carousel', function (e) { + assert.ok(typeof e.from !== 'undefined', 'from present') + assert.ok(typeof e.to !== 'undefined', 'to present') + $(this).off() + done() + }) + .on('slide.bs.carousel', function (e) { + assert.ok(typeof e.from !== 'undefined', 'from present') + assert.ok(typeof e.to !== 'undefined', 'to present') + $(this).off('slide.bs.carousel') + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should set interval from data attribute', function (assert) { + assert.expect(4) + var templateHTML = '<div id="myCarousel" class="carousel slide">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>First Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Second Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Third Thumbnail label</h4>' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'ultricies vehicula ut id elit.</p>' + + '</div>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>' + + '</div>' + var $carousel = $(templateHTML) + $carousel.attr('data-interval', 1814) + + $carousel.appendTo('body') + $('[data-slide]').first().trigger('click') + assert.strictEqual($carousel.data('bs.carousel')._config.interval, 1814) + $carousel.remove() + + $carousel.appendTo('body').attr('data-modal', 'foobar') + $('[data-slide]').first().trigger('click') + assert.strictEqual($carousel.data('bs.carousel')._config.interval, 1814, 'even if there is an data-modal attribute set') + $carousel.remove() + + $carousel.appendTo('body') + $('[data-slide]').first().trigger('click') + $carousel.attr('data-interval', 1860) + $('[data-slide]').first().trigger('click') + assert.strictEqual($carousel.data('bs.carousel')._config.interval, 1814, 'attributes should be read only on initialization') + $carousel.remove() + + $carousel.attr('data-interval', false) + $carousel.appendTo('body') + $carousel.bootstrapCarousel(1) + assert.strictEqual($carousel.data('bs.carousel')._config.interval, false, 'data attribute has higher priority than default options') + $carousel.remove() + }) + + QUnit.test('should skip over non-items when using item indices', function (assert) { + assert.expect(2) + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="1814">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '</div>' + + '<script type="text/x-metamorph" id="thingy"/>' + + '<div class="carousel-item">' + + '<img alt="">' + + '</div>' + + '<div class="carousel-item">' + + '</div>' + + '</div>' + + '</div>' + var $template = $(templateHTML) + + $template.bootstrapCarousel() + + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item active') + + $template.bootstrapCarousel(1) + + assert.strictEqual($template.find('.carousel-item')[1], $template.find('.active')[0], 'second item active') + }) + + QUnit.test('should skip over non-items when using next/prev methods', function (assert) { + assert.expect(2) + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="1814">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '</div>' + + '<script type="text/x-metamorph" id="thingy"/>' + + '<div class="carousel-item">' + + '<img alt="">' + + '</div>' + + '<div class="carousel-item">' + + '</div>' + + '</div>' + + '</div>' + var $template = $(templateHTML) + + $template.bootstrapCarousel() + + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item active') + + $template.bootstrapCarousel('next') + + assert.strictEqual($template.find('.carousel-item')[1], $template.find('.active')[0], 'second item active') + }) + + QUnit.test('should go to previous item if left arrow key is pressed', function (assert) { + assert.expect(2) + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="false">' + + '<div class="carousel-inner">' + + '<div id="first" class="carousel-item">' + + '<img alt="">' + + '</div>' + + '<div id="second" class="carousel-item active">' + + '<img alt="">' + + '</div>' + + '<div id="third" class="carousel-item">' + + '<img alt="">' + + '</div>' + + '</div>' + + '</div>' + var $template = $(templateHTML) + + $template.bootstrapCarousel() + + assert.strictEqual($template.find('.carousel-item')[1], $template.find('.active')[0], 'second item active') + + $template.trigger($.Event('keydown', { + which: 37 + })) + + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item active') + }) + + QUnit.test('should go to next item if right arrow key is pressed', function (assert) { + assert.expect(2) + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="false">' + + '<div class="carousel-inner">' + + '<div id="first" class="carousel-item active">' + + '<img alt="">' + + '</div>' + + '<div id="second" class="carousel-item">' + + '<img alt="">' + + '</div>' + + '<div id="third" class="carousel-item">' + + '<img alt="">' + + '</div>' + + '</div>' + + '</div>' + var $template = $(templateHTML) + + $template.bootstrapCarousel() + + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item active') + + $template.trigger($.Event('keydown', { + which: 39 + })) + + assert.strictEqual($template.find('.carousel-item')[1], $template.find('.active')[0], 'second item active') + }) + + QUnit.test('should not prevent keydown if key is not ARROW_LEFT or ARROW_RIGHT', function (assert) { + assert.expect(2) + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="false">' + + '<div class="carousel-inner">' + + '<div id="first" class="carousel-item active">' + + '<img alt="">' + + '</div>' + + '</div>' + + '</div>' + var $template = $(templateHTML) + + $template.bootstrapCarousel() + var done = assert.async() + + var eventArrowDown = $.Event('keydown', { + which: 40 + }) + var eventArrowUp = $.Event('keydown', { + which: 38 + }) + + $template.one('keydown', function (event) { + assert.strictEqual(event.isDefaultPrevented(), false) + }) + + $template.trigger(eventArrowDown) + + $template.one('keydown', function (event) { + assert.strictEqual(event.isDefaultPrevented(), false) + done() + }) + + $template.trigger(eventArrowUp) + }) + + QUnit.test('should support disabling the keyboard navigation', function (assert) { + assert.expect(3) + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="false" data-keyboard="false">' + + '<div class="carousel-inner">' + + '<div id="first" class="carousel-item active">' + + '<img alt="">' + + '</div>' + + '<div id="second" class="carousel-item">' + + '<img alt="">' + + '</div>' + + '<div id="third" class="carousel-item">' + + '<img alt="">' + + '</div>' + + '</div>' + + '</div>' + var $template = $(templateHTML) + + $template.bootstrapCarousel() + + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item active') + + $template.trigger($.Event('keydown', { + which: 39 + })) + + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item still active after right arrow press') + + $template.trigger($.Event('keydown', { + which: 37 + })) + + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item still active after left arrow press') + }) + + QUnit.test('should ignore keyboard events within <input>s and <textarea>s', function (assert) { + assert.expect(7) + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="false">' + + '<div class="carousel-inner">' + + '<div id="first" class="carousel-item active">' + + '<img alt="">' + + '<input type="text" id="in-put">' + + '<textarea id="text-area"></textarea>' + + '</div>' + + '<div id="second" class="carousel-item">' + + '<img alt="">' + + '</div>' + + '<div id="third" class="carousel-item">' + + '<img alt="">' + + '</div>' + + '</div>' + + '</div>' + var $template = $(templateHTML) + var $input = $template.find('#in-put') + var $textarea = $template.find('#text-area') + + assert.strictEqual($input.length, 1, 'found <input>') + assert.strictEqual($textarea.length, 1, 'found <textarea>') + + $template.bootstrapCarousel() + + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item active') + + $input.trigger($.Event('keydown', { + which: 39 + })) + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item still active after right arrow press in <input>') + + $input.trigger($.Event('keydown', { + which: 37 + })) + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item still active after left arrow press in <input>') + + $textarea.trigger($.Event('keydown', { + which: 39 + })) + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item still active after right arrow press in <textarea>') + + $textarea.trigger($.Event('keydown', { + which: 37 + })) + assert.strictEqual($template.find('.carousel-item')[0], $template.find('.active')[0], 'first item still active after left arrow press in <textarea>') + }) + + QUnit.test('should wrap around from end to start when wrap option is true', function (assert) { + assert.expect(3) + var carouselHTML = '<div id="carousel-example-generic" class="carousel slide" data-wrap="true">' + + '<ol class="carousel-indicators">' + + '<li data-target="#carousel-example-generic" data-slide-to="0" class="active"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="1"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="2"/>' + + '</ol>' + + '<div class="carousel-inner">' + + '<div class="carousel-item active" id="one">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item" id="two">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item" id="three">' + + '<div class="carousel-caption"/>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"/>' + + '<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"/>' + + '</div>' + var $carousel = $(carouselHTML) + var getActiveId = function () { + return $carousel.find('.carousel-item.active').attr('id') + } + + var done = assert.async() + + $carousel + .one('slid.bs.carousel', function () { + assert.strictEqual(getActiveId(), 'two', 'carousel slid from 1st to 2nd slide') + $carousel + .one('slid.bs.carousel', function () { + assert.strictEqual(getActiveId(), 'three', 'carousel slid from 2nd to 3rd slide') + $carousel + .one('slid.bs.carousel', function () { + assert.strictEqual(getActiveId(), 'one', 'carousel wrapped around and slid from 3rd to 1st slide') + done() + }) + .bootstrapCarousel('next') + }) + .bootstrapCarousel('next') + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should wrap around from start to end when wrap option is true', function (assert) { + assert.expect(1) + var carouselHTML = '<div id="carousel-example-generic" class="carousel slide" data-wrap="true">' + + '<ol class="carousel-indicators">' + + '<li data-target="#carousel-example-generic" data-slide-to="0" class="active"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="1"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="2"/>' + + '</ol>' + + '<div class="carousel-inner">' + + '<div class="carousel-item active" id="one">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item" id="two">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item" id="three">' + + '<div class="carousel-caption"/>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"/>' + + '<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"/>' + + '</div>' + var $carousel = $(carouselHTML) + + var done = assert.async() + + $carousel + .on('slid.bs.carousel', function () { + assert.strictEqual($carousel.find('.carousel-item.active').attr('id'), 'three', 'carousel wrapped around and slid from 1st to 3rd slide') + done() + }) + .bootstrapCarousel('prev') + }) + + QUnit.test('should stay at the end when the next method is called and wrap is false', function (assert) { + assert.expect(3) + var carouselHTML = '<div id="carousel-example-generic" class="carousel slide" data-wrap="false">' + + '<ol class="carousel-indicators">' + + '<li data-target="#carousel-example-generic" data-slide-to="0" class="active"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="1"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="2"/>' + + '</ol>' + + '<div class="carousel-inner">' + + '<div class="carousel-item active" id="one">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item" id="two">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item" id="three">' + + '<div class="carousel-caption"/>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"/>' + + '<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"/>' + + '</div>' + var $carousel = $(carouselHTML) + var getActiveId = function () { + return $carousel.find('.carousel-item.active').attr('id') + } + + var done = assert.async() + + $carousel + .one('slid.bs.carousel', function () { + assert.strictEqual(getActiveId(), 'two', 'carousel slid from 1st to 2nd slide') + $carousel + .one('slid.bs.carousel', function () { + assert.strictEqual(getActiveId(), 'three', 'carousel slid from 2nd to 3rd slide') + $carousel + .one('slid.bs.carousel', function () { + assert.ok(false, 'carousel slid when it should not have slid') + }) + .bootstrapCarousel('next') + assert.strictEqual(getActiveId(), 'three', 'carousel did not wrap around and stayed on 3rd slide') + done() + }) + .bootstrapCarousel('next') + }) + .bootstrapCarousel('next') + }) + + QUnit.test('should stay at the start when the prev method is called and wrap is false', function (assert) { + assert.expect(1) + var carouselHTML = '<div id="carousel-example-generic" class="carousel slide" data-wrap="false">' + + '<ol class="carousel-indicators">' + + '<li data-target="#carousel-example-generic" data-slide-to="0" class="active"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="1"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="2"/>' + + '</ol>' + + '<div class="carousel-inner">' + + '<div class="carousel-item active" id="one">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item" id="two">' + + '<div class="carousel-caption"/>' + + '</div>' + + '<div class="carousel-item" id="three">' + + '<div class="carousel-caption"/>' + + '</div>' + + '</div>' + + '<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"/>' + + '<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"/>' + + '</div>' + var $carousel = $(carouselHTML) + + $carousel + .on('slid.bs.carousel', function () { + assert.ok(false, 'carousel slid when it should not have slid') + }) + .bootstrapCarousel('prev') + assert.strictEqual($carousel.find('.carousel-item.active').attr('id'), 'one', 'carousel did not wrap around and stayed on 1st slide') + }) + + QUnit.test('should not prevent keydown for inputs and textareas', function (assert) { + assert.expect(2) + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="false">' + + '<div class="carousel-inner">' + + '<div id="first" class="carousel-item">' + + '<input type="text" id="inputText" />' + + '</div>' + + '<div id="second" class="carousel-item active">' + + '<textarea id="txtArea"></textarea>' + + '</div>' + + '</div>' + + '</div>' + var $template = $(templateHTML) + var done = assert.async() + $template.appendTo('#qunit-fixture') + var $inputText = $template.find('#inputText') + var $textArea = $template.find('#txtArea') + $template.bootstrapCarousel() + + var eventKeyDown = $.Event('keydown', { + which: 65 + }) // 65 for "a" + $inputText.on('keydown', function (event) { + assert.strictEqual(event.isDefaultPrevented(), false) + }) + $inputText.trigger(eventKeyDown) + + $textArea.on('keydown', function (event) { + assert.strictEqual(event.isDefaultPrevented(), false) + done() + }) + $textArea.trigger(eventKeyDown) + }) + + QUnit.test('Should not go to the next item when the carousel is not visible', function (assert) { + assert.expect(2) + var done = assert.async() + var html = '<div id="myCarousel" class="carousel slide" data-interval="50" style="display: none;">' + + ' <div class="carousel-inner">' + + ' <div id="firstItem" class="carousel-item active">' + + ' <img alt="">' + + ' </div>' + + ' <div class="carousel-item">' + + ' <img alt="">' + + ' </div>' + + ' <div class="carousel-item">' + + ' <img alt="">' + + ' </div>' + + ' <a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>' + + ' <a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>' + + '</div>' + var $html = $(html) + $html + .appendTo('#qunit-fixture') + .bootstrapCarousel() + + var $firstItem = $('#firstItem') + setTimeout(function () { + assert.ok($firstItem.hasClass('active')) + $html + .bootstrapCarousel('dispose') + .attr('style', 'visibility: hidden;') + .bootstrapCarousel() + + setTimeout(function () { + assert.ok($firstItem.hasClass('active')) + done() + }, 80) + }, 80) + }) + + QUnit.test('Should not go to the next item when the parent of the carousel is not visible', function (assert) { + assert.expect(2) + var done = assert.async() + var html = '<div id="parent" style="display: none;">' + + ' <div id="myCarousel" class="carousel slide" data-interval="50" style="display: none;">' + + ' <div class="carousel-inner">' + + ' <div id="firstItem" class="carousel-item active">' + + ' <img alt="">' + + ' </div>' + + ' <div class="carousel-item">' + + ' <img alt="">' + + ' </div>' + + ' <div class="carousel-item">' + + ' <img alt="">' + + ' </div>' + + ' <a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>' + + ' <a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>' + + ' </div>' + + '</div>' + var $html = $(html) + $html.appendTo('#qunit-fixture') + var $parent = $html.find('#parent') + var $carousel = $html.find('#myCarousel') + $carousel.bootstrapCarousel() + var $firstItem = $('#firstItem') + + setTimeout(function () { + assert.ok($firstItem.hasClass('active')) + $carousel.bootstrapCarousel('dispose') + $parent.attr('style', 'visibility: hidden;') + $carousel.bootstrapCarousel() + + setTimeout(function () { + assert.ok($firstItem.hasClass('active')) + done() + }, 80) + }, 80) + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/collapse.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/collapse.js new file mode 100644 index 0000000..7f4cedd --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/collapse.js @@ -0,0 +1,858 @@ +$(function () { + 'use strict' + + QUnit.module('collapse plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).collapse, 'collapse method is defined') + }) + + QUnit.module('collapse', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapCollapse = $.fn.collapse.noConflict() + }, + afterEach: function () { + $.fn.collapse = $.fn.bootstrapCollapse + delete $.fn.bootstrapCollapse + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.collapse, 'undefined', 'collapse was set back to undefined (org value)') + }) + + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div/>') + $el.bootstrapCollapse() + try { + $el.bootstrapCollapse('noMethod') + } catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>') + var $collapse = $el.bootstrapCollapse() + assert.ok($collapse instanceof $, 'returns jquery collection') + assert.strictEqual($collapse[0], $el[0], 'collection contains element') + }) + + QUnit.test('should show a collapsed element', function (assert) { + assert.expect(2) + var done = assert.async() + var $el = $('<div class="collapse"/>') + + $el.one('shown.bs.collapse', function () { + assert.ok($el.hasClass('show'), 'has class "show"') + assert.ok(!/height/i.test($el.attr('style')), 'has height reset') + done() + }).bootstrapCollapse('show') + }) + + QUnit.test('should show multiple collapsed elements', function (assert) { + assert.expect(4) + var done = assert.async() + var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href=".multi"/>').appendTo('#qunit-fixture') + var $el = $('<div class="collapse multi"/>').appendTo('#qunit-fixture') + var $el2 = $('<div class="collapse multi"/>').appendTo('#qunit-fixture') + $el.one('shown.bs.collapse', function () { + assert.ok($el.hasClass('show'), 'has class "show"') + assert.ok(!/height/i.test($el.attr('style')), 'has height reset') + }) + $el2.one('shown.bs.collapse', function () { + assert.ok($el2.hasClass('show'), 'has class "show"') + assert.ok(!/height/i.test($el2.attr('style')), 'has height reset') + done() + }) + $target.trigger('click') + }) + + QUnit.test('should collapse only the first collapse', function (assert) { + assert.expect(2) + var done = assert.async() + var html = [ + '<div class="panel-group" id="accordion1">', + '<div class="panel">', + '<div id="collapse1" class="collapse"/>', + '</div>', + '</div>', + '<div class="panel-group" id="accordion2">', + '<div class="panel">', + '<div id="collapse2" class="collapse show"/>', + '</div>', + '</div>' + ].join('') + $(html).appendTo('#qunit-fixture') + var $el1 = $('#collapse1') + var $el2 = $('#collapse2') + $el1.one('shown.bs.collapse', function () { + assert.ok($el1.hasClass('show')) + assert.ok($el2.hasClass('show')) + done() + }).bootstrapCollapse('show') + }) + + QUnit.test('should hide a collapsed element', function (assert) { + assert.expect(1) + var $el = $('<div class="collapse"/>').bootstrapCollapse('hide') + + assert.ok(!$el.hasClass('show'), 'does not have class "show"') + }) + + QUnit.test('should not fire shown when show is prevented', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div class="collapse"/>') + .on('show.bs.collapse', function (e) { + e.preventDefault() + assert.ok(true, 'show event fired') + done() + }) + .on('shown.bs.collapse', function () { + assert.ok(false, 'shown event fired') + }) + .bootstrapCollapse('show') + }) + + QUnit.test('should reset style to auto after finishing opening collapse', function (assert) { + assert.expect(2) + var done = assert.async() + + $('<div class="collapse" style="height: 0px"/>') + .on('show.bs.collapse', function () { + assert.strictEqual(this.style.height, '0px', 'height is 0px') + }) + .on('shown.bs.collapse', function () { + assert.strictEqual(this.style.height, '', 'height is auto') + done() + }) + .bootstrapCollapse('show') + }) + + QUnit.test('should reset style to auto after finishing closing collapse', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div class="collapse"/>') + .on('shown.bs.collapse', function () { + $(this).bootstrapCollapse('hide') + }) + .on('hidden.bs.collapse', function () { + assert.strictEqual(this.style.height, '', 'height is auto') + done() + }) + .bootstrapCollapse('show') + }) + + QUnit.test('should remove "collapsed" class from target when collapse is shown', function (assert) { + assert.expect(1) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture') + + $('<div id="test1"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.collapse', function () { + assert.ok(!$target.hasClass('collapsed'), 'target does not have collapsed class') + done() + }) + + $target.trigger('click') + }) + + QUnit.test('should add "collapsed" class to target when collapse is hidden', function (assert) { + assert.expect(1) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') + + $('<div id="test1" class="show"/>') + .appendTo('#qunit-fixture') + .on('hidden.bs.collapse', function () { + assert.ok($target.hasClass('collapsed'), 'target has collapsed class') + done() + }) + + $target.trigger('click') + }) + + QUnit.test('should remove "collapsed" class from all triggers targeting the collapse when the collapse is shown', function (assert) { + assert.expect(2) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture') + var $alt = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture') + + $('<div id="test1"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.collapse', function () { + assert.ok(!$target.hasClass('collapsed'), 'target trigger does not have collapsed class') + assert.ok(!$alt.hasClass('collapsed'), 'alt trigger does not have collapsed class') + done() + }) + + $target.trigger('click') + }) + + QUnit.test('should add "collapsed" class to all triggers targeting the collapse when the collapse is hidden', function (assert) { + assert.expect(2) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') + var $alt = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') + + $('<div id="test1" class="show"/>') + .appendTo('#qunit-fixture') + .on('hidden.bs.collapse', function () { + assert.ok($target.hasClass('collapsed'), 'target has collapsed class') + assert.ok($alt.hasClass('collapsed'), 'alt trigger has collapsed class') + done() + }) + + $target.trigger('click') + }) + + QUnit.test('should not close a collapse when initialized with "show" option if already shown', function (assert) { + assert.expect(0) + var done = assert.async() + + var $test = $('<div id="test1" class="show"/>') + .appendTo('#qunit-fixture') + .on('hide.bs.collapse', function () { + assert.ok(false) + }) + + $test.bootstrapCollapse('show') + + setTimeout(done, 0) + }) + + QUnit.test('should open a collapse when initialized with "show" option if not already shown', function (assert) { + assert.expect(1) + var done = assert.async() + + var $test = $('<div id="test1" />') + .appendTo('#qunit-fixture') + .on('show.bs.collapse', function () { + assert.ok(true) + }) + + $test.bootstrapCollapse('show') + + setTimeout(done, 0) + }) + + QUnit.test('should not show a collapse when initialized with "hide" option if already hidden', function (assert) { + assert.expect(0) + var done = assert.async() + + $('<div class="collapse"></div>') + .appendTo('#qunit-fixture') + .on('show.bs.collapse', function () { + assert.ok(false, 'showing a previously-uninitialized hidden collapse when the "hide" method is called') + }) + .bootstrapCollapse('hide') + + setTimeout(done, 0) + }) + + QUnit.test('should hide a collapse when initialized with "hide" option if not already hidden', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div class="collapse show"></div>') + .appendTo('#qunit-fixture') + .on('hide.bs.collapse', function () { + assert.ok(true, 'hiding a previously-uninitialized shown collapse when the "hide" method is called') + }) + .bootstrapCollapse('hide') + + setTimeout(done, 0) + }) + + QUnit.test('should remove "collapsed" class from active accordion target', function (assert) { + assert.expect(3) + var done = assert.async() + + var accordionHTML = '<div id="accordion">' + + '<div class="card"/>' + + '<div class="card"/>' + + '<div class="card"/>' + + '</div>' + var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.card') + + var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" />').appendTo($groups.eq(0)) + + $('<div id="body1" class="show" data-parent="#accordion"/>').appendTo($groups.eq(0)) + + var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2" />').appendTo($groups.eq(1)) + + $('<div id="body2" data-parent="#accordion"/>').appendTo($groups.eq(1)) + + var $target3 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body3" />').appendTo($groups.eq(2)) + + $('<div id="body3" data-parent="#accordion"/>') + .appendTo($groups.eq(2)) + .on('shown.bs.collapse', function () { + assert.ok($target1.hasClass('collapsed'), 'inactive target 1 does have class "collapsed"') + assert.ok($target2.hasClass('collapsed'), 'inactive target 2 does have class "collapsed"') + assert.ok(!$target3.hasClass('collapsed'), 'active target 3 does not have class "collapsed"') + + done() + }) + + $target3.trigger('click') + }) + + QUnit.test('should allow dots in data-parent', function (assert) { + assert.expect(3) + var done = assert.async() + + var accordionHTML = '<div class="accordion">' + + '<div class="card"/>' + + '<div class="card"/>' + + '<div class="card"/>' + + '</div>' + var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.card') + + var $target1 = $('<a role="button" data-toggle="collapse" href="#body1"/>').appendTo($groups.eq(0)) + + $('<div id="body1" class="show" data-parent=".accordion"/>').appendTo($groups.eq(0)) + + var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2"/>').appendTo($groups.eq(1)) + + $('<div id="body2" data-parent=".accordion"/>').appendTo($groups.eq(1)) + + var $target3 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body3"/>').appendTo($groups.eq(2)) + + $('<div id="body3" data-parent=".accordion"/>') + .appendTo($groups.eq(2)) + .on('shown.bs.collapse', function () { + assert.ok($target1.hasClass('collapsed'), 'inactive target 1 does have class "collapsed"') + assert.ok($target2.hasClass('collapsed'), 'inactive target 2 does have class "collapsed"') + assert.ok(!$target3.hasClass('collapsed'), 'active target 3 does not have class "collapsed"') + + done() + }) + + $target3.trigger('click') + }) + + QUnit.test('should set aria-expanded="true" on trigger/control when collapse is shown', function (assert) { + assert.expect(1) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture') + + $('<div id="test1"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.collapse', function () { + assert.strictEqual($target.attr('aria-expanded'), 'true', 'aria-expanded on target is "true"') + done() + }) + + $target.trigger('click') + }) + + QUnit.test('should set aria-expanded="false" on trigger/control when collapse is hidden', function (assert) { + assert.expect(1) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') + + $('<div id="test1" class="show"/>') + .appendTo('#qunit-fixture') + .on('hidden.bs.collapse', function () { + assert.strictEqual($target.attr('aria-expanded'), 'false', 'aria-expanded on target is "false"') + done() + }) + + $target.trigger('click') + }) + + QUnit.test('should set aria-expanded="true" on all triggers targeting the collapse when the collapse is shown', function (assert) { + assert.expect(2) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture') + var $alt = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture') + + $('<div id="test1"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.collapse', function () { + assert.strictEqual($target.attr('aria-expanded'), 'true', 'aria-expanded on trigger/control is "true"') + assert.strictEqual($alt.attr('aria-expanded'), 'true', 'aria-expanded on alternative trigger/control is "true"') + done() + }) + + $target.trigger('click') + }) + + QUnit.test('should set aria-expanded="false" on all triggers targeting the collapse when the collapse is hidden', function (assert) { + assert.expect(2) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') + var $alt = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') + + $('<div id="test1" class="show"/>') + .appendTo('#qunit-fixture') + .on('hidden.bs.collapse', function () { + assert.strictEqual($target.attr('aria-expanded'), 'false', 'aria-expanded on trigger/control is "false"') + assert.strictEqual($alt.attr('aria-expanded'), 'false', 'aria-expanded on alternative trigger/control is "false"') + done() + }) + + $target.trigger('click') + }) + + QUnit.test('should change aria-expanded from active accordion trigger/control to "false" and set the trigger/control for the newly active one to "true"', function (assert) { + assert.expect(3) + var done = assert.async() + + var accordionHTML = '<div id="accordion">' + + '<div class="card"/>' + + '<div class="card"/>' + + '<div class="card"/>' + + '</div>' + var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.card') + + var $target1 = $('<a role="button" data-toggle="collapse" aria-expanded="true" href="#body1"/>').appendTo($groups.eq(0)) + + $('<div id="body1" class="show" data-parent="#accordion"/>').appendTo($groups.eq(0)) + + var $target2 = $('<a role="button" data-toggle="collapse" aria-expanded="false" href="#body2" class="collapsed" aria-expanded="false" />').appendTo($groups.eq(1)) + + $('<div id="body2" data-parent="#accordion"/>').appendTo($groups.eq(1)) + + var $target3 = $('<a class="collapsed" data-toggle="collapse" aria-expanded="false" role="button" href="#body3"/>').appendTo($groups.eq(2)) + + $('<div id="body3" data-parent="#accordion"/>') + .appendTo($groups.eq(2)) + .on('shown.bs.collapse', function () { + assert.strictEqual($target1.attr('aria-expanded'), 'false', 'inactive trigger/control 1 has aria-expanded="false"') + assert.strictEqual($target2.attr('aria-expanded'), 'false', 'inactive trigger/control 2 has aria-expanded="false"') + assert.strictEqual($target3.attr('aria-expanded'), 'true', 'active trigger/control 3 has aria-expanded="true"') + + done() + }) + + $target3.trigger('click') + }) + + QUnit.test('should not fire show event if show is prevented because other element is still transitioning', function (assert) { + assert.expect(1) + var done = assert.async() + + var accordionHTML = '<div id="accordion">' + + '<div class="card"/>' + + '<div class="card"/>' + + '</div>' + var showFired = false + var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.card') + + var $target1 = $('<a role="button" data-toggle="collapse" href="#body1"/>').appendTo($groups.eq(0)) + + $('<div id="body1" class="collapse" data-parent="#accordion"/>') + .appendTo($groups.eq(0)) + .on('show.bs.collapse', function () { + showFired = true + }) + + var $target2 = $('<a role="button" data-toggle="collapse" href="#body2"/>').appendTo($groups.eq(1)) + var $body2 = $('<div id="body2" class="collapse" data-parent="#accordion"/>').appendTo($groups.eq(1)) + + $target2.trigger('click') + + $body2 + .toggleClass('show collapsing') + .data('bs.collapse')._isTransitioning = 1 + + $target1.trigger('click') + + setTimeout(function () { + assert.ok(!showFired, 'show event did not fire') + done() + }, 1) + }) + + QUnit.test('should add "collapsed" class to target when collapse is hidden via manual invocation', function (assert) { + assert.expect(1) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') + + $('<div id="test1" class="show"/>') + .appendTo('#qunit-fixture') + .on('hidden.bs.collapse', function () { + assert.ok($target.hasClass('collapsed')) + done() + }) + .bootstrapCollapse('hide') + }) + + QUnit.test('should remove "collapsed" class from target when collapse is shown via manual invocation', function (assert) { + assert.expect(1) + var done = assert.async() + + var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture') + + $('<div id="test1"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.collapse', function () { + assert.ok(!$target.hasClass('collapsed')) + done() + }) + .bootstrapCollapse('show') + }) + + QUnit.test('should allow accordion to use children other than card', function (assert) { + assert.expect(4) + var done = assert.async() + var accordionHTML = '<div id="accordion">' + + '<div class="item">' + + '<a id="linkTrigger" data-toggle="collapse" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"></a>' + + '<div id="collapseOne" class="collapse" role="tabpanel" aria-labelledby="headingThree" data-parent="#accordion"></div>' + + '</div>' + + '<div class="item">' + + '<a id="linkTriggerTwo" data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"></a>' + + '<div id="collapseTwo" class="collapse show" role="tabpanel" aria-labelledby="headingTwo" data-parent="#accordion"></div>' + + '</div>' + + '</div>' + + $(accordionHTML).appendTo('#qunit-fixture') + var $trigger = $('#linkTrigger') + var $triggerTwo = $('#linkTriggerTwo') + var $collapseOne = $('#collapseOne') + var $collapseTwo = $('#collapseTwo') + $collapseOne.on('shown.bs.collapse', function () { + assert.ok($collapseOne.hasClass('show'), '#collapseOne is shown') + assert.ok(!$collapseTwo.hasClass('show'), '#collapseTwo is not shown') + $collapseTwo.on('shown.bs.collapse', function () { + assert.ok(!$collapseOne.hasClass('show'), '#collapseOne is not shown') + assert.ok($collapseTwo.hasClass('show'), '#collapseTwo is shown') + done() + }) + $triggerTwo.trigger($.Event('click')) + }) + $trigger.trigger($.Event('click')) + }) + + QUnit.test('should allow accordion to contain nested elements', function (assert) { + assert.expect(4) + var done = assert.async() + var accordionHTML = '<div id="accordion">' + + '<div class="row">' + + '<div class="col-lg-6">' + + '<div class="item">' + + '<a id="linkTrigger" data-toggle="collapse" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"></a>' + + '<div id="collapseOne" class="collapse" role="tabpanel" aria-labelledby="headingThree" data-parent="#accordion"></div>' + + '</div>' + + '</div>' + + '<div class="col-lg-6">' + + '<div class="item">' + + '<a id="linkTriggerTwo" data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"></a>' + + '<div id="collapseTwo" class="collapse show" role="tabpanel" aria-labelledby="headingTwo" data-parent="#accordion"></div>' + + '</div>' + + '</div>' + + '</div>' + + '</div>' + + $(accordionHTML).appendTo('#qunit-fixture') + var $trigger = $('#linkTrigger') + var $triggerTwo = $('#linkTriggerTwo') + var $collapseOne = $('#collapseOne') + var $collapseTwo = $('#collapseTwo') + $collapseOne.on('shown.bs.collapse', function () { + assert.ok($collapseOne.hasClass('show'), '#collapseOne is shown') + assert.ok(!$collapseTwo.hasClass('show'), '#collapseTwo is not shown') + $collapseTwo.on('shown.bs.collapse', function () { + assert.ok(!$collapseOne.hasClass('show'), '#collapseOne is not shown') + assert.ok($collapseTwo.hasClass('show'), '#collapseTwo is shown') + done() + }) + $triggerTwo.trigger($.Event('click')) + }) + $trigger.trigger($.Event('click')) + }) + + QUnit.test('should allow accordion to target multiple elements', function (assert) { + assert.expect(8) + var done = assert.async() + var accordionHTML = '<div id="accordion">' + + '<a id="linkTriggerOne" data-toggle="collapse" data-target=".collapseOne" href="#" aria-expanded="false" aria-controls="collapseOne"></a>' + + '<a id="linkTriggerTwo" data-toggle="collapse" data-target=".collapseTwo" href="#" aria-expanded="false" aria-controls="collapseTwo"></a>' + + '<div id="collapseOneOne" class="collapse collapseOne" role="tabpanel" data-parent="#accordion"></div>' + + '<div id="collapseOneTwo" class="collapse collapseOne" role="tabpanel" data-parent="#accordion"></div>' + + '<div id="collapseTwoOne" class="collapse collapseTwo" role="tabpanel" data-parent="#accordion"></div>' + + '<div id="collapseTwoTwo" class="collapse collapseTwo" role="tabpanel" data-parent="#accordion"></div>' + + '</div>' + + $(accordionHTML).appendTo('#qunit-fixture') + var $trigger = $('#linkTriggerOne') + var $triggerTwo = $('#linkTriggerTwo') + var $collapseOneOne = $('#collapseOneOne') + var $collapseOneTwo = $('#collapseOneTwo') + var $collapseTwoOne = $('#collapseTwoOne') + var $collapseTwoTwo = $('#collapseTwoTwo') + var collapsedElements = { + one : false, + two : false + } + + function firstTest() { + assert.ok($collapseOneOne.hasClass('show'), '#collapseOneOne is shown') + assert.ok($collapseOneTwo.hasClass('show'), '#collapseOneTwo is shown') + assert.ok(!$collapseTwoOne.hasClass('show'), '#collapseTwoOne is not shown') + assert.ok(!$collapseTwoTwo.hasClass('show'), '#collapseTwoTwo is not shown') + $triggerTwo.trigger($.Event('click')) + } + + function secondTest() { + assert.ok(!$collapseOneOne.hasClass('show'), '#collapseOneOne is not shown') + assert.ok(!$collapseOneTwo.hasClass('show'), '#collapseOneTwo is not shown') + assert.ok($collapseTwoOne.hasClass('show'), '#collapseTwoOne is shown') + assert.ok($collapseTwoTwo.hasClass('show'), '#collapseTwoTwo is shown') + done() + } + + $collapseOneOne.on('shown.bs.collapse', function () { + if (collapsedElements.one) { + firstTest() + } else { + collapsedElements.one = true + } + }) + + $collapseOneTwo.on('shown.bs.collapse', function () { + if (collapsedElements.one) { + firstTest() + } else { + collapsedElements.one = true + } + }) + + $collapseTwoOne.on('shown.bs.collapse', function () { + if (collapsedElements.two) { + secondTest() + } else { + collapsedElements.two = true + } + }) + + $collapseTwoTwo.on('shown.bs.collapse', function () { + if (collapsedElements.two) { + secondTest() + } else { + collapsedElements.two = true + } + }) + + $trigger.trigger($.Event('click')) + }) + + QUnit.test('should collapse accordion children but not nested accordion children', function (assert) { + assert.expect(9) + var done = assert.async() + $('<div id="accordion">' + + '<div class="item">' + + '<a id="linkTrigger" data-toggle="collapse" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"></a>' + + '<div id="collapseOne" data-parent="#accordion" class="collapse" role="tabpanel" aria-labelledby="headingThree">' + + '<div id="nestedAccordion">' + + '<div class="item">' + + '<a id="nestedLinkTrigger" data-toggle="collapse" href="#nestedCollapseOne" aria-expanded="false" aria-controls="nestedCollapseOne"></a>' + + '<div id="nestedCollapseOne" data-parent="#nestedAccordion" class="collapse" role="tabpanel" aria-labelledby="headingThree">' + + '</div>' + + '</div>' + + '</div>' + + '</div>' + + '</div>' + + '<div class="item">' + + '<a id="linkTriggerTwo" data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"></a>' + + '<div id="collapseTwo" data-parent="#accordion" class="collapse show" role="tabpanel" aria-labelledby="headingTwo"></div>' + + '</div>' + + '</div>').appendTo('#qunit-fixture') + var $trigger = $('#linkTrigger') + var $triggerTwo = $('#linkTriggerTwo') + var $nestedTrigger = $('#nestedLinkTrigger') + var $collapseOne = $('#collapseOne') + var $collapseTwo = $('#collapseTwo') + var $nestedCollapseOne = $('#nestedCollapseOne') + + $collapseOne.one('shown.bs.collapse', function () { + assert.ok($collapseOne.hasClass('show'), '#collapseOne is shown') + assert.ok(!$collapseTwo.hasClass('show'), '#collapseTwo is not shown') + assert.ok(!$('#nestedCollapseOne').hasClass('show'), '#nestedCollapseOne is not shown') + $nestedCollapseOne.one('shown.bs.collapse', function () { + assert.ok($collapseOne.hasClass('show'), '#collapseOne is shown') + assert.ok(!$collapseTwo.hasClass('show'), '#collapseTwo is not shown') + assert.ok($nestedCollapseOne.hasClass('show'), '#nestedCollapseOne is shown') + $collapseTwo.one('shown.bs.collapse', function () { + assert.ok(!$collapseOne.hasClass('show'), '#collapseOne is not shown') + assert.ok($collapseTwo.hasClass('show'), '#collapseTwo is shown') + assert.ok($nestedCollapseOne.hasClass('show'), '#nestedCollapseOne is shown') + done() + }) + $triggerTwo.trigger($.Event('click')) + }) + $nestedTrigger.trigger($.Event('click')) + }) + $trigger.trigger($.Event('click')) + }) + + QUnit.test('should not prevent event for input', function (assert) { + assert.expect(3) + var done = assert.async() + var $target = $('<input type="checkbox" data-toggle="collapse" data-target="#collapsediv1" />').appendTo('#qunit-fixture') + + $('<div id="collapsediv1"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.collapse', function () { + assert.ok($(this).hasClass('show')) + assert.ok($target.attr('aria-expanded') === 'true') + assert.ok($target.prop('checked')) + done() + }) + + $target.trigger($.Event('click')) + }) + + QUnit.test('should add "collapsed" class to triggers only when all the targeted collapse are hidden', function (assert) { + assert.expect(9) + var done = assert.async() + + var $trigger1 = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') + var $trigger2 = $('<a role="button" data-toggle="collapse" href="#test2"/>').appendTo('#qunit-fixture') + var $trigger3 = $('<a role="button" data-toggle="collapse" href=".multi"/>').appendTo('#qunit-fixture') + + var $target1 = $('<div id="test1" class="multi"/>').appendTo('#qunit-fixture') + var $target2 = $('<div id="test2" class="multi"/>').appendTo('#qunit-fixture') + + $target2.one('shown.bs.collapse', function () { + assert.ok(!$trigger1.hasClass('collapsed'), 'trigger1 does not have collapsed class') + assert.ok(!$trigger2.hasClass('collapsed'), 'trigger2 does not have collapsed class') + assert.ok(!$trigger3.hasClass('collapsed'), 'trigger3 does not have collapsed class') + $target2.one('hidden.bs.collapse', function () { + assert.ok(!$trigger1.hasClass('collapsed'), 'trigger1 does not have collapsed class') + assert.ok($trigger2.hasClass('collapsed'), 'trigger2 has collapsed class') + assert.ok(!$trigger3.hasClass('collapsed'), 'trigger3 does not have collapsed class') + $target1.one('hidden.bs.collapse', function () { + assert.ok($trigger1.hasClass('collapsed'), 'trigger1 has collapsed class') + assert.ok($trigger2.hasClass('collapsed'), 'trigger2 has collapsed class') + assert.ok($trigger3.hasClass('collapsed'), 'trigger3 has collapsed class') + done() + }) + $trigger1.trigger('click') + }) + $trigger2.trigger('click') + }) + $trigger3.trigger('click') + }) + + QUnit.test('should set aria-expanded="true" to triggers targeting shown collaspe and aria-expanded="false" only when all the targeted collapses are shown', function (assert) { + assert.expect(9) + var done = assert.async() + + var $trigger1 = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') + var $trigger2 = $('<a role="button" data-toggle="collapse" href="#test2"/>').appendTo('#qunit-fixture') + var $trigger3 = $('<a role="button" data-toggle="collapse" href=".multi"/>').appendTo('#qunit-fixture') + + var $target1 = $('<div id="test1" class="multi collapse"/>').appendTo('#qunit-fixture') + var $target2 = $('<div id="test2" class="multi collapse"/>').appendTo('#qunit-fixture') + + $target2.one('shown.bs.collapse', function () { + assert.strictEqual($trigger1.attr('aria-expanded'), 'true', 'aria-expanded on trigger1 is "true"') + assert.strictEqual($trigger2.attr('aria-expanded'), 'true', 'aria-expanded on trigger2 is "true"') + assert.strictEqual($trigger3.attr('aria-expanded'), 'true', 'aria-expanded on trigger3 is "true"') + $target2.one('hidden.bs.collapse', function () { + assert.strictEqual($trigger1.attr('aria-expanded'), 'true', 'aria-expanded on trigger1 is "true"') + assert.strictEqual($trigger2.attr('aria-expanded'), 'false', 'aria-expanded on trigger2 is "false"') + assert.strictEqual($trigger3.attr('aria-expanded'), 'true', 'aria-expanded on trigger3 is "true"') + $target1.one('hidden.bs.collapse', function () { + assert.strictEqual($trigger1.attr('aria-expanded'), 'false', 'aria-expanded on trigger1 is "fasle"') + assert.strictEqual($trigger2.attr('aria-expanded'), 'false', 'aria-expanded on trigger2 is "false"') + assert.strictEqual($trigger3.attr('aria-expanded'), 'false', 'aria-expanded on trigger3 is "false"') + done() + }) + $trigger1.trigger('click') + }) + $trigger2.trigger('click') + }) + $trigger3.trigger('click') + }) + + QUnit.test('should not prevent interactions inside the collapse element', function (assert) { + assert.expect(2) + var done = assert.async() + + var $target = $('<input type="checkbox" data-toggle="collapse" data-target="#collapsediv1" />').appendTo('#qunit-fixture') + var htmlCollapse = + '<div id="collapsediv1" class="collapse">' + + ' <input type="checkbox" id="testCheckbox" />' + + '</div>' + + $(htmlCollapse) + .appendTo('#qunit-fixture') + .on('shown.bs.collapse', function () { + assert.ok($target.prop('checked'), '$trigger is checked') + var $testCheckbox = $('#testCheckbox') + $testCheckbox.trigger($.Event('click')) + setTimeout(function () { + assert.ok($testCheckbox.prop('checked'), '$testCheckbox is checked too') + done() + }, 5) + }) + + $target.trigger($.Event('click')) + }) + + QUnit.test('should allow jquery object in parent config', function (assert) { + assert.expect(1) + var html = + '<div class="my-collapse">' + + ' <div class="item">' + + ' <a data-toggle="collapse" href="#">Toggle item</a>' + + ' <div class="collapse">Lorem ipsum</div>' + + ' </div>' + + '</div>' + + $(html).appendTo('#qunit-fixture') + try { + $('[data-toggle="collapse"]').bootstrapCollapse({ + parent: $('.my-collapse') + }) + assert.ok(true, 'collapse correctly created') + } catch (err) { + assert.ok(false, 'collapse not created') + } + }) + + QUnit.test('should allow DOM object in parent config', function (assert) { + assert.expect(1) + var html = + '<div class="my-collapse">' + + ' <div class="item">' + + ' <a data-toggle="collapse" href="#">Toggle item</a>' + + ' <div class="collapse">Lorem ipsum</div>' + + ' </div>' + + '</div>' + + $(html).appendTo('#qunit-fixture') + try { + $('[data-toggle="collapse"]').bootstrapCollapse({ + parent: $('.my-collapse')[0] + }) + assert.ok(true, 'collapse correctly created') + } catch (err) { + assert.ok(false, 'collapse not created') + } + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/dropdown.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/dropdown.js new file mode 100644 index 0000000..81d35ff --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/dropdown.js @@ -0,0 +1,1124 @@ +$(function () { + 'use strict' + + QUnit.module('dropdowns plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).dropdown, 'dropdown method is defined') + }) + + QUnit.module('dropdowns', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapDropdown = $.fn.dropdown.noConflict() + }, + afterEach: function () { + $.fn.dropdown = $.fn.bootstrapDropdown + delete $.fn.bootstrapDropdown + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.dropdown, 'undefined', 'dropdown was set back to undefined (org value)') + }) + + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div/>') + $el.bootstrapDropdown() + try { + $el.bootstrapDropdown('noMethod') + } catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>') + var $dropdown = $el.bootstrapDropdown() + assert.ok($dropdown instanceof $, 'returns jquery collection') + assert.strictEqual($dropdown[0], $el[0], 'collection contains element') + }) + + QUnit.test('should not open dropdown if target is disabled via attribute', function (assert) { + assert.expect(1) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<button disabled href="#" class="btn dropdown-toggle" data-toggle="dropdown">Dropdown</button>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + $(dropdownHTML).appendTo('#qunit-fixture') + var $dropdown = $('#qunit-fixture').find('[data-toggle="dropdown"]').bootstrapDropdown() + $dropdown.on('click', function () { + assert.ok(!$dropdown.parent('.dropdown').hasClass('show')) + done() + }) + $dropdown.trigger($.Event('click')) + }) + + QUnit.test('should not add class position-static to dropdown if boundary not set', function (assert) { + assert.expect(1) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown() + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok(!$dropdown.parent('.dropdown').hasClass('position-static'), '"position-static" class not added') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should add class position-static to dropdown if boundary not scrollParent', function (assert) { + assert.expect(1) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-boundary="viewport">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown() + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('position-static'), '"position-static" class added') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should set aria-expanded="true" on target when dropdown menu is shown', function (assert) { + assert.expect(1) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.strictEqual($dropdown.attr('aria-expanded'), 'true', 'aria-expanded is set to string "true" on click') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should set aria-expanded="false" on target when dropdown menu is hidden', function (assert) { + assert.expect(1) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" aria-expanded="false" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + $dropdown + .parent('.dropdown') + .on('hidden.bs.dropdown', function () { + assert.strictEqual($dropdown.attr('aria-expanded'), 'false', 'aria-expanded is set to string "false" on hide') + done() + }) + + $dropdown.trigger('click') + $(document.body).trigger('click') + }) + + QUnit.test('should not open dropdown if target is disabled via class', function (assert) { + assert.expect(1) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<button href="#" class="btn dropdown-toggle disabled" data-toggle="dropdown">Dropdown</button>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + + $(dropdownHTML).appendTo('#qunit-fixture') + var $dropdown = $('#qunit-fixture').find('[data-toggle="dropdown"]').bootstrapDropdown() + $dropdown.on('click', function () { + assert.ok(!$dropdown.parent('.dropdown').hasClass('show')) + done() + }) + $dropdown.trigger($.Event('click')) + }) + + QUnit.test('should add class show to menu if clicked', function (assert) { + assert.expect(1) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown() + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should test if element has a # before assuming it\'s a selector', function (assert) { + assert.expect(1) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="/foo/" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown() + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should remove "show" class if body is clicked', function (assert) { + assert.expect(2) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click') + $(document.body).trigger('click') + }).on('hidden.bs.dropdown', function () { + assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class removed') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should remove "show" class if tabbing outside of menu', function (assert) { + assert.expect(2) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="dropdown-divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click') + var e = $.Event('keyup') + e.which = 9 // Tab + $(document.body).trigger(e) + }).on('hidden.bs.dropdown', function () { + assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class removed') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should remove "show" class if body is clicked, with multiple dropdowns', function (assert) { + assert.expect(7) + var done = assert.async() + var dropdownHTML = '<div class="nav">' + + '<div class="dropdown" id="testmenu">' + + '<a class="dropdown-toggle" data-toggle="dropdown" href="#testmenu">Test menu <span class="caret"/></a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#sub1">Submenu 1</a>' + + '</div>' + + '</div>' + + '</div>' + + '<div class="btn-group">' + + '<button class="btn">Actions</button>' + + '<button class="btn dropdown-toggle" data-toggle="dropdown"></button>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Action 1</a>' + + '</div>' + + '</div>' + var $dropdowns = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-toggle="dropdown"]') + var $first = $dropdowns.first() + var $last = $dropdowns.last() + + assert.strictEqual($dropdowns.length, 2, 'two dropdowns') + + $first.parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.strictEqual($first.parents('.show').length, 1, '"show" class added on click') + assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 1, 'only one dropdown is shown') + $(document.body).trigger('click') + }).on('hidden.bs.dropdown', function () { + assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed') + $last.trigger('click') + }) + + $last.parent('.btn-group') + .on('shown.bs.dropdown', function () { + assert.strictEqual($last.parent('.show').length, 1, '"show" class added on click') + assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 1, 'only one dropdown is shown') + $(document.body).trigger('click') + }).on('hidden.bs.dropdown', function () { + assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed') + done() + }) + $first.trigger('click') + }) + + QUnit.test('should remove "show" class if body if tabbing outside of menu, with multiple dropdowns', function (assert) { + assert.expect(7) + var done = assert.async() + var dropdownHTML = '<div class="nav">' + + '<div class="dropdown" id="testmenu">' + + '<a class="dropdown-toggle" data-toggle="dropdown" href="#testmenu">Test menu <span class="caret"/></a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#sub1">Submenu 1</a>' + + '</div>' + + '</div>' + + '</div>' + + '<div class="btn-group">' + + '<button class="btn">Actions</button>' + + '<button class="btn dropdown-toggle" data-toggle="dropdown"><span class="caret"/></button>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Action 1</a>' + + '</div>' + + '</div>' + var $dropdowns = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-toggle="dropdown"]') + var $first = $dropdowns.first() + var $last = $dropdowns.last() + + assert.strictEqual($dropdowns.length, 2, 'two dropdowns') + + $first.parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.strictEqual($first.parents('.show').length, 1, '"show" class added on click') + assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 1, 'only one dropdown is shown') + var e = $.Event('keyup') + e.which = 9 // Tab + $(document.body).trigger(e) + }).on('hidden.bs.dropdown', function () { + assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed') + $last.trigger('click') + }) + + $last.parent('.btn-group') + .on('shown.bs.dropdown', function () { + assert.strictEqual($last.parent('.show').length, 1, '"show" class added on click') + assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 1, 'only one dropdown is shown') + var e = $.Event('keyup') + e.which = 9 // Tab + $(document.body).trigger(e) + }).on('hidden.bs.dropdown', function () { + assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed') + done() + }) + $first.trigger('click') + }) + + QUnit.test('should fire show and hide event', function (assert) { + assert.expect(2) + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var done = assert.async() + + $dropdown + .parent('.dropdown') + .on('show.bs.dropdown', function () { + assert.ok(true, 'show was fired') + }) + .on('hide.bs.dropdown', function () { + assert.ok(true, 'hide was fired') + done() + }) + + $dropdown.trigger('click') + $(document.body).trigger('click') + }) + + QUnit.test('should fire shown and hidden event', function (assert) { + assert.expect(2) + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var done = assert.async() + + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok(true, 'shown was fired') + }) + .on('hidden.bs.dropdown', function () { + assert.ok(true, 'hidden was fired') + done() + }) + + $dropdown.trigger('click') + $(document.body).trigger('click') + }) + + QUnit.test('should fire shown and hidden event with a relatedTarget', function (assert) { + assert.expect(2) + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + var done = assert.async() + + $dropdown.parent('.dropdown') + .on('hidden.bs.dropdown', function (e) { + assert.strictEqual(e.relatedTarget, $dropdown[0]) + done() + }) + .on('shown.bs.dropdown', function (e) { + assert.strictEqual(e.relatedTarget, $dropdown[0]) + $(document.body).trigger('click') + }) + + $dropdown.trigger('click') + }) + + QUnit.test('should fire hide and hidden event with a clickEvent', function (assert) { + assert.expect(3) + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + $dropdown.parent('.dropdown') + .on('hide.bs.dropdown', function (e) { + assert.ok(e.clickEvent) + }) + .on('hidden.bs.dropdown', function (e) { + assert.ok(e.clickEvent) + }) + .on('shown.bs.dropdown', function () { + assert.ok(true, 'shown was fired') + $(document.body).trigger('click') + }) + + $dropdown.trigger('click') + }) + + QUnit.test('should fire hide and hidden event without a clickEvent if event type is not click', function (assert) { + assert.expect(3) + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + $dropdown.parent('.dropdown') + .on('hide.bs.dropdown', function (e) { + assert.notOk(e.clickEvent) + }) + .on('hidden.bs.dropdown', function (e) { + assert.notOk(e.clickEvent) + }) + .on('shown.bs.dropdown', function () { + assert.ok(true, 'shown was fired') + $dropdown.trigger($.Event('keydown', { + which: 27 + })) + }) + + $dropdown.trigger('click') + }) + + QUnit.test('should ignore keyboard events within <input>s and <textarea>s', function (assert) { + assert.expect(3) + var done = assert.async() + + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '<input type="text" id="input">' + + '<textarea id="textarea"/>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var $input = $('#input') + var $textarea = $('#textarea') + + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok(true, 'shown was fired') + + $input.trigger('focus').trigger($.Event('keydown', { + which: 38 + })) + assert.ok($(document.activeElement).is($input), 'input still focused') + + $textarea.trigger('focus').trigger($.Event('keydown', { + which: 38 + })) + assert.ok($(document.activeElement).is($textarea), 'textarea still focused') + + done() + }) + + $dropdown.trigger('click') + }) + + QUnit.test('should skip disabled element when using keyboard navigation', function (assert) { + assert.expect(3) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item disabled" href="#">Disabled link</a>' + + '<button class="dropdown-item" type="button" disabled>Disabled button</button>' + + '<a id="item1" class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok(true, 'shown was fired') + $dropdown.trigger($.Event('keydown', { + which: 40 + })) + $dropdown.trigger($.Event('keydown', { + which: 40 + })) + assert.ok(!$(document.activeElement).is('.disabled'), '.disabled is not focused') + assert.ok(!$(document.activeElement).is(':disabled'), ':disabled is not focused') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should focus next/previous element when using keyboard navigation', function (assert) { + assert.expect(4) + var done = assert.async() + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a id="item1" class="dropdown-item" href="#">A link</a>' + + '<a id="item2" class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok(true, 'shown was fired') + $dropdown.trigger($.Event('keydown', { + which: 40 + })) + assert.ok($(document.activeElement).is($('#item1')), 'item1 is focused') + + $(document.activeElement).trigger($.Event('keydown', { + which: 40 + })) + assert.ok($(document.activeElement).is($('#item2')), 'item2 is focused') + + $(document.activeElement).trigger($.Event('keydown', { + which: 38 + })) + assert.ok($(document.activeElement).is($('#item1')), 'item1 is focused') + done() + }) + $dropdown.trigger('click') + }) + + QUnit.test('should not close the dropdown if the user clicks on a text field', function (assert) { + assert.expect(2) + var done = assert.async() + var dropdownHTML = '<div class="dropdown">' + + '<button type="button" data-toggle="dropdown">Dropdown</button>' + + '<div class="dropdown-menu">' + + '<input id="textField" type="text" />' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var $textfield = $('#textField') + $textfield.on('click', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown') + done() + }) + + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown') + $textfield.trigger($.Event('click')) + }) + $dropdown.trigger('click') + }) + + QUnit.test('should not close the dropdown if the user clicks on a textarea', function (assert) { + assert.expect(2) + var done = assert.async() + var dropdownHTML = '<div class="dropdown">' + + '<button type="button" data-toggle="dropdown">Dropdown</button>' + + '<div class="dropdown-menu">' + + '<textarea id="textArea"></textarea>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var $textarea = $('#textArea') + $textarea.on('click', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown') + done() + }) + + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown') + $textarea.trigger($.Event('click')) + }) + $dropdown.trigger('click') + }) + + QUnit.test('Dropdown should not use Popper.js in navbar', function (assert) { + assert.expect(1) + var done = assert.async() + var html = '<nav class="navbar navbar-expand-md navbar-light bg-light">' + + '<div class="dropdown">' + + ' <a class="nav-link dropdown-toggle" href="#" id="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>' + + ' <div class="dropdown-menu" aria-labelledby="dropdown">' + + ' <a class="dropdown-item" href="#">Action</a>' + + ' <a class="dropdown-item" href="#">Another action</a>' + + ' <a class="dropdown-item" href="#">Something else here</a>' + + ' </div>' + + '</div>' + + '</nav>' + + $(html).appendTo('#qunit-fixture') + var $triggerDropdown = $('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + var $dropdownMenu = $triggerDropdown.next() + + $triggerDropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + assert.ok(typeof $dropdownMenu.attr('style') === 'undefined', 'No inline style applied by Popper.js') + done() + }) + $triggerDropdown.trigger($.Event('click')) + }) + + QUnit.test('should ignore keyboard events for <input>s and <textarea>s within dropdown-menu, except for escape key', function (assert) { + assert.expect(7) + var done = assert.async() + + var dropdownHTML = '<div class="tabs">' + + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '<input type="text" id="input">' + + '<textarea id="textarea"/>' + + '</div>' + + '</div>' + + '</div>' + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var $input = $('#input') + var $textarea = $('#textarea') + + $dropdown + .parent('.dropdown') + .on('shown.bs.dropdown', function () { + // Space key + $input.trigger('focus').trigger($.Event('keydown', { + which: 32 + })) + assert.ok($(document.activeElement)[0] === $input[0], 'input still focused') + $textarea.trigger('focus').trigger($.Event('keydown', { + which: 32 + })) + assert.ok($(document.activeElement)[0] === $textarea[0], 'textarea still focused') + + // Key up + $input.trigger('focus').trigger($.Event('keydown', { + which: 38 + })) + assert.ok($(document.activeElement)[0] === $input[0], 'input still focused') + $textarea.trigger('focus').trigger($.Event('keydown', { + which: 38 + })) + assert.ok($(document.activeElement)[0] === $textarea[0], 'textarea still focused') + + // Key down + $input.trigger('focus').trigger($.Event('keydown', { + which: 40 + })) + assert.ok($(document.activeElement)[0] === $input[0], 'input still focused') + $textarea.trigger('focus').trigger($.Event('keydown', { + which: 40 + })) + assert.ok($(document.activeElement)[0] === $textarea[0], 'textarea still focused') + + // Key escape + $input.trigger('focus').trigger($.Event('keydown', { + which: 27 + })) + assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown') + done() + }) + + $dropdown.trigger('click') + }) + + QUnit.test('should ignore space key events for <input>s within dropdown, and accept up, down and escape', function (assert) { + assert.expect(6) + var done = assert.async() + + var dropdownHTML = + '<ul class="nav tabs">' + + ' <li class="dropdown">' + + ' <input type="text" id="input" data-toggle="dropdown">' + + ' <div class="dropdown-menu" role="menu">' + + ' <a id="item1" class="dropdown-item" href="#">Secondary link</a>' + + ' <a id="item2" class="dropdown-item" href="#">Something else here</a>' + + ' <div class="divider"></div>' + + ' <a class="dropdown-item" href="#">Another link</a>' + + ' </div>' + + ' </li>' + + '</ul>' + + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var $input = $('#input') + + $dropdown + .parent('.dropdown') + .one('shown.bs.dropdown', function () { + assert.ok(true, 'shown was fired') + + // Key space + $input.trigger('focus').trigger($.Event('keydown', { + which: 32 + })) + assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown') + assert.ok($(document.activeElement).is($input), 'input is still focused') + + // Key escape + $input.trigger('focus').trigger($.Event('keydown', { + which: 27 + })) + assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown') + + $dropdown + .parent('.dropdown') + .one('shown.bs.dropdown', function () { + // Key down + $input.trigger('focus').trigger($.Event('keydown', { + which: 40 + })) + assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused') + + $dropdown + .parent('.dropdown') + .one('shown.bs.dropdown', function () { + // Key up + $input.trigger('focus').trigger($.Event('keydown', { + which: 38 + })) + assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused') + done() + }).bootstrapDropdown('toggle') + $input.trigger('click') + }) + $input.trigger('click') + }) + $input.trigger('click') + }) + + QUnit.test('should ignore space key events for <textarea>s within dropdown, and accept up, down and escape', function (assert) { + assert.expect(6) + var done = assert.async() + + var dropdownHTML = + '<ul class="nav tabs">' + + ' <li class="dropdown">' + + ' <textarea id="textarea" data-toggle="dropdown"></textarea>' + + ' <div class="dropdown-menu" role="menu">' + + ' <a id="item1" class="dropdown-item" href="#">Secondary link</a>' + + ' <a id="item2" class="dropdown-item" href="#">Something else here</a>' + + ' <div class="divider"></div>' + + ' <a class="dropdown-item" href="#">Another link</a>' + + ' </div>' + + ' </li>' + + '</ul>' + + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var $textarea = $('#textarea') + + $dropdown + .parent('.dropdown') + .one('shown.bs.dropdown', function () { + assert.ok(true, 'shown was fired') + + // Key space + $textarea.trigger('focus').trigger($.Event('keydown', { + which: 32 + })) + assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown') + assert.ok($(document.activeElement).is($textarea), 'textarea is still focused') + + // Key escape + $textarea.trigger('focus').trigger($.Event('keydown', { + which: 27 + })) + assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown') + + $dropdown + .parent('.dropdown') + .one('shown.bs.dropdown', function () { + // Key down + $textarea.trigger('focus').trigger($.Event('keydown', { + which: 40 + })) + assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused') + + $dropdown + .parent('.dropdown') + .one('shown.bs.dropdown', function () { + // Key up + $textarea.trigger('focus').trigger($.Event('keydown', { + which: 38 + })) + assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused') + done() + }).bootstrapDropdown('toggle') + $textarea.trigger('click') + }) + $textarea.trigger('click') + }) + $textarea.trigger('click') + }) + + QUnit.test('should not use Popper.js if display set to static', function (assert) { + assert.expect(1) + var dropdownHTML = + '<div class="dropdown">' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-display="static">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item" href="#">Secondary link</a>' + + '<a class="dropdown-item" href="#">Something else here</a>' + + '<div class="divider"/>' + + '<a class="dropdown-item" href="#">Another link</a>' + + '</div>' + + '</div>' + + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + var done = assert.async() + var dropdownMenu = $dropdown.next()[0] + + $dropdown.parent('.dropdown') + .on('shown.bs.dropdown', function () { + // Popper.js add this attribute when we use it + assert.strictEqual(dropdownMenu.getAttribute('x-placement'), null) + done() + }) + + $dropdown.trigger('click') + }) + + QUnit.test('should call Popper.js and detect navbar on update', function (assert) { + assert.expect(3) + + var dropdownHTML = + '<div class="dropdown">' + + ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + ' <div class="dropdown-menu">' + + ' <a class="dropdown-item" href="#">Another link</a>' + + ' </div>' + + '</div>' + + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var dropdown = $dropdown.data('bs.dropdown') + dropdown.toggle() + assert.ok(dropdown._popper) + + var spyPopper = sinon.spy(dropdown._popper, 'scheduleUpdate') + var spyDetectNavbar = sinon.spy(dropdown, '_detectNavbar') + dropdown.update() + + assert.ok(spyPopper.called) + assert.ok(spyDetectNavbar.called) + }) + + QUnit.test('should just detect navbar on update', function (assert) { + assert.expect(2) + + var dropdownHTML = + '<div class="dropdown">' + + ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + ' <div class="dropdown-menu">' + + ' <a class="dropdown-item" href="#">Another link</a>' + + ' </div>' + + '</div>' + + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var dropdown = $dropdown.data('bs.dropdown') + var spyDetectNavbar = sinon.spy(dropdown, '_detectNavbar') + + dropdown.update() + + assert.notOk(dropdown._popper) + assert.ok(spyDetectNavbar.called) + }) + + QUnit.test('should dispose dropdown with Popper', function (assert) { + assert.expect(6) + + var dropdownHTML = + '<div class="dropdown">' + + ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + ' <div class="dropdown-menu">' + + ' <a class="dropdown-item" href="#">Another link</a>' + + ' </div>' + + '</div>' + + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var dropdown = $dropdown.data('bs.dropdown') + dropdown.toggle() + + assert.ok(dropdown._popper) + assert.ok(dropdown._menu !== null) + assert.ok(dropdown._element !== null) + var spyDestroy = sinon.spy(dropdown._popper, 'destroy') + + dropdown.dispose() + + assert.ok(spyDestroy.called) + assert.ok(dropdown._menu === null) + assert.ok(dropdown._element === null) + }) + + QUnit.test('should dispose dropdown', function (assert) { + assert.expect(5) + + var dropdownHTML = + '<div class="dropdown">' + + ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + ' <div class="dropdown-menu">' + + ' <a class="dropdown-item" href="#">Another link</a>' + + ' </div>' + + '</div>' + + var $dropdown = $(dropdownHTML) + .appendTo('#qunit-fixture') + .find('[data-toggle="dropdown"]') + .bootstrapDropdown() + + var dropdown = $dropdown.data('bs.dropdown') + + assert.notOk(dropdown._popper) + assert.ok(dropdown._menu !== null) + assert.ok(dropdown._element !== null) + + dropdown.dispose() + + assert.ok(dropdown._menu === null) + assert.ok(dropdown._element === null) + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/modal.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/modal.js new file mode 100644 index 0000000..53a2e04 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/modal.js @@ -0,0 +1,657 @@ +$(function () { + 'use strict' + + QUnit.module('modal plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).modal, 'modal method is defined') + }) + + QUnit.module('modal', { + before: function () { + // Enable the scrollbar measurer + $('<style type="text/css"> .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } </style>').appendTo('head') + // Function to calculate the scrollbar width which is then compared to the padding or margin changes + $.fn.getScrollbarWidth = function () { + var scrollDiv = document.createElement('div') + scrollDiv.className = 'modal-scrollbar-measure' + document.body.appendChild(scrollDiv) + var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth + document.body.removeChild(scrollDiv) + return scrollbarWidth + } + + // Simulate scrollbars + $('html').css('padding-right', '16px') + }, + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapModal = $.fn.modal.noConflict() + }, + afterEach: function () { + $('.modal-backdrop, #modal-test').remove() + $(document.body).removeClass('modal-open') + $.fn.modal = $.fn.bootstrapModal + delete $.fn.bootstrapModal + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.modal, 'undefined', 'modal was set back to undefined (orig value)') + }) + + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div id="modal-test"/>') + $el.bootstrapModal() + try { + $el.bootstrapModal('noMethod') + } catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div id="modal-test"/>') + var $modal = $el.bootstrapModal() + assert.ok($modal instanceof $, 'returns jquery collection') + assert.strictEqual($modal[0], $el[0], 'collection contains element') + }) + + QUnit.test('should expose defaults var for settings', function (assert) { + assert.expect(1) + assert.ok($.fn.bootstrapModal.Constructor.Default, 'default object exposed') + }) + + QUnit.test('should insert into dom when show method is called', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div id="modal-test"/>') + .on('shown.bs.modal', function () { + assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should fire show event', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div id="modal-test"/>') + .on('show.bs.modal', function () { + assert.ok(true, 'show event fired') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should not fire shown when show was prevented', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div id="modal-test"/>') + .on('show.bs.modal', function (e) { + e.preventDefault() + assert.ok(true, 'show event fired') + done() + }) + .on('shown.bs.modal', function () { + assert.ok(false, 'shown event fired') + }) + .bootstrapModal('show') + }) + + QUnit.test('should hide modal when hide is called', function (assert) { + assert.expect(3) + var done = assert.async() + + $('<div id="modal-test"/>') + .on('shown.bs.modal', function () { + assert.ok($('#modal-test').is(':visible'), 'modal visible') + assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + $(this).bootstrapModal('hide') + }) + .on('hidden.bs.modal', function () { + assert.ok(!$('#modal-test').is(':visible'), 'modal hidden') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should toggle when toggle is called', function (assert) { + assert.expect(3) + var done = assert.async() + + $('<div id="modal-test"/>') + .on('shown.bs.modal', function () { + assert.ok($('#modal-test').is(':visible'), 'modal visible') + assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + $(this).bootstrapModal('toggle') + }) + .on('hidden.bs.modal', function () { + assert.ok(!$('#modal-test').is(':visible'), 'modal hidden') + done() + }) + .bootstrapModal('toggle') + }) + + QUnit.test('should remove from dom when click [data-dismiss="modal"]', function (assert) { + assert.expect(3) + var done = assert.async() + + $('<div id="modal-test"><span class="close" data-dismiss="modal"/></div>') + .on('shown.bs.modal', function () { + assert.ok($('#modal-test').is(':visible'), 'modal visible') + assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + $(this).find('.close').trigger('click') + }) + .on('hidden.bs.modal', function () { + assert.ok(!$('#modal-test').is(':visible'), 'modal hidden') + done() + }) + .bootstrapModal('toggle') + }) + + QUnit.test('should allow modal close with "backdrop:false"', function (assert) { + assert.expect(2) + var done = assert.async() + + $('<div id="modal-test" data-backdrop="false"/>') + .on('shown.bs.modal', function () { + assert.ok($('#modal-test').is(':visible'), 'modal visible') + $(this).bootstrapModal('hide') + }) + .on('hidden.bs.modal', function () { + assert.ok(!$('#modal-test').is(':visible'), 'modal hidden') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should close modal when clicking outside of modal-content', function (assert) { + assert.expect(3) + var done = assert.async() + + $('<div id="modal-test"><div class="contents"/></div>') + .on('shown.bs.modal', function () { + assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + $('.contents').trigger('click') + assert.ok($('#modal-test').is(':visible'), 'modal visible') + $('#modal-test').trigger('click') + }) + .on('hidden.bs.modal', function () { + assert.ok(!$('#modal-test').is(':visible'), 'modal hidden') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should not close modal when clicking outside of modal-content if data-backdrop="true"', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div id="modal-test" data-backdrop="false"><div class="contents"/></div>') + .on('shown.bs.modal', function () { + $('#modal-test').trigger('click') + assert.ok($('#modal-test').is(':visible'), 'modal not hidden') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should close modal when escape key is pressed via keydown', function (assert) { + assert.expect(3) + var done = assert.async() + + var $div = $('<div id="modal-test"/>') + $div + .on('shown.bs.modal', function () { + assert.ok($('#modal-test').length, 'modal inserted into dom') + assert.ok($('#modal-test').is(':visible'), 'modal visible') + $div.trigger($.Event('keydown', { + which: 27 + })) + + setTimeout(function () { + assert.ok(!$('#modal-test').is(':visible'), 'modal hidden') + $div.remove() + done() + }, 0) + }) + .bootstrapModal('show') + }) + + QUnit.test('should not close modal when escape key is pressed via keyup', function (assert) { + assert.expect(3) + var done = assert.async() + + var $div = $('<div id="modal-test"/>') + $div + .on('shown.bs.modal', function () { + assert.ok($('#modal-test').length, 'modal inserted into dom') + assert.ok($('#modal-test').is(':visible'), 'modal visible') + $div.trigger($.Event('keyup', { + which: 27 + })) + + setTimeout(function () { + assert.ok($div.is(':visible'), 'modal still visible') + $div.remove() + done() + }, 0) + }) + .bootstrapModal('show') + }) + + QUnit.test('should trigger hide event once when clicking outside of modal-content', function (assert) { + assert.expect(1) + var done = assert.async() + + var triggered + + $('<div id="modal-test"><div class="contents"/></div>') + .on('shown.bs.modal', function () { + triggered = 0 + $('#modal-test').trigger('click') + }) + .on('hide.bs.modal', function () { + triggered += 1 + assert.strictEqual(triggered, 1, 'modal hide triggered once') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should remove aria-hidden attribute when shown, add it back when hidden', function (assert) { + assert.expect(3) + var done = assert.async() + + $('<div id="modal-test" aria-hidden="true"/>') + .on('shown.bs.modal', function () { + assert.notOk($('#modal-test').is('[aria-hidden]'), 'aria-hidden attribute removed') + $(this).bootstrapModal('hide') + }) + .on('hidden.bs.modal', function () { + assert.ok($('#modal-test').is('[aria-hidden]'), 'aria-hidden attribute added') + assert.strictEqual($('#modal-test').attr('aria-hidden'), 'true', 'correct aria-hidden="true" added') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should close reopened modal with [data-dismiss="modal"] click', function (assert) { + assert.expect(2) + var done = assert.async() + + $('<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"/></div></div>') + .one('shown.bs.modal', function () { + $('#close').trigger('click') + }) + .one('hidden.bs.modal', function () { + // After one open-close cycle + assert.ok(!$('#modal-test').is(':visible'), 'modal hidden') + $(this) + .one('shown.bs.modal', function () { + $('#close').trigger('click') + }) + .one('hidden.bs.modal', function () { + assert.ok(!$('#modal-test').is(':visible'), 'modal hidden') + done() + }) + .bootstrapModal('show') + }) + .bootstrapModal('show') + }) + + QUnit.test('should restore focus to toggling element when modal is hidden after having been opened via data-api', function (assert) { + assert.expect(1) + var done = assert.async() + + var $toggleBtn = $('<button data-toggle="modal" data-target="#modal-test"/>').appendTo('#qunit-fixture') + + $('<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"/></div></div>') + .on('hidden.bs.modal', function () { + setTimeout(function () { + assert.ok($(document.activeElement).is($toggleBtn), 'toggling element is once again focused') + done() + }, 0) + }) + .on('shown.bs.modal', function () { + $('#close').trigger('click') + }) + .appendTo('#qunit-fixture') + + $toggleBtn.trigger('click') + }) + + QUnit.test('should not restore focus to toggling element if the associated show event gets prevented', function (assert) { + assert.expect(1) + var done = assert.async() + var $toggleBtn = $('<button data-toggle="modal" data-target="#modal-test"/>').appendTo('#qunit-fixture') + var $otherBtn = $('<button id="other-btn"/>').appendTo('#qunit-fixture') + + $('<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"/></div>') + .one('show.bs.modal', function (e) { + e.preventDefault() + $otherBtn.trigger('focus') + setTimeout($.proxy(function () { + $(this).bootstrapModal('show') + }, this), 0) + }) + .on('hidden.bs.modal', function () { + setTimeout(function () { + assert.ok($(document.activeElement).is($otherBtn), 'focus returned to toggling element') + done() + }, 0) + }) + .on('shown.bs.modal', function () { + $('#close').trigger('click') + }) + .appendTo('#qunit-fixture') + + $toggleBtn.trigger('click') + }) + + QUnit.test('should adjust the inline padding of the modal when opening', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div id="modal-test"/>') + .on('shown.bs.modal', function () { + var expectedPadding = $(this).getScrollbarWidth() + 'px' + var currentPadding = $(this).css('padding-right') + assert.strictEqual(currentPadding, expectedPadding, 'modal padding should be adjusted while opening') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should adjust the inline body padding when opening and restore when closing', function (assert) { + assert.expect(2) + var done = assert.async() + var $body = $(document.body) + var originalPadding = $body.css('padding-right') + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + var currentPadding = $body.css('padding-right') + assert.strictEqual(currentPadding, originalPadding, 'body padding should be reset after closing') + $body.removeAttr('style') + done() + }) + .on('shown.bs.modal', function () { + var expectedPadding = parseFloat(originalPadding) + $(this).getScrollbarWidth() + 'px' + var currentPadding = $body.css('padding-right') + assert.strictEqual(currentPadding, expectedPadding, 'body padding should be adjusted while opening') + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should store the original body padding in data-padding-right before showing', function (assert) { + assert.expect(2) + var done = assert.async() + var $body = $(document.body) + var originalPadding = '0px' + $body.css('padding-right', originalPadding) + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + assert.strictEqual(typeof $body.data('padding-right'), 'undefined', 'data-padding-right should be cleared after closing') + $body.removeAttr('style') + done() + }) + .on('shown.bs.modal', function () { + assert.strictEqual($body.data('padding-right'), originalPadding, 'original body padding should be stored in data-padding-right') + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should not adjust the inline body padding when it does not overflow', function (assert) { + assert.expect(1) + var done = assert.async() + var $body = $(document.body) + var originalPadding = $body.css('padding-right') + + // Hide scrollbars to prevent the body overflowing + $body.css('overflow', 'hidden') // Real scrollbar (for in-browser testing) + $('html').css('padding-right', '0px') // Simulated scrollbar (for PhantomJS) + + $('<div id="modal-test"/>') + .on('shown.bs.modal', function () { + var currentPadding = $body.css('padding-right') + assert.strictEqual(currentPadding, originalPadding, 'body padding should not be adjusted') + $(this).bootstrapModal('hide') + + // Restore scrollbars + $body.css('overflow', 'auto') + $('html').css('padding-right', '16px') + done() + }) + .bootstrapModal('show') + }) + + QUnit.test('should adjust the inline padding of fixed elements when opening and restore when closing', function (assert) { + assert.expect(2) + var done = assert.async() + var $element = $('<div class="fixed-top"></div>').appendTo('#qunit-fixture') + var originalPadding = $element.css('padding-right') + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + var currentPadding = $element.css('padding-right') + assert.strictEqual(currentPadding, originalPadding, 'fixed element padding should be reset after closing') + $element.remove() + done() + }) + .on('shown.bs.modal', function () { + var expectedPadding = parseFloat(originalPadding) + $(this).getScrollbarWidth() + 'px' + var currentPadding = $element.css('padding-right') + assert.strictEqual(currentPadding, expectedPadding, 'fixed element padding should be adjusted while opening') + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should store the original padding of fixed elements in data-padding-right before showing', function (assert) { + assert.expect(2) + var done = assert.async() + var $element = $('<div class="fixed-top"></div>').appendTo('#qunit-fixture') + var originalPadding = '0px' + $element.css('padding-right', originalPadding) + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + assert.strictEqual(typeof $element.data('padding-right'), 'undefined', 'data-padding-right should be cleared after closing') + $element.remove() + done() + }) + .on('shown.bs.modal', function () { + assert.strictEqual($element.data('padding-right'), originalPadding, 'original fixed element padding should be stored in data-padding-right') + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should adjust the inline margin of sticky elements when opening and restore when closing', function (assert) { + assert.expect(2) + var done = assert.async() + var $element = $('<div class="sticky-top"></div>').appendTo('#qunit-fixture') + var originalPadding = $element.css('margin-right') + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + var currentPadding = $element.css('margin-right') + assert.strictEqual(currentPadding, originalPadding, 'sticky element margin should be reset after closing') + $element.remove() + done() + }) + .on('shown.bs.modal', function () { + var expectedPadding = parseFloat(originalPadding) - $(this).getScrollbarWidth() + 'px' + var currentPadding = $element.css('margin-right') + assert.strictEqual(currentPadding, expectedPadding, 'sticky element margin should be adjusted while opening') + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should store the original margin of sticky elements in data-margin-right before showing', function (assert) { + assert.expect(2) + var done = assert.async() + var $element = $('<div class="sticky-top"></div>').appendTo('#qunit-fixture') + var originalPadding = '0px' + $element.css('margin-right', originalPadding) + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + assert.strictEqual(typeof $element.data('margin-right'), 'undefined', 'data-margin-right should be cleared after closing') + $element.remove() + done() + }) + .on('shown.bs.modal', function () { + assert.strictEqual($element.data('margin-right'), originalPadding, 'original sticky element margin should be stored in data-margin-right') + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should ignore values set via CSS when trying to restore body padding after closing', function (assert) { + assert.expect(1) + var done = assert.async() + var $body = $(document.body) + var $style = $('<style>body { padding-right: 42px; }</style>').appendTo('head') + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + assert.strictEqual($body.attr('style').indexOf('padding-right'), -1, 'body does not have inline padding set') + $style.remove() + done() + }) + .on('shown.bs.modal', function () { + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should ignore other inline styles when trying to restore body padding after closing', function (assert) { + assert.expect(2) + var done = assert.async() + var $body = $(document.body) + var $style = $('<style>body { padding-right: 42px; }</style>').appendTo('head') + + $body.css('color', 'red') + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + assert.strictEqual($body[0].style.paddingRight, '', 'body does not have inline padding set') + assert.strictEqual($body[0].style.color, 'red', 'body still has other inline styles set') + $body.removeAttr('style') + $style.remove() + done() + }) + .on('shown.bs.modal', function () { + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should properly restore non-pixel inline body padding after closing', function (assert) { + assert.expect(1) + var done = assert.async() + var $body = $(document.body) + + $body.css('padding-right', '5%') + + $('<div id="modal-test"/>') + .on('hidden.bs.modal', function () { + assert.strictEqual($body[0].style.paddingRight, '5%', 'body does not have inline padding set') + $body.removeAttr('style') + done() + }) + .on('shown.bs.modal', function () { + $(this).bootstrapModal('hide') + }) + .bootstrapModal('show') + }) + + QUnit.test('should not follow link in area tag', function (assert) { + assert.expect(2) + var done = assert.async() + + $('<map><area id="test" shape="default" data-toggle="modal" data-target="#modal-test" href="demo.html"/></map>') + .appendTo('#qunit-fixture') + + $('<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"/></div></div>') + .appendTo('#qunit-fixture') + + $('#test') + .on('click.bs.modal.data-api', function (event) { + assert.notOk(event.isDefaultPrevented(), 'navigating to href will happen') + + setTimeout(function () { + assert.ok(event.isDefaultPrevented(), 'model shown instead of navigating to href') + done() + }, 1) + }) + .trigger('click') + }) + + QUnit.test('should not parse target as html', function (assert) { + assert.expect(1) + var done = assert.async() + + var $toggleBtn = $('<button data-toggle="modal" data-target="<div id="modal-test"><div class="contents"<div<div id="close" data-dismiss="modal"/></div></div>"/>') + .appendTo('#qunit-fixture') + + $toggleBtn.trigger('click') + setTimeout(function () { + assert.strictEqual($('#modal-test').length, 0, 'target has not been parsed and added to the document') + done() + }, 1) + }) + + QUnit.test('should not execute js from target', function (assert) { + assert.expect(0) + var done = assert.async() + + // This toggle button contains XSS payload in its data-target + // Note: it uses the onerror handler of an img element to execute the js, because a simple script element does not work here + // a script element works in manual tests though, so here it is likely blocked by the qunit framework + var $toggleBtn = $('<button data-toggle="modal" data-target="<div><image src="missing.png" onerror="$('#qunit-fixture button.control').trigger('click')"></div>"/>') + .appendTo('#qunit-fixture') + // The XSS payload above does not have a closure over this function and cannot access the assert object directly + // However, it can send a click event to the following control button, which will then fail the assert + $('<button>') + .addClass('control') + .on('click', function () { + assert.notOk(true, 'XSS payload is not executed as js') + }) + .appendTo('#qunit-fixture') + + $toggleBtn.trigger('click') + setTimeout(done, 500) + }) + + QUnit.test('should not try to open a modal which is already visible', function (assert) { + assert.expect(1) + var done = assert.async() + var count = 0 + + $('<div id="modal-test"/>').on('shown.bs.modal', function () { + count++ + }).on('hidden.bs.modal', function () { + assert.strictEqual(count, 1, 'show() runs only once') + done() + }) + .bootstrapModal('show') + .bootstrapModal('show') + .bootstrapModal('hide') + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/popover.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/popover.js new file mode 100644 index 0000000..f4b04de --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/popover.js @@ -0,0 +1,471 @@ +$(function () { + 'use strict' + + QUnit.module('popover plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).popover, 'popover method is defined') + }) + + QUnit.module('popover', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapPopover = $.fn.popover.noConflict() + }, + afterEach: function () { + $.fn.popover = $.fn.bootstrapPopover + delete $.fn.bootstrapPopover + $('.popover').remove() + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.popover, 'undefined', 'popover was set back to undefined (org value)') + }) + + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div/>') + $el.bootstrapPopover() + try { + $el.bootstrapPopover('noMethod') + } catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>') + var $popover = $el.bootstrapPopover() + assert.ok($popover instanceof $, 'returns jquery collection') + assert.strictEqual($popover[0], $el[0], 'collection contains element') + }) + + QUnit.test('should render popover element', function (assert) { + assert.expect(2) + var done = assert.async() + $('<a href="#" title="mdo" data-content="https://twitter.com/mdo">@mdo</a>') + .appendTo('#qunit-fixture') + .on('shown.bs.popover', function () { + assert.notEqual($('.popover').length, 0, 'popover was inserted') + $(this).bootstrapPopover('hide') + }) + .on('hidden.bs.popover', function () { + assert.strictEqual($('.popover').length, 0, 'popover removed') + done() + }) + .bootstrapPopover('show') + }) + + QUnit.test('should store popover instance in popover data object', function (assert) { + assert.expect(1) + var $popover = $('<a href="#" title="mdo" data-content="https://twitter.com/mdo">@mdo</a>').bootstrapPopover() + + assert.ok($popover.data('bs.popover'), 'popover instance exists') + }) + + QUnit.test('should store popover trigger in popover instance data object', function (assert) { + assert.expect(1) + var $popover = $('<a href="#" title="ResentedHook">@ResentedHook</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover() + + $popover.bootstrapPopover('show') + + assert.ok($('.popover').data('bs.popover'), 'popover trigger stored in instance data') + }) + + QUnit.test('should get title and content from options', function (assert) { + assert.expect(4) + var done = assert.async() + var $popover = $('<a href="#">@fat</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + title: function () { + return '@fat' + }, + content: function () { + return 'loves writing tests (╯°□°)╯︵ ┻━┻' + } + }) + + $popover + .one('shown.bs.popover', function () { + assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.strictEqual($('.popover .popover-header').text(), '@fat', 'title correctly inserted') + assert.strictEqual($('.popover .popover-body').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted') + $popover.bootstrapPopover('hide') + }) + .one('hidden.bs.popover', function () { + assert.strictEqual($('.popover').length, 0, 'popover was removed') + done() + }) + .bootstrapPopover('show') + }) + + QUnit.test('should allow DOMElement title and content (html: true)', function (assert) { + assert.expect(5) + var title = document.createTextNode('@glebm <3 writing tests') + var content = $('<i>¯\\_(ツ)_/¯</i>').get(0) + var $popover = $('<a href="#" rel="tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + html: true, + title: title, + content: content + }) + + $popover.bootstrapPopover('show') + + assert.notEqual($('.popover').length, 0, 'popover inserted') + assert.strictEqual($('.popover .popover-header').text(), '@glebm <3 writing tests', 'title inserted') + assert.ok($.contains($('.popover').get(0), title), 'title node moved, not copied') + // toLowerCase because IE8 will return <I>...</I> + assert.strictEqual($('.popover .popover-body').html().toLowerCase(), '<i>¯\\_(ツ)_/¯</i>', 'content inserted') + assert.ok($.contains($('.popover').get(0), content), 'content node moved, not copied') + }) + + QUnit.test('should allow DOMElement title and content (html: false)', function (assert) { + assert.expect(5) + var title = document.createTextNode('@glebm <3 writing tests') + var content = $('<i>¯\\_(ツ)_/¯</i>').get(0) + var $popover = $('<a href="#" rel="tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + title: title, + content: content + }) + + $popover.bootstrapPopover('show') + + assert.notEqual($('.popover').length, 0, 'popover inserted') + assert.strictEqual($('.popover .popover-header').text(), '@glebm <3 writing tests', 'title inserted') + assert.ok(!$.contains($('.popover').get(0), title), 'title node copied, not moved') + assert.strictEqual($('.popover .popover-body').html(), '¯\\_(ツ)_/¯', 'content inserted') + assert.ok(!$.contains($('.popover').get(0), content), 'content node copied, not moved') + }) + + QUnit.test('should not duplicate HTML object', function (assert) { + assert.expect(6) + var done = assert.async() + var $div = $('<div/>').html('loves writing tests (╯°□°)╯︵ ┻━┻') + + var $popover = $('<a href="#">@fat</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + html: true, + content: function () { + return $div + } + }) + + function popoverInserted() { + assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.equal($('.popover .popover-body').html(), $div[0].outerHTML, 'content correctly inserted') + } + + $popover + .one('shown.bs.popover', function () { + popoverInserted() + + $popover.one('hidden.bs.popover', function () { + assert.strictEqual($('.popover').length, 0, 'popover was removed') + + $popover.one('shown.bs.popover', function () { + popoverInserted() + + $popover.one('hidden.bs.popover', function () { + assert.strictEqual($('.popover').length, 0, 'popover was removed') + done() + }).bootstrapPopover('hide') + }).bootstrapPopover('show') + }).bootstrapPopover('hide') + }) + .bootstrapPopover('show') + }) + + QUnit.test('should get title and content from attributes', function (assert) { + assert.expect(4) + var done = assert.async() + var $popover = $('<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover() + .one('shown.bs.popover', function () { + assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.strictEqual($('.popover .popover-header').text(), '@mdo', 'title correctly inserted') + assert.strictEqual($('.popover .popover-body').text(), 'loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻', 'content correctly inserted') + $popover.bootstrapPopover('hide') + }) + .one('hidden.bs.popover', function () { + assert.strictEqual($('.popover').length, 0, 'popover was removed') + done() + }) + .bootstrapPopover('show') + }) + + QUnit.test('should get title and content from attributes ignoring options passed via js', function (assert) { + assert.expect(4) + var done = assert.async() + var $popover = $('<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + title: 'ignored title option', + content: 'ignored content option' + }) + .one('shown.bs.popover', function () { + assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.strictEqual($('.popover .popover-header').text(), '@mdo', 'title correctly inserted') + assert.strictEqual($('.popover .popover-body').text(), 'loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻', 'content correctly inserted') + $popover.bootstrapPopover('hide') + }) + .one('hidden.bs.popover', function () { + assert.strictEqual($('.popover').length, 0, 'popover was removed') + done() + }) + .bootstrapPopover('show') + }) + + QUnit.test('should respect custom template', function (assert) { + assert.expect(3) + var done = assert.async() + var $popover = $('<a href="#">@fat</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + title: 'Test', + content: 'Test', + template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"/><div class="content"><p/></div></div></div>' + }) + .one('shown.bs.popover', function () { + assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.ok($('.popover').hasClass('foobar'), 'custom class is present') + $popover.bootstrapPopover('hide') + }) + .one('hidden.bs.popover', function () { + assert.strictEqual($('.popover').length, 0, 'popover was removed') + done() + }) + .bootstrapPopover('show') + }) + + QUnit.test('should destroy popover', function (assert) { + assert.expect(7) + var $popover = $('<div/>') + .bootstrapPopover({ + trigger: 'hover' + }) + .on('click.foo', $.noop) + + assert.ok($popover.data('bs.popover'), 'popover has data') + assert.ok($._data($popover[0], 'events').mouseover && $._data($popover[0], 'events').mouseout, 'popover has hover event') + assert.strictEqual($._data($popover[0], 'events').click[0].namespace, 'foo', 'popover has extra click.foo event') + + $popover.bootstrapPopover('show') + $popover.bootstrapPopover('dispose') + + assert.ok(!$popover.hasClass('show'), 'popover is hidden') + assert.ok(!$popover.data('popover'), 'popover does not have data') + assert.strictEqual($._data($popover[0], 'events').click[0].namespace, 'foo', 'popover still has click.foo') + assert.ok(!$._data($popover[0], 'events').mouseover && !$._data($popover[0], 'events').mouseout, 'popover does not have any events') + }) + + QUnit.test('should render popover element using delegated selector', function (assert) { + assert.expect(2) + var done = assert.async() + var $div = $('<div><a href="#" title="mdo" data-content="https://twitter.com/mdo">@mdo</a></div>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + selector: 'a', + trigger: 'click' + }) + .one('shown.bs.popover', function () { + assert.notEqual($('.popover').length, 0, 'popover was inserted') + $div.find('a').trigger('click') + }) + .one('hidden.bs.popover', function () { + assert.strictEqual($('.popover').length, 0, 'popover was removed') + done() + }) + + $div.find('a').trigger('click') + }) + + QUnit.test('should detach popover content rather than removing it so that event handlers are left intact', function (assert) { + assert.expect(1) + var $content = $('<div class="content-with-handler"><a class="btn btn-warning">Button with event handler</a></div>').appendTo('#qunit-fixture') + + var handlerCalled = false + $('.content-with-handler .btn').on('click', function () { + handlerCalled = true + }) + + var $div = $('<div><a href="#">Show popover</a></div>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + html: true, + trigger: 'manual', + container: 'body', + animation: false, + content: function () { + return $content + } + }) + + var done = assert.async() + $div + .one('shown.bs.popover', function () { + $div + .one('hidden.bs.popover', function () { + $div + .one('shown.bs.popover', function () { + $('.content-with-handler .btn').trigger('click') + assert.ok(handlerCalled, 'content\'s event handler still present') + $div.bootstrapPopover('dispose') + done() + }) + .bootstrapPopover('show') + }) + .bootstrapPopover('hide') + }) + .bootstrapPopover('show') + }) + + QUnit.test('should do nothing when an attempt is made to hide an uninitialized popover', function (assert) { + assert.expect(1) + + var $popover = $('<span data-toggle="popover" data-title="some title" data-content="some content">some text</span>') + .appendTo('#qunit-fixture') + .on('hidden.bs.popover shown.bs.popover', function () { + assert.ok(false, 'should not fire any popover events') + }) + .bootstrapPopover('hide') + assert.strictEqual(typeof $popover.data('bs.popover'), 'undefined', 'should not initialize the popover') + }) + + QUnit.test('should fire inserted event', function (assert) { + assert.expect(2) + var done = assert.async() + + $('<a href="#">@Johann-S</a>') + .appendTo('#qunit-fixture') + .on('inserted.bs.popover', function () { + assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.ok(true, 'inserted event fired') + done() + }) + .bootstrapPopover({ + title: 'Test', + content: 'Test' + }) + .bootstrapPopover('show') + }) + + QUnit.test('should throw an error when show is called on hidden elements', function (assert) { + assert.expect(1) + var done = assert.async() + + try { + $('<div data-toggle="popover" data-title="some title" data-content="@Johann-S" style="display: none"/>').bootstrapPopover('show') + } catch (err) { + assert.strictEqual(err.message, 'Please use show on visible elements') + done() + } + }) + + QUnit.test('should hide popovers when their containing modal is closed', function (assert) { + assert.expect(1) + var done = assert.async() + var templateHTML = '<div id="modal-test" class="modal">' + + '<div class="modal-dialog" role="document">' + + '<div class="modal-content">' + + '<div class="modal-body">' + + '<button id="popover-test" type="button" class="btn btn-secondary" data-toggle="popover" data-placement="top" data-content="Popover">' + + 'Popover on top' + + '</button>' + + '</div>' + + '</div>' + + '</div>' + + '</div>' + + $(templateHTML).appendTo('#qunit-fixture') + $('#popover-test') + .on('shown.bs.popover', function () { + $('#modal-test').modal('hide') + }) + .on('hide.bs.popover', function () { + assert.ok(true, 'popover hide') + done() + }) + + $('#modal-test') + .on('shown.bs.modal', function () { + $('#popover-test').bootstrapPopover('show') + }) + .modal('show') + }) + + QUnit.test('should convert number to string without error for content and title', function (assert) { + assert.expect(2) + var done = assert.async() + var $popover = $('<a href="#">@mdo</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + title: 5, + content: 7 + }) + .on('shown.bs.popover', function () { + assert.strictEqual($('.popover .popover-header').text(), '5') + assert.strictEqual($('.popover .popover-body').text(), '7') + done() + }) + + $popover.bootstrapPopover('show') + }) + + QUnit.test('popover should be shown right away after the call of disable/enable', function (assert) { + assert.expect(2) + var done = assert.async() + var $popover = $('<a href="#">@mdo</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + title: 'Test popover', + content: 'with disable/enable' + }) + .on('shown.bs.popover', function () { + assert.strictEqual($('.popover').hasClass('show'), true) + done() + }) + + $popover.bootstrapPopover('disable') + $popover.trigger($.Event('click')) + setTimeout(function () { + assert.strictEqual($('.popover').length === 0, true) + $popover.bootstrapPopover('enable') + $popover.trigger($.Event('click')) + }, 200) + }) + + QUnit.test('popover should call content function only once', function (assert) { + assert.expect(1) + var done = assert.async() + var nbCall = 0 + $('<div id="popover" style="display:none">content</div>').appendTo('#qunit-fixture') + var $popover = $('<a href="#">@Johann-S</a>') + .appendTo('#qunit-fixture') + .bootstrapPopover({ + content: function () { + nbCall++ + return $('#popover').clone().show().get(0) + } + }) + .on('shown.bs.popover', function () { + assert.strictEqual(nbCall, 1) + done() + }) + + $popover.trigger($.Event('click')) + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/scrollspy.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/scrollspy.js new file mode 100644 index 0000000..1337e58 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/scrollspy.js @@ -0,0 +1,728 @@ +$(function () { + 'use strict' + + QUnit.module('scrollspy plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).scrollspy, 'scrollspy method is defined') + }) + + QUnit.module('scrollspy', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapScrollspy = $.fn.scrollspy.noConflict() + }, + afterEach: function () { + $.fn.scrollspy = $.fn.bootstrapScrollspy + delete $.fn.bootstrapScrollspy + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.scrollspy, 'undefined', 'scrollspy was set back to undefined (org value)') + }) + + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div/>').appendTo('#qunit-fixture') + $el.bootstrapScrollspy() + try { + $el.bootstrapScrollspy('noMethod') + } catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>').appendTo('#qunit-fixture') + var $scrollspy = $el.bootstrapScrollspy() + assert.ok($scrollspy instanceof $, 'returns jquery collection') + assert.strictEqual($scrollspy[0], $el[0], 'collection contains element') + }) + + QUnit.test('should only switch "active" class on current target', function (assert) { + assert.expect(1) + var done = assert.async() + + var sectionHTML = '<div id="root" class="active">' + + '<div class="topbar">' + + '<div class="topbar-inner">' + + '<div class="container" id="ss-target">' + + '<ul class="nav">' + + '<li class="nav-item"><a href="#masthead">Overview</a></li>' + + '<li class="nav-item"><a href="#detail">Detail</a></li>' + + '</ul>' + + '</div>' + + '</div>' + + '</div>' + + '<div id="scrollspy-example" style="height: 100px; overflow: auto;">' + + '<div style="height: 200px;">' + + '<h4 id="masthead">Overview</h4>' + + '<p style="height: 200px">' + + 'Ad leggings keytar, brunch id art party dolor labore.' + + '</p>' + + '</div>' + + '<div style="height: 200px;">' + + '<h4 id="detail">Detail</h4>' + + '<p style="height: 200px">' + + 'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.' + + '</p>' + + '</div>' + + '</div>' + + '</div>' + var $section = $(sectionHTML).appendTo('#qunit-fixture') + + var $scrollspy = $section + .show() + .find('#scrollspy-example') + .bootstrapScrollspy({ + target: '#ss-target' + }) + + $scrollspy.one('scroll', function () { + assert.ok($section.hasClass('active'), '"active" class still on root node') + done() + }) + + $scrollspy.scrollTop(350) + }) + + QUnit.test('should only switch "active" class on current target specified w element', function (assert) { + assert.expect(1) + var done = assert.async() + + var sectionHTML = '<div id="root" class="active">' + + '<div class="topbar">' + + '<div class="topbar-inner">' + + '<div class="container" id="ss-target">' + + '<ul class="nav">' + + '<li class="nav-item"><a href="#masthead">Overview</a></li>' + + '<li class="nav-item"><a href="#detail">Detail</a></li>' + + '</ul>' + + '</div>' + + '</div>' + + '</div>' + + '<div id="scrollspy-example" style="height: 100px; overflow: auto;">' + + '<div style="height: 200px;">' + + '<h4 id="masthead">Overview</h4>' + + '<p style="height: 200px">' + + 'Ad leggings keytar, brunch id art party dolor labore.' + + '</p>' + + '</div>' + + '<div style="height: 200px;">' + + '<h4 id="detail">Detail</h4>' + + '<p style="height: 200px">' + + 'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.' + + '</p>' + + '</div>' + + '</div>' + + '</div>' + var $section = $(sectionHTML).appendTo('#qunit-fixture') + + var $scrollspy = $section + .show() + .find('#scrollspy-example') + .bootstrapScrollspy({ + target: document.getElementById('#ss-target') + }) + + $scrollspy.one('scroll', function () { + assert.ok($section.hasClass('active'), '"active" class still on root node') + done() + }) + + $scrollspy.scrollTop(350) + }) + + QUnit.test('should correctly select middle navigation option when large offset is used', function (assert) { + assert.expect(3) + var done = assert.async() + + var sectionHTML = '<div id="header" style="height: 500px;"></div>' + + '<nav id="navigation" class="navbar">' + + '<ul class="navbar-nav">' + + '<li class="nav-item active"><a class="nav-link" id="one-link" href="#one">One</a></li>' + + '<li class="nav-item"><a class="nav-link" id="two-link" href="#two">Two</a></li>' + + '<li class="nav-item"><a class="nav-link" id="three-link" href="#three">Three</a></li>' + + '</ul>' + + '</nav>' + + '<div id="content" style="height: 200px; overflow-y: auto;">' + + '<div id="one" style="height: 500px;"></div>' + + '<div id="two" style="height: 300px;"></div>' + + '<div id="three" style="height: 10px;"></div>' + + '</div>' + var $section = $(sectionHTML).appendTo('#qunit-fixture') + var $scrollspy = $section + .show() + .filter('#content') + + $scrollspy.bootstrapScrollspy({ + target: '#navigation', + offset: $scrollspy.position().top + }) + + $scrollspy.one('scroll', function () { + assert.ok(!$section.find('#one-link').hasClass('active'), '"active" class removed from first section') + assert.ok($section.find('#two-link').hasClass('active'), '"active" class on middle section') + assert.ok(!$section.find('#three-link').hasClass('active'), '"active" class not on last section') + done() + }) + + $scrollspy.scrollTop(550) + }) + + QUnit.test('should add the active class to the correct element', function (assert) { + assert.expect(2) + var navbarHtml = + '<nav class="navbar">' + + '<ul class="nav">' + + '<li class="nav-item"><a class="nav-link" id="a-1" href="#div-1">div 1</a></li>' + + '<li class="nav-item"><a class="nav-link" id="a-2" href="#div-2">div 2</a></li>' + + '</ul>' + + '</nav>' + var contentHtml = + '<div class="content" style="overflow: auto; height: 50px">' + + '<div id="div-1" style="height: 100px; padding: 0; margin: 0">div 1</div>' + + '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + + '</div>' + + $(navbarHtml).appendTo('#qunit-fixture') + var $content = $(contentHtml) + .appendTo('#qunit-fixture') + .bootstrapScrollspy({ + offset: 0, + target: '.navbar' + }) + + var done = assert.async() + var testElementIsActiveAfterScroll = function (element, target) { + var deferred = $.Deferred() + var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) + $content.one('scroll', function () { + assert.ok($(element).hasClass('active'), 'target:' + target + ', element' + element) + deferred.resolve() + }) + $content.scrollTop(scrollHeight) + return deferred.promise() + } + + $.when(testElementIsActiveAfterScroll('#a-1', '#div-1')) + .then(function () { + return testElementIsActiveAfterScroll('#a-2', '#div-2') + }) + .then(function () { + done() + }) + }) + + QUnit.test('should add the active class to the correct element (nav markup)', function (assert) { + assert.expect(2) + var navbarHtml = + '<nav class="navbar">' + + '<nav class="nav">' + + '<a class="nav-link" id="a-1" href="#div-1">div 1</a>' + + '<a class="nav-link" id="a-2" href="#div-2">div 2</a>' + + '</nav>' + + '</nav>' + var contentHtml = + '<div class="content" style="overflow: auto; height: 50px">' + + '<div id="div-1" style="height: 100px; padding: 0; margin: 0">div 1</div>' + + '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + + '</div>' + + $(navbarHtml).appendTo('#qunit-fixture') + var $content = $(contentHtml) + .appendTo('#qunit-fixture') + .bootstrapScrollspy({ + offset: 0, + target: '.navbar' + }) + + var done = assert.async() + var testElementIsActiveAfterScroll = function (element, target) { + var deferred = $.Deferred() + var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) + $content.one('scroll', function () { + assert.ok($(element).hasClass('active'), 'target:' + target + ', element' + element) + deferred.resolve() + }) + $content.scrollTop(scrollHeight) + return deferred.promise() + } + + $.when(testElementIsActiveAfterScroll('#a-1', '#div-1')) + .then(function () { + return testElementIsActiveAfterScroll('#a-2', '#div-2') + }) + .then(function () { + done() + }) + }) + + QUnit.test('should add the active class to the correct element (list-group markup)', function (assert) { + assert.expect(2) + var navbarHtml = + '<nav class="navbar">' + + '<div class="list-group">' + + '<a class="list-group-item" id="a-1" href="#div-1">div 1</a>' + + '<a class="list-group-item" id="a-2" href="#div-2">div 2</a>' + + '</div>' + + '</nav>' + var contentHtml = + '<div class="content" style="overflow: auto; height: 50px">' + + '<div id="div-1" style="height: 100px; padding: 0; margin: 0">div 1</div>' + + '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + + '</div>' + + $(navbarHtml).appendTo('#qunit-fixture') + var $content = $(contentHtml) + .appendTo('#qunit-fixture') + .bootstrapScrollspy({ + offset: 0, + target: '.navbar' + }) + + var done = assert.async() + var testElementIsActiveAfterScroll = function (element, target) { + var deferred = $.Deferred() + var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) + $content.one('scroll', function () { + assert.ok($(element).hasClass('active'), 'target:' + target + ', element' + element) + deferred.resolve() + }) + $content.scrollTop(scrollHeight) + return deferred.promise() + } + + $.when(testElementIsActiveAfterScroll('#a-1', '#div-1')) + .then(function () { + return testElementIsActiveAfterScroll('#a-2', '#div-2') + }) + .then(function () { + done() + }) + }) + + QUnit.test('should add the active class correctly when there are nested elements at 0 scroll offset', function (assert) { + assert.expect(6) + var times = 0 + var done = assert.async() + var navbarHtml = '<nav id="navigation" class="navbar">' + + '<ul class="nav">' + + '<li class="nav-item"><a id="a-1" class="nav-link" href="#div-1">div 1</a>' + + '<ul class="nav">' + + '<li class="nav-item"><a id="a-2" class="nav-link" href="#div-2">div 2</a></li>' + + '</ul>' + + '</li>' + + '</ul>' + + '</nav>' + + var contentHtml = '<div class="content" style="position: absolute; top: 0px; overflow: auto; height: 50px">' + + '<div id="div-1" style="padding: 0; margin: 0">' + + '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + + '</div>' + + '</div>' + + $(navbarHtml).appendTo('#qunit-fixture') + + var $content = $(contentHtml) + .appendTo('#qunit-fixture') + .bootstrapScrollspy({ + offset: 0, + target: '#navigation' + }) + + function testActiveElements() { + if (++times > 3) { + return done() + } + + $content.one('scroll', function () { + assert.ok($('#a-1').hasClass('active'), 'nav item for outer element has "active" class') + assert.ok($('#a-2').hasClass('active'), 'nav item for inner element has "active" class') + testActiveElements() + }) + + $content.scrollTop($content.scrollTop() + 10) + } + + testActiveElements() + }) + + QUnit.test('should add the active class correctly when there are nested elements (nav markup)', function (assert) { + assert.expect(6) + var times = 0 + var done = assert.async() + var navbarHtml = '<nav id="navigation" class="navbar">' + + '<nav class="nav">' + + '<a id="a-1" class="nav-link" href="#div-1">div 1</a>' + + '<nav class="nav">' + + '<a id="a-2" class="nav-link" href="#div-2">div 2</a>' + + '</nav>' + + '</nav>' + + '</nav>' + + var contentHtml = '<div class="content" style="position: absolute; top: 0px; overflow: auto; height: 50px">' + + '<div id="div-1" style="padding: 0; margin: 0">' + + '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + + '</div>' + + '</div>' + + $(navbarHtml).appendTo('#qunit-fixture') + + var $content = $(contentHtml) + .appendTo('#qunit-fixture') + .bootstrapScrollspy({ + offset: 0, + target: '#navigation' + }) + + function testActiveElements() { + if (++times > 3) { + return done() + } + + $content.one('scroll', function () { + assert.ok($('#a-1').hasClass('active'), 'nav item for outer element has "active" class') + assert.ok($('#a-2').hasClass('active'), 'nav item for inner element has "active" class') + testActiveElements() + }) + + $content.scrollTop($content.scrollTop() + 10) + } + + testActiveElements() + }) + + QUnit.test('should add the active class correctly when there are nested elements (nav nav-item markup)', function (assert) { + assert.expect(6) + var times = 0 + var done = assert.async() + var navbarHtml = '<nav id="navigation" class="navbar">' + + '<ul class="nav">' + + '<li class="nav-item"><a id="a-1" class="nav-link" href="#div-1">div 1</a></li>' + + '<ul class="nav">' + + '<li class="nav-item"><a id="a-2" class="nav-link" href="#div-2">div 2</a></li>' + + '</ul>' + + '</ul>' + + '</nav>' + + var contentHtml = '<div class="content" style="position: absolute; top: 0px; overflow: auto; height: 50px">' + + '<div id="div-1" style="padding: 0; margin: 0">' + + '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + + '</div>' + + '</div>' + + $(navbarHtml).appendTo('#qunit-fixture') + + var $content = $(contentHtml) + .appendTo('#qunit-fixture') + .bootstrapScrollspy({ + offset: 0, + target: '#navigation' + }) + + function testActiveElements() { + if (++times > 3) { + return done() + } + + $content.one('scroll', function () { + assert.ok($('#a-1').hasClass('active'), 'nav item for outer element has "active" class') + assert.ok($('#a-2').hasClass('active'), 'nav item for inner element has "active" class') + testActiveElements() + }) + + $content.scrollTop($content.scrollTop() + 10) + } + + testActiveElements() + }) + + QUnit.test('should add the active class correctly when there are nested elements (list-group markup)', function (assert) { + assert.expect(6) + var times = 0 + var done = assert.async() + var navbarHtml = '<nav id="navigation" class="navbar">' + + '<div class="list-group">' + + '<a id="a-1" class="list-group-item" href="#div-1">div 1</a>' + + '<div class="list-group">' + + '<a id="a-2" class="list-group-item" href="#div-2">div 2</a>' + + '</div>' + + '</div>' + + '</nav>' + + var contentHtml = '<div class="content" style="position: absolute; top: 0px; overflow: auto; height: 50px">' + + '<div id="div-1" style="padding: 0; margin: 0">' + + '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + + '</div>' + + '</div>' + + $(navbarHtml).appendTo('#qunit-fixture') + + var $content = $(contentHtml) + .appendTo('#qunit-fixture') + .bootstrapScrollspy({ + offset: 0, + target: '#navigation' + }) + + function testActiveElements() { + if (++times > 3) { + return done() + } + + $content.one('scroll', function () { + assert.ok($('#a-1').hasClass('active'), 'nav item for outer element has "active" class') + assert.ok($('#a-2').hasClass('active'), 'nav item for inner element has "active" class') + testActiveElements() + }) + + $content.scrollTop($content.scrollTop() + 10) + } + + testActiveElements() + }) + + QUnit.test('should clear selection if above the first section', function (assert) { + assert.expect(3) + var done = assert.async() + + var sectionHTML = '<div id="header" style="height: 500px;"></div>' + + '<nav id="navigation" class="navbar">' + + '<ul class="navbar-nav">' + + '<li class="nav-item"><a id="one-link" class="nav-link active" href="#one">One</a></li>' + + '<li class="nav-item"><a id="two-link" class="nav-link" href="#two">Two</a></li>' + + '<li class="nav-item"><a id="three-link" class="nav-link" href="#three">Three</a></li>' + + '</ul>' + + '</nav>' + $(sectionHTML).appendTo('#qunit-fixture') + + var scrollspyHTML = '<div id="content" style="height: 200px; overflow-y: auto;">' + + '<div id="spacer" style="height: 100px;"/>' + + '<div id="one" style="height: 100px;"/>' + + '<div id="two" style="height: 100px;"/>' + + '<div id="three" style="height: 100px;"/>' + + '<div id="spacer" style="height: 100px;"/>' + + '</div>' + var $scrollspy = $(scrollspyHTML).appendTo('#qunit-fixture') + + $scrollspy + .bootstrapScrollspy({ + target: '#navigation', + offset: $scrollspy.position().top + }) + .one('scroll', function () { + assert.strictEqual($('.active').length, 1, '"active" class on only one element present') + assert.strictEqual($('.active').is('#two-link'), true, '"active" class on second section') + $scrollspy + .one('scroll', function () { + assert.strictEqual($('.active').length, 0, 'selection cleared') + done() + }) + .scrollTop(0) + }) + .scrollTop(201) + }) + + QUnit.test('should NOT clear selection if above the first section and first section is at the top', function (assert) { + assert.expect(4) + var done = assert.async() + + var sectionHTML = '<div id="header" style="height: 500px;"></div>' + + '<nav id="navigation" class="navbar">' + + '<ul class="navbar-nav">' + + '<li class="nav-item"><a id="one-link" class="nav-link active" href="#one">One</a></li>' + + '<li class="nav-item"><a id="two-link" class="nav-link" href="#two">Two</a></li>' + + '<li class="nav-item"><a id="three-link" class="nav-link" href="#three">Three</a></li>' + + '</ul>' + + '</nav>' + $(sectionHTML).appendTo('#qunit-fixture') + + var negativeHeight = -10 + var startOfSectionTwo = 101 + + var scrollspyHTML = '<div id="content" style="height: 200px; overflow-y: auto;">' + + '<div id="one" style="height: 100px;"/>' + + '<div id="two" style="height: 100px;"/>' + + '<div id="three" style="height: 100px;"/>' + + '<div id="spacer" style="height: 100px;"/>' + + '</div>' + var $scrollspy = $(scrollspyHTML).appendTo('#qunit-fixture') + + $scrollspy + .bootstrapScrollspy({ + target: '#navigation', + offset: $scrollspy.position().top + }) + .one('scroll', function () { + assert.strictEqual($('.active').length, 1, '"active" class on only one element present') + assert.strictEqual($('.active').is('#two-link'), true, '"active" class on second section') + $scrollspy + .one('scroll', function () { + assert.strictEqual($('.active').length, 1, '"active" class on only one element present') + assert.strictEqual($('.active').is('#one-link'), true, '"active" class on first section') + done() + }) + .scrollTop(negativeHeight) + }) + .scrollTop(startOfSectionTwo) + }) + + QUnit.test('should correctly select navigation element on backward scrolling when each target section height is 100%', function (assert) { + assert.expect(5) + var navbarHtml = + '<nav class="navbar">' + + '<ul class="nav">' + + '<li class="nav-item"><a id="li-100-1" class="nav-link" href="#div-100-1">div 1</a></li>' + + '<li class="nav-item"><a id="li-100-2" class="nav-link" href="#div-100-2">div 2</a></li>' + + '<li class="nav-item"><a id="li-100-3" class="nav-link" href="#div-100-3">div 3</a></li>' + + '<li class="nav-item"><a id="li-100-4" class="nav-link" href="#div-100-4">div 4</a></li>' + + '<li class="nav-item"><a id="li-100-5" class="nav-link" href="#div-100-5">div 5</a></li>' + + '</ul>' + + '</nav>' + var contentHtml = + '<div class="content" style="position: relative; overflow: auto; height: 100px">' + + '<div id="div-100-1" style="position: relative; height: 100%; padding: 0; margin: 0">div 1</div>' + + '<div id="div-100-2" style="position: relative; height: 100%; padding: 0; margin: 0">div 2</div>' + + '<div id="div-100-3" style="position: relative; height: 100%; padding: 0; margin: 0">div 3</div>' + + '<div id="div-100-4" style="position: relative; height: 100%; padding: 0; margin: 0">div 4</div>' + + '<div id="div-100-5" style="position: relative; height: 100%; padding: 0; margin: 0">div 5</div>' + + '</div>' + + $(navbarHtml).appendTo('#qunit-fixture') + var $content = $(contentHtml) + .appendTo('#qunit-fixture') + .bootstrapScrollspy({ + offset: 0, + target: '.navbar' + }) + + var testElementIsActiveAfterScroll = function (element, target) { + var deferred = $.Deferred() + var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) + $content.one('scroll', function () { + assert.ok($(element).hasClass('active'), 'target:' + target + ', element: ' + element) + deferred.resolve() + }) + $content.scrollTop(scrollHeight) + return deferred.promise() + } + + var done = assert.async() + $.when(testElementIsActiveAfterScroll('#li-100-5', '#div-100-5')) + .then(function () { + return testElementIsActiveAfterScroll('#li-100-4', '#div-100-4') + }) + .then(function () { + return testElementIsActiveAfterScroll('#li-100-3', '#div-100-3') + }) + .then(function () { + return testElementIsActiveAfterScroll('#li-100-2', '#div-100-2') + }) + .then(function () { + return testElementIsActiveAfterScroll('#li-100-1', '#div-100-1') + }) + .then(function () { + done() + }) + }) + + QUnit.test('should allow passed in option offset method: offset', function (assert) { + assert.expect(4) + + var testOffsetMethod = function (type) { + var $navbar = $( + '<nav class="navbar"' + (type === 'data' ? ' id="navbar-offset-method-menu"' : '') + '>' + + '<ul class="nav">' + + '<li class="nav-item"><a id="li-' + type + 'm-1" class="nav-link" href="#div-' + type + 'm-1">div 1</a></li>' + + '<li class="nav-item"><a id="li-' + type + 'm-2" class="nav-link" href="#div-' + type + 'm-2">div 2</a></li>' + + '<li class="nav-item"><a id="li-' + type + 'm-3" class="nav-link" href="#div-' + type + 'm-3">div 3</a></li>' + + '</ul>' + + '</nav>' + ) + var $content = $( + '<div class="content"' + (type === 'data' ? ' data-spy="scroll" data-target="#navbar-offset-method-menu" data-offset="0" data-method="offset"' : '') + ' style="position: relative; overflow: auto; height: 100px">' + + '<div id="div-' + type + 'm-1" style="position: relative; height: 200px; padding: 0; margin: 0">div 1</div>' + + '<div id="div-' + type + 'm-2" style="position: relative; height: 150px; padding: 0; margin: 0">div 2</div>' + + '<div id="div-' + type + 'm-3" style="position: relative; height: 250px; padding: 0; margin: 0">div 3</div>' + + '</div>' + ) + + $navbar.appendTo('#qunit-fixture') + $content.appendTo('#qunit-fixture') + + if (type === 'js') { + $content.bootstrapScrollspy({ + target: '.navbar', + offset: 0, + method: 'offset' + }) + } else if (type === 'data') { + $(window).trigger('load') + } + + var $target = $('#div-' + type + 'm-2') + var scrollspy = $content.data('bs.scrollspy') + + assert.ok(scrollspy._offsets[1] === $target.offset().top, 'offset method with ' + type + ' option') + assert.ok(scrollspy._offsets[1] !== $target.position().top, 'position method with ' + type + ' option') + $navbar.remove() + $content.remove() + } + + testOffsetMethod('js') + testOffsetMethod('data') + }) + + QUnit.test('should allow passed in option offset method: position', function (assert) { + assert.expect(4) + + var testOffsetMethod = function (type) { + var $navbar = $( + '<nav class="navbar"' + (type === 'data' ? ' id="navbar-offset-method-menu"' : '') + '>' + + '<ul class="nav">' + + '<li class="nav-item"><a class="nav-link" id="li-' + type + 'm-1" href="#div-' + type + 'm-1">div 1</a></li>' + + '<li class="nav-item"><a class="nav-link" id="li-' + type + 'm-2" href="#div-' + type + 'm-2">div 2</a></li>' + + '<li class="nav-item"><a class="nav-link" id="li-' + type + 'm-3" href="#div-' + type + 'm-3">div 3</a></li>' + + '</ul>' + + '</nav>' + ) + var $content = $( + '<div class="content"' + (type === 'data' ? ' data-spy="scroll" data-target="#navbar-offset-method-menu" data-offset="0" data-method="position"' : '') + ' style="position: relative; overflow: auto; height: 100px">' + + '<div id="div-' + type + 'm-1" style="position: relative; height: 200px; padding: 0; margin: 0">div 1</div>' + + '<div id="div-' + type + 'm-2" style="position: relative; height: 150px; padding: 0; margin: 0">div 2</div>' + + '<div id="div-' + type + 'm-3" style="position: relative; height: 250px; padding: 0; margin: 0">div 3</div>' + + '</div>' + ) + + $navbar.appendTo('#qunit-fixture') + $content.appendTo('#qunit-fixture') + + if (type === 'js') { + $content.bootstrapScrollspy({ + target: '.navbar', + offset: 0, + method: 'position' + }) + } else if (type === 'data') { + $(window).trigger('load') + } + + var $target = $('#div-' + type + 'm-2') + var scrollspy = $content.data('bs.scrollspy') + + assert.ok(scrollspy._offsets[1] !== $target.offset().top, 'offset method with ' + type + ' option') + assert.ok(scrollspy._offsets[1] === $target.position().top, 'position method with ' + type + ' option') + $navbar.remove() + $content.remove() + } + + testOffsetMethod('js') + testOffsetMethod('data') + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/tab.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/tab.js new file mode 100644 index 0000000..c70e0d1 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/tab.js @@ -0,0 +1,417 @@ +$(function () { + 'use strict' + + QUnit.module('tabs plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).tab, 'tabs method is defined') + }) + + QUnit.module('tabs', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapTab = $.fn.tab.noConflict() + }, + afterEach: function () { + $.fn.tab = $.fn.bootstrapTab + delete $.fn.bootstrapTab + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.tab, 'undefined', 'tab was set back to undefined (org value)') + }) + + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div/>') + $el.bootstrapTab() + try { + $el.bootstrapTab('noMethod') + } catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>') + var $tab = $el.bootstrapTab() + assert.ok($tab instanceof $, 'returns jquery collection') + assert.strictEqual($tab[0], $el[0], 'collection contains element') + }) + + QUnit.test('should activate element by tab id', function (assert) { + assert.expect(2) + var tabsHTML = '<ul class="nav">' + + '<li><a href="#home">Home</a></li>' + + '<li><a href="#profile">Profile</a></li>' + + '</ul>' + + $('<ul><li id="home"/><li id="profile"/></ul>').appendTo('#qunit-fixture') + + $(tabsHTML).find('li:last-child a').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile') + + $(tabsHTML).find('li:first-child a').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') + }) + + QUnit.test('should activate element by tab id', function (assert) { + assert.expect(2) + var pillsHTML = '<ul class="nav nav-pills">' + + '<li><a href="#home">Home</a></li>' + + '<li><a href="#profile">Profile</a></li>' + + '</ul>' + + $('<ul><li id="home"/><li id="profile"/></ul>').appendTo('#qunit-fixture') + + $(pillsHTML).find('li:last-child a').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile') + + $(pillsHTML).find('li:first-child a').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') + }) + + QUnit.test('should activate element by tab id in ordered list', function (assert) { + assert.expect(2) + var pillsHTML = '<ol class="nav nav-pills">' + + '<li><a href="#home">Home</a></li>' + + '<li><a href="#profile">Profile</a></li>' + + '</ol>' + + $('<ol><li id="home"/><li id="profile"/></ol>').appendTo('#qunit-fixture') + + $(pillsHTML).find('li:last-child a').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile') + + $(pillsHTML).find('li:first-child a').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') + }) + + QUnit.test('should activate element by tab id in nav list', function (assert) { + assert.expect(2) + var tabsHTML = '<nav class="nav">' + + '<a href="#home">Home</a>' + + '<a href="#profile">Profile</a>' + + '</nav>' + + $('<nav><div id="home"></div><div id="profile"></div></nav>').appendTo('#qunit-fixture') + + $(tabsHTML).find('a:last-child').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile') + + $(tabsHTML).find('a:first-child').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') + }) + + QUnit.test('should activate element by tab id in list group', function (assert) { + assert.expect(2) + var tabsHTML = '<div class="list-group">' + + '<a href="#home">Home</a>' + + '<a href="#profile">Profile</a>' + + '</div>' + + $('<nav><div id="home"></div><div id="profile"></div></nav>').appendTo('#qunit-fixture') + + $(tabsHTML).find('a:last-child').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile') + + $(tabsHTML).find('a:first-child').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') + }) + + QUnit.test('should not fire shown when show is prevented', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div class="nav"/>') + .on('show.bs.tab', function (e) { + e.preventDefault() + assert.ok(true, 'show event fired') + done() + }) + .on('shown.bs.tab', function () { + assert.ok(false, 'shown event fired') + }) + .bootstrapTab('show') + }) + + QUnit.test('should not fire shown when tab is already active', function (assert) { + assert.expect(0) + var tabsHTML = '<ul class="nav nav-tabs" role="tablist">' + + '<li class="nav-item"><a href="#home" class="nav-link active" role="tab">Home</a></li>' + + '<li class="nav-item"><a href="#profile" class="nav-link" role="tab">Profile</a></li>' + + '</ul>' + + '<div class="tab-content">' + + '<div class="tab-pane active" id="home" role="tabpanel"></div>' + + '<div class="tab-pane" id="profile" role="tabpanel"></div>' + + '</div>' + + $(tabsHTML) + .find('a.active') + .on('shown.bs.tab', function () { + assert.ok(true, 'shown event fired') + }) + .bootstrapTab('show') + }) + + QUnit.test('should not fire shown when tab is disabled', function (assert) { + assert.expect(0) + var tabsHTML = '<ul class="nav nav-tabs" role="tablist">' + + '<li class="nav-item"><a href="#home" class="nav-link active" role="tab">Home</a></li>' + + '<li class="nav-item"><a href="#profile" class="nav-link disabled" role="tab">Profile</a></li>' + + '</ul>' + + '<div class="tab-content">' + + '<div class="tab-pane active" id="home" role="tabpanel"></div>' + + '<div class="tab-pane" id="profile" role="tabpanel"></div>' + + '</div>' + + $(tabsHTML) + .find('a.disabled') + .on('shown.bs.tab', function () { + assert.ok(true, 'shown event fired') + }) + .bootstrapTab('show') + }) + + QUnit.test('show and shown events should reference correct relatedTarget', function (assert) { + assert.expect(2) + var done = assert.async() + + var dropHTML = + '<ul class="drop nav">' + + ' <li class="dropdown"><a data-toggle="dropdown" href="#">1</a>' + + ' <ul class="dropdown-menu nav">' + + ' <li><a href="#1-1" data-toggle="tab">1-1</a></li>' + + ' <li><a href="#1-2" data-toggle="tab">1-2</a></li>' + + ' </ul>' + + ' </li>' + + '</ul>' + + $(dropHTML) + .find('ul > li:first-child a') + .bootstrapTab('show') + .end() + .find('ul > li:last-child a') + .on('show.bs.tab', function (e) { + assert.strictEqual(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget') + }) + .on('shown.bs.tab', function (e) { + assert.strictEqual(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget') + done() + }) + .bootstrapTab('show') + }) + + QUnit.test('should fire hide and hidden events', function (assert) { + assert.expect(2) + var done = assert.async() + + var tabsHTML = '<ul class="nav">' + + '<li><a href="#home">Home</a></li>' + + '<li><a href="#profile">Profile</a></li>' + + '</ul>' + + $(tabsHTML) + .find('li:first-child a') + .on('hide.bs.tab', function () { + assert.ok(true, 'hide event fired') + }) + .bootstrapTab('show') + .end() + .find('li:last-child a') + .bootstrapTab('show') + + $(tabsHTML) + .find('li:first-child a') + .on('hidden.bs.tab', function () { + assert.ok(true, 'hidden event fired') + done() + }) + .bootstrapTab('show') + .end() + .find('li:last-child a') + .bootstrapTab('show') + }) + + QUnit.test('should not fire hidden when hide is prevented', function (assert) { + assert.expect(1) + var done = assert.async() + + var tabsHTML = '<ul class="nav">' + + '<li><a href="#home">Home</a></li>' + + '<li><a href="#profile">Profile</a></li>' + + '</ul>' + + $(tabsHTML) + .find('li:first-child a') + .on('hide.bs.tab', function (e) { + e.preventDefault() + assert.ok(true, 'hide event fired') + done() + }) + .on('hidden.bs.tab', function () { + assert.ok(false, 'hidden event fired') + }) + .bootstrapTab('show') + .end() + .find('li:last-child a') + .bootstrapTab('show') + }) + + QUnit.test('hide and hidden events contain correct relatedTarget', function (assert) { + assert.expect(2) + var done = assert.async() + + var tabsHTML = '<ul class="nav">' + + '<li><a href="#home">Home</a></li>' + + '<li><a href="#profile">Profile</a></li>' + + '</ul>' + + $(tabsHTML) + .find('li:first-child a') + .on('hide.bs.tab', function (e) { + assert.strictEqual(e.relatedTarget.hash, '#profile', 'references correct element as relatedTarget') + }) + .on('hidden.bs.tab', function (e) { + assert.strictEqual(e.relatedTarget.hash, '#profile', 'references correct element as relatedTarget') + done() + }) + .bootstrapTab('show') + .end() + .find('li:last-child a') + .bootstrapTab('show') + }) + + QUnit.test('selected tab should have aria-selected', function (assert) { + assert.expect(8) + var tabsHTML = '<ul class="nav nav-tabs">' + + '<li><a class="nav-item active" href="#home" toggle="tab" aria-selected="true">Home</a></li>' + + '<li><a class="nav-item" href="#profile" toggle="tab" aria-selected="false">Profile</a></li>' + + '</ul>' + var $tabs = $(tabsHTML).appendTo('#qunit-fixture') + + $tabs.find('li:first-child a').bootstrapTab('show') + assert.strictEqual($tabs.find('.active').attr('aria-selected'), 'true', 'shown tab has aria-selected = true') + assert.strictEqual($tabs.find('a:not(.active)').attr('aria-selected'), 'false', 'hidden tab has aria-selected = false') + + $tabs.find('li:last-child a').trigger('click') + assert.strictEqual($tabs.find('.active').attr('aria-selected'), 'true', 'after click, shown tab has aria-selected = true') + assert.strictEqual($tabs.find('a:not(.active)').attr('aria-selected'), 'false', 'after click, hidden tab has aria-selected = false') + + $tabs.find('li:first-child a').bootstrapTab('show') + assert.strictEqual($tabs.find('.active').attr('aria-selected'), 'true', 'shown tab has aria-selected = true') + assert.strictEqual($tabs.find('a:not(.active)').attr('aria-selected'), 'false', 'hidden tab has aria-selected = false') + + $tabs.find('li:first-child a').trigger('click') + assert.strictEqual($tabs.find('.active').attr('aria-selected'), 'true', 'after second show event, shown tab still has aria-selected = true') + assert.strictEqual($tabs.find('a:not(.active)').attr('aria-selected'), 'false', 'after second show event, hidden tab has aria-selected = false') + }) + + QUnit.test('selected tab should deactivate previous selected tab', function (assert) { + assert.expect(2) + var tabsHTML = '<ul class="nav nav-tabs">' + + '<li class="nav-item"><a class="nav-link active" href="#home" data-toggle="tab">Home</a></li>' + + '<li class="nav-item"><a class="nav-link" href="#profile" data-toggle="tab">Profile</a></li>' + + '</ul>' + var $tabs = $(tabsHTML).appendTo('#qunit-fixture') + + $tabs.find('li:last-child a').trigger('click') + assert.notOk($tabs.find('li:first-child a').hasClass('active')) + assert.ok($tabs.find('li:last-child a').hasClass('active')) + }) + + QUnit.test('selected tab should deactivate previous selected link in dropdown', function (assert) { + assert.expect(3) + var tabsHTML = '<ul class="nav nav-tabs">' + + '<li class="nav-item"><a class="nav-link" href="#home" data-toggle="tab">Home</a></li>' + + '<li class="nav-item"><a class="nav-link" href="#profile" data-toggle="tab">Profile</a></li>' + + '<li class="nav-item dropdown"><a class="nav-link dropdown-toggle active" data-toggle="dropdown" href="#">Dropdown</a>' + + '<div class="dropdown-menu">' + + '<a class="dropdown-item active" href="#dropdown1" id="dropdown1-tab" data-toggle="tab">@fat</a>' + + '<a class="dropdown-item" href="#dropdown2" id="dropdown2-tab" data-toggle="tab">@mdo</a>' + + '</div>' + + '</li>' + + '</ul>' + var $tabs = $(tabsHTML).appendTo('#qunit-fixture') + + $tabs.find('li:first-child a').trigger('click') + assert.ok($tabs.find('li:first-child a').hasClass('active')) + assert.notOk($tabs.find('li:last-child a').hasClass('active')) + assert.notOk($tabs.find('li:last-child .dropdown-menu a:first-child').hasClass('active')) + }) + + QUnit.test('Nested tabs', function (assert) { + assert.expect(2) + var done = assert.async() + var tabsHTML = + '<nav class="nav nav-tabs" role="tablist">' + + ' <a id="tab1" href="#x-tab1" class="nav-item nav-link" data-toggle="tab" role="tab" aria-controls="x-tab1">Tab 1</a>' + + ' <a href="#x-tab2" class="nav-item nav-link active" data-toggle="tab" role="tab" aria-controls="x-tab2" aria-selected="true">Tab 2</a>' + + ' <a href="#x-tab3" class="nav-item nav-link" data-toggle="tab" role="tab" aria-controls="x-tab3">Tab 3</a>' + + '</nav>' + + '<div class="tab-content">' + + ' <div class="tab-pane" id="x-tab1" role="tabpanel">' + + ' <nav class="nav nav-tabs" role="tablist">' + + ' <a href="#nested-tab1" class="nav-item nav-link active" data-toggle="tab" role="tab" aria-controls="x-tab1" aria-selected="true">Nested Tab 1</a>' + + ' <a id="tabNested2" href="#nested-tab2" class="nav-item nav-link" data-toggle="tab" role="tab" aria-controls="x-profile">Nested Tab2</a>' + + ' </nav>' + + ' <div class="tab-content">' + + ' <div class="tab-pane active" id="nested-tab1" role="tabpanel">Nested Tab1 Content</div>' + + ' <div class="tab-pane" id="nested-tab2" role="tabpanel">Nested Tab2 Content</div>' + + ' </div>' + + ' </div>' + + ' <div class="tab-pane active" id="x-tab2" role="tabpanel">Tab2 Content</div>' + + ' <div class="tab-pane" id="x-tab3" role="tabpanel">Tab3 Content</div>' + + '</div>' + + $(tabsHTML).appendTo('#qunit-fixture') + + $('#tabNested2').on('shown.bs.tab', function () { + assert.ok($('#x-tab1').hasClass('active')) + done() + }) + + $('#tab1').on('shown.bs.tab', function () { + assert.ok($('#x-tab1').hasClass('active')) + $('#tabNested2').trigger($.Event('click')) + }) + .trigger($.Event('click')) + }) + + QUnit.test('should not remove fade class if no active pane is present', function (assert) { + assert.expect(6) + var done = assert.async() + var tabsHTML = '<ul class="nav nav-tabs" role="tablist">' + + '<li class="nav-item"><a id="tab-home" href="#home" class="nav-link" data-toggle="tab" role="tab">Home</a></li>' + + '<li class="nav-item"><a id="tab-profile" href="#profile" class="nav-link" data-toggle="tab" role="tab">Profile</a></li>' + + '</ul>' + + '<div class="tab-content">' + + '<div class="tab-pane fade" id="home" role="tabpanel"></div>' + + '<div class="tab-pane fade" id="profile" role="tabpanel"></div>' + + '</div>' + + $(tabsHTML).appendTo('#qunit-fixture') + $('#tab-profile') + .on('shown.bs.tab', function () { + assert.ok($('#profile').hasClass('fade')) + assert.ok($('#profile').hasClass('show')) + + $('#tab-home') + .on('shown.bs.tab', function () { + assert.ok($('#profile').hasClass('fade')) + assert.notOk($('#profile').hasClass('show')) + assert.ok($('#home').hasClass('fade')) + assert.ok($('#home').hasClass('show')) + + done() + }) + .trigger($.Event('click')) + }) + .trigger($.Event('click')) + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/tooltip.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/tooltip.js new file mode 100644 index 0000000..9cf3068 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/tooltip.js @@ -0,0 +1,969 @@ +$(function () { + 'use strict' + + QUnit.module('tooltip plugin') + + QUnit.test('should be defined on jquery object', function (assert) { + assert.expect(1) + assert.ok($(document.body).tooltip, 'tooltip method is defined') + }) + + QUnit.module('tooltip', { + beforeEach: function () { + // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode + $.fn.bootstrapTooltip = $.fn.tooltip.noConflict() + }, + afterEach: function () { + $.fn.tooltip = $.fn.bootstrapTooltip + delete $.fn.bootstrapTooltip + $('.tooltip').remove() + $('#qunit-fixture').html('') + } + }) + + QUnit.test('should provide no conflict', function (assert) { + assert.expect(1) + assert.strictEqual(typeof $.fn.tooltip, 'undefined', 'tooltip was set back to undefined (org value)') + }) + + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div/>') + $el.bootstrapTooltip() + try { + $el.bootstrapTooltip('noMethod') + } catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + + QUnit.test('should return jquery collection containing the element', function (assert) { + assert.expect(2) + var $el = $('<div/>') + var $tooltip = $el.bootstrapTooltip() + assert.ok($tooltip instanceof $, 'returns jquery collection') + assert.strictEqual($tooltip[0], $el[0], 'collection contains element') + }) + + QUnit.test('should expose default settings', function (assert) { + assert.expect(1) + assert.ok($.fn.bootstrapTooltip.Constructor.Default, 'defaults is defined') + }) + + QUnit.test('should empty title attribute', function (assert) { + assert.expect(1) + var $trigger = $('<a href="#" rel="tooltip" title="Another tooltip"/>').bootstrapTooltip() + assert.strictEqual($trigger.attr('title'), '', 'title attribute was emptied') + }) + + QUnit.test('should add data attribute for referencing original title', function (assert) { + assert.expect(1) + var $trigger = $('<a href="#" rel="tooltip" title="Another tooltip"/>').bootstrapTooltip() + assert.strictEqual($trigger.attr('data-original-title'), 'Another tooltip', 'original title preserved in data attribute') + }) + + QUnit.test('should add aria-describedby to the trigger on show', function (assert) { + assert.expect(3) + var $trigger = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .bootstrapTooltip() + .appendTo('#qunit-fixture') + .bootstrapTooltip('show') + + var id = $('.tooltip').attr('id') + + assert.strictEqual($('#' + id).length, 1, 'has a unique id') + assert.strictEqual($('.tooltip').attr('aria-describedby'), $trigger.attr('id'), 'tooltip id and aria-describedby on trigger match') + assert.ok($trigger[0].hasAttribute('aria-describedby'), 'trigger has aria-describedby') + }) + + QUnit.test('should remove aria-describedby from trigger on hide', function (assert) { + assert.expect(2) + var done = assert.async() + var $trigger = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .bootstrapTooltip() + .appendTo('#qunit-fixture') + + $trigger + .one('shown.bs.tooltip', function () { + assert.ok($trigger[0].hasAttribute('aria-describedby'), 'trigger has aria-describedby') + $trigger.bootstrapTooltip('hide') + }) + .one('hidden.bs.tooltip', function () { + assert.ok(!$trigger[0].hasAttribute('aria-describedby'), 'trigger does not have aria-describedby') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should assign a unique id tooltip element', function (assert) { + assert.expect(2) + $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip('show') + + var id = $('.tooltip').attr('id') + + assert.strictEqual($('#' + id).length, 1, 'tooltip has unique id') + assert.strictEqual(id.indexOf('tooltip'), 0, 'tooltip id has prefix') + }) + + QUnit.test('should place tooltips relative to placement option', function (assert) { + assert.expect(2) + var done = assert.async() + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + placement: 'bottom' + }) + + $tooltip + .one('shown.bs.tooltip', function () { + assert.ok($('.tooltip') + .is('.fade.bs-tooltip-bottom.show'), 'has correct classes applied') + + $tooltip.bootstrapTooltip('hide') + }) + .one('hidden.bs.tooltip', function () { + assert.strictEqual($tooltip.data('bs.tooltip').tip.parentNode, null, 'tooltip removed') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should allow html entities', function (assert) { + assert.expect(2) + var done = assert.async() + var $tooltip = $('<a href="#" rel="tooltip" title="<b>@fat</b>"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + html: true + }) + + $tooltip + .one('shown.bs.tooltip', function () { + assert.notEqual($('.tooltip b').length, 0, 'b tag was inserted') + $tooltip.bootstrapTooltip('hide') + }) + .one('hidden.bs.tooltip', function () { + assert.strictEqual($tooltip.data('bs.tooltip').tip.parentNode, null, 'tooltip removed') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should allow DOMElement title (html: false)', function (assert) { + assert.expect(3) + var done = assert.async() + var title = document.createTextNode('<3 writing tests') + var $tooltip = $('<a href="#" rel="tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + title: title + }) + + $tooltip + .one('shown.bs.tooltip', function () { + assert.notEqual($('.tooltip').length, 0, 'tooltip inserted') + assert.strictEqual($('.tooltip').text(), '<3 writing tests', 'title inserted') + assert.ok(!$.contains($('.tooltip').get(0), title), 'title node copied, not moved') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should allow DOMElement title (html: true)', function (assert) { + assert.expect(3) + var done = assert.async() + var title = document.createTextNode('<3 writing tests') + var $tooltip = $('<a href="#" rel="tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + html: true, + title: title + }) + + $tooltip + .one('shown.bs.tooltip', function () { + assert.notEqual($('.tooltip').length, 0, 'tooltip inserted') + assert.strictEqual($('.tooltip').text(), '<3 writing tests', 'title inserted') + assert.ok($.contains($('.tooltip').get(0), title), 'title node moved, not copied') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should respect custom classes', function (assert) { + assert.expect(2) + var done = assert.async() + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + template: '<div class="tooltip some-class"><div class="tooltip-arrow"/><div class="tooltip-inner"/></div>' + }) + + $tooltip + .one('shown.bs.tooltip', function () { + assert.ok($('.tooltip').hasClass('some-class'), 'custom class is present') + $tooltip.bootstrapTooltip('hide') + }) + .one('hidden.bs.tooltip', function () { + assert.strictEqual($tooltip.data('bs.tooltip').tip.parentNode, null, 'tooltip removed') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should fire show event', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div title="tooltip title"/>') + .on('show.bs.tooltip', function () { + assert.ok(true, 'show event fired') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should throw an error when show is called on hidden elements', function (assert) { + assert.expect(1) + var done = assert.async() + + try { + $('<div title="tooltip title" style="display: none"/>').bootstrapTooltip('show') + } catch (err) { + assert.strictEqual(err.message, 'Please use show on visible elements') + done() + } + }) + + QUnit.test('should fire inserted event', function (assert) { + assert.expect(2) + var done = assert.async() + + $('<div title="tooltip title"/>') + .appendTo('#qunit-fixture') + .on('inserted.bs.tooltip', function () { + assert.notEqual($('.tooltip').length, 0, 'tooltip was inserted') + assert.ok(true, 'inserted event fired') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should fire shown event', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div title="tooltip title"></div>') + .appendTo('#qunit-fixture') + .on('shown.bs.tooltip', function () { + assert.ok(true, 'shown was called') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should not fire shown event when show was prevented', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div title="tooltip title"/>') + .on('show.bs.tooltip', function (e) { + e.preventDefault() + assert.ok(true, 'show event fired') + done() + }) + .on('shown.bs.tooltip', function () { + assert.ok(false, 'shown event fired') + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should fire hide event', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div title="tooltip title"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.tooltip', function () { + $(this).bootstrapTooltip('hide') + }) + .on('hide.bs.tooltip', function () { + assert.ok(true, 'hide event fired') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should fire hidden event', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div title="tooltip title"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.tooltip', function () { + $(this).bootstrapTooltip('hide') + }) + .on('hidden.bs.tooltip', function () { + assert.ok(true, 'hidden event fired') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should not fire hidden event when hide was prevented', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div title="tooltip title"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.tooltip', function () { + $(this).bootstrapTooltip('hide') + }) + .on('hide.bs.tooltip', function (e) { + e.preventDefault() + assert.ok(true, 'hide event fired') + done() + }) + .on('hidden.bs.tooltip', function () { + assert.ok(false, 'hidden event fired') + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should destroy tooltip', function (assert) { + assert.expect(7) + var $tooltip = $('<div/>') + .bootstrapTooltip() + .on('click.foo', function () {}) // eslint-disable-line no-empty-function + + assert.ok($tooltip.data('bs.tooltip'), 'tooltip has data') + assert.ok($._data($tooltip[0], 'events').mouseover && $._data($tooltip[0], 'events').mouseout, 'tooltip has hover events') + assert.strictEqual($._data($tooltip[0], 'events').click[0].namespace, 'foo', 'tooltip has extra click.foo event') + + $tooltip.bootstrapTooltip('show') + $tooltip.bootstrapTooltip('dispose') + + assert.ok(!$tooltip.hasClass('show'), 'tooltip is hidden') + assert.ok(!$._data($tooltip[0], 'bs.tooltip'), 'tooltip does not have data') + assert.strictEqual($._data($tooltip[0], 'events').click[0].namespace, 'foo', 'tooltip still has click.foo') + assert.ok(!$._data($tooltip[0], 'events').mouseover && !$._data($tooltip[0], 'events').mouseout, 'tooltip does not have hover events') + }) + + // QUnit.test('should show tooltip with delegate selector on click', function (assert) { + // assert.expect(2) + // var $div = $('<div><a href="#" rel="tooltip" title="Another tooltip"/></div>') + // .appendTo('#qunit-fixture') + // .bootstrapTooltip({ + // selector: 'a[rel="tooltip"]', + // trigger: 'click' + // }) + + // $div.find('a').trigger('click') + // assert.ok($('.tooltip').is('.fade.in'), 'tooltip is faded in') + + // $div.find('a').trigger('click') + // assert.strictEqual($div.data('bs.tooltip').tip.parentNode, null, 'tooltip removed') + // }) + + QUnit.test('should show tooltip when toggle is called', function (assert) { + assert.expect(1) + $('<a href="#" rel="tooltip" title="tooltip on toggle"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + trigger: 'manual' + }) + .bootstrapTooltip('toggle') + + assert.ok($('.tooltip').is('.fade.show'), 'tooltip is faded active') + }) + + QUnit.test('should hide previously shown tooltip when toggle is called on tooltip', function (assert) { + assert.expect(1) + $('<a href="#" rel="tooltip" title="tooltip on toggle">@ResentedHook</a>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + trigger: 'manual' + }) + .bootstrapTooltip('show') + + $('.tooltip').bootstrapTooltip('toggle') + assert.ok($('.tooltip').not('.fade.show'), 'tooltip was faded out') + }) + + QUnit.test('should place tooltips inside body when container is body', function (assert) { + assert.expect(3) + var done = assert.async() + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + container: 'body' + }) + + $tooltip + .one('shown.bs.tooltip', function () { + assert.notEqual($('body > .tooltip').length, 0, 'tooltip is direct descendant of body') + assert.strictEqual($('#qunit-fixture > .tooltip').length, 0, 'tooltip is not in parent') + $tooltip.bootstrapTooltip('hide') + }) + .one('hidden.bs.tooltip', function () { + assert.strictEqual($('body > .tooltip').length, 0, 'tooltip was removed from dom') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should add position class before positioning so that position-specific styles are taken into account', function (assert) { + assert.expect(2) + var done = assert.async() + var styles = '<style>' + + '.bs-tooltip-right { white-space: nowrap; }' + + '.bs-tooltip-right .tooltip-inner { max-width: none; }' + + '</style>' + var $styles = $(styles).appendTo('head') + + var $container = $('<div/>').appendTo('#qunit-fixture') + $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line"/>') + .appendTo($container) + .bootstrapTooltip({ + placement: 'right', + trigger: 'manual' + }) + .on('inserted.bs.tooltip', function () { + var $tooltip = $($(this).data('bs.tooltip').tip) + assert.ok($tooltip.hasClass('bs-tooltip-right')) + assert.ok(typeof $tooltip.attr('style') === 'undefined') + $styles.remove() + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should use title attribute for tooltip text', function (assert) { + assert.expect(2) + var done = assert.async() + var $tooltip = $('<a href="#" rel="tooltip" title="Simple tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip() + + $tooltip + .one('shown.bs.tooltip', function () { + assert.strictEqual($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title from title attribute is set') + $tooltip.bootstrapTooltip('hide') + }) + .one('hidden.bs.tooltip', function () { + assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should prefer title attribute over title option', function (assert) { + assert.expect(2) + var done = assert.async() + var $tooltip = $('<a href="#" rel="tooltip" title="Simple tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + title: 'This is a tooltip with some content' + }) + + $tooltip + .one('shown.bs.tooltip', function () { + assert.strictEqual($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title is set from title attribute while preferred over title option') + $tooltip.bootstrapTooltip('hide') + }) + .one('hidden.bs.tooltip', function () { + assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should use title option', function (assert) { + assert.expect(2) + var done = assert.async() + var $tooltip = $('<a href="#" rel="tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + title: 'This is a tooltip with some content' + }) + + $tooltip + .one('shown.bs.tooltip', function () { + assert.strictEqual($('.tooltip').children('.tooltip-inner').text(), 'This is a tooltip with some content', 'title from title option is set') + $tooltip.bootstrapTooltip('hide') + }) + .one('hidden.bs.tooltip', function () { + assert.strictEqual($('.tooltip').length, 0, 'tooltip removed from dom') + done() + }) + .bootstrapTooltip('show') + }) + + QUnit.test('should not error when trying to show an top-placed tooltip that has been removed from the dom', function (assert) { + assert.expect(1) + var passed = true + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .one('show.bs.tooltip', function () { + $(this).remove() + }) + .bootstrapTooltip({ + placement: 'top' + }) + + try { + $tooltip.bootstrapTooltip('show') + } catch (err) { + passed = false + console.log(err) + } + + assert.ok(passed, '.tooltip(\'show\') should not throw an error if element no longer is in dom') + }) + + QUnit.test('should show tooltip if leave event hasn\'t occurred before delay expires', function (assert) { + assert.expect(2) + var done = assert.async() + + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + delay: 150 + }) + + setTimeout(function () { + assert.ok(!$('.tooltip').is('.fade.show'), '100ms: tooltip is not faded active') + }, 100) + + setTimeout(function () { + assert.ok($('.tooltip').is('.fade.show'), '200ms: tooltip is faded active') + done() + }, 200) + + $tooltip.trigger('mouseenter') + }) + + QUnit.test('should not show tooltip if leave event occurs before delay expires', function (assert) { + assert.expect(2) + var done = assert.async() + + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + delay: 150 + }) + + setTimeout(function () { + assert.ok(!$('.tooltip').is('.fade.show'), '100ms: tooltip not faded active') + $tooltip.trigger('mouseout') + }, 100) + + setTimeout(function () { + assert.ok(!$('.tooltip').is('.fade.show'), '200ms: tooltip not faded active') + done() + }, 200) + + $tooltip.trigger('mouseenter') + }) + + QUnit.test('should not hide tooltip if leave event occurs and enter event occurs within the hide delay', function (assert) { + assert.expect(3) + var done = assert.async() + + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + delay: { + show: 0, + hide: 150 + } + }) + + setTimeout(function () { + assert.ok($('.tooltip').is('.fade.show'), '1ms: tooltip faded active') + $tooltip.trigger('mouseout') + + setTimeout(function () { + assert.ok($('.tooltip').is('.fade.show'), '100ms: tooltip still faded active') + $tooltip.trigger('mouseenter') + }, 100) + + setTimeout(function () { + assert.ok($('.tooltip').is('.fade.show'), '200ms: tooltip still faded active') + done() + }, 200) + }, 0) + + $tooltip.trigger('mouseenter') + }) + + QUnit.test('should not show tooltip if leave event occurs before delay expires', function (assert) { + assert.expect(2) + var done = assert.async() + + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + delay: 150 + }) + + setTimeout(function () { + assert.ok(!$('.tooltip').is('.fade.show'), '100ms: tooltip not faded active') + $tooltip.trigger('mouseout') + }, 100) + + setTimeout(function () { + assert.ok(!$('.tooltip').is('.fade.show'), '200ms: tooltip not faded active') + done() + }, 200) + + $tooltip.trigger('mouseenter') + }) + + QUnit.test('should not show tooltip if leave event occurs before delay expires, even if hide delay is 0', function (assert) { + assert.expect(2) + var done = assert.async() + + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + delay: { + show: 150, + hide: 0 + } + }) + + setTimeout(function () { + assert.ok(!$('.tooltip').is('.fade.show'), '100ms: tooltip not faded active') + $tooltip.trigger('mouseout') + }, 100) + + setTimeout(function () { + assert.ok(!$('.tooltip').is('.fade.show'), '250ms: tooltip not faded active') + done() + }, 250) + + $tooltip.trigger('mouseenter') + }) + + QUnit.test('should wait 200ms before hiding the tooltip', function (assert) { + assert.expect(3) + var done = assert.async() + + var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + delay: { + show: 0, + hide: 150 + } + }) + + setTimeout(function () { + assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.show'), '1ms: tooltip faded active') + + $tooltip.trigger('mouseout') + + setTimeout(function () { + assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.show'), '100ms: tooltip still faded active') + }, 100) + + setTimeout(function () { + assert.ok(!$($tooltip.data('bs.tooltip').tip).is('.show'), '200ms: tooltip removed') + done() + }, 200) + }, 0) + + $tooltip.trigger('mouseenter') + }) + + QUnit.test('should not reload the tooltip on subsequent mouseenter events', function (assert) { + assert.expect(1) + var titleHtml = function () { + var uid = Util.getUID('tooltip') + return '<p id="tt-content">' + uid + '</p><p>' + uid + '</p><p>' + uid + '</p>' + } + + var $tooltip = $('<span id="tt-outer" rel="tooltip" data-trigger="hover" data-placement="top">some text</span>') + .appendTo('#qunit-fixture') + + $tooltip.bootstrapTooltip({ + html: true, + animation: false, + trigger: 'hover', + delay: { + show: 0, + hide: 500 + }, + container: $tooltip, + title: titleHtml + }) + + $('#tt-outer').trigger('mouseenter') + + var currentUid = $('#tt-content').text() + + $('#tt-content').trigger('mouseenter') + assert.strictEqual(currentUid, $('#tt-content').text()) + }) + + QUnit.test('should not reload the tooltip if the mouse leaves and re-enters before hiding', function (assert) { + assert.expect(4) + + var titleHtml = function () { + var uid = Util.getUID('tooltip') + return '<p id="tt-content">' + uid + '</p><p>' + uid + '</p><p>' + uid + '</p>' + } + + var $tooltip = $('<span id="tt-outer" rel="tooltip" data-trigger="hover" data-placement="top">some text</span>') + .appendTo('#qunit-fixture') + + $tooltip.bootstrapTooltip({ + html: true, + animation: false, + trigger: 'hover', + delay: { + show: 0, + hide: 500 + }, + title: titleHtml + }) + + var obj = $tooltip.data('bs.tooltip') + + $('#tt-outer').trigger('mouseenter') + + var currentUid = $('#tt-content').text() + + $('#tt-outer').trigger('mouseleave') + assert.strictEqual(currentUid, $('#tt-content').text()) + + assert.ok(obj._hoverState === 'out', 'the tooltip hoverState should be set to "out"') + + $('#tt-outer').trigger('mouseenter') + assert.ok(obj._hoverState === 'show', 'the tooltip hoverState should be set to "show"') + + assert.strictEqual(currentUid, $('#tt-content').text()) + }) + + QUnit.test('should do nothing when an attempt is made to hide an uninitialized tooltip', function (assert) { + assert.expect(1) + + var $tooltip = $('<span data-toggle="tooltip" title="some tip">some text</span>') + .appendTo('#qunit-fixture') + .on('hidden.bs.tooltip shown.bs.tooltip', function () { + assert.ok(false, 'should not fire any tooltip events') + }) + .bootstrapTooltip('hide') + assert.strictEqual(typeof $tooltip.data('bs.tooltip'), 'undefined', 'should not initialize the tooltip') + }) + + QUnit.test('should not remove tooltip if multiple triggers are set and one is still active', function (assert) { + assert.expect(41) + var $el = $('<button>Trigger</button>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + trigger: 'click hover focus', + animation: false + }) + var tooltip = $el.data('bs.tooltip') + var $tooltip = $(tooltip.getTipElement()) + + function showingTooltip() { + return $tooltip.hasClass('show') || tooltip._hoverState === 'show' + } + + var tests = [ + ['mouseenter', 'mouseleave'], + + ['focusin', 'focusout'], + + ['click', 'click'], + + ['mouseenter', 'focusin', 'focusout', 'mouseleave'], + ['mouseenter', 'focusin', 'mouseleave', 'focusout'], + + ['focusin', 'mouseenter', 'mouseleave', 'focusout'], + ['focusin', 'mouseenter', 'focusout', 'mouseleave'], + + ['click', 'focusin', 'mouseenter', 'focusout', 'mouseleave', 'click'], + ['mouseenter', 'click', 'focusin', 'focusout', 'mouseleave', 'click'], + ['mouseenter', 'focusin', 'click', 'click', 'mouseleave', 'focusout'] + ] + + assert.ok(!showingTooltip()) + + $.each(tests, function (idx, triggers) { + for (var i = 0, len = triggers.length; i < len; i++) { + $el.trigger(triggers[i]) + assert.equal(i < len - 1, showingTooltip()) + } + }) + }) + + QUnit.test('should show on first trigger after hide', function (assert) { + assert.expect(3) + var $el = $('<a href="#" rel="tooltip" title="Test tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + trigger: 'click hover focus', + animation: false + }) + + var tooltip = $el.data('bs.tooltip') + var $tooltip = $(tooltip.getTipElement()) + + function showingTooltip() { + return $tooltip.hasClass('show') || tooltip._hoverState === 'show' + } + + $el.trigger('click') + assert.ok(showingTooltip(), 'tooltip is faded in') + + $el.bootstrapTooltip('hide') + assert.ok(!showingTooltip(), 'tooltip was faded out') + + $el.trigger('click') + assert.ok(showingTooltip(), 'tooltip is faded in again') + }) + + QUnit.test('should hide tooltip when their containing modal is closed', function (assert) { + assert.expect(1) + var done = assert.async() + var templateHTML = '<div id="modal-test" class="modal">' + + '<div class="modal-dialog" role="document">' + + '<div class="modal-content">' + + '<div class="modal-body">' + + '<a id="tooltipTest" href="#" data-toggle="tooltip" title="Some tooltip text!">Tooltip</a>' + + '</div>' + + '</div>' + + '</div>' + + '</div>' + + $(templateHTML).appendTo('#qunit-fixture') + $('#tooltipTest') + .bootstrapTooltip({ + trigger: 'manuel' + }) + .on('shown.bs.tooltip', function () { + $('#modal-test').modal('hide') + }) + .on('hide.bs.tooltip', function () { + assert.ok(true, 'tooltip hide') + done() + }) + + $('#modal-test') + .on('shown.bs.modal', function () { + $('#tooltipTest').bootstrapTooltip('show') + }) + .modal('show') + }) + + QUnit.test('should reset tip classes when hidden event triggered', function (assert) { + assert.expect(2) + var done = assert.async() + var $el = $('<a href="#" rel="tooltip" title="Test tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip('show') + .on('hidden.bs.tooltip', function () { + var tooltip = $el.data('bs.tooltip') + var $tooltip = $(tooltip.getTipElement()) + assert.ok($tooltip.hasClass('tooltip')) + assert.ok($tooltip.hasClass('fade')) + done() + }) + + $el.bootstrapTooltip('hide') + }) + + QUnit.test('should convert number in title to string', function (assert) { + assert.expect(1) + var done = assert.async() + var $el = $('<a href="#" rel="tooltip" title="7"/>') + .appendTo('#qunit-fixture') + .on('shown.bs.tooltip', function () { + var tooltip = $el.data('bs.tooltip') + var $tooltip = $(tooltip.getTipElement()) + assert.strictEqual($tooltip.children().text(), '7') + done() + }) + + $el.bootstrapTooltip('show') + }) + + QUnit.test('tooltip should be shown right away after the call of disable/enable', function (assert) { + assert.expect(2) + var done = assert.async() + + var $trigger = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip() + .on('shown.bs.tooltip', function () { + assert.strictEqual($('.tooltip').hasClass('show'), true) + done() + }) + + $trigger.bootstrapTooltip('disable') + $trigger.trigger($.Event('click')) + setTimeout(function () { + assert.strictEqual($('.tooltip').length === 0, true) + $trigger.bootstrapTooltip('enable') + $trigger.trigger($.Event('click')) + }, 200) + }) + + QUnit.test('should call Popper.js to update', function (assert) { + assert.expect(2) + + var $tooltip = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip() + + var tooltip = $tooltip.data('bs.tooltip') + tooltip.show() + assert.ok(tooltip._popper) + + var spyPopper = sinon.spy(tooltip._popper, 'scheduleUpdate') + tooltip.update() + assert.ok(spyPopper.called) + }) + + QUnit.test('should not call Popper.js to update', function (assert) { + assert.expect(1) + + var $tooltip = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip() + + var tooltip = $tooltip.data('bs.tooltip') + tooltip.update() + + assert.ok(tooltip._popper === null) + }) + + QUnit.test('should use Popper.js to get the tip on placement change', function (assert) { + assert.expect(1) + + var $tooltip = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip() + + var $tipTest = $('<div class="bs-tooltip" />') + .appendTo('#qunit-fixture') + + var tooltip = $tooltip.data('bs.tooltip') + tooltip.tip = null + + tooltip._handlePopperPlacementChange({ + instance: { + popper: $tipTest[0] + }, + placement: 'auto' + }) + + assert.ok(tooltip.tip === $tipTest[0]) + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/unit/util.js b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/util.js new file mode 100644 index 0000000..37327b8 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/unit/util.js @@ -0,0 +1,104 @@ +$(function () { + 'use strict' + + window.Util = typeof bootstrap !== 'undefined' ? bootstrap.Util : Util + + QUnit.module('util', { + afterEach: function () { + $('#qunit-fixture').html('') + } + }) + + QUnit.test('Util.getSelectorFromElement should return the correct element', function (assert) { + assert.expect(2) + + var $el = $('<div data-target="body"></div>').appendTo($('#qunit-fixture')) + assert.strictEqual(Util.getSelectorFromElement($el[0]), 'body') + + // Not found element + var $el2 = $('<div data-target="#fakeDiv"></div>').appendTo($('#qunit-fixture')) + assert.strictEqual(Util.getSelectorFromElement($el2[0]), null) + }) + + QUnit.test('Util.typeCheckConfig should thrown an error when a bad config is passed', function (assert) { + assert.expect(1) + var namePlugin = 'collapse' + var defaultType = { + toggle: 'boolean', + parent: '(string|element)' + } + var config = { + toggle: true, + parent: 777 + } + + try { + Util.typeCheckConfig(namePlugin, config, defaultType) + } catch (err) { + assert.strictEqual(err.message, 'COLLAPSE: Option "parent" provided type "number" but expected type "(string|element)".') + } + }) + + QUnit.test('Util.isElement should check if we passed an element or not', function (assert) { + assert.expect(3) + var $div = $('<div id="test"></div>').appendTo($('#qunit-fixture')) + + assert.strictEqual(Util.isElement($div), 1) + assert.strictEqual(Util.isElement($div[0]), 1) + assert.strictEqual(typeof Util.isElement({}) === 'undefined', true) + }) + + QUnit.test('Util.getTransitionDurationFromElement should accept transition durations in milliseconds', function (assert) { + assert.expect(1) + var $div = $('<div style="transition: all 300ms ease-out;"></div>').appendTo($('#qunit-fixture')) + + assert.strictEqual(Util.getTransitionDurationFromElement($div[0]), 300) + }) + + QUnit.test('Util.getTransitionDurationFromElement should accept transition durations in seconds', function (assert) { + assert.expect(1) + var $div = $('<div style="transition: all .4s ease-out;"></div>').appendTo($('#qunit-fixture')) + + assert.strictEqual(Util.getTransitionDurationFromElement($div[0]), 400) + }) + + QUnit.test('Util.getTransitionDurationFromElement should get the first transition duration if multiple transition durations are defined', function (assert) { + assert.expect(1) + var $div = $('<div style="transition: transform .3s ease-out, opacity .2s;"></div>').appendTo($('#qunit-fixture')) + + assert.strictEqual(Util.getTransitionDurationFromElement($div[0]), 300) + }) + + QUnit.test('Util.getTransitionDurationFromElement should return 0 if transition duration is not defined', function (assert) { + assert.expect(1) + var $div = $('<div></div>').appendTo($('#qunit-fixture')) + + assert.strictEqual(Util.getTransitionDurationFromElement($div[0]), 0) + }) + + QUnit.test('Util.getTransitionDurationFromElement should return 0 if element is not found in DOM', function (assert) { + assert.expect(1) + var $div = $('#fake-id') + + assert.strictEqual(Util.getTransitionDurationFromElement($div[0]), 0) + }) + + QUnit.test('Util.getUID should generate a new id uniq', function (assert) { + assert.expect(2) + var id = Util.getUID('test') + var id2 = Util.getUID('test') + + assert.ok(id !== id2, id + ' !== ' + id2) + + id = Util.getUID('test') + $('<div id="' + id + '"></div>').appendTo($('#qunit-fixture')) + + id2 = Util.getUID('test') + assert.ok(id !== id2, id + ' !== ' + id2) + }) + + QUnit.test('Util.supportsTransitionEnd should return true', function (assert) { + assert.expect(1) + assert.ok(Util.supportsTransitionEnd()) + }) +}) diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/alert.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/alert.html new file mode 100644 index 0000000..67cafa9 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/alert.html @@ -0,0 +1,58 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Alert</title> + </head> + <body> + <div class="container"> + <h1>Alert <small>Bootstrap Visual Test</small></h1> + + <div class="alert alert-warning alert-dismissible fade show" role="alert"> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + <strong>Holy guacamole!</strong> You should check in on some of those fields below. + </div> + + <div class="alert alert-danger alert-dismissible fade show" role="alert"> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + <p> + <strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again. + </p> + <p> + <button type="button" class="btn btn-danger">Danger</button> + <button type="button" class="btn btn-secondary">Secondary</button> + </p> + </div> + + <div class="alert alert-danger alert-dismissible fade show" role="alert"> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + <p> + <strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. + </p> + <p> + <button type="button" class="btn btn-danger">Take this action</button> + <button type="button" class="btn btn-primary">Or do this</button> + </p> + </div> + + <div class="alert alert-warning alert-dismissible fade show" role="alert" style="transition-duration: 5s;"> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + This alert will take 5 seconds to fade out. + </div> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/alert.js"></script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/button.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/button.html new file mode 100644 index 0000000..b82a10d --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/button.html @@ -0,0 +1,51 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Button</title> + </head> + <body> + <div class="container"> + <h1>Button <small>Bootstrap Visual Test</small></h1> + + <button type="button" class="btn btn-primary" data-toggle="button" aria-pressed="false" autocomplete="off"> + Single toggle + </button> + + <p>For checkboxes and radio buttons, ensure that keyboard behavior is functioning correctly.</p> + <p>Navigate to the checkboxes with the keyboard (generally, using <kbd>TAB</kbd> / <kbd>SHIFT + TAB</kbd>), and ensure that <kbd>SPACE</kbd> toggles the currently focused checkbox. Click on one of the checkboxes using the mouse, ensure that focus was correctly set on the actual checkbox, and that <kbd>SPACE</kbd> toggles the checkbox again.</p> + + <div class="btn-group" data-toggle="buttons"> + <label class="btn btn-primary active"> + <input type="checkbox" checked autocomplete="off"> Checkbox 1 (pre-checked) + </label> + <label class="btn btn-primary"> + <input type="checkbox" autocomplete="off"> Checkbox 2 + </label> + <label class="btn btn-primary"> + <input type="checkbox" autocomplete="off"> Checkbox 3 + </label> + </div> + + <p>Navigate to the radio button group with the keyboard (generally, using <kbd>TAB</kbd> / <kbd>SHIFT + TAB</kbd>). If no radio button was initially set to be selected, the first/last radio button should receive focus (depending on whether you navigated "forward" to the group with <kbd>TAB</kbd> or "backwards" using <kbd>SHIFT + TAB</kbd>). If a radio button was already selected, navigating with the keyboard should set focus to that particular radio button. Only one radio button in a group should receive focus at any given time. Ensure that the selected radio button can be changed by using the <kbd>←</kbd> and <kbd>→</kbd> arrow keys. Click on one of the radio buttons with the mouse, ensure that focus was correctly set on the actual radio button, and that <kbd>←</kbd> and <kbd>→</kbd> change the selected radio button again.</p> + + <div class="btn-group" data-toggle="buttons"> + <label class="btn btn-primary active"> + <input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected) + </label> + <label class="btn btn-primary"> + <input type="radio" name="options" id="option2" autocomplete="off"> Radio 2 + </label> + <label class="btn btn-primary"> + <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3 + </label> + </div> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/button.js"></script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/carousel.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/carousel.html new file mode 100644 index 0000000..630f870 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/carousel.html @@ -0,0 +1,66 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Carousel</title> + <style> + .carousel-item { + transition: transform 2s ease, opacity .5s ease; + } + </style> + </head> + <body> + <div class="container"> + <h1>Carousel <small>Bootstrap Visual Test</small></h1> + + <p>The transition duration should be around 2s. Also, the carousel shouldn't slide when its window/tab is hidden. Check the console log.</p> + + <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> + <ol class="carousel-indicators"> + <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> + <li data-target="#carousel-example-generic" data-slide-to="1"></li> + <li data-target="#carousel-example-generic" data-slide-to="2"></li> + </ol> + <div class="carousel-inner"> + <div class="carousel-item active"> + <img src="https://i.imgur.com/iEZgY7Y.jpg" alt="First slide"> + </div> + <div class="carousel-item"> + <img src="https://i.imgur.com/eNWn1Xs.jpg" alt="Second slide"> + </div> + <div class="carousel-item"> + <img src="https://i.imgur.com/Nm7xoti.jpg" alt="Third slide"> + </div> + </div> + <a class="carousel-control-prev" href="#carousel-example-generic" role="button" data-slide="prev"> + <span class="carousel-control-prev-icon" aria-hidden="true"></span> + <span class="sr-only">Previous</span> + </a> + <a class="carousel-control-next" href="#carousel-example-generic" role="button" data-slide="next"> + <span class="carousel-control-next-icon" aria-hidden="true"></span> + <span class="sr-only">Next</span> + </a> + </div> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/carousel.js"></script> + <script> + $(function() { + var t0, t1; + + // Test to show that the carousel doesn't slide when the current tab isn't visible + // Test to show that transition-duration can be changed with css + $('#carousel-example-generic').on('slid.bs.carousel', function(event) { + t1 = performance.now() + console.log('transition-duration took' + (t1 - t0) + 'ms, slid at ', event.timeStamp) + }).on('slide.bs.carousel', function() { + t0 = performance.now() + }) + }) + </script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/collapse.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/collapse.html new file mode 100644 index 0000000..07cb98f --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/collapse.html @@ -0,0 +1,78 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Collapse</title> + </head> + <body> + <div class="container"> + <h1>Collapse <small>Bootstrap Visual Test</small></h1> + + <div id="accordion" role="tablist"> + <div class="card"> + <div class="card-header" role="tab" id="headingOne"> + <h5 class="mb-0"> + <a data-toggle="collapse" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> + Collapsible Group Item #1 + </a> + </h5> + </div> + + <div id="collapseOne" class="collapse show" data-parent="#accordion" role="tabpanel" aria-labelledby="headingOne"> + <div class="card-body"> + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + </div> + </div> + </div> + <div class="card"> + <div class="card-header" role="tab" id="headingTwo"> + <h5 class="mb-0"> + <a class="collapsed" data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> + Collapsible Group Item #2 + </a> + </h5> + </div> + <div id="collapseTwo" class="collapse" data-parent="#accordion" role="tabpanel" aria-labelledby="headingTwo"> + <div class="card-body"> + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + </div> + </div> + </div> + <div class="card"> + <div class="card-header" role="tab" id="headingThree"> + <h5 class="mb-0"> + <a class="collapsed" data-toggle="collapse" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> + Collapsible Group Item #3 + </a> + </h5> + </div> + <div id="collapseThree" class="collapse" data-parent="#accordion" role="tabpanel" aria-labelledby="headingThree"> + <div class="card-body"> + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + </div> + </div> + </div> + <div class="card"> + <div class="card-header" role="tab" id="headingFour"> + <h5 class="mb-0"> + <a class="collapsed" data-toggle="collapse" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour"> + Collapsible Group Item with XSS in data-parent + </a> + </h5> + </div> + <div id="collapseFour" class="collapse" data-parent="<img src=1 onerror=alert(123) />" role="tabpanel" aria-labelledby="headingFour"> + <div class="card-body"> + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + </div> + </div> + </div> + </div> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/collapse.js"></script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/dropdown.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/dropdown.html new file mode 100644 index 0000000..be533b1 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/dropdown.html @@ -0,0 +1,212 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Dropdown</title> + </head> + <body> + <div class="container"> + <h1>Dropdown <small>Bootstrap Visual Test</small></h1> + + <nav class="navbar navbar-expand-md navbar-light bg-light"> + <a class="navbar-brand" href="#">Navbar</a> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div class="collapse navbar-collapse" id="navbarResponsive"> + <ul class="navbar-nav"> + <li class="nav-item active"> + <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#">Link</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#">Link</a> + </li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> + <div class="dropdown-menu" aria-labelledby="dropdown"> + <a class="dropdown-item" href="#">Action</a> + <a class="dropdown-item" href="#">Another action</a> + <a class="dropdown-item" href="#">Something else here</a> + </div> + </li> + </ul> + </div> + </nav> + + <ul class="nav nav-pills mt-3"> + <li class="nav-item"> + <a class="nav-link active" href="#">Active</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#">Link</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#">Link</a> + </li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="https://example.com" id="dropdown2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> + <div class="dropdown-menu" aria-labelledby="dropdown2"> + <a class="dropdown-item" href="#">Action</a> + <a class="dropdown-item" href="#">Another action</a> + <a class="dropdown-item" href="#">Something else here</a> + </div> + </li> + </ul> + + <div class="row"> + <div class="col-sm-12 mt-4"> + <div class="btn-group dropup"> + <button type="button" class="btn btn-secondary">Dropup split</button> + <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <span class="sr-only">Dropup split</span> + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="#">Action</a> + <a class="dropdown-item" href="#">Another action</a> + <a class="dropdown-item" href="#">Something else here</a> + </div> + </div> + + <div class="btn-group dropup"> + <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropup</button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="#">Action</a> + <a class="dropdown-item" href="#">Another action</a> + <a class="dropdown-item" href="#">Something else here</a> + </div> + </div> + + <div class="btn-group"> + <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + This dropdown's menu is right-aligned + </button> + <div class="dropdown-menu dropdown-menu-right"> + <button class="dropdown-item" type="button">Action</button> + <button class="dropdown-item" type="button">Another action</button> + <button class="dropdown-item" type="button">Something else here</button> + </div> + </div> + </div> + + <div class="col-sm-12 mt-4"> + <div class="btn-group dropup" role="group"> + <a href="#" class="btn btn-secondary">Dropup split align right</a> + <button type="button" id="dropdown-page-subheader-button-3" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <span class="sr-only">Product actions</span> + </button> + <div class="dropdown-menu dropdown-menu-right"> + <button class="dropdown-item" type="button">Action</button> + <button class="dropdown-item" type="button">Another action</button> + <button class="dropdown-item" type="button">Something else here with a long text</button> + </div> + </div> + <div class="btn-group dropup"> + <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropup align right</button> + <div class="dropdown-menu dropdown-menu-right"> + <button class="dropdown-item" type="button">Action</button> + <button class="dropdown-item" type="button">Another action</button> + <button class="dropdown-item" type="button">Something else here with a long text</button> + </div> + </div> + </div> + + <div class="col-sm-12 mt-4"> + <div class="btn-group dropright" role="group"> + <a href="#" class="btn btn-secondary">Dropright split</a> + <button type="button" id="dropdown-page-subheader-button-4" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <span class="sr-only">Product actions</span> + </button> + <div class="dropdown-menu"> + <button class="dropdown-item" type="button">Action</button> + <button class="dropdown-item" type="button">Another action</button> + <button class="dropdown-item" type="button">Something else here with a long text</button> + </div> + </div> + <div class="btn-group dropright"> + <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuRight" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropright + </button> + <div class="dropdown-menu" aria-labelledby="dropdownMenuRight"> + <button class="dropdown-item" type="button">Action</button> + <button class="dropdown-item" type="button">Another action</button> + <button class="dropdown-item" type="button">Something else here</button> + </div> + </div> + <!-- dropleft --> + <div class="btn-group dropleft" role="group"> + <a href="#" class="btn btn-secondary">Dropleft split</a> + <button type="button" id="dropdown-page-subheader-button-5" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <span class="sr-only">Product actions</span> + </button> + <div class="dropdown-menu"> + <button class="dropdown-item" type="button">Action</button> + <button class="dropdown-item" type="button">Another action</button> + <button class="dropdown-item" type="button">Something else here with a long text</button> + </div> + </div> + <div class="btn-group dropleft"> + <button class="btn btn-secondary dropdown-toggle" type="button" id="dropleftMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropleft + </button> + <div class="dropdown-menu" aria-labelledby="dropleftMenu"> + <button class="dropdown-item" type="button">Action</button> + <button class="dropdown-item" type="button">Another action</button> + <button class="dropdown-item" type="button">Something else here</button> + </div> + </div> + </div> + </div> + + <div class="row"> + <div class="col-sm-3 mt-4"> + <div class="btn-group dropdown"> + <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" data-offset="10,20">Dropdown offset</button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="#">Action</a> + <a class="dropdown-item" href="#">Another action</a> + <a class="dropdown-item" href="#">Something else here</a> + </div> + </div> + </div> + <div class="col-sm-3 mt-4"> + <div class="btn-group dropdown"> + <button type="button" class="btn btn-secondary">Dropdown reference</button> + <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-reference="parent"> + <span class="sr-only">Dropdown split</span> + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="#">Action</a> + <a class="dropdown-item" href="#">Another action</a> + <a class="dropdown-item" href="#">Something else here</a> + </div> + </div> + </div> + <div class="col-sm-3 mt-4"> + <div class="dropdown"> + <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" data-display="static" aria-haspopup="true" aria-expanded="false"> + Dropdown menu without Popper.js + </button> + <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> + <a class="dropdown-item" href="#">Action</a> + <a class="dropdown-item" href="#">Another action</a> + <a class="dropdown-item" href="#">Something else here</a> + </div> + </div> + </div> + </div> + + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../../site/docs/4.1/assets/js/vendor/popper.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/dropdown.js"></script> + <script src="../../dist/collapse.js"></script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/modal.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/modal.html new file mode 100644 index 0000000..4fed55c --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/modal.html @@ -0,0 +1,268 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Modal</title> + <style> + #tall { + height: 1500px; + width: 100px; + } + </style> + </head> + <body> + <nav class="navbar navbar-full navbar-dark bg-dark"> + <button class="navbar-toggler hidden-lg-up" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"></button> + <div class="collapse navbar-expand-md" id="navbarResponsive"> + <a class="navbar-brand" href="#">This shouldn't jump!</a> + <ul class="navbar-nav"> + <li class="nav-item active"> + <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#">Link</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#">Link</a> + </li> + </ul> + </div> + </nav> + + <div class="container mt-3"> + <h1>Modal <small>Bootstrap Visual Test</small></h1> + + <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + <h4 class="modal-title" id="myModalLabel">Modal title</h4> + </div> + <div class="modal-body"> + <h4>Text in a modal</h4> + <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p> + + <h4>Popover in a modal</h4> + <p>This <button type="button" class="btn btn-primary" data-toggle="popover" data-placement="left" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">button</button> should trigger a popover on click.</p> + + + <h4>Tooltips in a modal</h4> + <p><a href="#" data-toggle="tooltip" data-placement="top" title="Tooltip on top">This link</a> and <a href="#" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">that link</a> should have tooltips on hover.</p> + + <div id="accordion" role="tablist"> + <div class="card"> + <div class="card-header" role="tab" id="headingOne"> + <h5 class="mb-0"> + <a data-toggle="collapse" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> + Collapsible Group Item #1 + </a> + </h5> + </div> + + <div id="collapseOne" class="collapse show" data-parent="#accordion" role="tabpanel" aria-labelledby="headingOne"> + <div class="card-body"> + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + </div> + </div> + </div> + <div class="card"> + <div class="card-header" role="tab" id="headingTwo"> + <h5 class="mb-0"> + <a class="collapsed" data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> + Collapsible Group Item #2 + </a> + </h5> + </div> + <div id="collapseTwo" class="collapse" data-parent="#accordion" role="tabpanel" aria-labelledby="headingTwo"> + <div class="card-body"> + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + </div> + </div> + </div> + <div class="card"> + <div class="card-header" role="tab" id="headingThree"> + <h5 class="mb-0"> + <a class="collapsed" data-toggle="collapse" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> + Collapsible Group Item #3 + </a> + </h5> + </div> + <div id="collapseThree" class="collapse" data-parent="#accordion" role="tabpanel" aria-labelledby="headingThree"> + <div class="card-body"> + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + </div> + </div> + </div> + </div> + + <hr> + + <h4>Overflowing text to show scroll behavior</h4> + <p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p> + <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p> + <p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p> + <p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p> + <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p> + <p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p> + <p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p> + <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p> + <p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> + <button type="button" class="btn btn-primary">Save changes</button> + </div> + </div> + </div> + </div> + + <div class="modal fade" id="firefoxModal" tabindex="-1" role="dialog" aria-labelledby="firefoxModalLabel" aria-hidden="true"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + <h4 class="modal-title" id="firefoxModalLabel">Firefox Bug Test</h4> + </div> + <div class="modal-body"> + <ol> + <li>Ensure you're using Firefox.</li> + <li>Open a new tab and then switch back to this tab.</li> + <li>Click into this input: <input type="text" id="ff-bug-input"></li> + <li>Switch to the other tab and then back to this tab.</li> + </ol> + <p>Test result: <strong id="ff-bug-test-result"></strong></p> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> + <button type="button" class="btn btn-primary">Save changes</button> + </div> + </div> + </div> + </div> + + <div class="modal fade" id="slowModal" tabindex="-1" role="dialog" aria-labelledby="slowModalLabel" aria-hidden="true" style="transition-duration: 5s;"> + <div class="modal-dialog" role="document" style="transition-duration: inherit;"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + <h4 class="modal-title" id="slowModalLabel">Lorem slowly</h4> + </div> + <div class="modal-body"> + <p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Nulla vitae elit libero, a pharetra augue.</p> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> + <button type="button" class="btn btn-primary">Save changes</button> + </div> + </div> + </div> + </div> + + <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> + Launch demo modal + </button> + + <button type="button" class="btn btn-primary btn-lg" id="tall-toggle"> + Toggle tall <body> content + </button> + + <br><br> + + <button type="button" class="btn btn-secondary btn-lg" data-toggle="modal" data-target="#firefoxModal"> + Launch Firefox bug test modal + </button> + (<a href="https://github.com/twbs/bootstrap/issues/18365">See Issue #18365</a>) + + <br><br> + + <button type="button" class="btn btn-secondary btn-lg" data-toggle="modal" data-target="#slowModal"> + Launch modal with slow transition + </button> + + <br><br> + + <div class="bg-dark text-white p-2" id="tall" style="display: none;"> + Tall body content to force the page to have a scrollbar. + </div> + + <button type="button" class="btn btn-secondary btn-lg" data-toggle="modal" data-target="<div class="modal fade the-bad" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">The Bad Modal</h4></div><div class="modal-body">This modal's HTTML source code is declared inline, inside the data-target attribute of it's show-button</div></div></div></div>"> + Modal with an XSS inside the data-target + </button> + + <br><br> + + <button type="button" class="btn btn-secondary btn-lg" id="btnPreventModal"> + Launch prevented modal on hide (to see the result open your console) + </button> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../../site/docs/4.1/assets/js/vendor/popper.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/modal.js"></script> + <script src="../../dist/collapse.js"></script> + <script src="../../dist/tooltip.js"></script> + <script src="../../dist/popover.js"></script> + + <script> + var firefoxTestDone = false + function reportFirefoxTestResult(result) { + if (!firefoxTestDone) { + $('#ff-bug-test-result') + .addClass(result ? 'text-success' : 'text-danger') + .text(result ? 'PASS' : 'FAIL') + } + } + + $(function () { + $('[data-toggle="popover"]').popover() + $('[data-toggle="tooltip"]').tooltip() + + $('#tall-toggle').click(function () { + $('#tall').toggle() + }) + + $('#ff-bug-input').one('focus', function () { + $('#firefoxModal').on('focus', reportFirefoxTestResult.bind(false)) + $('#ff-bug-input').on('focus', reportFirefoxTestResult.bind(true)) + }) + + $('#btnPreventModal').on('click', function () { + $('#firefoxModal').one('shown.bs.modal', function () { + $(this).modal('hide') + }) + .one('hide.bs.modal', function (event) { + event.preventDefault() + if ($(this).data('bs.modal')._isTransitioning) { + console.error('Modal plugin should not set _isTransitioning when hide event is prevented') + } else { + console.log('Test passed') + $(this).modal('hide') // work as expected + } + }) + .modal('show') + }) + + // Test transition duration + var t0, t1; + + $('#slowModal').on('shown.bs.modal', function(){ + t1 = performance.now() + console.log('transition-duration took ' + (t1 - t0) + 'ms.') + }).on('show.bs.modal', function(){ + t0 = performance.now() + }) + + }) + </script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/popover.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/popover.html new file mode 100644 index 0000000..422fd67 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/popover.html @@ -0,0 +1,46 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Popover</title> + </head> + <body> + <div class="container"> + <h1>Popover <small>Bootstrap Visual Test</small></h1> + + <button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="auto" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> + Popover on auto + </button> + + <button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="top" data-content="Default placement was on top but not enough place"> + Popover on top + </button> + + <button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> + Popover on right + </button> + + <button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> + Popover on bottom + </button> + + <button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> + Popover on left + </button> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../../site/docs/4.1/assets/js/vendor/popper.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/tooltip.js"></script> + <script src="../../dist/popover.js"></script> + + <script> + $(function () { + $('[data-toggle="popover"]').popover() + }) + </script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/scrollspy.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/scrollspy.html new file mode 100644 index 0000000..1d08585 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/scrollspy.html @@ -0,0 +1,95 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Scrollspy</title> + <style> + body { padding-top: 70px; } + </style> + </head> + <body data-spy="scroll" data-target=".navbar" data-offset="70"> + <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top"> + <a class="navbar-brand" href="#">Scrollspy test</a> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + <div class="navbar-collapse collapse" id="navbarSupportedContent"> + <ul class="navbar-nav mr-auto"> + <li class="nav-item"> + <a class="nav-link" href="#fat">@fat</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#mdo">@mdo</a> + </li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> + <div class="dropdown-menu" aria-labelledby="dropdown"> + <a class="dropdown-item" href="#one">One</a> + <a class="dropdown-item" href="#two">Two</a> + <a class="dropdown-item" href="#three">Three</a> + </div> + </li> + <li class="nav-item"> + <a class="nav-link" href="#final">Final</a> + </li> + </ul> + </div> + </nav> + <div class="container"> + <h2 id="fat">@fat</h2> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <hr> + <h2 id="mdo">@mdo</h2> + <p>Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <hr> + <h2 id="one">one</h2> + <p>Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <hr> + <h2 id="two">two</h2> + <p>In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <hr> + <h2 id="three">three</h2> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> + <hr> + <h2 id="final">Final section</h2> + <p>Ad leggings keytar, brunch id art party dolor labore.</p> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/scrollspy.js"></script> + <script src="../../dist/dropdown.js"></script> + <script src="../../dist/collapse.js"></script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/tab.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/tab.html new file mode 100644 index 0000000..eb72f5c --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/tab.html @@ -0,0 +1,234 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Tab</title> + <style> + h4 { + margin: 40px 0 10px; + } + </style> + </head> + <body> + <div class="container"> + <h1>Tab <small>Bootstrap Visual Test</small></h1> + + <h4>Tabs without fade</h4> + + <ul class="nav nav-tabs" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" data-toggle="tab" href="#home" role="tab">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" data-toggle="tab" href="#profile" role="tab">Profile</a> + </li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> + <div class="dropdown-menu" aria-labelledby="dropdown"> + <a class="dropdown-item" data-toggle="tab" href="#fat" role="tab">@fat</a> + <a class="dropdown-item" data-toggle="tab" href="#mdo" role="tab">@mdo</a> + </div> + </li> + </ul> + + <div class="tab-content" role="tablist"> + <div class="tab-pane active" id="home" role="tabpanel"> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + </div> + <div class="tab-pane" id="profile" role="tabpanel"> + <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> + <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> + </div> + <div class="tab-pane" id="fat" role="tabpanel"> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + </div> + <div class="tab-pane" id="mdo" role="tabpanel"> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + </div> + </div> + + <h4>Tabs with fade</h4> + + <ul class="nav nav-tabs" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" data-toggle="tab" href="#home2" role="tab">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" data-toggle="tab" href="#profile2" role="tab">Profile</a> + </li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="dropdown2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> + <div class="dropdown-menu" aria-labelledby="dropdown2"> + <a class="dropdown-item" data-toggle="tab" href="#fat2" role="tab">@fat</a> + <a class="dropdown-item" data-toggle="tab" href="#mdo2" role="tab">@mdo</a> + </div> + </li> + </ul> + + <div class="tab-content" role="tablist"> + <div class="tab-pane fade show active" id="home2" role="tabpanel"> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + </div> + <div class="tab-pane fade" id="profile2" role="tabpanel"> + <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> + <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> + </div> + <div class="tab-pane fade" id="fat2" role="tabpanel"> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + </div> + <div class="tab-pane fade" id="mdo2" role="tabpanel"> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + </div> + </div> + + <h4>Tabs without fade (no initially active pane)</h4> + + <ul class="nav nav-tabs" role="tablist"> + <li class="nav-item"> + <a class="nav-link" data-toggle="tab" href="#home3" role="tab">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" data-toggle="tab" href="#profile3" role="tab">Profile</a> + </li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="dropdown3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> + <div class="dropdown-menu" aria-labelledby="dropdown3"> + <a class="dropdown-item" data-toggle="tab" href="#fat3" role="tab">@fat</a> + <a class="dropdown-item" data-toggle="tab" href="#mdo3" role="tab">@mdo</a> + </div> + </li> + </ul> + + <div class="tab-content" role="tablist"> + <div class="tab-pane" id="home3" role="tabpanel"> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + </div> + <div class="tab-pane" id="profile3" role="tabpanel"> + <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> + <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> + </div> + <div class="tab-pane" id="fat3" role="tabpanel"> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + </div> + <div class="tab-pane" id="mdo3" role="tabpanel"> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + </div> + </div> + + <h4>Tabs with fade (no initially active pane)</h4> + + <ul class="nav nav-tabs" role="tablist"> + <li class="nav-item"> + <a class="nav-link" data-toggle="tab" href="#home4" role="tab">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" data-toggle="tab" href="#profile4" role="tab">Profile</a> + </li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="dropdown4" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> + <div class="dropdown-menu" aria-labelledby="dropdown4"> + <a class="dropdown-item" data-toggle="tab" href="#fat4" role="tab">@fat</a> + <a class="dropdown-item" data-toggle="tab" href="#mdo4" role="tab">@mdo</a> + </div> + </li> + </ul> + + <div class="tab-content"> + <div class="tab-pane fade" id="home4" role="tabpanel"> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + </div> + <div class="tab-pane fade" id="profile4" role="tabpanel"> + <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> + <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> + </div> + <div class="tab-pane fade" id="fat4" role="tabpanel"> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + </div> + <div class="tab-pane fade" id="mdo4" role="tabpanel"> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + </div> + </div> + + <h4>Tabs with nav (with fade)</h4> + <nav class="nav nav-pills"> + <a class="nav-link nav-item active" data-toggle="tab" href="#home5">Home</a> + <a class="nav-link nav-item" data-toggle="tab" href="#profile5">Profile</a> + <div class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="dropdown5" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> + <div class="dropdown-menu" aria-labelledby="dropdown5"> + <a class="dropdown-item" data-toggle="tab" href="#fat5">@fat</a> + <a class="dropdown-item" data-toggle="tab" href="#mdo5">@mdo</a> + </div> + </div> + <a class="nav-link nav-item disabled" href="#">Disabled</a> + </nav> + + <div class="tab-content" role="tabpanel"> + <div role="tabpanel" class="tab-pane fade show active" id="home5"> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + </div> + <div role="tabpanel" class="tab-pane fade" id="profile5"> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> + </div> + <div class="tab-pane fade" id="fat5" role="tabpanel"> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> + </div> + <div class="tab-pane fade" id="mdo5" role="tabpanel"> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> + </div> + </div> + + <h4>Tabs with list-group (with fade)</h4> + <div class="row"> + <div class="col-4"> + <div class="list-group" id="list-tab" role="tablist"> + <a class="list-group-item list-group-item-action active" id="list-home-list" data-toggle="tab" href="#list-home" role="tab" aria-controls="list-home">Home</a> + <a class="list-group-item list-group-item-action" id="list-profile-list" data-toggle="tab" href="#list-profile" role="tab" aria-controls="list-profile">Profile</a> + <a class="list-group-item list-group-item-action" id="list-messages-list" data-toggle="tab" href="#list-messages" role="tab" aria-controls="list-messages">Messages</a> + <a class="list-group-item list-group-item-action" id="list-settings-list" data-toggle="tab" href="#list-settings" role="tab" aria-controls="list-settings">Settings</a> + </div> + </div> + <div class="col-8"> + <div class="tab-content" id="nav-tabContent"> + <div class="tab-pane fade show active" id="list-home" role="tabpanel" aria-labelledby="list-home-list"> + <p>Velit aute mollit ipsum ad dolor consectetur nulla officia culpa adipisicing exercitation fugiat tempor. Voluptate deserunt sit sunt nisi aliqua fugiat proident ea ut. Mollit voluptate reprehenderit occaecat nisi ad non minim tempor sunt voluptate consectetur exercitation id ut nulla. Ea et fugiat aliquip nostrud sunt incididunt consectetur culpa aliquip eiusmod dolor. Anim ad Lorem aliqua in cupidatat nisi enim eu nostrud do aliquip veniam minim.</p> + </div> + <div class="tab-pane fade" id="list-profile" role="tabpanel" aria-labelledby="list-profile-list"> + <p>Cupidatat quis ad sint excepteur laborum in esse qui. Et excepteur consectetur ex nisi eu do cillum ad laborum. Mollit et eu officia dolore sunt Lorem culpa qui commodo velit ex amet id ex. Officia anim incididunt laboris deserunt anim aute dolor incididunt veniam aute dolore do exercitation. Dolor nisi culpa ex ad irure in elit eu dolore. Ad laboris ipsum reprehenderit irure non commodo enim culpa commodo veniam incididunt veniam ad.</p> + </div> + <div class="tab-pane fade" id="list-messages" role="tabpanel" aria-labelledby="list-messages-list"> + <p>Ut ut do pariatur aliquip aliqua aliquip exercitation do nostrud commodo reprehenderit aute ipsum voluptate. Irure Lorem et laboris nostrud amet cupidatat cupidatat anim do ut velit mollit consequat enim tempor. Consectetur est minim nostrud nostrud consectetur irure labore voluptate irure. Ipsum id Lorem sit sint voluptate est pariatur eu ad cupidatat et deserunt culpa sit eiusmod deserunt. Consectetur et fugiat anim do eiusmod aliquip nulla laborum elit adipisicing pariatur cillum.</p> + </div> + <div class="tab-pane fade" id="list-settings" role="tabpanel" aria-labelledby="list-settings-list"> + <p>Irure enim occaecat labore sit qui aliquip reprehenderit amet velit. Deserunt ullamco ex elit nostrud ut dolore nisi officia magna sit occaecat laboris sunt dolor. Nisi eu minim cillum occaecat aute est cupidatat aliqua labore aute occaecat ea aliquip sunt amet. Aute mollit dolor ut exercitation irure commodo non amet consectetur quis amet culpa. Quis ullamco nisi amet qui aute irure eu. Magna labore dolor quis ex labore id nostrud deserunt dolor eiusmod eu pariatur culpa mollit in irure.</p> + </div> + </div> + </div> + </div> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../../site/docs/4.1/assets/js/vendor/popper.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/tab.js"></script> + <script src="../../dist/dropdown.js"></script> + </body> +</html> diff --git a/themes/docsy/assets/vendor/bootstrap/js/tests/visual/tooltip.html b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/tooltip.html new file mode 100644 index 0000000..88165c0 --- /dev/null +++ b/themes/docsy/assets/vendor/bootstrap/js/tests/visual/tooltip.html @@ -0,0 +1,80 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css"> + <title>Tooltip</title> + <style> + #target { + border: 1px solid; + width: 100px; + height: 50px; + border: 1px solid; + margin-left: 50px; + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); + margin-top: 100px; + } + </style> + </head> + <body> + <div class="container"> + <h1>Tooltip <small>Bootstrap Visual Test</small></h1> + + <p class="text-muted">Tight pants next level keffiyeh <a href="#" data-toggle="tooltip" title="Default tooltip">you probably</a> haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel <a href="#" data-toggle="tooltip" title="Another tooltip">have a</a> terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan <a href="#" data-toggle="tooltip" title="Another one here too">whatever keytar</a>, scenester farm-to-table banksy Austin <a href="#" data-toggle="tooltip" title="The last tip!">twitter handle</a> freegan cred raw denim single-origin coffee viral.</p> + + <hr> + + <div class="row"> + <p> + <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="auto" title="Tooltip on auto"> + Tooltip on auto + </button> + <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top"> + Tooltip on top + </button> + <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="right" title="Tooltip on right"> + Tooltip on right + </button> + <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom"> + Tooltip on bottom + </button> + <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="left" title="Tooltip on left"> + Tooltip on left + </button> + </p> + </div> + <div class="row"> + <p> + <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="left" title="Tooltip with XSS" data-container="<img src=1 onerror=alert(123) />"> + Tooltip with XSS + </button> + <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="left" title="Tooltip with container" data-container="#customContainer"> + Tooltip with container + </button> + <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>"> + Tooltip with HTML + </button> + </p> + </div> + <div id="target" title="Test tooltip on transformed element"></div> + <div id="customContainer"></div> + </div> + + <script src="../../../site/docs/4.1/assets/js/vendor/jquery-slim.min.js"></script> + <script src="../../../site/docs/4.1/assets/js/vendor/popper.min.js"></script> + <script src="../../dist/util.js"></script> + <script src="../../dist/tooltip.js"></script> + <script> + $(function () { + $('[data-toggle="tooltip"]').tooltip() + $('#target').tooltip({ + placement : 'top', + trigger : 'manual' + }).tooltip('show') + }) + </script> + </body> +</html> |