Remove room lock, not that usefull now that you can use a password

master
Daniel Berteaud 11 years ago
parent 75709997d9
commit 25f2602694
  1. 4
      lib/Vroom/I18N/en.pm
  2. 4
      lib/Vroom/I18N/fr.pm
  3. 38
      public/js/vroom.js
  4. 29
      public/vroom.pl
  5. 16
      templates/default/join.html.ep

@ -31,11 +31,7 @@ our %Lexicon = (
"FROM" => "From", "FROM" => "From",
"GIVE_US_YOUR_FEEDBACK" => "Give us your feedback", "GIVE_US_YOUR_FEEDBACK" => "Give us your feedback",
"YOUR_FEEDBACK_HELPS_US" => "Your feedback (good or bad) can help us improve this application", "YOUR_FEEDBACK_HELPS_US" => "Your feedback (good or bad) can help us improve this application",
"ROOM_LOCKED" => "This room is now locked",
"ROOM_UNLOCKED" => "This room is now unlocked",
"ONE_OF_THE_PEERS" => "one of the peers", "ONE_OF_THE_PEERS" => "one of the peers",
"ROOM_LOCKED_BY_s" => "%s locked the room",
"ROOM_UNLOCKED_BY_s" => "%s unlocked the room",
"PASSWORD_PROTECT_ON_BY_s" => "%s password protected the room", "PASSWORD_PROTECT_ON_BY_s" => "%s password protected the room",
"PASSWORD_PROTECT_OFF_BY_s" => "%s removed password protection", "PASSWORD_PROTECT_OFF_BY_s" => "%s removed password protection",
"OOOPS" => "Ooops", "OOOPS" => "Ooops",

@ -34,11 +34,7 @@ our %Lexicon = (
"GIVE_US_YOUR_FEEDBACK" => "Parlez-nous de votre expérience", "GIVE_US_YOUR_FEEDBACK" => "Parlez-nous de votre expérience",
"YOUR_FEEDBACK_HELPS_US" => "Votre retour d'expérience (bonne ou mauvaise) peut nous aider à améliorer cette application", "YOUR_FEEDBACK_HELPS_US" => "Votre retour d'expérience (bonne ou mauvaise) peut nous aider à améliorer cette application",
"INVITE_SENT_TO_s" => "Une invitation a été envoyée à %s", "INVITE_SENT_TO_s" => "Une invitation a été envoyée à %s",
"ROOM_LOCKED" => "Ce salon est maintenant verrouillé",
"ROOM_UNLOCKED" => "Ce salon est maintenant déverrouillé",
"ONE_OF_THE_PEERS" => "un des participants", "ONE_OF_THE_PEERS" => "un des participants",
"ROOM_LOCKED_BY_s" => "%s a verrouillé le salon",
"ROOM_UNLOCKED_BY_s" => "%s a déverrouillé le salon",
"PASSWORD_PROTECT_ON_BY_s" => "%s a protégé le salon par un mot de passe", "PASSWORD_PROTECT_ON_BY_s" => "%s a protégé le salon par un mot de passe",
"PASSWORD_PROTECT_OFF_BY_s" => "%s a supprimé la protection par mot de passe", "PASSWORD_PROTECT_OFF_BY_s" => "%s a supprimé la protection par mot de passe",
"OOOPS" => "Oups", "OOOPS" => "Oups",

@ -25,8 +25,6 @@ var locale = {
CAM_RESUMED: '', CAM_RESUMED: '',
SET_YOUR_NAME_TO_CHAT: '', SET_YOUR_NAME_TO_CHAT: '',
ONE_OF_THE_PEERS: '', ONE_OF_THE_PEERS: '',
ROOM_LOCKED_BY_s: '',
ROOM_UNLOCKED_BY_s: '',
PASSWORD_PROTECT_ON_BY_s: '', PASSWORD_PROTECT_ON_BY_s: '',
PASSWORD_PROTECT_OFF_BY_s: '', PASSWORD_PROTECT_OFF_BY_s: '',
CANT_SEND_TO_s: '', CANT_SEND_TO_s: '',
@ -420,16 +418,6 @@ function initVroom(room) {
$(el).remove(); $(el).remove();
}); });
webrtc.on('room_locked', function(data){
$('#lockLabel').addClass('btn-danger active');
$.notify(sprintf(locale.ROOM_LOCKED_BY_s, stringEscape(peers[data.id].displayName)), 'info');
});
webrtc.on('room_unlocked', function(data){
$('#lockLabel').removeClass('btn-danger active');
$.notify(sprintf(locale.ROOM_UNLOCKED_BY_s, stringEscape(peers[data.id].displayName)), 'info');
});
webrtc.on('password_protect_on', function(data){ webrtc.on('password_protect_on', function(data){
$.notify(sprintf(locale.PASSWORD_PROTECT_ON_BY_s, stringEscape(peers[data.id].displayName)), 'info'); $.notify(sprintf(locale.PASSWORD_PROTECT_ON_BY_s, stringEscape(peers[data.id].displayName)), 'info');
}); });
@ -523,32 +511,6 @@ function initVroom(room) {
webrtc.sendDirectlyToAll('vroom', 'setDisplayName', $('#displayName').val()); webrtc.sendDirectlyToAll('vroom', 'setDisplayName', $('#displayName').val());
}); });
// Handle room lock/unlock
$('#lockButton').change(function() {
var action = ($(this).is(":checked")) ? 'lock':'unlock';
$.ajax({
data: {
action: action,
room: roomName
},
error: function(data) {
var msg = (data && data.msg) ? data.msg : locale.ERROR_OCCURED;
$.notify(msg, 'error');
},
success: function(data) {
$.notify(data.msg, 'info');
if (action === 'lock'){
$("#lockLabel").addClass('btn-danger');
webrtc.sendToAll('room_locked', {});
}
else{
$("#lockLabel").removeClass('btn-danger');
webrtc.sendToAll('room_unlocked', {});
}
}
});
});
// ScreenSharing // ScreenSharing
$('#shareScreenButton').change(function() { $('#shareScreenButton').change(function() {
var action = ($(this).is(":checked")) ? 'share':'unshare'; var action = ($(this).is(":checked")) ? 'share':'unshare';

@ -417,8 +417,7 @@ get '/(*room)' => sub {
room => $room room => $room
); );
} }
$self->stash(locked => $data->{locked} ? 'checked':'', $self->stash(turnPassword => $data->{token});
turnPassword => $data->{token});
$self->render('join'); $self->render('join');
}; };
@ -467,32 +466,6 @@ post '/action' => sub {
} }
); );
} }
if ($action =~ m/(un)?lock/){
my ($lock,$success);
if ($action eq 'lock'){
$lock = 1;
$success = $self->l('ROOM_LOCKED');
}
else{
$lock = 0;
$success = $self->l('ROOM_UNLOCKED');
}
my $room = $self->param('room');
my $res = $self->lock_room($room,$lock);
unless ($res){
return $self->render(
json => {
msg => $self->l('ERROR_OCCURED'),
},
status => '500'
);
}
return $self->render(
json => {
msg => $success,
}
);
}
elsif ($action eq 'ping'){ elsif ($action eq 'ping'){
my $res = $self->ping_room($room); my $res = $self->ping_room($room);
# Cleanup expired rooms every ~10 pings # Cleanup expired rooms every ~10 pings

@ -104,22 +104,6 @@
</div> </div>
</div> </div>
</li> </li>
<li class="divider"></li>
<li>
<li>
<div class="navbar-form">
<center>
<p><%=l 'PREVENT_TO_JOIN' %></p>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default<%= $locked eq 'checked' ? ' btn-danger active':'' %> help" id="lockLabel" data-toggle="tooltip" data-placement="bottom" title="<%=l 'PREVENT_TO_JOIN' %>">
<input type="checkbox" id="lockButton" <%= $locked %>>
<span class="glyphicon glyphicon-lock">
</span>
</label>
</div>
</center>
</div>
</li>
</ul> </ul>
</div> </div>
<div class="btn-group navbar-form navbar-right" data-toggle="buttons" > <div class="btn-group navbar-form navbar-right" data-toggle="buttons" >

Loading…
Cancel
Save