bootstrap-more 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +46 -0
  5. data/Rakefile +1 -0
  6. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  7. data/app/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  8. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  9. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  10. data/app/assets/javascripts/bootstrap/affix.js +126 -0
  11. data/app/assets/javascripts/bootstrap/alert.js +98 -0
  12. data/app/assets/javascripts/bootstrap/button.js +109 -0
  13. data/app/assets/javascripts/bootstrap/carousel.js +217 -0
  14. data/app/assets/javascripts/bootstrap/collapse.js +179 -0
  15. data/app/assets/javascripts/bootstrap/dropdown.js +154 -0
  16. data/app/assets/javascripts/bootstrap/modal.js +246 -0
  17. data/app/assets/javascripts/bootstrap/popover.js +117 -0
  18. data/app/assets/javascripts/bootstrap/scrollspy.js +158 -0
  19. data/app/assets/javascripts/bootstrap/tab.js +135 -0
  20. data/app/assets/javascripts/bootstrap/tooltip.js +386 -0
  21. data/app/assets/javascripts/bootstrap/transition.js +56 -0
  22. data/app/assets/javascripts/bootstrap.js +12 -0
  23. data/app/assets/stylesheets/_bootstrap-more.scss +1 -0
  24. data/app/assets/stylesheets/bootstrap/_alerts.scss +67 -0
  25. data/app/assets/stylesheets/bootstrap/_badges.scss +51 -0
  26. data/app/assets/stylesheets/bootstrap/_breadcrumbs.scss +23 -0
  27. data/app/assets/stylesheets/bootstrap/_button-groups.scss +260 -0
  28. data/app/assets/stylesheets/bootstrap/_buttons.scss +165 -0
  29. data/app/assets/stylesheets/bootstrap/_carousel.scss +231 -0
  30. data/app/assets/stylesheets/bootstrap/_close.scss +35 -0
  31. data/app/assets/stylesheets/bootstrap/_code.scss +53 -0
  32. data/app/assets/stylesheets/bootstrap/_component-animations.scss +29 -0
  33. data/app/assets/stylesheets/bootstrap/_config.scss +19 -0
  34. data/app/assets/stylesheets/bootstrap/_dropdowns.scss +203 -0
  35. data/app/assets/stylesheets/bootstrap/_forms.scss +371 -0
  36. data/app/assets/stylesheets/bootstrap/_glyphicons.scss +237 -0
  37. data/app/assets/stylesheets/bootstrap/_grid.scss +93 -0
  38. data/app/assets/stylesheets/bootstrap/_input-groups.scss +146 -0
  39. data/app/assets/stylesheets/bootstrap/_jumbotron.scss +40 -0
  40. data/app/assets/stylesheets/bootstrap/_labels.scss +58 -0
  41. data/app/assets/stylesheets/bootstrap/_list-group.scss +95 -0
  42. data/app/assets/stylesheets/bootstrap/_media.scss +56 -0
  43. data/app/assets/stylesheets/bootstrap/_mixins.scss +882 -0
  44. data/app/assets/stylesheets/bootstrap/_modals.scss +132 -0
  45. data/app/assets/stylesheets/bootstrap/_navbar.scss +628 -0
  46. data/app/assets/stylesheets/bootstrap/_navs.scss +262 -0
  47. data/app/assets/stylesheets/bootstrap/_normalize.scss +406 -0
  48. data/app/assets/stylesheets/bootstrap/_pager.scss +55 -0
  49. data/app/assets/stylesheets/bootstrap/_pagination.scss +85 -0
  50. data/app/assets/stylesheets/bootstrap/_panels.scss +172 -0
  51. data/app/assets/stylesheets/bootstrap/_popovers.scss +133 -0
  52. data/app/assets/stylesheets/bootstrap/_print.scss +105 -0
  53. data/app/assets/stylesheets/bootstrap/_progress-bars.scss +92 -0
  54. data/app/assets/stylesheets/bootstrap/_responsive-utilities.scss +198 -0
  55. data/app/assets/stylesheets/bootstrap/_scaffolding.scss +119 -0
  56. data/app/assets/stylesheets/bootstrap/_tables.scss +244 -0
  57. data/app/assets/stylesheets/bootstrap/_theme.scss +247 -0
  58. data/app/assets/stylesheets/bootstrap/_thumbnails.scss +32 -0
  59. data/app/assets/stylesheets/bootstrap/_tooltip.scss +95 -0
  60. data/app/assets/stylesheets/bootstrap/_type.scss +279 -0
  61. data/app/assets/stylesheets/bootstrap/_utilities.scss +56 -0
  62. data/app/assets/stylesheets/bootstrap/_variables.scss +665 -0
  63. data/app/assets/stylesheets/bootstrap/_wells.scss +29 -0
  64. data/app/assets/stylesheets/bootstrap/bootstrap.scss +50 -0
  65. data/bootstrap-more.gemspec +23 -0
  66. data/docs/.gitignore +17 -0
  67. data/docs/.ruby-gemset +1 -0
  68. data/docs/.ruby-version +1 -0
  69. data/docs/Gemfile +9 -0
  70. data/docs/README.md +8 -0
  71. data/docs/Rakefile +1 -0
  72. data/docs/config.rb +98 -0
  73. data/docs/index.html.erb +9 -0
  74. data/docs/source/about.html.erb +92 -0
  75. data/docs/source/assets/javascripts/application.js +103 -0
  76. data/docs/source/assets/javascripts/bootstrap.js +12 -0
  77. data/docs/source/assets/javascripts/vendor/.gitkeep +0 -0
  78. data/docs/source/assets/javascripts/vendor/holder.js +404 -0
  79. data/docs/source/assets/javascripts/vendor/ie8-responsive-file-warning.js +12 -0
  80. data/docs/source/assets/stylesheets/_settings.scss +656 -0
  81. data/docs/source/assets/stylesheets/bootstrap.scss +2 -0
  82. data/docs/source/assets/stylesheets/pygments-manni.css +66 -0
  83. data/docs/source/assets/stylesheets/styles.scss +1198 -0
  84. data/docs/source/components.html.erb +3607 -0
  85. data/docs/source/css.html.erb +2585 -0
  86. data/docs/source/customize.html.erb +1715 -0
  87. data/docs/source/getting-started.html.erb +1010 -0
  88. data/docs/source/includes/_ads.erb +1 -0
  89. data/docs/source/includes/_footer.erb +23 -0
  90. data/docs/source/includes/_header.erb +39 -0
  91. data/docs/source/includes/_nav-about.erb +12 -0
  92. data/docs/source/includes/_nav-components.erb +137 -0
  93. data/docs/source/includes/_nav-css.erb +99 -0
  94. data/docs/source/includes/_nav-customize.erb +40 -0
  95. data/docs/source/includes/_nav-getting-started.erb +44 -0
  96. data/docs/source/includes/_nav-javascript.erb +88 -0
  97. data/docs/source/includes/_nav-main.erb +34 -0
  98. data/docs/source/includes/_old-bs-docs.erb +8 -0
  99. data/docs/source/includes/_social-buttons.erb +16 -0
  100. data/docs/source/index.html.erb +17 -0
  101. data/docs/source/javascript.html.erb +1946 -0
  102. data/docs/source/layouts/default.html.erb +75 -0
  103. data/docs/source/layouts/home.html.erb +20 -0
  104. data/docs/source/layouts/layout.html.erb +81 -0
  105. data/lib/bootstrap-more/version.rb +5 -0
  106. data/lib/bootstrap-more.rb +7 -0
  107. metadata +185 -0
