aboutsummaryrefslogtreecommitdiff
path: root/js/document/views/design.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/document/views/design.js')
-rwxr-xr-xjs/document/views/design.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js
index 3f58650e..b3887fdf 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -324,7 +324,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
324 initWebGl: { 324 initWebGl: {
325 value: function (scripttags) { 325 value: function (scripttags) {
326 // 326 //
327 var n, webgldata; 327 var n, webgldata, fileRead;
328 //Setting the iFrame property for reference in helper class 328 //Setting the iFrame property for reference in helper class
329 this.model.webGlHelper.iframe = this.model.views.design.iframe; 329 this.model.webGlHelper.iframe = this.model.views.design.iframe;
330 //Checking for webGL Data 330 //Checking for webGL Data
@@ -333,9 +333,18 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
333 webgldata = null; 333 webgldata = null;
334 //Checking for tags with webGL data 334 //Checking for tags with webGL data
335 if (scripttags[w].getAttribute) { 335 if (scripttags[w].getAttribute) {
336 if (scripttags[w].getAttribute('data-ninja-webgl') !== null) { 336 if (scripttags[w].getAttribute('data-ninja-canvas') !== null) {
337 //TODO: Add logic to handle more than one data tag 337 //TODO: Add logic to handle more than one data tag
338 webgldata = JSON.parse((scripttags[w].innerHTML.replace("(", "")).replace(")", "")); 338 webgldata = JSON.parse((scripttags[w].innerHTML.replace("(", "")).replace(")", ""));
339 } else if (scripttags[w].getAttribute('data-ninja-canvas-json') !== null) {
340 //TODO: Add check for hardcoded URL
341 fileRead = this.application.ninja.ioMediator.fio.readFile({uri: this.application.ninja.documentController.documentHackReference.root+scripttags[w].getAttribute('data-ninja-canvas-json')});
342 //
343 if (fileRead.status === 204) {
344 webgldata = JSON.parse((fileRead.file.content.replace("(", "")).replace(")", ""));
345 } else {
346 //Error
347 }
339 } 348 }
340 //Checking for webGL data and building data array 349 //Checking for webGL data and building data array
341 if (webgldata && webgldata.data) { 350 if (webgldata && webgldata.data) {