Skip to content

Commit

Permalink
Merge branch 'develop' into feature/rails-4.2
Browse files Browse the repository at this point in the history
* develop:
  * Tested against Rails 3.2.21, 4.0.12 and 4.1.8 * Improved dependencies * Improved readme
  * bootstrap 3.3.1
  * bootstrap 3.3.0
  * Tested against Rails 3.2.20, 4.0.11 and 4.1.7 * Open-ended dependencies for development gems
  • Loading branch information
tagliala committed Nov 29, 2014
2 parents 61cd7d9 + e6731b0 commit d62dda7
Show file tree
Hide file tree
Showing 60 changed files with 830 additions and 540 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.1.3
- 2.1
gemfile:
- gemfiles/rails_3.2.gemfile
- gemfiles/rails_4.0.gemfile
Expand Down
6 changes: 3 additions & 3 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
appraise 'rails-3.2' do
gem 'rails', '3.2.19'
gem 'rails', '3.2.21'
gem 'uglifier'
gem 'minitest', '~> 4'
end

appraise 'rails-4.0' do
gem 'rails', '4.0.10'
gem 'rails', '4.0.12'
gem 'uglifier'
gem 'minitest', '~> 4'
end

appraise 'rails-4.1' do
gem 'rails', '4.1.6'
gem 'rails', '4.1.8'
gem 'uglifier'
gem 'minitest', '~> 5'
end
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 2.15.1

* Tested against Rails 3.2.21, 4.0.12 and 4.1.8
* Improved dependencies
* Improved readme

## 2.15.0

* bootstrap 3.3.1

## 2.14.0

* bootstrap 3.3.0

## 2.13.0

* Tested against Rails 3.2.20, 4.0.11 and 4.1.7
* Open-ended dependencies for development gems

## 2.12.1

* Tested against Ruby 2.1.3
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Code Climate](https://codeclimate.com/github/diowa/twbs_less_rails/badges/gpa.svg)](https://codeclimate.com/github/diowa/twbs_less_rails)
[![Coverage Status](https://img.shields.io/coveralls/diowa/twbs_less_rails.svg)](https://coveralls.io/r/diowa/twbs_less_rails?branch=master)

Brings [Bootstrap](http://getbootstrap.com/) and [Font Awesome](http://fontawesome.io) assets into your Rails application.
An opinionated gem which brings [Bootstrap](http://getbootstrap.com/) and [Font Awesome](http://fontawesome.io) assets into your Rails application.



Expand Down Expand Up @@ -92,7 +92,7 @@ Take a look at [the whole list of Javascript components](/vendor/assets/javascri

Twbs Less Rails uses [Appraisal](https://github.com/thoughtbot/appraisal) for testing against multiple gem dependency versions.
```bash
$ appraisal install && appraisal update # Make sure your appraisals are installed and up to date
$ appraisal install; appraisal update # Make sure your appraisals are installed and up to date
$ appraisal rake
```

Expand Down
2 changes: 1 addition & 1 deletion app/assets/fonts/glyphicons-halflings-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gemfiles/rails_3.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rails", "3.2.19"
gem "rails", "3.2.21"
gem "uglifier"
gem "minitest", "~> 4"

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_4.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rails", "4.0.10"
gem "rails", "4.0.12"
gem "uglifier"
gem "minitest", "~> 4"

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_4.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rails", "4.1.6"
gem "rails", "4.1.8"
gem "uglifier"
gem "minitest", "~> 5"

Expand Down
2 changes: 1 addition & 1 deletion lib/twbs_less_rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module TwbsLessRails
VERSION = "2.12.1"
VERSION = "2.15.1"
end
2 changes: 1 addition & 1 deletion src/twbs/bootstrap
Submodule bootstrap updated 231 files
18 changes: 9 additions & 9 deletions twbs_less_rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ['lib']

s.add_runtime_dependency 'rails', '>= 3.2.19', '< 5.0.0'
s.add_runtime_dependency 'therubyracer', '~> 0.12'
s.add_runtime_dependency 'less-rails', '~> 2'
s.add_runtime_dependency 'rails', '>= 3.2.20', '< 5.0.0'
s.add_runtime_dependency 'therubyracer', '~> 0.12.1'
s.add_runtime_dependency 'less-rails', '~> 2.6'

s.add_development_dependency 'appraisal', '~> 1'
s.add_development_dependency 'capybara', '~> 2'
s.add_development_dependency 'coveralls', '~> 0.7'
s.add_development_dependency 'minitest', '>= 4', '< 6'
s.add_development_dependency 'rake', '~> 10'
s.add_development_dependency 'simplecov', '~> 0.9'
s.add_development_dependency 'appraisal', '~> 1.0'
s.add_development_dependency 'capybara', '~> 2.4'
s.add_development_dependency 'coveralls', '~> 0.7.1'
s.add_development_dependency 'minitest', '>= 4.7.5', '< 5.5.0'
s.add_development_dependency 'rake', '~> 10.4'
s.add_development_dependency 'simplecov', '~> 0.9.1'
end
66 changes: 43 additions & 23 deletions vendor/assets/javascripts/twbs/bootstrap/affix.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: affix.js v3.2.0
* Bootstrap: affix.js v3.3.1
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
Expand Down Expand Up @@ -28,7 +28,7 @@
this.checkPosition()
}

Affix.VERSION = '3.2.0'
Affix.VERSION = '3.3.1'

Affix.RESET = 'affix affix-top affix-bottom'

Expand All @@ -37,6 +37,28 @@
target: window
}

Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var targetHeight = this.$target.height()

if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false

if (this.affixed == 'bottom') {
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
}

var initializing = this.affixed == null
var colliderTop = initializing ? scrollTop : position.top
var colliderHeight = initializing ? targetHeight : height

if (offsetTop != null && colliderTop <= offsetTop) return 'top'
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'

return false
}

Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
Expand All @@ -52,42 +74,40 @@
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return

var scrollHeight = $(document).height()
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var height = this.$element.height()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom
var scrollHeight = $('body').height()

if (typeof offset != 'object') offsetBottom = offsetTop = offset
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' :
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)

if (this.affixed === affix) return
if (this.unpin != null) this.$element.css('top', '')
if (this.affixed != affix) {
if (this.unpin != null) this.$element.css('top', '')

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

this.$element.trigger(e)
this.$element.trigger(e)

if (e.isDefaultPrevented()) return
if (e.isDefaultPrevented()) return

this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null

this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger($.Event(affixType.replace('affix', 'affixed')))
this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
}

if (affix == 'bottom') {
this.$element.offset({
top: scrollHeight - this.$element.height() - offsetBottom
top: scrollHeight - height - offsetBottom
})
}
}
Expand Down Expand Up @@ -132,8 +152,8 @@

data.offset = data.offset || {}

if (data.offsetBottom) data.offset.bottom = data.offsetBottom
if (data.offsetTop) data.offset.top = data.offsetTop
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
if (data.offsetTop != null) data.offset.top = data.offsetTop

Plugin.call($spy, data)
})
Expand Down
10 changes: 6 additions & 4 deletions vendor/assets/javascripts/twbs/bootstrap/alert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: alert.js v3.2.0
* Bootstrap: alert.js v3.3.1
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
Expand All @@ -18,7 +18,9 @@
$(el).on('click', dismiss, this.close)
}

Alert.VERSION = '3.2.0'
Alert.VERSION = '3.3.1'

Alert.TRANSITION_DURATION = 150

Alert.prototype.close = function (e) {
var $this = $(this)
Expand All @@ -34,7 +36,7 @@
if (e) e.preventDefault()

if (!$parent.length) {
$parent = $this.hasClass('alert') ? $this : $this.parent()
$parent = $this.closest('.alert')
}

$parent.trigger(e = $.Event('close.bs.alert'))
Expand All @@ -51,7 +53,7 @@
$.support.transition && $parent.hasClass('fade') ?
$parent
.one('bsTransitionEnd', removeElement)
.emulateTransitionEnd(150) :
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
removeElement()
}

Expand Down
26 changes: 16 additions & 10 deletions vendor/assets/javascripts/twbs/bootstrap/button.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: button.js v3.2.0
* Bootstrap: button.js v3.3.1
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
Expand All @@ -19,7 +19,7 @@
this.isLoading = false
}

Button.VERSION = '3.2.0'
Button.VERSION = '3.3.1'

Button.DEFAULTS = {
loadingText: 'loading...'
Expand All @@ -35,10 +35,10 @@

if (data.resetText == null) $el.data('resetText', $el[val]())

$el[val](data[state] == null ? this.options[state] : data[state])

// push to event loop to allow forms to submit
setTimeout($.proxy(function () {
$el[val](data[state] == null ? this.options[state] : data[state])

if (state == 'loadingText') {
this.isLoading = true
$el.addClass(d).attr(d, d)
Expand All @@ -60,6 +60,8 @@
else $parent.find('.active').removeClass('active')
}
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
} else {
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
}

if (changed) this.$element.toggleClass('active')
Expand Down Expand Up @@ -100,11 +102,15 @@
// BUTTON DATA-API
// ===============

$(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
Plugin.call($btn, 'toggle')
e.preventDefault()
})
$(document)
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
Plugin.call($btn, 'toggle')
e.preventDefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
})

}(jQuery);
Loading

0 comments on commit d62dda7

Please sign in to comment.