added option to disable webchat input
This commit is contained in:
parent
4c552eb6ba
commit
aba85ac512
3 changed files with 30 additions and 24 deletions
1
configuration.txt
Executable file → Normal file
1
configuration.txt
Executable file → Normal file
|
|
@ -69,6 +69,7 @@ web:
|
||||||
|
|
||||||
# showchat: modal/balloons
|
# showchat: modal/balloons
|
||||||
showchat: modal
|
showchat: modal
|
||||||
|
allowchat: true
|
||||||
messagettl: 15000
|
messagettl: 15000
|
||||||
|
|
||||||
showplayerfacesonmap: true
|
showplayerfacesonmap: true
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,8 @@ public class DynmapPlugin extends JavaPlugin {
|
||||||
webServer.handlers.put("/up/configuration", new ClientConfigurationHandler((Map<?, ?>) configuration.getProperty("web")));
|
webServer.handlers.put("/up/configuration", new ClientConfigurationHandler((Map<?, ?>) configuration.getProperty("web")));
|
||||||
|
|
||||||
SendMessageHandler messageHandler = new SendMessageHandler();
|
SendMessageHandler messageHandler = new SendMessageHandler();
|
||||||
|
boolean allowchat = configuration.getBoolean("allowchat", true);
|
||||||
|
if (allowchat == true) {
|
||||||
messageHandler.onMessageReceived.addListener(new Listener<SendMessageHandler.Message>() {
|
messageHandler.onMessageReceived.addListener(new Listener<SendMessageHandler.Message>() {
|
||||||
@Override
|
@Override
|
||||||
public void triggered(Message t) {
|
public void triggered(Message t) {
|
||||||
|
|
@ -141,6 +143,7 @@ public class DynmapPlugin extends JavaPlugin {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
webServer.handlers.put("/up/sendmessage", messageHandler);
|
webServer.handlers.put("/up/sendmessage", messageHandler);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
webServer.startServer();
|
webServer.startServer();
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,7 @@ DynMap.prototype = {
|
||||||
var messagelist = me.messagelist = $('<div/>')
|
var messagelist = me.messagelist = $('<div/>')
|
||||||
.addClass('messagelist')
|
.addClass('messagelist')
|
||||||
.appendTo(chat);
|
.appendTo(chat);
|
||||||
|
if (me.options.allowchat === 'true') {
|
||||||
var chatinput = me.chatinput = $('<input/>')
|
var chatinput = me.chatinput = $('<input/>')
|
||||||
.addClass('chatinput')
|
.addClass('chatinput')
|
||||||
.attr({
|
.attr({
|
||||||
|
|
@ -218,6 +219,7 @@ DynMap.prototype = {
|
||||||
})
|
})
|
||||||
.appendTo(chat);
|
.appendTo(chat);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Enable hash-links.
|
// TODO: Enable hash-links.
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue