twitter-bootstrap-rails 5.1.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +61 -0
  3. data/README.md +29 -613
  4. data/app/assets/javascripts/twitter/bootstrap/bootstrap.min.js +7 -0
  5. data/app/assets/javascripts/twitter/bootstrap.js +1 -12
  6. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css +6 -0
  7. data/lib/generators/bootstrap/install/install_generator.rb +29 -8
  8. data/lib/generators/bootstrap/install/templates/application.js +1 -3
  9. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +3 -4
  10. data/lib/generators/bootstrap/layout/templates/layout.html.erb +17 -60
  11. data/lib/generators/bootstrap/partial/templates/_navbar-devise.html.erb +30 -0
  12. data/lib/generators/bootstrap/partial/templates/_navbar.html.erb +16 -0
  13. data/lib/generators/bootstrap/themed/templates/_form.html.erb +16 -23
  14. data/lib/generators/bootstrap/themed/templates/index.html.erb +10 -10
  15. data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -5
  16. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -8
  17. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  18. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap.bundle.min.js +7 -0
  19. data/vendor/assets/stylesheets/twitter/bootstrap/bootstrap.min.css +6 -0
  20. data/vendor/toolkit/twitter/bootstrap/variables.less +1681 -799
  21. metadata +17 -73
  22. data/app/assets/javascripts/twitter/bootstrap/affix.js +0 -162
  23. data/app/assets/javascripts/twitter/bootstrap/alert.js +0 -94
  24. data/app/assets/javascripts/twitter/bootstrap/button.js +0 -120
  25. data/app/assets/javascripts/twitter/bootstrap/carousel.js +0 -237
  26. data/app/assets/javascripts/twitter/bootstrap/collapse.js +0 -211
  27. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +0 -165
  28. data/app/assets/javascripts/twitter/bootstrap/modal.js +0 -337
  29. data/app/assets/javascripts/twitter/bootstrap/popover.js +0 -108
  30. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +0 -172
  31. data/app/assets/javascripts/twitter/bootstrap/tab.js +0 -155
  32. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +0 -514
  33. data/app/assets/javascripts/twitter/bootstrap/transition.js +0 -59
  34. data/app/assets/javascripts/twitter/bootstrap_ujs.js +0 -11
  35. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +0 -1
  36. data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +0 -1
@@ -1,237 +0,0 @@
1
- /* ========================================================================
2
- * Bootstrap: carousel.js v3.3.6
3
- * http://getbootstrap.com/javascript/#carousel
4
- * ========================================================================
5
- * Copyright 2011-2015 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
- // =========================
15
-
16
- var Carousel = function (element, options) {
17
- this.$element = $(element)
18
- this.$indicators = this.$element.find('.carousel-indicators')
19
- this.options = options
20
- this.paused = null
21
- this.sliding = null
22
- this.interval = null
23
- this.$active = null
24
- this.$items = null
25
-
26
- this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
27
-
28
- this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
29
- .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
30
- .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
31
- }
32
-
33
- Carousel.VERSION = '3.3.6'
34
-
35
- Carousel.TRANSITION_DURATION = 600
36
-
37
- Carousel.DEFAULTS = {
38
- interval: 5000,
39
- pause: 'hover',
40
- wrap: true,
41
- keyboard: true
42
- }
43
-
44
- Carousel.prototype.keydown = function (e) {
45
- if (/input|textarea/i.test(e.target.tagName)) return
46
- switch (e.which) {
47
- case 37: this.prev(); break
48
- case 39: this.next(); break
49
- default: return
50
- }
51
-
52
- e.preventDefault()
53
- }
54
-
55
- Carousel.prototype.cycle = function (e) {
56
- e || (this.paused = false)
57
-
58
- this.interval && clearInterval(this.interval)
59
-
60
- this.options.interval
61
- && !this.paused
62
- && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
63
-
64
- return this
65
- }
66
-
67
- Carousel.prototype.getItemIndex = function (item) {
68
- this.$items = item.parent().children('.item')
69
- return this.$items.index(item || this.$active)
70
- }
71
-
72
- Carousel.prototype.getItemForDirection = function (direction, active) {
73
- var activeIndex = this.getItemIndex(active)
74
- var willWrap = (direction == 'prev' && activeIndex === 0)
75
- || (direction == 'next' && activeIndex == (this.$items.length - 1))
76
- if (willWrap && !this.options.wrap) return active
77
- var delta = direction == 'prev' ? -1 : 1
78
- var itemIndex = (activeIndex + delta) % this.$items.length
79
- return this.$items.eq(itemIndex)
80
- }
81
-
82
- Carousel.prototype.to = function (pos) {
83
- var that = this
84
- var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
85
-
86
- if (pos > (this.$items.length - 1) || pos < 0) return
87
-
88
- if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
89
- if (activeIndex == pos) return this.pause().cycle()
90
-
91
- return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
92
- }
93
-
94
- Carousel.prototype.pause = function (e) {
95
- e || (this.paused = true)
96
-
97
- if (this.$element.find('.next, .prev').length && $.support.transition) {
98
- this.$element.trigger($.support.transition.end)
99
- this.cycle(true)
100
- }
101
-
102
- this.interval = clearInterval(this.interval)
103
-
104
- return this
105
- }
106
-
107
- Carousel.prototype.next = function () {
108
- if (this.sliding) return
109
- return this.slide('next')
110
- }
111
-
112
- Carousel.prototype.prev = function () {
113
- if (this.sliding) return
114
- return this.slide('prev')
115
- }
116
-
117
- Carousel.prototype.slide = function (type, next) {
118
- var $active = this.$element.find('.item.active')
119
- var $next = next || this.getItemForDirection(type, $active)
120
- var isCycling = this.interval
121
- var direction = type == 'next' ? 'left' : 'right'
122
- var that = this
123
-
124
- if ($next.hasClass('active')) return (this.sliding = false)
125
-
126
- var relatedTarget = $next[0]
127
- var slideEvent = $.Event('slide.bs.carousel', {
128
- relatedTarget: relatedTarget,
129
- direction: direction
130
- })
131
- this.$element.trigger(slideEvent)
132
- if (slideEvent.isDefaultPrevented()) return
133
-
134
- this.sliding = true
135
-
136
- isCycling && this.pause()
137
-
138
- if (this.$indicators.length) {
139
- this.$indicators.find('.active').removeClass('active')
140
- var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
141
- $nextIndicator && $nextIndicator.addClass('active')
142
- }
143
-
144
- var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
145
- if ($.support.transition && this.$element.hasClass('slide')) {
146
- $next.addClass(type)
147
- $next[0].offsetWidth // force reflow
148
- $active.addClass(direction)
149
- $next.addClass(direction)
150
- $active
151
- .one('bsTransitionEnd', function () {
152
- $next.removeClass([type, direction].join(' ')).addClass('active')
153
- $active.removeClass(['active', direction].join(' '))
154
- that.sliding = false
155
- setTimeout(function () {
156
- that.$element.trigger(slidEvent)
157
- }, 0)
158
- })
159
- .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
160
- } else {
161
- $active.removeClass('active')
162
- $next.addClass('active')
163
- this.sliding = false
164
- this.$element.trigger(slidEvent)
165
- }
166
-
167
- isCycling && this.cycle()
168
-
169
- return this
170
- }
171
-
172
-
173
- // CAROUSEL PLUGIN DEFINITION
174
- // ==========================
175
-
176
- function Plugin(option) {
177
- return this.each(function () {
178
- var $this = $(this)
179
- var data = $this.data('bs.carousel')
180
- var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
181
- var action = typeof option == 'string' ? option : options.slide
182
-
183
- if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
184
- if (typeof option == 'number') data.to(option)
185
- else if (action) data[action]()
186
- else if (options.interval) data.pause().cycle()
187
- })
188
- }
189
-
190
- var old = $.fn.carousel
191
-
192
- $.fn.carousel = Plugin
193
- $.fn.carousel.Constructor = Carousel
194
-
195
-
196
- // CAROUSEL NO CONFLICT
197
- // ====================
198
-
199
- $.fn.carousel.noConflict = function () {
200
- $.fn.carousel = old
201
- return this
202
- }
203
-
204
-
205
- // CAROUSEL DATA-API
206
- // =================
207
-
208
- var clickHandler = function (e) {
209
- var href
210
- var $this = $(this)
211
- var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
212
- if (!$target.hasClass('carousel')) return
213
- var options = $.extend({}, $target.data(), $this.data())
214
- var slideIndex = $this.attr('data-slide-to')
215
- if (slideIndex) options.interval = false
216
-
217
- Plugin.call($target, options)
218
-
219
- if (slideIndex) {
220
- $target.data('bs.carousel').to(slideIndex)
221
- }
222
-
223
- e.preventDefault()
224
- }
225
-
226
- $(document)
227
- .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
228
- .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
229
-
230
- $(window).on('load', function () {
231
- $('[data-ride="carousel"]').each(function () {
232
- var $carousel = $(this)
233
- Plugin.call($carousel, $carousel.data())
234
- })
235
- })
236
-
237
- }(jQuery);
@@ -1,211 +0,0 @@
1
- /* ========================================================================
2
- * Bootstrap: collapse.js v3.3.6
3
- * http://getbootstrap.com/javascript/#collapse
4
- * ========================================================================
5
- * Copyright 2011-2015 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
- // ================================
15
-
16
- var Collapse = function (element, options) {
17
- this.$element = $(element)
18
- this.options = $.extend({}, Collapse.DEFAULTS, options)
19
- this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
20
- '[data-toggle="collapse"][data-target="#' + element.id + '"]')
21
- this.transitioning = null
22
-
23
- if (this.options.parent) {
24
- this.$parent = this.getParent()
25
- } else {
26
- this.addAriaAndCollapsedClass(this.$element, this.$trigger)
27
- }
28
-
29
- if (this.options.toggle) this.toggle()
30
- }
31
-
32
- Collapse.VERSION = '3.3.6'
33
-
34
- Collapse.TRANSITION_DURATION = 350
35
-
36
- Collapse.DEFAULTS = {
37
- toggle: true
38
- }
39
-
40
- Collapse.prototype.dimension = function () {
41
- var hasWidth = this.$element.hasClass('width')
42
- return hasWidth ? 'width' : 'height'
43
- }
44
-
45
- Collapse.prototype.show = function () {
46
- if (this.transitioning || this.$element.hasClass('in')) return
47
-
48
- var activesData
49
- var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
50
-
51
- if (actives && actives.length) {
52
- activesData = actives.data('bs.collapse')
53
- if (activesData && activesData.transitioning) return
54
- }
55
-
56
- var startEvent = $.Event('show.bs.collapse')
57
- this.$element.trigger(startEvent)
58
- if (startEvent.isDefaultPrevented()) return
59
-
60
- if (actives && actives.length) {
61
- Plugin.call(actives, 'hide')
62
- activesData || actives.data('bs.collapse', null)
63
- }
64
-
65
- var dimension = this.dimension()
66
-
67
- this.$element
68
- .removeClass('collapse')
69
- .addClass('collapsing')[dimension](0)
70
- .attr('aria-expanded', true)
71
-
72
- this.$trigger
73
- .removeClass('collapsed')
74
- .attr('aria-expanded', true)
75
-
76
- this.transitioning = 1
77
-
78
- var complete = function () {
79
- this.$element
80
- .removeClass('collapsing')
81
- .addClass('collapse in')[dimension]('')
82
- this.transitioning = 0
83
- this.$element
84
- .trigger('shown.bs.collapse')
85
- }
86
-
87
- if (!$.support.transition) return complete.call(this)
88
-
89
- var scrollSize = $.camelCase(['scroll', dimension].join('-'))
90
-
91
- this.$element
92
- .one('bsTransitionEnd', $.proxy(complete, this))
93
- .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
94
- }
95
-
96
- Collapse.prototype.hide = function () {
97
- if (this.transitioning || !this.$element.hasClass('in')) return
98
-
99
- var startEvent = $.Event('hide.bs.collapse')
100
- this.$element.trigger(startEvent)
101
- if (startEvent.isDefaultPrevented()) return
102
-
103
- var dimension = this.dimension()
104
-
105
- this.$element[dimension](this.$element[dimension]())[0].offsetHeight
106
-
107
- this.$element
108
- .addClass('collapsing')
109
- .removeClass('collapse in')
110
- .attr('aria-expanded', false)
111
-
112
- this.$trigger
113
- .addClass('collapsed')
114
- .attr('aria-expanded', false)
115
-
116
- this.transitioning = 1
117
-
118
- var complete = function () {
119
- this.transitioning = 0
120
- this.$element
121
- .removeClass('collapsing')
122
- .addClass('collapse')
123
- .trigger('hidden.bs.collapse')
124
- }
125
-
126
- if (!$.support.transition) return complete.call(this)
127
-
128
- this.$element
129
- [dimension](0)
130
- .one('bsTransitionEnd', $.proxy(complete, this))
131
- .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
132
- }
133
-
134
- Collapse.prototype.toggle = function () {
135
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
136
- }
137
-
138
- Collapse.prototype.getParent = function () {
139
- return $(this.options.parent)
140
- .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
141
- .each($.proxy(function (i, element) {
142
- var $element = $(element)
143
- this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
144
- }, this))
145
- .end()
146
- }
147
-
148
- Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
149
- var isOpen = $element.hasClass('in')
150
-
151
- $element.attr('aria-expanded', isOpen)
152
- $trigger
153
- .toggleClass('collapsed', !isOpen)
154
- .attr('aria-expanded', isOpen)
155
- }
156
-
157
- function getTargetFromTrigger($trigger) {
158
- var href
159
- var target = $trigger.attr('data-target')
160
- || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
161
-
162
- return $(target)
163
- }
164
-
165
-
166
- // COLLAPSE PLUGIN DEFINITION
167
- // ==========================
168
-
169
- function Plugin(option) {
170
- return this.each(function () {
171
- var $this = $(this)
172
- var data = $this.data('bs.collapse')
173
- var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
174
-
175
- if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
176
- if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
177
- if (typeof option == 'string') data[option]()
178
- })
179
- }
180
-
181
- var old = $.fn.collapse
182
-
183
- $.fn.collapse = Plugin
184
- $.fn.collapse.Constructor = Collapse
185
-
186
-
187
- // COLLAPSE NO CONFLICT
188
- // ====================
189
-
190
- $.fn.collapse.noConflict = function () {
191
- $.fn.collapse = old
192
- return this
193
- }
194
-
195
-
196
- // COLLAPSE DATA-API
197
- // =================
198
-
199
- $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
200
- var $this = $(this)
201
-
202
- if (!$this.attr('data-target')) e.preventDefault()
203
-
204
- var $target = getTargetFromTrigger($this)
205
- var data = $target.data('bs.collapse')
206
- var option = data ? 'toggle' : $this.data()
207
-
208
- Plugin.call($target, option)
209
- })
210
-
211
- }(jQuery);
@@ -1,165 +0,0 @@
1
- /* ========================================================================
2
- * Bootstrap: dropdown.js v3.3.6
3
- * http://getbootstrap.com/javascript/#dropdowns
4
- * ========================================================================
5
- * Copyright 2011-2015 Twitter, Inc.
6
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
- * ======================================================================== */
8
-
9
-
10
- +function ($) {
11
- 'use strict';
12
-
13
- // DROPDOWN CLASS DEFINITION
14
- // =========================
15
-
16
- var backdrop = '.dropdown-backdrop'
17
- var toggle = '[data-toggle="dropdown"]'
18
- var Dropdown = function (element) {
19
- $(element).on('click.bs.dropdown', this.toggle)
20
- }
21
-
22
- Dropdown.VERSION = '3.3.6'
23
-
24
- function getParent($this) {
25
- var selector = $this.attr('data-target')
26
-
27
- if (!selector) {
28
- selector = $this.attr('href')
29
- selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
30
- }
31
-
32
- var $parent = selector && $(selector)
33
-
34
- return $parent && $parent.length ? $parent : $this.parent()
35
- }
36
-
37
- function clearMenus(e) {
38
- if (e && e.which === 3) return
39
- $(backdrop).remove()
40
- $(toggle).each(function () {
41
- var $this = $(this)
42
- var $parent = getParent($this)
43
- var relatedTarget = { relatedTarget: this }
44
-
45
- if (!$parent.hasClass('open')) return
46
-
47
- if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
48
-
49
- $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
50
-
51
- if (e.isDefaultPrevented()) return
52
-
53
- $this.attr('aria-expanded', 'false')
54
- $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
55
- })
56
- }
57
-
58
- Dropdown.prototype.toggle = function (e) {
59
- var $this = $(this)
60
-
61
- if ($this.is('.disabled, :disabled')) return
62
-
63
- var $parent = getParent($this)
64
- var isActive = $parent.hasClass('open')
65
-
66
- clearMenus()
67
-
68
- if (!isActive) {
69
- if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
70
- // if mobile we use a backdrop because click events don't delegate
71
- $(document.createElement('div'))
72
- .addClass('dropdown-backdrop')
73
- .insertAfter($(this))
74
- .on('click', clearMenus)
75
- }
76
-
77
- var relatedTarget = { relatedTarget: this }
78
- $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
79
-
80
- if (e.isDefaultPrevented()) return
81
-
82
- $this
83
- .trigger('focus')
84
- .attr('aria-expanded', 'true')
85
-
86
- $parent
87
- .toggleClass('open')
88
- .trigger($.Event('shown.bs.dropdown', relatedTarget))
89
- }
90
-
91
- return false
92
- }
93
-
94
- Dropdown.prototype.keydown = function (e) {
95
- if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
96
-
97
- var $this = $(this)
98
-
99
- e.preventDefault()
100
- e.stopPropagation()
101
-
102
- if ($this.is('.disabled, :disabled')) return
103
-
104
- var $parent = getParent($this)
105
- var isActive = $parent.hasClass('open')
106
-
107
- if (!isActive && e.which != 27 || isActive && e.which == 27) {
108
- if (e.which == 27) $parent.find(toggle).trigger('focus')
109
- return $this.trigger('click')
110
- }
111
-
112
- var desc = ' li:not(.disabled):visible a'
113
- var $items = $parent.find('.dropdown-menu' + desc)
114
-
115
- if (!$items.length) return
116
-
117
- var index = $items.index(e.target)
118
-
119
- if (e.which == 38 && index > 0) index-- // up
120
- if (e.which == 40 && index < $items.length - 1) index++ // down
121
- if (!~index) index = 0
122
-
123
- $items.eq(index).trigger('focus')
124
- }
125
-
126
-
127
- // DROPDOWN PLUGIN DEFINITION
128
- // ==========================
129
-
130
- function Plugin(option) {
131
- return this.each(function () {
132
- var $this = $(this)
133
- var data = $this.data('bs.dropdown')
134
-
135
- if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
136
- if (typeof option == 'string') data[option].call($this)
137
- })
138
- }
139
-
140
- var old = $.fn.dropdown
141
-
142
- $.fn.dropdown = Plugin
143
- $.fn.dropdown.Constructor = Dropdown
144
-
145
-
146
- // DROPDOWN NO CONFLICT
147
- // ====================
148
-
149
- $.fn.dropdown.noConflict = function () {
150
- $.fn.dropdown = old
151
- return this
152
- }
153
-
154
-
155
- // APPLY TO STANDARD DROPDOWN ELEMENTS
156
- // ===================================
157
-
158
- $(document)
159
- .on('click.bs.dropdown.data-api', clearMenus)
160
- .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
161
- .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
162
- .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
163
- .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
164
-
165
- }(jQuery);