-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFile.fusion
More file actions
75 lines (68 loc) · 2.8 KB
/
File.fusion
File metadata and controls
75 lines (68 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* This prototype outputs the tag for including HTML, JS, MJS or CSS
*/
prototype(Carbon.IncludeAssets:File) < prototype(Neos.Fusion:Component) {
@propTypes {
file = ${PropTypes.string}
assetPackage = ${PropTypes.string}
cacheBuster = ${PropTypes.boolean}
disableCacheBusterForPreloadAsset = ${PropTypes.boolean}
assetPath = ${PropTypes.string}
wrapper = ${PropTypes.string}
}
file = ${null}
assetPackage = Carbon.IncludeAssets:SiteResourcesPackageKey
cacheBuster = ${Configuration.setting('Carbon.IncludeAssets.Default.CacheBuster')}
disableCacheBusterForPreloadAsset = ${Configuration.setting('Carbon.IncludeAssets.Default.DisableCacheBusterForPreloadAsset')}
assetPath = ${null}
wrapper = ${null}
paths = ${Configuration.setting('Carbon.IncludeAssets.Default.Path')}
inBackend = Carbon.IncludeAssets:InBackend
cached = false
@if.fileIsSet = ${this.file}
@private {
fileObject = ${Carbon.IncludeAssets.parseFilename(props.file)}
assetKey = ${private.fileObject.inline ? 'Inline' : 'File'}
type = ${private.fileObject.type}
isPlain = ${private.type == 'PLAIN'}
finalAssetPath = Neos.Fusion:Case {
assetPath {
condition = ${props.assetPath}
renderer = ${props.assetPath}
}
cached {
condition = ${props.cached}
renderer = ${props.paths['Cached'][private.assetKey]}
}
default {
condition = true
renderer = ${props.paths[private.assetKey][private.type]}
}
}
fileCaseProps = Neos.Fusion:DataStructure {
isPlain = ${private.isPlain}
path = ${private.fileObject.external || private.fileObject.path ? private.fileObject.filename : props.assetPackage && private.finalAssetPath ? 'resource://' + props.assetPackage + '/' + private.finalAssetPath + '/' + private.fileObject.filename : false}
path.@if.isNotPlain = ${!private.isPlain}
wrapper = ${props.wrapper}
fileObject = ${private.fileObject}
type = ${private.type}
cacheBuster = ${props.cacheBuster}
inBackend = ${props.inBackend}
disableCacheBusterForPreloadAsset = ${props.disableCacheBusterForPreloadAsset}
}
}
renderer = Neos.Fusion:Case {
cached {
condition = ${props.cached}
renderer = Carbon.IncludeAssets:Internal.FileCase.Cached {
@apply.fileCaseProps = ${private.fileCaseProps}
}
}
default {
condition = true
renderer = Carbon.IncludeAssets:Internal.FileCase {
@apply.fileCaseProps = ${private.fileCaseProps}
}
}
}
}