hr-design-system-handlebars 1.114.87 → 1.114.89
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 +25 -0
- package/dist/assets/brand/hr4/conf/locatags.merged.json +2 -2
- package/dist/assets/index.css +3 -3
- package/dist/assets/js/components/forms/js/contactForm.alpine.js +8 -1
- package/dist/views/components/forms/components/fields.hbs +1 -0
- package/dist/views/components/forms/components/input.hbs +3 -1
- package/dist/views/components/page/podcast/podcast_episode_article.hbs +1 -1
- package/dist/views_static/components/forms/components/fields.hbs +1 -0
- package/dist/views_static/components/forms/components/input.hbs +3 -1
- package/dist/views_static/components/page/podcast/podcast_episode_article.hbs +1 -1
- package/package.json +1 -1
- package/src/assets/brand/hr4/conf/locatags.merged.json +2 -2
- package/src/assets/fixtures/content/copytext/copytext_webform_simple.json +4 -0
- package/src/assets/fixtures/forms/form_fields.inc.json +14 -0
- package/src/stories/views/components/content/copytext/fixtures/copytext_webform_simple.json +1 -1
- package/src/stories/views/components/forms/components/fields.hbs +1 -0
- package/src/stories/views/components/forms/components/input.hbs +3 -1
- package/src/stories/views/components/forms/js/contactForm.alpine.js +8 -1
- package/src/stories/views/components/page/podcast/podcast_episode_article.hbs +1 -1
- package/src/stories/views/components/voting/voting.mdx +71 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# v1.114.89 (Thu Feb 13 2025)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- add voting-documentation [#1238](https://github.com/mumprod/hr-design-system-handlebars/pull/1238) ([@hanswurstsalat](https://github.com/hanswurstsalat))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Geraldo ([@hanswurstsalat](https://github.com/hanswurstsalat))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v1.114.88 (Thu Feb 13 2025)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- Dpe 3535 js protection [#1237](https://github.com/mumprod/hr-design-system-handlebars/pull/1237) ([@vascoeduardo](https://github.com/vascoeduardo) [@eduardo-hr](https://github.com/eduardo-hr))
|
|
18
|
+
|
|
19
|
+
#### Authors: 2
|
|
20
|
+
|
|
21
|
+
- [@eduardo-hr](https://github.com/eduardo-hr)
|
|
22
|
+
- Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
1
26
|
# v1.114.87 (Tue Feb 11 2025)
|
|
2
27
|
|
|
3
28
|
#### 🐛 Bug Fix
|
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
"ext_service_datapolicy_accept_permanently_text": "Externe Inhalte von <b>{0}</b> zukünftig immer anzeigen.",
|
|
182
182
|
"ext_service_datapolicy_accept_button_text": "Inhalt anzeigen",
|
|
183
183
|
"ext_service_datapolicy_headline": "Externen Inhalt von {0} anzeigen?",
|
|
184
|
-
"ext_service_datapolicy_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Beim Laden des Inhalts werden Daten an den Anbieter und ggf. weitere Dritte übertragen. Nähere Informationen
|
|
185
|
-
"ext_service_datapolicy_no_js_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Da
|
|
184
|
+
"ext_service_datapolicy_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Beim Laden des Inhalts werden Daten an den Anbieter und ggf. weitere Dritte übertragen. Nähere Informationen erhalten Sie in unseren ",
|
|
185
|
+
"ext_service_datapolicy_no_js_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Da Sie in Ihrem Browser Javascript deaktiviert haben, kann dieser hier nicht angezeigt werden. Der nachfolgende Link öffnet den Inhalt auf der Seite des Anbieters.",
|
|
186
186
|
"ext_service_datapolicy_no_js_link": "{0}-Inhalt öffnen",
|
|
187
187
|
"story_infobox_intro_sr": "Weitere Informationen",
|
|
188
188
|
"story_infobox_outro_sr": "Ende der weiteren Informationen",
|
package/dist/assets/index.css
CHANGED
|
@@ -3828,7 +3828,7 @@ article #commentList {
|
|
|
3828
3828
|
border-bottom-color: var(--color-secondary-ds);
|
|
3829
3829
|
}
|
|
3830
3830
|
.counter-reset {
|
|
3831
|
-
counter-reset:
|
|
3831
|
+
counter-reset: cnt1739469830196;
|
|
3832
3832
|
}
|
|
3833
3833
|
.animate-delay-100 {
|
|
3834
3834
|
--tw-animate-delay: 100ms;
|
|
@@ -4273,7 +4273,7 @@ html { scroll-behavior: smooth; }
|
|
|
4273
4273
|
--tw-ring-color: rgba(255, 255, 255, 0.5);
|
|
4274
4274
|
}
|
|
4275
4275
|
.-ordered {
|
|
4276
|
-
counter-increment:
|
|
4276
|
+
counter-increment: cnt1739469830196 1;
|
|
4277
4277
|
}
|
|
4278
4278
|
.-ordered::before {
|
|
4279
4279
|
position: absolute;
|
|
@@ -4291,7 +4291,7 @@ html { scroll-behavior: smooth; }
|
|
|
4291
4291
|
--tw-text-opacity: 1;
|
|
4292
4292
|
color: rgba(0, 0, 0, 1);
|
|
4293
4293
|
color: rgba(0, 0, 0, var(--tw-text-opacity));
|
|
4294
|
-
content: counter(
|
|
4294
|
+
content: counter(cnt1739469830196);
|
|
4295
4295
|
}
|
|
4296
4296
|
/*! ****************************/
|
|
4297
4297
|
/*! DataPolicy stuff */
|
|
@@ -10,6 +10,7 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
|
|
|
10
10
|
ajaxTimeout: 60 * 1000,
|
|
11
11
|
form: this.$refs[formId],
|
|
12
12
|
formWrapper: this.$refs[formId].closest("#formWrapper"),
|
|
13
|
+
honeypot: this.$refs[formId].querySelector('input[data-name="x-message"]'),
|
|
13
14
|
actionUrl: this.form && this.form.getAttribute('action'),
|
|
14
15
|
checkForJsonURL () {
|
|
15
16
|
if (jsonUrl) {
|
|
@@ -31,10 +32,16 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
|
|
|
31
32
|
},
|
|
32
33
|
submitButtonHandler(event) {
|
|
33
34
|
this.$store.forms.submissionAttempted[formId] = true;
|
|
35
|
+
if (this.honeypot) {
|
|
36
|
+
this.honeypot.removeAttribute('required');
|
|
37
|
+
}
|
|
34
38
|
if(this.form.reportValidity()){
|
|
35
39
|
this.handleSubmit(event,this.form)
|
|
36
40
|
} else {
|
|
37
|
-
this.scrollToElementAndCenterWithTimeout(document.activeElement, 50)
|
|
41
|
+
this.scrollToElementAndCenterWithTimeout(document.activeElement, 50)
|
|
42
|
+
if (this.honeypot) {
|
|
43
|
+
this.honeypot.setAttribute('required', '');
|
|
44
|
+
}
|
|
38
45
|
}
|
|
39
46
|
},
|
|
40
47
|
retryHandler() {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
_errorMandatory="Bitte füllen Sie dieses Pflichtfeld aus"
|
|
45
45
|
_errorEmail="Bitte geben Sie eine gültige E-Mail-Adresse ein."
|
|
46
46
|
_formId=../_formId
|
|
47
|
+
_isHoneypot=this.hasSpamProtection
|
|
47
48
|
}}
|
|
48
49
|
{{else if this.type.isSelect}}
|
|
49
50
|
{{~> components/forms/components/select
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
x-on:keyup ="validateField();"
|
|
15
15
|
type="{{#if _type}}{{_type}}{{/if}}"
|
|
16
16
|
name="{{#if _name}}{{_name}}{{/if}}"
|
|
17
|
+
{{#if _isHoneypot}}data-name="x-message" required="" {{/if}}
|
|
18
|
+
|
|
17
19
|
{{#if _locaKey}}
|
|
18
20
|
title="{{loca _locaKey}}{{#if _required}}*{{/if}}"
|
|
19
21
|
placeholder="placeholder:{{loca _locaKey}}{{#if _required}}*{{/if}}"
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
{{#if _maxLength}}
|
|
36
38
|
maxlength="{{_maxLength}}"
|
|
37
39
|
{{/if~}}
|
|
38
|
-
{{#if _required}} required{{/if}}
|
|
40
|
+
{{#if _required}} required=""{{/if}}
|
|
39
41
|
{{#if _tabindex}} tabindex="{{_tabindex}}"{{/if}}
|
|
40
42
|
{{#if _autocompleteOff}} autocomplete="off"{{/if}}
|
|
41
43
|
{{#if _autoSuggestFeature}}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{{#if (isStorybook)}}
|
|
8
8
|
{{> components/podcast/components/podcast_player_shorttext _isSinglePage=true}}
|
|
9
9
|
{{else}}
|
|
10
|
-
{{
|
|
10
|
+
{{~> components/content/copytext/copytext _isWebview=_webview ~}}
|
|
11
11
|
{{/if}}
|
|
12
12
|
{{> components/content/content_footer/content_footer
|
|
13
13
|
_author=this.audioAuthor
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
_errorMandatory="Bitte füllen Sie dieses Pflichtfeld aus"
|
|
45
45
|
_errorEmail="Bitte geben Sie eine gültige E-Mail-Adresse ein."
|
|
46
46
|
_formId=../_formId
|
|
47
|
+
_isHoneypot=this.hasSpamProtection
|
|
47
48
|
}}
|
|
48
49
|
{{else if this.type.isSelect}}
|
|
49
50
|
{{~> components/forms/components/select
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
x-on:keyup ="validateField();"
|
|
15
15
|
type="{{#if _type}}{{_type}}{{/if}}"
|
|
16
16
|
name="{{#if _name}}{{_name}}{{/if}}"
|
|
17
|
+
{{#if _isHoneypot}}data-name="x-message" required="" {{/if}}
|
|
18
|
+
|
|
17
19
|
{{#if _locaKey}}
|
|
18
20
|
title="{{loca _locaKey}}{{#if _required}}*{{/if}}"
|
|
19
21
|
placeholder="placeholder:{{loca _locaKey}}{{#if _required}}*{{/if}}"
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
{{#if _maxLength}}
|
|
36
38
|
maxlength="{{_maxLength}}"
|
|
37
39
|
{{/if~}}
|
|
38
|
-
{{#if _required}} required{{/if}}
|
|
40
|
+
{{#if _required}} required=""{{/if}}
|
|
39
41
|
{{#if _tabindex}} tabindex="{{_tabindex}}"{{/if}}
|
|
40
42
|
{{#if _autocompleteOff}} autocomplete="off"{{/if}}
|
|
41
43
|
{{#if _autoSuggestFeature}}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{{#if (isStorybook)}}
|
|
8
8
|
{{> components/podcast/components/podcast_player_shorttext _isSinglePage=true}}
|
|
9
9
|
{{else}}
|
|
10
|
-
{{
|
|
10
|
+
{{~> components/content/copytext/copytext _isWebview=_webview ~}}
|
|
11
11
|
{{/if}}
|
|
12
12
|
{{> components/content/content_footer/content_footer
|
|
13
13
|
_author=this.audioAuthor
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"repository": "https://github.com/szuelch/hr-design-system-handlebars",
|
|
9
|
-
"version": "1.114.
|
|
9
|
+
"version": "1.114.89",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "storybook dev -p 6006 public",
|
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
"ext_service_datapolicy_accept_permanently_text": "Externe Inhalte von <b>{0}</b> zukünftig immer anzeigen.",
|
|
182
182
|
"ext_service_datapolicy_accept_button_text": "Inhalt anzeigen",
|
|
183
183
|
"ext_service_datapolicy_headline": "Externen Inhalt von {0} anzeigen?",
|
|
184
|
-
"ext_service_datapolicy_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Beim Laden des Inhalts werden Daten an den Anbieter und ggf. weitere Dritte übertragen. Nähere Informationen
|
|
185
|
-
"ext_service_datapolicy_no_js_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Da
|
|
184
|
+
"ext_service_datapolicy_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Beim Laden des Inhalts werden Daten an den Anbieter und ggf. weitere Dritte übertragen. Nähere Informationen erhalten Sie in unseren ",
|
|
185
|
+
"ext_service_datapolicy_no_js_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Da Sie in Ihrem Browser Javascript deaktiviert haben, kann dieser hier nicht angezeigt werden. Der nachfolgende Link öffnet den Inhalt auf der Seite des Anbieters.",
|
|
186
186
|
"ext_service_datapolicy_no_js_link": "{0}-Inhalt öffnen",
|
|
187
187
|
"story_infobox_intro_sr": "Weitere Informationen",
|
|
188
188
|
"story_infobox_outro_sr": "Ende der weiteren Informationen",
|
|
@@ -24,6 +24,20 @@
|
|
|
24
24
|
"isRequired": true,
|
|
25
25
|
"maxLength": "140"
|
|
26
26
|
},
|
|
27
|
+
"input-honeypot-required": {
|
|
28
|
+
"type": {
|
|
29
|
+
"isText": true,
|
|
30
|
+
"asString": "text"
|
|
31
|
+
},
|
|
32
|
+
"name": "message",
|
|
33
|
+
"label": "message",
|
|
34
|
+
"description": "message",
|
|
35
|
+
"defaultValue": "",
|
|
36
|
+
"isHidden": true,
|
|
37
|
+
"hasSpamProtection":true,
|
|
38
|
+
"isRequired": false,
|
|
39
|
+
"maxLength": "140"
|
|
40
|
+
},
|
|
27
41
|
"input-text-nachname-required": {
|
|
28
42
|
"type": {
|
|
29
43
|
"isText": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"copytextParagraph":[{"isHeadline":true,"text":"Copytext mit Formular"},{"paragraphBoxItem":{"isWebForm":true,"hasNewWebForm":true,"title":"Kontaktformular","successText":{"richtext":"Liebe Nutzerin, lieber Nutzer,<br><br>ich werde mich so schnell wie möglich um Ihr Anliegen kümmern. Hier geht's zur <a class='' href='https://www.hessenschau.de/index.html'>hessenschau.de-Startseite</a> mit aktuellen Nachrichten aus Hessen.<br><br>Viele Grüße, <br><br>Karsten Hufer"},"jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"{"form_error_required":"Server: Pflichtfeld","form_error_max":"Server: Zu viele Zeichen","form_error_validurl":"Server: Ungültige URL","form_error_empty":"Server: Darf nicht ausgefüllt werden","form_error_constants_or_null":"Server: Ungültiger Wert","form_error_constants":"Server: Ungültiger Wert","form_error_max_multivalue":"Server: Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten","vote_error_identity_already_used":"Server: Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich.","vote_error_token_request_count_exceeded":"Server: Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt.","form_error_email":"Server: Ungültige E-Mail-Adresse"}","isMultipart":"isMultipart","trackingInformations":"trackingInformations","fields":[{"type":{"isText":true,"asString":"text"},"name":"vorname","label":"Vorname","description":"Das ist der Beschreibungstext von Vorname","defaultValue":"","isHidden":false,"isRequired":false}]}}]}
|
|
1
|
+
{"copytextParagraph":[{"isHeadline":true,"text":"Copytext mit Formular"},{"paragraphBoxItem":{"isWebForm":true,"hasNewWebForm":true,"title":"Kontaktformular","successText":{"richtext":"Liebe Nutzerin, lieber Nutzer,<br><br>ich werde mich so schnell wie möglich um Ihr Anliegen kümmern. Hier geht's zur <a class='' href='https://www.hessenschau.de/index.html'>hessenschau.de-Startseite</a> mit aktuellen Nachrichten aus Hessen.<br><br>Viele Grüße, <br><br>Karsten Hufer"},"jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"{"form_error_required":"Server: Pflichtfeld","form_error_max":"Server: Zu viele Zeichen","form_error_validurl":"Server: Ungültige URL","form_error_empty":"Server: Darf nicht ausgefüllt werden","form_error_constants_or_null":"Server: Ungültiger Wert","form_error_constants":"Server: Ungültiger Wert","form_error_max_multivalue":"Server: Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten","vote_error_identity_already_used":"Server: Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich.","vote_error_token_request_count_exceeded":"Server: Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt.","form_error_email":"Server: Ungültige E-Mail-Adresse"}","isMultipart":"isMultipart","trackingInformations":"trackingInformations","fields":[{"type":{"isText":true,"asString":"text"},"name":"vorname","label":"Vorname","description":"Das ist der Beschreibungstext von Vorname","defaultValue":"","isHidden":false,"isRequired":false},{"type":{"isText":true,"asString":"text"},"name":"message","label":"message","description":"message","defaultValue":"","isHidden":true,"hasSpamProtection":true,"isRequired":false,"maxLength":"140"}]}}]}
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
_errorMandatory="Bitte füllen Sie dieses Pflichtfeld aus"
|
|
45
45
|
_errorEmail="Bitte geben Sie eine gültige E-Mail-Adresse ein."
|
|
46
46
|
_formId=../_formId
|
|
47
|
+
_isHoneypot=this.hasSpamProtection
|
|
47
48
|
}}
|
|
48
49
|
{{else if this.type.isSelect}}
|
|
49
50
|
{{~> components/forms/components/select
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
x-on:keyup ="validateField();"
|
|
15
15
|
type="{{#if _type}}{{_type}}{{/if}}"
|
|
16
16
|
name="{{#if _name}}{{_name}}{{/if}}"
|
|
17
|
+
{{#if _isHoneypot}}data-name="x-message" required="" {{/if}}
|
|
18
|
+
|
|
17
19
|
{{#if _locaKey}}
|
|
18
20
|
title="{{loca _locaKey}}{{#if _required}}*{{/if}}"
|
|
19
21
|
placeholder="placeholder:{{loca _locaKey}}{{#if _required}}*{{/if}}"
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
{{#if _maxLength}}
|
|
36
38
|
maxlength="{{_maxLength}}"
|
|
37
39
|
{{/if~}}
|
|
38
|
-
{{#if _required}} required{{/if}}
|
|
40
|
+
{{#if _required}} required=""{{/if}}
|
|
39
41
|
{{#if _tabindex}} tabindex="{{_tabindex}}"{{/if}}
|
|
40
42
|
{{#if _autocompleteOff}} autocomplete="off"{{/if}}
|
|
41
43
|
{{#if _autoSuggestFeature}}
|
|
@@ -10,6 +10,7 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
|
|
|
10
10
|
ajaxTimeout: 60 * 1000,
|
|
11
11
|
form: this.$refs[formId],
|
|
12
12
|
formWrapper: this.$refs[formId].closest("#formWrapper"),
|
|
13
|
+
honeypot: this.$refs[formId].querySelector('input[data-name="x-message"]'),
|
|
13
14
|
actionUrl: this.form && this.form.getAttribute('action'),
|
|
14
15
|
checkForJsonURL () {
|
|
15
16
|
if (jsonUrl) {
|
|
@@ -31,10 +32,16 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
|
|
|
31
32
|
},
|
|
32
33
|
submitButtonHandler(event) {
|
|
33
34
|
this.$store.forms.submissionAttempted[formId] = true;
|
|
35
|
+
if (this.honeypot) {
|
|
36
|
+
this.honeypot.removeAttribute('required');
|
|
37
|
+
}
|
|
34
38
|
if(this.form.reportValidity()){
|
|
35
39
|
this.handleSubmit(event,this.form)
|
|
36
40
|
} else {
|
|
37
|
-
this.scrollToElementAndCenterWithTimeout(document.activeElement, 50)
|
|
41
|
+
this.scrollToElementAndCenterWithTimeout(document.activeElement, 50)
|
|
42
|
+
if (this.honeypot) {
|
|
43
|
+
this.honeypot.setAttribute('required', '');
|
|
44
|
+
}
|
|
38
45
|
}
|
|
39
46
|
},
|
|
40
47
|
retryHandler() {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{{#if (isStorybook)}}
|
|
8
8
|
{{> components/podcast/components/podcast_player_shorttext _isSinglePage=true}}
|
|
9
9
|
{{else}}
|
|
10
|
-
{{
|
|
10
|
+
{{~> components/content/copytext/copytext _isWebview=_webview ~}}
|
|
11
11
|
{{/if}}
|
|
12
12
|
{{> components/content/content_footer/content_footer
|
|
13
13
|
_author=this.audioAuthor
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ArgTypes, Meta, Story, Canvas } from '@storybook/blocks'
|
|
2
|
+
import * as votingStories from './voting.stories'
|
|
3
|
+
|
|
4
|
+
<Meta of={votingStories} />
|
|
5
|
+
|
|
6
|
+
# Voting
|
|
7
|
+
|
|
8
|
+
## Beschreibung
|
|
9
|
+
|
|
10
|
+
Das Voting besteht aus den Hauptkomponenten <b>voting.hbs</b>, <b>voting_media_player.hbs</b> und <b>voting_result.hbs</b>.<br/><br/>
|
|
11
|
+
Diese verwenden die folgenden Unter-Komponenten:<br/>
|
|
12
|
+
voting_backbutton.hbs, voting_header.hbs, voting_hint.hbs und voting_submit.hbs.<br/><br/>
|
|
13
|
+
Die Funktionalität wird über diese javascript-Dateien bereitgestellt:<br/>
|
|
14
|
+
votingCookieCheckerDs.feature.js, votingDs.feature.js, votingResultCookieDs.feature.js und votingValidatorDs.feature.js.<br/><br/>
|
|
15
|
+
Alle genannten Dateien werden nachfolgend beschrieben.
|
|
16
|
+
|
|
17
|
+
### voting.hbs
|
|
18
|
+
Dies ist die Hauptkomponente. Sie kann in anderen Komponenten inkludiert werden (siehe Verwendung).
|
|
19
|
+
Sie enthält im umschließenden div-Element die data-Attribute für das javascript (data-hr-voting-ds, data-hr-voting-validator-ds, data-hr-voting-cookie-checker-ds)
|
|
20
|
+
und übergibt diesen jeweils Daten-Objekte.<br/>
|
|
21
|
+
Die nächste Ebene ist ein div-Element mit der css-Klasse "js-voting-wrapper", anhand derer diesem div Inhalte per javascript zugefügt werden.<br/>
|
|
22
|
+
Nachfolgend das form-Element, welches die Daten an den ugc-Server sendet. Die voting-Felder werden per Einbindung der Komponente fields.hbs erzeugt. Um diese den grafischen Vorlagen entsprechend darzustellen, werden diverse css-Parameter benötigt.<br/>
|
|
23
|
+
Ferner enthält voting.hbs drei script-Elemente mit den jeweiligen css-Klassen js-successMessage, js-errorMessage und js-result. Mit Hilfe dieser Klassennamen wird hier jeweils die Komponente voting_result.hbs in verschiedenen Ausprägungen eingebunden.<br/>
|
|
24
|
+
Am Ende von voting.hbs wird die Komponente teaser_featured_content.hbs inkludiert, welche die "Mehr zum Thema"-Links enthält.
|
|
25
|
+
|
|
26
|
+
### voting_media_player.hbs
|
|
27
|
+
Mit dieser Komponente werden Audios und Videos in den voting-Optionen dargestellt.
|
|
28
|
+
|
|
29
|
+
### voting_result.hbs
|
|
30
|
+
Diese Komponente wird per javascript in voting.hbs inkludiert und stellt - abhängig von den ihr übergebenen Parametern - das voting-Ergebnis in einem per css keyframes animierten barchart, ein Danke-Text oder eine Fehlermeldung dar.
|
|
31
|
+
|
|
32
|
+
### voting_backbutton.hbs
|
|
33
|
+
Enthält den "Zurück zur Abstimmung"-Button. Dieser wird nur im Fehlerfall, also in der Fehler-Message dargestellt.
|
|
34
|
+
|
|
35
|
+
### voting_header.hbs
|
|
36
|
+
Diese Komponente stellt Label (Voting) und Titel dar.
|
|
37
|
+
|
|
38
|
+
### voting_hint.hbs
|
|
39
|
+
Wird für die Anzeige diverser Hinweistexte verwendet, zB. Anzahl der Stimmen, "Werte Stimmen" bei absoluten Werten.
|
|
40
|
+
|
|
41
|
+
### voting_submit.hbs
|
|
42
|
+
Beinhaltet den "Abstimmen"-Button + Icon + Hinweistext.
|
|
43
|
+
|
|
44
|
+
### votingDs.feature.js
|
|
45
|
+
Hier sind u.a. die Handler für das Versenden des Voting-Formulars, die Verarbeitung der response vom ugc-Server sowie das Laden der voting_result-Komponente in den verschiedenen Ausprägungen definiert.
|
|
46
|
+
|
|
47
|
+
### votingCookieCheckerDs.feature.js
|
|
48
|
+
Prüft, ob ein voting-cookie existiert und lädt ggf. eine Message ("Sie haben bereits abgestimmt").
|
|
49
|
+
|
|
50
|
+
### votingResultCookieDs.feature.js
|
|
51
|
+
Setzt das voting-cookie.
|
|
52
|
+
|
|
53
|
+
### votingValidatorDs.feature.js
|
|
54
|
+
Steuert das enablen/disablen des Submit-Buttons sowie die Anzeige der Anzahl der gewählten Optionen (n/x).
|
|
55
|
+
|
|
56
|
+
## Verwendung
|
|
57
|
+
|
|
58
|
+
Das Voting wird in handlebars wie folgt eingebaut:
|
|
59
|
+
|
|
60
|
+
1. Im copytext
|
|
61
|
+
```html
|
|
62
|
+
{{> components/voting/voting}}
|
|
63
|
+
```
|
|
64
|
+
2. Als Teaser
|
|
65
|
+
```html
|
|
66
|
+
{{> components/voting/voting _isTeaser=true}}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
<Canvas withToolbar>
|
|
70
|
+
<Story of={votingStories.Default} />
|
|
71
|
+
</Canvas>
|