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 { #confMenu {
min-width: 400px; min-width: 400px;
} }
.ownerEl {
display: none;
}
#chatBox { #chatBox {
max-height:300px; max-height:300px;
resize:none; resize:none;

@ -75,7 +75,8 @@ function initVroom(room) {
micMuted: false, micMuted: false,
videoPaused: false, videoPaused: false,
displayName: '', displayName: '',
color: chooseColor() color: chooseColor(),
role: 'participant'
} }
}; };
var mainVid = false, var mainVid = false,
@ -90,6 +91,24 @@ function initVroom(room) {
dataType: 'json', 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 // Screen sharing is only suported on chrome > 26
if ( !$.browser.webkit || $.browser.versionNumber < 26 ) { if ( !$.browser.webkit || $.browser.versionNumber < 26 ) {
$("#shareScreenLabel").addClass('disabled'); $("#shareScreenLabel").addClass('disabled');

@ -428,7 +428,7 @@ post '/action' => sub {
my $self = shift; my $self = shift;
my $action = $self->param('action'); my $action = $self->param('action');
my $room = $self->param('room') || ""; 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( return $self->render(
json => { json => {
msg => $self->l('ERROR_NOT_LOGGED_IN'), 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) # Not found (404)

@ -79,7 +79,9 @@
<span class="glyphicon glyphicon-expand"> <span class="glyphicon glyphicon-expand">
</span> </span>
</label> </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="glyphicon glyphicon-wrench"></span>
<span class="caret"></span> <span class="caret"></span>
</button> </button>

Loading…
Cancel
Save