twitter-bootstrap-rails 2.0.6 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of twitter-bootstrap-rails might be problematic. Click here for more details.

Files changed (53) hide show
  1. data/README.md +40 -22
  2. data/app/helpers/flash_block_helper.rb +17 -0
  3. data/app/helpers/twitter_breadcrumbs_helper.rb +5 -0
  4. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +14 -0
  5. data/lib/generators/bootstrap/layout/templates/layout.html.erb +1 -5
  6. data/lib/generators/bootstrap/layout/templates/layout.html.haml +1 -5
  7. data/lib/generators/bootstrap/layout/templates/layout.html.slim +1 -5
  8. data/lib/generators/bootstrap/themed/templates/show.html.erb +4 -4
  9. data/lib/twitter/bootstrap/rails/engine.rb +1 -1
  10. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  11. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  12. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  13. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +28 -32
  14. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +29 -33
  15. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +27 -19
  16. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +45 -26
  17. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +18 -10
  18. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +25 -17
  19. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +13 -10
  20. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +43 -17
  21. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +12 -7
  22. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +40 -35
  23. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +30 -20
  24. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +25 -11
  25. data/vendor/toolkit/twitter/bootstrap/accordion.less +5 -0
  26. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +2 -3
  27. data/vendor/toolkit/twitter/bootstrap/button-groups.less +55 -36
  28. data/vendor/toolkit/twitter/bootstrap/buttons.less +15 -11
  29. data/vendor/toolkit/twitter/bootstrap/close.less +12 -1
  30. data/vendor/toolkit/twitter/bootstrap/code.less +4 -4
  31. data/vendor/toolkit/twitter/bootstrap/component-animations.less +5 -5
  32. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +15 -20
  33. data/vendor/toolkit/twitter/bootstrap/forms.less +58 -29
  34. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +55 -0
  35. data/vendor/toolkit/twitter/bootstrap/layouts.less +1 -1
  36. data/vendor/toolkit/twitter/bootstrap/mixins.less +53 -36
  37. data/vendor/toolkit/twitter/bootstrap/modals.less +1 -1
  38. data/vendor/toolkit/twitter/bootstrap/navbar.less +64 -41
  39. data/vendor/toolkit/twitter/bootstrap/navs.less +36 -36
  40. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +14 -6
  41. data/vendor/toolkit/twitter/bootstrap/reset.less +3 -3
  42. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +26 -0
  43. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +149 -0
  44. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +17 -0
  45. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +146 -0
  46. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +41 -0
  47. data/vendor/toolkit/twitter/bootstrap/responsive.less +14 -337
  48. data/vendor/toolkit/twitter/bootstrap/sprites.less +39 -6
  49. data/vendor/toolkit/twitter/bootstrap/tables.less +22 -5
  50. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +14 -2
  51. data/vendor/toolkit/twitter/bootstrap/type.less +7 -6
  52. data/vendor/toolkit/twitter/bootstrap/variables.less +10 -6
  53. metadata +31 -11
@@ -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
- if (startEvent == 'show') that.reset()
98
+ if (startEvent.type == '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);
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-dropdown.js v2.0.2
2
+ * bootstrap-dropdown.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#dropdowns
4
4
  * ============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,15 +18,16 @@
18
18
  * ============================================================ */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* DROPDOWN CLASS DEFINITION
26
27
  * ========================= */
27
28
 
28
29
  var toggle = '[data-toggle="dropdown"]'
29
- , Dropdown = function ( element ) {
30
+ , Dropdown = function (element) {
30
31
  var $el = $(element).on('click.dropdown.data-api', this.toggle)
31
32
  $('html').on('click.dropdown.data-api', function () {
32
33
  $el.parent().removeClass('open')
@@ -37,12 +38,16 @@
37
38
 
38
39
  constructor: Dropdown
39
40
 
40
- , toggle: function ( e ) {
41
+ , toggle: function (e) {
41
42
  var $this = $(this)
42
- , selector = $this.attr('data-target')
43
43
  , $parent
44
+ , selector
44
45
  , isActive
45
46
 
47
+ if ($this.is('.disabled, :disabled')) return
48
+
49
+ selector = $this.attr('data-target')
50
+
46
51
  if (!selector) {
47
52
  selector = $this.attr('href')
48
53
  selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
@@ -54,7 +59,8 @@
54
59
  isActive = $parent.hasClass('open')
55
60
 
56
61
  clearMenus()
57
- !isActive && $parent.toggleClass('open')
62
+
63
+ if (!isActive) $parent.toggleClass('open')
58
64
 
59
65
  return false
60
66
  }
@@ -69,7 +75,7 @@
69
75
  /* DROPDOWN PLUGIN DEFINITION
70
76
  * ========================== */
71
77
 
72
- $.fn.dropdown = function ( option ) {
78
+ $.fn.dropdown = function (option) {
73
79
  return this.each(function () {
74
80
  var $this = $(this)
75
81
  , data = $this.data('dropdown')
@@ -86,7 +92,9 @@
86
92
 
87
93
  $(function () {
88
94
  $('html').on('click.dropdown.data-api', clearMenus)
89
- $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
95
+ $('body')
96
+ .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
97
+ .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
90
98
  })
91
99
 
92
- }( window.jQuery );
100
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* =========================================================
2
- * bootstrap-modal.js v2.0.2
2
+ * bootstrap-modal.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#modals
4
4
  * =========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,14 +18,15 @@
18
18
  * ========================================================= */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* MODAL CLASS DEFINITION
26
27
  * ====================== */
27
28
 
28
- var Modal = function ( content, options ) {
29
+ var Modal = function (content, options) {
29
30
  this.options = options
30
31
  this.$element = $(content)
31
32
  .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
@@ -41,19 +42,23 @@
41
42
 
42
43
  , show: function () {
43
44
  var that = this
45
+ , e = $.Event('show')
46
+
47
+ this.$element.trigger(e)
44
48
 
45
- if (this.isShown) return
49
+ if (this.isShown || e.isDefaultPrevented()) return
46
50
 
47
51
  $('body').addClass('modal-open')
48
52
 
49
53
  this.isShown = true
50
- this.$element.trigger('show')
51
54
 
52
55
  escape.call(this)
53
56
  backdrop.call(this, function () {
54
57
  var transition = $.support.transition && that.$element.hasClass('fade')
55
58
 
56
- !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
59
+ if (!that.$element.parent().length) {
60
+ that.$element.appendTo(document.body) //don't move modals dom position
61
+ }
57
62
 
58
63
  that.$element
59
64
  .show()
@@ -71,21 +76,24 @@
71
76
  })
72
77
  }
73
78
 
74
- , hide: function ( e ) {
79
+ , hide: function (e) {
75
80
  e && e.preventDefault()
76
81
 
77
- if (!this.isShown) return
78
-
79
82
  var that = this
83
+
84
+ e = $.Event('hide')
85
+
86
+ this.$element.trigger(e)
87
+
88
+ if (!this.isShown || e.isDefaultPrevented()) return
89
+
80
90
  this.isShown = false
81
91
 
82
92
  $('body').removeClass('modal-open')
83
93
 
84
94
  escape.call(this)
85
95
 
86
- this.$element
87
- .trigger('hide')
88
- .removeClass('in')
96
+ this.$element.removeClass('in')
89
97
 
90
98
  $.support.transition && this.$element.hasClass('fade') ?
91
99
  hideWithTransition.call(this) :
@@ -111,7 +119,7 @@
111
119
  })
112
120
  }
113
121
 
114
- function hideModal( that ) {
122
+ function hideModal(that) {
115
123
  this.$element
116
124
  .hide()
117
125
  .trigger('hidden')
@@ -119,7 +127,7 @@
119
127
  backdrop.call(this)
120
128
  }
121
129
 
122
- function backdrop( callback ) {
130
+ function backdrop(callback) {
123
131
  var that = this
124
132
  , animate = this.$element.hasClass('fade') ? 'fade' : ''
125
133
 
@@ -173,7 +181,7 @@
173
181
  /* MODAL PLUGIN DEFINITION
174
182
  * ======================= */
175
183
 
176
- $.fn.modal = function ( option ) {
184
+ $.fn.modal = function (option) {
177
185
  return this.each(function () {
178
186
  var $this = $(this)
179
187
  , data = $this.data('modal')
@@ -207,4 +215,4 @@
207
215
  })
208
216
  })
209
217
 
210
- }( window.jQuery );
218
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ===========================================================
2
- * bootstrap-popover.js v2.0.2
2
+ * bootstrap-popover.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#popovers
4
4
  * ===========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,14 +18,19 @@
18
18
  * =========================================================== */
19
19
 
20
20
 
21
- !function( $ ) {
21
+ !function ($) {
22
22
 
23
- "use strict"
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* POPOVER PUBLIC CLASS DEFINITION
27
+ * =============================== */
24
28
 
25
29
  var Popover = function ( element, options ) {
26
30
  this.init('popover', element, options)
27
31
  }
28
32
 
33
+
29
34
  /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
30
35
  ========================================== */
31
36
 
@@ -38,8 +43,8 @@
38
43
  , title = this.getTitle()
39
44
  , content = this.getContent()
40
45
 
41
- $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title)
42
- $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content)
46
+ $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
47
+ $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
43
48
 
44
49
  $tip.removeClass('fade top bottom left right in')
45
50
  }
@@ -56,12 +61,10 @@
56
61
  content = $e.attr('data-content')
57
62
  || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
58
63
 
59
- content = content.toString().replace(/(^\s*|\s*$)/, "")
60
-
61
64
  return content
62
65
  }
63
66
 
64
- , tip: function() {
67
+ , tip: function () {
65
68
  if (!this.$tip) {
66
69
  this.$tip = $(this.options.template)
67
70
  }
@@ -74,7 +77,7 @@
74
77
  /* POPOVER PLUGIN DEFINITION
75
78
  * ======================= */
76
79
 
77
- $.fn.popover = function ( option ) {
80
+ $.fn.popover = function (option) {
78
81
  return this.each(function () {
79
82
  var $this = $(this)
80
83
  , data = $this.data('popover')
@@ -92,4 +95,4 @@
92
95
  , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
93
96
  })
94
97
 
95
- }( window.jQuery );
98
+ }(window.jQuery);