Update chat stuff to point to new+improved server code
This commit is contained in:
parent
676b5f0ee2
commit
29a805ab87
@ -53,9 +53,8 @@ function serverProblemsDialog(errmsg) {
|
||||
}
|
||||
|
||||
function mkApiUrl(action, server) {
|
||||
server = typeof server !== 'undefined' ? server : "gs";
|
||||
server = "gs";
|
||||
return "http://" + server + ".terranquest.net/" + action + ".php";
|
||||
//return "config/" + action + ".json";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ function refreshStats() {
|
||||
|
||||
function getChat() {
|
||||
if (lockGot) {
|
||||
$.getJSON(mkApiUrl('chat', 'cs'), {
|
||||
$.getJSON(mkApiUrl('chat'), {
|
||||
lat: latitude,
|
||||
long: longitude
|
||||
}, function (data) {
|
||||
@ -59,10 +59,10 @@ function getChat() {
|
||||
var content = "";
|
||||
data.forEach(function (msg) {
|
||||
var usernameclass = "chat-username";
|
||||
if (msg.username === 'skylarmt') {
|
||||
if (msg.nickname === 'skylarmt') {
|
||||
usernameclass = "chat-username-admin";
|
||||
}
|
||||
content += "<span class='" + usernameclass + "' onclick='openProfile(\"" + msg.username + "\");'>" + msg.username + "</span> " + msg.message + "<br />";
|
||||
content += "<span class='" + usernameclass + "' onclick='openProfile(\"" + msg.nickname + "\");'>" + msg.nickname + "</span> " + msg.message + "<br />";
|
||||
});
|
||||
$('#chatmsgs').html(content);
|
||||
});
|
||||
@ -81,8 +81,7 @@ setInterval(function () {
|
||||
$("#chatsendform").submit(function (event) {
|
||||
var message = $('#chatbox-input').val();
|
||||
if (message !== '') {
|
||||
$.post(mkApiUrl('chat', 'cs'), {
|
||||
user: username,
|
||||
$.post(mkApiUrl('chat'), {
|
||||
lat: latitude,
|
||||
long: longitude,
|
||||
msg: message
|
||||
|
Reference in New Issue
Block a user