Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
149ecd21
Commit
149ecd21
authored
May 16, 2013
by
fat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
straight trash wang
parent
53bc9328
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
604 additions
and
648 deletions
+604
-648
js/alert.js
js/alert.js
+4
-4
js/carousel.js
js/carousel.js
+4
-3
js/collapse.js
js/collapse.js
+2
-2
js/dropdown.js
js/dropdown.js
+0
-1
js/modal.js
js/modal.js
+138
-147
js/popover.js
js/popover.js
+49
-54
js/scrollspy.js
js/scrollspy.js
+94
-100
js/tab.js
js/tab.js
+64
-75
js/tooltip.js
js/tooltip.js
+237
-247
js/transition.js
js/transition.js
+12
-15
No files found.
js/alert.js
View file @
149ecd21
...
...
@@ -45,7 +45,7 @@
$parent
=
$this
.
hasClass
(
'
alert
'
)
?
$this
:
$this
.
parent
()
}
$parent
.
trigger
(
e
=
$
.
Event
(
'
bs
-
close
'
))
$parent
.
trigger
(
e
=
$
.
Event
(
'
bs
:alert:
close
'
))
if
(
e
.
isDefaultPrevented
())
return
...
...
@@ -79,8 +79,8 @@
$
.
fn
.
alert
.
Constructor
=
Alert
/*
ALERT NO CONFLICT
* ================= */
//
ALERT NO CONFLICT
// =================
$
.
fn
.
alert
.
noConflict
=
function
()
{
$
.
fn
.
alert
=
old
...
...
@@ -89,7 +89,7 @@
// ALERT DATA-API
// ==============
*/
// ==============
$
(
document
).
on
(
'
click.bs-alert.bs-data-api
'
,
dismiss
,
Alert
.
prototype
.
close
)
...
...
js/carousel.js
View file @
149ecd21
...
...
@@ -111,7 +111,7 @@
$next
=
$next
.
length
?
$next
:
this
.
$element
.
find
(
'
.item
'
)[
fallback
]()
var
e
=
$
.
Event
(
'
slide
'
,
{
relatedTarget
:
$next
[
0
],
direction
:
direction
})
var
e
=
$
.
Event
(
'
bs:carousel:
slide
'
,
{
relatedTarget
:
$next
[
0
],
direction
:
direction
})
if
(
$next
.
hasClass
(
'
active
'
))
return
...
...
@@ -159,11 +159,11 @@
$
.
fn
.
carousel
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
var
data
=
$this
.
data
(
'
carousel
'
)
var
data
=
$this
.
data
(
'
bs-
carousel
'
)
var
options
=
$
.
extend
({},
Carousel
.
DEFAULTS
,
typeof
option
==
'
object
'
&&
option
)
var
action
=
typeof
option
==
'
string
'
?
option
:
options
.
slide
if
(
!
data
)
$this
.
data
(
'
carousel
'
,
(
data
=
new
Carousel
(
this
,
options
)))
if
(
!
data
)
$this
.
data
(
'
bs-
carousel
'
,
(
data
=
new
Carousel
(
this
,
options
)))
if
(
typeof
option
==
'
number
'
)
data
.
to
(
option
)
else
if
(
action
)
data
[
action
]()
else
if
(
options
.
interval
)
data
.
pause
().
cycle
()
...
...
@@ -181,6 +181,7 @@
return
this
}
// CAROUSEL DATA-API
// =================
...
...
js/collapse.js
View file @
149ecd21
...
...
@@ -56,7 +56,7 @@
}
this
.
$element
[
dimension
](
0
)
this
.
transition
(
'
addClass
'
,
$
.
Event
(
'
show
'
),
'
shown
'
)
this
.
transition
(
'
addClass
'
,
$
.
Event
(
'
bs:collapse:
show
'
),
'
shown
'
)
if
(
$
.
support
.
transition
)
this
.
$element
[
dimension
](
this
.
$element
[
0
][
scroll
])
}
...
...
@@ -65,7 +65,7 @@
if
(
this
.
transitioning
||
!
this
.
$element
.
hasClass
(
'
in
'
))
return
var
dimension
=
this
.
dimension
()
this
.
reset
(
this
.
$element
[
dimension
]())
this
.
transition
(
'
removeClass
'
,
$
.
Event
(
'
hide
'
),
'
hidden
'
)
this
.
transition
(
'
removeClass
'
,
$
.
Event
(
'
bs:collapse:
hide
'
),
'
hidden
'
)
this
.
$element
[
dimension
](
0
)
}
...
...
js/dropdown.js
View file @
149ecd21
...
...
@@ -20,7 +20,6 @@
!
function
(
$
)
{
"
use strict
"
;
// DROPDOWN CLASS DEFINITION
// =========================
...
...
js/modal.js
View file @
149ecd21
...
...
@@ -18,32 +18,33 @@
* ========================================================= */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
/* MODAL CLASS DEFINITION
* ====================== */
// MODAL CLASS DEFINITION
// ======================
var
Modal
=
function
(
element
,
options
)
{
this
.
options
=
options
this
.
$element
=
$
(
element
)
.
delegate
(
'
[data-dismiss="modal"]
'
,
'
click.dismiss.modal
'
,
$
.
proxy
(
this
.
hide
,
this
))
this
.
options
.
remote
&&
this
.
$element
.
find
(
'
.modal-body
'
).
load
(
this
.
options
.
remote
)
}
this
.
$element
=
$
(
element
).
delegate
(
'
[data-dismiss="modal"]
'
,
'
click.dismiss.modal
'
,
$
.
proxy
(
this
.
hide
,
this
))
this
.
$backdrop
=
this
.
isShown
=
null
Modal
.
prototype
=
{
if
(
this
.
options
.
remote
)
this
.
$element
.
find
(
'
.modal-body
'
).
load
(
this
.
options
.
remote
)
}
constructor
:
Modal
Modal
.
DEFAULTS
=
{
backdrop
:
true
,
keyboard
:
true
,
show
:
true
}
,
toggle
:
function
()
{
Modal
.
prototype
.
toggle
=
function
()
{
return
this
[
!
this
.
isShown
?
'
show
'
:
'
hide
'
]()
}
,
show
:
function
()
{
Modal
.
prototype
.
show
=
function
()
{
var
that
=
this
,
e
=
$
.
Event
(
'
show
'
)
var
e
=
$
.
Event
(
'
bs:modal:
show
'
)
this
.
$element
.
trigger
(
e
)
...
...
@@ -73,18 +74,16 @@
that
.
enforceFocus
()
transition
?
that
.
$element
.
one
(
$
.
support
.
transition
.
end
,
function
()
{
that
.
$element
.
focus
().
trigger
(
'
shown
'
)
})
:
that
.
$element
.
focus
().
trigger
(
'
shown
'
)
that
.
$element
.
one
(
$
.
support
.
transition
.
end
,
function
()
{
that
.
$element
.
focus
().
trigger
(
'
bs:modal:
shown
'
)
})
:
that
.
$element
.
focus
().
trigger
(
'
bs:modal:
shown
'
)
})
}
,
hide
:
function
(
e
)
{
e
&&
e
.
preventDefault
()
Modal
.
prototype
.
show
=
function
(
e
)
{
if
(
e
)
e
.
preventDefault
()
var
that
=
this
e
=
$
.
Event
(
'
hide
'
)
e
=
$
.
Event
(
'
bs:modal:hide
'
)
this
.
$element
.
trigger
(
e
)
...
...
@@ -105,29 +104,27 @@
this
.
hideModal
()
}
,
enforceFocus
:
function
()
{
var
that
=
this
Modal
.
prototype
.
enforceFocus
=
function
()
{
$
(
document
).
on
(
'
focusin.modal
'
,
function
(
e
)
{
if
(
that
.
$element
[
0
]
!==
e
.
target
&&
!
that
.
$element
.
has
(
e
.
target
).
length
)
{
that
.
$element
.
focus
()
if
(
this
.
$element
[
0
]
!==
e
.
target
&&
!
this
.
$element
.
has
(
e
.
target
).
length
)
{
this
.
$element
.
focus
()
}
}
)
},
this
)
}
,
escape
:
function
()
{
var
that
=
this
Modal
.
prototype
.
escape
=
function
()
{
if
(
this
.
isShown
&&
this
.
options
.
keyboard
)
{
this
.
$element
.
on
(
'
keyup.dismiss.modal
'
,
function
(
e
)
{
e
.
which
==
27
&&
that
.
hide
()
}
)
e
.
which
==
27
&&
this
.
hide
()
},
this
)
}
else
if
(
!
this
.
isShown
)
{
this
.
$element
.
off
(
'
keyup.dismiss.modal
'
)
}
}
,
hideWithTransition
:
function
()
{
Modal
.
prototype
.
hideWithTransition
=
function
()
{
var
that
=
this
,
timeout
=
setTimeout
(
function
()
{
var
timeout
=
setTimeout
(
function
()
{
that
.
$element
.
off
(
$
.
support
.
transition
.
end
)
that
.
hideModal
()
},
500
)
...
...
@@ -138,23 +135,23 @@
})
}
,
hideModal
:
function
()
{
Modal
.
prototype
.
hideModal
=
function
()
{
var
that
=
this
this
.
$element
.
hide
()
this
.
backdrop
(
function
()
{
that
.
removeBackdrop
()
that
.
$element
.
trigger
(
'
hidden
'
)
that
.
$element
.
trigger
(
'
bs:modal:
hidden
'
)
})
}
,
removeBackdrop
:
function
()
{
Modal
.
prototype
.
removeBackdrop
:
function
()
{
this
.
$backdrop
&&
this
.
$backdrop
.
remove
()
this
.
$backdrop
=
null
}
,
backdrop
:
function
(
callback
)
{
Modal
.
prototype
.
backdrop
:
function
(
callback
)
{
var
that
=
this
,
animate
=
this
.
$element
.
hasClass
(
'
fade
'
)
?
'
fade
'
:
''
var
animate
=
this
.
$element
.
hasClass
(
'
fade
'
)
?
'
fade
'
:
''
if
(
this
.
isShown
&&
this
.
options
.
backdrop
)
{
var
doAnimate
=
$
.
support
.
transition
&&
animate
...
...
@@ -189,36 +186,30 @@
callback
()
}
}
}
/*
MODAL PLUGIN DEFINITION
* ======================= */
//
MODAL PLUGIN DEFINITION
// =======================
var
old
=
$
.
fn
.
modal
$
.
fn
.
modal
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
modal
'
)
,
options
=
$
.
extend
({},
$
.
fn
.
modal
.
defaults
,
$this
.
data
(),
typeof
option
==
'
object
'
&&
option
)
if
(
!
data
)
$this
.
data
(
'
modal
'
,
(
data
=
new
Modal
(
this
,
options
)))
var
data
=
$this
.
data
(
'
bs-modal
'
)
var
options
=
$
.
extend
({},
Modal
.
DEFAULTS
,
$this
.
data
(),
typeof
option
==
'
object
'
&&
option
)
if
(
!
data
)
$this
.
data
(
'
bs-modal
'
,
(
data
=
new
Modal
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
else
if
(
options
.
show
)
data
.
show
()
})
}
$
.
fn
.
modal
.
defaults
=
{
backdrop
:
true
,
keyboard
:
true
,
show
:
true
}
$
.
fn
.
modal
.
Constructor
=
Modal
/*
MODAL NO CONFLICT
* ================= */
//
MODAL NO CONFLICT
// =================
$
.
fn
.
modal
.
noConflict
=
function
()
{
$
.
fn
.
modal
=
old
...
...
@@ -226,14 +217,14 @@
}
/*
MODAL DATA-API
* ============== */
//
MODAL DATA-API
// ==============
$
(
document
).
on
(
'
click.modal.data-api
'
,
'
[data-toggle="modal"]
'
,
function
(
e
)
{
var
$this
=
$
(
this
)
,
href
=
$this
.
attr
(
'
href
'
)
,
$target
=
$
(
$this
.
attr
(
'
data-target
'
)
||
(
href
&&
href
.
replace
(
/.*
(?=
#
[^\s]
+$
)
/
,
''
)))
//strip for ie7
,
option
=
$target
.
data
(
'
modal
'
)
?
'
toggle
'
:
$
.
extend
({
remote
:
!
/#/
.
test
(
href
)
&&
href
},
$target
.
data
(),
$this
.
data
())
var
href
=
$this
.
attr
(
'
href
'
)
var
$target
=
$
(
$this
.
attr
(
'
data-target
'
)
||
(
href
&&
href
.
replace
(
/.*
(?=
#
[^\s]
+$
)
/
,
''
)))
//strip for ie7
var
option
=
$target
.
data
(
'
modal
'
)
?
'
toggle
'
:
$
.
extend
({
remote
:
!
/#/
.
test
(
href
)
&&
href
},
$target
.
data
(),
$this
.
data
())
e
.
preventDefault
()
...
...
@@ -245,7 +236,7 @@
})
var
$body
=
$
(
document
.
body
)
.
on
(
'
shown
'
,
'
.modal
'
,
function
()
{
$body
.
addClass
(
'
modal-open
'
)
})
.
on
(
'
hidden
'
,
'
.modal
'
,
function
()
{
$body
.
removeClass
(
'
modal-open
'
)
})
.
on
(
'
bs:modal:shown
'
,
'
.modal
'
,
function
()
{
$body
.
addClass
(
'
modal-open
'
)
})
.
on
(
'
bs:modal:
hidden
'
,
'
.modal
'
,
function
()
{
$body
.
removeClass
(
'
modal-open
'
)
})
}(
window
.
jQuery
);
js/popover.js
View file @
149ecd21
...
...
@@ -18,30 +18,38 @@
* =========================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
/* POPOVER PUBLIC CLASS DEFINITION
* =============================== */
// POPOVER PUBLIC CLASS DEFINITION
// ===============================
var
Popover
=
function
(
element
,
options
)
{
this
.
init
(
'
popover
'
,
element
,
options
)
}
Popover
.
DEFAULTS
=
$
.
extend
({}
,
$
.
fn
.
tooltip
.
Constructor
.
DEFAULTS
,
{
placement
:
'
right
'
,
trigger
:
'
click
'
,
content
:
''
,
template
:
'
<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>
'
})
/
*
NOTE: POPOVER EXTENDS tooltip.js
========================================== */
/
/
NOTE: POPOVER EXTENDS tooltip.js
// ================================
Popover
.
prototype
=
$
.
extend
({},
$
.
fn
.
tooltip
.
Constructor
.
prototype
,
{
Popover
.
prototype
=
$
.
extend
({},
$
.
fn
.
tooltip
.
Constructor
.
prototype
)
constructor
:
Popover
Popover
.
prototype
.
constructor
=
Popover
,
setContent
:
function
()
{
Popover
.
prototype
.
getDefaults
=
function
()
{
return
Popover
.
DEFAULTS
}
Popover
.
prototype
.
setContent
=
function
()
{
var
$tip
=
this
.
tip
()
,
title
=
this
.
getTitle
()
,
content
=
this
.
getContent
()
var
title
=
this
.
getTitle
()
var
content
=
this
.
getContent
()
$tip
.
find
(
'
.popover-title
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
title
)
$tip
.
find
(
'
.popover-content
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
content
)
...
...
@@ -49,62 +57,49 @@
$tip
.
removeClass
(
'
fade top bottom left right in
'
)
}
,
hasContent
:
function
()
{
Popover
.
prototype
.
hasContent
=
function
()
{
return
this
.
getTitle
()
||
this
.
getContent
()
}
,
getContent
:
function
()
{
var
content
,
$e
=
this
.
$element
,
o
=
this
.
options
content
=
(
typeof
o
.
content
==
'
function
'
?
o
.
content
.
call
(
$e
[
0
])
:
o
.
content
)
||
$e
.
attr
(
'
data-content
'
)
Popover
.
prototype
.
getContent
=
function
()
{
var
content
=
typeof
this
.
options
.
content
==
'
function
'
?
this
.
options
.
content
.
call
(
$e
[
0
])
:
this
.
options
.
content
return
content
return
content
||
this
.
$element
.
attr
(
'
data-content
'
)
}
,
tip
:
function
()
{
if
(
!
this
.
$tip
)
{
this
.
$tip
=
$
(
this
.
options
.
template
)
}
Popover
.
prototype
.
tip
=
function
()
{
if
(
!
this
.
$tip
)
this
.
$tip
=
$
(
this
.
options
.
template
)
return
this
.
$tip
}
,
destroy
:
function
()
{
Popover
.
prototype
.
destroy
=
function
()
{
this
.
hide
().
$element
.
off
(
'
.
'
+
this
.
type
).
removeData
(
this
.
type
)
}
})
/*
POPOVER PLUGIN DEFINITION
* ======================= */
//
POPOVER PLUGIN DEFINITION
// =========================
var
old
=
$
.
fn
.
popover
$
.
fn
.
popover
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
popover
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
popover
'
,
(
data
=
new
Popover
(
this
,
options
)))
var
data
=
$this
.
data
(
'
bs-popover
'
)
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
bs-popover
'
,
(
data
=
new
Popover
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
}
$
.
fn
.
popover
.
Constructor
=
Popover
$
.
fn
.
popover
.
defaults
=
$
.
extend
({}
,
$
.
fn
.
tooltip
.
defaults
,
{
placement
:
'
right
'
,
trigger
:
'
click
'
,
content
:
''
,
template
:
'
<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>
'
})
/*
POPOVER NO CONFLICT
* =================== */
//
POPOVER NO CONFLICT
// ===================
$
.
fn
.
popover
.
noConflict
=
function
()
{
$
.
fn
.
popover
=
old
...
...
js/scrollspy.js
View file @
149ecd21
...
...
@@ -18,48 +18,49 @@
* ============================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
/* SCROLLSPY CLASS DEFINITION
* ========================== */
// SCROLLSPY CLASS DEFINITION
// ==========================
function
ScrollSpy
(
element
,
options
)
{
var
href
var
process
=
$
.
proxy
(
this
.
process
,
this
)
,
$element
=
$
(
element
).
is
(
'
body
'
)
?
$
(
window
)
:
$
(
element
)
,
href
this
.
options
=
$
.
extend
({},
$
.
fn
.
scrollspy
.
defaults
,
options
)
var
$element
=
$
(
element
).
is
(
'
body
'
)
?
$
(
window
)
:
$
(
element
)
this
.
$body
=
$
(
'
body
'
)
this
.
$scrollElement
=
$element
.
on
(
'
scroll.scroll-spy.data-api
'
,
process
)
this
.
options
=
$
.
extend
({},
ScrollSpy
.
DEFAULTS
,
options
)
this
.
selector
=
(
this
.
options
.
target
||
((
href
=
$
(
element
).
attr
(
'
href
'
))
&&
href
.
replace
(
/.*
(?=
#
[^\s]
+$
)
/
,
''
))
//strip for ie7
||
''
)
+
'
.nav li > a
'
this
.
$body
=
$
(
'
body
'
)
this
.
offsets
=
$
([])
this
.
targets
=
$
([])
this
.
activeTarget
=
null
this
.
refresh
()
this
.
process
()
}
ScrollSpy
.
prototype
=
{
constructor
:
ScrollSpy
,
refresh
:
function
()
{
var
self
=
this
,
$targets
ScrollSpy
.
DEFAULTS
=
{
offset
:
10
}
ScrollSpy
.
prototype
.
refresh
=
function
()
{
this
.
offsets
=
$
([])
this
.
targets
=
$
([])
$targets
=
this
.
$body
var
self
=
this
var
$targets
=
this
.
$body
.
find
(
this
.
selector
)
.
map
(
function
()
{
var
$el
=
$
(
this
)
,
href
=
$el
.
data
(
'
target
'
)
||
$el
.
attr
(
'
href
'
)
,
$href
=
/^#
\w
/
.
test
(
href
)
&&
$
(
href
)
return
(
$href
var
href
=
$el
.
data
(
'
target
'
)
||
$el
.
attr
(
'
href
'
)
var
$href
=
/^#
\w
/
.
test
(
href
)
&&
$
(
href
)
return
(
$href
&&
$href
.
length
&&
[[
$href
.
position
().
top
+
(
!
$
.
isWindow
(
self
.
$scrollElement
.
get
(
0
))
&&
self
.
$scrollElement
.
scrollTop
()),
href
]]
)
||
null
&&
[[
$href
.
position
().
top
+
(
!
$
.
isWindow
(
self
.
$scrollElement
.
get
(
0
))
&&
self
.
$scrollElement
.
scrollTop
()),
href
]]
)
||
null
})
.
sort
(
function
(
a
,
b
)
{
return
a
[
0
]
-
b
[
0
]
})
.
each
(
function
()
{
...
...
@@ -68,18 +69,17 @@
})
}
,
process
:
function
()
{
ScrollSpy
.
prototype
.
process
=
function
()
{
var
scrollTop
=
this
.
$scrollElement
.
scrollTop
()
+
this
.
options
.
offset
,
scrollHeight
=
this
.
$scrollElement
[
0
].
scrollHeight
||
this
.
$body
[
0
].
scrollHeight
,
maxScroll
=
scrollHeight
-
this
.
$scrollElement
.
height
()
,
offsets
=
this
.
offsets
,
targets
=
this
.
targets
,
activeTarget
=
this
.
activeTarget
,
i
var
scrollHeight
=
this
.
$scrollElement
[
0
].
scrollHeight
||
this
.
$body
[
0
].
scrollHeight
var
maxScroll
=
scrollHeight
-
this
.
$scrollElement
.
height
()
var
offsets
=
this
.
offsets
var
targets
=
this
.
targets
var
activeTarget
=
this
.
activeTarget
var
i
if
(
scrollTop
>=
maxScroll
)
{
return
activeTarget
!=
(
i
=
targets
.
last
()[
0
])
&&
this
.
activate
(
i
)
return
activeTarget
!=
(
i
=
targets
.
last
()[
0
])
&&
this
.
activate
(
i
)
}
for
(
i
=
offsets
.
length
;
i
--
;)
{
...
...
@@ -90,58 +90,52 @@
}
}
,
activate
:
function
(
target
)
{
var
active
,
selector
ScrollSpy
.
prototype
.
activate
=
function
(
target
)
{
this
.
activeTarget
=
target
$
(
this
.
selector
)
.
parents
(
'
.active
'
)
.
removeClass
(
'
active
'
)
selector
=
this
.
selector
var
selector
=
this
.
selector
+
'
[data-target="
'
+
target
+
'
"],
'
+
this
.
selector
+
'
[href="
'
+
target
+
'
"]
'
active
=
$
(
selector
)
var
active
=
$
(
selector
)
.
parents
(
'
li
'
)
.
addClass
(
'
active
'
)
if
(
active
.
parent
(
'
.dropdown-menu
'
).
length
)
{
active
=
active
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
active
=
active
.
closest
(
'
li.dropdown
'
)
.
addClass
(
'
active
'
)
}
active
.
trigger
(
'
activate
'
)
}
}
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
// SCROLLSPY PLUGIN DEFINITION
// ===========================
var
old
=
$
.
fn
.
scrollspy
$
.
fn
.
scrollspy
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
scrollspy
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
scrollspy
'
,
(
data
=
new
ScrollSpy
(
this
,
options
)))
var
data
=
$this
.
data
(
'
bs-scrollspy
'
)
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
bs-scrollspy
'
,
(
data
=
new
ScrollSpy
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
}
$
.
fn
.
scrollspy
.
Constructor
=
ScrollSpy
$
.
fn
.
scrollspy
.
defaults
=
{
offset
:
10
}
/*
SCROLLSPY NO CONFLICT
* ===================== */
//
SCROLLSPY NO CONFLICT
// =====================
$
.
fn
.
scrollspy
.
noConflict
=
function
()
{
$
.
fn
.
scrollspy
=
old
...
...
@@ -149,8 +143,8 @@
}
/*
SCROLLSPY DATA-API
* ================== */
//
SCROLLSPY DATA-API
// ==================
$
(
window
).
on
(
'
load
'
,
function
()
{
$
(
'
[data-spy="scroll"]
'
).
each
(
function
()
{
...
...
js/tab.js
View file @
149ecd21
...
...
@@ -18,40 +18,29 @@
* ======================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
/* TAB CLASS DEFINITION
* ==================== */
// TAB CLASS DEFINITION
// ====================
var
Tab
=
function
(
element
)
{
this
.
element
=
$
(
element
)
}
Tab
.
prototype
=
{
constructor
:
Tab
,
show
:
function
()
{
Tab
.
prototype
.
show
=
function
()
{
var
$this
=
this
.
element
,
$ul
=
$this
.
closest
(
'
ul:not(.dropdown-menu)
'
)
,
selector
=
$this
.
attr
(
'
data-target
'
)
,
previous
,
$target
,
e
var
$ul
=
$this
.
closest
(
'
ul:not(.dropdown-menu)
'
)
var
selector
=
$this
.
attr
(
'
data-target
'
)
if
(
!
selector
)
{
selector
=
$this
.
attr
(
'
href
'
)
selector
=
selector
&&
selector
.
replace
(
/.*
(?=
#
[^\s]
*$
)
/
,
''
)
//strip for ie7
}
if
(
$this
.
parent
(
'
li
'
).
hasClass
(
'
active
'
)
)
return
if
(
$this
.
parent
(
'
li
'
).
hasClass
(
'
active
'
)
)
return
previous
=
$ul
.
find
(
'
.active:last a
'
)[
0
]
e
=
$
.
Event
(
'
show
'
,
{
var
previous
=
$ul
.
find
(
'
.active:last a
'
)[
0
]
var
e
=
$
.
Event
(
'
bs:tab:show
'
,
{
relatedTarget
:
previous
})
...
...
@@ -59,20 +48,20 @@
if
(
e
.
isDefaultPrevented
())
return
$target
=
$
(
selector
)
var
$target
=
$
(
selector
)
this
.
activate
(
$this
.
parent
(
'
li
'
),
$ul
)
this
.
activate
(
$target
,
$target
.
parent
(),
function
()
{
$this
.
trigger
({
type
:
'
shown
'
type
:
'
bs:tab:
shown
'
,
relatedTarget
:
previous
})
})
}
,
activate
:
function
(
element
,
container
,
callback
)
{
Tab
.
prototype
.
activate
=
function
(
element
,
container
,
callback
)
{
var
$active
=
container
.
find
(
'
> .active
'
)
,
transition
=
callback
var
transition
=
callback
&&
$
.
support
.
transition
&&
$active
.
hasClass
(
'
fade
'
)
...
...
@@ -91,7 +80,7 @@
element
.
removeClass
(
'
fade
'
)
}
if
(
element
.
parent
(
'
.dropdown-menu
'
)
)
{
if
(
element
.
parent
(
'
.dropdown-menu
'
)
)
{
element
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
}
...
...
@@ -104,19 +93,19 @@
$active
.
removeClass
(
'
in
'
)
}
}
/*
TAB PLUGIN DEFINITION
* ===================== */
//
TAB PLUGIN DEFINITION
// =====================
var
old
=
$
.
fn
.
tab
$
.
fn
.
tab
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
tab
'
)
if
(
!
data
)
$this
.
data
(
'
tab
'
,
(
data
=
new
Tab
(
this
)))
var
data
=
$this
.
data
(
'
bs-tab
'
)
if
(
!
data
)
$this
.
data
(
'
bs-tab
'
,
(
data
=
new
Tab
(
this
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
}
...
...
@@ -124,8 +113,8 @@
$
.
fn
.
tab
.
Constructor
=
Tab
/*
TAB NO CONFLICT
* =============== */
//
TAB NO CONFLICT
// ===============
$
.
fn
.
tab
.
noConflict
=
function
()
{
$
.
fn
.
tab
=
old
...
...
@@ -133,8 +122,8 @@
}
/*
TAB DATA-API
* ============ */
//
TAB DATA-API
// ============
$
(
document
).
on
(
'
click.tab.data-api
'
,
'
[data-toggle="tab"], [data-toggle="pill"]
'
,
function
(
e
)
{
e
.
preventDefault
()
...
...
js/tooltip.js
View file @
149ecd21
This diff is collapsed.
Click to expand it.
js/transition.js
View file @
149ecd21
...
...
@@ -18,33 +18,30 @@
* ========================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
/* CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
* ======================================================= */
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
function
transitionEnd
()
{
var
el
=
document
.
createElement
(
'
bootstrap
'
)
;
var
el
=
document
.
createElement
(
'
bootstrap
'
)
var
transEndEventNames
=
{
'
WebkitTransition
'
:
'
webkitTransitionEnd
'
,
'
MozTransition
'
:
'
transitionend
'
,
'
OTransition
'
:
'
oTransitionEnd otransitionend
'
,
'
transition
'
:
'
transitionend
'
}
;
}
for
(
var
name
in
transEndEventNames
)
{
if
(
el
.
style
[
name
]
!==
undefined
)
{
return
{
end
:
transEndEventNames
[
name
]
}
;
return
{
end
:
transEndEventNames
[
name
]
}
}
}
}
$
(
function
()
{
$
.
support
.
transition
=
transitionEnd
()
;
})
;
$
.
support
.
transition
=
transitionEnd
()
})
}(
window
.
jQuery
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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