Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Latest commit

 

History

History
161 lines (139 loc) · 4.11 KB

open-results.md

File metadata and controls

161 lines (139 loc) · 4.11 KB
layout title key
content-without-sidebar
Open Contest Results
open-results
<style> @media (min-width: 768px) { .open-container { width: 750px !important; } } @media (min-width: 992px) { .open-container { width: 970px !important; } } @media (min-width: 1200px) { .open-container { width: 1170px !important; } } </style>
 Medals are awarded based on the cutoffs from the actual competition.
 For Indonesian citizens only: Para pemenang hadiah kategori umum dan siswa akan dihubungi via email.
Filter By Team:
<script> const country_index = 1; const medal_index = 3; var data = []; var table_el = document.getElementById("results"); var filter_el = document.getElementById("filter"); var countries = [ "All Teams" ]; function onlyUniqueNoEmpty(value, index, self) { return self.indexOf(value) === index && value !== ""; } function populateCountries() { countries = countries.concat(data.map(c => c[country_index]) .slice(1).filter(onlyUniqueNoEmpty).sort()); } function h (parent, tag) { var el = document.createElement(tag); parent.append(el); return el; } function httpGetAsync(theUrl, callback) { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) callback(xmlHttp.responseText); } xmlHttp.open("GET", theUrl, true); // true for asynchronous xmlHttp.send(null); } function processCSV(allText) { var allTextLines = allText.split(/\r\n|\n/); var lines = []; for (var i=0; i e.target.value === "All Teams" || e.target.value === c[country_index])) ); } function populateFilter() { filter_el.addEventListener("change", onFilterChange); for (var i = 0; i= 349) { tbody_tr.classList.add("medal-gold"); var td = h(tbody_tr, "td"); td.textContent = "Gold"; }else if (parseInt(data[i][3]) >= 290) { tbody_tr.classList.add("medal-silver"); var td = h(tbody_tr, "td"); td.textContent = "Silver"; }else if (parseInt(data[i][3]) >= 217) { tbody_tr.classList.add("medal-bronze"); var td = h(tbody_tr, "td"); td.textContent = "Bronze"; }else { var td = h(tbody_tr, "td"); } } } httpGetAsync("/open-results.tsv", function(allText) { data = processCSV(allText); populateCountries(); populateFilter(); populateTable(table_el, data); }); </script>