Added support for ~ and % modes. Close #10

This commit is contained in:
Mattias Erming 2014-06-13 12:16:47 +02:00
parent 6c8328146e
commit 9f5d3807ec
2 changed files with 8 additions and 3 deletions

View File

@ -221,8 +221,8 @@ $(function() {
.closest(".window") .closest(".window")
.data("id"); .data("id");
// Remove modes // Strip modes.
var name = user.html().replace(/[\s+@]/g, ""); var name = user.html().trim().replace(/[+%@~]/, "");
if (name.match(/[#.]|-!-/) != null) { if (name.match(/[#.]|-!-/) != null) {
return; return;
} }

View File

@ -19,7 +19,12 @@ Chan.prototype.sortUsers = function() {
this.users, this.users,
function(u) { return u.name.toLowerCase(); } function(u) { return u.name.toLowerCase(); }
); );
var modes = ["+", "@"]; var modes = [
"~",
"%",
"@",
"+",
].reverse();
modes.forEach(function(mode) { modes.forEach(function(mode) {
this.users = _.remove( this.users = _.remove(
this.users, this.users,