bootstrap-generators 3.1.1.3 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -5
  3. data/README.md +8 -8
  4. data/Rakefile +7 -5
  5. data/lib/bootstrap/generators/version.rb +1 -1
  6. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +40 -23
  7. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.scss +41 -24
  8. data/vendor/assets/javascripts/bootstrap.js +6 -6
  9. data/vendor/assets/javascripts/bootstrap/affix.js +19 -14
  10. data/vendor/assets/javascripts/bootstrap/alert.js +10 -6
  11. data/vendor/assets/javascripts/bootstrap/button.js +11 -8
  12. data/vendor/assets/javascripts/bootstrap/carousel.js +49 -31
  13. data/vendor/assets/javascripts/bootstrap/collapse.js +22 -22
  14. data/vendor/assets/javascripts/bootstrap/dropdown.js +17 -13
  15. data/vendor/assets/javascripts/bootstrap/modal.js +66 -29
  16. data/vendor/assets/javascripts/bootstrap/popover.js +10 -7
  17. data/vendor/assets/javascripts/bootstrap/scrollspy.js +40 -23
  18. data/vendor/assets/javascripts/bootstrap/tab.js +11 -8
  19. data/vendor/assets/javascripts/bootstrap/tooltip.js +115 -57
  20. data/vendor/assets/javascripts/bootstrap/transition.js +18 -7
  21. data/vendor/assets/stylesheets/bootstrap.css.erb +2740 -2322
  22. data/vendor/twitter/bootstrap/less/alerts.less +4 -3
  23. data/vendor/twitter/bootstrap/less/badges.less +18 -18
  24. data/vendor/twitter/bootstrap/less/bootstrap.less +3 -2
  25. data/vendor/twitter/bootstrap/less/button-groups.less +16 -2
  26. data/vendor/twitter/bootstrap/less/buttons.less +0 -2
  27. data/vendor/twitter/bootstrap/less/carousel.less +15 -4
  28. data/vendor/twitter/bootstrap/less/code.less +6 -1
  29. data/vendor/twitter/bootstrap/less/component-animations.less +6 -4
  30. data/vendor/twitter/bootstrap/less/dropdowns.less +2 -0
  31. data/vendor/twitter/bootstrap/less/forms.less +144 -42
  32. data/vendor/twitter/bootstrap/less/glyphicons.less +5 -5
  33. data/vendor/twitter/bootstrap/less/input-groups.less +6 -2
  34. data/vendor/twitter/bootstrap/less/jumbotron.less +4 -0
  35. data/vendor/twitter/bootstrap/less/labels.less +1 -1
  36. data/vendor/twitter/bootstrap/less/list-group.less +22 -1
  37. data/vendor/twitter/bootstrap/less/mixins.less +35 -925
  38. data/vendor/twitter/bootstrap/less/mixins/alerts.less +14 -0
  39. data/vendor/twitter/bootstrap/less/mixins/background-variant.less +8 -0
  40. data/vendor/twitter/bootstrap/less/mixins/border-radius.less +18 -0
  41. data/vendor/twitter/bootstrap/less/mixins/buttons.less +50 -0
  42. data/vendor/twitter/bootstrap/less/mixins/center-block.less +7 -0
  43. data/vendor/twitter/bootstrap/less/mixins/clearfix.less +22 -0
  44. data/vendor/twitter/bootstrap/less/mixins/forms.less +81 -0
  45. data/vendor/twitter/bootstrap/less/mixins/gradients.less +59 -0
  46. data/vendor/twitter/bootstrap/less/mixins/grid-framework.less +91 -0
  47. data/vendor/twitter/bootstrap/less/mixins/grid.less +122 -0
  48. data/vendor/twitter/bootstrap/less/mixins/hide-text.less +21 -0
  49. data/vendor/twitter/bootstrap/less/mixins/image.less +34 -0
  50. data/vendor/twitter/bootstrap/less/mixins/labels.less +12 -0
  51. data/vendor/twitter/bootstrap/less/mixins/list-group.less +29 -0
  52. data/vendor/twitter/bootstrap/less/mixins/nav-divider.less +10 -0
  53. data/vendor/twitter/bootstrap/less/mixins/nav-vertical-align.less +9 -0
  54. data/vendor/twitter/bootstrap/less/mixins/opacity.less +8 -0
  55. data/vendor/twitter/bootstrap/less/mixins/pagination.less +23 -0
  56. data/vendor/twitter/bootstrap/less/mixins/panels.less +24 -0
  57. data/vendor/twitter/bootstrap/less/mixins/progress-bar.less +10 -0
  58. data/vendor/twitter/bootstrap/less/mixins/reset-filter.less +8 -0
  59. data/vendor/twitter/bootstrap/less/mixins/resize.less +6 -0
  60. data/vendor/twitter/bootstrap/less/mixins/responsive-visibility.less +15 -0
  61. data/vendor/twitter/bootstrap/less/mixins/size.less +10 -0
  62. data/vendor/twitter/bootstrap/less/mixins/tab-focus.less +9 -0
  63. data/vendor/twitter/bootstrap/less/mixins/table-row.less +28 -0
  64. data/vendor/twitter/bootstrap/less/mixins/text-emphasis.less +8 -0
  65. data/vendor/twitter/bootstrap/less/mixins/text-overflow.less +8 -0
  66. data/vendor/twitter/bootstrap/less/mixins/vendor-prefixes.less +224 -0
  67. data/vendor/twitter/bootstrap/less/modals.less +18 -7
  68. data/vendor/twitter/bootstrap/less/navbar.less +41 -2
  69. data/vendor/twitter/bootstrap/less/navs.less +1 -1
  70. data/vendor/twitter/bootstrap/less/normalize.less +20 -18
  71. data/vendor/twitter/bootstrap/less/panels.less +8 -6
  72. data/vendor/twitter/bootstrap/less/popovers.less +1 -1
  73. data/vendor/twitter/bootstrap/less/progress-bars.less +27 -2
  74. data/vendor/twitter/bootstrap/less/responsive-embed.less +34 -0
  75. data/vendor/twitter/bootstrap/less/responsive-utilities.less +103 -1
  76. data/vendor/twitter/bootstrap/less/scaffolding.less +17 -1
  77. data/vendor/twitter/bootstrap/less/tables.less +4 -4
  78. data/vendor/twitter/bootstrap/less/theme.less +11 -0
  79. data/vendor/twitter/bootstrap/less/type.less +32 -12
  80. data/vendor/twitter/bootstrap/less/utilities.less +1 -0
  81. data/vendor/twitter/bootstrap/less/variables.less +40 -23
  82. data/vendor/twitter/bootstrap/sass/_alerts.scss +4 -3
  83. data/vendor/twitter/bootstrap/sass/_badges.scss +13 -11
  84. data/vendor/twitter/bootstrap/sass/_button-groups.scss +16 -2
  85. data/vendor/twitter/bootstrap/sass/_buttons.scss +0 -2
  86. data/vendor/twitter/bootstrap/sass/_carousel.scss +15 -4
  87. data/vendor/twitter/bootstrap/sass/_code.scss +6 -1
  88. data/vendor/twitter/bootstrap/sass/_component-animations.scss +10 -4
  89. data/vendor/twitter/bootstrap/sass/_dropdowns.scss +2 -0
  90. data/vendor/twitter/bootstrap/sass/_forms.scss +144 -42
  91. data/vendor/twitter/bootstrap/sass/_glyphicons.scss +4 -0
  92. data/vendor/twitter/bootstrap/sass/_input-groups.scss +6 -2
  93. data/vendor/twitter/bootstrap/sass/_jumbotron.scss +4 -0
  94. data/vendor/twitter/bootstrap/sass/_labels.scss +11 -9
  95. data/vendor/twitter/bootstrap/sass/_list-group.scss +22 -1
  96. data/vendor/twitter/bootstrap/sass/_mixins.scss +35 -943
  97. data/vendor/twitter/bootstrap/sass/_modals.scss +18 -7
  98. data/vendor/twitter/bootstrap/sass/_navbar.scss +41 -2
  99. data/vendor/twitter/bootstrap/sass/_navs.scss +1 -1
  100. data/vendor/twitter/bootstrap/sass/_normalize.scss +20 -18
  101. data/vendor/twitter/bootstrap/sass/_panels.scss +8 -6
  102. data/vendor/twitter/bootstrap/sass/_popovers.scss +1 -1
  103. data/vendor/twitter/bootstrap/sass/_progress-bars.scss +27 -2
  104. data/vendor/twitter/bootstrap/sass/_responsive-embed.scss +34 -0
  105. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +101 -1
  106. data/vendor/twitter/bootstrap/sass/_scaffolding.scss +17 -1
  107. data/vendor/twitter/bootstrap/sass/_tables.scss +4 -4
  108. data/vendor/twitter/bootstrap/sass/_theme.scss +11 -0
  109. data/vendor/twitter/bootstrap/sass/_type.scss +32 -12
  110. data/vendor/twitter/bootstrap/sass/_utilities.scss +1 -0
  111. data/vendor/twitter/bootstrap/sass/_variables.scss +41 -24
  112. data/vendor/twitter/bootstrap/sass/bootstrap.scss +3 -2
  113. data/vendor/twitter/bootstrap/sass/mixins/_alerts.scss +14 -0
  114. data/vendor/twitter/bootstrap/sass/mixins/_background-variant.scss +11 -0
  115. data/vendor/twitter/bootstrap/sass/mixins/_border-radius.scss +18 -0
  116. data/vendor/twitter/bootstrap/sass/mixins/_buttons.scss +50 -0
  117. data/vendor/twitter/bootstrap/sass/mixins/_center-block.scss +7 -0
  118. data/vendor/twitter/bootstrap/sass/mixins/_clearfix.scss +22 -0
  119. data/vendor/twitter/bootstrap/sass/mixins/_forms.scss +84 -0
  120. data/vendor/twitter/bootstrap/sass/mixins/_gradients.scss +58 -0
  121. data/vendor/twitter/bootstrap/sass/mixins/_grid-framework.scss +81 -0
  122. data/vendor/twitter/bootstrap/sass/mixins/_grid.scss +122 -0
  123. data/vendor/twitter/bootstrap/sass/mixins/_hide-text.scss +21 -0
  124. data/vendor/twitter/bootstrap/sass/mixins/_image.scss +34 -0
  125. data/vendor/twitter/bootstrap/sass/mixins/_labels.scss +12 -0
  126. data/vendor/twitter/bootstrap/sass/mixins/_list-group.scss +31 -0
  127. data/vendor/twitter/bootstrap/sass/mixins/_nav-divider.scss +10 -0
  128. data/vendor/twitter/bootstrap/sass/mixins/_nav-vertical-align.scss +9 -0
  129. data/vendor/twitter/bootstrap/sass/mixins/_opacity.scss +8 -0
  130. data/vendor/twitter/bootstrap/sass/mixins/_pagination.scss +23 -0
  131. data/vendor/twitter/bootstrap/sass/mixins/_panels.scss +24 -0
  132. data/vendor/twitter/bootstrap/sass/mixins/_progress-bar.scss +10 -0
  133. data/vendor/twitter/bootstrap/sass/mixins/_reset-filter.scss +8 -0
  134. data/vendor/twitter/bootstrap/sass/mixins/_resize.scss +6 -0
  135. data/vendor/twitter/bootstrap/sass/mixins/_responsive-visibility.scss +21 -0
  136. data/vendor/twitter/bootstrap/sass/mixins/_size.scss +10 -0
  137. data/vendor/twitter/bootstrap/sass/mixins/_tab-focus.scss +9 -0
  138. data/vendor/twitter/bootstrap/sass/mixins/_table-row.scss +28 -0
  139. data/vendor/twitter/bootstrap/sass/mixins/_text-emphasis.scss +11 -0
  140. data/vendor/twitter/bootstrap/sass/mixins/_text-overflow.scss +8 -0
  141. data/vendor/twitter/bootstrap/sass/mixins/_vendor-prefixes.scss +219 -0
  142. metadata +62 -2
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: affix.js v3.1.1
2
+ * Bootstrap: affix.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#affix
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -15,7 +15,8 @@
15
15
 
