Skip to content

Commit

Permalink
Merge branch 'master' into master-xmr-actions-split
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 30, 2020
2 parents c4c1682 + 85c4788 commit 2bc4e9e
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 6 deletions.
51 changes: 51 additions & 0 deletions build/zip-examples.js
@@ -0,0 +1,51 @@
#!/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)
1 change: 1 addition & 0 deletions config.yml
Expand Up @@ -64,6 +64,7 @@ params:
download:
source: "https://github.com/twbs/bootstrap/archive/v4.3.1.zip"
dist: "https://github.com/twbs/bootstrap/releases/download/v4.3.1/bootstrap-4.3.1-dist.zip"
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v4.3.1/bootstrap-4.3.1-examples.zip"

cdn:
# See https://www.srihash.org for info on how to generate the hashes
Expand Down
5 changes: 3 additions & 2 deletions js/src/modal.js
Expand Up @@ -442,8 +442,9 @@ 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
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -56,10 +56,11 @@
"docs-serve-only": "serve _gh_pages --listen 9001",
"lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json",
"update-deps": "ncu -u -x karma-browserstack-launcher,popper.js && npm update && echo Manually update site/assets/js/vendor",
"release": "npm-run-all dist release-sri release-zip docs-build",
"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 \"rm -rf bootstrap-$npm_package_version-dist && cp -r dist/ bootstrap-$npm_package_version-dist && zip -r9 bootstrap-$npm_package_version-dist.zip bootstrap-$npm_package_version-dist && 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-build docs-lint",
"netlify": "cross-env-shell HUGO_BASEURL=$DEPLOY_PRIME_URL npm-run-all dist release-sri docs-build",
Expand Down
5 changes: 5 additions & 0 deletions scss/_reboot.scss
Expand Up @@ -575,6 +575,11 @@ output {
display: inline-block;
}

// Remove border from iframe

iframe {
border: 0;
}

// Summary
//
Expand Down
3 changes: 2 additions & 1 deletion scss/forms/_form-check.scss
Expand Up @@ -33,7 +33,8 @@
}

&[type="radio"] {
@include border-radius($form-check-radio-border-radius);
// stylelint-disable-next-line property-blacklist
border-radius: $form-check-radio-border-radius;
}

&:active {
Expand Down
1 change: 0 additions & 1 deletion scss/helpers/_embed.scss
Expand Up @@ -19,7 +19,6 @@
left: 0;
width: 100%;
height: 100%;
border: 0;
}
}

Expand Down
6 changes: 6 additions & 0 deletions site/content/docs/4.3/getting-started/download.md
Expand Up @@ -28,6 +28,12 @@ Should you require [build tools]({{< docsref "/getting-started/build-tools#tooli

<a href="{{< param "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]({{< docsref "/examples" >}}), you can grab the already built examples:

<a href="{{< param "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
2 changes: 1 addition & 1 deletion site/content/docs/4.3/helpers/embed.md
Expand Up @@ -10,7 +10,7 @@ toc: true

Rules are directly applied to `<iframe>`, `<embed>`, `<video>`, and `<object>` elements; optionally use an explicit descendant class `.embed-responsive-item` when you want to match the styling for other attributes.

**Pro-Tip!** You don't need to include `frameborder="0"` in your `<iframe>`s as we override that for you.
**Pro-Tip!** You don't need to include `frameborder="0"` in your `<iframe>`s as we override that for you in [reboot]({{< docsref "/content/reboot" >}}).

## Example

Expand Down
1 change: 1 addition & 0 deletions site/layouts/_default/single.html
Expand Up @@ -14,6 +14,7 @@ <h1 class="bd-title mt-0">{{ .Title | markdownify }}</h1>
<p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p>
{{ if eq .Title "Examples" }}
<a href="{{ .Site.Params.download.source }}" class="btn btn-lg btn-bd-primary" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download');">Download source code</a>
<a href="{{ .Site.Params.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>
{{ end }}
{{ partial "ads" . }}
</div>
Expand Down

0 comments on commit 2bc4e9e

Please sign in to comment.