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 @@
...
@@ -45,7 +45,7 @@
$parent
=
$this
.
hasClass
(
'
alert
'
)
?
$this
:
$this
.
parent
()
$parent
=
$this
.
hasClass
(
'
alert
'
)
?
$this
:
$this
.
parent
()
}
}
$parent
.
trigger
(
e
=
$
.
Event
(
'
bs
-
close
'
))
$parent
.
trigger
(
e
=
$
.
Event
(
'
bs
:alert:
close
'
))
if
(
e
.
isDefaultPrevented
())
return
if
(
e
.
isDefaultPrevented
())
return
...
@@ -79,8 +79,8 @@
...
@@ -79,8 +79,8 @@
$
.
fn
.
alert
.
Constructor
=
Alert
$
.
fn
.
alert
.
Constructor
=
Alert
/*
ALERT NO CONFLICT
//
ALERT NO CONFLICT
* ================= */
// =================
$
.
fn
.
alert
.
noConflict
=
function
()
{
$
.
fn
.
alert
.
noConflict
=
function
()
{
$
.
fn
.
alert
=
old
$
.
fn
.
alert
=
old
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
// ALERT DATA-API
// ALERT DATA-API
// ==============
*/
// ==============
$
(
document
).
on
(
'
click.bs-alert.bs-data-api
'
,
dismiss
,
Alert
.
prototype
.
close
)
$
(
document
).
on
(
'
click.bs-alert.bs-data-api
'
,
dismiss
,
Alert
.
prototype
.
close
)
...
...
js/carousel.js
View file @
149ecd21
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
$next
=
$next
.
length
?
$next
:
this
.
$element
.
find
(
'
.item
'
)[
fallback
]()
$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
if
(
$next
.
hasClass
(
'
active
'
))
return
...
@@ -159,11 +159,11 @@
...
@@ -159,11 +159,11 @@
$
.
fn
.
carousel
=
function
(
option
)
{
$
.
fn
.
carousel
=
function
(
option
)
{
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
var
$this
=
$
(
this
)
var
data
=
$this
.
data
(
'
carousel
'
)
var
data
=
$this
.
data
(
'
bs-
carousel
'
)
var
options
=
$
.
extend
({},
Carousel
.
DEFAULTS
,
typeof
option
==
'
object
'
&&
option
)
var
options
=
$
.
extend
({},
Carousel
.
DEFAULTS
,
typeof
option
==
'
object
'
&&
option
)
var
action
=
typeof
option
==
'
string
'
?
option
:
options
.
slide
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
)
if
(
typeof
option
==
'
number
'
)
data
.
to
(
option
)
else
if
(
action
)
data
[
action
]()
else
if
(
action
)
data
[
action
]()
else
if
(
options
.
interval
)
data
.
pause
().
cycle
()
else
if
(
options
.
interval
)
data
.
pause
().
cycle
()
...
@@ -181,6 +181,7 @@
...
@@ -181,6 +181,7 @@
return
this
return
this
}
}
// CAROUSEL DATA-API
// CAROUSEL DATA-API
// =================
// =================
...
...
js/collapse.js
View file @
149ecd21
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
}
}
this
.
$element
[
dimension
](
0
)
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
])
if
(
$
.
support
.
transition
)
this
.
$element
[
dimension
](
this
.
$element
[
0
][
scroll
])
}
}
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
if
(
this
.
transitioning
||
!
this
.
$element
.
hasClass
(
'
in
'
))
return
if
(
this
.
transitioning
||
!
this
.
$element
.
hasClass
(
'
in
'
))
return
var
dimension
=
this
.
dimension
()
var
dimension
=
this
.
dimension
()
this
.
reset
(
this
.
$element
[
dimension
]())
this
.
reset
(
this
.
$element
[
dimension
]())
this
.
transition
(
'
removeClass
'
,
$
.
Event
(
'
hide
'
),
'
hidden
'
)
this
.
transition
(
'
removeClass
'
,
$
.
Event
(
'
bs:collapse:
hide
'
),
'
hidden
'
)
this
.
$element
[
dimension
](
0
)
this
.
$element
[
dimension
](
0
)
}
}
...
...
js/dropdown.js
View file @
149ecd21
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
!
function
(
$
)
{
"
use strict
"
;
!
function
(
$
)
{
"
use strict
"
;
// DROPDOWN CLASS DEFINITION
// DROPDOWN CLASS DEFINITION
// =========================
// =========================
...
...
js/modal.js
View file @
149ecd21
...
@@ -18,32 +18,33 @@
...
@@ -18,32 +18,33 @@
* ========================================================= */
* ========================================================= */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
// MODAL CLASS DEFINITION
// ======================
/* MODAL CLASS DEFINITION
* ====================== */
var
Modal
=
function
(
element
,
options
)
{
var
Modal
=
function
(
element
,
options
)
{
this
.
options
=
options
this
.
options
=
options
this
.
$element
=
$
(
element
)
this
.
$element
=
$
(
element
).
delegate
(
'
[data-dismiss="modal"]
'
,
'
click.dismiss.modal
'
,
$
.
proxy
(
this
.
hide
,
this
))
.
delegate
(
'
[data-dismiss="modal"]
'
,
'
click.dismiss.modal
'
,
$
.
proxy
(
this
.
hide
,
this
))
this
.
$backdrop
=
this
.
options
.
remote
&&
this
.
$element
.
find
(
'
.modal-body
'
).
load
(
this
.
options
.
remote
)
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
'
]()
return
this
[
!
this
.
isShown
?
'
show
'
:
'
hide
'
]()
}
}
,
show
:
function
()
{
Modal
.
prototype
.
show
=
function
()
{
var
that
=
this
var
that
=
this
,
e
=
$
.
Event
(
'
show
'
)
var
e
=
$
.
Event
(
'
bs:modal:
show
'
)
this
.
$element
.
trigger
(
e
)
this
.
$element
.
trigger
(
e
)
...
@@ -73,18 +74,16 @@
...
@@ -73,18 +74,16 @@
that
.
enforceFocus
()
that
.
enforceFocus
()
transition
?
transition
?
that
.
$element
.
one
(
$
.
support
.
transition
.
end
,
function
()
{
that
.
$element
.
focus
().
trigger
(
'
shown
'
)
})
:
that
.
$element
.
one
(
$
.
support
.
transition
.
end
,
function
()
{
that
.
$element
.
focus
().
trigger
(
'
bs:modal:
shown
'
)
})
:
that
.
$element
.
focus
().
trigger
(
'
shown
'
)
that
.
$element
.
focus
().
trigger
(
'
bs:modal:
shown
'
)
})
})
}
}
,
hide
:
function
(
e
)
{
Modal
.
prototype
.
show
=
function
(
e
)
{
e
&&
e
.
preventDefault
()
if
(
e
)
e
.
preventDefault
()
var
that
=
this
e
=
$
.
Event
(
'
bs:modal:hide
'
)
e
=
$
.
Event
(
'
hide
'
)
this
.
$element
.
trigger
(
e
)
this
.
$element
.
trigger
(
e
)
...
@@ -105,29 +104,27 @@
...
@@ -105,29 +104,27 @@
this
.
hideModal
()
this
.
hideModal
()
}
}
,
enforceFocus
:
function
()
{
Modal
.
prototype
.
enforceFocus
=
function
()
{
var
that
=
this
$
(
document
).
on
(
'
focusin.modal
'
,
function
(
e
)
{
$
(
document
).
on
(
'
focusin.modal
'
,
function
(
e
)
{
if
(
that
.
$element
[
0
]
!==
e
.
target
&&
!
that
.
$element
.
has
(
e
.
target
).
length
)
{
if
(
this
.
$element
[
0
]
!==
e
.
target
&&
!
this
.
$element
.
has
(
e
.
target
).
length
)
{
that
.
$element
.
focus
()
this
.
$element
.
focus
()
}
}
}
)
},
this
)
}
}
,
escape
:
function
()
{
Modal
.
prototype
.
escape
=
function
()
{
var
that
=
this
if
(
this
.
isShown
&&
this
.
options
.
keyboard
)
{
if
(
this
.
isShown
&&
this
.
options
.
keyboard
)
{
this
.
$element
.
on
(
'
keyup.dismiss.modal
'
,
function
(
e
)
{
this
.
$element
.
on
(
'
keyup.dismiss.modal
'
,
function
(
e
)
{
e
.
which
==
27
&&
that
.
hide
()
e
.
which
==
27
&&
this
.
hide
()
}
)
},
this
)
}
else
if
(
!
this
.
isShown
)
{
}
else
if
(
!
this
.
isShown
)
{
this
.
$element
.
off
(
'
keyup.dismiss.modal
'
)
this
.
$element
.
off
(
'
keyup.dismiss.modal
'
)
}
}
}
}
,
hideWithTransition
:
function
()
{
Modal
.
prototype
.
hideWithTransition
=
function
()
{
var
that
=
this
var
that
=
this
,
timeout
=
setTimeout
(
function
()
{
var
timeout
=
setTimeout
(
function
()
{
that
.
$element
.
off
(
$
.
support
.
transition
.
end
)
that
.
$element
.
off
(
$
.
support
.
transition
.
end
)
that
.
hideModal
()
that
.
hideModal
()
},
500
)
},
500
)
...
@@ -138,23 +135,23 @@
...
@@ -138,23 +135,23 @@
})
})
}
}
,
hideModal
:
function
()
{
Modal
.
prototype
.
hideModal
=
function
()
{
var
that
=
this
var
that
=
this
this
.
$element
.
hide
()
this
.
$element
.
hide
()
this
.
backdrop
(
function
()
{
this
.
backdrop
(
function
()
{
that
.
removeBackdrop
()
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
&&
this
.
$backdrop
.
remove
()
this
.
$backdrop
=
null
this
.
$backdrop
=
null
}
}
,
backdrop
:
function
(
callback
)
{
Modal
.
prototype
.
backdrop
:
function
(
callback
)
{
var
that
=
this
var
that
=
this
,
animate
=
this
.
$element
.
hasClass
(
'
fade
'
)
?
'
fade
'
:
''
var
animate
=
this
.
$element
.
hasClass
(
'
fade
'
)
?
'
fade
'
:
''
if
(
this
.
isShown
&&
this
.
options
.
backdrop
)
{
if
(
this
.
isShown
&&
this
.
options
.
backdrop
)
{
var
doAnimate
=
$
.
support
.
transition
&&
animate
var
doAnimate
=
$
.
support
.
transition
&&
animate
...
@@ -189,36 +186,30 @@
...
@@ -189,36 +186,30 @@
callback
()
callback
()
}
}
}
}
}
/*
MODAL PLUGIN DEFINITION
//
MODAL PLUGIN DEFINITION
* ======================= */
// =======================
var
old
=
$
.
fn
.
modal
var
old
=
$
.
fn
.
modal
$
.
fn
.
modal
=
function
(
option
)
{
$
.
fn
.
modal
=
function
(
option
)
{
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
modal
'
)
var
data
=
$this
.
data
(
'
bs-modal
'
)
,
options
=
$
.
extend
({},
$
.
fn
.
modal
.
defaults
,
$this
.
data
(),
typeof
option
==
'
object
'
&&
option
)
var
options
=
$
.
extend
({},
Modal
.
DEFAULTS
,
$this
.
data
(),
typeof
option
==
'
object
'
&&
option
)
if
(
!
data
)
$this
.
data
(
'
modal
'
,
(
data
=
new
Modal
(
this
,
options
)))
if
(
!
data
)
$this
.
data
(
'
bs-modal
'
,
(
data
=
new
Modal
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
else
if
(
options
.
show
)
data
.
show
()
else
if
(
options
.
show
)
data
.
show
()
})
})
}
}
$
.
fn
.
modal
.
defaults
=
{
backdrop
:
true
,
keyboard
:
true
,
show
:
true
}
$
.
fn
.
modal
.
Constructor
=
Modal
$
.
fn
.
modal
.
Constructor
=
Modal
/*
MODAL NO CONFLICT
//
MODAL NO CONFLICT
* ================= */
// =================
$
.
fn
.
modal
.
noConflict
=
function
()
{
$
.
fn
.
modal
.
noConflict
=
function
()
{
$
.
fn
.
modal
=
old
$
.
fn
.
modal
=
old
...
@@ -226,14 +217,14 @@
...
@@ -226,14 +217,14 @@
}
}
/*
MODAL DATA-API
//
MODAL DATA-API
* ============== */
// ==============
$
(
document
).
on
(
'
click.modal.data-api
'
,
'
[data-toggle="modal"]
'
,
function
(
e
)
{
$
(
document
).
on
(
'
click.modal.data-api
'
,
'
[data-toggle="modal"]
'
,
function
(
e
)
{
var
$this
=
$
(
this
)
var
$this
=
$
(
this
)
,
href
=
$this
.
attr
(
'
href
'
)
var
href
=
$this
.
attr
(
'
href
'
)
,
$target
=
$
(
$this
.
attr
(
'
data-target
'
)
||
(
href
&&
href
.
replace
(
/.*
(?=
#
[^\s]
+$
)
/
,
''
)))
//strip for ie7
var
$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
option
=
$target
.
data
(
'
modal
'
)
?
'
toggle
'
:
$
.
extend
({
remote
:
!
/#/
.
test
(
href
)
&&
href
},
$target
.
data
(),
$this
.
data
())
e
.
preventDefault
()
e
.
preventDefault
()
...
@@ -245,7 +236,7 @@
...
@@ -245,7 +236,7 @@
})
})
var
$body
=
$
(
document
.
body
)
var
$body
=
$
(
document
.
body
)
.
on
(
'
shown
'
,
'
.modal
'
,
function
()
{
$body
.
addClass
(
'
modal-open
'
)
})
.
on
(
'
bs:modal:shown
'
,
'
.modal
'
,
function
()
{
$body
.
addClass
(
'
modal-open
'
)
})
.
on
(
'
hidden
'
,
'
.modal
'
,
function
()
{
$body
.
removeClass
(
'
modal-open
'
)
})
.
on
(
'
bs:modal:
hidden
'
,
'
.modal
'
,
function
()
{
$body
.
removeClass
(
'
modal-open
'
)
})
}(
window
.
jQuery
);
}(
window
.
jQuery
);
js/popover.js
View file @
149ecd21
...
@@ -18,30 +18,38 @@
...
@@ -18,30 +18,38 @@
* =========================================================== */
* =========================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
// POPOVER PUBLIC CLASS DEFINITION
// ===============================
/* POPOVER PUBLIC CLASS DEFINITION
* =============================== */
var
Popover
=
function
(
element
,
options
)
{
var
Popover
=
function
(
element
,
options
)
{
this
.
init
(
'
popover
'
,
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
()
var
$tip
=
this
.
tip
()
,
title
=
this
.
getTitle
()
var
title
=
this
.
getTitle
()
,
content
=
this
.
getContent
()
var
content
=
this
.
getContent
()
$tip
.
find
(
'
.popover-title
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
title
)
$tip
.
find
(
'
.popover-title
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
title
)
$tip
.
find
(
'
.popover-content
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
content
)
$tip
.
find
(
'
.popover-content
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
content
)
...
@@ -49,62 +57,49 @@
...
@@ -49,62 +57,49 @@
$tip
.
removeClass
(
'
fade top bottom left right in
'
)
$tip
.
removeClass
(
'
fade top bottom left right in
'
)
}
}
,
hasContent
:
function
()
{
Popover
.
prototype
.
hasContent
=
function
()
{
return
this
.
getTitle
()
||
this
.
getContent
()
return
this
.
getTitle
()
||
this
.
getContent
()
}
}
,
getContent
:
function
()
{
Popover
.
prototype
.
getContent
=
function
()
{
var
content
var
content
=
typeof
this
.
options
.
content
==
'
function
'
?
,
$e
=
this
.
$element
this
.
options
.
content
.
call
(
$e
[
0
])
:
,
o
=
this
.
options
this
.
options
.
content
content
=
(
typeof
o
.
content
==
'
function
'
?
o
.
content
.
call
(
$e
[
0
])
:
o
.
content
)
||
$e
.
attr
(
'
data-content
'
)
return
content
return
content
||
this
.
$element
.
attr
(
'
data-content
'
)
}
}
,
tip
:
function
()
{
Popover
.
prototype
.
tip
=
function
()
{
if
(
!
this
.
$tip
)
{
if
(
!
this
.
$tip
)
this
.
$tip
=
$
(
this
.
options
.
template
)
this
.
$tip
=
$
(
this
.
options
.
template
)
}
return
this
.
$tip
return
this
.
$tip
}
}
,
destroy
:
function
()
{
Popover
.
prototype
.
destroy
=
function
()
{
this
.
hide
().
$element
.
off
(
'
.
'
+
this
.
type
).
removeData
(
this
.
type
)
this
.
hide
().
$element
.
off
(
'
.
'
+
this
.
type
).
removeData
(
this
.
type
)
}
}
})
/*
POPOVER PLUGIN DEFINITION
//
POPOVER PLUGIN DEFINITION
* ======================= */
// =========================
var
old
=
$
.
fn
.
popover
var
old
=
$
.
fn
.
popover
$
.
fn
.
popover
=
function
(
option
)
{
$
.
fn
.
popover
=
function
(
option
)
{
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
popover
'
)
var
data
=
$this
.
data
(
'
bs-popover
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
popover
'
,
(
data
=
new
Popover
(
this
,
options
)))
if
(
!
data
)
$this
.
data
(
'
bs-popover
'
,
(
data
=
new
Popover
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
})
}
}
$
.
fn
.
popover
.
Constructor
=
Popover
$
.
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
.
noConflict
=
function
()
{
$
.
fn
.
popover
=
old
$
.
fn
.
popover
=
old
...
...
js/scrollspy.js
View file @
149ecd21
...
@@ -18,48 +18,49 @@
...
@@ -18,48 +18,49 @@
* ============================================================== */
* ============================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
// SCROLLSPY CLASS DEFINITION
// ==========================
/* SCROLLSPY CLASS DEFINITION
* ========================== */
function
ScrollSpy
(
element
,
options
)
{
function
ScrollSpy
(
element
,
options
)
{
var
href
var
process
=
$
.
proxy
(
this
.
process
,
this
)
var
process
=
$
.
proxy
(
this
.
process
,
this
)
,
$element
=
$
(
element
).
is
(
'
body
'
)
?
$
(
window
)
:
$
(
element
)
var
$element
=
$
(
element
).
is
(
'
body
'
)
?
$
(
window
)
:
$
(
element
)
,
href
this
.
options
=
$
.
extend
({},
$
.
fn
.
scrollspy
.
defaults
,
options
)
this
.
$body
=
$
(
'
body
'
)
this
.
$scrollElement
=
$element
.
on
(
'
scroll.scroll-spy.data-api
'
,
process
)
this
.
$scrollElement
=
$element
.
on
(
'
scroll.scroll-spy.data-api
'
,
process
)
this
.
options
=
$
.
extend
({},
ScrollSpy
.
DEFAULTS
,
options
)
this
.
selector
=
(
this
.
options
.
target
this
.
selector
=
(
this
.
options
.
target
||
((
href
=
$
(
element
).
attr
(
'
href
'
))
&&
href
.
replace
(
/.*
(?=
#
[^\s]
+$
)
/
,
''
))
//strip for ie7
||
((
href
=
$
(
element
).
attr
(
'
href
'
))
&&
href
.
replace
(
/.*
(?=
#
[^\s]
+$
)
/
,
''
))
//strip for ie7
||
''
)
+
'
.nav li > a
'
||
''
)
+
'
.nav li > a
'
this
.
$body
=
$
(
'
body
'
)
this
.
offsets
=
$
([])
this
.
targets
=
$
([])
this
.
activeTarget
=
null
this
.
refresh
()
this
.
refresh
()
this
.
process
()
this
.
process
()
}
}
ScrollSpy
.
prototype
=
{
ScrollSpy
.
DEFAULTS
=
{
offset
:
10
constructor
:
ScrollSpy
}
,
refresh
:
function
()
{
var
self
=
this
,
$targets
ScrollSpy
.
prototype
.
refresh
=
function
()
{
this
.
offsets
=
$
([])
this
.
offsets
=
$
([])
this
.
targets
=
$
([])
this
.
targets
=
$
([])
$targets
=
this
.
$body
var
self
=
this
var
$targets
=
this
.
$body
.
find
(
this
.
selector
)
.
find
(
this
.
selector
)
.
map
(
function
()
{
.
map
(
function
()
{
var
$el
=
$
(
this
)
var
$el
=
$
(
this
)
,
href
=
$el
.
data
(
'
target
'
)
||
$el
.
attr
(
'
href
'
)
var
href
=
$el
.
data
(
'
target
'
)
||
$el
.
attr
(
'
href
'
)
,
$href
=
/^#
\w
/
.
test
(
href
)
&&
$
(
href
)
var
$href
=
/^#
\w
/
.
test
(
href
)
&&
$
(
href
)
return
(
$href
return
(
$href
&&
$href
.
length
&&
$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
]
})
.
sort
(
function
(
a
,
b
)
{
return
a
[
0
]
-
b
[
0
]
})
.
each
(
function
()
{
.
each
(
function
()
{
...
@@ -68,18 +69,17 @@
...
@@ -68,18 +69,17 @@
})
})
}
}
,
process
:
function
()
{
ScrollSpy
.
prototype
.
process
=
function
()
{
var
scrollTop
=
this
.
$scrollElement
.
scrollTop
()
+
this
.
options
.
offset
var
scrollTop
=
this
.
$scrollElement
.
scrollTop
()
+
this
.
options
.
offset
,
scrollHeight
=
this
.
$scrollElement
[
0
].
scrollHeight
||
this
.
$body
[
0
].
scrollHeight
var
scrollHeight
=
this
.
$scrollElement
[
0
].
scrollHeight
||
this
.
$body
[
0
].
scrollHeight
,
maxScroll
=
scrollHeight
-
this
.
$scrollElement
.
height
()
var
maxScroll
=
scrollHeight
-
this
.
$scrollElement
.
height
()
,
offsets
=
this
.
offsets
var
offsets
=
this
.
offsets
,
targets
=
this
.
targets
var
targets
=
this
.
targets
,
activeTarget
=
this
.
activeTarget
var
activeTarget
=
this
.
activeTarget
,
i
var
i
if
(
scrollTop
>=
maxScroll
)
{
if
(
scrollTop
>=
maxScroll
)
{
return
activeTarget
!=
(
i
=
targets
.
last
()[
0
])
return
activeTarget
!=
(
i
=
targets
.
last
()[
0
])
&&
this
.
activate
(
i
)
&&
this
.
activate
(
i
)
}
}
for
(
i
=
offsets
.
length
;
i
--
;)
{
for
(
i
=
offsets
.
length
;
i
--
;)
{
...
@@ -90,58 +90,52 @@
...
@@ -90,58 +90,52 @@
}
}
}
}
,
activate
:
function
(
target
)
{
ScrollSpy
.
prototype
.
activate
=
function
(
target
)
{
var
active
,
selector
this
.
activeTarget
=
target
this
.
activeTarget
=
target
$
(
this
.
selector
)
$
(
this
.
selector
)
.
parents
(
'
.active
'
)
.
parents
(
'
.active
'
)
.
removeClass
(
'
active
'
)
.
removeClass
(
'
active
'
)
selector
=
this
.
selector
var
selector
=
this
.
selector
+
'
[data-target="
'
+
target
+
'
"],
'
+
'
[data-target="
'
+
target
+
'
"],
'
+
this
.
selector
+
'
[href="
'
+
target
+
'
"]
'
+
this
.
selector
+
'
[href="
'
+
target
+
'
"]
'
active
=
$
(
selector
)
var
active
=
$
(
selector
)
.
parents
(
'
li
'
)
.
parents
(
'
li
'
)
.
addClass
(
'
active
'
)
.
addClass
(
'
active
'
)
if
(
active
.
parent
(
'
.dropdown-menu
'
).
length
)
{
if
(
active
.
parent
(
'
.dropdown-menu
'
).
length
)
{
active
=
active
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
active
=
active
.
closest
(
'
li.dropdown
'
)
.
addClass
(
'
active
'
)
}
}
active
.
trigger
(
'
activate
'
)
active
.
trigger
(
'
activate
'
)
}
}
}
// SCROLLSPY PLUGIN DEFINITION
/* SCROLLSPY PLUGIN DEFINITION
// ===========================
* =========================== */
var
old
=
$
.
fn
.
scrollspy
var
old
=
$
.
fn
.
scrollspy
$
.
fn
.
scrollspy
=
function
(
option
)
{
$
.
fn
.
scrollspy
=
function
(
option
)
{
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
scrollspy
'
)
var
data
=
$this
.
data
(
'
bs-scrollspy
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
scrollspy
'
,
(
data
=
new
ScrollSpy
(
this
,
options
)))
if
(
!
data
)
$this
.
data
(
'
bs-scrollspy
'
,
(
data
=
new
ScrollSpy
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
})
}
}
$
.
fn
.
scrollspy
.
Constructor
=
ScrollSpy
$
.
fn
.
scrollspy
.
Constructor
=
ScrollSpy
$
.
fn
.
scrollspy
.
defaults
=
{
offset
:
10
}
/*
SCROLLSPY NO CONFLICT
//
SCROLLSPY NO CONFLICT
* ===================== */
// =====================
$
.
fn
.
scrollspy
.
noConflict
=
function
()
{
$
.
fn
.
scrollspy
.
noConflict
=
function
()
{
$
.
fn
.
scrollspy
=
old
$
.
fn
.
scrollspy
=
old
...
@@ -149,8 +143,8 @@
...
@@ -149,8 +143,8 @@
}
}
/*
SCROLLSPY DATA-API
//
SCROLLSPY DATA-API
* ================== */
// ==================
$
(
window
).
on
(
'
load
'
,
function
()
{
$
(
window
).
on
(
'
load
'
,
function
()
{
$
(
'
[data-spy="scroll"]
'
).
each
(
function
()
{
$
(
'
[data-spy="scroll"]
'
).
each
(
function
()
{
...
...
js/tab.js
View file @
149ecd21
...
@@ -18,40 +18,29 @@
...
@@ -18,40 +18,29 @@
* ======================================================== */
* ======================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
// TAB CLASS DEFINITION
// ====================
/* TAB CLASS DEFINITION
* ==================== */
var
Tab
=
function
(
element
)
{
var
Tab
=
function
(
element
)
{
this
.
element
=
$
(
element
)
this
.
element
=
$
(
element
)
}
}
Tab
.
prototype
=
{
Tab
.
prototype
.
show
=
function
()
{
constructor
:
Tab
,
show
:
function
()
{
var
$this
=
this
.
element
var
$this
=
this
.
element
,
$ul
=
$this
.
closest
(
'
ul:not(.dropdown-menu)
'
)
var
$ul
=
$this
.
closest
(
'
ul:not(.dropdown-menu)
'
)
,
selector
=
$this
.
attr
(
'
data-target
'
)
var
selector
=
$this
.
attr
(
'
data-target
'
)
,
previous
,
$target
,
e
if
(
!
selector
)
{
if
(
!
selector
)
{
selector
=
$this
.
attr
(
'
href
'
)
selector
=
$this
.
attr
(
'
href
'
)
selector
=
selector
&&
selector
.
replace
(
/.*
(?=
#
[^\s]
*$
)
/
,
''
)
//strip for ie7
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
]
var
previous
=
$ul
.
find
(
'
.active:last a
'
)[
0
]
var
e
=
$
.
Event
(
'
bs:tab:show
'
,
{
e
=
$
.
Event
(
'
show
'
,
{
relatedTarget
:
previous
relatedTarget
:
previous
})
})
...
@@ -59,20 +48,20 @@
...
@@ -59,20 +48,20 @@
if
(
e
.
isDefaultPrevented
())
return
if
(
e
.
isDefaultPrevented
())
return
$target
=
$
(
selector
)
var
$target
=
$
(
selector
)
this
.
activate
(
$this
.
parent
(
'
li
'
),
$ul
)
this
.
activate
(
$this
.
parent
(
'
li
'
),
$ul
)
this
.
activate
(
$target
,
$target
.
parent
(),
function
()
{
this
.
activate
(
$target
,
$target
.
parent
(),
function
()
{
$this
.
trigger
({
$this
.
trigger
({
type
:
'
shown
'
type
:
'
bs:tab:
shown
'
,
relatedTarget
:
previous
,
relatedTarget
:
previous
})
})
})
})
}
}
,
activate
:
function
(
element
,
container
,
callback
)
{
Tab
.
prototype
.
activate
=
function
(
element
,
container
,
callback
)
{
var
$active
=
container
.
find
(
'
> .active
'
)
var
$active
=
container
.
find
(
'
> .active
'
)
,
transition
=
callback
var
transition
=
callback
&&
$
.
support
.
transition
&&
$
.
support
.
transition
&&
$active
.
hasClass
(
'
fade
'
)
&&
$active
.
hasClass
(
'
fade
'
)
...
@@ -91,7 +80,7 @@
...
@@ -91,7 +80,7 @@
element
.
removeClass
(
'
fade
'
)
element
.
removeClass
(
'
fade
'
)
}
}
if
(
element
.
parent
(
'
.dropdown-menu
'
)
)
{
if
(
element
.
parent
(
'
.dropdown-menu
'
)
)
{
element
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
element
.
closest
(
'
li.dropdown
'
).
addClass
(
'
active
'
)
}
}
...
@@ -104,19 +93,19 @@
...
@@ -104,19 +93,19 @@
$active
.
removeClass
(
'
in
'
)
$active
.
removeClass
(
'
in
'
)
}
}
}
/*
TAB PLUGIN DEFINITION
//
TAB PLUGIN DEFINITION
* ===================== */
// =====================
var
old
=
$
.
fn
.
tab
var
old
=
$
.
fn
.
tab
$
.
fn
.
tab
=
function
(
option
)
{
$
.
fn
.
tab
=
function
(
option
)
{
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
tab
'
)
var
data
=
$this
.
data
(
'
bs-tab
'
)
if
(
!
data
)
$this
.
data
(
'
tab
'
,
(
data
=
new
Tab
(
this
)))
if
(
!
data
)
$this
.
data
(
'
bs-tab
'
,
(
data
=
new
Tab
(
this
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
})
}
}
...
@@ -124,8 +113,8 @@
...
@@ -124,8 +113,8 @@
$
.
fn
.
tab
.
Constructor
=
Tab
$
.
fn
.
tab
.
Constructor
=
Tab
/*
TAB NO CONFLICT
//
TAB NO CONFLICT
* =============== */
// ===============
$
.
fn
.
tab
.
noConflict
=
function
()
{
$
.
fn
.
tab
.
noConflict
=
function
()
{
$
.
fn
.
tab
=
old
$
.
fn
.
tab
=
old
...
@@ -133,8 +122,8 @@
...
@@ -133,8 +122,8 @@
}
}
/*
TAB DATA-API
//
TAB DATA-API
* ============ */
// ============
$
(
document
).
on
(
'
click.tab.data-api
'
,
'
[data-toggle="tab"], [data-toggle="pill"]
'
,
function
(
e
)
{
$
(
document
).
on
(
'
click.tab.data-api
'
,
'
[data-toggle="tab"], [data-toggle="pill"]
'
,
function
(
e
)
{
e
.
preventDefault
()
e
.
preventDefault
()
...
...
js/tooltip.js
View file @
149ecd21
...
@@ -19,43 +19,51 @@
...
@@ -19,43 +19,51 @@
* ========================================================== */
* ========================================================== */
!
function
(
$
)
{
!
function
(
$
)
{
"
use strict
"
;
"
use strict
"
;
// jshint ;_;
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
/* TOOLTIP PUBLIC CLASS DEFINITION
* =============================== */
var
Tooltip
=
function
(
element
,
options
)
{
var
Tooltip
=
function
(
element
,
options
)
{
this
.
type
=
this
.
options
=
this
.
enabled
=
this
.
timeout
=
this
.
hoverState
=
this
.
$element
=
null
this
.
init
(
'
tooltip
'
,
element
,
options
)
this
.
init
(
'
tooltip
'
,
element
,
options
)
}
}
Tooltip
.
prototype
=
{
Tooltip
.
DEFAULTS
=
{
animation
:
true
constructor
:
Tooltip
,
placement
:
'
top
'
,
selector
:
false
,
init
:
function
(
type
,
element
,
options
)
{
,
template
:
'
<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>
'
var
eventIn
,
trigger
:
'
hover focus
'
,
eventOut
,
title
:
''
,
triggers
,
delay
:
0
,
trigger
,
html
:
false
,
i
,
container
:
false
}
Tooltip
.
prototype
.
init
=
function
(
type
,
element
,
options
)
{
this
.
type
=
type
this
.
type
=
type
this
.
$element
=
$
(
element
)
this
.
options
=
this
.
getOptions
(
options
)
this
.
options
=
this
.
getOptions
(
options
)
this
.
enabled
=
true
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
'
)
{
if
(
trigger
==
'
click
'
)
{
this
.
$element
.
on
(
'
click.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
toggle
,
this
))
this
.
$element
.
on
(
'
click.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
toggle
,
this
))
}
else
if
(
trigger
!=
'
manual
'
)
{
}
else
if
(
trigger
!=
'
manual
'
)
{
eventIn
=
trigger
==
'
hover
'
?
'
mouseenter
'
:
'
focus
'
var
eventIn
=
trigger
==
'
hover
'
?
'
mouseenter
'
:
'
focus
'
eventOut
=
trigger
==
'
hover
'
?
'
mouseleave
'
:
'
blur
'
var
eventOut
=
trigger
==
'
hover
'
?
'
mouseleave
'
:
'
blur
'
this
.
$element
.
on
(
eventIn
+
'
.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
enter
,
this
))
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
))
this
.
$element
.
on
(
eventOut
+
'
.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
leave
,
this
))
}
}
...
@@ -66,8 +74,12 @@
...
@@ -66,8 +74,12 @@
this
.
fixTitle
()
this
.
fixTitle
()
}
}
,
getOptions
:
function
(
options
)
{
Tooltip
.
prototype
.
getDefaults
=
function
()
{
options
=
$
.
extend
({},
$
.
fn
[
this
.
type
].
defaults
,
this
.
$element
.
data
(),
options
)
return
Tooltip
.
DEFAULTS
}
Tooltip
.
prototype
.
getOptions
=
function
(
options
)
{
options
=
$
.
extend
({},
this
.
getDefaults
(),
this
.
$element
.
data
(),
options
)
if
(
options
.
delay
&&
typeof
options
.
delay
==
'
number
'
)
{
if
(
options
.
delay
&&
typeof
options
.
delay
==
'
number
'
)
{
options
.
delay
=
{
options
.
delay
=
{
...
@@ -79,27 +91,27 @@
...
@@ -79,27 +91,27 @@
return
options
return
options
}
}
,
enter
:
function
(
e
)
{
Tooltip
.
prototype
.
enter
=
function
(
e
)
{
var
defaults
=
$
.
fn
[
this
.
type
].
defaults
var
defaults
=
$
.
fn
[
this
.
type
].
defaults
,
options
=
{}
var
options
=
{}
,
self
this
.
_options
&&
$
.
each
(
this
.
_options
,
function
(
key
,
value
)
{
this
.
_options
&&
$
.
each
(
this
.
_options
,
function
(
key
,
value
)
{
if
(
defaults
[
key
]
!=
value
)
options
[
key
]
=
value
if
(
defaults
[
key
]
!=
value
)
options
[
key
]
=
value
},
this
)
},
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
()
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
show
)
return
self
.
show
()
clearTimeout
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
self
.
hoverState
=
'
in
'
self
.
hoverState
=
'
in
'
this
.
timeout
=
setTimeout
(
function
()
{
this
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
in
'
)
self
.
show
()
if
(
self
.
hoverState
==
'
in
'
)
self
.
show
()
},
self
.
options
.
delay
.
show
)
},
self
.
options
.
delay
.
show
)
}
}
,
leave
:
function
(
e
)
{
Tooltip
.
prototype
.
leave
=
function
(
e
)
{
var
self
=
$
(
e
.
currentTarget
)[
this
.
type
](
this
.
_options
).
data
(
this
.
type
)
var
self
=
$
(
e
.
currentTarget
)[
this
.
type
](
this
.
_options
).
data
(
this
.
type
)
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
...
@@ -111,26 +123,21 @@
...
@@ -111,26 +123,21 @@
},
self
.
options
.
delay
.
hide
)
},
self
.
options
.
delay
.
hide
)
}
}
,
show
:
function
()
{
Tooltip
.
prototype
.
show
=
function
()
{
var
$tip
var
e
=
$
.
Event
(
'
bs:
'
+
this
.
type
+
'
:show
'
)
,
pos
,
actualWidth
,
actualHeight
,
placement
,
tp
,
e
=
$
.
Event
(
'
show
'
)
if
(
this
.
hasContent
()
&&
this
.
enabled
)
{
if
(
this
.
hasContent
()
&&
this
.
enabled
)
{
this
.
$element
.
trigger
(
e
)
this
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
if
(
e
.
isDefaultPrevented
())
return
$tip
=
this
.
tip
()
var
$tip
=
this
.
tip
()
this
.
setContent
()
this
.
setContent
()
if
(
this
.
options
.
animation
)
{
if
(
this
.
options
.
animation
)
$tip
.
addClass
(
'
fade
'
)
$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
.
call
(
this
,
$tip
[
0
],
this
.
$element
[
0
])
:
this
.
options
.
placement
this
.
options
.
placement
...
@@ -140,10 +147,10 @@
...
@@ -140,10 +147,10 @@
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
pos
=
this
.
getPosition
()
var
tp
var
pos
=
this
.
getPosition
()
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualWidth
=
$tip
[
0
].
offsetWidth
actualHeight
=
$tip
[
0
].
offsetHeight
var
actualHeight
=
$tip
[
0
].
offsetHeight
switch
(
placement
)
{
switch
(
placement
)
{
case
'
bottom
'
:
case
'
bottom
'
:
...
@@ -163,37 +170,34 @@
...
@@ -163,37 +170,34 @@
this
.
applyPlacement
(
tp
,
placement
)
this
.
applyPlacement
(
tp
,
placement
)
this
.
$element
.
trigger
(
'
shown
'
)
this
.
$element
.
trigger
(
'
shown
'
)
}
}
}
,
applyPlacement
:
function
(
offset
,
placement
)
{
Tooltip
.
prototype
.
applyPlacement
=
function
(
offset
,
placement
)
{
var
$tip
=
this
.
tip
()
var
$tip
=
this
.
tip
()
,
width
=
$tip
[
0
].
offsetWidth
var
width
=
$tip
[
0
].
offsetWidth
,
height
=
$tip
[
0
].
offsetHeight
var
height
=
$tip
[
0
].
offsetHeight
,
actualWidth
,
actualHeight
,
delta
,
replace
$tip
$tip
.
offset
(
offset
)
.
offset
(
offset
)
.
addClass
(
placement
)
.
addClass
(
placement
)
.
addClass
(
'
in
'
)
.
addClass
(
'
in
'
)
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualWidth
=
$tip
[
0
].
offsetWidth
actualHeight
=
$tip
[
0
].
offsetHeight
var
actualHeight
=
$tip
[
0
].
offsetHeight
if
(
placement
==
'
top
'
&&
actualHeight
!=
height
)
{
if
(
placement
==
'
top
'
&&
actualHeight
!=
height
)
{
var
replace
=
true
offset
.
top
=
offset
.
top
+
height
-
actualHeight
offset
.
top
=
offset
.
top
+
height
-
actualHeight
replace
=
true
}
}
if
(
placement
==
'
bottom
'
||
placement
==
'
top
'
)
{
if
(
placement
==
'
bottom
'
||
placement
==
'
top
'
)
{
delta
=
0
var
delta
=
0
if
(
offset
.
left
<
0
){
if
(
offset
.
left
<
0
){
delta
=
offset
.
left
*
-
2
delta
=
offset
.
left
*
-
2
offset
.
left
=
0
offset
.
left
=
0
$tip
.
offset
(
offset
)
$tip
.
offset
(
offset
)
actualWidth
=
$tip
[
0
].
offsetWidth
actualWidth
=
$tip
[
0
].
offsetWidth
actualHeight
=
$tip
[
0
].
offsetHeight
actualHeight
=
$tip
[
0
].
offsetHeight
}
}
...
@@ -206,26 +210,25 @@
...
@@ -206,26 +210,25 @@
if
(
replace
)
$tip
.
offset
(
offset
)
if
(
replace
)
$tip
.
offset
(
offset
)
}
}
,
replaceArrow
:
function
(
delta
,
dimension
,
position
){
Tooltip
.
prototype
.
replaceArrow
=
function
(
delta
,
dimension
,
position
){
this
this
.
arrow
().
css
(
position
,
delta
?
(
50
*
(
1
-
delta
/
dimension
)
+
"
%
"
)
:
''
)
.
arrow
()
.
css
(
position
,
delta
?
(
50
*
(
1
-
delta
/
dimension
)
+
"
%
"
)
:
''
)
}
}
,
setContent
:
function
()
{
Tooltip
.
prototype
.
setContent
=
function
()
{
var
$tip
=
this
.
tip
()
var
$tip
=
this
.
tip
()
,
title
=
this
.
getTitle
()
var
title
=
this
.
getTitle
()
$tip
.
find
(
'
.tooltip-inner
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
title
)
$tip
.
find
(
'
.tooltip-inner
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
title
)
$tip
.
removeClass
(
'
fade in top bottom left right
'
)
$tip
.
removeClass
(
'
fade in top bottom left right
'
)
}
}
,
hide
:
function
()
{
Tooltip
.
prototype
.
hide
=
function
()
{
var
that
=
this
var
that
=
this
,
$tip
=
this
.
tip
()
var
$tip
=
this
.
tip
()
,
e
=
$
.
Event
(
'
hide
'
)
var
e
=
$
.
Event
(
'
hide
'
)
this
.
$element
.
trigger
(
e
)
this
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
if
(
e
.
isDefaultPrevented
())
return
$tip
.
removeClass
(
'
in
'
)
$tip
.
removeClass
(
'
in
'
)
...
@@ -250,18 +253,18 @@
...
@@ -250,18 +253,18 @@
return
this
return
this
}
}
,
fixTitle
:
function
()
{
Tooltip
.
prototype
.
fixTitle
=
function
()
{
var
$e
=
this
.
$element
var
$e
=
this
.
$element
if
(
$e
.
attr
(
'
title
'
)
||
typeof
(
$e
.
attr
(
'
data-original-title
'
))
!=
'
string
'
)
{
if
(
$e
.
attr
(
'
title
'
)
||
typeof
(
$e
.
attr
(
'
data-original-title
'
))
!=
'
string
'
)
{
$e
.
attr
(
'
data-original-title
'
,
$e
.
attr
(
'
title
'
)
||
''
).
attr
(
'
title
'
,
''
)
$e
.
attr
(
'
data-original-title
'
,
$e
.
attr
(
'
title
'
)
||
''
).
attr
(
'
title
'
,
''
)
}
}
}
}
,
hasContent
:
function
()
{
Tooltip
.
prototype
.
hasContent
=
function
()
{
return
this
.
getTitle
()
return
this
.
getTitle
()
}
}
,
getPosition
:
function
()
{
Tooltip
.
prototype
.
getPosition
=
function
()
{
var
el
=
this
.
$element
[
0
]
var
el
=
this
.
$element
[
0
]
return
$
.
extend
({},
(
typeof
el
.
getBoundingClientRect
==
'
function
'
)
?
el
.
getBoundingClientRect
()
:
{
return
$
.
extend
({},
(
typeof
el
.
getBoundingClientRect
==
'
function
'
)
?
el
.
getBoundingClientRect
()
:
{
width
:
el
.
offsetWidth
width
:
el
.
offsetWidth
...
@@ -269,10 +272,10 @@
...
@@ -269,10 +272,10 @@
},
this
.
$element
.
offset
())
},
this
.
$element
.
offset
())
}
}
,
getTitle
:
function
()
{
Tooltip
.
prototype
.
getTitle
=
function
()
{
var
title
var
title
,
$e
=
this
.
$element
var
$e
=
this
.
$element
,
o
=
this
.
options
var
o
=
this
.
options
title
=
$e
.
attr
(
'
data-original-title
'
)
title
=
$e
.
attr
(
'
data-original-title
'
)
||
(
typeof
o
.
title
==
'
function
'
?
o
.
title
.
call
(
$e
[
0
])
:
o
.
title
)
||
(
typeof
o
.
title
==
'
function
'
?
o
.
title
.
call
(
$e
[
0
])
:
o
.
title
)
...
@@ -280,15 +283,15 @@
...
@@ -280,15 +283,15 @@
return
title
return
title
}
}
,
tip
:
function
()
{
Tooltip
.
prototype
.
tip
=
function
()
{
return
this
.
$tip
=
this
.
$tip
||
$
(
this
.
options
.
template
)
return
this
.
$tip
=
this
.
$tip
||
$
(
this
.
options
.
template
)
}
}
,
arrow
:
function
(){
Tooltip
.
prototype
.
arrow
=
function
(){
return
this
.
$arrow
=
this
.
$arrow
||
this
.
tip
().
find
(
"
.tooltip-arrow
"
)
return
this
.
$arrow
=
this
.
$arrow
||
this
.
tip
().
find
(
"
.tooltip-arrow
"
)
}
}
,
validate
:
function
()
{
Tooltip
.
prototype
.
validate
=
function
()
{
if
(
!
this
.
$element
[
0
].
parentNode
)
{
if
(
!
this
.
$element
[
0
].
parentNode
)
{
this
.
hide
()
this
.
hide
()
this
.
$element
=
null
this
.
$element
=
null
...
@@ -296,40 +299,39 @@
...
@@ -296,40 +299,39 @@
}
}
}
}
,
enable
:
function
()
{
Tooltip
.
prototype
.
enable
=
function
()
{
this
.
enabled
=
true
this
.
enabled
=
true
}
}
,
disable
:
function
()
{
Tooltip
.
prototype
.
disable
=
function
()
{
this
.
enabled
=
false
this
.
enabled
=
false
}
}
,
toggleEnabled
:
function
()
{
Tooltip
.
prototype
.
toggleEnabled
=
function
()
{
this
.
enabled
=
!
this
.
enabled
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
var
self
=
e
?
$
(
e
.
currentTarget
)[
this
.
type
](
this
.
_options
).
data
(
this
.
type
)
:
this
self
.
tip
().
hasClass
(
'
in
'
)
?
self
.
hide
()
:
self
.
show
()
self
.
tip
().
hasClass
(
'
in
'
)
?
self
.
hide
()
:
self
.
show
()
}
}
,
destroy
:
function
()
{
Tooltip
.
prototype
.
destroy
=
function
()
{
this
.
hide
().
$element
.
off
(
'
.
'
+
this
.
type
).
removeData
(
this
.
type
)
this
.
hide
().
$element
.
off
(
'
.
'
+
this
.
type
).
removeData
(
this
.
type
)
}
}
}
/*
TOOLTIP PLUGIN DEFINITION
//
TOOLTIP PLUGIN DEFINITION
* ========================= */
// =========================
var
old
=
$
.
fn
.
tooltip
var
old
=
$
.
fn
.
tooltip
$
.
fn
.
tooltip
=
function
(
option
)
{
$
.
fn
.
tooltip
=
function
(
option
)
{
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
tooltip
'
)
var
data
=
$this
.
data
(
'
tooltip
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
tooltip
'
,
(
data
=
new
Tooltip
(
this
,
options
)))
if
(
!
data
)
$this
.
data
(
'
tooltip
'
,
(
data
=
new
Tooltip
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
})
...
@@ -337,21 +339,9 @@
...
@@ -337,21 +339,9 @@
$
.
fn
.
tooltip
.
Constructor
=
Tooltip
$
.
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
.
noConflict
=
function
()
{
$
.
fn
.
tooltip
=
old
$
.
fn
.
tooltip
=
old
...
...
js/transition.js
View file @
149ecd21
...
@@ -18,33 +18,30 @@
...
@@ -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
()
{
function
transitionEnd
()
{
var
el
=
document
.
createElement
(
'
bootstrap
'
)
;
var
el
=
document
.
createElement
(
'
bootstrap
'
)
var
transEndEventNames
=
{
var
transEndEventNames
=
{
'
WebkitTransition
'
:
'
webkitTransitionEnd
'
'
WebkitTransition
'
:
'
webkitTransitionEnd
'
,
'
MozTransition
'
:
'
transitionend
'
,
'
MozTransition
'
:
'
transitionend
'
,
'
OTransition
'
:
'
oTransitionEnd otransitionend
'
,
'
OTransition
'
:
'
oTransitionEnd otransitionend
'
,
'
transition
'
:
'
transitionend
'
,
'
transition
'
:
'
transitionend
'
}
;
}
for
(
var
name
in
transEndEventNames
)
{
for
(
var
name
in
transEndEventNames
)
{
if
(
el
.
style
[
name
]
!==
undefined
)
{
if
(
el
.
style
[
name
]
!==
undefined
)
{
return
{
end
:
transEndEventNames
[
name
]
}
;
return
{
end
:
transEndEventNames
[
name
]
}
}
}
}
}
}
}
$
(
function
()
{
$
(
function
()
{
$
.
support
.
transition
=
transitionEnd
()
;
$
.
support
.
transition
=
transitionEnd
()
})
;
})
}(
window
.
jQuery
);
}(
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