Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support of script_startup together with script #15

Merged
merged 1 commit into from Nov 22, 2019

Conversation

stepansnigirev
Copy link

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 the script to lvgl_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 with script and script_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. If comment is present in the object it will add the corresponding comment before the script.

} catch(e) {
error_handler();
return;
}

external_link = url;
// last url is probably the important one
external_link = url[url.length-1].url;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: As far as I know external_link does nothing anymore, so all of the lines referring to it (and prev_external_link) can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants