Merge pull request #105 from esSteres/indev

Use twemoji (for #94)
This commit is contained in:
Sakimori 2021-01-02 18:13:15 -05:00 committed by GitHub
commit cda703bfae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View File

@ -61,4 +61,8 @@ h2 {
#link_div > a:hover { #link_div > a:hover {
color: white; color: white;
}
img.emoji {
height: 14px;
} }

View File

@ -7,7 +7,6 @@ $(document).ready(function (){
}); });
socket.on("states_update", function (json) { //json is an object containing all game updates socket.on("states_update", function (json) { //json is an object containing all game updates
console.log(json)
var searchparams = new URLSearchParams(window.location.search); var searchparams = new URLSearchParams(window.location.search);
var exists = false; var exists = false;
for (game of json) { for (game of json) {
@ -17,7 +16,10 @@ $(document).ready(function (){
} }
} }
if (!exists) { if (!exists) {
// inform the user the game has ended $('game').remove()
$('#game_container').text("The game you're looking for either doesn't exist or has already ended.")
} }
twemoji.parse(document.body);
}); });
}); });

View File

@ -89,9 +89,10 @@ const insertEmpty = (grid) => {
const insertGame = (gridboxnum, game) => { const insertGame = (gridboxnum, game) => {
var thisBox = grid.children[gridboxnum]; var thisBox = grid.children[gridboxnum];
thisBox.innerHTML = game.html;
thisBox.className = "game"; thisBox.className = "game";
thisBox.timestamp = game.timestamp; thisBox.timestamp = game.timestamp;
thisBox.innerHTML = game.html;
twemoji.parse(thisBox);
}; };
const insertLeague = (league) => { const insertLeague = (league) => {

View File

@ -1,6 +1,7 @@
<html lang="en-US"> <html lang="en-US">
<head> <head>
<script src="//code.jquery.com/jquery-3.5.1.min.js"></script> <script src="//code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.0.4/socket.io.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.0.4/socket.io.js"></script>
<script type="text/javascript" async src="https://platform.twitter.com/widgets.js"></script> <script type="text/javascript" async src="https://platform.twitter.com/widgets.js"></script>