mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
closes #806
This commit is contained in:
@@ -18,19 +18,26 @@ define(function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Admin.updateRoomUsage = function(err, data) {
|
Admin.updateRoomUsage = function(err, data) {
|
||||||
console.log(arguments);
|
var active_users = $('#active_users'),
|
||||||
var active_users = document.getElementById('active_users'),
|
|
||||||
total = 0;
|
total = 0;
|
||||||
active_users.innerHTML = '';
|
|
||||||
|
if(!active_users.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
active_users.html('');
|
||||||
|
|
||||||
|
var usersHtml = '';
|
||||||
|
|
||||||
for (var room in data) {
|
for (var room in data) {
|
||||||
if (room !== '') {
|
if (room !== '') {
|
||||||
var count = $(data[room]).length;
|
var count = $(data[room]).length;
|
||||||
total += count;
|
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;
|
document.getElementById('connections').innerHTML = total;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -686,22 +686,21 @@ define(['composer'], function(composer) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('event:post_edited', function(data) {
|
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) {
|
||||||
|
|
||||||
if (editedPostTitle.length > 0) {
|
|
||||||
editedPostTitle.fadeOut(250, function() {
|
editedPostTitle.fadeOut(250, function() {
|
||||||
editedPostTitle.html(data.title);
|
editedPostTitle.html(data.title);
|
||||||
editedPostTitle.fadeIn(250);
|
editedPostTitle.fadeIn(250);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(editedPostEl).fadeOut(250, function() {
|
editedPostEl.fadeOut(250, function() {
|
||||||
this.innerHTML = data.content;
|
editedPostEl.html(data.content);
|
||||||
$(this).fadeIn(250);
|
editedPostEl.find('img').addClass('img-responsive');
|
||||||
|
editedPostEl.fadeIn(250);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('posts.favourite', function(data) {
|
socket.on('posts.favourite', function(data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user