Skip to content

Commit

Permalink
Merge branch 'master' of github.com:twbs/bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo committed Dec 7, 2013
2 parents 775c29f + 94a5413 commit cc1f956
Show file tree
Hide file tree
Showing 23 changed files with 119 additions and 61 deletions.
30 changes: 28 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* jshint node: true */

module.exports = function(grunt) {
module.exports = function (grunt) {
"use strict";

// Force use of Unix newlines
Expand Down Expand Up @@ -40,6 +40,21 @@ module.exports = function(grunt) {
}
},

jscs: {
options: {
config: 'js/.jscs.json',
},
gruntfile: {
src: ['Gruntfile.js']
},
src: {
src: ['js/*.js']
},
test: {
src: ['js/tests/unit/*.js']
}
},

concat: {
options: {
banner: '<%= banner %><%= jqueryCheck %>',
Expand Down Expand Up @@ -72,6 +87,16 @@ module.exports = function(grunt) {
bootstrap: {
src: ['<%= concat.bootstrap.dest %>'],
dest: 'dist/js/<%= pkg.name %>.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'
}
},

Expand Down Expand Up @@ -278,6 +303,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-html-validation');
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-jscs-checker');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-sed');
Expand All @@ -286,7 +312,7 @@ module.exports = function(grunt) {
grunt.registerTask('validate-html', ['jekyll', 'validation']);

// Test task.
var testSubtasks = ['dist-css', 'jshint', 'qunit', 'validate-html'];
var testSubtasks = ['dist-css', 'jshint', 'jscs', 'qunit', 'validate-html'];
// Only run Sauce Labs tests if there's a Sauce access key
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined') {
testSubtasks.push('connect');
Expand Down
8 changes: 2 additions & 6 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
================================================== -->
<!-- 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.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/application.js"></script>

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

{% comment %}
Expand Down
1 change: 1 addition & 0 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ <h1 id="translations">Translations</h1>
<li><a href="http://www.oneskyapp.com/docs/bootstrap/ru">Bootstrap по-русски (Russian)</a></li>
<li><a href="http://www.oneskyapp.com/docs/bootstrap/es">Bootstrap en Español (Spanish)</a></li>
<li><a href="http://twbs.site-konstruktor.com.ua">Bootstrap ua Українською (Ukrainian)</a></li>
<li><a href="http://www.oneskyapp.com/docs/bootstrap/fr">Bootstrap en Français (French)</a></li>
</ul>
<p>Have another language to add, or perhaps a different or better translation? Let us know by <a href="https://github.com/twbs/bootstrap/issues/new">opening an issue</a>.</p>
</div>
5 changes: 2 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "bootstrap",
"version": "3.0.3",
"main": [
"./dist/js/bootstrap.js",
"./dist/css/bootstrap.css",
"./dist/js/bootstrap.js",
"./dist/css/bootstrap.css",
"./dist/fonts/glyphicons-halflings-regular.eot",
"./dist/fonts/glyphicons-halflings-regular.svg",
"./dist/fonts/glyphicons-halflings-regular.ttf",
Expand All @@ -19,7 +19,6 @@
"CNAME",
"CONTRIBUTING.md",
"Gruntfile.js",
"browserstack.json",
"composer.json",
"package.json",
"*.html"
Expand Down
2 changes: 1 addition & 1 deletion customize.html
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ <h3>Dropdown items</h3>
<p class="help-block">Hovered dropdown menu entry text color</p>
<label>@dropdown-link-hover-bg</label>
<input type="text" class="form-control" placeholder="#f5f5f5" data-var="@dropdown-link-hover-bg">
<p class="help-block">Hovered dropdown menu entry text color</p>
<p class="help-block">Hovered dropdown menu entry background color</p>

<label>@dropdown-link-active-color</label>
<input type="text" class="form-control" placeholder="@component-active-color" data-var="@dropdown-link-active-color">
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -4754,7 +4754,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
}

.navbar-default .navbar-toggle .icon-bar {
background-color: #cccccc;
background-color: #888888;
}

.navbar-default .navbar-collapse,
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
}
}

Tooltip.prototype.applyPlacement = function(offset, placement) {
Tooltip.prototype.applyPlacement = function (offset, placement) {
var replace
var $tip = this.tip()
var width = $tip[0].offsetWidth
Expand Down Expand Up @@ -1323,7 +1323,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
if (replace) $tip.offset(offset)
}

Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
}

Expand Down
11 changes: 11 additions & 0 deletions docs-assets/js/customize.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions getting-started.html
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,16 @@ <h2 id="migration-dropped">What's removed</h2>
<td><code>.tabs-left</code> <code>.tabs-right</code> <code>.tabs-below</code></td>
<td class="text-muted">N/A</td>
</tr>
<tr>
<td>Pill-based tabbable area</td>
<td><code>.pill-content</code></td>
<td><code>.tab-content</code></td>
</tr>
<tr>
<td>Pill-based tabbable area pane</td>
<td><code>.pill-pane</code></td>
<td><code>.tab-pane</code></td>
</tr>
<tr>
<td>Nav lists</td>
<td><code>.nav-list</code> <code>.nav-header</code></td>
Expand Down
6 changes: 3 additions & 3 deletions javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ <h3>Options</h3>
<td>animation</td>
<td>boolean</td>
<td>true</td>
<td>apply a CSS fade transition to the tooltip</td>
<td>apply a CSS fade transition to the popover</td>
</tr>
<tr>
<td>html</td>
Expand All @@ -1141,7 +1141,7 @@ <h3>Options</h3>
<td>selector</td>
<td>string</td>
<td>false</td>
<td>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 <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsfiddle.net/fScua/">an informative example</a>.</td>
<td>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 <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsfiddle.net/fScua/">an informative example</a>.</td>
</tr>
<tr>
<td>trigger</td>
Expand Down Expand Up @@ -1941,7 +1941,7 @@ <h3>Positioning via CSS</h3>
<ol>
<li>To start, the plugin adds <code>.affix-top</code> to indicate the element is in it's top-most position. At this point no CSS positioning is required.</li>
<li>Scrolling past the element you want affixed should trigger the actual affixing. This is where <code>.affix</code> replaces <code>.affix-top</code> and sets <code>position: fixed;</code> (provided by Bootstrap's code CSS).</li>
<li>If a bottom offset is defined, scrolling past that should replace <code>.affix</code> with <code>.affix-bottom</code>. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add <code>position: absolute;</code> when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the elemtn from there.</li>
<li>If a bottom offset is defined, scrolling past that should replace <code>.affix</code> with <code>.affix-bottom</code>. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add <code>position: absolute;</code> when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.</li>
</ol>
<p>Follow the above steps to set your CSS for either of the usage options below.</p>

Expand Down
14 changes: 14 additions & 0 deletions js/.jscs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return"],
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireRightStickedOperators": ["!"],
"disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowKeywords": ["with"],
"validateLineBreaks": "LF",
"requireLineFeedAtFileEnd": true
}
2 changes: 1 addition & 1 deletion js/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

if (e.keyCode == 38 && index > 0) index-- // up
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
if (!~index) index=0
if (!~index) index = 0

$items.eq(index).focus()
}
Expand Down
2 changes: 1 addition & 1 deletion js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')

