-
Notifications
You must be signed in to change notification settings - Fork 24
/
index.html
85 lines (78 loc) · 3.31 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
<html>
<head>
<title>Wolfbrains</title>
<style type="text/css">
img { border-radius: 15px; width: 25px; height: 25px; display: inline;}
</style>
<script type="text/javascript" src="yaml.min.js"></script>
<script type="text/javascript" src="gravatar.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
var dataStore = {};
var currentYear = new Date().getFullYear();
var theBrains = document.getElementById('wolfbrains');
YAML.load('//ckdake.github.io/wolfbrains/data.yml', function(result)
{
nativeObject = result;
nativeObject.people.forEach(function(peopleEntry) {
peopleEntry.jobs.forEach(function(jobEntry) {
var company = jobEntry['company'];
var startYear = jobEntry['start_day'].getFullYear();
var endYear = currentYear;
if (jobEntry['end_day'] != null) {
endYear = jobEntry['end_day'].getFullYear();
}
for (year = startYear; year <= endYear; year++) {
if (!(dataStore.hasOwnProperty(year))) { dataStore[year] = {} };
if (!(dataStore[year].hasOwnProperty(company))) { dataStore[year][company] = [] };
dataStore[year][company].push(peopleEntry);
}
});
if (peopleEntry.education) {
peopleEntry.education.forEach(function(educationEntry) {
var institution = educationEntry['institution'];
if (educationEntry['start_day'] != null) {
var startYear = educationEntry['start_day'].getFullYear();
}
var endYear = currentYear;
if (educationEntry['end_day'] != null) {
endYear = educationEntry['end_day'].getFullYear();
}
if (startYear != null && endYear != null) {
for (year = startYear; year <= endYear; year++) {
if (!(dataStore.hasOwnProperty(year))) { dataStore[year] = {} };
if (!(dataStore[year].hasOwnProperty(institution))) { dataStore[year][institution] = [] };
dataStore[year][institution].push(peopleEntry);
}
}
});
}
});
Object.keys(dataStore).forEach(function(year) {
var yearLabel = document.createElement('h2');
yearLabel.appendChild(document.createTextNode(year));
theBrains.appendChild(yearLabel);
Object.keys(dataStore[year]).forEach(function(company) {
var companyLabel = document.createElement('div');
companyLabel.appendChild(document.createTextNode(company + ":"));
dataStore[year][company].forEach(function(person) {
var personLink = document.createElement('a');
personLink.setAttribute('href', person['url']);
var personImage = document.createElement('img');
personImage.setAttribute('src', gravatar(person['email']));
personLink.appendChild(personImage);
companyLabel.appendChild(personLink);
});
theBrains.appendChild(companyLabel);
});
});
});
});
</script>
</head>
<body>
<h1>One(s) of Us</h1>
<ul id="wolfbrains">
</ul>
<a href="https://github.com/ckdake/wolfbrains">go here to contribute</a>
</body>