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

67 lines
2.2 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 = @
2015-07-09 01:09:29 +08:00
chats = getInSession('chats')
if chats isnt undefined
for chat in chats
if chat.userId is _this.userId
chat.gotMail = false
break
setInSession 'chats', chats
'click .gotUnreadPublic': (event) ->
2015-07-09 01:09:29 +08:00
chats = getInSession('chats')
if chats isnt undefined
for chat in chats
if chat.userId is 'PUBLIC_CHAT'
chat.gotMail = false
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