diff options
-rw-r--r-- | js/mediators/io-mediator.js | 14 | ||||
-rw-r--r-- | node_modules/tools/template-creator.js | 8 |
2 files changed, 13 insertions, 9 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 | // |
diff --git a/node_modules/tools/template-creator.js b/node_modules/tools/template-creator.js index ba4cdc7a..e312cd32 100644 --- a/node_modules/tools/template-creator.js +++ b/node_modules/tools/template-creator.js | |||
@@ -40,7 +40,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
40 | self = this; | 40 | self = this; |
41 | 41 | ||
42 | this._objectNamesIndex = {}; | 42 | this._objectNamesIndex = {}; |
43 | doc = this._document = document.implementation.createHTMLDocument(""); | 43 | //doc = this._document = document.implementation.createHTMLDocument(""); |
44 | 44 | ||
45 | /* | 45 | /* |
46 | function copyNode(sourceNode, targetNode, isRootNode) { | 46 | function copyNode(sourceNode, targetNode, isRootNode) { |
@@ -65,7 +65,8 @@ function copyNode(sourceNode, targetNode, isRootNode) { | |||
65 | } | 65 | } |
66 | */ | 66 | */ |
67 | 67 | ||
68 | if (head) { | 68 | /* |
69 | if (head) { | ||
69 | doc.head.innerHTML = head.innerHTML; | 70 | doc.head.innerHTML = head.innerHTML; |
70 | } | 71 | } |
71 | if (montageJsPath) { | 72 | if (montageJsPath) { |
@@ -84,11 +85,12 @@ function copyNode(sourceNode, targetNode, isRootNode) { | |||
84 | // the first child is the title | 85 | // the first child is the title |
85 | doc.head.insertBefore(doc.createTextNode("\n "), doc.head.firstChild); | 86 | doc.head.insertBefore(doc.createTextNode("\n "), doc.head.firstChild); |
86 | } | 87 | } |
88 | */ | ||
87 | 89 | ||
88 | //copyNode(body, this._document.body, true); | 90 | //copyNode(body, this._document.body, true); |
89 | this._ownerSerialization = serializer.serialize(components); | 91 | this._ownerSerialization = serializer.serialize(components); |
90 | this._externalObjects = serializer.getExternalObjects(); | 92 | this._externalObjects = serializer.getExternalObjects(); |
91 | 93 | ||
92 | return this; | 94 | return this; |
93 | } | 95 | } |
94 | }, | 96 | }, |