diff --git a/index.html b/index.html index bfbf9c745d312b70db43510a4ba4d8b162c87178..88f4d95ef18e342ff1dcd1c37fc189cdd4917b2f 100755 --- a/index.html +++ b/index.html @@ -237,8 +237,6 @@ <script defer="defer" src="//www.ebi.ac.uk/web_guidelines/js/plugins.js"></script> <script defer="defer" src="//www.ebi.ac.uk/web_guidelines/js/script.js"></script> --> - <script defer="defer" src="js/cookiebanner.js"></script> - <script defer="defer" src="js/foot.js"></script> <script defer="defer" src="js/script.js"></script> <!-- The Foundation theme JavaScript --> diff --git a/js/cookiebanner.js b/js/cookiebanner.js deleted file mode 100644 index 92d203881335f3f14de7d48aed2b0f8d21d2b9ba..0000000000000000000000000000000000000000 --- a/js/cookiebanner.js +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) EMBL-EBI 2016; Authors: Peter Walter, Ken Hawkins */ - -(function cookieBanner() { - function setCookie(c_name, value, exdays) { - var exdate = new Date(); - var c_value; - exdate.setDate(exdate.getDate() + exdays); - c_value = escape(value) + ((exdays===null) ? "" : ";expires=" + exdate.toUTCString()) + ";domain=.ebi.ac.uk;path=/"; - document.cookie = c_name + "=" + c_value; - c_value = escape(value) + ((exdays===null) ? "" : ";expires=" + exdate.toUTCString()) + ";domain=" + document.domain + ";path=/"; - document.cookie = c_name + "=" + c_value; - } - - function getCookie(c_name) { - var i, x, y, ARRcookies=document.cookie.split(";"); - for (i=0; i<ARRcookies.length; i++) - { - x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); - y = ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); - x = x.replace(/^\s+|\s+$/g,""); - if (x===c_name) { - return unescape(y); - } - } - } - - function createStyles() { - var head = document.head || document.getElementsByTagName('head')[0]; - var style = document.createElement('style'); - - style.type = 'text/css'; - var css = "" + - " #cookie-banner {position:fixed;background-color:#111;width:100%;padding:.75rem;left:0;bottom:0;color:#eee;}" + - " #cookie-banner a {color:#fff;}" + - " .text {margin-right:2em;}"; - - if (style.styleSheet){ - style.styleSheet.cssText = css; - } else { - style.appendChild(document.createTextNode(css)); - } - - head.appendChild(style); - } - - function createBanner() { - var banner = document.createElement('div'); - var wrapper = document.createElement('div'); - var inner = document.createElement('div'); - - banner.id = "cookie-banner"; - wrapper.className = "row"; - wrapper.innerHTML = "" + - " <div class='text'>This website uses cookies. By continuing to browse this site, you are agreeing to the use of our site cookies. " + - " To find out more, see our <a href='//www.ebi.ac.uk/about/terms-of-use'>Terms of Use</a>.</div>" + - " <div id='cookie-dismiss'> <button class='close-button' style='top: 0.3rem; color:#fff;' aria-label='Close alert' type='button'><span aria-hidden='true'>×</span></button></div>" + - ""; - - document.body.appendChild(banner); - banner.appendChild(wrapper); - } - - function openBanner() { - var height = document.getElementById('cookie-banner').offsetHeight; - document.getElementById('cookie-banner').style.display = 'block'; - document.body.style.paddingBottom = height+'px'; - } - - function closeBanner() { - var height = document.getElementById('cookie-banner').offsetHeight; - document.getElementById('cookie-banner').style.display = 'none'; - document.body.style.paddingBottom = '0'; - } - - function init() { - try { - if (getCookie('cookies-accepted') !== 'true') { - createStyles(); - createBanner(); - openBanner(); - - setCookie('cookies-accepted', 'true', 90); // show cookie message only once - - document.getElementById('cookie-dismiss').onclick = function() { - closeBanner(); - return false; - }; - } - } - catch(err) { - setTimeout(init, 100); - } - } - - init(); - -})(); diff --git a/js/fontpresentation.js b/js/fontpresentation.js deleted file mode 100644 index 7afff9ad265fc93e7aa1b954a9c8fb140613cbbd..0000000000000000000000000000000000000000 --- a/js/fontpresentation.js +++ /dev/null @@ -1 +0,0 @@ -// Removed \ No newline at end of file diff --git a/js/foot.js b/js/foot.js deleted file mode 100644 index 0c972cfb34194e08064e5f99bae4962c432398ce..0000000000000000000000000000000000000000 --- a/js/foot.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) EMBL-EBI 2015 - */ -(function updateFoot() { - var html = '' + '<div class="columns small-6 medium-2 "> ' + ' <a href="//www.ebi.ac.uk" title="EMBL-EBI"><span class="ebi-logo"></span></a> ' + ' <ul> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="services"><a class="services-color" href="//www.ebi.ac.uk/services">Services</a></h5> ' + ' <ul> ' + ' <li class="first"><a href="//www.ebi.ac.uk/services">By topic</a></li> ' + ' <li><a href="//www.ebi.ac.uk/services/all">By name (A-Z)</a></li> ' + ' <li class="last"><a href="//www.ebi.ac.uk/support">Help & Support</a></li> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="research"><a class="research-color" href="//www.ebi.ac.uk/research">Research</a></h5> ' + ' <ul> ' + ' <li><a href="//www.ebi.ac.uk/research/publications">Publications</a></li> ' + ' <li><a href="//www.ebi.ac.uk/research/groups">Research groups</a></li> ' + ' <li class="last"><a href="//www.ebi.ac.uk/research/postdocs">Postdocs</a> & <a href="//www.ebi.ac.uk/research/eipp">PhDs</a></li> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="training"><a class="training-color" href="//www.ebi.ac.uk/training">Training</a></h5> ' + ' <ul> ' + ' <li><a href="//www.ebi.ac.uk/training/handson">Train at EBI</a></li> ' + ' <li><a href="//www.ebi.ac.uk/training/roadshow">Train outside EBI</a></li> ' + ' <li><a href="//www.ebi.ac.uk/training/online">Train online</a></li> ' + ' <li class="last"><a href="//www.ebi.ac.uk/training/contact-us">Contact organisers</a></li> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="industry"><a class="industry-color" href="//www.ebi.ac.uk/industry">Industry</a></h5> ' + ' <ul> ' + ' <li><a href="//www.ebi.ac.uk/industry/private">Members Area</a></li> ' + ' <li><a href="//www.ebi.ac.uk/industry/workshops">Workshops</a></li> ' + ' <li><a href="//www.ebi.ac.uk/industry/sme-forum"><abbr title="Small Medium Enterprise">SME</abbr> Forum</a></li> ' + ' <li class="last"><a href="//www.ebi.ac.uk/industry/contact">Contact Industry programme</a></li> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="about"><a class="ebi-color" href="//www.ebi.ac.uk/about">About EMBL-EBI</a></h5> ' + ' <ul> ' + - ' <li><a href="//www.ebi.ac.uk/about/contact">Contact us</a> ' + - ' <li><a href="//www.ebi.ac.uk/about/events">Events</a></li> ' + - ' <li><a href="//www.ebi.ac.uk/about/jobs" title="Jobs, postdocs, PhDs...">Jobs</a></li> ' + - ' <li class="first"><a href="//www.ebi.ac.uk/about/news">News</a></li> ' + - ' <li><a href="//www.ebi.ac.uk/about/people">People & groups</a></li> ' + - ' </ul> ' + ' </div>' + ''; - - function init() { - try { - var foot = document.getElementById('global-nav-expanded'); - foot.innerHTML = html; - } catch (err) { - setTimeout(init, 500); - } - } - init(); -})(); - -(function updateFooterMeta() { - var d = new Date(); - var html = '<div class="columns">' + '<p class="address">EMBL-EBI, Wellcome Genome Campus, Hinxton, Cambridgeshire, CB10 1SD, UK. +44 (0)1223 49 44 44</p> <p class="legal">Copyright © EMBL-EBI ' + d.getFullYear() + ' | EMBL-EBI is <a href="http://www.embl.org/">part of the European Molecular Biology Laboratory</a> | <a href="//www.ebi.ac.uk/about/terms-of-use">Terms of use</a>' + - '<a class="readmore float-right" href="http://intranet.ebi.ac.uk">Intranet</a>' + - '</p>' + '</div>'; - - function init() { - try { - var foot = document.getElementById('ebi-footer-meta'); - foot.innerHTML = html; - } catch (err) { - setTimeout(init, 500); - } - } - init(); -})(); -(function includeScripts() { - var requireScripts = ['//www.ebi.ac.uk/web_guidelines/EBI-Framework/v1.2/js/cookiebanner.js', '//www.ebi.ac.uk/web_guidelines/EBI-Framework/v1.2/js/script.js', '//www.ebi.ac.uk/web_guidelines/js/downtime.js?' + Math.round(new Date().getTime() / 3600000)]; - - function init() { - try { - var existingScripts = document.getElementsByTagName('script'); - var gotScript, i, j, putScript; - for (j = 0; j < requireScripts.length; j++) { - for (gotScript = false, i = 0; i < existingScripts.length; i++) - if (existingScripts[i].src.indexOf(requireScripts[j]) !== -1) - gotScript = true; - if (!gotScript) { - putComment = document.createComment(requireScripts[j] + ' automatically inserted'); - putScript = document.createElement('script'); - putScript.type = 'text/javascript'; - putScript.src = requireScripts[j]; - document.body.appendChild(putComment); - document.body.appendChild(putScript); - } - } - } catch (err) { - setTimeout(init, 500); - } - } - init(); -})(); diff --git a/js/script.js b/js/script.js index b1e58817d21442903cd1444c465512b62a7d14e7..d28b3d7569a62a163249f24d71341682c0dda7a9 100644 --- a/js/script.js +++ b/js/script.js @@ -246,3 +246,162 @@ })(); })(); + +(function updateFoot() { + var html = '' + '<div class="columns small-6 medium-2 "> ' + ' <a href="//www.ebi.ac.uk" title="EMBL-EBI"><span class="ebi-logo"></span></a> ' + ' <ul> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="services"><a class="services-color" href="//www.ebi.ac.uk/services">Services</a></h5> ' + ' <ul> ' + ' <li class="first"><a href="//www.ebi.ac.uk/services">By topic</a></li> ' + ' <li><a href="//www.ebi.ac.uk/services/all">By name (A-Z)</a></li> ' + ' <li class="last"><a href="//www.ebi.ac.uk/support">Help & Support</a></li> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="research"><a class="research-color" href="//www.ebi.ac.uk/research">Research</a></h5> ' + ' <ul> ' + ' <li><a href="//www.ebi.ac.uk/research/publications">Publications</a></li> ' + ' <li><a href="//www.ebi.ac.uk/research/groups">Research groups</a></li> ' + ' <li class="last"><a href="//www.ebi.ac.uk/research/postdocs">Postdocs</a> & <a href="//www.ebi.ac.uk/research/eipp">PhDs</a></li> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="training"><a class="training-color" href="//www.ebi.ac.uk/training">Training</a></h5> ' + ' <ul> ' + ' <li><a href="//www.ebi.ac.uk/training/handson">Train at EBI</a></li> ' + ' <li><a href="//www.ebi.ac.uk/training/roadshow">Train outside EBI</a></li> ' + ' <li><a href="//www.ebi.ac.uk/training/online">Train online</a></li> ' + ' <li class="last"><a href="//www.ebi.ac.uk/training/contact-us">Contact organisers</a></li> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="industry"><a class="industry-color" href="//www.ebi.ac.uk/industry">Industry</a></h5> ' + ' <ul> ' + ' <li><a href="//www.ebi.ac.uk/industry/private">Members Area</a></li> ' + ' <li><a href="//www.ebi.ac.uk/industry/workshops">Workshops</a></li> ' + ' <li><a href="//www.ebi.ac.uk/industry/sme-forum"><abbr title="Small Medium Enterprise">SME</abbr> Forum</a></li> ' + ' <li class="last"><a href="//www.ebi.ac.uk/industry/contact">Contact Industry programme</a></li> ' + ' </ul> ' + ' </div> ' + ' ' + ' <div class="columns small-6 medium-2 "> ' + ' <h5 class="about"><a class="ebi-color" href="//www.ebi.ac.uk/about">About EMBL-EBI</a></h5> ' + ' <ul> ' + + ' <li><a href="//www.ebi.ac.uk/about/contact">Contact us</a> ' + + ' <li><a href="//www.ebi.ac.uk/about/events">Events</a></li> ' + + ' <li><a href="//www.ebi.ac.uk/about/jobs" title="Jobs, postdocs, PhDs...">Jobs</a></li> ' + + ' <li class="first"><a href="//www.ebi.ac.uk/about/news">News</a></li> ' + + ' <li><a href="//www.ebi.ac.uk/about/people">People & groups</a></li> ' + + ' </ul> ' + ' </div>' + ''; + + function init() { + try { + var foot = document.getElementById('global-nav-expanded'); + foot.innerHTML = html; + } catch (err) { + setTimeout(init, 500); + } + } + init(); +})(); + +(function updateFooterMeta() { + var d = new Date(); + var html = '<div class="columns">' + '<p class="address">EMBL-EBI, Wellcome Genome Campus, Hinxton, Cambridgeshire, CB10 1SD, UK. +44 (0)1223 49 44 44</p> <p class="legal">Copyright © EMBL-EBI ' + d.getFullYear() + ' | EMBL-EBI is <a href="http://www.embl.org/">part of the European Molecular Biology Laboratory</a> | <a href="//www.ebi.ac.uk/about/terms-of-use">Terms of use</a>' + + '<a class="readmore float-right" href="http://intranet.ebi.ac.uk">Intranet</a>' + + '</p>' + '</div>'; + + function init() { + try { + var foot = document.getElementById('ebi-footer-meta'); + foot.innerHTML = html; + } catch (err) { + setTimeout(init, 500); + } + } + init(); +})(); +(function includeScripts() { + var requireScripts = ['//www.ebi.ac.uk/web_guidelines/EBI-Framework/v1.2/js/script.js', '//www.ebi.ac.uk/web_guidelines/js/downtime.js?' + Math.round(new Date().getTime() / 3600000)]; + + function init() { + try { + var existingScripts = document.getElementsByTagName('script'); + var gotScript, i, j, putScript; + for (j = 0; j < requireScripts.length; j++) { + for (gotScript = false, i = 0; i < existingScripts.length; i++) + if (existingScripts[i].src.indexOf(requireScripts[j]) !== -1) + gotScript = true; + if (!gotScript) { + putComment = document.createComment(requireScripts[j] + ' automatically inserted'); + putScript = document.createElement('script'); + putScript.type = 'text/javascript'; + putScript.src = requireScripts[j]; + document.body.appendChild(putComment); + document.body.appendChild(putScript); + } + } + } catch (err) { + setTimeout(init, 500); + } + } + init(); +})(); + +(function cookieBanner() { + function setCookie(c_name, value, exdays) { + var exdate = new Date(); + var c_value; + exdate.setDate(exdate.getDate() + exdays); + c_value = escape(value) + ((exdays===null) ? "" : ";expires=" + exdate.toUTCString()) + ";domain=.ebi.ac.uk;path=/"; + document.cookie = c_name + "=" + c_value; + c_value = escape(value) + ((exdays===null) ? "" : ";expires=" + exdate.toUTCString()) + ";domain=" + document.domain + ";path=/"; + document.cookie = c_name + "=" + c_value; + } + + function getCookie(c_name) { + var i, x, y, ARRcookies=document.cookie.split(";"); + for (i=0; i<ARRcookies.length; i++) + { + x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); + y = ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); + x = x.replace(/^\s+|\s+$/g,""); + if (x===c_name) { + return unescape(y); + } + } + } + + function createStyles() { + var head = document.head || document.getElementsByTagName('head')[0]; + var style = document.createElement('style'); + + style.type = 'text/css'; + var css = "" + + " #cookie-banner {position:fixed;background-color:#111;width:100%;padding:.75rem;left:0;bottom:0;color:#eee;}" + + " #cookie-banner a {color:#fff;}" + + " .text {margin-right:2em;}"; + + if (style.styleSheet){ + style.styleSheet.cssText = css; + } else { + style.appendChild(document.createTextNode(css)); + } + + head.appendChild(style); + } + + function createBanner() { + var banner = document.createElement('div'); + var wrapper = document.createElement('div'); + var inner = document.createElement('div'); + + banner.id = "cookie-banner"; + wrapper.className = "row"; + wrapper.innerHTML = "" + + " <div class='text'>This website uses cookies. By continuing to browse this site, you are agreeing to the use of our site cookies. " + + " To find out more, see our <a href='//www.ebi.ac.uk/about/terms-of-use'>Terms of Use</a>.</div>" + + " <div id='cookie-dismiss'> <button class='close-button' style='top: 0.3rem; color:#fff;' aria-label='Close alert' type='button'><span aria-hidden='true'>×</span></button></div>" + + ""; + + document.body.appendChild(banner); + banner.appendChild(wrapper); + } + + function openBanner() { + var height = document.getElementById('cookie-banner').offsetHeight; + document.getElementById('cookie-banner').style.display = 'block'; + document.body.style.paddingBottom = height+'px'; + } + + function closeBanner() { + var height = document.getElementById('cookie-banner').offsetHeight; + document.getElementById('cookie-banner').style.display = 'none'; + document.body.style.paddingBottom = '0'; + } + + function init() { + try { + if (getCookie('cookies-accepted') !== 'true') { + createStyles(); + createBanner(); + openBanner(); + + setCookie('cookies-accepted', 'true', 90); // show cookie message only once + + document.getElementById('cookie-dismiss').onclick = function() { + closeBanner(); + return false; + }; + } + } + catch(err) { + setTimeout(init, 100); + } + } + + init(); + +})();