hof 22.10.4-update-country-list-beta → 22.11.0-frontend-v4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/components/date/templates/date.html +1 -1
- package/frontend/govuk-template/build/govuk_template.html +66 -22
- package/frontend/govuk-template/govuk_template_generated.html +66 -22
- package/frontend/template-mixins/mixins/template-mixins.js +5 -4
- package/frontend/template-mixins/partials/forms/checkbox.html +5 -1
- package/frontend/template-mixins/partials/forms/input-text-date.html +2 -1
- package/frontend/template-mixins/partials/forms/input-text-group.html +1 -1
- package/frontend/template-mixins/partials/forms/textarea-group.html +1 -1
- package/frontend/template-partials/views/layout.html +1 -1
- package/frontend/template-partials/views/partials/cookie-banner.html +50 -32
- package/frontend/template-partials/views/partials/navigation.html +2 -2
- package/frontend/themes/gov-uk/client-js/cookieSettings.js +36 -24
- package/package.json +2 -2
- package/sandbox/package.json +1 -1
- package/sandbox/public/css/app.css +2935 -1288
- package/sandbox/public/js/bundle.js +4752 -2214
- package/sandbox/yarn.lock +166 -59
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/* eslint-disable max-len, no-
|
|
1
|
+
/* eslint-disable max-len, no-undef */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
// TODO: update package.json(s)
|
|
5
5
|
|
|
6
6
|
function hideFallbackContent(containerId) {
|
|
7
|
-
|
|
7
|
+
const container = document.getElementById(containerId);
|
|
8
8
|
if (container === null) return;
|
|
9
|
-
|
|
10
|
-
for (
|
|
9
|
+
const fallbackContent = container.getElementsByClassName('js-disabled');
|
|
10
|
+
for (let i = 0; i < fallbackContent.length; i++) {
|
|
11
11
|
fallbackContent[i].style.display = 'none';
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function showInteractiveContent(containerId) {
|
|
16
|
-
|
|
16
|
+
const container = document.getElementById(containerId);
|
|
17
17
|
if (container === null) return;
|
|
18
|
-
|
|
19
|
-
for (
|
|
18
|
+
const interactiveContent = container.getElementsByClassName('js-enabled');
|
|
19
|
+
for (let i = 0; i < interactiveContent.length; i++) {
|
|
20
20
|
interactiveContent[i].style.display = 'block';
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -34,41 +34,53 @@ function setCookiePreferences(preferences) {
|
|
|
34
34
|
function showCookieBannerSubmitted() {
|
|
35
35
|
document.getElementById('cookie-banner-info').style.display = 'none';
|
|
36
36
|
document.getElementById('cookie-banner-actions').style.display = 'none';
|
|
37
|
-
|
|
37
|
+
let cookieBannerSubmitted;
|
|
38
|
+
const cookieBannerDiv = document.getElementById('cookie-banner-submitted-accepted');
|
|
39
|
+
if (cookieBannerDiv.dataset.acceptCookies === 'true') {
|
|
40
|
+
cookieBannerSubmitted = document.getElementById('cookie-banner-submitted-accepted');
|
|
41
|
+
} else {
|
|
42
|
+
cookieBannerSubmitted = document.getElementById('cookie-banner-submitted-rejected');
|
|
43
|
+
}
|
|
38
44
|
cookieBannerSubmitted.style.display = 'block';
|
|
39
45
|
cookieBannerSubmitted.focus();
|
|
40
46
|
}
|
|
41
47
|
|
|
48
|
+
function hideCookieBanner() {
|
|
49
|
+
document.getElementById('cookie-banner').style.display = 'none';
|
|
50
|
+
}
|
|
51
|
+
|
|
42
52
|
function initialiseBannerButtons() {
|
|
53
|
+
const acceptedCookieBannerDiv = document.getElementById('cookie-banner-submitted-accepted');
|
|
43
54
|
document.getElementById('accept-cookies-button').addEventListener('click', function () {
|
|
44
|
-
setCookiePreferences({essential: true, usage: true});
|
|
55
|
+
setCookiePreferences({ essential: true, usage: true });
|
|
45
56
|
showCookieBannerSubmitted();
|
|
46
57
|
sessionStorage.setItem('reloading', 'true');
|
|
47
58
|
window.location = document.URL;
|
|
48
59
|
});
|
|
49
60
|
|
|
50
61
|
document.getElementById('reject-cookies-button').addEventListener('click', function () {
|
|
51
|
-
setCookiePreferences({essential: true, usage: false});
|
|
62
|
+
setCookiePreferences({ essential: true, usage: false });
|
|
63
|
+
acceptedCookieBannerDiv.dataset.acceptCookies = 'false';
|
|
52
64
|
showCookieBannerSubmitted();
|
|
53
65
|
});
|
|
54
66
|
|
|
55
|
-
document.getElementById('hide-cookie-banner').addEventListener('click',
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
document.getElementById('hide-accept-cookie-banner').addEventListener('click', hideCookieBanner);
|
|
68
|
+
|
|
69
|
+
document.getElementById('hide-reject-cookie-banner').addEventListener('click', hideCookieBanner);
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
function initialiseCookieBanner() {
|
|
61
|
-
|
|
73
|
+
const preferences = GOVUK.cookie('cookie_preferences');
|
|
62
74
|
|
|
63
75
|
if (preferences !== null) {
|
|
64
76
|
return;
|
|
65
77
|
}
|
|
66
78
|
|
|
67
79
|
// the default cookie message container from hof-govuk-template
|
|
68
|
-
|
|
80
|
+
const bannerContainer = document.getElementById('global-cookie-message');
|
|
69
81
|
|
|
70
82
|
// the cookie banner that will replace the container's default content if using google analytics
|
|
71
|
-
|
|
83
|
+
const cookieBanner = document.getElementById('cookie-banner');
|
|
72
84
|
|
|
73
85
|
if (bannerContainer !== null && cookieBanner !== null) {
|
|
74
86
|
hideFallbackContent('global-cookie-message');
|
|
@@ -82,8 +94,8 @@ function handleSaveSettings(e) {
|
|
|
82
94
|
e.preventDefault();
|
|
83
95
|
setCookiePreferences({ essential: true, usage: document.getElementById('radio-1').checked });
|
|
84
96
|
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
const cookieNotification = document.getElementById('cookie-notification');
|
|
98
|
+
const cookieBanner = document.getElementById('cookie-banner');
|
|
87
99
|
|
|
88
100
|
if (cookieBanner !== null) {
|
|
89
101
|
cookieBanner.style.display = 'none';
|
|
@@ -96,8 +108,8 @@ function handleSaveSettings(e) {
|
|
|
96
108
|
}
|
|
97
109
|
|
|
98
110
|
function initialiseFormControls() {
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
const preferences = JSON.parse(GOVUK.cookie('cookie_preferences'));
|
|
112
|
+
let usage;
|
|
101
113
|
|
|
102
114
|
if (preferences !== null && preferences.usage !== undefined && typeof preferences.usage === 'boolean') {
|
|
103
115
|
usage = preferences.usage;
|
|
@@ -111,7 +123,7 @@ function initialiseFormControls() {
|
|
|
111
123
|
}
|
|
112
124
|
|
|
113
125
|
function initialiseCookiePage() {
|
|
114
|
-
|
|
126
|
+
const shouldDisplayCookieControls = document.getElementById('cookie-settings') !== null;
|
|
115
127
|
|
|
116
128
|
if (shouldDisplayCookieControls) {
|
|
117
129
|
hideFallbackContent('cookie-settings');
|
|
@@ -122,12 +134,12 @@ function initialiseCookiePage() {
|
|
|
122
134
|
|
|
123
135
|
function onLoad() {
|
|
124
136
|
window.onload = function () {
|
|
125
|
-
|
|
137
|
+
const reloading = sessionStorage.getItem('reloading');
|
|
126
138
|
if (reloading) {
|
|
127
139
|
sessionStorage.removeItem('reloading');
|
|
128
140
|
|
|
129
|
-
|
|
130
|
-
|
|
141
|
+
const bannerContainer = document.getElementById('global-cookie-message');
|
|
142
|
+
const cookieBanner = document.getElementById('cookie-banner');
|
|
131
143
|
|
|
132
144
|
if (bannerContainer !== null && cookieBanner !== null) {
|
|
133
145
|
bannerContainer.style.display = 'block';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hof",
|
|
3
3
|
"description": "A bootstrap for HOF projects",
|
|
4
|
-
"version": "22.
|
|
4
|
+
"version": "22.11.0-frontend-v4-beta.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": "HomeOffice",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"findup": "^0.1.5",
|
|
61
61
|
"glob": "^7.2.0",
|
|
62
62
|
"govuk-elements-sass": "^3.1.3",
|
|
63
|
-
"govuk-frontend": "
|
|
63
|
+
"govuk-frontend": "4.10.1",
|
|
64
64
|
"govuk_template_mustache": "^0.26.0",
|
|
65
65
|
"helmet": "^3.22.0",
|
|
66
66
|
"hogan-express-strict": "^0.5.4",
|