From 5da69dfd30f353ff753cba9322744e2f33f32a1a Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 9 Mar 2012 13:36:15 -0800 Subject: Adding missing file for webGL, still need a fix for runtime --- js/mediators/io-mediator.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 277b3a1b..ffae0192 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -361,7 +361,7 @@ exports.IoMediator = Montage.create(Component, { } } // - var json, matchingtags = [], webgltag, scripts = template.document.content.document.getElementsByTagName('script'), webgljstag, webgllibtag; + var json, matchingtags = [], webgltag, scripts = template.document.content.document.getElementsByTagName('script'), webgljstag, webgllibtag, webglrdgetag; // for (var i in scripts) { if (scripts[i].getAttribute) { @@ -374,6 +374,9 @@ exports.IoMediator = Montage.create(Component, { if (scripts[i].getAttribute('data-ninja-webgl-lib') !== null) { webgllibtag = scripts[i]; // TODO: Add logic to delete unneccesary tags } + if (scripts[i].getAttribute('data-ninja-webgl-rdge') !== null) { + webglrdgetag = scripts[i]; // TODO: Add logic to delete unneccesary tags + } } } // @@ -386,6 +389,14 @@ exports.IoMediator = Montage.create(Component, { } } // + if (!webglrdgetag) { + webglrdgetag = template.document.content.document.createElement('script'); + webglrdgetag.setAttribute('type', 'text/javascript'); + webglrdgetag.setAttribute('src', rdgeDirName+'/rdge-compiled.js'); + webglrdgetag.setAttribute('data-ninja-webgl-rdge', 'true'); + template.document.content.document.head.appendChild(webglrdgetag); + } + // if (!webgllibtag) { webgllibtag = template.document.content.document.createElement('script'); webgllibtag.setAttribute('type', 'text/javascript'); @@ -421,7 +432,7 @@ function initWebGl (e) {\n\ //Creating data manager\n\ cvsDataMngr = new CanvasDataManager();\n\ //Loading data to canvas(es)\n\ - cvsDataMngr.loadGLData(document.body, ninjaWebGlData.data);\n\ + cvsDataMngr.loadGLData(document.body, ninjaWebGlData.data, '"+rdgeDirName+"/');\n\ }\ "; //TODO: Add version and other data for RDGE @@ -437,11 +448,14 @@ function initWebGl (e) {\n\ //Closing array (make-shift JSON string to validate data in