compass-bootstrap-rails 0.1.3.1
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 +8 -0
- data/Gemfile +4 -0
- data/README.mkdn +151 -0
- data/Rakefile +1 -0
- data/compass-bootstrap.gemspec +25 -0
- data/lib/compass-bootstrap/rails/engine.rb +7 -0
- data/lib/compass-bootstrap/rails.rb +7 -0
- data/lib/compass-bootstrap/version.rb +5 -0
- data/lib/compass-bootstrap.rb +9 -0
- data/stylesheets/compass-bootstrap/_compass_bootstrap.scss +29 -0
- data/stylesheets/compass-bootstrap/_forms.scss +465 -0
- data/stylesheets/compass-bootstrap/_mixins.scss +210 -0
- data/stylesheets/compass-bootstrap/_patterns.scss +1003 -0
- data/stylesheets/compass-bootstrap/_reset.scss +141 -0
- data/stylesheets/compass-bootstrap/_scaffolding.scss +137 -0
- data/stylesheets/compass-bootstrap/_tables.scss +171 -0
- data/stylesheets/compass-bootstrap/_type.scss +187 -0
- data/stylesheets/compass-bootstrap/_variables.scss +60 -0
- data/vendor/assets/javascripts/bootstrap-alerts.js +104 -0
- data/vendor/assets/javascripts/bootstrap-dropdown.js +50 -0
- data/vendor/assets/javascripts/bootstrap-modal.js +227 -0
- data/vendor/assets/javascripts/bootstrap-popover.js +77 -0
- data/vendor/assets/javascripts/bootstrap-scrollspy.js +105 -0
- data/vendor/assets/javascripts/bootstrap-tabs.js +62 -0
- data/vendor/assets/javascripts/bootstrap-twipsy.js +307 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_compass_bootstrap.scss +29 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_forms.scss +465 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_mixins.scss +210 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_patterns.scss +1003 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_reset.scss +141 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_scaffolding.scss +137 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_tables.scss +171 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_type.scss +187 -0
- data/vendor/assets/stylesheets/compass-bootstrap/_variables.scss +60 -0
- data/vendor/assets/stylesheets/compass-bootstrap/compass_bootstrap.scss +29 -0
- data/vendor/assets/stylesheets/compass-bootstrap/manifest.rb +20 -0
- metadata +94 -0
@@ -0,0 +1,104 @@
|
|
1
|
+
/* ==========================================================
|
2
|
+
* bootstrap-alerts.js v1.3.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
4
|
+
* ==========================================================
|
5
|
+
* Copyright 2011 Twitter, Inc.
|
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.
|
18
|
+
* ========================================================== */
|
19
|
+
|
20
|
+
|
21
|
+
(function( $ ){
|
22
|
+
|
23
|
+
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
|
24
|
+
* ======================================================= */
|
25
|
+
|
26
|
+
var transitionEnd
|
27
|
+
|
28
|
+
$(document).ready(function () {
|
29
|
+
|
30
|
+
$.support.transition = (function () {
|
31
|
+
var thisBody = document.body || document.documentElement
|
32
|
+
, thisStyle = thisBody.style
|
33
|
+
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
|
34
|
+
return support
|
35
|
+
})()
|
36
|
+
|
37
|
+
// set CSS transition event type
|
38
|
+
if ( $.support.transition ) {
|
39
|
+
transitionEnd = "TransitionEnd"
|
40
|
+
if ( $.browser.webkit ) {
|
41
|
+
transitionEnd = "webkitTransitionEnd"
|
42
|
+
} else if ( $.browser.mozilla ) {
|
43
|
+
transitionEnd = "transitionend"
|
44
|
+
} else if ( $.browser.opera ) {
|
45
|
+
transitionEnd = "oTransitionEnd"
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
})
|
50
|
+
|
51
|
+
/* ALERT CLASS DEFINITION
|
52
|
+
* ====================== */
|
53
|
+
|
54
|
+
var Alert = function ( content, selector ) {
|
55
|
+
this.$element = $(content)
|
56
|
+
.delegate(selector || '.close', 'click', this.close)
|
57
|
+
}
|
58
|
+
|
59
|
+
Alert.prototype = {
|
60
|
+
|
61
|
+
close: function (e) {
|
62
|
+
var $element = $(this).parent('.alert-message')
|
63
|
+
|
64
|
+
e && e.preventDefault()
|
65
|
+
$element.removeClass('in')
|
66
|
+
|
67
|
+
function removeElement () {
|
68
|
+
$element.remove()
|
69
|
+
}
|
70
|
+
|
71
|
+
$.support.transition && $element.hasClass('fade') ?
|
72
|
+
$element.bind(transitionEnd, removeElement) :
|
73
|
+
removeElement()
|
74
|
+
}
|
75
|
+
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
/* ALERT PLUGIN DEFINITION
|
80
|
+
* ======================= */
|
81
|
+
|
82
|
+
$.fn.alert = function ( options ) {
|
83
|
+
|
84
|
+
if ( options === true ) {
|
85
|
+
return this.data('alert')
|
86
|
+
}
|
87
|
+
|
88
|
+
return this.each(function () {
|
89
|
+
var $this = $(this)
|
90
|
+
|
91
|
+
if ( typeof options == 'string' ) {
|
92
|
+
return $this.data('alert')[options]()
|
93
|
+
}
|
94
|
+
|
95
|
+
$(this).data('alert', new Alert( this ))
|
96
|
+
|
97
|
+
})
|
98
|
+
}
|
99
|
+
|
100
|
+
$(document).ready(function () {
|
101
|
+
new Alert($('body'), '.alert-message[data-alert] .close')
|
102
|
+
})
|
103
|
+
|
104
|
+
})( window.jQuery || window.ender )
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/* ============================================================
|
2
|
+
* bootstrap-dropdown.js v1.3.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#dropdown
|
4
|
+
* ============================================================
|
5
|
+
* Copyright 2011 Twitter, Inc.
|
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.
|
18
|
+
* ============================================================ */
|
19
|
+
|
20
|
+
|
21
|
+
(function( $ ){
|
22
|
+
|
23
|
+
var d = 'a.menu, .dropdown-toggle'
|
24
|
+
|
25
|
+
function clearMenus() {
|
26
|
+
$(d).parent('li').removeClass('open')
|
27
|
+
}
|
28
|
+
|
29
|
+
$(function () {
|
30
|
+
$('html').bind("click", clearMenus)
|
31
|
+
$('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
|
32
|
+
})
|
33
|
+
|
34
|
+
/* DROPDOWN PLUGIN DEFINITION
|
35
|
+
* ========================== */
|
36
|
+
|
37
|
+
$.fn.dropdown = function ( selector ) {
|
38
|
+
return this.each(function () {
|
39
|
+
$(this).delegate(selector || d, 'click', function (e) {
|
40
|
+
var li = $(this).parent('li')
|
41
|
+
, isActive = li.hasClass('open')
|
42
|
+
|
43
|
+
clearMenus()
|
44
|
+
!isActive && li.toggleClass('open')
|
45
|
+
return false
|
46
|
+
})
|
47
|
+
})
|
48
|
+
}
|
49
|
+
|
50
|
+
})( window.jQuery || window.ender )
|
@@ -0,0 +1,227 @@
|
|
1
|
+
/* =========================================================
|
2
|
+
* bootstrap-modal.js v1.3.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#modal
|
4
|
+
* =========================================================
|
5
|
+
* Copyright 2011 Twitter, Inc.
|
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.
|
18
|
+
* ========================================================= */
|
19
|
+
|
20
|
+
|
21
|
+
(function( $ ){
|
22
|
+
|
23
|
+
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
|
24
|
+
* ======================================================= */
|
25
|
+
|
26
|
+
var transitionEnd
|
27
|
+
|
28
|
+
$(document).ready(function () {
|
29
|
+
|
30
|
+
$.support.transition = (function () {
|
31
|
+
var thisBody = document.body || document.documentElement
|
32
|
+
, thisStyle = thisBody.style
|
33
|
+
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
|
34
|
+
return support
|
35
|
+
})()
|
36
|
+
|
37
|
+
// set CSS transition event type
|
38
|
+
if ( $.support.transition ) {
|
39
|
+
transitionEnd = "TransitionEnd"
|
40
|
+
if ( $.browser.webkit ) {
|
41
|
+
transitionEnd = "webkitTransitionEnd"
|
42
|
+
} else if ( $.browser.mozilla ) {
|
43
|
+
transitionEnd = "transitionend"
|
44
|
+
} else if ( $.browser.opera ) {
|
45
|
+
transitionEnd = "oTransitionEnd"
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
})
|
50
|
+
|
51
|
+
|
52
|
+
/* MODAL PUBLIC CLASS DEFINITION
|
53
|
+
* ============================= */
|
54
|
+
|
55
|
+
var Modal = function ( content, options ) {
|
56
|
+
this.settings = $.extend({}, $.fn.modal.defaults)
|
57
|
+
this.$element = $(content)
|
58
|
+
.delegate('.close', 'click.modal', $.proxy(this.hide, this))
|
59
|
+
|
60
|
+
if ( options ) {
|
61
|
+
$.extend( this.settings, options )
|
62
|
+
|
63
|
+
if ( options.show ) {
|
64
|
+
this.show()
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
return this
|
69
|
+
}
|
70
|
+
|
71
|
+
Modal.prototype = {
|
72
|
+
|
73
|
+
toggle: function () {
|
74
|
+
return this[!this.isShown ? 'show' : 'hide']()
|
75
|
+
}
|
76
|
+
|
77
|
+
, show: function () {
|
78
|
+
var that = this
|
79
|
+
this.isShown = true
|
80
|
+
this.$element.trigger('show')
|
81
|
+
|
82
|
+
escape.call(this)
|
83
|
+
backdrop.call(this, function () {
|
84
|
+
that.$element
|
85
|
+
.appendTo(document.body)
|
86
|
+
.show()
|
87
|
+
|
88
|
+
setTimeout(function () {
|
89
|
+
that.$element
|
90
|
+
.addClass('in')
|
91
|
+
.trigger('shown')
|
92
|
+
}, 1)
|
93
|
+
})
|
94
|
+
|
95
|
+
return this
|
96
|
+
}
|
97
|
+
|
98
|
+
, hide: function (e) {
|
99
|
+
e && e.preventDefault()
|
100
|
+
|
101
|
+
var that = this
|
102
|
+
this.isShown = false
|
103
|
+
|
104
|
+
escape.call(this)
|
105
|
+
|
106
|
+
this.$element
|
107
|
+
.trigger('hide')
|
108
|
+
.removeClass('in')
|
109
|
+
|
110
|
+
function removeElement () {
|
111
|
+
that.$element
|
112
|
+
.hide()
|
113
|
+
.trigger('hidden')
|
114
|
+
|
115
|
+
backdrop.call(that)
|
116
|
+
}
|
117
|
+
|
118
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
119
|
+
this.$element.one(transitionEnd, removeElement) :
|
120
|
+
removeElement()
|
121
|
+
|
122
|
+
return this
|
123
|
+
}
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
/* MODAL PRIVATE METHODS
|
129
|
+
* ===================== */
|
130
|
+
|
131
|
+
function backdrop ( callback ) {
|
132
|
+
var that = this
|
133
|
+
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
134
|
+
if ( this.isShown && this.settings.backdrop ) {
|
135
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
136
|
+
.click($.proxy(this.hide, this))
|
137
|
+
.appendTo(document.body)
|
138
|
+
|
139
|
+
setTimeout(function () {
|
140
|
+
that.$backdrop && that.$backdrop.addClass('in')
|
141
|
+
$.support.transition && that.$backdrop.hasClass('fade') ?
|
142
|
+
that.$backdrop.one(transitionEnd, callback) :
|
143
|
+
callback()
|
144
|
+
})
|
145
|
+
} else if ( !this.isShown && this.$backdrop ) {
|
146
|
+
this.$backdrop.removeClass('in')
|
147
|
+
|
148
|
+
function removeElement() {
|
149
|
+
that.$backdrop.remove()
|
150
|
+
that.$backdrop = null
|
151
|
+
}
|
152
|
+
|
153
|
+
$.support.transition && this.$element.hasClass('fade')?
|
154
|
+
this.$backdrop.one(transitionEnd, removeElement) :
|
155
|
+
removeElement()
|
156
|
+
} else if ( callback ) {
|
157
|
+
callback()
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
function escape() {
|
162
|
+
var that = this
|
163
|
+
if ( this.isShown && this.settings.keyboard ) {
|
164
|
+
$('body').bind('keyup.modal', function ( e ) {
|
165
|
+
if ( e.which == 27 ) {
|
166
|
+
that.hide()
|
167
|
+
}
|
168
|
+
})
|
169
|
+
} else if ( !this.isShown ) {
|
170
|
+
$('body').unbind('keyup.modal')
|
171
|
+
}
|
172
|
+
}
|
173
|
+
|
174
|
+
|
175
|
+
/* MODAL PLUGIN DEFINITION
|
176
|
+
* ======================= */
|
177
|
+
|
178
|
+
$.fn.modal = function ( options ) {
|
179
|
+
var modal = this.data('modal')
|
180
|
+
|
181
|
+
if (!modal) {
|
182
|
+
|
183
|
+
if (typeof options == 'string') {
|
184
|
+
options = {
|
185
|
+
show: /show|toggle/.test(options)
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
return this.each(function () {
|
190
|
+
$(this).data('modal', new Modal(this, options))
|
191
|
+
})
|
192
|
+
}
|
193
|
+
|
194
|
+
if ( options === true ) {
|
195
|
+
return modal
|
196
|
+
}
|
197
|
+
|
198
|
+
if ( typeof options == 'string' ) {
|
199
|
+
modal[options]()
|
200
|
+
} else if ( modal ) {
|
201
|
+
modal.toggle()
|
202
|
+
}
|
203
|
+
|
204
|
+
return this
|
205
|
+
}
|
206
|
+
|
207
|
+
$.fn.modal.Modal = Modal
|
208
|
+
|
209
|
+
$.fn.modal.defaults = {
|
210
|
+
backdrop: false
|
211
|
+
, keyboard: false
|
212
|
+
, show: true
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
/* MODAL DATA- IMPLEMENTATION
|
217
|
+
* ========================== */
|
218
|
+
|
219
|
+
$(document).ready(function () {
|
220
|
+
$('body').delegate('[data-controls-modal]', 'click', function (e) {
|
221
|
+
e.preventDefault()
|
222
|
+
var $this = $(this).data('show', true)
|
223
|
+
$('#' + $this.attr('data-controls-modal')).modal( $this.data() )
|
224
|
+
})
|
225
|
+
})
|
226
|
+
|
227
|
+
})( window.jQuery || window.ender )
|
@@ -0,0 +1,77 @@
|
|
1
|
+
/* ===========================================================
|
2
|
+
* bootstrap-popover.js v1.3.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#popover
|
4
|
+
* ===========================================================
|
5
|
+
* Copyright 2011 Twitter, Inc.
|
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.
|
18
|
+
* =========================================================== */
|
19
|
+
|
20
|
+
|
21
|
+
(function( $ ) {
|
22
|
+
|
23
|
+
var Popover = function ( element, options ) {
|
24
|
+
this.$element = $(element)
|
25
|
+
this.options = options
|
26
|
+
this.enabled = true
|
27
|
+
this.fixTitle()
|
28
|
+
}
|
29
|
+
|
30
|
+
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TWIPSY.js
|
31
|
+
========================================= */
|
32
|
+
|
33
|
+
Popover.prototype = $.extend({}, $.fn.twipsy.Twipsy.prototype, {
|
34
|
+
|
35
|
+
setContent: function () {
|
36
|
+
var $tip = this.tip()
|
37
|
+
$tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
|
38
|
+
$tip.find('.content p')[this.options.html ? 'html' : 'text'](this.getContent())
|
39
|
+
$tip[0].className = 'popover'
|
40
|
+
}
|
41
|
+
|
42
|
+
, getContent: function () {
|
43
|
+
var contentvar
|
44
|
+
, $e = this.$element
|
45
|
+
, o = this.options
|
46
|
+
|
47
|
+
if (typeof this.options.content == 'string') {
|
48
|
+
content = $e.attr(o.content)
|
49
|
+
} else if (typeof this.options.content == 'function') {
|
50
|
+
content = this.options.content.call(this.$element[0])
|
51
|
+
}
|
52
|
+
return content
|
53
|
+
}
|
54
|
+
|
55
|
+
, tip: function() {
|
56
|
+
if (!this.$tip) {
|
57
|
+
this.$tip = $('<div class="popover" />')
|
58
|
+
.html('<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>')
|
59
|
+
}
|
60
|
+
return this.$tip
|
61
|
+
}
|
62
|
+
|
63
|
+
})
|
64
|
+
|
65
|
+
|
66
|
+
/* POPOVER PLUGIN DEFINITION
|
67
|
+
* ======================= */
|
68
|
+
|
69
|
+
$.fn.popover = function (options) {
|
70
|
+
if (typeof options == 'object') options = $.extend({}, $.fn.popover.defaults, options)
|
71
|
+
$.fn.twipsy.initWith.call(this, options, Popover, 'popover')
|
72
|
+
return this
|
73
|
+
}
|
74
|
+
|
75
|
+
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'data-content', placement: 'right'})
|
76
|
+
|
77
|
+
})( window.jQuery || window.ender )
|
@@ -0,0 +1,105 @@
|
|
1
|
+
/* =============================================================
|
2
|
+
* bootstrap-scrollspy.js v1.3.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
4
|
+
* =============================================================
|
5
|
+
* Copyright 2011 Twitter, Inc.
|
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.
|
18
|
+
* ============================================================== */
|
19
|
+
|
20
|
+
|
21
|
+
!function ( $ ) {
|
22
|
+
|
23
|
+
var $window = $(window)
|
24
|
+
|
25
|
+
function ScrollSpy( topbar, selector ) {
|
26
|
+
var processScroll = $.proxy(this.processScroll, this)
|
27
|
+
this.$topbar = $(topbar)
|
28
|
+
this.selector = selector || 'li > a'
|
29
|
+
this.refresh()
|
30
|
+
this.$topbar.delegate(this.selector, 'click', processScroll)
|
31
|
+
$window.scroll(processScroll)
|
32
|
+
this.processScroll()
|
33
|
+
}
|
34
|
+
|
35
|
+
ScrollSpy.prototype = {
|
36
|
+
|
37
|
+
refresh: function () {
|
38
|
+
this.targets = this.$topbar.find(this.selector).map(function () {
|
39
|
+
var href = $(this).attr('href')
|
40
|
+
return /^#\w/.test(href) && $(href).length ? href : null
|
41
|
+
})
|
42
|
+
|
43
|
+
this.offsets = $.map(this.targets, function (id) {
|
44
|
+
return $(id).offset().top
|
45
|
+
})
|
46
|
+
}
|
47
|
+
|
48
|
+
, processScroll: function () {
|
49
|
+
var scrollTop = $window.scrollTop() + 10
|
50
|
+
, offsets = this.offsets
|
51
|
+
, targets = this.targets
|
52
|
+
, activeTarget = this.activeTarget
|
53
|
+
, i
|
54
|
+
|
55
|
+
for (i = offsets.length; i--;) {
|
56
|
+
activeTarget != targets[i]
|
57
|
+
&& scrollTop >= offsets[i]
|
58
|
+
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
59
|
+
&& this.activateButton( targets[i] )
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
, activateButton: function (target) {
|
64
|
+
this.activeTarget = target
|
65
|
+
|
66
|
+
this.$topbar
|
67
|
+
.find(this.selector).parent('.active')
|
68
|
+
.removeClass('active')
|
69
|
+
|
70
|
+
this.$topbar
|
71
|
+
.find(this.selector + '[href="' + target + '"]')
|
72
|
+
.parent('li')
|
73
|
+
.addClass('active')
|
74
|
+
}
|
75
|
+
|
76
|
+
}
|
77
|
+
|
78
|
+
/* SCROLLSPY PLUGIN DEFINITION
|
79
|
+
* =========================== */
|
80
|
+
|
81
|
+
$.fn.scrollSpy = function( options ) {
|
82
|
+
var scrollspy = this.data('scrollspy')
|
83
|
+
|
84
|
+
if (!scrollspy) {
|
85
|
+
return this.each(function () {
|
86
|
+
$(this).data('scrollspy', new ScrollSpy( this, options ))
|
87
|
+
})
|
88
|
+
}
|
89
|
+
|
90
|
+
if ( options === true ) {
|
91
|
+
return scrollspy
|
92
|
+
}
|
93
|
+
|
94
|
+
if ( typeof options == 'string' ) {
|
95
|
+
scrollspy[options]()
|
96
|
+
}
|
97
|
+
|
98
|
+
return this
|
99
|
+
}
|
100
|
+
|
101
|
+
$(document).ready(function () {
|
102
|
+
$('body').scrollSpy('[data-scrollspy] li > a')
|
103
|
+
})
|
104
|
+
|
105
|
+
}( window.jQuery || window.ender )
|
@@ -0,0 +1,62 @@
|
|
1
|
+
/* ========================================================
|
2
|
+
* bootstrap-tabs.js v1.3.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#tabs
|
4
|
+
* ========================================================
|
5
|
+
* Copyright 2011 Twitter, Inc.
|
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.
|
18
|
+
* ======================================================== */
|
19
|
+
|
20
|
+
|
21
|
+
(function( $ ){
|
22
|
+
|
23
|
+
function activate ( element, container ) {
|
24
|
+
container.find('.active').removeClass('active')
|
25
|
+
element.addClass('active')
|
26
|
+
}
|
27
|
+
|
28
|
+
function tab( e ) {
|
29
|
+
var $this = $(this)
|
30
|
+
, href = $this.attr('href')
|
31
|
+
, $ul = $(e.liveFired)
|
32
|
+
, $controlled
|
33
|
+
|
34
|
+
if (/^#\w+/.test(href)) {
|
35
|
+
e.preventDefault()
|
36
|
+
|
37
|
+
if ($this.hasClass('active')) {
|
38
|
+
return
|
39
|
+
}
|
40
|
+
|
41
|
+
$href = $(href)
|
42
|
+
|
43
|
+
activate($this.parent('li'), $ul)
|
44
|
+
activate($href, $href.parent())
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
/* TABS/PILLS PLUGIN DEFINITION
|
50
|
+
* ============================ */
|
51
|
+
|
52
|
+
$.fn.tabs = $.fn.pills = function ( selector ) {
|
53
|
+
return this.each(function () {
|
54
|
+
$(this).delegate(selector || '.tabs li > a, .pills > li > a', 'click', tab)
|
55
|
+
})
|
56
|
+
}
|
57
|
+
|
58
|
+
$(document).ready(function () {
|
59
|
+
$('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
|
60
|
+
})
|
61
|
+
|
62
|
+
})( window.jQuery || window.ender )
|