diff options
| author | Patrick Schönberger | 2018-12-20 21:15:20 +0100 |
|---|---|---|
| committer | Patrick Schönberger | 2018-12-20 21:15:20 +0100 |
| commit | 6377dc0c14b8e16dfbaa81e00734266b6fcd0365 (patch) | |
| tree | e0b62b26e79ae80b3e4cce17ca14cf2a41a1f843 /html | |
| parent | 836aefac5aba1a288561cf1bd5a2cdb9a060097e (diff) | |
| download | lolstats-6377dc0c14b8e16dfbaa81e00734266b6fcd0365.tar.gz lolstats-6377dc0c14b8e16dfbaa81e00734266b6fcd0365.zip | |
cleanup
new data structure
Diffstat (limited to 'html')
| -rw-r--r-- | html/index.html | 13 | ||||
| -rw-r--r-- | html/script.js | 14 |
2 files changed, 21 insertions, 6 deletions
diff --git a/html/index.html b/html/index.html index e39dec9..25434c1 100644 --- a/html/index.html +++ b/html/index.html @@ -39,7 +39,7 @@ <div id="champselect"> <button class="champselect" v-on:click="selectAll">All</button> <button class="champselect" v-on:click="selectNone">None</button><br /> - <span v-for="c in champions"><input class="champselectcb" type="checkbox" />{{ c }}<br /></span> + <span v-for="c in champions"><input class="champselectcb" type="checkbox" :id="'cb' + c" /><label :for="'cb' + c">{{ c }}</label><br /></span> </div> <button id="refreshbutton" v-on:click="refreshHistory">Refresh</button> </div> @@ -48,6 +48,10 @@ <div style="position: relative; width: 100%; height: 100%; max-height: 100%" id="scrollArea" class="clusterize-scroll"> <table> <tbody id="contentArea" class="clusterize-content"> + <tr class="clusterize-no-data"> + <td>Loading data...</td> + </tr> + <!-- <tr> <th>Icon</th> <th v-for="c in matchprops">{{ c.text }}</th> @@ -55,7 +59,8 @@ <tr v-for="m in matches"> <td><img class="championIcon" :src="'http://ddragon.leagueoflegends.com/cdn/8.24.1/img/champion/' + m.championString + '.png'"></img></td> <td v-for="c in matchprops">{{ m[c.name] }}</td> - </tr> + </tr> + --> </tbody> </table> </div> @@ -72,10 +77,6 @@ <!-- Vue.js Script --> <script src="lol/script.js"></script> <script> - var clusterize = new Clusterize({ - scrollId: 'scrollArea', - contentId: 'contentArea', - }); </script> </body> </html> 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() { |
