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
a82ecaf2
Commit
a82ecaf2
authored
8 years ago
by
khawkins98
Browse files
Options
Downloads
Patches
Plain Diff
Masthead structure updates 2 of 2
Updates JS meta templating file for #49
parent
69c96315
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/script.js
+26
-26
26 additions, 26 deletions
js/script.js
with
26 additions
and
26 deletions
js/script.js
+
26
−
26
View file @
a82ecaf2
...
...
@@ -50,12 +50,12 @@
(
function
externalLinks
()
{
function
isOwnDomain
(
url
)
{
return
(
url
.
indexOf
(
'
//
'
)
===
-
1
||
url
.
indexOf
(
'
//www.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//wwwdev.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//www.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//wwwdev.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//srs.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//frontier.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//frontier.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//ftp.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//intranet.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//intranet.ebi.ac.uk
'
)
!==
-
1
||
url
.
indexOf
(
'
//pdbe.org
'
)
!==
-
1
||
url
.
indexOf
(
'
//
'
+
document
.
domain
)
!==
-
1
);
}
...
...
@@ -96,7 +96,7 @@
'
<div class="input-group-button">
'
+
'
<input type="submit" name="submit" value="Search" class="button">
'
+
'
<input type="hidden" name="db" value="allebi" checked="checked">
'
+
'
<input type="hidden" name="requestFrom" value="
global-
masthead" checked="checked">
'
+
'
<input type="hidden" name="requestFrom" value="masthead
-black-bar
" checked="checked">
'
+
'
</div>
'
+
'
</div>
'
+
'
</fieldset>
'
+
...
...
@@ -134,13 +134,13 @@
var
searchError
=
searchBoxes
[
searchBox
].
errorText
||
'
Please enter a search term
'
;
var
searchAction
=
(
searchForm
)
?
searchForm
.
action
:
''
;
var
isEbiSearch
=
searchAction
.
indexOf
(
'
/ebisearch/
'
)
!==
-
1
;
if
(
searchForm
&&
searchInput
&&
isEbiSearch
)
{
// add reference to other items for onsubmit anonymous function
searchForm
.
searchInput
=
searchInput
;
searchForm
.
searchInputDefault
=
searchInputDefault
;
searchForm
.
searchError
=
searchError
;
searchForm
.
onsubmit
=
function
()
{
searchInput
=
this
.
searchInput
;
searchInputDefault
=
this
.
searchInputDefault
;
...
...
@@ -148,7 +148,7 @@
// Ensure input is trimmed
searchInput
.
value
=
searchInput
.
value
.
trim
();
if
(
searchInput
.
value
===
searchInputDefault
||
searchInput
.
value
===
''
)
{
alert
(
searchError
);
return
false
;
...
...
@@ -161,15 +161,15 @@
}
catch
(
err
)
{}
})();
// Remove global-nav/global-nav-expanded from header/footer
// if body.no-global-nav is set
(
function
hideGlobalNav
()
{
try
{
var
hasGlobalMasthead
=
document
.
getElementById
(
'
global-
masthead
'
)
!==
null
;
var
hasGlobalMasthead
=
document
.
getElementById
(
'
masthead
-black-bar
'
)
!==
null
;
var
disabled
=
document
.
body
.
className
.
indexOf
(
'
no-global-nav
'
)
!==
-
1
;
var
elem
;
if
(
hasGlobalMasthead
&&
disabled
)
{
if
((
elem
=
document
.
getElementById
(
'
global-nav
'
))
!==
null
)
{
elem
.
parentNode
.
removeChild
(
elem
);
...
...
@@ -181,16 +181,16 @@
}
catch
(
err
)
{}
})();
// Tap the location bar to scroll to the top
// Disabled for v1.1 per https://github.com/ebiwd/EBI-Framework/issues/23
// (function scrollMeUp() {
// var
localM
asthead = document.getElementById('
local-
masthead');
//
localM
asthead.onclick = function(e){
// var
m
asthead = document.getElementById('masthead');
//
m
asthead.onclick = function(e){
// if (e.target.nodeName == 'A')
// return;
// // if jQuery then do it all pretty like
// if (window.jQuery) {
// if (window.jQuery) {
// $('html,body').animate({
// scrollTop: 0
// }, 700);
...
...
@@ -202,18 +202,18 @@
// Assign global nav background images through meta tags
(
function
assignImageByMetaTags
()
{
var
localM
asthead
=
document
.
getElementById
(
'
local-
masthead
'
);
var
m
asthead
=
document
.
getElementById
(
'
masthead
'
);
// check for both ebi: and ebi- formatted meta tags
var
localM
astheadColor
=
document
.
querySelector
(
"
meta[name='ebi:
local
masthead-color']
"
)
||
document
.
querySelector
(
"
meta[name='ebi-
local
masthead-color']
"
);
var
localM
astheadImage
=
document
.
querySelector
(
"
meta[name='ebi:
local
masthead-image']
"
)
||
document
.
querySelector
(
"
meta[name='ebi-
local
masthead-image']
"
);
var
m
astheadColor
=
document
.
querySelector
(
"
meta[name='ebi:masthead-color']
"
)
||
document
.
querySelector
(
"
meta[name='ebi-masthead-color']
"
);
var
m
astheadImage
=
document
.
querySelector
(
"
meta[name='ebi:masthead-image']
"
)
||
document
.
querySelector
(
"
meta[name='ebi-masthead-image']
"
);
if
(
localM
astheadColor
!=
null
)
{
localM
asthead
.
style
.
backgroundColor
=
localM
astheadColor
.
getAttribute
(
"
content
"
);
localM
asthead
.
className
+=
'
meta-background-color
'
;
if
(
m
astheadColor
!=
null
)
{
m
asthead
.
style
.
backgroundColor
=
m
astheadColor
.
getAttribute
(
"
content
"
);
m
asthead
.
className
+=
'
meta-background-color
'
;
}
if
(
localM
astheadImage
!=
null
)
{
localM
asthead
.
style
.
backgroundImage
=
'
url(
'
+
localM
astheadImage
.
getAttribute
(
"
content
"
)
+
'
)
'
;
localM
asthead
.
className
+=
'
meta-background-image
'
;
if
(
m
astheadImage
!=
null
)
{
m
asthead
.
style
.
backgroundImage
=
'
url(
'
+
m
astheadImage
.
getAttribute
(
"
content
"
)
+
'
)
'
;
m
asthead
.
className
+=
'
meta-background-image
'
;
}
})();
...
...
@@ -250,11 +250,11 @@
'
</div>
'
+
'
<p><a href="http://embl.org/" class="button readmore">Or learn more about EMBL</a></p>
'
+
'
</div>
'
;
document
.
getElementById
(
"
global-
masthead
"
).
appendChild
(
dropdownDiv
);
document
.
getElementById
(
"
masthead
-black-bar
"
).
appendChild
(
dropdownDiv
);
// We don't invoke the dropdown here, as that method depends on how you're using the Framework
}
catch
(
err
)
{};
})();
})();
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