vertx-howtos-jekyll-theme 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +52 -0
  4. data/_layouts/page.html +61 -0
  5. data/_sass/bootstrap/js/dist/alert.js +199 -0
  6. data/_sass/bootstrap/js/dist/alert.js.map +1 -0
  7. data/_sass/bootstrap/js/dist/button.js +187 -0
  8. data/_sass/bootstrap/js/dist/button.js.map +1 -0
  9. data/_sass/bootstrap/js/dist/carousel.js +666 -0
  10. data/_sass/bootstrap/js/dist/carousel.js.map +1 -0
  11. data/_sass/bootstrap/js/dist/collapse.js +428 -0
  12. data/_sass/bootstrap/js/dist/collapse.js.map +1 -0
  13. data/_sass/bootstrap/js/dist/dropdown.js +591 -0
  14. data/_sass/bootstrap/js/dist/dropdown.js.map +1 -0
  15. data/_sass/bootstrap/js/dist/index.js +23 -0
  16. data/_sass/bootstrap/js/dist/index.js.map +1 -0
  17. data/_sass/bootstrap/js/dist/modal.js +644 -0
  18. data/_sass/bootstrap/js/dist/modal.js.map +1 -0
  19. data/_sass/bootstrap/js/dist/popover.js +261 -0
  20. data/_sass/bootstrap/js/dist/popover.js.map +1 -0
  21. data/_sass/bootstrap/js/dist/scrollspy.js +375 -0
  22. data/_sass/bootstrap/js/dist/scrollspy.js.map +1 -0
  23. data/_sass/bootstrap/js/dist/tab.js +266 -0
  24. data/_sass/bootstrap/js/dist/tab.js.map +1 -0
  25. data/_sass/bootstrap/js/dist/toast.js +278 -0
  26. data/_sass/bootstrap/js/dist/toast.js.map +1 -0
  27. data/_sass/bootstrap/js/dist/tooltip.js +745 -0
  28. data/_sass/bootstrap/js/dist/tooltip.js.map +1 -0
  29. data/_sass/bootstrap/js/dist/util.js +168 -0
  30. data/_sass/bootstrap/js/dist/util.js.map +1 -0
  31. data/_sass/bootstrap/js/src/alert.js +179 -0
  32. data/_sass/bootstrap/js/src/button.js +171 -0
  33. data/_sass/bootstrap/js/src/carousel.js +604 -0
  34. data/_sass/bootstrap/js/src/collapse.js +402 -0
  35. data/_sass/bootstrap/js/src/dropdown.js +538 -0
  36. data/_sass/bootstrap/js/src/index.js +52 -0
  37. data/_sass/bootstrap/js/src/modal.js +587 -0
  38. data/_sass/bootstrap/js/src/popover.js +184 -0
  39. data/_sass/bootstrap/js/src/scrollspy.js +326 -0
  40. data/_sass/bootstrap/js/src/tab.js +257 -0
  41. data/_sass/bootstrap/js/src/toast.js +223 -0
  42. data/_sass/bootstrap/js/src/tooltip.js +735 -0
  43. data/_sass/bootstrap/js/src/util.js +173 -0
  44. data/_sass/bootstrap/js/tests/README.md +69 -0
  45. data/_sass/bootstrap/js/tests/browsers.js +82 -0
  46. data/_sass/bootstrap/js/tests/index.html +145 -0
  47. data/_sass/bootstrap/js/tests/integration/bundle.js +8 -0
  48. data/_sass/bootstrap/js/tests/integration/index.html +66 -0
  49. data/_sass/bootstrap/js/tests/integration/rollup.bundle.js +20 -0
  50. data/_sass/bootstrap/js/tests/karma.conf.js +145 -0
  51. data/_sass/bootstrap/js/tests/unit/.eslintrc.json +40 -0
  52. data/_sass/bootstrap/js/tests/unit/alert.js +123 -0
  53. data/_sass/bootstrap/js/tests/unit/button.js +222 -0
  54. data/_sass/bootstrap/js/tests/unit/carousel.js +1273 -0
  55. data/_sass/bootstrap/js/tests/unit/collapse.js +892 -0
  56. data/_sass/bootstrap/js/tests/unit/dropdown.js +1364 -0
  57. data/_sass/bootstrap/js/tests/unit/modal.js +796 -0
  58. data/_sass/bootstrap/js/tests/unit/popover.js +471 -0
  59. data/_sass/bootstrap/js/tests/unit/scrollspy.js +728 -0
  60. data/_sass/bootstrap/js/tests/unit/tab.js +462 -0
  61. data/_sass/bootstrap/js/tests/unit/toast.js +239 -0
  62. data/_sass/bootstrap/js/tests/unit/tooltip.js +1072 -0
  63. data/_sass/bootstrap/js/tests/unit/util.js +164 -0
  64. data/_sass/bootstrap/js/tests/visual/alert.html +58 -0
  65. data/_sass/bootstrap/js/tests/visual/button.html +51 -0
  66. data/_sass/bootstrap/js/tests/visual/carousel.html +66 -0
  67. data/_sass/bootstrap/js/tests/visual/collapse.html +78 -0
  68. data/_sass/bootstrap/js/tests/visual/dropdown.html +212 -0
  69. data/_sass/bootstrap/js/tests/visual/modal.html +268 -0
  70. data/_sass/bootstrap/js/tests/visual/popover.html +46 -0
  71. data/_sass/bootstrap/js/tests/visual/scrollspy.html +95 -0
  72. data/_sass/bootstrap/js/tests/visual/tab.html +234 -0
  73. data/_sass/bootstrap/js/tests/visual/toast.html +72 -0
  74. data/_sass/bootstrap/js/tests/visual/tooltip.html +106 -0
  75. data/_sass/bootstrap/scss/_alert.scss +51 -0
  76. data/_sass/bootstrap/scss/_badge.scss +53 -0
  77. data/_sass/bootstrap/scss/_breadcrumb.scss +41 -0
  78. data/_sass/bootstrap/scss/_button-group.scss +163 -0
  79. data/_sass/bootstrap/scss/_buttons.scss +140 -0
  80. data/_sass/bootstrap/scss/_card.scss +310 -0
  81. data/_sass/bootstrap/scss/_carousel.scss +198 -0
  82. data/_sass/bootstrap/scss/_close.scss +44 -0
  83. data/_sass/bootstrap/scss/_code.scss +48 -0
  84. data/_sass/bootstrap/scss/_custom-forms.scss +507 -0
  85. data/_sass/bootstrap/scss/_dropdown.scss +191 -0
  86. data/_sass/bootstrap/scss/_forms.scss +334 -0
  87. data/_sass/bootstrap/scss/_functions.scss +86 -0
  88. data/_sass/bootstrap/scss/_grid.scss +52 -0
  89. data/_sass/bootstrap/scss/_images.scss +42 -0
  90. data/_sass/bootstrap/scss/_input-group.scss +193 -0
  91. data/_sass/bootstrap/scss/_jumbotron.scss +16 -0
  92. data/_sass/bootstrap/scss/_list-group.scss +121 -0
  93. data/_sass/bootstrap/scss/_media.scss +8 -0
  94. data/_sass/bootstrap/scss/_mixins.scss +41 -0
  95. data/_sass/bootstrap/scss/_modal.scss +186 -0
  96. data/_sass/bootstrap/scss/_nav.scss +120 -0
  97. data/_sass/bootstrap/scss/_navbar.scss +299 -0
  98. data/_sass/bootstrap/scss/_pagination.scss +78 -0
  99. data/_sass/bootstrap/scss/_popover.scss +183 -0
  100. data/_sass/bootstrap/scss/_print.scss +141 -0
  101. data/_sass/bootstrap/scss/_progress.scss +34 -0
  102. data/_sass/bootstrap/scss/_reboot.scss +462 -0
  103. data/_sass/bootstrap/scss/_root.scss +19 -0
  104. data/_sass/bootstrap/scss/_spinners.scss +53 -0
  105. data/_sass/bootstrap/scss/_tables.scss +187 -0
  106. data/_sass/bootstrap/scss/_toasts.scss +43 -0
  107. data/_sass/bootstrap/scss/_tooltip.scss +115 -0
  108. data/_sass/bootstrap/scss/_transitions.scss +22 -0
  109. data/_sass/bootstrap/scss/_type.scss +125 -0
  110. data/_sass/bootstrap/scss/_utilities.scss +16 -0
  111. data/_sass/bootstrap/scss/_variables.scss +1091 -0
  112. data/_sass/bootstrap/scss/bootstrap-grid.scss +29 -0
  113. data/_sass/bootstrap/scss/bootstrap-reboot.scss +12 -0
  114. data/_sass/bootstrap/scss/bootstrap.scss +44 -0
  115. data/_sass/bootstrap/scss/mixins/_alert.scss +13 -0
  116. data/_sass/bootstrap/scss/mixins/_background-variant.scss +21 -0
  117. data/_sass/bootstrap/scss/mixins/_badge.scss +11 -0
  118. data/_sass/bootstrap/scss/mixins/_border-radius.scss +35 -0
  119. data/_sass/bootstrap/scss/mixins/_box-shadow.scss +5 -0
  120. data/_sass/bootstrap/scss/mixins/_breakpoints.scss +123 -0
  121. data/_sass/bootstrap/scss/mixins/_buttons.scss +111 -0
  122. data/_sass/bootstrap/scss/mixins/_caret.scss +62 -0
  123. data/_sass/bootstrap/scss/mixins/_clearfix.scss +7 -0
  124. data/_sass/bootstrap/scss/mixins/_float.scss +11 -0
  125. data/_sass/bootstrap/scss/mixins/_forms.scss +198 -0
  126. data/_sass/bootstrap/scss/mixins/_gradients.scss +45 -0
  127. data/_sass/bootstrap/scss/mixins/_grid-framework.scss +66 -0
  128. data/_sass/bootstrap/scss/mixins/_grid.scss +51 -0
  129. data/_sass/bootstrap/scss/mixins/_hover.scss +37 -0
  130. data/_sass/bootstrap/scss/mixins/_image.scss +36 -0
  131. data/_sass/bootstrap/scss/mixins/_list-group.scss +21 -0
  132. data/_sass/bootstrap/scss/mixins/_lists.scss +7 -0
  133. data/_sass/bootstrap/scss/mixins/_nav-divider.scss +10 -0
  134. data/_sass/bootstrap/scss/mixins/_pagination.scss +22 -0
  135. data/_sass/bootstrap/scss/mixins/_reset-text.scss +17 -0
  136. data/_sass/bootstrap/scss/mixins/_resize.scss +6 -0
  137. data/_sass/bootstrap/scss/mixins/_screen-reader.scss +33 -0
  138. data/_sass/bootstrap/scss/mixins/_size.scss +6 -0
  139. data/_sass/bootstrap/scss/mixins/_table-row.scss +39 -0
  140. data/_sass/bootstrap/scss/mixins/_text-emphasis.scss +14 -0
  141. data/_sass/bootstrap/scss/mixins/_text-hide.scss +13 -0
  142. data/_sass/bootstrap/scss/mixins/_text-truncate.scss +8 -0
  143. data/_sass/bootstrap/scss/mixins/_transition.scss +16 -0
  144. data/_sass/bootstrap/scss/mixins/_visibility.scss +7 -0
  145. data/_sass/bootstrap/scss/utilities/_align.scss +8 -0
  146. data/_sass/bootstrap/scss/utilities/_background.scss +19 -0
  147. data/_sass/bootstrap/scss/utilities/_borders.scss +63 -0
  148. data/_sass/bootstrap/scss/utilities/_clearfix.scss +3 -0
  149. data/_sass/bootstrap/scss/utilities/_display.scss +38 -0
  150. data/_sass/bootstrap/scss/utilities/_embed.scss +39 -0
  151. data/_sass/bootstrap/scss/utilities/_flex.scss +51 -0
  152. data/_sass/bootstrap/scss/utilities/_float.scss +9 -0
  153. data/_sass/bootstrap/scss/utilities/_overflow.scss +5 -0
  154. data/_sass/bootstrap/scss/utilities/_position.scss +32 -0
  155. data/_sass/bootstrap/scss/utilities/_screenreaders.scss +11 -0
  156. data/_sass/bootstrap/scss/utilities/_shadows.scss +6 -0
  157. data/_sass/bootstrap/scss/utilities/_sizing.scss +20 -0
  158. data/_sass/bootstrap/scss/utilities/_spacing.scss +73 -0
  159. data/_sass/bootstrap/scss/utilities/_text.scss +67 -0
  160. data/_sass/bootstrap/scss/utilities/_visibility.scss +11 -0
  161. data/_sass/custom.scss +1 -0
  162. data/assets/css/style.scss +65 -0
  163. data/assets/images/vertx-square.svg +1 -0
  164. metadata +248 -0
