diff --git a/lib/Vroom/I18N/en.pm b/lib/Vroom/I18N/en.pm index 856a511..d442eed 100644 --- a/lib/Vroom/I18N/en.pm +++ b/lib/Vroom/I18N/en.pm @@ -36,6 +36,8 @@ our %Lexicon = ( "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_OFF_BY_s" => "%s removed password protection", "OOOPS" => "Ooops", "GOODBY" => "Goodby", "THANKS_SEE_YOU_SOON" => "Thanks and see you soon", diff --git a/lib/Vroom/I18N/fr.pm b/lib/Vroom/I18N/fr.pm index 81c8c11..312f54c 100644 --- a/lib/Vroom/I18N/fr.pm +++ b/lib/Vroom/I18N/fr.pm @@ -39,6 +39,8 @@ our %Lexicon = ( "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_OFF_BY_s" => "%s a supprimé la protection par mot de passe", "OOOPS" => "Oups", "GOODBY" => "Au revoir", "THANKS_SEE_YOU_SOON" => "Merci et à bientôt", diff --git a/public/js/vroom.js b/public/js/vroom.js index 60b0350..cfb55a7 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -27,6 +27,8 @@ var locale = { ONE_OF_THE_PEERS: '', ROOM_LOCKED_BY_s: '', ROOM_UNLOCKED_BY_s: '', + PASSWORD_PROTECT_ON_BY_s: '', + PASSWORD_PROTECT_OFF_BY_s: '', CANT_SEND_TO_s: '', SCREEN_s: '', TO_INVITE_SHARE_THIS_URL: '' @@ -428,6 +430,14 @@ function initVroom(room) { $.notify(sprintf(locale.ROOM_UNLOCKED_BY_s, stringEscape(peers[data.id].displayName)), 'info'); }); + webrtc.on('password_protect_on', function(data){ + $.notify(sprintf(locale.PASSWORD_PROTECT_ON_BY_s, stringEscape(peers[data.id].displayName)), 'info'); + }); + + webrtc.on('password_protect_off', function(data){ + $.notify(sprintf(locale.PASSWORD_PROTECT_OFF_BY_s, stringEscape(peers[data.id].displayName)), 'info'); + }); + // Handle the readyToCall event: join the room webrtc.once('readyToCall', function () { webrtc.joinRoom(room); @@ -643,6 +653,7 @@ function initVroom(room) { success: function(data) { $.notify(data.msg, 'success'); $('#joinPass').val(''); + webrtc.sendToAll('password_protect_on', {}); } }); }); @@ -661,6 +672,7 @@ function initVroom(room) { success: function(data) { $.notify(data.msg, 'success'); $('#joinPass').val(''); + webrtc.sendToAll('password_protect_off', {}); } }); });