hr-design-system-handlebars 0.47.15 → 0.47.18

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/build/helpers/resourceUrl.js +14 -1
  3. package/dist/assets/index.css +43 -12
  4. package/dist/views/base/tracking/atiHelperNew.js +37 -0
  5. package/dist/views/base/tracking/atiMediaHelperNew.js +193 -0
  6. package/dist/views/components/audio/audioElement.subfeature.js +118 -0
  7. package/dist/views/components/button/button.hbs +16 -0
  8. package/dist/views/components/button/button_round.hbs +16 -0
  9. package/dist/views/components/externalService/trackingCookie.subfeature.js +37 -0
  10. package/dist/views/components/mediaplayer/mediaplayerLoader.feature.js +81 -0
  11. package/dist/views/components/teaser/components/teaser_av_consumption.hbs +8 -0
  12. package/dist/views/components/teaser/components/teaser_image.hbs +3 -0
  13. package/dist/views/components/teaser/components/teaser_lead.hbs +5 -0
  14. package/dist/views/components/teaser/teaser_alternativ.hbs +1 -3
  15. package/dist/views/components/teaser/teaser_standard.hbs +2 -4
  16. package/dist/views/components/video/livestream/videoLivestream.subfeature.js +254 -0
  17. package/dist/views/components/video/videoOnDemandPlayer.subfeature.js +356 -0
  18. package/dist/views/components/video/video_element.hbs +77 -0
  19. package/package.json +1 -1
  20. package/src/assets/fixtures/teaser/teaser_lead.inc.json +53 -0
  21. package/src/assets/fixtures/teaser/teaser_standard_50_serif_av_consumption.json +21 -0
  22. package/src/assets/tailwind.css +7 -0
  23. package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.4.055f7511.css +3 -0
  24. package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.4.d39f03b6.js +6 -0
  25. package/src/assets/vendor/ardplayer/ardplayer-libimsc.9e067311.chunk.js +13 -0
  26. package/src/assets/vendor/ardplayer/ardplayer-pluginchromecast.8ad4db4d.chunk.js +1 -0
  27. package/src/assets/vendor/ardplayer/ardplayer-pluginhtmla.77bf082c.chunk.js +1 -0
  28. package/src/assets/vendor/ardplayer/ardplayer-pluginhtmlv.8be44713.chunk.js +1 -0
  29. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginchromecast~plugindash~pluginhls~pluginhtmla~pluginhtmlv.9fbaccf5.chunk.js +1 -0
  30. package/src/assets/vendor/ardplayer/ardplayer-vendors~plugindash.32239ff8.chunk.js +1066 -0
  31. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhls.f21f56cc.chunk.js +365 -0
  32. package/src/assets/vendor/js/ardplayer-hr-6.3.4.d39f03b6.js +6 -0
  33. package/src/assets/vendor/js/smarttagProd.js +101 -0
  34. package/src/stories/views/base/tracking/atiHelperNew.js +37 -0
  35. package/src/stories/views/base/tracking/atiMediaHelperNew.js +193 -0
  36. package/src/stories/views/components/audio/audioElement.subfeature.js +118 -0
  37. package/src/stories/views/components/button/button.hbs +16 -0
  38. package/src/stories/views/components/button/button_round.hbs +16 -0
  39. package/src/stories/views/components/externalService/trackingCookie.subfeature.js +37 -0
  40. package/src/stories/views/components/mediaplayer/mediaplayerLoader.feature.js +81 -0
  41. package/src/stories/views/components/teaser/components/teaser_av_consumption.hbs +8 -0
  42. package/src/stories/views/components/teaser/components/teaser_byline.stories.mdx +52 -1
  43. package/src/stories/views/components/teaser/components/teaser_image.hbs +3 -0
  44. package/src/stories/views/components/teaser/components/teaser_lead.hbs +5 -0
  45. package/src/stories/views/components/teaser/components/teaser_title.stories.mdx +34 -2
  46. package/src/stories/views/components/teaser/components/teaser_topline.stories.mdx +26 -4
  47. package/src/stories/views/components/teaser/fixtures/teaser_standard_100_serif_av_consumption.json +1 -0
  48. package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_av_consumption.json +1 -0
  49. package/src/stories/views/components/teaser/teaser_alternativ.hbs +1 -3
  50. package/src/stories/views/components/teaser/teaser_alternativ.stories.mdx +43 -3
  51. package/src/stories/views/components/teaser/teaser_poster.stories.mdx +15 -13
  52. package/src/stories/views/components/teaser/teaser_standard.hbs +2 -4
  53. package/src/stories/views/components/teaser/teaser_standard_av.stories.mdx +50 -0
  54. package/src/stories/views/components/video/livestream/videoLivestream.subfeature.js +254 -0
  55. package/src/stories/views/components/video/videoOnDemandPlayer.subfeature.js +356 -0
  56. package/src/stories/views/components/video/video_element.hbs +77 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ # v0.47.18 (Tue Jun 28 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - DPE-1572 kick off [#246](https://github.com/mumprod/hr-design-system-handlebars/pull/246) ([@vascoeduardo](https://github.com/vascoeduardo))
