-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
118 lines (108 loc) · 3.66 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dependencies on Package Control</title>
</head>
<style type="text/css">
body {max-width: 40em; margin: auto;}
img {float: right; margin: 0 20px; }
#deps p {margin-left: 10px}
hr {border: 0 none; background: #cccccc; height: 1px;}
</style>
<script type="text/javascript">
function getXmlHttp(){
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function appendDep(dep, target) {
var child = document.createElement('p');
var link = document.createElement('a');
var url = '';
if (dep.issues){
url = dep.issues.replace('/issues', '');
} else {
if (dep.releases){
url = dep.releases[0].base;
} else {
alert(dep);
}
}
link.href = url;
link.appendChild(document.createTextNode(dep.name + '\t'));
child.appendChild(link);
if (url.lastIndexOf('https://github.com/', 0) === 0) {
var gh_shield = document.createElement('img');
gh_shield.src = 'https://img.shields.io/github/tag/' + url.substr(19) + '.svg';
child.appendChild(gh_shield);
}
var pp_shield = document.createElement('img');
pp_shield.src = 'https://img.shields.io/pypi/v/' + dep.name.replace('python-', '') + '.svg';
child.appendChild(pp_shield);
child.appendChild(document.createElement('br'));
child.appendChild(document.createTextNode(dep.description));
child.appendChild(document.createElement('br'));
if (dep.releases[0].sublime_text) {
if ('*' != dep.releases[0].sublime_text) {
child.appendChild(document.createElement('br'));
child.appendChild(document.createTextNode('ST version is restricted to ' + dep.releases[0].sublime_text));
}
}
if (dep.releases[0].platforms) {
if ('*' != dep.releases[0].platforms[0]) {
child.appendChild(document.createElement('br'));
child.appendChild(document.createTextNode('Platform restriction(s): ' + dep.releases[0].platforms));
}
}
target.appendChild(child);
target.appendChild(document.createElement('hr'));
}
var xmlhttp = getXmlHttp()
xmlhttp.open('GET', 'https://raw.githubusercontent.com/wbond/package_control_channel/master/repository/dependencies.json', true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var json = JSON.parse(xmlhttp.responseText);
var target = document.getElementById("deps")
target.appendChild(document.createElement('hr'));
var deps = json.dependencies;
for (i = 0; i < deps.length; i++) {
appendDep(deps[i], target);
}
} else {
alert('GitHub did not respond! :(');
return null
}
}
};
xmlhttp.send(null);
</script>
<body>
<h1>Beautiful WIP Page For List Of Dependencies</h1>
<p>
This is supposed to be a list of dependencies
that are available for packages distributed
via <a href="https://packagecontrol.io/">Package Control</a>
and for easy checking
whether they are still up to date
with their pypi equivalent,
since most packages are infered from there.
</p>
<p>
<a href="https://github.com/wbond/package_control_channel/blob/master/repository/dependencies.json">Link to current <code>dependencies.json</code> file.</a>
</p>
<div id="deps"></div>
</body>
</html>