twbs_sass_rails 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -8
- data/CONTRIBUTING.md +4 -4
- data/Gemfile.lock +52 -65
- data/LICENSE +2 -2
- data/README.md +48 -18
- data/Rakefile +67 -32
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +23 -8
- 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 +200 -199
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/gemfiles/Gemfile.rails-3.2.x +2 -3
- data/gemfiles/Gemfile.rails-4.0.x +2 -3
- data/lib/generators/twbs_sass_rails/install/install_generator.rb +2 -2
- data/lib/generators/twbs_sass_rails/install/templates/{twbs-variables.css.less → twbs-variables.css.scss} +4 -3
- data/lib/generators/twbs_sass_rails/install/templates/{twbs.css.less → twbs.css.scss} +12 -7
- data/lib/twbs_sass_rails/version.rb +1 -1
- data/test/dummy/app/assets/stylesheets/{default-twbs.css.less → default-twbs.css.scss} +0 -0
- data/test/dummy/app/assets/stylesheets/test.css.scss +9 -0
- data/test/dummy/app/assets/stylesheets/twbs-variables.css.scss +7 -0
- data/test/dummy/app/assets/stylesheets/{twbs.css.less → twbs.css.scss} +12 -7
- data/test/dummy/config/application.rb +4 -1
- data/test/dummy/config/environments/development.rb +1 -1
- data/test/generators/install_generator_test.rb +4 -4
- data/test/integration/assets_precompile_integration_test.rb +11 -5
- data/test/integration/twbs_sass_rails_integration_test.rb +8 -7
- data/test/test_helper.rb +2 -4
- data/twbs_sass_rails.gemspec +6 -9
- data/vendor/assets/javascripts/respond.js +223 -212
- data/vendor/assets/javascripts/twbs/bootstrap/affix.js +36 -25
- data/vendor/assets/javascripts/twbs/bootstrap/alert.js +7 -17
- data/vendor/assets/javascripts/twbs/bootstrap/button.js +26 -28
- data/vendor/assets/javascripts/twbs/bootstrap/carousel.js +22 -34
- data/vendor/assets/javascripts/twbs/bootstrap/collapse.js +9 -18
- data/vendor/assets/javascripts/twbs/bootstrap/dropdown.js +25 -32
- data/vendor/assets/javascripts/twbs/bootstrap/modal.js +27 -30
- data/vendor/assets/javascripts/twbs/bootstrap/popover.js +16 -23
- data/vendor/assets/javascripts/twbs/bootstrap/scrollspy.js +19 -24
- data/vendor/assets/javascripts/twbs/bootstrap/tab.js +10 -20
- data/vendor/assets/javascripts/twbs/bootstrap/tooltip.js +54 -41
- data/vendor/assets/javascripts/twbs/bootstrap/transition.js +13 -21
- data/vendor/assets/stylesheets/fontawesome/_bordered-pulled.scss +16 -0
- data/vendor/assets/stylesheets/fontawesome/_core.scss +12 -0
- data/vendor/assets/stylesheets/fontawesome/_extras.scss +44 -0
- data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +6 -0
- data/vendor/assets/stylesheets/fontawesome/_icons.scss +412 -0
- data/vendor/assets/stylesheets/fontawesome/_larger.scss +13 -0
- data/vendor/assets/stylesheets/fontawesome/_list.scss +19 -0
- data/vendor/assets/stylesheets/fontawesome/_mixins.scss +20 -0
- data/vendor/assets/stylesheets/fontawesome/_path.scss +14 -0
- data/vendor/assets/stylesheets/fontawesome/_rotated-flipped.scss +9 -0
- data/vendor/assets/stylesheets/fontawesome/_spinning.scss +30 -0
- data/vendor/assets/stylesheets/fontawesome/_stacked.scss +20 -0
- data/vendor/assets/stylesheets/fontawesome/_variables.scss +381 -0
- data/vendor/assets/stylesheets/fontawesome/font-awesome.scss +17 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{alerts.less → _alerts.scss} +10 -10
- data/vendor/assets/stylesheets/twbs/bootstrap/{badges.less → _badges.scss} +19 -15
- data/vendor/assets/stylesheets/twbs/bootstrap/_breadcrumbs.scss +26 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{button-groups.less → _button-groups.scss} +38 -60
- data/vendor/assets/stylesheets/twbs/bootstrap/{buttons.less → _buttons.scss} +28 -34
- data/vendor/assets/stylesheets/twbs/bootstrap/{carousel.less → _carousel.scss} +38 -19
- data/vendor/assets/stylesheets/twbs/bootstrap/_close.scss +35 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_code.scss +63 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{component-animations.less → _component-animations.scss} +2 -2
- data/vendor/assets/stylesheets/twbs/bootstrap/{dropdowns.less → _dropdowns.scss} +53 -33
- data/vendor/assets/stylesheets/twbs/bootstrap/{forms.less → _forms.scss} +133 -79
- data/vendor/assets/stylesheets/twbs/bootstrap/{glyphicons.less → _glyphicons.scss} +16 -19
- data/vendor/assets/stylesheets/twbs/bootstrap/_grid.scss +100 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{input-groups.less → _input-groups.scss} +58 -29
- data/vendor/assets/stylesheets/twbs/bootstrap/_jumbotron.scss +44 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{labels.less → _labels.scss} +14 -8
- data/vendor/assets/stylesheets/twbs/bootstrap/_list-group.scss +110 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{media.less → _media.scss} +0 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_mixins.scss +931 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{modals.less → _modals.scss} +37 -40
- data/vendor/assets/stylesheets/twbs/bootstrap/_navbar.scss +620 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{navs.less → _navs.scss} +41 -52
- data/vendor/assets/stylesheets/twbs/bootstrap/{normalize.less → _normalize.scss} +148 -121
- data/vendor/assets/stylesheets/twbs/bootstrap/{pager.less → _pager.scss} +8 -8
- data/vendor/assets/stylesheets/twbs/bootstrap/_pagination.scss +88 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_panels.scss +230 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{popovers.less → _popovers.scss} +36 -36
- data/vendor/assets/stylesheets/twbs/bootstrap/{print.less → _print.scss} +6 -5
- data/vendor/assets/stylesheets/twbs/bootstrap/_progress-bars.scss +80 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_responsive-utilities.scss +80 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{scaffolding.less → _scaffolding.scss} +39 -24
- data/vendor/assets/stylesheets/twbs/bootstrap/{tables.less → _tables.scss} +42 -48
- data/vendor/assets/stylesheets/twbs/bootstrap/_theme.scss +247 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_thumbnails.scss +38 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_tooltip.scss +95 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_type.scss +296 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{utilities.less → _utilities.scss} +14 -3
- data/vendor/assets/stylesheets/twbs/bootstrap/_variables.scss +831 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{wells.less → _wells.scss} +6 -6
- data/vendor/assets/stylesheets/twbs/bootstrap/bootstrap.scss +48 -0
- data/vendor/assets/stylesheets/twbs/{bootstrap.less → bootstrap.scss} +0 -0
- metadata +94 -134
- data/test/dummy/app/assets/stylesheets/test.css.less +0 -5
- data/test/dummy/app/assets/stylesheets/twbs-variables.css.less +0 -6
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/db/.keep +0 -0
- data/vendor/assets/stylesheets/fontawesome/bootstrap.less +0 -84
- data/vendor/assets/stylesheets/fontawesome/core.less +0 -129
- data/vendor/assets/stylesheets/fontawesome/extras.less +0 -93
- data/vendor/assets/stylesheets/fontawesome/font-awesome.less +0 -33
- data/vendor/assets/stylesheets/fontawesome/icons.less +0 -381
- data/vendor/assets/stylesheets/fontawesome/mixins.less +0 -48
- data/vendor/assets/stylesheets/fontawesome/path.less +0 -14
- data/vendor/assets/stylesheets/fontawesome/variables.less +0 -735
- data/vendor/assets/stylesheets/twbs/bootstrap/bootstrap.less +0 -58
- data/vendor/assets/stylesheets/twbs/bootstrap/breadcrumbs.less +0 -23
- data/vendor/assets/stylesheets/twbs/bootstrap/close.less +0 -33
- data/vendor/assets/stylesheets/twbs/bootstrap/code.less +0 -56
- data/vendor/assets/stylesheets/twbs/bootstrap/grid.less +0 -346
- data/vendor/assets/stylesheets/twbs/bootstrap/jumbotron.less +0 -40
- data/vendor/assets/stylesheets/twbs/bootstrap/list-group.less +0 -88
- data/vendor/assets/stylesheets/twbs/bootstrap/mixins.less +0 -744
- data/vendor/assets/stylesheets/twbs/bootstrap/navbar.less +0 -621
- data/vendor/assets/stylesheets/twbs/bootstrap/pagination.less +0 -85
- data/vendor/assets/stylesheets/twbs/bootstrap/panels.less +0 -143
- data/vendor/assets/stylesheets/twbs/bootstrap/progress-bars.less +0 -96
- data/vendor/assets/stylesheets/twbs/bootstrap/responsive-utilities.less +0 -220
- data/vendor/assets/stylesheets/twbs/bootstrap/theme.less +0 -244
- data/vendor/assets/stylesheets/twbs/bootstrap/thumbnails.less +0 -32
- data/vendor/assets/stylesheets/twbs/bootstrap/tooltip.less +0 -95
- data/vendor/assets/stylesheets/twbs/bootstrap/type.less +0 -271
- data/vendor/assets/stylesheets/twbs/bootstrap/variables.less +0 -635
@@ -1,31 +1,22 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: button.js v3.
|
3
|
-
* http://
|
2
|
+
* Bootstrap: button.js v3.1.0
|
3
|
+
* http://getbootstrap.com/javascript/#buttons
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// BUTTON PUBLIC CLASS DEFINITION
|
24
14
|
// ==============================
|
25
15
|
|
26
16
|
var Button = function (element, options) {
|
27
|
-
this.$element
|
28
|
-
this.options
|
17
|
+
this.$element = $(element)
|
18
|
+
this.options = $.extend({}, Button.DEFAULTS, options)
|
19
|
+
this.isLoading = false
|
29
20
|
}
|
30
21
|
|
31
22
|
Button.DEFAULTS = {
|
@@ -45,24 +36,31 @@
|
|
45
36
|
$el[val](data[state] || this.options[state])
|
46
37
|
|
47
38
|
// push to event loop to allow forms to submit
|
48
|
-
setTimeout(function () {
|
49
|
-
state == 'loadingText'
|
50
|
-
|
51
|
-
$el.
|
52
|
-
|
39
|
+
setTimeout($.proxy(function () {
|
40
|
+
if (state == 'loadingText') {
|
41
|
+
this.isLoading = true
|
42
|
+
$el.addClass(d).attr(d, d)
|
43
|
+
} else if (this.isLoading) {
|
44
|
+
this.isLoading = false
|
45
|
+
$el.removeClass(d).removeAttr(d)
|
46
|
+
}
|
47
|
+
}, this), 0)
|
53
48
|
}
|
54
49
|
|
55
50
|
Button.prototype.toggle = function () {
|
51
|
+
var changed = true
|
56
52
|
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
57
53
|
|
58
54
|
if ($parent.length) {
|
59
55
|
var $input = this.$element.find('input')
|
60
|
-
|
61
|
-
.
|
62
|
-
|
56
|
+
if ($input.prop('type') == 'radio') {
|
57
|
+
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
58
|
+
else $parent.find('.active').removeClass('active')
|
59
|
+
}
|
60
|
+
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
63
61
|
}
|
64
62
|
|
65
|
-
this.$element.toggleClass('active')
|
63
|
+
if (changed) this.$element.toggleClass('active')
|
66
64
|
}
|
67
65
|
|
68
66
|
|
@@ -106,4 +104,4 @@
|
|
106
104
|
e.preventDefault()
|
107
105
|
})
|
108
106
|
|
109
|
-
}(
|
107
|
+
}(jQuery);
|
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: carousel.js v3.
|
3
|
-
* http://
|
2
|
+
* Bootstrap: carousel.js v3.1.0
|
3
|
+
* http://getbootstrap.com/javascript/#carousel
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// CAROUSEL CLASS DEFINITION
|
24
14
|
// =========================
|
@@ -39,9 +29,9 @@
|
|
39
29
|
}
|
40
30
|
|
41
31
|
Carousel.DEFAULTS = {
|
42
|
-
interval: 5000
|
43
|
-
|
44
|
-
|
32
|
+
interval: 5000,
|
33
|
+
pause: 'hover',
|
34
|
+
wrap: true
|
45
35
|
}
|
46
36
|
|
47
37
|
Carousel.prototype.cycle = function (e) {
|
@@ -69,7 +59,7 @@
|
|
69
59
|
|
70
60
|
if (pos > (this.$items.length - 1) || pos < 0) return
|
71
61
|
|
72
|
-
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
|
62
|
+
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
73
63
|
if (activeIndex == pos) return this.pause().cycle()
|
74
64
|
|
75
65
|
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
@@ -78,7 +68,7 @@
|
|
78
68
|
Carousel.prototype.pause = function (e) {
|
79
69
|
e || (this.paused = true)
|
80
70
|
|
81
|
-
if (this.$element.find('.next, .prev').length && $.support.transition
|
71
|
+
if (this.$element.find('.next, .prev').length && $.support.transition) {
|
82
72
|
this.$element.trigger($.support.transition.end)
|
83
73
|
this.cycle(true)
|
84
74
|
}
|
@@ -111,25 +101,25 @@
|
|
111
101
|
$next = this.$element.find('.item')[fallback]()
|
112
102
|
}
|
113
103
|
|
114
|
-
this.sliding =
|
115
|
-
|
116
|
-
isCycling && this.pause()
|
104
|
+
if ($next.hasClass('active')) return this.sliding = false
|
117
105
|
|
118
106
|
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
107
|
+
this.$element.trigger(e)
|
108
|
+
if (e.isDefaultPrevented()) return
|
119
109
|
|
120
|
-
|
110
|
+
this.sliding = true
|
111
|
+
|
112
|
+
isCycling && this.pause()
|
121
113
|
|
122
114
|
if (this.$indicators.length) {
|
123
115
|
this.$indicators.find('.active').removeClass('active')
|
124
|
-
this.$element.one('slid', function () {
|
116
|
+
this.$element.one('slid.bs.carousel', function () {
|
125
117
|
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
126
118
|
$nextIndicator && $nextIndicator.addClass('active')
|
127
119
|
})
|
128
120
|
}
|
129
121
|
|
130
122
|
if ($.support.transition && this.$element.hasClass('slide')) {
|
131
|
-
this.$element.trigger(e)
|
132
|
-
if (e.isDefaultPrevented()) return
|
133
123
|
$next.addClass(type)
|
134
124
|
$next[0].offsetWidth // force reflow
|
135
125
|
$active.addClass(direction)
|
@@ -139,16 +129,14 @@
|
|
139
129
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
140
130
|
$active.removeClass(['active', direction].join(' '))
|
141
131
|
that.sliding = false
|
142
|
-
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
132
|
+
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
143
133
|
})
|
144
|
-
.emulateTransitionEnd(
|
134
|
+
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
145
135
|
} else {
|
146
|
-
this.$element.trigger(e)
|
147
|
-
if (e.isDefaultPrevented()) return
|
148
136
|
$active.removeClass('active')
|
149
137
|
$next.addClass('active')
|
150
138
|
this.sliding = false
|
151
|
-
this.$element.trigger('slid')
|
139
|
+
this.$element.trigger('slid.bs.carousel')
|
152
140
|
}
|
153
141
|
|
154
142
|
isCycling && this.cycle()
|
@@ -214,4 +202,4 @@
|
|
214
202
|
})
|
215
203
|
})
|
216
204
|
|
217
|
-
}(
|
205
|
+
}(jQuery);
|
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: collapse.js v3.
|
3
|
-
* http://
|
2
|
+
* Bootstrap: collapse.js v3.1.0
|
3
|
+
* http://getbootstrap.com/javascript/#collapse
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// COLLAPSE PUBLIC CLASS DEFINITION
|
24
14
|
// ================================
|
@@ -69,7 +59,7 @@
|
|
69
59
|
var complete = function () {
|
70
60
|
this.$element
|
71
61
|
.removeClass('collapsing')
|
72
|
-
.addClass('in')
|
62
|
+
.addClass('collapse in')
|
73
63
|
[dimension]('auto')
|
74
64
|
this.transitioning = 0
|
75
65
|
this.$element.trigger('shown.bs.collapse')
|
@@ -137,6 +127,7 @@
|
|
137
127
|
var data = $this.data('bs.collapse')
|
138
128
|
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
139
129
|
|
130
|
+
if (!data && options.toggle && option == 'show') option = !option
|
140
131
|
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
141
132
|
if (typeof option == 'string') data[option]()
|
142
133
|
})
|
@@ -176,4 +167,4 @@
|
|
176
167
|
$target.collapse(option)
|
177
168
|
})
|
178
169
|
|
179
|
-
}(
|
170
|
+
}(jQuery);
|
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: dropdown.js v3.
|
3
|
-
* http://
|
2
|
+
* Bootstrap: dropdown.js v3.1.0
|
3
|
+
* http://getbootstrap.com/javascript/#dropdowns
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// DROPDOWN CLASS DEFINITION
|
24
14
|
// =========================
|
@@ -26,7 +16,7 @@
|
|
26
16
|
var backdrop = '.dropdown-backdrop'
|
27
17
|
var toggle = '[data-toggle=dropdown]'
|
28
18
|
var Dropdown = function (element) {
|
29
|
-
|
19
|
+
$(element).on('click.bs.dropdown', this.toggle)
|
30
20
|
}
|
31
21
|
|
32
22
|
Dropdown.prototype.toggle = function (e) {
|
@@ -41,17 +31,18 @@
|
|
41
31
|
|
42
32
|
if (!isActive) {
|
43
33
|
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
44
|
-
// if mobile we
|
34
|
+
// if mobile we use a backdrop because click events don't delegate
|
45
35
|
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
46
36
|
}
|
47
37
|
|
48
|
-
|
38
|
+
var relatedTarget = { relatedTarget: this }
|
39
|
+
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
49
40
|
|
50
41
|
if (e.isDefaultPrevented()) return
|
51
42
|
|
52
43
|
$parent
|
53
44
|
.toggleClass('open')
|
54
|
-
.trigger('shown.bs.dropdown')
|
45
|
+
.trigger('shown.bs.dropdown', relatedTarget)
|
55
46
|
|
56
47
|
$this.focus()
|
57
48
|
}
|
@@ -77,7 +68,8 @@
|
|
77
68
|
return $this.click()
|
78
69
|
}
|
79
70
|
|
80
|
-
var
|
71
|
+
var desc = ' li:not(.divider):visible a'
|
72
|
+
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
|
81
73
|
|
82
74
|
if (!$items.length) return
|
83
75
|
|
@@ -85,19 +77,20 @@
|
|
85
77
|
|
86
78
|
if (e.keyCode == 38 && index > 0) index-- // up
|
87
79
|
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
88
|
-
if (!~index) index=0
|
80
|
+
if (!~index) index = 0
|
89
81
|
|
90
82
|
$items.eq(index).focus()
|
91
83
|
}
|
92
84
|
|
93
|
-
function clearMenus() {
|
85
|
+
function clearMenus(e) {
|
94
86
|
$(backdrop).remove()
|
95
|
-
$(toggle).each(function (
|
87
|
+
$(toggle).each(function () {
|
96
88
|
var $parent = getParent($(this))
|
89
|
+
var relatedTarget = { relatedTarget: this }
|
97
90
|
if (!$parent.hasClass('open')) return
|
98
|
-
$parent.trigger(e = $.Event('hide.bs.dropdown'))
|
91
|
+
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
99
92
|
if (e.isDefaultPrevented()) return
|
100
|
-
$parent.removeClass('open').trigger('hidden.bs.dropdown')
|
93
|
+
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
101
94
|
})
|
102
95
|
}
|
103
96
|
|
@@ -106,7 +99,7 @@
|
|
106
99
|
|
107
100
|
if (!selector) {
|
108
101
|
selector = $this.attr('href')
|
109
|
-
selector = selector &&
|
102
|
+
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
110
103
|
}
|
111
104
|
|
112
105
|
var $parent = selector && $(selector)
|
@@ -123,9 +116,9 @@
|
|
123
116
|
$.fn.dropdown = function (option) {
|
124
117
|
return this.each(function () {
|
125
118
|
var $this = $(this)
|
126
|
-
var data = $this.data('dropdown')
|
119
|
+
var data = $this.data('bs.dropdown')
|
127
120
|
|
128
|
-
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
121
|
+
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
129
122
|
if (typeof option == 'string') data[option].call($this)
|
130
123
|
})
|
131
124
|
}
|
@@ -148,7 +141,7 @@
|
|
148
141
|
$(document)
|
149
142
|
.on('click.bs.dropdown.data-api', clearMenus)
|
150
143
|
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
151
|
-
.on('click.bs.dropdown.data-api'
|
152
|
-
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]'
|
144
|
+
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
145
|
+
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
|
153
146
|
|
154
|
-
}(
|
147
|
+
}(jQuery);
|
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: modal.js v3.
|
3
|
-
* http://
|
2
|
+
* Bootstrap: modal.js v3.1.0
|
3
|
+
* http://getbootstrap.com/javascript/#modals
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// MODAL CLASS DEFINITION
|
24
14
|
// ======================
|
@@ -29,13 +19,19 @@
|
|
29
19
|
this.$backdrop =
|
30
20
|
this.isShown = null
|
31
21
|
|
32
|
-
if (this.options.remote)
|
22
|
+
if (this.options.remote) {
|
23
|
+
this.$element
|
24
|
+
.find('.modal-content')
|
25
|
+
.load(this.options.remote, $.proxy(function () {
|
26
|
+
this.$element.trigger('loaded.bs.modal')
|
27
|
+
}, this))
|
28
|
+
}
|
33
29
|
}
|
34
30
|
|
35
31
|
Modal.DEFAULTS = {
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
backdrop: true,
|
33
|
+
keyboard: true,
|
34
|
+
show: true
|
39
35
|
}
|
40
36
|
|
41
37
|
Modal.prototype.toggle = function (_relatedTarget) {
|
@@ -54,7 +50,7 @@
|
|
54
50
|
|
55
51
|
this.escape()
|
56
52
|
|
57
|
-
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
53
|
+
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
58
54
|
|
59
55
|
this.backdrop(function () {
|
60
56
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
@@ -63,7 +59,9 @@
|
|
63
59
|
that.$element.appendTo(document.body) // don't move modals dom position
|
64
60
|
}
|
65
61
|
|
66
|
-
that.$element
|
62
|
+
that.$element
|
63
|
+
.show()
|
64
|
+
.scrollTop(0)
|
67
65
|
|
68
66
|
if (transition) {
|
69
67
|
that.$element[0].offsetWidth // force reflow
|
@@ -105,7 +103,7 @@
|
|
105
103
|
this.$element
|
106
104
|
.removeClass('in')
|
107
105
|
.attr('aria-hidden', true)
|
108
|
-
.off('click.dismiss.modal')
|
106
|
+
.off('click.dismiss.bs.modal')
|
109
107
|
|
110
108
|
$.support.transition && this.$element.hasClass('fade') ?
|
111
109
|
this.$element
|
@@ -149,7 +147,6 @@
|
|
149
147
|
}
|
150
148
|
|
151
149
|
Modal.prototype.backdrop = function (callback) {
|
152
|
-
var that = this
|
153
150
|
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
154
151
|
|
155
152
|
if (this.isShown && this.options.backdrop) {
|
@@ -158,7 +155,7 @@
|
|
158
155
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
159
156
|
.appendTo(document.body)
|
160
157
|
|
161
|
-
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
|
158
|
+
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
162
159
|
if (e.target !== e.currentTarget) return
|
163
160
|
this.options.backdrop == 'static'
|
164
161
|
? this.$element[0].focus.call(this.$element[0])
|
@@ -180,7 +177,7 @@
|
|
180
177
|
} else if (!this.isShown && this.$backdrop) {
|
181
178
|
this.$backdrop.removeClass('in')
|
182
179
|
|
183
|
-
$.support.transition && this.$element.hasClass('fade')?
|
180
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
184
181
|
this.$backdrop
|
185
182
|
.one($.support.transition.end, callback)
|
186
183
|
.emulateTransitionEnd(150) :
|
@@ -228,9 +225,9 @@
|
|
228
225
|
var $this = $(this)
|
229
226
|
var href = $this.attr('href')
|
230
227
|
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
231
|
-
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
228
|
+
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
232
229
|
|
233
|
-
e.preventDefault()
|
230
|
+
if ($this.is('a')) e.preventDefault()
|
234
231
|
|
235
232
|
$target
|
236
233
|
.modal(option, this)
|
@@ -240,7 +237,7 @@
|
|
240
237
|
})
|
241
238
|
|
242
239
|
$(document)
|
243
|
-
.on('show.bs.modal',
|
240
|
+
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
244
241
|
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
245
242
|
|
246
|
-
}(
|
243
|
+
}(jQuery);
|
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: popover.js v3.
|
3
|
-
* http://
|
2
|
+
* Bootstrap: popover.js v3.1.0
|
3
|
+
* http://getbootstrap.com/javascript/#popovers
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// POPOVER PUBLIC CLASS DEFINITION
|
24
14
|
// ===============================
|
@@ -29,11 +19,11 @@
|
|
29
19
|
|
30
20
|
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
31
21
|
|
32
|
-
Popover.DEFAULTS = $.extend({}
|
33
|
-
placement: 'right'
|
34
|
-
|
35
|
-
|
36
|
-
|
22
|
+
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
23
|
+
placement: 'right',
|
24
|
+
trigger: 'click',
|
25
|
+
content: '',
|
26
|
+
template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
37
27
|
})
|
38
28
|
|
39
29
|
|
@@ -54,7 +44,9 @@
|
|
54
44
|
var content = this.getContent()
|
55
45
|
|
56
46
|
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
57
|
-
$tip.find('.popover-content')[
|
47
|
+
$tip.find('.popover-content')[ // we use append for html objects to maintain js events
|
48
|
+
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
49
|
+
](content)
|
58
50
|
|
59
51
|
$tip.removeClass('fade top bottom left right in')
|
60
52
|
|
@@ -98,6 +90,7 @@
|
|
98
90
|
var data = $this.data('bs.popover')
|
99
91
|
var options = typeof option == 'object' && option
|
100
92
|
|
93
|
+
if (!data && option == 'destroy') return
|
101
94
|
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
102
95
|
if (typeof option == 'string') data[option]()
|
103
96
|
})
|
@@ -114,4 +107,4 @@
|
|
114
107
|
return this
|
115
108
|
}
|
116
109
|
|
117
|
-
}(
|
110
|
+
}(jQuery);
|