From b762bb37470c8a54becd9c86650534b92a996e6a Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 30 Jan 2014 23:17:19 -0600 Subject: [PATCH] Slight fix to tabcomplete --- www/assets/js/ui.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/assets/js/ui.js b/www/assets/js/ui.js index ed5fdc34..a3b9f1b0 100644 --- a/www/assets/js/ui.js +++ b/www/assets/js/ui.js @@ -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) {