hr-design-system-handlebars 1.63.9 → 1.63.10

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,15 @@
1
+ # v1.63.10 (Fri Apr 12 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Several fixes for Javascript and Iframe Styles [#899](https://github.com/mumprod/hr-design-system-handlebars/pull/899) ([@Paul-Atreidis](https://github.com/Paul-Atreidis))
6
+
7
+ #### Authors: 1
8
+
9
+ - [@Paul-Atreidis](https://github.com/Paul-Atreidis)
10
+
11
+ ---
12
+
1
13
  # v1.63.9 (Thu Apr 11 2024)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -1536,6 +1536,9 @@ article.indexTextDS .indexTextHighlighted .link {
1536
1536
  .aspect-video {
1537
1537
  aspect-ratio: 16 / 9;
1538
1538
  }
1539
+ .\!h-full {
1540
+ height: 100% !important;
1541
+ }
1539
1542
  .h-0 {
1540
1543
  height: 0px;
1541
1544
  }
@@ -1593,6 +1596,9 @@ article.indexTextDS .indexTextHighlighted .link {
1593
1596
  .h-\[500rem\] {
1594
1597
  height: 500rem;
1595
1598
  }
1599
+ .h-\[560px\] {
1600
+ height: 560px;
1601
+ }
1596
1602
  .h-\[9px\] {
1597
1603
  height: 9px;
1598
1604
  }
@@ -1719,6 +1725,9 @@ article.indexTextDS .indexTextHighlighted .link {
1719
1725
  .w-screen {
1720
1726
  width: 100vw;
1721
1727
  }
1728
+ .\!min-w-full {
1729
+ min-width: 100% !important;
1730
+ }
1722
1731
  .min-w-0 {
1723
1732
  min-width: 0px;
1724
1733
  }
@@ -3324,7 +3333,7 @@ article.indexTextDS .indexTextHighlighted .link {
3324
3333
  border-bottom-color: var(--color-secondary-ds);
3325
3334
  }
3326
3335
  .counter-reset {
3327
- counter-reset: cnt1712858412306;
3336
+ counter-reset: cnt1712914517068;
3328
3337
  }
3329
3338
  .hyphens-auto {
3330
3339
  -webkit-hyphens: auto;
@@ -3703,7 +3712,7 @@ article.indexTextDS .indexTextHighlighted .link {
3703
3712
  --tw-ring-color: rgba(255, 255, 255, 0.5);
3704
3713
  }
3705
3714
  .-ordered {
3706
- counter-increment: cnt1712858412306 1;
3715
+ counter-increment: cnt1712914517068 1;
3707
3716
  }
3708
3717
  .-ordered::before {
3709
3718
  position: absolute;
@@ -3719,7 +3728,7 @@ article.indexTextDS .indexTextHighlighted .link {
3719
3728
  letter-spacing: .0125em;
3720
3729
  --tw-text-opacity: 1;
3721
3730
  color: rgba(0, 0, 0, var(--tw-text-opacity));
3722
- content: counter(cnt1712858412306);
3731
+ content: counter(cnt1712914517068);
3723
3732
  }
3724
3733
  /*! ****************************/
3725
3734
  /*! DataPolicy stuff */
@@ -5535,6 +5544,10 @@ article.indexTextDS .indexTextHighlighted .link {
5535
5544
  height: 2rem;
5536
5545
  }
5537
5546
 
5547
+ .sm480\:h-full {
5548
+ height: 100%;
5549
+ }
5550
+
5538
5551
  .sm480\:w-2\/3 {
5539
5552
  width: 66.666667%;
5540
5553
  }
@@ -1,85 +1,88 @@
1
1
 
2
- const DataWrapperContentRefresher = function (context, uniqueID) {
3
- const { element: rootElement } = context
4
- let remainingTime
5
- let timer
6
- let iframeRefresh = document.getElementById('datawrapper-chart-' + uniqueID)
2
+ const DataWrapperContentRefresher = function (context, id, refreshIntervall) {
3
+ const { element: rootElement } = context
4
+ let remainingTime
5
+ let timer
6
+ let uniqueID = id
7
+ let intervall = refreshIntervall
8
+ let iframeRefresh = document.getElementById('datawrapper-chart-' + uniqueID)
9
+
10
+ const createRefresher = function () {
11
+ console.log("Refresher bauen")
12
+ let divCounter = document.createElement('div')
13
+ let divOverlay = document.createElement('div')
14
+ let divTextOverlay = document.createElement('div')
15
+ divOverlay.id = 'overlay' + uniqueID
16
+ divOverlay.style.position = 'absolute'
17
+ divOverlay.style.top = '0'
18
+ divOverlay.style.display = 'none'
19
+ divOverlay.style.alignItems = 'center'
20
+ divOverlay.style.justifyContent = 'center'
21
+ divOverlay.style.backgroundColor = '#fff'
22
+ divOverlay.style.width = '100%'
23
+ divOverlay.style.height = 'calc(100% - 36px)'
24
+ divOverlay.style.backgroundColor = '#d8e9f6'
25
+ divTextOverlay.innerHTML = 'Lade Inhalt neu...'
26
+ divTextOverlay.style.backgroundColor = '#005293'
27
+ divTextOverlay.style.padding = '8px'
28
+ divTextOverlay.style.color = '#fff'
29
+ divTextOverlay.style.fontWeight = '800'
30
+ divTextOverlay.style.fontFamily = 'RobotoSlab'
31
+ divTextOverlay.style.borderRadius = '6px 6px 6px 6px'
32
+ divOverlay.appendChild(divTextOverlay)
33
+ divCounter.id = 'counter' + uniqueID
34
+ divCounter.style.backgroundColor = '#006dc1'
35
+ divCounter.style.color = '#fff'
36
+ divCounter.style.fontSize = '12px'
37
+ divCounter.style.padding = '8px'
38
+ divCounter.style.borderRadius = '0 0 4px 4px'
7
39
 
8
- const createRefresher = function (uniqueID) {
9
- let divCounter = document.createElement('div')
10
- let divOverlay = document.createElement('div')
11
- let divTextOverlay = document.createElement('div')
12
- divOverlay.id = 'overlay' + uniqueID
13
- divOverlay.style.position = 'absolute'
14
- divOverlay.style.top = '0'
15
- divOverlay.style.display = 'none'
16
- divOverlay.style.alignItems = 'center'
17
- divOverlay.style.justifyContent = 'center'
18
- divOverlay.style.backgroundColor = '#fff'
19
- divOverlay.style.width = '100%'
20
- divOverlay.style.height = 'calc(100% - 36px)'
21
- divOverlay.style.backgroundColor = '#d8e9f6'
22
- divTextOverlay.innerHTML = 'Lade Inhalt neu...'
23
- divTextOverlay.style.backgroundColor = '#005293'
24
- divTextOverlay.style.padding = '8px'
25
- divTextOverlay.style.color = '#fff'
26
- divTextOverlay.style.fontWeight = '800'
27
- divTextOverlay.style.fontFamily = 'RobotoSlab'
28
- divTextOverlay.style.borderRadius = '6px 6px 6px 6px'
29
- divOverlay.appendChild(divTextOverlay)
30
- divCounter.id = 'counter' + uniqueID
31
- divCounter.style.backgroundColor = '#006dc1'
32
- divCounter.style.color = '#fff'
33
- divCounter.style.fontSize = '12px'
34
- divCounter.style.padding = '8px'
35
- divCounter.style.borderRadius = '0 0 4px 4px'
36
-
37
- rootElement.style.position = 'relative'
38
- rootElement.appendChild(divCounter)
39
- rootElement.appendChild(divOverlay)
40
- startCountdown()
41
- }
40
+ rootElement.style.position = 'relative'
41
+ rootElement.appendChild(divCounter)
42
+ rootElement.appendChild(divOverlay)
43
+ startCountdown()
44
+ }
42
45
 
43
- const refreshIframe = function () {
44
- console.log('Reload')
45
- iframeRefresh.style.opacity = '0'
46
- iframeRefresh.src =
47
- iframeRefresh.src.split('?')[0] + '?_=' + new Date().getTime()
48
- clearInterval(timer)
49
- }
50
- const startCountdown = function () {
51
- remainingTime = Number(iFrameConfig.refreshIntervall)
52
- setTimeout(function () {
53
- iframeRefresh.style.opacity = '1'
54
- document.getElementById('overlay' + uniqueID).style.display = 'none'
55
- }, 1000)
56
- timer = setInterval(function () {
57
- checkTimer()
58
- }, 1000)
59
- }
60
- const checkTimer = function () {
61
- if (remainingTime >= 0) {
46
+ const refreshIframe = function () {
47
+ console.log('Reload')
48
+ iframeRefresh.style.opacity = '0'
49
+ iframeRefresh.src =
50
+ iframeRefresh.src.split('?')[0] + '?_=' + new Date().getTime()
51
+ clearInterval(timer)
52
+ }
53
+ const startCountdown = function () {
54
+ remainingTime = Number(intervall)
55
+ setTimeout(function () {
56
+ iframeRefresh.style.opacity = '1'
57
+ document.getElementById('overlay' + uniqueID).style.display = 'none'
58
+ }, 1000)
59
+ timer = setInterval(function () {
60
+ checkTimer()
61
+ }, 1000)
62
+ }
63
+ const checkTimer = function () {
64
+ if (remainingTime >= 0) {
65
+ document.getElementById('counter' + uniqueID).innerHTML =
66
+ 'Dieser Inhalt wird automatisch aktualisiert in ' +
67
+ secondsToTimeString(remainingTime) +
68
+ ' Min.'
69
+ remainingTime -= 1
70
+ if (remainingTime == -1) {
71
+ document.getElementById('overlay' + uniqueID).style.display = 'flex'
62
72
  document.getElementById('counter' + uniqueID).innerHTML =
63
- 'Dieser Inhalt wird automatisch aktualisiert in ' +
64
- secondsToTimeString(remainingTime) +
65
- ' Min.'
66
- remainingTime -= 1
67
- if (remainingTime == -1) {
68
- document.getElementById('overlay' + uniqueID).style.display = 'flex'
69
- document.getElementById('counter' + uniqueID).innerHTML =
70
- 'Zeitintervall wird neu gestartet...'
71
- }
72
- } else {
73
- refreshIframe()
74
- startCountdown()
73
+ 'Zeitintervall wird neu gestartet...'
75
74
  }
75
+ } else {
76
+ refreshIframe()
77
+ startCountdown()
76
78
  }
77
- const secondsToTimeString = function (seconds) {
78
- return new Date(seconds * 1000).toISOString().substr(14, 5)
79
- }
80
- return {
81
- createRefresher: createRefresher
82
- }
83
79
  }
80
+ const secondsToTimeString = function (seconds) {
81
+ return new Date(seconds * 1000).toISOString().substr(14, 5)
82
+ }
83
+ return {
84
+ createRefresher: createRefresher
85
+ }
86
+ }
84
87
 
85
- export default DataWrapperContentRefresher
88
+ export default DataWrapperContentRefresher
@@ -1,28 +1,62 @@
1
- const DataWrapperNoResponsiveIframe = function (context, configAR, configFixedHeight, comfigEmbedCode) {
1
+ const DataWrapperNoResponsiveIframe = function (context, configAR, configFixedHeight, embedCode) {
2
2
 
3
3
  const { element: rootElement } = context
4
4
  let aspectRatio = configAR
5
5
  let fixedHeight = configFixedHeight
6
- let embedCode = comfigEmbedCode
7
6
 
8
- const createNoResponsiveIframe = function (aspectRatioClass) {
7
+ const createNoResponsiveIframe = function () {
9
8
 
10
9
 
11
10
  var parentDiv = document.createElement('div')
12
- parentDiv.className = 'copytext__scrollWrapper'
11
+ //Auflösen nach Tailwind-Klassen //copytext__scrollWrapper
12
+ parentDiv.className = '!h-full'
13
13
  var div = document.createElement('div')
14
14
  //Keine Aspect-Ratio ausgewählt aber eine feste Höhe
15
+
16
+ console.log(aspectRatio)
17
+ console.log(configAR)
15
18
  if (aspectRatio === undefined) {
16
- div.className = 'noaspect_datawrapper_cdn'
19
+ //Auflösen nach Tailwind-Klassen //noaspect_datawrapper_cdn
20
+ div.className = 'relative overflow-hidden w-0 border-0 !min-w-full'
17
21
  div.style.height = fixedHeight + 'px'
18
22
  div.style.width = '100%'
19
23
  }
20
24
  // Aspect-Ratio ausgewählt
21
25
  else {
22
- div.className = aspectRatioClass + ' datawrapper_cdn'
26
+ //ar-- in Tailwind-Klassen
27
+ let tailwindCSS
28
+ switch(aspectRatio){
29
+ case '100':
30
+ tailwindCSS = "ar-1-1"
31
+ break;
32
+ case '16x9':
33
+ tailwindCSS = "ar-16-9"
34
+ break;
35
+ case '9x16':
36
+ tailwindCSS = "ar-9-16"
37
+ break;
38
+ case '16x7':
39
+ tailwindCSS = "ar-16-7"
40
+ break;
41
+ case '7x16':
42
+ tailwindCSS = "ar-7-16"
43
+ break;
44
+ case '4x3':
45
+ tailwindCSS = "ar-4-3"
46
+ break;
47
+ case '100x27':
48
+ tailwindCSS = "ar-100-27"
49
+ break;
50
+ default:
51
+ tailwindCSS = "ar-16-9"
52
+ }
53
+
54
+ div.className = tailwindCSS + " w-full sm480:h-full h-[560px]"
23
55
  }
24
56
  var iframe = document.createElement('iframe')
25
- iframe.className = 'w-full h-full datawrapper_cdn'
57
+
58
+ //Auflösen nach Tailwind-Klassen //ar_iframe datawrapper_cdn
59
+ iframe.setAttribute('class', 'border-0 top-0 left-0 w-full h-full overflow-y-hidden')
26
60
  iframe.setAttribute('id', 'i_frame')
27
61
  iframe.setAttribute('data-isloaded', '0')
28
62
  iframe.setAttribute('webkitallowfullscreen', '')
@@ -23,19 +23,24 @@ const ExternalService = function (context) {
23
23
  embedType = options.embedType,
24
24
  dataPolicyCheck = options.dataPolicyCheck || false,
25
25
  id = options.id,
26
- iFrameConfig = options.iFrameConfig,
27
- isWebview = window.parent.document.documentElement.classList.contains('webview'),
28
- button = hr$('.js-dataPolicyTeaser__button', rootElement)[0]
29
-
26
+ iFrameConfig = options.iFrameConfig
30
27
  let acceptButton,
31
28
  acceptAlwaysCheckbox = hr$('.js-dataPolicy-acceptPermanentely', rootElement)[0],
32
- dataPolicySettingsButton = hr$('.js-data-policy-settings-button', rootParent)[0],
33
- embedCode = options.embedCode,
29
+ dataPolicySettingsButton = hr$('.js-data-policy-settings-button', rootParent)[0]
30
+ let embedCode = options.embedCode,
34
31
  iframe,
35
32
  settingsCookie,
36
- isExternalServiceLoaded = false
37
-
33
+ noResponsiveIframe,
34
+ contentRefresher,
35
+ uniqueId,
36
+ isExternalServiceLoaded = false,
37
+ isWebview = window.parent.document.documentElement.classList.contains('webview')
38
38
 
39
+ const testDOMElements = function () {
40
+ console.log(rootElement)
41
+ console.log(rootParent)
42
+ console.log(acceptAlwaysCheckbox)
43
+ }
39
44
  const embedExternalService = function (callback) {
40
45
  $.ajax({
41
46
  type: 'GET',
@@ -101,7 +106,7 @@ const ExternalService = function (context) {
101
106
  }
102
107
  break
103
108
  default:
104
- loadIframe()
109
+ loadIframe() //für alle Dienste die nicht der DSGVO Datapolicy unterliegen
105
110
  }
106
111
  }
107
112
 
@@ -123,34 +128,49 @@ const ExternalService = function (context) {
123
128
  script.type = 'text/javascript'
124
129
  rootElement.appendChild(script)
125
130
  }
131
+ const createUniqueID = function() {
132
+ uniqueId = Math.random().toString(36).replace(/[^a-z]+/g, '').substring(2, 10)
133
+ }
134
+
135
+ const getAspectRatioClass = function () {
136
+ switch (iFrameConfig.aspectRatio) {
137
+ case '16x9':
138
+ return "ar-16-9"
139
+ case '16x7':
140
+ return "ar-16-7"
141
+ case '4x3':
142
+ return "ar-4-3"
143
+ case '100x27':
144
+ return "ar-100-27"
145
+ case '100':
146
+ return "ar-1-1"
147
+ case '9x16':
148
+ return "ar-9-16"
149
+ case '7x16':
150
+ return "ar-7-16"
151
+ default:
152
+ return "ar-16-9"
153
+ }
154
+ }
126
155
 
127
156
  const createDataWrapperEmbed = function () {
128
157
  removeDatapolicyBox()
129
- var uniqueID = function () {
130
- return Math.random()
131
- .toString(36)
132
- .replace(/[^a-z]+/g, '')
133
- .substring(2, 10)
134
- }
135
- let contentRefresher = new DataWrapperContentRefresher(context, uniqueID)
136
- let noResponsiveIframe = new DataWrapperNoResponsiveIframe(context, iFrameConfig.aspectRatio, iFrameConfig.fixedHeight, embedCode)
137
-
158
+ createUniqueID()
138
159
  if (iFrameConfig.noResponsiveIframe == 'true') {
139
- noResponsiveIframe.createNoResponsiveIframe(getAspectRatioClass())
160
+ noResponsiveIframe = new DataWrapperNoResponsiveIframe(context, iFrameConfig.aspectRatio, iFrameConfig.fixedHeight, embedCode)
161
+ noResponsiveIframe.createNoResponsiveIframe()
140
162
  }
141
163
  else {
142
164
  var iframe = document.createElement('iframe')
143
- iframe.className = 'dataWrapper-embed'
144
- iframe.style.width = '0'
145
- iframe.style.minWidth = '100% !important'
146
- iframe.style.border = 'none'
165
+ //Auflösen nach Tailwind-Klassen //dataWrapper-embed
166
+ iframe.className = 'w-0 !min-w-full border-0'
147
167
  iframe.setAttribute('webkitallowfullscreen', '')
148
168
  iframe.setAttribute('mozallowfullscreen', '')
149
169
  iframe.setAttribute('allowfullscreen', '')
150
170
  iframe.setAttribute('scrolling', 'no')
151
171
  iframe.setAttribute('frameborder', '0')
152
172
  iframe.src = embedCode
153
- iframe.id = 'datawrapper-chart-' + uniqueID
173
+ iframe.id = 'datawrapper-chart-' + uniqueId
154
174
  rootElement.insertBefore(iframe, null)
155
175
 
156
176
  loadScript(
@@ -159,6 +179,8 @@ const ExternalService = function (context) {
159
179
  true
160
180
  )
161
181
  if (iFrameConfig.refreshContent == 'true') {
182
+ console.log("contentRefresher anfügen")
183
+ contentRefresher = new DataWrapperContentRefresher(context, uniqueId, iFrameConfig.refreshIntervall)
162
184
  contentRefresher.createRefresher()
163
185
  }
164
186
  }
@@ -251,64 +273,39 @@ const ExternalService = function (context) {
251
273
  }, 250)
252
274
  }
253
275
 
254
- const getAspectRatioClass = function () {
255
- switch (iFrameConfig.aspectRatio) {
256
- case '16x9':
257
- return "ar-16-9"
258
- case '16x7':
259
- return "ar-16-7"
260
- case '4x3':
261
- return "ar-4-3"
262
- case '100x27':
263
- return "ar-100-27"
264
- case '100':
265
- return "ar-1-1"
266
- case '9x16':
267
- return "ar-9-16"
268
- case '7x16':
269
- return "ar-7-16"
270
- default:
271
- return "ar-16-9"
272
- }
273
- }
274
-
275
276
  const loadIframe = function () {
276
277
  console.log('load iframe ' + id)
277
278
  iframe =
278
279
  "<iframe id='i_frame' data-isloaded='0' src='" +
279
280
  embedCode +
280
- "' frameborder='0' class='" +
281
- iFrameConfig.heightClass +
282
- "' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"
281
+ "' frameborder='0' class='w-full h-full' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"
283
282
  if (iFrameConfig.aspectRatio) {
284
283
  iframe =
285
- "<div class='copytext__scrollWrapper'><div class='" +
284
+ "<div class='!h-full'><div class=" +
286
285
  getAspectRatioClass() +
287
286
  ' ' +
288
287
  id +
289
288
  "'><iframe id='i_frame' data-isloaded='0' src='" +
290
289
  embedCode +
291
- "' frameborder='0' class='w-full h-full " +
292
- iFrameConfig.heightClass +
293
- ' ' +
290
+ "' frameborder='0' class='w-full h-full '" +
294
291
  id +
295
292
  "' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></div>"
296
293
  //TODO Weiche Animation der Inhalte
297
294
  } else {
298
295
  if (iFrameConfig.fixedHeight) {
299
296
  iframe =
300
- "<div class='copytext__scrollWrapper -fixedHeight' style='height:" +
297
+ "<div class='!h-full' style='height:" +
301
298
  iFrameConfig.fixedHeight +
302
- "px'><iframe data-isloaded='0' class='w-full h-full' src='" +
299
+ "px'><iframe data-isloaded='0' src='" +
303
300
  embedCode +
304
- "' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>"
301
+ "' frameborder='0' class='w-full h-full' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>"
305
302
  } else {
306
303
  iframe =
307
- "<div class='copytext__scrollWrapper " +
304
+ "<div class='!h-full " +
308
305
  id +
309
- "'><iframe data-isloaded='0' class='w-full h-full' src='" +
306
+ "'><iframe data-isloaded='0' src='" +
310
307
  embedCode +
311
- "' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>"
308
+ "' frameborder='0' class='w-full h-full' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>"
312
309
  }
313
310
  }
314
311
 
@@ -414,6 +411,7 @@ const ExternalService = function (context) {
414
411
  }
415
412
  initDataPolicy()
416
413
  resetCheckboxForPermanentService()
414
+ testDOMElements()
417
415
  if (isWebview) {
418
416
  /*Für die App werden Cookie-Daten des neuen Cookies wieder mit dem alten Cookie synchronisiert */
419
417
  syncAppOptionsToSettingsCookie()
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.63.9",
9
+ "version": "1.63.10",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "storybook dev -p 6006 public",
@@ -1,85 +1,88 @@
1
1
 
2
- const DataWrapperContentRefresher = function (context, uniqueID) {
3
- const { element: rootElement } = context
4
- let remainingTime
5
- let timer
6
- let iframeRefresh = document.getElementById('datawrapper-chart-' + uniqueID)
2
+ const DataWrapperContentRefresher = function (context, id, refreshIntervall) {
3
+ const { element: rootElement } = context
4
+ let remainingTime
5
+ let timer
6
+ let uniqueID = id
7
+ let intervall = refreshIntervall
8
+ let iframeRefresh = document.getElementById('datawrapper-chart-' + uniqueID)
9
+
10
+ const createRefresher = function () {
11
+ console.log("Refresher bauen")
12
+ let divCounter = document.createElement('div')
13
+ let divOverlay = document.createElement('div')
14
+ let divTextOverlay = document.createElement('div')
15
+ divOverlay.id = 'overlay' + uniqueID
16
+ divOverlay.style.position = 'absolute'
17
+ divOverlay.style.top = '0'
18
+ divOverlay.style.display = 'none'
19
+ divOverlay.style.alignItems = 'center'
20
+ divOverlay.style.justifyContent = 'center'
21
+ divOverlay.style.backgroundColor = '#fff'
22
+ divOverlay.style.width = '100%'
23
+ divOverlay.style.height = 'calc(100% - 36px)'
24
+ divOverlay.style.backgroundColor = '#d8e9f6'
25
+ divTextOverlay.innerHTML = 'Lade Inhalt neu...'
26
+ divTextOverlay.style.backgroundColor = '#005293'
27
+ divTextOverlay.style.padding = '8px'
28
+ divTextOverlay.style.color = '#fff'
29
+ divTextOverlay.style.fontWeight = '800'
30
+ divTextOverlay.style.fontFamily = 'RobotoSlab'
31
+ divTextOverlay.style.borderRadius = '6px 6px 6px 6px'
32
+ divOverlay.appendChild(divTextOverlay)
33
+ divCounter.id = 'counter' + uniqueID
34
+ divCounter.style.backgroundColor = '#006dc1'
35
+ divCounter.style.color = '#fff'
36
+ divCounter.style.fontSize = '12px'
37
+ divCounter.style.padding = '8px'
38
+ divCounter.style.borderRadius = '0 0 4px 4px'
7
39
 
8
- const createRefresher = function (uniqueID) {
9
- let divCounter = document.createElement('div')
10
- let divOverlay = document.createElement('div')
11
- let divTextOverlay = document.createElement('div')
12
- divOverlay.id = 'overlay' + uniqueID
13
- divOverlay.style.position = 'absolute'
14
- divOverlay.style.top = '0'
15
- divOverlay.style.display = 'none'
16
- divOverlay.style.alignItems = 'center'
17
- divOverlay.style.justifyContent = 'center'
18
- divOverlay.style.backgroundColor = '#fff'
19
- divOverlay.style.width = '100%'
20
- divOverlay.style.height = 'calc(100% - 36px)'
21
- divOverlay.style.backgroundColor = '#d8e9f6'
22
- divTextOverlay.innerHTML = 'Lade Inhalt neu...'
23
- divTextOverlay.style.backgroundColor = '#005293'
24
- divTextOverlay.style.padding = '8px'
25
- divTextOverlay.style.color = '#fff'
26
- divTextOverlay.style.fontWeight = '800'
27
- divTextOverlay.style.fontFamily = 'RobotoSlab'
28
- divTextOverlay.style.borderRadius = '6px 6px 6px 6px'
29
- divOverlay.appendChild(divTextOverlay)
30
- divCounter.id = 'counter' + uniqueID
31
- divCounter.style.backgroundColor = '#006dc1'
32
- divCounter.style.color = '#fff'
33
- divCounter.style.fontSize = '12px'
34
- divCounter.style.padding = '8px'
35
- divCounter.style.borderRadius = '0 0 4px 4px'
36
-
37
- rootElement.style.position = 'relative'
38
- rootElement.appendChild(divCounter)
39
- rootElement.appendChild(divOverlay)
40
- startCountdown()
41
- }
40
+ rootElement.style.position = 'relative'
41
+ rootElement.appendChild(divCounter)
42
+ rootElement.appendChild(divOverlay)
43
+ startCountdown()
44
+ }
42
45
 
43
- const refreshIframe = function () {
44
- console.log('Reload')
45
- iframeRefresh.style.opacity = '0'
46
- iframeRefresh.src =
47
- iframeRefresh.src.split('?')[0] + '?_=' + new Date().getTime()
48
- clearInterval(timer)
49
- }
50
- const startCountdown = function () {
51
- remainingTime = Number(iFrameConfig.refreshIntervall)
52
- setTimeout(function () {
53
- iframeRefresh.style.opacity = '1'
54
- document.getElementById('overlay' + uniqueID).style.display = 'none'
55
- }, 1000)
56
- timer = setInterval(function () {
57
- checkTimer()
58
- }, 1000)
59
- }
60
- const checkTimer = function () {
61
- if (remainingTime >= 0) {
46
+ const refreshIframe = function () {
47
+ console.log('Reload')
48
+ iframeRefresh.style.opacity = '0'
49
+ iframeRefresh.src =
50
+ iframeRefresh.src.split('?')[0] + '?_=' + new Date().getTime()
51
+ clearInterval(timer)
52
+ }
53
+ const startCountdown = function () {
54
+ remainingTime = Number(intervall)
55
+ setTimeout(function () {
56
+ iframeRefresh.style.opacity = '1'
57
+ document.getElementById('overlay' + uniqueID).style.display = 'none'
58
+ }, 1000)
59
+ timer = setInterval(function () {
60
+ checkTimer()
61
+ }, 1000)
62
+ }
63
+ const checkTimer = function () {
64
+ if (remainingTime >= 0) {
65
+ document.getElementById('counter' + uniqueID).innerHTML =
66
+ 'Dieser Inhalt wird automatisch aktualisiert in ' +
67
+ secondsToTimeString(remainingTime) +
68
+ ' Min.'
69
+ remainingTime -= 1
70
+ if (remainingTime == -1) {
71
+ document.getElementById('overlay' + uniqueID).style.display = 'flex'
62
72
  document.getElementById('counter' + uniqueID).innerHTML =
63
- 'Dieser Inhalt wird automatisch aktualisiert in ' +
64
- secondsToTimeString(remainingTime) +
65
- ' Min.'
66
- remainingTime -= 1
67
- if (remainingTime == -1) {
68
- document.getElementById('overlay' + uniqueID).style.display = 'flex'
69
- document.getElementById('counter' + uniqueID).innerHTML =
70
- 'Zeitintervall wird neu gestartet...'
71
- }
72
- } else {
73
- refreshIframe()
74
- startCountdown()
73
+ 'Zeitintervall wird neu gestartet...'
75
74
  }
75
+ } else {
76
+ refreshIframe()
77
+ startCountdown()
76
78
  }
77
- const secondsToTimeString = function (seconds) {
78
- return new Date(seconds * 1000).toISOString().substr(14, 5)
79
- }
80
- return {
81
- createRefresher: createRefresher
82
- }
83
79
  }
80
+ const secondsToTimeString = function (seconds) {
81
+ return new Date(seconds * 1000).toISOString().substr(14, 5)
82
+ }
83
+ return {
84
+ createRefresher: createRefresher
85
+ }
86
+ }
84
87
 
85
- export default DataWrapperContentRefresher
88
+ export default DataWrapperContentRefresher
@@ -1,28 +1,62 @@
1
- const DataWrapperNoResponsiveIframe = function (context, configAR, configFixedHeight, comfigEmbedCode) {
1
+ const DataWrapperNoResponsiveIframe = function (context, configAR, configFixedHeight, embedCode) {
2
2
 
3
3
  const { element: rootElement } = context
4
4
  let aspectRatio = configAR
5
5
  let fixedHeight = configFixedHeight
6
- let embedCode = comfigEmbedCode
7
6
 
8
- const createNoResponsiveIframe = function (aspectRatioClass) {
7
+ const createNoResponsiveIframe = function () {
9
8
 
10
9
 
11
10
  var parentDiv = document.createElement('div')
12
- parentDiv.className = 'copytext__scrollWrapper'
11
+ //Auflösen nach Tailwind-Klassen //copytext__scrollWrapper
12
+ parentDiv.className = '!h-full'
13
13
  var div = document.createElement('div')
14
14
  //Keine Aspect-Ratio ausgewählt aber eine feste Höhe
15
+
16
+ console.log(aspectRatio)
17
+ console.log(configAR)
15
18
  if (aspectRatio === undefined) {
16
- div.className = 'noaspect_datawrapper_cdn'
19
+ //Auflösen nach Tailwind-Klassen //noaspect_datawrapper_cdn
20
+ div.className = 'relative overflow-hidden w-0 border-0 !min-w-full'
17
21
  div.style.height = fixedHeight + 'px'
18
22
  div.style.width = '100%'
19
23
  }
20
24
  // Aspect-Ratio ausgewählt
21
25
  else {
22
- div.className = aspectRatioClass + ' datawrapper_cdn'
26
+ //ar-- in Tailwind-Klassen
27
+ let tailwindCSS
28
+ switch(aspectRatio){
29
+ case '100':
30
+ tailwindCSS = "ar-1-1"
31
+ break;
32
+ case '16x9':
33
+ tailwindCSS = "ar-16-9"
34
+ break;
35
+ case '9x16':
36
+ tailwindCSS = "ar-9-16"
37
+ break;
38
+ case '16x7':
39
+ tailwindCSS = "ar-16-7"
40
+ break;
41
+ case '7x16':
42
+ tailwindCSS = "ar-7-16"
43
+ break;
44
+ case '4x3':
45
+ tailwindCSS = "ar-4-3"
46
+ break;
47
+ case '100x27':
48
+ tailwindCSS = "ar-100-27"
49
+ break;
50
+ default:
51
+ tailwindCSS = "ar-16-9"
52
+ }
53
+
54
+ div.className = tailwindCSS + " w-full sm480:h-full h-[560px]"
23
55
  }
24
56
  var iframe = document.createElement('iframe')
25
- iframe.className = 'w-full h-full datawrapper_cdn'
57
+
58
+ //Auflösen nach Tailwind-Klassen //ar_iframe datawrapper_cdn
59
+ iframe.setAttribute('class', 'border-0 top-0 left-0 w-full h-full overflow-y-hidden')
26
60
  iframe.setAttribute('id', 'i_frame')
27
61
  iframe.setAttribute('data-isloaded', '0')
28
62
  iframe.setAttribute('webkitallowfullscreen', '')
@@ -23,19 +23,24 @@ const ExternalService = function (context) {
23
23
  embedType = options.embedType,
24
24
  dataPolicyCheck = options.dataPolicyCheck || false,
25
25
  id = options.id,
26
- iFrameConfig = options.iFrameConfig,
27
- isWebview = window.parent.document.documentElement.classList.contains('webview'),
28
- button = hr$('.js-dataPolicyTeaser__button', rootElement)[0]
29
-
26
+ iFrameConfig = options.iFrameConfig
30
27
  let acceptButton,
31
28
  acceptAlwaysCheckbox = hr$('.js-dataPolicy-acceptPermanentely', rootElement)[0],
32
- dataPolicySettingsButton = hr$('.js-data-policy-settings-button', rootParent)[0],
33
- embedCode = options.embedCode,
29
+ dataPolicySettingsButton = hr$('.js-data-policy-settings-button', rootParent)[0]
30
+ let embedCode = options.embedCode,
34
31
  iframe,
35
32
  settingsCookie,
36
- isExternalServiceLoaded = false
37
-
33
+ noResponsiveIframe,
34
+ contentRefresher,
35
+ uniqueId,
36
+ isExternalServiceLoaded = false,
37
+ isWebview = window.parent.document.documentElement.classList.contains('webview')
38
38
 
39
+ const testDOMElements = function () {
40
+ console.log(rootElement)
41
+ console.log(rootParent)
42
+ console.log(acceptAlwaysCheckbox)
43
+ }
39
44
  const embedExternalService = function (callback) {
40
45
  $.ajax({
41
46
  type: 'GET',
@@ -101,7 +106,7 @@ const ExternalService = function (context) {
101
106
  }
102
107
  break
103
108
  default:
104
- loadIframe()
109
+ loadIframe() //für alle Dienste die nicht der DSGVO Datapolicy unterliegen
105
110
  }
106
111
  }
107
112
 
@@ -123,34 +128,49 @@ const ExternalService = function (context) {
123
128
  script.type = 'text/javascript'
124
129
  rootElement.appendChild(script)
125
130
  }
131
+ const createUniqueID = function() {
132
+ uniqueId = Math.random().toString(36).replace(/[^a-z]+/g, '').substring(2, 10)
133
+ }
134
+
135
+ const getAspectRatioClass = function () {
136
+ switch (iFrameConfig.aspectRatio) {
137
+ case '16x9':
138
+ return "ar-16-9"
139
+ case '16x7':
140
+ return "ar-16-7"
141
+ case '4x3':
142
+ return "ar-4-3"
143
+ case '100x27':
144
+ return "ar-100-27"
145
+ case '100':
146
+ return "ar-1-1"
147
+ case '9x16':
148
+ return "ar-9-16"
149
+ case '7x16':
150
+ return "ar-7-16"
151
+ default:
152
+ return "ar-16-9"
153
+ }
154
+ }
126
155
 
127
156
  const createDataWrapperEmbed = function () {
128
157
  removeDatapolicyBox()
129
- var uniqueID = function () {
130
- return Math.random()
131
- .toString(36)
132
- .replace(/[^a-z]+/g, '')
133
- .substring(2, 10)
134
- }
135
- let contentRefresher = new DataWrapperContentRefresher(context, uniqueID)
136
- let noResponsiveIframe = new DataWrapperNoResponsiveIframe(context, iFrameConfig.aspectRatio, iFrameConfig.fixedHeight, embedCode)
137
-
158
+ createUniqueID()
138
159
  if (iFrameConfig.noResponsiveIframe == 'true') {
139
- noResponsiveIframe.createNoResponsiveIframe(getAspectRatioClass())
160
+ noResponsiveIframe = new DataWrapperNoResponsiveIframe(context, iFrameConfig.aspectRatio, iFrameConfig.fixedHeight, embedCode)
161
+ noResponsiveIframe.createNoResponsiveIframe()
140
162
  }
141
163
  else {
142
164
  var iframe = document.createElement('iframe')
143
- iframe.className = 'dataWrapper-embed'
144
- iframe.style.width = '0'
145
- iframe.style.minWidth = '100% !important'
146
- iframe.style.border = 'none'
165
+ //Auflösen nach Tailwind-Klassen //dataWrapper-embed
166
+ iframe.className = 'w-0 !min-w-full border-0'
147
167
  iframe.setAttribute('webkitallowfullscreen', '')
148
168
  iframe.setAttribute('mozallowfullscreen', '')
149
169
  iframe.setAttribute('allowfullscreen', '')
150
170
  iframe.setAttribute('scrolling', 'no')
151
171
  iframe.setAttribute('frameborder', '0')
152
172
  iframe.src = embedCode
153
- iframe.id = 'datawrapper-chart-' + uniqueID
173
+ iframe.id = 'datawrapper-chart-' + uniqueId
154
174
  rootElement.insertBefore(iframe, null)
155
175
 
156
176
  loadScript(
@@ -159,6 +179,8 @@ const ExternalService = function (context) {
159
179
  true
160
180
  )
161
181
  if (iFrameConfig.refreshContent == 'true') {
182
+ console.log("contentRefresher anfügen")
183
+ contentRefresher = new DataWrapperContentRefresher(context, uniqueId, iFrameConfig.refreshIntervall)
162
184
  contentRefresher.createRefresher()
163
185
  }
164
186
  }
@@ -251,64 +273,39 @@ const ExternalService = function (context) {
251
273
  }, 250)
252
274
  }
253
275
 
254
- const getAspectRatioClass = function () {
255
- switch (iFrameConfig.aspectRatio) {
256
- case '16x9':
257
- return "ar-16-9"
258
- case '16x7':
259
- return "ar-16-7"
260
- case '4x3':
261
- return "ar-4-3"
262
- case '100x27':
263
- return "ar-100-27"
264
- case '100':
265
- return "ar-1-1"
266
- case '9x16':
267
- return "ar-9-16"
268
- case '7x16':
269
- return "ar-7-16"
270
- default:
271
- return "ar-16-9"
272
- }
273
- }
274
-
275
276
  const loadIframe = function () {
276
277
  console.log('load iframe ' + id)
277
278
  iframe =
278
279
  "<iframe id='i_frame' data-isloaded='0' src='" +
279
280
  embedCode +
280
- "' frameborder='0' class='" +
281
- iFrameConfig.heightClass +
282
- "' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"
281
+ "' frameborder='0' class='w-full h-full' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"
283
282
  if (iFrameConfig.aspectRatio) {
284
283
  iframe =
285
- "<div class='copytext__scrollWrapper'><div class='" +
284
+ "<div class='!h-full'><div class=" +
286
285
  getAspectRatioClass() +
287
286
  ' ' +
288
287
  id +
289
288
  "'><iframe id='i_frame' data-isloaded='0' src='" +
290
289
  embedCode +
291
- "' frameborder='0' class='w-full h-full " +
292
- iFrameConfig.heightClass +
293
- ' ' +
290
+ "' frameborder='0' class='w-full h-full '" +
294
291
  id +
295
292
  "' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></div>"
296
293
  //TODO Weiche Animation der Inhalte
297
294
  } else {
298
295
  if (iFrameConfig.fixedHeight) {
299
296
  iframe =
300
- "<div class='copytext__scrollWrapper -fixedHeight' style='height:" +
297
+ "<div class='!h-full' style='height:" +
301
298
  iFrameConfig.fixedHeight +
302
- "px'><iframe data-isloaded='0' class='w-full h-full' src='" +
299
+ "px'><iframe data-isloaded='0' src='" +
303
300
  embedCode +
304
- "' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>"
301
+ "' frameborder='0' class='w-full h-full' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>"
305
302
  } else {
306
303
  iframe =
307
- "<div class='copytext__scrollWrapper " +
304
+ "<div class='!h-full " +
308
305
  id +
309
- "'><iframe data-isloaded='0' class='w-full h-full' src='" +
306
+ "'><iframe data-isloaded='0' src='" +
310
307
  embedCode +
311
- "' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>"
308
+ "' frameborder='0' class='w-full h-full' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>"
312
309
  }
313
310
  }
314
311
 
@@ -414,6 +411,7 @@ const ExternalService = function (context) {
414
411
  }
415
412
  initDataPolicy()
416
413
  resetCheckboxForPermanentService()
414
+ testDOMElements()
417
415
  if (isWebview) {
418
416
  /*Für die App werden Cookie-Daten des neuen Cookies wieder mit dem alten Cookie synchronisiert */
419
417
  syncAppOptionsToSettingsCookie()
@@ -24,4 +24,23 @@ Die interaktiven Elemente sind:
24
24
  <li> einen Aktions-Button, der den Inhalt einmalig, bis zum nächsten Refresh oder erneuten Besuch der Seite anzeigt.</li>
25
25
  </ul>
26
26
 
27
- <Story of={ExternalServiceStories.ExterneDienste} />
27
+
28
+ ## Beispiel Dienst Giphy
29
+ <Story of={ExternalServiceStories.ExterneDiensteGiphy} />
30
+
31
+ ## Beispiel Dienst Datawrapper mit responsivem Iframe
32
+ Der Datawrapper wird standardmässig mit einem responsiven Iframe geladen, d.h. das der Inhalt des Iframes - die Datengrafik - an den äußeren Container skaliert wird.
33
+
34
+ <Story of={ExternalServiceStories.ExterneDiensteDatawrapper} />
35
+
36
+ ## Beispiel Dienst Datawrapper ohne responsives Iframe und fester Höhe
37
+ Ist die Konfiguration "NoResponsiveIFrame" auf TRUE gesetzt werden die Felder für "FixedHeight" und "AspectRatio" ausgelesen. Ist das Feld FixedHeight befüllt, wird der Wert daraus übernommen
38
+ <Story of={ExternalServiceStories.ExterneDiensteDatawrapperNoResponsiveFixedHeight} />
39
+
40
+ ## Beispiel Dienst Datawrapper ohne responsives Iframe und AspectRatio
41
+ Ist die Konfiguration "NoResponsiveIFrame" auf TRUE gesetzt werden die Felder für "FixedHeight" und "AspectRatio" ausgelesen. Ist das Feld AspectRatio ausgewählt wird der Wert daraus übernommen
42
+ <Story of={ExternalServiceStories.ExterneDiensteDatawrapperNoResponsiveAspectRatio} />
43
+
44
+
45
+ ## Beispiel Dienst Datawrapper mit ContentRefresher
46
+ <Story of={ExternalServiceStories.ExterneDiensteDatawrapperContentRefresher} />
@@ -23,8 +23,29 @@ export default {
23
23
  },
24
24
  }
25
25
 
26
- export const ExterneDienste = {
26
+ export const ExterneDiensteGiphy = {
27
27
  render: TemplatePageExternalService.bind({}),
28
- name: 'Externe Dienste',
29
- args: ExternalServiceContent,
30
- }
28
+ name: 'Externe Dienste Giphy',
29
+ args: ExternalServiceContent.Giphy,
30
+ }
31
+ export const ExterneDiensteDatawrapper = {
32
+ render: TemplatePageExternalService.bind({}),
33
+ name: 'Externe Dienste Datawrapper MIT Responsivem Iframe',
34
+ args: ExternalServiceContent.Datawrapper_CDN,
35
+ }
36
+ export const ExterneDiensteDatawrapperNoResponsiveFixedHeight = {
37
+ render: TemplatePageExternalService.bind({}),
38
+ name: 'Externe Dienste Datawrapper OHNE Responsivem Iframe (Feste Höhe)',
39
+ args: ExternalServiceContent.Datawrapper_CDN_NoResponsiveFixedHeight,
40
+ }
41
+ export const ExterneDiensteDatawrapperNoResponsiveAspectRatio = {
42
+ render: TemplatePageExternalService.bind({}),
43
+ name: 'Externe Dienste Datawrapper OHNE Responsivem Iframe (Aspect Ratio)',
44
+ args: ExternalServiceContent.Datawrapper_CDN_NoResponsiveAspectRatio,
45
+ }
46
+ export const ExterneDiensteDatawrapperContentRefresher = {
47
+ render: TemplatePageExternalService.bind({}),
48
+ name: 'Externe Dienste Datawrapper mit ContentRefresher',
49
+ args: ExternalServiceContent.Datawrapper_CDN_NoResponsiveFixedHeightReload,
50
+ }
51
+