6
+
7
+ #### Authors: 1
8
+
9
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
10
+
11
+ ---
12
+
13
+ # v0.47.17 (Mon Jun 27 2022)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Alternativ-Teaser Documentation [#252](https://github.com/mumprod/hr-design-system-handlebars/pull/252) (zouhair1 [@selbaciri](https://github.com/selbaciri))
18
+
19
+ #### Authors: 2
20
+
21
+ - Saad El Baciri ([@selbaciri](https://github.com/selbaciri))
22
+ - selbaciri (zouhair1)
23
+
24
+ ---
25
+
26
+ # v0.47.16 (Mon Jun 27 2022)
27
+
28
+ #### 🐛 Bug Fix
29
+
30
+ - add documentation [#251](https://github.com/mumprod/hr-design-system-handlebars/pull/251) ([@hanswurstsalat](https://github.com/hanswurstsalat))
31
+
32
+ #### Authors: 1
33
+
34
+ - Geraldo ([@hanswurstsalat](https://github.com/hanswurstsalat))
35
+
36
+ ---
37
+
1
38
  # v0.47.15 (Thu Jun 23 2022)
2
39
 
3
40
  #### 🐛 Bug Fix
@@ -1,6 +1,19 @@
1
1
  module.exports = function (text, options) {
2
2
  var resourceUrl
3
-
3
+ // ARD PLAYER Folder
4
+ if (text.includes('assets/vendor/ardplayer/')){
5
+ resourceUrl = text.replace(
6
+ 'assets/',
7
+ './'
8
+ )
9
+ }
10
+ // VENDOR Folder
11
+ if (text.includes('assets/js/vendor/')){
12
+ resourceUrl = text.replace(
13
+ 'assets/js/vendor',
14
+ './vendor/js'
15
+ )
16
+ }
4
17
  if (text.includes('assets/base/')) {
5
18
  if (text.includes('assets/base/icons/logo/') && options.hash['_brand']) {
6
19
  resourceUrl = text.replace(
@@ -1493,6 +1493,9 @@ Ensure the default browser behavior of the `hidden` attribute.
1493
1493
  .left-0 {
1494
1494
  left: 0px;
1495
1495
  }
1496
+ .bottom-0 {
1497
+ bottom: 0px;
1498
+ }
1496
1499
  .right-0 {
1497
1500
  right: 0px;
1498
1501
  }
@@ -1552,6 +1555,10 @@ Ensure the default browser behavior of the `hidden` attribute.
1552
1555
  margin-left: 2rem;
1553
1556
  margin-right: 2rem;
1554
1557
  }
1558
+ .my-4 {
1559
+ margin-top: 1rem;
1560
+ margin-bottom: 1rem;
1561
+ }
1555
1562
  .mx-px {
1556
1563
  margin-left: 1px;
1557
1564
  margin-right: 1px;
@@ -1665,6 +1672,9 @@ Ensure the default browser behavior of the `hidden` attribute.
1665
1672
  .h-5 {
1666
1673
  height: 1.25rem;
1667
1674
  }
1675
+ .h-6 {
1676
+ height: 1.5rem;
1677
+ }
1668
1678
  .h-3\.5 {
1669
1679
  height: 0.875rem;
1670
1680
  }
@@ -1680,9 +1690,6 @@ Ensure the default browser behavior of the `hidden` attribute.
1680
1690
  .h-8 {
1681
1691
  height: 2rem;
1682
1692
  }
1683
- .h-6 {
1684
- height: 1.5rem;
1685
- }
1686
1693
  .h-2 {
1687
1694
  height: 0.5rem;
1688
1695
  }
@@ -1947,6 +1954,9 @@ Ensure the default browser behavior of the `hidden` attribute.
1947
1954
  .rounded {
1948
1955
  border-radius: 0.25rem;
1949
1956
  }
1957
+ .rounded-full {
1958
+ border-radius: 9999px;
1959
+ }
1950
1960
  .rounded-t-xl {
1951
1961
  border-top-left-radius: 0.75rem;
1952
1962
  border-top-right-radius: 0.75rem;
@@ -1976,6 +1986,9 @@ Ensure the default browser behavior of the `hidden` attribute.
1976
1986
  .border {
1977
1987
  border-width: 1px;
1978
1988
  }
1989
+ .border-4 {
1990
+ border-width: 4px;
1991
+ }
1979
1992
  .border-0 {
1980
1993
  border-width: 0px;
1981
1994
  }
@@ -2018,6 +2031,10 @@ Ensure the default browser behavior of the `hidden` attribute.
2018
2031
  --tw-bg-opacity: 1;
2019
2032
  background-color: rgba(187, 247, 208, var(--tw-bg-opacity));
2020
2033
  }
2034
+ .bg-blue-500 {
2035
+ --tw-bg-opacity: 1;
2036
+ background-color: rgba(59, 130, 246, var(--tw-bg-opacity));
2037
+ }
2021
2038
  .bg-gray-100 {
2022
2039
  --tw-bg-opacity: 1;
2023
2040
  background-color: rgba(243, 244, 246, var(--tw-bg-opacity));
@@ -2127,9 +2144,20 @@ Ensure the default browser behavior of the `hidden` attribute.
2127
2144
  .\!p-4 {
2128
2145
  padding: 1rem !important;
2129
2146
  }
2147
+ .p-1 {
2148
+ padding: 0.25rem;
2149
+ }
2130
2150
  .p-2 {
2131
2151
  padding: 0.5rem;
2132
2152
  }
2153
+ .py-2 {
2154
+ padding-top: 0.5rem;
2155
+ padding-bottom: 0.5rem;
2156
+ }
2157
+ .px-4 {
2158
+ padding-left: 1rem;
2159
+ padding-right: 1rem;
2160
+ }
2133
2161
  .py-6 {
2134
2162
  padding-top: 1.5rem;
2135
2163
  padding-bottom: 1.5rem;
@@ -2174,10 +2202,6 @@ Ensure the default browser behavior of the `hidden` attribute.
2174
2202
  padding-left: 0.75rem;
2175
2203
  padding-right: 0.75rem;
2176
2204
  }
2177
- .py-2 {
2178
- padding-top: 0.5rem;
2179
- padding-bottom: 0.5rem;
2180
- }
2181
2205
  .py-1\.5 {
2182
2206
  padding-top: 0.375rem;
2183
2207
  padding-bottom: 0.375rem;
@@ -2190,10 +2214,6 @@ Ensure the default browser behavior of the `hidden` attribute.
2190
2214
  padding-left: 0px;
2191
2215
  padding-right: 0px;
2192
2216
  }
2193
- .px-4 {
2194
- padding-left: 1rem;
2195
- padding-right: 1rem;
2196
- }
2197
2217
  .pt-px {
2198
2218
  padding-top: 1px;
2199
2219
  }
@@ -2551,6 +2571,13 @@ Ensure the default browser behavior of the `hidden` attribute.
2551
2571
  transition: transform 150ms ease-in-out 0s;
2552
2572
  transition: transform 150ms ease-in-out 0s, -webkit-transform 150ms ease-in-out 0s;
2553
2573
  }
2574
+ .c-videoplayer .ardplayer {
2575
+ position: absolute;
2576
+ top: 0;
2577
+ left: 0;
2578
+ right: 0;
2579
+ bottom: 0;
2580
+ }
2554
2581
  .first\:border-t:first-child {
2555
2582
  border-top-width: 1px;
2556
2583
  }
@@ -2572,6 +2599,10 @@ Ensure the default browser behavior of the `hidden` attribute.
2572
2599
  .last-of-type\:hidden:last-of-type {
2573
2600
  display: none;
2574
2601
  }
2602
+ .hover\:bg-blue-700:hover {
2603
+ --tw-bg-opacity: 1;
2604
+ background-color: rgba(29, 78, 216, var(--tw-bg-opacity));
2605
+ }
2575
2606
  .hover\:bg-blue-congress:hover {
2576
2607
  --tw-bg-opacity: 1;
2577
2608
  background-color: rgba(0, 82, 147, var(--tw-bg-opacity));
@@ -3238,4 +3269,4 @@ Ensure the default browser behavior of the `hidden` attribute.
3238
3269
  .tablet\:first\:border-l:first-child {
3239
3270
  border-left-width: 1px;
3240
3271
  }
3241
- }
3272
+ }
@@ -0,0 +1,37 @@
1
+
2
+ import TrackingCookie from '../../components/externalService/trackingCookie.subfeature'
3
+
4
+ const isTrackingAllowed = () => {
5
+ const trackingCookie = new TrackingCookie()
6
+ return trackingCookie.isTrackingAccepted('ati')
7
+ }
8
+
9
+ const uxAction = (label, secondLevelId) => {
10
+ secondLevelId = secondLevelId || window.xtn2
11
+ if (window.xt_click && isTrackingAllowed()) {
12
+ window.xt_click('this', 'C', secondLevelId, label, 'A')
13
+ }
14
+ }
15
+
16
+ const uxNavigation = (label, secondLevelId) => {
17
+ secondLevelId = secondLevelId || window.xtn2
18
+ if (window.xt_click && isTrackingAllowed()) {
19
+ window.xt_click('this', 'C', secondLevelId, label, 'N')
20
+ }
21
+ }
22
+
23
+ const pi = (label, secondLevelId) => {
24
+ secondLevelId = secondLevelId || window.xtn2
25
+ if (window.xt_click && isTrackingAllowed()) {
26
+ window.xt_click('this', 'F', secondLevelId, label)
27
+ }
28
+ }
29
+
30
+ const download = (label, secondLevelId) => {
31
+ secondLevelId = secondLevelId || window.xtn2
32
+ if (window.xt_click && isTrackingAllowed()) {
33
+ window.xt_click('this', 'C', secondLevelId, label, 'T')
34
+ }
35
+ }
36
+
37
+ export { isTrackingAllowed, uxAction, uxNavigation, pi, download }
@@ -0,0 +1,193 @@
1
+ import { isTrackingAllowed, pi } from '../tracking/atiHelperNew'
2
+
3
+ const ATIMediaHelper = function (
4
+ avType,
5
+ pageName,
6
+ secondLevelId,
7
+ length,
8
+ multcid,
9
+ multctype,
10
+ multcdate,
11
+ chapter
12
+ ) {
13
+ 'use strict'
14
+ ;(this.avType = avType),
15
+ (this.secondLevelId = secondLevelId),
16
+ (this.multcid = multcid),
17
+ (this.multctype = multctype),
18
+ (this.multcdate = multcdate),
19
+ (this.chapter = chapter),
20
+ (this.pageName = pageName),
21
+ (this.length = length),
22
+ (this.wasNeverPlayed = true)
23
+
24
+ /*console.log(this.avType)
25
+ console.log(this.secondLevelId)
26
+ console.log(this.pageName)
27
+ console.log(this.length)*/
28
+ }
29
+
30
+ ATIMediaHelper.prototype = {
31
+ xtRichMediaVideoHelper: function (data) {
32
+ if (window.xt_rm && isTrackingAllowed()) {
33
+ console.log('XT_RM')
34
+ console.log('A ID: ' + data.avType + '&plyr=' + data.pageName)
35
+ console.log('B SECONDLEVELID: ' + data.secondLevelId)
36
+ console.log('C PAGENAME: ' + data.pageName + ':' + data.avType + 'Play')
37
+ console.log('D ACTION: ' + data.action)
38
+ console.log('F REFRESH: ' + data.refresh)
39
+ console.log('G DURATION: ' + data.length)
40
+ console.log('H POSTIONBUF: ' + '0')
41
+ console.log('H POSITION: ' + 'rmp=' + data.position)
42
+ console.log('H POSITIONNEW: ' + data.positionNew)
43
+ console.log('J DATARATE: ' + data.datarate)
44
+ console.log('K LOCATION: ' + data.location)
45
+ console.log('L TYPE: ' + data.type)
46
+ console.log('M SIZE: ' + data.size)
47
+ console.log('N FORMAT: ' + data.format)
48
+ xt_rm(
49
+ data.avType + '&plyr=' + data.pageName,
50
+ data.secondLevelId,
51
+ data.pageName + ':' + data.avType + 'Play',
52
+ data.action,
53
+ '',
54
+ data.refresh,
55
+ data.length,
56
+ '&rmp=' + data.position + '&rmpf=' + data.positionNew + '&rmbufp=0',
57
+ '',
58
+ data.datarate,
59
+ data.location,
60
+ data.type,
61
+ data.size,
62
+ data.format
63
+ )
64
+ }
65
+ },
66
+
67
+ xtClickVideoHelper: function (data) {
68
+ if (window.xt_click) {
69
+ console.log('XT_CLICK ')
70
+ var uniqueId = Math.abs(this.hashCode(data.pageName))
71
+ uniqueId = uniqueId.length > 15 ? uniqueId.substring(0, 15) : uniqueId
72
+ pi(
73
+ data.pageName +
74
+ ':' +
75
+ data.avType +
76
+ 'Play' +
77
+ '&pid=' +
78
+ uniqueId +
79
+ '&pchap=' +
80
+ data.chapter +
81
+ '&pidt=' +
82
+ data.x5 +
83
+ '&x1=' +
84
+ data.x1 +
85
+ '&x2=' +
86
+ data.x2 +
87
+ '&x5=' +
88
+ data.x5.substring(0, 8),
89
+ data.secondLevelId
90
+ )
91
+ }
92
+ },
93
+
94
+ hashCode: function (string) {
95
+ var hash = 0,
96
+ i,
97
+ chr
98
+ if (string.length === 0) return hash
99
+ for (i = 0; i < string.length; i++) {
100
+ chr = string.charCodeAt(i)
101
+ hash = (hash << 5) - hash + chr
102
+ hash |= 0 // Convert to 32bit integer
103
+ }
104
+ return hash
105
+ },
106
+
107
+ trackInitialMediaPlay: function () {
108
+ const data = {}
109
+
110
+ if (this.wasNeverPlayed) {
111
+ if (this.avType === 'livestreamVideo' || this.avType === 'livestreamAudio') {
112
+ data.object = 'this'
113
+ data.click = 'F'
114
+ if (this.avType === 'livestreamVideo') {
115
+ data.pageName = this.pageName + ':video'
116
+ data.avType = 'video'
117
+ } else {
118
+ data.pageName = this.pageName + ':audio'
119
+ data.avType = 'audio'
120
+ }
121
+ data.secondLevelId = this.secondLevelId
122
+ data.x1 = this.multcid
123
+ data.x2 = this.multctype
124
+ data.x5 = this.multcdate
125
+ data.chapter = this.chapter
126
+ data.action = 'play'
127
+ data.refresh = '10'
128
+ data.length = ''
129
+ data.position = '0'
130
+ data.positionNew = '0'
131
+ data.datarate = ''
132
+ data.location = 'int'
133
+ data.type = 'live'
134
+ data.size = ''
135
+ data.format = ''
136
+ } else {
137
+ data.object = 'this'
138
+ data.click = 'F'
139
+ data.avType = this.avType
140
+ data.pageName = this.pageName
141
+ data.secondLevelId = this.secondLevelId
142
+ data.x1 = this.multcid
143
+ data.x2 = this.multctype
144
+ data.x5 = this.multcdate
145
+ data.chapter = this.chapter
146
+ data.action = 'play'
147
+ data.refresh = ''
148
+ data.length = this.length
149
+ data.position = '0'
150
+ data.positionNew = '0'
151
+ data.datarate = '19'
152
+ data.location = 'int'
153
+ data.type = 'clip'
154
+ data.size = '100000'
155
+ data.format = '9'
156
+ }
157
+
158
+ this.xtClickVideoHelper(data)
159
+ this.xtRichMediaVideoHelper(data)
160
+ }
161
+
162
+ this.wasNeverPlayed = false
163
+ },
164
+
165
+ trackMediaSeek: function (_from, _to) {
166
+ console.log(_from)
167
+ console.log(_to)
168
+
169
+ const data = {}
170
+
171
+ data.avType = this.avType
172
+ data.pageName = this.pageName
173
+ data.secondLevelId = this.secondLevelId
174
+ data.x1 = this.multcid
175
+ data.x2 = this.multctype
176
+ data.x5 = this.multcdate
177
+ data.chapter = this.chapter
178
+ data.action = 'move'
179
+ data.refresh = ''
180
+ data.length = this.length
181
+ data.position = _from
182
+ data.positionNew = _to
183
+ data.datarate = ''
184
+ data.location = 'int'
185
+ data.type = 'clip'
186
+ data.size = ''
187
+ data.format = ''
188
+
189
+ this.xtRichMediaVideoHelper(data)
190
+ },
191
+ }
192
+
193
+ export default ATIMediaHelper
@@ -0,0 +1,118 @@
1
+ import { fireEvent, hr$, listen } from 'hrQueryNew'
2
+ import { uxAction } from '../../base/tracking/atiHelperNew'
3
+ import ATIMediaHelper from '../../base/tracking/atiMediaHelperNew'
4
+
5
+ const AudioElement = function (options, rootElement) {
6
+ 'use strict'
7
+
8
+ const audio = hr$('audio', rootElement)[0],
9
+ downloadInfo = hr$('.audioElement__downloadInfo', rootElement)[0],
10
+ downloadText = hr$('.audioElement__downloadText', rootElement)[0],
11
+ mediaTracking = new ATIMediaHelper(
12
+ 'audio',
13
+ options.mediaMetadata.ati.pageName,
14
+ options.mediaMetadata.ati.secondLevelId,
15
+ options.mediaMetadata.agf.length,
16
+ options.mediaMetadata.ati.documentName,
17
+ options.mediaMetadata.ati.documentType,
18
+ options.mediaMetadata.ati.documentDate,
19
+ options.mediaMetadata.ati.chapter
20
+ )
21
+ let autoplay = options.autoplay || false,
22
+ isPlaying = false
23
+
24
+ const errorHandling = function (e) {
25
+ console.dir(audio)
26
+
27
+ if (audio.canPlayType && audio.canPlayType('audio/mpeg').length <= 0) {
28
+ showPlaybackNotSupported()
29
+ return
30
+ }
31
+
32
+ switch (audio.networkState) {
33
+ //file not found - 404
34
+ case HTMLMediaElement.NETWORK_NO_SOURCE:
35
+ showFileNotFound()
36
+ return
37
+
38
+ default:
39
+ break
40
+ }
41
+
42
+ //falls es mit einem event aufgerufen wurde
43
+ //und bis hierhin kam gibt es einen generellen fehler
44
+ if (e) {
45
+ showGeneralError()
46
+ return
47
+ }
48
+
49
+ return
50
+ }
51
+ const showGeneralError = function () {
52
+ console.log('Audio: Error')
53
+ downloadText.innerHTML = options.playbackError
54
+ rootElement.insertBefore(downloadInfo, rootElement.firstChild)
55
+ downloadInfo.style.display = 'inline-block'
56
+
57
+ uxAction('audioPlayer', 'generalError')
58
+ }
59
+ const showFileNotFound = function () {
60
+ console.log('Audio: File Not Found')
61
+ downloadInfo.innerHTML = options.playbackFileNotFound
62
+ rootElement.insertBefore(downloadInfo, rootElement.firstChild)
63
+ downloadInfo.style.display = 'inline-block'
64
+
65
+ uxAction('audioPlayer', 'fileNotFound')
66
+ }
67
+ const showPlaybackNotSupported = function () {
68
+ console.log('Audio: Playback unsupported')
69
+ downloadText.innerHTML = options.playbackUnsupported
70
+ rootElement.insertBefore(downloadInfo, rootElement.firstChild)
71
+ downloadInfo.style.display = 'inline-block'
72
+
73
+ uxAction('audioPlayer', 'playbackNotSupported')
74
+ }
75
+ const shouldIStopPlaying = function (event) {
76
+ console.log(event.detail)
77
+ if (event.detail != audio && isPlaying) {
78
+ audio.pause()
79
+ pauseAudio(event)
80
+ }
81
+ }
82
+ const startAudio = function (e) {
83
+ console.log('start')
84
+ uxAction('audioPlayer', 'audioPlay')
85
+ mediaTracking.trackInitialMediaPlay()
86
+ fireEvent('hr:global:stopOtherAVs', audio, true)
87
+ isPlaying = true
88
+ const geotag = hr$('.js-geotag', rootElement)[0]
89
+ if (typeof geotag != 'undefined') {
90
+ geotag.classList.add('hide')
91
+ }
92
+ }
93
+ const pauseAudio = function (e) {
94
+ console.log('pause')
95
+ const ended = e.target.ended
96
+ isPlaying = false
97
+ if (!ended) {
98
+ uxAction('audioPlayer', 'pause')
99
+ } else {
100
+ uxAction('audioPlayer', 'ended')
101
+ }
102
+ }
103
+
104
+ //falls ein fehler auftrat bevor das js, geladen wurde
105
+ errorHandling()
106
+
107
+ listen('error', errorHandling, rootElement)
108
+ listen('play', startAudio, audio)
109
+ listen('pause', pauseAudio, audio)
110
+
111
+ if (autoplay) {
112
+ audio.play()
113
+ }
114
+
115
+ listen('hr:global:stopOtherAVs', shouldIStopPlaying)
116
+ }
117
+
118
+ export default AudioElement
@@ -0,0 +1,16 @@
1
+ <button
2
+ {{~#if _aria}} aria-label="{{_aria}}"{{/if}}
3
+ {{~#if _isButton}} type="button"{{else}} type="submit"{{/if~}}
4
+ {{~#if _name}} name="{{_name}}"{{/if}}
5
+ class="bg-blue-500 hover:bg-blue-700 text-white py-2 px-4 rounded {{_addClass}}{{#if _webview}} -webview{{/if}}"
6
+ {{~#if _value}} value="{{_value}}"{{/if}}
7
+ >
8
+ {{~#if _showIcon~}}
9
+ {{> components/base/image/icon _icon=_icon _iconmap=_iconmap _addClass=_addIconClass _webview=_webview}}
10
+ {{/if~}}
11
+ {{~#if _label~}}
12
+ <span class="button__text">
13
+ {{~_label~}}
14
+ </span>
15
+ {{/if~}}
16
+ </button>
@@ -0,0 +1,16 @@
1
+ <button
2
+ {{~#if _aria}} aria-label="{{_aria}}"{{/if}}
3
+ {{~#if _isButton}} type="button"{{else}} type="submit"{{/if~}}
4
+ {{~#if _name}} name="{{_name}}"{{/if}}
5
+ class="bg-blue-500 hover:bg-blue-700 text-white rounded-full border-4 border-white p-1 {{_addClass}}{{#if _webview}} -webview{{/if}}"
6
+ {{~#if _value}} value="{{_value}}"{{/if}}
7
+ >
8
+ {{~#if _showIcon~}}
9
+ {{> components/base/image/icon _icon=_icon _iconmap=_iconmap _addClass=_addIconClass _webview=_webview}}
10
+ {{/if~}}
11
+ {{~#if _label~}}
12
+ <span class="sr-only">
13
+ {{~_label~}}
14
+ </span>
15
+ {{/if~}}
16
+ </button>
@@ -0,0 +1,37 @@
1
+ import { getJSONCookie, setJSONCookie } from 'hrQueryNew'
2
+
3
+ const TrackingCookie = function () {
4
+ let cookie = {}
5
+ const trackingCookieLifetime = 1000 * 60 * 60 * 24 * 365 * 10 /* 10 years */
6
+
7
+ const setCookieForTracking = function (trackingService, state) {
8
+ if (state == null) {
9
+ state = true
10
+ }
11
+ console.log('Schreibe Cookie: ' + trackingService + ': ' + state)
12
+ readTrackingCookie()
13
+ cookie[trackingService] = state
14
+ writeTrackingCookie()
15
+ }
16
+ const isTrackingAccepted = function (trackingService) {
17
+ readTrackingCookie()
18
+ return cookie[trackingService] === true
19
+ }
20
+ const writeTrackingCookie = function () {
21
+ setJSONCookie('tracking', cookie, trackingCookieLifetime)
22
+ }
23
+ const readTrackingCookie = function () {
24
+ cookie = getJSONCookie('tracking') || {}
25
+ }
26
+ const isTrackingCookieExistent = function (trackingService) {
27
+ readTrackingCookie()
28
+ return cookie.hasOwnProperty(trackingService)
29
+ }
30
+ return {
31
+ setCookieForTracking: setCookieForTracking,
32
+ isTrackingAccepted: isTrackingAccepted,
33
+ isTrackingCookieExistent: isTrackingCookieExistent,
34
+ }
35
+ }
36
+
37
+ export default TrackingCookie