Skip to content

Commit

Permalink
update to Twitter Bootstrap 2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
WaYdotNET committed Apr 27, 2012
1 parent ef52c11 commit b98a5d2
Show file tree
Hide file tree
Showing 44 changed files with 1,218 additions and 906 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,5 +1,5 @@
/* ==========================================================
* bootstrap-alert.js v2.0.2
* bootstrap-alert.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2012 Twitter, Inc.
Expand All @@ -18,61 +18,57 @@
* ========================================================== */


!function( $ ){
!function ($) {

"use strict"; // jshint ;_;

"use strict"

/* ALERT CLASS DEFINITION
* ====================== */

var dismiss = '[data-dismiss="alert"]'
, Alert = function ( el ) {
, Alert = function (el) {
$(el).on('click', dismiss, this.close)
}

Alert.prototype = {

constructor: Alert
Alert.prototype.close = function (e) {
var $this = $(this)
, selector = $this.attr('data-target')
, $parent

, close: function ( e ) {
var $this = $(this)
, selector = $this.attr('data-target')
, $parent
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}

if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
$parent = $(selector)

$parent = $(selector)
$parent.trigger('close')
e && e.preventDefault()

e && e.preventDefault()
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())

$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
$parent.trigger(e = $.Event('close'))

$parent
.trigger('close')
.removeClass('in')
if (e.isDefaultPrevented()) return

function removeElement() {
$parent
.trigger('closed')
.remove()
}
$parent.removeClass('in')

$.support.transition && $parent.hasClass('fade') ?
$parent.on($.support.transition.end, removeElement) :
removeElement()
function removeElement() {
$parent
.trigger('closed')
.remove()
}

$.support.transition && $parent.hasClass('fade') ?
$parent.on($.support.transition.end, removeElement) :
removeElement()
}


/* ALERT PLUGIN DEFINITION
* ======================= */

$.fn.alert = function ( option ) {
$.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('alert')
Expand All @@ -91,4 +87,4 @@
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
})

}( window.jQuery );
}(window.jQuery);
@@ -1,5 +1,5 @@
/* ============================================================
* bootstrap-button.js v2.0.2
* bootstrap-button.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2012 Twitter, Inc.
Expand All @@ -17,58 +17,54 @@
* limitations under the License.
* ============================================================ */

!function( $ ){

"use strict"
!function ($) {

"use strict"; // jshint ;_;


/* BUTTON PUBLIC CLASS DEFINITION
* ============================== */

var Button = function ( element, options ) {
var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, $.fn.button.defaults, options)
}

Button.prototype = {

constructor: Button
Button.prototype.setState = function (state) {
var d = 'disabled'
, $el = this.$element
, data = $el.data()
, val = $el.is('input') ? 'val' : 'html'

, setState: function ( state ) {
var d = 'disabled'
, $el = this.$element
, data = $el.data()
, val = $el.is('input') ? 'val' : 'html'
state = state + 'Text'
data.resetText || $el.data('resetText', $el[val]())

state = state + 'Text'
data.resetText || $el.data('resetText', $el[val]())
$el[val](data[state] || this.options[state])

$el[val](data[state] || this.options[state])

// push to event loop to allow forms to submit
setTimeout(function () {
state == 'loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}, 0)
}

, toggle: function () {
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
// push to event loop to allow forms to submit
setTimeout(function () {
state == 'loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}, 0)
}

$parent && $parent
.find('.active')
.removeClass('active')
Button.prototype.toggle = function () {
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')

this.$element.toggleClass('active')
}
$parent && $parent
.find('.active')
.removeClass('active')

this.$element.toggleClass('active')
}


/* BUTTON PLUGIN DEFINITION
* ======================== */

$.fn.button = function ( option ) {
$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('button')
Expand Down Expand Up @@ -97,4 +93,4 @@
})
})

}( window.jQuery );
}(window.jQuery);
@@ -1,5 +1,5 @@
/* ==========================================================
* bootstrap-carousel.js v2.0.2
* bootstrap-carousel.js v2.0.3
* http://twitter.github.com/bootstrap/javascript.html#carousel
* ==========================================================
* Copyright 2012 Twitter, Inc.
Expand All @@ -18,16 +18,17 @@
* ========================================================== */


!function( $ ){
!function ($) {

"use strict"; // jshint ;_;

"use strict"

/* CAROUSEL CLASS DEFINITION
* ========================= */

var Carousel = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, $.fn.carousel.defaults, options)
this.options = options
this.options.slide && this.slide(this.options.slide)
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
Expand All @@ -36,8 +37,11 @@

Carousel.prototype = {

cycle: function () {
this.interval = setInterval($.proxy(this.next, this), this.options.interval)
cycle: function (e) {
if (!e) this.paused = false
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}

Expand All @@ -62,7 +66,8 @@
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
}

, pause: function () {
, pause: function (e) {
if (!e) this.paused = true
clearInterval(this.interval)
this.interval = null
return this
Expand All @@ -85,6 +90,7 @@
, direction = type == 'next' ? 'left' : 'right'
, fallback = type == 'next' ? 'first' : 'last'
, that = this
, e = $.Event('slide')

this.sliding = true

Expand All @@ -94,24 +100,26 @@

if ($next.hasClass('active')) return

if (!$.support.transition && this.$element.hasClass('slide')) {
this.$element.trigger('slide')
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid')
} else {
if ($.support.transition && this.$element.hasClass('slide')) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$next.addClass(direction)
this.$element.trigger('slide')
this.$element.one($.support.transition.end, function () {
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () { that.$element.trigger('slid') }, 0)
})
} else {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid')
}

isCycling && this.cycle()
Expand All @@ -125,15 +133,15 @@
/* CAROUSEL PLUGIN DEFINITION
* ========================== */

$.fn.carousel = function ( option ) {
$.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('carousel')
, options = typeof option == 'object' && option
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (typeof option == 'string' || (option = options.slide)) data[option]()
else data.cycle()
else if (options.interval) data.cycle()
})
}

Expand All @@ -158,4 +166,4 @@
})
})

}( window.jQuery );
}(window.jQuery);

0 comments on commit b98a5d2

Please sign in to comment.