Tabcomplete names

This commit is contained in:
Mattias Erming 2014-07-09 18:54:16 +02:00
parent 9e528e5f00
commit 33d3f8f386
2 changed files with 9 additions and 1 deletions

View file

@ -434,6 +434,7 @@ button {
#chat .names {
bottom: 0;
overflow: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
padding: 15px 20px;
position: absolute;

View file

@ -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());
}