Skip to content

Commit

Permalink
Update to Twitter Bootstrap 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
metaskills committed Feb 1, 2012
1 parent 9aeed24 commit 7bc1dcb
Show file tree
Hide file tree
Showing 58 changed files with 4,908 additions and 2,690 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========

2.0.0 - 01/31/2011

* Update to Twitter Bootstrap 2.0.0


1.4.1 - 11/18/2011
------------------

Expand Down
2 changes: 1 addition & 1 deletion lib/less/rails/bootstrap/version.rb
@@ -1,7 +1,7 @@
module Less
module Rails
module Bootstrap
VERSION = "1.4.3"
VERSION = "2.0.0"
end
end
end
11 changes: 2 additions & 9 deletions test/cases/usage_css_spec.rb
Expand Up @@ -7,14 +7,7 @@ class UsageCssSpec < Less::Rails::Bootstrap::Spec
let(:app_css) { dummy_asset('application.css') }

it 'will render main bootstrap.less file and all included modules' do
app_css.must_include 'Bootstrap @VERSION', 'From boostrap.less'
app_css.must_include 'Forms.less', 'From forms.less'
app_css.must_include 'Snippets of reusable CSS', 'From mixins.less'
app_css.must_include 'Patterns.less', 'From patterns.less'
app_css.must_include 'Scaffolding', 'From scaffolding.less'
app_css.must_include 'Tables.less', 'From tables.less'
app_css.must_include 'Typography.less', 'From type.less'
app_css.must_include 'Variables.less', 'From variables.less'
app_css.must_include 'Bootstrap v2'
end

it 'must include basic css afterward' do
Expand All @@ -38,7 +31,7 @@ class UsageCssSpec < Less::Rails::Bootstrap::Spec

it 'will render bootstrap variables' do
link_color_line = line_for_framework_css('framework-linkColor')
link_color_line.must_include 'color:#0069d6;'
link_color_line.must_include 'color:#0088cc;'
end

end
Expand Down
12 changes: 5 additions & 7 deletions test/cases/usage_js_spec.rb
Expand Up @@ -7,13 +7,11 @@ class UsageJsSpec < Less::Rails::Bootstrap::Spec
let(:app_js) { dummy_asset('application.js') }

it 'will render main bootstrap.js file and all included modules' do
app_js.must_include 'bootstrap-alerts.js'
app_js.must_include 'bootstrap-dropdown.js'
app_js.must_include 'bootstrap-modal.js'
app_js.must_include 'bootstrap-popover.js'
app_js.must_include 'bootstrap-scrollspy.js'
app_js.must_include 'bootstrap-tabs.js'
app_js.must_include 'bootstrap-twipsy.js'
files = ['alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal',
'popover', 'scrollspy', 'tab', 'tooltip', 'transition', 'typeahead']
files.each do |file|
app_js.must_include "bootstrap-#{file}.js"
end
end

it 'must include basic js afterward' do
Expand Down
20 changes: 12 additions & 8 deletions vendor/assets/javascripts/twitter/bootstrap.js
@@ -1,8 +1,12 @@
//= require twitter/bootstrap/alerts
//= require twitter/bootstrap/buttons
//= require twitter/bootstrap/dropdown
//= require twitter/bootstrap/modal
//= require twitter/bootstrap/twipsy
//= require twitter/bootstrap/popover
//= require twitter/bootstrap/scrollspy
//= require twitter/bootstrap/tabs
//= require twitter/bootstrap/alert.js
//= require twitter/bootstrap/button.js
//= require twitter/bootstrap/carousel.js
//= require twitter/bootstrap/collapse.js
//= require twitter/bootstrap/dropdown.js
//= require twitter/bootstrap/modal.js
//= require twitter/bootstrap/popover.js
//= require twitter/bootstrap/scrollspy.js
//= require twitter/bootstrap/tab.js
//= require twitter/bootstrap/tooltip.js
//= require twitter/bootstrap/transition.js
//= require twitter/bootstrap/typeahead.js
91 changes: 91 additions & 0 deletions vendor/assets/javascripts/twitter/bootstrap/alert.js
@@ -0,0 +1,91 @@
/* ==========================================================
* bootstrap-alert.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* 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"

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

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

Alert.prototype = {

constructor: Alert

, 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
}

$parent = $(selector)
$parent.trigger('close')

e && e.preventDefault()

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

$parent.removeClass('in')

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

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

}


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

$.fn.alert = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('alert')
if (!data) $this.data('alert', (data = new Alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}

$.fn.alert.Constructor = Alert


/* ALERT DATA-API
* ============== */

$(function () {
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
})

}( window.jQuery )
113 changes: 0 additions & 113 deletions vendor/assets/javascripts/twitter/bootstrap/alerts.js

This file was deleted.

98 changes: 98 additions & 0 deletions vendor/assets/javascripts/twitter/bootstrap/button.js
@@ -0,0 +1,98 @@
/* ============================================================
* bootstrap-button.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* 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"

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

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

Button.prototype = {

constructor: Button

, 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]())

$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"]')

$parent && $parent
.find('.active')
.removeClass('active')

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

}


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

$.fn.button = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('button')
, options = typeof option == 'object' && option
if (!data) $this.data('button', (data = new Button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setState(option)
})
}

$.fn.button.defaults = {
loadingText: 'loading...'
}

$.fn.button.Constructor = Button


/* BUTTON DATA-API
* =============== */

$(function () {
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
$(e.target).button('toggle')
})
})

}( window.jQuery )

0 comments on commit 7bc1dcb

Please sign in to comment.