Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/upstream/master'
Browse files Browse the repository at this point in the history
* remotes/upstream/master: (76 commits)
  grunt dist
  Update docs per `.container-fluid` addition - Remove `.container-fluid` from "removed classes". - Container isn't fluid by default (`.container`) and `.row` isn't percentage-based, so update docs.
  Don't test Linux browsers since we don't support them officially and they're failing our tests
  Fixes twbs#12171: Ensure panel groups have a bottom margin since we nuke it on child panels
  refer to correct component
  docs mention for twbs#12188
  use height adjectives for greater clarity
  document twbs#11675
  rm outdated `<select>` references from comments in forms.less
  Clarify that the focus docs styles are not in the repo, per twbs/bootstrap-sass#497
  Fixes twbs#11990 and twbs#12159: Make range inputs block level and 100% wide by default
  grunt dist
  mixins.less: fix typo in comment
  use periods for consistency in each line
  Use absolute instead of relative URLs
  grunt dist
  Update paths in bower.json
  Add new varaible @icon-font-svg-id and set it to be the correct SVG font ID, used new variable in glyphicons.less
  missing a period after "Twitter, Inc"
  bump grunt-contrib-jade to v0.9.1
  ...

Conflicts:
	Gruntfile.js
	dist/css/bootstrap-theme.css
	dist/css/bootstrap-theme.css.map
	dist/css/bootstrap-theme.min.css
	dist/css/bootstrap.css
	dist/css/bootstrap.css.map
	dist/css/bootstrap.min.css
	dist/js/bootstrap.js
	dist/js/bootstrap.min.js
	less/variables.less
	test-infra/sauce_browsers.yml
  • Loading branch information
kevinawoo committed Jan 11, 2014
2 parents 993ed12 + e290897 commit b2adb69
Show file tree
Hide file tree
Showing 70 changed files with 3,034 additions and 2,053 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 0.10
- "0.10"
before_install:
- time sudo pip install --use-mirrors -r test-infra/requirements.txt
- rvm use 1.9.3 --fuzzy
Expand Down
26 changes: 13 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ implementing features, refactoring code, porting to a different language),
otherwise you risk spending a lot of time working on something that the
project's developers might not want to merge into the project.

Please adhere to the [coding conventions](#code-conventions) used throughout a
Please adhere to the [coding guidelines](#code-guidelines) used throughout the
project (indentation, accurate comments, etc.) and any other requirements
(such as test coverage).

Adhering to the following this process is the best way to get your work
Adhering to the following process is the best way to get your work
included in the project:

1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork,
Expand Down Expand Up @@ -147,27 +147,27 @@ included in the project:
with a clear title and description against the `master` branch.

**IMPORTANT**: By submitting a patch, you agree to allow the project owners to
license your work under the the terms of the [MIT License](LICENSE.md).
license your work under the terms of the [MIT License](LICENSE.md).


## Code guidelines

### HTML

- Two spaces for indentation, never tabs
- Double quotes only, never single quotes
- Always use proper indentation
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags)
- Two spaces for indentation, never tabs.
- Double quotes only, never single quotes.
- Always use proper indentation.
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`.

### CSS

- CSS changes must be done in `.less` files first, never just in the compiled `.css` files
- 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
- CSS changes must be done in `.less` files first, never just in the compiled `.css` files.
- 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`).
Expand Down
134 changes: 79 additions & 55 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ module.exports = function (grunt) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
}

var BsLessdocParser = require('./docs/grunt/bs-lessdoc-parser.js')
var fs = require('fs')
var btoa = require('btoa')
var generateGlyphiconsData = require('./docs/grunt/bs-glyphicons-data-generator.js')
var generateRawFilesJs = require('./docs/grunt/bs-raw-files-generator.js')
var path = require('path')

