Commit
… documents.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,15 @@ | |
|
||
window.scripts_to_get = window.scripts_to_get || parent.scripts_to_get || window.location.search.match(/\bscript=(.*?\.js)/gi) || []; | ||
|
||
|
||
|
||
for (var i=0, scriptsrc; scriptsrc = scripts_to_get[i]; i++){ | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
subtleGradient
|
||
scripts_to_get[i] = scriptsrc = decodeURIComponent(scriptsrc.replace(/^(&?script=)+/,'')); | ||
|
||
scriptsrc.replace(/^(?!=http|\/)/,'../'); | ||
|
||
|
||
scripts_to_get[i] = scriptsrc = decodeURIComponent(scriptsrc.replace(/^(&?script=)+/, '')); | ||
scriptsrc.replace(/^(?!=http|\/)/, '../'); | ||
|
||
var written; | ||
|
||
if (document.write){ | ||
try { | ||
document.write('<scr'+'ipt src="'+ scriptsrc +'" type="text/javascript"><\/script>'); | ||
|
@@ -20,20 +22,20 @@ | |
} | ||
} | ||
|
||
if (!written && document.documentElement.nodeName == 'HTML'){ | ||
if (!written && document.documentElement.nodeName.toLowerCase() == 'html'){ | ||
This comment has been minimized.
Sorry, something went wrong.
subtleGradient
|
||
var script = document.createElement('script'); | ||
script.setAttribute('src', scriptsrc); | ||
script.setAttribute('type', 'text/javascript'); | ||
document.documentElement.appendChild(script); | ||
} | ||
|
||
// else evalRemote(scriptsrc); | ||
|
||
if (/\bbootstrap\b/.test(scriptsrc)) scripts_to_get.splice(i,1); | ||
if (/\bbootstrap\b/.test(scriptsrc)) scripts_to_get.splice(i, 1); | ||
|
||
} | ||
|
||
this.frameworkName = (scripts_to_get[0] || '').replace(/^.*\//,''); | ||
this.frameworkName = (scripts_to_get[0] || '').replace(/^.*\//, ''); | ||
|
||
// function evalRemote(url){ | ||
// if (!(/^(\/|http:)/).test(url) && /\bmocks\b/.test(document.location.href)) url = '../' + url; | ||
|
2 comments
on commit c91a611
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks really good.
isHTML is indeed a better thing to know than isXML
since some DOM-like object that doesn't have getByID isn't XML but also isn't HTML. Good Stuff.
Going to have to check it out and test it ofc, but I have no reason to believe that it won't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, September. I suck.
How does this work without the element being added to the document first?