mirror of
https://github.com/typemill/typemill.git
synced 2025-01-16 21:08:20 +01:00
Merge pull request #502 from josefpavlik/figureSwipe_plugin
addJS and addInlineJS allow to specify attributes for tag <script>
This commit is contained in:
commit
a6c29a01c0
@ -82,19 +82,19 @@ class Assets
|
||||
$this->inlineCSS[] = '<style>' . $CSS . '</style>';
|
||||
}
|
||||
|
||||
public function addJS($JS)
|
||||
public function addJS($JS, $attr)
|
||||
{
|
||||
$JSfile = $this->getFileUrl($JS);
|
||||
|
||||
if($JSfile)
|
||||
{
|
||||
$this->JS[] = '<script src="' . $JSfile . '"></script>';
|
||||
$this->JS[] = '<script ' . $attr . ' src="' . $JSfile . '"></script>';
|
||||
}
|
||||
}
|
||||
|
||||
public function addInlineJS($JS)
|
||||
public function addInlineJS($JS, $attr)
|
||||
{
|
||||
$this->inlineJS[] = '<script>' . $JS . '</script>';
|
||||
$this->inlineJS[] = '<script' . $attr . '>' . $JS . '</script>';
|
||||
}
|
||||
|
||||
public function addBloxConfigJS($JS)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user