hof 22.8.4 → 22.9.0-beta
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 +16 -0
- package/README.md +30 -0
- package/config/hof-defaults.js +6 -1
- package/frontend/govuk-template/govuk_template_generated.html +102 -0
- package/frontend/template-partials/views/layout.html +2 -8
- package/frontend/themes/gov-uk/styles/_cookie-banner.scss +0 -3
- package/hof-22.9.0.tgz +0 -0
- package/lib/settings.js +1 -0
- package/package/.eslintignore +1 -0
- package/package/CHANGELOG.md +232 -0
- package/package/LICENSE +21 -0
- package/package/README.md +1887 -0
- package/package/bin/hof-build +10 -0
- package/package/bin/hof-transpiler +12 -0
- package/package/build/helpers/importer.js +29 -0
- package/package/build/helpers/local.js +35 -0
- package/package/build/helpers/resolver/import.js +32 -0
- package/package/build/helpers/resolver/nearest-package-root.js +33 -0
- package/package/build/helpers/resolver/package.js +29 -0
- package/package/build/helpers/resolver.js +16 -0
- package/package/build/index.js +49 -0
- package/package/build/lib/env.js +36 -0
- package/package/build/lib/mkdir.js +9 -0
- package/package/build/lib/run.js +17 -0
- package/package/build/lib/spawn.js +18 -0
- package/package/build/tasks/browserify/compress.js +15 -0
- package/package/build/tasks/browserify/index.js +48 -0
- package/package/build/tasks/build/index.js +6 -0
- package/package/build/tasks/images/index.js +27 -0
- package/package/build/tasks/index.js +8 -0
- package/package/build/tasks/sass/index.js +67 -0
- package/package/build/tasks/translate/index.js +20 -0
- package/package/build/tasks/watch/index.js +161 -0
- package/package/components/address-lookup/default-model.js +76 -0
- package/package/components/address-lookup/defaults.js +25 -0
- package/package/components/address-lookup/index.js +251 -0
- package/package/components/address-lookup/templates/address-lookup.html +14 -0
- package/package/components/address-lookup/templates/address.html +22 -0
- package/package/components/address-lookup/templates/postcode.html +9 -0
- package/package/components/clear-session/Readme.md +46 -0
- package/package/components/clear-session/index.js +26 -0
- package/package/components/combine-and-loop-fields/Readme.md +42 -0
- package/package/components/combine-and-loop-fields/index.js +156 -0
- package/package/components/date/fields.js +16 -0
- package/package/components/date/index.js +172 -0
- package/package/components/date/templates/date.html +20 -0
- package/package/components/emailer/assets/images/govuk_logotype_email.png +0 -0
- package/package/components/emailer/assets/images/ho_crest_27px.png +0 -0
- package/package/components/emailer/assets/images/spacer.gif +0 -0
- package/package/components/emailer/email-service.js +51 -0
- package/package/components/emailer/emailer.js +53 -0
- package/package/components/emailer/index.js +74 -0
- package/package/components/emailer/transports/debug.js +74 -0
- package/package/components/emailer/transports/index.js +8 -0
- package/package/components/emailer/transports/ses.js +36 -0
- package/package/components/emailer/transports/smtp.js +26 -0
- package/package/components/emailer/transports/stub.js +5 -0
- package/package/components/emailer/views/layout.html +63 -0
- package/package/components/homeoffice-countries/index.js +22 -0
- package/package/components/index.js +13 -0
- package/package/components/notify/index.js +62 -0
- package/package/components/notify/notify.js +51 -0
- package/package/components/session-timeout-warning/index.js +67 -0
- package/package/components/summary/index.js +237 -0
- package/package/config/builder-defaults.js +45 -0
- package/package/config/component-defaults.js +13 -0
- package/package/config/hof-defaults.js +65 -0
- package/package/config/rate-limits.js +20 -0
- package/package/config/sanitisation-rules.js +32 -0
- package/package/controller/base-controller.js +296 -0
- package/package/controller/behaviour-hooks.js +51 -0
- package/package/controller/behaviour-session.js +64 -0
- package/package/controller/controller.js +258 -0
- package/package/controller/deprecate-error.js +10 -0
- package/package/controller/formatting/formatters.js +70 -0
- package/package/controller/formatting/index.js +32 -0
- package/package/controller/index.js +17 -0
- package/package/controller/validation/email.js +30 -0
- package/package/controller/validation/index.js +101 -0
- package/package/controller/validation/validators.js +181 -0
- package/package/controller/validation-error.js +14 -0
- package/package/frontend/govuk-template/build/config.js +24 -0
- package/package/frontend/govuk-template/build/govuk_template.html +102 -0
- package/package/frontend/govuk-template/build/index.js +23 -0
- package/package/frontend/govuk-template/govuk_template_generated.html +102 -0
- package/package/frontend/govuk-template/index.js +29 -0
- package/package/frontend/index.js +9 -0
- package/package/frontend/template-mixins/mixins/helpers.js +103 -0
- package/package/frontend/template-mixins/mixins/index.js +37 -0
- package/package/frontend/template-mixins/mixins/render.js +12 -0
- package/package/frontend/template-mixins/mixins/template-mixins.js +520 -0
- package/package/frontend/template-mixins/partials/forms/checkbox-group.html +47 -0
- package/package/frontend/template-mixins/partials/forms/checkbox.html +16 -0
- package/package/frontend/template-mixins/partials/forms/input-submit.html +1 -0
- package/package/frontend/template-mixins/partials/forms/input-text-date.html +37 -0
- package/package/frontend/template-mixins/partials/forms/input-text-group.html +45 -0
- package/package/frontend/template-mixins/partials/forms/option-group.html +43 -0
- package/package/frontend/template-mixins/partials/forms/select.html +17 -0
- package/package/frontend/template-mixins/partials/forms/textarea-group.html +37 -0
- package/package/frontend/template-mixins/partials/mixins/panel.html +4 -0
- package/package/frontend/template-partials/index.js +9 -0
- package/package/frontend/template-partials/translations/index.js +26 -0
- package/package/frontend/template-partials/translations/src/cy/base.json +4 -0
- package/package/frontend/template-partials/translations/src/cy/buttons.json +6 -0
- package/package/frontend/template-partials/translations/src/cy/cookies.json +104 -0
- package/package/frontend/template-partials/translations/src/cy/errorlist.json +6 -0
- package/package/frontend/template-partials/translations/src/cy/errors.json +18 -0
- package/package/frontend/template-partials/translations/src/cy/terms.json +28 -0
- package/package/frontend/template-partials/translations/src/en/accessibility.json +43 -0
- package/package/frontend/template-partials/translations/src/en/base.json +5 -0
- package/package/frontend/template-partials/translations/src/en/buttons.json +10 -0
- package/package/frontend/template-partials/translations/src/en/cookies.json +116 -0
- package/package/frontend/template-partials/translations/src/en/errorlist.json +7 -0
- package/package/frontend/template-partials/translations/src/en/errors.json +35 -0
- package/package/frontend/template-partials/translations/src/en/exit.json +5 -0
- package/package/frontend/template-partials/translations/src/en/fields.json +5 -0
- package/package/frontend/template-partials/translations/src/en/journey.json +6 -0
- package/package/frontend/template-partials/translations/src/en/save-and-exit.json +4 -0
- package/package/frontend/template-partials/translations/src/en/terms.json +28 -0
- package/package/frontend/template-partials/views/404.html +9 -0
- package/package/frontend/template-partials/views/accessibility.html +55 -0
- package/package/frontend/template-partials/views/confirm.html +8 -0
- package/package/frontend/template-partials/views/confirmation.html +19 -0
- package/package/frontend/template-partials/views/content/en/what-happens-next.md +0 -0
- package/package/frontend/template-partials/views/cookie-error.html +1 -0
- package/package/frontend/template-partials/views/cookies.html +84 -0
- package/package/frontend/template-partials/views/email/data-row.html +4 -0
- package/package/frontend/template-partials/views/email/formatted.html +12 -0
- package/package/frontend/template-partials/views/email/layout.html +63 -0
- package/package/frontend/template-partials/views/email/raw.html +11 -0
- package/package/frontend/template-partials/views/email/section-row.html +3 -0
- package/package/frontend/template-partials/views/error.html +20 -0
- package/package/frontend/template-partials/views/exit.html +9 -0
- package/package/frontend/template-partials/views/feedback-submitted.html +11 -0
- package/package/frontend/template-partials/views/layout.html +55 -0
- package/package/frontend/template-partials/views/partials/analytics-table.html +25 -0
- package/package/frontend/template-partials/views/partials/back.html +5 -0
- package/package/frontend/template-partials/views/partials/bullet-list.html +7 -0
- package/package/frontend/template-partials/views/partials/confirmation-alert.html +6 -0
- package/package/frontend/template-partials/views/partials/continue.html +5 -0
- package/package/frontend/template-partials/views/partials/cookie-banner.html +29 -0
- package/package/frontend/template-partials/views/partials/cookie-notification.html +4 -0
- package/package/frontend/template-partials/views/partials/cookie-settings-button.html +1 -0
- package/package/frontend/template-partials/views/partials/cookie-settings-radio.html +8 -0
- package/package/frontend/template-partials/views/partials/details-summary.html +8 -0
- package/package/frontend/template-partials/views/partials/external-link.html +1 -0
- package/package/frontend/template-partials/views/partials/form.html +10 -0
- package/package/frontend/template-partials/views/partials/gatag.html +60 -0
- package/package/frontend/template-partials/views/partials/head.html +31 -0
- package/package/frontend/template-partials/views/partials/heading.html +11 -0
- package/package/frontend/template-partials/views/partials/items-table.html +32 -0
- package/package/frontend/template-partials/views/partials/maincontent-left.html +10 -0
- package/package/frontend/template-partials/views/partials/navigation.html +8 -0
- package/package/frontend/template-partials/views/partials/page.html +23 -0
- package/package/frontend/template-partials/views/partials/panel-indent.html +3 -0
- package/package/frontend/template-partials/views/partials/session-cookies-table.html +28 -0
- package/package/frontend/template-partials/views/partials/session-timeout-warning.html +38 -0
- package/package/frontend/template-partials/views/partials/summary-table-row.html +14 -0
- package/package/frontend/template-partials/views/partials/summary-table.html +8 -0
- package/package/frontend/template-partials/views/partials/table.html +18 -0
- package/package/frontend/template-partials/views/partials/validation-list.html +3 -0
- package/package/frontend/template-partials/views/partials/validation-summary.html +25 -0
- package/package/frontend/template-partials/views/partials/warn.html +7 -0
- package/package/frontend/template-partials/views/rate-limit-error.html +10 -0
- package/package/frontend/template-partials/views/save-and-exit.html +17 -0
- package/package/frontend/template-partials/views/service-unavailable.html +13 -0
- package/package/frontend/template-partials/views/session-timeout.html +7 -0
- package/package/frontend/template-partials/views/step.html +14 -0
- package/package/frontend/template-partials/views/terms.html +26 -0
- package/package/frontend/themes/gov-uk/client-js/cookieSettings.js +145 -0
- package/package/frontend/themes/gov-uk/client-js/govuk-cookies.js +121 -0
- package/package/frontend/themes/gov-uk/client-js/index.js +27 -0
- package/package/frontend/themes/gov-uk/client-js/session-timeout-dialog.js +348 -0
- package/package/frontend/themes/gov-uk/client-js/skip-to-main.js +19 -0
- package/package/frontend/themes/gov-uk/index.js +9 -0
- package/package/frontend/themes/gov-uk/styles/_base.scss +17 -0
- package/package/frontend/themes/gov-uk/styles/_check_your_answers.scss +155 -0
- package/package/frontend/themes/gov-uk/styles/_cookie-banner.scss +111 -0
- package/package/frontend/themes/gov-uk/styles/_cookie-settings.scss +33 -0
- package/package/frontend/themes/gov-uk/styles/_govuk_frontend_toolkit.scss +23 -0
- package/package/frontend/themes/gov-uk/styles/_helpers.scss +5 -0
- package/package/frontend/themes/gov-uk/styles/_layout.scss +125 -0
- package/package/frontend/themes/gov-uk/styles/_panel-indent.scss +27 -0
- package/package/frontend/themes/gov-uk/styles/_pdf.scss +42 -0
- package/package/frontend/themes/gov-uk/styles/_session-timeout-dialog.scss +121 -0
- package/package/frontend/themes/gov-uk/styles/_typography.scss +27 -0
- package/package/frontend/themes/gov-uk/styles/_variables.scss +11 -0
- package/package/frontend/themes/gov-uk/styles/govuk.scss +43 -0
- package/package/frontend/themes/gov-uk/styles/mixins.scss +16 -0
- package/package/frontend/themes/gov-uk/styles/modules/_alerts.scss +73 -0
- package/package/frontend/themes/gov-uk/styles/modules/_buttons.scss +5 -0
- package/package/frontend/themes/gov-uk/styles/modules/_character-count.scss +8 -0
- package/package/frontend/themes/gov-uk/styles/modules/_confirm-page.scss +20 -0
- package/package/frontend/themes/gov-uk/styles/modules/_lists.scss +5 -0
- package/package/frontend/themes/gov-uk/styles/modules/_progressive-reveal.scss +17 -0
- package/package/frontend/themes/gov-uk/styles/modules/_validation.scss +51 -0
- package/package/frontend/themes/index.js +5 -0
- package/package/frontend/toolkit/assets/images/passports/new-window-link-blue.png +0 -0
- package/package/frontend/toolkit/assets/images/passports/new-window-link.png +0 -0
- package/package/frontend/toolkit/assets/images/spinner.gif +0 -0
- package/package/frontend/toolkit/assets/javascript/character-count.js +99 -0
- package/package/frontend/toolkit/assets/javascript/form-focus.js +101 -0
- package/package/frontend/toolkit/assets/javascript/helpers.js +177 -0
- package/package/frontend/toolkit/assets/javascript/progressive-reveal.js +72 -0
- package/package/frontend/toolkit/assets/javascript/validation.js +71 -0
- package/package/frontend/toolkit/assets/javascript/vendor/details.polyfill.js +189 -0
- package/package/frontend/toolkit/assets/javascript/vendor/indexof.polyfill.js +39 -0
- package/package/frontend/toolkit/assets/javascript/vendor/safari-cachebuster.js +6 -0
- package/package/frontend/toolkit/assets/stylesheets/_base.scss +17 -0
- package/package/frontend/toolkit/assets/stylesheets/_helpers.scss +5 -0
- package/package/frontend/toolkit/assets/stylesheets/_layout.scss +118 -0
- package/package/frontend/toolkit/assets/stylesheets/_typography.scss +27 -0
- package/package/frontend/toolkit/assets/stylesheets/_variables.scss +11 -0
- package/package/frontend/toolkit/assets/stylesheets/app.scss +30 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_buttons.scss +47 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_details.scss +38 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_elements-typography.scss +175 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_forms.scss +167 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_helpers.scss +39 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_layout.scss +67 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_lists.scss +40 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_panels.scss +29 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_reset.scss +33 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_tables.scss +33 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-block-labels.scss +63 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-date.scss +39 -0
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-validation.scss +63 -0
- package/package/frontend/toolkit/assets/stylesheets/mixins.scss +16 -0
- package/package/frontend/toolkit/assets/stylesheets/modules/_alerts.scss +73 -0
- package/package/frontend/toolkit/assets/stylesheets/modules/_buttons.scss +5 -0
- package/package/frontend/toolkit/assets/stylesheets/modules/_confirm-page.scss +20 -0
- package/package/frontend/toolkit/assets/stylesheets/modules/_lists.scss +5 -0
- package/package/frontend/toolkit/assets/stylesheets/modules/_progressive-reveal.scss +17 -0
- package/package/frontend/toolkit/assets/stylesheets/modules/_validation.scss +51 -0
- package/package/frontend/toolkit/index.js +10 -0
- package/package/index.js +351 -0
- package/package/lib/deindex.js +18 -0
- package/package/lib/encryption.js +23 -0
- package/package/lib/ga-tag.js +89 -0
- package/package/lib/health.js +26 -0
- package/package/lib/helpers.js +66 -0
- package/package/lib/logger.js +65 -0
- package/package/lib/markdown.js +46 -0
- package/package/lib/router.js +111 -0
- package/package/lib/serve-static.js +12 -0
- package/package/lib/sessions.js +82 -0
- package/package/lib/settings.js +74 -0
- package/package/lib/which.js +28 -0
- package/package/middleware/cookies.js +43 -0
- package/package/middleware/deep-translate.js +32 -0
- package/package/middleware/errors.js +119 -0
- package/package/middleware/index.js +10 -0
- package/package/middleware/not-found.js +38 -0
- package/package/middleware/rate-limiter.js +98 -0
- package/package/middleware/service-unavailable.js +64 -0
- package/package/model/apis/axios-settings.js +21 -0
- package/package/model/apis/html-to-pdf-converter.js +35 -0
- package/package/model/apis/index.js +5 -0
- package/package/model/index.js +348 -0
- package/package/package.json +147 -0
- package/package/sandbox/README.md +66 -0
- package/package/sandbox/apps/sandbox/behaviours/clear-session.js +8 -0
- package/package/sandbox/apps/sandbox/behaviours/country-select.js +10 -0
- package/package/sandbox/apps/sandbox/behaviours/international-number.js +22 -0
- package/package/sandbox/apps/sandbox/fields.js +128 -0
- package/package/sandbox/apps/sandbox/index.js +99 -0
- package/package/sandbox/apps/sandbox/lib/staticAppealStages.js +189 -0
- package/package/sandbox/apps/sandbox/sections/summary-data-sections.js +43 -0
- package/package/sandbox/apps/sandbox/translations/src/en/errors.json +5 -0
- package/package/sandbox/apps/sandbox/translations/src/en/exit.json +4 -0
- package/package/sandbox/apps/sandbox/translations/src/en/fields.json +101 -0
- package/package/sandbox/apps/sandbox/translations/src/en/journey.json +7 -0
- package/package/sandbox/apps/sandbox/translations/src/en/pages.json +72 -0
- package/package/sandbox/apps/sandbox/translations/src/en/validation.json +54 -0
- package/package/sandbox/apps/sandbox/views/form-guidance-link.html +8 -0
- package/package/sandbox/apps/sandbox/views/save-and-exit.html +19 -0
- package/package/sandbox/assets/images/icons/icon-caret-left.png +0 -0
- package/package/sandbox/assets/images/icons/icon-complete.png +0 -0
- package/package/sandbox/assets/images/icons/icon-cross-remove-sign.png +0 -0
- package/package/sandbox/assets/js/index.js +70 -0
- package/package/sandbox/assets/scss/app.scss +27 -0
- package/package/sandbox/codecept.conf.js +15 -0
- package/package/sandbox/config.js +17 -0
- package/package/sandbox/package.json +26 -0
- package/package/sandbox/server.js +23 -0
- package/package/sandbox/yarn.lock +262 -0
- package/package/transpiler/index.js +2 -0
- package/package/transpiler/lib/aggregate.js +32 -0
- package/package/transpiler/lib/build.js +15 -0
- package/package/transpiler/lib/compile.js +12 -0
- package/package/transpiler/lib/expand-dirs.js +14 -0
- package/package/transpiler/lib/write-files.js +24 -0
- package/package/utilities/autofill/index.js +189 -0
- package/package/utilities/autofill/inputs.js +60 -0
- package/package/utilities/countries.js +12 -0
- package/package/utilities/helpers/index.js +189 -0
- package/package/utilities/index.js +9 -0
- package/package/utilities/reqres/index.js +18 -0
- package/package/utilities/test-data/data/domain.json +7 -0
- package/package/utilities/test-data/data/firstname.json +16 -0
- package/package/utilities/test-data/data/lastname.json +10 -0
- package/package/utilities/test-data/data/postcode.json +12 -0
- package/package/utilities/test-data/data/streetname.json +8 -0
- package/package/utilities/test-data/data/streetsuffix.json +7 -0
- package/package/utilities/test-data/data/town.json +9 -0
- package/package/utilities/test-data/index.js +67 -0
- package/package/wizard/behaviours/complete.js +20 -0
- package/package/wizard/behaviours/index.js +5 -0
- package/package/wizard/index.js +124 -0
- package/package/wizard/middleware/back-links.js +68 -0
- package/package/wizard/middleware/check-complete.js +13 -0
- package/package/wizard/middleware/check-progress.js +139 -0
- package/package/wizard/middleware/check-session.js +17 -0
- package/package/wizard/middleware/csrf.js +47 -0
- package/package/wizard/middleware/session-model.js +11 -0
- package/package/wizard/middleware/session.js +9 -0
- package/package/wizard/model.js +29 -0
- package/package/wizard/util/constants.js +5 -0
- package/package/wizard/util/helpers.js +19 -0
- package/package.json +5 -6
- package/.editorconfig +0 -10
- package/.github/workflows/automate-publish.yml +0 -38
- package/.github/workflows/automate-tag.yml +0 -78
- package/.istanbul.yml +0 -20
- package/codeReviewChecklist.md +0 -22
- package/pull_request_template.md +0 -16
@@ -0,0 +1,32 @@
|
|
1
|
+
{{#hasItems}}
|
2
|
+
<div class="loop-summary-table">
|
3
|
+
{{#items}}
|
4
|
+
<table class="govuk-table">
|
5
|
+
<thead class="govuk-table__head">
|
6
|
+
<tr class="govuk-table__row">
|
7
|
+
<th scope="col" class="govuk-table__header data-col" colspan="2">{{itemTitle}}</th>
|
8
|
+
<th scope="col" class="govuk-table__header action-col">
|
9
|
+
<a href="{{baseUrl}}/{{route}}/edit/{{index}}">{{#t}}buttons.edit{{/t}}<span class="visuallyhidden"> {{itemTitle}}</span></a>
|
10
|
+
</th>
|
11
|
+
<th scope="col" class="govuk-table__header action-col">
|
12
|
+
<a href="{{baseUrl}}/{{route}}/delete/{{index}}">{{#t}}buttons.delete{{/t}}<span
|
13
|
+
class="visuallyhidden"> {{itemTitle}}</span></a>
|
14
|
+
</th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody class="govuk-table__body">
|
18
|
+
{{#fields}}
|
19
|
+
{{#showInSummary}}
|
20
|
+
<tr class="govuk-table__row">
|
21
|
+
<td class="govuk-table__cell" class="govuk-table__header data-col">{{#t}}fields.{{field}}{{/t}}</td>
|
22
|
+
<td></td>
|
23
|
+
<td class="govuk-table__cell" class="govuk-table__header data-col">{{#parsed}}{{parsed}}{{/parsed}}{{^parsed}}{{value}}{{/parsed}}</td>
|
24
|
+
<td></td>
|
25
|
+
</tr>
|
26
|
+
{{/showInSummary}}
|
27
|
+
{{/fields}}
|
28
|
+
</tbody>
|
29
|
+
</table>
|
30
|
+
{{/items}}
|
31
|
+
</div>
|
32
|
+
{{/hasItems}}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{{$content-outer}}
|
2
|
+
{{$preloader}}{{/preloader}}
|
3
|
+
<div class="govuk-grid-column-two-thirds">
|
4
|
+
{{$validationSummary}}{{/validationSummary}}
|
5
|
+
{{#captionHeading}}<span class="govuk-caption-l">{{captionHeading}}</span>{{/captionHeading}}
|
6
|
+
{{#header}}<h1 class="govuk-heading-l">{{header}}</h1>{{/header}}
|
7
|
+
{{#subHeading}}<div id="page-header"><h2 class="govuk-heading-m">{{subHeading}}</h2></div>{{/subHeading}}
|
8
|
+
{{$content}}{{/content}}
|
9
|
+
</div>
|
10
|
+
{{/content-outer}}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="govuk-header__content">
|
2
|
+
{{#startPageRedirectUrl}}
|
3
|
+
<a href="{{startPageRedirectUrl}}" class="govuk-header__link govuk-header__link--service-name" id="proposition-name">{{$journeyHeader}}{{/journeyHeader}}</a>
|
4
|
+
{{/startPageRedirectUrl}}
|
5
|
+
{{^startPageRedirectUrl}}
|
6
|
+
<a href="{{journeyHeaderURL}}" class="govuk-header__link govuk-header__link--service-name" id="proposition-name">{{$journeyHeader}}{{/journeyHeader}}</a>
|
7
|
+
{{/startPageRedirectUrl}}
|
8
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{{<layout}}
|
2
|
+
{{$journeyHeader}}
|
3
|
+
{{#t}}journey.header{{/t}}
|
4
|
+
{{/journeyHeader}}
|
5
|
+
|
6
|
+
{{$validationSummary}}
|
7
|
+
{{> partials-validation-summary}}
|
8
|
+
{{/validationSummary}}
|
9
|
+
|
10
|
+
{{$propositionHeader}}
|
11
|
+
{{> partials-navigation}}
|
12
|
+
{{/propositionHeader}}
|
13
|
+
|
14
|
+
{{$header}}{{{title}}}{{/header}}
|
15
|
+
{{$content}}
|
16
|
+
{{<partials-form}}
|
17
|
+
{{$form}}
|
18
|
+
{{$page-content}}{{/page-content}}
|
19
|
+
{{> partials-session-timeout-warning}}
|
20
|
+
{{/form}}
|
21
|
+
{{/partials-form}}
|
22
|
+
{{/content}}
|
23
|
+
{{/layout}}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<table class="govuk-table">
|
2
|
+
<thead class="govuk-table__head">
|
3
|
+
<tr class="govuk-table__row">
|
4
|
+
{{#headers}}
|
5
|
+
<th scope="col" class="govuk-table__header app-custom-class">{{.}}</th>
|
6
|
+
{{/headers}}
|
7
|
+
</tr>
|
8
|
+
</thead>
|
9
|
+
<tbody>
|
10
|
+
<tr class="govuk-table__row">
|
11
|
+
{{#cookieName}}
|
12
|
+
<td scope="row" class="govuk-table__header">{{cookieName}}</td>
|
13
|
+
{{/cookieName}}
|
14
|
+
{{^cookieName}}
|
15
|
+
<td>{{defaultCookieName}}</td>
|
16
|
+
{{/cookieName}}
|
17
|
+
<td>{{defaultCookiePurpose}}</td>
|
18
|
+
<td>{{defaultCookieExpires}}</td>
|
19
|
+
</tr>
|
20
|
+
{{#rows}}
|
21
|
+
<tr>
|
22
|
+
{{#.}}
|
23
|
+
<td>{{.}}</td>
|
24
|
+
{{/.}}
|
25
|
+
</tr>
|
26
|
+
{{/rows}}
|
27
|
+
</tbody>
|
28
|
+
</table>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class="govuk-timeout-warning-fallback">
|
2
|
+
<p>We will reset your application if you do not complete the page and press continue
|
3
|
+
in 5 minutes.</p>
|
4
|
+
<p>We do this to keep your information secure.</p>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<dialog id="js-modal-dialog" data-session-timeout="{{sessionTimeOut}}" data-session-timeout-warning="{{sessionTimeOutWarning}}"
|
8
|
+
data-url-redirect="/session-timeout" class="modal-dialog dialog" role="dialog"
|
9
|
+
aria-live="polite" aria-labelledby="dialog-title" aria-describedby="at-timer">
|
10
|
+
<div class="modal-dialog__inner">
|
11
|
+
{{^showSaveAndExit}}
|
12
|
+
<h2 id="dialog-title" class="govuk-heading-l">
|
13
|
+
{{#dialogTitle}}{{#t}}pages.session-timeout-warning.dialog-title{{/t}}{{/dialogTitle}}{{^dialogTitle}}Your page will time out soon{{/dialogTitle}}
|
14
|
+
</h2>
|
15
|
+
<div class="govuk-body">
|
16
|
+
<div id="timer" class="timer" aria-hidden="true" aria-relevant="additions"></div>
|
17
|
+
<div id="at-timer" class="at-timer govuk-visually-hidden" role="status"></div>
|
18
|
+
<p class="dialog-text-prefix visually-hidden">To protect your information, this page will time out in </p>
|
19
|
+
<p class="dialog-text visually-hidden">{{#dialogText}}{{#t}}pages.session-timeout-warning.dialog-text{{/t}}{{/dialogText}}{{^dialogText}}If that happens, your progress will not be saved.{{/dialogText}}</p>
|
20
|
+
</div>
|
21
|
+
<button class="govuk-button dialog-button js-dialog-close" id="timeout-continue-button" data-module="govuk-button">{{#timeoutContinueButton}}{{#t}}pages.session-timeout-warning.timeout-continue-button{{/t}}{{/timeoutContinueButton}}{{^timeoutContinueButton}}Stay on this page{{/timeoutContinueButton}}</button>
|
22
|
+
<a href="{{baseUrl}}{{exitStep}}" class="govuk-link dialog-exit-link" role="button">{{#dialogExitLink}}{{#t}}pages.session-timeout-warning.dialog-exit-link{{/t}}{{/dialogExitLink}}{{^dialogExitLink}}Exit this form{{/dialogExitLink}}</a>
|
23
|
+
{{/showSaveAndExit}}
|
24
|
+
{{#showSaveAndExit}}
|
25
|
+
<h2 id="dialog-title" class="govuk-heading-l">
|
26
|
+
{{#dialogTitle}}{{#t}}pages.session-timeout-warning.dialog-title{{/t}}{{/dialogTitle}}{{^dialogTitle}}You will be signed out soon{{/dialogTitle}}
|
27
|
+
</h2>
|
28
|
+
<div class="govuk-body">
|
29
|
+
<div id="timer" class="timer" aria-hidden="true" aria-relevant="additions"></div>
|
30
|
+
<div id="at-timer" class="at-timer govuk-visually-hidden" role="status"></div>
|
31
|
+
<p class="dialog-text-prefix visually-hidden">To protect your information, you will be signed out in </p>
|
32
|
+
<p class="dialog-text visually-hidden">{{#dialogText}}{{#t}}pages.session-timeout-warning.dialog-text{{/t}}{{/dialogText}}{{^dialogText}}Any answers you have saved will not be affected, but your progress on this page will not be saved.{{/dialogText}}</p>
|
33
|
+
</div>
|
34
|
+
<button class="govuk-button dialog-button js-dialog-close" id="timeout-continue-button" data-module="govuk-button">{{#timeoutContinueButton}}{{#t}}pages.session-timeout-warning.timeout-continue-button{{/t}}{{/timeoutContinueButton}}{{^timeoutContinueButton}}Stay signed in{{/timeoutContinueButton}}</button>
|
35
|
+
<a href="{{baseUrl}}{{saveAndExitStep}}" class="govuk-link dialog-exit-link" role="button">{{#dialogExitLink}}{{#t}}pages.session-timeout-warning.dialog-exit-link{{/t}}{{/dialogExitLink}}{{^dialogExitLink}}Sign out{{/dialogExitLink}}</a>
|
36
|
+
{{/showSaveAndExit}}
|
37
|
+
</div>
|
38
|
+
</dialog>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="confirm-row">
|
2
|
+
{{#isSeparator}}
|
3
|
+
{{/isSeparator}}
|
4
|
+
{{^isSeparator}}
|
5
|
+
<dt class="confirm-label">{{label}}</dt>
|
6
|
+
<dd class="confirm-value" data-value="{{value}}">{{value}}</dd>
|
7
|
+
{{#changeLink}}
|
8
|
+
<dd><span><a class="govuk-link" href="{{changeLink}}" id="{{field}}-change-{{index}}">{{#t}}buttons.change{{/t}} <span class="visuallyhidden">{{changeLinkDescription}} from {{value}}</span></a></span></dd>
|
9
|
+
{{/changeLink}}
|
10
|
+
{{^changeLink}}
|
11
|
+
<dd><span><a class="govuk-link" href="{{baseUrl}}{{step}}/edit#{{field}}" id="{{field}}-change">{{#t}}buttons.change{{/t}} <span class="visuallyhidden">{{changeLinkDescription}} from {{value}}</span></a></span></dd>
|
12
|
+
{{/changeLink}}
|
13
|
+
{{/isSeparator}}
|
14
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<table class="govuk-table">
|
2
|
+
<thead class="govuk-table__head">
|
3
|
+
<tr class="govuk-table__row">
|
4
|
+
{{#headers}}
|
5
|
+
<th scope="col" class="govuk-table__header app-custom-class">{{.}}</th>
|
6
|
+
{{/headers}}
|
7
|
+
</tr>
|
8
|
+
</thead>
|
9
|
+
<tbody class="govuk-table__body">
|
10
|
+
{{#rows}}
|
11
|
+
<tr class="govuk-table__row">
|
12
|
+
{{#.}}
|
13
|
+
<td class="govuk-table__cell">{{.}}</td>
|
14
|
+
{{/.}}
|
15
|
+
</tr>
|
16
|
+
{{/rows}}
|
17
|
+
</tbody>
|
18
|
+
</table>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{{#errorlist.length}}
|
2
|
+
<div class="govuk-error-summary" aria-labelledby="error-summary-title" data-module="govuk-error-summary" role="alert" tabindex="-1">
|
3
|
+
{{$errorlist-title}}
|
4
|
+
|
5
|
+
{{#errorLength.single}}
|
6
|
+
<h2 class="govuk-error-summary__title" id="error-summary-title">{{#t}}errorlist.title.single{{/t}}</h2>
|
7
|
+
{{/errorLength.single}}
|
8
|
+
{{#errorLength.multiple}}
|
9
|
+
<h2 class="govuk-error-summary__title" id="error-summary-title">{{#t}}errorlist.title.multiple{{/t}}</h2>
|
10
|
+
{{/errorLength.multiple}}
|
11
|
+
|
12
|
+
{{/errorlist-title}}
|
13
|
+
<div class="govuk-error-summary__body">
|
14
|
+
{{<partials-validation-list}}
|
15
|
+
{{$validation-list}}
|
16
|
+
{{#errorlist}}
|
17
|
+
{{#message}}
|
18
|
+
<li><a href="#{{errorLinkId}}">{{ message }}</a></li>
|
19
|
+
{{/message}}
|
20
|
+
{{/errorlist}}
|
21
|
+
{{/validation-list}}
|
22
|
+
{{/partials-validation-list}}
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
{{/errorlist.length}}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{{<layout}}
|
2
|
+
{{$header}}
|
3
|
+
{{content.title}}
|
4
|
+
{{/header}}
|
5
|
+
{{$content}}
|
6
|
+
<p>{{content.message}}</p>
|
7
|
+
<p>{{content.preTimeToWait}}{{content.timeToWait}}{{content.postTimeToWait}}</p>
|
8
|
+
<a href="/" class="button" role="button">{{#t}}buttons.try-again{{/t}}</a>
|
9
|
+
{{/content}}
|
10
|
+
{{/layout}}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{{<layout}}
|
2
|
+
{{$journeyHeader}}
|
3
|
+
{{#t}}journey.header{{/t}}
|
4
|
+
{{/journeyHeader}}
|
5
|
+
|
6
|
+
{{$propositionHeader}}
|
7
|
+
{{> partials-navigation}}
|
8
|
+
{{/propositionHeader}}
|
9
|
+
|
10
|
+
{{$header}}
|
11
|
+
{{header}}
|
12
|
+
{{/header}}
|
13
|
+
|
14
|
+
{{$content}}
|
15
|
+
<p>{{#saveExitFormContent}}{{#t}}pages.save-and-exit.message{{/t}}{{/saveExitFormContent}}{{^saveExitFormContent}}{{{message}}}{{/saveExitFormContent}}</p>
|
16
|
+
{{/content}}
|
17
|
+
{{/layout}}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{{<error}}
|
2
|
+
{{$content}}
|
3
|
+
<h1 class="govuk-heading-l">{{title}}</h1>
|
4
|
+
<p class="govuk-body">{{{message}}}</p>
|
5
|
+
<p class="govuk-body">{{{answers-saved}}}</p>
|
6
|
+
{{#contact}}
|
7
|
+
<p class="govuk-body">{{{contact}}}</p>
|
8
|
+
{{/contact}}
|
9
|
+
{{#alternative}}
|
10
|
+
<p class="govuk-body">{{{alternative}}}</p>
|
11
|
+
{{/alternative}}
|
12
|
+
{{/content}}
|
13
|
+
{{/error}}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{{<partials-page}}
|
2
|
+
{{$page-content}}
|
3
|
+
{{#beforeFields}}
|
4
|
+
{{beforeFields}}
|
5
|
+
{{/beforeFields}}
|
6
|
+
{{#fields}}
|
7
|
+
{{#renderField}}{{/renderField}}
|
8
|
+
{{/fields}}
|
9
|
+
{{#afterFields}}
|
10
|
+
{{afterFields}}
|
11
|
+
{{/afterFields}}
|
12
|
+
{{#input-submit}}continue{{/input-submit}}
|
13
|
+
{{/page-content}}
|
14
|
+
{{/partials-page}}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{{<layout}}
|
2
|
+
|
3
|
+
{{$propositionHeader}}{{/propositionHeader}}
|
4
|
+
|
5
|
+
{{$header}}
|
6
|
+
{{header}}
|
7
|
+
{{/header}}
|
8
|
+
|
9
|
+
{{$content}}
|
10
|
+
<h2>{{how-we-use}}</h2>
|
11
|
+
{{#data-link}}
|
12
|
+
{{> partials-external-link}}
|
13
|
+
{{/data-link}}
|
14
|
+
<p>{{used-for}}</p>
|
15
|
+
{{#used-for-list}}
|
16
|
+
{{> partials-bullet-list}}
|
17
|
+
{{/used-for-list}}
|
18
|
+
<p>{{your-info}}</p>
|
19
|
+
{{#your-info-list}}
|
20
|
+
{{> partials-bullet-list}}
|
21
|
+
{{/your-info-list}}
|
22
|
+
<p>{{info-gathered}}</p>
|
23
|
+
<h2>{{countries}}</h2>
|
24
|
+
<p>{{countries-text}}</p>
|
25
|
+
{{/content}}
|
26
|
+
{{/layout}}
|
@@ -0,0 +1,145 @@
|
|
1
|
+
/* eslint-disable max-len, no-var, vars-on-top, no-undef */
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
// TODO: update package.json(s)
|
5
|
+
|
6
|
+
function hideFallbackContent(containerId) {
|
7
|
+
var container = document.getElementById(containerId);
|
8
|
+
if (container === null) return;
|
9
|
+
var fallbackContent = container.getElementsByClassName('js-disabled');
|
10
|
+
for (var i = 0; i < fallbackContent.length; i++) {
|
11
|
+
fallbackContent[i].style.display = 'none';
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
function showInteractiveContent(containerId) {
|
16
|
+
var container = document.getElementById(containerId);
|
17
|
+
if (container === null) return;
|
18
|
+
var interactiveContent = container.getElementsByClassName('js-enabled');
|
19
|
+
for (var i = 0; i < interactiveContent.length; i++) {
|
20
|
+
interactiveContent[i].style.display = 'block';
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
function setCookiePreferences(preferences) {
|
25
|
+
GOVUK.cookie('cookie_preferences', JSON.stringify(preferences), { days: 30 });
|
26
|
+
|
27
|
+
if (!preferences.usage) {
|
28
|
+
GOVUK.cookie('_ga', null);
|
29
|
+
GOVUK.cookie('_gat', null);
|
30
|
+
GOVUK.cookie('_gid', null);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
function showCookieBannerSubmitted() {
|
35
|
+
document.getElementById('cookie-banner-info').style.display = 'none';
|
36
|
+
document.getElementById('cookie-banner-actions').style.display = 'none';
|
37
|
+
var cookieBannerSubmitted = document.getElementById('cookie-banner-submitted');
|
38
|
+
cookieBannerSubmitted.style.display = 'block';
|
39
|
+
cookieBannerSubmitted.focus();
|
40
|
+
}
|
41
|
+
|
42
|
+
function initialiseBannerButtons() {
|
43
|
+
document.getElementById('accept-cookies-button').addEventListener('click', function () {
|
44
|
+
setCookiePreferences({essential: true, usage: true});
|
45
|
+
showCookieBannerSubmitted();
|
46
|
+
sessionStorage.setItem('reloading', 'true');
|
47
|
+
window.location = document.URL;
|
48
|
+
});
|
49
|
+
|
50
|
+
document.getElementById('reject-cookies-button').addEventListener('click', function () {
|
51
|
+
setCookiePreferences({essential: true, usage: false});
|
52
|
+
showCookieBannerSubmitted();
|
53
|
+
});
|
54
|
+
|
55
|
+
document.getElementById('hide-cookie-banner').addEventListener('click', function () {
|
56
|
+
document.getElementById('cookie-banner').style.display = 'none';
|
57
|
+
});
|
58
|
+
}
|
59
|
+
|
60
|
+
function initialiseCookieBanner() {
|
61
|
+
var preferences = GOVUK.cookie('cookie_preferences');
|
62
|
+
|
63
|
+
if (preferences !== null) {
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
|
67
|
+
// the default cookie message container from hof-govuk-template
|
68
|
+
var bannerContainer = document.getElementById('global-cookie-message');
|
69
|
+
|
70
|
+
// the cookie banner that will replace the container's default content if using google analytics
|
71
|
+
var cookieBanner = document.getElementById('cookie-banner');
|
72
|
+
|
73
|
+
if (bannerContainer !== null && cookieBanner !== null) {
|
74
|
+
hideFallbackContent('global-cookie-message');
|
75
|
+
showInteractiveContent('global-cookie-message');
|
76
|
+
bannerContainer.style.display = 'block';
|
77
|
+
initialiseBannerButtons();
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
function handleSaveSettings(e) {
|
82
|
+
e.preventDefault();
|
83
|
+
setCookiePreferences({ essential: true, usage: document.getElementById('radio-1').checked });
|
84
|
+
|
85
|
+
var cookieNotification = document.getElementById('cookie-notification');
|
86
|
+
var cookieBanner = document.getElementById('cookie-banner');
|
87
|
+
|
88
|
+
if (cookieBanner !== null) {
|
89
|
+
cookieBanner.style.display = 'none';
|
90
|
+
}
|
91
|
+
|
92
|
+
if (cookieNotification !== null) {
|
93
|
+
cookieNotification.style.display = 'block';
|
94
|
+
cookieNotification.focus();
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
function initialiseFormControls() {
|
99
|
+
var preferences = JSON.parse(GOVUK.cookie('cookie_preferences'));
|
100
|
+
var usage;
|
101
|
+
|
102
|
+
if (preferences !== null && preferences.usage !== undefined && typeof preferences.usage === 'boolean') {
|
103
|
+
usage = preferences.usage;
|
104
|
+
} else {
|
105
|
+
usage = false;
|
106
|
+
}
|
107
|
+
|
108
|
+
document.getElementById('radio-1').checked = usage;
|
109
|
+
document.getElementById('radio-2').checked = !usage;
|
110
|
+
document.getElementById('save-cookie-settings').addEventListener('click', handleSaveSettings);
|
111
|
+
}
|
112
|
+
|
113
|
+
function initialiseCookiePage() {
|
114
|
+
var shouldDisplayCookieControls = document.getElementById('cookie-settings') !== null;
|
115
|
+
|
116
|
+
if (shouldDisplayCookieControls) {
|
117
|
+
hideFallbackContent('cookie-settings');
|
118
|
+
showInteractiveContent('cookie-settings');
|
119
|
+
initialiseFormControls();
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
function onLoad() {
|
124
|
+
window.onload = function () {
|
125
|
+
var reloading = sessionStorage.getItem('reloading');
|
126
|
+
if (reloading) {
|
127
|
+
sessionStorage.removeItem('reloading');
|
128
|
+
|
129
|
+
var bannerContainer = document.getElementById('global-cookie-message');
|
130
|
+
var cookieBanner = document.getElementById('cookie-banner');
|
131
|
+
|
132
|
+
if (bannerContainer !== null && cookieBanner !== null) {
|
133
|
+
bannerContainer.style.display = 'block';
|
134
|
+
}
|
135
|
+
initialiseBannerButtons();
|
136
|
+
showCookieBannerSubmitted();
|
137
|
+
}
|
138
|
+
};
|
139
|
+
}
|
140
|
+
|
141
|
+
module.exports = {
|
142
|
+
initialiseCookieBanner: initialiseCookieBanner,
|
143
|
+
initialiseCookiePage: initialiseCookiePage,
|
144
|
+
onLoad: onLoad
|
145
|
+
};
|
@@ -0,0 +1,121 @@
|
|
1
|
+
/* eslint-disable no-undef, no-param-reassign, no-unused-vars */
|
2
|
+
(function () {
|
3
|
+
'use strict';
|
4
|
+
const root = this;
|
5
|
+
if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }
|
6
|
+
|
7
|
+
/*
|
8
|
+
Cookie methods
|
9
|
+
==============
|
10
|
+
|
11
|
+
Usage:
|
12
|
+
|
13
|
+
Setting a cookie:
|
14
|
+
GOVUK.cookie('hobnob', 'tasty', { days: 30 });
|
15
|
+
|
16
|
+
Reading a cookie:
|
17
|
+
GOVUK.cookie('hobnob');
|
18
|
+
|
19
|
+
Deleting a cookie:
|
20
|
+
GOVUK.cookie('hobnob', null);
|
21
|
+
*/
|
22
|
+
GOVUK.cookie = function (name, value, options) {
|
23
|
+
if(typeof value !== 'undefined') {
|
24
|
+
if(value === false || value === null) {
|
25
|
+
return GOVUK.setCookie(name, '', { days: -1 });
|
26
|
+
}
|
27
|
+
return GOVUK.setCookie(name, value, options);
|
28
|
+
}
|
29
|
+
return GOVUK.getCookie(name);
|
30
|
+
};
|
31
|
+
GOVUK.setCookie = function (name, value, options) {
|
32
|
+
if(typeof options === 'undefined') {
|
33
|
+
options = {};
|
34
|
+
}
|
35
|
+
let cookieString = name + '=' + value + '; path=/';
|
36
|
+
if (options.days) {
|
37
|
+
const date = new Date();
|
38
|
+
date.setTime(date.getTime() + (options.days * 24 * 60 * 60 * 1000));
|
39
|
+
cookieString = cookieString + '; expires=' + date.toGMTString();
|
40
|
+
}
|
41
|
+
if (document.location.protocol === 'https:') {
|
42
|
+
cookieString = cookieString + '; Secure';
|
43
|
+
}
|
44
|
+
document.cookie = cookieString;
|
45
|
+
};
|
46
|
+
GOVUK.getCookie = function (name) {
|
47
|
+
const nameEQ = name + '=';
|
48
|
+
const cookies = document.cookie.split(';');
|
49
|
+
for(let i = 0, len = cookies.length; i < len; i++) {
|
50
|
+
let cookie = cookies[i];
|
51
|
+
while (cookie.charAt(0) === ' ') {
|
52
|
+
cookie = cookie.substring(1, cookie.length);
|
53
|
+
}
|
54
|
+
if (cookie.indexOf(nameEQ) === 0) {
|
55
|
+
return decodeURIComponent(cookie.substring(nameEQ.length));
|
56
|
+
}
|
57
|
+
}
|
58
|
+
return null;
|
59
|
+
};
|
60
|
+
}).call(this);
|
61
|
+
(function () {
|
62
|
+
'use strict';
|
63
|
+
const root = this;
|
64
|
+
if (typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }
|
65
|
+
|
66
|
+
GOVUK.addCookieMessage = function () {
|
67
|
+
const message = document.getElementById('global-cookie-message');
|
68
|
+
|
69
|
+
const hasCookieMessage = (message && GOVUK.cookie('seen_cookie_message') === null);
|
70
|
+
|
71
|
+
if (hasCookieMessage) {
|
72
|
+
message.style.display = 'block';
|
73
|
+
GOVUK.cookie('seen_cookie_message', 'yes', { days: 28 });
|
74
|
+
|
75
|
+
document.addEventListener('DOMContentLoaded', function (event) {
|
76
|
+
if (GOVUK.analytics && typeof GOVUK.analytics.trackEvent === 'function') {
|
77
|
+
GOVUK.analytics.trackEvent('cookieBanner', 'Cookie banner shown', {
|
78
|
+
value: 1,
|
79
|
+
nonInteraction: true
|
80
|
+
});
|
81
|
+
}
|
82
|
+
});
|
83
|
+
}
|
84
|
+
};
|
85
|
+
}).call(this)
|
86
|
+
;
|
87
|
+
(function () {
|
88
|
+
'use strict';
|
89
|
+
|
90
|
+
// add cookie message
|
91
|
+
if (window.GOVUK && GOVUK.addCookieMessage) {
|
92
|
+
GOVUK.addCookieMessage();
|
93
|
+
}
|
94
|
+
|
95
|
+
// header navigation toggle
|
96
|
+
if (document.querySelectorAll && document.addEventListener) {
|
97
|
+
const els = document.querySelectorAll('.js-header-toggle');
|
98
|
+
let i; let _i;
|
99
|
+
for(i = 0, _i = els.length; i < _i; i++) {
|
100
|
+
els[i].addEventListener('click', function (e) {
|
101
|
+
e.preventDefault();
|
102
|
+
const target = document.getElementById(this.getAttribute('href').substr(1));
|
103
|
+
const targetClass = target.getAttribute('class') || '';
|
104
|
+
const sourceClass = this.getAttribute('class') || '';
|
105
|
+
|
106
|
+
if(targetClass.indexOf('js-visible') !== -1) {
|
107
|
+
target.setAttribute('class', targetClass.replace(/(^|\s)js-visible(\s|$)/, ''));
|
108
|
+
} else {
|
109
|
+
target.setAttribute('class', targetClass + ' js-visible');
|
110
|
+
}
|
111
|
+
if(sourceClass.indexOf('js-visible') !== -1) {
|
112
|
+
this.setAttribute('class', sourceClass.replace(/(^|\s)js-visible(\s|$)/, ''));
|
113
|
+
} else {
|
114
|
+
this.setAttribute('class', sourceClass + ' js-visible');
|
115
|
+
}
|
116
|
+
this.setAttribute('aria-expanded', this.getAttribute('aria-expanded') !== 'true');
|
117
|
+
target.setAttribute('aria-hidden', target.getAttribute('aria-hidden') === 'false');
|
118
|
+
});
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}).call(this);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/* eslint-disable no-var, vars-on-top, no-unused-vars */
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
var toolkit = require('../../../toolkit');
|
5
|
+
var helpers = toolkit.helpers;
|
6
|
+
var progressiveReveal = toolkit.progressiveReveal;
|
7
|
+
var formFocus = toolkit.formFocus;
|
8
|
+
var characterCount = toolkit.characterCount;
|
9
|
+
var validation = toolkit.validation;
|
10
|
+
|
11
|
+
var GOVUK = require('govuk-frontend');
|
12
|
+
GOVUK.initAll();
|
13
|
+
window.GOVUK = GOVUK;
|
14
|
+
var skipToMain = require('./skip-to-main');
|
15
|
+
var cookie = require('./govuk-cookies');
|
16
|
+
var cookieSettings = require('./cookieSettings');
|
17
|
+
var sessionDialog = require('./session-timeout-dialog');
|
18
|
+
|
19
|
+
toolkit.detailsSummary();
|
20
|
+
|
21
|
+
helpers.documentReady(progressiveReveal);
|
22
|
+
helpers.documentReady(formFocus);
|
23
|
+
helpers.documentReady(cookieSettings.initialiseCookieBanner);
|
24
|
+
helpers.documentReady(cookieSettings.initialiseCookiePage);
|
25
|
+
helpers.documentReady(cookieSettings.onLoad);
|
26
|
+
helpers.documentReady(characterCount);
|
27
|
+
helpers.documentReady(validation);
|