Skip to content

Commit

Permalink
Merge branch 'v4-dev' into v4-interaction-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed May 2, 2020
2 parents 72fc538 + 63dbe47 commit 1ab721a
Show file tree
Hide file tree
Showing 13 changed files with 165 additions and 14 deletions.
40 changes: 40 additions & 0 deletions .github/release-drafter.yml
@@ -0,0 +1,40 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
prerelease: true
exclude-labels:
- 'skip-changelog'
categories:
- title: '🚀 Features'
labels:
- 'new-feature'
- 'feature'
- 'enhancement'
- title: '🐛 Bug fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🎨 CSS'
labels:
- 'css'
- title: '☕️ JavaScript'
labels:
- 'js'
- title: '📖 Docs'
labels:
- 'docs'
- title: '🌎 Accessibility'
labels:
- 'accessibility'
- title: '🧰 Misc'
labels:
- 'build'
- 'meta'
- 'chore'
- title: '📦 Dependencies'
labels:
- 'dependencies'
change-template: '- #$NUMBER: $TITLE'
template: |
## Changes
$CHANGES
28 changes: 28 additions & 0 deletions .github/workflows/codeql.yml
@@ -0,0 +1,28 @@
name: "Code Scanning - Action"

on:
push:
pull_request:
schedule:
- cron: "0 0 * * 0"

jobs:
CodeQL-Build:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
14 changes: 14 additions & 0 deletions .github/workflows/release-notes.yml
@@ -0,0 +1,14 @@
name: Release notes

on:
push:
branches:
- v4-dev

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions _config.yml
Expand Up @@ -51,6 +51,7 @@ icons: "https://icons.getbootstrap.com"
download:
source: "https://github.com/twbs/bootstrap/archive/v4.4.1.zip"
dist: "https://github.com/twbs/bootstrap/releases/download/v4.4.1/bootstrap-4.4.1-dist.zip"
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v4.4.1/bootstrap-4.4.1-examples.zip"

cdn:
# See https://www.srihash.org for info on how to generate the hashes
Expand Down
55 changes: 55 additions & 0 deletions build/zip-examples.js
@@ -0,0 +1,55 @@
#!/usr/bin/env node

/*!
* Script to create the built examples zip archive;
* requires the `zip` command to be present!
* Copyright 2020 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/

'use strict'

const path = require('path')
const sh = require('shelljs')

const {
version, version_short: versionShort
} = require('../package.json')

const folderName = `bootstrap-${version}-examples`

sh.config.fatal = true

if (!sh.test('-d', '_gh_pages')) {
throw new Error('The _gh_pages folder does not exist, did you forget building the docs?')
}

// switch to the root dir
sh.cd(path.join(__dirname, '..'))

// remove any previously created folder with the same name
sh.rm('-rf', folderName)
sh.mkdir('-p', folderName)

// copy the examples and dist folders; for the examples we use `*`
// so that its content are copied to the root dist dir
sh.cp('-Rf', [
`_gh_pages/docs/${versionShort}/examples/*`,
`_gh_pages/docs/${versionShort}/dist/`
], folderName)
sh.rm(`${folderName}/index.html`)

// sed-fu
sh.find(`${folderName}/**/*.html`).forEach((file) => {
sh.sed('-i', new RegExp(`"/docs/${versionShort}/`, 'g'), '"../', file)
sh.sed('-i', /(<link href="\.\.\/.*) integrity=".*>/g, '$1>', file)
sh.sed('-i', /(<script src="\.\.\/.*) integrity=".*>/g, '$1></script>', file)
})

// create the zip file
sh.exec(`zip -r9 "${folderName}.zip" "${folderName}"`, {
fatal: true
})

// remove the folder we created
sh.rm('-rf', folderName)
7 changes: 5 additions & 2 deletions js/src/modal.js
Expand Up @@ -455,8 +455,11 @@ class Modal {
}