@@ -0,0 +1,8 @@
1
+ import 'popper.js'
2
+ import $ from 'jquery'
3
+ import bootstrap from '../../../dist/js/bootstrap'
4
+
5
+ $(() => {
6
+ $('#resultUID').text(bootstrap.Util.getUID('bs'))
7
+ $('[data-toggle="tooltip"]').tooltip()
8
+ })
@@ -0,0 +1,66 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <!-- Required meta tags -->
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7
+
8
+ <!-- Bootstrap CSS -->
9
+ <link rel="stylesheet" href="../../../dist/css/bootstrap.min.css">
10
+
11
+ <title>Hello, world!</title>
12
+ </head>
13
+ <body>
14
+ <div class="container">
15
+ <h1>Hello, world!</h1>
16
+ <div class="col-12">
17
+ <div class="mt-5 mb-3">
18
+ <span>Util.getUID: </span>
19
+ <span id="resultUID"></span>
20
+ </div>
21
+ <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top">
22
+ Tooltip on top
23
+ </button>
24
+ <div id="carouselExampleCaptions" class="carousel slide mt-2" data-ride="carousel">
25
+ <ol class="carousel-indicators">
26
+ <li data-target="#carouselExampleCaptions" data-slide-to="0"></li>
27
+ <li data-target="#carouselExampleCaptions" data-slide-to="1" class="active"></li>
28
+ <li data-target="#carouselExampleCaptions" data-slide-to="2"></li>
29
+ </ol>
30
+ <div class="carousel-inner">
31
+ <div class="carousel-item">
32
+ <img class="d-block w-100" data-src="holder.js/800x400?auto=yes&amp;bg=777&amp;fg=555&amp;text=First slide" alt="First slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826cb%20text%20%7B%20fill%3A%23555%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826cb%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22285.921875%22%20y%3D%22217.7%22%3EFirst%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
33
+ <div class="carousel-caption d-none d-md-block">
34
+ <h5>First slide label</h5>
35
+ <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
36
+ </div>
37
+ </div>
38
+ <div class="carousel-item active">
39
+ <img class="d-block w-100" data-src="holder.js/800x400?auto=yes&amp;bg=666&amp;fg=444&amp;text=Second slide" alt="Second slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826ce%20text%20%7B%20fill%3A%23444%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826ce%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23666%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22247.3203125%22%20y%3D%22217.7%22%3ESecond%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
40
+ <div class="carousel-caption d-none d-md-block">
41
+ <h5>Second slide label</h5>
42
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
43
+ </div>
44
+ </div>
45
+ <div class="carousel-item">
46
+ <img class="d-block w-100" data-src="holder.js/800x400?auto=yes&amp;bg=555&amp;fg=333&amp;text=Third slide" alt="Third slide [800x400]" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_167a6f826cf%20text%20%7B%20fill%3A%23333%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_167a6f826cf%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23555%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22277%22%20y%3D%22217.7%22%3EThird%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
47
+ <div class="carousel-caption d-none d-md-block">
48
+ <h5>Third slide label</h5>
49
+ <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ <a class="carousel-control-prev" href="#carouselExampleCaptions" role="button" data-slide="prev">
54
+ <span class="carousel-control-prev-icon" aria-hidden="true"></span>
55
+ <span class="sr-only">Previous</span>
56
+ </a>
57
+ <a class="carousel-control-next" href="#carouselExampleCaptions" role="button" data-slide="next">
58
+ <span class="carousel-control-next-icon" aria-hidden="true"></span>
59
+ <span class="sr-only">Next</span>
60
+ </a>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <script src="../../coverage/bundle.js"></script>
65
+ </body>
66
+ </html>
@@ -0,0 +1,20 @@
1
+ /* eslint-env node */
2
+
3
+ const resolve = require('rollup-plugin-node-resolve')
4
+ const commonjs = require('rollup-plugin-commonjs')
5
+ const babel = require('rollup-plugin-babel')
6
+
7
+ module.exports = {
8
+ input: 'js/tests/integration/bundle.js',
9
+ output: {
10
+ file: 'js/coverage/bundle.js',
11
+ format: 'iife'
12
+ },
13
+ plugins: [
14
+ resolve(),
15
+ commonjs(),
16
+ babel({
17
+ exclude: 'node_modules/**'
18
+ })
19
+ ]
20
+ }
@@ -0,0 +1,145 @@
1
+ /* eslint-env node */
2
+ /* eslint no-process-env: 0 */
3
+
4
+ const ip = require('ip')
5
+ const pkg = require('../../package.json')
6
+ const {
7
+ browsers,
8
+ browsersKeys
9
+ } = require('./browsers')
10
+ const path = require('path')
11
+ const jsCoveragePath = path.resolve(__dirname, '../coverage')
12
+
13
+ const jqueryFile = process.env.USE_OLD_JQUERY ? 'https://code.jquery.com/jquery-1.9.1.min.js' : `site/docs/${pkg.version_short}/assets/js/vendor/jquery-slim.min.js`
14
+ const bundle = process.env.BUNDLE === 'true'
15
+ const browserStack = process.env.BROWSER === 'true'
16
+
17
+ const frameworks = [
18
+ 'qunit',
19
+ 'sinon'
20
+ ]
21
+
22
+ const plugins = [
23
+ 'karma-qunit',
24
+ 'karma-sinon'
25
+ ]
26
+
27
+ const reporters = ['dots']
28
+
29
+ const detectBrowsers = {
30
+ usePhantomJS: false,
31
+ postDetection(availableBrowser) {
32
+ if (typeof process.env.TRAVIS_JOB_ID !== 'undefined' || availableBrowser.includes('Chrome')) {
33
+ return ['ChromeHeadless']
34
+ }
35
+
36
+ if (availableBrowser.includes('Firefox')) {
37
+ return ['FirefoxHeadless']
38
+ }
39
+
40
+ throw new Error('Please install Firefox or Chrome')
41
+ }
42
+ }
43
+
44
+ const customLaunchers = {
45
+ FirefoxHeadless: {
46
+ base: 'Firefox',
47
+ flags: ['-headless']
48
+ }
49
+ }
50
+
51
+ let files = [
52
+ 'node_modules/popper.js/dist/umd/popper.min.js',
53
+ 'node_modules/hammer-simulator/index.js'
54
+ ]
55
+
56
+ const conf = {
57
+ basePath: '../..',
58
+ port: 9876,
59
+ colors: true,
60
+ autoWatch: false,
61
+ singleRun: true,
62
+ concurrency: Infinity,
63
+ client: {
64
+ qunit: {
65
+ showUI: true
66
+ }
67
+ }
68
+ }
69
+
70
+ if (bundle) {
71
+ frameworks.push('detectBrowsers')
72
+ plugins.push(
73
+ 'karma-chrome-launcher',
74
+ 'karma-firefox-launcher',
75
+ 'karma-detect-browsers'
76
+ )
77
+ conf.customLaunchers = customLaunchers
78
+ conf.detectBrowsers = detectBrowsers
79
+ files = files.concat([
80
+ jqueryFile,
81
+ 'dist/js/bootstrap.js'
82
+ ])
83
+ } else if (browserStack) {
84
+ conf.hostname = ip.address()
85
+ conf.browserStack = {
86
+ username: process.env.BROWSER_STACK_USERNAME,
87
+ accessKey: process.env.BROWSER_STACK_ACCESS_KEY,
88
+ build: `bootstrap-${new Date().toISOString()}`,
89
+ project: 'Bootstrap',
90
+ retryLimit: 2
91
+ }
92
+ plugins.push('karma-browserstack-launcher')
93
+ conf.customLaunchers = browsers
94
+ conf.browsers = browsersKeys
95
+ reporters.push('BrowserStack')
96
+ files = files.concat([
97
+ `site/docs/${pkg.version_short}/assets/js/vendor/jquery-slim.min.js`,
98
+ 'js/dist/util.js',
99
+ 'js/dist/tooltip.js',
100
+ 'js/dist/!(util|index|tooltip).js' // include all of our js/dist files except util.js, index.js and tooltip.js
101
+ ])
102
+ } else {
103
+ frameworks.push('detectBrowsers')
104
+ plugins.push(
105
+ 'karma-chrome-launcher',
106
+ 'karma-firefox-launcher',
107
+ 'karma-detect-browsers',
108
+ 'karma-coverage-istanbul-reporter'
109
+ )
110
+ files = files.concat([
111
+ jqueryFile,
112
+ 'js/coverage/dist/util.js',
113
+ 'js/coverage/dist/tooltip.js',
114
+ 'js/coverage/dist/!(util|index|tooltip).js' // include all of our js/dist files except util.js, index.js and tooltip.js
115
+ ])
116
+ reporters.push('coverage-istanbul')
117
+ conf.customLaunchers = customLaunchers
118
+ conf.detectBrowsers = detectBrowsers
119
+ conf.coverageIstanbulReporter = {
120
+ dir: jsCoveragePath,
121
+ reports: ['lcov', 'text-summary'],
122
+ thresholds: {
123
+ emitWarning: false,
124
+ global: {
125
+ statements: 90,
126
+ branches: 86,
127
+ functions: 89,
128
+ lines: 90
129
+ }
130
+ }
131
+ }
132
+ }
133
+
134
+ files.push('js/tests/unit/*.js')
135
+
136
+ conf.frameworks = frameworks
137
+ conf.plugins = plugins
138
+ conf.reporters = reporters
139
+ conf.files = files
140
+
141
+ module.exports = (karmaConfig) => {
142
+ // possible values: karmaConfig.LOG_DISABLE || karmaConfig.LOG_ERROR || karmaConfig.LOG_WARN || karmaConfig.LOG_INFO || karmaConfig.LOG_DEBUG
143
+ conf.logLevel = karmaConfig.LOG_ERROR || karmaConfig.LOG_WARN
144
+ karmaConfig.set(conf)
145
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "env": {
3
+ "es6": false,
4
+ "jquery": true,
5
+ "qunit": true
6
+ },
7
+ "globals": {
8
+ "bootstrap": false,
9
+ "sinon": false,
10
+ "Util": false,
11
+ "Alert": false,
12
+ "Button": false,
13
+ "Carousel": false,
14
+ "Simulator": false,
15
+ "Toast": false
16
+ },
17
+ "parserOptions": {
18
+ "ecmaVersion": 5,
19
+ "sourceType": "script"
20
+ },
21
+ "extends": "../../../.eslintrc.json",
22
+ "rules": {
23
+ "no-console": "error",
24
+ // Best Practices
25
+ "consistent-return": "off",
26
+ "no-magic-numbers": "off",
27
+ "vars-on-top": "off",
28
+
29
+ // Stylistic Issues
30
+ "func-style": "off",
31
+ "spaced-comment": "off",
32
+
33
+ // ECMAScript 6
34
+ "no-var": "off",
35
+ "object-shorthand": "off",
36
+ "prefer-arrow-callback": "off",
37
+ "prefer-template": "off",
38
+ "prefer-rest-params": "off"
39
+ }
40
+ }
@@ -0,0 +1,123 @@
1
+ $(function () {
2
+ 'use strict'
3
+
4
+ QUnit.module('alert plugin')
5
+
6
+ QUnit.test('should be defined on jquery object', function (assert) {
7
+ assert.expect(1)
8
+ assert.ok($(document.body).alert, 'alert method is defined')
9
+ })
10
+
11
+ QUnit.module('alert', {
12
+ beforeEach: function () {
13
+ // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode
14
+ $.fn.bootstrapAlert = $.fn.alert.noConflict()
15
+ },
16
+ afterEach: function () {
17
+ $.fn.alert = $.fn.bootstrapAlert
18
+ delete $.fn.bootstrapAlert
19
+ $('#qunit-fixture').html('')
20
+ }
21
+ })
22
+
23
+ QUnit.test('should provide no conflict', function (assert) {
24
+ assert.expect(1)
25
+ assert.strictEqual(typeof $.fn.alert, 'undefined', 'alert was set back to undefined (org value)')
26
+ })
27
+
28
+ QUnit.test('should return jquery collection containing the element', function (assert) {
29
+ assert.expect(2)
30
+ var $el = $('<div/>')
31
+ var $alert = $el.bootstrapAlert()
32
+ assert.ok($alert instanceof $, 'returns jquery collection')
33
+ assert.strictEqual($alert[0], $el[0], 'collection contains element')
34
+ })
35
+
36
+ QUnit.test('should fade element out on clicking .close', function (assert) {
37
+ assert.expect(1)
38
+ var alertHTML = '<div class="alert alert-danger fade show">' +
39
+ '<a class="close" href="#" data-dismiss="alert">×</a>' +
40
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' +
41
+ '</div>'
42
+
43
+ var $alert = $(alertHTML).bootstrapAlert().appendTo($('#qunit-fixture'))
44
+
45
+ $alert.find('.close').trigger('click')
46
+
47
+ assert.strictEqual($alert.hasClass('show'), false, 'remove .show class on .close click')
48
+ })
49
+
50
+ QUnit.test('should remove element when clicking .close', function (assert) {
51
+ assert.expect(2)
52
+ var done = assert.async()
53
+ var alertHTML = '<div class="alert alert-danger fade show">' +
54
+ '<a class="close" href="#" data-dismiss="alert">×</a>' +
55
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' +
56
+ '</div>'
57
+ var $alert = $(alertHTML).appendTo('#qunit-fixture').bootstrapAlert()
58
+
59
+ assert.notEqual($('#qunit-fixture').find('.alert').length, 0, 'element added to dom')
60
+
61
+ $alert
62
+ .one('closed.bs.alert', function () {
63
+ assert.strictEqual($('#qunit-fixture').find('.alert').length, 0, 'element removed from dom')
64
+ done()
65
+ })
66
+ .find('.close')
67
+ .trigger('click')
68
+ })
69
+
70
+ QUnit.test('should not fire closed when close is prevented', function (assert) {
71
+ assert.expect(1)
72
+ var done = assert.async()
73
+ $('<div class="alert"/>')
74
+ .on('close.bs.alert', function (e) {
75
+ e.preventDefault()
76
+ assert.ok(true, 'close event fired')
77
+ done()
78
+ })
79
+ .on('closed.bs.alert', function () {
80
+ assert.ok(false, 'closed event fired')
81
+ })
82
+ .bootstrapAlert('close')
83
+ })
84
+
85
+ QUnit.test('close should use internal _element if no element provided', function (assert) {
86
+ assert.expect(1)
87
+
88
+ var done = assert.async()
89
+ var $el = $('<div/>')
90
+ var $alert = $el.bootstrapAlert()
91
+ var alertInstance = $alert.data('bs.alert')
92
+
93
+ $alert.one('closed.bs.alert', function () {
94
+ assert.ok('alert closed')
95
+ done()
96
+ })
97
+
98
+ alertInstance.close()
99
+ })
100
+
101
+ QUnit.test('dispose should remove data and the element', function (assert) {
102
+ assert.expect(2)
103
+
104
+ var $el = $('<div/>')
105
+ var $alert = $el.bootstrapAlert()
106
+
107
+ assert.ok(typeof $alert.data('bs.alert') !== 'undefined')
108
+
109
+ $alert.data('bs.alert').dispose()
110
+
111
+ assert.ok(typeof $alert.data('bs.button') === 'undefined')
112
+ })
113
+
114
+ QUnit.test('should return alert version', function (assert) {
115
+ assert.expect(1)
116
+
117
+ if (typeof Alert !== 'undefined') {
118
+ assert.ok(typeof Alert.VERSION === 'string')
119
+ } else {
120
+ assert.notOk()
121
+ }
122
+ })
123
+ })
@@ -0,0 +1,222 @@
1
+ $(function () {
2
+ 'use strict'
3
+
4
+ QUnit.module('button plugin')
5
+
6
+ QUnit.test('should be defined on jquery object', function (assert) {
7
+ assert.expect(1)
8
+ assert.ok($(document.body).button, 'button method is defined')
9
+ })
10
+
11
+ QUnit.module('button', {
12
+ beforeEach: function () {
13
+ // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode
14
+ $.fn.bootstrapButton = $.fn.button.noConflict()
15
+ },
16
+ afterEach: function () {
17
+ $.fn.button = $.fn.bootstrapButton
18
+ delete $.fn.bootstrapButton
19
+ $('#qunit-fixture').html('')
20
+ }
21
+ })
22
+
23
+ QUnit.test('should provide no conflict', function (assert) {
24
+ assert.expect(1)
25
+ assert.strictEqual(typeof $.fn.button, 'undefined', 'button was set back to undefined (org value)')
26
+ })
27
+
28
+ QUnit.test('should return jquery collection containing the element', function (assert) {
29
+ assert.expect(2)
30
+ var $el = $('<div/>')
31
+ var $button = $el.bootstrapButton()
32
+ assert.ok($button instanceof $, 'returns jquery collection')
33
+ assert.strictEqual($button[0], $el[0], 'collection contains element')
34
+ })
35
+
36
+ QUnit.test('should toggle active', function (assert) {
37
+ assert.expect(2)
38
+ var $btn = $('<button class="btn" data-toggle="button">mdo</button>')
39
+ assert.ok(!$btn.hasClass('active'), 'btn does not have active class')
40
+ $btn.bootstrapButton('toggle')
41
+ assert.ok($btn.hasClass('active'), 'btn has class active')
42
+ })
43
+
44
+ QUnit.test('should toggle active when btn children are clicked', function (assert) {
45
+ assert.expect(2)
46
+ var $btn = $('<button class="btn" data-toggle="button">mdo</button>')
47
+ var $inner = $('<i/>')
48
+ $btn
49
+ .append($inner)
50
+ .appendTo('#qunit-fixture')
51
+ assert.ok(!$btn.hasClass('active'), 'btn does not have active class')
52
+ $inner.trigger('click')
53
+ assert.ok($btn.hasClass('active'), 'btn has class active')
54
+ })
55
+
56
+ QUnit.test('should toggle aria-pressed', function (assert) {
57
+ assert.expect(2)
58
+ var $btn = $('<button class="btn" data-toggle="button" aria-pressed="false">redux</button>')
59
+ assert.strictEqual($btn.attr('aria-pressed'), 'false', 'btn aria-pressed state is false')
60
+ $btn.bootstrapButton('toggle')
61
+ assert.strictEqual($btn.attr('aria-pressed'), 'true', 'btn aria-pressed state is true')
62
+ })
63
+
64
+ QUnit.test('should toggle aria-pressed on buttons with container', function (assert) {
65
+ assert.expect(1)
66
+ var groupHTML = '<div class="btn-group" data-toggle="buttons">' +
67
+ '<button id="btn1" class="btn btn-secondary" type="button">One</button>' +
68
+ '<button class="btn btn-secondary" type="button">Two</button>' +
69
+ '</div>'
70
+ $('#qunit-fixture').append(groupHTML)
71
+ $('#btn1').bootstrapButton('toggle')
72
+ assert.strictEqual($('#btn1').attr('aria-pressed'), 'true')
73
+ })
74
+
75
+ QUnit.test('should toggle aria-pressed when btn children are clicked', function (assert) {
76
+ assert.expect(2)
77
+ var $btn = $('<button class="btn" data-toggle="button" aria-pressed="false">redux</button>')
78
+ var $inner = $('<i/>')
79
+ $btn
80
+ .append($inner)
81
+ .appendTo('#qunit-fixture')
82
+ assert.strictEqual($btn.attr('aria-pressed'), 'false', 'btn aria-pressed state is false')
83
+ $inner.trigger('click')
84
+ assert.strictEqual($btn.attr('aria-pressed'), 'true', 'btn aria-pressed state is true')
85
+ })
86
+
87
+ QUnit.test('should trigger input change event when toggled button has input field', function (assert) {
88
+ assert.expect(1)
89
+ var done = assert.async()
90
+
91
+ var groupHTML = '<div class="btn-group" data-toggle="buttons">' +
92
+ '<label class="btn btn-primary">' +
93
+ '<input type="radio" id="radio" autocomplete="off">Radio' +
94
+ '</label>' +
95
+ '</div>'
96
+ var $group = $(groupHTML).appendTo('#qunit-fixture')
97
+
98
+ $group.find('input').on('change', function (e) {
99
+ e.preventDefault()
100
+ assert.ok(true, 'change event fired')
101
+ done()
102
+ })
103
+
104
+ $group.find('label').trigger('click')
105
+ })
106
+
107
+ QUnit.test('should check for closest matching toggle', function (assert) {
108
+ assert.expect(12)
109
+ var groupHTML = '<div class="btn-group" data-toggle="buttons">' +
110
+ '<label class="btn btn-primary active">' +
111
+ '<input type="radio" name="options" id="option1" checked="true"> Option 1' +
112
+ '</label>' +
113
+ '<label class="btn btn-primary">' +
114
+ '<input type="radio" name="options" id="option2"> Option 2' +
115
+ '</label>' +
116
+ '<label class="btn btn-primary">' +
117
+ '<input type="radio" name="options" id="option3"> Option 3' +
118
+ '</label>' +
119
+ '</div>'
120
+ var $group = $(groupHTML).appendTo('#qunit-fixture')
121
+
122
+ var $btn1 = $group.children().eq(0)
123
+ var $btn2 = $group.children().eq(1)
124
+
125
+ assert.ok($btn1.hasClass('active'), 'btn1 has active class')
126
+ assert.ok($btn1.find('input').prop('checked'), 'btn1 is checked')
127
+ assert.ok(!$btn2.hasClass('active'), 'btn2 does not have active class')
128
+ assert.ok(!$btn2.find('input').prop('checked'), 'btn2 is not checked')
129
+ $btn2.find('input').trigger('click')
130
+ assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class')
131
+ assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked')
132
+ assert.ok($btn2.hasClass('active'), 'btn2 has active class')
133
+ assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked')
134
+
135
+ $btn2.find('input').trigger('click') // Clicking an already checked radio should not un-check it
136
+ assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class')
137
+ assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked')
138
+ assert.ok($btn2.hasClass('active'), 'btn2 has active class')
139
+ assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked')
140
+ })
141
+
142
+ QUnit.test('should only toggle selectable inputs', function (assert) {
143
+ assert.expect(6)
144
+ var groupHTML = '<div class="btn-group" data-toggle="buttons">' +
145
+ '<label class="btn btn-primary active">' +
146
+ '<input type="hidden" name="option1" id="option1-default" value="false">' +
147
+ '<input type="checkbox" name="option1" id="option1" checked="true"> Option 1' +
148
+ '</label>' +
149
+ '</div>'
150
+ var $group = $(groupHTML).appendTo('#qunit-fixture')
151
+
152
+ var $btn = $group.children().eq(0)
153
+ var $hidden = $btn.find('input#option1-default')
154
+ var $cb = $btn.find('input#option1')
155
+
156
+ assert.ok($btn.hasClass('active'), 'btn has active class')
157
+ assert.ok($cb.prop('checked'), 'btn is checked')
158
+ assert.ok(!$hidden.prop('checked'), 'hidden is not checked')
159
+ $btn.trigger('click')
160
+ assert.ok(!$btn.hasClass('active'), 'btn does not have active class')
161
+ assert.ok(!$cb.prop('checked'), 'btn is not checked')
162
+ assert.ok(!$hidden.prop('checked'), 'hidden is not checked') // should not be changed
163
+ })
164
+
165
+ QUnit.test('should not add aria-pressed on labels for radio/checkbox inputs in a data-toggle="buttons" group', function (assert) {
166
+ assert.expect(2)
167
+ var groupHTML = '<div class="btn-group" data-toggle="buttons">' +
168
+ '<label class="btn btn-primary"><input type="checkbox" autocomplete="off"> Checkbox</label>' +
169
+ '<label class="btn btn-primary"><input type="radio" name="options" autocomplete="off"> Radio</label>' +
170
+ '</div>'
171
+ var $group = $(groupHTML).appendTo('#qunit-fixture')
172
+
173
+ var $btn1 = $group.children().eq(0)
174
+ var $btn2 = $group.children().eq(1)
175
+
176
+ $btn1.find('input').trigger('click')
177
+ assert.ok($btn1.is(':not([aria-pressed])'), 'label for nested checkbox input has not been given an aria-pressed attribute')
178
+
179
+ $btn2.find('input').trigger('click')
180
+ assert.ok($btn2.is(':not([aria-pressed])'), 'label for nested radio input has not been given an aria-pressed attribute')
181
+ })
182
+
183
+ QUnit.test('should handle disabled attribute on non-button elements', function (assert) {
184
+ assert.expect(2)
185
+ var groupHTML = '<div class="btn-group disabled" data-toggle="buttons" aria-disabled="true" disabled>' +
186
+ '<label class="btn btn-danger disabled" aria-disabled="true" disabled>' +
187
+ '<input type="checkbox" aria-disabled="true" autocomplete="off" disabled class="disabled"/>' +
188
+ '</label>' +
189
+ '</div>'
190
+ var $group = $(groupHTML).appendTo('#qunit-fixture')
191
+
192
+ var $btn = $group.children().eq(0)
193
+ var $input = $btn.children().eq(0)
194
+
195
+ $btn.trigger('click')
196
+ assert.ok($btn.is(':not(.active)'), 'button did not become active')
197
+ assert.ok(!$input.is(':checked'), 'checkbox did not get checked')
198
+ })
199
+
200
+ QUnit.test('dispose should remove data and the element', function (assert) {
201
+ assert.expect(2)
202
+
203
+ var $el = $('<div/>')
204
+ var $button = $el.bootstrapButton()
205
+
206
+ assert.ok(typeof $button.data('bs.button') !== 'undefined')
207
+
208
+ $button.data('bs.button').dispose()
209
+
210
+ assert.ok(typeof $button.data('bs.button') === 'undefined')
211
+ })
212
+
213
+ QUnit.test('should return button version', function (assert) {
214
+ assert.expect(1)
215
+
216
+ if (typeof Button !== 'undefined') {
217
+ assert.ok(typeof Button.VERSION === 'string')
218
+ } else {
219
+ assert.notOk()
220
+ }
221
+ })
222
+ })