more fixes

This commit is contained in:
Calvin Montgomery 2013-06-24 23:40:42 -04:00
parent 8b0a960440
commit dc7eeed360
2 changed files with 9 additions and 2 deletions

View File

@ -72,6 +72,12 @@ function handle(chan, user, msg, data) {
} }
else if(msg.indexOf("/d") == 0 && msg.length > 2 && else if(msg.indexOf("/d") == 0 && msg.length > 2 &&
msg[2].match(/[-0-9 ]/)) { msg[2].match(/[-0-9 ]/)) {
if(msg[2] == "-") {
if(msg.length == 3)
return;
if(!msg[3].match(/[0-9]/))
return;
}
handleDrink(chan, user, msg.substring(2), data); handleDrink(chan, user, msg.substring(2), data);
} }
else if(msg.indexOf("/clear") == 0) { else if(msg.indexOf("/clear") == 0) {

View File

@ -71,10 +71,11 @@ $("#listloaded_refresh").click(function() {
menuHandler("#show_actionlog", "#actionlog"); menuHandler("#show_actionlog", "#actionlog");
$("#show_actionlog").click(getActionLog); $("#show_actionlog").click(getActionLog);
$("#actionlog_filter").click(function() { $("#actionlog_filter").click(function() {
var tbl = $("#actionlog table");
var actions = $(this).val(); var actions = $(this).val();
$("#actionlog tbody").remove(); $("#actionlog tbody").remove();
var entries = []; var entries = [];
$("#actionlog table").data("allentries").forEach(function(e) { tbl.data("allentries").forEach(function(e) {
if(actions.indexOf(e.action) == -1) if(actions.indexOf(e.action) == -1)
return; return;
entries.push(e); entries.push(e);
@ -398,7 +399,7 @@ function setupCallbacks() {
var x = a.name, y = b.name; var x = a.name, y = b.name;
return x == y ? 0 : (x < y ? -1 : 1); return x == y ? 0 : (x < y ? -1 : 1);
} }
return a.usercount < b.usercount ? -1 : 1; return a.usercount < b.usercount ? 1 : -1;
}); });
var total = 0; var total = 0;
data.forEach(function(c) { data.forEach(function(c) {