bigbluebutton-Github/bigbluebutton-html5/app/client/views/users/user_item.coffee

75 lines
2.4 KiB
CoffeeScript
Raw Normal View History

Template.displayUserIcons.events
'click .muteIcon': (event) ->
toggleMic @
'click .raisedHandIcon': (event) ->
2014-09-25 03:55:55 +08:00
# the function to call 'userLowerHand'
# the meeting id
# the _id of the person whose land is to be lowered
# the userId of the person who is lowering the hand
2015-05-06 04:15:33 +08:00
BBB.lowerHand(getInSession("meetingId"), @userId, getInSession("userId"), getInSession("authToken"))
2015-04-24 02:02:56 +08:00
Template.displayUserIcons.helpers
userLockedIconApplicable: (userId) ->
# the lock settings affect the user (and requiire a lock icon) if
# the user is set to be locked and there is a relevant lock in place
locked = BBB.getUser(userId)?.user.locked
settings = Meteor.Meetings.findOne()?.roomLockSettings
lockInAction = settings.disablePrivChat or
settings.disableCam or
settings.disableMic or
settings.lockedLayout or
settings.disablePubChat
return locked and lockInAction
2015-05-08 10:52:36 +08:00
2015-05-21 22:41:58 +08:00
# Opens a private chat tab when a username from the userlist is clicked
2015-05-08 10:52:36 +08:00
Template.usernameEntry.events
2015-05-15 06:47:31 +08:00
'click .usernameEntry': (event) ->
2015-05-08 10:52:36 +08:00
userIdSelected = @.userId
unless userIdSelected is null
if userIdSelected is BBB.getCurrentUser()?.userId
setInSession "inChatWith", "PUBLIC_CHAT"
else
setInSession "inChatWith", userIdSelected
if isLandscape()
$("#newMessageInput").focus()
if isPortrait() or isPortraitMobile()
toggleUsersList()
$("#newMessageInput").focus()
'click .gotUnreadMail': (event) ->
_this = @
currentId = getInSession('userId')
if currentId isnt undefined and currentId is _this.userId
_id = "PUBLIC_CHAT"
else
_id = _this.userId
2015-07-09 01:09:29 +08:00
chats = getInSession('chats')
if chats isnt undefined
for chat in chats
if chat.userId is _id
2015-07-09 01:09:29 +08:00
chat.gotMail = false
chat.number = 0
2015-07-09 01:09:29 +08:00
break
setInSession 'chats', chats
Template.usernameEntry.helpers
hasGotUnreadMailClass: (userId) ->
2015-07-09 01:09:29 +08:00
chats = getInSession('chats')
if chats isnt undefined
2015-07-09 01:09:29 +08:00
for chat in chats
if chat.userId is userId and chat.gotMail
return true
return false
getNumberOfUnreadMessages: (userId) ->
chats = getInSession('chats')
if chats isnt undefined
for chat in chats
if chat.userId is userId and chat.gotMail
if chat.number > 9
return "9+"
else
return chat.number
return