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
|
2014-06-26 23:14:43 +08:00
|
|
|
"click .raiseHand": (event) -> #Meteor.call('userRaiseHand', @_id)
|
2014-06-12 22:08:55 +08:00
|
|
|
|
2014-06-26 23:14:43 +08:00
|
|
|
"click .disableCam": (event) -> #Meteor.call('userToggleCam', @_id, false)
|
2014-06-12 22:08:55 +08:00
|
|
|
|
2014-06-26 23:14:43 +08:00
|
|
|
"click .disableMic": (event) -> #Meteor.call('userToggleMic', @_id, false)
|
2014-06-12 22:08:55 +08:00
|
|
|
|
2014-06-26 23:14:43 +08:00
|
|
|
"click .enableMic": (event) -> #Meteor.call('userToggleMic', @_id, true)
|
2014-06-12 22:08:55 +08:00
|
|
|
|
2014-06-26 23:14:43 +08:00
|
|
|
"click .enableCam": (event) -> #Meteor.call('userToggleCam', @_id, true)
|
2014-06-12 22:08:55 +08:00
|
|
|
|
2014-06-26 23:14:43 +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
|
2014-07-03 01:13:00 +08:00
|
|
|
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
|
|
|
|
2014-06-24 01:20:08 +08:00
|
|
|
|
2014-06-26 23:14:43 +08:00
|
|
|
"click .kickUser": (event) ->
|
2014-06-24 01:20:08 +08:00
|
|
|
Meteor.Users.update({_id:@_id}, {$set: {meetingId: ""}})
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userKickUser', @_id)
|
2014-06-17 01:45:17 +08:00
|
|
|
|
|
|
|
Template.displayOtherUsersControls.events
|
|
|
|
"click .disableMic": (event) ->
|
|
|
|
event.stopImmediatePropagation()
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userToggleMic', @_id, false)
|
2014-06-17 01:45:17 +08:00
|
|
|
"click .enableMic": (event) ->
|
|
|
|
event.stopImmediatePropagation()
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userToggleMic', @_id, true)
|
2014-06-17 01:45:17 +08:00
|
|
|
"click .disableCam": (event) ->
|
|
|
|
event.stopImmediatePropagation()
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userToggleCam', @_id, false)
|
2014-06-17 01:45:17 +08:00
|
|
|
"click .enableCam": (event) ->
|
|
|
|
event.stopImmediatePropagation()
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userToggleCam', @_id, true)
|
2014-06-17 01:45:17 +08:00
|
|
|
|
|
|
|
Template.displayOwnControls.events
|
|
|
|
"click .disableMic": (event) ->
|
|
|
|
event.stopImmediatePropagation()
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userToggleMic', @_id, false)
|
|
|
|
|
2014-06-17 01:45:17 +08:00
|
|
|
"click .enableMic": (event) ->
|
|
|
|
event.stopImmediatePropagation()
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userToggleMic', @_id, true)
|
|
|
|
|
2014-06-17 01:45:17 +08:00
|
|
|
"click .disableCam": (event) ->
|
|
|
|
event.stopImmediatePropagation()
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userToggleCam', @_id, false)
|
|
|
|
|
2014-06-17 01:45:17 +08:00
|
|
|
"click .enableCam": (event) ->
|
|
|
|
event.stopImmediatePropagation()
|
2014-06-26 23:14:43 +08:00
|
|
|
#Meteor.call('userToggleCam', @_id, true)
|
2014-06-23 21:21:03 +08:00
|
|
|
|