This commit is contained in:
Baris Usakli
2013-10-28 14:36:31 -04:00
parent ccf4ed1235
commit ac12bd0b8f
5 changed files with 38 additions and 14 deletions

View File

@@ -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,");