From 6377dc0c14b8e16dfbaa81e00734266b6fcd0365 Mon Sep 17 00:00:00 2001 From: Patrick Schönberger Date: Thu, 20 Dec 2018 21:15:20 +0100 Subject: cleanup new data structure --- html/script.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'html/script.js') 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("Game TypeTime"); 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 = ""; + newTag = newTag.concat("" + app.matches[m].queueString + ""); + newTag = newTag.concat("" + app.matches[m].timestampString + ""); + newTag = newTag.concat(""); + console.log(newTag); + matchesHtml.push(newTag); } + var clusterize = new Clusterize({ + rows: matchesHtml, + scrollId: 'scrollArea', + contentId: 'contentArea', + }); }); } function getInfo() { -- cgit v1.2.3