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

61 lines
2.0 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 = @
setInSession 'chats', getInSession('chats').map((chat) ->
chat.gotMail = false if chat.userId is _this.userId
chat
)
Template.usernameEntry.helpers
hasGotUnreadMailClass: (userId) ->
chats = getInSession('chats')
flag = false
chats.map((tab) ->
if tab.userId is userId
if tab.gotMail
flag = true
tab
)
if flag
return "gotUnreadMail"
else
return ""