Skip to content

Node.js based forum software built for the modern web

topic/browsing/list and topic/browsing/count components

psychobunnye06e1dccb631
diff --git a/NOTES.md b/NOTES.md
index 0bc8d51d76..79c8aceb34 100644
--- a/NOTES.md
+++ b/NOTES.md
@@ -4,14 +4,19 @@ Deprecation TODO's for post - 0.7x
- public/src/components.js: remove pre-0.7x compatibility code
- public/src/client/topic/postTools.js: remove selectors for every post button (ex. ".edit")
- remove all pre-0.7x compatibility selectors for:
- .post-content
- .topic-title
- .post_reply
- .edit
- .delete
- .purge
- .move
- .reply
- .quote
- .chat
- .flag
\ No newline at end of file
+ Topics -
+ .post-content
+ .topic-title
+ .post_reply
+ .edit
+ .delete
+ .purge
+ .move
+ .reply
+ .quote
+ .chat
+ .flag
+ .thread_active_users
+ .browsing-users
+ .thread_active_users
+ .user-count
\ No newline at end of file
diff --git a/public/src/client/topic/browsing.js b/public/src/client/topic/browsing.js
index 935439fa88..bdb5ee25dd 100644
--- a/public/src/client/topic/browsing.js
+++ b/public/src/client/topic/browsing.js
@@ -10,7 +10,7 @@ define('forum/topic/browsing', function() {
Browsing.onUpdateUsersInRoom = function(data) {
if (data && data.room.indexOf('topic_' + ajaxify.variables.get('topic_id')) !== -1) {
- $('.browsing-users').toggleClass('hidden', !data.users.length);
+ $('.thread_active_users-users, [component="topic/browsing/list"]').parent().toggleClass('hidden', !data.users.length);
for(var i=0; i<data.users.length; ++i) {
addUserIcon(data.users[i]);
}
@@ -20,7 +20,7 @@ define('forum/topic/browsing', function() {
};
Browsing.onUserEnter = function(data) {
- var activeEl = $('.thread_active_users');
+ var activeEl = $('.thread_active_users, [component="topic/browsing/list"]');
var user = activeEl.find('a[data-uid="' + data.uid + '"]');
if (!user.length && activeEl.first().children().length < 10) {
addUserIcon(data);
@@ -35,7 +35,7 @@ define('forum/topic/browsing', function() {
if (app.user.uid === parseInt(uid, 10)) {
return;
}
- var user = $('.thread_active_users').find('a[data-uid="' + uid + '"]');
+ var user = $('.thread_active_users, [component="topic/browsing/list"]').find('a[data-uid="' + uid + '"]');
if (user.length) {
var count = Math.max(0, parseInt(user.attr('data-count'), 10) - 1);
user.attr('data-count', count);
@@ -63,7 +63,7 @@ define('forum/topic/browsing', function() {
}
function updateBrowsingUsers(data) {
- var activeEl = $('.thread_active_users');
+ var activeEl = $('.thread_active_users, [component="topic/browsing/list"]');
var user = activeEl.find('a[data-uid="'+ data.uid + '"]');
if (user.length && data.status === 'offline') {
user.parent().remove();
@@ -74,7 +74,7 @@ define('forum/topic/browsing', function() {
if (!user.userslug) {
return;
}
- var activeEl = $('.thread_active_users');
+ var activeEl = $('.thread_active_users, [component="topic/browsing/list"]');
var userEl = createUserIcon(user.uid, user.picture, user.userslug, user.username);
var isSelf = parseInt(user.uid, 10) === parseInt(app.user.uid, 10);
if (isSelf) {
@@ -89,7 +89,7 @@ define('forum/topic/browsing', function() {
}
function createUserIcon(uid, picture, userslug, username) {
- if(!$('.thread_active_users').find('[data-uid="' + uid + '"]').length) {
+ if(!$('.thread_active_users, [component="topic/browsing/list"]').find('[data-uid="' + uid + '"]').length) {
return $('<div class="inline-block"><a data-uid="' + uid + '" data-count="1" href="' + config.relative_path + '/user/' + userslug + '"><img title="' + username + '" src="'+ picture +'"/></a></div>');
}
}
@@ -99,11 +99,11 @@ define('forum/topic/browsing', function() {
if (!count || count < 0) {
count = 0;
}
- $('.user-count').text(count).parent().toggleClass('hidden', count === 0);
+ $('.user-count, [component="topic/browsing/count"]').text(count).parent().toggleClass('hidden', count === 0);
}
function increaseUserCount(incr) {
- updateUserCount(parseInt($('.user-count').first().text(), 10) + incr);
+ updateUserCount(parseInt($('.user-count, [component="topic/browsing/count"]').first().text(), 10) + incr);
}
return Browsing;