Skip to content

Commit

Permalink
Merge branch 'master' into docs_derp
Browse files Browse the repository at this point in the history
Conflicts:
	_config.yml
	docs/_includes/footer.html
	docs/_includes/nav-main.html
	docs/_includes/old-bs-docs.html
	docs/_layouts/default.html
	docs/_layouts/home.html
	docs/getting-started.html
	docs/index.html
  • Loading branch information
mdo committed Dec 31, 2013
2 parents 9e1153d + 8812856 commit b253cb2
Show file tree
Hide file tree
Showing 113 changed files with 406 additions and 128 deletions.
49 changes: 29 additions & 20 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ module.exports = function (grunt) {
RegExp.quote = function (string) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
}

var fs = require('fs')
var btoa = require('btoa')

// Project configuration.
grunt.initConfig({

Expand Down Expand Up @@ -41,7 +44,7 @@ module.exports = function (grunt) {
src: ['js/tests/unit/*.js']
},
assets: {
src: ['docs-assets/js/application.js', 'docs-assets/js/customizer.js']
src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
}
},

Expand All @@ -62,12 +65,12 @@ module.exports = function (grunt) {

csslint: {
options: {
csslintrc: '.csslintrc'
csslintrc: 'less/.csslintrc'
},
src: [
'dist/css/bootstrap.css',
'dist/css/bootstrap-theme.css',
'docs-assets/css/docs.css'
'docs/assets/css/docs.css'
]
},

Expand Down Expand Up @@ -115,13 +118,13 @@ module.exports = function (grunt) {
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/customizer.js'
'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'
dest: 'docs/assets/js/customize.js'
}
},

Expand Down Expand Up @@ -182,7 +185,7 @@ module.exports = function (grunt) {
csscomb: {
sort: {
options: {
sortOrder: '.csscomb.json'
config: 'less/.csscomb.json'
},
files: {
'dist/css/<%= pkg.name %>.css': ['dist/css/<%= pkg.name %>.css'],
Expand All @@ -196,6 +199,16 @@ module.exports = function (grunt) {
expand: true,
src: ['fonts/*'],
dest: 'dist/'
},
docs: {
expand: true,
cwd: './dist',
src: [
'{css,js}/*.min.*',
'{css}/*.map',
'fonts/*'
],
dest: 'docs/dist'
}
},

Expand Down Expand Up @@ -267,7 +280,7 @@ module.exports = function (grunt) {
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')
browsers: grunt.file.readYAML('test-infra/sauce_browsers.yml')
}
}
}
Expand Down Expand Up @@ -306,10 +319,10 @@ module.exports = function (grunt) {
grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']);

// Fonts distribution task.
grunt.registerTask('dist-fonts', ['copy']);
grunt.registerTask('dist-docs', ['copy:docs']);

// Full distribution task.
grunt.registerTask('dist', ['clean', 'dist-css', 'dist-fonts', 'dist-js']);
grunt.registerTask('dist', ['clean', 'dist-css', 'copy:fonts', 'dist-js']);

// Default task.
grunt.registerTask('default', ['test', 'dist', 'build-glyphicons-data', 'build-customizer']);
Expand All @@ -320,8 +333,6 @@ module.exports = function (grunt) {
grunt.registerTask('change-version-number', ['sed']);

grunt.registerTask('build-glyphicons-data', function () {
var fs = require('fs')

// Pass encoding, utf8, so `readFileSync` will return a string instead of a
// buffer
var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8')
Expand All @@ -340,15 +351,13 @@ module.exports = function (grunt) {
}

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

fs.writeFileSync('_data/glyphicons.yml', glyphiconsData)
fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData)
});

// task for building customizer
grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () {
var fs = require('fs')

function getFiles(type) {
var files = {}
fs.readdirSync(type)
Expand All @@ -363,6 +372,6 @@ module.exports = function (grunt) {
}

var files = getFiles('js') + getFiles('less') + getFiles('fonts')
fs.writeFileSync('docs-assets/js/raw-files.js', files)
fs.writeFileSync('docs/assets/js/raw-files.js', files)
});
};
34 changes: 12 additions & 22 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,27 @@ pygments: true
permalink: pretty

# Server
source: ./docs
destination: ./_gh_pages
host: 0.0.0.0
port: 9001
exclude:
- ".editorconfig"
- ".gitignore"
- "bower.json"
- "CNAME"
- "composer.json"
- "CONTRIBUTING.md"
- "DOCS-LICENSE"
- "Gruntfile.js"
- "less"
- "LICENSE"
- "node_modules"
- "package.json"
- "README.md"
- "sauce_browsers.yml"
- "test-infra"
baseurl: /
url: http://localhost:9001

# Custom vars
current_version: 3.0.3
repo: https://github.com/twbs/bootstrap

download_source: https://github.com/twbs/bootstrap/archive/v3.0.3.zip
download_dist: https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip
download_sass: https://github.com/twbs/bootstrap-sass/archive/v3.0.3.0.tar.gz
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
sass: https://github.com/twbs/bootstrap-sass/archive/v3.0.3.0.tar.gz

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
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
cdn:
css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css
css_theme: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css
js: //netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js
44 changes: 30 additions & 14 deletions dist/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$next = this.$element.find('.item')[fallback]()
}

if ($next.hasClass('active')) return
if ($next.hasClass('active')) return this.sliding = false

var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
this.$element.trigger(e)
Expand Down Expand Up @@ -659,13 +659,14 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
}

$parent.trigger(e = $.Event('show.bs.dropdown'))
var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))

if (e.isDefaultPrevented()) return

