Hide conf menu by default

And display it only if we are the owner of the room
master
Daniel Berteaud 11 years ago
parent 9364ff66d8
commit 41b5f5754b
  1. 3
      public/css/vroom.css
  2. 21
      public/js/vroom.js
  3. 10
      public/vroom.pl
  4. 4
      templates/default/join.html.ep

@ -79,6 +79,9 @@
#confMenu {
min-width: 400px;
}
.ownerEl {
display: none;
}
#chatBox {
max-height:300px;
resize:none;

@ -75,7 +75,8 @@ function initVroom(room) {
micMuted: false,
videoPaused: false,
displayName: '',
color: chooseColor()
color: chooseColor(),
role: 'participant'
}
};
var mainVid = false,
@ -90,6 +91,24 @@ function initVroom(room) {
dataType: 'json',
});
// get our role (participant or owner)
$.ajax({
data: {
action: 'getRole',
room: roomName
},
error: function(data) {
$.notify(locale.ERROR_OCCURED, 'error');
},
success: function(data) {
peers.local.role = data.msg;
// Enable owner reserved menu
if (data.msg == 'owner'){
$('.ownerEl').show();
}
}
});
// Screen sharing is only suported on chrome > 26
if ( !$.browser.webkit || $.browser.versionNumber < 26 ) {
$("#shareScreenLabel").addClass('disabled');

@ -428,7 +428,7 @@ post '/action' => sub {
my $self = shift;
my $action = $self->param('action');
my $room = $self->param('room') || "";
if (!$self->session('name') || !$self->has_joined($self->session('name'), $room)){
if (!$self->session('name') || !$self->has_joined($self->session('name'), $room) || !$self->session($room) || !$self->session($room)->{role}){
return $self->render(
json => {
msg => $self->l('ERROR_NOT_LOGGED_IN'),
@ -519,6 +519,14 @@ post '/action' => sub {
);
}
}
elsif ($action eq 'getRole'){
return $self->render(
json => {
msg => $self->session($room)->{role},
status => 'success'
},
);
}
};
# Not found (404)

@ -79,7 +79,9 @@
<span class="glyphicon glyphicon-expand">
</span>
</label>
<button class="btn btn-default dropdown-toggle help" type="button" id="confMenuButton" data-toggle="dropdown" data-toggle="tooltip" data-placement="bottom" title="<%=l 'CONFIGURE' %>">
</div>
<div class="btn-group navbar-form navbar-left">
<button class="btn btn-default dropdown-toggle help ownerEl" type="button" id="confMenuButton" data-toggle="dropdown" data-toggle="tooltip" data-placement="bottom" title="<%=l 'CONFIGURE' %>">
<span class="glyphicon glyphicon-wrench"></span>
<span class="caret"></span>
</button>

Loading…
Cancel
Save