mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
online counter now working
This commit is contained in:
parent
efdb3b8963
commit
ad86901f0b
2 changed files with 16 additions and 1 deletions
|
@ -468,6 +468,19 @@ var paduserlist = (function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateInviteNotice();
|
updateInviteNotice();
|
||||||
|
|
||||||
|
console.log(self.updateNumberOfOnlineUsers());
|
||||||
|
},
|
||||||
|
updateNumberOfOnlineUsers: function(){
|
||||||
|
var online = 1; // you are always online!
|
||||||
|
for(var i=0;i<otherUsersData.length;i++) {
|
||||||
|
if(otherUsersData[i].status == "")
|
||||||
|
{
|
||||||
|
online++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$("#online_count").text(online);
|
||||||
|
return online;
|
||||||
},
|
},
|
||||||
userLeave: function(info) {
|
userLeave: function(info) {
|
||||||
var existingIndex = findExistingIndex(info.userId);
|
var existingIndex = findExistingIndex(info.userId);
|
||||||
|
@ -498,6 +511,8 @@ var paduserlist = (function() {
|
||||||
userData.leaveTimer = thisLeaveTimer;
|
userData.leaveTimer = thisLeaveTimer;
|
||||||
}
|
}
|
||||||
updateInviteNotice();
|
updateInviteNotice();
|
||||||
|
|
||||||
|
console.log(self.updateNumberOfOnlineUsers());
|
||||||
},
|
},
|
||||||
showGuestPrompt: function(userId, displayName) {
|
showGuestPrompt: function(userId, displayName) {
|
||||||
if (knocksToIgnore[userId]) {
|
if (knocksToIgnore[userId]) {
|
||||||
|
|
|
@ -122,7 +122,7 @@ var clientVars = {}; // ]]>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="javascript:void (window.pad&&pad.editbarClick('showusers'));" title="Show connected users">
|
<a href="javascript:void (window.pad&&pad.editbarClick('showusers'));" title="Show connected users">
|
||||||
<img id="showusersicon" src="/static/img/mar11/editbar_showusers.gif" /> <span>1</span>
|
<img id="showusersicon" src="/static/img/mar11/editbar_showusers.gif" /> <span id="online_count">1</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue