This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsave open project blocks.xml
16 lines (16 loc) · 2.75 KB
/
save open project blocks.xml
1
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="save project %'project name'" type="command" category="other"><comment x="0" y="0" w="330" collapsed="false">Saves a project to the browser's memory.</comment><header></header><code></code><inputs><input type="%txt"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>save_project</l><list><block var="project name"/></list></custom-block></script></block-definition><block-definition s="open project %'project name'" type="command" category="other"><comment x="0" y="0" w="284" collapsed="false">Replaces the current project with the one named 'project name' in the browser's memory.</comment><header></header><code></code><inputs><input type="%txt"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>open_project</l><list><block var="project name"/></list></custom-block></script></block-definition><block-definition s="run eCraft2Learn command %'command name' with %'inputs'" type="command" category="other"><header></header><code></code><inputs><input type="%txt"></input><input type="%mult%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>function_name</l><l>parameters</l></list><l>if (typeof ecraft2learn === 'object') {


 ecraft2learn.run(function_name, parameters);


} else {


 var script = document.createElement("script");


 script.type = "text/javascript";


 script.src = "https://toontalk.github.io/ai-cloud/ecraft2learn.js";


 script.addEventListener('load', function () {


 ecraft2learn.run(function_name, parameters);


 });


 document.head.appendChild(script);


}</l></block><list><block var="command name"/><block var="inputs"/></list></block></script></block-definition><block-definition s="call eCraft2Learn reporter %'reporter name' with %'inputs'" type="reporter" category="other"><header></header><code></code><inputs><input type="%txt"></input><input type="%mult%s"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>function_name</l><l>parameters</l></list><l>if (typeof ecraft2learn === 'object') {


 return ecraft2learn.run(function_name, parameters);


} else {


 alert("Any eCraft2Learn command must be run before the " + function_name + " reporter.");


 return 0;


}</l></block><list><block var="reporter name"/><block var="inputs"/></list></block></block></script></block-definition></blocks>