From e4811613ee2acf22d822f9bc0a42b68cd50cee58 Mon Sep 17 00:00:00 2001 From: Michael Dickson Date: Mon, 4 Dec 2023 15:25:08 -0500 Subject: [PATCH 1/2] refactor notification code - new branch - small change to immutable(?) head.html --- head.html | 1 + scripts/custom-scripts.js | 22 ++++++++++++++++++++++ styles/gmo-styles.css | 4 ++++ 3 files changed, 27 insertions(+) create mode 100644 scripts/custom-scripts.js diff --git a/head.html b/head.html index cd02fd34..0e998767 100644 --- a/head.html +++ b/head.html @@ -13,6 +13,7 @@ + diff --git a/scripts/custom-scripts.js b/scripts/custom-scripts.js new file mode 100644 index 00000000..ce4f9ed7 --- /dev/null +++ b/scripts/custom-scripts.js @@ -0,0 +1,22 @@ +import { getBrandingConfig } from "./site-config.js"; +import { EventNames } from "./events.js"; +import showToast from "./toast-message.js"; + +initLegalNotice(); + +async function initLegalNotice() { + const config = await getBrandingConfig(); + console.log(config); + document.addEventListener(EventNames.SESSION_STARTED, function() { + showLegalNotice(config); + }); +} + +function showLegalNotice(config) { + const legalDefault = `NOTICE: Adobe records and uses your e-mail address for tracking purposes.`; + const legalToast = config?.legalMessage || legalDefault; + const legalDuration = 10000; + const toastType = "info"; + + showToast(legalToast, legalDuration, toastType, false); +} \ No newline at end of file diff --git a/styles/gmo-styles.css b/styles/gmo-styles.css index af6e3c76..9183ecea 100644 --- a/styles/gmo-styles.css +++ b/styles/gmo-styles.css @@ -15,4 +15,8 @@ header:empty { header nav .nav-brand .adp-logo img { min-height: 42px; +} + +.adp-toast { + text-transform: none; } \ No newline at end of file From 84e45ec020d4205b538927ca2419823c7347c20c Mon Sep 17 00:00:00 2001 From: Michael Dickson Date: Mon, 4 Dec 2023 15:33:37 -0500 Subject: [PATCH 2/2] remove log statement --- scripts/custom-scripts.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/custom-scripts.js b/scripts/custom-scripts.js index ce4f9ed7..656b9009 100644 --- a/scripts/custom-scripts.js +++ b/scripts/custom-scripts.js @@ -6,7 +6,6 @@ initLegalNotice(); async function initLegalNotice() { const config = await getBrandingConfig(); - console.log(config); document.addEventListener(EventNames.SESSION_STARTED, function() { showLegalNotice(config); });