0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-12 00:08:59 +01:00

Merge branch 'master' into docs_derp

This commit is contained in:
Mark Otto 2013-12-18 13:06:47 -08:00
commit 5bba874467
20 changed files with 122 additions and 102 deletions

View File

@ -113,12 +113,27 @@ module.exports = function (grunt) {
}, },
less: { less: {
compile: { compileCore: {
options: { options: {
strictMath: true strictMath: true,
sourceMap: true,
outputSourceFiles: true,
sourceMapURL: '<%= pkg.name %>.css.map',
sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
},
files: {
'dist/css/<%= pkg.name %>.css': 'less/bootstrap.less'
}
},
compileTheme: {
options: {
strictMath: true,
sourceMap: true,
outputSourceFiles: true,
sourceMapURL: '<%= pkg.name %>-theme.css.map',
sourceMapFilename: 'dist/css/<%= pkg.name %>-theme.css.map'
}, },
files: { files: {
'dist/css/<%= pkg.name %>.css': 'less/bootstrap.less',
'dist/css/<%= pkg.name %>-theme.css': 'less/theme.less' 'dist/css/<%= pkg.name %>-theme.css': 'less/theme.less'
} }
}, },

View File

@ -345,3 +345,4 @@
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
} }
/*# sourceMappingURL=bootstrap-theme.css.map */

1
dist/css/bootstrap-theme.css.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -5741,3 +5741,4 @@ td.visible-print {
display: none !important; display: none !important;
} }
} }
/*# sourceMappingURL=bootstrap.css.map */

1
dist/css/bootstrap.css.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -40,7 +40,7 @@ body {
.site-wrapper { .site-wrapper {
display: table; display: table;
width: 100%; width: 100%;
height: 100%; /* For at leat Firefox */ height: 100%; /* For at least Firefox */
min-height: 100%; min-height: 100%;
} }
.site-wrapper-inner { .site-wrapper-inner {

View File

@ -1,6 +1,7 @@
{ {
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireLeftStickedOperators": [","],
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireRightStickedOperators": ["!"], "requireRightStickedOperators": ["!"],
"disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],

View File

@ -39,9 +39,9 @@
} }
Carousel.DEFAULTS = { Carousel.DEFAULTS = {
interval: 5000 interval: 5000,
, pause: 'hover' pause: 'hover',
, wrap: true wrap: true
} }
Carousel.prototype.cycle = function (e) { Carousel.prototype.cycle = function (e) {

View File

@ -33,9 +33,9 @@
} }
Modal.DEFAULTS = { Modal.DEFAULTS = {
backdrop: true backdrop: true,
, keyboard: true keyboard: true,
, show: true show: true
} }
Modal.prototype.toggle = function (_relatedTarget) { Modal.prototype.toggle = function (_relatedTarget) {

View File

@ -30,10 +30,10 @@
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right' placement: 'right',
, trigger: 'click' trigger: 'click',
, content: '' content: '',
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
}) })

View File

@ -53,8 +53,8 @@
this.activate($this.parent('li'), $ul) this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function () { this.activate($target, $target.parent(), function () {
$this.trigger({ $this.trigger({
type: 'shown.bs.tab' type: 'shown.bs.tab',
, relatedTarget: previous relatedTarget: previous
}) })
}) })
} }

View File

