Skip to content

Commit f547e2e

Browse files
committed
1.4.0 update references
1 parent b64ae13 commit f547e2e

14 files changed

+4237
-113
lines changed

1.4.0/bootstrap-alerts.js

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/* ==========================================================
2+
* bootstrap-alerts.js v1.4.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+
"use strict"
24+
25+
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
26+
* ======================================================= */
27+
28+
var transitionEnd
29+
30+
$(document).ready(function () {
31+
32+
$.support.transition = (function () {
33+
var thisBody = document.body || document.documentElement
34+
, thisStyle = thisBody.style
35+
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
36+
return support
37+
})()
38+
39+
// set CSS transition event type
40+
if ( $.support.transition ) {
41+
transitionEnd = "TransitionEnd"
42+
if ( $.browser.webkit ) {
43+
transitionEnd = "webkitTransitionEnd"
44+
} else if ( $.browser.mozilla ) {
45+
transitionEnd = "transitionend"
46+
} else if ( $.browser.opera ) {
47+
transitionEnd = "oTransitionEnd"
48+
}
49+
}
50+
51+
})
52+
53+
/* ALERT CLASS DEFINITION
54+
* ====================== */
55+
56+
var Alert = function ( content, options ) {
57+
this.settings = $.extend({}, $.fn.alert.defaults, options)
58+
this.$element = $(content)
59+
.delegate(this.settings.selector, 'click', this.close)
60+
}
61+
62+
Alert.prototype = {
63+
64+
close: function (e) {
65+
var $element = $(this).parent('.alert-message')
66+
67+
e && e.preventDefault()
68+
$element.removeClass('in')
69+
70+
function removeElement () {
71+
$element.remove()
72+
}
73+
74+
$.support.transition && $element.hasClass('fade') ?
75+
$element.bind(transitionEnd, removeElement) :
76+
removeElement()
77+
}
78+
79+
}
80+
81+
82+
/* ALERT PLUGIN DEFINITION
83+
* ======================= */
84+
85+
$.fn.alert = function ( options ) {
86+
87+
if ( options === true ) {
88+
return this.data('alert')
89+
}
90+
91+
return this.each(function () {
92+
var $this = $(this)
93+
94+
if ( typeof options == 'string' ) {
95+
return $this.data('alert')[options]()
96+
}
97+
98+
$(this).data('alert', new Alert( this, options ))
99+
100+
})
101+
}
102+
103+
$.fn.alert.defaults = {
104+
selector: '.close'
105+
}
106+
107+
$(document).ready(function () {
108+
new Alert($('body'), {
109+
selector: '.alert-message[data-alert] .close'
110+
})
111+
})
112+
113+
}( window.jQuery || window.ender );

1.4.0/bootstrap-buttons.js

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/* ============================================================
2+
* bootstrap-dropdown.js v1.4.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+
!function( $ ){
21+
22+
"use strict"
23+
24+
function setState(el, state) {
25+
var d = 'disabled'
26+
, $el = $(el)
27+
, data = $el.data()
28+
29+
state = state + 'Text'
30+
data.resetText || $el.data('resetText', $el.html())
31+
32+
$el.html( data[state] || $.fn.button.defaults[state] )
33+
34+
state == 'loadingText' ?
35+
$el.addClass(d).attr(d, d) :
36+
$el.removeClass(d).removeAttr(d)
37+
}
38+
39+
function toggle(el) {
40+
$(el).toggleClass('active')
41+
}
42+
43+
$.fn.button = function(options) {
44+
return this.each(function () {
45+
if (options == 'toggle') {
46+
return toggle(this)
47+
}
48+
options && setState(this, options)
49+
})
50+
}
51+
52+
$.fn.button.defaults = {
53+
loadingText: 'loading...'
54+
}
55+
56+
$(function () {
57+
$('body').delegate('.btn[data-toggle]', 'click', function () {
58+
$(this).button('toggle')
59+
})
60+
})
61+
62+
}( window.jQuery || window.ender );

1.4.0/bootstrap-dropdown.js

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* ============================================================
2+
* bootstrap-dropdown.js v1.4.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+
"use strict"
24+
25+
/* DROPDOWN PLUGIN DEFINITION
26+
* ========================== */
27+
28+
$.fn.dropdown = function ( selector ) {
29+
return this.each(function () {
30+
$(this).delegate(selector || d, 'click', function (e) {
31+
var li = $(this).parent('li')
32+
, isActive = li.hasClass('open')
33+
34+
clearMenus()
35+
!isActive && li.toggleClass('open')
36+
return false
37+
})
38+
})
39+
}
40+
41+
/* APPLY TO STANDARD DROPDOWN ELEMENTS
42+
* =================================== */
43+
44+
var d = 'a.menu, .dropdown-toggle'
45+
46+
function clearMenus() {
47+
$(d).parent('li').removeClass('open')
48+
}
49+
50+
$(function () {
51+
$('html').bind("click", clearMenus)
52+
$('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
53+
})
54+
55+
}( window.jQuery || window.ender );

0 commit comments

Comments
 (0)