@@ -0,0 +1,98 @@
1
+ /* ========================================================================
2
+ * Bootstrap: alert.js v3.0.2
3
+ * http://getbootstrap.com/javascript/#alerts
4
+ * ========================================================================
5
+ * Copyright 2013 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // ALERT CLASS DEFINITION
24
+ // ======================
25
+
26
+ var dismiss = '[data-dismiss="alert"]'
27
+ var Alert = function (el) {
28
+ $(el).on('click', dismiss, this.close)
29
+ }
30
+
31
+ Alert.prototype.close = function (e) {
32
+ var $this = $(this)
33
+ var selector = $this.attr('data-target')
34
+
35
+ if (!selector) {
36
+ selector = $this.attr('href')
37
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
38
+ }
39
+
40
+ var $parent = $(selector)
41
+
42
+ if (e) e.preventDefault()
43
+
44
+ if (!$parent.length) {
45
+ $parent = $this.hasClass('alert') ? $this : $this.parent()
46
+ }
47
+
48
+ $parent.trigger(e = $.Event('close.bs.alert'))
49
+
50
+ if (e.isDefaultPrevented()) return
51
+
52
+ $parent.removeClass('in')
53
+
54
+ function removeElement() {
55
+ $parent.trigger('closed.bs.alert').remove()
56
+ }
57
+
58
+ $.support.transition && $parent.hasClass('fade') ?
59
+ $parent
60
+ .one($.support.transition.end, removeElement)
61
+ .emulateTransitionEnd(150) :
62
+ removeElement()
63
+ }
64
+
65
+
66
+ // ALERT PLUGIN DEFINITION
67
+ // =======================
68
+
69
+ var old = $.fn.alert
70
+
71
+ $.fn.alert = function (option) {
72
+ return this.each(function () {
73
+ var $this = $(this)
74
+ var data = $this.data('bs.alert')
75
+
76
+ if (!data) $this.data('bs.alert', (data = new Alert(this)))
77
+ if (typeof option == 'string') data[option].call($this)
78
+ })
79
+ }
80
+
81
+ $.fn.alert.Constructor = Alert
82
+
83
+
84
+ // ALERT NO CONFLICT
85
+ // =================
86
+
87
+ $.fn.alert.noConflict = function () {
88
+ $.fn.alert = old
89
+ return this
90
+ }
91
+
92
+
93
+ // ALERT DATA-API
94
+ // ==============
95
+
96
+ $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
97
+
98
+ }(jQuery);
@@ -0,0 +1,109 @@
1
+ /* ========================================================================
2
+ * Bootstrap: button.js v3.0.2
3
+ * http://getbootstrap.com/javascript/#buttons
4
+ * ========================================================================
5
+ * Copyright 2013 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // BUTTON PUBLIC CLASS DEFINITION
24
+ // ==============================
25
+
26
+ var Button = function (element, options) {
27
+ this.$element = $(element)
28
+ this.options = $.extend({}, Button.DEFAULTS, options)
29
+ }
30
+
31
+ Button.DEFAULTS = {
32
+ loadingText: 'loading...'
33
+ }
34
+
35
+ Button.prototype.setState = function (state) {
36
+ var d = 'disabled'
37
+ var $el = this.$element
38
+ var val = $el.is('input') ? 'val' : 'html'
39
+ var data = $el.data()
40
+
41
+ state = state + 'Text'
42
+
43
+ if (!data.resetText) $el.data('resetText', $el[val]())
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
+ Button.prototype.toggle = function () {
56
+ var $parent = this.$element.closest('[data-toggle="buttons"]')
57
+
58
+ if ($parent.length) {
59
+ var $input = this.$element.find('input')
60
+ .prop('checked', !this.$element.hasClass('active'))
61
+ .trigger('change')
62
+ if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
63
+ }
64
+
65
+ this.$element.toggleClass('active')
66
+ }
67
+
68
+
69
+ // BUTTON PLUGIN DEFINITION
70
+ // ========================
71
+
72
+ var old = $.fn.button
73
+
74
+ $.fn.button = function (option) {
75
+ return this.each(function () {
76
+ var $this = $(this)
77
+ var data = $this.data('bs.button')
78
+ var options = typeof option == 'object' && option
79
+
80
+ if (!data) $this.data('bs.button', (data = new Button(this, options)))
81
+
82
+ if (option == 'toggle') data.toggle()
83
+ else if (option) data.setState(option)
84
+ })
85
+ }
86
+
87
+ $.fn.button.Constructor = Button
88
+
89
+
90
+ // BUTTON NO CONFLICT
91
+ // ==================
92
+
93
+ $.fn.button.noConflict = function () {
94
+ $.fn.button = old
95
+ return this
96
+ }
97
+
98
+
99
+ // BUTTON DATA-API
100
+ // ===============
101
+
102
+ $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
103
+ var $btn = $(e.target)
104
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
105
+ $btn.button('toggle')
106
+ e.preventDefault()
107
+ })
108
+
109
+ }(jQuery);
@@ -0,0 +1,217 @@
1
+ /* ========================================================================
2
+ * Bootstrap: carousel.js v3.0.2
3
+ * http://getbootstrap.com/javascript/#carousel
4
+ * ========================================================================
5
+ * Copyright 2013 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // CAROUSEL CLASS DEFINITION
24
+ // =========================
25
+
26
+ var Carousel = function (element, options) {
27
+ this.$element = $(element)
28
+ this.$indicators = this.$element.find('.carousel-indicators')
29
+ this.options = options
30
+ this.paused =
31
+ this.sliding =
32
+ this.interval =
33
+ this.$active =
34
+ this.$items = null
35
+
36
+ this.options.pause == 'hover' && this.$element
37
+ .on('mouseenter', $.proxy(this.pause, this))
38
+ .on('mouseleave', $.proxy(this.cycle, this))
39
+ }
40
+
41
+ Carousel.DEFAULTS = {
42
+ interval: 5000
43
+ , pause: 'hover'
44
+ , wrap: true
45
+ }
46
+
47
+ Carousel.prototype.cycle = function (e) {
48
+ e || (this.paused = false)
49
+
50
+ this.interval && clearInterval(this.interval)
51
+
52
+ this.options.interval
53
+ && !this.paused
54
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
55
+
56
+ return this
57
+ }
58
+
59
+ Carousel.prototype.getActiveIndex = function () {
60
+ this.$active = this.$element.find('.item.active')
61
+ this.$items = this.$active.parent().children()
62
+
63
+ return this.$items.index(this.$active)
64
+ }
65
+
66
+ Carousel.prototype.to = function (pos) {
67
+ var that = this
68
+ var activeIndex = this.getActiveIndex()
69
+
70
+ if (pos > (this.$items.length - 1) || pos < 0) return
71
+
72
+ if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
73
+ if (activeIndex == pos) return this.pause().cycle()
74
+
75
+ return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
76
+ }
77
+
78
+ Carousel.prototype.pause = function (e) {
79
+ e || (this.paused = true)
80
+
81
+ if (this.$element.find('.next, .prev').length && $.support.transition.end) {
82
+ this.$element.trigger($.support.transition.end)
83
+ this.cycle(true)
84
+ }
85
+
86
+ this.interval = clearInterval(this.interval)
87
+
88
+ return this
89
+ }
90
+
91
+ Carousel.prototype.next = function () {
92
+ if (this.sliding) return
93
+ return this.slide('next')
94
+ }
95
+
96
+ Carousel.prototype.prev = function () {
97
+ if (this.sliding) return
98
+ return this.slide('prev')
99
+ }
100
+
101
+ Carousel.prototype.slide = function (type, next) {
102
+ var $active = this.$element.find('.item.active')
103
+ var $next = next || $active[type]()
104
+ var isCycling = this.interval
105
+ var direction = type == 'next' ? 'left' : 'right'
106
+ var fallback = type == 'next' ? 'first' : 'last'
107
+ var that = this
108
+
109
+ if (!$next.length) {
110
+ if (!this.options.wrap) return
111
+ $next = this.$element.find('.item')[fallback]()
112
+ }
113
+
114
+ this.sliding = true
115
+
116
+ isCycling && this.pause()
117
+
118
+ var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
119
+
120
+ if ($next.hasClass('active')) return
121
+
122
+ if (this.$indicators.length) {
123
+ this.$indicators.find('.active').removeClass('active')
124
+ this.$element.one('slid', function () {
125
+ var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
126
+ $nextIndicator && $nextIndicator.addClass('active')
127
+ })
128
+ }
129
+
130
+ if ($.support.transition && this.$element.hasClass('slide')) {
131
+ this.$element.trigger(e)
132
+ if (e.isDefaultPrevented()) return
133
+ $next.addClass(type)
134
+ $next[0].offsetWidth // force reflow
135
+ $active.addClass(direction)
136
+ $next.addClass(direction)
137
+ $active
138
+ .one($.support.transition.end, function () {
139
+ $next.removeClass([type, direction].join(' ')).addClass('active')
140
+ $active.removeClass(['active', direction].join(' '))
141
+ that.sliding = false
142
+ setTimeout(function () { that.$element.trigger('slid') }, 0)
143
+ })
144
+ .emulateTransitionEnd(600)
145
+ } else {
146
+ this.$element.trigger(e)
147
+ if (e.isDefaultPrevented()) return
148
+ $active.removeClass('active')
149
+ $next.addClass('active')
150
+ this.sliding = false
151
+ this.$element.trigger('slid')
152
+ }
153
+
154
+ isCycling && this.cycle()
155
+
156
+ return this
157
+ }
158
+
159
+
160
+ // CAROUSEL PLUGIN DEFINITION
161
+ // ==========================
162
+
163
+ var old = $.fn.carousel
164
+
165
+ $.fn.carousel = function (option) {
166
+ return this.each(function () {
167
+ var $this = $(this)
168
+ var data = $this.data('bs.carousel')
169
+ var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
170
+ var action = typeof option == 'string' ? option : options.slide
171
+
172
+ if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
173
+ if (typeof option == 'number') data.to(option)
174
+ else if (action) data[action]()
175
+ else if (options.interval) data.pause().cycle()
176
+ })
177
+ }
178
+
179
+ $.fn.carousel.Constructor = Carousel
180
+
181
+
182
+ // CAROUSEL NO CONFLICT
183
+ // ====================
184
+
185
+ $.fn.carousel.noConflict = function () {
186
+ $.fn.carousel = old
187
+ return this
188
+ }
189
+
190
+
191
+ // CAROUSEL DATA-API
192
+ // =================
193
+
194
+ $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
195
+ var $this = $(this), href
196
+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
197
+ var options = $.extend({}, $target.data(), $this.data())
198
+ var slideIndex = $this.attr('data-slide-to')
199
+ if (slideIndex) options.interval = false
200
+
201
+ $target.carousel(options)
202
+
203
+ if (slideIndex = $this.attr('data-slide-to')) {
204
+ $target.data('bs.carousel').to(slideIndex)
205
+ }
206
+
207
+ e.preventDefault()
208
+ })
209
+
210
+ $(window).on('load', function () {
211
+ $('[data-ride="carousel"]').each(function () {
212
+ var $carousel = $(this)
213
+ $carousel.carousel($carousel.data())
214
+ })
215
+ })
216
+
217
+ }(jQuery);
@@ -0,0 +1,179 @@
1
+ /* ========================================================================
2
+ * Bootstrap: collapse.js v3.0.2
3
+ * http://getbootstrap.com/javascript/#collapse
4
+ * ========================================================================
5
+ * Copyright 2013 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // COLLAPSE PUBLIC CLASS DEFINITION
24
+ // ================================
25
+
26
+ var Collapse = function (element, options) {
27
+ this.$element = $(element)
28
+ this.options = $.extend({}, Collapse.DEFAULTS, options)
29
+ this.transitioning = null
30
+
31
+ if (this.options.parent) this.$parent = $(this.options.parent)
32
+ if (this.options.toggle) this.toggle()
33
+ }
34
+
35
+ Collapse.DEFAULTS = {
36
+ toggle: true
37
+ }
38
+
39
+ Collapse.prototype.dimension = function () {
40
+ var hasWidth = this.$element.hasClass('width')
41
+ return hasWidth ? 'width' : 'height'
42
+ }
43
+
44
+ Collapse.prototype.show = function () {
45
+ if (this.transitioning || this.$element.hasClass('in')) return
46
+
47
+ var startEvent = $.Event('show.bs.collapse')
48
+ this.$element.trigger(startEvent)
49
+ if (startEvent.isDefaultPrevented()) return
50
+
51
+ var actives = this.$parent && this.$parent.find('> .panel > .in')
52
+
53
+ if (actives && actives.length) {
54
+ var hasData = actives.data('bs.collapse')
55
+ if (hasData && hasData.transitioning) return
56
+ actives.collapse('hide')
57
+ hasData || actives.data('bs.collapse', null)
58
+ }
59
+
60
+ var dimension = this.dimension()
61
+
62
+ this.$element
63
+ .removeClass('collapse')
64
+ .addClass('collapsing')
65
+ [dimension](0)
66
+
67
+ this.transitioning = 1
68
+
69
+ var complete = function () {
70
+ this.$element
71
+ .removeClass('collapsing')
72
+ .addClass('in')
73
+ [dimension]('auto')
74
+ this.transitioning = 0
75
+ this.$element.trigger('shown.bs.collapse')
76
+ }
77
+
78
+ if (!$.support.transition) return complete.call(this)
79
+
80
+ var scrollSize = $.camelCase(['scroll', dimension].join('-'))
81
+
82
+ this.$element
83
+ .one($.support.transition.end, $.proxy(complete, this))
84
+ .emulateTransitionEnd(350)
85
+ [dimension](this.$element[0][scrollSize])
86
+ }
87
+
88
+ Collapse.prototype.hide = function () {
89
+ if (this.transitioning || !this.$element.hasClass('in')) return
90
+
91
+ var startEvent = $.Event('hide.bs.collapse')
92
+ this.$element.trigger(startEvent)
93
+ if (startEvent.isDefaultPrevented()) return
94
+
95
+ var dimension = this.dimension()
96
+
97
+ this.$element
98
+ [dimension](this.$element[dimension]())
99
+ [0].offsetHeight
100
+
101
+ this.$element
102
+ .addClass('collapsing')
103
+ .removeClass('collapse')
104
+ .removeClass('in')
105
+
106
+ this.transitioning = 1
107
+
108
+ var complete = function () {
109
+ this.transitioning = 0
110
+ this.$element
111
+ .trigger('hidden.bs.collapse')
112
+ .removeClass('collapsing')
113
+ .addClass('collapse')
114
+ }
115
+
116
+ if (!$.support.transition) return complete.call(this)
117
+
118
+ this.$element
119
+ [dimension](0)
120
+ .one($.support.transition.end, $.proxy(complete, this))
121
+ .emulateTransitionEnd(350)
122
+ }
123
+
124
+ Collapse.prototype.toggle = function () {
125
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
126
+ }
127
+
128
+
129
+ // COLLAPSE PLUGIN DEFINITION
130
+ // ==========================
131
+
132
+ var old = $.fn.collapse
133
+
134
+ $.fn.collapse = function (option) {
135
+ return this.each(function () {
136
+ var $this = $(this)
137
+ var data = $this.data('bs.collapse')
138
+ var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
139
+
140
+ if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
141
+ if (typeof option == 'string') data[option]()
142
+ })
143
+ }
144
+
145
+ $.fn.collapse.Constructor = Collapse
146
+
147
+
148
+ // COLLAPSE NO CONFLICT
149
+ // ====================
150
+
151
+ $.fn.collapse.noConflict = function () {
152
+ $.fn.collapse = old
153
+ return this
154
+ }
155
+
156
+
157
+ // COLLAPSE DATA-API
158
+ // =================
159
+
160
+ $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
161
+ var $this = $(this), href
162
+ var target = $this.attr('data-target')
163
+ || e.preventDefault()
164
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
165
+ var $target = $(target)
166
+ var data = $target.data('bs.collapse')
167
+ var option = data ? 'toggle' : $this.data()
168
+ var parent = $this.attr('data-parent')
169
+ var $parent = parent && $(parent)
170
+
171
+ if (!data || !data.transitioning) {
172
+ if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
173
+ $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
174
+ }
175
+
176
+ $target.collapse(option)
177
+ })
178
+
179
+ }(jQuery);