Update index.js

This commit is contained in:
TheBrokenRail 2016-12-04 08:39:22 -05:00 committed by GitHub
parent c4750d64b6
commit a58bcb93e6

View file

@ -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) {