add support of script_startup together with script #15
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.
Relevant discussion here:
https://forum.littlevgl.com/t/examples-for-lvgl-in-micropython/1190/26
With this pull request an optional parameter
script_startup
can be passed alongside with thescript
tolvgl_editor.html
, for example:https://stepansnigirev.github.io/sim/lvgl_editor.html?script_startup=https://gist.githubusercontent.com/stepansnigirev/d360caaca643a17989b1b41ceef417d1/raw&script=https://raw.githubusercontent.com/stepansnigirev/lv_examples/rework/src/lv_ex_chart/lv_ex_chart_1.py
I renamed a parameter to
script_startup
for consistency withscript
andscript_direct
.The
processScriptArg
function is changed to be extendable to more scripts in the future if we want to. The first argument of the function can be an url string, then it works as before, or it can be an array of objects, then all of them will be loaded and combined to the editor window. Ifcomment
is present in the object it will add the corresponding comment before the script.