twitter-bootstrap-ruby 2.1.1.0 → 2.3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +46 -65
- data/Rakefile +21 -16
- data/css/bootstrap.css +825 -451
- data/css/bootstrap.min.css +268 -237
- data/js/bootstrap-affix.js +15 -2
- data/js/bootstrap-alert.js +13 -4
- data/js/bootstrap-button.js +16 -7
- data/js/bootstrap-carousel.js +52 -21
- data/js/bootstrap-collapse.js +26 -17
- data/js/bootstrap-dropdown.js +32 -17
- data/js/bootstrap-modal.js +44 -36
- data/js/bootstrap-popover.js +17 -6
- data/js/bootstrap-scrollspy.js +13 -2
- data/js/bootstrap-tab.js +16 -7
- data/js/bootstrap-tooltip.js +120 -34
- data/js/bootstrap-transition.js +5 -5
- data/js/bootstrap-typeahead.js +55 -20
- data/lib/twitter/bootstrap/version.rb +1 -1
- metadata +24 -9
data/js/bootstrap-affix.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-affix.js v2.
|
2
|
+
* bootstrap-affix.js v2.3.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#affix
|
4
4
|
* ==========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -28,7 +28,9 @@
|
|
28
28
|
|
29
29
|
var Affix = function (element, options) {
|
30
30
|
this.options = $.extend({}, $.fn.affix.defaults, options)
|
31
|
-
this.$window = $(window)
|
31
|
+
this.$window = $(window)
|
32
|
+
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
33
|
+
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
|
32
34
|
this.$element = $(element)
|
33
35
|
this.checkPosition()
|
34
36
|
}
|
@@ -66,6 +68,8 @@
|
|
66
68
|
/* AFFIX PLUGIN DEFINITION
|
67
69
|
* ======================= */
|
68
70
|
|
71
|
+
var old = $.fn.affix
|
72
|
+
|
69
73
|
$.fn.affix = function (option) {
|
70
74
|
return this.each(function () {
|
71
75
|
var $this = $(this)
|
@@ -83,6 +87,15 @@
|
|
83
87
|
}
|
84
88
|
|
85
89
|
|
90
|
+
/* AFFIX NO CONFLICT
|
91
|
+
* ================= */
|
92
|
+
|
93
|
+
$.fn.affix.noConflict = function () {
|
94
|
+
$.fn.affix = old
|
95
|
+
return this
|
96
|
+
}
|
97
|
+
|
98
|
+
|
86
99
|
/* AFFIX DATA-API
|
87
100
|
* ============== */
|
88
101
|
|
data/js/bootstrap-alert.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-alert.js v2.
|
2
|
+
* bootstrap-alert.js v2.3.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
4
4
|
* ==========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -68,6 +68,8 @@
|
|
68
68
|
/* ALERT PLUGIN DEFINITION
|
69
69
|
* ======================= */
|
70
70
|
|
71
|
+
var old = $.fn.alert
|
72
|
+
|
71
73
|
$.fn.alert = function (option) {
|
72
74
|
return this.each(function () {
|
73
75
|
var $this = $(this)
|
@@ -80,11 +82,18 @@
|
|
80
82
|
$.fn.alert.Constructor = Alert
|
81
83
|
|
82
84
|
|
85
|
+
/* ALERT NO CONFLICT
|
86
|
+
* ================= */
|
87
|
+
|
88
|
+
$.fn.alert.noConflict = function () {
|
89
|
+
$.fn.alert = old
|
90
|
+
return this
|
91
|
+
}
|
92
|
+
|
93
|
+
|
83
94
|
/* ALERT DATA-API
|
84
95
|
* ============== */
|
85
96
|
|
86
|
-
$(
|
87
|
-
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
88
|
-
})
|
97
|
+
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
|
89
98
|
|
90
99
|
}(window.jQuery);
|
data/js/bootstrap-button.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-button.js v2.
|
2
|
+
* bootstrap-button.js v2.3.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
4
4
|
* ============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -64,6 +64,8 @@
|
|
64
64
|
/* BUTTON PLUGIN DEFINITION
|
65
65
|
* ======================== */
|
66
66
|
|
67
|
+
var old = $.fn.button
|
68
|
+
|
67
69
|
$.fn.button = function (option) {
|
68
70
|
return this.each(function () {
|
69
71
|
var $this = $(this)
|
@@ -82,15 +84,22 @@
|
|
82
84
|
$.fn.button.Constructor = Button
|
83
85
|
|
84
86
|
|
87
|
+
/* BUTTON NO CONFLICT
|
88
|
+
* ================== */
|
89
|
+
|
90
|
+
$.fn.button.noConflict = function () {
|
91
|
+
$.fn.button = old
|
92
|
+
return this
|
93
|
+
}
|
94
|
+
|
95
|
+
|
85
96
|
/* BUTTON DATA-API
|
86
97
|
* =============== */
|
87
98
|
|
88
|
-
$(function () {
|
89
|
-
$
|
90
|
-
|
91
|
-
|
92
|
-
$btn.button('toggle')
|
93
|
-
})
|
99
|
+
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
|
100
|
+
var $btn = $(e.target)
|
101
|
+
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
102
|
+
$btn.button('toggle')
|
94
103
|
})
|
95
104
|
|
96
105
|
}(window.jQuery);
|
data/js/bootstrap-carousel.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-carousel.js v2.
|
2
|
+
* bootstrap-carousel.js v2.3.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#carousel
|
4
4
|
* ==========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -28,8 +28,8 @@
|
|
28
28
|
|
29
29
|
var Carousel = function (element, options) {
|
30
30
|
this.$element = $(element)
|
31
|
+
this.$indicators = this.$element.find('.carousel-indicators')
|
31
32
|
this.options = options
|
32
|
-
this.options.slide && this.slide(this.options.slide)
|
33
33
|
this.options.pause == 'hover' && this.$element
|
34
34
|
.on('mouseenter', $.proxy(this.pause, this))
|
35
35
|
.on('mouseleave', $.proxy(this.cycle, this))
|
@@ -39,19 +39,24 @@
|
|
39
39
|
|
40
40
|
cycle: function (e) {
|
41
41
|
if (!e) this.paused = false
|
42
|
+
if (this.interval) clearInterval(this.interval);
|
42
43
|
this.options.interval
|
43
44
|
&& !this.paused
|
44
45
|
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
45
46
|
return this
|
46
47
|
}
|
47
48
|
|
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)
|
53
|
+
}
|
54
|
+
|
48
55
|
, to: function (pos) {
|
49
|
-
var
|
50
|
-
, children = $active.parent().children()
|
51
|
-
, activePos = children.index($active)
|
56
|
+
var activeIndex = this.getActiveIndex()
|
52
57
|
, that = this
|
53
58
|
|
54
|
-
if (pos > (
|
59
|
+
if (pos > (this.$items.length - 1) || pos < 0) return
|
55
60
|
|
56
61
|
if (this.sliding) {
|
57
62
|
return this.$element.one('slid', function () {
|
@@ -59,18 +64,18 @@
|
|
59
64
|
})
|
60
65
|
}
|
61
66
|
|
62
|
-
if (
|
67
|
+
if (activeIndex == pos) {
|
63
68
|
return this.pause().cycle()
|
64
69
|
}
|
65
70
|
|
66
|
-
return this.slide(pos >
|
71
|
+
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
67
72
|
}
|
68
73
|
|
69
74
|
, pause: function (e) {
|
70
75
|
if (!e) this.paused = true
|
71
76
|
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
72
77
|
this.$element.trigger($.support.transition.end)
|
73
|
-
this.cycle()
|
78
|
+
this.cycle(true)
|
74
79
|
}
|
75
80
|
clearInterval(this.interval)
|
76
81
|
this.interval = null
|
@@ -94,9 +99,7 @@
|
|
94
99
|
, direction = type == 'next' ? 'left' : 'right'
|
95
100
|
, fallback = type == 'next' ? 'first' : 'last'
|
96
101
|
, that = this
|
97
|
-
, e
|
98
|
-
relatedTarget: $next[0]
|
99
|
-
})
|
102
|
+
, e
|
100
103
|
|
101
104
|
this.sliding = true
|
102
105
|
|
@@ -104,8 +107,21 @@
|
|
104
107
|
|
105
108
|
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
106
109
|
|
110
|
+
e = $.Event('slide', {
|
111
|
+
relatedTarget: $next[0]
|
112
|
+
, direction: direction
|
113
|
+
})
|
114
|
+
|
107
115
|
if ($next.hasClass('active')) return
|
108
116
|
|
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
|
+
|
109
125
|
if ($.support.transition && this.$element.hasClass('slide')) {
|
110
126
|
this.$element.trigger(e)
|
111
127
|
if (e.isDefaultPrevented()) return
|
@@ -139,6 +155,8 @@
|
|
139
155
|
/* CAROUSEL PLUGIN DEFINITION
|
140
156
|
* ========================== */
|
141
157
|
|
158
|
+
var old = $.fn.carousel
|
159
|
+
|
142
160
|
$.fn.carousel = function (option) {
|
143
161
|
return this.each(function () {
|
144
162
|
var $this = $(this)
|
@@ -148,7 +166,7 @@
|
|
148
166
|
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
149
167
|
if (typeof option == 'number') data.to(option)
|
150
168
|
else if (action) data[action]()
|
151
|
-
else if (options.interval) data.cycle()
|
169
|
+
else if (options.interval) data.pause().cycle()
|
152
170
|
})
|
153
171
|
}
|
154
172
|
|
@@ -160,17 +178,30 @@
|
|
160
178
|
$.fn.carousel.Constructor = Carousel
|
161
179
|
|
162
180
|
|
181
|
+
/* CAROUSEL NO CONFLICT
|
182
|
+
* ==================== */
|
183
|
+
|
184
|
+
$.fn.carousel.noConflict = function () {
|
185
|
+
$.fn.carousel = old
|
186
|
+
return this
|
187
|
+
}
|
188
|
+
|
163
189
|
/* CAROUSEL DATA-API
|
164
190
|
* ================= */
|
165
191
|
|
166
|
-
$(function () {
|
167
|
-
$
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
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
|
197
|
+
|
198
|
+
$target.carousel(options)
|
199
|
+
|
200
|
+
if (slideIndex = $this.attr('data-slide-to')) {
|
201
|
+
$target.data('carousel').pause().to(slideIndex).cycle()
|
202
|
+
}
|
203
|
+
|
204
|
+
e.preventDefault()
|
174
205
|
})
|
175
206
|
|
176
207
|
}(window.jQuery);
|
data/js/bootstrap-collapse.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* =============================================================
|
2
|
-
* bootstrap-collapse.js v2.
|
2
|
+
* bootstrap-collapse.js v2.3.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
4
4
|
* =============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -52,7 +52,7 @@
|
|
52
52
|
, actives
|
53
53
|
, hasData
|
54
54
|
|
55
|
-
if (this.transitioning) return
|
55
|
+
if (this.transitioning || this.$element.hasClass('in')) return
|
56
56
|
|
57
57
|
dimension = this.dimension()
|
58
58
|
scroll = $.camelCase(['scroll', dimension].join('-'))
|
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
, hide: function () {
|
74
74
|
var dimension
|
75
|
-
if (this.transitioning) return
|
75
|
+
if (this.transitioning || !this.$element.hasClass('in')) return
|
76
76
|
dimension = this.dimension()
|
77
77
|
this.reset(this.$element[dimension]())
|
78
78
|
this.transition('removeClass', $.Event('hide'), 'hidden')
|
@@ -120,14 +120,16 @@
|
|
120
120
|
}
|
121
121
|
|
122
122
|
|
123
|
-
/*
|
124
|
-
*
|
123
|
+
/* COLLAPSE PLUGIN DEFINITION
|
124
|
+
* ========================== */
|
125
|
+
|
126
|
+
var old = $.fn.collapse
|
125
127
|
|
126
128
|
$.fn.collapse = function (option) {
|
127
129
|
return this.each(function () {
|
128
130
|
var $this = $(this)
|
129
131
|
, data = $this.data('collapse')
|
130
|
-
, options = typeof option == 'object' && option
|
132
|
+
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
|
131
133
|
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
132
134
|
if (typeof option == 'string') data[option]()
|
133
135
|
})
|
@@ -140,19 +142,26 @@
|
|
140
142
|
$.fn.collapse.Constructor = Collapse
|
141
143
|
|
142
144
|
|
143
|
-
/*
|
145
|
+
/* COLLAPSE NO CONFLICT
|
144
146
|
* ==================== */
|
145
147
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
148
|
+
$.fn.collapse.noConflict = function () {
|
149
|
+
$.fn.collapse = old
|
150
|
+
return this
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
/* COLLAPSE DATA-API
|
155
|
+
* ================= */
|
156
|
+
|
157
|
+
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
158
|
+
var $this = $(this), href
|
159
|
+
, target = $this.attr('data-target')
|
160
|
+
|| 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)
|
156
165
|
})
|
157
166
|
|
158
167
|
}(window.jQuery);
|
data/js/bootstrap-dropdown.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-dropdown.js v2.
|
2
|
+
* bootstrap-dropdown.js v2.3.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
4
4
|
* ============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -53,9 +53,10 @@
|
|
53
53
|
|
54
54
|
if (!isActive) {
|
55
55
|
$parent.toggleClass('open')
|
56
|
-
$this.focus()
|
57
56
|
}
|
58
57
|
|
58
|
+
$this.focus()
|
59
|
+
|
59
60
|
return false
|
60
61
|
}
|
61
62
|
|
@@ -80,9 +81,12 @@
|
|
80
81
|
|
81
82
|
isActive = $parent.hasClass('open')
|
82
83
|
|
83
|
-
if (!isActive || (isActive && e.keyCode == 27))
|
84
|
+
if (!isActive || (isActive && e.keyCode == 27)) {
|
85
|
+
if (e.which == 27) $parent.find(toggle).focus()
|
86
|
+
return $this.click()
|
87
|
+
}
|
84
88
|
|
85
|
-
$items = $('[role=menu] li:not(.divider) a', $parent)
|
89
|
+
$items = $('[role=menu] li:not(.divider):visible a', $parent)
|
86
90
|
|
87
91
|
if (!$items.length) return
|
88
92
|
|
@@ -100,8 +104,9 @@
|
|
100
104
|
}
|
101
105
|
|
102
106
|
function clearMenus() {
|
103
|
-
|
104
|
-
.removeClass('open')
|
107
|
+
$(toggle).each(function () {
|
108
|
+
getParent($(this)).removeClass('open')
|
109
|
+
})
|
105
110
|
}
|
106
111
|
|
107
112
|
function getParent($this) {
|
@@ -113,8 +118,9 @@
|
|
113
118
|
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
114
119
|
}
|
115
120
|
|
116
|
-
$parent = $(selector)
|
117
|
-
|
121
|
+
$parent = selector && $(selector)
|
122
|
+
|
123
|
+
if (!$parent || !$parent.length) $parent = $this.parent()
|
118
124
|
|
119
125
|
return $parent
|
120
126
|
}
|
@@ -123,6 +129,8 @@
|
|
123
129
|
/* DROPDOWN PLUGIN DEFINITION
|
124
130
|
* ========================== */
|
125
131
|
|
132
|
+
var old = $.fn.dropdown
|
133
|
+
|
126
134
|
$.fn.dropdown = function (option) {
|
127
135
|
return this.each(function () {
|
128
136
|
var $this = $(this)
|
@@ -135,16 +143,23 @@
|
|
135
143
|
$.fn.dropdown.Constructor = Dropdown
|
136
144
|
|
137
145
|
|
146
|
+
/* DROPDOWN NO CONFLICT
|
147
|
+
* ==================== */
|
148
|
+
|
149
|
+
$.fn.dropdown.noConflict = function () {
|
150
|
+
$.fn.dropdown = old
|
151
|
+
return this
|
152
|
+
}
|
153
|
+
|
154
|
+
|
138
155
|
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
139
156
|
* =================================== */
|
140
157
|
|
141
|
-
$(
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
148
|
-
})
|
158
|
+
$(document)
|
159
|
+
.on('click.dropdown.data-api', clearMenus)
|
160
|
+
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
161
|
+
.on('click.dropdown-menu', function (e) { e.stopPropagation() })
|
162
|
+
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
163
|
+
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
149
164
|
|
150
|
-
}(window.jQuery);
|
165
|
+
}(window.jQuery);
|