netlogix / eel-javascript
Neos Eel Helper to embed inline JavaScript
Installs: 1 659
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Type:neos-package
Requires
- matthiasmullie/minify: ^1.3
- neos/eel: ^7.3 || ^8.3
- neos/flow: ^7.3 || ^8.3
- neos/fusion: ^7.3 || ^8.3
This package is auto-updated.
Last update: 2024-11-04 08:59:09 UTC
README
Neos Eel Helper to embed inline JavaScript from files.
Installation
composer require netlogix/eel-javascript
Usage
You can use the JavaScriptHelper in your Fusion files like this:
Scripts without Variables
To include scripts that don't require external variables, you can use the embed
method.
script = ${Netlogix.JavaScript.embed('resource://Netlogix.Eel.JavaScript/Private/ScriptWithVars.js')}
Scripts with Variables
To include scripts that require external variables, you can use the embedWithVariables
method.
scriptWithVars = ${Netlogix.JavaScript.embedWithVariables('resource://Netlogix.Eel.JavaScript/Private/ScriptWithVars.js', {'someVariableName': 'someValue'})}
This will prefix the included javascript file with the variables passed to the method:
var someVariable= 'someValue'; /// ... your script ScriptWithVars.js