-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
52 lines (52 loc) · 1.83 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<script>
if (location.href.indexOf("http://") == 0) {
location = location.href.replace("http:", "https:", 1);
}
</script>
<title>GoAgent ·</title>
<script src="marked.js"></script>
<link rel="stylesheet" href="github-markdown.css">
</head>
<body style="min-width:200px; max-width:900px; margin:auto; padding:16px;">
<div id="content" class="markdown-body"></div>
<script>
(function() {
if (location.href.indexOf('https:') < 0) {
return;
}
if (window.XMLHttpRequest) {
var request = new XMLHttpRequest();
} else {
var request = new ActiveXObject("Microsoft.XMLHTTP");
}
request.onreadystatechange = render;
var path = "/goagent/README.md";
if (location.href.indexOf('?') > 0) {
path = location.href.substring(location.href.indexOf('?')+1);
}
request.open('GET', path, true);
request.send();
function render() {
if (request.readyState == 4) {
if (request.status >= 200 && request.status < 400){
var firstline = request.responseText.split("\n")[0];
if (firstline.indexOf('#') == 0) {
document.title += ' ' + firstline.replace(/#*/, '').replace(/\s+/, '');
} else {
document.title += ' A GAE Proxy';
}
document.getElementById("content").innerHTML = marked(request.responseText);
} else {
location = 'https://github.com/goagent/goagent';
}
}
}
})();
</script>
</body>
</html>