_checkScrollbar() {
const rect = document.body.getBoundingClientRect()
this._isBodyOverflowing = rect.left + rect.right < window.innerWidth
const {
left, right
} = document.body.getBoundingClientRect()

this._isBodyOverflowing = Math.floor(left + right) < window.innerWidth
this._scrollbarWidth = this._getScrollbarWidth()
}

Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -73,10 +73,11 @@
"docs-serve-only": "npm run docs-serve -- --skip-initial-build --no-watch",
"lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json",
"update-deps": "ncu -u -x \"jquery,karma-browserstack-launcher,popper.js,qunit,sinon\" && npm update && bundle update && cross-env-shell echo Manually update \\\"site/docs/$npm_package_version_short/assets/js/vendor/\\\"",
"release": "npm-run-all dist release-sri release-zip docs-production",
"release": "npm-run-all dist release-sri docs-build release-zip*",
"release-sri": "node build/generate-sri.js",
"release-version": "node build/change-version.js",
"release-zip": "cross-env-shell \"shx rm -rf bootstrap-$npm_package_version-dist && shx cp -r dist/ bootstrap-$npm_package_version-dist && zip -r9 bootstrap-$npm_package_version-dist.zip bootstrap-$npm_package_version-dist && shx rm -rf bootstrap-$npm_package_version-dist\"",
"release-zip-examples": "node build/zip-examples.js",
"dist": "npm-run-all --parallel css js",
"test": "npm-run-all lint dist js-test docs-compile docs-lint",
"netlify": "npm-run-all dist release-sri docs-netlify",
Expand All @@ -88,7 +89,7 @@
},
"style": "dist/css/bootstrap.css",
"sass": "scss/bootstrap.scss",
"main": "dist/js/bootstrap",
"main": "dist/js/bootstrap.js",
"repository": {
"type": "git",
"url": "git+https://github.com/twbs/bootstrap.git"
Expand Down
3 changes: 3 additions & 0 deletions scss/_reboot.scss
Expand Up @@ -229,6 +229,9 @@ pre {
margin-bottom: 1rem;
// Don't allow content to break outside
overflow: auto;
// Disable auto-hiding scrollbar in IE & legacy Edge to avoid overlap,
// making it impossible to interact with the content
-ms-overflow-style: scrollbar;
}


Expand Down
4 changes: 2 additions & 2 deletions site/_data/browser-features.yml
Expand Up @@ -82,7 +82,7 @@
browser: >
Chrome
summary: >
Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/Events/transitioncancel) when a CSS transition is canceled
Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/transitioncancel_event) when a CSS transition is canceled
upstream_bug: >
Chromium#642487
origin: >
Expand Down Expand Up @@ -112,7 +112,7 @@
browser: >
Safari
summary: >
Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/Events/transitioncancel) when a CSS transition is canceled
Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/transitioncancel_event) when a CSS transition is canceled
upstream_bug: >
WebKit#161535
origin: >
Expand Down
3 changes: 1 addition & 2 deletions site/_includes/social.html
Expand Up @@ -11,8 +11,7 @@
<meta property="og:title" content="{{ page.title | default: site.title | smartify }}">
<meta property="og:description" content="{{ page.description | default: site.description | smartify }}">
<meta property="og:type" content="website">
<meta property="og:image" content="{{ site.url | replace: 'https://', 'http://' | append: site.social_image_path }}">
<meta property="og:image:secure_url" content="{{ site.url | append: site.social_image_path }}">
<meta property="og:image" content="{{ site.url | append: site.social_image_path }}">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
1 change: 1 addition & 0 deletions site/_layouts/simple.html
Expand Up @@ -8,6 +8,7 @@ <h1 class="bd-title mt-0">{{ page.title | smartify }}</h1>
<p class="bd-lead">{{ page.description | smartify }}</p>
{%- if page.title == "Examples" -%}
<a href="{{ site.download.source }}" class="btn btn-lg btn-bd-primary" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download');">Download source code</a>
<a href="{{ site.download.dist_examples }}" class="btn btn-lg btn-bd-primary mt-3 mt-sm-0 ml-sm-3 ml-md-5" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download Examples');">Download Examples</a>
{%- endif -%}
</div>
{% include ads.html %}
Expand Down
12 changes: 6 additions & 6 deletions site/docs/4.4/assets/js/src/search.js
Expand Up @@ -35,14 +35,14 @@
transformData: function (hits) {
return hits.map(function (hit) {
var currentUrl = getOrigin()
var liveUrl = 'https://getbootstrap.com'
var liveUrl = 'https://getbootstrap.com/'

// When in production, return the result as is,
// otherwise remove our url from it.
// eslint-disable-next-line no-negated-condition
hit.url = currentUrl.indexOf(liveUrl) !== -1
hit.url = currentUrl.lastIndexOf(liveUrl, 0) === 0
// On production, return the result as is
? hit.url
: hit.url.replace(liveUrl, '')
// On development or Netlify, replace `hit.url` with a trailing slash,
// so that the result link is relative to the server root
: hit.url.replace(liveUrl, '/')

// Prevent jumping to first header
if (hit.anchor === 'content') {
Expand Down
6 changes: 6 additions & 0 deletions site/docs/4.4/getting-started/download.md
Expand Up @@ -28,6 +28,12 @@ Should you require [build tools]({{ site.baseurl }}/docs/{{ site.docs_version }}

<a href="{{ site.download.source }}" class="btn btn-bd-primary" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download source');">Download source</a>

## Examples

If you want to download and examine our [examples]({{ site.baseurl }}/docs/{{ site.docs_version }}/examples/), you can grab the already built examples:

<a href="{{ site.download.dist_examples }}" class="btn btn-bd-primary" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download Examples');">Download Examples</a>

## BootstrapCDN

Skip the download with [BootstrapCDN](https://www.bootstrapcdn.com/) to deliver cached version of Bootstrap's compiled CSS and JS to your project.
Expand Down

0 comments on commit 1ab721a

Please sign in to comment.