diff options
author | Johann-S <johann.servoire@gmail.com> | 2017-08-29 22:16:00 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2017-08-31 19:43:04 +0300 |
commit | 9936bf59444c402b653f28449529eab83794e911 (patch) | |
tree | 9f92962faffb32135e5d1a3af31176572c359884 /js | |
parent | 0165a620ec5826289dd56c0683c413e7a5b47fcb (diff) |
Create a bundled release of Bootstrap with Popper.js inside
Diffstat (limited to 'js')
-rw-r--r-- | js/src/alert.js | 3 | ||||
-rw-r--r-- | js/src/button.js | 3 | ||||
-rw-r--r-- | js/src/carousel.js | 3 | ||||
-rw-r--r-- | js/src/collapse.js | 3 | ||||
-rw-r--r-- | js/src/dropdown.js | 8 | ||||
-rw-r--r-- | js/src/index.js | 46 | ||||
-rw-r--r-- | js/src/modal.js | 3 | ||||
-rw-r--r-- | js/src/popover.js | 3 | ||||
-rw-r--r-- | js/src/scrollspy.js | 3 | ||||
-rw-r--r-- | js/src/tab.js | 3 | ||||
-rw-r--r-- | js/src/tooltip.js | 8 | ||||
-rw-r--r-- | js/src/util.js | 4 | ||||
-rw-r--r-- | js/tests/.eslintrc.json | 1 |
13 files changed, 74 insertions, 17 deletions
diff --git a/js/src/alert.js b/js/src/alert.js index b6b9336af7..9fcf088b12 100644 --- a/js/src/alert.js +++ b/js/src/alert.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Util from './util' @@ -8,7 +9,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Alert = (($) => { +const Alert = (() => { /** diff --git a/js/src/button.js b/js/src/button.js index a8a72ef569..a121b8e13a 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -1,3 +1,4 @@ +import $ from 'jquery' /** * -------------------------------------------------------------------------- * Bootstrap (v4.0.0-beta): button.js @@ -5,7 +6,7 @@ * -------------------------------------------------------------------------- */ -const Button = (($) => { +const Button = (() => { /** diff --git a/js/src/carousel.js b/js/src/carousel.js index 8736605190..a5ad02541a 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Util from './util' @@ -8,7 +9,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Carousel = (($) => { +const Carousel = (() => { /** diff --git a/js/src/collapse.js b/js/src/collapse.js index 7d1ba4c54f..acc959d40c 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Util from './util' @@ -8,7 +9,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Collapse = (($) => { +const Collapse = (() => { /** diff --git a/js/src/dropdown.js b/js/src/dropdown.js index e1c48ac6e5..adb54f0f21 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -1,5 +1,5 @@ -/* global Popper */ - +import $ from 'jquery' +import Popper from 'popper.js' import Util from './util' @@ -10,7 +10,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Dropdown = (($) => { +const Dropdown = (() => { /** * Check for Popper dependency @@ -445,6 +445,6 @@ const Dropdown = (($) => { return Dropdown -})(jQuery) +})(jQuery, Popper) export default Dropdown diff --git a/js/src/index.js b/js/src/index.js new file mode 100644 index 0000000000..a3858dd24b --- /dev/null +++ b/js/src/index.js @@ -0,0 +1,46 @@ +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.0.0-alpha.6): index.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +if (typeof jQuery === 'undefined') { + throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.') +} + +(() => { + const version = $.fn.jquery.split(' ')[0].split('.') + const min = 3 + const max = 4 + if (version[0] < min || version[0] >= max) { + throw new Error('Bootstrap\'s JavaScript requires at least jQuery v3.0.0 but less than v4.0.0') + } +})(jQuery) + +export { + Util, + Alert, + Button, + Carousel, + Collapse, + Dropdown, + Modal, + Popover, + Scrollspy, + Tab, + Tooltip +} diff --git a/js/src/modal.js b/js/src/modal.js index ab73230c8f..2ff93342d5 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Util from './util' @@ -8,7 +9,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Modal = (($) => { +const Modal = (() => { /** diff --git a/js/src/popover.js b/js/src/popover.js index f5820ecbed..aeccdf7501 100644 --- a/js/src/popover.js +++ b/js/src/popover.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Tooltip from './tooltip' @@ -8,7 +9,7 @@ import Tooltip from './tooltip' * -------------------------------------------------------------------------- */ -const Popover = (($) => { +const Popover = (() => { /** diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 588f652988..70067c0b35 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Util from './util' @@ -8,7 +9,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const ScrollSpy = (($) => { +const ScrollSpy = (() => { /** diff --git a/js/src/tab.js b/js/src/tab.js index c32cd3776f..18af4e7e27 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Util from './util' @@ -8,7 +9,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Tab = (($) => { +const Tab = (() => { /** diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 37573cf498..5dc28ab7ef 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -1,5 +1,5 @@ -/* global Popper */ - +import $ from 'jquery' +import Popper from 'popper.js' import Util from './util' @@ -10,7 +10,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Tooltip = (($) => { +const Tooltip = (() => { /** * Check for Popper dependency @@ -728,6 +728,6 @@ const Tooltip = (($) => { return Tooltip -})(jQuery) +})(jQuery, Popper) export default Tooltip diff --git a/js/src/util.js b/js/src/util.js index cd3f1fb6a2..b18d0f776d 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -1,3 +1,5 @@ +import $ from 'jquery' + /** * -------------------------------------------------------------------------- * Bootstrap (v4.0.0-beta): util.js @@ -5,7 +7,7 @@ * -------------------------------------------------------------------------- */ -const Util = (($) => { +const Util = (() => { /** diff --git a/js/tests/.eslintrc.json b/js/tests/.eslintrc.json index a05a3a3900..b039801444 100644 --- a/js/tests/.eslintrc.json +++ b/js/tests/.eslintrc.json @@ -28,6 +28,7 @@ "global-require": "off", "no-process-env": "off", "no-process-exit": "off", + "no-sync": "off", // Stylistic Issues "brace-style": "off", |