projects
/
mudsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Connect to the right url no matter where we connect from
[mudsync.git]
/
data
/
web-static
/
js
/
mudsync.js
diff --git
a/data/web-static/js/mudsync.js
b/data/web-static/js/mudsync.js
index 90f3daa4ef9af9d995cf1c0649a6c19ab1ff0c71..b926c146b8b8c84eda2af175aefe2398fc6a6c35 100644
(file)
--- a/
data/web-static/js/mudsync.js
+++ b/
data/web-static/js/mudsync.js
@@
-27,9
+27,9
@@
function displayMessage(data, self_sent) {
- stream_metabox.offsetHeight)) {
should_scroll = true;
}
- stream_metabox.offsetHeight)) {
should_scroll = true;
}
- document.getElementById("main-input").value = "";
if (self_sent) {
new_entry.setAttribute("class", "stream-entry self-sent");
if (self_sent) {
new_entry.setAttribute("class", "stream-entry self-sent");
+ document.getElementById("main-input").value = "";
} else {
new_entry.setAttribute("class", "stream-entry");
}
} else {
new_entry.setAttribute("class", "stream-entry");
}
@@
-42,7
+42,8
@@
function displayMessage(data, self_sent) {
function installWebsocket() {
// TODO: Don't hardcode the websocket path; pull it from the DOM
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);
};
ws.onmessage = function(evt) {
displayMessage(evt.data, false);
};