You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
691 B
JavaScript

define(function() {
var home = {};
home.init = function() {
ajaxify.register_events([
'user.count',
'meta.getUsageStats',
'user.getActiveUsers'
]);
socket.emit('user.count', function(data) {
$('#stats_users').html(utils.makeNumberHumanReadable(data.count)).attr('title', data.count);
});
socket.emit('meta.getUsageStats', function(data) {
$('#stats_topics').html(utils.makeNumberHumanReadable(data.topics)).attr('title', data.topics);
$('#stats_posts').html(utils.makeNumberHumanReadable(data.posts)).attr('title', data.posts);
});
socket.emit('user.getActiveUsers', function(data) {
$('#stats_online').html(data.users);
});
}
return home;
});