hr-design-system-handlebars 0.51.0 → 0.52.0
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/.storybook/main.js +1 -4
- package/CHANGELOG.md +36 -0
- package/build/helpers/loca.js +1 -0
- package/build/scripts/build.js +3 -1
- package/dist/assets/js/views/base/tracking/atiHelper.subfeature.js +36 -0
- package/dist/assets/js/views/base/tracking/atiMediaHelper.subfeature.js +193 -0
- package/dist/assets/js/views/components/foo.feature.js +16 -0
- package/dist/{views/components → assets/js/views}/generic/hrQuery.subfeature.js +0 -0
- package/{src/stories/views/components → dist/views}/generic/hrQuery.subfeature.js +0 -0
- package/package.json +1 -1
- package/src/assets/fixtures/teaser/teaser_alternative_100_serif_download.json +40 -0
- package/src/assets/fixtures/teaser/teaser_alternative_50_serif_download.json +40 -0
- package/src/assets/fixtures/teaser/teaser_labels.inc.json +8 -0
- package/src/assets/fixtures/teaser/teaser_standard_100_serif_download.json +17 -0
- package/src/assets/fixtures/teaser/teaser_standard_50_serif_download.json +17 -0
- package/src/assets/fixtures/teaser/teasers.inc.json +111 -0
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif_download.json +1 -0
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif_download.json +1 -0
- package/src/stories/views/components/teaser/fixtures/teaser_standard_100_serif_download.json +1 -0
- package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_download.json +1 -0
- package/src/stories/views/components/teaser/teaser_alternativ.stories.mdx +8 -0
- package/src/stories/views/components/teaser/teaser_standard.stories.mdx +4 -0
- package/src/stories/views/generic/hrQuery.subfeature.js +380 -0
package/.storybook/main.js
CHANGED
|
@@ -36,10 +36,7 @@ module.exports = {
|
|
|
36
36
|
components: path.resolve(__dirname, '../src/stories/views/components'),
|
|
37
37
|
base: path.resolve(__dirname, '../src/stories/views/base'),
|
|
38
38
|
tailwind$: path.resolve(__dirname, '../src/assets/tailwind.css'),
|
|
39
|
-
hrQuery$: path.resolve(
|
|
40
|
-
__dirname,
|
|
41
|
-
'../src/stories/views/components/generic/hrQuery.subfeature.js'
|
|
42
|
-
),
|
|
39
|
+
hrQuery$: path.resolve(__dirname, '../src/stories/views/generic/hrQuery.subfeature.js'),
|
|
43
40
|
initializer$: path.resolve(
|
|
44
41
|
__dirname,
|
|
45
42
|
'../build/webpack/feature-loader/initializer/initializer.js'
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
# v0.52.0 (Mon Aug 01 2022)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Dpe 1675 Download Teaser [#290](https://github.com/mumprod/hr-design-system-handlebars/pull/290) ([@Sunny1112358](https://github.com/Sunny1112358))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- [@Sunny1112358](https://github.com/Sunny1112358)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v0.51.2 (Thu Jul 28 2022)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- FEATURE: hrQuery is moved out of the components [#289](https://github.com/mumprod/hr-design-system-handlebars/pull/289) ([@szuelch](https://github.com/szuelch))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- [@szuelch](https://github.com/szuelch)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# v0.51.1 (Thu Jul 28 2022)
|
|
26
|
+
|
|
27
|
+
#### 🐛 Bug Fix
|
|
28
|
+
|
|
29
|
+
- FEATURE: All js files that get loaded by [#288](https://github.com/mumprod/hr-design-system-handlebars/pull/288) ([@szuelch](https://github.com/szuelch))
|
|
30
|
+
|
|
31
|
+
#### Authors: 1
|
|
32
|
+
|
|
33
|
+
- [@szuelch](https://github.com/szuelch)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
1
37
|
# v0.51.0 (Wed Jul 27 2022)
|
|
2
38
|
|
|
3
39
|
#### 🚀 Enhancement
|
package/build/helpers/loca.js
CHANGED
|
@@ -17,6 +17,7 @@ module.exports = function(text, options) {
|
|
|
17
17
|
"comment_anchor_2": " Kommentaren des Artikels springen",
|
|
18
18
|
"date_simple_at": options + " Uhr",
|
|
19
19
|
"label_ticker":"Ticker",
|
|
20
|
+
"label_download":"Download",
|
|
20
21
|
"label_media":"Media",
|
|
21
22
|
"group_tabbed_more":"weitere Meldungen aus " + options,
|
|
22
23
|
}
|
package/build/scripts/build.js
CHANGED
|
@@ -7,5 +7,7 @@ const run = (cmd) => execSync(cmd, { stdio: 'inherit', cwd: root })
|
|
|
7
7
|
// Copy hbs files into the dist folder
|
|
8
8
|
run(`npx copyfiles \"./src/index.js\" dist --up=1`)
|
|
9
9
|
run(`npx copyfiles \"./src/stories/views/**/*.{js,hbs}\" dist --up=2`)
|
|
10
|
-
run(
|
|
10
|
+
run(
|
|
11
|
+
`npx copyfiles -e \"./src/stories/views/**/clickTracking.feature.js\" \"./src/stories/views/**/*.{feature,subfeature}.js\" dist/assets/js --up=2`
|
|
12
|
+
)
|
|
11
13
|
run(`npx copyfiles \"./src/assets/**/*.{woff,svg}\" dist --up=1`)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
|
|
2
|
+
|
|
3
|
+
const isTrackingAllowed = () => {
|
|
4
|
+
const trackingCookie = new TrackingCookie()
|
|
5
|
+
return trackingCookie.isTrackingAccepted('ati')
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const uxAction = (label, secondLevelId) => {
|
|
9
|
+
secondLevelId = secondLevelId || window.xtn2
|
|
10
|
+
if (window.xt_click && isTrackingAllowed()) {
|
|
11
|
+
window.xt_click('this', 'C', secondLevelId, label, 'A')
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const uxNavigation = (label, secondLevelId) => {
|
|
16
|
+
secondLevelId = secondLevelId || window.xtn2
|
|
17
|
+
if (window.xt_click && isTrackingAllowed()) {
|
|
18
|
+
window.xt_click('this', 'C', secondLevelId, label, 'N')
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const pi = (label, secondLevelId) => {
|
|
23
|
+
secondLevelId = secondLevelId || window.xtn2
|
|
24
|
+
if (window.xt_click && isTrackingAllowed()) {
|
|
25
|
+
window.xt_click('this', 'F', secondLevelId, label)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const download = (label, secondLevelId) => {
|
|
30
|
+
secondLevelId = secondLevelId || window.xtn2
|
|
31
|
+
if (window.xt_click && isTrackingAllowed()) {
|
|
32
|
+
window.xt_click('this', 'C', secondLevelId, label, 'T')
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { isTrackingAllowed, uxAction, uxNavigation, pi, download }
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { isTrackingAllowed, pi } from 'base/tracking/atiHelper.subfeature'
|
|
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,16 @@
|
|
|
1
|
+
import { hr$ } from 'hrQuery'
|
|
2
|
+
const Foo = (context) => {
|
|
3
|
+
const { options } = context
|
|
4
|
+
const { element: rootElement } = context
|
|
5
|
+
const { test } = options
|
|
6
|
+
|
|
7
|
+
const init = () => {
|
|
8
|
+
console.log(rootElement)
|
|
9
|
+
console.log(hr$('.inner', rootElement))
|
|
10
|
+
console.log(`Feature ${test} geladen`)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
init()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default Foo
|
|
File without changes
|
|
File without changes
|
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": "0.
|
|
9
|
+
"version": "0.52.0",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "start-storybook -p 6006 public",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@->jsoninclude": "teaser/teasers.inc.json",
|
|
3
|
+
"@->contentpath": "teaserDownload",
|
|
4
|
+
"@->overrides": [
|
|
5
|
+
{
|
|
6
|
+
"@->contentpath": "logicItem.includePath",
|
|
7
|
+
"@->value": "components/teaser/teaser_alternative"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"@->contentpath": "logicItem.includeModel.teaserSize",
|
|
11
|
+
"@->value": "100"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"@->contentpath": "logicItem.includeModel.teaserType",
|
|
15
|
+
"@->value": "alternative-ds"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"@->contentpath": "logicItem.includeModel.isMobile1to1",
|
|
19
|
+
"@->value": "true"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"@->contentpath": "logicItem.includeModel.link.content.isMobile1to1",
|
|
23
|
+
"@->value": "true"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"@->contentpath": "logicItem.includeModel.teaserImage",
|
|
27
|
+
"@->value": {
|
|
28
|
+
"@->jsoninclude": "teaser/teaser_images.inc.json",
|
|
29
|
+
"@->contentpath": "md_1_tab"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"@->contentpath": "logicItem.includeModel.label",
|
|
34
|
+
"@->value": {
|
|
35
|
+
"@->jsoninclude": "teaser/teaser_labels.inc.json",
|
|
36
|
+
"@->contentpath": "download"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@->jsoninclude": "teaser/teasers.inc.json",
|
|
3
|
+
"@->contentpath": "teaserDownload",
|
|
4
|
+
"@->overrides": [
|
|
5
|
+
{
|
|
6
|
+
"@->contentpath": "logicItem.includePath",
|
|
7
|
+
"@->value": "components/teaser/teaser_alternative"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"@->contentpath": "logicItem.includeModel.teaserSize",
|
|
11
|
+
"@->value": "50"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"@->contentpath": "logicItem.includeModel.teaserType",
|
|
15
|
+
"@->value": "alternative-ds"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"@->contentpath": "logicItem.includeModel.isMobile1to1",
|
|
19
|
+
"@->value": "true"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"@->contentpath": "logicItem.includeModel.link.content.isMobile1to1",
|
|
23
|
+
"@->value": "true"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"@->contentpath": "logicItem.includeModel.teaserImage",
|
|
27
|
+
"@->value": {
|
|
28
|
+
"@->jsoninclude": "teaser/teaser_images.inc.json",
|
|
29
|
+
"@->contentpath": "md_2_tab"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"@->contentpath": "logicItem.includeModel.label",
|
|
34
|
+
"@->value": {
|
|
35
|
+
"@->jsoninclude": "teaser/teaser_labels.inc.json",
|
|
36
|
+
"@->contentpath": "download"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@->jsoninclude": "teaser/teasers.inc.json",
|
|
3
|
+
"@->contentpath": "teaserDownload",
|
|
4
|
+
"@->overrides": [
|
|
5
|
+
{
|
|
6
|
+
"@->contentpath": "logicItem.includeModel.teaserSize",
|
|
7
|
+
"@->value": "100"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"@->contentpath": "logicItem.includeModel.label",
|
|
11
|
+
"@->value": {
|
|
12
|
+
"@->jsoninclude": "teaser/teaser_labels.inc.json",
|
|
13
|
+
"@->contentpath": "download"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@->jsoninclude": "teaser/teasers.inc.json",
|
|
3
|
+
"@->contentpath": "teaserDownload",
|
|
4
|
+
"@->overrides": [
|
|
5
|
+
{
|
|
6
|
+
"@->contentpath": "logicItem.includeModel.teaserSize",
|
|
7
|
+
"@->value": "50"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"@->contentpath": "logicItem.includeModel.label",
|
|
11
|
+
"@->value": {
|
|
12
|
+
"@->jsoninclude": "teaser/teaser_labels.inc.json",
|
|
13
|
+
"@->contentpath": "download"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -110,6 +110,117 @@
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
+
"teaserDownload": {
|
|
114
|
+
"isSsi": true,
|
|
115
|
+
"logicItem": {
|
|
116
|
+
"includePath": "components/teaser/teaser_standard",
|
|
117
|
+
"includeModel": {
|
|
118
|
+
"byline": "Byline",
|
|
119
|
+
"title": "Download",
|
|
120
|
+
"topline": "",
|
|
121
|
+
"headingFontVariant": "serif",
|
|
122
|
+
"extendedTitle": "",
|
|
123
|
+
"teaserType": "standard-ds",
|
|
124
|
+
"teaserSize": "hero",
|
|
125
|
+
"isMobile1to1": false,
|
|
126
|
+
"teaserDate": {
|
|
127
|
+
"htmlDateTime": "2022-04-17T19:30+0200",
|
|
128
|
+
"htmlDate": "20.02.1983",
|
|
129
|
+
"date": "17.04.22",
|
|
130
|
+
"dateSeparatorTime": "17.04.22, 19:30"
|
|
131
|
+
},
|
|
132
|
+
"teaserInfo": {
|
|
133
|
+
"showTeaserInfo": true,
|
|
134
|
+
"showTeaserInfoSection": true,
|
|
135
|
+
"showTeaserInfoChannel": true,
|
|
136
|
+
"showTeaserInfoAll": true,
|
|
137
|
+
"showTeaserInfoDate": false,
|
|
138
|
+
"showTeaserInfoDateTime": false,
|
|
139
|
+
"showTeaserInfoProgramRef": true
|
|
140
|
+
},
|
|
141
|
+
"teaserImage": {
|
|
142
|
+
"@->jsoninclude": "teaser/teaser_images.inc.json",
|
|
143
|
+
"@->contentpath": "standard_1"
|
|
144
|
+
},
|
|
145
|
+
"hasMediaButtons": false,
|
|
146
|
+
"dontLazyload": true,
|
|
147
|
+
"isStandardTeaser": true,
|
|
148
|
+
"isHeroTeaser": true,
|
|
149
|
+
"isMediaTeaser": false,
|
|
150
|
+
"isGuide": false,
|
|
151
|
+
"isProgram": false,
|
|
152
|
+
"isEvent": false,
|
|
153
|
+
"isTicker": false,
|
|
154
|
+
"isAudio": false,
|
|
155
|
+
"isVideo": false,
|
|
156
|
+
"isPodcastEpisode": false,
|
|
157
|
+
"isExtOrBrandLink": false,
|
|
158
|
+
"isAuthor": false,
|
|
159
|
+
"copyright": "Copyright Text",
|
|
160
|
+
"audioAuthor": "Audio Author",
|
|
161
|
+
"hasStatus": false,
|
|
162
|
+
"hasTeaserItem": true,
|
|
163
|
+
"allowAVConsumption": false,
|
|
164
|
+
"displayEpgInfos": false,
|
|
165
|
+
"aspectRatio": "ar--teaserTop",
|
|
166
|
+
"hideGeotag": false,
|
|
167
|
+
"hideEditableByline": true,
|
|
168
|
+
"doTracking": true,
|
|
169
|
+
"trackingForArdMediatheksLink": false,
|
|
170
|
+
"showMediatheksLink": false,
|
|
171
|
+
"showAirdate": false,
|
|
172
|
+
"showProfileInfoAsByline": false,
|
|
173
|
+
"obsolet_brandOfTeaser": "hessenschau",
|
|
174
|
+
"documentSection": "",
|
|
175
|
+
"headlineTag": "h1",
|
|
176
|
+
"icon": "ortsmarke",
|
|
177
|
+
"imageVariant": "topteaser",
|
|
178
|
+
"shorttext": "",
|
|
179
|
+
"sophoraId": "rueckkehr-nach-abschiebung-wolfhagen--100",
|
|
180
|
+
"profiles": "",
|
|
181
|
+
"teaserLead": {
|
|
182
|
+
"avDocument": "",
|
|
183
|
+
"image": ""
|
|
184
|
+
},
|
|
185
|
+
"geotag": [
|
|
186
|
+
{
|
|
187
|
+
"title": "Wolfhagen"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"link": {
|
|
191
|
+
"url": "/teaser1",
|
|
192
|
+
"webviewUrl": "/teaser1#webview",
|
|
193
|
+
"isTargetBlank": false,
|
|
194
|
+
"hasIcon": false,
|
|
195
|
+
"iconName": "iconName",
|
|
196
|
+
"readMoreText": {
|
|
197
|
+
"readMoreScreenreader": "Zum Artikel",
|
|
198
|
+
"readMore": "mehr",
|
|
199
|
+
"readMoreLong": "read More Long"
|
|
200
|
+
},
|
|
201
|
+
"content": {
|
|
202
|
+
"headlineTag": "h1",
|
|
203
|
+
"headingFontVariant": "serif",
|
|
204
|
+
"imageVariant": "topteaser",
|
|
205
|
+
"isFileDownload": false,
|
|
206
|
+
"teaserImage": {
|
|
207
|
+
"@->jsoninclude": "teaser/teaser_images.inc.json",
|
|
208
|
+
"@->contentpath": "standard_1"
|
|
209
|
+
},
|
|
210
|
+
"teaserSize": "hero",
|
|
211
|
+
"isMobile1to1": false,
|
|
212
|
+
"teaserType": "standard-ds",
|
|
213
|
+
"title": "Abgeschobene Geschwister aus Syrien zurück in Wolfhagen",
|
|
214
|
+
"topline": "Überglücklich, aber ohne Mama",
|
|
215
|
+
"trackingData": {
|
|
216
|
+
"secondLevelId": "2",
|
|
217
|
+
"pageName": "hessenschau"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
113
224
|
"teaserWithComments": {
|
|
114
225
|
"isSsi": true,
|
|
115
226
|
"logicItem": {
|
package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif_download.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSsi":true,"logicItem":{"includePath":"components/teaser/teaser_alternative","includeModel":{"byline":"Byline","title":"Download","topline":"","headingFontVariant":"serif","extendedTitle":"","teaserType":"alternative-ds","teaserSize":"100","isMobile1to1":"true","teaserDate":{"htmlDateTime":"2022-04-17T19:30+0200","htmlDate":"20.02.1983","date":"17.04.22","dateSeparatorTime":"17.04.22, 19:30"},"teaserInfo":{"showTeaserInfo":true,"showTeaserInfoSection":true,"showTeaserInfoChannel":true,"showTeaserInfoAll":true,"showTeaserInfoDate":false,"showTeaserInfoDateTime":false,"showTeaserInfoProgramRef":true},"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":true,"asImage":false,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"media":"all and (max-width: 47.938em)","sizes":"40vw","srcset":"https://picsum.photos/id/188/320/320 320w, https://picsum.photos/id/188/480/480 480w, https://picsum.photos/id/188/640/640 640w, https://picsum.photos/id/188/960/960 960w"},{"media":"all and (min-width: 48em) ","sizes":"33vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w"}]}},"hasMediaButtons":false,"dontLazyload":true,"isStandardTeaser":true,"isHeroTeaser":true,"isMediaTeaser":false,"isGuide":false,"isProgram":false,"isEvent":false,"isTicker":false,"isAudio":false,"isVideo":false,"isPodcastEpisode":false,"isExtOrBrandLink":false,"isAuthor":false,"copyright":"Copyright Text","audioAuthor":"Audio Author","hasStatus":false,"hasTeaserItem":true,"allowAVConsumption":false,"displayEpgInfos":false,"aspectRatio":"ar--teaserTop","hideGeotag":false,"hideEditableByline":true,"doTracking":true,"trackingForArdMediatheksLink":false,"showMediatheksLink":false,"showAirdate":false,"showProfileInfoAsByline":false,"obsolet_brandOfTeaser":"hessenschau","documentSection":"","headlineTag":"h1","icon":"ortsmarke","imageVariant":"topteaser","shorttext":"","sophoraId":"rueckkehr-nach-abschiebung-wolfhagen--100","profiles":"","teaserLead":{"avDocument":"","image":""},"geotag":[{"title":"Wolfhagen"}],"link":{"url":"/teaser1","webviewUrl":"/teaser1#webview","isTargetBlank":false,"hasIcon":false,"iconName":"iconName","readMoreText":{"readMoreScreenreader":"Zum Artikel","readMore":"mehr","readMoreLong":"read More Long"},"content":{"headlineTag":"h1","headingFontVariant":"serif","imageVariant":"topteaser","isFileDownload":false,"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"teaserSize":"hero","isMobile1to1":"true","teaserType":"standard-ds","title":"Abgeschobene Geschwister aus Syrien zurück in Wolfhagen","topline":"Überglücklich, aber ohne Mama","trackingData":{"secondLevelId":"2","pageName":"hessenschau"}}},"label":{"type":"download","loca":"label_download","byline":{"bylineSsi":"ZIP - 3mb","bylineText":"BylineText"}}}}}
|
package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif_download.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSsi":true,"logicItem":{"includePath":"components/teaser/teaser_alternative","includeModel":{"byline":"Byline","title":"Download","topline":"","headingFontVariant":"serif","extendedTitle":"","teaserType":"alternative-ds","teaserSize":"50","isMobile1to1":"true","teaserDate":{"htmlDateTime":"2022-04-17T19:30+0200","htmlDate":"20.02.1983","date":"17.04.22","dateSeparatorTime":"17.04.22, 19:30"},"teaserInfo":{"showTeaserInfo":true,"showTeaserInfoSection":true,"showTeaserInfoChannel":true,"showTeaserInfoAll":true,"showTeaserInfoDate":false,"showTeaserInfoDateTime":false,"showTeaserInfoProgramRef":true},"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":true,"asImage":false,"fallback":"https://picsum.photos/id/189/480/270","sources":[{"media":"all and (max-width: 47.938em)","sizes":"40vw","srcset":"https://picsum.photos/id/189/320/320 320w, https://picsum.photos/id/189/480/480 480w, https://picsum.photos/id/189/640/640 640w, https://picsum.photos/id/189/960/960 960w"},{"media":"all and (min-width: 48em) ","sizes":"33vw","srcset":"https://picsum.photos/id/189/320/180 320w, https://picsum.photos/id/189/480/270 480w, https://picsum.photos/id/189/640/360 640w, https://picsum.photos/id/189/960/540 960w"}]}},"hasMediaButtons":false,"dontLazyload":true,"isStandardTeaser":true,"isHeroTeaser":true,"isMediaTeaser":false,"isGuide":false,"isProgram":false,"isEvent":false,"isTicker":false,"isAudio":false,"isVideo":false,"isPodcastEpisode":false,"isExtOrBrandLink":false,"isAuthor":false,"copyright":"Copyright Text","audioAuthor":"Audio Author","hasStatus":false,"hasTeaserItem":true,"allowAVConsumption":false,"displayEpgInfos":false,"aspectRatio":"ar--teaserTop","hideGeotag":false,"hideEditableByline":true,"doTracking":true,"trackingForArdMediatheksLink":false,"showMediatheksLink":false,"showAirdate":false,"showProfileInfoAsByline":false,"obsolet_brandOfTeaser":"hessenschau","documentSection":"","headlineTag":"h1","icon":"ortsmarke","imageVariant":"topteaser","shorttext":"","sophoraId":"rueckkehr-nach-abschiebung-wolfhagen--100","profiles":"","teaserLead":{"avDocument":"","image":""},"geotag":[{"title":"Wolfhagen"}],"link":{"url":"/teaser1","webviewUrl":"/teaser1#webview","isTargetBlank":false,"hasIcon":false,"iconName":"iconName","readMoreText":{"readMoreScreenreader":"Zum Artikel","readMore":"mehr","readMoreLong":"read More Long"},"content":{"headlineTag":"h1","headingFontVariant":"serif","imageVariant":"topteaser","isFileDownload":false,"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"teaserSize":"hero","isMobile1to1":"true","teaserType":"standard-ds","title":"Abgeschobene Geschwister aus Syrien zurück in Wolfhagen","topline":"Überglücklich, aber ohne Mama","trackingData":{"secondLevelId":"2","pageName":"hessenschau"}}},"label":{"type":"download","loca":"label_download","byline":{"bylineSsi":"ZIP - 3mb","bylineText":"BylineText"}}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSsi":true,"logicItem":{"includePath":"components/teaser/teaser_standard","includeModel":{"byline":"Byline","title":"Download","topline":"","headingFontVariant":"serif","extendedTitle":"","teaserType":"standard-ds","teaserSize":"100","isMobile1to1":false,"teaserDate":{"htmlDateTime":"2022-04-17T19:30+0200","htmlDate":"20.02.1983","date":"17.04.22","dateSeparatorTime":"17.04.22, 19:30"},"teaserInfo":{"showTeaserInfo":true,"showTeaserInfoSection":true,"showTeaserInfoChannel":true,"showTeaserInfoAll":true,"showTeaserInfoDate":false,"showTeaserInfoDateTime":false,"showTeaserInfoProgramRef":true},"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"hasMediaButtons":false,"dontLazyload":true,"isStandardTeaser":true,"isHeroTeaser":true,"isMediaTeaser":false,"isGuide":false,"isProgram":false,"isEvent":false,"isTicker":false,"isAudio":false,"isVideo":false,"isPodcastEpisode":false,"isExtOrBrandLink":false,"isAuthor":false,"copyright":"Copyright Text","audioAuthor":"Audio Author","hasStatus":false,"hasTeaserItem":true,"allowAVConsumption":false,"displayEpgInfos":false,"aspectRatio":"ar--teaserTop","hideGeotag":false,"hideEditableByline":true,"doTracking":true,"trackingForArdMediatheksLink":false,"showMediatheksLink":false,"showAirdate":false,"showProfileInfoAsByline":false,"obsolet_brandOfTeaser":"hessenschau","documentSection":"","headlineTag":"h1","icon":"ortsmarke","imageVariant":"topteaser","shorttext":"","sophoraId":"rueckkehr-nach-abschiebung-wolfhagen--100","profiles":"","teaserLead":{"avDocument":"","image":""},"geotag":[{"title":"Wolfhagen"}],"link":{"url":"/teaser1","webviewUrl":"/teaser1#webview","isTargetBlank":false,"hasIcon":false,"iconName":"iconName","readMoreText":{"readMoreScreenreader":"Zum Artikel","readMore":"mehr","readMoreLong":"read More Long"},"content":{"headlineTag":"h1","headingFontVariant":"serif","imageVariant":"topteaser","isFileDownload":false,"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"teaserSize":"hero","isMobile1to1":false,"teaserType":"standard-ds","title":"Abgeschobene Geschwister aus Syrien zurück in Wolfhagen","topline":"Überglücklich, aber ohne Mama","trackingData":{"secondLevelId":"2","pageName":"hessenschau"}}},"label":{"type":"download","loca":"label_download","byline":{"bylineSsi":"ZIP - 3mb","bylineText":"BylineText"}}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSsi":true,"logicItem":{"includePath":"components/teaser/teaser_standard","includeModel":{"byline":"Byline","title":"Download","topline":"","headingFontVariant":"serif","extendedTitle":"","teaserType":"standard-ds","teaserSize":"50","isMobile1to1":false,"teaserDate":{"htmlDateTime":"2022-04-17T19:30+0200","htmlDate":"20.02.1983","date":"17.04.22","dateSeparatorTime":"17.04.22, 19:30"},"teaserInfo":{"showTeaserInfo":true,"showTeaserInfoSection":true,"showTeaserInfoChannel":true,"showTeaserInfoAll":true,"showTeaserInfoDate":false,"showTeaserInfoDateTime":false,"showTeaserInfoProgramRef":true},"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"hasMediaButtons":false,"dontLazyload":true,"isStandardTeaser":true,"isHeroTeaser":true,"isMediaTeaser":false,"isGuide":false,"isProgram":false,"isEvent":false,"isTicker":false,"isAudio":false,"isVideo":false,"isPodcastEpisode":false,"isExtOrBrandLink":false,"isAuthor":false,"copyright":"Copyright Text","audioAuthor":"Audio Author","hasStatus":false,"hasTeaserItem":true,"allowAVConsumption":false,"displayEpgInfos":false,"aspectRatio":"ar--teaserTop","hideGeotag":false,"hideEditableByline":true,"doTracking":true,"trackingForArdMediatheksLink":false,"showMediatheksLink":false,"showAirdate":false,"showProfileInfoAsByline":false,"obsolet_brandOfTeaser":"hessenschau","documentSection":"","headlineTag":"h1","icon":"ortsmarke","imageVariant":"topteaser","shorttext":"","sophoraId":"rueckkehr-nach-abschiebung-wolfhagen--100","profiles":"","teaserLead":{"avDocument":"","image":""},"geotag":[{"title":"Wolfhagen"}],"link":{"url":"/teaser1","webviewUrl":"/teaser1#webview","isTargetBlank":false,"hasIcon":false,"iconName":"iconName","readMoreText":{"readMoreScreenreader":"Zum Artikel","readMore":"mehr","readMoreLong":"read More Long"},"content":{"headlineTag":"h1","headingFontVariant":"serif","imageVariant":"topteaser","isFileDownload":false,"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"teaserSize":"hero","isMobile1to1":false,"teaserType":"standard-ds","title":"Abgeschobene Geschwister aus Syrien zurück in Wolfhagen","topline":"Überglücklich, aber ohne Mama","trackingData":{"secondLevelId":"2","pageName":"hessenschau"}}},"label":{"type":"download","loca":"label_download","byline":{"bylineSsi":"ZIP - 3mb","bylineText":"BylineText"}}}}}
|
|
@@ -8,6 +8,7 @@ import heroTeaserWithLabel from './fixtures/teaser_alternative_hero_serif_label.
|
|
|
8
8
|
import heroTeaserWithComments from './fixtures/teaser_alternative_hero_serif_comments.json'
|
|
9
9
|
import teaser100 from './fixtures/teaser_alternative_100_serif.json'
|
|
10
10
|
import teaser50 from './fixtures/teaser_alternative_50_serif.json'
|
|
11
|
+
import teaser50Download from './fixtures/teaser_alternative_50_serif_download.json'
|
|
11
12
|
|
|
12
13
|
<Meta
|
|
13
14
|
title="Komponenten/Teaser/Alternativ"
|
|
@@ -67,6 +68,10 @@ Der Alternativ-Teaser besteht aus 2 Hauptelemente: <b>Bild</b> und <b>Text</b> (
|
|
|
67
68
|
Desktop = Bild(33%) neben Text(66%) <br/>
|
|
68
69
|
Mobile = Verhalten wie bei 100% Standard-Teaser <br/>
|
|
69
70
|
|
|
71
|
+
<b>Alternativ 50% mit Download:</b> <br/>
|
|
72
|
+
Desktop = Bild(33%) neben Text(66%) <br/>
|
|
73
|
+
Mobile = Verhalten wie bei 100% Standard-Teaser <br/>
|
|
74
|
+
|
|
70
75
|
Der Alternativ-Teaser soll nur als 100%- bzw. 50%-Teaser verwendet werden.
|
|
71
76
|
|
|
72
77
|
## Sub-Komponenten
|
|
@@ -111,4 +116,7 @@ Die Alternativ-Teaser-Komponente wird in handlebars wie folgt eingebaut:
|
|
|
111
116
|
<Story name="Alternativ 50" args={teaser50.logicItem.includeModel}>
|
|
112
117
|
{Template.bind({})}
|
|
113
118
|
</Story>
|
|
119
|
+
<Story name="Alternativ 50 mit Download" args={teaser50Download.logicItem.includeModel}>
|
|
120
|
+
{Template.bind({})}
|
|
121
|
+
</Story>
|
|
114
122
|
</Preview>
|
|
@@ -7,6 +7,7 @@ import teaser100Serif from './fixtures/teaser_standard_100_serif.json'
|
|
|
7
7
|
import teaser50Serif from './fixtures/teaser_standard_50_serif.json'
|
|
8
8
|
import teaser33Serif from './fixtures/teaser_standard_33_serif.json'
|
|
9
9
|
import teaser25Serif from './fixtures/teaser_standard_25_serif.json'
|
|
10
|
+
import teaser100Download from './fixtures/teaser_standard_100_serif_download.json'
|
|
10
11
|
|
|
11
12
|
<Meta
|
|
12
13
|
title="Komponenten/Teaser/Standard"
|
|
@@ -108,5 +109,8 @@ Die Standard-Teaser-Komponente wird in handlebars wie folgt eingebaut:
|
|
|
108
109
|
<Story name="Standard 25" args={teaser25Serif.logicItem.includeModel}>
|
|
109
110
|
{Template.bind({})}
|
|
110
111
|
</Story>
|
|
112
|
+
<Story name="Standard 100 Mit Download" args={teaser100Download.logicItem.includeModel}>
|
|
113
|
+
{Template.bind({})}
|
|
114
|
+
</Story>
|
|
111
115
|
</Preview>
|
|
112
116
|
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import Initializer from 'initializer'
|
|
2
|
+
import loadFeature from 'loadFeature'
|
|
3
|
+
|
|
4
|
+
const hr$ = (selector, element) => {
|
|
5
|
+
// if element set, use it
|
|
6
|
+
// if not use document as default
|
|
7
|
+
const rootElement = element || document
|
|
8
|
+
|
|
9
|
+
// falls kein selector angegeben
|
|
10
|
+
// gib das element zurück
|
|
11
|
+
if (!selector) {
|
|
12
|
+
return rootElement
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// wenn ein , oder ein leerzeichen '.class1 .class2'
|
|
16
|
+
// in der query dann qSA
|
|
17
|
+
if (
|
|
18
|
+
selector.indexOf(',') > 0 ||
|
|
19
|
+
selector.split(' ').length > 1 ||
|
|
20
|
+
selector.split('.').length > 1
|
|
21
|
+
) {
|
|
22
|
+
return rootElement.querySelectorAll(selector)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (selector[0] === '.') {
|
|
26
|
+
return rootElement.getElementsByClassName(selector.substring(1))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (selector[0] === '#') {
|
|
30
|
+
return new Array(document.getElementById(selector.substring(1)))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// gib eine NodeList zurück
|
|
34
|
+
return rootElement.querySelectorAll(selector)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const stripTags = text => {
|
|
38
|
+
if (text) {
|
|
39
|
+
return text.replace(/(<([^>]+)>)/gi, '')
|
|
40
|
+
}
|
|
41
|
+
return false
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const getViewportWidth = () =>
|
|
45
|
+
Math.max(document.documentElement.clientWidth, window.innerWidth || 0)
|
|
46
|
+
|
|
47
|
+
const isString = value => Object.prototype.toString.call(value) === '[object String]'
|
|
48
|
+
|
|
49
|
+
const isElementInViewport = el => {
|
|
50
|
+
const rect = el.getBoundingClientRect()
|
|
51
|
+
return rect.top <= (document.documentElement || document.body).clientHeight
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const getClosestParentWithTag = (tagName, node) => {
|
|
55
|
+
while (node !== null && node.tagName !== 'BODY') {
|
|
56
|
+
if (node.tagName && node.tagName.toLowerCase() === tagName) {
|
|
57
|
+
return node
|
|
58
|
+
}
|
|
59
|
+
node = node.parentNode
|
|
60
|
+
}
|
|
61
|
+
return false
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const getNodeWithClassInPath = (className, startNode) => {
|
|
65
|
+
let node = startNode
|
|
66
|
+
|
|
67
|
+
while (node && node !== document) {
|
|
68
|
+
if (node.classList.contains(className)) {
|
|
69
|
+
return node
|
|
70
|
+
}
|
|
71
|
+
node = node.parentNode
|
|
72
|
+
}
|
|
73
|
+
return false
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const isDescendant = (parent, child) => {
|
|
77
|
+
let node = child.parentNode
|
|
78
|
+
while (node !== null) {
|
|
79
|
+
if (node === parent) {
|
|
80
|
+
return true
|
|
81
|
+
}
|
|
82
|
+
node = node.parentNode
|
|
83
|
+
}
|
|
84
|
+
return false
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* wartet x ms seit dem letzen aufruf bis es ausgeführt wird */
|
|
88
|
+
const debounce = (fn, delay) => {
|
|
89
|
+
let timer = null
|
|
90
|
+
return (...args) => {
|
|
91
|
+
const context = this
|
|
92
|
+
clearTimeout(timer)
|
|
93
|
+
timer = setTimeout(() => {
|
|
94
|
+
fn.apply(context, args)
|
|
95
|
+
}, delay)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/* feuert all x ms */
|
|
99
|
+
const throttle = (fn, threshhold, scope) => {
|
|
100
|
+
threshhold = threshhold || 250
|
|
101
|
+
let last
|
|
102
|
+
let deferTimer
|
|
103
|
+
return (...args) => {
|
|
104
|
+
const context = scope || this
|
|
105
|
+
|
|
106
|
+
const now = +new Date()
|
|
107
|
+
if (last && now < last + threshhold) {
|
|
108
|
+
// hold on to it
|
|
109
|
+
clearTimeout(deferTimer)
|
|
110
|
+
deferTimer = setTimeout(() => {
|
|
111
|
+
last = now
|
|
112
|
+
fn.apply(context, args)
|
|
113
|
+
}, threshhold)
|
|
114
|
+
} else {
|
|
115
|
+
last = now
|
|
116
|
+
fn.apply(context, args)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Once, führt eine Funktion genau einmal aus, egal wie oft sie aufgerufen wird
|
|
122
|
+
* Usage
|
|
123
|
+
var canOnlyFireOnce = hr$.once(function() {
|
|
124
|
+
console.log('Fired!');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
canOnlyFireOnce(); // "Fired!"
|
|
128
|
+
canOnlyFireOnce(); // nada
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
const once = (fn, context) => {
|
|
132
|
+
let result
|
|
133
|
+
|
|
134
|
+
return (...args) => {
|
|
135
|
+
if (fn) {
|
|
136
|
+
result = fn.apply(context || this, args)
|
|
137
|
+
fn = null
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return result
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const listen = (eventName, fn, documentNode) => {
|
|
145
|
+
documentNode = documentNode === undefined ? document : documentNode
|
|
146
|
+
|
|
147
|
+
if (window.attachEvent) {
|
|
148
|
+
documentNode.attachEvent(eventName, fn)
|
|
149
|
+
} else {
|
|
150
|
+
documentNode.addEventListener(eventName, fn)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const unlisten = (eventName, fn, documentNode) => {
|
|
154
|
+
documentNode = documentNode === undefined ? document : documentNode
|
|
155
|
+
|
|
156
|
+
if (window.attachEvent) {
|
|
157
|
+
documentNode.detachEvent(eventName, fn)
|
|
158
|
+
} else {
|
|
159
|
+
documentNode.removeEventListener(eventName, fn)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const listenOnce = (eventName, fn, documentNode) => {
|
|
163
|
+
documentNode = documentNode === undefined ? document : documentNode
|
|
164
|
+
|
|
165
|
+
documentNode.addEventListener(eventName, fn, { once: true })
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const fireEvent = (event_name, data, handleIframe) => {
|
|
169
|
+
const event = document.createEvent('CustomEvent')
|
|
170
|
+
|
|
171
|
+
event.initCustomEvent(event_name, true, true, data)
|
|
172
|
+
|
|
173
|
+
document.dispatchEvent(event)
|
|
174
|
+
|
|
175
|
+
if (handleIframe) {
|
|
176
|
+
if (hr$('#js-iFrame')[0]) {
|
|
177
|
+
hr$('#js-iFrame')[0].contentWindow.document.dispatchEvent(event)
|
|
178
|
+
}
|
|
179
|
+
if (inIframe()) {
|
|
180
|
+
parent.document.dispatchEvent(event)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const inIframe = () => {
|
|
186
|
+
try {
|
|
187
|
+
return window.self !== window.top
|
|
188
|
+
} catch (e) {
|
|
189
|
+
return true
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const setJSONCookie = (cookieName, cookieValue, cookieLifetime) => {
|
|
194
|
+
setCookie(cookieName, JSON.stringify(cookieValue), cookieLifetime)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const setCookie = (cookieName, cookieValue, cookieLifetime) => {
|
|
198
|
+
let expires
|
|
199
|
+
|
|
200
|
+
const domain = getDomain()
|
|
201
|
+
|
|
202
|
+
if (cookieLifetime) {
|
|
203
|
+
expires = new Date()
|
|
204
|
+
expires.setMilliseconds(expires.getMilliseconds() + cookieLifetime)
|
|
205
|
+
expires = expires.toUTCString()
|
|
206
|
+
} else {
|
|
207
|
+
expires = ''
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
document.cookie =
|
|
211
|
+
cookieName + '=' + cookieValue + ';expires=' + expires + ';domain=' + domain + ';path=/;'
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const getJSONCookie = cookieName => {
|
|
215
|
+
let cookie
|
|
216
|
+
|
|
217
|
+
try {
|
|
218
|
+
cookie = JSON.parse(getCookie(cookieName))
|
|
219
|
+
} catch (e) {}
|
|
220
|
+
|
|
221
|
+
return cookie
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const getCookie = cookieName => {
|
|
225
|
+
let cookieString = RegExp('' + cookieName + '[^;]+').exec(document.cookie)
|
|
226
|
+
return unescape(!!cookieString ? cookieString.toString().replace(/^[^=]+./, '') : '')
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const deleteCookie = cookieName => {
|
|
230
|
+
const domain = getDomain()
|
|
231
|
+
document.cookie =
|
|
232
|
+
cookieName + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=' + domain + ';path=/;'
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const getDomain = () => {
|
|
236
|
+
return window.location.hostname.substring(window.location.hostname.indexOf('.') + 1)
|
|
237
|
+
}
|
|
238
|
+
const requestTimeout = (fn, delay) => {
|
|
239
|
+
var requestAnimFrame = (function() {
|
|
240
|
+
return (
|
|
241
|
+
window.requestAnimationFrame ||
|
|
242
|
+
function(callback, element) {
|
|
243
|
+
window.setTimeout(callback, 1000 / 60)
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
})(),
|
|
247
|
+
start = new Date().getTime(),
|
|
248
|
+
handle = {}
|
|
249
|
+
function loop() {
|
|
250
|
+
var current = new Date().getTime(),
|
|
251
|
+
delta = current - start
|
|
252
|
+
if (delta >= delay) {
|
|
253
|
+
fn.call()
|
|
254
|
+
} else {
|
|
255
|
+
handle.value = requestAnimFrame(loop)
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
handle.value = requestAnimFrame(loop)
|
|
259
|
+
return handle
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const replaceAnimated = (
|
|
263
|
+
elem,
|
|
264
|
+
data,
|
|
265
|
+
rescan,
|
|
266
|
+
callback,
|
|
267
|
+
timeoutDelay,
|
|
268
|
+
valueFrom,
|
|
269
|
+
valueTo,
|
|
270
|
+
easing,
|
|
271
|
+
duration
|
|
272
|
+
) => {
|
|
273
|
+
const property = 'opacity'
|
|
274
|
+
timeoutDelay = timeoutDelay || 800
|
|
275
|
+
valueFrom = valueFrom || 0.2
|
|
276
|
+
valueTo = valueTo || 1.0
|
|
277
|
+
easing = easing || 'ease-in-out'
|
|
278
|
+
duration = duration || '0.8s'
|
|
279
|
+
|
|
280
|
+
elem.style.WebkitTransition = property + ' ' + duration + ' ' + easing
|
|
281
|
+
elem.style.MozTransition = property + ' ' + duration + ' ' + easing
|
|
282
|
+
elem.style.transition = property + ' ' + duration + ' ' + easing
|
|
283
|
+
|
|
284
|
+
elem.style[property] = valueFrom
|
|
285
|
+
|
|
286
|
+
requestTimeout(function() {
|
|
287
|
+
if (data) {
|
|
288
|
+
elem.innerHTML = data
|
|
289
|
+
}
|
|
290
|
+
elem.style[property] = valueTo
|
|
291
|
+
|
|
292
|
+
if (rescan) {
|
|
293
|
+
Initializer.run(elem, loadFeature)
|
|
294
|
+
hrScriptLoad.rescanForModulesAndVariants(elem)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (callback) {
|
|
298
|
+
callback()
|
|
299
|
+
}
|
|
300
|
+
}, timeoutDelay)
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
hr$.loadScript = function(id, scriptUrl, async, callback) {
|
|
304
|
+
if (document.getElementById(id)) return
|
|
305
|
+
|
|
306
|
+
var firstScriptTagInPage = hr$('script')[0],
|
|
307
|
+
scriptTag = document.createElement('script')
|
|
308
|
+
|
|
309
|
+
scriptTag.id = id
|
|
310
|
+
scriptTag.src = scriptUrl
|
|
311
|
+
|
|
312
|
+
if (async) {
|
|
313
|
+
scriptTag.setAttribute('async', !!async)
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (callback) {
|
|
317
|
+
scriptTag.addEventListener(
|
|
318
|
+
'load',
|
|
319
|
+
function(e) {
|
|
320
|
+
callback(null, e)
|
|
321
|
+
},
|
|
322
|
+
false
|
|
323
|
+
)
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
firstScriptTagInPage.parentNode.insertBefore(scriptTag, firstScriptTagInPage)
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const loadScript = (id, scriptUrl, async, callback) => {
|
|
330
|
+
if (document.getElementById(id)) return
|
|
331
|
+
|
|
332
|
+
let firstScriptTagInPage = hr$('script')[0],
|
|
333
|
+
scriptTag = document.createElement('script')
|
|
334
|
+
|
|
335
|
+
scriptTag.id = id
|
|
336
|
+
scriptTag.src = scriptUrl
|
|
337
|
+
|
|
338
|
+
if (async) {
|
|
339
|
+
scriptTag.setAttribute('async', !!async)
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (callback) {
|
|
343
|
+
scriptTag.addEventListener(
|
|
344
|
+
'load',
|
|
345
|
+
function(e) {
|
|
346
|
+
callback(null, e)
|
|
347
|
+
},
|
|
348
|
+
false
|
|
349
|
+
)
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
firstScriptTagInPage.parentNode.insertBefore(scriptTag, firstScriptTagInPage)
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export {
|
|
356
|
+
hr$,
|
|
357
|
+
stripTags,
|
|
358
|
+
getViewportWidth,
|
|
359
|
+
isString,
|
|
360
|
+
isElementInViewport,
|
|
361
|
+
getClosestParentWithTag,
|
|
362
|
+
getNodeWithClassInPath,
|
|
363
|
+
isDescendant,
|
|
364
|
+
debounce,
|
|
365
|
+
throttle,
|
|
366
|
+
once,
|
|
367
|
+
listen,
|
|
368
|
+
unlisten,
|
|
369
|
+
listenOnce,
|
|
370
|
+
fireEvent,
|
|
371
|
+
inIframe,
|
|
372
|
+
setCookie,
|
|
373
|
+
setJSONCookie,
|
|
374
|
+
getJSONCookie,
|
|
375
|
+
getCookie,
|
|
376
|
+
deleteCookie,
|
|
377
|
+
requestTimeout,
|
|
378
|
+
replaceAnimated,
|
|
379
|
+
loadScript
|
|
380
|
+
}
|