$.support.transition && this.$element.hasClass('fade')?
$.support.transition && this.$element.hasClass('fade') ?
this.$backdrop
.one($.support.transition.end, callback)
.emulateTransitionEnd(150) :
Expand Down
14 changes: 7 additions & 7 deletions js/tests/unit/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ $(function () {
ok($('#modal-test').length, 'modal inserted into dom')
$(this).modal("hide")
})
.on("hidden.bs.modal", function() {
.on("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
$('#modal-test').remove()
start()
Expand All @@ -92,7 +92,7 @@ $(function () {
ok($('#modal-test').length, 'modal inserted into dom')
div.modal("toggle")
})
.on("hidden.bs.modal", function() {
.on("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
Expand All @@ -110,7 +110,7 @@ $(function () {
ok($('#modal-test').length, 'modal inserted into dom')
div.find('.close').click()
})
.on("hidden.bs.modal", function() {
.on("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
Expand All @@ -127,7 +127,7 @@ $(function () {
ok($('#modal-test').is(":visible"), 'modal visible')
div.modal("hide")
})
.on("hidden.bs.modal", function() {
.on("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
Expand All @@ -146,7 +146,7 @@ $(function () {
ok($('#modal-test').is(":visible"), 'modal visible')
$('#modal-test').click()
})
.bind("hidden.bs.modal", function() {
.bind("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
Expand All @@ -164,7 +164,7 @@ $(function () {
triggered = 0
$('#modal-test').click()
})
.one("hidden.bs.modal", function() {
.one("hidden.bs.modal", function () {
div.modal("show")
})
.bind("hide.bs.modal", function () {
Expand All @@ -184,7 +184,7 @@ $(function () {
$('#close').click()
ok(!$('#modal-test').is(":visible"), 'modal hidden')
})
.one("hidden.bs.modal", function() {
.one("hidden.bs.modal", function () {
div.one('hidden.bs.modal', function () {
start()
}).modal("show")
Expand Down
8 changes: 4 additions & 4 deletions js/tests/unit/phantom.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

// These methods connect QUnit to PhantomJS.
QUnit.log = function(obj) {
QUnit.log = function (obj) {
// What is this I don’t even
if (obj.message === '[object Object], undefined:undefined') { return }
// Parse some stuff before sending it.
Expand All @@ -32,15 +32,15 @@
sendMessage('qunit.log', obj.result, actual, expected, obj.message, obj.source)
}

QUnit.testStart = function(obj) {
QUnit.testStart = function (obj) {
sendMessage('qunit.testStart', obj.name)
}

QUnit.testDone = function(obj) {
QUnit.testDone = function (obj) {
sendMessage('qunit.testDone', obj.name, obj.failed, obj.passed, obj.total)
}

QUnit.moduleStart = function(obj) {
QUnit.moduleStart = function (obj) {
sendMessage('qunit.moduleStart', obj.name)
}

Expand Down
4 changes: 2 additions & 2 deletions js/tests/unit/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ $(function () {
$('#qunit-fixture').empty()
})

test("should respect custom classes", function() {
test("should respect custom classes", function () {
$.support.transition = false
var popover = $('<a href="#">@fat</a>')
.appendTo('#qunit-fixture')
Expand All @@ -118,7 +118,7 @@ $(function () {
})

test("should destroy popover", function () {
var popover = $('<div/>').popover({trigger: 'hover'}).on('click.foo', function(){})
var popover = $('<div/>').popover({trigger: 'hover'}).on('click.foo', function () {})
ok(popover.data('bs.popover'), 'popover has data')
ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event')
ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event')
Expand Down
2 changes: 1 addition & 1 deletion js/tests/unit/scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(function () {
test("should switch active class on scroll", function () {
var sectionHTML = '<div id="masthead"></div>'
, $section = $(sectionHTML).append('#qunit-fixture')
, topbarHTML ='<div class="topbar">'
, topbarHTML = '<div class="topbar">'
+ '<div class="topbar-inner">'
+ '<div class="container">'
+ '<h3><a href="#">Bootstrap</a></h3>'
Expand Down
4 changes: 2 additions & 2 deletions js/tests/unit/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ $(function () {
+ '</ul>'

$(dropHTML).find('ul>li:first a').tab('show').end()
.find('ul>li:last a').on('show', function(event){
.find('ul>li:last a').on('show', function (event) {
equal(event.relatedTarget.hash, "#1-1")
}).on('shown', function(event){
}).on('shown', function (event) {
equal(event.relatedTarget.hash, "#1-1")
}).tab('show')
})
Expand Down
Loading

0 comments on commit cc1f956

Please sign in to comment.