aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
Diffstat (limited to 'assets')
-rw-r--r--assets/canvas-runtime.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js
index dd4ad6f9..adff0e8c 100644
--- a/assets/canvas-runtime.js
+++ b/assets/canvas-runtime.js
@@ -37,15 +37,25 @@ function CanvasDataManager()
37 for (var i=0; i<nWorlds; i++) 37 for (var i=0; i<nWorlds; i++)
38 { 38 {
39 var importStr = value[i]; 39 var importStr = value[i];
40 var jObj = JSON.parse( importStr );
41 40
42 var id = jObj.id; 41 // there should be some version information in
43 if (id) 42 // the form of 'v0.0;' Pull that off. (the trailing ';' should
43 // be in the first 24 characters).
44 var index = importStr.indexOf( ';' );
45 if ((importStr[0] === 'v') && (index < 24))
44 { 46 {
45 var canvas = this.findCanvasWithID( id, root ); 47 // JSON format. pull off the version info
46 if (canvas) 48 importStr = importStr.substr( index+1 );
49
50 var jObj = JSON.parse( importStr );
51 var id = jObj.id;
52 if (id)
47 { 53 {
48 new GLRuntime( canvas, jObj, assetPath ); 54 var canvas = this.findCanvasWithID( id, root );
55 if (canvas)
56 {
57 new GLRuntime( canvas, jObj, assetPath );
58 }
49 } 59 }
50 } 60 }
51 } 61 }