-
Notifications
You must be signed in to change notification settings - Fork 0
/
loopers.js
50 lines (43 loc) · 987 Bytes
/
loopers.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
let workPackages = (function () {
pub = {};
makePkg = (img, name, descr) => {
return `<div class="w-container">
<div class="w-richtext">
<div style='display:inline; font-size: 26px; line-height: 36px; margin-top: 20px;'>
<img src="${img}" width="100" height="100"> ${name}
</div>
<blockquote>${descr}</blockquote>
</div>
</div>
`;
};
displayPkgs = (pkgs) => {
pkgs.forEach((package) => {
let img = package.img;
let name = package.name;
let descr = package.descr;
$("#main-content").append(makePkg(img, name, descr));
});
};
pub.setup = () => {
$.ajax({
type: "GET",
url: "loopers.json",
data: {
get_param: "value",
},
dataType: "json",
async: false,
success: function (data) {
let pkgs = [];
pkgs = data.biogs;
displayPkgs(pkgs);
},
error: () => {
alert("Could not load work-package data.");
},
});
};
return pub;
})();
$(document).ready(pub.setup);