Commit aaad85bc authored by Mark Otto's avatar Mark Otto
Browse files

Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into v4-dev

parents 8feae907 ce2e944a
Showing with 635 additions and 1564 deletions
+635 -1564
This diff is collapsed.
This diff is collapsed.
...@@ -21,7 +21,7 @@ Download just the compiled and minified CSS and JavaScript. Doesn't include any ...@@ -21,7 +21,7 @@ Download just the compiled and minified CSS and JavaScript. Doesn't include any
<div class="col-sm-6"> <div class="col-sm-6">
{% markdown %} {% markdown %}
### Source files ### Source files
Download everything: source Sass, JavaScript, and documentation files. **Requires a Sass compiler, [Autoprefixer](https://github.com/postcss/autoprefixer), and [some setup]({{ site.baseurl }}/getting-started/build-tools/#tooling-setup).** Download everything: source Sass, JavaScript, and documentation files. **Requires a Sass compiler, [Autoprefixer](https://github.com/postcss/autoprefixer), [postcss-flexbugs-fixes](https://github.com/luisrudge/postcss-flexbugs-fixes), and [some setup]({{ site.baseurl }}/getting-started/build-tools/#tooling-setup).**
<a href="{{ site.download.source }}" class="btn btn-bs btn-outline" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download source');">Download source</a> <a href="{{ site.download.source }}" class="btn btn-bs btn-outline" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download source');">Download source</a>
{% endmarkdown %} {% endmarkdown %}
...@@ -30,7 +30,7 @@ Download everything: source Sass, JavaScript, and documentation files. **Require ...@@ -30,7 +30,7 @@ Download everything: source Sass, JavaScript, and documentation files. **Require
## Package managers ## Package managers
Pull in Bootstrap's **source files** into nearly any project with some of the most popular package managers. No matter the package manager, Bootstrap will **require a Sass compiler and [Autoprefixer](https://github.com/postcss/autoprefixer)** for a setup that matches our official compiled versions. Pull in Bootstrap's **source files** into nearly any project with some of the most popular package managers. No matter the package manager, Bootstrap will **require a Sass compiler, [Autoprefixer](https://github.com/postcss/autoprefixer), and [postcss-flexbugs-fixes](https://github.com/luisrudge/postcss-flexbugs-fixes)** for a setup that matches our official compiled versions.
{% callout warning %} {% callout warning %}
**Heads up!** Not all package managers have the v4 alpha published yet, but we should have them up shortly! **Heads up!** Not all package managers have the v4 alpha published yet, but we should have them up shortly!
......
...@@ -19,7 +19,7 @@ Flexbox support is available for a number of Bootstrap's components: ...@@ -19,7 +19,7 @@ Flexbox support is available for a number of Bootstrap's components:
- Input groups, which move from `display: table;` to `display: flex;`. - Input groups, which move from `display: table;` to `display: flex;`.
- The media component moves from `display: table;` and a number of hacky styles to a simple `display: flex;`. - The media component moves from `display: table;` and a number of hacky styles to a simple `display: flex;`.
Vendor prefixes are provided in our compiled CSS with Autoprefixer via Grunt. Vendor prefixes are provided in our compiled CSS with [Autoprefixer](https://github.com/postcss/autoprefixer) via Grunt. Some bugs in IE10-11's Flexbox implementation are worked around via [postcss-flexbugs-fixes](https://github.com/luisrudge/postcss-flexbugs-fixes).
## Why flexbox? ## Why flexbox?
......
/*!
* Bootstrap Grunt task for the CommonJS module generation
* http://getbootstrap.com
* Copyright 2014-2015 The Bootstrap Authors
* Copyright 2014-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict';
var fs = require('fs');
var path = require('path');
var COMMONJS_BANNER = '// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.\n';
module.exports = function generateCommonJSModule(grunt, srcFiles, destFilepath) {
var destDir = path.dirname(destFilepath);
function srcPathToDestRequire(srcFilepath) {
return 'require(\'' + srcFilepath.replace(/\\/g, '/') + '\')';
}
var moduleOutputJs = COMMONJS_BANNER + srcFiles.map(srcPathToDestRequire).join('\n');
try {
fs.writeFileSync(destFilepath, moduleOutputJs);
} catch (err) {
grunt.fail.warn(err);
}
grunt.log.writeln('File ' + destFilepath.cyan + ' created.');
};
This diff is collapsed.
This diff is collapsed.
{ {
"esnext": true,
"verbose": true,
"disallowEmptyBlocks": true, "disallowEmptyBlocks": true,
"disallowKeywords": ["with"], "disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": true, "disallowMixedSpacesAndTabs": true,
......
...@@ -26,6 +26,8 @@ var Carousel = (function ($) { ...@@ -26,6 +26,8 @@ var Carousel = (function ($) {
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME]; var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 600; var TRANSITION_DURATION = 600;
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
var Default = { var Default = {
interval: 5000, interval: 5000,
...@@ -241,10 +243,12 @@ var Carousel = (function ($) { ...@@ -241,10 +243,12 @@ var Carousel = (function ($) {
} }
switch (event.which) { switch (event.which) {
case 37: case ARROW_LEFT_KEYCODE:
this.prev();break; this.prev();
case 39: break;
this.next();break; case ARROW_RIGHT_KEYCODE:
this.next();
break;
default: default:
return; return;
} }
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -25,6 +25,10 @@ var Dropdown = (function ($) { ...@@ -25,6 +25,10 @@ var Dropdown = (function ($) {
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME]; var JQUERY_NO_CONFLICT = $.fn[NAME];
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
var Event = { var Event = {
HIDE: 'hide' + EVENT_KEY, HIDE: 'hide' + EVENT_KEY,
...@@ -159,7 +163,7 @@ var Dropdown = (function ($) { ...@@ -159,7 +163,7 @@ var Dropdown = (function ($) {
}, { }, {
key: '_clearMenus', key: '_clearMenus',
value: function _clearMenus(event) { value: function _clearMenus(event) {
if (event && event.which === 3) { if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {
return; return;
} }
...@@ -222,9 +226,9 @@ var Dropdown = (function ($) { ...@@ -222,9 +226,9 @@ var Dropdown = (function ($) {
var parent = Dropdown._getParentFromElement(this); var parent = Dropdown._getParentFromElement(this);
var isActive = $(parent).hasClass(ClassName.OPEN); var isActive = $(parent).hasClass(ClassName.OPEN);
if (!isActive && event.which !== 27 || isActive && event.which === 27) { if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {
if (event.which === 27) { if (event.which === ESCAPE_KEYCODE) {
var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
$(toggle).trigger('focus'); $(toggle).trigger('focus');
} }
...@@ -245,12 +249,12 @@ var Dropdown = (function ($) { ...@@ -245,12 +249,12 @@ var Dropdown = (function ($) {
var index = items.indexOf(event.target); var index = items.indexOf(event.target);
if (event.which === 38 && index > 0) { if (event.which === ARROW_UP_KEYCODE && index > 0) {
// up // up
index--; index--;
} }
if (event.which === 40 && index < items.length - 1) { if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
// down // down
index++; index++;
} }
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
This diff is collapsed.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -135,6 +135,7 @@ var ScrollSpy = (function ($) { ...@@ -135,6 +135,7 @@ var ScrollSpy = (function ($) {
// todo (fat): remove sketch reliance on jQuery position/offset // todo (fat): remove sketch reliance on jQuery position/offset
return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
} }
return null;
}).filter(function (item) { }).filter(function (item) {
return item; return item;
}).sort(function (a, b) { }).sort(function (a, b) {
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
This diff is collapsed.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -238,9 +238,14 @@ const Carousel = (($) => { ...@@ -238,9 +238,14 @@ const Carousel = (($) => {
} }
switch (event.which) { switch (event.which) {
case ARROW_LEFT_KEYCODE: this.prev(); break case ARROW_LEFT_KEYCODE:
case ARROW_RIGHT_KEYCODE: this.next(); break this.prev()
default: return break
case ARROW_RIGHT_KEYCODE:
this.next()
break
default:
return
} }
} }
......
This diff is collapsed.
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