mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-05-15 16:01:07 -04:00
Fixed xml import/export in Playground
This commit is contained in:
parent
771f18e23b
commit
41082a76cd
2 changed files with 3 additions and 3 deletions
|
@ -56,7 +56,7 @@ var VirtualMachine = require('scratch-vm');
|
||||||
var vm = new VirtualMachine();
|
var vm = new VirtualMachine();
|
||||||
|
|
||||||
// Block events
|
// Block events
|
||||||
workspace.addChangeListener(vm.blockListener);
|
Scratch.workspace.addChangeListener(vm.blockListener);
|
||||||
|
|
||||||
// Run threads
|
// Run threads
|
||||||
vm.start();
|
vm.start();
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
<script>
|
<script>
|
||||||
function toXml() {
|
function toXml() {
|
||||||
var output = document.getElementById('importExport');
|
var output = document.getElementById('importExport');
|
||||||
var xml = Blockly.Xml.workspaceToDom(workspace);
|
var xml = Blockly.Xml.workspaceToDom(Scratch.workspace);
|
||||||
output.value = Blockly.Xml.domToPrettyText(xml);
|
output.value = Blockly.Xml.domToPrettyText(xml);
|
||||||
output.focus();
|
output.focus();
|
||||||
output.select();
|
output.select();
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
function fromXml() {
|
function fromXml() {
|
||||||
var input = document.getElementById('importExport');
|
var input = document.getElementById('importExport');
|
||||||
var xml = Blockly.Xml.textToDom(input.value);
|
var xml = Blockly.Xml.textToDom(input.value);
|
||||||
Blockly.Xml.domToWorkspace(workspace, xml);
|
Blockly.Xml.domToWorkspace(Scratch.workspace, xml);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue