Slight fix to tabcomplete

This commit is contained in:
calzoneman 2014-01-30 23:17:19 -06:00
parent 6051dd3939
commit b762bb3747
1 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,12 @@ $("#guestname").keydown(function (ev) {
function chatTabComplete() {
var words = $("#chatline").val().split(" ");
var current = words[words.length - 1].toLowerCase();
if (!current.match(/^[\w-]{1,20}$/)) {
return;
}
console.log($("#userlist").children().map);
var users = $("#userlist").children().map(function (_, elem) {
return elem.children[1].innerHTML;
}).filter(function (_, name) {