diff --git a/js/client-chat-tournament.js b/js/client-chat-tournament.js index 25dee5533..1f755da9d 100644 --- a/js/client-chat-tournament.js +++ b/js/client-chat-tournament.js @@ -216,11 +216,24 @@ TournamentBox.prototype.parseMessage = function (data, isBroadcast) { if (Config.server.id !== "battletower") return true; + var cmd = data.shift().toLowerCase(); if (isBroadcast) { - // TODO - return true; + switch (cmd) { + case 'info': + var $infoList = $(''); + JSON.parse(data.join('|')).forEach(function (tournament) { + var $info = $('
  • '); + $info.text(": " + BattleFormats[tournament.format].name + " " + tournament.generator + (tournament.isStarted ? " (Started)" : "")); + $info.prepend($('').attr('href', app.root + toRoomid(tournament.room).toLowerCase()).text(tournament.room)); + $infoList.append($info); + }); + this.room.$chat.append($('
    ').append($('
    ').append($infoList))); + break; + + default: + return true; + } } else { - var cmd = data.shift().toLowerCase(); switch (cmd) { case 'create': var format = BattleFormats[data[0]].name; diff --git a/style/client.css b/style/client.css index b8e4f40df..69576511a 100644 --- a/style/client.css +++ b/style/client.css @@ -981,6 +981,12 @@ a.ilink:hover { /* Tournaments */ +.tournaments-info > ul { + list-style: none; + margin: 0; + padding: 0; +} + .tournament-wrapper { display: none; position: absolute;