// Project configuration.
grunt.initConfig({
Expand All @@ -20,10 +23,16 @@ module.exports = function (grunt) {
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n' +
' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under <%= _.pluck(pkg.licenses, "type") %> (<%= _.pluck(pkg.licenses, "url") %>)\n' +
' */\n',
jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n',
bannerDocs: '/*!\n' +
' * Bootstrap Docs (<%= pkg.homepage %>)\n' +
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under the Creative Commons Attribution 3.0 Unported License. For\n' +
' * details, see http://creativecommons.org/licenses/by/3.0/.\n' +
' */\n',
jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'Bootstrap requires jQuery\') }\n\n',

// Task configuration.
clean: {
Expand All @@ -45,6 +54,9 @@ module.exports = function (grunt) {
},
assets: {
src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
},
docsGrunt: {
src: ['docs/grunt/*.js']
}
},

Expand All @@ -60,6 +72,12 @@ module.exports = function (grunt) {
},
test: {
src: ['js/tests/unit/*.js']
},
assets: {
src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
},
docsGrunt: {
src: ['docs/grunt/*.js']
}
},

Expand Down Expand Up @@ -101,30 +119,37 @@ module.exports = function (grunt) {
uglify: {
bootstrap: {
options: {
banner: '<%= banner %>\n',
banner: '<%= banner %>',
report: 'min'
},
src: ['<%= concat.bootstrap.dest %>'],
dest: 'dist/js/<%= pkg.name %>.min.js'
},
customize: {
options: {
banner: '/*!\n' +
' * Bootstrap Docs (<%= pkg.homepage %>)\n' +
' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under the Creative Commons Attribution 3.0 Unported License. For\n' +
' * details, see http://creativecommons.org/licenses/by/3.0/.\n' +
' */\n',
banner: '<%= bannerDocs %>',
report: 'min'
},
src: [
'docs/assets/js/less.js',
'docs/assets/js/jszip.js',
'docs/assets/js/uglify.js',
'docs/assets/js/filesaver.js',
'docs/assets/js/raw-files.js',
'docs/assets/js/customizer.js'
],
dest: 'docs/assets/js/customize.js'
dest: 'docs/assets/js/customize.min.js'
},
docsJs: {
options: {
banner: '<%= bannerDocs %>',
report: 'min'
},
src: [
'docs/assets/js/holder.js',
'docs/assets/js/application.js'
],
dest: 'docs/assets/js/docs.min.js'
}
},

Expand Down Expand Up @@ -165,6 +190,23 @@ module.exports = function (grunt) {
}
},

cssmin: {
compress: {
options: {
banner: '<%= bannerDocs %>',
keepSpecialComments: '*',
noAdvanced: true, // turn advanced optimizations off until it's fixed in clean-css
report: 'min',
selectorsMergeMode: 'ie8'
},
src: [
'docs/assets/css/docs.css',
'docs/assets/css/pygments-manni.css'
],
dest: 'docs/assets/css/pack.min.css'
}
},

usebanner: {
dist: {
options: {
Expand Down Expand Up @@ -205,7 +247,7 @@ module.exports = function (grunt) {
cwd: './dist',
src: [
'{css,js}/*.min.*',
'{css}/*.map',
'css/*.map',
'fonts/*'
],
},
Expand Down Expand Up @@ -237,6 +279,23 @@ module.exports = function (grunt) {
docs: {}
},

jade: {
compile: {
options: {
pretty: true,
data: function () {
var filePath = path.join(__dirname, 'less/variables.less');
var fileContent = fs.readFileSync(filePath, {encoding: 'utf8'});
var parser = new BsLessdocParser(fileContent);
return {sections: parser.parseFile()};
}
},
files: {
'docs/_includes/customizer-variables.html': 'docs/customizer-variables.jade'
}
}
},

validation: {
options: {
charset: 'utf-8',
Expand Down Expand Up @@ -303,7 +362,7 @@ module.exports = function (grunt) {
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']);
testSubtasks = testSubtasks.concat(['dist-css', 'csslint', 'jshint', 'jscs', 'qunit', 'build-customizer-vars-form']);
}
// Skip HTML validation if running a different subset of the test suite
// if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'validate-html') {
Expand All @@ -322,7 +381,7 @@ module.exports = function (grunt) {
grunt.registerTask('dist-js', ['concat', 'uglify']);

// CSS distribution task.
grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']);
grunt.registerTask('dist-css', ['less', 'cssmin', 'csscomb', 'usebanner']);

// Fonts distribution task.
grunt.registerTask('dist-fonts', ['copy:fonts']);
Expand All @@ -341,49 +400,14 @@ module.exports = function (grunt) {
// This can be overzealous, so its changes should always be manually reviewed!
grunt.registerTask('change-version-number', ['sed']);

grunt.registerTask('build-glyphicons-data', function () {
// Pass encoding, utf8, so `readFileSync` will return a string instead of a
// buffer
var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8')
var glpyhiconsLines = glyphiconsFile.split('\n')

// Use any line that starts with ".glyphicon-" and capture the class name
var iconClassName = /^\.(glyphicon-[^\s]+)/
var glyphiconsData = '# This file is generated via Grunt task. **Do not edit directly.** \n' +
'# See the \'build-glyphicons-data\' task in Gruntfile.js.\n\n';
for (var i = 0, len = glpyhiconsLines.length; i < len; i++) {
var match = glpyhiconsLines[i].match(iconClassName)

if (match != null) {
glyphiconsData += '- ' + match[1] + '\n'
}
}

// Create the `_data` directory if it doesn't already exist
if (!fs.existsSync('docs/_data')) fs.mkdirSync('docs/_data')

fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData)
});
grunt.registerTask('build-glyphicons-data', generateGlyphiconsData);

// task for building customizer
grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () {
function getFiles(type) {
var files = {}
fs.readdirSync(type)
.filter(function (path) {
return type == 'fonts' ? true : new RegExp('\\.' + type + '$').test(path)
})
.forEach(function (path) {
var fullPath = type + '/' + path
return files[path] = (type == 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8'))
})
return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'
}

var files = getFiles('js') + getFiles('less') + getFiles('fonts')
fs.writeFileSync('docs/assets/js/raw-files.js', files)
});
grunt.registerTask('build-customizer', ['build-customizer-vars-form', 'build-raw-files']);
grunt.registerTask('build-customizer-vars-form', ['jade']);
grunt.registerTask('build-raw-files', 'Add scripts/less files to customizer.', generateRawFilesJs);

//custom tasks for loopfirst
grunt.registerTask('loopfirst_watch', ['dist', 'watch', 'copy']);
// grunt.registerTask('loopfirst_copy', ['dist', 'copy:loopfirst'])

};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Twitter, Inc
Copyright (c) 2011-2014 Twitter, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified

## Bugs and feature requests

Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).


## Documentation
Expand Down Expand Up @@ -88,7 +88,7 @@ Bootstrap uses [Grunt](http://gruntjs.com/) with convenient methods for working
From the command line:

1. Install `grunt-cli` globally with `npm install -g grunt-cli`.
2. Navigate to the root `/bootstrap` directory, then run `npm install`. npm will look at [package.json](package.json) and automatically install the necessary local dependencies listed there.
2. Navigate to the root `/bootstrap` directory, then run `npm install`. npm will look at [package.json](https://github.com/twbs/bootstrap/blob/master/package.json) and automatically install the necessary local dependencies listed there.

When completed, you'll be able to run the various Grunt commands provided from the command line.

Expand Down Expand Up @@ -120,7 +120,7 @@ Please read through our [contributing guidelines](https://github.com/twbs/bootst

More over, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](http://github.com/mdo/code-guide), maintained by [Mark Otto](http://github.com/mdo).

Editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>.
Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>.



Expand Down Expand Up @@ -170,4 +170,4 @@ For more information on SemVer, please visit <http://semver.org/>.

## Copyright and license

Copyright 2013 Twitter, Inc under [the MIT license](LICENSE).
Copyright 2011-2014 Twitter, Inc. under [the MIT license](LICENSE).
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ url: http://localhost:9001
# Custom vars
current_version: 3.0.3
repo: https://github.com/twbs/bootstrap
sass_repo: https://github.com/twbs/bootstrap-sass

download:
source: https://github.com/twbs/bootstrap/archive/v3.0.3.zip
dist: https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip

blog: http://blog.getbootstrap.com
expo: http://expo.getbootstrap.com
sass_repo: https://github.com/twbs/bootstrap-sass

cdn:
css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css
Expand Down
6 changes: 2 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
],
"ignore": [
"**/.*",
"*.html",
"_*",
"_config.yml",
"CNAME",
"composer.json",
"CONTRIBUTING.md",
"docs-assets",
"examples",
"docs",
"js/tests"
],
"dependencies": {
Expand Down
Loading

0 comments on commit b2adb69

Please sign in to comment.