-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathexplore.html
135 lines (112 loc) · 2.62 KB
/
explore.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<html>
<head>
<title>dotabap</title>
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
background: #E8E8E8;
}
a,
a:visited {
color: #4078c0;
text-decoration: none;
}
a:hover,
a:active {
text-decoration: underline;
}
a.disabled {
text-decoration: none;
color: inherit;
}
div#header {
display: block;
margin-top: 0.5em;
padding-bottom: 0.5em;
border-bottom: 3px double lightgrey;
}
div#toc {
display: block;
background-color: #f2f2f2;
padding: 1em;
}
div#footer {
display: block;
margin-bottom: 1em;
padding-top: 0.5em;
border-top: 3px double lightgrey;
color: grey;
text-align: center;
}
h1 {
display: inline;
}
h2 {
display: inline;
}
h3 {
display: inline;
color: grey;
font-weight: normal;
font-size: smaller;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
function goBack() {
window.history.back();
}
function shuffle(sourceArray) {
for (var n = 0; n < sourceArray.length - 1; n++) {
var k = n + Math.floor(Math.random() * (sourceArray.length - n));
var temp = sourceArray[k];
sourceArray[k] = sourceArray[n];
sourceArray[n] = temp;
}
}
function run() {
/* global $ */
$.getJSON("https://generated.dotabap.org/generated.json", function (data) {
var items = [];
$.each(data, function (key, val) {
items.push("<h2>" +
data[key].repo.name +
"</h2> <a href='sapevent:install?" +
data[key].repo.clone_url +
"'>Clone</a><br><h3>" +
data[key].repo.clone_url +
"</h3><br>" +
data[key].repo.description);
});
shuffle(items);
$('#content').html(items.join("<br><br>"));
});
if (!check4ArrowFunctions()){
//dotabap.org needs full ES6 support
$("#poweredby").removeAttr('href').addClass("disabled");
}
}
function check4ArrowFunctions() {
try {
eval("var arrowFunction = (x) => x");
}
catch (e) {
return false;
}
return true;
}
</script>
</head>
<body onload="run()">
<div id="header">
<h1>Explore</h1> Powered by
<a href="http://dotabap.org" id="poweredby">dotabap.org</a>
</div>
<div id="toc">
<div id="content"></div>
</div>
<div id="footer">
footer
</div>
</body>
</html>