|
|
|
@ -114,6 +114,17 @@ var socket,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
socket.on('event:banned', function() {
|
|
|
|
|
app.alert({
|
|
|
|
|
title: 'Banned',
|
|
|
|
|
message: 'You are banned you will be logged out!',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
timeout: 1000
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
setTimeout(app.logout, 1000);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.enter_room('global');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -121,6 +132,14 @@ var socket,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.logout = function() {
|
|
|
|
|
$.post(RELATIVE_PATH + '/logout', {
|
|
|
|
|
_csrf: $('#csrf_token').val()
|
|
|
|
|
}, function() {
|
|
|
|
|
window.location = RELATIVE_PATH + '/';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// takes a string like 1000 and returns 1,000
|
|
|
|
|
app.addCommas = function (text) {
|
|
|
|
|
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
|
|
|
|
|