Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBI-Framework
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ebiwd
EBI-Framework
Commits
fb4033b4
Commit
fb4033b4
authored
7 years ago
by
khawkins98
Browse files
Options
Downloads
Patches
Plain Diff
Update compiled
parent
a0cb0e2e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/foundationExtendEBI.min.js
+1
-1
1 addition, 1 deletion
js/foundationExtendEBI.min.js
with
1 addition
and
1 deletion
js/foundationExtendEBI.min.js
+
1
−
1
View file @
fb4033b4
function
ebiGaIndicateLoaded
(
numberOfEbiGaChecks
,
numberOfEbiGaChecksLimit
){
function
ebiGaCheck
(){
numberOfEbiGaChecks
++
;
try
{
ga
&&
ga
.
loaded
?(
jQuery
(
"
body
"
).
addClass
(
"
google-analytics-loaded
"
),
ebiGaInit
()):
numberOfEbiGaChecks
<=
numberOfEbiGaChecksLimit
&&
setTimeout
(
ebiGaCheck
,
900
)}
catch
(
err
){
numberOfEbiGaChecks
<=
numberOfEbiGaChecksLimit
&&
setTimeout
(
ebiGaCheck
,
900
)}}
ebiGaCheck
()}
function
analyticsTrackInteraction
(
actedOnItem
,
parentContainer
,
customEventName
){
if
((
customEventName
=
customEventName
||
[]).
length
>
0
)
linkName
=
customEventName
;
else
{
var
linkName
=
jQuery
(
actedOnItem
).
text
().
toString
();
0
==
linkName
.
length
&&
jQuery
(
actedOnItem
).
attr
(
"
src
"
)
&&
(
linkName
=
jQuery
(
actedOnItem
).
attr
(
"
src
"
).
split
(
"
/
"
).
ebiLast
()),
0
==
linkName
.
length
&&
jQuery
(
actedOnItem
).
val
()
&&
(
linkName
=
jQuery
(
actedOnItem
).
val
()),
"
Global search
"
==
parentContainer
&&
(
linkName
=
"
query:
"
+
jQuery
(
"
#global-search input#query
"
).
val
())}
Date
.
now
()
-
lastGaEventTime
>
150
&&
(
ga
&&
ga
(
"
send
"
,
"
event
"
,
"
UI
"
,
"
UI Element /
"
+
parentContainer
,
linkName
),
lastGaEventTime
=
Date
.
now
(),
jQuery
(
"
body
"
).
hasClass
(
"
verbose-analytics
"
)
&&
(
console
.
log
(
"
%c Verbose analytics on
"
,
"
color: #FFF; background: #111; font-size: .75rem;
"
),
console
.
log
(
"
clicked on: %o
"
,
actedOnItem
),
console
.
log
(
"
sent to GA:
"
,
"
event ->
"
,
"
UI ->
"
,
"
UI Element /
"
+
parentContainer
+
"
->
"
,
linkName
,
"
; at:
"
,
lastGaEventTime
)))}
function
ebiGaInit
(){
jQuery
(
"
body.google-analytics-loaded .track-with-analytics-events a
"
).
on
(
"
mousedown
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Manually tracked area
"
)}),
jQuery
(
"
body.google-analytics-loaded .masthead-black-bar
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Black bar
"
)}),
jQuery
(
"
body.google-analytics-loaded .masthead
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Masthead
"
)}),
jQuery
(
"
body.google-analytics-loaded .related ul
"
).
on
(
"
mousedown
"
,
"
li > a
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Popular
"
)}),
jQuery
(
"
body.google-analytics-loaded .with-overlay
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Highlight box
"
)}),
jQuery
(
"
body.google-analytics-loaded #global-footer
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Footer
"
)}),
jQuery
(
"
body.google-analytics-loaded #global-search
"
).
on
(
"
mousedown
"
,
"
input
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Global search
"
)}),
jQuery
(
"
body.google-analytics-loaded #local-search
"
).
on
(
"
mousedown
"
,
"
input
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Local search
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-intro, body.google-analytics-loaded .intro-unit
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Intro
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-sidebar
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Sidebar
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-left
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Left content
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-right
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Right content
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-footer
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Content footer
"
)}),
jQuery
(
"
body.google-analytics-loaded #main-content-area, body.google-analytics-loaded .analytics-content-main
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Main content
"
)});
var
keydown
=
null
;
jQuery
(
"
body
"
).
hasClass
(
"
google-analytics-loaded
"
)
&&
jQuery
(
window
).
keydown
(
function
(
e
){
return
(
70
==
e
.
keyCode
&&
(
e
.
ctrlKey
||
e
.
metaKey
)
||
191
==
e
.
keyCode
)
&&
(
keydown
=
(
new
Date
).
getTime
()),
!
0
}).
blur
(
function
(){
if
(
null
!==
keydown
){
var
delta
=
(
new
Date
).
getTime
()
-
keydown
;
delta
>
0
&&
delta
<
1
e3
&&
ga
&&
ga
(
"
send
"
,
"
event
"
,
"
UI
"
,
"
UI Element / Keyboard
"
,
"
Browser in page search
"
),
keydown
=
null
}})}
function
addBlankTargetToExternalLinkEBI
(
parent
){
!
function
(
$
){
var
parent
=
parent
||
"
#content
"
;
$
(
parent
+
"
a
"
).
filter
(
function
(){
return
this
.
hostname
&&
this
.
hostname
!==
location
.
hostname
}).
attr
(
"
target
"
,
"
_blank
"
)}(
jQuery
)}
function
addExternalToBlankWindowLinksEBI
(
parent
){
!
function
(
$
){
var
parent
=
parent
||
"
#content
"
;
$
(
parent
+
'
a[target="_blank"]
'
).
addClass
(
"
external
"
)}(
jQuery
)}
function
activateEMBLdropdown
(
options
){
!
function
(
$
){
var
options
=
options
||
""
,
dropDownOptions
=
{
closeOnClick
:
!
0
};
if
(
"
reInit
"
==
options
){
try
{
$
(
"
#embl-dropdown
"
).
foundation
(
"
close
"
),
$
(
"
#embl-dropdown
"
).
foundation
(
"
destroy
"
)}
catch
(
err
){}
ebiFrameworkInsertEMBLdropdown
(),
activateEMBLdropdown
()}
else
setTimeout
(
function
(){
try
{
new
Foundation
.
Dropdown
(
$
(
"
#embl-dropdown
"
),
dropDownOptions
)}
catch
(
err
){}},
200
)}(
jQuery
)}
function
smoothScrollAnchorLinksEBI
(){
!
function
(
$
){
$
(
"
a[href*=
\\
#]:not([href=
\\
#])
"
).
on
(
"
click
"
,
function
(){
if
(
$
(
this
).
parent
().
parent
().
hasClass
(
"
tabs
"
))
return
!
0
;
if
(
location
.
pathname
.
replace
(
/^
\/
/
,
""
)
==
this
.
pathname
.
replace
(
/^
\/
/
,
""
)
&&
location
.
hostname
==
this
.
hostname
){
var
target
=
$
(
this
.
hash
),
targetName
=
this
.
hash
;
if
((
target
=
target
.
length
?
target
:
$
(
"
[name=
"
+
this
.
hash
.
slice
(
1
)
+
"
]
"
)).
length
)
return
$
(
"
html,body
"
).
animate
({
scrollTop
:
target
.
offset
().
top
-
40
},{
duration
:
1
e3
,
complete
:
function
(){
window
.
location
.
hash
=
targetName
}}),
!
1
}})}(
jQuery
)}
function
invokeResponsiveMenuEBI
(){
!
function
(
$
){
var
desiredStuckMenuHeight
=
$
(
"
.masthead-inner
"
).
outerHeight
()
-
$
(
"
.masthead-inner > nav > ul.menu
"
).
outerHeight
();
$
(
"
<style id='dynamic-stuck-height' type='text/css'> .masthead.sticky.is-stuck{ margin-top: -
"
+
desiredStuckMenuHeight
+
"
px !important;} </style>
"
).
appendTo
(
"
body
"
);
var
localMenuClass
=
"
.masthead-inner > nav > ul.dropdown.menu.float-left
"
;
if
(
$
(
localMenuClass
).
length
>
0
){
var
localMenuLeftPadding
=
parseInt
(
$
(
"
.masthead-inner > nav ul
"
).
css
(
"
padding-left
"
)),
localMenuWidthAvail
=
$
(
"
.masthead-inner > nav
"
).
innerWidth
()
-
localMenuLeftPadding
;
function
localNavSpilloverMenu
(
changeDirection
){
var
localMenuWidthUsed
=
0
,
localMenuRightSideWidth
=
$
(
"
.masthead-inner > nav ul.float-right.menu
"
).
outerWidth
();
if
(
localMenuRightSideWidth
+=
1
,
$
(
localMenuClass
+
'
> li:not(".bug-fix-placeholder")
'
).
each
(
function
(){
localMenuWidthUsed
+=
$
(
this
).
outerWidth
()}),
localMenuWidthUsed
+=
localMenuRightSideWidth
,
0
==
$
(
localMenuClass
+
"
li.extra-items-menu
"
).
length
){
$
(
localMenuClass
).
append
(
'
<li class="extra-items-menu" style="display:none;"><a href="#">Also in this section</a><ul class="menu"><li class="bug-fix-placeholder" style="display:none !important;"><a href="#">A workaround</a> <ul class="menu"> <li><a href="#">for a bug where the dropdown menu fails sometimes unless there are two submenus in the submenu</a></li></ul> </li></ul></li>
'
),
localMenuWidthUsed
+=
$
(
localMenuClass
+
"
> li.extra-items-menu
"
).
outerWidth
();
var
options
=
{
closeOnClickInside
:
!
1
,
closeOnClick
:
!
1
};
new
Foundation
.
DropdownMenu
(
$
(
localMenuClass
),
options
)}
if
(
"
init
"
!=
changeDirection
&&
"
decrease
"
!=
changeDirection
||
localMenuWidthUsed
>
localMenuWidthAvail
&&
(
0
==
$
(
localMenuClass
+
"
li.extra-items-menu:visible
"
).
length
&&
$
(
localMenuClass
+
"
li.extra-items-menu
"
).
show
(),
$
(
$
(
localMenuClass
+
"
> li
"
).
get
().
reverse
().
slice
(
1
)).
each
(
function
(){
localMenuWidthUsed
>
localMenuWidthAvail
&&
(
localMenuWidthUsed
-=
$
(
this
).
outerWidth
(),
$
(
this
).
detach
().
prependTo
(
localMenuClass
+
"
> li.extra-items-menu > ul.menu
"
))})),
"
increase
"
==
changeDirection
&&
1
==
$
(
localMenuClass
+
"
li.extra-items-menu:visible
"
).
length
)
for
(
var
spaceToWorkWith
=
localMenuWidthAvail
-
localMenuWidthUsed
,
spaceRequiredForFirstHiddenChild
=
$
(
localMenuClass
+
"
> li.extra-items-menu > ul.menu > li:first-child
"
).
outerWidth
();
spaceToWorkWith
>
spaceRequiredForFirstHiddenChild
;)
if
(
spaceToWorkWith
-=
spaceRequiredForFirstHiddenChild
,
$
(
localMenuClass
+
"
> li.extra-items-menu > ul.menu > li:first-child
"
).
detach
().
insertBefore
(
localMenuClass
+
"
li.extra-items-menu
"
),
0
==
$
(
localMenuClass
+
'
> li.extra-items-menu > ul.menu > li:not(".bug-fix-placeholder")
'
).
length
){
$
(
localMenuClass
+
"
li.extra-items-menu
"
).
hide
();
break
}}
localNavSpilloverMenu
(
"
init
"
),
$
(
window
).
resize
(
function
(){
var
snapshot_localMenuWidthAvail
=
$
(
"
.masthead-inner > nav
"
).
innerWidth
(),
widthChangeAmount
=
snapshot_localMenuWidthAvail
-
localMenuWidthAvail
;
0
!=
widthChangeAmount
&&
(
localMenuWidthAvail
=
snapshot_localMenuWidthAvail
),
widthChangeAmount
>
1
&&
localNavSpilloverMenu
(
"
increase
"
),
widthChangeAmount
<-
1
&&
localNavSpilloverMenu
(
"
decrease
"
)})}}(
jQuery
)}
ebiGaIndicateLoaded
(
0
,
2
),
Array
.
prototype
.
ebiLast
||
(
Array
.
prototype
.
ebiLast
=
function
(){
return
this
[
this
.
length
-
1
]});
var
lastGaEventTime
=
Date
.
now
();
!
function
(
$
){
function
tog
(
v
){
return
v
?
"
addClass
"
:
"
removeClass
"
}
$
(
document
).
on
(
"
input
"
,
"
.clearable
"
,
function
(){
$
(
this
)[
tog
(
this
.
value
)](
"
x
"
)}).
on
(
"
mousemove
"
,
"
.x
"
,
function
(
e
){
$
(
this
)[
tog
(
this
.
offsetWidth
-
25
<
e
.
clientX
-
this
.
getBoundingClientRect
().
left
)](
"
onX
"
)}).
on
(
"
touchstart click
"
,
"
.onX
"
,
function
(
ev
){
ev
.
preventDefault
(),
$
(
this
).
removeClass
(
"
x onX
"
).
val
(
""
).
change
().
keyup
()}),
$
.
fn
.
foundationExtendEBI
=
function
(){
activateEMBLdropdown
(),
smoothScrollAnchorLinksEBI
(),
invokeResponsiveMenuEBI
(),
$
(
'
a[data-toggle="search-global-dropdown"]
'
).
click
(
function
(){
$
(
this
).
is
(
"
:not(.hover)
"
)
&&
setTimeout
(
function
(){
$
(
"
input#global-searchbox
"
).
focus
()},
100
)}),
$
(
"
.with-overlay
"
).
on
(
"
click
"
,
function
(
e
){
var
href
=
$
(
this
).
find
(
"
a:first
"
).
attr
(
"
href
"
)
||
""
;
href
.
length
>
0
&&
(
window
.
location
.
href
=
href
)}),
$
(
"
table.responsive-table
"
).
each
(
function
(){
for
(
var
columnsToAppend
=
$
(
this
).
find
(
"
th
"
),
i
=
0
;
i
<
columnsToAppend
.
length
;
i
++
)
if
(
$
(
columnsToAppend
[
i
]).
attr
(
"
class
"
)){
var
position
=
i
+
1
;
$
(
this
).
find
(
"
td:nth-child(
"
+
position
+
"
)
"
).
addClass
(
$
(
columnsToAppend
[
i
]).
attr
(
"
class
"
))}})};
var
bodyData
=
$
(
"
body
"
).
data
();
bodyData
.
foundationInvoke
&&
(
bodyData
.
foundationInvoke
=
bodyData
.
foundationInvoke
||
"
document
"
,
"
true
"
===
bodyData
.
foundationInvoke
&&
(
bodyData
.
foundationInvoke
=
"
document
"
),
$
(
bodyData
.
foundationInvoke
).
foundation
()),
bodyData
.
foundationExtendEBI
&&
(
bodyData
.
foundationExtendEBI
=
bodyData
.
foundationExtendEBI
||
"
document
"
,
"
true
"
===
bodyData
.
foundationExtendEBI
&&
(
bodyData
.
foundationExtendEBI
=
"
document
"
),
$
(
bodyData
.
foundationExtendEBI
).
foundationExtendEBI
()),
bodyData
.
addExternal
&&
(
addBlankTargetToExternalLinkEBI
(),
addExternalToBlankWindowLinksEBI
())}(
jQuery
);
\ No newline at end of file
function
ebiGaIndicateLoaded
(
numberOfEbiGaChecks
,
numberOfEbiGaChecksLimit
){
function
ebiGaCheck
(){
numberOfEbiGaChecks
++
;
try
{
ga
&&
ga
.
loaded
?(
jQuery
(
"
body
"
).
addClass
(
"
google-analytics-loaded
"
),
ebiGaInit
()):
numberOfEbiGaChecks
<=
numberOfEbiGaChecksLimit
&&
setTimeout
(
ebiGaCheck
,
900
)}
catch
(
err
){
numberOfEbiGaChecks
<=
numberOfEbiGaChecksLimit
&&
setTimeout
(
ebiGaCheck
,
900
)}}
ebiGaCheck
()}
function
analyticsTrackInteraction
(
actedOnItem
,
parentContainer
,
customEventName
){
if
((
customEventName
=
customEventName
||
[]).
length
>
0
)
linkName
=
customEventName
;
else
{
var
linkName
=
jQuery
(
actedOnItem
).
text
().
toString
();
0
==
linkName
.
length
&&
jQuery
(
actedOnItem
).
attr
(
"
src
"
)
&&
(
linkName
=
jQuery
(
actedOnItem
).
attr
(
"
src
"
).
split
(
"
/
"
).
ebiLast
()),
0
==
linkName
.
length
&&
jQuery
(
actedOnItem
).
val
()
&&
(
linkName
=
jQuery
(
actedOnItem
).
val
()),
"
Global search
"
==
parentContainer
&&
(
linkName
=
"
query:
"
+
jQuery
(
"
#global-search input#query
"
).
val
())}
Date
.
now
()
-
lastGaEventTime
>
150
&&
(
ga
&&
ga
(
"
send
"
,
"
event
"
,
"
UI
"
,
"
UI Element /
"
+
parentContainer
,
linkName
),
lastGaEventTime
=
Date
.
now
(),
jQuery
(
"
body
"
).
hasClass
(
"
verbose-analytics
"
)
&&
(
console
.
log
(
"
%c Verbose analytics on
"
,
"
color: #FFF; background: #111; font-size: .75rem;
"
),
console
.
log
(
"
clicked on: %o
"
,
actedOnItem
),
console
.
log
(
"
sent to GA:
"
,
"
event ->
"
,
"
UI ->
"
,
"
UI Element /
"
+
parentContainer
+
"
->
"
,
linkName
,
"
; at:
"
,
lastGaEventTime
)))}
function
ebiGaInit
(){
jQuery
(
"
body.google-analytics-loaded .track-with-analytics-events a
"
).
on
(
"
mousedown
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Manually tracked area
"
)}),
jQuery
(
"
body.google-analytics-loaded .masthead-black-bar
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Black bar
"
)}),
jQuery
(
"
body.google-analytics-loaded .masthead
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Masthead
"
)}),
jQuery
(
"
body.google-analytics-loaded .related ul
"
).
on
(
"
mousedown
"
,
"
li > a
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Popular
"
)}),
jQuery
(
"
body.google-analytics-loaded .with-overlay
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Highlight box
"
)}),
jQuery
(
"
body.google-analytics-loaded #global-footer
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Footer
"
)}),
jQuery
(
"
body.google-analytics-loaded #global-search
"
).
on
(
"
mousedown
"
,
"
input
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Global search
"
)}),
jQuery
(
"
body.google-analytics-loaded #local-search
"
).
on
(
"
mousedown
"
,
"
input
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Local search
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-intro, body.google-analytics-loaded .intro-unit
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Intro
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-sidebar
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Sidebar
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-left
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Left content
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-right
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Right content
"
)}),
jQuery
(
"
body.google-analytics-loaded .analytics-content-footer
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Content footer
"
)}),
jQuery
(
"
body.google-analytics-loaded #main-content-area, body.google-analytics-loaded .analytics-content-main
"
).
on
(
"
mousedown
"
,
"
a, button
"
,
function
(
e
){
analyticsTrackInteraction
(
e
.
target
,
"
Main content
"
)});
var
keydown
=
null
;
jQuery
(
"
body
"
).
hasClass
(
"
google-analytics-loaded
"
)
&&
jQuery
(
window
).
keydown
(
function
(
e
){
return
(
70
==
e
.
keyCode
&&
(
e
.
ctrlKey
||
e
.
metaKey
)
||
191
==
e
.
keyCode
)
&&
(
keydown
=
(
new
Date
).
getTime
()),
!
0
}).
blur
(
function
(){
if
(
null
!==
keydown
){
var
delta
=
(
new
Date
).
getTime
()
-
keydown
;
delta
>
0
&&
delta
<
1
e3
&&
ga
&&
ga
(
"
send
"
,
"
event
"
,
"
UI
"
,
"
UI Element / Keyboard
"
,
"
Browser in page search
"
),
keydown
=
null
}})}
function
addBlankTargetToExternalLinkEBI
(
parent
){
!
function
(
$
){
var
parent
=
parent
||
"
#content
"
;
$
(
parent
+
"
a
"
).
filter
(
function
(){
return
this
.
hostname
&&
this
.
hostname
!==
location
.
hostname
}).
attr
(
"
target
"
,
"
_blank
"
)}(
jQuery
)}
function
addExternalToBlankWindowLinksEBI
(
parent
){
!
function
(
$
){
var
parent
=
parent
||
"
#content
"
;
$
(
parent
+
'
a[target="_blank"]
'
).
addClass
(
"
external
"
)}(
jQuery
)}
function
activateEMBLdropdown
(
options
){
!
function
(
$
){
var
options
=
options
||
""
,
dropDownOptions
=
{
closeOnClick
:
!
0
};
if
(
"
reInit
"
==
options
){
try
{
$
(
"
#embl-dropdown
"
).
foundation
(
"
close
"
),
$
(
"
#embl-dropdown
"
).
foundation
(
"
destroy
"
)}
catch
(
err
){}
ebiFrameworkInsertEMBLdropdown
(),
activateEMBLdropdown
()}
else
setTimeout
(
function
(){
try
{
new
Foundation
.
Dropdown
(
$
(
"
#embl-dropdown
"
),
dropDownOptions
)}
catch
(
err
){}},
200
)}(
jQuery
)}
function
smoothScrollAnchorLinksEBI
(){
!
function
(
$
){
function
ebiSmoothScroll
(
hash
){
var
target
=
$
(
hash
),
targetName
=
hash
;
if
((
target
=
target
.
length
?
target
:
$
(
"
[name=
"
+
targetName
.
slice
(
1
)
+
"
]
"
)).
length
)
return
$
(
"
html,body
"
).
animate
({
scrollTop
:
target
.
offset
().
top
-
50
},{
duration
:
1
e3
,
complete
:
function
(){
window
.
location
.
hash
=
targetName
}}),
!
1
}
window
.
location
.
hash
.
length
>
0
&&
ebiSmoothScroll
(
window
.
location
.
hash
),
$
(
"
a[href*=
\\
#]:not([href=
\\
#])
"
).
on
(
"
click
"
,
function
(){
if
(
$
(
this
).
parent
().
parent
().
hasClass
(
"
tabs
"
))
return
!
0
;
location
.
pathname
.
replace
(
/^
\/
/
,
""
)
==
this
.
pathname
.
replace
(
/^
\/
/
,
""
)
&&
location
.
hostname
==
this
.
hostname
&&
ebiSmoothScroll
(
this
.
hash
)})}(
jQuery
)}
function
invokeResponsiveMenuEBI
(){
!
function
(
$
){
var
desiredStuckMenuHeight
=
$
(
"
.masthead-inner
"
).
outerHeight
()
-
$
(
"
.masthead-inner > nav > ul.menu
"
).
outerHeight
();
$
(
"
<style id='dynamic-stuck-height' type='text/css'> .masthead.sticky.is-stuck{ margin-top: -
"
+
desiredStuckMenuHeight
+
"
px !important;} </style>
"
).
appendTo
(
"
body
"
);
var
localMenuClass
=
"
.masthead-inner > nav > ul.dropdown.menu.float-left
"
;
if
(
$
(
localMenuClass
).
length
>
0
){
var
localMenuLeftPadding
=
parseInt
(
$
(
"
.masthead-inner > nav ul
"
).
css
(
"
padding-left
"
)),
localMenuWidthAvail
=
$
(
"
.masthead-inner > nav
"
).
innerWidth
()
-
localMenuLeftPadding
;
function
localNavSpilloverMenu
(
changeDirection
){
var
localMenuWidthUsed
=
0
,
localMenuRightSideWidth
=
$
(
"
.masthead-inner > nav ul.float-right.menu
"
).
outerWidth
();
if
(
localMenuRightSideWidth
+=
1
,
$
(
localMenuClass
+
'
> li:not(".bug-fix-placeholder")
'
).
each
(
function
(){
localMenuWidthUsed
+=
$
(
this
).
outerWidth
()}),
localMenuWidthUsed
+=
localMenuRightSideWidth
,
0
==
$
(
localMenuClass
+
"
li.extra-items-menu
"
).
length
){
$
(
localMenuClass
).
append
(
'
<li class="extra-items-menu" style="display:none;"><a href="#">Also in this section</a><ul class="menu"><li class="bug-fix-placeholder" style="display:none !important;"><a href="#">A workaround</a> <ul class="menu"> <li><a href="#">for a bug where the dropdown menu fails sometimes unless there are two submenus in the submenu</a></li></ul> </li></ul></li>
'
),
localMenuWidthUsed
+=
$
(
localMenuClass
+
"
> li.extra-items-menu
"
).
outerWidth
();
var
options
=
{
closeOnClickInside
:
!
1
,
closeOnClick
:
!
1
};
new
Foundation
.
DropdownMenu
(
$
(
localMenuClass
),
options
)}
if
(
"
init
"
!=
changeDirection
&&
"
decrease
"
!=
changeDirection
||
localMenuWidthUsed
>
localMenuWidthAvail
&&
(
0
==
$
(
localMenuClass
+
"
li.extra-items-menu:visible
"
).
length
&&
$
(
localMenuClass
+
"
li.extra-items-menu
"
).
show
(),
$
(
$
(
localMenuClass
+
"
> li
"
).
get
().
reverse
().
slice
(
1
)).
each
(
function
(){
localMenuWidthUsed
>
localMenuWidthAvail
&&
(
localMenuWidthUsed
-=
$
(
this
).
outerWidth
(),
$
(
this
).
detach
().
prependTo
(
localMenuClass
+
"
> li.extra-items-menu > ul.menu
"
))})),
"
increase
"
==
changeDirection
&&
1
==
$
(
localMenuClass
+
"
li.extra-items-menu:visible
"
).
length
)
for
(
var
spaceToWorkWith
=
localMenuWidthAvail
-
localMenuWidthUsed
,
spaceRequiredForFirstHiddenChild
=
$
(
localMenuClass
+
"
> li.extra-items-menu > ul.menu > li:first-child
"
).
outerWidth
();
spaceToWorkWith
>
spaceRequiredForFirstHiddenChild
;)
if
(
spaceToWorkWith
-=
spaceRequiredForFirstHiddenChild
,
$
(
localMenuClass
+
"
> li.extra-items-menu > ul.menu > li:first-child
"
).
detach
().
insertBefore
(
localMenuClass
+
"
li.extra-items-menu
"
),
0
==
$
(
localMenuClass
+
'
> li.extra-items-menu > ul.menu > li:not(".bug-fix-placeholder")
'
).
length
){
$
(
localMenuClass
+
"
li.extra-items-menu
"
).
hide
();
break
}}
localNavSpilloverMenu
(
"
init
"
),
$
(
window
).
resize
(
function
(){
var
snapshot_localMenuWidthAvail
=
$
(
"
.masthead-inner > nav
"
).
innerWidth
(),
widthChangeAmount
=
snapshot_localMenuWidthAvail
-
localMenuWidthAvail
;
0
!=
widthChangeAmount
&&
(
localMenuWidthAvail
=
snapshot_localMenuWidthAvail
),
widthChangeAmount
>
1
&&
localNavSpilloverMenu
(
"
increase
"
),
widthChangeAmount
<-
1
&&
localNavSpilloverMenu
(
"
decrease
"
)})}}(
jQuery
)}
ebiGaIndicateLoaded
(
0
,
2
),
Array
.
prototype
.
ebiLast
||
(
Array
.
prototype
.
ebiLast
=
function
(){
return
this
[
this
.
length
-
1
]});
var
lastGaEventTime
=
Date
.
now
();
!
function
(
$
){
function
tog
(
v
){
return
v
?
"
addClass
"
:
"
removeClass
"
}
$
(
document
).
on
(
"
input
"
,
"
.clearable
"
,
function
(){
$
(
this
)[
tog
(
this
.
value
)](
"
x
"
)}).
on
(
"
mousemove
"
,
"
.x
"
,
function
(
e
){
$
(
this
)[
tog
(
this
.
offsetWidth
-
25
<
e
.
clientX
-
this
.
getBoundingClientRect
().
left
)](
"
onX
"
)}).
on
(
"
touchstart click
"
,
"
.onX
"
,
function
(
ev
){
ev
.
preventDefault
(),
$
(
this
).
removeClass
(
"
x onX
"
).
val
(
""
).
change
().
keyup
()}),
$
.
fn
.
foundationExtendEBI
=
function
(){
activateEMBLdropdown
(),
smoothScrollAnchorLinksEBI
(),
invokeResponsiveMenuEBI
(),
$
(
'
a[data-toggle="search-global-dropdown"]
'
).
click
(
function
(){
$
(
this
).
is
(
"
:not(.hover)
"
)
&&
setTimeout
(
function
(){
$
(
"
input#global-searchbox
"
).
focus
()},
100
)}),
$
(
"
.with-overlay
"
).
on
(
"
click
"
,
function
(
e
){
var
href
=
$
(
this
).
find
(
"
a:first
"
).
attr
(
"
href
"
)
||
""
;
href
.
length
>
0
&&
(
window
.
location
.
href
=
href
)}),
$
(
"
table.responsive-table
"
).
each
(
function
(){
for
(
var
columnsToAppend
=
$
(
this
).
find
(
"
th
"
),
i
=
0
;
i
<
columnsToAppend
.
length
;
i
++
)
if
(
$
(
columnsToAppend
[
i
]).
attr
(
"
class
"
)){
var
position
=
i
+
1
;
$
(
this
).
find
(
"
td:nth-child(
"
+
position
+
"
)
"
).
addClass
(
$
(
columnsToAppend
[
i
]).
attr
(
"
class
"
))}})};
var
bodyData
=
$
(
"
body
"
).
data
();
bodyData
.
foundationInvoke
&&
(
bodyData
.
foundationInvoke
=
bodyData
.
foundationInvoke
||
"
document
"
,
"
true
"
===
bodyData
.
foundationInvoke
&&
(
bodyData
.
foundationInvoke
=
"
document
"
),
$
(
bodyData
.
foundationInvoke
).
foundation
()),
bodyData
.
foundationExtendEBI
&&
(
bodyData
.
foundationExtendEBI
=
bodyData
.
foundationExtendEBI
||
"
document
"
,
"
true
"
===
bodyData
.
foundationExtendEBI
&&
(
bodyData
.
foundationExtendEBI
=
"
document
"
),
$
(
bodyData
.
foundationExtendEBI
).
foundationExtendEBI
()),
bodyData
.
addExternal
&&
(
addBlankTargetToExternalLinkEBI
(),
addExternalToBlankWindowLinksEBI
())}(
jQuery
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment