less-rails-bootstrap 2.0.10 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/CHANGELOG.md +5 -0
  2. data/lib/less/rails/bootstrap/version.rb +1 -1
  3. data/scripts/update_bootstrap.sh +33 -0
  4. data/test/cases/usage_css_spec.rb +2 -2
  5. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  6. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  7. data/vendor/assets/javascripts/twitter/bootstrap/alert.js +28 -32
  8. data/vendor/assets/javascripts/twitter/bootstrap/button.js +29 -33
  9. data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +27 -19
  10. data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +44 -25
  11. data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +18 -10
  12. data/vendor/assets/javascripts/twitter/bootstrap/modal.js +25 -17
  13. data/vendor/assets/javascripts/twitter/bootstrap/popover.js +13 -10
  14. data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +43 -17
  15. data/vendor/assets/javascripts/twitter/bootstrap/tab.js +12 -7
  16. data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +40 -35
  17. data/vendor/assets/javascripts/twitter/bootstrap/transition.js +30 -20
  18. data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +25 -11
  19. data/vendor/frameworks/twitter/bootstrap/accordion.less +5 -0
  20. data/vendor/frameworks/twitter/bootstrap/bootstrap.less +2 -3
  21. data/vendor/frameworks/twitter/bootstrap/button-groups.less +55 -36
  22. data/vendor/frameworks/twitter/bootstrap/buttons.less +15 -11
  23. data/vendor/frameworks/twitter/bootstrap/close.less +12 -1
  24. data/vendor/frameworks/twitter/bootstrap/code.less +5 -5
  25. data/vendor/frameworks/twitter/bootstrap/component-animations.less +4 -4
  26. data/vendor/frameworks/twitter/bootstrap/dropdowns.less +15 -20
  27. data/vendor/frameworks/twitter/bootstrap/forms.less +58 -29
  28. data/vendor/frameworks/twitter/bootstrap/grid.less +1 -1
  29. data/vendor/frameworks/twitter/bootstrap/labels-badges.less +55 -0
  30. data/vendor/frameworks/twitter/bootstrap/layouts.less +2 -2
  31. data/vendor/frameworks/twitter/bootstrap/mixins.less +53 -36
  32. data/vendor/frameworks/twitter/bootstrap/modals.less +1 -1
  33. data/vendor/frameworks/twitter/bootstrap/navbar.less +65 -42
  34. data/vendor/frameworks/twitter/bootstrap/navs.less +36 -36
  35. data/vendor/frameworks/twitter/bootstrap/pager.less +1 -1
  36. data/vendor/frameworks/twitter/bootstrap/progress-bars.less +14 -6
  37. data/vendor/frameworks/twitter/bootstrap/reset.less +3 -3
  38. data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.less +23 -0
  39. data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.less +149 -0
  40. data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.less +15 -0
  41. data/vendor/frameworks/twitter/bootstrap/responsive-navbar.less +146 -0
  42. data/vendor/frameworks/twitter/bootstrap/responsive-utilities.less +41 -0
  43. data/vendor/frameworks/twitter/bootstrap/responsive.less +14 -337
  44. data/vendor/frameworks/twitter/bootstrap/sprites.less +41 -8
  45. data/vendor/frameworks/twitter/bootstrap/tables.less +22 -5
  46. data/vendor/frameworks/twitter/bootstrap/thumbnails.less +11 -2
  47. data/vendor/frameworks/twitter/bootstrap/type.less +7 -6
  48. data/vendor/frameworks/twitter/bootstrap/variables.less +12 -8
  49. metadata +11 -4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 2.0.11 - 04/25/2012
5
+
6
+ * Update to bootstrap 2.0.3.
7
+
8
+
4
9
  2.0.10 - 04/04/2012
5
10
 
6
11
  * Include a way to require the responsive responsive file.
@@ -1,7 +1,7 @@
1
1
  module Less
2
2
  module Rails
3
3
  module Bootstrap
