/** * 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} } } } }