aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-03-12 16:39:21 -0700
committerJose Antonio Marquez2012-03-12 16:39:21 -0700
commit43916167592b17a639b7189c0b7bc1fd0e5d5b1e (patch)
treebbe13535fdbd0c03bbc02e0ebf5fd2b29f0e1111 /js
parent8d62c5b896a1f86f2c7726b30310d6b1c7f535d5 (diff)
downloadninja-43916167592b17a639b7189c0b7bc1fd0e5d5b1e.tar.gz
Clean up and TODOs
Diffstat (limited to 'js')
-rw-r--r--js/mediators/io-mediator.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js
index e9661f20..472b3004 100644
--- a/js/mediators/io-mediator.js
+++ b/js/mediators/io-mediator.js
@@ -418,13 +418,16 @@ exports.IoMediator = Montage.create(Component, {
418 webgltag.setAttribute('data-ninja-webgl', 'true'); 418 webgltag.setAttribute('data-ninja-webgl', 'true');
419 template.document.content.document.head.appendChild(webgltag); 419 template.document.content.document.head.appendChild(webgltag);
420 } 420 }
421 // 421 //TODO: Remove this tag and place inside JS file
422 if (!webgljstag) { 422 if (!webgljstag) {
423 webgljstag = template.document.content.document.createElement('script'); 423 webgljstag = template.document.content.document.createElement('script');
424 webgljstag.setAttribute('type', 'text/javascript'); 424 webgljstag.setAttribute('type', 'text/javascript');
425 webgljstag.setAttribute('data-ninja-webgl-js', 'true'); 425 webgljstag.setAttribute('data-ninja-webgl-js', 'true');
426 template.document.content.document.head.appendChild(webgljstag); 426 template.document.content.document.head.appendChild(webgljstag);
427 } 427 }
428
429 /////////////////////////////////////////////////////////////////////////////
430 /////////////////////////////////////////////////////////////////////////////
428 //TODO: Decide if this should be over-writter or only written on creation 431 //TODO: Decide if this should be over-writter or only written on creation
429 webgljstag.innerHTML = "\ 432 webgljstag.innerHTML = "\
430//Loading webGL/canvas data on window load\n\ 433//Loading webGL/canvas data on window load\n\
@@ -443,7 +446,11 @@ function initWebGl (e) {\n\
443 cvsDataMngr.loadGLData(document.body, ninjaWebGlData.data, '"+rdgeDirName+"/');\n\ 446 cvsDataMngr.loadGLData(document.body, ninjaWebGlData.data, '"+rdgeDirName+"/');\n\
444}\ 447}\
445 "; 448 ";
446 //TODO: Add version and other data for RDGE 449 /////////////////////////////////////////////////////////////////////////////
450 /////////////////////////////////////////////////////////////////////////////
451 /////////////////////////////////////////////////////////////////////////////
452
453 //TODO: This data should be saved to a JSON file eventually
447 json = '\n({\n\t"version": "'+rdgeVersion+'",\n\t"directory": "'+rdgeDirName+'/",\n\t"data": ['; 454 json = '\n({\n\t"version": "'+rdgeVersion+'",\n\t"directory": "'+rdgeDirName+'/",\n\t"data": [';
448 //Looping through data to create escaped array 455 //Looping through data to create escaped array
449 for (var j=0; template.webgl[j]; j++) { 456 for (var j=0; template.webgl[j]; j++) {
@@ -457,15 +464,6 @@ function initWebGl (e) {\n\
457 json += '\n\t\t]\n})\n'; 464 json += '\n\t\t]\n})\n';
458 //Setting string in tag 465 //Setting string in tag
459 webgltag.innerHTML = json; 466 webgltag.innerHTML = json;
460 /*
461webgltag.innerHTML = json.replace(/assets\//gi, webGlDirSwap);
462 //
463 function webGlDirSwap (dir) {
464 return rdgeDirName+'/';
465 }
466 //
467 console.log(webgltag.innerHTML);
468*/
469 } 467 }
470 //Cleaning URLs from HTML 468 //Cleaning URLs from HTML
471 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)); 469 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));