less-rails-bootstrap 2.3.3 → 3.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +7 -11
- data/lib/less/rails/bootstrap/version.rb +1 -1
- data/scripts/update_bootstrap.sh +37 -8
- data/test/cases/usage_css_spec.rb +15 -12
- data/test/cases/usage_js_spec.rb +4 -4
- data/test/dummy_app/app/assets/stylesheets/fonts.css.less +2 -0
- data/test/dummy_app/app/assets/stylesheets/framework.css.less +4 -2
- data/test/dummy_app/app/assets/stylesheets/individual.css.less +2 -2
- data/test/spec_helper.rb +1 -2
- data/vendor/assets/javascripts/twitter/bootstrap.js +0 -1
- data/vendor/assets/javascripts/twitter/bootstrap/affix.js +58 -49
- data/vendor/assets/javascripts/twitter/bootstrap/alert.js +36 -37
- data/vendor/assets/javascripts/twitter/bootstrap/button.js +41 -39
- data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +131 -125
- data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +108 -96
- data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +72 -87
- data/vendor/assets/javascripts/twitter/bootstrap/modal.js +149 -155
- data/vendor/assets/javascripts/twitter/bootstrap/popover.js +60 -59
- data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +103 -107
- data/vendor/assets/javascripts/twitter/bootstrap/tab.js +73 -82
- data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +258 -255
- data/vendor/assets/javascripts/twitter/bootstrap/transition.js +34 -38
- data/vendor/frameworks/twitter/bootstrap/accordion.less +9 -12
- data/vendor/frameworks/twitter/bootstrap/alerts.less +43 -53
- data/vendor/frameworks/twitter/bootstrap/bootstrap.less +21 -21
- data/vendor/frameworks/twitter/bootstrap/breadcrumbs.less +7 -8
- data/vendor/frameworks/twitter/bootstrap/button-groups.less +93 -151
- data/vendor/frameworks/twitter/bootstrap/buttons.less +93 -164
- data/vendor/frameworks/twitter/bootstrap/carousel.less +110 -63
- data/vendor/frameworks/twitter/bootstrap/close.less +18 -17
- data/vendor/frameworks/twitter/bootstrap/code.less +14 -20
- data/vendor/frameworks/twitter/bootstrap/component-animations.less +10 -3
- data/vendor/frameworks/twitter/bootstrap/dropdowns.less +66 -143
- data/vendor/frameworks/twitter/bootstrap/forms.less +281 -548
- data/vendor/frameworks/twitter/bootstrap/grid.less +194 -11
- data/vendor/frameworks/twitter/bootstrap/media.less +8 -7
- data/vendor/frameworks/twitter/bootstrap/mixins.less +290 -446
- data/vendor/frameworks/twitter/bootstrap/modals.less +92 -51
- data/vendor/frameworks/twitter/bootstrap/navbar.less +285 -402
- data/vendor/frameworks/twitter/bootstrap/navs.less +176 -348
- data/vendor/frameworks/twitter/bootstrap/pager.less +45 -33
- data/vendor/frameworks/twitter/bootstrap/pagination.less +89 -104
- data/vendor/frameworks/twitter/bootstrap/popovers.less +53 -51
- data/vendor/frameworks/twitter/bootstrap/progress-bars.less +28 -45
- data/vendor/frameworks/twitter/bootstrap/responsive-utilities.less +92 -32
- data/vendor/frameworks/twitter/bootstrap/scaffolding.less +60 -18
- data/vendor/frameworks/twitter/bootstrap/tables.less +131 -164
- data/vendor/frameworks/twitter/bootstrap/thumbnails.less +20 -31
- data/vendor/frameworks/twitter/bootstrap/tooltip.less +45 -20
- data/vendor/frameworks/twitter/bootstrap/type.less +84 -99
- data/vendor/frameworks/twitter/bootstrap/utilities.less +17 -5
- data/vendor/frameworks/twitter/bootstrap/variables.less +446 -179
- data/vendor/frameworks/twitter/bootstrap/wells.less +5 -5
- metadata +41 -44
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
- data/vendor/assets/stylesheets/twitter/bootstrap-responsive.css.less +0 -1
- data/vendor/assets/stylesheets/twitter/bootstrap.css.less +0 -1
- data/vendor/frameworks/twitter/bootstrap.less +0 -1
- data/vendor/frameworks/twitter/bootstrap/hero-unit.less +0 -25
- data/vendor/frameworks/twitter/bootstrap/labels-badges.less +0 -84
- data/vendor/frameworks/twitter/bootstrap/layouts.less +0 -16
- data/vendor/frameworks/twitter/bootstrap/reset.less +0 -216
- data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.less +0 -28
- data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.less +0 -193
- data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.less +0 -19
- data/vendor/frameworks/twitter/bootstrap/responsive-navbar.less +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive.less +0 -48
- data/vendor/frameworks/twitter/bootstrap/sprites.less +0 -197
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://
|
4
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: scrollspy.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#scrollspy
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,133 +15,129 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* SCROLLSPY CLASS DEFINITION
|
27
|
-
* ========================== */
|
23
|
+
// SCROLLSPY CLASS DEFINITION
|
24
|
+
// ==========================
|
28
25
|
|
29
26
|
function ScrollSpy(element, options) {
|
30
|
-
var
|
31
|
-
|
32
|
-
|
33
|
-
this.
|
34
|
-
this.$
|
35
|
-
this
|
27
|
+
var href
|
28
|
+
var process = $.proxy(this.process, this)
|
29
|
+
|
30
|
+
this.$element = $(element).is('body') ? $(window) : $(element)
|
31
|
+
this.$body = $('body')
|
32
|
+
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
|
33
|
+
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
34
|
+
this.selector = (this.options.target
|
36
35
|
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
37
36
|
|| '') + ' .nav li > a'
|
38
|
-
this
|
37
|
+
this.offsets = $([])
|
38
|
+
this.targets = $([])
|
39
|
+
this.activeTarget = null
|
40
|
+
|
39
41
|
this.refresh()
|
40
42
|
this.process()
|
41
43
|
}
|
42
44
|
|
43
|
-
ScrollSpy.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
}
|
114
|
-
|
115
|
-
active.trigger('activate')
|
116
|
-
}
|
45
|
+
ScrollSpy.DEFAULTS = {
|
46
|
+
offset: 10
|
47
|
+
}
|
48
|
+
|
49
|
+
ScrollSpy.prototype.refresh = function () {
|
50
|
+
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
|
51
|
+
|
52
|
+
this.offsets = $([])
|
53
|
+
this.targets = $([])
|
54
|
+
|
55
|
+
var self = this
|
56
|
+
var $targets = this.$body
|
57
|
+
.find(this.selector)
|
58
|
+
.map(function () {
|
59
|
+
var $el = $(this)
|
60
|
+
var href = $el.data('target') || $el.attr('href')
|
61
|
+
var $href = /^#\w/.test(href) && $(href)
|
62
|
+
|
63
|
+
return ($href
|
64
|
+
&& $href.length
|
65
|
+
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
66
|
+
})
|
67
|
+
.sort(function (a, b) { return a[0] - b[0] })
|
68
|
+
.each(function () {
|
69
|
+
self.offsets.push(this[0])
|
70
|
+
self.targets.push(this[1])
|
71
|
+
})
|
72
|
+
}
|
73
|
+
|
74
|
+
ScrollSpy.prototype.process = function () {
|
75
|
+
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
76
|
+
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
77
|
+
var maxScroll = scrollHeight - this.$scrollElement.height()
|
78
|
+
var offsets = this.offsets
|
79
|
+
var targets = this.targets
|
80
|
+
var activeTarget = this.activeTarget
|
81
|
+
var i
|
82
|
+
|
83
|
+
if (scrollTop >= maxScroll) {
|
84
|
+
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
85
|
+
}
|
86
|
+
|
87
|
+
for (i = offsets.length; i--;) {
|
88
|
+
activeTarget != targets[i]
|
89
|
+
&& scrollTop >= offsets[i]
|
90
|
+
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
91
|
+
&& this.activate( targets[i] )
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
ScrollSpy.prototype.activate = function (target) {
|
96
|
+
this.activeTarget = target
|
97
|
+
|
98
|
+
$(this.selector)
|
99
|
+
.parents('.active')
|
100
|
+
.removeClass('active')
|
101
|
+
|
102
|
+
var selector = this.selector
|
103
|
+
+ '[data-target="' + target + '"],'
|
104
|
+
+ this.selector + '[href="' + target + '"]'
|
105
|
+
|
106
|
+
var active = $(selector)
|
107
|
+
.parents('li')
|
108
|
+
.addClass('active')
|
109
|
+
|
110
|
+
if (active.parent('.dropdown-menu').length) {
|
111
|
+
active = active
|
112
|
+
.closest('li.dropdown')
|
113
|
+
.addClass('active')
|
114
|
+
}
|
117
115
|
|
116
|
+
active.trigger('activate')
|
118
117
|
}
|
119
118
|
|
120
119
|
|
121
|
-
|
122
|
-
|
120
|
+
// SCROLLSPY PLUGIN DEFINITION
|
121
|
+
// ===========================
|
123
122
|
|
124
123
|
var old = $.fn.scrollspy
|
125
124
|
|
126
125
|
$.fn.scrollspy = function (option) {
|
127
126
|
return this.each(function () {
|
128
|
-
var $this
|
129
|
-
|
130
|
-
|
131
|
-
|
127
|
+
var $this = $(this)
|
128
|
+
var data = $this.data('bs.scrollspy')
|
129
|
+
var options = typeof option == 'object' && option
|
130
|
+
|
131
|
+
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
132
132
|
if (typeof option == 'string') data[option]()
|
133
133
|
})
|
134
134
|
}
|
135
135
|
|
136
136
|
$.fn.scrollspy.Constructor = ScrollSpy
|
137
137
|
|
138
|
-
$.fn.scrollspy.defaults = {
|
139
|
-
offset: 10
|
140
|
-
}
|
141
|
-
|
142
138
|
|
143
|
-
|
144
|
-
|
139
|
+
// SCROLLSPY NO CONFLICT
|
140
|
+
// =====================
|
145
141
|
|
146
142
|
$.fn.scrollspy.noConflict = function () {
|
147
143
|
$.fn.scrollspy = old
|
@@ -149,8 +145,8 @@
|
|
149
145
|
}
|
150
146
|
|
151
147
|
|
152
|
-
|
153
|
-
|
148
|
+
// SCROLLSPY DATA-API
|
149
|
+
// ==================
|
154
150
|
|
155
151
|
$(window).on('load', function () {
|
156
152
|
$('[data-spy="scroll"]').each(function () {
|
@@ -159,4 +155,4 @@
|
|
159
155
|
})
|
160
156
|
})
|
161
157
|
|
162
|
-
}(window.jQuery);
|
158
|
+
}(window.jQuery);
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://
|
4
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: tab.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#tabs
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,108 +15,99 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* TAB CLASS DEFINITION
|
27
|
-
* ==================== */
|
23
|
+
// TAB CLASS DEFINITION
|
24
|
+
// ====================
|
28
25
|
|
29
26
|
var Tab = function (element) {
|
30
27
|
this.element = $(element)
|
31
28
|
}
|
32
29
|
|
33
|
-
Tab.prototype = {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
, show: function () {
|
38
|
-
var $this = this.element
|
39
|
-
, $ul = $this.closest('ul:not(.dropdown-menu)')
|
40
|
-
, selector = $this.attr('data-target')
|
41
|
-
, previous
|
42
|
-
, $target
|
43
|
-
, e
|
44
|
-
|
45
|
-
if (!selector) {
|
46
|
-
selector = $this.attr('href')
|
47
|
-
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
48
|
-
}
|
30
|
+
Tab.prototype.show = function () {
|
31
|
+
var $this = this.element
|
32
|
+
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
33
|
+
var selector = $this.attr('data-target')
|
49
34
|
|
50
|
-
|
35
|
+
if (!selector) {
|
36
|
+
selector = $this.attr('href')
|
37
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
38
|
+
}
|
51
39
|
|
52
|
-
|
40
|
+
if ($this.parent('li').hasClass('active')) return
|
53
41
|
|
54
|
-
|
55
|
-
|
56
|
-
|
42
|
+
var previous = $ul.find('.active:last a')[0]
|
43
|
+
var e = $.Event('show.bs.tab', {
|
44
|
+
relatedTarget: previous
|
45
|
+
})
|
57
46
|
|
58
|
-
|
47
|
+
$this.trigger(e)
|
59
48
|
|
60
|
-
|
49
|
+
if (e.isDefaultPrevented()) return
|
61
50
|
|
62
|
-
|
51
|
+
var $target = $(selector)
|
63
52
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
})
|
53
|
+
this.activate($this.parent('li'), $ul)
|
54
|
+
this.activate($target, $target.parent(), function () {
|
55
|
+
$this.trigger({
|
56
|
+
type: 'shown.bs.tab'
|
57
|
+
, relatedTarget: previous
|
70
58
|
})
|
71
|
-
}
|
72
|
-
|
73
|
-
, activate: function ( element, container, callback) {
|
74
|
-
var $active = container.find('> .active')
|
75
|
-
, transition = callback
|
76
|
-
&& $.support.transition
|
77
|
-
&& $active.hasClass('fade')
|
78
|
-
|
79
|
-
function next() {
|
80
|
-
$active
|
81
|
-
.removeClass('active')
|
82
|
-
.find('> .dropdown-menu > .active')
|
83
|
-
.removeClass('active')
|
84
|
-
|
85
|
-
element.addClass('active')
|
86
|
-
|
87
|
-
if (transition) {
|
88
|
-
element[0].offsetWidth // reflow for transition
|
89
|
-
element.addClass('in')
|
90
|
-
} else {
|
91
|
-
element.removeClass('fade')
|
92
|
-
}
|
93
|
-
|
94
|
-
if ( element.parent('.dropdown-menu') ) {
|
95
|
-
element.closest('li.dropdown').addClass('active')
|
96
|
-
}
|
59
|
+
})
|
60
|
+
}
|
97
61
|
|
98
|
-
|
62
|
+
Tab.prototype.activate = function (element, container, callback) {
|
63
|
+
var $active = container.find('> .active')
|
64
|
+
var transition = callback
|
65
|
+
&& $.support.transition
|
66
|
+
&& $active.hasClass('fade')
|
67
|
+
|
68
|
+
function next() {
|
69
|
+
$active
|
70
|
+
.removeClass('active')
|
71
|
+
.find('> .dropdown-menu > .active')
|
72
|
+
.removeClass('active')
|
73
|
+
|
74
|
+
element.addClass('active')
|
75
|
+
|
76
|
+
if (transition) {
|
77
|
+
element[0].offsetWidth // reflow for transition
|
78
|
+
element.addClass('in')
|
79
|
+
} else {
|
80
|
+
element.removeClass('fade')
|
99
81
|
}
|
100
82
|
|
101
|
-
|
102
|
-
|
103
|
-
|
83
|
+
if (element.parent('.dropdown-menu')) {
|
84
|
+
element.closest('li.dropdown').addClass('active')
|
85
|
+
}
|
104
86
|
|
105
|
-
|
87
|
+
callback && callback()
|
106
88
|
}
|
89
|
+
|
90
|
+
transition ?
|
91
|
+
$active
|
92
|
+
.one($.support.transition.end, next)
|
93
|
+
.emulateTransitionEnd(150) :
|
94
|
+
next()
|
95
|
+
|
96
|
+
$active.removeClass('in')
|
107
97
|
}
|
108
98
|
|
109
99
|
|
110
|
-
|
111
|
-
|
100
|
+
// TAB PLUGIN DEFINITION
|
101
|
+
// =====================
|
112
102
|
|
113
103
|
var old = $.fn.tab
|
114
104
|
|
115
105
|
$.fn.tab = function ( option ) {
|
116
106
|
return this.each(function () {
|
117
107
|
var $this = $(this)
|
118
|
-
|
119
|
-
|
108
|
+
var data = $this.data('bs.tab')
|
109
|
+
|
110
|
+
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
120
111
|
if (typeof option == 'string') data[option]()
|
121
112
|
})
|
122
113
|
}
|
@@ -124,8 +115,8 @@
|
|
124
115
|
$.fn.tab.Constructor = Tab
|
125
116
|
|
126
117
|
|
127
|
-
|
128
|
-
|
118
|
+
// TAB NO CONFLICT
|
119
|
+
// ===============
|
129
120
|
|
130
121
|
$.fn.tab.noConflict = function () {
|
131
122
|
$.fn.tab = old
|
@@ -133,12 +124,12 @@
|
|
133
124
|
}
|
134
125
|
|
135
126
|
|
136
|
-
|
137
|
-
|
127
|
+
// TAB DATA-API
|
128
|
+
// ============
|
138
129
|
|
139
|
-
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
130
|
+
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
140
131
|
e.preventDefault()
|
141
132
|
$(this).tab('show')
|
142
133
|
})
|
143
134
|
|
144
|
-
}(window.jQuery);
|
135
|
+
}(window.jQuery);
|