-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
executable file
·31 lines (24 loc) · 1006 Bytes
/
main.js
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
var facultyURL = 'https://docs.google.com/spreadsheets/d/1p8r5qRrLbDJp1tmBXvZow9ygzn2EVv3f_m0lgONC1HE/pubhtml';
Tabletop.init({
key: facultyURL,
callback: processData,
simpleSheet: true,
});
function processData(data, tabletop) {
if (!data[0]) return;
for (i in data) {
if (data[i].Display !== 'y') continue;
var title = data[i]['Title'];
var titleKey = title.replace(' ', '');
if (!title) continue;
$('body').append('<div class="project-div" id="project-' + titleKey + '"></div>');
var div = '#project-' + titleKey;
var names = data[i]['Name'];
var research = data[i]['Research'];
$(div).append('<h1>Project</h1>');
$(div).append('<div class="hr" style="background:#' + Math.random().toString(16).substr(-6) + '"></div>');
$(div).append('<p><span>Faculty:</span><br>' + names + '</p>');
$(div).append('<p><span>Research</span><br>' + research + '</p>');
$(div).append('<p class="additional"></p>');
}
}