Skip to content
Snippets Groups Projects
Commit ed420cc1 authored by Ken Hawkins's avatar Ken Hawkins
Browse files

Properly invoke new banner

parent 9e993686
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
// Injects the Data Protection notice onto sites
// For guidance on using: https://www.ebi.ac.uk/style-lab/websites/patterns/banner-data-protection.html
function createDataProtectionBanner() {
function ebiFrameworkCreateDataProtectionBanner() {
var banner = document.createElement('div');
var wrapper = document.createElement('div');
var inner = document.createElement('div');
......@@ -68,7 +68,7 @@ function getCookie(c_name) {
var dataProtectionSettings = new Object();
function runDataProtectionBanner() {
function ebiFrameworkRunDataProtectionBanner() {
try {
dataProtectionSettings.message = 'This website uses cookies. By continuing to browse this site, you are agreeing to the use of our site cookies. We also collect some information [text goes here, please review and agree]. ';
dataProtectionSettings.link = 'https://www.ebi.ac.uk/about/link-needed-to-data-protection';
......@@ -96,16 +96,16 @@ function runDataProtectionBanner() {
// If this version of banner not accpeted, show it:
if (getCookie(dataProtectionSettings.cookieName) != "true") {
createDataProtectionBanner();
ebiFrameworkCreateDataProtectionBanner();
}
} catch(err) { setTimeout(runDataProtectionBanner, 100); }
} catch(err) { setTimeout(ebiFrameworkRunDataProtectionBanner, 100); }
}
function resetDataProtectionBanner() {
document.cookie = dataProtectionSettings.cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT;domain=" + document.domain + ";path=/";
runDataProtectionBanner();
ebiFrameworkRunDataProtectionBanner();
}
// execute
runDataProtectionBanner();
ebiFrameworkRunDataProtectionBanner();
......@@ -16,7 +16,7 @@ function ebiFrameworkInvokeScripts() {
ebiFrameworkUpdateFoot();
ebiFrameworkUpdateFooterMeta();
ebiFrameworkIncludeAnnouncements();
ebiFrameworkCookieBanner();
ebiFrameworkRunDataProtectionBanner();
}
document.addEventListener("DOMContentLoaded", function(event) {
......
......@@ -659,7 +659,7 @@ function ebiFrameworkIncludeAnnouncements() {
// Injects the Data Protection notice onto sites
// For guidance on using: https://www.ebi.ac.uk/style-lab/websites/patterns/banner-data-protection.html
function createDataProtectionBanner() {
function ebiFrameworkCreateDataProtectionBanner() {
var banner = document.createElement('div');
var wrapper = document.createElement('div');
var inner = document.createElement('div');
......@@ -727,7 +727,7 @@ function getCookie(c_name) {
var dataProtectionSettings = new Object();
function runDataProtectionBanner() {
function ebiFrameworkRunDataProtectionBanner() {
try {
dataProtectionSettings.message = 'This website uses cookies. By continuing to browse this site, you are agreeing to the use of our site cookies. We also collect some information [text goes here, please review and agree]. ';
dataProtectionSettings.link = 'https://www.ebi.ac.uk/about/link-needed-to-data-protection';
......@@ -755,19 +755,19 @@ function runDataProtectionBanner() {
// If this version of banner not accpeted, show it:
if (getCookie(dataProtectionSettings.cookieName) != "true") {
createDataProtectionBanner();
ebiFrameworkCreateDataProtectionBanner();
}
} catch(err) { setTimeout(runDataProtectionBanner, 100); }
} catch(err) { setTimeout(ebiFrameworkRunDataProtectionBanner, 100); }
}
function resetDataProtectionBanner() {
document.cookie = dataProtectionSettings.cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT;domain=" + document.domain + ";path=/";
runDataProtectionBanner();
ebiFrameworkRunDataProtectionBanner();
}
// execute
runDataProtectionBanner();
ebiFrameworkRunDataProtectionBanner();
/**
* All scripts are automatically loaded, unless the page asked us not to.
......@@ -787,7 +787,7 @@ function ebiFrameworkInvokeScripts() {
ebiFrameworkUpdateFoot();
ebiFrameworkUpdateFooterMeta();
ebiFrameworkIncludeAnnouncements();
ebiFrameworkCookieBanner();
ebiFrameworkRunDataProtectionBanner();
}
document.addEventListener("DOMContentLoaded", function(event) {
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment