You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added tile for q1k3, added new splash texts (and splash image...), fixed search bar, fixed back to top button, removed n-gon enhanced, and maybe more idk.
if(src.indexOf('//gist.githubusercontent.com')>0||src.indexOf('//raw.githubusercontent.com')>0||src.indexOf('//bitbucket.org')>0){//Check if it's from raw.github.com or bitbucket.org
87
+
frame[i].src=location.href.split('?')[0]+'?'+src;//Then rewrite URL so it can be loaded using YQL
88
+
}
89
+
}
90
+
a=document.querySelectorAll('a[href]');
91
+
for(i=0;i<a.length;++i){
92
+
href=a[i].href;//Get absolute URL
93
+
if(href.indexOf('#')>0){//Check if it's an anchor
94
+
a[i].href=location.href.split('?')[0]+location.search+'#'+a[i].hash.substring(1);//Then rewrite URL with support for empty anchor
95
+
}
96
+
elseif((href.indexOf('//gist.githubusercontent.com')>0||href.indexOf('//raw.githubusercontent.com')>0||href.indexOf('//bitbucket.org')>0)&&(href.indexOf('.html')>0||href.indexOf('.htm')>0)){//Check if it's from raw.github.com or bitbucket.org and to HTML files
97
+
a[i].href=location.href.split('?')[0]+'?'+href;//Then rewrite URL so it can be loaded using YQL
98
+
}
99
+
}
100
+
if(document.querySelectorAll('frameset').length)
101
+
return;//Don't replace CSS/JS if it's a frameset, because it will be erased by document.write()
if(href.indexOf('//gist.githubusercontent.com')>0||href.indexOf('//raw.githubusercontent.com')>0||href.indexOf('//bitbucket.org')>0||href.indexOf('//')===-1){//Check if it's from raw.github.com or bitbucket.org
106
+
HTMLPreview.send(href,'loadCSS');//Then load it using YQL
if(src.indexOf('//gist.githubusercontent.com')>0||src.indexOf('//raw.githubusercontent.com')>0||src.indexOf('//bitbucket.org')>0){//Check if it's from raw.github.com or bitbucket.org
116
+
HTMLPreview.send(src,'loadJS');//Then load it using YQL
HTMLPreview.content=data.query.results.resources.content.replace(/<head>/i,'<head><base href="'+HTMLPreview.raw()+'">').replace(/<script(type=["'](text|application)\/javascript["'])?/gi,'<script type="text/htmlpreview"').replace(/<\/body>/i,'<script src="'+location.href.split('?')[0]+'/htmlpreview.js"></script><script>HTMLPreview.replaceAssets();</script></body>').replace(/<\/head>\s*<frameset/gi,'<script src="'+location.href.split('?')[0]+'/htmlpreview.js"></script><script>document.addEventListener("DOMContentLoaded",HTMLPreview.replaceAssets,false);</script></head><frameset');//Add <base> just after <head> and inject <script> just before </body> or </head> if <frameset>
139
+
setTimeout(function(){
140
+
document.open();
141
+
document.write(HTMLPreview.content);
142
+
document.close();
143
+
},50);//Delay updating document to have it cleared before
document.write('<style>'+data.query.results.resources.content.replace(/url\((?:'|")?([^\/][^:'"\)]+)(?:'|")?\)/gi,'url('+data.query.results.resources.url.replace(/[^\/]+\.css.*$/gi,'')+'$1)')+'</style>');//If relative URL in CSS background-image property, then concatenate URL to CSS directory
document.write('<script src="//query.yahooapis.com/v1/public/yql?q=use%20%22https%3A%2F%2Fraw.githubusercontent.com%2Fyql%2Fyql-tables%2Fmaster%2Fdata%2Fdata.headers.xml%22%20as%20headers%3B%20select%20*%20from%20headers%20where%20url%3D%22'+encodeURIComponent(file)+'%22&format=json&diagnostics=true&callback=HTMLPreview.'+callback+'"></script>');//Get content using YQL
0 commit comments