diff options
Diffstat (limited to 'node_modules/montage/ui/template.js')
-rwxr-xr-x | node_modules/montage/ui/template.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/node_modules/montage/ui/template.js b/node_modules/montage/ui/template.js index ee2cc1be..6dbf2c67 100755 --- a/node_modules/montage/ui/template.js +++ b/node_modules/montage/ui/template.js | |||
@@ -167,7 +167,7 @@ var Template = exports.Template = Montage.create(Montage, /** @lends module:mont | |||
167 | 167 | ||
168 | this.createHtmlDocumentFromModuleId(requireFunction, moduleId, function(doc) { | 168 | this.createHtmlDocumentFromModuleId(requireFunction, moduleId, function(doc) { |
169 | if (!doc) { | 169 | if (!doc) { |
170 | throw "Template '" + url + "' not found."; | 170 | throw "Template '" + moduleId + "' not found."; |
171 | } | 171 | } |
172 | self._isLoaded = true; | 172 | self._isLoaded = true; |
173 | self.initWithDocument(doc); | 173 | self.initWithDocument(doc); |
@@ -602,7 +602,8 @@ var Template = exports.Template = Montage.create(Montage, /** @lends module:mont | |||
602 | for (var i = 0, cssTag; (cssTag = cssTags[i]); i++) { | 602 | for (var i = 0, cssTag; (cssTag = cssTags[i]); i++) { |
603 | if ((url = cssTag.getAttribute("href"))) { | 603 | if ((url = cssTag.getAttribute("href"))) { |
604 | if (! /^https?:\/\/|^\//.test(url)) { // TODO: look into base links... | 604 | if (! /^https?:\/\/|^\//.test(url)) { // TODO: look into base links... |
605 | url = rootUrl + url; | 605 | cssTag.href = rootUrl + url; |
606 | url = cssTag.href; | ||
606 | } | 607 | } |
607 | 608 | ||
608 | if (url in fromLinks) { | 609 | if (url in fromLinks) { |
@@ -711,7 +712,9 @@ var Template = exports.Template = Montage.create(Montage, /** @lends module:mont | |||
711 | scriptNode = doc.importNode(script, true); | 712 | scriptNode = doc.importNode(script, true); |
712 | if (src) { | 713 | if (src) { |
713 | if (! /^https?:\/\/|^\//.test(src)) { // TODO: look into base links... | 714 | if (! /^https?:\/\/|^\//.test(src)) { // TODO: look into base links... |
714 | scriptNode.src = src = rootUrl + src; | 715 | scriptNode.src = rootUrl + src; |
716 | // scriptNode.src = scriptNode.src is used to normalize the src attribute | ||
717 | src = (scriptNode.src = scriptNode.src); | ||
715 | } | 718 | } |
716 | if (src in externalScriptsLoaded) continue; | 719 | if (src in externalScriptsLoaded) continue; |
717 | externalScriptsLoaded[src] = true; | 720 | externalScriptsLoaded[src] = true; |