From fa22895d9cffc14110e46c5a329eb69d7bb9016f Mon Sep 17 00:00:00 2001 From: Lakshmishri Date: Thu, 8 Aug 2024 09:41:16 +0200 Subject: [PATCH 1/3] set up onetrust cookie management --- scripts/delayed.js | 34 +++++++++++++++++++++++++++++++++- styles/styles.css | 8 ++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/scripts/delayed.js b/scripts/delayed.js index 28fa26c..c111c14 100644 --- a/scripts/delayed.js +++ b/scripts/delayed.js @@ -1 +1,33 @@ -// add delayed functionality here +import { loadScript } from './aem.js'; + +// OneTrust Cookies Consent Notice +if (!window.location.pathname.includes('srcdoc') + && !['hlx.live', 'aem.page', 'aem.live'].some((url) => window.location.host.includes(url))) { + // when running on localhost in the block library host is empty but the path is srcdoc + // on localhost/hlx.page/hlx.live the consent notice is displayed every time the page opens, + // because the cookie is not persistent. To avoid this annoyance, disable unless on the + // production page. + loadScript('https://cdn.cookielaw.org/scripttemplates/otSDKStub.js', { + type: 'text/javascript', + charset: 'UTF-8', + 'data-domain-script': '0190e9aa-e486-72b8-ada6-bda52c32aa2c', + }); + + window.OptanonWrapper = () => { + const currentOnetrustActiveGroups = window.OnetrustActiveGroups; + + function isSameGroups(groups1, groups2) { + const s1 = JSON.stringify(groups1.split(',').sort()); + const s2 = JSON.stringify(groups2.split(',').sort()); + + return s1 === s2; + } + + window.OneTrust.OnConsentChanged(() => { + // reloading the page only when the active group has changed + if (!isSameGroups(currentOnetrustActiveGroups, window.OnetrustActiveGroups)) { + window.location.reload(); + } + }); + }; +} diff --git a/styles/styles.css b/styles/styles.css index 13706fd..22d19e5 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -326,4 +326,12 @@ main .border-top { .width-400 { max-width: 400px; margin: auto; +} + +/* styles to override onetrust */ +#onetrust-consent-sdk #onetrust-pc-sdk button:not(#clear-filters-handler):not(.ot-close-icon):not(#filter-btn-handler):not(.ot-remove-objection-handler):not(.ot-obj-leg-btn-handler):not([aria-expanded]):not(.ot-link-btn), +#onetrust-banner-sdk #onetrust-reject-all-handler, +#onetrust-consent-sdk #onetrust-accept-btn-handler { + background-color: var(--link-color) !important; + border-color: transparent !important; } \ No newline at end of file From c62d7a6bcb8a0e12018a95964787aa946077fd5e Mon Sep 17 00:00:00 2001 From: Lakshmishri Date: Thu, 8 Aug 2024 09:59:29 +0200 Subject: [PATCH 2/3] fix lint errors --- styles/styles.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/styles/styles.css b/styles/styles.css index 22d19e5..c3b8116 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -329,7 +329,8 @@ main .border-top { } /* styles to override onetrust */ -#onetrust-consent-sdk #onetrust-pc-sdk button:not(#clear-filters-handler):not(.ot-close-icon):not(#filter-btn-handler):not(.ot-remove-objection-handler):not(.ot-obj-leg-btn-handler):not([aria-expanded]):not(.ot-link-btn), + +#onetrust-consent-sdk #onetrust-pc-sdk button:not(#clear-filters-handler, .ot-close-icon, #filter-btn-handler, .ot-remove-objection-handler, .ot-obj-leg-btn-handler, [aria-expanded], .ot-link-btn), #onetrust-banner-sdk #onetrust-reject-all-handler, #onetrust-consent-sdk #onetrust-accept-btn-handler { background-color: var(--link-color) !important; From 75a179669430890427a4638444d02dfcb95218d7 Mon Sep 17 00:00:00 2001 From: Tomasz Dziezyk Date: Wed, 14 Aug 2024 13:14:21 +0200 Subject: [PATCH 3/3] Update privacy policy page styles --- styles/styles.css | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/styles/styles.css b/styles/styles.css index c3b8116..9597092 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -102,6 +102,22 @@ h6, font-weight: 600; } +* + .h1, +* + .h2, +* + .h3, +* + .h4, +* + .h5, +* + .h6, +* + h1, +* + h2, +* + h3, +* + h4, +* + h5, +* + h6 { + margin-top: 40px; +} + + p, dl, ol, @@ -112,6 +128,10 @@ blockquote { margin-bottom: 1em; } +ul { + padding-left: 30px; +} + address, dl, fieldset, figure, ol, p, pre, ul { margin: 0 0 20px; } @@ -335,4 +355,25 @@ main .border-top { #onetrust-consent-sdk #onetrust-accept-btn-handler { background-color: var(--link-color) !important; border-color: transparent !important; -} \ No newline at end of file +} + +/* article styles - start */ +.article h1 { + font-size: 2.2313rem; + line-height: 1.2; + color: #333; + font-weight: 400; + margin-bottom: 40px +} + +.article em { + color: rgb(240 80 110); +} + +@media (width >= 960px) { + .article h1 { + font-size:2.625rem + } +} + +/* article styles - end */