hr-design-system-handlebars 1.70.4 → 1.70.6

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 CHANGED
@@ -1,3 +1,27 @@
1
+ # v1.70.6 (Wed Jun 12 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - ✨ h-Auszeichnungen der Label überarbeiten [#943](https://github.com/mumprod/hr-design-system-handlebars/pull/943) ([@vascoeduardo](https://github.com/vascoeduardo))
6
+
7
+ #### Authors: 1
8
+
9
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
10
+
11
+ ---
12
+
13
+ # v1.70.5 (Wed Jun 12 2024)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Europawahl: Externen Dienst für Ergebnisse einrichten [#942](https://github.com/mumprod/hr-design-system-handlebars/pull/942) ([@vascoeduardo](https://github.com/vascoeduardo))
18
+
19
+ #### Authors: 1
20
+
21
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
22
+
23
+ ---
24
+
1
25
  # v1.70.4 (Wed Jun 12 2024)
2
26
 
3
27
  #### 🐛 Bug Fix
@@ -3359,7 +3359,7 @@ article.indexTextDS .indexTextHighlighted .link {
3359
3359
  border-bottom-color: var(--color-secondary-ds);
3360
3360
  }
3361
3361
  .counter-reset {
3362
- counter-reset: cnt1718191247598;
3362
+ counter-reset: cnt1718204121860;
3363
3363
  }
