ScriptCraft
ScriptCraft copied to clipboard
Scratchpad support
My kids are loving the things they can build now, so thanks first of all. I'm trying to graduate them to more lengthy programs that reasonably fit in the console. But as I do it now, I have to edit the file, upload it to the server, reload, etc. etc. It would seem like it would be much easier to set some variable, like "serverScript" and then run /js run(serverScript) and have it fetch that URL and run the script as if I had typed it in the console. Then I could use something like http://jsfiddle.net/ as the editor and not worry about saving. This kind of iterative development could obviously significantly improve learning speed. Thoughts?
or put another way - are you able to reach out to the network from within a JS fn? If so then I suppose I can just write this fn myself.
Hi Max, You could use https://github.com/walterhiggins/ScriptCraft/blob/master/docs/API-Reference.md#http-module
I don't recommend running code from public servers for security reasons. I'll never make this easy in scriptcraft as it's potentially dangerous.
Walter
On Wed, Sep 24, 2014 at 6:01 PM, Max Metral [email protected] wrote:
or put another way - are you able to reach out to the network from within a JS fn? If so then I suppose I can just write this fn myself.
— Reply to this email directly or view it on GitHub https://github.com/walterhiggins/ScriptCraft/issues/157#issuecomment-56703494 .
Walter Higgins Mobile: (+353) 086 8511600 Website: http://walterhiggins.net/
Makes sense. I'll try to mash up http://ace.c9.io/ and this and see if I can get some autocomplete support too.
To confirm - is each /js command in its own closure or it's one big closure?
each /js command is in the same single global closure (one big closure). Be careful. Have you looked at https://github.com/walterhiggins/ScriptCraft/blob/master/docs/API-Reference.md#classroom-plugin
Walter
On Wed, Sep 24, 2014 at 6:14 PM, Max Metral [email protected] wrote:
To confirm - is each /js command in its own closure or it's one big closure?
— Reply to this email directly or view it on GitHub https://github.com/walterhiggins/ScriptCraft/issues/157#issuecomment-56705554 .
Walter Higgins Mobile: (+353) 086 8511600 Website: http://walterhiggins.net/
I used an inverse approach a while ago: a small python+bottle based web server provided a browser based javascript editor. My kids could then edit and save scripts to directly to the server.
@jmbjorndalen I'm interested in hearing about the approach you took. Have you blogged about it?
@walterhiggins No, I haven't written anything about it. I haven't used it in a while, but I can have a look at it and see if I can get it running again.
@walterhiggins No blog entry yet, but I've made a github repository of a (trimmed version of) the code. https://github.com/jmbjorndalen/scedit
The Gnacraft project use something based on blocks. http://code.gnancraft.net/edit/ I don't know what they used but feel free to ask them.