2016-06-01 10:04:56 -04:00
|
|
|
<!doctype html>
|
|
|
|
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Scratch VM Playground</title>
|
|
|
|
<link rel="stylesheet" href="playground.css">
|
2016-09-24 18:11:01 -04:00
|
|
|
<link rel="stylesheet" href="zenburn.css">
|
2016-06-01 10:04:56 -04:00
|
|
|
</head>
|
|
|
|
<body>
|
2016-06-01 10:18:08 -04:00
|
|
|
<div id="vm-devtools">
|
2016-06-01 14:17:18 -04:00
|
|
|
<h2>Scratch VM Playground</h2>
|
2016-08-31 12:28:44 -04:00
|
|
|
<select id="selectedTarget" multiple></select>
|
2016-09-13 18:09:43 -04:00
|
|
|
<div id="projectButtons">
|
|
|
|
<button id="greenflag">Green flag</button>
|
|
|
|
<button id="stopall">Stop</button>
|
|
|
|
</div>
|
|
|
|
<br />
|
|
|
|
<ul id="playgroundLinks">
|
|
|
|
<li><a id="renderexplorer-link" href="#">Renderer</a></li>
|
|
|
|
<li><a id="threadexplorer-link" href="#">Threads</a></li>
|
|
|
|
<li><a id="blockexplorer-link" href="#">Block Representation</a></li>
|
|
|
|
<li><a id="importexport-link" href="#">Import/Export</a></li>
|
|
|
|
</ul><br />
|
2016-06-29 20:56:55 -04:00
|
|
|
<div id="tab-renderexplorer">
|
2016-09-13 18:09:43 -04:00
|
|
|
Renderer<br />
|
|
|
|
<canvas id="scratch-stage" style="width: 480px; height: 360px;"></canvas><br />
|
2016-06-29 20:56:55 -04:00
|
|
|
</div>
|
2016-06-07 20:44:08 -04:00
|
|
|
<div id="tab-threadexplorer">
|
|
|
|
Thread explorer
|
|
|
|
<pre id="threadexplorer"></pre>
|
|
|
|
</div>
|
2016-06-01 10:18:08 -04:00
|
|
|
<div id="tab-blockexplorer">
|
2016-06-07 20:44:08 -04:00
|
|
|
Block explorer
|
2016-06-01 10:47:47 -04:00
|
|
|
<pre id="blockexplorer"></pre>
|
2016-06-01 10:18:08 -04:00
|
|
|
</div>
|
2016-09-02 08:27:43 -04:00
|
|
|
<div id="tab-importexport">
|
2016-09-13 18:09:43 -04:00
|
|
|
Import/Export<br />
|
|
|
|
Project ID: <input id="projectId" value="119615668" />
|
2016-09-15 19:02:03 -04:00
|
|
|
<button id="projectLoadButton">Load</button>
|
|
|
|
<button id="createEmptyProject">New Project</button><br />
|
2016-09-02 08:27:43 -04:00
|
|
|
<p>
|
|
|
|
<input type="button" value="Export to XML" onclick="toXml()">
|
|
|
|
|
|
|
|
<input type="button" value="Import from XML" onclick="fromXml()" id="import">
|
2016-09-13 18:09:43 -04:00
|
|
|
<br /><br />
|
2016-09-02 08:41:12 -04:00
|
|
|
<textarea id="importExport"></textarea>
|
2016-09-02 08:27:43 -04:00
|
|
|
</p>
|
|
|
|
</div>
|
2016-06-01 10:18:08 -04:00
|
|
|
</div>
|
2016-08-31 12:28:44 -04:00
|
|
|
|
2016-06-01 10:04:56 -04:00
|
|
|
<div id="blocks"></div>
|
2016-06-01 10:18:08 -04:00
|
|
|
|
2016-09-24 18:11:01 -04:00
|
|
|
<!-- FPS counter, Syntax highlighter, Blocks, Renderer -->
|
|
|
|
<script src="./vendor.js"></script>
|
2016-06-21 15:30:36 -04:00
|
|
|
<!-- VM Worker -->
|
2016-09-24 18:11:01 -04:00
|
|
|
<script src="./vm.js"></script>
|
2016-06-01 10:04:56 -04:00
|
|
|
<!-- Playground -->
|
|
|
|
<script src="./playground.js"></script>
|
2016-09-27 18:12:20 -04:00
|
|
|
<!-- Audio -->
|
2016-09-27 18:18:15 -04:00
|
|
|
<script src="./AudioEngine.js"></script>
|
|
|
|
<script src="./Tone.min.js"></script>
|
2016-09-28 13:20:51 -04:00
|
|
|
<script src="./soundfont-player.min.js"></script>
|
2016-09-02 08:27:43 -04:00
|
|
|
<script>
|
|
|
|
function toXml() {
|
|
|
|
var output = document.getElementById('importExport');
|
|
|
|
var xml = Blockly.Xml.workspaceToDom(workspace);
|
|
|
|
output.value = Blockly.Xml.domToPrettyText(xml);
|
|
|
|
output.focus();
|
|
|
|
output.select();
|
|
|
|
}
|
2016-09-06 11:46:10 -04:00
|
|
|
|
2016-09-02 08:27:43 -04:00
|
|
|
function fromXml() {
|
|
|
|
var input = document.getElementById('importExport');
|
|
|
|
var xml = Blockly.Xml.textToDom(input.value);
|
|
|
|
Blockly.Xml.domToWorkspace(workspace, xml);
|
|
|
|
}
|
|
|
|
</script>
|
2016-06-01 10:04:56 -04:00
|
|
|
</body>
|
|
|
|
</html>
|