rails_admin 0.6.5 → 0.6.6

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

Potentially problematic release.


This version of rails_admin might be problematic. Click here for more details.

Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js +99 -74
  3. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js +48 -55
  4. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-button.js +70 -65
  5. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-carousel.js +163 -147
  6. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-collapse.js +117 -114
  7. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-dropdown.js +89 -107
  8. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-modal.js +208 -175
  9. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-popover.js +77 -78
  10. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-scrollspy.js +137 -129
  11. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-tab.js +85 -101
  12. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-tooltip.js +364 -268
  13. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js +51 -52
  14. data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-typeahead.js +1782 -335
  15. data/app/assets/javascripts/rails_admin/ra.filter-box.js +1 -1
  16. data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +3 -3
  17. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +1 -1
  18. data/app/assets/javascripts/rails_admin/ra.remote-form.js +6 -2
  19. data/app/assets/stylesheets/rails_admin/base/theming.scss +34 -14
  20. data/app/assets/stylesheets/rails_admin/bootstrap/_alerts.scss +47 -58
  21. data/app/assets/stylesheets/rails_admin/bootstrap/_badges.scss +57 -0
  22. data/app/assets/stylesheets/rails_admin/bootstrap/_breadcrumbs.scss +12 -10
  23. data/app/assets/stylesheets/rails_admin/bootstrap/_button-groups.scss +163 -152
  24. data/app/assets/stylesheets/rails_admin/bootstrap/_buttons.scss +98 -169
  25. data/app/assets/stylesheets/rails_admin/bootstrap/_carousel.scss +151 -66
  26. data/app/assets/stylesheets/rails_admin/bootstrap/_close.scss +11 -8
  27. data/app/assets/stylesheets/rails_admin/bootstrap/_code.scss +36 -29
  28. data/app/assets/stylesheets/rails_admin/bootstrap/_component-animations.scss +16 -3
  29. data/app/assets/stylesheets/rails_admin/bootstrap/_dropdowns.scss +115 -148
  30. data/app/assets/stylesheets/rails_admin/bootstrap/_forms.scss +396 -547
  31. data/app/assets/stylesheets/rails_admin/bootstrap/_glyphicons.scss +237 -0
  32. data/app/assets/stylesheets/rails_admin/bootstrap/_grid.scss +74 -11
  33. data/app/assets/stylesheets/rails_admin/bootstrap/_input-groups.scss +166 -0
  34. data/app/assets/stylesheets/rails_admin/bootstrap/_jumbotron.scss +48 -0
  35. data/app/assets/stylesheets/rails_admin/bootstrap/_labels.scss +66 -0
  36. data/app/assets/stylesheets/rails_admin/bootstrap/_list-group.scss +131 -0
  37. data/app/assets/stylesheets/rails_admin/bootstrap/_media.scss +8 -7
  38. data/app/assets/stylesheets/rails_admin/bootstrap/_mixins.scss +36 -693
  39. data/app/assets/stylesheets/rails_admin/bootstrap/_modals.scss +108 -53
  40. data/app/assets/stylesheets/rails_admin/bootstrap/_navbar.scss +545 -383
  41. data/app/assets/stylesheets/rails_admin/bootstrap/_navs.scss +191 -358
  42. data/app/assets/stylesheets/rails_admin/bootstrap/_normalize.scss +425 -0
  43. data/app/assets/stylesheets/rails_admin/bootstrap/_pager.scss +45 -33
  44. data/app/assets/stylesheets/rails_admin/bootstrap/_pagination.scss +70 -105
  45. data/app/assets/stylesheets/rails_admin/bootstrap/_panels.scss +243 -0
  46. data/app/assets/stylesheets/rails_admin/bootstrap/_popovers.scss +61 -61
  47. data/app/assets/stylesheets/rails_admin/bootstrap/_print.scss +101 -0
  48. data/app/assets/stylesheets/rails_admin/bootstrap/_progress-bars.scss +56 -73
  49. data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-embed.scss +34 -0
  50. data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-utilities.scss +150 -50
  51. data/app/assets/stylesheets/rails_admin/bootstrap/_scaffolding.scss +120 -23
  52. data/app/assets/stylesheets/rails_admin/bootstrap/_tables.scss +168 -170
  53. data/app/assets/stylesheets/rails_admin/bootstrap/_theme.scss +258 -0
  54. data/app/assets/stylesheets/rails_admin/bootstrap/_thumbnails.scss +27 -42
  55. data/app/assets/stylesheets/rails_admin/bootstrap/_tooltip.scss +49 -24
  56. data/app/assets/stylesheets/rails_admin/bootstrap/_type.scss +200 -143
  57. data/app/assets/stylesheets/rails_admin/bootstrap/_utilities.scss +33 -21
  58. data/app/assets/stylesheets/rails_admin/bootstrap/_variables.scss +764 -215
  59. data/app/assets/stylesheets/rails_admin/bootstrap/_wells.scss +7 -7
  60. data/app/assets/stylesheets/rails_admin/bootstrap/bootstrap.scss +47 -60
  61. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_alerts.scss +14 -0
  62. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_background-variant.scss +11 -0
  63. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_border-radius.scss +18 -0
  64. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_buttons.scss +50 -0
  65. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_center-block.scss +7 -0
  66. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_clearfix.scss +22 -0
  67. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_forms.scss +84 -0
  68. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_gradients.scss +58 -0
  69. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_grid-framework.scss +81 -0
  70. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_grid.scss +122 -0
  71. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_hide-text.scss +21 -0
  72. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_image.scss +34 -0
  73. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_labels.scss +12 -0
  74. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_list-group.scss +31 -0
  75. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-divider.scss +10 -0
  76. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  77. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_opacity.scss +8 -0
  78. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_pagination.scss +23 -0
  79. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_panels.scss +24 -0
  80. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_progress-bar.scss +10 -0
  81. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_reset-filter.scss +8 -0
  82. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_resize.scss +6 -0
  83. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_responsive-visibility.scss +21 -0
  84. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_size.scss +10 -0
  85. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_tab-focus.scss +9 -0
  86. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_table-row.scss +28 -0
  87. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_text-emphasis.scss +11 -0
  88. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_text-overflow.scss +8 -0
  89. data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_vendor-prefixes.scss +219 -0
  90. data/app/assets/stylesheets/rails_admin/ra.calendar-additions.scss +17 -0
  91. data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +9 -5
  92. data/app/helpers/rails_admin/application_helper.rb +20 -19
  93. data/app/helpers/rails_admin/form_builder.rb +14 -11
  94. data/app/views/kaminari/twitter-bootstrap/_paginator.html.haml +8 -9
  95. data/app/views/layouts/rails_admin/_navigation.html.haml +5 -5
  96. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +1 -1
  97. data/app/views/layouts/rails_admin/application.html.haml +9 -8
  98. data/app/views/layouts/rails_admin/pjax.html.haml +4 -3
  99. data/app/views/rails_admin/main/_form_datetime.html.haml +2 -1
  100. data/app/views/rails_admin/main/_form_field.html.haml +1 -1
  101. data/app/views/rails_admin/main/_form_text.html.haml +1 -1
  102. data/app/views/rails_admin/main/_submit_buttons.html.haml +1 -0
  103. data/app/views/rails_admin/main/dashboard.html.haml +1 -1
  104. data/app/views/rails_admin/main/export.html.haml +19 -16
  105. data/app/views/rails_admin/main/index.html.haml +11 -7
  106. data/app/views/rails_admin/main/show.html.haml +1 -1
  107. data/lib/rails_admin/adapters/active_record.rb +2 -2
  108. data/lib/rails_admin/adapters/mongoid/property.rb +1 -1
  109. data/lib/rails_admin/config/actions/bulk_delete.rb +0 -1
  110. data/lib/rails_admin/config/actions/edit.rb +0 -2
  111. data/lib/rails_admin/config/actions/export.rb +0 -2
  112. data/lib/rails_admin/config/actions/index.rb +0 -3
  113. data/lib/rails_admin/config/actions/new.rb +0 -2
  114. data/lib/rails_admin/config/configurable.rb +1 -1
  115. data/lib/rails_admin/config/fields/base.rb +9 -0
  116. data/lib/rails_admin/config/fields/factories/enum.rb +2 -3
  117. data/lib/rails_admin/config/fields/types/polymorphic_association.rb +4 -0
  118. data/lib/rails_admin/config/model.rb +2 -1
  119. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +2 -2
  120. data/lib/rails_admin/support/csv_converter.rb +22 -42
  121. data/lib/rails_admin/version.rb +1 -1
  122. metadata +59 -18
  123. data/app/assets/stylesheets/rails_admin/bootstrap/_accordion.scss +0 -34
  124. data/app/assets/stylesheets/rails_admin/bootstrap/_hero-unit.scss +0 -25
  125. data/app/assets/stylesheets/rails_admin/bootstrap/_labels-badges.scss +0 -83
  126. data/app/assets/stylesheets/rails_admin/bootstrap/_layouts.scss +0 -16
  127. data/app/assets/stylesheets/rails_admin/bootstrap/_reset.scss +0 -216
  128. data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-1200px-min.scss +0 -28
  129. data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-767px-max.scss +0 -193
  130. data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-768px-979px.scss +0 -19
  131. data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-navbar.scss +0 -189
  132. data/app/assets/stylesheets/rails_admin/bootstrap/_sprites.scss +0 -197
  133. data/app/assets/stylesheets/rails_admin/bootstrap/responsive.scss +0 -48
@@ -1,207 +1,223 @@
1
- /* ==========================================================
2
- * bootstrap-carousel.js v2.3.2
3
- * http://getbootstrap.com/2.3.2/javascript.html#carousel
4
- * ==========================================================
5
- * Copyright 2012 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 ($) {
22
-
23
- "use strict"; // jshint ;_;
24
-
25
-
26
- /* CAROUSEL CLASS DEFINITION
27
- * ========================= */
1
+ /* ========================================================================
2
+ * Bootstrap: carousel.js v3.2.0
3
+ * http://getbootstrap.com/javascript/#carousel
4
+ * ========================================================================
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // CAROUSEL CLASS DEFINITION
14
+ // =========================
28
15
 
29
16
  var Carousel = function (element, options) {
30
- this.$element = $(element)
17
+ this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
31
18
  this.$indicators = this.$element.find('.carousel-indicators')
32
- this.options = options
19
+ this.options = options
20
+ this.paused =
21
+ this.sliding =
22
+ this.interval =
23
+ this.$active =
24
+ this.$items = null
25
+
33
26
  this.options.pause == 'hover' && this.$element
34
- .on('mouseenter', $.proxy(this.pause, this))
35
- .on('mouseleave', $.proxy(this.cycle, this))
27
+ .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
28
+ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
36
29
  }
37
30
 
38
- Carousel.prototype = {
31
+ Carousel.VERSION = '3.2.0'
39
32
 
40
- cycle: function (e) {
41
- if (!e) this.paused = false
42
- if (this.interval) clearInterval(this.interval);
43
- this.options.interval
44
- && !this.paused
45
- && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
46
- return this
47
- }
33
+ Carousel.DEFAULTS = {
34
+ interval: 5000,
35
+ pause: 'hover',
36
+ wrap: true
37
+ }
48
38
 
49
- , getActiveIndex: function () {
50
- this.$active = this.$element.find('.item.active')
51
- this.$items = this.$active.parent().children()
52
- return this.$items.index(this.$active)
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
53
44
  }
54
45
 
55
- , to: function (pos) {
56
- var activeIndex = this.getActiveIndex()
57
- , that = this
46
+ e.preventDefault()
47
+ }
58
48
 
59
- if (pos > (this.$items.length - 1) || pos < 0) return
49
+ Carousel.prototype.cycle = function (e) {
50
+ e || (this.paused = false)
60
51
 
61
- if (this.sliding) {
62
- return this.$element.one('slid', function () {
63
- that.to(pos)
64
- })
65
- }
52
+ this.interval && clearInterval(this.interval)
66
53
 
67
- if (activeIndex == pos) {
68
- return this.pause().cycle()
69
- }
54
+ this.options.interval
55
+ && !this.paused
56
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
70
57
 
71
- return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
72
- }
58
+ return this
59
+ }
73
60
 
74
- , pause: function (e) {
75
- if (!e) this.paused = true
76
- if (this.$element.find('.next, .prev').length && $.support.transition.end) {
77
- this.$element.trigger($.support.transition.end)
78
- this.cycle(true)
79
- }
80
- clearInterval(this.interval)
81
- this.interval = null
82
- return this
83
- }
61
+ Carousel.prototype.getItemIndex = function (item) {
62
+ this.$items = item.parent().children('.item')
63
+ return this.$items.index(item || this.$active)
64
+ }
84
65
 
85
- , next: function () {
86
- if (this.sliding) return
87
- return this.slide('next')
88
- }
66
+ Carousel.prototype.to = function (pos) {
67
+ var that = this
68
+ var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
69
+
70
+ if (pos > (this.$items.length - 1) || pos < 0) return
71
+
72
+ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
73
+ if (activeIndex == pos) return this.pause().cycle()
89
74
 
90
- , prev: function () {
91
- if (this.sliding) return
92
- return this.slide('prev')
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) {
82
+ this.$element.trigger($.support.transition.end)
83
+ this.cycle(true)
93
84
  }
94
85
 
95
- , slide: function (type, next) {
96
- var $active = this.$element.find('.item.active')
97
- , $next = next || $active[type]()
98
- , isCycling = this.interval
99
- , direction = type == 'next' ? 'left' : 'right'
100
- , fallback = type == 'next' ? 'first' : 'last'
101
- , that = this
102
- , e
86
+ this.interval = clearInterval(this.interval)
103
87
 
104
- this.sliding = true
88
+ return this
89
+ }
105
90
 
106
- isCycling && this.pause()
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
+ }
107
100
 
108
- $next = $next.length ? $next : this.$element.find('.item')[fallback]()
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
+ }
109
113
 
110
- e = $.Event('slide', {
111
- relatedTarget: $next[0]
112
- , direction: direction
113
- })
114
+ if ($next.hasClass('active')) return (this.sliding = false)
114
115
 
115
- if ($next.hasClass('active')) 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
116
123
 
117
- if (this.$indicators.length) {
118
- this.$indicators.find('.active').removeClass('active')
119
- this.$element.one('slid', function () {
120
- var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
121
- $nextIndicator && $nextIndicator.addClass('active')
122
- })
123
- }
124
-
125
- if ($.support.transition && this.$element.hasClass('slide')) {
126
- this.$element.trigger(e)
127
- if (e.isDefaultPrevented()) return
128
- $next.addClass(type)
129
- $next[0].offsetWidth // force reflow
130
- $active.addClass(direction)
131
- $next.addClass(direction)
132
- this.$element.one($.support.transition.end, function () {
124
+ this.sliding = true
125
+
126
+ isCycling && this.pause()
127
+
128
+ if (this.$indicators.length) {
129
+ this.$indicators.find('.active').removeClass('active')
130
+ var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
131
+ $nextIndicator && $nextIndicator.addClass('active')
132
+ }
133
+
134
+ var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
135
+ if ($.support.transition && this.$element.hasClass('slide')) {
136
+ $next.addClass(type)
137
+ $next[0].offsetWidth // force reflow
138
+ $active.addClass(direction)
139
+ $next.addClass(direction)
140
+ $active
141
+ .one('bsTransitionEnd', function () {
133
142
  $next.removeClass([type, direction].join(' ')).addClass('active')
134
143
  $active.removeClass(['active', direction].join(' '))
135
144
  that.sliding = false
136
- setTimeout(function () { that.$element.trigger('slid') }, 0)
145
+ setTimeout(function () {
146
+ that.$element.trigger(slidEvent)
147
+ }, 0)
137
148
  })
138
- } else {
139
- this.$element.trigger(e)
140
- if (e.isDefaultPrevented()) return
141
- $active.removeClass('active')
142
- $next.addClass('active')
143
- this.sliding = false
144
- this.$element.trigger('slid')
145
- }
146
-
147
- isCycling && this.cycle()
148
-
149
- return this
149
+ .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
150
+ } else {
151
+ $active.removeClass('active')
152
+ $next.addClass('active')
153
+ this.sliding = false
154
+ this.$element.trigger(slidEvent)
150
155
  }
151
156
 
152
- }
157
+ isCycling && this.cycle()
153
158
 
159
+ return this
160
+ }
154
161
 
155
- /* CAROUSEL PLUGIN DEFINITION
156
- * ========================== */
157
162
 
158
- var old = $.fn.carousel
163
+ // CAROUSEL PLUGIN DEFINITION
164
+ // ==========================
159
165
 
160
- $.fn.carousel = function (option) {
166
+ function Plugin(option) {
161
167
  return this.each(function () {
162
- var $this = $(this)
163
- , data = $this.data('carousel')
164
- , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
165
- , action = typeof option == 'string' ? option : options.slide
166
- if (!data) $this.data('carousel', (data = new Carousel(this, options)))
168
+ var $this = $(this)
169
+ var data = $this.data('bs.carousel')
170
+ var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
171
+ var action = typeof option == 'string' ? option : options.slide
172
+
173
+ if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
167
174
  if (typeof option == 'number') data.to(option)
168
175
  else if (action) data[action]()
169
176
  else if (options.interval) data.pause().cycle()
170
177
  })
171
178
  }
172
179
 
173
- $.fn.carousel.defaults = {
174
- interval: 5000
175
- , pause: 'hover'
176
- }
180
+ var old = $.fn.carousel
177
181
 
182
+ $.fn.carousel = Plugin
178
183
  $.fn.carousel.Constructor = Carousel
179
184
 
180
185
 
181
- /* CAROUSEL NO CONFLICT
182
- * ==================== */
186
+ // CAROUSEL NO CONFLICT
187
+ // ====================
183
188
 
184
189
  $.fn.carousel.noConflict = function () {
185
190
  $.fn.carousel = old
186
191
  return this
187
192
  }
188
193
 
189
- /* CAROUSEL DATA-API
190
- * ================= */
191
194
 
192
- $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
193
- var $this = $(this), href
194
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
195
- , options = $.extend({}, $target.data(), $this.data())
196
- , slideIndex
195
+ // CAROUSEL DATA-API
196
+ // =================
197
+
198
+ $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
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
203
+ var options = $.extend({}, $target.data(), $this.data())
204
+ var slideIndex = $this.attr('data-slide-to')
205
+ if (slideIndex) options.interval = false
197
206
 
198
- $target.carousel(options)
207
+ Plugin.call($target, options)
199
208
 
200
- if (slideIndex = $this.attr('data-slide-to')) {
201
- $target.data('carousel').pause().to(slideIndex).cycle()
209
+ if (slideIndex) {
210
+ $target.data('bs.carousel').to(slideIndex)
202
211
  }
203
212
 
204
213
  e.preventDefault()
205
214
  })
206
215
 
207
- }(window.jQuery);
216
+ $(window).on('load', function () {
217
+ $('[data-ride="carousel"]').each(function () {
218
+ var $carousel = $(this)
219
+ Plugin.call($carousel, $carousel.data())
220
+ })
221
+ })
222
+
223
+ }(jQuery);
@@ -1,149 +1,142 @@
1
- /* =============================================================
2
- * bootstrap-collapse.js v2.3.2
3
- * http://getbootstrap.com/2.3.2/javascript.html#collapse
4
- * =============================================================
5
- * Copyright 2012 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 ($) {
22
-
23
- "use strict"; // jshint ;_;
24
-
25
-
26
- /* COLLAPSE PUBLIC CLASS DEFINITION
27
- * ================================ */
1
+ /* ========================================================================
2
+ * Bootstrap: collapse.js v3.2.0
3
+ * http://getbootstrap.com/javascript/#collapse
4
+ * ========================================================================
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // COLLAPSE PUBLIC CLASS DEFINITION
14
+ // ================================
28
15
 
29
16
  var Collapse = function (element, options) {
30
- this.$element = $(element)
31
- this.options = $.extend({}, $.fn.collapse.defaults, options)
17
+ this.$element = $(element)
18
+ this.options = $.extend({}, Collapse.DEFAULTS, options)
19
+ this.transitioning = null
32
20
 
33
- if (this.options.parent) {
34
- this.$parent = $(this.options.parent)
35
- }
21
+ if (this.options.parent) this.$parent = $(this.options.parent)
22
+ if (this.options.toggle) this.toggle()
23
+ }
24
+
25
+ Collapse.VERSION = '3.2.0'
36
26
 
37
- this.options.toggle && this.toggle()
27
+ Collapse.DEFAULTS = {
28
+ toggle: true
38
29
  }
39
30
 
40
- Collapse.prototype = {
31
+ Collapse.prototype.dimension = function () {
32
+ var hasWidth = this.$element.hasClass('width')
33
+ return hasWidth ? 'width' : 'height'
34
+ }
41
35
 
42
- constructor: Collapse
36
+ Collapse.prototype.show = function () {
37
+ if (this.transitioning || this.$element.hasClass('in')) return
43
38
 
44
- , dimension: function () {
45
- var hasWidth = this.$element.hasClass('width')
46
- return hasWidth ? 'width' : 'height'
47
- }
39
+ var startEvent = $.Event('show.bs.collapse')
40
+ this.$element.trigger(startEvent)
41
+ if (startEvent.isDefaultPrevented()) return
48
42
 
49
- , show: function () {
50
- var dimension
51
- , scroll
52
- , actives
53
- , hasData
43
+ var actives = this.$parent && this.$parent.find('> .panel > .in')
54
44
 
55
- if (this.transitioning || this.$element.hasClass('in')) return
45
+ if (actives && actives.length) {
46
+ var hasData = actives.data('bs.collapse')
47
+ if (hasData && hasData.transitioning) return
48
+ Plugin.call(actives, 'hide')
49
+ hasData || actives.data('bs.collapse', null)
50
+ }
56
51
 
57
- dimension = this.dimension()
58
- scroll = $.camelCase(['scroll', dimension].join('-'))
59
- actives = this.$parent && this.$parent.find('> .accordion-group > .in')
52
+ var dimension = this.dimension()
60
53
 
61
- if (actives && actives.length) {
62
- hasData = actives.data('collapse')
63
- if (hasData && hasData.transitioning) return
64
- actives.collapse('hide')
65
- hasData || actives.data('collapse', null)
66
- }
54
+ this.$element
55
+ .removeClass('collapse')
56
+ .addClass('collapsing')[dimension](0)
67
57
 
68
- this.$element[dimension](0)
69
- this.transition('addClass', $.Event('show'), 'shown')
70
- $.support.transition && this.$element[dimension](this.$element[0][scroll])
71
- }
58
+ this.transitioning = 1
72
59
 
73
- , hide: function () {
74
- var dimension
75
- if (this.transitioning || !this.$element.hasClass('in')) return
76
- dimension = this.dimension()
77
- this.reset(this.$element[dimension]())
78
- this.transition('removeClass', $.Event('hide'), 'hidden')
79
- this.$element[dimension](0)
60
+ var complete = function () {
61
+ this.$element
62
+ .removeClass('collapsing')
63
+ .addClass('collapse in')[dimension]('')
64
+ this.transitioning = 0
65
+ this.$element
66
+ .trigger('shown.bs.collapse')
80
67
  }
81
68
 
82
- , reset: function (size) {
83
- var dimension = this.dimension()
69
+ if (!$.support.transition) return complete.call(this)
84
70
 
85
- this.$element
86
- .removeClass('collapse')
87
- [dimension](size || 'auto')
88
- [0].offsetWidth
71
+ var scrollSize = $.camelCase(['scroll', dimension].join('-'))
89
72
 
90
- this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
73
+ this.$element
74
+ .one('bsTransitionEnd', $.proxy(complete, this))
75
+ .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
76
+ }
91
77
 
92
- return this
93
- }
78
+ Collapse.prototype.hide = function () {
79
+ if (this.transitioning || !this.$element.hasClass('in')) return
94
80
 
95
- , transition: function (method, startEvent, completeEvent) {
96
- var that = this
97
- , complete = function () {
98
- if (startEvent.type == 'show') that.reset()
99
- that.transitioning = 0
100
- that.$element.trigger(completeEvent)
101
- }
81
+ var startEvent = $.Event('hide.bs.collapse')
82
+ this.$element.trigger(startEvent)
83
+ if (startEvent.isDefaultPrevented()) return
102
84
 
103
- this.$element.trigger(startEvent)
85
+ var dimension = this.dimension()
104
86
 
105
- if (startEvent.isDefaultPrevented()) return
87
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight
106
88
 
107
- this.transitioning = 1
89
+ this.$element
90
+ .addClass('collapsing')
91
+ .removeClass('collapse')
92
+ .removeClass('in')
108
93
 
109
- this.$element[method]('in')
94
+ this.transitioning = 1
110
95
 
111
- $.support.transition && this.$element.hasClass('collapse') ?
112
- this.$element.one($.support.transition.end, complete) :
113
- complete()
96
+ var complete = function () {
97
+ this.transitioning = 0
98
+ this.$element
99
+ .trigger('hidden.bs.collapse')
100
+ .removeClass('collapsing')
101
+ .addClass('collapse')
114
102
  }
115
103
 
116
- , toggle: function () {
117
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
118
- }
104
+ if (!$.support.transition) return complete.call(this)
119
105
 
106
+ this.$element
107
+ [dimension](0)
108
+ .one('bsTransitionEnd', $.proxy(complete, this))
109
+ .emulateTransitionEnd(350)
120
110
  }
121
111
 
112
+ Collapse.prototype.toggle = function () {
113
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
114
+ }
122
115
 
123
- /* COLLAPSE PLUGIN DEFINITION
124
- * ========================== */
125
116
 
126
- var old = $.fn.collapse
117
+ // COLLAPSE PLUGIN DEFINITION
118
+ // ==========================
127
119
 
128
- $.fn.collapse = function (option) {
120
+ function Plugin(option) {
129
121
  return this.each(function () {
130
- var $this = $(this)
131
- , data = $this.data('collapse')
132
- , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
133
- if (!data) $this.data('collapse', (data = new Collapse(this, options)))
122
+ var $this = $(this)
123
+ var data = $this.data('bs.collapse')
124
+ var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
125
+
126
+ if (!data && options.toggle && option == 'show') option = !option
127
+ if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
134
128
  if (typeof option == 'string') data[option]()
135
129
  })
136
130
  }
137
131
 
138
- $.fn.collapse.defaults = {
139
- toggle: true
140
- }
132
+ var old = $.fn.collapse
141
133
 
134
+ $.fn.collapse = Plugin
142
135
  $.fn.collapse.Constructor = Collapse
143
136
 
144
137
 
145
- /* COLLAPSE NO CONFLICT
146
- * ==================== */
138
+ // COLLAPSE NO CONFLICT
139
+ // ====================
147
140
 
148
141
  $.fn.collapse.noConflict = function () {
149
142
  $.fn.collapse = old
@@ -151,17 +144,27 @@
151
144
  }
152
145
 
153
146
 
154
- /* COLLAPSE DATA-API
155
- * ================= */
147
+ // COLLAPSE DATA-API
148
+ // =================
156
149
 
157
- $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
158
- var $this = $(this), href
159
- , target = $this.attr('data-target')
150
+ $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
151
+ var href
152
+ var $this = $(this)
153
+ var target = $this.attr('data-target')
160
154
  || e.preventDefault()
161
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
162
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
163
- $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
164
- $(target).collapse(option)
155
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
156
+ var $target = $(target)
157
+ var data = $target.data('bs.collapse')
158
+ var option = data ? 'toggle' : $this.data()
159
+ var parent = $this.attr('data-parent')
160
+ var $parent = parent && $(parent)
161
+
162
+ if (!data || !data.transitioning) {
163
+ if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
164
+ $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
165
+ }
166
+
167
+ Plugin.call($target, option)
165
168
  })
166
169
 
167
- }(window.jQuery);
170
+ }(jQuery);