From 996a50e7833f278a4217e4fe7bbf1e3be7f8ba80 Mon Sep 17 00:00:00 2001 From: Ken Hawkins <khawkins98@gmail.com> Date: Mon, 21 May 2018 11:23:46 +0100 Subject: [PATCH] Update data protection banner guidance For https://github.com/ebiwd/EBI-Framework/issues/137 --- .../banner-data-protection.html | 3 +++ .../banner-data-protection.js | 1 - .../patterns/banner-data-protection/layout.html | 17 +++++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 content/websites/patterns/banner-data-protection/banner-data-protection.js diff --git a/content/websites/patterns/banner-data-protection/banner-data-protection.html b/content/websites/patterns/banner-data-protection/banner-data-protection.html index e69de29..7365872 100644 --- a/content/websites/patterns/banner-data-protection/banner-data-protection.html +++ b/content/websites/patterns/banner-data-protection/banner-data-protection.html @@ -0,0 +1,3 @@ +<div id="data-protection-message-configuration" +data-message="Your message and links here." +data-service-id="myService" data-data-protection-version="0.1"></div> diff --git a/content/websites/patterns/banner-data-protection/banner-data-protection.js b/content/websites/patterns/banner-data-protection/banner-data-protection.js deleted file mode 100644 index 0608be9..0000000 --- a/content/websites/patterns/banner-data-protection/banner-data-protection.js +++ /dev/null @@ -1 +0,0 @@ -// Comning soon diff --git a/content/websites/patterns/banner-data-protection/layout.html b/content/websites/patterns/banner-data-protection/layout.html index 1ee8cf1..b9425c1 100644 --- a/content/websites/patterns/banner-data-protection/layout.html +++ b/content/websites/patterns/banner-data-protection/layout.html @@ -28,9 +28,7 @@ You’ll just need to add a div#data-protection-message-configuration with your parameters and the banner will be built accordingly: ``` - <div id="data-protection-message-configuration" - data-message="Your message and links here." - data-service-id="myService" data-data-protection-version="0.1"></div> + {{> banner-data-protection}} ``` See further guidance at <a href="https://www.ebi.ac.uk/style-lab/websites/patterns/banner-data-protection.html">https://www.ebi.ac.uk/style-lab/websites/patterns/banner-data-protection.html</a> @@ -41,14 +39,18 @@ #### If you're not using the EBI Visual Framework: - This banner code will be automatically invoked for users of the EBI Visual Framework, sites still using compliance can add this JS code (still in development): + This banner code will be automatically invoked for users of the EBI Visual Framework, sites still using Compliance theme (or other frameworks) can add this JS code: ``` - console.warn('âš ï¸ This code is still under development, do not use in production. e-mail khawkins@ebi.ac.uk for guidance.'); + var localFrameworkVersion = '1.1'; // 1.1 or 1.2 or compliance or other + // if you select compliance or other we will add some helpful + // CSS styling, but you may need to add some CSS yourself var newDataProtectionNotificationBanner = document.createElement('script'); - newDataProtectionNotificationBanner.src = 'https://dev.ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/js/ebi-global-includes/script/5_ebiFrameworkNotificationBanner.js'; + newDataProtectionNotificationBanner.src = 'https://dev.ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/js/ebi-global-includes/script/5_ebiFrameworkNotificationBanner.js?legacyRequest='+localFrameworkVersion; document.head.appendChild(newDataProtectionNotificationBanner); - setTimeout(ebiFrameworkRunDataProtectionBanner, 1200); + newDataProtectionNotificationBanner.onload = function() { + ebiFrameworkRunDataProtectionBanner(); // invoke the banner + }; ``` ### How it works @@ -64,7 +66,6 @@ Let us know! <a href="mailto:khawkins@ebi.ac.uk">khawkins@ebi.ac.uk</a> or [post to the GitHub issue](https://github.com/ebiwd/EBI-Framework/issues/137). - {{> banner-data-protection}} {{/markdown}} </div> -- GitLab