16
16
  var Affix = function (element, options) {
17
17
  this.options = $.extend({}, Affix.DEFAULTS, options)
18
- this.$window = $(window)
18
+
19
+ this.$target = $(this.options.target)
19
20
  .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
20
21
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
21
22
 
@@ -27,16 +28,19 @@
27
28
  this.checkPosition()
28
29
  }
29
30
 
30
- Affix.RESET = 'affix affix-top affix-bottom'
31
+ Affix.VERSION = '3.2.0'
32
+
33
+ Affix.RESET = 'affix affix-top affix-bottom'
31
34
 
32
35
  Affix.DEFAULTS = {
33
- offset: 0
36
+ offset: 0,
37
+ target: window
34
38
  }
35
39
 
36
40
  Affix.prototype.getPinnedOffset = function () {
37
41
  if (this.pinnedOffset) return this.pinnedOffset
38
42
  this.$element.removeClass(Affix.RESET).addClass('affix')
39
- var scrollTop = this.$window.scrollTop()
43
+ var scrollTop = this.$target.scrollTop()
40
44
  var position = this.$element.offset()
41
45
  return (this.pinnedOffset = position.top - scrollTop)
42
46
  }
@@ -49,14 +53,12 @@
49
53
  if (!this.$element.is(':visible')) return
50
54
 
51
55
  var scrollHeight = $(document).height()
52
- var scrollTop = this.$window.scrollTop()
56
+ var scrollTop = this.$target.scrollTop()
53
57
  var position = this.$element.offset()
54
58
  var offset = this.options.offset
55
59
  var offsetTop = offset.top
56
60
  var offsetBottom = offset.bottom
57
61
 
58
- if (this.affixed == 'top') position.top += scrollTop
59
-
60
62
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
61
63
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
62
64
  if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
@@ -66,7 +68,7 @@
66
68
  offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
67
69
 
68
70
  if (this.affixed === affix) return
69
- if (this.unpin) this.$element.css('top', '')
71
+ if (this.unpin != null) this.$element.css('top', '')
70
72
 
71
73
  var affixType = 'affix' + (affix ? '-' + affix : '')
72
74
  var e = $.Event(affixType + '.bs.affix')
@@ -84,7 +86,9 @@
84
86
  .trigger($.Event(affixType.replace('affix', 'affixed')))
85
87
 
86
88
  if (affix == 'bottom') {
87
- this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
89
+ this.$element.offset({
90
+ top: scrollHeight - this.$element.height() - offsetBottom
91
+ })
88
92
  }
89
93
  }
90
94
 
@@ -92,9 +96,7 @@
92
96
  // AFFIX PLUGIN DEFINITION
