less-rails-bootstrap 2.3.3 → 3.0.0.rc1
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.
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +7 -11
- data/lib/less/rails/bootstrap/version.rb +1 -1
- data/scripts/update_bootstrap.sh +37 -8
- data/test/cases/usage_css_spec.rb +15 -12
- data/test/cases/usage_js_spec.rb +4 -4
- data/test/dummy_app/app/assets/stylesheets/fonts.css.less +2 -0
- data/test/dummy_app/app/assets/stylesheets/framework.css.less +4 -2
- data/test/dummy_app/app/assets/stylesheets/individual.css.less +2 -2
- data/test/spec_helper.rb +1 -2
- data/vendor/assets/javascripts/twitter/bootstrap.js +0 -1
- data/vendor/assets/javascripts/twitter/bootstrap/affix.js +58 -49
- data/vendor/assets/javascripts/twitter/bootstrap/alert.js +36 -37
- data/vendor/assets/javascripts/twitter/bootstrap/button.js +41 -39
- data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +131 -125
- data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +108 -96
- data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +72 -87
- data/vendor/assets/javascripts/twitter/bootstrap/modal.js +149 -155
- data/vendor/assets/javascripts/twitter/bootstrap/popover.js +60 -59
- data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +103 -107
- data/vendor/assets/javascripts/twitter/bootstrap/tab.js +73 -82
- data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +258 -255
- data/vendor/assets/javascripts/twitter/bootstrap/transition.js +34 -38
- data/vendor/frameworks/twitter/bootstrap/accordion.less +9 -12
- data/vendor/frameworks/twitter/bootstrap/alerts.less +43 -53
- data/vendor/frameworks/twitter/bootstrap/bootstrap.less +21 -21
- data/vendor/frameworks/twitter/bootstrap/breadcrumbs.less +7 -8
- data/vendor/frameworks/twitter/bootstrap/button-groups.less +93 -151
- data/vendor/frameworks/twitter/bootstrap/buttons.less +93 -164
- data/vendor/frameworks/twitter/bootstrap/carousel.less +110 -63
- data/vendor/frameworks/twitter/bootstrap/close.less +18 -17
- data/vendor/frameworks/twitter/bootstrap/code.less +14 -20
- data/vendor/frameworks/twitter/bootstrap/component-animations.less +10 -3
- data/vendor/frameworks/twitter/bootstrap/dropdowns.less +66 -143
- data/vendor/frameworks/twitter/bootstrap/forms.less +281 -548
- data/vendor/frameworks/twitter/bootstrap/grid.less +194 -11
- data/vendor/frameworks/twitter/bootstrap/media.less +8 -7
- data/vendor/frameworks/twitter/bootstrap/mixins.less +290 -446
- data/vendor/frameworks/twitter/bootstrap/modals.less +92 -51
- data/vendor/frameworks/twitter/bootstrap/navbar.less +285 -402
- data/vendor/frameworks/twitter/bootstrap/navs.less +176 -348
- data/vendor/frameworks/twitter/bootstrap/pager.less +45 -33
- data/vendor/frameworks/twitter/bootstrap/pagination.less +89 -104
- data/vendor/frameworks/twitter/bootstrap/popovers.less +53 -51
- data/vendor/frameworks/twitter/bootstrap/progress-bars.less +28 -45
- data/vendor/frameworks/twitter/bootstrap/responsive-utilities.less +92 -32
- data/vendor/frameworks/twitter/bootstrap/scaffolding.less +60 -18
- data/vendor/frameworks/twitter/bootstrap/tables.less +131 -164
- data/vendor/frameworks/twitter/bootstrap/thumbnails.less +20 -31
- data/vendor/frameworks/twitter/bootstrap/tooltip.less +45 -20
- data/vendor/frameworks/twitter/bootstrap/type.less +84 -99
- data/vendor/frameworks/twitter/bootstrap/utilities.less +17 -5
- data/vendor/frameworks/twitter/bootstrap/variables.less +446 -179
- data/vendor/frameworks/twitter/bootstrap/wells.less +5 -5
- metadata +41 -44
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
- data/vendor/assets/stylesheets/twitter/bootstrap-responsive.css.less +0 -1
- data/vendor/assets/stylesheets/twitter/bootstrap.css.less +0 -1
- data/vendor/frameworks/twitter/bootstrap.less +0 -1
- data/vendor/frameworks/twitter/bootstrap/hero-unit.less +0 -25
- data/vendor/frameworks/twitter/bootstrap/labels-badges.less +0 -84
- data/vendor/frameworks/twitter/bootstrap/layouts.less +0 -16
- data/vendor/frameworks/twitter/bootstrap/reset.less +0 -216
- data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.less +0 -28
- data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.less +0 -193
- data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.less +0 -19
- data/vendor/frameworks/twitter/bootstrap/responsive-navbar.less +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive.less +0 -48
- data/vendor/frameworks/twitter/bootstrap/sprites.less +0 -197
@@ -1,8 +1,8 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://
|
4
|
-
*
|
5
|
-
* Copyright
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: alert.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#alerts
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2013 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -15,66 +15,65 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* ALERT CLASS DEFINITION
|
27
|
-
* ====================== */
|
23
|
+
// ALERT CLASS DEFINITION
|
24
|
+
// ======================
|
28
25
|
|
29
26
|
var dismiss = '[data-dismiss="alert"]'
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
var Alert = function (el) {
|
28
|
+
$(el).on('click', dismiss, this.close)
|
29
|
+
}
|
33
30
|
|
34
31
|
Alert.prototype.close = function (e) {
|
35
|
-
var $this
|
36
|
-
|
37
|
-
, $parent
|
32
|
+
var $this = $(this)
|
33
|
+
var selector = $this.attr('data-target')
|
38
34
|
|
39
35
|
if (!selector) {
|
40
36
|
selector = $this.attr('href')
|
41
|
-
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
37
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
42
38
|
}
|
43
39
|
|
44
|
-
$parent = $(selector)
|
40
|
+
var $parent = $(selector)
|
45
41
|
|
46
|
-
e
|
42
|
+
if (e) e.preventDefault()
|
47
43
|
|
48
|
-
|
44
|
+
if (!$parent.length) {
|
45
|
+
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
46
|
+
}
|
49
47
|
|
50
|
-
$parent.trigger(e = $.Event('close'))
|
48
|
+
$parent.trigger(e = $.Event('close.bs.alert'))
|
51
49
|
|
52
50
|
if (e.isDefaultPrevented()) return
|
53
51
|
|
54
52
|
$parent.removeClass('in')
|
55
53
|
|
56
54
|
function removeElement() {
|
57
|
-
$parent
|
58
|
-
.trigger('closed')
|
59
|
-
.remove()
|
55
|
+
$parent.trigger('closed.bs.alert').remove()
|
60
56
|
}
|
61
57
|
|
62
58
|
$.support.transition && $parent.hasClass('fade') ?
|
63
|
-
$parent
|
59
|
+
$parent
|
60
|
+
.one($.support.transition.end, removeElement)
|
61
|
+
.emulateTransitionEnd(150) :
|
64
62
|
removeElement()
|
65
63
|
}
|
66
64
|
|
67
65
|
|
68
|
-
|
69
|
-
|
66
|
+
// ALERT PLUGIN DEFINITION
|
67
|
+
// =======================
|
70
68
|
|
71
69
|
var old = $.fn.alert
|
72
70
|
|
73
71
|
$.fn.alert = function (option) {
|
74
72
|
return this.each(function () {
|
75
73
|
var $this = $(this)
|
76
|
-
|
77
|
-
|
74
|
+
var data = $this.data('bs.alert')
|
75
|
+
|
76
|
+
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
78
77
|
if (typeof option == 'string') data[option].call($this)
|
79
78
|
})
|
80
79
|
}
|
@@ -82,8 +81,8 @@
|
|
82
81
|
$.fn.alert.Constructor = Alert
|
83
82
|
|
84
83
|
|
85
|
-
|
86
|
-
|
84
|
+
// ALERT NO CONFLICT
|
85
|
+
// =================
|
87
86
|
|
88
87
|
$.fn.alert.noConflict = function () {
|
89
88
|
$.fn.alert = old
|
@@ -91,9 +90,9 @@
|
|
91
90
|
}
|
92
91
|
|
93
92
|
|
94
|
-
|
95
|
-
|
93
|
+
// ALERT DATA-API
|
94
|
+
// ==============
|
96
95
|
|
97
|
-
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
|
96
|
+
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
98
97
|
|
99
|
-
}(window.jQuery);
|
98
|
+
}(window.jQuery);
|
@@ -1,8 +1,8 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://
|
4
|
-
*
|
5
|
-
* Copyright
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: button.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#buttons
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2013 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -15,30 +15,32 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* BUTTON PUBLIC CLASS DEFINITION
|
27
|
-
* ============================== */
|
23
|
+
// BUTTON PUBLIC CLASS DEFINITION
|
24
|
+
// ==============================
|
28
25
|
|
29
26
|
var Button = function (element, options) {
|
30
27
|
this.$element = $(element)
|
31
|
-
this.options
|
28
|
+
this.options = $.extend({}, Button.DEFAULTS, options)
|
29
|
+
}
|
30
|
+
|
31
|
+
Button.DEFAULTS = {
|
32
|
+
loadingText: 'loading...'
|
32
33
|
}
|
33
34
|
|
34
35
|
Button.prototype.setState = function (state) {
|
35
|
-
var d
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
var d = 'disabled'
|
37
|
+
var $el = this.$element
|
38
|
+
var val = $el.is('input') ? 'val' : 'html'
|
39
|
+
var data = $el.data()
|
39
40
|
|
40
41
|
state = state + 'Text'
|
41
|
-
|
42
|
+
|
43
|
+
if (!data.resetText) $el.data('resetText', $el[val]())
|
42
44
|
|
43
45
|
$el[val](data[state] || this.options[state])
|
44
46
|
|
@@ -46,46 +48,45 @@
|
|
46
48
|
setTimeout(function () {
|
47
49
|
state == 'loadingText' ?
|
48
50
|
$el.addClass(d).attr(d, d) :
|
49
|
-
$el.removeClass(d).removeAttr(d)
|
51
|
+
$el.removeClass(d).removeAttr(d);
|
50
52
|
}, 0)
|
51
53
|
}
|
52
54
|
|
53
55
|
Button.prototype.toggle = function () {
|
54
|
-
var $parent = this.$element.closest('[data-toggle="buttons
|
56
|
+
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
55
57
|
|
56
|
-
$parent
|
57
|
-
.find('.active')
|
58
|
-
.removeClass('active')
|
58
|
+
if ($parent.length) {
|
59
|
+
var $input = this.$element.find('input').prop('checked', !this.$element.hasClass('active'))
|
60
|
+
if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
|
61
|
+
}
|
59
62
|
|
60
63
|
this.$element.toggleClass('active')
|
61
64
|
}
|
62
65
|
|
63
66
|
|
64
|
-
|
65
|
-
|
67
|
+
// BUTTON PLUGIN DEFINITION
|
68
|
+
// ========================
|
66
69
|
|
67
70
|
var old = $.fn.button
|
68
71
|
|
69
72
|
$.fn.button = function (option) {
|
70
73
|
return this.each(function () {
|
71
|
-
var $this
|
72
|
-
|
73
|
-
|
74
|
-
|
74
|
+
var $this = $(this)
|
75
|
+
var data = $this.data('button')
|
76
|
+
var options = typeof option == 'object' && option
|
77
|
+
|
78
|
+
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
79
|
+
|
75
80
|
if (option == 'toggle') data.toggle()
|
76
81
|
else if (option) data.setState(option)
|
77
82
|
})
|
78
83
|
}
|
79
84
|
|
80
|
-
$.fn.button.defaults = {
|
81
|
-
loadingText: 'loading...'
|
82
|
-
}
|
83
|
-
|
84
85
|
$.fn.button.Constructor = Button
|
85
86
|
|
86
87
|
|
87
|
-
|
88
|
-
|
88
|
+
// BUTTON NO CONFLICT
|
89
|
+
// ==================
|
89
90
|
|
90
91
|
$.fn.button.noConflict = function () {
|
91
92
|
$.fn.button = old
|
@@ -93,13 +94,14 @@
|
|
93
94
|
}
|
94
95
|
|
95
96
|
|
96
|
-
|
97
|
-
|
97
|
+
// BUTTON DATA-API
|
98
|
+
// ===============
|
98
99
|
|
99
|
-
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
|
100
|
+
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
|
100
101
|
var $btn = $(e.target)
|
101
102
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
102
103
|
$btn.button('toggle')
|
104
|
+
e.preventDefault()
|
103
105
|
})
|
104
106
|
|
105
|
-
}(window.jQuery);
|
107
|
+
}(window.jQuery);
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://
|
4
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: carousel.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#carousel
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,193 +15,199 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* CAROUSEL CLASS DEFINITION
|
27
|
-
* ========================= */
|
23
|
+
// CAROUSEL CLASS DEFINITION
|
24
|
+
// =========================
|
28
25
|
|
29
26
|
var Carousel = function (element, options) {
|
30
|
-
this.$element
|
27
|
+
this.$element = $(element)
|
31
28
|
this.$indicators = this.$element.find('.carousel-indicators')
|
32
|
-
this.options
|
29
|
+
this.options = options
|
30
|
+
this.paused =
|
31
|
+
this.sliding =
|
32
|
+
this.interval =
|
33
|
+
this.$active =
|
34
|
+
this.$items = null
|
35
|
+
|
33
36
|
this.options.pause == 'hover' && this.$element
|
34
37
|
.on('mouseenter', $.proxy(this.pause, this))
|
35
38
|
.on('mouseleave', $.proxy(this.cycle, this))
|
36
39
|
}
|
37
40
|
|
38
|
-
Carousel.
|
41
|
+
Carousel.DEFAULTS = {
|
42
|
+
interval: 5000
|
43
|
+
, pause: 'hover'
|
44
|
+
}
|
39
45
|
|
40
|
-
|
41
|
-
|
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
|
-
}
|
46
|
+
Carousel.prototype.cycle = function (e) {
|
47
|
+
e || (this.paused = false)
|
48
48
|
|
49
|
-
|
50
|
-
this.$active = this.$element.find('.item.active')
|
51
|
-
this.$items = this.$active.parent().children()
|
52
|
-
return this.$items.index(this.$active)
|
53
|
-
}
|
49
|
+
this.interval && clearInterval(this.interval)
|
54
50
|
|
55
|
-
|
56
|
-
|
57
|
-
|
51
|
+
this.options.interval
|
52
|
+
&& !this.paused
|
53
|
+
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
58
54
|
|
59
|
-
|
55
|
+
return this
|
56
|
+
}
|
60
57
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
})
|
65
|
-
}
|
58
|
+
Carousel.prototype.getActiveIndex = function () {
|
59
|
+
this.$active = this.$element.find('.item.active')
|
60
|
+
this.$items = this.$active.parent().children()
|
66
61
|
|
67
|
-
|
68
|
-
|
69
|
-
}
|
62
|
+
return this.$items.index(this.$active)
|
63
|
+
}
|
70
64
|
|
71
|
-
|
72
|
-
|
65
|
+
Carousel.prototype.to = function (pos) {
|
66
|
+
var that = this
|
67
|
+
var activeIndex = this.getActiveIndex()
|
73
68
|
|
74
|
-
|
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
|
-
}
|
69
|
+
if (pos > (this.$items.length - 1) || pos < 0) return
|
84
70
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
71
|
+
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
|
72
|
+
if (activeIndex == pos) return this.pause().cycle()
|
73
|
+
|
74
|
+
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
75
|
+
}
|
76
|
+
|
77
|
+
Carousel.prototype.pause = function (e) {
|
78
|
+
e || (this.paused = true)
|
89
79
|
|
90
|
-
|
91
|
-
|
92
|
-
|
80
|
+
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
81
|
+
this.$element.trigger($.support.transition.end)
|
82
|
+
this.cycle(true)
|
93
83
|
}
|
94
84
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
85
|
+
this.interval = clearInterval(this.interval)
|
86
|
+
|
87
|
+
return this
|
88
|
+
}
|
89
|
+
|
90
|
+
Carousel.prototype.next = function () {
|
91
|
+
if (this.sliding) return
|
92
|
+
return this.slide('next')
|
93
|
+
}
|
94
|
+
|
95
|
+
Carousel.prototype.prev = function () {
|
96
|
+
if (this.sliding) return
|
97
|
+
return this.slide('prev')
|
98
|
+
}
|
103
99
|
|
104
|
-
|
100
|
+
Carousel.prototype.slide = function (type, next) {
|
101
|
+
var $active = this.$element.find('.item.active')
|
102
|
+
var $next = next || $active[type]()
|
103
|
+
var isCycling = this.interval
|
104
|
+
var direction = type == 'next' ? 'left' : 'right'
|
105
|
+
var fallback = type == 'next' ? 'first' : 'last'
|
106
|
+
var that = this
|
105
107
|
|
106
|
-
|
108
|
+
this.sliding = true
|
107
109
|
|
108
|
-
|
110
|
+
isCycling && this.pause()
|
109
111
|
|
110
|
-
|
111
|
-
relatedTarget: $next[0]
|
112
|
-
, direction: direction
|
113
|
-
})
|
112
|
+
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
114
113
|
|
115
|
-
|
114
|
+
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
116
115
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
116
|
+
if ($next.hasClass('active')) return
|
117
|
+
|
118
|
+
if (this.$indicators.length) {
|
119
|
+
this.$indicators.find('.active').removeClass('active')
|
120
|
+
this.$element.one('slid', function () {
|
121
|
+
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
122
|
+
$nextIndicator && $nextIndicator.addClass('active')
|
123
|
+
})
|
124
|
+
}
|
125
|
+
|
126
|
+
if ($.support.transition && this.$element.hasClass('slide')) {
|
127
|
+
this.$element.trigger(e)
|
128
|
+
if (e.isDefaultPrevented()) return
|
129
|
+
$next.addClass(type)
|
130
|
+
$next[0].offsetWidth // force reflow
|
131
|
+
$active.addClass(direction)
|
132
|
+
$next.addClass(direction)
|
133
|
+
$active
|
134
|
+
.one($.support.transition.end, function () {
|
133
135
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
134
136
|
$active.removeClass(['active', direction].join(' '))
|
135
137
|
that.sliding = false
|
136
138
|
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
137
139
|
})
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
isCycling && this.cycle()
|
148
|
-
|
149
|
-
return this
|
140
|
+
.emulateTransitionEnd(600)
|
141
|
+
} else {
|
142
|
+
this.$element.trigger(e)
|
143
|
+
if (e.isDefaultPrevented()) return
|
144
|
+
$active.removeClass('active')
|
145
|
+
$next.addClass('active')
|
146
|
+
this.sliding = false
|
147
|
+
this.$element.trigger('slid')
|
150
148
|
}
|
151
149
|
|
150
|
+
isCycling && this.cycle()
|
151
|
+
|
152
|
+
return this
|
152
153
|
}
|
153
154
|
|
154
155
|
|
155
|
-
|
156
|
-
|
156
|
+
// CAROUSEL PLUGIN DEFINITION
|
157
|
+
// ==========================
|
157
158
|
|
158
159
|
var old = $.fn.carousel
|
159
160
|
|
160
161
|
$.fn.carousel = function (option) {
|
161
162
|
return this.each(function () {
|
162
|
-
var $this
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
163
|
+
var $this = $(this)
|
164
|
+
var data = $this.data('bs.carousel')
|
165
|
+
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
166
|
+
var action = typeof option == 'string' ? option : options.slide
|
167
|
+
|
168
|
+
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
167
169
|
if (typeof option == 'number') data.to(option)
|
168
170
|
else if (action) data[action]()
|
169
171
|
else if (options.interval) data.pause().cycle()
|
170
172
|
})
|
171
173
|
}
|
172
174
|
|
173
|
-
$.fn.carousel.defaults = {
|
174
|
-
interval: 5000
|
175
|
-
, pause: 'hover'
|
176
|
-
}
|
177
|
-
|
178
175
|
$.fn.carousel.Constructor = Carousel
|
179
176
|
|
180
177
|
|
181
|
-
|
182
|
-
|
178
|
+
// CAROUSEL NO CONFLICT
|
179
|
+
// ====================
|
183
180
|
|
184
181
|
$.fn.carousel.noConflict = function () {
|
185
182
|
$.fn.carousel = old
|
186
183
|
return this
|
187
184
|
}
|
188
185
|
|
189
|
-
/* CAROUSEL DATA-API
|
190
|
-
* ================= */
|
191
186
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
187
|
+
// CAROUSEL DATA-API
|
188
|
+
// =================
|
189
|
+
|
190
|
+
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
191
|
+
var $this = $(this), href
|
192
|
+
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
193
|
+
var options = $.extend({}, $target.data(), $this.data())
|
194
|
+
var slideIndex = $this.attr('data-slide-to')
|
195
|
+
if (slideIndex) options.interval = false
|
197
196
|
|
198
197
|
$target.carousel(options)
|
199
198
|
|
200
199
|
if (slideIndex = $this.attr('data-slide-to')) {
|
201
|
-
$target.data('carousel').
|
200
|
+
$target.data('bs.carousel').to(slideIndex)
|
202
201
|
}
|
203
202
|
|
204
203
|
e.preventDefault()
|
205
204
|
})
|
206
205
|
|
207
|
-
|
206
|
+
$(window).on('load', function () {
|
207
|
+
$('[data-ride="carousel"]').each(function () {
|
208
|
+
var $carousel = $(this)
|
209
|
+
$carousel.carousel($carousel.data())
|
210
|
+
})
|
211
|
+
})
|
212
|
+
|
213
|
+
}(window.jQuery);
|