v1.18.x
Baris Soner Usakli 11 years ago
parent 1dddd77ae1
commit 8c1c844007

@ -18,19 +18,26 @@ define(function() {
};
Admin.updateRoomUsage = function(err, data) {
console.log(arguments);
var active_users = document.getElementById('active_users'),
var active_users = $('#active_users'),
total = 0;
active_users.innerHTML = '';
if(!active_users.length) {
return;
}
active_users.html('');
var usersHtml = '';
for (var room in data) {
if (room !== '') {
var count = $(data[room]).length;
total += count;
active_users.innerHTML = active_users.innerHTML + "<div class='alert alert-success'><strong>" + room + "</strong> " + count + " active user" + (count > 1 ? "s" : "") + "</div>";
usersHtml += "<div class='alert alert-success'><strong>" + room + "</strong> " + count + " active user" + (count > 1 ? "s" : "") + "</div>";
}
}
active_users.html(usersHtml);
document.getElementById('connections').innerHTML = total;
};

@ -686,22 +686,21 @@ define(['composer'], function(composer) {
});
socket.on('event:post_edited', function(data) {
var editedPostEl = document.getElementById('content_' + data.pid);
var editedPostEl = $('#content_' + data.pid),
editedPostTitle = $('#topic_title_' + data.pid);
var editedPostTitle = $('#topic_title_' + data.pid);
if (editedPostTitle.length > 0) {
if (editedPostTitle.length) {
editedPostTitle.fadeOut(250, function() {
editedPostTitle.html(data.title);
editedPostTitle.fadeIn(250);
});
}
$(editedPostEl).fadeOut(250, function() {
this.innerHTML = data.content;
$(this).fadeIn(250);
editedPostEl.fadeOut(250, function() {
editedPostEl.html(data.content);
editedPostEl.find('img').addClass('img-responsive');
editedPostEl.fadeIn(250);
});
});
socket.on('posts.favourite', function(data) {

Loading…
Cancel
Save