Commit bc65b585 authored by Jacob Thornton's avatar Jacob Thornton

merge in js from 1.4... start working through js docs

parent 0b1d5d91
VERSION=1.2.0
VERSION=2.0.0
DATE=$(shell DATE)
BOOTSTRAP = ./bootstrap.css
BOOTSTRAP_MIN = ./bootstrap.min.css
......
/*!
* Bootstrap v1.2.0
* Bootstrap v2.0.0
*
* Copyright 2011 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: Sun Nov 20 18:13:58 PST 2011
* Date: Sun Nov 20 20:05:48 PST 2011
*/
/* Reset.less
* Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc).
......@@ -2269,11 +2269,11 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner {
visibility: visible;
padding: 5px;
font-size: 11px;
filter: alpha(opacity=80);
-moz-opacity: 0.8;
opacity: 0.8;
filter: alpha(opacity=0);
-moz-opacity: 0;
opacity: 0;
}
.twipsy.fade.in {
.twipsy.in {
filter: alpha(opacity=80);
-moz-opacity: 0.8;
opacity: 0.8;
......
......@@ -329,7 +329,7 @@ button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0;
.modal-footer{padding:14px 15px 15px;margin-bottom:0;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;zoom:1;}.modal-footer:before,.modal-footer:after{display:table;*display:inline;content:"";zoom:1;}
.modal-footer:after{clear:both;}
.modal-footer .btn{float:right;margin-left:5px;}
.twipsy{position:absolute;z-index:1000;display:block;visibility:visible;padding:5px;font-size:11px;filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;}.twipsy.fade.in{filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;}
.twipsy{position:absolute;z-index:1000;display:block;visibility:visible;padding:5px;font-size:11px;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;}.twipsy.in{filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;}
.twipsy.above .twipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
.twipsy.left .twipsy-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;}
.twipsy.below .twipsy-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;}
......
......@@ -304,6 +304,13 @@ body > .navbar-fixed .brand:hover {
margin-left: 10px;
}
/* scrollspy docs */
.scrollspy-example {
overflow: auto;
height: 200px;
position: relative;
}
/* Popover docs
-------------------------------------------------- */
......
......@@ -37,7 +37,7 @@
<li><a href="./scaffolding.html">Scaffolding</a></li>
<li class="active"><a href="./base-css.html">Base CSS</a></li>
<li><a href="./components.html">Components</a></li>
<li><a href="./javascript.html">Javascript</a></li>
<li><a href="./javascript.html">Javascript plugins</a></li>
<li><a href="./less.html">Using LESS</a></li>
</ul>
</div>
......
This diff is collapsed.
/* ==========================================================
* bootstrap-alerts.js v1.4.0
* bootstrap-alerts.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2011 Twitter, Inc.
......@@ -22,34 +22,6 @@
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var transitionEnd
$(document).ready(function () {
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
})
/* ALERT CLASS DEFINITION
* ====================== */
......@@ -76,7 +48,7 @@
}
$.support.transition && $element.hasClass('fade') ?
$element.bind(transitionEnd, removeElement) :
$element.bind($.support.transition.end, removeElement) :
removeElement()
}
......@@ -88,10 +60,6 @@
$.fn.alert = function ( options ) {
if ( options === true ) {
return this.data('alert')
}
return this.each(function () {
var $this = $(this)
, data
......@@ -112,13 +80,11 @@
}
$.fn.alert.defaults = {
selector: '.close'
selector: '[data-dismiss="alert"]'
}
$(document).ready(function () {
new Alert($('body'), {
selector: '.alert-message[data-alert] .close'
})
$(function () {
new Alert( $('body') )
})
}( window.jQuery || window.ender );
\ No newline at end of file
/* ============================================================
* bootstrap-dropdown.js v1.4.0
* bootstrap-dropdown.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#dropdown
* ============================================================
* Copyright 2011 Twitter, Inc.
......@@ -22,34 +22,45 @@
"use strict"
/* SIMPLE DROPDOWN LOGIC
* ===================== */
var s = '[data-toggle="dropdown"]'
function clearMenus() {
$(s).parent('li').removeClass('open')
}
function toggle(e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
}
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
})
var args = ['click', toggle]
, $this = $(this)
selector && args.unshift(selector)
$this[selector ? 'delegate' : 'bind'].apply($this, args)
})
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
var d = 'a.menu, .dropdown-toggle'
function clearMenus() {
$(d).parent('li').removeClass('open')
}
$(function () {
$('html').bind("click", clearMenus)
$('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
$('body').dropdown(s)
})
}( window.jQuery || window.ender );
\ No newline at end of file
......@@ -22,35 +22,6 @@
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var transitionEnd
$(document).ready(function () {
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
})
/* MODAL PUBLIC CLASS DEFINITION
* ============================= */
......@@ -92,7 +63,7 @@
that.$element.addClass('in')
transition ?
that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
that.$element.trigger('shown')
})
......@@ -130,14 +101,13 @@
* ===================== */
function hideWithTransition() {
// firefox drops transitionEnd events :{o
var that = this
, timeout = setTimeout(function () {
that.$element.unbind(transitionEnd)
that.$element.unbind($.support.transition.end)
hideModal.call(that)
}, 500)
this.$element.one(transitionEnd, function () {
this.$element.one($.support.transition.end, function () {
clearTimeout(timeout)
hideModal.call(that)
})
......@@ -171,14 +141,14 @@
this.$backdrop.addClass('in')
doAnimate ?
this.$backdrop.one(transitionEnd, callback) :
this.$backdrop.one($.support.transition.end, callback) :
callback()
} else if ( !this.isShown && this.$backdrop ) {
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')?
this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) :
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
removeBackdrop.call(this)
} else if ( callback ) {
......@@ -240,9 +210,9 @@
$.fn.modal.Modal = Modal
$.fn.modal.defaults = {
backdrop: false
, keyboard: false
, show: false
backdrop: true
, keyboard: true
, show: true
}
......@@ -252,7 +222,7 @@
$(document).ready(function () {
$('body').delegate('[data-controls-modal]', 'click', function (e) {
e.preventDefault()
var $this = $(this).data('show', true)
var $this = $(this)
$('#' + $this.attr('data-controls-modal')).modal( $this.data() )
})
})
......
/* ===========================================================
* bootstrap-popover.js v1.4.0
* bootstrap-popover.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#popover
* ===========================================================
* Copyright 2011 Twitter, Inc.
......@@ -36,8 +36,8 @@
setContent: function () {
var $tip = this.tip()
$tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
$tip.find('.content > *')[this.options.html ? 'html' : 'text'](this.getContent())
$tip.find('.title')['html'](this.getTitle())
$tip.find('.content > *')['html'](this.getContent())
$tip[0].className = 'popover'
}
......
......@@ -20,33 +20,34 @@
!function ( $ ) {
var $window = $(window)
function ScrollSpy() {
var process = $.proxy(this.process, this)
this.$topbar = $('body')
this.selector = '[data-scrollspy] li > a'
this.selector = '.nav li > a'
this.$body = $('body').delegate(this.selector, 'click', process)
this.$scrollElement = $('[data-spy="scroll"]').bind('scroll', process)
this.refresh()
this.$topbar.delegate(this.selector, 'click', process)
$window.scroll(process)
this.process()
}
ScrollSpy.prototype = {
refresh: function () {
this.targets = this.$topbar.find(this.selector).map(function () {
var href = $(this).attr('href')
return /^#\w/.test(href) && $(href).length ? href : null
})
this.targets = this.$body
.find(this.selector)
.map(function () {
var href = $(this).attr('href')
return /^#\w/.test(href) && $(href).length ? href : null
})
this.offsets = $.map(this.targets, function (id) {
return $(id).offset().top
return $(id).position().top
})
}
, process: function () {
var scrollTop = $window.scrollTop() + 10
var scrollTop = this.$scrollElement.scrollTop() + 10
, offsets = this.offsets
, targets = this.targets
, activeTarget = this.activeTarget
......@@ -65,11 +66,11 @@
this.activeTarget = target
this.$topbar
this.$body
.find(this.selector).parent('.active')
.removeClass('active')
active = this.$topbar
active = this.$body
.find(this.selector + '[href="' + target + '"]')
.parent('li')
.addClass('active')
......@@ -82,8 +83,6 @@
}
$(function () {
new ScrollSpy()
})
$(function () { new ScrollSpy() })
}( window.jQuery || window.ender )
\ No newline at end of file
/* ========================================================
* bootstrap-tabs.js v1.4.0
* bootstrap-tabs.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2011 Twitter, Inc.
......
......@@ -38,7 +38,7 @@ $(function () {
transitionEnd = "oTransitionEnd"
}
return transitionEnd
})()
}())
}
})()
......
/* ==========================================================
* bootstrap-twipsy.js v1.4.0
* bootstrap-twipsy.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#twipsy
* Adapted from the original jQuery.tipsy by Jason Frame
* ==========================================================
......@@ -18,40 +18,10 @@
* limitations under the License.
* ========================================================== */
!function( $ ) {
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var transitionEnd
$(document).ready(function () {
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
})
/* TWIPSY PUBLIC CLASS DEFINITION
* ============================== */
......@@ -119,7 +89,7 @@
, setContent: function () {
var $tip = this.tip()
$tip.find('.twipsy-inner')[this.options.html ? 'html' : 'text'](this.getTitle())
$tip.find('.twipsy-inner').html(this.getTitle())
$tip[0].className = 'twipsy'
}
......@@ -134,7 +104,7 @@
}
$.support.transition && this.$tip.hasClass('fade') ?
$tip.bind(transitionEnd, removeElement) :
$tip.bind( $.support.transition.end, removeElement) :
removeElement()
}
......@@ -164,7 +134,7 @@
title = ('' + title).replace(/(^\s*|\s*$)/, "")
return title || o.fallback
return title
}
, tip: function() {
......@@ -219,18 +189,21 @@
, eventIn
, eventOut
if (options === true) {
return this.data(name)
} else if (typeof options == 'string') {
if (typeof options == 'string') {
twipsy = this.data(name)
if (twipsy) {
twipsy[options]()
}
if (twipsy) twipsy[options]()
return this
}
options = $.extend({}, $.fn[name].defaults, options)
if (options.delay && typeof options.delay == 'number') {
options.delay = {
show: options.delay
, hide: options.delay
}
}
function get(ele) {
var twipsy = $.data(ele, name)
......@@ -246,7 +219,7 @@
var twipsy = get(this)
twipsy.hoverState = 'in'
if (options.delayIn == 0) {
if (!options.delay || !options.delay.show) {
twipsy.show()
} else {
twipsy.fixTitle()
......@@ -254,21 +227,21 @@
if (twipsy.hoverState == 'in') {
twipsy.show()
}
}, options.delayIn)
}, options.delay.show)
}
}
function leave() {
var twipsy = get(this)
twipsy.hoverState = 'out'
if (options.delayOut == 0) {
if (!options.delay || !options.delay.hide) {
twipsy.hide()
} else {
setTimeout(function() {
if (twipsy.hoverState == 'out') {
twipsy.hide()
}
}, options.delayOut)
}, options.delay.hide)
}
}
......@@ -292,15 +265,12 @@
$.fn.twipsy.defaults = {
animate: true
, delayIn: 0
, delayOut: 0
, fallback: ''
, delay: 0
, placement: 'above'
, html: false
, live: false
, offset: 0
, title: 'title'
, trigger: 'hover'
, title: 'title'
, template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
}
......
......@@ -8,8 +8,8 @@
visibility: visible;
padding: 5px;
font-size: 11px;
.opacity(80);
&.fade.in {
.opacity(0);
&.in {
.opacity(80);
}
&.above .twipsy-arrow { #popoverArrow > .above(); }
......
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