Some status improvements.

Status messages now consistently use the game's uname, and the table
of choices puts the games in the right order.
This commit is contained in:
John "Elwin" Edwards 2012-06-20 08:49:10 -07:00
parent 4c27e44ef8
commit f711cdb591
2 changed files with 10 additions and 4 deletions

View file

@ -454,7 +454,13 @@ function getcurrent() {
var cell2 = document.createElement("div");
var cell3 = document.createElement("div");
cell1.appendChild(document.createTextNode(reply.g[i].p));
cell2.appendChild(document.createTextNode(reply.g[i].g));
var uname = reply.g[i].g;
if (uname in games)
cell2.appendChild(document.createTextNode(games[uname].name));
else {
debug(1, "Unrecognized game: " + uname);
continue;
}
var button = document.createElement("span");
button.appendChild(document.createTextNode("Watch"));
button.onclick = makeWatcher(reply.g[i].n);
@ -492,8 +498,8 @@ function getchoices() {
/* Don't remove the first child, it's the header. */
while (optdiv.childNodes.length > 1)
optdiv.removeChild(optdiv.childNodes[1]);
for (var gname in reply.stat) {
if (!(gname in games))
for (var gname in games) {
if (!(gname in reply.stat))
continue;
var acttext;
if (reply.stat[gname] == "s")