Skip to content

Commit

Permalink
updated bootstrapped to twitter bootstrap 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Watson committed Aug 31, 2012
1 parent b9c7c80 commit 1ecb672
Show file tree
Hide file tree
Showing 60 changed files with 4,019 additions and 1,994 deletions.
Binary file modified vendor/assets/images/glyphicons-halflings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions vendor/assets/javascripts/bootstrap-affix.js
@@ -0,0 +1,104 @@
/* ==========================================================
* bootstrap-affix.js v2.1.0
* http://twitter.github.com/bootstrap/javascript.html#affix
* ==========================================================
* Copyright 2012 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.
* ========================================================== */


!function ($) {

"use strict"; // jshint ;_;


/* AFFIX CLASS DEFINITION
* ====================== */

var Affix = function (element, options) {
this.options = $.extend({}, $.fn.affix.defaults, options)
this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
this.$element = $(element)
this.checkPosition()
}

Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return

var scrollHeight = $(document).height()
, scrollTop = this.$window.scrollTop()
, position = this.$element.offset()
, offset = this.options.offset
, offsetBottom = offset.bottom
, offsetTop = offset.top
, reset = 'affix affix-top affix-bottom'
, affix

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

affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
'top' : false

if (this.affixed === affix) return

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

this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
}


/* AFFIX PLUGIN DEFINITION
* ======================= */

$.fn.affix = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('affix')
, options = typeof option == 'object' && option
if (!data) $this.data('affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
}

$.fn.affix.Constructor = Affix

$.fn.affix.defaults = {
offset: 0
}


/* AFFIX DATA-API
* ============== */

$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
, data = $spy.data()

data.offset = data.offset || {}

data.offsetBottom && (data.offset.bottom = data.offsetBottom)
data.offsetTop && (data.offset.top = data.offsetTop)

$spy.affix(data)
})
})


}(window.jQuery);
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap-alert.js
@@ -1,5 +1,5 @@
/* ==========================================================
* bootstrap-alert.js v2.0.4
* bootstrap-alert.js v2.1.0
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap-button.js
@@ -1,5 +1,5 @@
/* ============================================================
* bootstrap-button.js v2.0.4
* bootstrap-button.js v2.1.0
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2012 Twitter, Inc.
Expand Down
17 changes: 12 additions & 5 deletions vendor/assets/javascripts/bootstrap-carousel.js
@@ -1,5 +1,5 @@
/* ==========================================================
* bootstrap-carousel.js v2.0.4
* bootstrap-carousel.js v2.1.0
* http://twitter.github.com/bootstrap/javascript.html#carousel
* ==========================================================
* Copyright 2012 Twitter, Inc.
Expand Down Expand Up @@ -46,7 +46,7 @@
}

, to: function (pos) {
var $active = this.$element.find('.active')
var $active = this.$element.find('.item.active')
, children = $active.parent().children()
, activePos = children.index($active)
, that = this
Expand All @@ -68,6 +68,10 @@

, pause: function (e) {
if (!e) this.paused = true
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
this.$element.trigger($.support.transition.end)
this.cycle()
}
clearInterval(this.interval)
this.interval = null
return this
Expand All @@ -84,13 +88,15 @@
}

, slide: function (type, next) {
var $active = this.$element.find('.active')
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'
, fallback = type == 'next' ? 'first' : 'last'
, that = this
, e = $.Event('slide')
, e = $.Event('slide', {
relatedTarget: $next[0]
})

this.sliding = true

Expand Down Expand Up @@ -138,9 +144,10 @@
var $this = $(this)
, data = $this.data('carousel')
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
, action = typeof option == 'string' ? option : options.slide
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 if (action) data[action]()
else if (options.interval) data.cycle()
})
}
Expand Down
7 changes: 4 additions & 3 deletions vendor/assets/javascripts/bootstrap-collapse.js
@@ -1,5 +1,5 @@
/* =============================================================
* bootstrap-collapse.js v2.0.4
* bootstrap-collapse.js v2.1.0
* http://twitter.github.com/bootstrap/javascript.html#collapse
* =============================================================
* Copyright 2012 Twitter, Inc.
Expand Down Expand Up @@ -67,7 +67,7 @@

this.$element[dimension](0)
this.transition('addClass', $.Event('show'), 'shown')
this.$element[dimension](this.$element[0][scroll])
$.support.transition && this.$element[dimension](this.$element[0][scroll])
}

, hide: function () {
Expand Down Expand Up @@ -144,12 +144,13 @@
* ==================== */

$(function () {
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href
, target = $this.attr('data-target')
|| e.preventDefault()
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
, option = $(target).data('collapse') ? 'toggle' : $this.data()
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
$(target).collapse(option)
})
})
Expand Down
82 changes: 66 additions & 16 deletions vendor/assets/javascripts/bootstrap-dropdown.js
@@ -1,5 +1,5 @@
/* ============================================================
* bootstrap-dropdown.js v2.0.4
* bootstrap-dropdown.js v2.1.0
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
* ============================================================
* Copyright 2012 Twitter, Inc.
Expand All @@ -26,7 +26,7 @@
/* DROPDOWN CLASS DEFINITION
* ========================= */

var toggle = '[data-toggle="dropdown"]'
var toggle = '[data-toggle=dropdown]'
, Dropdown = function (element) {
var $el = $(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', function () {
Expand All @@ -41,34 +41,82 @@
, toggle: function (e) {
var $this = $(this)
, $parent
, selector
, isActive

if ($this.is('.disabled, :disabled')) return

selector = $this.attr('data-target')
$parent = getParent($this)

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

clearMenus()

if (!isActive) {
$parent.toggleClass('open')
$this.focus()
}

$parent = $(selector)
$parent.length || ($parent = $this.parent())
return false
}

, keydown: function (e) {
var $this
, $items
, $active
, $parent
, isActive
, index

if (!/(38|40|27)/.test(e.keyCode)) return

$this = $(this)

e.preventDefault()
e.stopPropagation()

if ($this.is('.disabled, :disabled')) return

$parent = getParent($this)

isActive = $parent.hasClass('open')

clearMenus()
if (!isActive || (isActive && e.keyCode == 27)) return $this.click()

if (!isActive) $parent.toggleClass('open')
$items = $('[role=menu] li:not(.divider) a', $parent)

return false
if (!$items.length) return

index = $items.index($items.filter(':focus'))

if (e.keyCode == 38 && index > 0) index-- // up
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0

$items
.eq(index)
.focus()
}

}

function clearMenus() {
$(toggle).parent().removeClass('open')
getParent($(toggle))
.removeClass('open')
}

function getParent($this) {
var selector = $this.attr('data-target')
, $parent

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

$parent = $(selector)
$parent.length || ($parent = $this.parent())

return $parent
}


Expand All @@ -91,10 +139,12 @@
* =================================== */

$(function () {
$('html').on('click.dropdown.data-api', clearMenus)
$('html')
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
$('body')
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown', function (e) { e.stopPropagation() })
.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)
})

}(window.jQuery);

0 comments on commit 1ecb672

Please sign in to comment.