Skip to content

Commit

Permalink
Get runs to direct to run link.
Browse files Browse the repository at this point in the history
  • Loading branch information
luckytyphlosion committed Jul 29, 2020
1 parent 755c35c commit f7abb62
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
</tr>
</table>-->
<table id="mcceQueue"></table>
<!--<table id="mcQueue"></table>-->
<pre></pre>
</body>
</html>
23 changes: 6 additions & 17 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,6 @@ function srcApiGetCallback(endpoint, callback)
// request leaderboard for placement
// https://www.speedrun.com/api/v1/leaderboards/nd2e9erd/category/vdom79v2

/*
function srcGetAllRuns_processRuns(allRuns)
{
let fragment = document.createDocumentFragment();
for (run of allRuns) {
let row = document.createElement("tr");
for
let row = mcceQueue.insertRow();
output += JSON.stringify(run) + "\\n";
}
$("pre").text(output);
}*/

async function fetchVerificationQueue()
{
Expand Down Expand Up @@ -314,12 +298,17 @@ async function createLeaderboard()
let runPlatform = await getRunPlatform(run);
addCellToRow(row, runPlatform);
addCellToRow(row, getDaysSinceRunDone(run));
row.setAttribute("data-href", run["weblink"]);
row.classList.add("row-link");
fragment.appendChild(row);
}
let leaderboardTable = document.createElement("table");
leaderboardTable.classList.add("colPadding");
leaderboardTable.classList.add("col-padding");
leaderboardTable.appendChild(fragment);
$("#mcceQueue").append(leaderboardTable);
$("table .row-link").on("click", function() {
window.location = $(this).data("href");
});
}

$(function() {
Expand Down
7 changes: 6 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.colPadding td
.col-padding td
{
padding: 0px 5px;
text-align: center;
vertical-align: middle;
}

.row-link:hover{
background-color: #cccccc;
cursor: pointer;
}

0 comments on commit f7abb62

Please sign in to comment.