aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-06-08 14:44:17 -0700
committerNivesh Rajbhandari2012-06-08 14:44:17 -0700
commit2e10e6a57f45522606c7a0e4c56962f0dc1ea225 (patch)
tree2520cbabf44d519c9136c33b51a5f5652e341126 /js/document
parentc52bf5141126801cb243ce0d4d93dbbcd29b45f6 (diff)
parentbad5a44824ba35cbc7f4f4d245e32b90208f00c1 (diff)
downloadninja-2e10e6a57f45522606c7a0e4c56962f0dc1ea225.tar.gz
Merge branch 'refs/heads/ninja-internal' into ScrollBarFix
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/mediators/template.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/document/mediators/template.js b/js/document/mediators/template.js
index e04c16d9..4c72314a 100755
--- a/js/document/mediators/template.js
+++ b/js/document/mediators/template.js
@@ -93,9 +93,11 @@ exports.TemplateDocumentMediator = Montage.create(Component, {
93 hackTag = hackHtml.getElementsByTagName('ninjahtmlhack')[0]; 93 hackTag = hackHtml.getElementsByTagName('ninjahtmlhack')[0];
94 docHtmlTag = doc.getElementsByTagName('html')[0]; 94 docHtmlTag = doc.getElementsByTagName('html')[0];
95 //Looping through the attributes to copy them 95 //Looping through the attributes to copy them
96 for (var m in hackTag.attributes) { 96 if (hackTag) {
97 if (hackTag.attributes[m].value) { 97 for (var m in hackTag.attributes) {
98 docHtmlTag.setAttribute(hackTag.attributes[m].name.replace(/ninjahtmlhack/gi, 'html'), hackTag.attributes[m].value.replace(/ninjahtmlhack/gi, 'html')); 98 if (hackTag.attributes[m].value) {
99 docHtmlTag.setAttribute(hackTag.attributes[m].name.replace(/ninjahtmlhack/gi, 'html'), hackTag.attributes[m].value.replace(/ninjahtmlhack/gi, 'html'));
100 }
99 } 101 }
100 } 102 }
101 //Garbage collection 103 //Garbage collection
@@ -612,7 +614,7 @@ exports.TemplateDocumentMediator = Montage.create(Component, {
612 cleanHTML = template.file.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)); 614 cleanHTML = template.file.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));
613 } 615 }
614 //TODO: Remove, this is a temp hack 616 //TODO: Remove, this is a temp hack
615 cleanHTML = '<!DOCTYPE html>\n'+cleanHTML; 617 cleanHTML = cleanHTML;
616 // 618 //
617 function parseNinjaRootUrl(url) { 619 function parseNinjaRootUrl(url) {
618 if (url.indexOf(this.application.ninja.coreIoApi.rootUrl) !== -1) { 620 if (url.indexOf(this.application.ninja.coreIoApi.rootUrl) !== -1) {