govuk_publishing_components 38.3.1 → 38.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +16 -1
- data/app/assets/javascripts/govuk_publishing_components/modules.js +12 -7
- data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/README.md +2 -2
- data/node_modules/axe-core/axe.js +5099 -5203
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/locales/README.md +9 -0
- data/node_modules/axe-core/locales/_template.json +4 -2
- data/node_modules/axe-core/locales/de.json +10 -4
- data/node_modules/axe-core/locales/ja.json +1 -1
- data/node_modules/axe-core/package.json +8 -3
- data/node_modules/axe-core/sri-history.json +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7ea0b6a93379ec1e7cb8e5b7194c5cc16e237129cdbe224b9a099d79f4ca7ff
|
4
|
+
data.tar.gz: 567e2f625bd4b773a48f56c13c15d383f4fcdba5c44c9369ae327b8cf5772419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b0bd17834a7658027b98c43cf2b2514f4bdb3ee06974e21bd27932a81e4f4ce4a7785468623d92511026e8773ae9af78dccca88c3c1ba0ba88ee89ff06b81aa
|
7
|
+
data.tar.gz: 1544edbfac9e4d2f5723f220aadd5619b86ff3386dae982d6b53ee9d8e20ba264a52f54ee44a6194b9ae912d8f0684d2a20bd3f0ff33d8d0775ca09cae3b8d86
|
@@ -26,7 +26,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
26
26
|
Feedback.prototype.init = function () {
|
27
27
|
this.setInitialAriaAttributes()
|
28
28
|
this.setHiddenValues()
|
29
|
-
|
29
|
+
this.setSurveyPath()
|
30
30
|
this.prompt.hidden = false
|
31
31
|
for (var k = 0; k < this.promptQuestions.length; k++) {
|
32
32
|
this.promptQuestions[k].hidden = false
|
@@ -151,6 +151,21 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
151
151
|
this.somethingIsWrongForm.appendChild(this.timerHoneyPot)
|
152
152
|
}
|
153
153
|
|
154
|
+
// This getter is needed for spyOn in tests
|
155
|
+
Feedback.prototype.getPagePath = function () {
|
156
|
+
return window.location.pathname
|
157
|
+
}
|
158
|
+
|
159
|
+
Feedback.prototype.setSurveyPath = function () {
|
160
|
+
var surveyLink = this.$module.querySelector('#survey_explanation a')
|
161
|
+
|
162
|
+
if (surveyLink) {
|
163
|
+
var pathWithoutEmailPII = this.getPagePath().replace(/[^\s=?&]+(?:@|%40)[^\s=?&]+/, '[email]')
|
164
|
+
var encodedPath = encodeURI(pathWithoutEmailPII)
|
165
|
+
surveyLink.setAttribute('href', 'https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=' + encodedPath)
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
154
169
|
Feedback.prototype.updateAriaAttributes = function (linkClicked) {
|
155
170
|
linkClicked.setAttribute('aria-expanded', true)
|
156
171
|
}
|
@@ -36,15 +36,20 @@
|
|
36
36
|
var moduleName = camelCaseAndCapitalise(moduleNames[j])
|
37
37
|
var started = element.getAttribute('data-' + moduleNames[j] + '-module-started')
|
38
38
|
if (typeof GOVUK.Modules[moduleName] === 'function' && !started) {
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
try {
|
40
|
+
if (GOVUK.Modules[moduleName].prototype.init) {
|
41
|
+
// Vanilla JavaScript GOV.UK Modules and GOV.UK Frontend V4 Modules
|
42
42
|
new GOVUK.Modules[moduleName](element).init()
|
43
|
-
|
44
|
-
|
45
|
-
//
|
46
|
-
|
43
|
+
} else {
|
44
|
+
// GOV.UK Frontend V5 Modules - removed component init() methods and initialise in constructor
|
45
|
+
// https://github.com/alphagov/govuk-design-system-architecture/blob/main/decision-records/010-remove-init-method.md
|
46
|
+
/* eslint-disable no-new */
|
47
|
+
new GOVUK.Modules[moduleName](element)
|
47
48
|
}
|
49
|
+
element.setAttribute('data-' + moduleNames[j] + '-module-started', true)
|
50
|
+
} catch (e) {
|
51
|
+
// if there's a problem with the module, catch the error to allow other modules to start
|
52
|
+
console.error('Error starting ' + moduleName + ' component JS: ', e, window.location)
|
48
53
|
}
|
49
54
|
}
|
50
55
|
}
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<h3 class="gem-c-feedback__form-heading"><%= t("components.feedback.help_us_improve_govuk") %></h3>
|
11
11
|
<p id="survey_explanation" class="gem-c-feedback__form-paragraph">
|
12
12
|
<%= t("components.feedback.more_about_visit") %>
|
13
|
-
<a href="https://www.smartsurvey.co.uk/s/gov-uk-banner/?c
|
13
|
+
<a href="https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=no-js" class="govuk-link" target="_blank" rel="noopener noreferrer external">Please fill in this survey (opens in a new tab)</a>.
|
14
14
|
</p>
|
15
15
|
<button
|
16
16
|
class="govuk-button govuk-button--secondary js-close-form"
|
@@ -103,9 +103,9 @@ or equivalently:
|
|
103
103
|
|
104
104
|
This will create a new build for axe, called `axe.<lang>.js` and `axe.<lang>.min.js`. If you want to build all localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`.
|
105
105
|
|
106
|
-
To create a new translation for axe, start by running `grunt translate --lang=<langcode>`. This will create a json file
|
106
|
+
To create a new translation for axe, start by running `grunt translate --lang=<langcode>`. This will create a json file in the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/doc/check-message-template.md).
|
107
107
|
|
108
|
-
To update existing translation file, re-run `grunt translate --lang=<langcode>`. This will add new messages used in English and remove messages which were not used in English.
|
108
|
+
To update an existing translation file, re-run `grunt translate --lang=<langcode>`. This will add new messages used in English and remove messages which were not used in English.
|
109
109
|
|
110
110
|
Additionally, locale can be applied at runtime by passing a `locale` object to `axe.configure()`. The locale object must be of the same shape as existing locales in the `./locales` directory. For example:
|
111
111
|
|