diff --git a/.csscomb.json b/.csscomb.json new file mode 100644 index 000000000000..1baf6bedd6cc --- /dev/null +++ b/.csscomb.json @@ -0,0 +1,290 @@ +{ + "always-semicolon": true, + "block-indent": 2, + "colon-space": true, + "color-case": "lower", + "color-shorthand": true, + "combinator-space": true, + "element-case": "lower", + "eof-newline": true, + "leading-zero": false, + "remove-empty-rulesets": true, + "rule-indent": 2, + "stick-brace": true, + "strip-spaces": true, + "unitless-zero": true, + "vendor-prefix-align": true, + "sort-order": [ + [ + "position", + "top", + "right", + "bottom", + "left", + "z-index", + "display", + "float", + "width", + "min-width", + "max-width", + "height", + "min-height", + "max-height", + "-webkit-box-sizing", + "-moz-box-sizing", + "box-sizing", + "padding", + "padding-top", + "padding-right", + "padding-bottom", + "padding-left", + "margin", + "margin-top", + "margin-right", + "margin-bottom", + "margin-left", + "overflow", + "overflow-x", + "overflow-y", + "-ms-overflow-x", + "-ms-overflow-y", + "clip", + "clear", + "font", + "font-family", + "font-size", + "font-style", + "font-weight", + "font-variant", + "font-size-adjust", + "font-stretch", + "font-effect", + "font-emphasize", + "font-emphasize-position", + "font-emphasize-style", + "font-smooth", + "-webkit-hyphens", + "-moz-hyphens", + "hyphens", + "line-height", + "color", + "text-align", + "-webkit-text-align-last", + "-moz-text-align-last", + "-ms-text-align-last", + "text-align-last", + "text-emphasis", + "text-emphasis-color", + "text-emphasis-style", + "text-emphasis-position", + "text-decoration", + "text-indent", + "text-justify", + "text-outline", + "-ms-text-overflow", + "text-overflow", + "text-overflow-ellipsis", + "text-overflow-mode", + "text-shadow", + "text-transform", + "text-wrap", + "letter-spacing", + "-ms-word-break", + "word-break", + "word-spacing", + "-ms-word-wrap", + "word-wrap", + "-moz-tab-size", + "-o-tab-size", + "tab-size", + "white-space", + "vertical-align", + "list-style", + "list-style-position", + "list-style-type", + "list-style-image", + "pointer-events", + "cursor", + "visibility", + "zoom", + "flex-direction", + "flex-order", + "flex-pack", + "flex-align", + "table-layout", + "empty-cells", + "caption-side", + "border-spacing", + "border-collapse", + "content", + "quotes", + "counter-reset", + "counter-increment", + "resize", + "-webkit-user-select", + "-moz-user-select", + "-ms-user-select", + "user-select", + "nav-index", + "nav-up", + "nav-right", + "nav-down", + "nav-left", + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", + "background", + "background-color", + "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient", + "filter:progid:DXImageTransform.Microsoft.gradient", + "background-image", + "background-repeat", + "background-attachment", + "background-position", + "background-position-x", + "background-position-y", + "-webkit-background-clip", + "-moz-background-clip", + "background-clip", + "background-origin", + "-webkit-background-size", + "-moz-background-size", + "-o-background-size", + "background-size", + "border", + "border-color", + "border-style", + "border-width", + "border-top", + "border-top-color", + "border-top-style", + "border-top-width", + "border-right", + "border-right-color", + "border-right-style", + "border-right-width", + "border-bottom", + "border-bottom-color", + "border-bottom-style", + "border-bottom-width", + "border-left", + "border-left-color", + "border-left-style", + "border-left-width", + "border-radius", + "border-top-left-radius", + "border-top-right-radius", + "border-bottom-right-radius", + "border-bottom-left-radius", + "-webkit-border-image", + "-moz-border-image", + "-o-border-image", + "border-image", + "-webkit-border-image-source", + "-moz-border-image-source", + "-o-border-image-source", + "border-image-source", + "-webkit-border-image-slice", + "-moz-border-image-slice", + "-o-border-image-slice", + "border-image-slice", + "-webkit-border-image-width", + "-moz-border-image-width", + "-o-border-image-width", + "border-image-width", + "-webkit-border-image-outset", + "-moz-border-image-outset", + "-o-border-image-outset", + "border-image-outset", + "-webkit-border-image-repeat", + "-moz-border-image-repeat", + "-o-border-image-repeat", + "border-image-repeat", + "outline", + "outline-width", + "outline-style", + "outline-color", + "outline-offset", + "-webkit-box-shadow", + "-moz-box-shadow", + "box-shadow", + "filter:progid:DXImageTransform.Microsoft.Alpha(Opacity", + "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha", + "opacity", + "-ms-interpolation-mode", + "-webkit-transition", + "-moz-transition", + "-ms-transition", + "-o-transition", + "transition", + "-webkit-transition-delay", + "-moz-transition-delay", + "-ms-transition-delay", + "-o-transition-delay", + "transition-delay", + "-webkit-transition-timing-function", + "-moz-transition-timing-function", + "-ms-transition-timing-function", + "-o-transition-timing-function", + "transition-timing-function", + "-webkit-transition-duration", + "-moz-transition-duration", + "-ms-transition-duration", + "-o-transition-duration", + "transition-duration", + "-webkit-transition-property", + "-moz-transition-property", + "-ms-transition-property", + "-o-transition-property", + "transition-property", + "-webkit-transform", + "-moz-transform", + "-ms-transform", + "-o-transform", + "transform", + "-webkit-transform-origin", + "-moz-transform-origin", + "-ms-transform-origin", + "-o-transform-origin", + "transform-origin", + "-webkit-animation", + "-moz-animation", + "-ms-animation", + "-o-animation", + "animation", + "-webkit-animation-name", + "-moz-animation-name", + "-ms-animation-name", + "-o-animation-name", + "animation-name", + "-webkit-animation-duration", + "-moz-animation-duration", + "-ms-animation-duration", + "-o-animation-duration", + "animation-duration", + "-webkit-animation-play-state", + "-moz-animation-play-state", + "-ms-animation-play-state", + "-o-animation-play-state", + "animation-play-state", + "-webkit-animation-timing-function", + "-moz-animation-timing-function", + "-ms-animation-timing-function", + "-o-animation-timing-function", + "animation-timing-function", + "-webkit-animation-delay", + "-moz-animation-delay", + "-ms-animation-delay", + "-o-animation-delay", + "animation-delay", + "-webkit-animation-iteration-count", + "-moz-animation-iteration-count", + "-ms-animation-iteration-count", + "-o-animation-iteration-count", + "animation-iteration-count", + "-webkit-animation-direction", + "-moz-animation-direction", + "-ms-animation-direction", + "-o-animation-direction", + "animation-direction" + ] + ] +} diff --git a/.csslintrc b/.csslintrc new file mode 100644 index 000000000000..8cf2f846dfd5 --- /dev/null +++ b/.csslintrc @@ -0,0 +1,18 @@ +{ + "adjoining-classes": false, + "box-sizing": false, + "box-model": false, + "compatible-vendor-prefixes": false, + "floats": false, + "font-sizes": false, + "gradients": false, + "important": false, + "known-properties": false, + "outline-none": false, + "qualified-headings": false, + "regex-selectors": false, + "text-indent": false, + "unique-headings": false, + "universal-selector": false, + "unqualified-attributes": false +} diff --git a/.gitattributes b/.gitattributes index 2125666142eb..0c6b2fea5f3b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,8 @@ -* text=auto \ No newline at end of file +# Enforce Unix newlines +*.css text eol=lf +*.html text eol=lf +*.js text eol=lf +*.json text eol=lf +*.less text eol=lf +*.md text eol=lf +*.yml text eol=lf diff --git a/.gitignore b/.gitignore index 9bfb3756c3c4..465cdb4633be 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,3 @@ validation-report.json # Folders to ignore node_modules bower_components -gudstrap diff --git a/.travis.yml b/.travis.yml index 775a7f15aad2..be63538028cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,28 @@ language: node_js node_js: - 0.10 -before_script: - - gem install jekyll - - npm install -g grunt-cli +before_install: + - time sudo pip install --use-mirrors -r test-infra/requirements.txt + - rvm use 1.9.3 --fuzzy + - if [ "$TWBS_TEST" = validate-html ]; then echo "ruby=$(basename $(rvm gemdir)) jekyll=$JEKYLL_VERSION" > pseudo_Gemfile.lock; fi +install: + - time npm install -g grunt-cli + - time ./test-infra/s3_cache.py download 'node.js packages' package.json ./node_modules || time npm install + - if [ "$TWBS_TEST" = validate-html ]; then time ./test-infra/s3_cache.py download rubygems pseudo_Gemfile.lock $(rvm gemdir) || gem install -N jekyll -v $JEKYLL_VERSION; fi +after_script: + - if [ "$TWBS_TEST" = core ]; then time ./test-infra/s3_cache.py upload 'node.js packages' package.json ./node_modules; fi + - if [ "$TWBS_TEST" = validate-html ]; then time ./test-infra/s3_cache.py upload rubygems pseudo_Gemfile.lock $(rvm gemdir); fi env: global: - - secure: Besg41eyU+2mfxrywQ4ydOShMdc34ImaO0S0ENP+aCOBuyNBIgP59wy5tBMmyai2/8eInYeVps4Td96mWInMMxzTe3Bar7eTLG5tWVKRSr/wc4NBPZ/ppoPAmCEsz9Y+VptRH9/FO8n7hsL9EFZ+xBKbG+C0SccGoyBDpA5j7/w= - - secure: Ptiv7phCImFP3ALIz+sMQzrZg8k7C1gLZbFBhWxjnQr3g06wIfX3Ls5y9OHvxid+lOZZjISui3wzBVgpVHqwHUYf96+r0mo6/mJ+F4ffUmShZANVaIMD/JRTnXhUQJbvntGLvxn1EYWPdNM+2IHJrMipnjHxU9tkgAnlel4Zdew= - - TWBS_HAVE_OWN_BROWSERSTACK_KEY: "" + - JEKYLL_VERSION: 1.4.1 + - SAUCE_USERNAME: bootstrap + - secure: "pJkBwnuae9dKU5tEcCqccfS1QQw7/meEcfz63fM7ba7QJNjoA6BaXj08L5Z3Vb5vBmVPwBawxo5Hp0jC0r/Z/O0hGnAmz/Cz09L+cy7dSAZ9x4hvZePSja/UAusaB5ogMoO8l2b773MzgQeSmrLbExr9BWLeqEfjC2hFgdgHLaQ=" + - secure: "gqjqISbxBJK6byFbsmr1AyP1qoWH+rap06A2gI7v72+Tn2PU2nYkIMUkCvhZw6K889jv+LhQ/ybcBxDOXHpNCExCnSgB4dcnmYp+9oeNZb37jSP0rQ+Ib4OTLjzc3/FawE/fUq5kukZTC7porzc/k0qJNLAZRx3YLALmK1GIdUY=" + - secure: "Gghh/e3Gsbj1+4RR9Lh2aR/xJl35HWiHqlPIeSUqE9D7uDCVTAwNce/dGL3Ew7uJPfJ6Pgr70wD3zgu3stw0Zmzayax0hiDtGwcQCxVIER08wqGANK9C2Q7PYJkNTNtiTo6ehKWbdV4Z+/U+TEYyQfpQTDbAFYk/vVpsdjp0Lmc=" + - secure: "RTbRdx4G/2OTLfrZtP1VbRljxEmd6A1F3GqXboeQTldsnAlwpsES65es5CE3ub/rmixLApOY9ot7OPmNixFgC2Y8xOsV7lNCC62QVpmqQEDyGFFQKb3yO6/dmwQxdsCqGfzf9Np6Wh5V22QFvr50ZLKLd7Uhd9oXMDIk/z1MJ3o=" + matrix: + - TWBS_TEST=core + - TWBS_TEST=validate-html + - TWBS_TEST=sauce-js-unit +matrix: + fast_finish: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c88a8d8823d..21062d9f1bce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ We only accept issues that are bug reports or feature requests. Bugs must be iso ## Pull requests -- CSS changes must be done in `.less` files first, never just the compiled `.css` files +- CSS changes must be done in `.less` files first, never just in the compiled `.css` files - If modifying the `.less` files, always recompile and commit the compiled files `bootstrap.css` and `bootstrap.min.css` - Try not to pollute your pull request with unintended changes--keep them simple and small - Try to share which browsers your code has been tested in before submitting a pull request @@ -37,12 +37,15 @@ We only accept issues that are bug reports or feature requests. Bugs must be iso ### CSS -- Adhere to the [RECESS CSS property order](http://markdotto.com/2011/11/29/css-property-order/) +- Adhere to the [CSS property order](http://markdotto.com/2011/11/29/css-property-order/) - Multiple-line approach (one property and value per line) - Always a space after a property's colon (e.g., `display: block;` and not `display:block;`) - End all lines with a semi-colon - For multiple, comma-separated selectors, place each selector on its own line - Attribute selectors, like `input[type="text"]` should always wrap the attribute's value in double quotes, for consistency and safety (see this [blog post on unquoted attribute values](http://mathiasbynens.be/notes/unquoted-attribute-values) that can lead to XSS attacks). +- Attribute selectors should only be used where absolutely necessary (e.g., form controls) and should be avoided on custom components for performance and explicitness. +- Series of classes for a component should include a base class (e.g., `.component`) and use the base class as a prefix for modifier and sub-components (e.g., `.component-lg`). +- Avoid inheritance and over nesting—use single, explicit classes whenever possible. ### JS @@ -58,7 +61,7 @@ We only accept issues that are bug reports or feature requests. Bugs must be iso With v3.1, we're moving from the Apache 2 to the MIT license for the Bootstrap code (not the docs). We're in the process of collecting permissions from all Bootstrap contributors with code still part of the project to make this happen. For details, please see [#2054](https://github.com/twbs/bootstrap/issues/2054). -By contributing your code, you agree to dual-license your contribution under the [Apache 2](https://github.com/twbs/bootstrap/blob/master/LICENSE) and [MIT](https://github.com/twbs/bootstrap/blob/master/MIT) licenses. +By contributing your code, you agree to dual-license your contribution under the [Apache 2](https://github.com/twbs/bootstrap/blob/master/LICENSE) and [MIT](https://github.com/twbs/bootstrap/blob/master/LICENSE-MIT) licenses. diff --git a/Gruntfile.js b/Gruntfile.js index 346819bfa27c..a7f7871e5fc1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,39 +1,30 @@ /* jshint node: true */ -module.exports = function(grunt) { - "use strict"; +module.exports = function (grunt) { + 'use strict'; - RegExp.quote = require('regexp-quote'); - - var semver = require("semver"); - var btoa = require('btoa'); + // Force use of Unix newlines + grunt.util.linefeed = '\n'; + RegExp.quote = function (string) { + return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&') + } + var btoa = require('btoa') // Project configuration. grunt.initConfig({ // Metadata. pkg: grunt.file.readJSON('package.json'), banner: '/*!\n' + - ' * Bootstrap v<%= pkg.version %> by @fat and @mdo\n' + + ' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' + ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + ' * Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' + - ' *\n' + - ' * Designed and built with all the love in the world by @mdo and @fat.\n' + ' */\n\n', - jqueryCheckBefore: '(function (factory) {\n\n' + - 'if (typeof define === "function" && define.amd) {\n\n' + - 'define(["jquery"], function(jQuery){\n\n' + - ' factory(jQuery);\n\n' + - ' return jQuery;\n\n' + - '});\n\n' + - '} else { factory(window.jQuery); }\n\n' + - '}(function (jQuery) {\n\n', - jqueryCheckAfter: '}));', + jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery")} \n\n', // Task configuration. clean: { - dist: ['dist'], - gudstrap: ['gudstrap'] + dist: ['dist'] }, jshint: { @@ -48,16 +39,42 @@ module.exports = function(grunt) { }, test: { src: ['js/tests/unit/*.js'] + }, + assets: { + src: ['docs-assets/js/application.js', 'docs-assets/js/customizer.js'] } }, + jscs: { + options: { + config: 'js/.jscs.json' + }, + gruntfile: { + src: ['Gruntfile.js'] + }, + src: { + src: ['js/*.js'] + }, + test: { + src: ['js/tests/unit/*.js'] + } + }, + + csslint: { + options: { + csslintrc: '.csslintrc' + }, + src: ['dist/css/gudstrap.css', 'dist/css/bootstrap.css', 'dist/css/bootstrap-theme.css'] + }, + concat: { options: { - banner: '<%= banner %><%= jqueryCheckBefore %>', - footer: '<%= jqueryCheckAfter%>', stripBanners: false }, bootstrap: { + options: { + banner: '<%= banner %><%= jqueryCheck %>' + }, src: [ 'js/transition.js', 'js/alert.js', @@ -74,7 +91,15 @@ module.exports = function(grunt) { 'js/toggle-btn-group-ef.js', 'js/stepper-ef.js' ], - dest: 'dist/js/<%= pkg.name %>.js' + dest: 'dist/js/bootstrap.js' + }, + gudstrap: { + options: { + banner: '<%= banner %><%= umdBefore %><%= jqueryCheck %>', + footer: '<%= umdAfter %>' + }, + src: ['<%= concat.bootstrap.src %>'], + dest: 'dist/js/gudstrap.js' } }, @@ -85,40 +110,80 @@ module.exports = function(grunt) { }, bootstrap: { src: ['<%= concat.bootstrap.dest %>'], - dest: 'dist/js/<%= pkg.name %>.min.js' + dest: 'dist/js/bootstrap.min.js' + }, + gudstrap: { + src: ['<%= concat.gudstrap.dest %>'], + dest: 'dist/js/gudstrap.min.js' + }, + customize: { + src: [ + 'docs-assets/js/less.js', + 'docs-assets/js/jszip.js', + 'docs-assets/js/uglify.js', + 'docs-assets/js/filesaver.js', + 'docs-assets/js/customizer.js' + ], + dest: 'docs-assets/js/customize.js' } }, - recess: { - options: { - compile: true, - banner: '<%= banner %>' - }, - bootstrap: { - src: ['less/bootstrap-ef.less'], - dest: 'dist/css/<%= pkg.name %>.css' - }, - min: { + less: { + compile: { options: { - compress: true + strictMath: true, + modifyVars: { + 'FontAwesomePath': '"../fonts"' + } }, - src: ['less/bootstrap-ef.less'], - dest: 'dist/css/<%= pkg.name %>.min.css' - }, - theme: { - src: ['less/theme.less'], - dest: 'dist/css/<%= pkg.name %>-theme.css' + files: { + 'dist/css/gudstrap.css': 'less/gudstrap.less', + 'dist/css/bootstrap.css': 'less/bootstrap-ef.less', + 'dist/css/bootstrap-theme.css': 'less/theme.less' + } }, - theme_min: { + minify: { options: { - compress: true + cleancss: true, + report: 'min' }, - src: ['less/theme.less'], - dest: 'dist/css/<%= pkg.name %>-theme.min.css' - }, - docs: { - src: ['docs-assets/less/docs-ef.less'], - dest: 'docs-assets/css/docs-ef.css' + files: { + 'dist/css/gudstrap.min.css': 'dist/css/gudstrap.css', + 'dist/css/bootstrap.min.css': 'dist/css/bootstrap.css', + 'dist/css/bootstrap-theme.min.css': 'dist/css/bootstrap-theme.css' + } + } + }, + + usebanner: { + dist: { + options: { + position: 'top', + banner: '<%= banner %>' + }, + files: { + src: [ + 'dist/css/gudstrap.css', + 'dist/css/gudstrap.min.css', + 'dist/css/bootstrap.css', + 'dist/css/bootstrap.min.css', + 'dist/css/bootstrap-theme.css', + 'dist/css/bootstrap-theme.min.css', + ] + } + } + }, + + csscomb: { + sort: { + options: { + sortOrder: '.csscomb.json' + }, + files: { + 'dist/css/gudstrap.css': ['dist/css/gudstrap.css'], + 'dist/css/bootstrap.css': ['dist/css/bootstrap.css'], + 'dist/css/bootstrap-theme.css': ['dist/css/bootstrap-theme.css'] + } } }, @@ -126,21 +191,8 @@ module.exports = function(grunt) { fonts: { expand: true, flatten: true, - src: [ "fonts/*", "bower_components/fontawesome/font/*" ], + src: [ 'fonts/*', 'bower_components/fontawesome/font/*' ], dest: 'dist/fonts' - }, - docscss: { - expand: true, - flatten: true, - src: [ 'docs-assets/css/docs.css' ], - dest: 'docs-assets/less/', - ext: '.less' - }, - gudstrap: { - expand: true, - cwd: 'dist/', - src: [ '**/*' ], - dest: 'gudstrap/<%= pkg["version-gudstrap"] %>/' } }, @@ -166,16 +218,21 @@ module.exports = function(grunt) { validation: { options: { + charset: 'utf-8', + doctype: 'HTML5', + failHard: true, reset: true, relaxerror: [ - "Bad value X-UA-Compatible for attribute http-equiv on element meta.", - "Element img is missing required attribute src." + 'Bad value X-UA-Compatible for attribute http-equiv on element meta.', + 'Element img is missing required attribute src.', + /* Ignore Private Unicode Area Error */ + '.*?Charmod C073.*?' ] }, files: { src: [ - "_gh_pages/**/*.html", - "!_gh_pages/bower_components/**/*" + '_gh_pages/**/*.html', + '!_gh_pages/bower_components/**/*' ] } }, @@ -189,9 +246,9 @@ module.exports = function(grunt) { files: '<%= jshint.test.src %>', tasks: ['jshint:test', 'qunit'] }, - recess: { + less: { files: 'less/*.less', - tasks: ['recess'] + tasks: ['less'] } }, @@ -204,24 +261,43 @@ module.exports = function(grunt) { replacement: grunt.option('newver'), recursive: true } + }, + + 'saucelabs-qunit': { + all: { + options: { + build: process.env.TRAVIS_JOB_ID, + concurrency: 3, + urls: ['http://127.0.0.1:3000/js/tests/index.html'], + browsers: grunt.file.readYAML('sauce_browsers.yml') + } + } } }); - // Load all grunt tasks - require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); + // These plugins provide necessary tasks. + require('load-grunt-tasks')(grunt, {scope: 'devDependencies'}); // Docs HTML validation task grunt.registerTask('validate-html', ['jekyll', 'validation']); // Test task. - var testSubtasks = ['dist-css', 'jshint', 'qunit', 'validate-html']; - // Only run BrowserStack tests under Travis - if (process.env.TRAVIS) { - // Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key - if ((process.env.TRAVIS_REPO_SLUG === 'twbs/bootstrap' && process.env.TRAVIS_PULL_REQUEST === 'false') || process.env.TWBS_HAVE_OWN_BROWSERSTACK_KEY) { - testSubtasks.push('browserstack_runner'); - } + var testSubtasks = []; + // Skip core tests if running a different subset of the test suite + if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'core') { + testSubtasks = testSubtasks.concat(['dist-css', 'jshint', 'jscs', 'qunit']); + } + // Skip HTML validation if running a different subset of the test suite + if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'validate-html') { + testSubtasks.push('validate-html'); + } + // Only run Sauce Labs tests if there's a Sauce access key + if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' + // Skip Sauce if running a different subset of the test suite + && (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) { + testSubtasks.push('connect'); + testSubtasks.push('saucelabs-qunit'); } grunt.registerTask('test', testSubtasks); @@ -229,13 +305,13 @@ module.exports = function(grunt) { grunt.registerTask('dist-js', ['concat', 'uglify']); // CSS distribution task. - grunt.registerTask('dist-css', ['copy:docscss', 'recess']); + grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']); // Fonts distribution task. - grunt.registerTask('dist-fonts', ['copy:fonts']); + grunt.registerTask('dist-fonts', ['copy']); // Full distribution task. - grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-fonts', 'dist-js']); + grunt.registerTask('dist', ['clean', 'dist-css', 'dist-fonts', 'dist-js']); // Default task. grunt.registerTask('default', ['test', 'dist']); @@ -245,9 +321,6 @@ module.exports = function(grunt) { // This can be overzealous, so its changes should always be manually reviewed! grunt.registerTask('change-version-number', ['sed']); - // Copy for GudStrap with version. - grunt.registerTask('dist-gudstrap', ['default', 'clean:gudstrap', 'copy:gudstrap']); - // task for building customizer grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () { var fs = require('fs') diff --git a/README.md b/README.md index 72a3935d9388..7d342d7a7094 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # [Bootstrap](http://getbootstrap.com) [![Build Status](https://secure.travis-ci.org/twbs/bootstrap.png)](http://travis-ci.org/twbs/bootstrap) [![devDependency Status](https://david-dm.org/twbs/bootstrap/dev-status.png)](https://david-dm.org/twbs/bootstrap#info=devDependencies) +[![Selenium Test Status](https://saucelabs.com/browser-matrix/bootstrap.svg)](https://saucelabs.com/u/bootstrap) Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created and maintained by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat). @@ -10,7 +11,7 @@ To get started, check out ! Three quick start options are available: -* [Download the latest release](https://github.com/twbs/bootstrap/archive/v3.0.2.zip). +* [Download the latest release](https://github.com/twbs/bootstrap/archive/v3.0.3.zip). * Clone the repo: `git clone https://github.com/twbs/bootstrap.git`. * Install with [Bower](http://bower.io): `bower install bootstrap`. @@ -56,8 +57,9 @@ Bootstrap's documentation, included in this repo in the root directory, is built ### Running documentation locally 1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) (requires v1.x). + - **Windows users:** read [this unofficial guide](https://github.com/juthilo/run-jekyll-on-windows/) to get Jekyll up and running without problems. 2. From the root `/bootstrap` directory, run `jekyll serve` in the command line. - - **Windows users:** run `chcp 65001` first to change the command prompt's character encoding ([code page](http://en.wikipedia.org/wiki/Windows_code_page)) to UTF-8 so Jekyll runs without errors. + - **Windows users:** For Ruby 2.0.0 run `chcp 65001` first to change the command prompt's character encoding ([code page](http://en.wikipedia.org/wiki/Windows_code_page)) to UTF-8 so Jekyll runs without errors. For Ruby 1.9.3 you can alternatively do `SET LANG=en_EN.UTF-8`. In addition, ensure you have Python installed and added in your `PATH` or the build will fail due to our Pygments dependency. 3. Open in your browser, and voilà. Learn more about using Jekyll by reading its [documentation](http://jekyllrb.com/docs/home/). @@ -122,7 +124,6 @@ Keep track of development and community news. * Follow [@twbootstrap on Twitter](http://twitter.com/twbootstrap). * Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com). -* Have a question that's not a feature request or bug report? [Ask on the mailing list.](http://groups.google.com/group/twitter-bootstrap) * Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##twitter-bootstrap` channel. diff --git a/_config.yml b/_config.yml index df85b143581f..ef82f3a5d235 100644 --- a/_config.yml +++ b/_config.yml @@ -1,18 +1,18 @@ # Dependencies markdown: rdiscount -pygments: true +highlighter: true # Permalinks permalink: pretty # Server destination: ./_gh_pages -exclude: [".editorconfig", ".gitignore", "bower.json", "composer.json", "CONTRIBUTING.md", "CNAME", "LICENSE", "Gruntfile.js", "package.json", "node_modules", "README.md", "less"] +exclude: [".editorconfig", ".gitignore", "bower.json", "composer.json", "CONTRIBUTING.md", "CNAME", "LICENSE", "Gruntfile.js", "package.json", "node_modules", "README.md", "less", "bower_components"] port: 9001 # Custom vars -current_version: 3.0.2 -repo: https://github.com/englishtown/gudstrap +current_version: 3.0.3 +repo: https://github.com/twbs/bootstrap download_source: https://github.com/englishtown/gudstrap/archive/develop.zip download_dist: https://github.com/englishtown/gudstrap/releases/ @@ -20,6 +20,6 @@ download_dist: https://github.com/englishtown/gudstrap/releases/ blog: http://blog.getbootstrap.com expo: http://expo.getbootstrap.com -cdn_css: //netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css -cdn_theme_css: //netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css -cdn_js: //netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js +cdn_css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css +cdn_theme_css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css +cdn_js: //netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js diff --git a/_includes/footer.html b/_includes/footer.html index 5f9b91f08622..fc5c515d39b6 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -2,7 +2,7 @@ ================================================== --> - + @@ -14,5 +14,5 @@ - + {% endif %} diff --git a/_includes/header.html b/_includes/header.html index 91aa0f559443..ba9007d7c12e 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,8 +1,9 @@ - - + + + {% if page.title == "GUDstrap" %} @@ -13,10 +14,10 @@ - + - + diff --git a/_includes/nav-components.html b/_includes/nav-components.html index eed543a635bc..262754cd9284 100644 --- a/_includes/nav-components.html +++ b/_includes/nav-components.html @@ -127,6 +127,7 @@
  • Basic example
  • Badges
  • Linked items
  • +
  • Contextual classes
  • Custom content
  • diff --git a/_includes/nav-css.html b/_includes/nav-css.html index 543d004f30fe..55d46d8b59c4 100644 --- a/_includes/nav-css.html +++ b/_includes/nav-css.html @@ -16,6 +16,7 @@
  • Media queries
  • Grid options
  • Ex: Stacked-to-horizonal
  • +
  • Ex: Fluid container
  • Ex: Mobile and desktops
  • Ex: Mobile, tablet, desktops
  • Responsive column resets
  • @@ -37,7 +38,14 @@
  • Lists
  • -
  • Code
  • +
  • + Code + +
  • Tables @@ -79,6 +89,8 @@
  • Helper classes
  • +
  • + Using LESS + +
  • diff --git a/_includes/nav-getting-started.html b/_includes/nav-getting-started.html index 243c05fb0517..6c041eef3838 100644 --- a/_includes/nav-getting-started.html +++ b/_includes/nav-getting-started.html @@ -8,6 +8,10 @@
  • What's included +
  • Basic template @@ -28,7 +32,19 @@
  • - Browser support + Browser and device support +
  • Third party support diff --git a/_includes/nav-javascript.html b/_includes/nav-javascript.html index e97027096c4c..aeeafe264117 100644 --- a/_includes/nav-javascript.html +++ b/_includes/nav-javascript.html @@ -13,6 +13,7 @@ Modal
  • diff --git a/_layouts/default.html b/_layouts/default.html index 1415c0811af3..13f759781832 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,5 +1,5 @@ - + {% include header.html %} diff --git a/_layouts/home.html b/_layouts/home.html index ab4dbf761b0c..7bbf7dbc3ee2 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -1,5 +1,5 @@ - + {% include header.html %} diff --git a/about.html b/about.html index 838e16c16b23..d728b168cf3c 100644 --- a/about.html +++ b/about.html @@ -104,7 +104,6 @@

    Community

    Stay up to date on the development of Bootstrap and reach out to the community with these helpful resources.

    @@ -123,6 +122,8 @@

    Translations

  • Bootstrap 中文文档 (Chinese)
  • Bootstrap по-русски (Russian)
  • Bootstrap en Español (Spanish)
  • +
  • Bootstrap ua Українською (Ukrainian)
  • +
  • Bootstrap en Français (French)
  • Have another language to add, or perhaps a different or better translation? Let us know by opening an issue.

    diff --git a/bower.json b/bower.json index 36efe112e355..0eddf32c5e48 100644 --- a/bower.json +++ b/bower.json @@ -1,10 +1,24 @@ { "name": "gudstrap", - "version": "3.0.2", - "version-gudstrap": "1.0.0", - "main": ["./dist/js/gudstrap.js", "./dist/css/gudstrap.css", "./dist/fonts/*"], + "version": "3.0.3", + "version-gudstrap": "1.1.1", + "main": [ + "./dist/js/bootstrap.js", + "./dist/css/bootstrap.css", + "./dist/js/gudstrap.js", + "./dist/css/gudstrap.css", + "./dist/fonts/*" + ], "ignore": [ - "**/.*" + "**/.*", + "_*", + "docs-assets", + "examples", + "js/tests", + "CNAME", + "CONTRIBUTING.md", + "composer.json", + "*.html" ], "dependencies": { "fontawesome": "https://github.com/FortAwesome/Font-Awesome.git#2bf42834763cee2606df32cc32fcee2b1b45230e", diff --git a/browserstack.json b/browserstack.json deleted file mode 100644 index 76564eb27a2d..000000000000 --- a/browserstack.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "username": "--secure--", - "key": "--secure--", - "test_path": "js/tests/index.html", - "browsers": [ - { - "browser": "firefox", - "browser_version": "latest", - "os": "OS X", - "os_version": "Mountain Lion" - }, - { - "browser": "safari", - "browser_version": "latest", - "os": "OS X", - "os_version": "Mountain Lion" - }, - { - "browser": "chrome", - "browser_version": "latest", - "os": "OS X", - "os_version": "Mountain Lion" - }, - { - "browser": "firefox", - "browser_version": "latest", - "os": "Windows", - "os_version": "7" - }, - { - "browser": "chrome", - "browser_version": "latest", - "os": "Windows", - "os_version": "7" - } - ] -} diff --git a/components.html b/components.html index 95fbe5630854..19362386f0a3 100644 --- a/components.html +++ b/components.html @@ -16,2156 +16,812 @@

    Glyphicons

    Available glyphs

    Includes 200 glyphs in font format from the Glyphicon Halflings set. Glyphicons Halflings are normally not available for free, but their creator has made them available for Bootstrap free of cost. As a thank you, we only ask that you to include a link back to Glyphicons whenever possible.

    -

    Also included is additional glyphs from Font Awesome - The iconic font designed for Bootstrap

    - - -

    Web application icons

    - - -

    Currency icons

    - - -

    Text editor icons

    - - -

    Directional icons

    - - -

    Video player icons

    - - -

    Brand icons

    -
    -

    All brand icons are trademarks of their respective owners.

    -

    The use of these trademarks does not indicate endorsement of the trademark holder by Font Awesome, nor vice versa.

    +
    +
      +
    • + + glyphicon glyphicon-adjust +
    • +
    • + + glyphicon glyphicon-align-center +
    • +
    • + + glyphicon glyphicon-align-justify +
    • +
    • + + glyphicon glyphicon-align-left +
    • +
    • + + glyphicon glyphicon-align-right +
    • +
    • + + glyphicon glyphicon-arrow-down +
    • +
    • + + glyphicon glyphicon-arrow-left +
    • +
    • + + glyphicon glyphicon-arrow-right +
    • +
    • + + glyphicon glyphicon-arrow-up +
    • +
    • + + glyphicon glyphicon-asterisk +
    • +
    • + + glyphicon glyphicon-backward +
    • +
    • + + glyphicon glyphicon-ban-circle +
    • +
    • + + glyphicon glyphicon-barcode +
    • +
    • + + glyphicon glyphicon-bell +
    • +
    • + + glyphicon glyphicon-bold +
    • +
    • + + glyphicon glyphicon-book +
    • +
    • + + glyphicon glyphicon-bookmark +
    • +
    • + + glyphicon glyphicon-briefcase +
    • +
    • + + glyphicon glyphicon-bullhorn +
    • +
    • + + glyphicon glyphicon-calendar +
    • +
    • + + glyphicon glyphicon-camera +
    • +
    • + + glyphicon glyphicon-certificate +
    • +
    • + + glyphicon glyphicon-check +
    • +
    • + + glyphicon glyphicon-chevron-down +
    • +
    • + + glyphicon glyphicon-chevron-left +
    • +
    • + + glyphicon glyphicon-chevron-right +
    • +
    • + + glyphicon glyphicon-chevron-up +
    • +
    • + + glyphicon glyphicon-circle-arrow-down +
    • +
    • + + glyphicon glyphicon-circle-arrow-left +
    • +
    • + + glyphicon glyphicon-circle-arrow-right +
    • +
    • + + glyphicon glyphicon-circle-arrow-up +
    • +
    • + + glyphicon glyphicon-cloud +
    • +
    • + + glyphicon glyphicon-cloud-download +
    • +
    • + + glyphicon glyphicon-cloud-upload +
    • +
    • + + glyphicon glyphicon-cog +
    • +
    • + + glyphicon glyphicon-collapse-down +
    • +
    • + + glyphicon glyphicon-collapse-up +
    • +
    • + + glyphicon glyphicon-comment +
    • +
    • + + glyphicon glyphicon-compressed +
    • +
    • + + glyphicon glyphicon-copyright-mark +
    • +
    • + + glyphicon glyphicon-credit-card +
    • +
    • + + glyphicon glyphicon-cutlery +
    • +
    • + + glyphicon glyphicon-dashboard +
    • +
    • + + glyphicon glyphicon-download +
    • +
    • + + glyphicon glyphicon-download-alt +
    • +
    • + + glyphicon glyphicon-earphone +
    • +
    • + + glyphicon glyphicon-edit +
    • +
    • + + glyphicon glyphicon-eject +
    • +
    • + + glyphicon glyphicon-envelope +
    • +
    • + + glyphicon glyphicon-euro +
    • +
    • + + glyphicon glyphicon-exclamation-sign +
    • +
    • + + glyphicon glyphicon-expand +
    • +
    • + + glyphicon glyphicon-export +
    • +
    • + + glyphicon glyphicon-eye-close +
    • +
    • + + glyphicon glyphicon-eye-open +
    • +
    • + + glyphicon glyphicon-facetime-video +
    • +
    • + + glyphicon glyphicon-fast-backward +
    • +
    • + + glyphicon glyphicon-fast-forward +
    • +
    • + + glyphicon glyphicon-file +
    • +
    • + + glyphicon glyphicon-film +
    • +
    • + + glyphicon glyphicon-filter +
    • +
    • + + glyphicon glyphicon-fire +
    • +
    • + + glyphicon glyphicon-flag +
    • +
    • + + glyphicon glyphicon-flash +
    • +
    • + + glyphicon glyphicon-floppy-disk +
    • +
    • + + glyphicon glyphicon-floppy-open +
    • +
    • + + glyphicon glyphicon-floppy-remove +
    • +
    • + + glyphicon glyphicon-floppy-save +
    • +
    • + + glyphicon glyphicon-floppy-saved +
    • +
    • + + glyphicon glyphicon-folder-close +
    • +
    • + + glyphicon glyphicon-folder-open +
    • +
    • + + glyphicon glyphicon-font +
    • +
    • + + glyphicon glyphicon-forward +
    • +
    • + + glyphicon glyphicon-fullscreen +
    • +
    • + + glyphicon glyphicon-gbp +
    • +
    • + + glyphicon glyphicon-gift +
    • +
    • + + glyphicon glyphicon-glass +
    • +
    • + + glyphicon glyphicon-globe +
    • +
    • + + glyphicon glyphicon-hand-down +
    • +
    • + + glyphicon glyphicon-hand-left +
    • +
    • + + glyphicon glyphicon-hand-right +
    • +
    • + + glyphicon glyphicon-hand-up +
    • +
    • + + glyphicon glyphicon-hd-video +
    • +
    • + + glyphicon glyphicon-hdd +
    • +
    • + + glyphicon glyphicon-header +
    • +
    • + + glyphicon glyphicon-headphones +
    • +
    • + + glyphicon glyphicon-heart +
    • +
    • + + glyphicon glyphicon-heart-empty +
    • +
    • + + glyphicon glyphicon-home +
    • +
    • + + glyphicon glyphicon-import +
    • +
    • + + glyphicon glyphicon-inbox +
    • +
    • + + glyphicon glyphicon-indent-left +
    • +
    • + + glyphicon glyphicon-indent-right +
    • +
    • + + glyphicon glyphicon-info-sign +
    • +
    • + + glyphicon glyphicon-italic +
    • +
    • + + glyphicon glyphicon-leaf +
    • +
    • + + glyphicon glyphicon-link +
    • +
    • + + glyphicon glyphicon-list +
    • +
    • + + glyphicon glyphicon-list-alt +
    • +
    • + + glyphicon glyphicon-lock +
    • +
    • + + glyphicon glyphicon-log-in +
    • +
    • + + glyphicon glyphicon-log-out +
    • +
    • + + glyphicon glyphicon-magnet +
    • +
    • + + glyphicon glyphicon-map-marker +
    • +
    • + + glyphicon glyphicon-minus +
    • +
    • + + glyphicon glyphicon-minus-sign +
    • +
    • + + glyphicon glyphicon-move +
    • +
    • + + glyphicon glyphicon-music +
    • +
    • + + glyphicon glyphicon-new-window +
    • +
    • + + glyphicon glyphicon-off +
    • +
    • + + glyphicon glyphicon-ok +
    • +
    • + + glyphicon glyphicon-ok-circle +
    • +
    • + + glyphicon glyphicon-ok-sign +
    • +
    • + + glyphicon glyphicon-open +
    • +
    • + + glyphicon glyphicon-paperclip +
    • +
    • + + glyphicon glyphicon-pause +
    • +
    • + + glyphicon glyphicon-pencil +
    • +
    • + + glyphicon glyphicon-phone +
    • +
    • + + glyphicon glyphicon-phone-alt +
    • +
    • + + glyphicon glyphicon-picture +
    • +
    • + + glyphicon glyphicon-plane +
    • +
    • + + glyphicon glyphicon-play +
    • +
    • + + glyphicon glyphicon-play-circle +
    • +
    • + + glyphicon glyphicon-plus +
    • +
    • + + glyphicon glyphicon-plus-sign +
    • +
    • + + glyphicon glyphicon-print +
    • +
    • + + glyphicon glyphicon-pushpin +
    • +
    • + + glyphicon glyphicon-qrcode +
    • +
    • + + glyphicon glyphicon-question-sign +
    • +
    • + + glyphicon glyphicon-random +
    • +
    • + + glyphicon glyphicon-record +
    • +
    • + + glyphicon glyphicon-refresh +
    • +
    • + + glyphicon glyphicon-registration-mark +
    • +
    • + + glyphicon glyphicon-remove +
    • +
    • + + glyphicon glyphicon-remove-circle +
    • +
    • + + glyphicon glyphicon-remove-sign +
    • +
    • + + glyphicon glyphicon-repeat +
    • +
    • + + glyphicon glyphicon-resize-full +
    • +
    • + + glyphicon glyphicon-resize-horizontal +
    • +
    • + + glyphicon glyphicon-resize-small +
    • +
    • + + glyphicon glyphicon-resize-vertical +
    • +
    • + + glyphicon glyphicon-retweet +
    • +
    • + + glyphicon glyphicon-road +
    • +
    • + + glyphicon glyphicon-save +
    • +
    • + + glyphicon glyphicon-saved +
    • +
    • + + glyphicon glyphicon-screenshot +
    • +
    • + + glyphicon glyphicon-sd-video +
    • +
    • + + glyphicon glyphicon-search +
    • +
    • + + glyphicon glyphicon-send +
    • +
    • + + glyphicon glyphicon-share +
    • +
    • + + glyphicon glyphicon-share-alt +
    • +
    • + + glyphicon glyphicon-shopping-cart +
    • +
    • + + glyphicon glyphicon-signal +
    • +
    • + + glyphicon glyphicon-sort +
    • +
    • + + glyphicon glyphicon-sort-by-alphabet +
    • +
    • + + glyphicon glyphicon-sort-by-alphabet-alt +
    • +
    • + + glyphicon glyphicon-sort-by-attributes +
    • +
    • + + glyphicon glyphicon-sort-by-attributes-alt +
    • +
    • + + glyphicon glyphicon-sort-by-order +
    • +
    • + + glyphicon glyphicon-sort-by-order-alt +
    • +
    • + + glyphicon glyphicon-sound-5-1 +
    • +
    • + + glyphicon glyphicon-sound-6-1 +
    • +
    • + + glyphicon glyphicon-sound-7-1 +
    • +
    • + + glyphicon glyphicon-sound-dolby +
    • +
    • + + glyphicon glyphicon-sound-stereo +
    • +
    • + + glyphicon glyphicon-star +
    • +
    • + + glyphicon glyphicon-star-empty +
    • +
    • + + glyphicon glyphicon-stats +
    • +
    • + + glyphicon glyphicon-step-backward +
    • +
    • + + glyphicon glyphicon-step-forward +
    • +
    • + + glyphicon glyphicon-stop +
    • +
    • + + glyphicon glyphicon-subtitles +
    • +
    • + + glyphicon glyphicon-tag +
    • +
    • + + glyphicon glyphicon-tags +
    • +
    • + + glyphicon glyphicon-tasks +
    • +
    • + + glyphicon glyphicon-text-height +
    • +
    • + + glyphicon glyphicon-text-width +
    • +
    • + + glyphicon glyphicon-th +
    • +
    • + + glyphicon glyphicon-th-large +
    • +
    • + + glyphicon glyphicon-th-list +
    • +
    • + + glyphicon glyphicon-thumbs-down +
    • +
    • + + glyphicon glyphicon-thumbs-up +
    • +
    • + + glyphicon glyphicon-time +
    • +
    • + + glyphicon glyphicon-tint +
    • +
    • + + glyphicon glyphicon-tower +
    • +
    • + + glyphicon glyphicon-transfer +
    • +
    • + + glyphicon glyphicon-trash +
    • +
    • + + glyphicon glyphicon-tree-conifer +
    • +
    • + + glyphicon glyphicon-tree-deciduous +
    • +
    • + + glyphicon glyphicon-unchecked +
    • +
    • + + glyphicon glyphicon-upload +
    • +
    • + + glyphicon glyphicon-usd +
    • +
    • + + glyphicon glyphicon-user +
    • +
    • + + glyphicon glyphicon-volume-down +
    • +
    • + + glyphicon glyphicon-volume-off +
    • +
    • + + glyphicon glyphicon-volume-up +
    • +
    • + + glyphicon glyphicon-warning-sign +
    • +
    • + + glyphicon glyphicon-wrench +
    • +
    • + + glyphicon glyphicon-zoom-in +
    • +
    • + + glyphicon glyphicon-zoom-out +
    • +
    -
      +
      +
      • .glyphicon .icon-adn @@ -2343,9 +999,11 @@

        Brand icons

        .glyphicon .icon-youtube-sign
      +

      Medical icons

      -
        +
        +
        • .glyphicon .icon-ambulance @@ -2375,9 +1033,14 @@

          Medical icons

          .glyphicon .icon-user-md
        +

        How to use

        For performance reasons, all icons require a base class and individual icon class. To use, place the following code just about anywhere. Be sure to leave a space between the icon and text for proper padding.

        +
        +

        Don't mix with other components

        +

        Icon classes cannot be combined with other elements. They are designed to be standalone elements.

        +
        {% highlight html %} {% endhighlight %} @@ -2452,9 +1115,13 @@ {% endhighlight %} -

        Add .pull-right to a .dropdown-menu to right align the dropdown menu.

        +

        Add .dropdown-menu-right to a .dropdown-menu to right align the dropdown menu.

        +
        +

        Deprecated .pull-right alignment

        +

        As of v3.1, we've deprecated .pull-right on dropdown menus. To right-align a menu, use .dropdown-menu-right. Right-aligned nav components in the navbar use a mixin version of this class to automatically align the menu. To override it, use .dropdown-menu-left.

        +
        {% highlight html %} -
    @@ -529,6 +590,7 @@

    Events

    {% endhighlight %} +
    @@ -588,7 +650,13 @@

    Usage

    Via data attributes

    To easily add scrollspy behavior to your topbar navigation, add data-spy="scroll" to the element you want to spy on (most typically this would be the <body>). Then add the data-target attribute with the ID or class of the parent element of any Bootstrap .nav component.

    {% highlight html %} - + + ... + ... {% endhighlight %} @@ -596,7 +664,7 @@

    Via data attributes

    Via JavaScript

    Call the scrollspy via JavaScript:

    {% highlight js %} -$('body').scrollspy({ target: '#navbar-example' }) +$('body').scrollspy({ target: '.navbar-example' }) {% endhighlight %}
    @@ -836,6 +904,15 @@

    Four directions

    +{% highlight html %} + + + + + + + +{% endhighlight %}

    Opt-in functionality

    @@ -858,9 +935,17 @@

    Usage

    {% endhighlight %}

    Markup

    -

    The generated markup of a tooltip is rather simple, though it does require a position (by default, set to top by the plugin).

    +

    The required markup for a tooltip is only a data attribute and title on the HTML element you wish to have a tooltip. The generated markup of a tooltip is rather simple, though it does require a position (by default, set to top by the plugin).

    +
    +

    Multiple-line links

    +

    Sometimes you want to add a tooltip to a hyperlink that wraps multiple lines. The default behavior of the tooltip plugin is to center it horizontally and vertically. Add white-space: nowrap; to your anchors to avoid this.

    +
    {% highlight html linenos %} -
    + +Hover over me + + +
    Tooltip!
    @@ -943,11 +1028,6 @@

    Data attributes for individual tooltips

    Options for individual tooltips can alternatively be specified through the use of data attributes, as explained above.

    -

    Markup

    -{% highlight html %} -Hover over me -{% endhighlight %} -

    Methods

    $().tooltip(options)

    @@ -1093,6 +1173,29 @@

    Four directions

    +{% highlight html %} + + + + + + + +{% endhighlight %} + +
    +

    Multiple-line links

    +

    Sometimes you want to add a tooltip to a hyperlink that wraps multiple lines. The default behavior of the tooltip plugin is to center it horizontally and vertically. Add white-space: nowrap; to your anchors to avoid this.

    +

    Usage

    @@ -1116,7 +1219,7 @@

    Options

    animation boolean true - apply a CSS fade transition to the tooltip + apply a CSS fade transition to the popover html @@ -1134,7 +1237,7 @@

    Options

    selector string false - if a selector is provided, tooltip objects will be delegated to the specified targets. in practice, this is used to enable dynamic HTML content to have popovers added. See this and an informative example. + if a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See this and an informative example. trigger @@ -1327,14 +1430,23 @@

    Example uses

    Stateful

    Add data-loading-text="Loading..." to use a loading state on a button.

    -
    {% highlight html %} - + {% endhighlight %}

    Single toggle

    @@ -1408,7 +1520,7 @@

    Radio

    Usage

    Enable buttons via JavaScript:

    {% highlight js %} -$('.btn-group').button() +$('.btn').button() {% endhighlight %}

    Markup

    @@ -1426,14 +1538,23 @@

    Auto toggling

    You can enable auto toggling of a button by using the data-toggle attribute.

    {% highlight html %} - + {% endhighlight %}

    $().button('loading')

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text.

    {% highlight html %} - + + {% endhighlight %}
    @@ -1447,7 +1568,7 @@

    $().button('reset')

    $().button(string)

    Resets button state - swaps text to any data defined text state.

    {% highlight html %} - + @@ -1593,7 +1714,7 @@

    Via data attributes

    Via JavaScript

    Enable manually with:

    {% highlight js %} -$(".collapse").collapse() +$('.collapse').collapse() {% endhighlight %}

    Options

    @@ -1926,22 +2047,27 @@

    Example


    Usage

    +

    Use the affix plugin via data attributes or manually with your own JavaScript. In both situations, you must provide CSS for the positioning of your content.

    + +

    Positioning via CSS

    +

    The affix plugin toggles between three classes, each representing a particular state: .affix, .affix-top, and .affix-bottom. You must provide the styles for these classes yourself (independent of this plugin) to handle the actual positions.

    +

    Here's how the affix plugin works:

    +
      +
    1. To start, the plugin adds .affix-top to indicate the element is in its top-most position. At this point no CSS positioning is required.
    2. +
    3. Scrolling past the element you want affixed should trigger the actual affixing. This is where .affix replaces .affix-top and sets position: fixed; (provided by Bootstrap's code CSS).
    4. +
    5. If a bottom offset is defined, scrolling past that should replace .affix with .affix-bottom. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add position: absolute; when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.
    6. +
    +

    Follow the above steps to set your CSS for either of the usage options below.

    Via data attributes

    -

    To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. Then use offsets to define when to toggle the pinning of an element on and off.

    +

    To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. Use offsets to define when to toggle the pinning of an element.

    {% highlight html %} -
    ...
    +
    + ... +
    {% endhighlight %} -
    -

    Requires independent styling ;)

    -

    - Affix toggles between three states/classes: .affix, .affix-top, and .affix-bottom. You must provide the styles for these classes yourself (independent of this plugin). - The .affix-top class should be in the regular flow of the document. The .affix class should be position: fixed. And .affix-bottom should be position: absolute. Note: .affix-bottom is special in that the plugin will place the element with JS relative to the offset: { bottom: number } option you've provided. -

    -
    -

    Via JavaScript

    Call the affix plugin via JavaScript:

    {% highlight js %} diff --git a/js/.jscs.json b/js/.jscs.json new file mode 100644 index 000000000000..e02344fd5a50 --- /dev/null +++ b/js/.jscs.json @@ -0,0 +1,14 @@ +{ + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], + "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "requireRightStickedOperators": ["!"], + "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowKeywords": ["with"], + "validateLineBreaks": "LF", + "requireLineFeedAtFileEnd": true +} diff --git a/js/.jshintrc b/js/.jshintrc index fdfdfbbfb3df..c8cccda377bb 100644 --- a/js/.jshintrc +++ b/js/.jshintrc @@ -10,5 +10,6 @@ "expr" : true, "laxbreak" : true, "laxcomma" : true, + "quotmark" : "single", "validthis": true } \ No newline at end of file diff --git a/js/affix.js b/js/affix.js index 7d111ecc4d08..0650ce3ae5f2 100644 --- a/js/affix.js +++ b/js/affix.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: affix.js v3.0.2 + * Bootstrap: affix.js v3.0.3 * http://getbootstrap.com/javascript/#affix * ======================================================================== * Copyright 2013 Twitter, Inc. @@ -18,7 +18,7 @@ * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { 'use strict'; // AFFIX CLASS DEFINITION // ====================== diff --git a/js/alert.js b/js/alert.js index 031d72aa598b..13a0cab915aa 100644 --- a/js/alert.js +++ b/js/alert.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: alert.js v3.0.2 + * Bootstrap: alert.js v3.0.3 * http://getbootstrap.com/javascript/#alerts * ======================================================================== * Copyright 2013 Twitter, Inc. @@ -18,7 +18,7 @@ * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { 'use strict'; // ALERT CLASS DEFINITION // ====================== diff --git a/js/button.js b/js/button.js index 3c1613506cd2..6c66960d8201 100644 --- a/js/button.js +++ b/js/button.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: button.js v3.0.2 + * Bootstrap: button.js v3.0.3 * http://getbootstrap.com/javascript/#buttons * ======================================================================== * Copyright 2013 Twitter, Inc. @@ -18,7 +18,7 @@ * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { 'use strict'; // BUTTON PUBLIC CLASS DEFINITION // ============================== diff --git a/js/carousel.js b/js/carousel.js index 902d4d781e29..26f3832ff463 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: carousel.js v3.0.2 + * Bootstrap: carousel.js v3.0.3 * http://getbootstrap.com/javascript/#carousel * ======================================================================== * Copyright 2013 Twitter, Inc. @@ -18,7 +18,7 @@ * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { 'use strict'; // CAROUSEL CLASS DEFINITION // ========================= @@ -69,7 +69,7 @@ if (pos > (this.$items.length - 1) || pos < 0) return - if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) if (activeIndex == pos) return this.pause().cycle() return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) @@ -121,7 +121,7 @@ if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') - this.$element.one('slid', function () { + this.$element.one('slid.bs.carousel', function () { var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) $nextIndicator && $nextIndicator.addClass('active') }) @@ -139,7 +139,7 @@ $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false - setTimeout(function () { that.$element.trigger('slid') }, 0) + setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) }) .emulateTransitionEnd(600) } else { @@ -148,7 +148,7 @@ $active.removeClass('active') $next.addClass('active') this.sliding = false - this.$element.trigger('slid') + this.$element.trigger('slid.bs.carousel') } isCycling && this.cycle() diff --git a/js/collapse.js b/js/collapse.js index 9967b167f108..7bc9fcb42537 100644 --- a/js/collapse.js +++ b/js/collapse.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: collapse.js v3.0.2 + * Bootstrap: collapse.js v3.0.3 * http://getbootstrap.com/javascript/#collapse * ======================================================================== * Copyright 2013 Twitter, Inc. @@ -18,7 +18,7 @@ * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { 'use strict'; // COLLAPSE PUBLIC CLASS DEFINITION // ================================ diff --git a/js/dropdown.js b/js/dropdown.js index d5da638def3b..3f71c7569bff 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: dropdown.js v3.0.2 + * Bootstrap: dropdown.js v3.0.3 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== * Copyright 2013 Twitter, Inc. @@ -18,7 +18,7 @@ * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { 'use strict'; // DROPDOWN CLASS DEFINITION // ========================= @@ -26,7 +26,7 @@ var backdrop = '.dropdown-backdrop' var toggle = '[data-toggle=dropdown]' var Dropdown = function (element) { - var $el = $(element).on('click.bs.dropdown', this.toggle) + $(element).on('click.bs.dropdown', this.toggle) } Dropdown.prototype.toggle = function (e) { @@ -41,7 +41,7 @@ if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we we use a backdrop because click events don't delegate + // if mobile we use a backdrop because click events don't delegate $('