93
97
  // =======================
94
98
 
95
- var old = $.fn.affix
96
-
97
- $.fn.affix = function (option) {
99
+ function Plugin(option) {
98
100
  return this.each(function () {
99
101
  var $this = $(this)
100
102
  var data = $this.data('bs.affix')
@@ -105,6 +107,9 @@
105
107
  })
106
108
  }
107
109
 
110
+ var old = $.fn.affix
111
+
112
+ $.fn.affix = Plugin
108
113
  $.fn.affix.Constructor = Affix
109
114
 
110
115
 
@@ -130,7 +135,7 @@
130
135
  if (data.offsetBottom) data.offset.bottom = data.offsetBottom
131
136
  if (data.offsetTop) data.offset.top = data.offsetTop
132
137
 
133
- $spy.affix(data)
138
+ Plugin.call($spy, data)
134
139
  })
135
140
  })
136
141
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: alert.js v3.1.1
2
+ * Bootstrap: alert.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#alerts
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -18,6 +18,8 @@
18
18
  $(el).on('click', dismiss, this.close)
19
19
  }
20
20
 
21
+ Alert.VERSION = '3.2.0'
22
+
21
23
  Alert.prototype.close = function (e) {
22
24
  var $this = $(this)
23
25
  var selector = $this.attr('data-target')
@@ -42,12 +44,13 @@
42
44
  $parent.removeClass('in')
43
45
 
44
46
  function removeElement() {
45
- $parent.trigger('closed.bs.alert').remove()
47
+ // detach from parent, fire event then clean up data
48
+ $parent.detach().trigger('closed.bs.alert').remove()
46
49
  }
47
50
 
48
51
  $.support.transition && $parent.hasClass('fade') ?
49
52
  $parent
50
- .one($.support.transition.end, removeElement)
53
+ .one('bsTransitionEnd', removeElement)
51
54
  .emulateTransitionEnd(150) :
52
55
  removeElement()
53
56
  }
@@ -56,9 +59,7 @@
56
59
  // ALERT PLUGIN DEFINITION
57
60
  // =======================
58
61
 
