aboutsummaryrefslogtreecommitdiff
path: root/js/document/html-document.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/document/html-document.js')
-rwxr-xr-xjs/document/html-document.js64
1 files changed, 22 insertions, 42 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 05c7d6c0..46fefd90 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -208,49 +208,29 @@ exports.HTMLDocument = Montage.create(TextDocument, {
208 var elt = this.documentRoot; 208 var elt = this.documentRoot;
209 if (elt) 209 if (elt)
210 { 210 {
211// FOR JOSE: The following commented out lines are what the runtime 211 var nWorlds= value.length;
212// version should execute. 212 for (var i=0; i<nWorlds; i++) {
213// var loadForRuntime = true; 213 var importStr = value[i];
214// if (loadForRuntime) 214 var startIndex = importStr.indexOf("id: ");
215// { 215 if (startIndex >= 0) {
216// var cdm = new CanvasDataManager(); 216 var endIndex = importStr.indexOf("\n", startIndex);
217// cdm.loadGLData(elt, value ); 217 if (endIndex > 0) {
218// } 218 var id = importStr.substring( startIndex+4, endIndex);
219// else 219 if (id) {
220 { 220 var canvas = this.findCanvasWithID(id, elt);
221 var nWorlds= value.length; 221 if (canvas) {
222 for (var i=0; i<nWorlds; i++) 222 if (!canvas.elementModel) {
223 { 223 NJUtils.makeElementModel(canvas, "Canvas", "shape", true);
224 var importStr = value[i]; 224 }
225 var startIndex = importStr.indexOf( "id: " ); 225 if (canvas.elementModel) {
226 if (startIndex >= 0) 226 if (canvas.elementModel.shapeModel.GLWorld) {
227 { 227 canvas.elementModel.shapeModel.GLWorld.clearTree();
228 var endIndex = importStr.indexOf( "\n", startIndex );
229 if (endIndex > 0)
230 {
231 var id = importStr.substring( startIndex+4, endIndex );
232 if (id)
233 {
234 var canvas = this.findCanvasWithID( id, elt );
235 if (canvas)
236 {
237 if (!canvas.elementModel)
238 {
239 NJUtils.makeElementModel(canvas, "Canvas", "shape", true);
240 }
241
242 if (canvas.elementModel)
243 {
244 if (canvas.elementModel.shapeModel.GLWorld)
245 canvas.elementModel.shapeModel.GLWorld.clearTree();
246
247 var index = importStr.indexOf( "webGL: " );
248 var useWebGL = (index >= 0)
249 var world = new GLWorld( canvas, useWebGL );
250 world.import( importStr );
251
252 this.buildShapeModel( canvas.elementModel, world );
253 } 228 }
229 var index = importStr.indexOf( "webGL: " );
230 var useWebGL = (index >= 0)
231 var world = new GLWorld(canvas, useWebGL);
232 world.import( importStr );
233 this.buildShapeModel(canvas.elementModel, world);
254 } 234 }
255 } 235 }
256 } 236 }