From 33d3f8f3867b22af3938ff51a17296693653ba2f Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Wed, 9 Jul 2014 18:54:16 +0200 Subject: [PATCH] Tabcomplete names --- client/css/style.css | 1 + client/js/chat.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/css/style.css b/client/css/style.css index 393fb0d2..47f7e2eb 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -434,6 +434,7 @@ button { #chat .names { bottom: 0; overflow: auto; + overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 15px 20px; position: absolute; diff --git a/client/js/chat.js b/client/js/chat.js index 01282470..356f2288 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -307,8 +307,15 @@ $(function() { }); function complete(word) { + var words = commands.slice(); + var users = chat.find(".active") + .find(".names") + .children() + .each(function() { + words.push($(this).text().replace(/[+%@~]/, "")); + }); return $.grep( - commands, + words, function(w) { return !w.toLowerCase().indexOf(word.toLowerCase()); }