2015-04-06 22:29:25 +08:00
|
|
|
# this method gets called from either mobile or desktop UI
|
|
|
|
# this method will adjust the UI to compensate for the new audio button
|
2015-04-15 00:05:32 +08:00
|
|
|
displayAudioSelectionMenu = ({isMobile} = {}) ->
|
2015-04-01 03:36:16 +08:00
|
|
|
isMobile ?= false
|
|
|
|
$('.joinAudioButton').blur()
|
|
|
|
|
|
|
|
if isMobile
|
|
|
|
toggleSlidingMenu()
|
|
|
|
|
2015-04-03 00:19:55 +08:00
|
|
|
if isMobile
|
2015-04-15 00:05:32 +08:00
|
|
|
$('.navbarTitle').css('width', '55%')
|
2015-04-01 03:36:16 +08:00
|
|
|
|
2015-04-06 22:29:25 +08:00
|
|
|
# pop open the dialog allowing users to choose the audio options
|
2015-04-01 03:36:16 +08:00
|
|
|
if isLandscapeMobile()
|
|
|
|
$('.joinAudio-dialog').addClass('landscape-mobile-joinAudio-dialog')
|
|
|
|
else
|
|
|
|
$('.joinAudio-dialog').addClass('desktop-joinAudio-dialog')
|
|
|
|
$("#joinAudioDialog").dialog("open")
|
|
|
|
|
2014-11-12 02:56:39 +08:00
|
|
|
# Helper to load javascript libraries from the BBB server
|
|
|
|
loadLib = (libname) ->
|
|
|
|
successCallback = ->
|
|
|
|
|
|
|
|
retryMessageCallback = (param) ->
|
2014-11-13 05:04:03 +08:00
|
|
|
#Meteor.log.info "Failed to load library", param
|
|
|
|
console.log "Failed to load library", param
|
2014-11-12 02:56:39 +08:00
|
|
|
|
|
|
|
Meteor.Loader.loadJs("http://#{window.location.hostname}/client/lib/#{libname}", successCallback, 10000).fail(retryMessageCallback)
|
|
|
|
|
2014-06-14 02:20:36 +08:00
|
|
|
# These settings can just be stored locally in session, created at start up
|
|
|
|
Meteor.startup ->
|
2014-11-12 02:56:39 +08:00
|
|
|
# Load SIP libraries before the application starts
|
2014-11-18 06:02:17 +08:00
|
|
|
loadLib('sip.js')
|
2014-11-12 02:56:39 +08:00
|
|
|
loadLib('bbb_webrtc_bridge_sip.js')
|
2015-03-03 00:30:46 +08:00
|
|
|
loadLib('bbblogger.js')
|
2014-11-12 02:56:39 +08:00
|
|
|
|
2014-09-24 02:27:59 +08:00
|
|
|
@SessionAmplify = _.extend({}, Session,
|
|
|
|
keys: _.object(_.map(amplify.store(), (value, key) ->
|
|
|
|
[
|
|
|
|
key
|
|
|
|
JSON.stringify(value)
|
|
|
|
]
|
|
|
|
))
|
|
|
|
set: (key, value) ->
|
|
|
|
Session.set.apply this, arguments
|
|
|
|
amplify.store key, value
|
|
|
|
return
|
|
|
|
)
|
2015-03-05 05:31:05 +08:00
|
|
|
#
|
2014-08-09 03:30:28 +08:00
|
|
|
Template.footer.helpers
|
2014-09-24 02:27:59 +08:00
|
|
|
getFooterString: ->
|
2014-12-16 23:55:38 +08:00
|
|
|
info = getBuildInformation()
|
2015-04-27 23:19:53 +08:00
|
|
|
foot = "(c) #{info.copyrightYear} BigBlueButton Inc. [build #{info.bbbServerVersion} - #{info.dateOfBuild}] - For more information visit #{info.link}"
|
2014-07-17 02:10:27 +08:00
|
|
|
|
2014-06-14 02:20:36 +08:00
|
|
|
Template.header.events
|
2015-04-01 03:36:16 +08:00
|
|
|
"click .joinAudioButton": (event) ->
|
2015-04-27 23:12:12 +08:00
|
|
|
if !isWebRTCAvailable()
|
|
|
|
notification_WebRTCNotSupported()
|
|
|
|
else
|
|
|
|
notification_WebRTCAudioJoined()
|
|
|
|
displayAudioSelectionMenu(isMobile: false)
|
2014-11-06 23:27:43 +08:00
|
|
|
|
2014-09-24 02:27:59 +08:00
|
|
|
"click .chatBarIcon": (event) ->
|
2014-11-02 07:11:06 +08:00
|
|
|
$(".tooltip").hide()
|
2014-09-24 02:27:59 +08:00
|
|
|
toggleChatbar()
|
2014-11-06 23:27:43 +08:00
|
|
|
|
2015-01-11 10:49:08 +08:00
|
|
|
"click .collapseSlidingMenuButton": (event) ->
|
2014-12-30 10:08:16 +08:00
|
|
|
toggleSlidingMenu()
|
2014-12-18 01:14:39 +08:00
|
|
|
$(".tooltip").hide()
|
2015-01-11 10:49:08 +08:00
|
|
|
$('.collapseSlidingMenuButton').blur()
|
2014-12-30 10:08:16 +08:00
|
|
|
$('.myNavbar').css('z-index', 1032)
|
2014-12-18 01:14:39 +08:00
|
|
|
|
2015-01-11 10:49:08 +08:00
|
|
|
'click .collapseNavbarButton': (event) ->
|
|
|
|
$(".tooltip").hide()
|
|
|
|
$('.collapseNavbarButton').blur()
|
|
|
|
toggleNavbarCollapse()
|
|
|
|
|
2014-11-06 23:27:43 +08:00
|
|
|
"click .hideNavbarIcon": (event) ->
|
2014-11-02 07:11:06 +08:00
|
|
|
$(".tooltip").hide()
|
2014-11-06 23:27:43 +08:00
|
|
|
toggleNavbar()
|
|
|
|
|
2015-04-01 03:36:16 +08:00
|
|
|
"click .leaveAudioButton": (event) ->
|
|
|
|
exitVoiceCall event
|
|
|
|
|
2014-11-06 23:27:43 +08:00
|
|
|
"click .lowerHand": (event) ->
|
2014-11-02 07:11:06 +08:00
|
|
|
$(".tooltip").hide()
|
2014-11-22 01:36:21 +08:00
|
|
|
Meteor.call('userLowerHand', getInSession("meetingId"), getInSession("userId"), getInSession("userId"), getInSession("authToken"))
|
|
|
|
|
2014-09-24 02:27:59 +08:00
|
|
|
"click .muteIcon": (event) ->
|
2014-11-02 07:11:06 +08:00
|
|
|
$(".tooltip").hide()
|
2014-09-24 02:27:59 +08:00
|
|
|
toggleMic @
|
2014-11-06 23:27:43 +08:00
|
|
|
|
|
|
|
"click .raiseHand": (event) ->
|
|
|
|
$(".tooltip").hide()
|
2014-11-22 01:36:21 +08:00
|
|
|
Meteor.call('userRaiseHand', getInSession("meetingId"), getInSession("userId"), getInSession("userId"), getInSession("authToken"))
|
2015-04-11 03:10:42 +08:00
|
|
|
|
|
|
|
# "click .settingsIcon": (event) ->
|
2014-11-06 23:27:43 +08:00
|
|
|
# alert "settings"
|
|
|
|
|
2014-09-24 02:27:59 +08:00
|
|
|
"click .signOutIcon": (event) ->
|
2014-12-20 07:51:31 +08:00
|
|
|
$('.signOutIcon').blur()
|
2015-03-10 04:31:19 +08:00
|
|
|
if isLandscapeMobile()
|
|
|
|
$('.logout-dialog').addClass('landscape-mobile-logout-dialog')
|
2014-12-20 03:01:45 +08:00
|
|
|
else
|
2015-03-10 04:31:19 +08:00
|
|
|
$('.logout-dialog').addClass('desktop-logout-dialog')
|
2014-11-21 11:15:29 +08:00
|
|
|
$("#dialog").dialog("open")
|
2015-04-01 03:36:16 +08:00
|
|
|
|
2014-09-24 02:27:59 +08:00
|
|
|
"click .hideNavbarIcon": (event) ->
|
2014-11-02 07:11:06 +08:00
|
|
|
$(".tooltip").hide()
|
2014-09-24 02:27:59 +08:00
|
|
|
toggleNavbar()
|
2014-11-06 23:27:43 +08:00
|
|
|
|
|
|
|
"click .usersListIcon": (event) ->
|
2014-11-02 07:11:06 +08:00
|
|
|
$(".tooltip").hide()
|
2014-11-06 23:27:43 +08:00
|
|
|
toggleUsersList()
|
|
|
|
|
|
|
|
"click .videoFeedIcon": (event) ->
|
2014-11-02 07:11:06 +08:00
|
|
|
$(".tooltip").hide()
|
2014-11-06 23:27:43 +08:00
|
|
|
toggleCam @
|
|
|
|
|
2014-09-24 02:27:59 +08:00
|
|
|
"click .whiteboardIcon": (event) ->
|
2014-11-02 07:11:06 +08:00
|
|
|
$(".tooltip").hide()
|
2014-09-24 02:27:59 +08:00
|
|
|
toggleWhiteBoard()
|
2014-11-06 23:27:43 +08:00
|
|
|
|
2014-09-24 02:27:59 +08:00
|
|
|
"mouseout #navbarMinimizedButton": (event) ->
|
|
|
|
$("#navbarMinimizedButton").removeClass("navbarMinimizedButtonLarge")
|
|
|
|
$("#navbarMinimizedButton").addClass("navbarMinimizedButtonSmall")
|
2014-07-31 04:22:23 +08:00
|
|
|
|
2014-11-06 23:27:43 +08:00
|
|
|
"mouseover #navbarMinimizedButton": (event) ->
|
|
|
|
$("#navbarMinimizedButton").removeClass("navbarMinimizedButtonSmall")
|
|
|
|
$("#navbarMinimizedButton").addClass("navbarMinimizedButtonLarge")
|
2014-12-30 10:08:16 +08:00
|
|
|
|
|
|
|
Template.slidingMenu.events
|
2015-04-01 03:36:16 +08:00
|
|
|
'click .joinAudioButton': (event) ->
|
2015-04-15 00:05:32 +08:00
|
|
|
displayAudioSelectionMenu(isMobile: true)
|
2014-12-30 10:08:16 +08:00
|
|
|
|
|
|
|
'click .chatBarIcon': (event) ->
|
|
|
|
$('.tooltip').hide()
|
|
|
|
toggleSlidingMenu()
|
|
|
|
toggleChatbar()
|
|
|
|
|
|
|
|
'click .lowerHand': (event) ->
|
|
|
|
$('.tooltip').hide()
|
|
|
|
toggleSlidingMenu()
|
|
|
|
Meteor.call('userLowerHand', getInSession('meetingId'), getInSession('userId'), getInSession('userId'), getInSession('authToken'))
|
|
|
|
|
|
|
|
'click .raiseHand': (event) ->
|
|
|
|
console.log 'navbar raise own hand from client'
|
|
|
|
$('.tooltip').hide()
|
|
|
|
toggleSlidingMenu()
|
|
|
|
Meteor.call('userRaiseHand', getInSession("meetingId"), getInSession("userId"), getInSession("userId"), getInSession("authToken"))
|
|
|
|
|
|
|
|
'click .usersListIcon': (event) ->
|
|
|
|
$('.tooltip').hide()
|
|
|
|
toggleSlidingMenu()
|
|
|
|
toggleUsersList()
|
|
|
|
|
|
|
|
'click .whiteboardIcon': (event) ->
|
|
|
|
$('.tooltip').hide()
|
|
|
|
toggleSlidingMenu()
|
|
|
|
toggleWhiteBoard()
|
|
|
|
|
|
|
|
'click .collapseButton': (event) ->
|
|
|
|
$('.tooltip').hide()
|
|
|
|
toggleSlidingMenu()
|
|
|
|
$('.collapseButton').blur()
|
2014-08-15 01:26:15 +08:00
|
|
|
|
2014-09-05 01:06:36 +08:00
|
|
|
Template.main.helpers
|
2015-04-01 03:36:16 +08:00
|
|
|
setTitle: ->
|
|
|
|
document.title = "BigBlueButton #{window.getMeetingName() ? 'HTML5'}"
|
2014-09-05 01:06:36 +08:00
|
|
|
|
2014-11-21 11:15:29 +08:00
|
|
|
Template.main.rendered = ->
|
2015-04-06 22:29:25 +08:00
|
|
|
# the initialization code for the dialog presenting the user with microphone+listen only options
|
2015-04-01 03:36:16 +08:00
|
|
|
$("#joinAudioDialog").dialog(
|
|
|
|
modal: true
|
|
|
|
draggable: false
|
|
|
|
resizable: false
|
|
|
|
autoOpen: false
|
|
|
|
dialogClass: 'no-close logout-dialog joinAudioDialog'
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: 'Cancel'
|
|
|
|
click: () ->
|
|
|
|
$(this).dialog("close")
|
|
|
|
$(".tooltip").hide()
|
|
|
|
class: 'btn btn-xs btn-default joinAudioDialogButton'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
open: (event, ui) ->
|
|
|
|
$('.ui-widget-overlay').bind 'click', () ->
|
|
|
|
if isMobile()
|
|
|
|
$("#joinAudioDialog").dialog('close')
|
|
|
|
position: { my: "center", at: "center", of: window }
|
|
|
|
)
|
|
|
|
|
2015-04-06 22:29:25 +08:00
|
|
|
# jQuery click events are handled here. Meteor click handlers don't get called.
|
|
|
|
# we pass in a named boolean parameter the whether we wish to join audio as listen only or not
|
2015-04-01 03:36:16 +08:00
|
|
|
$("#microphone").click ->
|
2015-04-15 00:05:32 +08:00
|
|
|
introToAudio @, isListenOnly: false
|
2015-04-01 03:36:16 +08:00
|
|
|
|
|
|
|
$("#listen_only").click ->
|
2015-04-15 00:05:32 +08:00
|
|
|
introToAudio @, isListenOnly: true
|
2015-04-01 03:36:16 +08:00
|
|
|
|
2014-11-21 11:15:29 +08:00
|
|
|
$("#dialog").dialog(
|
|
|
|
modal: true
|
|
|
|
draggable: false
|
|
|
|
resizable: false
|
|
|
|
autoOpen: false
|
|
|
|
dialogClass: 'no-close logout-dialog'
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: 'Yes'
|
|
|
|
click: () ->
|
|
|
|
userLogout getInSession("meetingId"), getInSession("userId"), true
|
|
|
|
$(this).dialog("close")
|
|
|
|
class: 'btn btn-xs btn-primary active'
|
|
|
|
}
|
|
|
|
{
|
|
|
|
text: 'No'
|
|
|
|
click: () ->
|
|
|
|
$(this).dialog("close")
|
|
|
|
$(".tooltip").hide()
|
|
|
|
class: 'btn btn-xs btn-default'
|
|
|
|
}
|
|
|
|
]
|
2015-03-10 05:30:25 +08:00
|
|
|
open: (event, ui) ->
|
|
|
|
$('.ui-widget-overlay').bind 'click', () ->
|
|
|
|
if isMobile()
|
|
|
|
$("#dialog").dialog('close')
|
2014-11-21 11:15:29 +08:00
|
|
|
position:
|
|
|
|
my: 'right top'
|
|
|
|
at: 'right bottom'
|
|
|
|
of: '.signOutIcon'
|
|
|
|
)
|
|
|
|
|
2015-04-27 23:12:12 +08:00
|
|
|
Meteor.NotificationControl = new NotificationControl()
|
2015-03-15 10:08:34 +08:00
|
|
|
|
2014-12-20 03:01:45 +08:00
|
|
|
$(window).resize( ->
|
|
|
|
$('#dialog').dialog('close')
|
2015-04-01 03:36:16 +08:00
|
|
|
$('#joinAudioDialog').dialog('close')
|
2014-12-20 03:01:45 +08:00
|
|
|
)
|
|
|
|
|
2015-03-06 01:25:11 +08:00
|
|
|
$('#shield').click () ->
|
|
|
|
toggleSlidingMenu()
|
|
|
|
|
2015-04-16 23:39:06 +08:00
|
|
|
if Meteor.config.app.autoJoinAudio
|
2015-04-15 00:25:53 +08:00
|
|
|
displayAudioSelectionMenu(isMobile:isMobile())
|
2015-04-15 00:05:32 +08:00
|
|
|
|
2014-07-31 04:22:23 +08:00
|
|
|
Template.makeButton.rendered = ->
|
2014-09-24 02:27:59 +08:00
|
|
|
$('button[rel=tooltip]').tooltip()
|
2014-08-15 01:26:15 +08:00
|
|
|
|
2014-11-06 23:27:43 +08:00
|
|
|
Template.recordingStatus.rendered = ->
|
|
|
|
$('button[rel=tooltip]').tooltip()
|