added option to disable webchat input
This commit is contained in:
parent
689df03b78
commit
32fdf9da86
3 changed files with 30 additions and 24 deletions
32
web/map.js
32
web/map.js
|
|
@ -202,21 +202,23 @@ DynMap.prototype = {
|
|||
var messagelist = me.messagelist = $('<div/>')
|
||||
.addClass('messagelist')
|
||||
.appendTo(chat);
|
||||
var chatinput = me.chatinput = $('<input/>')
|
||||
.addClass('chatinput')
|
||||
.attr({
|
||||
id: 'chatinput',
|
||||
type: 'text',
|
||||
value: ''
|
||||
})
|
||||
.keydown(function(event) {
|
||||
if (event.keyCode == '13') {
|
||||
event.preventDefault();
|
||||
sendChat(chatinput.val());
|
||||
chatinput.val('');
|
||||
}
|
||||
})
|
||||
.appendTo(chat);
|
||||
if (me.options.allowchat === 'true') {
|
||||
var chatinput = me.chatinput = $('<input/>')
|
||||
.addClass('chatinput')
|
||||
.attr({
|
||||
id: 'chatinput',
|
||||
type: 'text',
|
||||
value: ''
|
||||
})
|
||||
.keydown(function(event) {
|
||||
if (event.keyCode == '13') {
|
||||
event.preventDefault();
|
||||
sendChat(chatinput.val());
|
||||
chatinput.val('');
|
||||
}
|
||||
})
|
||||
.appendTo(chat);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Enable hash-links.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue