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
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
...
...
@@ -19,43 +19,51 @@
* ========================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
/* TOOLTIP PUBLIC CLASS DEFINITION
* =============================== */
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
var
Tooltip
=
function
(
element
,
options
)
{
this
.
type
=
this
.
options
=
this
.
enabled
=
this
.
timeout
=
this
.
hoverState
=
this
.
$element
=
null
this
.
init
(
'
tooltip
'
,
element
,
options
)
}
Tooltip
.
prototype
=
{
constructor
:
Tooltip
,
init
:
function
(
type
,
element
,
options
)
{
var
eventIn
,
eventOut
,
triggers
,
trigger
,
i
Tooltip
.
DEFAULTS
=
{
animation
:
true
,
placement
:
'
top
'
,
selector
:
false
,
template
:
'
<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>
'
,
trigger
:
'
hover focus
'
,
title
:
''
,
delay
:
0
,
html
:
false
,
container
:
false
}
Tooltip
.
prototype
.
init
=
function
(
type
,
element
,
options
)
{
this
.
type
=
type
this
.
$element
=
$
(
element
)
this
.
options
=
this
.
getOptions
(
options
)
this
.
enabled
=
true
this
.
$element
=
$
(
element
)
triggers
=
this
.
options
.
trigger
.
split
(
'
'
)
var
triggers
=
this
.
options
.
trigger
.
split
(
'
'
)
for
(
var
i
=
triggers
.
length
;
i
--
;)
{
var
trigger
=
triggers
[
i
]
for
(
i
=
triggers
.
length
;
i
--
;)
{
trigger
=
triggers
[
i
]
if
(
trigger
==
'
click
'
)
{
this
.
$element
.
on
(
'
click.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
toggle
,
this
))
}
else
if
(
trigger
!=
'
manual
'
)
{
eventIn
=
trigger
==
'
hover
'
?
'
mouseenter
'
:
'
focus
'
eventOut
=
trigger
==
'
hover
'
?
'
mouseleave
'
:
'
blur
'
var
eventIn
=
trigger
==
'
hover
'
?
'
mouseenter
'
:
'
focus
'
var
eventOut
=
trigger
==
'
hover
'
?
'
mouseleave
'
:
'
blur
'
this
.
$element
.
on
(
eventIn
+
'
.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
enter
,
this
))
this
.
$element
.
on
(
eventOut
+
'
.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
leave
,
this
))
}
...
...
@@ -66,8 +74,12 @@
this
.
fixTitle
()
}
,
getOptions
:
function
(
options
)
{
options
=
$
.
extend
({},
$
.
fn
[
this
.
type
].
defaults
,
this
.
$element
.
data
(),
options
)
Tooltip
.
prototype
.
getDefaults
=
function
()
{
return
Tooltip
.
DEFAULTS
}
Tooltip
.
prototype
.
getOptions
=
function
(
options
)
{
options
=
$
.
extend
({},
this
.
getDefaults
(),
this
.
$element
.
data
(),
options
)
if
(
options
.
delay
&&
typeof
options
.
delay
==
'
number
'
)
{
options
.
delay
=
{
...
...
@@ -79,27 +91,27 @@
return
options
}
,
enter
:
function
(
e
)
{
Tooltip
.
prototype
.
enter
=
function
(
e
)
{
var
defaults
=
$
.
fn
[
this
.
type
].
defaults
,
options
=
{}
,
self
var
options
=
{}
this
.
_options
&&
$
.
each
(
this
.
_options
,
function
(
key
,
value
)
{
if
(
defaults
[
key
]
!=
value
)
options
[
key
]
=
value
},
this
)
self
=
$
(
e
.
currentTarget
)[
this
.
type
](
options
).
data
(
this
.
type
)
var
self
=
$
(
e
.
currentTarget
)[
this
.
type
](
options
).
data
(
this
.
type
)
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
show
)
return
self
.
show
()
clearTimeout
(
this
.
timeout
)
self
.
hoverState
=
'
in
'
this
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
in
'
)
self
.
show
()
},
self
.
options
.
delay
.
show
)
}
,
leave
:
function
(
e
)
{
Tooltip
.
prototype
.
leave
=
function
(
e
)
{
var
self
=
$
(
e
.
currentTarget
)[
this
.
type
](
this
.
_options
).
data
(
this
.
type
)
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
...
...
@@ -111,26 +123,21 @@
},
self
.
options
.
delay
.
hide
)
}
,
show
:
function
()
{
var
$tip
,
pos
,
actualWidth
,
actualHeight
,
placement
,
tp
,
e
=
$
.
Event
(
'
show
'
)
Tooltip
.
prototype
.
show
=
function
()
{
var
e
=
$
.
Event
(
'
bs:
'
+
this
.
type
+
'
:show
'
)
if
(
this
.
hasContent
()
&&
this
.
enabled
)
{
this
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
$tip
=
this
.
tip
()
var
$tip
=
this
.
tip
()
this
.
setContent
()
if
(
this
.
options
.
animation
)
{
$tip
.
addClass
(
'
fade
'
)
}
if
(
this
.
options
.
animation
)
$tip
.
addClass
(
'
fade
'
)
placement
=
typeof
this
.
options
.
placement
==
'
function
'
?
var
placement
=
typeof
this
.
options
.
placement
==
'
function
'
?
this
.
options
.
placement
.
call
(
this
,
$tip
[
0
],
this
.
$element
[
0
])
:
this
.
options
.
placement
...
...
@@ -140,10 +147,10 @@
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
pos
=
this
.
getPosition
()
actualWidth
=
$tip
[
0
].
offsetWidth
actualHeight
=
$tip
[
0
].
offsetHeight
var
tp
var
pos
=
this
.
getPosition
()
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualHeight
=
$tip
[
0
].
offsetHeight
switch
(
placement
)
{
case
'
bottom
'
:
...
...
@@ -163,37 +170,34 @@
this
.
applyPlacement
(
tp
,
placement
)
this
.
$element
.
trigger
(
'
shown
'
)
}
}
,
applyPlacement
:
function
(
offset
,
placement
)
{
Tooltip
.
prototype
.
applyPlacement
=
function
(
offset
,
placement
)
{
var
$tip
=
this
.
tip
()
,
width
=
$tip
[
0
].
offsetWidth
,
height
=
$tip
[
0
].
offsetHeight
,
actualWidth
,
actualHeight
,
delta
,
replace
var
width
=
$tip
[
0
].
offsetWidth
var
height
=
$tip
[
0
].
offsetHeight
$tip
.
offset
(
offset
)
.
addClass
(
placement
)
.
addClass
(
'
in
'
)
actualWidth
=
$tip
[
0
].
offsetWidth
actualHeight
=
$tip
[
0
].
offsetHeight
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualHeight
=
$tip
[
0
].
offsetHeight
if
(
placement
==
'
top
'
&&
actualHeight
!=
height
)
{
var
replace
=
true
offset
.
top
=
offset
.
top
+
height
-
actualHeight
replace
=
true
}
if
(
placement
==
'
bottom
'
||
placement
==
'
top
'
)
{
delta
=
0
var
delta
=
0
if
(
offset
.
left
<
0
){
delta
=
offset
.
left
*
-
2
offset
.
left
=
0
$tip
.
offset
(
offset
)
actualWidth
=
$tip
[
0
].
offsetWidth
actualHeight
=
$tip
[
0
].
offsetHeight
}
...
...
@@ -206,26 +210,25 @@
if
(
replace
)
$tip
.
offset
(
offset
)
}
,
replaceArrow
:
function
(
delta
,
dimension
,
position
){
this
.
arrow
()
.
css
(
position
,
delta
?
(
50
*
(
1
-
delta
/
dimension
)
+
"
%
"
)
:
''
)
Tooltip
.
prototype
.
replaceArrow
=
function
(
delta
,
dimension
,
position
){
this
.
arrow
().
css
(
position
,
delta
?
(
50
*
(
1
-
delta
/
dimension
)
+
"
%
"
)
:
''
)
}
,
setContent
:
function
()
{
Tooltip
.
prototype
.
setContent
=
function
()
{
var
$tip
=
this
.
tip
()
,
title
=
this
.
getTitle
()
var
title
=
this
.
getTitle
()
$tip
.
find
(
'
.tooltip-inner
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
title
)
$tip
.
removeClass
(
'
fade in top bottom left right
'
)
}
,
hide
:
function
()
{
Tooltip
.
prototype
.
hide
=
function
()
{
var
that
=
this
,
$tip
=
this
.
tip
()
,
e
=
$
.
Event
(
'
hide
'
)
var
$tip
=
this
.
tip
()
var
e
=
$
.
Event
(
'
hide
'
)
this
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
$tip
.
removeClass
(
'
in
'
)
...
...
@@ -250,18 +253,18 @@
return
this
}
,
fixTitle
:
function
()
{
Tooltip
.
prototype
.
fixTitle
=
function
()
{
var
$e
=
this
.
$element
if
(
$e
.
attr
(
'
title
'
)
||
typeof
(
$e
.
attr
(
'
data-original-title
'
))
!=
'
string
'
)
{
$e
.
attr
(
'
data-original-title
'
,
$e
.
attr
(
'
title
'
)
||
''
).
attr
(
'
title
'
,
''
)
}
}
,
hasContent
:
function
()
{
Tooltip
.
prototype
.
hasContent
=
function
()
{
return
this
.
getTitle
()
}
,
getPosition
:
function
()
{
Tooltip
.
prototype
.
getPosition
=
function
()
{
var
el
=
this
.
$element
[
0
]
return
$
.
extend
({},
(
typeof
el
.
getBoundingClientRect
==
'
function
'
)
?
el
.
getBoundingClientRect
()
:
{
width
:
el
.
offsetWidth
...
...
@@ -269,10 +272,10 @@
},
this
.
$element
.
offset
())
}
,
getTitle
:
function
()
{
Tooltip
.
prototype
.
getTitle
=
function
()
{
var
title
,
$e
=
this
.
$element
,
o
=
this
.
options
var
$e
=
this
.
$element
var
o
=
this
.
options
title
=
$e
.
attr
(
'
data-original-title
'
)
||
(
typeof
o
.
title
==
'
function
'
?
o
.
title
.
call
(
$e
[
0
])
:
o
.
title
)
...
...
@@ -280,15 +283,15 @@
return
title
}
,
tip
:
function
()
{
Tooltip
.
prototype
.
tip
=
function
()
{
return
this
.
$tip
=
this
.
$tip
||
$
(
this
.
options
.
template
)
}
,
arrow
:
function
(){
Tooltip
.
prototype
.
arrow
=
function
(){
return
this
.
$arrow
=
this
.
$arrow
||
this
.
tip
().
find
(
"
.tooltip-arrow
"
)
}
,
validate
:
function
()
{
Tooltip
.
prototype
.
validate
=
function
()
{
if
(
!
this
.
$element
[
0
].
parentNode
)
{
this
.
hide
()
this
.
$element
=
null
...
...
@@ -296,40 +299,39 @@
}
}
,
enable
:
function
()
{
Tooltip
.
prototype
.
enable
=
function
()
{
this
.
enabled
=
true
}
,
disable
:
function
()
{
Tooltip
.
prototype
.
disable
=
function
()
{
this
.
enabled
=
false
}
,
toggleEnabled
:
function
()
{
Tooltip
.
prototype
.
toggleEnabled
=
function
()
{
this
.
enabled
=
!
this
.
enabled
}
,
toggle
:
function
(
e
)
{
Tooltip
.
prototype
.
toggle
=
function
(
e
)
{
var
self
=
e
?
$
(
e
.
currentTarget
)[
this
.
type
](
this
.
_options
).
data
(
this
.
type
)
:
this
self
.
tip
().
hasClass
(
'
in
'
)
?
self
.
hide
()
:
self
.
show
()
}
,
destroy
:
function
()
{
Tooltip
.
prototype
.
destroy
=
function
()
{
this
.
hide
().
$element
.
off
(
'
.
'
+
this
.
type
).
removeData
(
this
.
type
)
}
}
/*
TOOLTIP PLUGIN DEFINITION
* ========================= */
//
TOOLTIP PLUGIN DEFINITION
// =========================
var
old
=
$
.
fn
.
tooltip
$
.
fn
.
tooltip
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
tooltip
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
var
data
=
$this
.
data
(
'
tooltip
'
)
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
tooltip
'
,
(
data
=
new
Tooltip
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
...
...
@@ -337,21 +339,9 @@
$
.
fn
.
tooltip
.
Constructor
=
Tooltip
$
.
fn
.
tooltip
.
defaults
=
{
animation
:
true
,
placement
:
'
top
'
,
selector
:
false
,
template
:
'
<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>
'
,
trigger
:
'
hover focus
'
,
title
:
''
,
delay
:
0
,
html
:
false
,
container
:
false
}
/*
TOOLTIP NO CONFLICT
* =================== */
//
TOOLTIP NO CONFLICT
// ===================
$
.
fn
.
tooltip
.
noConflict
=
function
()
{
$
.
fn
.
tooltip
=
old
...
...
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