mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-01 10:01:12 +01:00
Merge branch 'master' of https://github.com/designcreateplay/NodeBB
This commit is contained in:
@@ -759,7 +759,12 @@ body .navbar .nodebb-inline-block {
|
||||
#notif-list {
|
||||
li {
|
||||
font-size: 12px;
|
||||
width: 200px;
|
||||
width: 300px;
|
||||
text-align: left;
|
||||
|
||||
a {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
&.unread {
|
||||
background: #eceff5;
|
||||
|
||||
@@ -129,6 +129,10 @@
|
||||
if (counts.unread > 0) notifIcon.className = 'icon-circle active';
|
||||
else notifIcon.className = 'icon-circle-blank';
|
||||
});
|
||||
socket.on('event:new_notification', function() {
|
||||
console.log('WOOT');
|
||||
document.querySelector('.notifications a i').className = 'icon-circle active';
|
||||
});
|
||||
socket.emit('api:notifications.counts');
|
||||
}());
|
||||
</script>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav pull-right nodebb-inline-block" id="right-menu">
|
||||
<li class="notifications dropdown">
|
||||
<li class="notifications dropdown text-center">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="notif_dropdown"><i class="icon-circle-blank"></i></a>
|
||||
<ul id="notif-list" class="dropdown-menu" aria-labelledby="notif_dropdown">
|
||||
<li><a href="#"><i class="icon-refresh icon-spin"></i> Loading Notifications</a></li>
|
||||
|
||||
@@ -55,6 +55,7 @@ var config = require('../config.js'),
|
||||
(function(uid) {
|
||||
Notifications.remove_by_uniqueId(notif_data.uniqueId, uid, function() {
|
||||
RDB.zadd('uid:' + uid + ':notifications:unread', notif_data.score, nid);
|
||||
global.io.sockets.in('uid_' + uid).emit('event:new_notification');
|
||||
if (callback) callback(true);
|
||||
});
|
||||
})(uids[x]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
var SocketIO = require('socket.io').listen(global.server,{log:false}),
|
||||
var SocketIO = require('socket.io').listen(global.server, { log:false }),
|
||||
cookie = require('cookie'),
|
||||
connect = require('connect'),
|
||||
config = require('../config.js'),
|
||||
@@ -58,6 +58,7 @@ var SocketIO = require('socket.io').listen(global.server,{log:false}),
|
||||
userSockets[uid].push(socket);
|
||||
user.go_online(uid);
|
||||
|
||||
socket.join('uid_' + uid);
|
||||
|
||||
/*process.on('uncaughtException', function(err) {
|
||||
// handle the error safely
|
||||
|
||||
Reference in New Issue
Block a user