mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
2cef9731ed
Added Spam Message config Internal server now replies a spam message Fixed getting webchat-interval to get int rather than double then cast Fixed holding down "enter" on the empty chat line would spam chat attempts Fixed so jsonip.appspot query is only done once
21 lines
437 B
JavaScript
21 lines
437 B
JavaScript
var ip;
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "http://jsonip.appspot.com/?callback=?",
|
|
dataType: "jsonp",
|
|
success: function(getip) { ip = getip.ip; }
|
|
});
|
|
function sendChat(me, message) {
|
|
var data = '{"name":"'+ip+'","message":"'+message+'"}';
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'up/sendmessage',
|
|
data: data,
|
|
dataType: 'json',
|
|
success: function(response) {
|
|
//handle response
|
|
if(response)
|
|
me.onPlayerChat('', response);
|
|
}
|
|
});
|
|
} |