mirror of https://github.com/calzoneman/sync.git
Fix singular words (Issue #46)
This commit is contained in:
parent
7b6bba3697
commit
d7de1fc69e
|
@ -142,7 +142,11 @@ function initCallbacks() {
|
||||||
/* REGION Chat */
|
/* REGION Chat */
|
||||||
|
|
||||||
socket.on("usercount", function(data) {
|
socket.on("usercount", function(data) {
|
||||||
$("#usercount").text(data.count + " connected users");
|
var text = data.count + " connected user";
|
||||||
|
if(data.count != 1) {
|
||||||
|
text += "s";
|
||||||
|
}
|
||||||
|
$("#usercount").text(text);
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("chatMsg", function(data) {
|
socket.on("chatMsg", function(data) {
|
||||||
|
@ -204,9 +208,12 @@ function initCallbacks() {
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("drinkCount", function(data) {
|
socket.on("drinkCount", function(data) {
|
||||||
var count = data.count;
|
if(data.count != 0) {
|
||||||
if(count != 0) {
|
var text = data.count + " drink";
|
||||||
$("#drinkcount").text(count + " drinks");
|
if(data.count != 1) {
|
||||||
|
text += "s";
|
||||||
|
}
|
||||||
|
$("#drinkcount").text(text);
|
||||||
$(".drinkbar").show();
|
$(".drinkbar").show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue