anjlab-bootstrap-rails 2.3.1.2 → 3.0.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/Rakefile +42 -26
- data/lib/bootstrap-rails.rb +5 -6
- data/lib/bootstrap-rails/engine.rb +2 -9
- data/lib/bootstrap-rails/version.rb +1 -1
- data/test/test_helper.rb +2 -2
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.eot +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.otf +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.svg +175 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.ttf +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.woff +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap.js +4 -5
- data/vendor/assets/javascripts/twitter/bootstrap/affix.js +50 -47
- data/vendor/assets/javascripts/twitter/bootstrap/alert.js +32 -35
- data/vendor/assets/javascripts/twitter/bootstrap/button.js +37 -37
- data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +123 -127
- data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +81 -95
- data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +61 -81
- data/vendor/assets/javascripts/twitter/bootstrap/modal.js +146 -151
- data/vendor/assets/javascripts/twitter/bootstrap/popover.js +53 -58
- data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +99 -105
- data/vendor/assets/javascripts/twitter/bootstrap/tab.js +70 -81
- data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +246 -254
- data/vendor/assets/javascripts/twitter/bootstrap/transition.js +24 -37
- data/vendor/assets/stylesheets/twitter/bootstrap.scss +1 -1
- data/vendor/{frameworks/twitter/bootstrap/accordion.scss → assets/stylesheets/twitter/bootstrap/_accordion.scss} +2 -2
- data/vendor/assets/stylesheets/twitter/bootstrap/_alerts.scss +92 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_badges.scss +58 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_bootstrap.scss +64 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +28 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_button-groups.scss +170 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_buttons.scss +160 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_carousel.scss +191 -0
- data/vendor/{frameworks/twitter/bootstrap/close.scss → assets/stylesheets/twitter/bootstrap/_close.scss} +7 -6
- data/vendor/{frameworks/twitter/bootstrap/code.scss → assets/stylesheets/twitter/bootstrap/_code.scss} +14 -14
- data/vendor/{frameworks/twitter/bootstrap/component-animations.scss → assets/stylesheets/twitter/bootstrap/_component-animations.scss} +1 -0
- data/vendor/{frameworks/twitter/bootstrap/dropdowns.scss → assets/stylesheets/twitter/bootstrap/_dropdowns.scss} +46 -57
- data/vendor/assets/stylesheets/twitter/bootstrap/_forms.scss +464 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_glyphicons.scss +200 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_grid.scss +65 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_jumbotron.scss +32 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_labels.scss +70 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_list-group.scss +96 -0
- data/vendor/{frameworks/twitter/bootstrap/media.scss → assets/stylesheets/twitter/bootstrap/_media.scss} +0 -1
- data/vendor/assets/stylesheets/twitter/bootstrap/_mixins.scss +510 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_modals.scss +137 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_navbar.scss +356 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_navs.scss +249 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_normalize.scss +396 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_pager.scss +54 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_pagination.scss +87 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_panels.scss +96 -0
- data/vendor/{frameworks/twitter/bootstrap/popovers.scss → assets/stylesheets/twitter/bootstrap/_popovers.scss} +32 -32
- data/vendor/assets/stylesheets/twitter/bootstrap/_print.scss +74 -0
- data/vendor/{frameworks/twitter/bootstrap/progress-bars.scss → assets/stylesheets/twitter/bootstrap/_progress-bars.scss} +40 -44
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +77 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +83 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_tables.scss +242 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +43 -0
- data/vendor/{frameworks/twitter/bootstrap/tooltip.scss → assets/stylesheets/twitter/bootstrap/_tooltip.scss} +20 -19
- data/vendor/assets/stylesheets/twitter/bootstrap/_type.scss +253 -0
- data/vendor/{frameworks/twitter/bootstrap/utilities.scss → assets/stylesheets/twitter/bootstrap/_utilities.scss} +17 -5
- data/vendor/assets/stylesheets/twitter/bootstrap/_variables.scss +416 -0
- data/vendor/{frameworks/twitter/bootstrap/wells.scss → assets/stylesheets/twitter/bootstrap/_wells.scss} +5 -5
- metadata +49 -53
- data/lib/bootstrap-rails/ie_hex_str.rb +0 -16
- data/test/ie_hex_str_test.rb +0 -26
- data/vendor/assets/images/twitter/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
- data/vendor/assets/stylesheets/twitter/bootstrap-responsive.scss +0 -1
- data/vendor/frameworks/twitter/bootstrap.scss +0 -1
- data/vendor/frameworks/twitter/bootstrap/alerts.scss +0 -79
- data/vendor/frameworks/twitter/bootstrap/bootstrap.scss +0 -63
- data/vendor/frameworks/twitter/bootstrap/breadcrumbs.scss +0 -24
- data/vendor/frameworks/twitter/bootstrap/button-groups.scss +0 -230
- data/vendor/frameworks/twitter/bootstrap/buttons.scss +0 -228
- data/vendor/frameworks/twitter/bootstrap/carousel.scss +0 -158
- data/vendor/frameworks/twitter/bootstrap/forms.scss +0 -690
- data/vendor/frameworks/twitter/bootstrap/grid.scss +0 -21
- data/vendor/frameworks/twitter/bootstrap/hero-unit.scss +0 -25
- data/vendor/frameworks/twitter/bootstrap/labels-badges.scss +0 -83
- data/vendor/frameworks/twitter/bootstrap/layouts.scss +0 -16
- data/vendor/frameworks/twitter/bootstrap/mixins.scss +0 -704
- data/vendor/frameworks/twitter/bootstrap/modals.scss +0 -95
- data/vendor/frameworks/twitter/bootstrap/navbar.scss +0 -496
- data/vendor/frameworks/twitter/bootstrap/navs.scss +0 -409
- data/vendor/frameworks/twitter/bootstrap/pager.scss +0 -43
- data/vendor/frameworks/twitter/bootstrap/pagination.scss +0 -123
- data/vendor/frameworks/twitter/bootstrap/reset.scss +0 -216
- data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.scss +0 -28
- data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.scss +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.scss +0 -19
- data/vendor/frameworks/twitter/bootstrap/responsive-navbar.scss +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive-utilities.scss +0 -59
- data/vendor/frameworks/twitter/bootstrap/responsive.scss +0 -48
- data/vendor/frameworks/twitter/bootstrap/scaffolding.scss +0 -53
- data/vendor/frameworks/twitter/bootstrap/sprites.scss +0 -197
- data/vendor/frameworks/twitter/bootstrap/tables.scss +0 -235
- data/vendor/frameworks/twitter/bootstrap/thumbnails.scss +0 -53
- data/vendor/frameworks/twitter/bootstrap/type.scss +0 -246
- data/vendor/frameworks/twitter/bootstrap/variables.scss +0 -295
@@ -1,8 +1,8 @@
|
|
1
|
-
/*
|
2
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: alert.js v3.0.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
4
|
-
*
|
5
|
-
* Copyright
|
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,48 +15,44 @@
|
|
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') ?
|
@@ -65,16 +61,17 @@
|
|
65
61
|
}
|
66
62
|
|
67
63
|
|
68
|
-
|
69
|
-
|
64
|
+
// ALERT PLUGIN DEFINITION
|
65
|
+
// =======================
|
70
66
|
|
71
67
|
var old = $.fn.alert
|
72
68
|
|
73
69
|
$.fn.alert = function (option) {
|
74
70
|
return this.each(function () {
|
75
71
|
var $this = $(this)
|
76
|
-
|
77
|
-
|
72
|
+
var data = $this.data('bs.alert')
|
73
|
+
|
74
|
+
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
78
75
|
if (typeof option == 'string') data[option].call($this)
|
79
76
|
})
|
80
77
|
}
|
@@ -82,8 +79,8 @@
|
|
82
79
|
$.fn.alert.Constructor = Alert
|
83
80
|
|
84
81
|
|
85
|
-
|
86
|
-
|
82
|
+
// ALERT NO CONFLICT
|
83
|
+
// =================
|
87
84
|
|
88
85
|
$.fn.alert.noConflict = function () {
|
89
86
|
$.fn.alert = old
|
@@ -91,9 +88,9 @@
|
|
91
88
|
}
|
92
89
|
|
93
90
|
|
94
|
-
|
95
|
-
|
91
|
+
// ALERT DATA-API
|
92
|
+
// ==============
|
96
93
|
|
97
|
-
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
|
94
|
+
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
98
95
|
|
99
|
-
}(window.jQuery);
|
96
|
+
}(window.jQuery);
|
@@ -1,8 +1,8 @@
|
|
1
|
-
/*
|
2
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: button.js v3.0.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
4
|
-
*
|
5
|
-
* Copyright
|
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,44 @@
|
|
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
56
|
var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
|
55
57
|
|
56
|
-
$parent
|
57
|
-
.find('.active')
|
58
|
-
|
58
|
+
if ($parent) {
|
59
|
+
$parent.find('.active').removeClass('active')
|
60
|
+
}
|
59
61
|
|
60
62
|
this.$element.toggleClass('active')
|
61
63
|
}
|
62
64
|
|
63
65
|
|
64
|
-
|
65
|
-
|
66
|
+
// BUTTON PLUGIN DEFINITION
|
67
|
+
// ========================
|
66
68
|
|
67
69
|
var old = $.fn.button
|
68
70
|
|
69
71
|
$.fn.button = function (option) {
|
70
72
|
return this.each(function () {
|
71
|
-
var $this
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
var $this = $(this)
|
74
|
+
var data = $this.data('button')
|
75
|
+
var options = typeof option == 'object' && option
|
76
|
+
|
77
|
+
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
78
|
+
|
75
79
|
if (option == 'toggle') data.toggle()
|
76
80
|
else if (option) data.setState(option)
|
77
81
|
})
|
78
82
|
}
|
79
83
|
|
80
|
-
$.fn.button.defaults = {
|
81
|
-
loadingText: 'loading...'
|
82
|
-
}
|
83
|
-
|
84
84
|
$.fn.button.Constructor = Button
|
85
85
|
|
86
86
|
|
87
|
-
|
88
|
-
|
87
|
+
// BUTTON NO CONFLICT
|
88
|
+
// ==================
|
89
89
|
|
90
90
|
$.fn.button.noConflict = function () {
|
91
91
|
$.fn.button = old
|
@@ -93,13 +93,13 @@
|
|
93
93
|
}
|
94
94
|
|
95
95
|
|
96
|
-
|
97
|
-
|
96
|
+
// BUTTON DATA-API
|
97
|
+
// ===============
|
98
98
|
|
99
|
-
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
|
99
|
+
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
|
100
100
|
var $btn = $(e.target)
|
101
101
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
102
102
|
$btn.button('toggle')
|
103
103
|
})
|
104
104
|
|
105
|
-
}(window.jQuery);
|
105
|
+
}(window.jQuery);
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: carousel.js v3.0.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#carousel
|
4
|
-
*
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,193 +15,189 @@
|
|
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
|
-
return this.slide('next')
|
88
|
-
}
|
71
|
+
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
|
72
|
+
if (activeIndex == pos) return this.pause().cycle()
|
89
73
|
|
90
|
-
|
91
|
-
|
92
|
-
|
74
|
+
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
75
|
+
}
|
76
|
+
|
77
|
+
Carousel.prototype.pause = function (e) {
|
78
|
+
e || (this.paused = true)
|
79
|
+
|
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
|
-
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
|
85
|
+
this.interval = clearInterval(this.interval)
|
103
86
|
|
104
|
-
|
87
|
+
return this
|
88
|
+
}
|
105
89
|
|
106
|
-
|
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
|
+
}
|
99
|
+
|
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
|
107
|
+
|
108
|
+
this.sliding = true
|
107
109
|
|
108
|
-
|
110
|
+
isCycling && this.pause()
|
109
111
|
|
110
|
-
|
111
|
-
|
112
|
-
|
112
|
+
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
113
|
+
|
114
|
+
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
115
|
+
|
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')
|
113
123
|
})
|
124
|
+
}
|
114
125
|
|
115
|
-
|
116
|
-
|
117
|
-
if (
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
that.sliding = false
|
136
|
-
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
137
|
-
})
|
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
|
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
|
+
this.$element.one($.support.transition.end, function () {
|
134
|
+
$next.removeClass([type, direction].join(' ')).addClass('active')
|
135
|
+
$active.removeClass(['active', direction].join(' '))
|
136
|
+
that.sliding = false
|
137
|
+
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
138
|
+
})
|
139
|
+
} else {
|
140
|
+
this.$element.trigger(e)
|
141
|
+
if (e.isDefaultPrevented()) return
|
142
|
+
$active.removeClass('active')
|
143
|
+
$next.addClass('active')
|
144
|
+
this.sliding = false
|
145
|
+
this.$element.trigger('slid')
|
150
146
|
}
|
151
147
|
|
148
|
+
isCycling && this.cycle()
|
149
|
+
|
150
|
+
return this
|
152
151
|
}
|
153
152
|
|
154
153
|
|
155
|
-
|
156
|
-
|
154
|
+
// CAROUSEL PLUGIN DEFINITION
|
155
|
+
// ==========================
|
157
156
|
|
158
157
|
var old = $.fn.carousel
|
159
158
|
|
160
159
|
$.fn.carousel = function (option) {
|
161
160
|
return this.each(function () {
|
162
|
-
var $this
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
161
|
+
var $this = $(this)
|
162
|
+
var data = $this.data('bs.carousel')
|
163
|
+
var options = $.extend({}, Carousel.DEFAULTS, typeof option == 'object' && option)
|
164
|
+
var action = typeof option == 'string' ? option : options.slide
|
165
|
+
|
166
|
+
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
167
167
|
if (typeof option == 'number') data.to(option)
|
168
168
|
else if (action) data[action]()
|
169
169
|
else if (options.interval) data.pause().cycle()
|
170
170
|
})
|
171
171
|
}
|
172
172
|
|
173
|
-
$.fn.carousel.defaults = {
|
174
|
-
interval: 5000
|
175
|
-
, pause: 'hover'
|
176
|
-
}
|
177
|
-
|
178
173
|
$.fn.carousel.Constructor = Carousel
|
179
174
|
|
180
175
|
|
181
|
-
|
182
|
-
|
176
|
+
// CAROUSEL NO CONFLICT
|
177
|
+
// ====================
|
183
178
|
|
184
179
|
$.fn.carousel.noConflict = function () {
|
185
180
|
$.fn.carousel = old
|
186
181
|
return this
|
187
182
|
}
|
188
183
|
|
189
|
-
|
190
|
-
|
184
|
+
|
185
|
+
// CAROUSEL DATA-API
|
186
|
+
// =================
|
191
187
|
|
192
188
|
$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
193
189
|
var $this = $(this), href
|
194
|
-
|
195
|
-
|
196
|
-
|
190
|
+
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
191
|
+
var options = $.extend({}, $target.data(), $this.data())
|
192
|
+
var slideIndex
|
197
193
|
|
198
194
|
$target.carousel(options)
|
199
195
|
|
200
196
|
if (slideIndex = $this.attr('data-slide-to')) {
|
201
|
-
$target.data('carousel').pause().to(slideIndex).cycle()
|
197
|
+
$target.data('bs-carousel').pause().to(slideIndex).cycle()
|
202
198
|
}
|
203
199
|
|
204
200
|
e.preventDefault()
|
205
201
|
})
|
206
202
|
|
207
|
-
}(window.jQuery);
|
203
|
+
}(window.jQuery);
|