bootstrapped-rails 2.0.8.1 → 2.0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bootstrapped-rails/version.rb +1 -1
- metadata +7 -112
- data/vendor/assets/twitter/.gitignore +0 -33
- data/vendor/assets/twitter/LICENSE +0 -13
- data/vendor/assets/twitter/Makefile +0 -59
- data/vendor/assets/twitter/README.md +0 -94
- data/vendor/assets/twitter/img/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/twitter/img/glyphicons-halflings.png +0 -0
- data/vendor/assets/twitter/js/README.md +0 -106
- data/vendor/assets/twitter/js/bootstrap-alert.js +0 -91
- data/vendor/assets/twitter/js/bootstrap-button.js +0 -98
- data/vendor/assets/twitter/js/bootstrap-carousel.js +0 -154
- data/vendor/assets/twitter/js/bootstrap-collapse.js +0 -136
- data/vendor/assets/twitter/js/bootstrap-dropdown.js +0 -92
- data/vendor/assets/twitter/js/bootstrap-modal.js +0 -209
- data/vendor/assets/twitter/js/bootstrap-popover.js +0 -95
- data/vendor/assets/twitter/js/bootstrap-scrollspy.js +0 -125
- data/vendor/assets/twitter/js/bootstrap-tab.js +0 -130
- data/vendor/assets/twitter/js/bootstrap-tooltip.js +0 -270
- data/vendor/assets/twitter/js/bootstrap-transition.js +0 -51
- data/vendor/assets/twitter/js/bootstrap-typeahead.js +0 -271
- data/vendor/assets/twitter/js/tests/index.html +0 -49
- data/vendor/assets/twitter/js/tests/unit/bootstrap-alert.js +0 -41
- data/vendor/assets/twitter/js/tests/unit/bootstrap-button.js +0 -54
- data/vendor/assets/twitter/js/tests/unit/bootstrap-collapse.js +0 -25
- data/vendor/assets/twitter/js/tests/unit/bootstrap-dropdown.js +0 -53
- data/vendor/assets/twitter/js/tests/unit/bootstrap-modal.js +0 -85
- data/vendor/assets/twitter/js/tests/unit/bootstrap-popover.js +0 -93
- data/vendor/assets/twitter/js/tests/unit/bootstrap-scrollspy.js +0 -31
- data/vendor/assets/twitter/js/tests/unit/bootstrap-tab.js +0 -45
- data/vendor/assets/twitter/js/tests/unit/bootstrap-tooltip.js +0 -62
- data/vendor/assets/twitter/js/tests/unit/bootstrap-transition.js +0 -13
- data/vendor/assets/twitter/js/tests/unit/bootstrap-typeahead.js +0 -128
- data/vendor/assets/twitter/js/tests/vendor/jquery.js +0 -9252
- data/vendor/assets/twitter/js/tests/vendor/qunit.css +0 -232
- data/vendor/assets/twitter/js/tests/vendor/qunit.js +0 -1510
- data/vendor/assets/twitter/scss/accordion.scss +0 -28
- data/vendor/assets/twitter/scss/alerts.scss +0 -70
- data/vendor/assets/twitter/scss/bootstrap.scss +0 -62
- data/vendor/assets/twitter/scss/breadcrumbs.scss +0 -22
- data/vendor/assets/twitter/scss/button-groups.scss +0 -147
- data/vendor/assets/twitter/scss/buttons.scss +0 -168
- data/vendor/assets/twitter/scss/carousel.scss +0 -121
- data/vendor/assets/twitter/scss/close.scss +0 -18
- data/vendor/assets/twitter/scss/code.scss +0 -44
- data/vendor/assets/twitter/scss/component-animations.scss +0 -18
- data/vendor/assets/twitter/scss/dropdowns.scss +0 -131
- data/vendor/assets/twitter/scss/forms.scss +0 -516
- data/vendor/assets/twitter/scss/grid.scss +0 -8
- data/vendor/assets/twitter/scss/hero-unit.scss +0 -20
- data/vendor/assets/twitter/scss/labels.scss +0 -16
- data/vendor/assets/twitter/scss/layouts.scss +0 -17
- data/vendor/assets/twitter/scss/mixins.scss +0 -500
- data/vendor/assets/twitter/scss/modals.scss +0 -72
- data/vendor/assets/twitter/scss/navbar.scss +0 -292
- data/vendor/assets/twitter/scss/navs.scss +0 -344
- data/vendor/assets/twitter/scss/pager.scss +0 -30
- data/vendor/assets/twitter/scss/pagination.scss +0 -55
- data/vendor/assets/twitter/scss/popovers.scss +0 -49
- data/vendor/assets/twitter/scss/progress-bars.scss +0 -95
- data/vendor/assets/twitter/scss/reset.scss +0 -126
- data/vendor/assets/twitter/scss/responsive.scss +0 -323
- data/vendor/assets/twitter/scss/scaffolding.scss +0 -29
- data/vendor/assets/twitter/scss/sprites.scss +0 -158
- data/vendor/assets/twitter/scss/tables.scss +0 -130
- data/vendor/assets/twitter/scss/thumbnails.scss +0 -35
- data/vendor/assets/twitter/scss/tooltip.scss +0 -35
- data/vendor/assets/twitter/scss/type.scss +0 -217
- data/vendor/assets/twitter/scss/utilities.scss +0 -23
- data/vendor/assets/twitter/scss/variables.scss +0 -99
- data/vendor/assets/twitter/scss/wells.scss +0 -17
- data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -28
- data/vendor/toolkit/twitter/bootstrap/alerts.less +0 -70
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +0 -62
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +0 -22
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +0 -148
- data/vendor/toolkit/twitter/bootstrap/buttons.less +0 -183
- data/vendor/toolkit/twitter/bootstrap/carousel.less +0 -121
- data/vendor/toolkit/twitter/bootstrap/close.less +0 -18
- data/vendor/toolkit/twitter/bootstrap/code.less +0 -57
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +0 -18
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +0 -130
- data/vendor/toolkit/twitter/bootstrap/forms.less +0 -522
- data/vendor/toolkit/twitter/bootstrap/grid.less +0 -8
- data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -20
- data/vendor/toolkit/twitter/bootstrap/labels.less +0 -32
- data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -17
- data/vendor/toolkit/twitter/bootstrap/mixins.less +0 -590
- data/vendor/toolkit/twitter/bootstrap/modals.less +0 -83
- data/vendor/toolkit/twitter/bootstrap/navbar.less +0 -299
- data/vendor/toolkit/twitter/bootstrap/navs.less +0 -353
- data/vendor/toolkit/twitter/bootstrap/pager.less +0 -30
- data/vendor/toolkit/twitter/bootstrap/pagination.less +0 -55
- data/vendor/toolkit/twitter/bootstrap/popovers.less +0 -49
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +0 -95
- data/vendor/toolkit/twitter/bootstrap/reset.less +0 -126
- data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -327
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +0 -29
- data/vendor/toolkit/twitter/bootstrap/sprites.less +0 -158
- data/vendor/toolkit/twitter/bootstrap/tables.less +0 -150
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +0 -35
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +0 -35
- data/vendor/toolkit/twitter/bootstrap/type.less +0 -218
- data/vendor/toolkit/twitter/bootstrap/utilities.less +0 -23
- data/vendor/toolkit/twitter/bootstrap/variables.less +0 -107
- data/vendor/toolkit/twitter/bootstrap/wells.less +0 -17
- data/vendor/toolkit/twitter/bootstrap_base.less +0 -2
@@ -1,271 +0,0 @@
|
|
1
|
-
/* =============================================================
|
2
|
-
* bootstrap-typeahead.js v2.0.0
|
3
|
-
* http://twitter.github.com/bootstrap/javascript.html#typeahead
|
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
|
-
!function( $ ){
|
21
|
-
|
22
|
-
"use strict"
|
23
|
-
|
24
|
-
var Typeahead = function ( element, options ) {
|
25
|
-
this.$element = $(element)
|
26
|
-
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
27
|
-
this.matcher = this.options.matcher || this.matcher
|
28
|
-
this.sorter = this.options.sorter || this.sorter
|
29
|
-
this.highlighter = this.options.highlighter || this.highlighter
|
30
|
-
this.$menu = $(this.options.menu).appendTo('body')
|
31
|
-
this.source = this.options.source
|
32
|
-
this.shown = false
|
33
|
-
this.listen()
|
34
|
-
}
|
35
|
-
|
36
|
-
Typeahead.prototype = {
|
37
|
-
|
38
|
-
constructor: Typeahead
|
39
|
-
|
40
|
-
, select: function () {
|
41
|
-
var val = this.$menu.find('.active').attr('data-value')
|
42
|
-
this.$element.val(val)
|
43
|
-
return this.hide()
|
44
|
-
}
|
45
|
-
|
46
|
-
, show: function () {
|
47
|
-
var pos = $.extend({}, this.$element.offset(), {
|
48
|
-
height: this.$element[0].offsetHeight
|
49
|
-
})
|
50
|
-
|
51
|
-
this.$menu.css({
|
52
|
-
top: pos.top + pos.height
|
53
|
-
, left: pos.left
|
54
|
-
})
|
55
|
-
|
56
|
-
this.$menu.show()
|
57
|
-
this.shown = true
|
58
|
-
return this
|
59
|
-
}
|
60
|
-
|
61
|
-
, hide: function () {
|
62
|
-
this.$menu.hide()
|
63
|
-
this.shown = false
|
64
|
-
return this
|
65
|
-
}
|
66
|
-
|
67
|
-
, lookup: function (event) {
|
68
|
-
var that = this
|
69
|
-
, items
|
70
|
-
, q
|
71
|
-
|
72
|
-
this.query = this.$element.val()
|
73
|
-
|
74
|
-
if (!this.query) {
|
75
|
-
return this.shown ? this.hide() : this
|
76
|
-
}
|
77
|
-
|
78
|
-
items = $.grep(this.source, function (item) {
|
79
|
-
if (that.matcher(item)) return item
|
80
|
-
})
|
81
|
-
|
82
|
-
items = this.sorter(items)
|
83
|
-
|
84
|
-
if (!items.length) {
|
85
|
-
return this.shown ? this.hide() : this
|
86
|
-
}
|
87
|
-
|
88
|
-
return this.render(items.slice(0, this.options.items)).show()
|
89
|
-
}
|
90
|
-
|
91
|
-
, matcher: function (item) {
|
92
|
-
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
|
93
|
-
}
|
94
|
-
|
95
|
-
, sorter: function (items) {
|
96
|
-
var beginswith = []
|
97
|
-
, caseSensitive = []
|
98
|
-
, caseInsensitive = []
|
99
|
-
, item
|
100
|
-
|
101
|
-
while (item = items.shift()) {
|
102
|
-
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
|
103
|
-
else if (~item.indexOf(this.query)) caseSensitive.push(item)
|
104
|
-
else caseInsensitive.push(item)
|
105
|
-
}
|
106
|
-
|
107
|
-
return beginswith.concat(caseSensitive, caseInsensitive)
|
108
|
-
}
|
109
|
-
|
110
|
-
, highlighter: function (item) {
|
111
|
-
return item.replace(new RegExp('(' + this.query + ')', 'ig'), function ($1, match) {
|
112
|
-
return '<strong>' + match + '</strong>'
|
113
|
-
})
|
114
|
-
}
|
115
|
-
|
116
|
-
, render: function (items) {
|
117
|
-
var that = this
|
118
|
-
|
119
|
-
items = $(items).map(function (i, item) {
|
120
|
-
i = $(that.options.item).attr('data-value', item)
|
121
|
-
i.find('a').html(that.highlighter(item))
|
122
|
-
return i[0]
|
123
|
-
})
|
124
|
-
|
125
|
-
items.first().addClass('active')
|
126
|
-
this.$menu.html(items)
|
127
|
-
return this
|
128
|
-
}
|
129
|
-
|
130
|
-
, next: function (event) {
|
131
|
-
var active = this.$menu.find('.active').removeClass('active')
|
132
|
-
, next = active.next()
|
133
|
-
|
134
|
-
if (!next.length) {
|
135
|
-
next = $(this.$menu.find('li')[0])
|
136
|
-
}
|
137
|
-
|
138
|
-
next.addClass('active')
|
139
|
-
}
|
140
|
-
|
141
|
-
, prev: function (event) {
|
142
|
-
var active = this.$menu.find('.active').removeClass('active')
|
143
|
-
, prev = active.prev()
|
144
|
-
|
145
|
-
if (!prev.length) {
|
146
|
-
prev = this.$menu.find('li').last()
|
147
|
-
}
|
148
|
-
|
149
|
-
prev.addClass('active')
|
150
|
-
}
|
151
|
-
|
152
|
-
, listen: function () {
|
153
|
-
this.$element
|
154
|
-
.on('blur', $.proxy(this.blur, this))
|
155
|
-
.on('keypress', $.proxy(this.keypress, this))
|
156
|
-
.on('keyup', $.proxy(this.keyup, this))
|
157
|
-
|
158
|
-
if ($.browser.webkit || $.browser.msie) {
|
159
|
-
this.$element.on('keydown', $.proxy(this.keypress, this))
|
160
|
-
}
|
161
|
-
|
162
|
-
this.$menu
|
163
|
-
.on('click', $.proxy(this.click, this))
|
164
|
-
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
165
|
-
}
|
166
|
-
|
167
|
-
, keyup: function (e) {
|
168
|
-
e.stopPropagation()
|
169
|
-
e.preventDefault()
|
170
|
-
|
171
|
-
switch(e.keyCode) {
|
172
|
-
case 40: // down arrow
|
173
|
-
case 38: // up arrow
|
174
|
-
break
|
175
|
-
|
176
|
-
case 9: // tab
|
177
|
-
case 13: // enter
|
178
|
-
if (!this.shown) return
|
179
|
-
this.select()
|
180
|
-
break
|
181
|
-
|
182
|
-
case 27: // escape
|
183
|
-
this.hide()
|
184
|
-
break
|
185
|
-
|
186
|
-
default:
|
187
|
-
this.lookup()
|
188
|
-
}
|
189
|
-
|
190
|
-
}
|
191
|
-
|
192
|
-
, keypress: function (e) {
|
193
|
-
e.stopPropagation()
|
194
|
-
if (!this.shown) return
|
195
|
-
|
196
|
-
switch(e.keyCode) {
|
197
|
-
case 9: // tab
|
198
|
-
case 13: // enter
|
199
|
-
case 27: // escape
|
200
|
-
e.preventDefault()
|
201
|
-
break
|
202
|
-
|
203
|
-
case 38: // up arrow
|
204
|
-
e.preventDefault()
|
205
|
-
this.prev()
|
206
|
-
break
|
207
|
-
|
208
|
-
case 40: // down arrow
|
209
|
-
e.preventDefault()
|
210
|
-
this.next()
|
211
|
-
break
|
212
|
-
}
|
213
|
-
}
|
214
|
-
|
215
|
-
, blur: function (e) {
|
216
|
-
var that = this
|
217
|
-
e.stopPropagation()
|
218
|
-
e.preventDefault()
|
219
|
-
setTimeout(function () { that.hide() }, 150)
|
220
|
-
}
|
221
|
-
|
222
|
-
, click: function (e) {
|
223
|
-
e.stopPropagation()
|
224
|
-
e.preventDefault()
|
225
|
-
this.select()
|
226
|
-
}
|
227
|
-
|
228
|
-
, mouseenter: function (e) {
|
229
|
-
this.$menu.find('.active').removeClass('active')
|
230
|
-
$(e.currentTarget).addClass('active')
|
231
|
-
}
|
232
|
-
|
233
|
-
}
|
234
|
-
|
235
|
-
|
236
|
-
/* TYPEAHEAD PLUGIN DEFINITION
|
237
|
-
* =========================== */
|
238
|
-
|
239
|
-
$.fn.typeahead = function ( option ) {
|
240
|
-
return this.each(function () {
|
241
|
-
var $this = $(this)
|
242
|
-
, data = $this.data('typeahead')
|
243
|
-
, options = typeof option == 'object' && option
|
244
|
-
if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
|
245
|
-
if (typeof option == 'string') data[option]()
|
246
|
-
})
|
247
|
-
}
|
248
|
-
|
249
|
-
$.fn.typeahead.defaults = {
|
250
|
-
source: []
|
251
|
-
, items: 8
|
252
|
-
, menu: '<ul class="typeahead dropdown-menu"></ul>'
|
253
|
-
, item: '<li><a href="#"></a></li>'
|
254
|
-
}
|
255
|
-
|
256
|
-
$.fn.typeahead.Constructor = Typeahead
|
257
|
-
|
258
|
-
|
259
|
-
/* TYPEAHEAD DATA-API
|
260
|
-
* ================== */
|
261
|
-
|
262
|
-
$(function () {
|
263
|
-
$('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
|
264
|
-
var $this = $(this)
|
265
|
-
if ($this.data('typeahead')) return
|
266
|
-
e.preventDefault()
|
267
|
-
$this.typeahead($this.data())
|
268
|
-
})
|
269
|
-
})
|
270
|
-
|
271
|
-
}( window.jQuery )
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<!DOCTYPE HTML>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Bootstrap Plugin Test Suite</title>
|
5
|
-
|
6
|
-
<!-- jquery -->
|
7
|
-
<!--<script src="http://code.jquery.com/jquery-1.7.min.js"></script>-->
|
8
|
-
<script src="vendor/jquery.js"></script>
|
9
|
-
|
10
|
-
<!-- qunit -->
|
11
|
-
<link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
|
12
|
-
<script src="vendor/qunit.js"></script>
|
13
|
-
|
14
|
-
<!-- plugin sources -->
|
15
|
-
<script src="../../js/bootstrap-transition.js"></script>
|
16
|
-
<script src="../../js/bootstrap-alert.js"></script>
|
17
|
-
<script src="../../js/bootstrap-button.js"></script>
|
18
|
-
<script src="../../js/bootstrap-collapse.js"></script>
|
19
|
-
<script src="../../js/bootstrap-dropdown.js"></script>
|
20
|
-
<script src="../../js/bootstrap-modal.js"></script>
|
21
|
-
<script src="../../js/bootstrap-scrollspy.js"></script>
|
22
|
-
<script src="../../js/bootstrap-tab.js"></script>
|
23
|
-
<script src="../../js/bootstrap-tooltip.js"></script>
|
24
|
-
<script src="../../js/bootstrap-popover.js"></script>
|
25
|
-
<script src="../../js/bootstrap-typeahead.js"></script>
|
26
|
-
|
27
|
-
<!-- unit tests -->
|
28
|
-
<script src="unit/bootstrap-transition.js"></script>
|
29
|
-
<script src="unit/bootstrap-alert.js"></script>
|
30
|
-
<script src="unit/bootstrap-button.js"></script>
|
31
|
-
<script src="unit/bootstrap-collapse.js"></script>
|
32
|
-
<script src="unit/bootstrap-dropdown.js"></script>
|
33
|
-
<script src="unit/bootstrap-modal.js"></script>
|
34
|
-
<script src="unit/bootstrap-scrollspy.js"></script>
|
35
|
-
<script src="unit/bootstrap-tab.js"></script>
|
36
|
-
<script src="unit/bootstrap-tooltip.js"></script>
|
37
|
-
<script src="unit/bootstrap-popover.js"></script>
|
38
|
-
<script src="unit/bootstrap-typeahead.js"></script>
|
39
|
-
|
40
|
-
<body>
|
41
|
-
<div>
|
42
|
-
<h1 id="qunit-header">Bootstrap Plugin Test Suite</h1>
|
43
|
-
<h2 id="qunit-banner"></h2>
|
44
|
-
<h2 id="qunit-userAgent"></h2>
|
45
|
-
<ol id="qunit-tests"></ol>
|
46
|
-
<div id="qunit-fixture"></div>
|
47
|
-
</div>
|
48
|
-
</body>
|
49
|
-
</html>
|
@@ -1,41 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-alerts")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
ok($(document.body).alert, 'alert method is defined')
|
7
|
-
})
|
8
|
-
|
9
|
-
test("should return element", function () {
|
10
|
-
ok($(document.body).alert()[0] == document.body, 'document.body returned')
|
11
|
-
})
|
12
|
-
|
13
|
-
test("should fade element out on clicking .close", function () {
|
14
|
-
var alertHTML = '<div class="alert-message warning fade in">'
|
15
|
-
+ '<a class="close" href="#" data-dismiss="alert">×</a>'
|
16
|
-
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.</p>'
|
17
|
-
+ '</div>'
|
18
|
-
, alert = $(alertHTML).alert()
|
19
|
-
|
20
|
-
alert.find('.close').click()
|
21
|
-
|
22
|
-
ok(!alert.hasClass('in'), 'remove .in class on .close click')
|
23
|
-
})
|
24
|
-
|
25
|
-
test("should remove element when clicking .close", function () {
|
26
|
-
$.support.transition = false
|
27
|
-
|
28
|
-
var alertHTML = '<div class="alert-message warning fade in">'
|
29
|
-
+ '<a class="close" href="#" data-dismiss="alert">×</a>'
|
30
|
-
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.</p>'
|
31
|
-
+ '</div>'
|
32
|
-
, alert = $(alertHTML).appendTo('#qunit-fixture').alert()
|
33
|
-
|
34
|
-
ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')
|
35
|
-
|
36
|
-
alert.find('.close').click()
|
37
|
-
|
38
|
-
ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
|
39
|
-
})
|
40
|
-
|
41
|
-
})
|
@@ -1,54 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-buttons")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
ok($(document.body).button, 'tabs method is defined')
|
7
|
-
})
|
8
|
-
|
9
|
-
test("should return element", function () {
|
10
|
-
ok($(document.body).button()[0] == document.body, 'document.body returned')
|
11
|
-
})
|
12
|
-
|
13
|
-
test("should return set state to loading", function () {
|
14
|
-
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
|
15
|
-
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
16
|
-
btn.button('loading')
|
17
|
-
equals(btn.html(), 'fat', 'btn text equals fat')
|
18
|
-
stop()
|
19
|
-
setTimeout(function () {
|
20
|
-
ok(btn.attr('disabled'), 'btn is disabled')
|
21
|
-
ok(btn.hasClass('disabled'), 'btn has disabled class')
|
22
|
-
start()
|
23
|
-
}, 0)
|
24
|
-
})
|
25
|
-
|
26
|
-
test("should return reset state", function () {
|
27
|
-
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
|
28
|
-
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
29
|
-
btn.button('loading')
|
30
|
-
equals(btn.html(), 'fat', 'btn text equals fat')
|
31
|
-
stop()
|
32
|
-
setTimeout(function () {
|
33
|
-
ok(btn.attr('disabled'), 'btn is disabled')
|
34
|
-
ok(btn.hasClass('disabled'), 'btn has disabled class')
|
35
|
-
start()
|
36
|
-
stop()
|
37
|
-
}, 0)
|
38
|
-
btn.button('reset')
|
39
|
-
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
40
|
-
setTimeout(function () {
|
41
|
-
ok(!btn.attr('disabled'), 'btn is not disabled')
|
42
|
-
ok(!btn.hasClass('disabled'), 'btn does not have disabled class')
|
43
|
-
start()
|
44
|
-
}, 0)
|
45
|
-
})
|
46
|
-
|
47
|
-
test("should toggle active", function () {
|
48
|
-
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
|
49
|
-
ok(!btn.hasClass('active'), 'btn does not have active class')
|
50
|
-
btn.button('toggle')
|
51
|
-
ok(btn.hasClass('active'), 'btn has class active')
|
52
|
-
})
|
53
|
-
|
54
|
-
})
|
@@ -1,25 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-collapse")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
ok($(document.body).collapse, 'collapse method is defined')
|
7
|
-
})
|
8
|
-
|
9
|
-
test("should return element", function () {
|
10
|
-
ok($(document.body).collapse()[0] == document.body, 'document.body returned')
|
11
|
-
})
|
12
|
-
|
13
|
-
test("should show a collapsed element", function () {
|
14
|
-
var el = $('<div class="collapse"></div>').collapse('show')
|
15
|
-
ok(el.hasClass('in'), 'has class in')
|
16
|
-
ok(/height/.test(el.attr('style')), 'has height set')
|
17
|
-
})
|
18
|
-
|
19
|
-
test("should hide a collapsed element", function () {
|
20
|
-
var el = $('<div class="collapse"></div>').collapse('hide')
|
21
|
-
ok(!el.hasClass('in'), 'does not have class in')
|
22
|
-
ok(/height/.test(el.attr('style')), 'has height set')
|
23
|
-
})
|
24
|
-
|
25
|
-
})
|
@@ -1,53 +0,0 @@
|
|
1
|
-
$(function () {
|
2
|
-
|
3
|
-
module("bootstrap-dropdowns")
|
4
|
-
|
5
|
-
test("should be defined on jquery object", function () {
|
6
|
-
ok($(document.body).dropdown, 'dropdown method is defined')
|
7
|
-
})
|
8
|
-
|
9
|
-
test("should return element", function () {
|
10
|
-
ok($(document.body).dropdown()[0] == document.body, 'document.body returned')
|
11
|
-
})
|
12
|
-
|
13
|
-
test("should add class open to menu if clicked", function () {
|
14
|
-
var dropdownHTML = '<ul class="tabs">'
|
15
|
-
+ '<li class="dropdown">'
|
16
|
-
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
|
17
|
-
+ '<ul class="dropdown-menu">'
|
18
|
-
+ '<li><a href="#">Secondary link</a></li>'
|
19
|
-
+ '<li><a href="#">Something else here</a></li>'
|
20
|
-
+ '<li class="divider"></li>'
|
21
|
-
+ '<li><a href="#">Another link</a></li>'
|
22
|
-
+ '</ul>'
|
23
|
-
+ '</li>'
|
24
|
-
+ '</ul>'
|
25
|
-
, dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
|
26
|
-
|
27
|
-
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
|
28
|
-
})
|
29
|
-
|
30
|
-
test("should remove open class if body clicked", function () {
|
31
|
-
var dropdownHTML = '<ul class="tabs">'
|
32
|
-
+ '<li class="dropdown">'
|
33
|
-
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
|
34
|
-
+ '<ul class="dropdown-menu">'
|
35
|
-
+ '<li><a href="#">Secondary link</a></li>'
|
36
|
-
+ '<li><a href="#">Something else here</a></li>'
|
37
|
-
+ '<li class="divider"></li>'
|
38
|
-
+ '<li><a href="#">Another link</a></li>'
|
39
|
-
+ '</ul>'
|
40
|
-
+ '</li>'
|
41
|
-
+ '</ul>'
|
42
|
-
, dropdown = $(dropdownHTML)
|
43
|
-
.appendTo('#qunit-fixture')
|
44
|
-
.find('[data-toggle="dropdown"]')
|
45
|
-
.dropdown()
|
46
|
-
.click()
|
47
|
-
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
|
48
|
-
$('body').click()
|
49
|
-
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class removed')
|
50
|
-
dropdown.remove()
|
51
|
-
})
|
52
|
-
|
53
|
-
})
|