59
- var old = $.fn.alert
60
-
61
- $.fn.alert = function (option) {
62
+ function Plugin(option) {
62
63
  return this.each(function () {
63
64
  var $this = $(this)
64
65
  var data = $this.data('bs.alert')
@@ -68,6 +69,9 @@
68
69
  })
69
70
  }
70
71
 
72
+ var old = $.fn.alert
73
+
74
+ $.fn.alert = Plugin
71
75
  $.fn.alert.Constructor = Alert
72
76
 
73
77
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: button.js v3.1.1
2
+ * Bootstrap: button.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#buttons
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -19,6 +19,8 @@
19
19
  this.isLoading = false
20
20
  }
21
21
 
22
+ Button.VERSION = '3.2.0'
23
+
22
24
  Button.DEFAULTS = {
23
25
  loadingText: 'loading...'
24
26
  }
@@ -31,9 +33,9 @@
31
33
 
32
34
  state = state + 'Text'
33
35
 
34
- if (!data.resetText) $el.data('resetText', $el[val]())
36
+ if (data.resetText == null) $el.data('resetText', $el[val]())
35
37
 
36
- $el[val](data[state] || this.options[state])
38
+ $el[val](data[state] == null ? this.options[state] : data[state])
37
39
 
38
40
  // push to event loop to allow forms to submit
