Commit 7d8d5c78 authored by Mark Otto's avatar Mark Otto

Merge branch '2.3.0-wip' into 3.0.0-wip

Conflicts:
	Makefile
	README.md
	component.json
	docs/assets/css/bootstrap-responsive.css
	docs/assets/css/bootstrap.css
	docs/assets/js/bootstrap-affix.js
	docs/assets/js/bootstrap-alert.js
	docs/assets/js/bootstrap-button.js
	docs/assets/js/bootstrap-carousel.js
	docs/assets/js/bootstrap-collapse.js
	docs/assets/js/bootstrap-dropdown.js
	docs/assets/js/bootstrap-modal.js
	docs/assets/js/bootstrap-popover.js
	docs/assets/js/bootstrap-scrollspy.js
	docs/assets/js/bootstrap-tab.js
	docs/assets/js/bootstrap-tooltip.js
	docs/assets/js/bootstrap-transition.js
	docs/assets/js/bootstrap-typeahead.js
	docs/assets/js/bootstrap.js
	docs/components.html
	docs/css.html
	docs/examples/fluid.html
	docs/extend.html
	docs/getting-started.html
	docs/index.html
	docs/templates/pages/base-css.mustache
	docs/templates/pages/components.mustache
	docs/templates/pages/extend.mustache
	docs/templates/pages/getting-started.mustache
	docs/templates/pages/index.mustache
	docs/templates/pages/javascript.mustache
	js/bootstrap-affix.js
	js/bootstrap-alert.js
	js/bootstrap-button.js
	js/bootstrap-carousel.js
	js/bootstrap-collapse.js
	js/bootstrap-dropdown.js
	js/bootstrap-modal.js
	js/bootstrap-popover.js
	js/bootstrap-scrollspy.js
	js/bootstrap-tab.js
	js/bootstrap-tooltip.js
	js/bootstrap-transition.js
	js/bootstrap-typeahead.js
	less/bootstrap.less
	less/buttons.less
	less/forms.less
	less/navbar.less
	less/popovers.less
	less/responsive-767px-max.less
	less/responsive.less
	less/tables.less
	less/tooltip.less
	less/type.less
	less/variables.less
	package.json
