aboutsummaryrefslogtreecommitdiff
path: root/js/mediators
diff options
context:
space:
mode:
Diffstat (limited to 'js/mediators')
-rw-r--r--js/mediators/io-mediator.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js
index c22d95be..277b3a1b 100644
--- a/js/mediators/io-mediator.js
+++ b/js/mediators/io-mediator.js
@@ -389,7 +389,7 @@ exports.IoMediator = Montage.create(Component, {
389 if (!webgllibtag) { 389 if (!webgllibtag) {
390 webgllibtag = template.document.content.document.createElement('script'); 390 webgllibtag = template.document.content.document.createElement('script');
391 webgllibtag.setAttribute('type', 'text/javascript'); 391 webgllibtag.setAttribute('type', 'text/javascript');
392 webgllibtag.setAttribute('src', rdgeDirName+'/CanvasDataManager.js'); 392 webgllibtag.setAttribute('src', rdgeDirName+'/CanvasRuntime.js');
393 webgllibtag.setAttribute('data-ninja-webgl-lib', 'true'); 393 webgllibtag.setAttribute('data-ninja-webgl-lib', 'true');
394 template.document.content.document.head.appendChild(webgllibtag); 394 template.document.content.document.head.appendChild(webgllibtag);
395 } 395 }
@@ -421,11 +421,11 @@ function initWebGl (e) {\n\
421 //Creating data manager\n\ 421 //Creating data manager\n\
422 cvsDataMngr = new CanvasDataManager();\n\ 422 cvsDataMngr = new CanvasDataManager();\n\
423 //Loading data to canvas(es)\n\ 423 //Loading data to canvas(es)\n\
424 cvsDataMngr.loadGLData(document.body, ninjaWebGlData, '"+rdgeDirName+"');\n\ 424 cvsDataMngr.loadGLData(document.body, ninjaWebGlData.data);\n\
425}\ 425}\
426 "; 426 ";
427 //TODO: Add version and other data for RDGE 427 //TODO: Add version and other data for RDGE
428 json = '\n({\n\t"version": "'+rdgeVersion+'",\n\t"data": ['; 428 json = '\n({\n\t"version": "'+rdgeVersion+'",\n\t"directory": "'+rdgeDirName+'/",\n\t"data": [';
429 //Looping through data to create escaped array 429 //Looping through data to create escaped array
430 for (var j=0; template.webgl[j]; j++) { 430 for (var j=0; template.webgl[j]; j++) {
431 if (j === 0) { 431 if (j === 0) {
@@ -437,7 +437,11 @@ function initWebGl (e) {\n\
437 //Closing array (make-shift JSON string to validate data in <script> tag) 437 //Closing array (make-shift JSON string to validate data in <script> tag)
438 json += '\n\t\t]\n})\n'; 438 json += '\n\t\t]\n})\n';
439 //Setting string in tag 439 //Setting string in tag
440 webgltag.innerHTML = json; 440 webgltag.innerHTML = json.replace(/assets\//gi, webGlDirSwap);
441 //
442 function webGlDirSwap (dir) {
443 return rdgeDirName+'/';
444 }
441 } 445 }
442 //Cleaning URLs from HTML 446 //Cleaning URLs from HTML
443 var cleanHTML = template.document.content.document.documentElement.outerHTML.replace(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi, parseNinjaRootUrl.bind(this)); 447 var cleanHTML = template.document.content.document.documentElement.outerHTML.replace(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi, parseNinjaRootUrl.bind(this));