Skip to content

Commit b253cb2

Browse files
committed
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
2 parents 9e1153d + 8812856 commit b253cb2

File tree

113 files changed

+406
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+406
-128
lines changed

Gruntfile.js

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ module.exports = function (grunt) {
99
RegExp.quote = function (string) {
1010
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
1111
}
12+
13+
var fs = require('fs')
1214
var btoa = require('btoa')
15+
1316
// Project configuration.
1417
grunt.initConfig({
1518

@@ -41,7 +44,7 @@ module.exports = function (grunt) {
4144
src: ['js/tests/unit/*.js']
4245
},
4346
assets: {
44-
src: ['docs-assets/js/application.js', 'docs-assets/js/customizer.js']
47+
src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
4548
}
4649
},
4750

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

6366
csslint: {
6467
options: {
65-
csslintrc: '.csslintrc'
68+
csslintrc: 'less/.csslintrc'
6669
},
6770
src: [
6871
'dist/css/bootstrap.css',
6972
'dist/css/bootstrap-theme.css',
70-
'docs-assets/css/docs.css'
73+
'docs/assets/css/docs.css'
7174
]
7275
},
7376

@@ -115,13 +118,13 @@ module.exports = function (grunt) {
115118
report: 'min'
116119
},
117120
src: [
118-
'docs-assets/js/less.js',
119-
'docs-assets/js/jszip.js',
120-
'docs-assets/js/uglify.js',
121-
'docs-assets/js/filesaver.js',
122-
'docs-assets/js/customizer.js'
121+
'docs/assets/js/less.js',
122+
'docs/assets/js/jszip.js',
123+
'docs/assets/js/uglify.js',
124+
'docs/assets/js/filesaver.js',
125+
'docs/assets/js/customizer.js'
123126
],
124-
dest: 'docs-assets/js/customize.js'
127+
dest: 'docs/assets/js/customize.js'
125128
}
126129
},
127130

@@ -182,7 +185,7 @@ module.exports = function (grunt) {
182185
csscomb: {
183186
sort: {
184187
options: {
185-
sortOrder: '.csscomb.json'
188+
config: 'less/.csscomb.json'
186189
},
187190
files: {
188191
'dist/css/<%= pkg.name %>.css': ['dist/css/<%= pkg.name %>.css'],
@@ -196,6 +199,16 @@ module.exports = function (grunt) {
196199
expand: true,
197200
src: ['fonts/*'],
198201
dest: 'dist/'
202+
},
203+
docs: {
204+
expand: true,
205+
cwd: './dist',
206+
src: [
207+
'{css,js}/*.min.*',
208+
'{css}/*.map',
209+
'fonts/*'
210+
],
211+
dest: 'docs/dist'
199212
}
200213
},
201214

@@ -267,7 +280,7 @@ module.exports = function (grunt) {
267280
build: process.env.TRAVIS_JOB_ID,
268281
concurrency: 3,
269282
urls: ['http://127.0.0.1:3000/js/tests/index.html'],
270-
browsers: grunt.file.readYAML('sauce_browsers.yml')
283+
browsers: grunt.file.readYAML('test-infra/sauce_browsers.yml')
271284
}
272285
}
273286
}
@@ -306,10 +319,10 @@ module.exports = function (grunt) {
306319
grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']);
307320

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

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

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

322335
grunt.registerTask('build-glyphicons-data', function () {
323-
var fs = require('fs')
324-
325336
// Pass encoding, utf8, so `readFileSync` will return a string instead of a
326337
// buffer
327338
var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8')
@@ -340,15 +351,13 @@ module.exports = function (grunt) {
340351
}
341352

342353
// Create the `_data` directory if it doesn't already exist
343-
if (!fs.existsSync('_data')) fs.mkdirSync('_data')
354+
if (!fs.existsSync('docs/_data')) fs.mkdirSync('docs/_data')
344355

345-
fs.writeFileSync('_data/glyphicons.yml', glyphiconsData)
356+
fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData)
346357
});
347358

348359
// task for building customizer
349360
grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () {
350-
var fs = require('fs')
351-
352361
function getFiles(type) {
353362
var files = {}
354363
fs.readdirSync(type)
@@ -363,6 +372,6 @@ module.exports = function (grunt) {
363372
}
364373

365374
var files = getFiles('js') + getFiles('less') + getFiles('fonts')
366-
fs.writeFileSync('docs-assets/js/raw-files.js', files)
375+
fs.writeFileSync('docs/assets/js/raw-files.js', files)
367376
});
368377
};

_config.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,27 @@ pygments: true
66
permalink: pretty
77