parents 76ed6b0b 4b34f494
...@@ -25,7 +25,7 @@ build: ...@@ -25,7 +25,7 @@ build:
@echo "Compiling documentation... ${CHECK} Done" @echo "Compiling documentation... ${CHECK} Done"
@cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js @cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js
@./node_modules/.bin/uglifyjs -nc docs/assets/js/bootstrap.js > docs/assets/js/bootstrap.min.tmp.js @./node_modules/.bin/uglifyjs -nc docs/assets/js/bootstrap.js > docs/assets/js/bootstrap.min.tmp.js
@echo "/**\n* Bootstrap.js v2.2.3 by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js @echo "/**\n* Bootstrap.js v2.3.0 by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js
@cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js @cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js
@rm docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js @rm docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js
@echo "Compiling and minifying javascript... ${CHECK} Done" @echo "Compiling and minifying javascript... ${CHECK} Done"
...@@ -59,19 +59,46 @@ clean: ...@@ -59,19 +59,46 @@ clean:
# recess & uglifyjs are required # recess & uglifyjs are required
# #
bootstrap: bootstrap: bootstrap-fonts bootstrap-css bootstrap-js
mkdir -p bootstrap/fonts
mkdir -p bootstrap/css
#
# JS COMPILE
#
bootstrap-js: bootstrap/js/*.js
bootstrap/js/*.js: js/*.js
mkdir -p bootstrap/js mkdir -p bootstrap/js
cp fonts/* bootstrap/fonts/
./node_modules/.bin/recess --compile ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css
./node_modules/.bin/recess --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > bootstrap/js/bootstrap.js cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > bootstrap/js/bootstrap.js
./node_modules/.bin/uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js ./node_modules/.bin/uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
#
# CSS COMPLILE
#
bootstrap-css: bootstrap/css/*.css
bootstrap/css/*.css: less/*.less
mkdir -p bootstrap/css
./node_modules/.bin/recess --compile ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css
./node_modules/.bin/recess --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
./node_modules/.bin/recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
./node_modules/.bin/recess --compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
#
# FONTS
#
bootstrap-fonts: bootstrap/fonts/*
bootstrap/fonts/*: fonts/*
mkdir -p bootstrap/fonts
cp fonts/* bootstrap/fonts/
# #
# MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O ) # MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O )
# #
...@@ -93,4 +120,4 @@ watch: ...@@ -93,4 +120,4 @@ watch:
watchr -e "watch('less/.*\.less') { system 'make' }" watchr -e "watch('less/.*\.less') { system 'make' }"
.PHONY: docs watch gh-pages .PHONY: docs watch gh-pages bootstrap-img bootstrap-css bootstrap-js
\ No newline at end of file
# [Twitter Bootstrap v3.0.0](http://twitter.github.com/bootstrap) [![Build Status](https://secure.travis-ci.org/twitter/bootstrap.png)](http://travis-ci.org/twitter/bootstrap) <a href="http://getbootstrap.com">
<img src="http://twitter.github.com/bootstrap/assets/img/bootstrap-docs-readme.png" width="100px">
</a>
# [Bootstrap v3.0.0](http://twitter.github.com/bootstrap) [![Build Status](https://secure.travis-ci.org/twitter/bootstrap.png)](http://travis-ci.org/twitter/bootstrap)
Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created and maintained by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat). Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created and maintained by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat).
To get started, checkout http://getbootstrap.com! To get started, checkout [http://getbootstrap.com](http://getbootstrap.com)!
...@@ -30,7 +34,7 @@ And constructed with the following guidelines: ...@@ -30,7 +34,7 @@ And constructed with the following guidelines:
* New additions without breaking backward compatibility bumps the minor (and resets the patch) * New additions without breaking backward compatibility bumps the minor (and resets the patch)
* Bug fixes and misc changes bumps the patch * Bug fixes and misc changes bumps the patch
For more information on SemVer, please visit http://semver.org/. For more information on SemVer, please visit [http://semver.org/](http://semver.org/).
...@@ -85,13 +89,13 @@ Thanks! ...@@ -85,13 +89,13 @@ Thanks!
**Mark Otto** **Mark Otto**
+ http://twitter.com/mdo + [http://twitter.com/mdo](http://twitter.com/mdo)
+ http://github.com/mdo + [http://github.com/mdo](http://github.com/mdo)
**Jacob Thornton** **Jacob Thornton**
+ http://twitter.com/fat + [http://twitter.com/fat](http://twitter.com/fat)
+ http://github.com/fat + [http://github.com/fat](http://github.com/fat)
...@@ -103,7 +107,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); ...@@ -103,7 +107,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this work except in compliance with the License. you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or at: You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0 [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
......
...@@ -694,9 +694,9 @@ blockquote { ...@@ -694,9 +694,9 @@ blockquote {
blockquote p { blockquote p {
margin-bottom: 0; margin-bottom: 0;
font-size: 16px; font-size: 17.5px;
font-weight: 300; font-weight: 300;
line-height: 25px; line-height: 1.25;
} }
blockquote small { blockquote small {
...@@ -1439,24 +1439,30 @@ table { ...@@ -1439,24 +1439,30 @@ table {
} }
.table-bordered thead:first-child tr:first-child > th:first-child, .table-bordered thead:first-child tr:first-child > th:first-child,
.table-bordered tbody:first-child tr:first-child > td:first-child { .table-bordered tbody:first-child tr:first-child > td:first-child,
.table-bordered tbody:first-child tr:first-child > th:first-child {
border-top-left-radius: 4px; border-top-left-radius: 4px;
} }
.table-bordered thead:first-child tr:first-child > th:last-child, .table-bordered thead:first-child tr:first-child > th:last-child,
.table-bordered tbody:first-child tr:first-child > td:last-child { .table-bordered tbody:first-child tr:first-child > td:last-child,
.table-bordered tbody:first-child tr:first-child > th:last-child {
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
.table-bordered thead:last-child tr:last-child > th:first-child, .table-bordered thead:last-child tr:last-child > th:first-child,
.table-bordered tbody:last-child tr:last-child > td:first-child, .table-bordered tbody:last-child tr:last-child > td:first-child,
.table-bordered tfoot:last-child tr:last-child > td:first-child { .table-bordered tbody:last-child tr:last-child > th:first-child,
.table-bordered tfoot:last-child tr:last-child > td:first-child,
.table-bordered tfoot:last-child tr:last-child > th:first-child {
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
} }
.table-bordered thead:last-child tr:last-child > th:last-child, .table-bordered thead:last-child tr:last-child > th:last-child,
.table-bordered tbody:last-child tr:last-child > td:last-child, .table-bordered tbody:last-child tr:last-child > td:last-child,
.table-bordered tfoot:last-child tr:last-child > td:last-child { .table-bordered tbody:last-child tr:last-child > th:last-child,
.table-bordered tfoot:last-child tr:last-child > td:last-child,
.table-bordered tfoot:last-child tr:last-child > th:last-child {
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
} }
...@@ -1487,8 +1493,8 @@ table { ...@@ -1487,8 +1493,8 @@ table {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
.table-hover tbody tr:hover td, .table-hover tbody tr:hover > td,
.table-hover tbody tr:hover th { .table-hover tbody tr:hover > th {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
...@@ -1499,35 +1505,35 @@ table th[class*="span"] { ...@@ -1499,35 +1505,35 @@ table th[class*="span"] {
margin-left: 0; margin-left: 0;
} }
.table tbody tr.success td { .table tbody tr.success > td {
background-color: #dff0d8; background-color: #dff0d8;
} }
.table tbody tr.error td { .table tbody tr.error > td {
background-color: #f2dede; background-color: #f2dede;
} }
.table tbody tr.warning td { .table tbody tr.warning > td {
background-color: #fcf8e3; background-color: #fcf8e3;
} }
.table tbody tr.info td { .table tbody tr.info > td {
background-color: #d9edf7; background-color: #d9edf7;
} }
.table-hover tbody tr.success:hover td { .table-hover tbody tr.success:hover > td {
background-color: #d0e9c6; background-color: #d0e9c6;
} }
.table-hover tbody tr.error:hover td { .table-hover tbody tr.error:hover > td {
background-color: #ebcccc; background-color: #ebcccc;
} }
.table-hover tbody tr.warning:hover td { .table-hover tbody tr.warning:hover > td {
background-color: #faf2cc; background-color: #faf2cc;
} }
.table-hover tbody tr.info:hover td { .table-hover tbody tr.info:hover > td {
background-color: #c4e3f3; background-color: #c4e3f3;
} }
...@@ -3360,8 +3366,8 @@ fieldset[disabled] .navbar .btn-navbar { ...@@ -3360,8 +3366,8 @@ fieldset[disabled] .navbar .btn-navbar {
} }
.navbar .nav li.dropdown > a:hover .caret { .navbar .nav li.dropdown > a:hover .caret {
border-top-color: #555555; border-top-color: #333333;
border-bottom-color: #555555; border-bottom-color: #333333;
} }
.navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.open > .dropdown-toggle,
...@@ -3842,6 +3848,7 @@ fieldset[disabled] .navbar-inverse .btn-navbar { ...@@ -3842,6 +3848,7 @@ fieldset[disabled] .navbar-inverse .btn-navbar {
display: block; display: block;
padding: 5px; padding: 5px;
font-size: 11px; font-size: 11px;
line-height: 1.4;
opacity: 0; opacity: 0;
filter: alpha(opacity=0); filter: alpha(opacity=0);
visibility: visible; visibility: visible;
...@@ -3924,7 +3931,7 @@ fieldset[disabled] .navbar-inverse .btn-navbar { ...@@ -3924,7 +3931,7 @@ fieldset[disabled] .navbar-inverse .btn-navbar {
left: 0; left: 0;
z-index: 1010; z-index: 1010;
display: none; display: none;
width: 236px; max-width: 276px;
padding: 1px; padding: 1px;
text-align: left; text-align: left;
white-space: normal; white-space: normal;
...@@ -3966,6 +3973,10 @@ fieldset[disabled] .navbar-inverse .btn-navbar { ...@@ -3966,6 +3973,10 @@ fieldset[disabled] .navbar-inverse .btn-navbar {
border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0;
} }
.popover-title:empty {
display: none;
}
.popover-content { .popover-content {
padding: 9px 14px; padding: 9px 14px;
} }
......
...@@ -528,6 +528,9 @@ h2 + .row { ...@@ -528,6 +528,9 @@ h2 + .row {
/* Example page /* Example page
------------------------- */ ------------------------- */
.bootstrap-examples h4 {
margin: 10px 0 5px;
}
.bootstrap-examples p { .bootstrap-examples p {
font-size: 13px; font-size: 13px;
line-height: 18px; line-height: 18px;
......
...@@ -43,14 +43,14 @@ ...@@ -43,14 +43,14 @@
// tooltip demo // tooltip demo
$('.tooltip-demo').tooltip({ $('.tooltip-demo').tooltip({
selector: "a[rel=tooltip]" selector: "a[data-toggle=tooltip]"
}) })
$('.tooltip-test').tooltip() $('.tooltip-test').tooltip()
$('.popover-test').popover() $('.popover-test').popover()
// popover demo // popover demo
$("a[rel=popover]") $("a[data-toggle=popover]")
.popover() .popover()
.click(function(e) { .click(function(e) {
e.preventDefault() e.preventDefault()
...@@ -153,4 +153,4 @@ $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { ...@@ -153,4 +153,4 @@ $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) {
} }
}) })
}(window.jQuery) }(window.jQuery)
\ No newline at end of file
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
e = $.Event('slide', { e = $.Event('slide', {
relatedTarget: $next[0] relatedTarget: $next[0]
, direction: direction
}) })
if ($next.hasClass('active')) return if ($next.hasClass('active')) return
...@@ -187,11 +188,18 @@ ...@@ -187,11 +188,18 @@
/* CAROUSEL DATA-API /* CAROUSEL DATA-API
* ================= */ * ================= */
$(document).on('click.carousel.data-api', '[data-slide]', function (e) { $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = $.extend({}, $target.data(), $this.data()) , options = $.extend({}, $target.data(), $this.data())
, slideIndex
$target.carousel(options) $target.carousel(options)
if (slideIndex = $this.attr('data-slide-to')) {
$target.data('carousel').pause().to(slideIndex).cycle()
}
e.preventDefault() e.preventDefault()
}) })
......
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
, data = $this.data('collapse') , data = $this.data('collapse')
, options = typeof option == 'object' && option , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('collapse', (data = new Collapse(this, options))) if (!data) $this.data('collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]() if (typeof option == 'string') data[option]()
}) })
......
...@@ -81,7 +81,10 @@ ...@@ -81,7 +81,10 @@
isActive = $parent.hasClass('open') isActive = $parent.hasClass('open')
if (!isActive || (isActive && e.keyCode == 27)) return $this.click() if (!isActive || (isActive && e.keyCode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
}
$items = $('[role=menu] li:not(.divider):visible a', $parent) $items = $('[role=menu] li:not(.divider):visible a', $parent)
...@@ -154,7 +157,7 @@ ...@@ -154,7 +157,7 @@
$(document) $(document)
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown.data-api touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
placement: 'right' placement: 'right'
, trigger: 'click' , trigger: 'click'
, content: '' , content: ''
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>' , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
}) })
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
, $href = /^#\w/.test(href) && $(href) , $href = /^#\w/.test(href) && $(href)
return ( $href return ( $href
&& $href.length && $href.length
&& [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null && [[ $href.position().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] })
.each(function () { .each(function () {
......
...@@ -38,19 +38,27 @@ ...@@ -38,19 +38,27 @@
, init: function (type, element, options) { , init: function (type, element, options) {
var eventIn var eventIn
, eventOut , eventOut
, triggers
, trigger
, i
this.type = type this.type = type
this.$element = $(element) this.$element = $(element)
this.options = this.getOptions(options) this.options = this.getOptions(options)
this.enabled = true this.enabled = true
if (this.options.trigger == 'click') { triggers = this.options.trigger.split(' ')
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (this.options.trigger != 'manual') { for (i = triggers.length; i--;) {
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus' trigger = triggers[i]
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur' if (trigger == 'click') {
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } else if (trigger != 'manual') {
eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
} }
this.options.selector ? this.options.selector ?
...@@ -102,8 +110,11 @@ ...@@ -102,8 +110,11 @@
, actualHeight , actualHeight
, placement , placement
, tp , tp
, e = $.Event('show')
if (this.hasContent() && this.enabled) { if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip = this.tip() $tip = this.tip()
this.setContent() this.setContent()
...@@ -118,7 +129,8 @@ ...@@ -118,7 +129,8 @@
$tip $tip
.detach() .detach()
.css({ top: 0, left: 0, display: 'block' }) .css({ top: 0, left: 0, display: 'block' })
.insertAfter(this.$element)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
pos = this.getPosition() pos = this.getPosition()
...@@ -144,6 +156,8 @@ ...@@ -144,6 +156,8 @@
.offset(tp) .offset(tp)
.addClass(placement) .addClass(placement)
.addClass('in') .addClass('in')
this.$element.trigger('shown')
} }
} }
...@@ -158,6 +172,10 @@ ...@@ -158,6 +172,10 @@
, hide: function () { , hide: function () {
var that = this var that = this
, $tip = this.tip() , $tip = this.tip()
, e = $.Event('hide')
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip.removeClass('in') $tip.removeClass('in')
...@@ -176,6 +194,8 @@ ...@@ -176,6 +194,8 @@
removeWithAnimation() : removeWithAnimation() :
$tip.detach() $tip.detach()
this.$element.trigger('hidden')
return this return this
} }
...@@ -234,8 +254,8 @@ ...@@ -234,8 +254,8 @@
} }
, toggle: function (e) { , toggle: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type) var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
self[self.tip().hasClass('in') ? 'hide' : 'show']() self.tip().hasClass('in') ? self.hide() : self.show()
} }
, destroy: function () { , destroy: function () {
...@@ -267,10 +287,11 @@ ...@@ -267,10 +287,11 @@
, 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' , trigger: 'hover focus'
, title: '' , title: ''
, delay: 0 , delay: 0
, html: false , html: false
, container: false
} }
...@@ -282,4 +303,4 @@ ...@@ -282,4 +303,4 @@
return this return this
} }
}(window.jQuery); }(window.jQuery);
\ No newline at end of file
...@@ -271,6 +271,7 @@ ...@@ -271,6 +271,7 @@
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
this.select() this.select()
this.$element.focus()
} }
, mouseenter: function (e) { , mouseenter: function (e) {
......
...@@ -369,6 +369,7 @@ ...@@ -369,6 +369,7 @@
e = $.Event('slide', { e = $.Event('slide', {
relatedTarget: $next[0] relatedTarget: $next[0]
, direction: direction
}) })
if ($next.hasClass('active')) return if ($next.hasClass('active')) return
...@@ -448,11 +449,18 @@ ...@@ -448,11 +449,18 @@
/* CAROUSEL DATA-API /* CAROUSEL DATA-API
* ================= */ * ================= */
$(document).on('click.carousel.data-api', '[data-slide]', function (e) { $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = $.extend({}, $target.data(), $this.data()) , options = $.extend({}, $target.data(), $this.data())
, slideIndex
$target.carousel(options) $target.carousel(options)
if (slideIndex = $this.attr('data-slide-to')) {
$target.data('carousel').pause().to(slideIndex).cycle()
}
e.preventDefault() e.preventDefault()
}) })
...@@ -587,7 +595,7 @@ ...@@ -587,7 +595,7 @@
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
, data = $this.data('collapse') , data = $this.data('collapse')
, options = typeof option == 'object' && option , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('collapse', (data = new Collapse(this, options))) if (!data) $this.data('collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]() if (typeof option == 'string') data[option]()
}) })
...@@ -705,7 +713,10 @@ ...@@ -705,7 +713,10 @@
isActive = $parent.hasClass('open') isActive = $parent.hasClass('open')
if (!isActive || (isActive && e.keyCode == 27)) return $this.click() if (!isActive || (isActive && e.keyCode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
}
$items = $('[role=menu] li:not(.divider):visible a', $parent) $items = $('[role=menu] li:not(.divider):visible a', $parent)
...@@ -778,7 +789,7 @@ ...@@ -778,7 +789,7 @@
$(document) $(document)
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown.data-api touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
...@@ -1067,19 +1078,27 @@ ...@@ -1067,19 +1078,27 @@
, init: function (type, element, options) { , init: function (type, element, options) {
var eventIn var eventIn
, eventOut , eventOut
, triggers
, trigger
, i
this.type = type this.type = type
this.$element = $(element) this.$element = $(element)
this.options = this.getOptions(options) this.options = this.getOptions(options)
this.enabled = true this.enabled = true
if (this.options.trigger == 'click') { triggers = this.options.trigger.split(' ')
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (this.options.trigger != 'manual') { for (i = triggers.length; i--;) {
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus' trigger = triggers[i]
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur' if (trigger == 'click') {
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } else if (trigger != 'manual') {
eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
} }
this.options.selector ? this.options.selector ?
...@@ -1131,8 +1150,11 @@ ...@@ -1131,8 +1150,11 @@
, actualHeight , actualHeight
, placement , placement
, tp , tp
, e = $.Event('show')
if (this.hasContent() && this.enabled) { if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip = this.tip() $tip = this.tip()
this.setContent() this.setContent()
...@@ -1147,7 +1169,8 @@ ...@@ -1147,7 +1169,8 @@
$tip $tip
.detach() .detach()
.css({ top: 0, left: 0, display: 'block' }) .css({ top: 0, left: 0, display: 'block' })
.insertAfter(this.$element)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
pos = this.getPosition() pos = this.getPosition()
...@@ -1173,6 +1196,8 @@ ...@@ -1173,6 +1196,8 @@
.offset(tp) .offset(tp)
.addClass(placement) .addClass(placement)
.addClass('in') .addClass('in')
this.$element.trigger('shown')
} }
} }
...@@ -1187,6 +1212,10 @@ ...@@ -1187,6 +1212,10 @@
, hide: function () { , hide: function () {
var that = this var that = this
, $tip = this.tip() , $tip = this.tip()
, e = $.Event('hide')
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip.removeClass('in') $tip.removeClass('in')
...@@ -1205,6 +1234,8 @@ ...@@ -1205,6 +1234,8 @@
removeWithAnimation() : removeWithAnimation() :
$tip.detach() $tip.detach()
this.$element.trigger('hidden')
return this return this
} }
...@@ -1263,8 +1294,8 @@ ...@@ -1263,8 +1294,8 @@
} }
, toggle: function (e) { , toggle: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type) var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
self[self.tip().hasClass('in') ? 'hide' : 'show']() self.tip().hasClass('in') ? self.hide() : self.show()
} }
, destroy: function () { , destroy: function () {
...@@ -1296,10 +1327,11 @@ ...@@ -1296,10 +1327,11 @@
, 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' , trigger: 'hover focus'
, title: '' , title: ''
, delay: 0 , delay: 0
, html: false , html: false
, container: false
} }
...@@ -1311,7 +1343,8 @@ ...@@ -1311,7 +1343,8 @@
return this return this
} }
}(window.jQuery);/* =========================================================== }(window.jQuery);
/* ===========================================================
* bootstrap-popover.js v3.0.0 * bootstrap-popover.js v3.0.0
* http://twitter.github.com/bootstrap/javascript.html#popovers * http://twitter.github.com/bootstrap/javascript.html#popovers
* =========================================================== * ===========================================================
...@@ -1412,7 +1445,7 @@ ...@@ -1412,7 +1445,7 @@
placement: 'right' placement: 'right'
, trigger: 'click' , trigger: 'click'
, content: '' , content: ''
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>' , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
}) })
...@@ -1486,7 +1519,7 @@ ...@@ -1486,7 +1519,7 @@
, $href = /^#\w/.test(href) && $(href) , $href = /^#\w/.test(href) && $(href)
return ( $href return ( $href
&& $href.length && $href.length
&& [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null && [[ $href.position().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] })
.each(function () { .each(function () {
...@@ -2002,6 +2035,7 @@ ...@@ -2002,6 +2035,7 @@
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
this.select() this.select()
this.$element.focus()
} }
, mouseenter: function (e) { , mouseenter: function (e) {
......
This diff is collapsed.
/* /*
Holder - 1.6 - client side image placeholders Holder - 1.9 - client side image placeholders
(c) 2012 Ivan Malopinsky / http://imsky.co (c) 2012-2013 Ivan Malopinsky / http://imsky.co
Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
Commercial use requires attribution. Commercial use requires attribution.
...@@ -33,6 +33,13 @@ function selector(a){ ...@@ -33,6 +33,13 @@ function selector(a){
//shallow object property extend //shallow object property extend
function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c} function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}
//hasOwnProperty polyfill
if (!Object.prototype.hasOwnProperty)
Object.prototype.hasOwnProperty = function(prop) {
var proto = this.__proto__ || this.constructor.prototype;
return (prop in this) && (!(prop in proto) || proto[prop] !== this[prop]);
}
function text_size(width, height, template) { function text_size(width, height, template) {
var dimension_arr = [height, width].sort(); var dimension_arr = [height, width].sort();
var maxFactor = Math.round(dimension_arr[1] / 16), var maxFactor = Math.round(dimension_arr[1] / 16),
...@@ -47,6 +54,7 @@ function draw(ctx, dimensions, template, ratio) { ...@@ -47,6 +54,7 @@ function draw(ctx, dimensions, template, ratio) {
var ts = text_size(dimensions.width, dimensions.height, template); var ts = text_size(dimensions.width, dimensions.height, template);
var text_height = ts.height; var text_height = ts.height;
var width = dimensions.width * ratio, height = dimensions.height * ratio; var width = dimensions.width * ratio, height = dimensions.height * ratio;
var font = template.font ? template.font : "sans-serif";
canvas.width = width; canvas.width = width;
canvas.height = height; canvas.height = height;
ctx.textAlign = "center"; ctx.textAlign = "center";
...@@ -54,39 +62,42 @@ function draw(ctx, dimensions, template, ratio) { ...@@ -54,39 +62,42 @@ function draw(ctx, dimensions, template, ratio) {
ctx.fillStyle = template.background; ctx.fillStyle = template.background;
ctx.fillRect(0, 0, width, height); ctx.fillRect(0, 0, width, height);
ctx.fillStyle = template.foreground; ctx.fillStyle = template.foreground;
ctx.font = "bold " + text_height + "px sans-serif"; ctx.font = "bold " + text_height + "px "+font;
var text = template.text ? template.text : (dimensions.width + "x" + dimensions.height); var text = template.text ? template.text : (dimensions.width + "x" + dimensions.height);
if (ctx.measureText(text).width / width > 1) { if (ctx.measureText(text).width / width > 1) {
text_height = template.size / (ctx.measureText(text).width / width); text_height = template.size / (ctx.measureText(text).width / width);
} }
ctx.font = "bold " + (text_height * ratio) + "px sans-serif"; //Resetting font size if necessary
ctx.font = "bold " + (text_height * ratio) + "px "+font;
ctx.fillText(text, (width / 2), (height / 2), width); ctx.fillText(text, (width / 2), (height / 2), width);
return canvas.toDataURL("image/png"); return canvas.toDataURL("image/png");
} }
function render(mode, el, holder, src) { function render(mode, el, holder, src) {
var dimensions = holder.dimensions, var dimensions = holder.dimensions,
theme = holder.theme, theme = holder.theme,
text = holder.text; text = holder.text ? decodeURIComponent(holder.text) : holder.text;
var dimensions_caption = dimensions.width + "x" + dimensions.height; var dimensions_caption = dimensions.width + "x" + dimensions.height;
theme = (text ? extend(theme, { theme = (text ? extend(theme, { text: text }) : theme);
text: text theme = (holder.font ? extend(theme, {font: holder.font}) : theme);
}) : theme);
var ratio = 1; var ratio = 1;
if(window.devicePixelRatio && window.devicePixelRatio > 1){ if(window.devicePixelRatio && window.devicePixelRatio > 1){
ratio = window.devicePixelRatio; ratio = window.devicePixelRatio;
} }
if (mode == "image") { if (mode == "image") {
el.setAttribute("data-src", src); el.setAttribute("data-src", src);
el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption);
el.style.width = dimensions.width + "px";
el.style.height = dimensions.height + "px"; if(fallback || !holder.auto){
el.style.width = dimensions.width + "px";
el.style.height = dimensions.height + "px";
}
if (fallback) { if (fallback) {
el.style.backgroundColor = theme.background; el.style.backgroundColor = theme.background;
} }
else{ else{
el.setAttribute("src", draw(ctx, dimensions, theme, ratio)); el.setAttribute("src", draw(ctx, dimensions, theme, ratio));
...@@ -108,14 +119,7 @@ function fluid(el, holder, src) { ...@@ -108,14 +119,7 @@ function fluid(el, holder, src) {
text: text text: text
}) : theme); }) : theme);
var fluid = document.createElement("table"); var fluid = document.createElement("div");
fluid.setAttribute("cellspacing",0)
fluid.setAttribute("cellpadding",0)
fluid.setAttribute("border",0)
var row = document.createElement("tr")
.appendChild(document.createElement("td")
.appendChild(document.createTextNode(theme.text)));
fluid.style.backgroundColor = theme.background; fluid.style.backgroundColor = theme.background;
fluid.style.color = theme.foreground; fluid.style.color = theme.foreground;
...@@ -124,31 +128,38 @@ function fluid(el, holder, src) { ...@@ -124,31 +128,38 @@ function fluid(el, holder, src) {
fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%")>0?"":"px"); fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%")>0?"":"px");
fluid.id = el.id; fluid.id = el.id;
var frag = document.createDocumentFragment(), el.style.width=0;
tbody = document.createElement("tbody"), el.style.height=0;
tr = document.createElement("tr"),
td = document.createElement("td");
tr.appendChild(td);
tbody.appendChild(tr);
frag.appendChild(tbody);
if (theme.text) { if (theme.text) {
td.appendChild(document.createTextNode(theme.text)) fluid.appendChild(document.createTextNode(theme.text))
fluid.appendChild(frag);
} else { } else {
td.appendChild(document.createTextNode(dimensions_caption)) fluid.appendChild(document.createTextNode(dimensions_caption))
fluid.appendChild(frag);
fluid_images.push(fluid); fluid_images.push(fluid);
setTimeout(fluid_update, 0); setTimeout(fluid_update, 0);
} }
el.parentNode.replaceChild(fluid, el); el.parentNode.insertBefore(fluid, el.nextSibling)
if(window.jQuery){
jQuery(function($){
$(el).on("load", function(){
el.style.width = fluid.style.width;
el.style.height = fluid.style.height;
$(el).show();
$(fluid).remove();
});
})
}
} }
function fluid_update() { function fluid_update() {
for (i in fluid_images) { for (i in fluid_images) {
var el = fluid_images[i]; if(!fluid_images.hasOwnProperty(i)) continue;
var label = el.getElementsByTagName("td")[0].firstChild; var el = fluid_images[i],
label = el.firstChild;
el.style.lineHeight = el.offsetHeight+"px";
label.data = el.offsetWidth + "x" + el.offsetHeight; label.data = el.offsetWidth + "x" + el.offsetHeight;
} }
} }
...@@ -175,6 +186,11 @@ function parse_flags(flags, options) { ...@@ -175,6 +186,11 @@ function parse_flags(flags, options) {
ret.theme = options.themes[flag]; ret.theme = options.themes[flag];
} else if (app.flags.text.match(flag)) { } else if (app.flags.text.match(flag)) {
ret.text = app.flags.text.output(flag); ret.text = app.flags.text.output(flag);
} else if(app.flags.font.match(flag)){
ret.font = app.flags.font.output(flag);
}
else if(app.flags.auto.match(flag)){
ret.auto = true;
} }
} }
...@@ -199,7 +215,7 @@ var fluid_images = []; ...@@ -199,7 +215,7 @@ var fluid_images = [];
var settings = { var settings = {
domain: "holder.js", domain: "holder.js",
images: "img", images: "img",
elements: ".holderjs", bgnodes: ".holderjs",
themes: { themes: {
"gray": { "gray": {
background: "#eee", background: "#eee",
...@@ -217,13 +233,13 @@ var settings = { ...@@ -217,13 +233,13 @@ var settings = {
size: 12 size: 12
} }
}, },
stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;border-collapse:collapse;border:0;vertical-align:middle;margin:0}" stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;margin:0}"
}; };
app.flags = { app.flags = {
dimensions: { dimensions: {
regex: /(\d+)x(\d+)/, regex: /^(\d+)x(\d+)$/,
output: function (val) { output: function (val) {
var exec = this.regex.exec(val); var exec = this.regex.exec(val);
return { return {
...@@ -233,7 +249,7 @@ app.flags = { ...@@ -233,7 +249,7 @@ app.flags = {
} }
}, },
fluid: { fluid: {
regex: /([0-9%]+)x([0-9%]+)/, regex: /^([0-9%]+)x([0-9%]+)$/,
output: function (val) { output: function (val) {
var exec = this.regex.exec(val); var exec = this.regex.exec(val);
return { return {
...@@ -258,10 +274,20 @@ app.flags = { ...@@ -258,10 +274,20 @@ app.flags = {
output: function (val) { output: function (val) {
return this.regex.exec(val)[1]; return this.regex.exec(val)[1];
} }
},
font: {
regex: /font\:(.*)/,
output: function(val){
return this.regex.exec(val)[1];
}
},
auto: {
regex: /^auto$/
} }
} }
for (var flag in app.flags) { for (var flag in app.flags) {
if(!app.flags.hasOwnProperty(flag)) continue;
app.flags[flag].match = function (val) { app.flags[flag].match = function (val) {
return val.match(this.regex) return val.match(this.regex)
} }
...@@ -285,29 +311,58 @@ app.add_image = function (src, el) { ...@@ -285,29 +311,58 @@ app.add_image = function (src, el) {
}; };
app.run = function (o) { app.run = function (o) {
var options = extend(settings, o), var options = extend(settings, o), images = [];
images_nodes = selector(options.images),
elements = selector(options.elements), if(options.images instanceof window.NodeList){
preempted = true, imageNodes = options.images;
images = []; }
else if(options.images instanceof window.Node){
imageNodes = [options.images];
}
else{
imageNodes = selector(options.images);
}
if(options.elements instanceof window.NodeList){
bgnodes = options.bgnodes;
}
else if(options.bgnodes instanceof window.Node){
bgnodes = [options.bgnodes];
}
else{
bgnodes = selector(options.bgnodes);
}
for (i = 0, l = images_nodes.length; i < l; i++) images.push(images_nodes[i]); preempted = true;
var holdercss = document.createElement("style"); for (i = 0, l = imageNodes.length; i < l; i++) images.push(imageNodes[i]);
holdercss.type = "text/css";
holdercss.styleSheet ? holdercss.styleSheet.cssText = options.stylesheet : holdercss.textContent = options.stylesheet; var holdercss = document.getElementById("holderjs-style");
document.getElementsByTagName("head")[0].appendChild(holdercss);
if(!holdercss){
holdercss = document.createElement("style");
holdercss.setAttribute("id", "holderjs-style");
holdercss.type = "text/css";
document.getElementsByTagName("head")[0].appendChild(holdercss);
}
if(holdercss.styleSheet){
holdercss.styleSheet += options.stylesheet;
}
else{
holdercss.textContent+= options.stylesheet;
}
var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)");
for (var l = elements.length, i = 0; i < l; i++) { for (var l = bgnodes.length, i = 0; i < l; i++) {
var src = window.getComputedStyle(elements[i], null) var src = window.getComputedStyle(bgnodes[i], null)
.getPropertyValue("background-image"); .getPropertyValue("background-image");
var flags = src.match(cssregex); var flags = src.match(cssregex);
if (flags) { if (flags) {
var holder = parse_flags(flags[1].split("/"), options); var holder = parse_flags(flags[1].split("/"), options);
if (holder) { if (holder) {
render("background", elements[i], holder, src); render("background", bgnodes[i], holder, src);
} }
} }
} }
...@@ -339,4 +394,8 @@ contentLoaded(win, function () { ...@@ -339,4 +394,8 @@ contentLoaded(win, function () {
preempted || app.run(); preempted || app.run();
}); });
})(Holder, window); if ( typeof define === "function" && define.amd ) {
define( "Holder", [], function () { return app; } );
}
})(Holder, window);
\ No newline at end of file
...@@ -158,6 +158,25 @@ ...@@ -158,6 +158,25 @@
&lt;ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel"&gt; &lt;ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel"&gt;
... ...
&lt;/ul&gt; &lt;/ul&gt;
</pre>
<h3>Disabled menu options</h3>
<p>Add <code>.disabled</code> to a <code>&lt;li&gt;</code> in the dropdown to disable the link.</p>
<div class="bs-docs-example">
<div class="dropdown clearfix">
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" style="display: block; position: static; margin-bottom: 5px; *width: 180px;">
<li><a tabindex="-1" href="#">Regular link</a></li>
<li class="disabled"><a tabindex="-1" href="#">Disabled link</a></li>
<li><a tabindex="-1" href="#">Another link</a></li>
</ul>
</div>
</div>
<pre class="prettyprint linenums">
&lt;ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"&gt;
&lt;li&gt;&lt;a tabindex="-1" href="#"&gt;Regular link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a tabindex="-1" href="#"&gt;Disabled link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a tabindex="-1" href="#"&gt;Another link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre> </pre>
</section> </section>
...@@ -185,9 +204,9 @@ ...@@ -185,9 +204,9 @@
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="btn-group"&gt; &lt;div class="btn-group"&gt;
&lt;button class="btn"&gt;1&lt;/button&gt; &lt;button class="btn"&gt;Left&lt;/button&gt;
&lt;button class="btn"&gt;2&lt;/button&gt; &lt;button class="btn"&gt;Middle&lt;/button&gt;
&lt;button class="btn"&gt;3&lt;/button&gt; &lt;button class="btn"&gt;Right&lt;/button&gt;
&lt;/div&gt; &lt;/div&gt;
</pre> </pre>
...@@ -1977,7 +1996,7 @@ ...@@ -1977,7 +1996,7 @@
<p><button class="close" style="float: none;">&times;</button></p> <p><button class="close" style="float: none;">&times;</button></p>
</div> </div>
<pre class="prettyprint linenums">&lt;button class="close"&gt;&amp;times;&lt;/button&gt;</pre> <pre class="prettyprint linenums">&lt;button class="close"&gt;&amp;times;&lt;/button&gt;</pre>
<p>iOS devices require an href="#" for click events if you would rather use an anchor.</p> <p>iOS devices require an <code>href="#"</code> for click events if you would rather use an anchor.</p>
<pre class="prettyprint linenums">&lt;a class="close" href="#"&gt;&amp;times;&lt;/a&gt;</pre> <pre class="prettyprint linenums">&lt;a class="close" href="#"&gt;&amp;times;&lt;/a&gt;</pre>
<h2>Helper classes</h2> <h2>Helper classes</h2>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
/* CUSTOMIZE THE NAVBAR /* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */ -------------------------------------------------- */
/* Carousel base class */ /* Carousel base class */
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
text-shadow: 0 1px 1px rgba(0,0,0,.4); text-shadow: 0 1px 1px rgba(0,0,0,.4);
background-color: transparent; background-color: transparent;
border: 0; border: 0;
z-index: 10;
} }
.carousel .item { .carousel .item {
...@@ -417,7 +418,7 @@ ...@@ -417,7 +418,7 @@
<!-- FOOTER --> <!-- FOOTER -->
<footer> <footer>
<p class="pull-right"><a href="#">Back to top</a></p> <p class="pull-right"><a href="#">Back to top</a></p>
<p>&copy; 2012 Company, Inc. &middot; <a href="#">Privacy</a> &middot; <a href="#">Terms</a></p> <p>&copy; 2013 Company, Inc. &middot; <a href="#">Privacy</a> &middot; <a href="#">Terms</a></p>
</footer> </footer>
</div><!-- /.container --> </div><!-- /.container -->
...@@ -448,5 +449,6 @@ ...@@ -448,5 +449,6 @@
}) })
}(window.jQuery) }(window.jQuery)
</script> </script>
<script src="../assets/js/holder/holder.js"></script>
</body> </body>
</html> </html>
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<hr> <hr>
<footer> <footer>
<p>&copy; Company 2012</p> <p>&copy; Company 2013</p>
</footer> </footer>
</div> <!-- /container --> </div> <!-- /container -->
......
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
} }
.navbar .nav { .navbar .nav {
margin: 0; margin: 0;
display: table;
width: 100%;
} }
.navbar .nav li { .navbar .nav li {
display: table-cell; display: table-cell;
...@@ -146,7 +148,7 @@ ...@@ -146,7 +148,7 @@
<hr> <hr>
<div class="footer"> <div class="footer">
<p>&copy; Company 2012</p> <p>&copy; Company 2013</p>
</div> </div>
</div> <!-- /container --> </div> <!-- /container -->
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<hr> <hr>
<div class="footer"> <div class="footer">
<p>&copy; Company 2012</p> <p>&copy; Company 2013</p>
</div> </div>
</div> <!-- /container --> </div> <!-- /container -->
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sticky footer &middot; Twitter Bootstrap</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- CSS -->
<link href="../assets/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
/* Sticky footer styles
-------------------------------------------------- */
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
#wrap > .container {
padding-top: 60px;
}
.container .credit {
margin: 20px 0;
}
code {
font-size: 80%;
}
</style>
<link href="../assets/css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="../assets/ico/favicon.png">
</head>
<body>
<!-- Part 1: Wrap all page content here -->
<div id="wrap">
<!-- Fixed navbar -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Project name</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="nav-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>Sticky footer with fixed navbar</h1>
</div>
<p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within <code>#wrap</code> with <code>padding-top: 60px;</code> on the <code>.container</code>.</p>
<p>Back to <a href="./sticky-footer.html">the sticky footer</a> minus the navbar.</p>
</div>
<div id="push"></div>
</div>
<div id="footer">
<div class="container">
<p class="muted credit">Example courtesy <a href="http://martinbean.co.uk">Martin Bean</a> and <a href="http://ryanfait.com/sticky-footer/">Ryan Fait</a>.</p>
</div>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../assets/js/jquery.js"></script>
<script src="../assets/js/bootstrap-transition.js"></script>
<script src="../assets/js/bootstrap-alert.js"></script>
<script src="../assets/js/bootstrap-modal.js"></script>
<script src="../assets/js/bootstrap-dropdown.js"></script>
<script src="../assets/js/bootstrap-scrollspy.js"></script>
<script src="../assets/js/bootstrap-tab.js"></script>
<script src="../assets/js/bootstrap-tooltip.js"></script>
<script src="../assets/js/bootstrap-popover.js"></script>
<script src="../assets/js/bootstrap-button.js"></script>
<script src="../assets/js/bootstrap-collapse.js"></script>
<script src="../assets/js/bootstrap-carousel.js"></script>
<script src="../assets/js/bootstrap-typeahead.js"></script>
</body>
</html>
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
<h1>Sticky footer</h1> <h1>Sticky footer</h1>
</div> </div>
<p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p> <p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p>
<p>Use <a href="./sticky-footer-navbar.html">the sticky footer</a> with a fixed navbar if need be, too.</p>
</div> </div>
<div id="push"></div> <div id="push"></div>
......
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
<div class="page-header"> <div class="page-header">
<h1>4. Basic HTML template</h1> <h1>4. Basic HTML template</h1>
</div> </div>
<p class="lead">With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the <a href="#file-structure">File structure</a>.</p> <p class="lead">With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the <a href="./getting-started.html#file-structure">File structure</a>.</p>
<p>Now, here's a look at a <strong>typical HTML file</strong>:</p> <p>Now, here's a look at a <strong>typical HTML file</strong>:</p>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;!DOCTYPE html&gt; &lt;!DOCTYPE html&gt;
...@@ -240,14 +240,14 @@ ...@@ -240,14 +240,14 @@
<div class="row bootstrap-examples"> <div class="row bootstrap-examples">
<div class="span4"> <div class="span4">
<a class="thumbnail" href="examples/starter-template.html"> <a class="thumbnail" href="examples/starter-template.html">
<img src="assets/img/examples/bootstrap-example-starter.jpg" alt=""> <img src="assets/img/examples/bootstrap-example-starter.png" alt="">
</a> </a>
<h4>Starter template</h4> <h4>Starter template</h4>
<p>A barebones HTML document with all the Bootstrap CSS and JavaScript included.</p> <p>A barebones HTML document with all the Bootstrap CSS and JavaScript included.</p>
</div> </div>
<div class="span4"> <div class="span4">
<a class="thumbnail" href="examples/hero.html"> <a class="thumbnail" href="examples/hero.html">
<img src="assets/img/examples/bootstrap-example-hero.jpg" alt=""> <img src="assets/img/examples/bootstrap-example-marketing.png" alt="">
</a> </a>
<h4>Basic marketing site</h4> <h4>Basic marketing site</h4>
<p>Featuring a hero unit for a primary message and three supporting elements.</p> <p>Featuring a hero unit for a primary message and three supporting elements.</p>
...@@ -259,6 +259,13 @@ ...@@ -259,6 +259,13 @@
<h4>Narrow marketing</h4> <h4>Narrow marketing</h4>
<p>Slim, lightweight marketing template for small projects or teams.</p> <p>Slim, lightweight marketing template for small projects or teams.</p>
</div> </div>
<div class="span4">
<a class="thumbnail" href="examples/justified-nav.html">
<img src="assets/img/examples/bootstrap-example-justified-nav.png" alt="">
</a>
<h4>Justified nav</h4>
<p>Marketing page with equal-width navigation links in a modified navbar.</p>
</div>
<div class="span4"> <div class="span4">
<a class="thumbnail" href="examples/signin.html"> <a class="thumbnail" href="examples/signin.html">
<img src="assets/img/examples/bootstrap-example-signin.png" alt=""> <img src="assets/img/examples/bootstrap-example-signin.png" alt="">
......
This diff is collapsed.
...@@ -90,6 +90,25 @@ ...@@ -90,6 +90,25 @@
&lt;ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel"&gt; &lt;ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel"&gt;
... ...
&lt;/ul&gt; &lt;/ul&gt;
</pre>
<h3>Disabled menu options</h3>
<p>Add <code>.disabled</code> to a <code>&lt;li&gt;</code> in the dropdown to disable the link.</p>
<div class="bs-docs-example">
<div class="dropdown clearfix">
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" style="display: block; position: static; margin-bottom: 5px; *width: 180px;">
<li><a tabindex="-1" href="#">Regular link</a></li>
<li class="disabled"><a tabindex="-1" href="#">Disabled link</a></li>
<li><a tabindex="-1" href="#">Another link</a></li>
</ul>
</div>
</div>{{! /example }}
<pre class="prettyprint linenums">
&lt;ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"&gt;
&lt;li&gt;&lt;a tabindex="-1" href="#"&gt;Regular link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a tabindex="-1" href="#"&gt;Disabled link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a tabindex="-1" href="#"&gt;Another link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre> </pre>
</section> </section>
...@@ -117,9 +136,9 @@ ...@@ -117,9 +136,9 @@
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="btn-group"&gt; &lt;div class="btn-group"&gt;
&lt;button class="btn"&gt;1&lt;/button&gt; &lt;button class="btn"&gt;Left&lt;/button&gt;
&lt;button class="btn"&gt;2&lt;/button&gt; &lt;button class="btn"&gt;Middle&lt;/button&gt;
&lt;button class="btn"&gt;3&lt;/button&gt; &lt;button class="btn"&gt;Right&lt;/button&gt;
&lt;/div&gt; &lt;/div&gt;
</pre> </pre>
...@@ -1909,7 +1928,7 @@ ...@@ -1909,7 +1928,7 @@
<p><button class="close" style="float: none;">&times;</button></p> <p><button class="close" style="float: none;">&times;</button></p>
</div> </div>
<pre class="prettyprint linenums">&lt;button class="close"&gt;&amp;times;&lt;/button&gt;</pre> <pre class="prettyprint linenums">&lt;button class="close"&gt;&amp;times;&lt;/button&gt;</pre>
<p>iOS devices require an href="#" for click events if you would rather use an anchor.</p> <p>iOS devices require an <code>href="#"</code> for click events if you would rather use an anchor.</p>
<pre class="prettyprint linenums">&lt;a class="close" href="#"&gt;&amp;times;&lt;/a&gt;</pre> <pre class="prettyprint linenums">&lt;a class="close" href="#"&gt;&amp;times;&lt;/a&gt;</pre>
<h2>Helper classes</h2> <h2>Helper classes</h2>
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<div class="page-header"> <div class="page-header">
<h1>4. Basic HTML template</h1> <h1>4. Basic HTML template</h1>
</div> </div>
<p class="lead">With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the <a href="#file-structure">File structure</a>.</p> <p class="lead">With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the <a href="./getting-started.html#file-structure">File structure</a>.</p>
<p>Now, here's a look at a <strong>typical HTML file</strong>:</p> <p>Now, here's a look at a <strong>typical HTML file</strong>:</p>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;!DOCTYPE html&gt; &lt;!DOCTYPE html&gt;
...@@ -172,14 +172,14 @@ ...@@ -172,14 +172,14 @@
<div class="row bootstrap-examples"> <div class="row bootstrap-examples">
<div class="span4"> <div class="span4">
<a class="thumbnail" href="examples/starter-template.html"> <a class="thumbnail" href="examples/starter-template.html">
<img src="assets/img/examples/bootstrap-example-starter.jpg" alt=""> <img src="assets/img/examples/bootstrap-example-starter.png" alt="">
</a> </a>
<h4>Starter template</h4> <h4>Starter template</h4>
<p>A barebones HTML document with all the Bootstrap CSS and JavaScript included.</p> <p>A barebones HTML document with all the Bootstrap CSS and JavaScript included.</p>
</div> </div>
<div class="span4"> <div class="span4">
<a class="thumbnail" href="examples/hero.html"> <a class="thumbnail" href="examples/hero.html">
<img src="assets/img/examples/bootstrap-example-hero.jpg" alt=""> <img src="assets/img/examples/bootstrap-example-marketing.png" alt="">
</a> </a>
<h4>Basic marketing site</h4> <h4>Basic marketing site</h4>
<p>Featuring a hero unit for a primary message and three supporting elements.</p> <p>Featuring a hero unit for a primary message and three supporting elements.</p>
...@@ -191,6 +191,13 @@ ...@@ -191,6 +191,13 @@
<h4>Narrow marketing</h4> <h4>Narrow marketing</h4>
<p>Slim, lightweight marketing template for small projects or teams.</p> <p>Slim, lightweight marketing template for small projects or teams.</p>
</div> </div>
<div class="span4">
<a class="thumbnail" href="examples/justified-nav.html">
<img src="assets/img/examples/bootstrap-example-justified-nav.png" alt="">
</a>
<h4>{{_i}}Justified nav{{/i}}</h4>
<p>{{_i}}Marketing page with equal-width navigation links in a modified navbar.{{/i}}</p>
</div>
<div class="span4"> <div class="span4">
<a class="thumbnail" href="examples/signin.html"> <a class="thumbnail" href="examples/signin.html">
<img src="assets/img/examples/bootstrap-example-signin.png" alt=""> <img src="assets/img/examples/bootstrap-example-signin.png" alt="">
......
This diff is collapsed.
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
e = $.Event('slide', { e = $.Event('slide', {
relatedTarget: $next[0] relatedTarget: $next[0]
, direction: direction
}) })
if ($next.hasClass('active')) return if ($next.hasClass('active')) return
...@@ -187,11 +188,18 @@ ...@@ -187,11 +188,18 @@
/* CAROUSEL DATA-API /* CAROUSEL DATA-API
* ================= */ * ================= */
$(document).on('click.carousel.data-api', '[data-slide]', function (e) { $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = $.extend({}, $target.data(), $this.data()) , options = $.extend({}, $target.data(), $this.data())
, slideIndex
$target.carousel(options) $target.carousel(options)
if (slideIndex = $this.attr('data-slide-to')) {
$target.data('carousel').pause().to(slideIndex).cycle()
}
e.preventDefault() e.preventDefault()
}) })
......
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
, data = $this.data('collapse') , data = $this.data('collapse')
, options = typeof option == 'object' && option , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('collapse', (data = new Collapse(this, options))) if (!data) $this.data('collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]() if (typeof option == 'string') data[option]()
}) })
......
...@@ -81,7 +81,10 @@ ...@@ -81,7 +81,10 @@
isActive = $parent.hasClass('open') isActive = $parent.hasClass('open')
if (!isActive || (isActive && e.keyCode == 27)) return $this.click() if (!isActive || (isActive && e.keyCode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
}
$items = $('[role=menu] li:not(.divider):visible a', $parent) $items = $('[role=menu] li:not(.divider):visible a', $parent)
...@@ -154,7 +157,7 @@ ...@@ -154,7 +157,7 @@
$(document) $(document)
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown.data-api touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
placement: 'right' placement: 'right'
, trigger: 'click' , trigger: 'click'
, content: '' , content: ''
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>' , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
}) })
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
, $href = /^#\w/.test(href) && $(href) , $href = /^#\w/.test(href) && $(href)
return ( $href return ( $href
&& $href.length && $href.length
&& [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null && [[ $href.position().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] })
.each(function () { .each(function () {
......
...@@ -38,19 +38,27 @@ ...@@ -38,19 +38,27 @@
, init: function (type, element, options) { , init: function (type, element, options) {
var eventIn var eventIn
, eventOut , eventOut
, triggers
, trigger
, i
this.type = type this.type = type
this.$element = $(element) this.$element = $(element)
this.options = this.getOptions(options) this.options = this.getOptions(options)
this.enabled = true this.enabled = true
if (this.options.trigger == 'click') { triggers = this.options.trigger.split(' ')
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (this.options.trigger != 'manual') { for (i = triggers.length; i--;) {
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus' trigger = triggers[i]
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur' if (trigger == 'click') {
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } else if (trigger != 'manual') {
eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
} }
this.options.selector ? this.options.selector ?
...@@ -102,8 +110,11 @@ ...@@ -102,8 +110,11 @@
, actualHeight , actualHeight
, placement , placement
, tp , tp
, e = $.Event('show')
if (this.hasContent() && this.enabled) { if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip = this.tip() $tip = this.tip()
this.setContent() this.setContent()
...@@ -118,7 +129,8 @@ ...@@ -118,7 +129,8 @@
$tip $tip
.detach() .detach()
.css({ top: 0, left: 0, display: 'block' }) .css({ top: 0, left: 0, display: 'block' })
.insertAfter(this.$element)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
pos = this.getPosition() pos = this.getPosition()
...@@ -144,6 +156,8 @@ ...@@ -144,6 +156,8 @@
.offset(tp) .offset(tp)
.addClass(placement) .addClass(placement)
.addClass('in') .addClass('in')
this.$element.trigger('shown')
} }
} }
...@@ -158,6 +172,10 @@ ...@@ -158,6 +172,10 @@
, hide: function () { , hide: function () {
var that = this var that = this
, $tip = this.tip() , $tip = this.tip()
, e = $.Event('hide')
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip.removeClass('in') $tip.removeClass('in')
...@@ -176,6 +194,8 @@ ...@@ -176,6 +194,8 @@
removeWithAnimation() : removeWithAnimation() :
$tip.detach() $tip.detach()
this.$element.trigger('hidden')
return this return this
} }
...@@ -234,8 +254,8 @@ ...@@ -234,8 +254,8 @@
} }
, toggle: function (e) { , toggle: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type) var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
self[self.tip().hasClass('in') ? 'hide' : 'show']() self.tip().hasClass('in') ? self.hide() : self.show()
} }
, destroy: function () { , destroy: function () {
...@@ -267,10 +287,11 @@ ...@@ -267,10 +287,11 @@
, 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' , trigger: 'hover focus'
, title: '' , title: ''
, delay: 0 , delay: 0
, html: false , html: false
, container: false
} }
...@@ -282,4 +303,4 @@ ...@@ -282,4 +303,4 @@
return this return this
} }
}(window.jQuery); }(window.jQuery);
\ No newline at end of file
...@@ -271,6 +271,7 @@ ...@@ -271,6 +271,7 @@
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
this.select() this.select()
this.$element.focus()
} }
, mouseenter: function (e) { , mouseenter: function (e) {
......
...@@ -31,6 +31,18 @@ $(function () { ...@@ -31,6 +31,18 @@ $(function () {
.carousel('next') .carousel('next')
}) })
test("should fire slide event with direction", function () {
var template = '<div id="myCarousel" class="carousel slide"><div class="carousel-inner"><div class="item active"><img alt=""><div class="carousel-caption"><h4>{{_i}}First Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Second Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Third Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div></div><a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a><a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a></div>'
$.support.transition = false
stop()
$(template).on('slide', function (e) {
e.preventDefault()
ok(e.direction)
ok(e.direction === 'right' || e.direction === 'left')
start()
}).carousel('next')
})
test("should fire slide event with relatedTarget", function () { test("should fire slide event with relatedTarget", function () {
var template = '<div id="myCarousel" class="carousel slide"><div class="carousel-inner"><div class="item active"><img alt=""><div class="carousel-caption"><h4>{{_i}}First Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Second Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Third Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div></div><a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a><a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a></div>' var template = '<div id="myCarousel" class="carousel slide"><div class="carousel-inner"><div class="item active"><img alt=""><div class="carousel-caption"><h4>{{_i}}First Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Second Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Third Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div></div><a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a><a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a></div>'
$.support.transition = false $.support.transition = false
......
...@@ -66,6 +66,83 @@ $(function () { ...@@ -66,6 +66,83 @@ $(function () {
ok(!$(".tooltip").length, 'tooltip removed') ok(!$(".tooltip").length, 'tooltip removed')
}) })
test("should fire show event", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
.bind("show", function() {
ok(true, "show was called")
start()
})
.tooltip('show')
})
test("should fire shown event", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
.bind("shown", function() {
ok(true, "shown was called")
start()
})
.tooltip('show')
})
test("should not fire shown event when default prevented", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
.bind("show", function(e) {
e.preventDefault()
ok(true, "show was called")
start()
})
.bind("shown", function() {
ok(false, "shown was called")
})
.tooltip('show')
})
test("should fire hide event", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
.bind("shown", function() {
$(this).tooltip('hide')
})
.bind("hide", function() {
ok(true, "hide was called")
start()
})
.tooltip('show')
})
test("should fire hidden event", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
.bind("shown", function() {
$(this).tooltip('hide')
})
.bind("hidden", function() {
ok(true, "hidden was called")
start()
})
.tooltip('show')
})
test("should not fire hidden event when default prevented", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
.bind("shown", function() {
$(this).tooltip('hide')
})
.bind("hide", function(e) {
e.preventDefault()
ok(true, "hide was called")
start()
})
.bind("hidden", function() {
ok(false, "hidden was called")
})
.tooltip('show')
})
test("should not show tooltip if leave event occurs before delay expires", function () { test("should not show tooltip if leave event occurs before delay expires", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>') var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
...@@ -156,4 +233,22 @@ $(function () { ...@@ -156,4 +233,22 @@ $(function () {
div.find('a').trigger('click') div.find('a').trigger('click')
ok($(".tooltip").is('.fade.in'), 'tooltip is faded in') ok($(".tooltip").is('.fade.in'), 'tooltip is faded in')
}) })
})
\ No newline at end of file test("should show tooltip when toggle is called", function () {
var tooltip = $('<a href="#" rel="tooltip" title="tooltip on toggle"></a>')
.appendTo('#qunit-fixture')
.tooltip({trigger: 'manual'})
.tooltip('toggle')
ok($(".tooltip").is('.fade.in'), 'tooltip should be toggled in')
})
test("should place tooltips inside the body", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
.appendTo('#qunit-fixture')
.tooltip({container:'body'})
.tooltip('show')
ok($("body > .tooltip").length, 'inside the body')
ok(!$("#qunit-fixture > .tooltip").length, 'not found in parent')
tooltip.tooltip('hide')
})
})
...@@ -192,17 +192,22 @@ $(function () { ...@@ -192,17 +192,22 @@ $(function () {
}).appendTo('body') }).appendTo('body')
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
, changed = false , changed = false
, focus = false
, blur = false
$input.val('a') $input.val('a')
typeahead.lookup() typeahead.lookup()
$input.change(function() { changed = true }); $input.change(function() { changed = true });
$input.focus(function() { focus = true; blur = false });
$input.blur(function() { blur = true; focus = false });
$(typeahead.$menu.find('li')[2]).mouseover().click() $(typeahead.$menu.find('li')[2]).mouseover().click()
equals($input.val(), 'ac', 'input value was correctly set') equals($input.val(), 'ac', 'input value was correctly set')
ok(!typeahead.$menu.is(':visible'), 'the menu was hidden') ok(!typeahead.$menu.is(':visible'), 'the menu was hidden')
ok(changed, 'a change event was fired') ok(changed, 'a change event was fired')
ok(focus && !blur, 'focus is still set')
$input.remove() $input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
......
...@@ -125,7 +125,6 @@ input[type="button"] { ...@@ -125,7 +125,6 @@ input[type="button"] {
border-color: darken(@btn-border, 10%); border-color: darken(@btn-border, 10%);
} }
} }
// Primary appears as blue
.btn-primary { .btn-primary {
background-color: @btn-background-primary; background-color: @btn-background-primary;
border-color: @btn-border-primary; border-color: @btn-border-primary;
......
...@@ -182,6 +182,12 @@ ...@@ -182,6 +182,12 @@
-o-transition-delay: @transition-delay; -o-transition-delay: @transition-delay;
transition-delay: @transition-delay; transition-delay: @transition-delay;
} }
.transition-duration(@transition-duration) {
-webkit-transition-duration: @transition-duration;
-moz-transition-duration: @transition-duration;
-o-transition-duration: @transition-duration;
transition-duration: @transition-duration;
}
// Transformations // Transformations
.rotate(@degrees) { .rotate(@degrees) {
......
...@@ -299,8 +299,8 @@ ...@@ -299,8 +299,8 @@
// Caret should match text color on hover // Caret should match text color on hover
.navbar .nav li.dropdown > a:hover .caret { .navbar .nav li.dropdown > a:hover .caret {
border-top-color: @navbar-link-color-active; border-top-color: @navbar-link-color-hover;
border-bottom-color: @navbar-link-color-active; border-bottom-color: @navbar-link-color-hover;
} }
// Remove background color from open dropdown // Remove background color from open dropdown
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
left: 0; left: 0;
z-index: @zindex-popover; z-index: @zindex-popover;
display: none; display: none;
width: 236px; max-width: 276px;
padding: 1px; padding: 1px;
text-align: left; // Reset given new insertion method text-align: left; // Reset given new insertion method
background-color: @popover-background; background-color: @popover-background;
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
background-color: @popover-title-background; background-color: @popover-title-background;
border-bottom: 1px solid darken(@popover-title-background, 5%); border-bottom: 1px solid darken(@popover-title-background, 5%);
border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0;
&:empty {
display: none;
}
} }
.popover-content { .popover-content {
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
margin-left: 0; margin-left: 0;
} }
// FORM FIELDS // FORM FIELDS
// ----------- // -----------
// Make span* classes full width // Make span* classes full width
......
...@@ -92,24 +92,32 @@ table { ...@@ -92,24 +92,32 @@ table {
tbody:first-child tr:first-child td { tbody:first-child tr:first-child td {
border-top: 0; border-top: 0;
} }
// For first th or td in the first row in the first thead or tbody // For first th/td in the first row in the first thead or tbody
thead:first-child tr:first-child > th:first-child, thead:first-child tr:first-child > th:first-child,
tbody:first-child tr:first-child > td:first-child { tbody:first-child tr:first-child > td:first-child,
tbody:first-child tr:first-child > th:first-child {
border-top-left-radius: @border-radius-base; border-top-left-radius: @border-radius-base;
} }
// For last th/td in the first row in the first thead or tbody
thead:first-child tr:first-child > th:last-child, thead:first-child tr:first-child > th:last-child,
tbody:first-child tr:first-child > td:last-child { tbody:first-child tr:first-child > td:last-child,
tbody:first-child tr:first-child > th:last-child {
border-top-right-radius: @border-radius-base; border-top-right-radius: @border-radius-base;
} }
// For first th or td in the last row in the last thead or tbody // For first th/td (can be either) in the last row in the last thead, tbody, and tfoot
thead:last-child tr:last-child > th:first-child, thead:last-child tr:last-child > th:first-child,
tbody:last-child tr:last-child > td:first-child, tbody:last-child tr:last-child > td:first-child,
tfoot:last-child tr:last-child > td:first-child { tbody:last-child tr:last-child > th:first-child,
tfoot:last-child tr:last-child > td:first-child,
tfoot:last-child tr:last-child > th:first-child {
border-bottom-left-radius: @border-radius-base; border-bottom-left-radius: @border-radius-base;
} }
// For last th/td (can be either) in the last row in the last thead, tbody, and tfoot
thead:last-child tr:last-child > th:last-child, thead:last-child tr:last-child > th:last-child,
tbody:last-child tr:last-child > td:last-child, tbody:last-child tr:last-child > td:last-child,
tfoot:last-child tr:last-child > td:last-child { tbody:last-child tr:last-child > th:last-child,
tfoot:last-child tr:last-child > td:last-child,
tfoot:last-child tr:last-child > th:last-child {
border-bottom-right-radius: @border-radius-base; border-bottom-right-radius: @border-radius-base;
} }
...@@ -159,8 +167,8 @@ table { ...@@ -159,8 +167,8 @@ table {
// Placed here since it has to come after the potential zebra striping // Placed here since it has to come after the potential zebra striping
.table-hover { .table-hover {
tbody { tbody {
tr:hover td, tr:hover > td,
tr:hover th { tr:hover > th {
background-color: @table-background-hover; background-color: @table-background-hover;
} }
} }
...@@ -184,32 +192,32 @@ table th[class*="span"] { ...@@ -184,32 +192,32 @@ table th[class*="span"] {
// Exact selectors below required to override .table-striped // Exact selectors below required to override .table-striped
.table tbody tr { .table tbody tr {
&.success td { &.success > td {
background-color: @state-success-background; background-color: @state-success-background;
} }
&.error td { &.error > td {
background-color: @state-error-background; background-color: @state-error-background;
} }
&.warning td { &.warning > td {
background-color: @state-warning-background; background-color: @state-warning-background;
} }
&.info td { &.info > td {
background-color: @state-info-background; background-color: @state-info-background;
} }
} }
// Hover states for .table-hover // Hover states for .table-hover
.table-hover tbody tr { .table-hover tbody tr {
&.success:hover td { &.success:hover > td {
background-color: darken(@state-success-background, 5%); background-color: darken(@state-success-background, 5%);
} }
&.error:hover td { &.error:hover > td {
background-color: darken(@state-error-background, 5%); background-color: darken(@state-error-background, 5%);
} }
&.warning:hover td { &.warning:hover > td {
background-color: darken(@state-warning-background, 5%); background-color: darken(@state-warning-background, 5%);
} }
&.info:hover td { &.info:hover > td {
background-color: darken(@state-info-background, 5%); background-color: darken(@state-info-background, 5%);
} }
} }
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
visibility: visible; visibility: visible;
padding: 5px; padding: 5px;
font-size: 11px; font-size: 11px;
line-height: 1.4;
.opacity(0); .opacity(0);
&.in { .opacity(100); } &.in { .opacity(100); }
&.top { margin-top: -3px; } &.top { margin-top: -3px; }
......
...@@ -181,7 +181,9 @@ blockquote { ...@@ -181,7 +181,9 @@ blockquote {
border-left: 5px solid @grayLighter; border-left: 5px solid @grayLighter;
p { p {
margin-bottom: 0; margin-bottom: 0;
#font > .shorthand(16px,300,@line-height-base * 1.25); font-size: @font-size-base * 1.25;
font-weight: 300;
line-height: 1.25;
} }
small { small {
display: block; display: block;
......
Markdown is supported
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