Skip to content

Commit

Permalink
bump to bootstrap 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
WattsInABox committed Feb 19, 2014
1 parent a67a5eb commit 1858647
Show file tree
Hide file tree
Showing 45 changed files with 4,041 additions and 6,334 deletions.
57 changes: 34 additions & 23 deletions app/assets/javascripts/twitter/bootstrap/affix.js
@@ -1,24 +1,14 @@
/* ========================================================================
* Bootstrap: affix.js v3.0.3
* Bootstrap: affix.js v3.1.1
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */


+function ($) { "use strict";
+function ($) {
'use strict';

// AFFIX CLASS DEFINITION
// ======================
Expand All @@ -29,9 +19,10 @@
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))

this.$element = $(element)
this.affixed =
this.unpin = null
this.$element = $(element)
this.affixed =
this.unpin =
this.pinnedOffset = null

this.checkPosition()
}
Expand All @@ -42,6 +33,14 @@
offset: 0
}

Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop = this.$window.scrollTop()
var position = this.$element.offset()
return (this.pinnedOffset = position.top - scrollTop)
}

Affix.prototype.checkPositionWithEventLoop = function () {
setTimeout($.proxy(this.checkPosition, this), 1)
}
Expand All @@ -56,9 +55,11 @@
var offsetTop = offset.top
var offsetBottom = offset.bottom

if (this.affixed == 'top') position.top += scrollTop

if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top()
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)

var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
Expand All @@ -67,13 +68,23 @@
if (this.affixed === affix) return
if (this.unpin) this.$element.css('top', '')

var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')

this.$element.trigger(e)

if (e.isDefaultPrevented()) return

this.affixed = affix
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null

this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger($.Event(affixType.replace('affix', 'affixed')))

if (affix == 'bottom') {
this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
}
}

Expand Down
20 changes: 5 additions & 15 deletions app/assets/javascripts/twitter/bootstrap/alert.js
@@ -1,24 +1,14 @@
/* ========================================================================
* Bootstrap: alert.js v3.0.3
* Bootstrap: alert.js v3.1.1
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */


+function ($) { "use strict";
+function ($) {
'use strict';

// ALERT CLASS DEFINITION
// ======================
Expand Down
50 changes: 21 additions & 29 deletions app/assets/javascripts/twitter/bootstrap/button.js
@@ -1,31 +1,22 @@
/* ========================================================================
* Bootstrap: button.js v3.0.3
* Bootstrap: button.js v3.1.1
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */


+function ($) { "use strict";
+function ($) {
'use strict';

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

var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Button.DEFAULTS, options)
this.$element = $(element)
this.options = $.extend({}, Button.DEFAULTS, options)
this.isLoading = false
}

Button.DEFAULTS = {
Expand All @@ -45,25 +36,26 @@
$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)
setTimeout($.proxy(function () {
if (state == 'loadingText') {
this.isLoading = true
$el.addClass(d).attr(d, d)
} else if (this.isLoading) {
this.isLoading = false
$el.removeClass(d).removeAttr(d)
}
}, this), 0)
}

Button.prototype.toggle = function () {
var $parent = this.$element.closest('[data-toggle="buttons"]')
var changed = true
var $parent = this.$element.closest('[data-toggle="buttons"]')

if ($parent.length) {
var $input = this.$element.find('input')
if ($input.prop('type') === 'radio') {
// see if clicking on current one
if ($input.prop('checked') && this.$element.hasClass('active'))
changed = false
else
$parent.find('.active').removeClass('active')
if ($input.prop('type') == 'radio') {
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
else $parent.find('.active').removeClass('active')
}
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
}
Expand Down
44 changes: 16 additions & 28 deletions app/assets/javascripts/twitter/bootstrap/carousel.js
@@ -1,24 +1,14 @@
/* ========================================================================
* Bootstrap: carousel.js v3.0.3
* Bootstrap: carousel.js v3.1.1
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */


+function ($) { "use strict";
+function ($) {
'use strict';

// CAROUSEL CLASS DEFINITION
// =========================
Expand All @@ -39,9 +29,9 @@
}

Carousel.DEFAULTS = {
interval: 5000
, pause: 'hover'
, wrap: true
interval: 5000,
pause: 'hover',
wrap: true
}

Carousel.prototype.cycle = function (e) {
Expand Down Expand Up @@ -78,7 +68,7 @@
Carousel.prototype.pause = function (e) {
e || (this.paused = true)

if (this.$element.find('.next, .prev').length && $.support.transition.end) {
if (this.$element.find('.next, .prev').length && $.support.transition) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
Expand Down Expand Up @@ -111,13 +101,15 @@
$next = this.$element.find('.item')[fallback]()
}

this.sliding = true

isCycling && this.pause()
if ($next.hasClass('active')) return this.sliding = false

var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
this.$element.trigger(e)
if (e.isDefaultPrevented()) return

if ($next.hasClass('active')) return
this.sliding = true

isCycling && this.pause()

if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
Expand All @@ -128,8 +120,6 @@
}

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)
Expand All @@ -141,10 +131,8 @@
that.sliding = false
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
})
.emulateTransitionEnd(600)
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
} else {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
Expand Down
23 changes: 7 additions & 16 deletions app/assets/javascripts/twitter/bootstrap/collapse.js
@@ -1,24 +1,14 @@
/* ========================================================================
* Bootstrap: collapse.js v3.0.3
* Bootstrap: collapse.js v3.1.1
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */


+function ($) { "use strict";
+function ($) {
'use strict';

// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
Expand Down Expand Up @@ -69,7 +59,7 @@
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('in')
.addClass('collapse in')
[dimension]('auto')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
Expand Down Expand Up @@ -137,6 +127,7 @@
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)

if (!data && options.toggle && option == 'show') option = !option
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
Expand Down

0 comments on commit 1858647

Please sign in to comment.