3364
3364
  .hyphens-auto {
3365
3365
  -webkit-hyphens: auto;
@@ -3738,7 +3738,7 @@ article.indexTextDS .indexTextHighlighted .link {
3738
3738
  --tw-ring-color: rgba(255, 255, 255, 0.5);
3739
3739
  }
3740
3740
  .-ordered {
3741
- counter-increment: cnt1718191247598 1;
3741
+ counter-increment: cnt1718204121860 1;
3742
3742
  }
3743
3743
  .-ordered::before {
3744
3744
  position: absolute;
@@ -3754,7 +3754,7 @@ article.indexTextDS .indexTextHighlighted .link {
3754
3754
  letter-spacing: .0125em;
3755
3755
  --tw-text-opacity: 1;
3756
3756
  color: rgba(0, 0, 0, var(--tw-text-opacity));
3757
- content: counter(cnt1718191247598);
3757
+ content: counter(cnt1718204121860);
3758
3758
  }
3759
3759
  /*! ****************************/
3760
3760
  /*! DataPolicy stuff */
@@ -102,7 +102,10 @@ const ExternalService = function (context) {
102
102
  break
103
103
  case 'wahlomat':
104
104
  createWahlOMatEmbed()
105
- break
105
+ break
106
+ case 'wahl-gemeinde-ergebnis':
107
+ createWahlGemeindeErgebnis()
108
+ break
106
109
  default:
107
110
  console.error('No JS Config for external service ' + id)
108
111
  break
@@ -112,7 +115,156 @@ const ExternalService = function (context) {
112
115
  loadIframe() //für alle Dienste die nicht der DSGVO Datapolicy unterliegen
113
116
  }
114
117
  }
118
+ const createWahlGemeindeErgebnis = function () {
119
+ let embedCode = options.embedCode,
120
+ cleanUrl,
121
+ wahlKreisVersionJsonUrl,
122
+ wahlkreis,
123
+ wahlid,
124
+ jsonResponse,
125
+ iFrameElement,
126
+ iframeHeight = 300
115
127
 
128
+ const cleanVariables = function (variable) {
129
+ while (variable.charAt(0) === '&') {
130
+ variable = variable.substring(1)
131
+ }
132
+ return variable
133
+ }
134
+ const extractDataFromEmbedCode = function () {
135
+ const parts = embedCode.split('*')
136
+ if (parts.length === 4) {
137
+ cleanUrl = cleanVariables(decodeURIComponent(parts[0].trim()))
138
+ wahlkreis = cleanVariables(decodeURIComponent(parts[1].trim()))
139
+ wahlid = cleanVariables(decodeURIComponent(parts[2].trim()))
140
+ wahlKreisVersionJsonUrl = cleanVariables(decodeURIComponent(parts[3].trim()))
141
+ }
142
+ }
143
+ const loadIframe = function (version, url, wahlkreis) {
144
+ if (version) {
145
+ let iframeUrl = url.replace('{version}', version)
146
+ let iframe = document.createElement('iframe')
147
+ iframe.className = ''
148
+ iframe.style.border = 'none'
149
+ iframe.style.height = iframeHeight + 'px'
150
+ iframe.style.width = '100%'
151
+ iframe.setAttribute('webkitallowfullscreen', '')
152
+ iframe.setAttribute('mozallowfullscreen', '')
153
+ iframe.setAttribute('allowfullscreen', '')
154
+ iframe.setAttribute('scrolling', 'no')
155
+ iframe.setAttribute('frameborder', '0')
156
+ iframe.src = iframeUrl
157
+ iframe.id = 'wahl-gemeinde-ergebnis-' + wahlkreis
158
+ rootElement.innerHTML = ''
159
+ rootElement.insertBefore(iframe, null)
160
+ iFrameElement = document.getElementById('wahl-gemeinde-ergebnis-' + wahlkreis)
161
+ } else {
162
+ loadNoDataDiv('Es liegen zur Zeit noch keine Ergebnisse vor', 5)
163
+ }
164
+ }
165
+ const loadNoDataDiv = function (text, timeout) {
166
+ let div = document.createElement('div')
167
+ div.className =
168
+ 'p-5 c-externalService__wahl-gemeinde-ergebnis-no-result rounded-tl-hr rounded-br-hr bg-highlight-1'
169
+ div.innerHTML =
170
+ '<div class="text-2xl text-clusterTeaserHeadline font-titleCluster mb-2">' +
171
+ text +
172
+ '</div>' +
173
+ '<div class="flex flex-row" >' +
174
+ ' <div class="">' +
175
+ ' <span>Dieser Inhalt wird automatisch aktualisiert in</span>' +
176
+ ' <span data-minutes>' +
177
+ timeout +
178
+ ' </span>' +
179
+ ' <span>Min</span>' +
180
+ ' <span data-seconds>0</span>' +
181
+ ' <span>Sek</span>' +
182
+ ' </div>' +
183
+ '</div>'
184
+ rootElement.innerHTML = ''
185
+ rootElement.insertBefore(div, null)
186
+ countdownMinutes(timeout, fetchJsonData)
187
+ }
188
+ const resizeIframe = function (newheight) {
189
+ if (newheight !== iframeHeight) {
190
+ iFrameElement.style.height = newheight + 'px'
191
+ iframeHeight = newheight
192
+ }
193
+ }
194
+ const processMessage = function (evt) {
195
+ if (evt.origin !== 'https://www.tagesschau.de') {
196
+ console.log('message', evt.origin + ' ist nicht vertrauenswürdig')
197
+ } else {
198
+ resizeIframe(evt.data)
199
+ }
200
+ }
201
+ const initMessageEventListener = function () {
202
+ if (window.addEventListener) {
203
+ // For standards-compliant web browsers
204
+ window.addEventListener('message', processMessage, false)
205
+ } else {
206
+ window.attachEvent('onmessage', processMessage)
207
+ }
208
+ }
209
+ const fetchJsonData = function () {
210
+ fetch(wahlKreisVersionJsonUrl, {
211
+ method: 'GET',
212
+ headers: {
213
+ Accept: 'application/json',
214
+ },
215
+ })
216
+ .then((response) => response.json())
217
+ .then((jsonData) =>
218
+ loadIframe(
219
+ jsonData.hasOwnProperty(wahlkreis) && jsonData[wahlkreis].v
220
+ ? jsonData[wahlkreis].v
221
+ : null,
222
+ cleanUrl,
223
+ wahlkreis,
224
+ ),
225
+ )
226
+ .catch(function () {
227
+ loadNoDataDiv('Es liegen zur Zeit noch keine Ergebnisse vor', 5)
228
+ console.log('No JSON Data Loaded')
229
+ })
230
+ }
231
+
232
+ function countdownMinutes(minutesToCountdown, callbackFunction) {
233
+ const second = 1000,
234
+ minute = second * 60,
235
+ hour = minute * 60,
236
+ day = hour * 24,
237
+ minuteElement = document.querySelector('[data-minutes]'),
238
+ secondElement = document.querySelector('[data-seconds]')
239
+
240
+ function AddMinutesToDate(date, minutes) {
241
+ return new Date(date.getTime() + minutes * 60000)
242
+ }
243
+
244
+ let countDown = AddMinutesToDate(new Date(), minutesToCountdown),
245
+ x = setInterval(function () {
246
+ let now = new Date().getTime(),
247
+ distance = countDown - now
248
+
249
+ if (minuteElement != null) {
250
+ minuteElement.innerText = Math.floor((distance % hour) / minute)
251
+ }
252
+
253
+ if (secondElement != null) {
254
+ secondElement.innerText = Math.floor((distance % minute) / second)
255
+ }
256
+
257
+ if (distance < 1000) {
258
+ callbackFunction()
259
+ clearInterval(x)
260
+ }
261
+ }, second)
262
+ }
263
+
264
+ extractDataFromEmbedCode()
265
+ initMessageEventListener()
266
+ fetchJsonData()
267
+ }
116
268
  const createWahlOMatEmbed = function () {
117
269
 
118
270
  const divTag = document.createElement('div')
@@ -1,16 +1,15 @@
1
1
  <header class="mt-6 sm480:mt-8">
2
+ {{#with this.label}}
3
+ {{#> components/label/label_group _css="mb-2"}}
4
+ {{> components/label/label _type=this.type _text=(loca this.loca)}}
5
+ {{/components/label/label_group}}
6
+ {{/with}}
2
7
  <h2>
3
- {{#if this.label }}
4
- {{#with this.label}}
5
- {{#> components/label/label_group _css="mb-2"}}
6
- {{> components/label/label _type=this.type _text=(loca this.loca)}}
7
- {{/components/label/label_group}}
8
- {{/with}}
9
- {{else}}
8
+ {{#unless this.label }}
10
9
  {{~#if topline}}
11
10
  <span class="block mb-2 text-base sm480:text-xl font-heading">{{this.topline}}</span>
12
11
  {{/if~}}
13
- {{/if~}}
12
+ {{/unless~}}
14
13
  <span class="text-3xl font-headingSerif sm480:text-4xl">{{this.title}}</span>
15
14
  </h2>
16
15
  </header>
@@ -1,16 +1,15 @@
1
1
  <header class="mt-6 sm480:mt-8">
2
+ {{#with this.label}}
3
+ {{#> components/label/label_group _css="mb-2"}}
4
+ {{> components/label/label _type=this.type _text=(loca this.loca)}}
5
+ {{/components/label/label_group}}
6
+ {{/with}}
2
7
  <h2>
3
- {{#if this.label }}
4
- {{#with this.label}}
5
- {{#> components/label/label_group _css="mb-2"}}
6
- {{> components/label/label _type=this.type _text=(loca this.loca)}}
7
- {{/components/label/label_group}}
8
- {{/with}}
9
- {{else}}
8
+ {{#unless this.label }}
10
9
  {{~#if topline}}
11
10
  <span class="block mb-2 text-base sm480:text-xl font-heading">{{this.topline}}</span>
12
11
  {{/if~}}
13
- {{/if~}}
12
+ {{/unless~}}
14
13
  <span class="text-3xl font-headingSerif sm480:text-4xl">{{this.title}}</span>
15
14
  </h2>
16
15
  </header>
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.70.4",
9
+ "version": "1.70.6",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "storybook dev -p 6006 public",
@@ -4,6 +4,21 @@
4
4
  "isHeadline": true,
5
5
  "text": "Copytext mit externen Diensten"
6
6
  },
7
+ {
8
+ "isHeadline": true,
9
+ "text": "Wahl Gemeinde Ergebnis"
10
+ },
11
+ {
12
+ "paragraphBoxItem": {
13
+ "isExternalService": true,
14
+ "toModel": {
15
+ "externalService": {
16
+ "@->jsoninclude": "external_service/external_service.inc.json",
17
+ "@->contentpath": "Wahl_Gemeinde_Ergebnis"
18
+ }
19
+ }
20
+ }
21
+ },
7
22
  {
8
23
  "isHeadline": true,
9
24
  "text": "360Grad"
@@ -245,5 +245,20 @@
245
245
  "setResponsiveIframe": false,
246
246
  "setTimedReloadIframe": false,
247
247
  "setTimeForReload": ""
248
+ },
249
+ "Wahl_Gemeinde_Ergebnis": {
250
+ "externalServiceConfig": {
251
+ "makeConfigurable": false,
252
+ "embedAsIFrame": false,
253
+ "externalServiceId": "wahl-gemeinde-ergebnis",
254
+ "externalServiceEmbedType": "js",
255
+ "externalServiceName": "wahl-gemeinde-ergebnis"
256
+ },
257
+ "serviceUrl": "https://www.tagesschau.de/wahl/archiv/2024-06-09-EP-DE/charts/wahlkreis-detail/G06412000-{version}.shtml?externalEmbed*G06412000*&2024-06-09-EP-DE*&https%3A%2F%2Fwww.hessenschau.de%2Fpolitik%2Flandtagswahl%2Fkandidatencheck%2Fwk-versions.json",
258
+ "fixedHeight": "",
259
+ "aspectRatio": "",
260
+ "setResponsiveIframe": false,
261
+ "setTimedReloadIframe": false,
262
+ "setTimeForReload": ""
248
263
  }
249
264
  }
@@ -1 +1 @@
1
- {"copytextParagraph":[{"isHeadline":true,"text":"Copytext mit externen Diensten"},{"isHeadline":true,"text":"360Grad"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":true,"externalServiceId":"360grad","externalServiceEmbedType":"iFrame","externalServiceName":"360 Grad"},"serviceUrl":"https://static.hr.de/hessenschau/360/tour-altstadt/360Tour-altstadt-final1.html","aspectRatio":"100","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"ARD-Mediathek (Video)"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"ard_mediathek","externalServiceEmbedType":"iFrame","externalServiceName":"ARD Mediathek (Video)"},"serviceUrl":"https://www.ardmediathek.de/embed/Y3JpZDovL2Z1bmsubmV0LzExNzkwL3ZpZGVvLzE3NzQ2NzU?clientType=hr","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"ARTE Concert 2.0"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"arte_concert_new","externalServiceEmbedType":"iFrame","externalServiceName":"Arte Concert 2.0"},"serviceUrl":"https://www.arte.tv/player/v5/index.php?json_url=https%3A%2F%2Fapi.arte.tv%2Fapi%2Fplayer%2Fv2%2Fconfig%2Fde%2F116593-005-A&lang=de&autoplay=false&mute=0","aspectRatio":"16x9","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Bundesliga Audiostream"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":true,"externalServiceId":"bundesligaAudiostream","externalServiceEmbedType":"iFrame","externalServiceName":"Bundesliga Audiostream"},"serviceUrl":"https://livecenter.sportschau.de/iframe/spielplan-kompakt/co3/md11/////","aspectRatio":"9x16","fixedHeight":"600","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Datawrapper CDN"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":false,"externalServiceId":"datawrapper_cdn","externalServiceEmbedType":"js","externalServiceName":"Datawrapper (Datengrafik)"},"serviceUrl":"https://datawrapper.dwcdn.net/IC3Xn/1/","fixedHeight":"380","setResponsiveIframe":true,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Esri Karte"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"esri","externalServiceEmbedType":"iFrame","externalServiceName":"Esri (Notfallkarte)"},"serviceUrl":"https://arcg.is/1aW0au0","aspectRatio":"100","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":"","externalServiceCaption":"Notfallkarte"}}}},{"isHeadline":true,"text":"Facebook"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":false,"externalServiceId":"facebook-post","externalServiceEmbedType":"js","externalServiceName":"Facebook"},"serviceUrl":"https://www.facebook.com/ZooFFM/posts/1926440010874354","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Flourish"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"flourish","externalServiceEmbedType":"iFrame","externalServiceName":"Flourish (Datengrafik)"},"serviceUrl":"https://public.flourish.studio/story/18361/embed","fixedHeight":"550","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Giphy"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"giphy","externalServiceEmbedType":"iFrame","externalServiceName":"Giphy (animiertes GIF)"},"serviceUrl":"https://giphy.com/embed/ONxw4niC96zwk","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Instagram"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":false,"externalServiceId":"instagram","externalServiceEmbedType":"js","externalServiceName":"Instagram"},"serviceUrl":"https://www.instagram.com/p/CEjxNt8lW4K/","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"X"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":false,"externalServiceId":"twitter-post","externalServiceEmbedType":"js","externalServiceName":"X"},"serviceUrl":"https://twitter.com/tagesthemen/status/1578122540362465299","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Vimeo"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"vimeo","externalServiceEmbedType":"iFrame","externalServiceName":"Vimeo (Video)"},"serviceUrl":"https://player.vimeo.com/video/438111654","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Youtube"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"youtube","externalServiceEmbedType":"iFrame","externalServiceName":"YouTube (Video)"},"serviceUrl":"https://www.youtube-nocookie.com/embed/LMjXHYHZtrE?rel=0","aspectRatio":"16x9","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Youtube 360°"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"youtube360","externalServiceEmbedType":"iFrame","externalServiceName":"YouTube 360 (360° Video)"},"serviceUrl":"https://www.youtube-nocookie.com/embed/yT1pyf9oXGk","aspectRatio":"16x9","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":"","externalServiceCaption":"Eine Demo der Virtual Reality-Inszenierung '2049: Zeitreise Mobilität'"}}}},{"isHeadline":true,"text":"Statischer Dienst"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":true,"externalServiceId":"staticService","externalServiceEmbedType":"iFrame","externalServiceName":"Statischer Dienst"},"serviceUrl":"https://static.hr.de/hessenschau/btw21/linientool/unternehmensgruendung","fixedHeight":"1000","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Wahlmonitor"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":false,"externalServiceId":"wahlmonitor","externalServiceEmbedType":"js","externalServiceName":"Wahlmonitor"},"serviceUrl":"https://www.tagesschau.de/wahl/monitor-15/4e1_monitor_embed.js*data-externalembed=true data-electionid=2023-10-08-LT-DE-HE data-ratio=43 data-arrows=1 data-hideLinkContainer=1 data-lra=hr data-tagesschau=1","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Wahlkreiskarte"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":false,"externalServiceId":"wahlkreiskarte","externalServiceEmbedType":"js","externalServiceName":"Wahlkreiskarte"},"serviceUrl":"https://www.tagesschau.de/wahl/karte21/current/4e1_karte_embed.js*data-electionid=2023-10-08-LT-DE-HE data-y= data-a=K data-k= data-p= data-elements= data-site= data-q=","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Koalitionsrechner"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":true,"externalServiceId":"koalitionsrechner","externalServiceEmbedType":"iFrame","externalServiceName":"Koalitionsrechner"},"serviceUrl":"https://www.tagesschau.de/wahl/koalitionsrechner/2023-10-08-LT-DE-HE-koalitionsrechner_embed.shtml","fixedHeight":"550","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}}],"dataPolicy":{"serviceList":[{"key":"ard_mediathek","value":"ARD Mediathek (Video)"},{"key":"arte_concert","value":"Arte Concert"},{"key":"arte_concert_new","value":"Arte Concert 2.0"},{"key":"datawrapper_cdn","value":"Datawrapper (Datengrafik)"},{"key":"esri","value":"Esri (Notfallkarte)"},{"key":"facebook-post","value":"Facebook"},{"key":"flourish","value":"Flourish (Datengrafik)"},{"key":"giphy","value":"Giphy (animiertes GIF)"},{"key":"instagram","value":"Instagram"},{"key":"twitter-post","value":"Twitter"},{"key":"vimeo","value":"Vimeo (Video)"},{"key":"youtube","value":"YouTube (Video)"},{"key":"youtube360","value":"YouTube 360 (360° Video)"}]}}
1
+ {"copytextParagraph":[{"isHeadline":true,"text":"Copytext mit externen Diensten"},{"isHeadline":true,"text":"Wahl Gemeinde Ergebnis"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":false,"externalServiceId":"wahl-gemeinde-ergebnis","externalServiceEmbedType":"js","externalServiceName":"wahl-gemeinde-ergebnis"},"serviceUrl":"https://www.tagesschau.de/wahl/archiv/2024-06-09-EP-DE/charts/wahlkreis-detail/G06412000-{version}.shtml?externalEmbed*G06412000*&2024-06-09-EP-DE*&https%3A%2F%2Fwww.hessenschau.de%2Fpolitik%2Flandtagswahl%2Fkandidatencheck%2Fwk-versions.json","fixedHeight":"","aspectRatio":"","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"360Grad"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":true,"externalServiceId":"360grad","externalServiceEmbedType":"iFrame","externalServiceName":"360 Grad"},"serviceUrl":"https://static.hr.de/hessenschau/360/tour-altstadt/360Tour-altstadt-final1.html","aspectRatio":"100","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"ARD-Mediathek (Video)"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"ard_mediathek","externalServiceEmbedType":"iFrame","externalServiceName":"ARD Mediathek (Video)"},"serviceUrl":"https://www.ardmediathek.de/embed/Y3JpZDovL2Z1bmsubmV0LzExNzkwL3ZpZGVvLzE3NzQ2NzU?clientType=hr","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"ARTE Concert 2.0"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"arte_concert_new","externalServiceEmbedType":"iFrame","externalServiceName":"Arte Concert 2.0"},"serviceUrl":"https://www.arte.tv/player/v5/index.php?json_url=https%3A%2F%2Fapi.arte.tv%2Fapi%2Fplayer%2Fv2%2Fconfig%2Fde%2F116593-005-A&lang=de&autoplay=false&mute=0","aspectRatio":"16x9","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Bundesliga Audiostream"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":true,"externalServiceId":"bundesligaAudiostream","externalServiceEmbedType":"iFrame","externalServiceName":"Bundesliga Audiostream"},"serviceUrl":"https://livecenter.sportschau.de/iframe/spielplan-kompakt/co3/md11/////","aspectRatio":"9x16","fixedHeight":"600","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Datawrapper CDN"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":false,"externalServiceId":"datawrapper_cdn","externalServiceEmbedType":"js","externalServiceName":"Datawrapper (Datengrafik)"},"serviceUrl":"https://datawrapper.dwcdn.net/IC3Xn/1/","fixedHeight":"380","setResponsiveIframe":true,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Esri Karte"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"esri","externalServiceEmbedType":"iFrame","externalServiceName":"Esri (Notfallkarte)"},"serviceUrl":"https://arcg.is/1aW0au0","aspectRatio":"100","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":"","externalServiceCaption":"Notfallkarte"}}}},{"isHeadline":true,"text":"Facebook"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":false,"externalServiceId":"facebook-post","externalServiceEmbedType":"js","externalServiceName":"Facebook"},"serviceUrl":"https://www.facebook.com/ZooFFM/posts/1926440010874354","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Flourish"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"flourish","externalServiceEmbedType":"iFrame","externalServiceName":"Flourish (Datengrafik)"},"serviceUrl":"https://public.flourish.studio/story/18361/embed","fixedHeight":"550","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Giphy"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"giphy","externalServiceEmbedType":"iFrame","externalServiceName":"Giphy (animiertes GIF)"},"serviceUrl":"https://giphy.com/embed/ONxw4niC96zwk","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Instagram"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":false,"externalServiceId":"instagram","externalServiceEmbedType":"js","externalServiceName":"Instagram"},"serviceUrl":"https://www.instagram.com/p/CEjxNt8lW4K/","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"X"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":false,"externalServiceId":"twitter-post","externalServiceEmbedType":"js","externalServiceName":"X"},"serviceUrl":"https://twitter.com/tagesthemen/status/1578122540362465299","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Vimeo"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"vimeo","externalServiceEmbedType":"iFrame","externalServiceName":"Vimeo (Video)"},"serviceUrl":"https://player.vimeo.com/video/438111654","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Youtube"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"youtube","externalServiceEmbedType":"iFrame","externalServiceName":"YouTube (Video)"},"serviceUrl":"https://www.youtube-nocookie.com/embed/LMjXHYHZtrE?rel=0","aspectRatio":"16x9","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Youtube 360°"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":true,"embedAsIFrame":true,"externalServiceId":"youtube360","externalServiceEmbedType":"iFrame","externalServiceName":"YouTube 360 (360° Video)"},"serviceUrl":"https://www.youtube-nocookie.com/embed/yT1pyf9oXGk","aspectRatio":"16x9","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":"","externalServiceCaption":"Eine Demo der Virtual Reality-Inszenierung '2049: Zeitreise Mobilität'"}}}},{"isHeadline":true,"text":"Statischer Dienst"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":true,"externalServiceId":"staticService","externalServiceEmbedType":"iFrame","externalServiceName":"Statischer Dienst"},"serviceUrl":"https://static.hr.de/hessenschau/btw21/linientool/unternehmensgruendung","fixedHeight":"1000","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Wahlmonitor"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":false,"externalServiceId":"wahlmonitor","externalServiceEmbedType":"js","externalServiceName":"Wahlmonitor"},"serviceUrl":"https://www.tagesschau.de/wahl/monitor-15/4e1_monitor_embed.js*data-externalembed=true data-electionid=2023-10-08-LT-DE-HE data-ratio=43 data-arrows=1 data-hideLinkContainer=1 data-lra=hr data-tagesschau=1","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Wahlkreiskarte"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":false,"externalServiceId":"wahlkreiskarte","externalServiceEmbedType":"js","externalServiceName":"Wahlkreiskarte"},"serviceUrl":"https://www.tagesschau.de/wahl/karte21/current/4e1_karte_embed.js*data-electionid=2023-10-08-LT-DE-HE data-y= data-a=K data-k= data-p= data-elements= data-site= data-q=","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}},{"isHeadline":true,"text":"Koalitionsrechner"},{"paragraphBoxItem":{"isExternalService":true,"toModel":{"externalService":{"externalServiceConfig":{"makeConfigurable":false,"embedAsIFrame":true,"externalServiceId":"koalitionsrechner","externalServiceEmbedType":"iFrame","externalServiceName":"Koalitionsrechner"},"serviceUrl":"https://www.tagesschau.de/wahl/koalitionsrechner/2023-10-08-LT-DE-HE-koalitionsrechner_embed.shtml","fixedHeight":"550","setResponsiveIframe":false,"setTimedReloadIframe":false,"setTimeForReload":""}}}}],"dataPolicy":{"serviceList":[{"key":"ard_mediathek","value":"ARD Mediathek (Video)"},{"key":"arte_concert","value":"Arte Concert"},{"key":"arte_concert_new","value":"Arte Concert 2.0"},{"key":"datawrapper_cdn","value":"Datawrapper (Datengrafik)"},{"key":"esri","value":"Esri (Notfallkarte)"},{"key":"facebook-post","value":"Facebook"},{"key":"flourish","value":"Flourish (Datengrafik)"},{"key":"giphy","value":"Giphy (animiertes GIF)"},{"key":"instagram","value":"Instagram"},{"key":"twitter-post","value":"Twitter"},{"key":"vimeo","value":"Vimeo (Video)"},{"key":"youtube","value":"YouTube (Video)"},{"key":"youtube360","value":"YouTube 360 (360° Video)"}]}}
@@ -102,7 +102,10 @@ const ExternalService = function (context) {
102
102
  break
103
103
  case 'wahlomat':
104
104
  createWahlOMatEmbed()
105
- break
105
+ break
106
+ case 'wahl-gemeinde-ergebnis':
107
+ createWahlGemeindeErgebnis()
108
+ break
106
109
  default:
107
110
  console.error('No JS Config for external service ' + id)
108
111
  break
@@ -112,7 +115,156 @@ const ExternalService = function (context) {
112
115
  loadIframe() //für alle Dienste die nicht der DSGVO Datapolicy unterliegen
113
116
  }
114
117
  }
118
+ const createWahlGemeindeErgebnis = function () {
119
+ let embedCode = options.embedCode,
120
+ cleanUrl,
121
+ wahlKreisVersionJsonUrl,
122
+ wahlkreis,
123
+ wahlid,
124
+ jsonResponse,
125
+ iFrameElement,
126
+ iframeHeight = 300
115
127
 
128
+ const cleanVariables = function (variable) {
129
+ while (variable.charAt(0) === '&') {
130
+ variable = variable.substring(1)
131
+ }
132
+ return variable
133
+ }
134
+ const extractDataFromEmbedCode = function () {
135
+ const parts = embedCode.split('*')
136
+ if (parts.length === 4) {
137
+ cleanUrl = cleanVariables(decodeURIComponent(parts[0].trim()))
138
+ wahlkreis = cleanVariables(decodeURIComponent(parts[1].trim()))
139
+ wahlid = cleanVariables(decodeURIComponent(parts[2].trim()))
140
+ wahlKreisVersionJsonUrl = cleanVariables(decodeURIComponent(parts[3].trim()))
141
+ }
142
+ }
143
+ const loadIframe = function (version, url, wahlkreis) {
144
+ if (version) {
145
+ let iframeUrl = url.replace('{version}', version)
146
+ let iframe = document.createElement('iframe')
147
+ iframe.className = ''
148
+ iframe.style.border = 'none'
149
+ iframe.style.height = iframeHeight + 'px'
150
+ iframe.style.width = '100%'
151
+ iframe.setAttribute('webkitallowfullscreen', '')
152
+ iframe.setAttribute('mozallowfullscreen', '')
153
+ iframe.setAttribute('allowfullscreen', '')
154
+ iframe.setAttribute('scrolling', 'no')
155
+ iframe.setAttribute('frameborder', '0')
156
+ iframe.src = iframeUrl
157
+ iframe.id = 'wahl-gemeinde-ergebnis-' + wahlkreis
158
+ rootElement.innerHTML = ''
159
+ rootElement.insertBefore(iframe, null)
160
+ iFrameElement = document.getElementById('wahl-gemeinde-ergebnis-' + wahlkreis)
161
+ } else {
162
+ loadNoDataDiv('Es liegen zur Zeit noch keine Ergebnisse vor', 5)
163
+ }
164
+ }
165
+ const loadNoDataDiv = function (text, timeout) {
166
+ let div = document.createElement('div')
167
+ div.className =
168
+ 'p-5 c-externalService__wahl-gemeinde-ergebnis-no-result rounded-tl-hr rounded-br-hr bg-highlight-1'
169
+ div.innerHTML =
170
+ '<div class="text-2xl text-clusterTeaserHeadline font-titleCluster mb-2">' +
171
+ text +
172
+ '</div>' +
173
+ '<div class="flex flex-row" >' +
174
+ ' <div class="">' +
175
+ ' <span>Dieser Inhalt wird automatisch aktualisiert in</span>' +
176
+ ' <span data-minutes>' +
177
+ timeout +
178
+ ' </span>' +
179
+ ' <span>Min</span>' +
180
+ ' <span data-seconds>0</span>' +
181
+ ' <span>Sek</span>' +
182
+ ' </div>' +
183
+ '</div>'
184
+ rootElement.innerHTML = ''
185
+ rootElement.insertBefore(div, null)
186
+ countdownMinutes(timeout, fetchJsonData)
187
+ }
188
+ const resizeIframe = function (newheight) {
189
+ if (newheight !== iframeHeight) {
190
+ iFrameElement.style.height = newheight + 'px'
191
+ iframeHeight = newheight
192
+ }
193
+ }
194
+ const processMessage = function (evt) {
195
+ if (evt.origin !== 'https://www.tagesschau.de') {
196
+ console.log('message', evt.origin + ' ist nicht vertrauenswürdig')
197
+ } else {
198
+ resizeIframe(evt.data)
199
+ }
200
+ }
201
+ const initMessageEventListener = function () {
202
+ if (window.addEventListener) {
203
+ // For standards-compliant web browsers
204
+ window.addEventListener('message', processMessage, false)
205
+ } else {
206
+ window.attachEvent('onmessage', processMessage)
207
+ }
208
+ }
209
+ const fetchJsonData = function () {
210
+ fetch(wahlKreisVersionJsonUrl, {
211
+ method: 'GET',
212
+ headers: {
213
+ Accept: 'application/json',
214
+ },
215
+ })
216
+ .then((response) => response.json())
217
+ .then((jsonData) =>
218
+ loadIframe(
219
+ jsonData.hasOwnProperty(wahlkreis) && jsonData[wahlkreis].v
220
+ ? jsonData[wahlkreis].v
221
+ : null,
222
+ cleanUrl,
223
+ wahlkreis,
224
+ ),
225
+ )
226
+ .catch(function () {
227
+ loadNoDataDiv('Es liegen zur Zeit noch keine Ergebnisse vor', 5)
228
+ console.log('No JSON Data Loaded')
229
+ })
230
+ }
231
+
232
+ function countdownMinutes(minutesToCountdown, callbackFunction) {
233
+ const second = 1000,
234
+ minute = second * 60,
235
+ hour = minute * 60,
236
+ day = hour * 24,
237
+ minuteElement = document.querySelector('[data-minutes]'),
238
+ secondElement = document.querySelector('[data-seconds]')
239
+
240
+ function AddMinutesToDate(date, minutes) {
241
+ return new Date(date.getTime() + minutes * 60000)
242
+ }
243
+
244
+ let countDown = AddMinutesToDate(new Date(), minutesToCountdown),
245
+ x = setInterval(function () {
246
+ let now = new Date().getTime(),
247
+ distance = countDown - now
248
+
249
+ if (minuteElement != null) {
250
+ minuteElement.innerText = Math.floor((distance % hour) / minute)
251
+ }
252
+
253
+ if (secondElement != null) {
254
+ secondElement.innerText = Math.floor((distance % minute) / second)
255
+ }
256
+
257
+ if (distance < 1000) {
258
+ callbackFunction()
259
+ clearInterval(x)
260
+ }
261
+ }, second)
262
+ }
263
+
264
+ extractDataFromEmbedCode()
265
+ initMessageEventListener()
266
+ fetchJsonData()
267
+ }
116
268
  const createWahlOMatEmbed = function () {
117
269
 
118
270
  const divTag = document.createElement('div')
@@ -2,6 +2,7 @@ import {
2
2
  ExternalServiceContent
3
3
  } from './external_service.data.js'
4
4
  import externalService from './external_service_with_datapolicy_check.hbs'
5
+ import externalServiceNoDatapolicyCheck from './external_service.hbs'
5
6
 
6
7
  const TemplatePageExternalService = (args, { globals: { theme } }) => {
7
8
  // You can either use a function to create DOM elements or use a plain html string!
@@ -9,7 +10,12 @@ const TemplatePageExternalService = (args, { globals: { theme } }) => {
9
10
  let brand = undefined !== theme ? theme : 'hessenschau'
10
11
  return externalService({ brand, ...args })
11
12
  }
12
-
13
+ const TemplatePageExternalServiceNoDatapolicyCheck = (args, { globals: { theme } }) => {
14
+ // You can either use a function to create DOM elements or use a plain html string!
15
+ // return `<div>${label}</div>`;
16
+ let brand = undefined !== theme ? theme : 'hessenschau'
17
+ return externalServiceNoDatapolicyCheck({ brand, ...args })
18
+ }
13
19
  export default {
14
20
  title: 'Komponenten/Externe Dienste',
15
21
  argTypes: {},
@@ -53,4 +59,9 @@ export const ExterneDiensteDatawrapperContentRefresher = {
53
59
  name: 'Externe Dienste Datawrapper mit ContentRefresher',
54
60
  args: ExternalServiceContent.Datawrapper_CDN_NoResponsiveFixedHeightReload,
55
61
  }
62
+ export const WahlGemeindeErgebnis = {
63
+ render: TemplatePageExternalServiceNoDatapolicyCheck.bind({}),
64
+ name: 'Externe Dienste Wahl Gemeinde Ergebnis',
65
+ args: ExternalServiceContent.Wahl_Gemeinde_Ergebnis,
66
+ }
56
67
 
@@ -208,5 +208,20 @@
208
208
  "setTimedReloadIframe": false,
209
209
  "setTimeForReload": "",
210
210
  "externalServiceCaption": "Eine Demo der Virtual Reality-Inszenierung '2049: Zeitreise Mobilität'"
211
+ },
212
+ "Wahl_Gemeinde_Ergebnis": {
213
+ "externalServiceConfig": {
214
+ "makeConfigurable": false,
215
+ "embedAsIFrame": false,
216
+ "externalServiceId": "wahl-gemeinde-ergebnis",
217
+ "externalServiceEmbedType": "js",
218
+ "externalServiceName": "wahl-gemeinde-ergebnis"
219
+ },
220
+ "serviceUrl": "https://www.tagesschau.de/wahl/archiv/2024-06-09-EP-DE/charts/wahlkreis-detail/G06412000-{version}.shtml?externalEmbed*G06412000*&2024-06-09-EP-DE*&https%3A%2F%2Fwww.hessenschau.de%2Fpolitik%2Flandtagswahl%2Fkandidatencheck%2Fwk-versions.json",
221
+ "fixedHeight": "",
222
+ "aspectRatio": "",
223
+ "setResponsiveIframe": false,
224
+ "setTimedReloadIframe": false,
225
+ "setTimeForReload": ""
211
226
  }
212
227
  }
@@ -1,16 +1,15 @@
1
1
  <header class="mt-6 sm480:mt-8">
2
+ {{#with this.label}}
3
+ {{#> components/label/label_group _css="mb-2"}}
4
+ {{> components/label/label _type=this.type _text=(loca this.loca)}}
5
+ {{/components/label/label_group}}
6
+ {{/with}}
2
7
  <h2>
3
- {{#if this.label }}
4
- {{#with this.label}}
5
- {{#> components/label/label_group _css="mb-2"}}
6
- {{> components/label/label _type=this.type _text=(loca this.loca)}}
7
- {{/components/label/label_group}}
8
- {{/with}}
9
- {{else}}
8
+ {{#unless this.label }}
10
9
  {{~#if topline}}
11
10
  <span class="block mb-2 text-base sm480:text-xl font-heading">{{this.topline}}</span>
12
11
  {{/if~}}
13
- {{/if~}}
12
+ {{/unless~}}
14
13
  <span class="text-3xl font-headingSerif sm480:text-4xl">{{this.title}}</span>
15
14
  </h2>
16
15
  </header>