+
+function displayMessage(data, self_sent) {
+ var new_entry = document.createElement("div");
+ withMaybeScroll(
+ function () {
+ if (self_sent) {
+ new_entry.setAttribute("class", "stream-entry self-sent");
+ document.getElementById("main-input").value = "";
+ } else {
+ new_entry.setAttribute("class", "stream-entry");
+ }
+ new_entry.innerHTML = data;
+ document.getElementById("stream").appendChild(new_entry);
+ });
+}
+
+function setConnectedText(string, to_class) {
+ var stream_metabox = document.getElementById("connection-status");
+ stream_metabox.textContent = "[" + string + "]";
+ stream_metabox.setAttribute("class", to_class);
+}
+