diff options
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/html-document.js | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js index 0dc26884..79450494 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js | |||
@@ -9,7 +9,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
9 | var Montage = require("montage/core/core").Montage, | 9 | var Montage = require("montage/core/core").Montage, |
10 | TextDocument = require("js/document/text-document").TextDocument, | 10 | TextDocument = require("js/document/text-document").TextDocument, |
11 | NJUtils = require("js/lib/NJUtils").NJUtils, | 11 | NJUtils = require("js/lib/NJUtils").NJUtils, |
12 | CanvasDataManager = require("js/lib/rdge/runtime/CanvasDataManager").CanvasDataManager, | ||
13 | GLWorld = require("js/lib/drawing/world").World; | 12 | GLWorld = require("js/lib/drawing/world").World; |
14 | //////////////////////////////////////////////////////////////////////// | 13 | //////////////////////////////////////////////////////////////////////// |
15 | // | 14 | // |
@@ -189,35 +188,36 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
189 | // }, | 188 | // }, |
190 | 189 | ||
191 | glData: { | 190 | glData: { |
192 | get: function() | 191 | get: function() { |
193 | { | 192 | // |
194 | var elt = this.iframe.contentWindow.document.getElementById("UserContent"); | 193 | var elt = this.iframe.contentWindow.document.getElementById("UserContent"); |
195 | this._glData = null; | 194 | // |
196 | if (elt) | 195 | if (elt) { |
197 | { | ||
198 | var cdm = new CanvasDataManager(); | ||
199 | this._glData = []; | 196 | this._glData = []; |
200 | cdm.collectGLData( elt, this._glData ); | 197 | //if (path) { |
198 | //this.collectGLData(elt, this._glData, path); | ||
199 | //} else { | ||
200 | this.collectGLData(elt, this._glData ); | ||
201 | //} | ||
202 | } else { | ||
203 | this._glData = null | ||
201 | } | 204 | } |
202 | 205 | // | |
203 | return this._glData; | 206 | return this._glData; |
204 | }, | 207 | }, |
205 | 208 | set: function(value) { | |
206 | set: function(value) | ||
207 | { | ||
208 | var elt = this.documentRoot; | 209 | var elt = this.documentRoot; |
209 | if (elt) | 210 | if (elt) { |
210 | { | ||
211 | var nWorlds= value.length; | 211 | var nWorlds= value.length; |
212 | for (var i=0; i<nWorlds; i++) { | 212 | for (var i=0; i<nWorlds; i++) { |
213 | var importStr = value[i]; | 213 | var importStr = value[i]; |
214 | var startIndex = importStr.indexOf("id: "); | 214 | var startIndex = importStr.indexOf( "id: " ); |
215 | if (startIndex >= 0) { | 215 | if (startIndex >= 0) { |
216 | var endIndex = importStr.indexOf("\n", startIndex); | 216 | var endIndex = importStr.indexOf( "\n", startIndex ); |
217 | if (endIndex > 0) { | 217 | if (endIndex > 0) { |
218 | var id = importStr.substring( startIndex+4, endIndex); | 218 | var id = importStr.substring( startIndex+4, endIndex ); |
219 | if (id) { | 219 | if (id) { |
220 | var canvas = this.findCanvasWithID(id, elt); | 220 | var canvas = this.findCanvasWithID( id, elt ); |
221 | if (canvas) { | 221 | if (canvas) { |
222 | if (!canvas.elementModel) { | 222 | if (!canvas.elementModel) { |
223 | NJUtils.makeElementModel(canvas, "Canvas", "shape", true); | 223 | NJUtils.makeElementModel(canvas, "Canvas", "shape", true); |
@@ -228,9 +228,9 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
228 | } | 228 | } |
229 | var index = importStr.indexOf( "webGL: " ); | 229 | var index = importStr.indexOf( "webGL: " ); |
230 | var useWebGL = (index >= 0) | 230 | var useWebGL = (index >= 0) |
231 | var world = new GLWorld(canvas, useWebGL); | 231 | var world = new GLWorld( canvas, useWebGL ); |
232 | world.import( importStr ); | 232 | world.import( importStr ); |
233 | this.buildShapeModel(canvas.elementModel, world); | 233 | this.buildShapeModel( canvas.elementModel, world ); |
234 | } | 234 | } |
235 | } | 235 | } |
236 | } | 236 | } |