mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
closes #806
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user