mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-25 15:32:40 -05:00
Update index.js
This commit is contained in:
parent
c4750d64b6
commit
a58bcb93e6
1 changed files with 5 additions and 1 deletions
|
@ -155,13 +155,17 @@ VirtualMachine.prototype.loadProject = function (json) {
|
||||||
this.runtime.setEditingTarget(this.editingTarget);
|
this.runtime.setEditingTarget(this.editingTarget);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
VirtualMachine.prototype.toPrettyJSON = function () {
|
||||||
|
return JSON.stringify(this.toJSON(), null, 4);
|
||||||
|
}
|
||||||
|
|
||||||
VirtualMachine.prototype.toJSON = function () {
|
VirtualMachine.prototype.toJSON = function () {
|
||||||
var obj = new Object();
|
var obj = new Object();
|
||||||
obj.sprites = this.runtime.targets;
|
obj.sprites = this.runtime.targets;
|
||||||
obj.meta = new Object();
|
obj.meta = new Object();
|
||||||
obj.meta.name = 'WIP';
|
obj.meta.name = 'WIP';
|
||||||
obj.meta.useragent = navigator.userAgent;
|
obj.meta.useragent = navigator.userAgent;
|
||||||
return JSON.stringify(obj, null, 2);
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
VirtualMachine.prototype.fromJSON = function (json) {
|
VirtualMachine.prototype.fromJSON = function (json) {
|
||||||
|
|
Loading…
Reference in a new issue