diff options
author | Martin Fischer <martin@push-f.com> | 2022-07-12 09:42:00 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-07-12 12:48:11 +0200 |
commit | 850ec09bdcf55b5cbbf9539fcb7355ed7161935a (patch) | |
tree | 52cdf9d3ea1b7a896111e6c321dab5accb076828 /script.js |
initial commit
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/script.js b/script.js new file mode 100644 index 0000000..b202914 --- /dev/null +++ b/script.js @@ -0,0 +1,30 @@ +const tbody = document.getElementById('tbody'); + +function newEl(tagname, content) { + const cell = document.createElement(tagname); + if (content instanceof Node) + cell.appendChild(content); + else + cell.textContent = content; + return cell; +} + +(async function() { + const data = await (await fetch('proposals.json')).json(); + data.forEach(proposal => { + const row = document.createElement('tr'); + + const statusCell = newEl('td', proposal.status); + statusCell.className = 'status-' + proposal.status; + row.appendChild(statusCell); + const link = newEl('a', proposal.name); + link.href = 'https://wiki.openstreetmap.org/wiki/' + proposal.page_title.replaceAll(' ', '_'); + row.appendChild(newEl('td', link)); + row.appendChild(newEl('td', proposal.draft_start)); + row.appendChild(newEl('td', proposal.rfc_start)); + row.appendChild(newEl('td', proposal.vote_start)); + row.appendChild(newEl('td', proposal.authors)); + + tbody.appendChild(row); + }); +})(); |