From 166de609841210e42e7079740a74012d088ecd84 Mon Sep 17 00:00:00 2001 From: Jim Carlton Date: Wed, 11 Dec 2024 13:46:55 +1100 Subject: [PATCH] Cookie consent - updates documentation config, cleans up js --- .../cookie-consent/_cookie-consent.hbs | 28 +---------- src/components/cookie-consent/blank.hbs | 4 ++ .../cookie-consent/cookie-consent-config.js | 2 +- .../cookie-consent/cookie-consent.js | 47 +++++++++++++++---- src/components/cookie-consent/theme.hbs | 4 ++ src/global/handlebars/layouts/layout.hbs | 2 +- 6 files changed, 51 insertions(+), 36 deletions(-) diff --git a/src/components/cookie-consent/_cookie-consent.hbs b/src/components/cookie-consent/_cookie-consent.hbs index 96e251a3..b3b4f14c 100644 --- a/src/components/cookie-consent/_cookie-consent.hbs +++ b/src/components/cookie-consent/_cookie-consent.hbs @@ -1,31 +1,7 @@ {{#if-equals type "banner"}} -{{!-- --}} +Trigger consent banner {{/if-equals}} {{#if-equals type "dialog"}} -Cookie preferences +Trigger cookie preferences {{/if-equals}} diff --git a/src/components/cookie-consent/blank.hbs b/src/components/cookie-consent/blank.hbs index 5e0beb7a..845f7ad5 100644 --- a/src/components/cookie-consent/blank.hbs +++ b/src/components/cookie-consent/blank.hbs @@ -6,5 +6,9 @@ model: cookie-consent-4: json/cookie-consent-4.json --- +

{{>_cookie-consent model.cookie-consent-1 type="banner"}} +

+

{{>_cookie-consent model.cookie-consent-4 type="dialog"}} +

\ No newline at end of file diff --git a/src/components/cookie-consent/cookie-consent-config.js b/src/components/cookie-consent/cookie-consent-config.js index 08403cdf..df95d82d 100644 --- a/src/components/cookie-consent/cookie-consent-config.js +++ b/src/components/cookie-consent/cookie-consent-config.js @@ -27,7 +27,7 @@ waitForCookieConsent(() => { acceptAllBtn: 'Accept all', acceptNecessaryBtn: 'Reject all', showPreferencesBtn: 'Manage your preferences', - confirmationMessage: 'Thanks for making your selection. View and update your cookie preferences here.', + confirmationMessage: 'Thanks for making your selection. View and update your cookie preferences here.', }, preferencesModal: { title: 'Manage cookie preferences', diff --git a/src/components/cookie-consent/cookie-consent.js b/src/components/cookie-consent/cookie-consent.js index 5c448a05..7eeca821 100644 --- a/src/components/cookie-consent/cookie-consent.js +++ b/src/components/cookie-consent/cookie-consent.js @@ -54,7 +54,7 @@ class CookieConsent { // Create the dialog dynamically const preferencesDialogHtml = ` -