bigbluebutton-Github/labs/meteor-client/client/views/users/user_item.coffee

68 lines
2.4 KiB
CoffeeScript
Raw Normal View History

2014-06-12 22:08:55 +08:00
Template.userItem.helpers
# using handlebars' {{equals}} wasn't working for these some reason, so heres a simple JS function to do it
compareUserIds: (u1, u2) ->
u1 is u2
Template.userItem.events
"click .raiseHand": (event) -> #Meteor.call('userRaiseHand', @_id)
2014-06-12 22:08:55 +08:00
"click .disableCam": (event) -> #Meteor.call('userToggleCam', @_id, false)
2014-06-12 22:08:55 +08:00
"click .disableMic": (event) -> #Meteor.call('userToggleMic', @_id, false)
2014-06-12 22:08:55 +08:00
"click .enableMic": (event) -> #Meteor.call('userToggleMic', @_id, true)
2014-06-12 22:08:55 +08:00
"click .enableCam": (event) -> #Meteor.call('userToggleCam', @_id, true)
2014-06-12 22:08:55 +08:00
"click .lowerHand": (event) -> #Meteor.call('userLowerHand', @_id)
2014-06-12 22:08:55 +08:00
2014-06-13 03:12:09 +08:00
"click .setPresenter": (event) ->
2014-06-23 21:17:19 +08:00
#do nothing if user is already presenter
2014-06-17 23:46:49 +08:00
unless @isPresenter
2014-06-23 21:17:19 +08:00
# find user account for new presenter
selectedUser = Meteor.Users.findOne(_id:@_id)
if selectedUser? # search for current presenter
originalPresenter = Meteor.Users.findOne("user.presenter": true)
2014-06-23 21:17:19 +08:00
if originalPresenter? # unset old presenter
Meteor.Users.update {_id: originalPresenter._id},{ $set:{ "user.presenter": false}}
# set newly selected user as presenter
Meteor.Users.update {_id: selectedUser._id},{$set:{"user.presenter": true}}
2014-06-12 22:08:55 +08:00
"click .kickUser": (event) ->
Meteor.Users.update({_id:@_id}, {$set: {meetingId: ""}})
#Meteor.call('userKickUser', @_id)
Template.displayOtherUsersControls.events
"click .disableMic": (event) ->
event.stopImmediatePropagation()
#Meteor.call('userToggleMic', @_id, false)
"click .enableMic": (event) ->
event.stopImmediatePropagation()
#Meteor.call('userToggleMic', @_id, true)
"click .disableCam": (event) ->
event.stopImmediatePropagation()
#Meteor.call('userToggleCam', @_id, false)
"click .enableCam": (event) ->
event.stopImmediatePropagation()
#Meteor.call('userToggleCam', @_id, true)
Template.displayOwnControls.events
"click .disableMic": (event) ->
event.stopImmediatePropagation()
#Meteor.call('userToggleMic', @_id, false)
"click .enableMic": (event) ->
event.stopImmediatePropagation()
#Meteor.call('userToggleMic', @_id, true)
"click .disableCam": (event) ->
event.stopImmediatePropagation()
#Meteor.call('userToggleCam', @_id, false)
"click .enableCam": (event) ->
event.stopImmediatePropagation()
#Meteor.call('userToggleCam', @_id, true)
2014-06-23 21:21:03 +08:00