twitter-bootstrap-rails 2.2.8 → 3.2.2
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 +7 -0
- data/README.md +160 -228
- data/Rakefile +4 -6
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +279 -38
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/javascripts/twitter/bootstrap/affix.js +142 -0
- data/app/assets/javascripts/twitter/bootstrap/alert.js +92 -0
- data/app/assets/javascripts/twitter/bootstrap/button.js +110 -0
- data/app/assets/javascripts/twitter/bootstrap/carousel.js +223 -0
- data/app/assets/javascripts/twitter/bootstrap/collapse.js +170 -0
- data/app/assets/javascripts/twitter/bootstrap/dropdown.js +151 -0
- data/app/assets/javascripts/twitter/bootstrap/modal.js +280 -0
- data/app/assets/javascripts/twitter/bootstrap/popover.js +113 -0
- data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +170 -0
- data/app/assets/javascripts/twitter/bootstrap/tab.js +128 -0
- data/app/assets/javascripts/twitter/bootstrap/tooltip.js +457 -0
- data/app/assets/javascripts/twitter/bootstrap/transition.js +59 -0
- data/app/assets/javascripts/twitter/bootstrap.js +12 -13
- data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -890
- data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +2026 -787
- data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -146
- data/app/helpers/bootstrap_flash_helper.rb +14 -7
- data/app/helpers/form_errors_helper.rb +22 -0
- data/app/helpers/glyph_helper.rb +8 -5
- data/app/helpers/modal_helper.rb +26 -22
- data/app/helpers/navbar_helper.rb +47 -32
- data/app/helpers/twitter_breadcrumbs_helper.rb +6 -2
- data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +8 -8
- data/lib/generators/bootstrap/install/install_generator.rb +3 -2
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +13 -11
- data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +5 -0
- data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +27 -48
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +19 -34
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +13 -30
- data/lib/generators/bootstrap/partial/templates/_login.html.erb +2 -3
- data/lib/generators/bootstrap/themed/templates/_form.html.erb +30 -10
- data/lib/generators/bootstrap/themed/templates/_form.html.haml +10 -8
- data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -9
- data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.erb +2 -2
- data/lib/generators/bootstrap/themed/templates/index.html.haml +2 -2
- data/lib/generators/bootstrap/themed/templates/index.html.slim +4 -5
- data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -7
- data/lib/generators/bootstrap/themed/templates/show.html.haml +4 -4
- data/lib/generators/bootstrap/themed/templates/show.html.slim +6 -7
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +3 -3
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
- data/lib/generators/bootstrap/themed/themed_generator.rb +2 -2
- data/lib/twitter/bootstrap/rails/breadcrumbs.rb +69 -0
- data/lib/twitter/bootstrap/rails/engine.rb +17 -10
- data/lib/twitter/bootstrap/rails/version.rb +2 -2
- data/spec/lib/breadcrumbs_spec.rb +99 -0
- data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +12 -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 +15 -15
- data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +207 -173
- data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +18 -16
- data/spec/spec_helper.rb +11 -1
- data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5796 -1
- data/vendor/static-source/bootstrap.less +0 -1
- data/vendor/static-source/fontawesome.less +0 -1
- data/vendor/static-source/sprites.less +1 -1
- data/vendor/toolkit/fontawesome/bordered-pulled.less +16 -0
- data/vendor/toolkit/fontawesome/core.less +8 -126
- data/vendor/toolkit/fontawesome/fixed-width.less +6 -0
- data/vendor/toolkit/fontawesome/font-awesome.less +9 -25
- data/vendor/toolkit/fontawesome/icons.less +549 -378
- data/vendor/toolkit/fontawesome/larger.less +13 -0
- data/vendor/toolkit/fontawesome/list.less +19 -0
- data/vendor/toolkit/fontawesome/mixins.less +16 -39
- data/vendor/toolkit/fontawesome/path.less +5 -5
- data/vendor/toolkit/fontawesome/rotated-flipped.less +20 -0
- data/vendor/toolkit/fontawesome/spinning.less +29 -0
- data/vendor/toolkit/fontawesome/stacked.less +20 -0
- data/vendor/toolkit/fontawesome/variables.less +557 -731
- data/vendor/toolkit/twitter/bootstrap/alerts.less +47 -58
- data/vendor/toolkit/twitter/bootstrap/badges.less +55 -0
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +26 -39
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +11 -9
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +168 -152
- data/vendor/toolkit/twitter/bootstrap/buttons.less +101 -170
- data/vendor/toolkit/twitter/bootstrap/carousel.less +150 -65
- data/vendor/toolkit/twitter/bootstrap/close.less +20 -19
- data/vendor/toolkit/twitter/bootstrap/code.less +38 -30
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +12 -3
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +115 -148
- data/vendor/toolkit/twitter/bootstrap/forms.less +401 -547
- data/vendor/toolkit/twitter/bootstrap/glyphicons.less +234 -0
- data/vendor/toolkit/twitter/bootstrap/grid.less +74 -11
- data/vendor/toolkit/twitter/bootstrap/input-groups.less +166 -0
- data/vendor/toolkit/twitter/bootstrap/jumbotron.less +48 -0
- data/vendor/toolkit/twitter/bootstrap/labels.less +64 -0
- data/vendor/toolkit/twitter/bootstrap/list-group.less +132 -0
- data/vendor/toolkit/twitter/bootstrap/media.less +8 -7
- data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +52 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +85 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/image.less +33 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +29 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +23 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +224 -0
- data/vendor/toolkit/twitter/bootstrap/mixins.less +36 -699
- data/vendor/toolkit/twitter/bootstrap/modals.less +109 -54
- data/vendor/toolkit/twitter/bootstrap/navbar.less +542 -384
- data/vendor/toolkit/twitter/bootstrap/navs.less +192 -359
- data/vendor/toolkit/twitter/bootstrap/normalize.less +425 -0
- data/vendor/toolkit/twitter/bootstrap/pager.less +46 -34
- data/vendor/toolkit/twitter/bootstrap/pagination.less +70 -105
- data/vendor/toolkit/twitter/bootstrap/panels.less +248 -0
- data/vendor/toolkit/twitter/bootstrap/popovers.less +61 -61
- data/vendor/toolkit/twitter/bootstrap/print.less +101 -0
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +51 -73
- data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +34 -0
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +177 -42
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +120 -23
- data/vendor/toolkit/twitter/bootstrap/tables.less +171 -182
- data/vendor/toolkit/twitter/bootstrap/theme.less +260 -0
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +26 -43
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +49 -24
- data/vendor/toolkit/twitter/bootstrap/type.less +208 -147
- data/vendor/toolkit/twitter/bootstrap/utilities.less +33 -7
- data/vendor/toolkit/twitter/bootstrap/variables.less +761 -215
- data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
- metadata +156 -130
- 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/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -169
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -361
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
- data/app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
- data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +0 -42
- data/test/lib/breadcrumbs_test.rb +0 -75
- data/test/test_helper.rb +0 -11
- data/vendor/toolkit/fontawesome/bootstrap.less +0 -84
- data/vendor/toolkit/fontawesome/extras.less +0 -93
- data/vendor/toolkit/fontawesome/font-awesome-ie7.less +0 -1953
- data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
- data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
- data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
- data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
- data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
- data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
- data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
- data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
- data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
- data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
- data/vendor/toolkit/twitter/bootstrap/sprites.less +0 -197
@@ -0,0 +1,110 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: button.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#buttons
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// BUTTON PUBLIC CLASS DEFINITION
|
14
|
+
// ==============================
|
15
|
+
|
16
|
+
var Button = function (element, options) {
|
17
|
+
this.$element = $(element)
|
18
|
+
this.options = $.extend({}, Button.DEFAULTS, options)
|
19
|
+
this.isLoading = false
|
20
|
+
}
|
21
|
+
|
22
|
+
Button.VERSION = '3.2.0'
|
23
|
+
|
24
|
+
Button.DEFAULTS = {
|
25
|
+
loadingText: 'loading...'
|
26
|
+
}
|
27
|
+
|
28
|
+
Button.prototype.setState = function (state) {
|
29
|
+
var d = 'disabled'
|
30
|
+
var $el = this.$element
|
31
|
+
var val = $el.is('input') ? 'val' : 'html'
|
32
|
+
var data = $el.data()
|
33
|
+
|
34
|
+
state = state + 'Text'
|
35
|
+
|
36
|
+
if (data.resetText == null) $el.data('resetText', $el[val]())
|
37
|
+
|
38
|
+
$el[val](data[state] == null ? this.options[state] : data[state])
|
39
|
+
|
40
|
+
// push to event loop to allow forms to submit
|
41
|
+
setTimeout($.proxy(function () {
|
42
|
+
if (state == 'loadingText') {
|
43
|
+
this.isLoading = true
|
44
|
+
$el.addClass(d).attr(d, d)
|
45
|
+
} else if (this.isLoading) {
|
46
|
+
this.isLoading = false
|
47
|
+
$el.removeClass(d).removeAttr(d)
|
48
|
+
}
|
49
|
+
}, this), 0)
|
50
|
+
}
|
51
|
+
|
52
|
+
Button.prototype.toggle = function () {
|
53
|
+
var changed = true
|
54
|
+
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
55
|
+
|
56
|
+
if ($parent.length) {
|
57
|
+
var $input = this.$element.find('input')
|
58
|
+
if ($input.prop('type') == 'radio') {
|
59
|
+
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
60
|
+
else $parent.find('.active').removeClass('active')
|
61
|
+
}
|
62
|
+
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
63
|
+
}
|
64
|
+
|
65
|
+
if (changed) this.$element.toggleClass('active')
|
66
|
+
}
|
67
|
+
|
68
|
+
|
69
|
+
// BUTTON PLUGIN DEFINITION
|
70
|
+
// ========================
|
71
|
+
|
72
|
+
function Plugin(option) {
|
73
|
+
return this.each(function () {
|
74
|
+
var $this = $(this)
|
75
|
+
var data = $this.data('bs.button')
|
76
|
+
var options = typeof option == 'object' && option
|
77
|
+
|
78
|
+
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
79
|
+
|
80
|
+
if (option == 'toggle') data.toggle()
|
81
|
+
else if (option) data.setState(option)
|
82
|
+
})
|
83
|
+
}
|
84
|
+
|
85
|
+
var old = $.fn.button
|
86
|
+
|
87
|
+
$.fn.button = Plugin
|
88
|
+
$.fn.button.Constructor = Button
|
89
|
+
|
90
|
+
|
91
|
+
// BUTTON NO CONFLICT
|
92
|
+
// ==================
|
93
|
+
|
94
|
+
$.fn.button.noConflict = function () {
|
95
|
+
$.fn.button = old
|
96
|
+
return this
|
97
|
+
}
|
98
|
+
|
99
|
+
|
100
|
+
// BUTTON DATA-API
|
101
|
+
// ===============
|
102
|
+
|
103
|
+
$(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
104
|
+
var $btn = $(e.target)
|
105
|
+
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
106
|
+
Plugin.call($btn, 'toggle')
|
107
|
+
e.preventDefault()
|
108
|
+
})
|
109
|
+
|
110
|
+
}(jQuery);
|
@@ -0,0 +1,223 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: carousel.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#carousel
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// CAROUSEL CLASS DEFINITION
|
14
|
+
// =========================
|
15
|
+
|
16
|
+
var Carousel = function (element, options) {
|
17
|
+
this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
|
18
|
+
this.$indicators = this.$element.find('.carousel-indicators')
|
19
|
+
this.options = options
|
20
|
+
this.paused =
|
21
|
+
this.sliding =
|
22
|
+
this.interval =
|
23
|
+
this.$active =
|
24
|
+
this.$items = null
|
25
|
+
|
26
|
+
this.options.pause == 'hover' && this.$element
|
27
|
+
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
|
28
|
+
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
29
|
+
}
|
30
|
+
|
31
|
+
Carousel.VERSION = '3.2.0'
|
32
|
+
|
33
|
+
Carousel.DEFAULTS = {
|
34
|
+
interval: 5000,
|
35
|
+
pause: 'hover',
|
36
|
+
wrap: true
|
37
|
+
}
|
38
|
+
|
39
|
+
Carousel.prototype.keydown = function (e) {
|
40
|
+
switch (e.which) {
|
41
|
+
case 37: this.prev(); break
|
42
|
+
case 39: this.next(); break
|
43
|
+
default: return
|
44
|
+
}
|
45
|
+
|
46
|
+
e.preventDefault()
|
47
|
+
}
|
48
|
+
|
49
|
+
Carousel.prototype.cycle = function (e) {
|
50
|
+
e || (this.paused = false)
|
51
|
+
|
52
|
+
this.interval && clearInterval(this.interval)
|
53
|
+
|
54
|
+
this.options.interval
|
55
|
+
&& !this.paused
|
56
|
+
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
57
|
+
|
58
|
+
return this
|
59
|
+
}
|
60
|
+
|
61
|
+
Carousel.prototype.getItemIndex = function (item) {
|
62
|
+
this.$items = item.parent().children('.item')
|
63
|
+
return this.$items.index(item || this.$active)
|
64
|
+
}
|
65
|
+
|
66
|
+
Carousel.prototype.to = function (pos) {
|
67
|
+
var that = this
|
68
|
+
var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
|
69
|
+
|
70
|
+
if (pos > (this.$items.length - 1) || pos < 0) return
|
71
|
+
|
72
|
+
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
|
73
|
+
if (activeIndex == pos) return this.pause().cycle()
|
74
|
+
|
75
|
+
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
76
|
+
}
|
77
|
+
|
78
|
+
Carousel.prototype.pause = function (e) {
|
79
|
+
e || (this.paused = true)
|
80
|
+
|
81
|
+
if (this.$element.find('.next, .prev').length && $.support.transition) {
|
82
|
+
this.$element.trigger($.support.transition.end)
|
83
|
+
this.cycle(true)
|
84
|
+
}
|
85
|
+
|
86
|
+
this.interval = clearInterval(this.interval)
|
87
|
+
|
88
|
+
return this
|
89
|
+
}
|
90
|
+
|
91
|
+
Carousel.prototype.next = function () {
|
92
|
+
if (this.sliding) return
|
93
|
+
return this.slide('next')
|
94
|
+
}
|
95
|
+
|
96
|
+
Carousel.prototype.prev = function () {
|
97
|
+
if (this.sliding) return
|
98
|
+
return this.slide('prev')
|
99
|
+
}
|
100
|
+
|
101
|
+
Carousel.prototype.slide = function (type, next) {
|
102
|
+
var $active = this.$element.find('.item.active')
|
103
|
+
var $next = next || $active[type]()
|
104
|
+
var isCycling = this.interval
|
105
|
+
var direction = type == 'next' ? 'left' : 'right'
|
106
|
+
var fallback = type == 'next' ? 'first' : 'last'
|
107
|
+
var that = this
|
108
|
+
|
109
|
+
if (!$next.length) {
|
110
|
+
if (!this.options.wrap) return
|
111
|
+
$next = this.$element.find('.item')[fallback]()
|
112
|
+
}
|
113
|
+
|
114
|
+
if ($next.hasClass('active')) return (this.sliding = false)
|
115
|
+
|
116
|
+
var relatedTarget = $next[0]
|
117
|
+
var slideEvent = $.Event('slide.bs.carousel', {
|
118
|
+
relatedTarget: relatedTarget,
|
119
|
+
direction: direction
|
120
|
+
})
|
121
|
+
this.$element.trigger(slideEvent)
|
122
|
+
if (slideEvent.isDefaultPrevented()) return
|
123
|
+
|
124
|
+
this.sliding = true
|
125
|
+
|
126
|
+
isCycling && this.pause()
|
127
|
+
|
128
|
+
if (this.$indicators.length) {
|
129
|
+
this.$indicators.find('.active').removeClass('active')
|
130
|
+
var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
|
131
|
+
$nextIndicator && $nextIndicator.addClass('active')
|
132
|
+
}
|
133
|
+
|
134
|
+
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
135
|
+
if ($.support.transition && this.$element.hasClass('slide')) {
|
136
|
+
$next.addClass(type)
|
137
|
+
$next[0].offsetWidth // force reflow
|
138
|
+
$active.addClass(direction)
|
139
|
+
$next.addClass(direction)
|
140
|
+
$active
|
141
|
+
.one('bsTransitionEnd', function () {
|
142
|
+
$next.removeClass([type, direction].join(' ')).addClass('active')
|
143
|
+
$active.removeClass(['active', direction].join(' '))
|
144
|
+
that.sliding = false
|
145
|
+
setTimeout(function () {
|
146
|
+
that.$element.trigger(slidEvent)
|
147
|
+
}, 0)
|
148
|
+
})
|
149
|
+
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
150
|
+
} else {
|
151
|
+
$active.removeClass('active')
|
152
|
+
$next.addClass('active')
|
153
|
+
this.sliding = false
|
154
|
+
this.$element.trigger(slidEvent)
|
155
|
+
}
|
156
|
+
|
157
|
+
isCycling && this.cycle()
|
158
|
+
|
159
|
+
return this
|
160
|
+
}
|
161
|
+
|
162
|
+
|
163
|
+
// CAROUSEL PLUGIN DEFINITION
|
164
|
+
// ==========================
|
165
|
+
|
166
|
+
function Plugin(option) {
|
167
|
+
return this.each(function () {
|
168
|
+
var $this = $(this)
|
169
|
+
var data = $this.data('bs.carousel')
|
170
|
+
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
171
|
+
var action = typeof option == 'string' ? option : options.slide
|
172
|
+
|
173
|
+
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
174
|
+
if (typeof option == 'number') data.to(option)
|
175
|
+
else if (action) data[action]()
|
176
|
+
else if (options.interval) data.pause().cycle()
|
177
|
+
})
|
178
|
+
}
|
179
|
+
|
180
|
+
var old = $.fn.carousel
|
181
|
+
|
182
|
+
$.fn.carousel = Plugin
|
183
|
+
$.fn.carousel.Constructor = Carousel
|
184
|
+
|
185
|
+
|
186
|
+
// CAROUSEL NO CONFLICT
|
187
|
+
// ====================
|
188
|
+
|
189
|
+
$.fn.carousel.noConflict = function () {
|
190
|
+
$.fn.carousel = old
|
191
|
+
return this
|
192
|
+
}
|
193
|
+
|
194
|
+
|
195
|
+
// CAROUSEL DATA-API
|
196
|
+
// =================
|
197
|
+
|
198
|
+
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
199
|
+
var href
|
200
|
+
var $this = $(this)
|
201
|
+
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
202
|
+
if (!$target.hasClass('carousel')) return
|
203
|
+
var options = $.extend({}, $target.data(), $this.data())
|
204
|
+
var slideIndex = $this.attr('data-slide-to')
|
205
|
+
if (slideIndex) options.interval = false
|
206
|
+
|
207
|
+
Plugin.call($target, options)
|
208
|
+
|
209
|
+
if (slideIndex) {
|
210
|
+
$target.data('bs.carousel').to(slideIndex)
|
211
|
+
}
|
212
|
+
|
213
|
+
e.preventDefault()
|
214
|
+
})
|
215
|
+
|
216
|
+
$(window).on('load', function () {
|
217
|
+
$('[data-ride="carousel"]').each(function () {
|
218
|
+
var $carousel = $(this)
|
219
|
+
Plugin.call($carousel, $carousel.data())
|
220
|
+
})
|
221
|
+
})
|
222
|
+
|
223
|
+
}(jQuery);
|
@@ -0,0 +1,170 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: collapse.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#collapse
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// COLLAPSE PUBLIC CLASS DEFINITION
|
14
|
+
// ================================
|
15
|
+
|
16
|
+
var Collapse = function (element, options) {
|
17
|
+
this.$element = $(element)
|
18
|
+
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
19
|
+
this.transitioning = null
|
20
|
+
|
21
|
+
if (this.options.parent) this.$parent = $(this.options.parent)
|
22
|
+
if (this.options.toggle) this.toggle()
|
23
|
+
}
|
24
|
+
|
25
|
+
Collapse.VERSION = '3.2.0'
|
26
|
+
|
27
|
+
Collapse.DEFAULTS = {
|
28
|
+
toggle: true
|
29
|
+
}
|
30
|
+
|
31
|
+
Collapse.prototype.dimension = function () {
|
32
|
+
var hasWidth = this.$element.hasClass('width')
|
33
|
+
return hasWidth ? 'width' : 'height'
|
34
|
+
}
|
35
|
+
|
36
|
+
Collapse.prototype.show = function () {
|
37
|
+
if (this.transitioning || this.$element.hasClass('in')) return
|
38
|
+
|
39
|
+
var startEvent = $.Event('show.bs.collapse')
|
40
|
+
this.$element.trigger(startEvent)
|
41
|
+
if (startEvent.isDefaultPrevented()) return
|
42
|
+
|
43
|
+
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
44
|
+
|
45
|
+
if (actives && actives.length) {
|
46
|
+
var hasData = actives.data('bs.collapse')
|
47
|
+
if (hasData && hasData.transitioning) return
|
48
|
+
Plugin.call(actives, 'hide')
|
49
|
+
hasData || actives.data('bs.collapse', null)
|
50
|
+
}
|
51
|
+
|
52
|
+
var dimension = this.dimension()
|
53
|
+
|
54
|
+
this.$element
|
55
|
+
.removeClass('collapse')
|
56
|
+
.addClass('collapsing')[dimension](0)
|
57
|
+
|
58
|
+
this.transitioning = 1
|
59
|
+
|
60
|
+
var complete = function () {
|
61
|
+
this.$element
|
62
|
+
.removeClass('collapsing')
|
63
|
+
.addClass('collapse in')[dimension]('')
|
64
|
+
this.transitioning = 0
|
65
|
+
this.$element
|
66
|
+
.trigger('shown.bs.collapse')
|
67
|
+
}
|
68
|
+
|
69
|
+
if (!$.support.transition) return complete.call(this)
|
70
|
+
|
71
|
+
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
72
|
+
|
73
|
+
this.$element
|
74
|
+
.one('bsTransitionEnd', $.proxy(complete, this))
|
75
|
+
.emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
|
76
|
+
}
|
77
|
+
|
78
|
+
Collapse.prototype.hide = function () {
|
79
|
+
if (this.transitioning || !this.$element.hasClass('in')) return
|
80
|
+
|
81
|
+
var startEvent = $.Event('hide.bs.collapse')
|
82
|
+
this.$element.trigger(startEvent)
|
83
|
+
if (startEvent.isDefaultPrevented()) return
|
84
|
+
|
85
|
+
var dimension = this.dimension()
|
86
|
+
|
87
|
+
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
|
88
|
+
|
89
|
+
this.$element
|
90
|
+
.addClass('collapsing')
|
91
|
+
.removeClass('collapse')
|
92
|
+
.removeClass('in')
|
93
|
+
|
94
|
+
this.transitioning = 1
|
95
|
+
|
96
|
+
var complete = function () {
|
97
|
+
this.transitioning = 0
|
98
|
+
this.$element
|
99
|
+
.trigger('hidden.bs.collapse')
|
100
|
+
.removeClass('collapsing')
|
101
|
+
.addClass('collapse')
|
102
|
+
}
|
103
|
+
|
104
|
+
if (!$.support.transition) return complete.call(this)
|
105
|
+
|
106
|
+
this.$element
|
107
|
+
[dimension](0)
|
108
|
+
.one('bsTransitionEnd', $.proxy(complete, this))
|
109
|
+
.emulateTransitionEnd(350)
|
110
|
+
}
|
111
|
+
|
112
|
+
Collapse.prototype.toggle = function () {
|
113
|
+
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
// COLLAPSE PLUGIN DEFINITION
|
118
|
+
// ==========================
|
119
|
+
|
120
|
+
function Plugin(option) {
|
121
|
+
return this.each(function () {
|
122
|
+
var $this = $(this)
|
123
|
+
var data = $this.data('bs.collapse')
|
124
|
+
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
125
|
+
|
126
|
+
if (!data && options.toggle && option == 'show') option = !option
|
127
|
+
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
128
|
+
if (typeof option == 'string') data[option]()
|
129
|
+
})
|
130
|
+
}
|
131
|
+
|
132
|
+
var old = $.fn.collapse
|
133
|
+
|
134
|
+
$.fn.collapse = Plugin
|
135
|
+
$.fn.collapse.Constructor = Collapse
|
136
|
+
|
137
|
+
|
138
|
+
// COLLAPSE NO CONFLICT
|
139
|
+
// ====================
|
140
|
+
|
141
|
+
$.fn.collapse.noConflict = function () {
|
142
|
+
$.fn.collapse = old
|
143
|
+
return this
|
144
|
+
}
|
145
|
+
|
146
|
+
|
147
|
+
// COLLAPSE DATA-API
|
148
|
+
// =================
|
149
|
+
|
150
|
+
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
|
151
|
+
var href
|
152
|
+
var $this = $(this)
|
153
|
+
var target = $this.attr('data-target')
|
154
|
+
|| e.preventDefault()
|
155
|
+
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
156
|
+
var $target = $(target)
|
157
|
+
var data = $target.data('bs.collapse')
|
158
|
+
var option = data ? 'toggle' : $this.data()
|
159
|
+
var parent = $this.attr('data-parent')
|
160
|
+
var $parent = parent && $(parent)
|
161
|
+
|
162
|
+
if (!data || !data.transitioning) {
|
163
|
+
if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
164
|
+
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
165
|
+
}
|
166
|
+
|
167
|
+
Plugin.call($target, option)
|
168
|
+
})
|
169
|
+
|
170
|
+
}(jQuery);
|
@@ -0,0 +1,151 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: dropdown.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#dropdowns
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// DROPDOWN CLASS DEFINITION
|
14
|
+
// =========================
|
15
|
+
|
16
|
+
var backdrop = '.dropdown-backdrop'
|
17
|
+
var toggle = '[data-toggle="dropdown"]'
|
18
|
+
var Dropdown = function (element) {
|
19
|
+
$(element).on('click.bs.dropdown', this.toggle)
|
20
|
+
}
|
21
|
+
|
22
|
+
Dropdown.VERSION = '3.2.0'
|
23
|
+
|
24
|
+
Dropdown.prototype.toggle = function (e) {
|
25
|
+
var $this = $(this)
|
26
|
+
|
27
|
+
if ($this.is('.disabled, :disabled')) return
|
28
|
+
|
29
|
+
var $parent = getParent($this)
|
30
|
+
var isActive = $parent.hasClass('open')
|
31
|
+
|
32
|
+
clearMenus()
|
33
|
+
|
34
|
+
if (!isActive) {
|
35
|
+
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
36
|
+
// if mobile we use a backdrop because click events don't delegate
|
37
|
+
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
38
|
+
}
|
39
|
+
|
40
|
+
var relatedTarget = { relatedTarget: this }
|
41
|
+
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
42
|
+
|
43
|
+
if (e.isDefaultPrevented()) return
|
44
|
+
|
45
|
+
$this.trigger('focus')
|
46
|
+
|
47
|
+
$parent
|
48
|
+
.toggleClass('open')
|
49
|
+
.trigger('shown.bs.dropdown', relatedTarget)
|
50
|
+
}
|
51
|
+
|
52
|
+
return false
|
53
|
+
}
|
54
|
+
|
55
|
+
Dropdown.prototype.keydown = function (e) {
|
56
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
57
|
+
|
58
|
+
var $this = $(this)
|
59
|
+
|
60
|
+
e.preventDefault()
|
61
|
+
e.stopPropagation()
|
62
|
+
|
63
|
+
if ($this.is('.disabled, :disabled')) return
|
64
|
+
|
65
|
+
var $parent = getParent($this)
|
66
|
+
var isActive = $parent.hasClass('open')
|
67
|
+
|
68
|
+
if (!isActive || (isActive && e.keyCode == 27)) {
|
69
|
+
if (e.which == 27) $parent.find(toggle).trigger('focus')
|
70
|
+
return $this.trigger('click')
|
71
|
+
}
|
72
|
+
|
73
|
+
var desc = ' li:not(.divider):visible a'
|
74
|
+
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
|
75
|
+
|
76
|
+
if (!$items.length) return
|
77
|
+
|
78
|
+
var index = $items.index($items.filter(':focus'))
|
79
|
+
|
80
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
81
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
82
|
+
if (!~index) index = 0
|
83
|
+
|
84
|
+
$items.eq(index).trigger('focus')
|
85
|
+
}
|
86
|
+
|
87
|
+
function clearMenus(e) {
|
88
|
+
if (e && e.which === 3) return
|
89
|
+
$(backdrop).remove()
|
90
|
+
$(toggle).each(function () {
|
91
|
+
var $parent = getParent($(this))
|
92
|
+
var relatedTarget = { relatedTarget: this }
|
93
|
+
if (!$parent.hasClass('open')) return
|
94
|
+
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
95
|
+
if (e.isDefaultPrevented()) return
|
96
|
+
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
97
|
+
})
|
98
|
+
}
|
99
|
+
|
100
|
+
function getParent($this) {
|
101
|
+
var selector = $this.attr('data-target')
|
102
|
+
|
103
|
+
if (!selector) {
|
104
|
+
selector = $this.attr('href')
|
105
|
+
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
106
|
+
}
|
107
|
+
|
108
|
+
var $parent = selector && $(selector)
|
109
|
+
|
110
|
+
return $parent && $parent.length ? $parent : $this.parent()
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
// DROPDOWN PLUGIN DEFINITION
|
115
|
+
// ==========================
|
116
|
+
|
117
|
+
function Plugin(option) {
|
118
|
+
return this.each(function () {
|
119
|
+
var $this = $(this)
|
120
|
+
var data = $this.data('bs.dropdown')
|
121
|
+
|
122
|
+
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
123
|
+
if (typeof option == 'string') data[option].call($this)
|
124
|
+
})
|
125
|
+
}
|
126
|
+
|
127
|
+
var old = $.fn.dropdown
|
128
|
+
|
129
|
+
$.fn.dropdown = Plugin
|
130
|
+
$.fn.dropdown.Constructor = Dropdown
|
131
|
+
|
132
|
+
|
133
|
+
// DROPDOWN NO CONFLICT
|
134
|
+
// ====================
|
135
|
+
|
136
|
+
$.fn.dropdown.noConflict = function () {
|
137
|
+
$.fn.dropdown = old
|
138
|
+
return this
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
143
|
+
// ===================================
|
144
|
+
|
145
|
+
$(document)
|
146
|
+
.on('click.bs.dropdown.data-api', clearMenus)
|
147
|
+
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
148
|
+
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
149
|
+
.on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)
|
150
|
+
|
151
|
+
}(jQuery);
|