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

Merge branch 'master' into docs_derp

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
parents 9e1153d0 8812856d
Showing with 89 additions and 80 deletions
+89 -80
...@@ -9,7 +9,10 @@ module.exports = function (grunt) { ...@@ -9,7 +9,10 @@ module.exports = function (grunt) {
RegExp.quote = function (string) { RegExp.quote = function (string) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&') return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
} }
var fs = require('fs')
var btoa = require('btoa') var btoa = require('btoa')
// Project configuration. // Project configuration.
grunt.initConfig({ grunt.initConfig({
...@@ -41,7 +44,7 @@ module.exports = function (grunt) { ...@@ -41,7 +44,7 @@ module.exports = function (grunt) {
src: ['js/tests/unit/*.js'] src: ['js/tests/unit/*.js']
}, },
assets: { assets: {
src: ['docs-assets/js/application.js', 'docs-assets/js/customizer.js'] src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
} }
}, },
...@@ -62,12 +65,12 @@ module.exports = function (grunt) { ...@@ -62,12 +65,12 @@ module.exports = function (grunt) {
csslint: { csslint: {
options: { options: {
csslintrc: '.csslintrc' csslintrc: 'less/.csslintrc'
}, },
src: [ src: [
'dist/css/bootstrap.css', 'dist/css/bootstrap.css',
'dist/css/bootstrap-theme.css', 'dist/css/bootstrap-theme.css',
'docs-assets/css/docs.css' 'docs/assets/css/docs.css'
] ]
}, },
...@@ -115,13 +118,13 @@ module.exports = function (grunt) { ...@@ -115,13 +118,13 @@ module.exports = function (grunt) {
report: 'min' report: 'min'
}, },
src: [ src: [
'docs-assets/js/less.js', 'docs/assets/js/less.js',
'docs-assets/js/jszip.js', 'docs/assets/js/jszip.js',
'docs-assets/js/uglify.js', 'docs/assets/js/uglify.js',
'docs-assets/js/filesaver.js', 'docs/assets/js/filesaver.js',
'docs-assets/js/customizer.js' 'docs/assets/js/customizer.js'
], ],
dest: 'docs-assets/js/customize.js' dest: 'docs/assets/js/customize.js'
} }
}, },
...@@ -182,7 +185,7 @@ module.exports = function (grunt) { ...@@ -182,7 +185,7 @@ module.exports = function (grunt) {
csscomb: { csscomb: {
sort: { sort: {
options: { options: {
sortOrder: '.csscomb.json' config: 'less/.csscomb.json'
}, },
files: { files: {
'dist/css/<%= pkg.name %>.css': ['dist/css/<%= pkg.name %>.css'], 'dist/css/<%= pkg.name %>.css': ['dist/css/<%= pkg.name %>.css'],
...@@ -196,6 +199,16 @@ module.exports = function (grunt) { ...@@ -196,6 +199,16 @@ module.exports = function (grunt) {
expand: true, expand: true,
src: ['fonts/*'], src: ['fonts/*'],
dest: 'dist/' dest: 'dist/'
},
docs: {
expand: true,
cwd: './dist',
src: [
'{css,js}/*.min.*',
'{css}/*.map',
'fonts/*'
],
dest: 'docs/dist'
} }
}, },
...@@ -267,7 +280,7 @@ module.exports = function (grunt) { ...@@ -267,7 +280,7 @@ module.exports = function (grunt) {
build: process.env.TRAVIS_JOB_ID, build: process.env.TRAVIS_JOB_ID,
concurrency: 3, concurrency: 3,
urls: ['http://127.0.0.1:3000/js/tests/index.html'], 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')
} }
} }
} }
...@@ -306,10 +319,10 @@ module.exports = function (grunt) { ...@@ -306,10 +319,10 @@ module.exports = function (grunt) {
grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']); grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']);
// Fonts distribution task. // Fonts distribution task.
grunt.registerTask('dist-fonts', ['copy']); grunt.registerTask('dist-docs', ['copy:docs']);
// Full distribution task. // 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. // Default task.
grunt.registerTask('default', ['test', 'dist', 'build-glyphicons-data', 'build-customizer']); grunt.registerTask('default', ['test', 'dist', 'build-glyphicons-data', 'build-customizer']);
...@@ -320,8 +333,6 @@ module.exports = function (grunt) { ...@@ -320,8 +333,6 @@ module.exports = function (grunt) {
grunt.registerTask('change-version-number', ['sed']); grunt.registerTask('change-version-number', ['sed']);
grunt.registerTask('build-glyphicons-data', function () { grunt.registerTask('build-glyphicons-data', function () {
var fs = require('fs')
// Pass encoding, utf8, so `readFileSync` will return a string instead of a // Pass encoding, utf8, so `readFileSync` will return a string instead of a
// buffer // buffer
var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8') var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8')
...@@ -340,15 +351,13 @@ module.exports = function (grunt) { ...@@ -340,15 +351,13 @@ module.exports = function (grunt) {
} }
// Create the `_data` directory if it doesn't already exist // 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 // task for building customizer
grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () { grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () {
var fs = require('fs')
function getFiles(type) { function getFiles(type) {
var files = {} var files = {}
fs.readdirSync(type) fs.readdirSync(type)
...@@ -363,6 +372,6 @@ module.exports = function (grunt) { ...@@ -363,6 +372,6 @@ module.exports = function (grunt) {
} }
var files = getFiles('js') + getFiles('less') + getFiles('fonts') 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)
}); });
}; };
...@@ -6,37 +6,27 @@ pygments: true ...@@ -6,37 +6,27 @@ pygments: true
permalink: pretty permalink: pretty
# Server # Server
source: ./docs
destination: ./_gh_pages destination: ./_gh_pages
host: 0.0.0.0
port: 9001 port: 9001
exclude: baseurl: /
- ".editorconfig" url: http://localhost:9001
- ".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"
# Custom vars # Custom vars
current_version: 3.0.3 current_version: 3.0.3
repo: https://github.com/twbs/bootstrap repo: https://github.com/twbs/bootstrap
download_source: https://github.com/twbs/bootstrap/archive/v3.0.3.zip download:
download_dist: https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip source: https://github.com/twbs/bootstrap/archive/v3.0.3.zip
download_sass: https://github.com/twbs/bootstrap-sass/archive/v3.0.3.0.tar.gz 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 blog: http://blog.getbootstrap.com
expo: http://expo.getbootstrap.com expo: http://expo.getbootstrap.com
sass_repo: https://github.com/twbs/bootstrap-sass sass_repo: https://github.com/twbs/bootstrap-sass
cdn_css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css cdn:
cdn_theme_css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css
cdn_js: //netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js 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
...@@ -351,7 +351,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -351,7 +351,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$next = this.$element.find('.item')[fallback]() $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 }) var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
this.$element.trigger(e) this.$element.trigger(e)
...@@ -659,13 +659,14 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -659,13 +659,14 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) $('<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 if (e.isDefaultPrevented()) return
$parent $parent
.toggleClass('open') .toggleClass('open')
.trigger('shown.bs.dropdown') .trigger('shown.bs.dropdown', relatedTarget)
$this.focus() $this.focus()
} }
...@@ -691,7 +692,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -691,7 +692,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return $this.click() 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 if (!$items.length) return
...@@ -704,14 +706,15 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -704,14 +706,15 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$items.eq(index).focus() $items.eq(index).focus()
} }
function clearMenus() { function clearMenus(e) {
$(backdrop).remove() $(backdrop).remove()
$(toggle).each(function (e) { $(toggle).each(function () {
var $parent = getParent($(this)) var $parent = getParent($(this))
var relatedTarget = { relatedTarget: this }
if (!$parent.hasClass('open')) return if (!$parent.hasClass('open')) return
$parent.trigger(e = $.Event('hide.bs.dropdown')) $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return if (e.isDefaultPrevented()) return
$parent.removeClass('open').trigger('hidden.bs.dropdown') $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
}) })
} }
...@@ -763,7 +766,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -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', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) .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); }(jQuery);
...@@ -787,9 +790,13 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -787,9 +790,13 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
this.$backdrop = this.$backdrop =
this.isShown = null this.isShown = null
if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () { if (this.options.remote) {
this.$element.trigger('loaded.bs.modal') this.$element
}, this)) .find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
} }
Modal.DEFAULTS = { Modal.DEFAULTS = {
...@@ -823,7 +830,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -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.appendTo(document.body) // don't move modals dom position
} }
that.$element.show() that.$element
.show()
.scrollTop(0)
if (transition) { if (transition) {
that.$element[0].offsetWidth // force reflow that.$element[0].offsetWidth // force reflow
...@@ -1448,7 +1457,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -1448,7 +1457,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
var content = this.getContent() var content = this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) $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') $tip.removeClass('fade top bottom left right in')
...@@ -1564,6 +1575,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -1564,6 +1575,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return ($href return ($href
&& $href.length && $href.length
&& $href.is(':visible')
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
}) })
.sort(function (a, b) { return a[0] - b[0] }) .sort(function (a, b) { return a[0] - b[0] })
...@@ -1586,6 +1598,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -1586,6 +1598,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return activeTarget != (i = targets.last()[0]) && this.activate(i) 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--;) { for (i = offsets.length; i--;) {
activeTarget != targets[i] activeTarget != targets[i]
&& scrollTop >= offsets[i] && scrollTop >= offsets[i]
......
This diff is collapsed.
File moved
File moved
File moved
...@@ -27,16 +27,13 @@ ...@@ -27,16 +27,13 @@
================================================== --> ================================================== -->
<!-- Placed at the end of the document so the pages load faster --> <!-- 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="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="dist/js/bootstrap.min.js"></script>
<script src="assets/js/holder.js"></script>
<script src="{{ page.base_url }}docs-assets/js/holder.js"></script> <script src="assets/js/application.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>
{% if page.slug == "customize" %} {% if page.slug == "customize" %}
<script src="{{ page.base_url }}docs-assets/js/raw-files.js"></script> <script src="assets/js/raw-files.js"></script>
<script src="{{ page.base_url }}docs-assets/js/customize.js"></script> <script src="assets/js/customize.js"></script>
{% endif %} {% endif %}
{% comment %} {% comment %}
......
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
</title> </title>
<!-- Bootstrap core CSS --> <!-- 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 --> <!-- Documentation extras -->
<link href="{{ page.base_url }}docs-assets/css/docs.css" rel="stylesheet"> <link href="{{ site.baseurl }}assets/css/docs.css" rel="stylesheet">
<link href="{{ page.base_url }}docs-assets/css/pygments-manni.css" rel="stylesheet"> <link href="{{ site.baseurl }}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]--> <!--[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 --> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
<![endif]--> <![endif]-->
<!-- Favicons --> <!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ page.base_url }}docs-assets/ico/apple-touch-icon-144-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ site.baseurl }}assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="{{ page.base_url }}docs-assets/ico/favicon.ico"> <link rel="shortcut icon" href="{{ site.baseurl }}assets/ico/favicon.ico">
<script> <script>
var _gaq = _gaq || []; var _gaq = _gaq || [];
......
File moved
File moved
File moved
File moved
File moved
...@@ -7,24 +7,24 @@ ...@@ -7,24 +7,24 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a href="{{ page.base_url }}" class="navbar-brand">Bootstrap</a> <a href="{{ site.baseurl }}" class="navbar-brand">Bootstrap</a>
</div> </div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation"> <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li{% if page.slug == "getting-started" %} class="active"{% endif %}> <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>
<li{% if page.slug == "css" %} class="active"{% endif %}> <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>
<li{% if page.slug == "components" %} class="active"{% endif %}> <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>
<li{% if page.slug == "js" %} class="active"{% endif %}> <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>
<li{% if page.slug == "customize" %} class="active"{% endif %}> <li{% if page.slug == "customize" %} class="active"{% endif %}>
<a href="{{ page.base_url }}customize">Customize</a> <a href="{{ site.baseurl }}customize">Customize</a>
</li> </li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
......
File moved
...@@ -50,6 +50,5 @@ ...@@ -50,6 +50,5 @@
<!-- JS and analytics only. --> <!-- JS and analytics only. -->
{% include footer.html %} {% include footer.html %}
</body> </body>
</html> </html>
...@@ -15,6 +15,5 @@ ...@@ -15,6 +15,5 @@
<!-- JS and analytics only. --> <!-- JS and analytics only. -->
{% include footer.html %} {% include footer.html %}
</body> </body>
</html> </html>
...@@ -3,7 +3,6 @@ layout: default ...@@ -3,7 +3,6 @@ layout: default
title: About title: About
slug: about slug: about
lead: "Learn about the history of Bootstrap, meet the core team, and check out the ever-growing community resources." lead: "Learn about the history of Bootstrap, meet the core team, and check out the ever-growing community resources."
base_url: "../"
--- ---
......
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