From 5c48ff38fcab247c0bb20529410f634f4b1e9bec Mon Sep 17 00:00:00 2001 From: Helmut Hackbarth Date: Wed, 14 Jul 2021 13:34:11 +0200 Subject: [PATCH] NEW option ... ... to include inline vanilla JS. The asset should have the following identifier: vanilla_xxx or vanillaCustom ... --- Classes/EventListener/AssetRenderer/IsInline.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/EventListener/AssetRenderer/IsInline.php b/Classes/EventListener/AssetRenderer/IsInline.php index d2c0e0e5..1a5f15e5 100644 --- a/Classes/EventListener/AssetRenderer/IsInline.php +++ b/Classes/EventListener/AssetRenderer/IsInline.php @@ -83,7 +83,7 @@ public function __invoke(BeforeJavaScriptsRenderingEvent $event): void foreach ($assetJsInline as $library => $source) { - if ($library == 'lazyload' || $library == 'lazyloadmagnifying' || $library == 'codesnippetJsInline' ) { + if ($library == 'lazyload' || $library == 'lazyloadmagnifying' || $library == 'codesnippetJsInline' || substr($library, 0, 7) == 'vanilla' ) { $js .= $source['source'] .PHP_EOL; $event->getAssetCollector()->removeInlineJavaScript($library); } elseif ( GeneralUtility::isFirstPartOfStr($library, 'background-video-') ) { @@ -129,4 +129,4 @@ public function __invoke(BeforeJavaScriptsRenderingEvent $event): void } } } -} \ No newline at end of file +}