]> git.scottworley.com Git - reliable-chat/blobdiff - webclient/rc.html
Feed the median-timestamp updates back into the UI
[reliable-chat] / webclient / rc.html
index 573ee6a42c78e44d4eb50aea1ee63f28aff96074..4137de1d2c06c8613a5ecf040bcc0c1ee5ea12c5 100644 (file)
                        history.splice(hi,1);
                        rcaddmessagetohistory(message);
                }
+
+               // Update the UI
+               var spans = message.UI.getElementsByTagName("span");
+               for (var i in spans) {
+                       if (spans[i].getAttribute && spans[i].getAttribute("class") == "timestamp") {
+                               spans[i].firstChild.data = rcformattime(message.Time);
+                       }
+               }
        }
 
        function rcreceivemessages(server, messages) {