diff --git a/js/ebi-global-includes/script/4_ebiFrameworkContent.js b/js/ebi-global-includes/script/4_ebiFrameworkContent.js index adb92402ba32aa1e950e04393af0f8f578d5bf38..88799797719b7dda8f6f9e4367057b0e8187e4c5 100644 --- a/js/ebi-global-includes/script/4_ebiFrameworkContent.js +++ b/js/ebi-global-includes/script/4_ebiFrameworkContent.js @@ -103,42 +103,27 @@ function ebiFrameworkUpdateFoot() { } function ebiFrameworkUpdateFooterMeta() { - 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>'; + 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 ebiFrameworkIncludeScripts() { - var requireScripts = ['//www.ebi.ac.uk/web_guidelines/EBI-Framework/v1.2/js/script.js', // make sure we have script.js from where we expect - '//www.ebi.ac.uk/web_guidelines/js/downtime.js?' + Math.round(new Date().getTime() / 3600000)]; // refresh downtime.js once an hour 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); } + try { + var foot = document.getElementById('ebi-footer-meta'); + foot.innerHTML = html; + } catch (err) { setTimeout(init, 500); } } init(); } + +function ebiFrameworkIncludeScripts() { + var downtimeScript = '//www.ebi.ac.uk/web_guidelines/js/downtime.js?' + Math.round(new Date().getTime() / 3600000); + putComment = document.createComment(downtimeScript + ' automatically inserted'); + putScript = document.createElement('script'); + putScript.type = 'text/javascript'; + putScript.src = downtimeScript; + document.body.appendChild(putComment); + document.body.appendChild(putScript); +} diff --git a/js/script.js b/js/script.js index 37b0296b808d4ee01b2cd0f21fca444fe299ccfa..270d8dde8a811b5426a7189adbdf917dbf85b2e5 100644 --- a/js/script.js +++ b/js/script.js @@ -1,6 +1,7 @@ /* Copyright (c) EMBL-EBI 2017 */ // Do not edit this file directly. // It is made by concating .js files with by npm into script.js. +// Source files: js/ebi-global-includes/script/*.js function ebiFrameworkExternalLinks() { // mark pdf/doc/txt links with link-pdf/link-doc/link-txt classes // exclude links with images @@ -220,45 +221,30 @@ function ebiFrameworkUpdateFoot() { } function ebiFrameworkUpdateFooterMeta() { - 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>'; + 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 ebiFrameworkIncludeScripts() { - var requireScripts = ['//www.ebi.ac.uk/web_guidelines/EBI-Framework/v1.2/js/script.js', // make sure we have script.js from where we expect - '//www.ebi.ac.uk/web_guidelines/js/downtime.js?' + Math.round(new Date().getTime() / 3600000)]; // refresh downtime.js once an hour 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); } + try { + var foot = document.getElementById('ebi-footer-meta'); + foot.innerHTML = html; + } catch (err) { setTimeout(init, 500); } } init(); } + +function ebiFrameworkIncludeScripts() { + var downtimeScript = '//www.ebi.ac.uk/web_guidelines/js/downtime.js?' + Math.round(new Date().getTime() / 3600000); + putComment = document.createComment(downtimeScript + ' automatically inserted'); + putScript = document.createElement('script'); + putScript.type = 'text/javascript'; + putScript.src = downtimeScript; + document.body.appendChild(putComment); + document.body.appendChild(putScript); +} function ebiFrameworkCookieBanner() { function setCookie(c_name, value, exdays) { var exdate = new Date();