4
- VERSION = "2.0.10"
4
+ VERSION = "2.0.11"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,33 @@
1
+ #!/bin/bash
2
+
3
+ bs_dir='../bootstrap'
4
+ lrb_dir='.'
5
+ lrb_img_dir="$lrb_dir/vendor/assets/images/twitter/bootstrap"
6
+ lrb_js_dir="$lrb_dir/vendor/assets/javascripts/twitter/bootstrap"
7
+ lrb_styles_dir="$lrb_dir/vendor/assets/stylesheets/twitter"
8
+ lrb_fw_dir="$lrb_dir/vendor/frameworks/twitter/bootstrap"
9
+
10
+ if [ ! -d $bs_dir ]; then
11
+ echo "Bootstrap not found. You might want to clone the bootstrap repo from http://twitter.github.com/bootstrap/ into $bs_dir"
12
+ exit 1
13
+ fi
14
+
15
+ # images
16
+ for f in $bs_dir/img/*; do
17
+ bn=$(basename $f)
18
+ cp $f $lrb_img_dir/$bn
19
+ done
20
+
21
+ # scripts
22
+ for f in $bs_dir/js/*.js; do
23
+ bn=$(basename $f)
24
+ cp $f $lrb_js_dir/${bn/bootstrap-/}
25
+ done
26
+
27
+ # styles
28
+ for f in $bs_dir/less/*.less; do
29
+ bn=$(basename $f)
30
+ sed -e 's#"\.\./img/\([^"]*\)"#"twitter/bootstrap/\1"#g' \
31
+ -e 's#background-image: url(#background-image: asset-url(#g' \
32
+ $f > $lrb_fw_dir/$bn
33
+ done
@@ -15,8 +15,8 @@ class UsageCssSpec < Less::Rails::Bootstrap::Spec
15
15
  end
16
16
 
17
17
  it 'uses less-rails asset-url helper for images' do
18
- app_css.must_include 'url("/assets/twitter/bootstrap/glyphicons-halflings.png")'
19
- app_css.must_include 'url("/assets/twitter/bootstrap/glyphicons-halflings-white.png")'
18
+ app_css.must_include 'url(/assets/twitter/bootstrap/glyphicons-halflings.png)'
19
+ app_css.must_include 'url(/assets/twitter/bootstrap/glyphicons-halflings-white.png)'
20
20
  end
21
21
 
22
22
  end
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-alert.js v2.0.2
2
+ * bootstrap-alert.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#alerts
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,61 +18,57 @@
18
18
  * ========================================================== */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* ALERT CLASS DEFINITION
26
27
  * ====================== */
27
28
 
28
29
  var dismiss = '[data-dismiss="alert"]'
29
- , Alert = function ( el ) {
30
+ , Alert = function (el) {
30
31
  $(el).on('click', dismiss, this.close)
31
32
  }
32
33
 
33
- Alert.prototype = {
34
-
35
- constructor: Alert
34
+ Alert.prototype.close = function (e) {
35
+ var $this = $(this)
36
+ , selector = $this.attr('data-target')
37
+ , $parent
36
38
 
37
- , close: function ( e ) {
38
- var $this = $(this)
39
- , selector = $this.attr('data-target')
40
- , $parent
39
+ if (!selector) {
40
+ selector = $this.attr('href')
41
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
42
+ }
41
43
 
42
- if (!selector) {
43
- selector = $this.attr('href')
44
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
45
- }
44
+ $parent = $(selector)
46
45
 
47
- $parent = $(selector)
48
- $parent.trigger('close')
46
+ e && e.preventDefault()
49
47
 
50
- e && e.preventDefault()
48
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
51
49
 
52
- $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
50
+ $parent.trigger(e = $.Event('close'))
53
51
 
54
- $parent
55
- .trigger('close')
56
- .removeClass('in')
52
+ if (e.isDefaultPrevented()) return
57
53
 
58
- function removeElement() {
59
- $parent
60
- .trigger('closed')
61
- .remove()
62
- }
54
+ $parent.removeClass('in')
63
55
 
64
- $.support.transition && $parent.hasClass('fade') ?
65
- $parent.on($.support.transition.end, removeElement) :
66
- removeElement()
56
+ function removeElement() {
57
+ $parent
58
+ .trigger('closed')
59
+ .remove()
67
60
  }
68
61
 
62
+ $.support.transition && $parent.hasClass('fade') ?
63
+ $parent.on($.support.transition.end, removeElement) :
64
+ removeElement()
69
65
  }
70
66
 
71
67
 
72
68
  /* ALERT PLUGIN DEFINITION
73
69
  * ======================= */
74
70
 
75
- $.fn.alert = function ( option ) {
71
+ $.fn.alert = function (option) {
76
72
  return this.each(function () {
77
73
  var $this = $(this)
78
74
  , data = $this.data('alert')
@@ -91,4 +87,4 @@
91
87
  $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
92
88
  })
93
89
 
94
- }( window.jQuery );
90
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-button.js v2.0.2
2
+ * bootstrap-button.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#buttons
4
4
  * ============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -17,58 +17,54 @@
17
17
  * limitations under the License.
18
18
  * ============================================================ */
19
19
 
20
- !function( $ ){
21
20
 
22
- "use strict"
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
24
+
23
25
 
24
26
  /* BUTTON PUBLIC CLASS DEFINITION
25
27
  * ============================== */
26
28
 
27
- var Button = function ( element, options ) {
29
+ var Button = function (element, options) {
28
30
  this.$element = $(element)
29
31
  this.options = $.extend({}, $.fn.button.defaults, options)
30
32
  }
31
33
 
32
- Button.prototype = {
33
-
34
- constructor: Button
34
+ Button.prototype.setState = function (state) {
35
+ var d = 'disabled'
36
+ , $el = this.$element
37
+ , data = $el.data()
38
+ , val = $el.is('input') ? 'val' : 'html'
35
39
 
36
- , setState: function ( state ) {
37
- var d = 'disabled'
38
- , $el = this.$element
39
- , data = $el.data()
40
- , val = $el.is('input') ? 'val' : 'html'
40
+ state = state + 'Text'
41
+ data.resetText || $el.data('resetText', $el[val]())
41
42
 
42
- state = state + 'Text'
43
- data.resetText || $el.data('resetText', $el[val]())
43
+ $el[val](data[state] || this.options[state])
44
44
 
45
- $el[val](data[state] || this.options[state])
46
-
47
- // push to event loop to allow forms to submit
48
- setTimeout(function () {
49
- state == 'loadingText' ?
50
- $el.addClass(d).attr(d, d) :
51
- $el.removeClass(d).removeAttr(d)
52
- }, 0)
53
- }
54
-
55
- , toggle: function () {
56
- var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
45
+ // push to event loop to allow forms to submit
46
+ setTimeout(function () {
47
+ state == 'loadingText' ?
48
+ $el.addClass(d).attr(d, d) :
49
+ $el.removeClass(d).removeAttr(d)
50
+ }, 0)
51
+ }
57
52
 
58
- $parent && $parent
59
- .find('.active')
60
- .removeClass('active')
53
+ Button.prototype.toggle = function () {
54
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
61
55
 
62
- this.$element.toggleClass('active')
63
- }
56
+ $parent && $parent
57
+ .find('.active')
58
+ .removeClass('active')
64
59
 
60
+ this.$element.toggleClass('active')
65
61
  }
66
62
 
67
63
 
68
64
  /* BUTTON PLUGIN DEFINITION
69
65
  * ======================== */
70
66
 
71
- $.fn.button = function ( option ) {
67
+ $.fn.button = function (option) {
72
68
  return this.each(function () {
73
69
  var $this = $(this)
74
70
  , data = $this.data('button')
@@ -97,4 +93,4 @@
97
93
  })
98
94
  })
99
95
 
100
- }( window.jQuery );
96
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-carousel.js v2.0.2
2
+ * bootstrap-carousel.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#carousel
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,16 +18,17 @@
18
18
  * ========================================================== */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* CAROUSEL CLASS DEFINITION
26
27
  * ========================= */
27
28
 
28
29
  var Carousel = function (element, options) {
29
30
  this.$element = $(element)
30
- this.options = $.extend({}, $.fn.carousel.defaults, options)
31
+ this.options = options
31
32
  this.options.slide && this.slide(this.options.slide)
32
33
  this.options.pause == 'hover' && this.$element
33
34
  .on('mouseenter', $.proxy(this.pause, this))
@@ -36,8 +37,11 @@
36
37
 
37
38
  Carousel.prototype = {
38
39
 
39
- cycle: function () {
40
- this.interval = setInterval($.proxy(this.next, this), this.options.interval)
40
+ cycle: function (e) {
41
+ if (!e) this.paused = false
42
+ this.options.interval
43
+ && !this.paused
44
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
41
45
  return this
42
46
  }
43
47
 
@@ -62,7 +66,8 @@
62
66
  return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
63
67
  }
64
68
 
65
- , pause: function () {
69
+ , pause: function (e) {
70
+ if (!e) this.paused = true
66
71
  clearInterval(this.interval)
67
72
  this.interval = null
68
73
  return this
@@ -85,6 +90,7 @@
85
90
  , direction = type == 'next' ? 'left' : 'right'
86
91
  , fallback = type == 'next' ? 'first' : 'last'
87
92
  , that = this
93
+ , e = $.Event('slide')
88
94
 
89
95
  this.sliding = true
90
96
 
@@ -94,24 +100,26 @@
94
100
 
95
101
  if ($next.hasClass('active')) return
96
102
 
97
- if (!$.support.transition && this.$element.hasClass('slide')) {
98
- this.$element.trigger('slide')
99
- $active.removeClass('active')
100
- $next.addClass('active')
101
- this.sliding = false
102
- this.$element.trigger('slid')
103
- } else {
103
+ if ($.support.transition && this.$element.hasClass('slide')) {
104
+ this.$element.trigger(e)
105
+ if (e.isDefaultPrevented()) return
104
106
  $next.addClass(type)
105
107
  $next[0].offsetWidth // force reflow
106
108
  $active.addClass(direction)
107
109
  $next.addClass(direction)
108
- this.$element.trigger('slide')
109
110
  this.$element.one($.support.transition.end, function () {
110
111
  $next.removeClass([type, direction].join(' ')).addClass('active')
111
112
  $active.removeClass(['active', direction].join(' '))
112
113
  that.sliding = false
113
114
  setTimeout(function () { that.$element.trigger('slid') }, 0)
114
115
  })
116
+ } else {
117
+ this.$element.trigger(e)
118
+ if (e.isDefaultPrevented()) return
119
+ $active.removeClass('active')
120
+ $next.addClass('active')
121
+ this.sliding = false
122
+ this.$element.trigger('slid')
115
123
  }
116
124
 
117
125
  isCycling && this.cycle()
@@ -125,15 +133,15 @@
125
133
  /* CAROUSEL PLUGIN DEFINITION
126
134
  * ========================== */
127
135
 
128
- $.fn.carousel = function ( option ) {
136
+ $.fn.carousel = function (option) {
129
137
  return this.each(function () {
130
138
  var $this = $(this)
131
139
  , data = $this.data('carousel')
132
- , options = typeof option == 'object' && option
140
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
133
141
  if (!data) $this.data('carousel', (data = new Carousel(this, options)))
134
142
  if (typeof option == 'number') data.to(option)
135
143
  else if (typeof option == 'string' || (option = options.slide)) data[option]()
136
- else data.cycle()
144
+ else if (options.interval) data.cycle()
137
145
  })
138
146
  }
139
147
 
@@ -158,4 +166,4 @@
158
166
  })
159
167
  })
160
168
 
161
- }( window.jQuery );
169
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-collapse.js v2.0.2
2
+ * bootstrap-collapse.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#collapse
4
4
  * =============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -17,16 +17,21 @@
17
17
  * limitations under the License.
18
18
  * ============================================================ */
19
19
 
20
- !function( $ ){
21
20
 
22
- "use strict"
21
+ !function ($) {
23
22
 
24
- var Collapse = function ( element, options ) {
25
- this.$element = $(element)
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* COLLAPSE PUBLIC CLASS DEFINITION
27
+ * ================================ */
28
+
29
+ var Collapse = function (element, options) {
30
+ this.$element = $(element)
26
31
  this.options = $.extend({}, $.fn.collapse.defaults, options)
27
32
 
28
- if (this.options["parent"]) {
29
- this.$parent = $(this.options["parent"])
33
+ if (this.options.parent) {
34
+ this.$parent = $(this.options.parent)
30
35
  }
31
36
 
32
37
  this.options.toggle && this.toggle()
@@ -42,31 +47,39 @@
42
47
  }
43
48
 
44
49
  , show: function () {
45
- var dimension = this.dimension()
46
- , scroll = $.camelCase(['scroll', dimension].join('-'))
47
- , actives = this.$parent && this.$parent.find('.in')
50
+ var dimension
51
+ , scroll
52
+ , actives
48
53
  , hasData
49
54
 
55
+ if (this.transitioning) return
56
+
57
+ dimension = this.dimension()
58
+ scroll = $.camelCase(['scroll', dimension].join('-'))
59
+ actives = this.$parent && this.$parent.find('> .accordion-group > .in')
60
+
50
61
  if (actives && actives.length) {
51
62
  hasData = actives.data('collapse')
63
+ if (hasData && hasData.transitioning) return
52
64
  actives.collapse('hide')
53
65
  hasData || actives.data('collapse', null)
54
66
  }
55
67
 
56
68
  this.$element[dimension](0)
57
- this.transition('addClass', 'show', 'shown')
69
+ this.transition('addClass', $.Event('show'), 'shown')
58
70
  this.$element[dimension](this.$element[0][scroll])
59
-
60
71
  }
61
72
 
62
73
  , hide: function () {
63
- var dimension = this.dimension()
74
+ var dimension
75
+ if (this.transitioning) return
76
+ dimension = this.dimension()
64
77
  this.reset(this.$element[dimension]())
65
- this.transition('removeClass', 'hide', 'hidden')
78
+ this.transition('removeClass', $.Event('hide'), 'hidden')
66
79
  this.$element[dimension](0)
67
80
  }
68
81
 
69
- , reset: function ( size ) {
82
+ , reset: function (size) {
70
83
  var dimension = this.dimension()
71
84
 
72
85
  this.$element
@@ -74,37 +87,43 @@
74
87
  [dimension](size || 'auto')
75
88
  [0].offsetWidth
76
89
 
77
- this.$element[size ? 'addClass' : 'removeClass']('collapse')
90
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
78
91
 
79
92
  return this
80
93
  }
81
94
 
82
- , transition: function ( method, startEvent, completeEvent ) {
95
+ , transition: function (method, startEvent, completeEvent) {
83
96
  var that = this
84
97
  , complete = function () {
85
98
  if (startEvent == 'show') that.reset()
99
+ that.transitioning = 0
86
100
  that.$element.trigger(completeEvent)
87
101
  }
88
102
 
89
- this.$element
90
- .trigger(startEvent)
91
- [method]('in')
103
+ this.$element.trigger(startEvent)
104
+
105
+ if (startEvent.isDefaultPrevented()) return
106
+
107
+ this.transitioning = 1
108
+
109
+ this.$element[method]('in')
92
110
 
93
111
  $.support.transition && this.$element.hasClass('collapse') ?
94
112
  this.$element.one($.support.transition.end, complete) :
95
113
  complete()
96
- }
114
+ }
97
115
 
98
116
  , toggle: function () {
99
117
  this[this.$element.hasClass('in') ? 'hide' : 'show']()
100
- }
118
+ }
101
119
 
102
120
  }
103
121
 
104
- /* COLLAPSIBLE PLUGIN DEFINITION
122
+
123
+ /* COLLAPSIBLE PLUGIN DEFINITION
105
124
  * ============================== */
106
125
 
107
- $.fn.collapse = function ( option ) {
126
+ $.fn.collapse = function (option) {
108
127
  return this.each(function () {
109
128
  var $this = $(this)
110
129
  , data = $this.data('collapse')
@@ -135,4 +154,4 @@
135
154
  })
136
155
  })
137
156
 
138
- }( window.jQuery );
157
+ }(window.jQuery);