Merge branch 'prototype-metor-client' of https://github.com/perroned/bigbluebutton into prototype-metor-client

This commit is contained in:
perroned 2014-07-31 13:48:24 -07:00
commit aff1b175f6
6 changed files with 66 additions and 46 deletions

View File

@ -49,6 +49,9 @@ Template.header.events
alert "settings"
"click .raiseHand": (event) ->
Meteor.call('userRaiseHand', @id)
Template.makeButton.rendered = ->
$('button[rel=tooltip]').tooltip()
# Gets called last in main template, just an easy place to print stuff out
Handlebars.registerHelper "doFinalStuff", ->

View File

@ -13,6 +13,7 @@
</div>
</body>
{{doFinalStuff}}
<audio id="remote-media" autoplay="autoplay" ></audio>
</template>
@ -21,59 +22,59 @@
<div class="navbar navbar-default navbar-static-top" role="navigation">
{{#with getCurrentUser}}
{{#if getInSession "display_usersList"}}
{{> makeButton id=userId btn_class="navbarIconToggleActive usersListIcon navbar-brand" i_class="user" _id=_id}}
{{> makeButton id=userId btn_class="navbarIconToggleActive usersListIcon navbar-brand" i_class="user" _id=_id rel="tooltip" data_placement="bottom" title="Hide List of Users"}}
{{else}}
{{> makeButton id=userId btn_class="usersListIcon navbar-brand" i_class="user" _id=_id}}
{{> makeButton id=userId btn_class="usersListIcon navbar-brand" i_class="user" _id=_id rel="tooltip" data_placement="bottom" title="Show List of Users"}}
{{/if}}
{{#if getInSession "display_chatbar"}}
{{> makeButton id=userId btn_class="navbarIconToggleActive chatBarIcon navbar-brand" i_class="comment" _id=_id}}
{{> makeButton id=userId btn_class="navbarIconToggleActive chatBarIcon navbar-brand" i_class="comment" _id=_id rel="tooltip" data_placement="bottom" title="Hide Message Pane"}}
{{else}}
{{> makeButton id=userId btn_class="chatBarIcon navbar-brand" i_class="comment" _id=_id}}
{{> makeButton id=userId btn_class="chatBarIcon navbar-brand" i_class="comment" _id=_id rel="tooltip" data_placement="bottom" title="Show Message Pane"}}
{{/if}}
{{#if isUserSharingVideo user}}
{{> makeButton id=userId btn_class="navbarIconToggleActive videoFeedIcon navbar-brand" i_class="facetime-video" sharingVideo=true _id=_id}}
{{> makeButton id=userId btn_class="navbarIconToggleActive videoFeedIcon navbar-brand" i_class="stop" sharingVideo=true _id=_id rel="tooltip" data_placement="bottom" title="Hide Webcams"}}
{{else}}
{{> makeButton id=userId btn_class="videoFeedIcon navbar-brand" i_class="stop" sharingVideo=false _id=_id}}
{{> makeButton id=userId btn_class="videoFeedIcon navbar-brand" i_class="facetime-video" sharingVideo=false _id=_id rel="tooltip" data_placement="bottom" title="Show Webcams"}}
{{/if}}
<!-- Join/hang up audio call -->
{{#if isUserSharingAudio user}}
{{> makeButton id=userId btn_class="navbarIconToggleActive audioFeedIcon navbar-brand" i_class="headphones" sharingAudio=true _id=_id}}
{{> makeButton id=userId btn_class="navbarIconToggleActive audioFeedIcon navbar-brand" i_class="volume-off" sharingAudio=true _id=_id rel="tooltip" data_placement="bottom" title="Leave Audio Call"}}
{{else}}
{{> makeButton id=userId btn_class="audioFeedIcon navbar-brand" i_class="volume-off" sharingAudio=false _id=_id}}
{{> makeButton id=userId btn_class="audioFeedIcon navbar-brand" i_class="headphones" sharingAudio=false _id=_id rel="tooltip" data_placement="bottom" title="Join Audio Call"}}
{{/if}}
<!-- Mute/unmute user -->
{{#if isUserSharingAudio user}}
<!-- Should use much more noticeable icons than just bootstraps volume-up & volume-down to differentiate talking but it is good for now -->
{{#if isUserTalking user}}
{{> makeButton id=userId btn_class="navbarIconToggleActive muteIcon navbar-brand" i_class="volume-up" sharingAudio=true _id=_id}}
{{> makeButton id=userId btn_class="navbarIconToggleActive muteIcon navbar-brand" i_class="volume-up" sharingAudio=true _id=_id rel="tooltip" data_placement="bottom" title="Mute"}}
{{else}}
{{> makeButton id=userId btn_class="navbarIconToggleActive muteIcon navbar-brand" i_class="volume-down" sharingAudio=true _id=_id}}
{{> makeButton id=userId btn_class="navbarIconToggleActive muteIcon navbar-brand" i_class="volume-down" sharingAudio=true _id=_id rel="tooltip" data_placement="bottom" title="Unmute"}}
{{/if}}
{{/if}}
{{#if user.raise_hand}}
{{> makeButton id=userId btn_class="navbarIconToggleActive navbar-brand" i_class="hand-up" isDisabled="disabled"}}
{{> makeButton id=userId btn_class="navbarIconToggleActive navbar-brand" i_class="hand-up" isDisabled="disabled" rel="tooltip" data_placement="bottom" title="Your hand is raised"}}
{{else}}
{{> makeButton id=userId btn_class="raiseHand navbar-brand" i_class="hand-up"}}
{{> makeButton id=userId btn_class="raiseHand navbar-brand" i_class="hand-up" rel="tooltip" data_placement="bottom" title="Raise your hand"}}
{{/if}}
{{> makeButton id="" btn_class="hideNavbarIcon pull-right navbar-brand" i_class="chevron-up"}}
{{> makeButton id="userId" btn_class="signOutIcon pull-right navbar-brand" i_class="log-out"}}
{{> makeButton id="userId" btn_class="settingsIcon pull-right navbar-brand" i_class="cog"}}
{{> makeButton id="" btn_class="hideNavbarIcon pull-right navbar-brand" i_class="chevron-up" rel="tooltip" data_placement="bottom" title="Hide Navbar"}}
{{> makeButton id="userId" btn_class="signOutIcon pull-right navbar-brand" i_class="log-out" rel="tooltip" data_placement="bottom" title="Logout"}}
{{> makeButton id="userId" btn_class="settingsIcon pull-right navbar-brand" i_class="cog" rel="tooltip" data_placement="bottom" title="Settings"}}
{{/with}}
</div>
{{else}}
<!-- User wants to hide navbar. The button for bringing the navbar back needs to still be available. Perhaps it should appear/disappear in the future on hover? Something to add later. -->
{{> makeButton id="" btn_class="hideNavbarIcon pull-right navbar-brand" i_class="chevron-down"}}
{{> makeButton id="" btn_class="hideNavbarIcon pull-right navbar-brand" i_class="chevron-down" rel="tooltip" data_placement="bottom" title="Display Navbar"}}
{{/if}}
</template>
<template name="makeButton">
<button type="submit" id="{{id}}" class="{{btn_class}} btn" {{isDisabled}}>
<button type="submit" id="{{id}}" class="{{btn_class}} btn" {{isDisabled}} rel="{{rel}}" data-placement="{{data_placement}}" title="{{title}}">
<i class="glyphicon glyphicon-{{i_class}}"></i>
</button>
</template>

View File

@ -151,8 +151,13 @@
}
#newMessageInput {
width: 95%;
width: 80%;
height:40px;
margin-top: 20px;
}
#sendMessageButton{
margin-left: 10px;
margin-top:9px;
height:40px;
}

View File

@ -48,32 +48,41 @@ Template.tabButtons.events
myTabs.updateValue newTabs
$(".publicChatTab").addClass('active') # doesn't work when closing the tab that's not currently active :(
Meteor.call("deletePrivateChatMessages", getInSession("userId"), @userId)
Template.chatInput.rendered = ->
$('input[rel=tooltip]').tooltip()
$('button[rel=tooltip]').tooltip()
@sendMessage = ->
message = $('#newMessageInput').val() # get the message from the input box
unless (message?.length > 0 and (/\S/.test(message))) # check the message has content and it is not whitespace
return # do nothing if invalid message
chattingWith = getInSession('inChatWith')
messageForServer = { # construct message for server
"message": message
"chat_type": if chattingWith is "PUBLIC_CHAT" then "PUBLIC_CHAT" else "PRIVATE_CHAT"
"from_userid": getInSession("userId")
"from_username": getUsersName()
"from_tz_offset": "240"
"to_username": if chattingWith is "PUBLIC_CHAT" then "public_chat_username" else chattingWith
"to_userid": if chattingWith is "PUBLIC_CHAT" then "public_chat_userid" else chattingWith
"from_lang": "en"
"from_time": getTime()
"from_color": "0"
}
# console.log 'Sending message to server:'
# console.log messageForServer
Meteor.call "sendChatMessagetoServer", getInSession("meetingId"), messageForServer
$('#newMessageInput').val '' # Clear message box
Template.chatInput.events
'click #sendMessageButton': (event) ->
sendMessage()
'keypress #newMessageInput': (event) -> # user pressed a button inside the chatbox
if event.which is 13 # Check for pressing enter to submit message
message = $('#newMessageInput').val() # get the message from the input box
unless (message?.length > 0 and (/\S/.test(message))) # check the message has content and it is not whitespace
return # do nothing if invalid message
chattingWith = getInSession('inChatWith')
messageForServer = { # construct message for server
"message": message
"chat_type": if chattingWith is "PUBLIC_CHAT" then "PUBLIC_CHAT" else "PRIVATE_CHAT"
"from_userid": getInSession("userId")
"from_username": getUsersName()
"from_tz_offset": "240"
"to_username": if chattingWith is "PUBLIC_CHAT" then "public_chat_username" else chattingWith
"to_userid": if chattingWith is "PUBLIC_CHAT" then "public_chat_userid" else chattingWith
"from_lang": "en"
"from_time": getTime()
"from_color": "0"
}
# console.log 'Sending message to server:'
# console.log messageForServer
Meteor.call "sendChatMessagetoServer", getInSession("meetingId"), messageForServer
$('#newMessageInput').val '' # Clear message box
sendMessage()
Template.optionsBar.events
'click .private-chat-user-entry': (event) -> # clicked a user's name to begin private chat

View File

@ -95,8 +95,10 @@
</template>
<template name="chatInput">
<br/>
<input type="text" id="newMessageInput" placeholder="Write a message..." />
<input type="text" id="newMessageInput" placeholder="Write a message..." rel="tooltip" data-placement="top" title="Write a new message" />
<button type="submit" id="sendMessageButton" class="btn" rel="tooltip" data-placement="top" title="Click to send your message">
Send
</button>
</template>

View File

@ -31,10 +31,10 @@
{{#if user.presenter}}
{{> makeButton id=user.externUserId btn_class="setPresenter btn btn-primary" i_class="picture" _id=_id isDisabled="disabled" isPresenter=true}}
{{else}}
{{> makeButton id=user.externUserId btn_class="setPresenter btn btn-primary" i_class="picture" _id=_id isPresenter=false}}
{{> makeButton id=user.externUserId btn_class="setPresenter btn btn-primary" i_class="picture" _id=_id isPresenter=false rel="tooltip" data_placement="top" title="Set Presenter"}}
{{/if}}
</td>
<td>{{> makeButton id=userId btn_class="kickUser btn btn-primary" i_class="remove-circle" _id=_id}}</td>
<td>{{> makeButton id=userId btn_class="kickUser btn btn-primary" i_class="remove-circle" _id=_id rel="tooltip" data_placement="right" title="Kick User"}}</td>
</template>
<!-- ####################################################################################### -->