$parent
.toggleClass('open')
.trigger('shown.bs.dropdown')
.trigger('shown.bs.dropdown', relatedTarget)

$this.focus()
}
Expand All @@ -691,7 +692,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return $this.click()
}

var $items = $('[role=menu] li:not(.divider):visible a', $parent)
var desc = ' li:not(.divider):visible a'
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)

if (!$items.length) return

Expand All @@ -704,14 +706,15 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$items.eq(index).focus()
}

function clearMenus() {
function clearMenus(e) {
$(backdrop).remove()
$(toggle).each(function (e) {
$(toggle).each(function () {
var $parent = getParent($(this))
var relatedTarget = { relatedTarget: this }
if (!$parent.hasClass('open')) return
$parent.trigger(e = $.Event('hide.bs.dropdown'))
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$parent.removeClass('open').trigger('hidden.bs.dropdown')
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}

Expand Down Expand Up @@ -763,7 +766,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]', Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)

}(jQuery);

Expand All @@ -787,9 +790,13 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
this.$backdrop =
this.isShown = null

if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}

Modal.DEFAULTS = {
Expand Down Expand Up @@ -823,7 +830,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
that.$element.appendTo(document.body) // don't move modals dom position
}

that.$element.show()
that.$element
.show()
.scrollTop(0)

if (transition) {
that.$element[0].offsetWidth // force reflow
Expand Down Expand Up @@ -1448,7 +1457,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
var content = this.getContent()

$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
$tip.find('.popover-content')[ // we use append for html objects to maintain js events
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
](content)

$tip.removeClass('fade top bottom left right in')

Expand Down Expand Up @@ -1564,6 +1575,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"

return ($href
&& $href.length
&& $href.is(':visible')
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
})
.sort(function (a, b) { return a[0] - b[0] })
Expand All @@ -1586,6 +1598,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return activeTarget != (i = targets.last()[0]) && this.activate(i)
}

if (activeTarget && scrollTop <= offsets[0]) {
return activeTarget != (i = targets[0]) && this.activate(i)
}

for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
Expand Down
2 changes: 1 addition & 1 deletion dist/js/bootstrap.min.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 5 additions & 8 deletions _includes/footer.html → docs/_includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="{{ page.base_url }}dist/js/bootstrap.min.js"></script>

<script src="{{ page.base_url }}docs-assets/js/holder.js"></script>
<script src="{{ page.base_url }}docs-assets/js/zeroclipboard.min.js"></script>

<script src="{{ page.base_url }}docs-assets/js/application.js"></script>
<script src="dist/js/bootstrap.min.js"></script>
<script src="assets/js/holder.js"></script>
<script src="assets/js/application.js"></script>

{% if page.slug == "customize" %}
<script src="{{ page.base_url }}docs-assets/js/raw-files.js"></script>
<script src="{{ page.base_url }}docs-assets/js/customize.js"></script>
<script src="assets/js/raw-files.js"></script>
<script src="assets/js/customize.js"></script>
{% endif %}

{% comment %}
Expand Down
12 changes: 6 additions & 6 deletions _includes/header.html → docs/_includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
</title>

<!-- Bootstrap core CSS -->
<link href="{{ page.base_url }}dist/css/bootstrap.min.css" rel="stylesheet">
<link href="{{ site.baseurl }}dist/css/bootstrap.min.css" rel="stylesheet">

<!-- Documentation extras -->
<link href="{{ page.base_url }}docs-assets/css/docs.css" rel="stylesheet">
<link href="{{ page.base_url }}docs-assets/css/pygments-manni.css" rel="stylesheet">
<!--[if lt IE 9]><script src="{{ page.base_url }}docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<link href="{{ site.baseurl }}assets/css/docs.css" rel="stylesheet">
<link href="{{ site.baseurl }}assets/css/pygments-manni.css" rel="stylesheet">
<!--[if lt IE 9]><script src="{{ site.baseurl }}assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand All @@ -28,8 +28,8 @@
<![endif]-->

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ page.base_url }}docs-assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="{{ page.base_url }}docs-assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ site.baseurl }}assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="{{ site.baseurl }}assets/ico/favicon.ico">

<script>
var _gaq = _gaq || [];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions _includes/nav-main.html → docs/_includes/nav-main.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="{{ page.base_url }}" class="navbar-brand">Bootstrap</a>
<a href="{{ site.baseurl }}" class="navbar-brand">Bootstrap</a>
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li{% if page.slug == "getting-started" %} class="active"{% endif %}>
<a href="{{ page.base_url }}getting-started">Getting started</a>
<a href="{{ site.baseurl }}getting-started">Getting started</a>
</li>
<li{% if page.slug == "css" %} class="active"{% endif %}>
<a href="{{ page.base_url }}css">CSS</a>
<a href="{{ site.baseurl }}css">CSS</a>
</li>
<li{% if page.slug == "components" %} class="active"{% endif %}>
<a href="{{ page.base_url }}components">Components</a>
<a href="{{ site.baseurl }}components">Components</a>
</li>
<li{% if page.slug == "js" %} class="active"{% endif %}>
<a href="{{ page.base_url }}javascript">JavaScript</a>
<a href="{{ site.baseurl }}javascript">JavaScript</a>
</li>
<li{% if page.slug == "customize" %} class="active"{% endif %}>
<a href="{{ page.base_url }}customize">Customize</a>
<a href="{{ site.baseurl }}customize">Customize</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion _layouts/default.html → docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ <h1>{{ page.title }}</h1>

<!-- JS and analytics only. -->
{% include footer.html %}

</body>
</html>
Loading

0 comments on commit b253cb2

Please sign in to comment.