mod_auth_openid_loginpage 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/public/css/bootstrap-responsive.css +815 -0
- data/public/css/bootstrap-responsive.min.css +9 -0
- data/public/css/bootstrap.css +4983 -0
- data/public/css/bootstrap.min.css +9 -0
- data/public/img/glyphicons-halflings-white.png +0 -0
- data/public/img/glyphicons-halflings.png +0 -0
- data/public/js/bootstrap-alert.js +90 -0
- data/public/js/bootstrap-button.js +96 -0
- data/public/js/bootstrap-carousel.js +169 -0
- data/public/js/bootstrap-collapse.js +157 -0
- data/public/js/bootstrap-dropdown.js +100 -0
- data/public/js/bootstrap-modal.js +218 -0
- data/public/js/bootstrap-popover.js +98 -0
- data/public/js/bootstrap-scrollspy.js +151 -0
- data/public/js/bootstrap-tab.js +135 -0
- data/public/js/bootstrap-tooltip.js +275 -0
- data/public/js/bootstrap-transition.js +61 -0
- data/public/js/bootstrap-typeahead.js +285 -0
- data/public/js/bootstrap.js +1825 -0
- data/public/js/bootstrap.min.js +6 -0
- data/public/js/jquery.js +9252 -0
- data/public/js/jquery.tablesorter.min.js +4 -0
- data/public/js/less-1.3.0.min.js +9 -0
- data/public/less/accordion.less +33 -0
- data/public/less/alerts.less +58 -0
- data/public/less/bootstrap.less +62 -0
- data/public/less/breadcrumbs.less +24 -0
- data/public/less/button-groups.less +191 -0
- data/public/less/buttons.less +191 -0
- data/public/less/carousel.less +121 -0
- data/public/less/close.less +29 -0
- data/public/less/code.less +57 -0
- data/public/less/component-animations.less +20 -0
- data/public/less/dropdowns.less +143 -0
- data/public/less/forms.less +583 -0
- data/public/less/grid.less +5 -0
- data/public/less/hero-unit.less +22 -0
- data/public/less/labels-badges.less +55 -0
- data/public/less/layouts.less +17 -0
- data/public/less/mixins.less +646 -0
- data/public/less/modals.less +90 -0
- data/public/less/navbar.less +358 -0
- data/public/less/navs.less +363 -0
- data/public/less/pager.less +36 -0
- data/public/less/pagination.less +56 -0
- data/public/less/popovers.less +49 -0
- data/public/less/progress-bars.less +117 -0
- data/public/less/reset.less +131 -0
- data/public/less/responsive-1200px-min.less +26 -0
- data/public/less/responsive-767px-max.less +149 -0
- data/public/less/responsive-768px-979px.less +17 -0
- data/public/less/responsive-navbar.less +153 -0
- data/public/less/responsive-utilities.less +41 -0
- data/public/less/responsive.less +48 -0
- data/public/less/scaffolding.less +29 -0
- data/public/less/sprites.less +191 -0
- data/public/less/tables.less +176 -0
- data/public/less/tests/css-tests.css +52 -0
- data/public/less/tests/css-tests.html +917 -0
- data/public/less/tests/forms.html +179 -0
- data/public/less/tests/navbar.html +108 -0
- data/public/less/thumbnails.less +47 -0
- data/public/less/tooltip.less +35 -0
- data/public/less/type.less +232 -0
- data/public/less/utilities.less +23 -0
- data/public/less/variables.less +206 -0
- data/public/less/wells.less +27 -0
- data/views/layout.erb +61 -0
- data/views/login_page.erb +9 -0
- metadata +190 -0
@@ -0,0 +1,100 @@
|
|
1
|
+
/* ============================================================
|
2
|
+
* bootstrap-dropdown.js v2.0.4
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
4
|
+
* ============================================================
|
5
|
+
* Copyright 2012 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
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
25
|
+
|
26
|
+
/* DROPDOWN CLASS DEFINITION
|
27
|
+
* ========================= */
|
28
|
+
|
29
|
+
var toggle = '[data-toggle="dropdown"]'
|
30
|
+
, Dropdown = function (element) {
|
31
|
+
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
32
|
+
$('html').on('click.dropdown.data-api', function () {
|
33
|
+
$el.parent().removeClass('open')
|
34
|
+
})
|
35
|
+
}
|
36
|
+
|
37
|
+
Dropdown.prototype = {
|
38
|
+
|
39
|
+
constructor: Dropdown
|
40
|
+
|
41
|
+
, toggle: function (e) {
|
42
|
+
var $this = $(this)
|
43
|
+
, $parent
|
44
|
+
, selector
|
45
|
+
, isActive
|
46
|
+
|
47
|
+
if ($this.is('.disabled, :disabled')) return
|
48
|
+
|
49
|
+
selector = $this.attr('data-target')
|
50
|
+
|
51
|
+
if (!selector) {
|
52
|
+
selector = $this.attr('href')
|
53
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
54
|
+
}
|
55
|
+
|
56
|
+
$parent = $(selector)
|
57
|
+
$parent.length || ($parent = $this.parent())
|
58
|
+
|
59
|
+
isActive = $parent.hasClass('open')
|
60
|
+
|
61
|
+
clearMenus()
|
62
|
+
|
63
|
+
if (!isActive) $parent.toggleClass('open')
|
64
|
+
|
65
|
+
return false
|
66
|
+
}
|
67
|
+
|
68
|
+
}
|
69
|
+
|
70
|
+
function clearMenus() {
|
71
|
+
$(toggle).parent().removeClass('open')
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
/* DROPDOWN PLUGIN DEFINITION
|
76
|
+
* ========================== */
|
77
|
+
|
78
|
+
$.fn.dropdown = function (option) {
|
79
|
+
return this.each(function () {
|
80
|
+
var $this = $(this)
|
81
|
+
, data = $this.data('dropdown')
|
82
|
+
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
83
|
+
if (typeof option == 'string') data[option].call($this)
|
84
|
+
})
|
85
|
+
}
|
86
|
+
|
87
|
+
$.fn.dropdown.Constructor = Dropdown
|
88
|
+
|
89
|
+
|
90
|
+
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
91
|
+
* =================================== */
|
92
|
+
|
93
|
+
$(function () {
|
94
|
+
$('html').on('click.dropdown.data-api', clearMenus)
|
95
|
+
$('body')
|
96
|
+
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
|
97
|
+
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
98
|
+
})
|
99
|
+
|
100
|
+
}(window.jQuery);
|
@@ -0,0 +1,218 @@
|
|
1
|
+
/* =========================================================
|
2
|
+
* bootstrap-modal.js v2.0.4
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#modals
|
4
|
+
* =========================================================
|
5
|
+
* Copyright 2012 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
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
25
|
+
|
26
|
+
/* MODAL CLASS DEFINITION
|
27
|
+
* ====================== */
|
28
|
+
|
29
|
+
var Modal = function (content, options) {
|
30
|
+
this.options = options
|
31
|
+
this.$element = $(content)
|
32
|
+
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
33
|
+
}
|
34
|
+
|
35
|
+
Modal.prototype = {
|
36
|
+
|
37
|
+
constructor: Modal
|
38
|
+
|
39
|
+
, toggle: function () {
|
40
|
+
return this[!this.isShown ? 'show' : 'hide']()
|
41
|
+
}
|
42
|
+
|
43
|
+
, show: function () {
|
44
|
+
var that = this
|
45
|
+
, e = $.Event('show')
|
46
|
+
|
47
|
+
this.$element.trigger(e)
|
48
|
+
|
49
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
50
|
+
|
51
|
+
$('body').addClass('modal-open')
|
52
|
+
|
53
|
+
this.isShown = true
|
54
|
+
|
55
|
+
escape.call(this)
|
56
|
+
backdrop.call(this, function () {
|
57
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
58
|
+
|
59
|
+
if (!that.$element.parent().length) {
|
60
|
+
that.$element.appendTo(document.body) //don't move modals dom position
|
61
|
+
}
|
62
|
+
|
63
|
+
that.$element
|
64
|
+
.show()
|
65
|
+
|
66
|
+
if (transition) {
|
67
|
+
that.$element[0].offsetWidth // force reflow
|
68
|
+
}
|
69
|
+
|
70
|
+
that.$element.addClass('in')
|
71
|
+
|
72
|
+
transition ?
|
73
|
+
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
74
|
+
that.$element.trigger('shown')
|
75
|
+
|
76
|
+
})
|
77
|
+
}
|
78
|
+
|
79
|
+
, hide: function (e) {
|
80
|
+
e && e.preventDefault()
|
81
|
+
|
82
|
+
var that = this
|
83
|
+
|
84
|
+
e = $.Event('hide')
|
85
|
+
|
86
|
+
this.$element.trigger(e)
|
87
|
+
|
88
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
89
|
+
|
90
|
+
this.isShown = false
|
91
|
+
|
92
|
+
$('body').removeClass('modal-open')
|
93
|
+
|
94
|
+
escape.call(this)
|
95
|
+
|
96
|
+
this.$element.removeClass('in')
|
97
|
+
|
98
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
99
|
+
hideWithTransition.call(this) :
|
100
|
+
hideModal.call(this)
|
101
|
+
}
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
/* MODAL PRIVATE METHODS
|
107
|
+
* ===================== */
|
108
|
+
|
109
|
+
function hideWithTransition() {
|
110
|
+
var that = this
|
111
|
+
, timeout = setTimeout(function () {
|
112
|
+
that.$element.off($.support.transition.end)
|
113
|
+
hideModal.call(that)
|
114
|
+
}, 500)
|
115
|
+
|
116
|
+
this.$element.one($.support.transition.end, function () {
|
117
|
+
clearTimeout(timeout)
|
118
|
+
hideModal.call(that)
|
119
|
+
})
|
120
|
+
}
|
121
|
+
|
122
|
+
function hideModal(that) {
|
123
|
+
this.$element
|
124
|
+
.hide()
|
125
|
+
.trigger('hidden')
|
126
|
+
|
127
|
+
backdrop.call(this)
|
128
|
+
}
|
129
|
+
|
130
|
+
function backdrop(callback) {
|
131
|
+
var that = this
|
132
|
+
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
133
|
+
|
134
|
+
if (this.isShown && this.options.backdrop) {
|
135
|
+
var doAnimate = $.support.transition && animate
|
136
|
+
|
137
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
138
|
+
.appendTo(document.body)
|
139
|
+
|
140
|
+
if (this.options.backdrop != 'static') {
|
141
|
+
this.$backdrop.click($.proxy(this.hide, this))
|
142
|
+
}
|
143
|
+
|
144
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
145
|
+
|
146
|
+
this.$backdrop.addClass('in')
|
147
|
+
|
148
|
+
doAnimate ?
|
149
|
+
this.$backdrop.one($.support.transition.end, callback) :
|
150
|
+
callback()
|
151
|
+
|
152
|
+
} else if (!this.isShown && this.$backdrop) {
|
153
|
+
this.$backdrop.removeClass('in')
|
154
|
+
|
155
|
+
$.support.transition && this.$element.hasClass('fade')?
|
156
|
+
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
|
157
|
+
removeBackdrop.call(this)
|
158
|
+
|
159
|
+
} else if (callback) {
|
160
|
+
callback()
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
function removeBackdrop() {
|
165
|
+
this.$backdrop.remove()
|
166
|
+
this.$backdrop = null
|
167
|
+
}
|
168
|
+
|
169
|
+
function escape() {
|
170
|
+
var that = this
|
171
|
+
if (this.isShown && this.options.keyboard) {
|
172
|
+
$(document).on('keyup.dismiss.modal', function ( e ) {
|
173
|
+
e.which == 27 && that.hide()
|
174
|
+
})
|
175
|
+
} else if (!this.isShown) {
|
176
|
+
$(document).off('keyup.dismiss.modal')
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
/* MODAL PLUGIN DEFINITION
|
182
|
+
* ======================= */
|
183
|
+
|
184
|
+
$.fn.modal = function (option) {
|
185
|
+
return this.each(function () {
|
186
|
+
var $this = $(this)
|
187
|
+
, data = $this.data('modal')
|
188
|
+
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
189
|
+
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
190
|
+
if (typeof option == 'string') data[option]()
|
191
|
+
else if (options.show) data.show()
|
192
|
+
})
|
193
|
+
}
|
194
|
+
|
195
|
+
$.fn.modal.defaults = {
|
196
|
+
backdrop: true
|
197
|
+
, keyboard: true
|
198
|
+
, show: true
|
199
|
+
}
|
200
|
+
|
201
|
+
$.fn.modal.Constructor = Modal
|
202
|
+
|
203
|
+
|
204
|
+
/* MODAL DATA-API
|
205
|
+
* ============== */
|
206
|
+
|
207
|
+
$(function () {
|
208
|
+
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
209
|
+
var $this = $(this), href
|
210
|
+
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
211
|
+
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
|
212
|
+
|
213
|
+
e.preventDefault()
|
214
|
+
$target.modal(option)
|
215
|
+
})
|
216
|
+
})
|
217
|
+
|
218
|
+
}(window.jQuery);
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/* ===========================================================
|
2
|
+
* bootstrap-popover.js v2.0.4
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#popovers
|
4
|
+
* ===========================================================
|
5
|
+
* Copyright 2012 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
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
25
|
+
|
26
|
+
/* POPOVER PUBLIC CLASS DEFINITION
|
27
|
+
* =============================== */
|
28
|
+
|
29
|
+
var Popover = function ( element, options ) {
|
30
|
+
this.init('popover', element, options)
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
35
|
+
========================================== */
|
36
|
+
|
37
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
|
38
|
+
|
39
|
+
constructor: Popover
|
40
|
+
|
41
|
+
, setContent: function () {
|
42
|
+
var $tip = this.tip()
|
43
|
+
, title = this.getTitle()
|
44
|
+
, content = this.getContent()
|
45
|
+
|
46
|
+
$tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
|
47
|
+
$tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
|
48
|
+
|
49
|
+
$tip.removeClass('fade top bottom left right in')
|
50
|
+
}
|
51
|
+
|
52
|
+
, hasContent: function () {
|
53
|
+
return this.getTitle() || this.getContent()
|
54
|
+
}
|
55
|
+
|
56
|
+
, getContent: function () {
|
57
|
+
var content
|
58
|
+
, $e = this.$element
|
59
|
+
, o = this.options
|
60
|
+
|
61
|
+
content = $e.attr('data-content')
|
62
|
+
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
63
|
+
|
64
|
+
return content
|
65
|
+
}
|
66
|
+
|
67
|
+
, tip: function () {
|
68
|
+
if (!this.$tip) {
|
69
|
+
this.$tip = $(this.options.template)
|
70
|
+
}
|
71
|
+
return this.$tip
|
72
|
+
}
|
73
|
+
|
74
|
+
})
|
75
|
+
|
76
|
+
|
77
|
+
/* POPOVER PLUGIN DEFINITION
|
78
|
+
* ======================= */
|
79
|
+
|
80
|
+
$.fn.popover = function (option) {
|
81
|
+
return this.each(function () {
|
82
|
+
var $this = $(this)
|
83
|
+
, data = $this.data('popover')
|
84
|
+
, options = typeof option == 'object' && option
|
85
|
+
if (!data) $this.data('popover', (data = new Popover(this, options)))
|
86
|
+
if (typeof option == 'string') data[option]()
|
87
|
+
})
|
88
|
+
}
|
89
|
+
|
90
|
+
$.fn.popover.Constructor = Popover
|
91
|
+
|
92
|
+
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
93
|
+
placement: 'right'
|
94
|
+
, content: ''
|
95
|
+
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
96
|
+
})
|
97
|
+
|
98
|
+
}(window.jQuery);
|
@@ -0,0 +1,151 @@
|
|
1
|
+
/* =============================================================
|
2
|
+
* bootstrap-scrollspy.js v2.0.4
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
4
|
+
* =============================================================
|
5
|
+
* Copyright 2012 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
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
25
|
+
|
26
|
+
/* SCROLLSPY CLASS DEFINITION
|
27
|
+
* ========================== */
|
28
|
+
|
29
|
+
function ScrollSpy( element, options) {
|
30
|
+
var process = $.proxy(this.process, this)
|
31
|
+
, $element = $(element).is('body') ? $(window) : $(element)
|
32
|
+
, href
|
33
|
+
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
|
34
|
+
this.$scrollElement = $element.on('scroll.scroll.data-api', process)
|
35
|
+
this.selector = (this.options.target
|
36
|
+
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
37
|
+
|| '') + ' .nav li > a'
|
38
|
+
this.$body = $('body')
|
39
|
+
this.refresh()
|
40
|
+
this.process()
|
41
|
+
}
|
42
|
+
|
43
|
+
ScrollSpy.prototype = {
|
44
|
+
|
45
|
+
constructor: ScrollSpy
|
46
|
+
|
47
|
+
, refresh: function () {
|
48
|
+
var self = this
|
49
|
+
, $targets
|
50
|
+
|
51
|
+
this.offsets = $([])
|
52
|
+
this.targets = $([])
|
53
|
+
|
54
|
+
$targets = this.$body
|
55
|
+
.find(this.selector)
|
56
|
+
.map(function () {
|
57
|
+
var $el = $(this)
|
58
|
+
, href = $el.data('target') || $el.attr('href')
|
59
|
+
, $href = /^#\w/.test(href) && $(href)
|
60
|
+
return ( $href
|
61
|
+
&& href.length
|
62
|
+
&& [[ $href.position().top, href ]] ) || null
|
63
|
+
})
|
64
|
+
.sort(function (a, b) { return a[0] - b[0] })
|
65
|
+
.each(function () {
|
66
|
+
self.offsets.push(this[0])
|
67
|
+
self.targets.push(this[1])
|
68
|
+
})
|
69
|
+
}
|
70
|
+
|
71
|
+
, process: function () {
|
72
|
+
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
73
|
+
, scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
74
|
+
, maxScroll = scrollHeight - this.$scrollElement.height()
|
75
|
+
, offsets = this.offsets
|
76
|
+
, targets = this.targets
|
77
|
+
, activeTarget = this.activeTarget
|
78
|
+
, i
|
79
|
+
|
80
|
+
if (scrollTop >= maxScroll) {
|
81
|
+
return activeTarget != (i = targets.last()[0])
|
82
|
+
&& this.activate ( i )
|
83
|
+
}
|
84
|
+
|
85
|
+
for (i = offsets.length; i--;) {
|
86
|
+
activeTarget != targets[i]
|
87
|
+
&& scrollTop >= offsets[i]
|
88
|
+
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
89
|
+
&& this.activate( targets[i] )
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
, activate: function (target) {
|
94
|
+
var active
|
95
|
+
, selector
|
96
|
+
|
97
|
+
this.activeTarget = target
|
98
|
+
|
99
|
+
$(this.selector)
|
100
|
+
.parent('.active')
|
101
|
+
.removeClass('active')
|
102
|
+
|
103
|
+
selector = this.selector
|
104
|
+
+ '[data-target="' + target + '"],'
|
105
|
+
+ this.selector + '[href="' + target + '"]'
|
106
|
+
|
107
|
+
active = $(selector)
|
108
|
+
.parent('li')
|
109
|
+
.addClass('active')
|
110
|
+
|
111
|
+
if (active.parent('.dropdown-menu')) {
|
112
|
+
active = active.closest('li.dropdown').addClass('active')
|
113
|
+
}
|
114
|
+
|
115
|
+
active.trigger('activate')
|
116
|
+
}
|
117
|
+
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
/* SCROLLSPY PLUGIN DEFINITION
|
122
|
+
* =========================== */
|
123
|
+
|
124
|
+
$.fn.scrollspy = function ( option ) {
|
125
|
+
return this.each(function () {
|
126
|
+
var $this = $(this)
|
127
|
+
, data = $this.data('scrollspy')
|
128
|
+
, options = typeof option == 'object' && option
|
129
|
+
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
|
130
|
+
if (typeof option == 'string') data[option]()
|
131
|
+
})
|
132
|
+
}
|
133
|
+
|
134
|
+
$.fn.scrollspy.Constructor = ScrollSpy
|
135
|
+
|
136
|
+
$.fn.scrollspy.defaults = {
|
137
|
+
offset: 10
|
138
|
+
}
|
139
|
+
|
140
|
+
|
141
|
+
/* SCROLLSPY DATA-API
|
142
|
+
* ================== */
|
143
|
+
|
144
|
+
$(function () {
|
145
|
+
$('[data-spy="scroll"]').each(function () {
|
146
|
+
var $spy = $(this)
|
147
|
+
$spy.scrollspy($spy.data())
|
148
|
+
})
|
149
|
+
})
|
150
|
+
|
151
|
+
}(window.jQuery);
|