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")
.data("id");
// Remove modes
var name = user.html().replace(/[\s+@]/g, "");
// Strip modes.
var name = user.html().trim().replace(/[+%@~]/, "");
if (name.match(/[#.]|-!-/) != null) {
return;
}

View File

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