Permalink
Browse files

Comply to the new rules.

  • Loading branch information...
XhmikosR committed Dec 16, 2017
1 parent 6d33650 commit 80d0943b95984bfaf4997d2198d467876d294bd8
@@ -16,7 +16,6 @@
'use strict'
$(function () {
// Tooltip and popover demos
$('.tooltip-demo').tooltip({
selector: '[data-toggle="tooltip"]',
@@ -60,7 +59,7 @@
$('.btn-clipboard')
.tooltip()
.on('mouseleave', function () {
// explicitly hide tooltip, since after clicking it remains
// Explicitly hide tooltip, since after clicking it remains
// focused (as it's a button), so tooltip would otherwise
// remain visible until focus is moved away
$(this).tooltip('hide')
View
@@ -1,6 +1,6 @@
/* eslint no-console:off */
(function setupSW() {
(function () {
'use strict'
if ('serviceWorker' in navigator) {
View
@@ -18,8 +18,13 @@ const sh = require('shelljs')
sh.config.fatal = true
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
RegExp.quote = (string) => string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
RegExp.quoteReplacement = (string) => string.replace(/[$]/g, '$$')
function regExpQuote(string) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
}
function regExpQuoteReplacement(string) {
return string.replace(/[$]/g, '$$')
}
const DRY_RUN = false
@@ -39,13 +44,9 @@ function walkAsync(directory, excludedDirectories, fileCallback, errback) {
process.nextTick(errback, err)
return
}
if (stats.isSymbolicLink()) {
return
}
else if (stats.isDirectory()) {
if (stats.isDirectory()) {
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback)
}
else if (stats.isFile()) {
} else if (stats.isFile()) {
process.nextTick(fileCallback, filepath)
}
})
@@ -54,18 +55,17 @@ function walkAsync(directory, excludedDirectories, fileCallback, errback) {
}
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
original = new RegExp(RegExp.quote(original), 'g')
replacement = RegExp.quoteReplacement(replacement)
const updateFile = !DRY_RUN ? (filepath) => {
original = new RegExp(regExpQuote(original), 'g')
replacement = regExpQuoteReplacement(replacement)
const updateFile = DRY_RUN ? (filepath) => {
if (allowedExtensions.has(path.parse(filepath).ext)) {
sh.sed('-i', original, replacement, filepath)
console.log(`FILE: ${filepath}`)
} else {
console.log(`EXCLUDED:${filepath}`)
}
} : (filepath) => {
if (allowedExtensions.has(path.parse(filepath).ext)) {
console.log(`FILE: ${filepath}`)
}
else {
console.log(`EXCLUDED:${filepath}`)
sh.sed('-i', original, replacement, filepath)
}
}
walkAsync(directory, excludedDirectories, updateFile, (err) => {
View
@@ -55,6 +55,6 @@ files.forEach((file) => {
console.log(`${file.configPropertyName}: ${integrity}`)
sh.sed('-i', new RegExp(`(\\s${file.configPropertyName}:\\s+"|')(\\S+)("|')`), '$1' + integrity + '$3', configFile)
sh.sed('-i', new RegExp(`(\\s${file.configPropertyName}:\\s+"|')(\\S+)("|')`), `$1${integrity}$3`, configFile)
})
})
View
@@ -7,6 +7,8 @@ module.exports = (ctx) => ({
sourcesContent: true
},
plugins: {
autoprefixer: { cascade: false }
autoprefixer: {
cascade: false
}
}
})
View
@@ -3,16 +3,17 @@
const path = require('path')
const babel = require('rollup-plugin-babel')
const resolve = require('rollup-plugin-node-resolve')
const pkg = require(path.resolve(__dirname, '../package.json'))
const BUNDLE = process.env.BUNDLE === 'true'
const year = new Date().getFullYear()
let fileDest = 'bootstrap.js'
const external = ['jquery', 'popper.js']
const external = ['jquery', 'popper.js']
const plugins = [
babel({
exclude: 'node_modules/**', // only transpile our source code
externalHelpersWhitelist: [ // include only required helpers
exclude: 'node_modules/**', // Only transpile our source code
externalHelpersWhitelist: [ // Include only required helpers
'defineProperties',
'createClass',
'inheritsLoose',
@@ -21,13 +22,13 @@ const plugins = [
})
]
const globals = {
jquery: 'jQuery', // ensure we use jQuery which is always available even in noConflict mode
jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
'popper.js': 'Popper'
}
if (BUNDLE) {
fileDest = 'bootstrap.bundle.js'
// remove last entry in external array to bundle Popper
// Remove last entry in external array to bundle Popper
external.pop()
delete globals['popper.js']
plugins.push(resolve())
@@ -91,7 +91,7 @@ jsUnitSaucelabs.on('tunnelCreated', () => {
if (typeof success !== 'undefined') {
const taskIds = success['js tests']
if (!taskIds || !taskIds.length) {
if (!taskIds || taskIds.length === 0) {
throw new Error('Error starting tests through Sauce Labs API')
}
View
@@ -64,5 +64,5 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
shell: true,
stdio: 'inherit'
})
.on('exit', process.exit)
.on('exit', process.exit)
})
View
@@ -4,6 +4,7 @@ const fs = require('fs')
const path = require('path')
const swBuild = require('workbox-build')
const config = require('./workbox.config.json')
const buildPrefix = '_gh_pages/'
const workboxSWSrcPath = require.resolve('workbox-sw')
View
@@ -1,7 +1,6 @@
import $ from 'jquery'
import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-beta.3): alert.js
@@ -10,8 +9,6 @@ import Util from './util'
*/
const Alert = (($) => {
/**
* ------------------------------------------------------------------------
* Constants
@@ -42,28 +39,24 @@ const Alert = (($) => {
SHOW : 'show'
}
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
class Alert {
constructor(element) {
this._element = element
}
// getters
// Getters
static get VERSION() {
return VERSION
}
// public
// Public
close(element) {
element = element || this._element
@@ -83,8 +76,7 @@ const Alert = (($) => {
this._element = null
}
// private
// Private
_getRootElement(element) {
const selector = Util.getSelectorFromElement(element)
@@ -129,8 +121,7 @@ const Alert = (($) => {
.remove()
}
// static
// Static
static _jQueryInterface(config) {
return this.each(function () {
@@ -157,10 +148,8 @@ const Alert = (($) => {
alertInstance.close(this)
}
}
}
/**
* ------------------------------------------------------------------------
* Data Api implementation
@@ -173,7 +162,6 @@ const Alert = (($) => {
Alert._handleDismiss(new Alert())
)
/**
* ------------------------------------------------------------------------
* jQuery
@@ -188,7 +176,6 @@ const Alert = (($) => {
}
return Alert
})($)
export default Alert
View
@@ -8,8 +8,6 @@ import $ from 'jquery'
*/
const Button = (($) => {
/**
* ------------------------------------------------------------------------
* Constants
@@ -39,37 +37,33 @@ const Button = (($) => {
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}`
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
// Getters
static get VERSION() {
return VERSION
}
// public
// Public
toggle() {
let triggerChangeEvent = true
let addAriaPressed = true
const rootElement = $(this._element).closest(
const rootElement = $(this._element).closest(
Selector.DATA_TOGGLE
)[0]
@@ -81,7 +75,6 @@ const Button = (($) => {
if (input.checked &&
$(this._element).hasClass(ClassName.ACTIVE)) {
triggerChangeEvent = false
} else {
const activeElement = $(rootElement).find(Selector.ACTIVE)[0]
@@ -105,7 +98,6 @@ const Button = (($) => {
input.focus()
addAriaPressed = false
}
}
if (addAriaPressed) {
@@ -123,8 +115,7 @@ const Button = (($) => {
this._element = null
}
// static
// Static
static _jQueryInterface(config) {
return this.each(function () {
@@ -140,10 +131,8 @@ const Button = (($) => {
}
})
}
}
/**
* ------------------------------------------------------------------------
* Data Api implementation
@@ -167,22 +156,20 @@ const Button = (($) => {
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))
})
/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/
$.fn[NAME] = Button._jQueryInterface
$.fn[NAME] = Button._jQueryInterface
$.fn[NAME].Constructor = Button
$.fn[NAME].noConflict = function () {
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT
return Button._jQueryInterface
}
return Button
})($)
export default Button
Oops, something went wrong.

0 comments on commit 80d0943

Please sign in to comment.