88
# Server
9+
source: ./docs
910
destination: ./_gh_pages
11+
host: 0.0.0.0
1012
port: 9001
11-
exclude:
12-
- ".editorconfig"
13-
- ".gitignore"
14-
- "bower.json"
15-
- "CNAME"
16-
- "composer.json"
17-
- "CONTRIBUTING.md"
18-
- "DOCS-LICENSE"
19-
- "Gruntfile.js"
20-
- "less"
21-
- "LICENSE"
22-
- "node_modules"
23-
- "package.json"
24-
- "README.md"
25-
- "sauce_browsers.yml"
26-
- "test-infra"
13+
baseurl: /
14+
url: http://localhost:9001
2715

2816
# Custom vars
2917
current_version: 3.0.3
3018
repo: https://github.com/twbs/bootstrap
3119

32-
download_source: https://github.com/twbs/bootstrap/archive/v3.0.3.zip
33-
download_dist: https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip
34-
download_sass: https://github.com/twbs/bootstrap-sass/archive/v3.0.3.0.tar.gz
20+
download:
21+
source: https://github.com/twbs/bootstrap/archive/v3.0.3.zip
22+
dist: https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip
23+
sass: https://github.com/twbs/bootstrap-sass/archive/v3.0.3.0.tar.gz
3524

3625
blog: http://blog.getbootstrap.com
3726
expo: http://expo.getbootstrap.com
3827
sass_repo: https://github.com/twbs/bootstrap-sass
3928

40-
cdn_css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css
41-
cdn_theme_css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css
42-
cdn_js: //netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js
29+
cdn:
30+
css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css
31+
css_theme: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css
32+
js: //netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js

dist/js/bootstrap.js

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
351351
$next = this.$element.find('.item')[fallback]()
352352
}
353353

354-
if ($next.hasClass('active')) return
354+
if ($next.hasClass('active')) return this.sliding = false
355355

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

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

664665
if (e.isDefaultPrevented()) return
665666

666667
$parent
667668
.toggleClass('open')
668-
.trigger('shown.bs.dropdown')
669+
.trigger('shown.bs.dropdown', relatedTarget)
669670

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

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

696698
if (!$items.length) return
697699

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

707-
function clearMenus() {
709+
function clearMenus(e) {
708710
$(backdrop).remove()
709-
$(toggle).each(function (e) {
711+
$(toggle).each(function () {
710712
var $parent = getParent($(this))
713+
var relatedTarget = { relatedTarget: this }
711714
if (!$parent.hasClass('open')) return
712-
$parent.trigger(e = $.Event('hide.bs.dropdown'))
715+
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
713716
if (e.isDefaultPrevented()) return
714-
$parent.removeClass('open').trigger('hidden.bs.dropdown')
717+
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
715718
})
716719
}
717720

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

768771
}(jQuery);
769772

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

790-
if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () {
791-
this.$element.trigger('loaded.bs.modal')
792-
}, this))
793+
if (this.options.remote) {
794+
this.$element
795+
.find('.modal-content')
796+
.load(this.options.remote, $.proxy(function () {
797+
this.$element.trigger('loaded.bs.modal')
798+
}, this))
799+
}
793800
}
794801

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

826-
that.$element.show()
833+
that.$element
834+
.show()
835+
.scrollTop(0)
827836

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

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

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

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

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

1601+
if (activeTarget && scrollTop <= offsets[0]) {
1602+
return activeTarget != (i = targets[0]) && this.activate(i)
1603+
}
1604+
15891605
for (i = offsets.length; i--;) {
15901606
activeTarget != targets[i]
15911607
&& scrollTop >= offsets[i]

dist/js/bootstrap.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,13 @@
2727
================================================== -->
2828
<!-- Placed at the end of the document so the pages load faster -->
2929
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
30-
<script src="{{ page.base_url }}dist/js/bootstrap.min.js"></script>
31-
32-
<script src="{{ page.base_url }}docs-assets/js/holder.js"></script>
33-
<script src="{{ page.base_url }}docs-assets/js/zeroclipboard.min.js"></script>
34-
35-
<script src="{{ page.base_url }}docs-assets/js/application.js"></script>
30+
<script src="dist/js/bootstrap.min.js"></script>
31+
<script src="assets/js/holder.js"></script>
32+
<script src="assets/js/application.js"></script>
3633

3734
{% if page.slug == "customize" %}
38-
<script src="{{ page.base_url }}docs-assets/js/raw-files.js"></script>
39-
<script src="{{ page.base_url }}docs-assets/js/customize.js"></script>
35+
<script src="assets/js/raw-files.js"></script>
36+
<script src="assets/js/customize.js"></script>
4037
{% endif %}
4138

4239
{% comment %}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
</title>
1515

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

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

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

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

3434
<script>
3535
var _gaq = _gaq || [];

0 commit comments

Comments
 (0)