2020-10-05 14:15:41 +00:00
|
|
|
function fetchAndRender (name) {
|
|
|
|
fetch(name + '.json')
|
|
|
|
.then(response => response.json())
|
|
|
|
.then(data => {
|
|
|
|
const mysource = document.getElementById(name + '-template').innerHTML;
|
|
|
|
const mytemplate = Handlebars.compile(mysource);
|
|
|
|
const myresult = mytemplate(data);
|
|
|
|
document.getElementById(name).innerHTML = myresult;
|
|
|
|
});
|
2020-05-14 12:52:48 +00:00
|
|
|
}
|
2020-05-13 14:24:14 +00:00
|
|
|
|
2020-10-05 14:15:41 +00:00
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
fetchAndRender('apps');
|
|
|
|
fetchAndRender('links');
|
|
|
|
fetchAndRender('providers');
|
2019-04-03 13:47:12 +00:00
|
|
|
});
|