treesummaryrefslogcommitdiff
path: root/html/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'html/script.js')
-rw-r--r--html/script.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/html/script.js b/html/script.js
index c2d4fd5..fdd261f 100644
--- a/html/script.js
+++ b/html/script.js
@@ -103,15 +103,29 @@ function getChampLookup() {
app.champlookup = JSON.parse(data);
});
}
+let matchesHtml = [];
function getMatches() {
$.ajax("/lol/matches?region=" + app.region + "&summoner=" + app.summoner)
.done((data) => {
app.matches = JSON.parse(data);
+ matchesHtml = [];
+ matchesHtml.push("<tr><th></th><th>Game Type</th><th>Time</th></tr>");
for (m in app.matches) {
app.matches[m].championString = app.champlookup[app.matches[m].champion];
app.matches[m].queueString = app.queues[app.matches[m].queue];
app.matches[m].timestampString = new Date(app.matches[m].timestamp).toLocaleString();
+ let newTag = "<tr><td><img class='championIcon' src='http://ddragon.leagueoflegends.com/cdn/8.24.1/img/champion/" + app.matches[m].championString + ".png'></img></td>";
+ newTag = newTag.concat("<td>" + app.matches[m].queueString + "</td>");
+ newTag = newTag.concat("<td>" + app.matches[m].timestampString + "</td>");
+ newTag = newTag.concat("</tr>");
+ console.log(newTag);
+ matchesHtml.push(newTag);
}
+ var clusterize = new Clusterize({
+ rows: matchesHtml,
+ scrollId: 'scrollArea',
+ contentId: 'contentArea',
+ });
});
}
function getInfo() {