hr-design-system-handlebars 1.67.6 → 1.67.8

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.
@@ -172,19 +172,11 @@ const ExternalService = function (context) {
172
172
  const createDataWrapperEmbed = function () {
173
173
  removeDatapolicyBox()
174
174
  createUniqueID()
175
- if (iFrameConfig.noResponsiveIframe == 'true') {
176
- noResponsiveIframe = new DataWrapperNoResponsiveIframe(context, iFrameConfig.aspectRatio, iFrameConfig.fixedHeight, uniqueId, embedCode)
177
- noResponsiveIframe.createNoResponsiveIframe()
178
-
179
- if (iFrameConfig.refreshContent == 'true') {
180
- console.log("contentRefresher anfügen")
181
- contentRefresher = new DataWrapperContentRefresher(context, uniqueId, iFrameConfig.refreshIntervall)
182
- contentRefresher.createRefresher()
183
- }
184
- }
185
- else {
175
+ if (iFrameConfig.responsiveIframe == 'true') {
176
+
177
+ //Responsives Iframe
186
178
  var iframe = document.createElement('iframe')
187
- //Auflösen nach Tailwind-Klassen //dataWrapper-embed
179
+ //Auflösen nach Tailwind-Klassen //dataWrapper-embed
188
180
  iframe.className = 'w-0 !min-w-full border-0'
189
181
  iframe.setAttribute('webkitallowfullscreen', '')
190
182
  iframe.setAttribute('mozallowfullscreen', '')
@@ -199,13 +191,53 @@ const ExternalService = function (context) {
199
191
  'datawrapper-js',
200
192
  'https://static.hr.de/hessenschau/datawrapper/responsiveIframe.js',
201
193
  true
202
- )
203
-
194
+ )
204
195
  if (iFrameConfig.refreshContent == 'true') {
205
196
  console.log("contentRefresher anfügen")
206
- contentRefresher = new DataWrapperContentRefresher(context, uniqueId, iFrameConfig.refreshIntervall)
197
+ contentRefresher = new DataWrapperContentRefresher(context, uniqueId, iFrameConfig.refreshIntervall, false)
207
198
  contentRefresher.createRefresher()
208
199
  }
200
+ }
201
+ else {
202
+ if(iFrameConfig.webcomponent == 'true') {
203
+
204
+ // Webcomponent
205
+ const divTag = document.createElement('div')
206
+ divTag.id = 'datawrapper-chart-' + uniqueID
207
+ rootElement.insertBefore(divTag, null)
208
+ const scriptTag = document.createElement('script')
209
+ scriptTag.setAttribute('id', 'datawrapper-component-js')
210
+ scriptTag.setAttribute('type', 'text/javascript')
211
+ scriptTag.setAttribute('defer', 'defer')
212
+ scriptTag.setAttribute('src', embedCode + 'embed.js?v=1')
213
+ scriptTag.setAttribute('charset', 'utf-8')
214
+ const noScriptTag = document.createElement('noscript')
215
+ const imageTag = document.createElement('img')
216
+ imageTag.src = embedCode + 'full.png'
217
+ imageTag.alt = ''
218
+ noScriptTag.appendChild(imageTag)
219
+ divTag.appendChild(scriptTag)
220
+ divTag.appendChild(noScriptTag)
221
+
222
+ if (iFrameConfig.refreshContent == 'true') {
223
+ console.log("contentRefresher anfügen")
224
+ contentRefresher = new DataWrapperContentRefresher(context, uniqueId, iFrameConfig.refreshIntervall, true)
225
+ contentRefresher.createRefresher()
226
+ }
227
+ }
228
+ else {
229
+ //Klassisches Iframe mit AR-Wrapper oder fester Höhe
230
+ noResponsiveIframe = new DataWrapperNoResponsiveIframe(context, iFrameConfig.aspectRatio, iFrameConfig.fixedHeight, uniqueId, embedCode)
231
+ noResponsiveIframe.createNoResponsiveIframe()
232
+
233
+ if (iFrameConfig.refreshContent == 'true') {
234
+ console.log("contentRefresher anfügen")
235
+ contentRefresher = new DataWrapperContentRefresher(context, uniqueId, iFrameConfig.refreshIntervall, false)
236
+ contentRefresher.createRefresher()
237
+ }
238
+ }
239
+
240
+
209
241
  }
210
242
  }
211
243
 
@@ -1,8 +1,9 @@
1
1
  <div class="grid clear-both{{#unless _isTeaser}} mt-10{{/unless}}">
2
2
  {{~> components/base/a11y/hiddenText _locaTag="story_externalservice_intro_sr" ~}}
3
- <div class="c-externalService c-externalService__{{this.externalServiceConfig.externalServiceId}} js-load"
3
+ <div class="c-externalService c-externalService__{{this.externalServiceConfig.externalServiceId}}{{#unless
4
+ this.fixedHeight }} -noFixedHeight{{/unless}} js-load"
4
5
  data-hr-external-service-ds='{"id":"{{this.externalServiceConfig.externalServiceId}}","embedCode":"{{this.serviceUrl}}","embedType":"{{this.externalServiceConfig.externalServiceEmbedType}}","dataPolicyCheck": true,"iFrameConfig": { {{#if this.fixedHeight}}
5
- "fixedHeight":"{{this.fixedHeight}}"{{else}}{{#if this.aspectRatio}}"aspectRatio":"{{this.aspectRatio}}"{{else}}"aspectRatio":"16x9"{{/if}}{{/if}},"noResponsiveIframe":"{{{this.setResponsiveIframe}}}"{{#if this.setTimedReloadIframe}},"refreshContent":"{{{this.setTimedReloadIframe}}}","refreshIntervall":"{{this.setTimeForReload}}"{{/if}} }}'>
6
+ "fixedHeight":"{{this.fixedHeight}}"{{else}}{{#if this.aspectRatio}}"aspectRatio":"{{this.aspectRatio}}"{{else}}"aspectRatio":"16x9"{{/if}}{{/if}},"responsiveIframe":"{{{this.setResponsiveIframe}}}","webcomponent":"{{{this.setWebcomponent}}}"{{#if this.setTimedReloadIframe}},"refreshContent":"{{{this.setTimedReloadIframe}}}","refreshIntervall":"{{this.setTimeForReload}}"{{/if}} }}'>
6
7
  {{~> components/externalService/components/external_service_data_policy ~}}
7
8
  </div>
8
9
  {{~> components/externalService/components/external_service_caption ~}}