From 0412ea7cf99773e1de6c86a34ae775640f8038c3 Mon Sep 17 00:00:00 2001 From: Josef Pavlik Date: Fri, 20 Dec 2024 17:45:51 +0100 Subject: [PATCH] addJS and addInlineJS allow to specify attributes for tag '; + $this->JS[] = ''; } } - public function addInlineJS($JS) + public function addInlineJS($JS, $attr) { - $this->inlineJS[] = ''; + $this->inlineJS[] = '' . $JS . ''; } public function addBloxConfigJS($JS) diff --git a/system/typemill/Plugin.php b/system/typemill/Plugin.php index 49cff29..709a618 100644 --- a/system/typemill/Plugin.php +++ b/system/typemill/Plugin.php @@ -201,14 +201,14 @@ abstract class Plugin implements EventSubscriberInterface $this->container->get('view')->getEnvironment()->addFunction($function); } - protected function addJS($JS) + protected function addJS($JS, $attr="") { - $this->container->get('assets')->addJS($JS); + $this->container->get('assets')->addJS($JS, $attr); } - protected function addInlineJS($JS) + protected function addInlineJS($JS, $attr="") { - $this->container->get('assets')->addInlineJS($JS); + $this->container->get('assets')->addInlineJS($JS, $attr); } protected function addBloxConfigJS($JS)