# HG changeset patch # User John "Elwin" Edwards # Date 1341970776 25200 # Node ID a4d3ecf188b72825b7343c3b0eb139135e779863 # Parent e07f9879912071466deabd1c9ccc7a35fc22a70f RLG-Web client: replace setTitle() with message(). Remove the title line, and make setTitle() add a message instead. Also remove setTitle() from termemu.js, because shterm.js duplicates the code. diff -r e07f98799120 -r a4d3ecf188b7 index-rlg.html --- a/index-rlg.html Tue Jul 10 16:32:49 2012 -0700 +++ b/index-rlg.html Tue Jul 10 18:39:36 2012 -0700 @@ -11,7 +11,6 @@

RLG-Web β3

- bell
TERM
diff -r e07f98799120 -r a4d3ecf188b7 rlgterm.js --- a/rlgterm.js Tue Jul 10 16:32:49 2012 -0700 +++ b/rlgterm.js Tue Jul 10 18:39:36 2012 -0700 @@ -385,7 +385,6 @@ function setup() { keyHexCodes.init(); termemu.init("termwrap", 24, 80); - setTitle("Not connected."); setmode("login"); /* Set up the text size. */ var cssSize = termemu.view.style.fontSize; @@ -445,7 +444,6 @@ /* Success */ session.lcred = reply.k; session.lname = reply.u; - setTitle("Logged in as " + reply.u); debug(0, "Logged in as " + reply.u + " with id " + reply.k); message("You are now logged in as " + reply.u + "."); setmode("choose"); @@ -623,7 +621,6 @@ session.id = reply.id; session.playing = true; termemu.resize(reply.h, reply.w); - setTitle("Playing as " + session.lname); debug(1, "Playing with id " + session.id); message("You are now playing " + game.name + "."); setmode("play"); @@ -659,7 +656,6 @@ termemu.resize(reply.h, reply.w); termemu.reset(); termemu.toAltBuf(); - setTitle("Watching"); debug(1, "Watching with id " + session.id); var pname = reply.p; var gname = games[reply.g].name; @@ -705,7 +701,6 @@ message("Welcome " + reply.u + ", you are now registered."); session.lcred = reply.k; session.lname = reply.u; - setTitle("Logged in as " + session.lname); debug(1, "Logged in as " + session.lname + " with id " + session.lcred); message("You are now logged in as " + reply.u + "."); setmode("choose"); @@ -734,7 +729,6 @@ session.id = null; session.playing = false; ajaxstate.clear(); - setTitle("Game over."); termemu.toNormBuf(); nsend = 0; nrecv = 0; @@ -843,6 +837,10 @@ return; } +function setTitle(tstr) { + message(tstr); +} + function textsize(larger) { var cssSize = termemu.view.style.fontSize; if (!cssSize) { diff -r e07f98799120 -r a4d3ecf188b7 termemu.js --- a/termemu.js Tue Jul 10 16:32:49 2012 -0700 +++ b/termemu.js Tue Jul 10 18:39:36 2012 -0700 @@ -1162,16 +1162,6 @@ } }; -function setTitle(tstr) { - var titlespan = document.getElementById("ttitle"); - var tnode = document.createTextNode(tstr); - if (titlespan.childNodes.length == 0) - titlespan.appendChild(tnode); - else - titlespan.replaceChild(tnode, titlespan.childNodes[0]); - return; -} - function dchunk(codes) { var dstr = "Chunk: "; for (var i = 0; i < codes.length; i++) {