@ -20,8 +20,8 @@ $(function () {
var alertHTML = '<div class="alert-message warning fade in">' var alertHTML = '<div class="alert-message warning fade in">'
+ '<a class="close" href="#" data-dismiss="alert">×</a>' + '<a class="close" href="#" data-dismiss="alert">×</a>'
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
+ '</div>' + '</div>',
, alert = $(alertHTML).alert() alert = $(alertHTML).alert()
alert.find('.close').click() alert.find('.close').click()
@ -34,8 +34,8 @@ $(function () {
var alertHTML = '<div class="alert-message warning fade in">' var alertHTML = '<div class="alert-message warning fade in">'
+ '<a class="close" href="#" data-dismiss="alert">×</a>' + '<a class="close" href="#" data-dismiss="alert">×</a>'
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
+ '</div>' + '</div>',
, alert = $(alertHTML).appendTo('#qunit-fixture').alert() alert = $(alertHTML).appendTo('#qunit-fixture').alert()
ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom') ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')

View File

@ -59,8 +59,8 @@ $(function () {
}) })
test('should toggle active when btn children are clicked', function () { test('should toggle active when btn children are clicked', function () {
var btn = $('<button class="btn" data-toggle="button">mdo</button>') var btn = $('<button class="btn" data-toggle="button">mdo</button>'),
, inner = $('<i></i>') inner = $('<i></i>')
btn btn
.append(inner) .append(inner)
.appendTo($('#qunit-fixture')) .appendTo($('#qunit-fixture'))
@ -70,9 +70,9 @@ $(function () {
}) })
test('should toggle active when btn children are clicked within btn-group', function () { test('should toggle active when btn children are clicked within btn-group', function () {
var btngroup = $('<div class="btn-group" data-toggle="buttons"></div>') var btngroup = $('<div class="btn-group" data-toggle="buttons"></div>'),
, btn = $('<button class="btn">fat</button>') btn = $('<button class="btn">fat</button>'),
, inner = $('<i></i>') inner = $('<i></i>')
btngroup btngroup
.append(btn.append(inner)) .append(btn.append(inner))
.appendTo($('#qunit-fixture')) .appendTo($('#qunit-fixture'))

View File

@ -28,8 +28,8 @@ $(function () {
+ '<li><a href="#">Another link</a></li>' + '<li><a href="#">Another link</a></li>'
+ '</ul>' + '</ul>'
+ '</li>' + '</li>'
+ '</ul>' + '</ul>',
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click() dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
}) })
@ -45,8 +45,8 @@ $(function () {
+ '<li><a href="#">Another link</a></li>' + '<li><a href="#">Another link</a></li>'
+ '</ul>' + '</ul>'
+ '</li>' + '</li>'
+ '</ul>' + '</ul>',
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click() dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
}) })
@ -62,8 +62,8 @@ $(function () {
+ '<li><a href="#">Another link</a></li>' + '<li><a href="#">Another link</a></li>'
+ '</ul>' + '</ul>'
+ '</li>' + '</li>'
+ '</ul>' + '</ul>',
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click() dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
}) })
@ -79,8 +79,8 @@ $(function () {
+ '<li><a href="#">Another link</a></li>' + '<li><a href="#">Another link</a></li>'
+ '</ul>' + '</ul>'
+ '</li>' + '</li>'
+ '</ul>' + '</ul>',
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click() dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
}) })
@ -97,8 +97,8 @@ $(function () {
+ '<li><a href="#">Another link</a></li>' + '<li><a href="#">Another link</a></li>'
+ '</ul>' + '</ul>'
+ '</li>' + '</li>'
+ '</ul>' + '</ul>',
, dropdown = $(dropdownHTML) dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]') .find('[data-toggle="dropdown"]')
.dropdown() .dropdown()
@ -127,10 +127,10 @@ $(function () {
+ ' <ul class="dropdown-menu">' + ' <ul class="dropdown-menu">'
+ ' <li><a href="#">Action 1</a></li>' + ' <li><a href="#">Action 1</a></li>'
+ ' </ul>' + ' </ul>'
+ '</div>' + '</div>',
, dropdowns = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-toggle="dropdown"]') dropdowns = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-toggle="dropdown"]'),
, first = dropdowns.first() first = dropdowns.first(),
, last = dropdowns.last() last = dropdowns.last()
ok(dropdowns.length == 2, 'Should be two dropdowns') ok(dropdowns.length == 2, 'Should be two dropdowns')
@ -160,8 +160,8 @@ $(function () {
+ '<li><a href="#">Another link</a></li>' + '<li><a href="#">Another link</a></li>'
+ '</ul>' + '</ul>'
+ '</li>' + '</li>'
+ '</ul>' + '</ul>',
, dropdown = $(dropdownHTML) dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]') .find('[data-toggle="dropdown"]')
.dropdown() .dropdown()
@ -194,8 +194,8 @@ $(function () {
+ '<li><a href="#">Another link</a></li>' + '<li><a href="#">Another link</a></li>'
+ '</ul>' + '</ul>'
+ '</li>' + '</li>'
+ '</ul>' + '</ul>',
, dropdown = $(dropdownHTML) dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]') .find('[data-toggle="dropdown"]')
.dropdown() .dropdown()

View File

@ -44,8 +44,8 @@ $(function () {
.popover({ .popover({
title: function () { title: function () {
return '@fat' return '@fat'
} },
, content: function () { content: function () {
return 'loves writing tests (╯°□°)╯︵ ┻━┻' return 'loves writing tests (╯°□°)╯︵ ┻━┻'
} }
}) })
@ -102,9 +102,9 @@ $(function () {
var popover = $('<a href="#">@fat</a>') var popover = $('<a href="#">@fat</a>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.popover({ .popover({
title: 'Test' title: 'Test',
, content: 'Test' content: 'Test',
, template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>' template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
}) })
popover.popover('show') popover.popover('show')

View File

@ -18,8 +18,8 @@ $(function () {
test('should switch active class on scroll', function () { test('should switch active class on scroll', function () {
var sectionHTML = '<div id="masthead"></div>' var sectionHTML = '<div id="masthead"></div>'
, $section = $(sectionHTML).append('#qunit-fixture') $section = $(sectionHTML).append('#qunit-fixture'),
, topbarHTML = '<div class="topbar">' topbarHTML = '<div class="topbar">'
+ '<div class="topbar-inner">' + '<div class="topbar-inner">'
+ '<div class="container">' + '<div class="container">'
+ '<h3><a href="#">Bootstrap</a></h3>' + '<h3><a href="#">Bootstrap</a></h3>'
@ -28,8 +28,8 @@ $(function () {
+ '</ul>' + '</ul>'
+ '</div>' + '</div>'
+ '</div>' + '</div>'
+ '</div>' + '</div>',
, $topbar = $(topbarHTML).scrollspy() $topbar = $(topbarHTML).scrollspy()
ok($topbar.find('.active', true)) ok($topbar.find('.active', true))
}) })

View File

@ -299,8 +299,8 @@ $(function () {
test('should place tooltip inside window', function () { test('should place tooltip inside window', function () {
var container = $('<div />').appendTo('body') var container = $('<div />').appendTo('body')
.css({position: 'absolute', width: 200, height: 200, bottom: 0, left: 0}) .css({position: 'absolute', width: 200, height: 200, bottom: 0, left: 0}),
, tooltip = $('<a href="#" title="Very very very very very very very very long tooltip">Hover me</a>') tooltip = $('<a href="#" title="Very very very very very very very very long tooltip">Hover me</a>')
.css({position: 'absolute', top: 0, left: 0}) .css({position: 'absolute', top: 0, left: 0})
.appendTo(container) .appendTo(container)
.tooltip({placement: 'top', animate: false}) .tooltip({placement: 'top', animate: false})
@ -318,9 +318,9 @@ $(function () {
test('should place tooltip on top of element', function () { test('should place tooltip on top of element', function () {
var container = $('<div />').appendTo('body') var container = $('<div />').appendTo('body')
.css({position: 'absolute', bottom: 0, left: 0, textAlign: 'right', width: 300, height: 300}) .css({position: 'absolute', bottom: 0, left: 0, textAlign: 'right', width: 300, height: 300}),
, p = $('<p style="margin-top:200px" />').appendTo(container) p = $('<p style="margin-top:200px" />').appendTo(container),
, tooltiped = $('<a href="#" title="very very very very very very very long tooltip">Hover me</a>') tooltiped = $('<a href="#" title="very very very very very very very long tooltip">Hover me</a>')
.css({marginTop: 200}) .css({marginTop: 200})
.appendTo(p) .appendTo(p)
.tooltip({placement: 'top', animate: false}) .tooltip({placement: 'top', animate: false})
@ -340,12 +340,12 @@ $(function () {
test('should add position class before positioning so that position-specific styles are taken into account', function () { test('should add position class before positioning so that position-specific styles are taken into account', function () {
$('head').append('<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>') $('head').append('<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>')
var container = $('<div />').appendTo('body') var container = $('<div />').appendTo('body'),
, target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line"></a>') target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line"></a>')
.appendTo(container) .appendTo(container)
.tooltip({placement: 'right'}) .tooltip({placement: 'right'})
.tooltip('show') .tooltip('show'),
, tooltip = container.find('.tooltip') tooltip = container.find('.tooltip')
ok( Math.round(target.offset().top + (target[0].offsetHeight / 2) - (tooltip[0].offsetHeight / 2)) === Math.round(tooltip.offset().top) ) ok( Math.round(target.offset().top + (target[0].offsetHeight / 2) - (tooltip[0].offsetHeight / 2)) === Math.round(tooltip.offset().top) )
target.tooltip('hide') target.tooltip('hide')
@ -389,12 +389,12 @@ $(function () {
test('tooltips should be placed dynamically, with the dynamic placement option', function () { test('tooltips should be placed dynamically, with the dynamic placement option', function () {
$.support.transition = false $.support.transition = false
var ttContainer = $('<div id="dynamic-tt-test"/>').css({ var ttContainer = $('<div id="dynamic-tt-test"/>').css({
'height' : 400 'height' : 400,
, 'overflow' : 'hidden' 'overflow' : 'hidden',
, 'position' : 'absolute' 'position' : 'absolute',
, 'top' : 0 'top' : 0,
, 'left' : 0 'left' : 0,
, 'width' : 600}) 'width' : 600})
.appendTo('body') .appendTo('body')
var topTooltip = $('<div style="display: inline-block; position: absolute; left: 0; top: 0;" rel="tooltip" title="Top tooltip">Top Dynamic Tooltip</div>') var topTooltip = $('<div style="display: inline-block; position: absolute; left: 0; top: 0;" rel="tooltip" title="Top tooltip">Top Dynamic Tooltip</div>')

View File

@ -36,15 +36,15 @@
} }
Tooltip.DEFAULTS = { Tooltip.DEFAULTS = {
animation: true animation: true,
, placement: 'top' placement: 'top',
, selector: false selector: false,
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
, trigger: 'hover focus' trigger: 'hover focus',
, title: '' title: '',
, delay: 0 delay: 0,
, html: false html: false,
, container: false container: false
} }
Tooltip.prototype.init = function (type, element, options) { Tooltip.prototype.init = function (type, element, options) {
@ -83,8 +83,8 @@
if (options.delay && typeof options.delay == 'number') { if (options.delay && typeof options.delay == 'number') {
options.delay = { options.delay = {
show: options.delay show: options.delay,
, hide: options.delay hide: options.delay
} }
} }
@ -295,8 +295,8 @@
Tooltip.prototype.getPosition = function () { Tooltip.prototype.getPosition = function () {
var el = this.$element[0] var el = this.$element[0]
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
width: el.offsetWidth width: el.offsetWidth,
, height: el.offsetHeight height: el.offsetHeight
}, this.$element.offset()) }, this.$element.offset())
} }

View File

@ -27,10 +27,10 @@
var el = document.createElement('bootstrap') var el = document.createElement('bootstrap')
var transEndEventNames = { var transEndEventNames = {
'WebkitTransition' : 'webkitTransitionEnd' 'WebkitTransition' : 'webkitTransitionEnd',
, 'MozTransition' : 'transitionend' 'MozTransition' : 'transitionend',
, 'OTransition' : 'oTransitionEnd otransitionend' 'OTransition' : 'oTransitionEnd otransitionend',
, 'transition' : 'transitionend' 'transition' : 'transitionend'
} }
for (var name in transEndEventNames) { for (var name in transEndEventNames) {