39
41
  setTimeout($.proxy(function () {
@@ -67,9 +69,7 @@
67
69
  // BUTTON PLUGIN DEFINITION
68
70
  // ========================
69
71
 
70
- var old = $.fn.button
71
-
72
- $.fn.button = function (option) {
72
+ function Plugin(option) {
73
73
  return this.each(function () {
74
74
  var $this = $(this)
75
75
  var data = $this.data('bs.button')
@@ -82,6 +82,9 @@
82
82
  })
83
83
  }
84
84
 
85
+ var old = $.fn.button
86
+
87
+ $.fn.button = Plugin
85
88
  $.fn.button.Constructor = Button
86
89
 
87
90
 
@@ -97,10 +100,10 @@
97
100
  // BUTTON DATA-API
98
101
  // ===============
99
102
 
100
- $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
103
+ $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
101
104
  var $btn = $(e.target)
102
105
  if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
103
- $btn.button('toggle')
106
+ Plugin.call($btn, 'toggle')
104
107
  e.preventDefault()
105
108
  })
106
109
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: carousel.js v3.1.1
2
+ * Bootstrap: carousel.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#carousel
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -14,7 +14,7 @@
14
14
  // =========================
15
15
 
16
16
  var Carousel = function (element, options) {
17
- this.$element = $(element)
17
+ this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
18
18
  this.$indicators = this.$element.find('.carousel-indicators')
19
19
  this.options = options
20
20
  this.paused =
@@ -24,17 +24,29 @@
24
24
  this.$items = null
25
25
 
26
26
  this.options.pause == 'hover' && this.$element
27
- .on('mouseenter', $.proxy(this.pause, this))
28
- .on('mouseleave', $.proxy(this.cycle, this))
27
+ .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
28
+ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
29
29
  }
30
30
 
31
+ Carousel.VERSION = '3.2.0'
32
+
31
33
  Carousel.DEFAULTS = {
32
34
  interval: 5000,
33
35
  pause: 'hover',
34
36
  wrap: true
35
37
  }
36
38
 
37
- Carousel.prototype.cycle = function (e) {
39
+ Carousel.prototype.keydown = function (e) {
40
+ switch (e.which) {
41
+ case 37: this.prev(); break
42
+ case 39: this.next(); break
43
+ default: return
44
+ }
45
+
46
+ e.preventDefault()
47
+ }
48
+
49
+ Carousel.prototype.cycle = function (e) {
38
50
  e || (this.paused = false)
39
51
 
40
52
  this.interval && clearInterval(this.interval)
@@ -46,20 +58,18 @@
46
58
  return this
47
59
  }
48
60
 
49
- Carousel.prototype.getActiveIndex = function () {
50
- this.$active = this.$element.find('.item.active')
51
- this.$items = this.$active.parent().children()
52
-
53
- return this.$items.index(this.$active)
61
+ Carousel.prototype.getItemIndex = function (item) {
62
+ this.$items = item.parent().children('.item')
63
+ return this.$items.index(item || this.$active)
54
64
  }
55
65
 
56
66
  Carousel.prototype.to = function (pos) {
57
67
  var that = this
58
- var activeIndex = this.getActiveIndex()
68
+ var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
59
69
 
60
70
  if (pos > (this.$items.length - 1) || pos < 0) return
61
71
 
62
- if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
72
+ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
63
73
  if (activeIndex == pos) return this.pause().cycle()
64
74
 
65
75
  return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
@@ -101,11 +111,15 @@
101
111
  $next = this.$element.find('.item')[fallback]()
102
112
  }
103
113
 
104
- if ($next.hasClass('active')) return this.sliding = false
114
+ if ($next.hasClass('active')) return (this.sliding = false)
105
115
 
106
- var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
107
- this.$element.trigger(e)
108
- if (e.isDefaultPrevented()) return
116
+ var relatedTarget = $next[0]
117
+ var slideEvent = $.Event('slide.bs.carousel', {
118
+ relatedTarget: relatedTarget,
119
+ direction: direction
120
+ })
121
+ this.$element.trigger(slideEvent)
122
+ if (slideEvent.isDefaultPrevented()) return
109
123
 
110
124
  this.sliding = true
111
125
 
@@ -113,30 +127,31 @@
113
127
 
114
128
  if (this.$indicators.length) {
115
129
  this.$indicators.find('.active').removeClass('active')
116
- this.$element.one('slid.bs.carousel', function () {
117
- var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
118
- $nextIndicator && $nextIndicator.addClass('active')
119
- })
130
+ var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
131
+ $nextIndicator && $nextIndicator.addClass('active')
120
132
  }
121
133
 
134
+ var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
122
135
  if ($.support.transition && this.$element.hasClass('slide')) {
123
136
  $next.addClass(type)
124
137
  $next[0].offsetWidth // force reflow
125
138
  $active.addClass(direction)
126
139
  $next.addClass(direction)
127
140
  $active
128
- .one($.support.transition.end, function () {
141
+ .one('bsTransitionEnd', function () {
129
142
  $next.removeClass([type, direction].join(' ')).addClass('active')
130
143
  $active.removeClass(['active', direction].join(' '))
131
144
  that.sliding = false
132
- setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
145
+ setTimeout(function () {
146
+ that.$element.trigger(slidEvent)
147
+ }, 0)
133
148
  })
134
149
  .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
135
150
  } else {
136
151
  $active.removeClass('active')
137
152
  $next.addClass('active')
138
153
  this.sliding = false
139
- this.$element.trigger('slid.bs.carousel')
154
+ this.$element.trigger(slidEvent)
140
155
  }
141
156
 
142
157
  isCycling && this.cycle()
@@ -148,9 +163,7 @@
148
163
  // CAROUSEL PLUGIN DEFINITION
149
164
  // ==========================
150
165
 
151
- var old = $.fn.carousel
152
-
153
- $.fn.carousel = function (option) {
166
+ function Plugin(option) {
154
167
  return this.each(function () {
155
168
  var $this = $(this)
156
169
  var data = $this.data('bs.carousel')
@@ -164,6 +177,9 @@
164
177
  })
165
178
  }
166
179
 
180
+ var old = $.fn.carousel
181
+
182
+ $.fn.carousel = Plugin
167
183
  $.fn.carousel.Constructor = Carousel
168
184
 
169
185
 
@@ -180,15 +196,17 @@
180
196
  // =================
181
197
 
182
198
  $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
183
- var $this = $(this), href
184
- var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
199
+ var href
200
+ var $this = $(this)
201
+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
202
+ if (!$target.hasClass('carousel')) return
185
203
  var options = $.extend({}, $target.data(), $this.data())
186
204
  var slideIndex = $this.attr('data-slide-to')
187
205
  if (slideIndex) options.interval = false
188
206
 
189
- $target.carousel(options)
207
+ Plugin.call($target, options)
190
208
 
191
- if (slideIndex = $this.attr('data-slide-to')) {
209
+ if (slideIndex) {
192
210
  $target.data('bs.carousel').to(slideIndex)
193
211
  }
194
212
 
@@ -198,7 +216,7 @@
198
216
  $(window).on('load', function () {
199
217
  $('[data-ride="carousel"]').each(function () {
200
218
  var $carousel = $(this)
201
- $carousel.carousel($carousel.data())
219
+ Plugin.call($carousel, $carousel.data())
202
220
  })
203
221
  })
204
222
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: collapse.js v3.1.1
2
+ * Bootstrap: collapse.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#collapse
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -22,6 +22,8 @@
22
22
  if (this.options.toggle) this.toggle()
23
23
  }
24
24
 
25
+ Collapse.VERSION = '3.2.0'
26
+
25
27
  Collapse.DEFAULTS = {
26
28
  toggle: true
27
29
  }
@@ -43,7 +45,7 @@
43
45
  if (actives && actives.length) {
44
46
  var hasData = actives.data('bs.collapse')
45
47
  if (hasData && hasData.transitioning) return
46
- actives.collapse('hide')
48
+ Plugin.call(actives, 'hide')
47
49
  hasData || actives.data('bs.collapse', null)
48
50
  }
49
51
 
@@ -51,18 +53,17 @@
51
53
 
52
54
  this.$element
53
55
  .removeClass('collapse')
54
- .addClass('collapsing')
55
- [dimension](0)
56
+ .addClass('collapsing')[dimension](0)
56
57
 
57
58
  this.transitioning = 1
58
59
 
59
60
  var complete = function () {
60
61
  this.$element
61
62
  .removeClass('collapsing')
62
- .addClass('collapse in')
63
- [dimension]('auto')
63
+ .addClass('collapse in')[dimension]('')
64
64
  this.transitioning = 0
65
- this.$element.trigger('shown.bs.collapse')
65
+ this.$element
66
+ .trigger('shown.bs.collapse')
66
67
  }
67
68
 
68
69
  if (!$.support.transition) return complete.call(this)
@@ -70,9 +71,8 @@
70
71
  var scrollSize = $.camelCase(['scroll', dimension].join('-'))
71
72
 
72
73
  this.$element
73
- .one($.support.transition.end, $.proxy(complete, this))
74
- .emulateTransitionEnd(350)
75
- [dimension](this.$element[0][scrollSize])
74
+ .one('bsTransitionEnd', $.proxy(complete, this))
75
+ .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
76
76
  }
77
77
 
78
78
  Collapse.prototype.hide = function () {
@@ -84,9 +84,7 @@
84
84
 
85
85
  var dimension = this.dimension()
86
86
 
87
- this.$element
88
- [dimension](this.$element[dimension]())
89
- [0].offsetHeight
87
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight
90
88
 
91
89
  this.$element
92
90
  .addClass('collapsing')
@@ -107,7 +105,7 @@
107
105
 
108
106
  this.$element
109
107
  [dimension](0)
110
- .one($.support.transition.end, $.proxy(complete, this))
108
+ .one('bsTransitionEnd', $.proxy(complete, this))
111
109
  .emulateTransitionEnd(350)
112
110
  }
113
111
 
@@ -119,9 +117,7 @@
119
117
  // COLLAPSE PLUGIN DEFINITION
120
118
  // ==========================
121
119
 
122
- var old = $.fn.collapse
123
-
124
- $.fn.collapse = function (option) {
120
+ function Plugin(option) {
125
121
  return this.each(function () {
126
122
  var $this = $(this)
127
123
  var data = $this.data('bs.collapse')
@@ -133,6 +129,9 @@
133
129
  })
134
130
  }
135
131
 
132
+ var old = $.fn.collapse
133
+
134
+ $.fn.collapse = Plugin
136
135
  $.fn.collapse.Constructor = Collapse
137
136
 
138
137
 
@@ -148,11 +147,12 @@
148
147
  // COLLAPSE DATA-API
149
148
  // =================
150
149
 
151
- $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
152
- var $this = $(this), href
150
+ $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
151
+ var href
152
+ var $this = $(this)
153
153
  var target = $this.attr('data-target')
154
154
  || e.preventDefault()
155
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
155
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
156
156
  var $target = $(target)
157
157
  var data = $target.data('bs.collapse')
158
158
  var option = data ? 'toggle' : $this.data()
@@ -160,11 +160,11 @@
160
160
  var $parent = parent && $(parent)
161
161
 
162
162
  if (!data || !data.transitioning) {
163
- if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
163
+ if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
164
164
  $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
165
165
  }
166
166
 
167
- $target.collapse(option)
167
+ Plugin.call($target, option)
168
168
  })
169
169
 
170
170
  }(jQuery);