- stream_metabox.offsetHeight)) {
should_scroll = true;
}
- document.getElementById("main-input").value = "";
if (self_sent) {
new_entry.setAttribute("class", "stream-entry self-sent");
+ document.getElementById("main-input").value = "";
} else {
new_entry.setAttribute("class", "stream-entry");
}
function installWebsocket() {
// TODO: Don't hardcode the websocket path; pull it from the DOM
- var ws = new WebSocket("ws://127.0.0.1:8888");
+ var address = "ws://".concat(window.location.hostname, ":", window.location.port);
+ var ws = new WebSocket(address);
ws.onmessage = function(evt) {
displayMessage(evt.data, false);
};