2014-06-14 02:20:36 +08:00
|
|
|
# These settings can just be stored locally in session, created at start up
|
|
|
|
Meteor.startup ->
|
2014-07-21 23:30:21 +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
|
|
|
|
)
|
2014-07-18 03:45:26 +08:00
|
|
|
|
|
|
|
SessionAmplify.set "display_usersList", true
|
|
|
|
SessionAmplify.set "display_navbar", true
|
|
|
|
SessionAmplify.set "display_chatbar", true
|
|
|
|
SessionAmplify.set "display_whiteboard", false
|
|
|
|
SessionAmplify.set "display_chatPane", true
|
|
|
|
SessionAmplify.set 'inChatWith', "PUBLIC_CHAT"
|
|
|
|
SessionAmplify.set "joinedAt", getTime()
|
|
|
|
SessionAmplify.set "isSharingAudio", false
|
|
|
|
|
2014-07-17 23:25:56 +08:00
|
|
|
@myTabs = new WatchValue()
|
|
|
|
@myTabs.updateValue [
|
|
|
|
{isActive:true, name:"Public", class: "publicChatTab"}
|
|
|
|
{isActive:false, name:"Options", class: "optionsChatTab"}
|
|
|
|
]
|
2014-07-17 02:10:27 +08:00
|
|
|
|
2014-06-14 02:20:36 +08:00
|
|
|
Template.header.events
|
|
|
|
"click .usersListIcon": (event) ->
|
|
|
|
toggleUsersList()
|
|
|
|
"click .chatBarIcon": (event) ->
|
2014-06-19 21:27:04 +08:00
|
|
|
toggleChatbar()
|
2014-06-14 02:20:36 +08:00
|
|
|
"click .videoFeedIcon": (event) ->
|
|
|
|
toggleCam @
|
|
|
|
"click .audioFeedIcon": (event) ->
|
|
|
|
toggleMic @
|
|
|
|
"click .signOutIcon": (event) ->
|
2014-07-18 04:13:06 +08:00
|
|
|
Meteor.call("userLogout", getInSession("meetingId"), getInSession("userId"))
|
2014-07-18 21:41:35 +08:00
|
|
|
setInSession "display_navbar", false # needed to hide navbar when the layout template renders
|
2014-07-18 23:18:27 +08:00
|
|
|
# wipe important session data
|
|
|
|
setInSession("userId", null)
|
|
|
|
setInSession("meetingId", null)
|
|
|
|
setInSession("currentChatId", null)
|
|
|
|
setInSession("meetingName", null)
|
|
|
|
setInSession("bbbServerVersion", null)
|
|
|
|
setInSession("userName", null)
|
|
|
|
# invalidate user
|
|
|
|
setInSession("validUser", false)
|
|
|
|
# navigate to logout
|
|
|
|
Router.go('logout')
|
2014-06-14 02:20:36 +08:00
|
|
|
"click .hideNavbarIcon": (event) ->
|
|
|
|
toggleNavbar()
|
|
|
|
"click .settingsIcon": (event) ->
|
2014-06-23 21:21:03 +08:00
|
|
|
alert "settings"
|
2014-06-24 03:51:54 +08:00
|
|
|
|
2014-06-27 01:13:19 +08:00
|
|
|
# Gets called last in main template, just an easy place to print stuff out
|
2014-06-26 02:51:16 +08:00
|
|
|
Handlebars.registerHelper "doFinalStuff", ->
|
2014-07-12 02:58:25 +08:00
|
|
|
console.log "-----Doing Final Stuff-----"
|