diff --git a/public/css/style.less b/public/css/style.less index 5d406dd732..5cb9d0b0ff 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -722,4 +722,15 @@ body .navbar .nodebb-inline-block { max-width:200px; max-height:60px; } +} + +.username-field { + .icon-circle { + font-size: 12px; + color: green; + } + .icon-circle-blank { + font-size: 12px; + color: red; + } } \ No newline at end of file diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index abd7405c9f..19a5fd123f 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -56,6 +56,8 @@ var ajaxify = {}; callback(); } + app.process_page(); + jQuery('#content, #footer').fadeIn(200); }, url, template); diff --git a/public/src/app.js b/public/src/app.js index 6cc39b60b7..c5a2f58bc9 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -277,6 +277,35 @@ var socket, app.current_room = room; }; + app.process_page = function() { + + function populate_online_users() { + var uids = []; + + jQuery('.post-row').each(function() { + uids.push(this.getAttribute('data-uid')); + }); + + socket.emit('api:user.get_online_users', uids); + } + + + populate_online_users(); + + } + + socket.on('api:user.get_online_users', function(users) { + jQuery('.username-field').each(function() { + var uid = jQuery(this).parents('li').attr('data-uid'); + + if (uid && jQuery.inArray(uid, users) !== -1) { + jQuery(this).prepend(''); + } else { + jQuery(this).prepend(''); + } + }); + }); + jQuery('document').ready(function() { app.enter_room('global'); diff --git a/public/templates/category.tpl b/public/templates/category.tpl index 9cf185e487..5640a9254e 100644 --- a/public/templates/category.tpl +++ b/public/templates/category.tpl @@ -5,12 +5,16 @@
+
+ There are no topics in this category.
+ Why don't you try posting one? +