Skip to content
This repository was archived by the owner on Aug 26, 2023. It is now read-only.

Commit b63ad9a

Browse files
committed
Copied static files to brambling static folder
1 parent 48c2ca6 commit b63ad9a

37 files changed

+10114
-17
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/* ========================================================================
2+
* Bootstrap: affix.js v3.2.0
3+
* http://getbootstrap.com/javascript/#affix
4+
* ========================================================================
5+
* Copyright 2011-2014 Twitter, Inc.
6+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7+
* ======================================================================== */
8+
9+
10+
+function ($) {
11+
'use strict';
12+
13+
// AFFIX CLASS DEFINITION
14+
// ======================
15+
16+
var Affix = function (element, options) {
17+
this.options = $.extend({}, Affix.DEFAULTS, options)
18+
19+
this.$target = $(this.options.target)
20+
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
21+
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
22+
23+
this.$element = $(element)
24+
this.affixed =
25+
this.unpin =
26+
this.pinnedOffset = null
27+
28+
this.checkPosition()
29+
}
30+
31+
Affix.VERSION = '3.2.0'
32+
33+
Affix.RESET = 'affix affix-top affix-bottom'
34+
35+
Affix.DEFAULTS = {
36+
offset: 0,
37+
target: window
38+
}
39+
40+
Affix.prototype.getPinnedOffset = function () {
41+
if (this.pinnedOffset) return this.pinnedOffset
42+
this.$element.removeClass(Affix.RESET).addClass('affix')
43+
var scrollTop = this.$target.scrollTop()
44+
var position = this.$element.offset()
45+
return (this.pinnedOffset = position.top - scrollTop)
46+
}
47+
48+
Affix.prototype.checkPositionWithEventLoop = function () {
49+
setTimeout($.proxy(this.checkPosition, this), 1)
50+
}
51+
52+
Affix.prototype.checkPosition = function () {
53+
if (!this.$element.is(':visible')) return
54+
55+
var scrollHeight = $(document).height()
56+
var scrollTop = this.$target.scrollTop()
57+
var position = this.$element.offset()
58+
var offset = this.options.offset
59+
var offsetTop = offset.top
60+
var offsetBottom = offset.bottom
61+
62+
if (typeof offset != 'object') offsetBottom = offsetTop = offset
63+
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
64+
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
65+
66+
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
67+
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
68+
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
69+
70+
if (this.affixed === affix) return
71+
if (this.unpin != null) this.$element.css('top', '')
72+
73+
var affixType = 'affix' + (affix ? '-' + affix : '')
74+
var e = $.Event(affixType + '.bs.affix')
75+
76+
this.$element.trigger(e)
77+
78+
if (e.isDefaultPrevented()) return
79+
80+
this.affixed = affix
81+
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
82+
83+
this.$element
84+
.removeClass(Affix.RESET)
85+
.addClass(affixType)
86+
.trigger($.Event(affixType.replace('affix', 'affixed')))
87+
88+
if (affix == 'bottom') {
89+
this.$element.offset({
90+
top: scrollHeight - this.$element.height() - offsetBottom
91+
})
92+
}
93+
}
94+
95+
96+
// AFFIX PLUGIN DEFINITION
97+
// =======================
98+
99+
function Plugin(option) {
100+
return this.each(function () {
101+
var $this = $(this)
102+
var data = $this.data('bs.affix')
103+
var options = typeof option == 'object' && option
104+
105+
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
106+
if (typeof option == 'string') data[option]()
107+
})
108+
}
109+
110+
var old = $.fn.affix
111+
112+
$.fn.affix = Plugin
113+
$.fn.affix.Constructor = Affix
114+
115+
116+
// AFFIX NO CONFLICT
117+
// =================
118+
119+
$.fn.affix.noConflict = function () {
120+
$.fn.affix = old
121+
return this
122+
}
123+
124+
125+
// AFFIX DATA-API
126+
// ==============
127+
128+
$(window).on('load', function () {
129+
$('[data-spy="affix"]').each(function () {
130+
var $spy = $(this)
131+
var data = $spy.data()
132+
133+
data.offset = data.offset || {}
134+
135+
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
136+
if (data.offsetTop) data.offset.top = data.offsetTop
137+
138+
Plugin.call($spy, data)
139+
})
140+
})
141+
142+
}(jQuery);
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/* ========================================================================
2+
* Bootstrap: alert.js v3.2.0
3+
* http://getbootstrap.com/javascript/#alerts
4+
* ========================================================================
5+
* Copyright 2011-2014 Twitter, Inc.
6+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7+
* ======================================================================== */
8+
9+
10+
+function ($) {
11+
'use strict';
12+
13+
// ALERT CLASS DEFINITION
14+
// ======================
15+
16+
var dismiss = '[data-dismiss="alert"]'
17+
var Alert = function (el) {
18+
$(el).on('click', dismiss, this.close)
19+
}
20+
21+
Alert.VERSION = '3.2.0'
22+
23+
Alert.prototype.close = function (e) {
24+
var $this = $(this)
25+
var selector = $this.attr('data-target')
26+
27+
if (!selector) {
28+
selector = $this.attr('href')
29+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
30+
}
31+
32+
var $parent = $(selector)
33+
34+
if (e) e.preventDefault()
35+
36+
if (!$parent.length) {
37+
$parent = $this.hasClass('alert') ? $this : $this.parent()
38+
}
39+
40+
$parent.trigger(e = $.Event('close.bs.alert'))
41+
42+
if (e.isDefaultPrevented()) return
43+
44+
$parent.removeClass('in')
45+
46+
function removeElement() {
47+
// detach from parent, fire event then clean up data
48+
$parent.detach().trigger('closed.bs.alert').remove()
49+
}
50+
51+
$.support.transition && $parent.hasClass('fade') ?
52+
$parent
53+
.one('bsTransitionEnd', removeElement)
54+
.emulateTransitionEnd(150) :
55+
removeElement()
56+
}
57+
58+
59+
// ALERT PLUGIN DEFINITION
60+
// =======================
61+
62+
function Plugin(option) {
63+
return this.each(function () {
64+
var $this = $(this)
65+
var data = $this.data('bs.alert')
66+
67+
if (!data) $this.data('bs.alert', (data = new Alert(this)))
68+
if (typeof option == 'string') data[option].call($this)
69+
})
70+
}
71+
72+
var old = $.fn.alert
73+
74+
$.fn.alert = Plugin
75+
$.fn.alert.Constructor = Alert
76+
77+
78+
// ALERT NO CONFLICT
79+
// =================
80+
81+
$.fn.alert.noConflict = function () {
82+
$.fn.alert = old
83+
return this
84+
}
85+
86+
87+
// ALERT DATA-API
88+
// ==============
89+
90+
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
91+
92+
}(jQuery);
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/* ========================================================================
2+
* Bootstrap: button.js v3.2.0
3+
* http://getbootstrap.com/javascript/#buttons
4+
* ========================================================================
5+
* Copyright 2011-2014 Twitter, Inc.
6+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7+
* ======================================================================== */
8+
9+
10+
+function ($) {
11+
'use strict';
12+
13+
// BUTTON PUBLIC CLASS DEFINITION
14+
// ==============================
15+
16+
var Button = function (element, options) {
17+
this.$element = $(element)
18+
this.options = $.extend({}, Button.DEFAULTS, options)
19+
this.isLoading = false
20+
}
21+
22+
Button.VERSION = '3.2.0'
23+
24+
Button.DEFAULTS = {
25+
loadingText: 'loading...'
26+
}
27+
28+
Button.prototype.setState = function (state) {
29+
var d = 'disabled'
30+
var $el = this.$element
31+
var val = $el.is('input') ? 'val' : 'html'
32+
var data = $el.data()
33+
34+
state = state + 'Text'
35+
36+
if (data.resetText == null) $el.data('resetText', $el[val]())
37+
38+
$el[val](data[state] == null ? this.options[state] : data[state])
39+
40+
// push to event loop to allow forms to submit
41+
setTimeout($.proxy(function () {
42+
if (state == 'loadingText') {
43+
this.isLoading = true
44+
$el.addClass(d).attr(d, d)
45+
} else if (this.isLoading) {
46+
this.isLoading = false
47+
$el.removeClass(d).removeAttr(d)
48+
}
49+
}, this), 0)
50+
}
51+
52+
Button.prototype.toggle = function () {
53+
var changed = true
54+
var $parent = this.$element.closest('[data-toggle="buttons"]')
55+
56+
if ($parent.length) {
57+
var $input = this.$element.find('input')
58+
if ($input.prop('type') == 'radio') {
59+
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
60+
else $parent.find('.active').removeClass('active')
61+
}
62+
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
63+
}
64+
65+
if (changed) this.$element.toggleClass('active')
66+
}
67+
68+
69+
// BUTTON PLUGIN DEFINITION
70+
// ========================
71+
72+
function Plugin(option) {
73+
return this.each(function () {
74+
var $this = $(this)
75+
var data = $this.data('bs.button')
76+
var options = typeof option == 'object' && option
77+
78+
if (!data) $this.data('bs.button', (data = new Button(this, options)))
79+
80+
if (option == 'toggle') data.toggle()
81+
else if (option) data.setState(option)
82+
})
83+
}
84+
85+
var old = $.fn.button
86+
87+
$.fn.button = Plugin
88+
$.fn.button.Constructor = Button
89+
90+
91+
// BUTTON NO CONFLICT
92+
// ==================
93+
94+
$.fn.button.noConflict = function () {
95+
$.fn.button = old
96+
return this
97+
}
98+
99+
100+
// BUTTON DATA-API
101+
// ===============
102+
103+
$(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
104+
var $btn = $(e.target)
105+
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
106+
Plugin.call($btn, 'toggle')
107+
e.preventDefault()
108+
})
109+
110+
}(jQuery);

0 commit comments

Comments
 (0)