diff options
author | Jose Antonio Marquez | 2012-03-18 18:07:40 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-18 18:07:40 -0700 |
commit | 9cb68d376870eea3db3636c30e5fa09d9f71c8cf (patch) | |
tree | 9eaaf887904c5bf7b687ad1a51065d2bb88ae9b7 /js/mediators | |
parent | 06a790e0f830d01539dc9e80c90e2bcdabaa666b (diff) | |
download | ninja-9cb68d376870eea3db3636c30e5fa09d9f71c8cf.tar.gz |
Tests and clean-up
Diffstat (limited to 'js/mediators')
-rw-r--r-- | js/mediators/io-mediator.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 01879bac..18a517a5 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js | |||
@@ -462,17 +462,17 @@ function loadWebGL (e) {\n\ | |||
462 | 462 | ||
463 | 463 | ||
464 | 464 | ||
465 | |||
466 | |||
467 | |||
465 | // | 468 | // |
466 | var mjsCounter = 0, mjsComponents = [], temp = TemplateCreator.create(); | 469 | var mjsCounter = 0, mjsComponents = [], temp = TemplateCreator.create(); |
470 | // | ||
467 | for (var m in template.mjs) { | 471 | for (var m in template.mjs) { |
468 | mjsComponents.push(template.mjs[m]); | 472 | mjsComponents.push(template.mjs[m]); |
469 | mjsCounter++; | 473 | mjsCounter++; |
470 | } | 474 | } |
471 | 475 | // | |
472 | // console.log(mjsComponents); | ||
473 | |||
474 | //console.log(TemplateCreator.) | ||
475 | |||
476 | if (template.mjs && mjsCounter > 0) { | 476 | if (template.mjs && mjsCounter > 0) { |
477 | var mjsDirName, mjsVersion, | 477 | var mjsDirName, mjsVersion, |
478 | mjscode = temp.initWithHeadAndBodyElements(template.document.content.document.documentElement.head, template.document.content.document.documentElement.body, mjsComponents)._ownerSerialization; | 478 | mjscode = temp.initWithHeadAndBodyElements(template.document.content.document.documentElement.head, template.document.content.document.documentElement.body, mjsComponents)._ownerSerialization; |
@@ -483,7 +483,7 @@ function loadWebGL (e) {\n\ | |||
483 | mjsDirName = (this.application.ninja.coreIoApi.ninjaLibrary.libs[i].name+this.application.ninja.coreIoApi.ninjaLibrary.libs[i].version).toLowerCase(); | 483 | mjsDirName = (this.application.ninja.coreIoApi.ninjaLibrary.libs[i].name+this.application.ninja.coreIoApi.ninjaLibrary.libs[i].version).toLowerCase(); |
484 | mjsVersion = this.application.ninja.coreIoApi.ninjaLibrary.libs[i].version; | 484 | mjsVersion = this.application.ninja.coreIoApi.ninjaLibrary.libs[i].version; |
485 | this.application.ninja.coreIoApi.ninjaLibrary.copyLibToCloud(template.document.root, mjsDirName); | 485 | this.application.ninja.coreIoApi.ninjaLibrary.copyLibToCloud(template.document.root, mjsDirName); |
486 | //TODO: Fix to allow no overwrite | 486 | //TODO: Fix to allow no overwrite and nested locations |
487 | var packjson = this.application.ninja.coreIoApi.createFile({uri: template.document.root+'package.json', contents: '{"mappings": {"montage": "'+mjsDirName+'/"}}'}); | 487 | var packjson = this.application.ninja.coreIoApi.createFile({uri: template.document.root+'package.json', contents: '{"mappings": {"montage": "'+mjsDirName+'/"}}'}); |
488 | } else { | 488 | } else { |
489 | //TODO: Error handle no available library to copy | 489 | //TODO: Error handle no available library to copy |
@@ -511,6 +511,8 @@ function loadWebGL (e) {\n\ | |||
511 | 511 | ||
512 | 512 | ||
513 | 513 | ||
514 | |||
515 | |||
514 | //Cleaning URLs from HTML | 516 | //Cleaning URLs from HTML |
515 | 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)); | 517 | 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)); |
516 | // | 518 | // |