aboutsummaryrefslogtreecommitdiff
path: root/js/document/views/design.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-22 14:47:17 -0700
committerValerio Virgillito2012-05-22 14:47:17 -0700
commitb3e85f609f704d668c8022c53418f8056bc71260 (patch)
tree122197204fff1b8adccfc089d6e6869e8c310550 /js/document/views/design.js
parent9b6da637d9654727426c6d78f17e3804bbd84ce5 (diff)
parentc5dad8ddc94b2e1c80565dfee072bda88e8880da (diff)
downloadninja-b3e85f609f704d668c8022c53418f8056bc71260.tar.gz
Merge pull request #250 from joseeight/Document
Montage components mapping & External data webGL support
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) {