Commit 280f6c5d authored by XhmikosR's avatar XhmikosR
Browse files

Merge pull request #16392 from twbs/jscs

Update JSCS rules
parents aa2c5b56 5ae00f2e
main cleanup-floating-forms cssvar-function dependabot/npm_and_yarn/stylelint-and-stylelint-config-twbs-bootstrap-15.3.0 extend-snippets feat/data-target floating-always-visible floating-labels-icons fod-main-banner form-controls-with-icons github/fork/719media/patch-13 github/fork/719media/patch-14 github/fork/719media/patch-9 github/fork/ChellyAhmed/fix-typo-reboot.md github/fork/ChellyAhmed/offcanvas-scroll-back github/fork/CtrlAltLilith/main github/fork/Elysiome/offcanvas-optional-window-resizing github/fork/JanSargsyan/main github/fork/LunicLynx/support-different-line-height-for-buttons github/fork/Psixodelik/main github/fork/Ronid1/ronid1/offcanvas_static_backdrop github/fork/RyanBerliner/tooltip-accessibility github/fork/SantiagoPVazquez/Feature-default-border-bottom-to-dropdown-item github/fork/Sir-Genius/utils github/fork/Sumit-Singh-8/main github/fork/Viktor-VERA2020/offcanvas-slide github/fork/Zivangu9/input-group-for-form-control-plaintext github/fork/alpadev/alpadev/call-dispose-on-component-reinstantiation github/fork/astagi/fix/tree-shake-modules github/fork/compnerd/dark-accordion-icon github/fork/derSascha/dropdown-dont-close-on-input-click github/fork/dev-ph1l/main github/fork/donquixote/issue-33861-utl-mixin github/fork/florianlacreuse/mixin-make-row-gutter-y github/fork/gregorw/main github/fork/iteggmbh/transitionend-dispose-race github/fork/jdelStrother/patch-1 github/fork/jonnysp/form-floating github/fork/jonnysp/independent-offcanvas github/fork/jonnysp/theme-dark-on-card-and-modal-fix github/fork/josefdlange/floating-label-placeholder-opacity github/fork/julien-deramond/enhance-change-version.js github/fork/julien-deramond/main-jd-fix-offset-content github/fork/julien-deramond/main-jd-issue-with-utitlies github/fork/julien-deramond/main-xmr-pa11y-ci-jd-add-hideElements github/fork/kyletsang/fix-tooltip-padding github/fork/lacutah/CheckboxCenteringDocumentation github/fork/lekoala/patch-3 github/fork/louismaximepiton/main-kld-lmp-collapse-proposal github/fork/louismaximepiton/main-lmp-card-inner-border-radius-fix github/fork/louismaximepiton/main-lmp-carousel-multiple-images github/fork/louismaximepiton/main-lmp-css-var-init github/fork/louismaximepiton/main-lmp-disabled-floating-label-fix github/fork/louismaximepiton/main-lmp-input-range-fix github/fork/louismaximepiton/main-lmp-shift-color github/fork/louismaximepiton/main-lmp-table-active-tr-fix github/fork/maciek-szn/switch github/fork/michael-roth/feature/19964-multiple-tab-targets github/fork/mistic100/dom-utils github/fork/nkdas91/accordion github/fork/nstungcom/fix-missing-modal-open-class github/fork/oraliahdz/animation-utilities github/fork/pine3ree/patch-7 github/fork/pouwerkerk/unindent-scss-docs-shortcode github/fork/smares/smares-no-scolling-on-modal-close github/fork/tgm-git/patch-1 gs-forms gs-toasts-with-animated-progress-bar gs/add-history-helper gs/change-version-dir-on-docs gs/data-must-set-onlu-one-instance gs/docs/fix-drop-down-error gs/event-handler-2 gs/make-docs-js-build gs/make-simple-attribute-toggler gs/popover-fix-doc gs/provide-steConfig-method gs/scrollspy-smoothscroll-option-use-browser-history gs/streamline-jqueryInterface gs/support-drop-down-in-navbar gs/test-js-generic-trigger gs/try-web-components gs/tweak-collapse-js-selector gs/use-event-handler-in-cocmponent gs/use-rollup-replace-for-version jo-docs-thanks-page jo-ssr-friendly logical-props-spacing-utils main-fod-disabled-form-check-label main-fod-nested-accordion main-fod-simpler-table-structure main-fod-table-separator main-fod-utilities-contrast main-jd-abbr-title main-jd-add-chips main-jd-add-doc-for-sass-custom-colors main-jd-add-enable-host-to-handle-web-components main-jd-browserstack-fine-tune main-jd-browserstack-updates main-jd-docs-consistent-usage-of-css-sections-step-2 main-jd-fix-docs-headers-in-white main-jd-fix-highlight-docs-border-radius main-jd-fix-placeholder-color-background-params-for-img-markup main-jd-glossary-experiment main-jd-postcss-drop-empty-css-vars main-jd-proto-doc-astro main-jd-skip-navigation-component main-jd-stackblitz-for-examples main-jd-upgrade-browserlistrc main-jd-use-host main-lmp-dark-theme-customization main-lmp-handle-scroll-target main-lmp-tab-fix main-mc-opensearch main-xmr-bundlewatch-action main-xmr-eslint-plugin-compat main-xmr-hugo-docs-vendor main-xmr-hugo-rm-ver main-xmr-linkinator-prod main-xmr-min-mangle main-xmr-pa11y-ci more-darkmode-examples nested-dropdowns patrickhlauke-issue37428 patrickhlauke-use-of-color-tweaks pr/34102 pr/37590 previous-next-docs-links sticky-thead utilities-functions-mixin v3-dev v4-dev v4-dev-dropdown-hide-method v530-dev v6-postcss-custom-media v6-spinner-dots v6/gs/use-floating-ui-in-place-of-popper xmr/dev xmr/docs-png xmr/docs-svgs xmr/hugo-reorg-files xmr/js-2 xmr/markdownlint xmr/prepare-530-alpha2 xmr/xo v5.3.0-alpha1 v5.2.3 v5.2.2 v5.2.1 v5.2.0 v5.2.0-beta1 v5.1.3 v5.1.2 v5.1.1 v5.1.0 v5.0.2 v5.0.1 v5.0.0 v5.0.0-beta3 v5.0.0-beta2 v5.0.0-beta1 v5.0.0-alpha3 v5.0.0-alpha2 v5.0.0-alpha1 v4.6.2 v4.6.1 v4.6.0 v4.5.3 v4.5.2 v4.5.1 v4.5.0 v4.4.1 v4.4.0 v4.3.1 v4.3.0 v4.2.1 v4.2.0 v4.1.3 v4.1.2 v4.1.1 v4.1.0 v4.0.0 v4.0.0-beta.3 v4.0.0-beta.2 v4.0.0-beta v4.0.0-alpha.6 v4.0.0-alpha.5 v4.0.0-alpha.4 v4.0.0-alpha.3 v4.0.0-alpha.2 v4.0.0-alpha v3.4.1 v3.4.0 v3.3.7 v3.3.6 v3.3.5
4 merge requests!28721Hot test,!16605Test pull please ignore,!22103test,!25326Adjust examples
Showing with 89 additions and 88 deletions
+89 -88
......@@ -2029,7 +2029,9 @@ if (typeof jQuery === 'undefined') {
// ====================
var Tab = function (element) {
// jscs:disable requireDollarBeforejQueryAssignment
this.element = $(element)
// jscs:enable requireDollarBeforejQueryAssignment
}
Tab.VERSION = '3.3.4'
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014 Twitter, Inc.
* Copyright 2014-2015 Twitter, Inc.
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
......@@ -10,6 +10,7 @@
(function () {
'use strict';
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style')
msViewportStyle.appendChild(
......@@ -19,4 +20,5 @@
)
document.querySelector('head').appendChild(msViewportStyle)
}
})();
This diff is collapsed.
......@@ -58,12 +58,12 @@
// theme toggler
;(function () {
var stylesheetLink = $('#bs-theme-stylesheet')
var themeBtn = $('.bs-docs-theme-toggle')
var $stylesheetLink = $('#bs-theme-stylesheet')
var $themeBtn = $('.bs-docs-theme-toggle')
var activateTheme = function () {
stylesheetLink.attr('href', stylesheetLink.attr('data-href'))
themeBtn.text('Disable theme preview')
$stylesheetLink.attr('href', $stylesheetLink.attr('data-href'))
$themeBtn.text('Disable theme preview')
localStorage.setItem('previewTheme', true)
}
......@@ -71,13 +71,13 @@
activateTheme()
}
themeBtn.click(function () {
var href = stylesheetLink.attr('href')
$themeBtn.click(function () {
var href = $stylesheetLink.attr('href')
if (!href || href.indexOf('data') === 0) {
activateTheme()
} else {
stylesheetLink.attr('href', '')
themeBtn.text('Preview theme')
$stylesheetLink.attr('href', '')
$themeBtn.text('Preview theme')
localStorage.removeItem('previewTheme')
}
})
......@@ -102,22 +102,22 @@
// Button state demo
$('#loading-example-btn').on('click', function () {
var btn = $(this)
btn.button('loading')
var $btn = $(this)
$btn.button('loading')
setTimeout(function () {
btn.button('reset')
$btn.button('reset')
}, 3000)
})
// Modal relatedTarget demo
$('#exampleModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var recipient = button.data('whatever') // Extract info from data-* attributes
var $button = $(event.relatedTarget) // Button that triggered the modal
var recipient = $button.data('whatever') // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
modal.find('.modal-title').text('New message to ' + recipient)
modal.find('.modal-body input').val(recipient)
var $modal = $(this)
$modal.find('.modal-title').text('New message to ' + recipient)
$modal.find('.modal-body input').val(recipient)
})
// Activate animated progress bar
......@@ -137,11 +137,11 @@
$(this).before(btnHtml)
})
var zeroClipboard = new ZeroClipboard($('.btn-clipboard'))
var htmlBridge = $('#global-zeroclipboard-html-bridge')
var $htmlBridge = $('#global-zeroclipboard-html-bridge')
// Handlers for ZeroClipboard
zeroClipboard.on('load', function () {
htmlBridge
$htmlBridge
.data('placement', 'top')
.attr('title', 'Copy to clipboard')
.tooltip()
......@@ -155,7 +155,7 @@
// Notify copy success and reset tooltip title
zeroClipboard.on('complete', function () {
htmlBridge
$htmlBridge
.attr('title', 'Copied!')
.tooltip('fixTitle')
.tooltip('show')
......@@ -177,5 +177,6 @@
;(function () {
'use strict';
addAnchors('.bs-docs-section > h1, .bs-docs-section > h2, .bs-docs-section > h3, .bs-docs-section > h4, .bs-docs-section > h5');
addAnchors('.bs-docs-section > h1, .bs-docs-section > h2, .bs-docs-section > h3, .bs-docs-section > h4, .bs-docs-section > h5')
})();
......@@ -11,6 +11,7 @@
window.onload = function () { // wait for load in a dumb way because B-0
'use strict';
var cw = '/*!\n' +
' * Bootstrap v3.3.4 (http://getbootstrap.com)\n' +
' * Copyright 2011-' + new Date().getFullYear() + ' Twitter, Inc.\n' +
......@@ -18,7 +19,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
' */\n\n'
var supportsFile = window.File && window.FileReader && window.FileList && window.Blob
var importDropTarget = $('#import-drop-target')
var $importDropTarget = $('#import-drop-target')
function showError(msg, err) {
$('<div id="bsCustomizerAlert" class="bs-customizer-alert">' +
......@@ -39,15 +40,15 @@ window.onload = function () { // wait for load in a dumb way because B-0
}
function showCallout(msg, showUpTop) {
var callout = $('<div class="bs-callout bs-callout-danger">' +
var $callout = $('<div class="bs-callout bs-callout-danger">' +
'<h4>Attention!</h4>' +
'<p>' + msg + '</p>' +
'</div>')
if (showUpTop) {
callout.appendTo('.bs-docs-container')
$callout.appendTo('.bs-docs-container')
} else {
callout.insertAfter('.bs-customize-download')
$callout.insertAfter('.bs-customize-download')
}
}
......@@ -200,8 +201,8 @@ window.onload = function () { // wait for load in a dumb way because B-0
}
function generateFonts() {
var glyphicons = $('#less-section [value="glyphicons.less"]:checked')
if (glyphicons.length) {
var $glyphicons = $('#less-section [value="glyphicons.less"]:checked')
if ($glyphicons.length) {
return __fonts
}
}
......@@ -358,7 +359,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
}
function removeImportAlerts() {
importDropTarget.nextAll('.alert').remove()
$importDropTarget.nextAll('.alert').remove()
}
function handleConfigFileSelect(e) {
......@@ -380,9 +381,9 @@ window.onload = function () { // wait for load in a dumb way because B-0
}
updateCustomizerFromJson(json)
showAlert('success', '<strong>Woohoo!</strong> Your configuration was successfully uploaded. Tweak your settings, then hit Download.', importDropTarget)
showAlert('success', '<strong>Woohoo!</strong> Your configuration was successfully uploaded. Tweak your settings, then hit Download.', $importDropTarget)
} catch (err) {
return showAlert('danger', '<strong>Shucks.</strong> We can only read valid <code>.json</code> files. Please try again.', importDropTarget)
return showAlert('danger', '<strong>Shucks.</strong> We can only read valid <code>.json</code> files. Please try again.', $importDropTarget)
}
}
......@@ -398,7 +399,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
}
if (supportsFile) {
importDropTarget
$importDropTarget
.on('dragover', handleConfigDragOver)
.on('drop', handleConfigFileSelect)
}
......@@ -406,23 +407,23 @@ window.onload = function () { // wait for load in a dumb way because B-0
$('#import-file-select').on('change', handleConfigFileSelect)
$('#import-manual-trigger').on('click', removeImportAlerts)
var inputsComponent = $('#less-section input')
var inputsPlugin = $('#plugin-section input')
var inputsVariables = $('#less-variables-section input')
var $inputsComponent = $('#less-section input')
var $inputsPlugin = $('#plugin-section input')
var $inputsVariables = $('#less-variables-section input')
$('#less-section .toggle').on('click', function (e) {
e.preventDefault()
inputsComponent.prop('checked', !inputsComponent.is(':checked'))
$inputsComponent.prop('checked', !$inputsComponent.is(':checked'))
})
$('#plugin-section .toggle').on('click', function (e) {
e.preventDefault()
inputsPlugin.prop('checked', !inputsPlugin.is(':checked'))
$inputsPlugin.prop('checked', !$inputsPlugin.is(':checked'))
})
$('#less-variables-section .toggle').on('click', function (e) {
e.preventDefault()
inputsVariables.val('')
$inputsVariables.val('')
})
$('[data-dependencies]').on('click', function () {
......@@ -431,8 +432,8 @@ window.onload = function () { // wait for load in a dumb way because B-0
if (!dependencies) return
dependencies = dependencies.split(',')
for (var i = 0; i < dependencies.length; i++) {
var dependency = $('[value="' + dependencies[i] + '"]')
dependency && dependency.prop('checked', true)
var $dependency = $('[value="' + dependencies[i] + '"]')
$dependency && $dependency.prop('checked', true)
}
})
......@@ -442,8 +443,8 @@ window.onload = function () { // wait for load in a dumb way because B-0
if (!dependents) return
dependents = dependents.split(',')
for (var i = 0; i < dependents.length; i++) {
var dependent = $('[value="' + dependents[i] + '"]')
dependent && dependent.prop('checked', false)
var $dependent = $('[value="' + dependents[i] + '"]')
$dependent && $dependent.prop('checked', false)
}
})
......
......@@ -2029,7 +2029,9 @@ if (typeof jQuery === 'undefined') {
// ====================
var Tab = function (element) {
// jscs:disable requireDollarBeforejQueryAssignment
this.element = $(element)
// jscs:enable requireDollarBeforejQueryAssignment
}
Tab.VERSION = '3.3.4'
......
......@@ -17,8 +17,11 @@
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireDollarBeforejQueryAssignment": true,
"requireDotNotation": true,
"requireLineFeedAtFileEnd": true,
"requirePaddingNewLinesAfterUseStrict": true,
"requirePaddingNewLinesBeforeExport": true,
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceAfterLineComment": true,
......@@ -31,7 +34,9 @@
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInsideObjectBrackets": "allButNested",
"validateAlignedFunctionParameters": true,
"validateIndentation": 2,
"validateLineBreaks": "LF",
"validateNewlineAfterArrayElements": true,
"validateQuoteMarks": "'"
}
......@@ -14,7 +14,9 @@
// ====================
var Tab = function (element) {
// jscs:disable requireDollarBeforejQueryAssignment
this.element = $(element)
// jscs:enable requireDollarBeforejQueryAssignment
}
Tab.VERSION = '3.3.4'
......
......@@ -166,16 +166,16 @@ $(function () {
assert.expect(3)
var done = assert.async()
var div = $('<div id="modal-test"/>')
div
var $div = $('<div id="modal-test"/>')
$div
.on('shown.bs.modal', function () {
assert.ok($('#modal-test').length, 'modal insterted into dom')
assert.ok($('#modal-test').is(':visible'), 'modal visible')
div.trigger($.Event('keydown', { which: 27 }))
$div.trigger($.Event('keydown', { which: 27 }))
setTimeout(function () {
assert.ok(!$('#modal-test').is(':visible'), 'modal hidden')
div.remove()
$div.remove()
done()
}, 0)
})
......@@ -186,16 +186,16 @@ $(function () {
assert.expect(3)
var done = assert.async()
var div = $('<div id="modal-test"/>')
div
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 }))
$div.trigger($.Event('keyup', { which: 27 }))
setTimeout(function () {
assert.ok($('#modal-test').is(':visible'), 'modal still visible')
div.remove()
assert.ok($div.is(':visible'), 'modal still visible')
$div.remove()
done()
}, 0)
})
......
......@@ -247,8 +247,8 @@
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-0.2.0.tgz"
},
"caniuse-db": {
"version": "1.0.30000149",
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000149.tgz"
"version": "1.0.30000150",
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000150.tgz"
},
"num2fraction": {
"version": "1.1.0",
......@@ -2349,14 +2349,8 @@
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
},
"tough-cookie": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.0.0.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.1.0.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
......@@ -2679,14 +2673,8 @@
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
},
"tough-cookie": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.0.0.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.1.0.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
......@@ -3169,16 +3157,16 @@
}
},
"grunt-jscs": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/grunt-jscs/-/grunt-jscs-1.6.0.tgz",
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/grunt-jscs/-/grunt-jscs-1.8.0.tgz",
"dependencies": {
"hooker": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz"
},
"jscs": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/jscs/-/jscs-1.12.0.tgz",
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/jscs/-/jscs-1.13.0.tgz",
"dependencies": {
"chalk": {
"version": "1.0.0",
......@@ -3241,8 +3229,8 @@
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.5.tgz"
},
"esprima-harmony-jscs": {
"version": "1.1.0-templates",
"resolved": "https://registry.npmjs.org/esprima-harmony-jscs/-/esprima-harmony-jscs-1.1.0-templates.tgz"
"version": "1.1.0-bin",
"resolved": "https://registry.npmjs.org/esprima-harmony-jscs/-/esprima-harmony-jscs-1.1.0-bin.tgz"
},
"estraverse": {
"version": "1.9.3",
......@@ -3324,6 +3312,10 @@
}
}
},
"pathval": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/pathval/-/pathval-0.1.1.tgz"
},
"prompt": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/prompt/-/prompt-0.2.14.tgz",
......@@ -3689,14 +3681,8 @@
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
},
"tough-cookie": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.0.0.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.1.0.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment