twitter-bootstrap-rails 3.2.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of twitter-bootstrap-rails might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/README.md +263 -247
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +273 -214
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/app/assets/javascripts/twitter/bootstrap/affix.js +60 -35
- data/app/assets/javascripts/twitter/bootstrap/alert.js +15 -9
- data/app/assets/javascripts/twitter/bootstrap/button.js +33 -20
- data/app/assets/javascripts/twitter/bootstrap/carousel.js +79 -47
- data/app/assets/javascripts/twitter/bootstrap/collapse.js +84 -43
- data/app/assets/javascripts/twitter/bootstrap/dropdown.js +65 -47
- data/app/assets/javascripts/twitter/bootstrap/modal.js +138 -44
- data/app/assets/javascripts/twitter/bootstrap/popover.js +12 -14
- data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +57 -38
- data/app/assets/javascripts/twitter/bootstrap/tab.js +54 -24
- data/app/assets/javascripts/twitter/bootstrap/tooltip.js +202 -87
- data/app/assets/javascripts/twitter/bootstrap/transition.js +19 -8
- data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -1
- data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -1
- data/app/helpers/bootstrap_flash_helper.rb +8 -3
- data/app/helpers/form_errors_helper.rb +11 -11
- data/app/helpers/glyph_helper.rb +7 -3
- data/app/helpers/modal_helper.rb +9 -13
- data/app/helpers/navbar_helper.rb +5 -2
- data/app/helpers/twitter_breadcrumbs_helper.rb +4 -1
- data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +5 -5
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +3 -4
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +7 -15
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +5 -5
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +3 -3
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +3 -5
- data/lib/generators/bootstrap/themed/templates/_form.html.erb +12 -9
- data/lib/generators/bootstrap/themed/templates/_form.html.haml +7 -5
- data/lib/generators/bootstrap/themed/templates/_form.html.slim +8 -6
- data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.erb +2 -0
- data/lib/generators/bootstrap/themed/templates/index.html.haml +1 -0
- data/lib/generators/bootstrap/themed/templates/index.html.slim +4 -3
- data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +1 -1
- data/lib/twitter/bootstrap/rails/breadcrumbs.rb +24 -13
- data/lib/twitter/bootstrap/rails/engine.rb +17 -12
- data/lib/twitter/bootstrap/rails/version.rb +1 -1
- data/spec/lib/breadcrumbs_spec.rb +42 -17
- data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +10 -4
- data/spec/lib/twitter_bootstrap_rails/bootstrap_flash_helper_spec.rb +128 -0
- data/spec/lib/twitter_bootstrap_rails/form_errors_helper_spec.rb +148 -0
- data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +24 -0
- data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +2 -2
- data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +62 -12
- data/spec/spec_helper.rb +5 -1
- data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -3
- data/vendor/toolkit/twitter/bootstrap/alerts.less +5 -0
- data/vendor/toolkit/twitter/bootstrap/badges.less +14 -3
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +6 -1
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +13 -14
- data/vendor/toolkit/twitter/bootstrap/buttons.less +14 -7
- data/vendor/toolkit/twitter/bootstrap/carousel.less +34 -7
- data/vendor/toolkit/twitter/bootstrap/close.less +1 -0
- data/vendor/toolkit/twitter/bootstrap/code.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +3 -1
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +9 -8
- data/vendor/toolkit/twitter/bootstrap/forms.less +110 -41
- data/vendor/toolkit/twitter/bootstrap/glyphicons.less +75 -3
- data/vendor/toolkit/twitter/bootstrap/grid.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/input-groups.less +8 -3
- data/vendor/toolkit/twitter/bootstrap/jumbotron.less +10 -4
- data/vendor/toolkit/twitter/bootstrap/labels.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/list-group.less +11 -13
- data/vendor/toolkit/twitter/bootstrap/media.less +40 -30
- data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +2 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +19 -6
- data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +4 -4
- data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +4 -4
- data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +2 -2
- data/vendor/toolkit/twitter/bootstrap/mixins/image.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +2 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +2 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/reset-text.less +18 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/size.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +2 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +8 -5
- data/vendor/toolkit/twitter/bootstrap/mixins.less +1 -0
- data/vendor/toolkit/twitter/bootstrap/modals.less +3 -3
- data/vendor/toolkit/twitter/bootstrap/navbar.less +6 -1
- data/vendor/toolkit/twitter/bootstrap/navs.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/normalize.less +12 -13
- data/vendor/toolkit/twitter/bootstrap/pager.less +1 -2
- data/vendor/toolkit/twitter/bootstrap/pagination.less +5 -4
- data/vendor/toolkit/twitter/bootstrap/panels.less +27 -4
- data/vendor/toolkit/twitter/bootstrap/popovers.less +5 -7
- data/vendor/toolkit/twitter/bootstrap/print.less +96 -96
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +1 -14
- data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +10 -9
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +0 -0
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +12 -1
- data/vendor/toolkit/twitter/bootstrap/tables.less +6 -5
- data/vendor/toolkit/twitter/bootstrap/theme.less +47 -16
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +13 -7
- data/vendor/toolkit/twitter/bootstrap/type.less +2 -8
- data/vendor/toolkit/twitter/bootstrap/utilities.less +0 -1
- data/vendor/toolkit/twitter/bootstrap/variables.less +36 -14
- data/vendor/toolkit/twitter/bootstrap/wells.less +0 -0
- metadata +76 -52
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +0 -504
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -4
- data/vendor/static-source/fontawesome.less +0 -8
- data/vendor/toolkit/fontawesome/bordered-pulled.less +0 -16
- data/vendor/toolkit/fontawesome/core.less +0 -12
- data/vendor/toolkit/fontawesome/fixed-width.less +0 -6
- data/vendor/toolkit/fontawesome/font-awesome.less +0 -17
- data/vendor/toolkit/fontawesome/icons.less +0 -506
- data/vendor/toolkit/fontawesome/larger.less +0 -13
- data/vendor/toolkit/fontawesome/list.less +0 -19
- data/vendor/toolkit/fontawesome/mixins.less +0 -20
- data/vendor/toolkit/fontawesome/path.less +0 -14
- data/vendor/toolkit/fontawesome/rotated-flipped.less +0 -9
- data/vendor/toolkit/fontawesome/spinning.less +0 -32
- data/vendor/toolkit/fontawesome/stacked.less +0 -20
- data/vendor/toolkit/fontawesome/variables.less +0 -515
Binary file
|
Binary file
|
Binary file
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: affix.js v3.
|
2
|
+
* Bootstrap: affix.js v3.3.6
|
3
3
|
* http://getbootstrap.com/javascript/#affix
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
5
|
+
* Copyright 2011-2015 Twitter, Inc.
|
6
6
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
7
|
* ======================================================================== */
|
8
8
|
|
@@ -15,28 +15,54 @@
|
|
15
15
|
|
16
16
|
var Affix = function (element, options) {
|
17
17
|
this.options = $.extend({}, Affix.DEFAULTS, options)
|
18
|
-
|
18
|
+
|
19
|
+
this.$target = $(this.options.target)
|
19
20
|
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
20
21
|
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
21
22
|
|
22
23
|
this.$element = $(element)
|
23
|
-
this.affixed =
|
24
|
-
this.unpin =
|
24
|
+
this.affixed = null
|
25
|
+
this.unpin = null
|
25
26
|
this.pinnedOffset = null
|
26
27
|
|
27
28
|
this.checkPosition()
|
28
29
|
}
|
29
30
|
|
30
|
-
Affix.
|
31
|
+
Affix.VERSION = '3.3.6'
|
32
|
+
|
33
|
+
Affix.RESET = 'affix affix-top affix-bottom'
|
31
34
|
|
32
35
|
Affix.DEFAULTS = {
|
33
|
-
offset: 0
|
36
|
+
offset: 0,
|
37
|
+
target: window
|
38
|
+
}
|
39
|
+
|
40
|
+
Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
|
41
|
+
var scrollTop = this.$target.scrollTop()
|
42
|
+
var position = this.$element.offset()
|
43
|
+
var targetHeight = this.$target.height()
|
44
|
+
|
45
|
+
if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
|
46
|
+
|
47
|
+
if (this.affixed == 'bottom') {
|
48
|
+
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
|
49
|
+
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
|
50
|
+
}
|
51
|
+
|
52
|
+
var initializing = this.affixed == null
|
53
|
+
var colliderTop = initializing ? scrollTop : position.top
|
54
|
+
var colliderHeight = initializing ? targetHeight : height
|
55
|
+
|
56
|
+
if (offsetTop != null && scrollTop <= offsetTop) return 'top'
|
57
|
+
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
|
58
|
+
|
59
|
+
return false
|
34
60
|
}
|
35
61
|
|
36
62
|
Affix.prototype.getPinnedOffset = function () {
|
37
63
|
if (this.pinnedOffset) return this.pinnedOffset
|
38
64
|
this.$element.removeClass(Affix.RESET).addClass('affix')
|
39
|
-
var scrollTop = this.$
|
65
|
+
var scrollTop = this.$target.scrollTop()
|
40
66
|
var position = this.$element.offset()
|
41
67
|
return (this.pinnedOffset = position.top - scrollTop)
|
42
68
|
}
|
@@ -48,43 +74,41 @@
|
|
48
74
|
Affix.prototype.checkPosition = function () {
|
49
75
|
if (!this.$element.is(':visible')) return
|
50
76
|
|
51
|
-
var
|
52
|
-
var scrollTop = this.$window.scrollTop()
|
53
|
-
var position = this.$element.offset()
|
77
|
+
var height = this.$element.height()
|
54
78
|
var offset = this.options.offset
|
55
79
|
var offsetTop = offset.top
|
56
80
|
var offsetBottom = offset.bottom
|
57
|
-
|
58
|
-
if (this.affixed == 'top') position.top += scrollTop
|
81
|
+
var scrollHeight = Math.max($(document).height(), $(document.body).height())
|
59
82
|
|
60
83
|
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
61
84
|
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
62
85
|
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
63
86
|
|
64
|
-
var affix = this.
|
65
|
-
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
66
|
-
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
87
|
+
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
|
67
88
|
|
68
|
-
if (this.affixed
|
69
|
-
|
89
|
+
if (this.affixed != affix) {
|
90
|
+
if (this.unpin != null) this.$element.css('top', '')
|
70
91
|
|
71
|
-
|
72
|
-
|
92
|
+
var affixType = 'affix' + (affix ? '-' + affix : '')
|
93
|
+
var e = $.Event(affixType + '.bs.affix')
|
73
94
|
|
74
|
-
|
95
|
+
this.$element.trigger(e)
|
75
96
|
|
76
|
-
|
97
|
+
if (e.isDefaultPrevented()) return
|
77
98
|
|
78
|
-
|
79
|
-
|
99
|
+
this.affixed = affix
|
100
|
+
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
80
101
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
102
|
+
this.$element
|
103
|
+
.removeClass(Affix.RESET)
|
104
|
+
.addClass(affixType)
|
105
|
+
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
|
106
|
+
}
|
85
107
|
|
86
108
|
if (affix == 'bottom') {
|
87
|
-
this.$element.offset({
|
109
|
+
this.$element.offset({
|
110
|
+
top: scrollHeight - height - offsetBottom
|
111
|
+
})
|
88
112
|
}
|
89
113
|
}
|
90
114
|
|
@@ -92,9 +116,7 @@
|
|
92
116
|
// AFFIX PLUGIN DEFINITION
|
93
117
|
// =======================
|
94
118
|
|
95
|
-
|
96
|
-
|
97
|
-
$.fn.affix = function (option) {
|
119
|
+
function Plugin(option) {
|
98
120
|
return this.each(function () {
|
99
121
|
var $this = $(this)
|
100
122
|
var data = $this.data('bs.affix')
|
@@ -105,6 +127,9 @@
|
|
105
127
|
})
|
106
128
|
}
|
107
129
|
|
130
|
+
var old = $.fn.affix
|
131
|
+
|
132
|
+
$.fn.affix = Plugin
|
108
133
|
$.fn.affix.Constructor = Affix
|
109
134
|
|
110
135
|
|
@@ -127,10 +152,10 @@
|
|
127
152
|
|
128
153
|
data.offset = data.offset || {}
|
129
154
|
|
130
|
-
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
131
|
-
if (data.offsetTop)
|
155
|
+
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
|
156
|
+
if (data.offsetTop != null) data.offset.top = data.offsetTop
|
132
157
|
|
133
|
-
$spy
|
158
|
+
Plugin.call($spy, data)
|
134
159
|
})
|
135
160
|
})
|
136
161
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: alert.js v3.
|
2
|
+
* Bootstrap: alert.js v3.3.6
|
3
3
|
* http://getbootstrap.com/javascript/#alerts
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
5
|
+
* Copyright 2011-2015 Twitter, Inc.
|
6
6
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
7
|
* ======================================================================== */
|
8
8
|
|
@@ -18,6 +18,10 @@
|
|
18
18
|
$(el).on('click', dismiss, this.close)
|
19
19
|
}
|
20
20
|
|
21
|
+
Alert.VERSION = '3.3.6'
|
22
|
+
|
23
|
+
Alert.TRANSITION_DURATION = 150
|
24
|
+
|
21
25
|
Alert.prototype.close = function (e) {
|
22
26
|
var $this = $(this)
|
23
27
|
var selector = $this.attr('data-target')
|
@@ -32,7 +36,7 @@
|
|
32
36
|
if (e) e.preventDefault()
|
33
37
|
|
34
38
|
if (!$parent.length) {
|
35
|
-
$parent = $this.
|
39
|
+
$parent = $this.closest('.alert')
|
36
40
|
}
|
37
41
|
|
38
42
|
$parent.trigger(e = $.Event('close.bs.alert'))
|
@@ -42,13 +46,14 @@
|
|
42
46
|
$parent.removeClass('in')
|
43
47
|
|
44
48
|
function removeElement() {
|
45
|
-
|
49
|
+
// detach from parent, fire event then clean up data
|
50
|
+
$parent.detach().trigger('closed.bs.alert').remove()
|
46
51
|
}
|
47
52
|
|
48
53
|
$.support.transition && $parent.hasClass('fade') ?
|
49
54
|
$parent
|
50
|
-
.one(
|
51
|
-
.emulateTransitionEnd(
|
55
|
+
.one('bsTransitionEnd', removeElement)
|
56
|
+
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
|
52
57
|
removeElement()
|
53
58
|
}
|
54
59
|
|
@@ -56,9 +61,7 @@
|
|
56
61
|
// ALERT PLUGIN DEFINITION
|
57
62
|
// =======================
|
58
63
|
|
59
|
-
|
60
|
-
|
61
|
-
$.fn.alert = function (option) {
|
64
|
+
function Plugin(option) {
|
62
65
|
return this.each(function () {
|
63
66
|
var $this = $(this)
|
64
67
|
var data = $this.data('bs.alert')
|
@@ -68,6 +71,9 @@
|
|
68
71
|
})
|
69
72
|
}
|
70
73
|
|
74
|
+
var old = $.fn.alert
|
75
|
+
|
76
|
+
$.fn.alert = Plugin
|
71
77
|
$.fn.alert.Constructor = Alert
|
72
78
|
|
73
79
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: button.js v3.
|
2
|
+
* Bootstrap: button.js v3.3.6
|
3
3
|
* http://getbootstrap.com/javascript/#buttons
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
5
|
+
* Copyright 2011-2015 Twitter, Inc.
|
6
6
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
7
|
* ======================================================================== */
|
8
8
|
|
@@ -19,6 +19,8 @@
|
|
19
19
|
this.isLoading = false
|
20
20
|
}
|
21
21
|
|
22
|
+
Button.VERSION = '3.3.6'
|
23
|
+
|
22
24
|
Button.DEFAULTS = {
|
23
25
|
loadingText: 'loading...'
|
24
26
|
}
|
@@ -29,14 +31,14 @@
|
|
29
31
|
var val = $el.is('input') ? 'val' : 'html'
|
30
32
|
var data = $el.data()
|
31
33
|
|
32
|
-
state
|
33
|
-
|
34
|
-
if (!data.resetText) $el.data('resetText', $el[val]())
|
34
|
+
state += 'Text'
|
35
35
|
|
36
|
-
|
36
|
+
if (data.resetText == null) $el.data('resetText', $el[val]())
|
37
37
|
|
38
38
|
// push to event loop to allow forms to submit
|
39
39
|
setTimeout($.proxy(function () {
|
40
|
+
$el[val](data[state] == null ? this.options[state] : data[state])
|
41
|
+
|
40
42
|
if (state == 'loadingText') {
|
41
43
|
this.isLoading = true
|
42
44
|
$el.addClass(d).attr(d, d)
|
@@ -54,22 +56,26 @@
|
|
54
56
|
if ($parent.length) {
|
55
57
|
var $input = this.$element.find('input')
|
56
58
|
if ($input.prop('type') == 'radio') {
|
57
|
-
if ($input.prop('checked')
|
58
|
-
|
59
|
+
if ($input.prop('checked')) changed = false
|
60
|
+
$parent.find('.active').removeClass('active')
|
61
|
+
this.$element.addClass('active')
|
62
|
+
} else if ($input.prop('type') == 'checkbox') {
|
63
|
+
if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
|
64
|
+
this.$element.toggleClass('active')
|
59
65
|
}
|
60
|
-
|
66
|
+
$input.prop('checked', this.$element.hasClass('active'))
|
67
|
+
if (changed) $input.trigger('change')
|
68
|
+
} else {
|
69
|
+
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
|
70
|
+
this.$element.toggleClass('active')
|
61
71
|
}
|
62
|
-
|
63
|
-
if (changed) this.$element.toggleClass('active')
|
64
72
|
}
|
65
73
|
|
66
74
|
|
67
75
|
// BUTTON PLUGIN DEFINITION
|
68
76
|
// ========================
|
69
77
|
|
70
|
-
|
71
|
-
|
72
|
-
$.fn.button = function (option) {
|
78
|
+
function Plugin(option) {
|
73
79
|
return this.each(function () {
|
74
80
|
var $this = $(this)
|
75
81
|
var data = $this.data('bs.button')
|
@@ -82,6 +88,9 @@
|
|
82
88
|
})
|
83
89
|
}
|
84
90
|
|
91
|
+
var old = $.fn.button
|
92
|
+
|
93
|
+
$.fn.button = Plugin
|
85
94
|
$.fn.button.Constructor = Button
|
86
95
|
|
87
96
|
|
@@ -97,11 +106,15 @@
|
|
97
106
|
// BUTTON DATA-API
|
98
107
|
// ===============
|
99
108
|
|
100
|
-
$(document)
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
109
|
+
$(document)
|
110
|
+
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
111
|
+
var $btn = $(e.target)
|
112
|
+
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
113
|
+
Plugin.call($btn, 'toggle')
|
114
|
+
if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
|
115
|
+
})
|
116
|
+
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
117
|
+
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
|
118
|
+
})
|
106
119
|
|
107
120
|
}(jQuery);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: carousel.js v3.
|
2
|
+
* Bootstrap: carousel.js v3.3.6
|
3
3
|
* http://getbootstrap.com/javascript/#carousel
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
5
|
+
* Copyright 2011-2015 Twitter, Inc.
|
6
6
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
7
|
* ======================================================================== */
|
8
8
|
|
@@ -17,24 +17,42 @@
|
|
17
17
|
this.$element = $(element)
|
18
18
|
this.$indicators = this.$element.find('.carousel-indicators')
|
19
19
|
this.options = options
|
20
|
-
this.paused =
|
21
|
-
this.sliding =
|
22
|
-
this.interval =
|
23
|
-
this.$active =
|
20
|
+
this.paused = null
|
21
|
+
this.sliding = null
|
22
|
+
this.interval = null
|
23
|
+
this.$active = null
|
24
24
|
this.$items = null
|
25
25
|
|
26
|
-
this.options.
|
27
|
-
|
28
|
-
|
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))
|
29
31
|
}
|
30
32
|
|
33
|
+
Carousel.VERSION = '3.3.6'
|
34
|
+
|
35
|
+
Carousel.TRANSITION_DURATION = 600
|
36
|
+
|
31
37
|
Carousel.DEFAULTS = {
|
32
38
|
interval: 5000,
|
33
39
|
pause: 'hover',
|
34
|
-
wrap: true
|
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()
|
35
53
|
}
|
36
54
|
|
37
|
-
Carousel.prototype.cycle =
|
55
|
+
Carousel.prototype.cycle = function (e) {
|
38
56
|
e || (this.paused = false)
|
39
57
|
|
40
58
|
this.interval && clearInterval(this.interval)
|
@@ -46,23 +64,31 @@
|
|
46
64
|
return this
|
47
65
|
}
|
48
66
|
|
49
|
-
Carousel.prototype.
|
50
|
-
this.$
|
51
|
-
this.$items
|
67
|
+
Carousel.prototype.getItemIndex = function (item) {
|
68
|
+
this.$items = item.parent().children('.item')
|
69
|
+
return this.$items.index(item || this.$active)
|
70
|
+
}
|
52
71
|
|
53
|
-
|
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)
|
54
80
|
}
|
55
81
|
|
56
82
|
Carousel.prototype.to = function (pos) {
|
57
83
|
var that = this
|
58
|
-
var activeIndex = this.
|
84
|
+
var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
|
59
85
|
|
60
86
|
if (pos > (this.$items.length - 1) || pos < 0) return
|
61
87
|
|
62
|
-
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
88
|
+
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
|
63
89
|
if (activeIndex == pos) return this.pause().cycle()
|
64
90
|
|
65
|
-
return this.slide(pos > activeIndex ? 'next' : 'prev',
|
91
|
+
return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
|
66
92
|
}
|
67
93
|
|
68
94
|
Carousel.prototype.pause = function (e) {
|
@@ -90,22 +116,20 @@
|
|
90
116
|
|
91
117
|
Carousel.prototype.slide = function (type, next) {
|
92
118
|
var $active = this.$element.find('.item.active')
|
93
|
-
var $next = next || $active
|
119
|
+
var $next = next || this.getItemForDirection(type, $active)
|
94
120
|
var isCycling = this.interval
|
95
121
|
var direction = type == 'next' ? 'left' : 'right'
|
96
|
-
var fallback = type == 'next' ? 'first' : 'last'
|
97
122
|
var that = this
|
98
123
|
|
99
|
-
if (
|
100
|
-
if (!this.options.wrap) return
|
101
|
-
$next = this.$element.find('.item')[fallback]()
|
102
|
-
}
|
124
|
+
if ($next.hasClass('active')) return (this.sliding = false)
|
103
125
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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
|
109
133
|
|
110
134
|
this.sliding = true
|
111
135
|
|
@@ -113,30 +137,31 @@
|
|
113
137
|
|
114
138
|
if (this.$indicators.length) {
|
115
139
|
this.$indicators.find('.active').removeClass('active')
|
116
|
-
this.$
|
117
|
-
|
118
|
-
$nextIndicator && $nextIndicator.addClass('active')
|
119
|
-
})
|
140
|
+
var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
|
141
|
+
$nextIndicator && $nextIndicator.addClass('active')
|
120
142
|
}
|
121
143
|
|
144
|
+
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
122
145
|
if ($.support.transition && this.$element.hasClass('slide')) {
|
123
146
|
$next.addClass(type)
|
124
147
|
$next[0].offsetWidth // force reflow
|
125
148
|
$active.addClass(direction)
|
126
149
|
$next.addClass(direction)
|
127
150
|
$active
|
128
|
-
.one(
|
151
|
+
.one('bsTransitionEnd', function () {
|
129
152
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
130
153
|
$active.removeClass(['active', direction].join(' '))
|
131
154
|
that.sliding = false
|
132
|
-
setTimeout(function () {
|
155
|
+
setTimeout(function () {
|
156
|
+
that.$element.trigger(slidEvent)
|
157
|
+
}, 0)
|
133
158
|
})
|
134
|
-
.emulateTransitionEnd(
|
159
|
+
.emulateTransitionEnd(Carousel.TRANSITION_DURATION)
|
135
160
|
} else {
|
136
161
|
$active.removeClass('active')
|
137
162
|
$next.addClass('active')
|
138
163
|
this.sliding = false
|
139
|
-
this.$element.trigger(
|
164
|
+
this.$element.trigger(slidEvent)
|
140
165
|
}
|
141
166
|
|
142
167
|
isCycling && this.cycle()
|
@@ -148,9 +173,7 @@
|
|
148
173
|
// CAROUSEL PLUGIN DEFINITION
|
149
174
|
// ==========================
|
150
175
|
|
151
|
-
|
152
|
-
|
153
|
-
$.fn.carousel = function (option) {
|
176
|
+
function Plugin(option) {
|
154
177
|
return this.each(function () {
|
155
178
|
var $this = $(this)
|
156
179
|
var data = $this.data('bs.carousel')
|
@@ -164,6 +187,9 @@
|
|
164
187
|
})
|
165
188
|
}
|
166
189
|
|
190
|
+
var old = $.fn.carousel
|
191
|
+
|
192
|
+
$.fn.carousel = Plugin
|
167
193
|
$.fn.carousel.Constructor = Carousel
|
168
194
|
|
169
195
|
|
@@ -179,26 +205,32 @@
|
|
179
205
|
// CAROUSEL DATA-API
|
180
206
|
// =================
|
181
207
|
|
182
|
-
|
183
|
-
var
|
184
|
-
var $
|
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
|
185
213
|
var options = $.extend({}, $target.data(), $this.data())
|
186
214
|
var slideIndex = $this.attr('data-slide-to')
|
187
215
|
if (slideIndex) options.interval = false
|
188
216
|
|
189
|
-
$target
|
217
|
+
Plugin.call($target, options)
|
190
218
|
|
191
|
-
if (slideIndex
|
219
|
+
if (slideIndex) {
|
192
220
|
$target.data('bs.carousel').to(slideIndex)
|
193
221
|
}
|
194
222
|
|
195
223
|
e.preventDefault()
|
196
|
-
}
|
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)
|
197
229
|
|
198
230
|
$(window).on('load', function () {
|
199
231
|
$('[data-ride="carousel"]').each(function () {
|
200
232
|
var $carousel = $(this)
|
201
|
-
|
233
|
+
Plugin.call($carousel, $carousel.data())
|
202
234
|
})
|
203
235
|
})
|
204
236
|
|