Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
8545fe97
Commit
8545fe97
authored
13 years ago
by
Jacob Thornton
Browse files
Options
Download
Email Patches
Plain Diff
greatly simply js plugins - remove js api where reasonable
parent
c9669be1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
docs/assets/js/application.js
+1
-1
docs/assets/js/application.js
js/bootstrap-accordion.js
+41
-0
js/bootstrap-accordion.js
js/bootstrap-alerts.js
+11
-69
js/bootstrap-alerts.js
js/bootstrap-dropdown.js
+8
-20
js/bootstrap-dropdown.js
js/bootstrap-modal.js
+28
-53
js/bootstrap-modal.js
js/bootstrap-popover.js
+0
-1
js/bootstrap-popover.js
js/bootstrap-scrollspy.js
+1
-24
js/bootstrap-scrollspy.js
js/bootstrap-tabs.js
+2
-8
js/bootstrap-tabs.js
js/bootstrap-transitions.js
+45
-0
js/bootstrap-transitions.js
js/bootstrap-twipsy.js
+1
-30
js/bootstrap-twipsy.js
with
138 additions
and
206 deletions
+138
-206
docs/assets/js/application.js
+
1
-
1
View file @
8545fe97
$
(
document
).
ready
(
function
(){
$
(
function
(){
// table sort example
// ==================
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-accordion.js
0 → 100644
+
41
-
0
View file @
8545fe97
/* =============================================================
* bootstrap-accordion.js v1.3.0
* http://twitter.github.com/bootstrap/javascript.html#accordion
* =============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
(
function
(
$
){
var
Accordion
=
function
(
element
,
options
)
{}
Accordion
.
prototype
=
{}
/* ALERT PLUGIN DEFINITION
* ======================= */
$
.
fn
.
accordion
=
function
(
options
)
{
if
(
options
===
true
)
{
return
this
.
data
(
'
accordion
'
)
}
return
this
.
each
(
function
()
{
new
Accordion
(
this
,
options
)
})
}
})(
window
.
jQuery
||
window
.
ender
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/bootstrap-alerts.js
+
11
-
69
View file @
8545fe97
...
...
@@ -17,90 +17,32 @@
* limitations under the License.
* ========================================================== */
(
function
(
$
){
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var
transitionEnd
$
(
document
).
ready
(
function
()
{
$
.
support
.
transition
=
(
function
()
{
var
thisBody
=
document
.
body
||
document
.
documentElement
,
thisStyle
=
thisBody
.
style
,
support
=
thisStyle
.
transition
!==
undefined
||
thisStyle
.
WebkitTransition
!==
undefined
||
thisStyle
.
MozTransition
!==
undefined
||
thisStyle
.
MsTransition
!==
undefined
||
thisStyle
.
OTransition
!==
undefined
return
support
})()
// set CSS transition event type
if
(
$
.
support
.
transition
)
{
transitionEnd
=
"
TransitionEnd
"
if
(
$
.
browser
.
webkit
)
{
transitionEnd
=
"
webkitTransitionEnd
"
}
else
if
(
$
.
browser
.
mozilla
)
{
transitionEnd
=
"
transitionend
"
}
else
if
(
$
.
browser
.
opera
)
{
transitionEnd
=
"
oTransitionEnd
"
}
}
})
/* ALERT CLASS DEFINITION
* ====================== */
var
Alert
=
function
(
content
,
selector
)
{
this
.
$element
=
$
(
content
)
.
delegate
(
'
[data-alert-dismiss]
'
,
'
click
'
,
this
.
close
)
}
Alert
.
prototype
=
{
close
:
function
(
e
)
{
var
$element
=
$
(
this
).
parent
(
'
.alert-message
'
)
function
close
(
e
)
{
var
$element
=
$
(
this
).
parent
(
'
.alert-message
'
)
e
&&
e
.
preventDefault
()
e
&&
e
.
stopPropagation
(
)
e
&&
e
.
preventDefault
()
$element
.
removeClass
(
'
in
'
)
$element
.
removeClass
(
'
in
'
)
function
removeElement
()
{
$element
.
remove
()
}
$
.
support
.
transition
&&
$element
.
hasClass
(
'
fade
'
)
?
$element
.
bind
(
transitionEnd
,
removeElement
)
:
removeElement
()
function
removeElement
()
{
$element
.
remove
()
}
$
.
support
.
transition
&&
$element
.
hasClass
(
'
fade
'
)
?
$element
.
bind
(
$
.
support
.
transition
.
end
,
removeElement
)
:
removeElement
()
}
/* ALERT PLUGIN DEFINITION
* ======================= */
$
.
fn
.
alert
=
function
(
options
)
{
if
(
options
===
true
)
{
return
this
.
data
(
'
alert
'
)
}
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
if
(
typeof
options
==
'
string
'
)
{
return
$this
.
data
(
'
alert
'
)[
options
]()
}
$
(
this
).
data
(
'
alert
'
,
new
Alert
(
this
))
})
}
$
(
document
).
ready
(
function
()
{
new
Alert
(
$
(
'
body
'
))
$
(
function
()
{
$
(
'
body
'
).
delegate
(
'
[data-alert-dismiss]
'
,
'
click
'
,
close
)
})
})(
window
.
jQuery
||
window
.
ender
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/bootstrap-dropdown.js
+
8
-
20
View file @
8545fe97
...
...
@@ -20,34 +20,22 @@
(
function
(
$
){
var
d
=
'
[data-dropdown]
'
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$
.
fn
.
dropdown
=
function
()
{
return
this
.
each
(
function
()
{
$
(
this
).
delegate
(
d
,
'
click
'
,
function
(
e
)
{
var
li
=
$
(
this
).
parent
(
'
li
'
)
,
isActive
=
li
.
hasClass
(
'
open
'
)
clearMenus
()
!
isActive
&&
li
.
toggleClass
(
'
open
'
)
return
false
})
})
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
function
clearMenus
()
{
$
(
d
).
parent
(
'
li
'
).
removeClass
(
'
open
'
)
$
(
selector
).
parent
(
'
li
'
).
removeClass
(
'
open
'
)
}
$
(
function
()
{
$
(
'
html
'
).
bind
(
"
click
"
,
clearMenus
)
$
(
'
body
'
).
dropdown
()
$
(
'
body
'
).
delegate
(
'
[data-dropdown]
'
,
'
click
'
,
function
(
e
)
{
var
li
=
$
(
this
).
parent
(
'
li
'
)
,
isActive
=
li
.
hasClass
(
'
open
'
)
clearMenus
()
!
isActive
&&
li
.
toggleClass
(
'
open
'
)
return
false
})
})
})(
window
.
jQuery
||
window
.
ender
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/bootstrap-modal.js
+
28
-
53
View file @
8545fe97
...
...
@@ -20,35 +20,6 @@
!
function
(
$
){
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var
transitionEnd
$
(
document
).
ready
(
function
()
{
$
.
support
.
transition
=
(
function
()
{
var
thisBody
=
document
.
body
||
document
.
documentElement
,
thisStyle
=
thisBody
.
style
,
support
=
thisStyle
.
transition
!==
undefined
||
thisStyle
.
WebkitTransition
!==
undefined
||
thisStyle
.
MozTransition
!==
undefined
||
thisStyle
.
MsTransition
!==
undefined
||
thisStyle
.
OTransition
!==
undefined
return
support
})()
// set CSS transition event type
if
(
$
.
support
.
transition
)
{
transitionEnd
=
"
TransitionEnd
"
if
(
$
.
browser
.
webkit
)
{
transitionEnd
=
"
webkitTransitionEnd
"
}
else
if
(
$
.
browser
.
mozilla
)
{
transitionEnd
=
"
transitionend
"
}
else
if
(
$
.
browser
.
opera
)
{
transitionEnd
=
"
oTransitionEnd
"
}
}
})
/* MODAL PUBLIC CLASS DEFINITION
* ============================= */
...
...
@@ -76,25 +47,7 @@
this
.
$element
.
trigger
(
'
show
'
)
escape
.
call
(
this
)
backdrop
.
call
(
this
,
function
()
{
var
transition
=
$
.
support
.
transition
&&
that
.
$element
.
hasClass
(
'
fade
'
)
that
.
$element
.
appendTo
(
document
.
body
)
.
show
()
if
(
transition
)
{
that
.
$element
[
0
].
offsetWidth
// force reflow
}
that
.
$element
.
addClass
(
'
in
'
)
transition
?
that
.
$element
.
one
(
transitionEnd
,
function
()
{
that
.
$element
.
trigger
(
'
shown
'
)
})
:
that
.
$element
.
trigger
(
'
shown
'
)
})
backdrop
.
call
(
this
)
return
this
}
...
...
@@ -124,7 +77,7 @@
}
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
fade
'
)
?
this
.
$element
.
one
(
transition
E
nd
,
removeElement
)
:
this
.
$element
.
one
(
$
.
support
.
transition
.
e
nd
,
removeElement
)
:
removeElement
()
return
this
...
...
@@ -136,9 +89,11 @@
/* MODAL PRIVATE METHODS
* ===================== */
function
backdrop
(
callback
)
{
function
backdrop
()
{
var
that
=
this
,
animate
=
this
.
$element
.
hasClass
(
'
fade
'
)
?
'
fade
'
:
''
,
callback
=
$
.
proxy
(
show
,
this
)
if
(
this
.
isShown
&&
this
.
settings
.
backdrop
)
{
var
doAnimate
=
$
.
support
.
transition
&&
animate
...
...
@@ -156,7 +111,7 @@
this
.
$backdrop
.
addClass
(
'
in
'
)
doAnimate
?
this
.
$backdrop
.
one
(
transition
E
nd
,
callback
)
:
this
.
$backdrop
.
one
(
$
.
support
.
transition
.
e
nd
,
callback
)
:
callback
()
}
else
if
(
!
this
.
isShown
&&
this
.
$backdrop
)
{
...
...
@@ -168,13 +123,33 @@
}
$
.
support
.
transition
&&
this
.
$element
.
hasClass
(
'
fade
'
)?
this
.
$backdrop
.
one
(
transition
E
nd
,
removeElement
)
:
this
.
$backdrop
.
one
(
$
.
support
.
transition
.
e
nd
,
removeElement
)
:
removeElement
()
}
else
if
(
callback
)
{
callback
()
}
}
function
show
()
{
var
transition
=
$
.
support
.
transition
&&
that
.
$element
.
hasClass
(
'
fade
'
)
,
that
=
this
this
.
$element
.
appendTo
(
document
.
body
)
.
show
()
if
(
transition
)
{
this
.
$element
[
0
].
offsetWidth
// force reflow
}
this
.
$element
.
addClass
(
'
in
'
)
transition
?
this
.
$element
.
one
(
$
.
support
.
transition
.
end
,
function
()
{
that
.
$element
.
trigger
(
'
shown
'
)
})
:
this
.
$element
.
trigger
(
'
shown
'
)
}
function
escape
()
{
var
that
=
this
if
(
this
.
isShown
&&
this
.
settings
.
keyboard
)
{
...
...
@@ -233,7 +208,7 @@
/* MODAL DATA-IMPLEMENTATION
* ========================= */
$
(
document
).
ready
(
function
()
{
$
(
function
()
{
$
(
'
body
'
).
delegate
(
'
[data-controls-modal]
'
,
'
click
'
,
function
(
e
)
{
e
.
preventDefault
()
var
$this
=
$
(
this
).
data
(
'
show
'
,
true
)
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-popover.js
+
0
-
1
View file @
8545fe97
...
...
@@ -62,7 +62,6 @@
})
/* POPOVER PLUGIN DEFINITION
* ======================= */
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-scrollspy.js
+
1
-
24
View file @
8545fe97
...
...
@@ -75,30 +75,7 @@
}
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
$
.
fn
.
scrollSpy
=
function
(
options
)
{
var
scrollspy
=
this
.
data
(
'
scrollspy
'
)
if
(
!
scrollspy
)
{
return
this
.
each
(
function
()
{
$
(
this
).
data
(
'
scrollspy
'
,
new
ScrollSpy
(
this
,
options
))
})
}
if
(
options
===
true
)
{
return
scrollspy
}
if
(
typeof
options
==
'
string
'
)
{
scrollspy
[
options
]()
}
return
this
}
$
(
document
).
ready
(
function
()
{
$
(
function
()
{
$
(
'
body
'
).
scrollSpy
(
'
[data-scrollspy] li > a
'
)
})
...
...
This diff is collapsed.
Click to expand it.
js/bootstrap-tabs.js
+
2
-
8
View file @
8545fe97
...
...
@@ -55,14 +55,8 @@
/* TABS/PILLS PLUGIN DEFINITION
* ============================ */
$
.
fn
.
tabs
=
$
.
fn
.
pills
=
function
(
selector
)
{
return
this
.
each
(
function
()
{
$
(
this
).
delegate
(
selector
||
'
.tabs li > a, .pills > li > a
'
,
'
click
'
,
tab
)
})
}
$
(
document
).
ready
(
function
()
{
$
(
'
body
'
).
tabs
(
'
ul[data-tabs] li > a, ul[data-pills] > li > a
'
)
$
(
function
()
{
$
(
'
body
'
).
delegate
(
'
ul[data-tabs] > li > a, ul[data-pills] > li > a
'
,
'
click
'
,
tab
)
})
}(
window
.
jQuery
||
window
.
ender
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/bootstrap-transitions.js
0 → 100644
+
45
-
0
View file @
8545fe97
/* ===================================================
* bootstrap-transitions.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html
* ===================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
$
(
function
()
{
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
$
.
support
.
transition
=
(
function
()
{
var
thisBody
=
document
.
body
||
document
.
documentElement
,
thisStyle
=
thisBody
.
style
,
support
=
thisStyle
.
transition
!==
undefined
||
thisStyle
.
WebkitTransition
!==
undefined
||
thisStyle
.
MozTransition
!==
undefined
||
thisStyle
.
MsTransition
!==
undefined
||
thisStyle
.
OTransition
!==
undefined
return
support
&&
{
end
:
(
function
()
{
var
transitionEnd
=
"
TransitionEnd
"
if
(
$
.
browser
.
webkit
)
{
transitionEnd
=
"
webkitTransitionEnd
"
}
else
if
(
$
.
browser
.
mozilla
)
{
transitionEnd
=
"
transitionend
"
}
else
if
(
$
.
browser
.
opera
)
{
transitionEnd
=
"
oTransitionEnd
"
}
return
transitionEnd
})()
}
})()
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/bootstrap-twipsy.js
+
1
-
30
View file @
8545fe97
...
...
@@ -21,35 +21,6 @@
!
function
(
$
)
{
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var
transitionEnd
$
(
document
).
ready
(
function
()
{
$
.
support
.
transition
=
(
function
()
{
var
thisBody
=
document
.
body
||
document
.
documentElement
,
thisStyle
=
thisBody
.
style
,
support
=
thisStyle
.
transition
!==
undefined
||
thisStyle
.
WebkitTransition
!==
undefined
||
thisStyle
.
MozTransition
!==
undefined
||
thisStyle
.
MsTransition
!==
undefined
||
thisStyle
.
OTransition
!==
undefined
return
support
})()
// set CSS transition event type
if
(
$
.
support
.
transition
)
{
transitionEnd
=
"
TransitionEnd
"
if
(
$
.
browser
.
webkit
)
{
transitionEnd
=
"
webkitTransitionEnd
"
}
else
if
(
$
.
browser
.
mozilla
)
{
transitionEnd
=
"
transitionend
"
}
else
if
(
$
.
browser
.
opera
)
{
transitionEnd
=
"
oTransitionEnd
"
}
}
})
/* TWIPSY PUBLIC CLASS DEFINITION
* ============================== */
...
...
@@ -131,7 +102,7 @@
}
$
.
support
.
transition
&&
this
.
$tip
.
hasClass
(
'
fade
'
)
?
$tip
.
bind
(
transition
E
nd
,
removeElement
)
:
$tip
.
bind
(
$
.
support
.
transition
.
e
nd
,
removeElement
)
:
removeElement
()
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment