Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify the Bug or Feature request
resolves #3551
resolves #3552
resolves #3553
Description of the Change
Adds JavaScript for each add-on, and allows add-ons to run JavaScript files for the add-on 'onFirstInit' and 'onInit' events.
Also adds the macro script command
js.listNS
to list available JavaScript contexts. This will not list the contexts created for add-ons.The onInit/onFirstInit + add-on javascript context can be tested with the following add on, adding it should print to the log (there is not really a way to access it yet so the log output is best way)
test-add-on.zip
Possible Drawbacks
None foreseeable.
Documentation Notes
For JavaScript Add-On contexts
https://docs.rptools.info/docs/add-ons/java-script#javascript-context
For running JavaScript on events
https://docs.rptools.info/docs/add-ons/creation/#format-of-the-events-configuration-file
For js.listNS
usage:
[r: js.listNS()]
Release Notes
This change is