Merge pull request #524 from rasmushaglund/fix-import-export
Fixed xml import/export in Playground
This commit is contained in:
commit
79bf68aa61
2 files changed
+3
-3
No files matched your search
@@ -56,7 +56,7 @@ var VirtualMachine = require('scratch-vm');
|
||||
var vm = new VirtualMachine();
|
||||
|
||||
// Block events
|
||||
workspace.addChangeListener(vm.blockListener);
|
||||
Scratch.workspace.addChangeListener(vm.blockListener);
|
||||
|
||||
// Run threads
|
||||
vm.start();
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<script>
|
||||
function toXml() {
|
||||
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.focus();
|
||||
output.select();
|
||||
@@ -81,7 +81,7 @@
|
||||
function fromXml() {
|
||||
var input = document.getElementById('importExport');
|
||||
var xml = Blockly.Xml.textToDom(input.value);
|
||||
Blockly.Xml.domToWorkspace(workspace, xml);
|
||||
Blockly.Xml.domToWorkspace(Scratch.workspace, xml);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user