diff --git a/lib/Vroom/I18N/en.pm b/lib/Vroom/I18N/en.pm index 4b3793e..e3f1926 100644 --- a/lib/Vroom/I18N/en.pm +++ b/lib/Vroom/I18N/en.pm @@ -158,7 +158,7 @@ our %Lexicon = ( "ROOM_NOW_PERSISTENT" => "This room is now persistent", "ROOM_NO_MORE_PERSISTENT" => "This rooms isn't persistent anymore", "EMAIL_INVITE" => "Email invitation", - "DELETE_THIS_ROOM" => "Delete this room", + "DELETE" => "Delete", "CONFIRM_DELETE" => "Confirm delation", "HELP_SET_DISPLAY_NAME" => "This field lets you type your name which will be displayed for other participants. " . "It must be set before you can use the chat. no need to validate anything, the name " . diff --git a/lib/Vroom/I18N/fr.pm b/lib/Vroom/I18N/fr.pm index 2aee2fa..a7f6317 100644 --- a/lib/Vroom/I18N/fr.pm +++ b/lib/Vroom/I18N/fr.pm @@ -164,7 +164,7 @@ our %Lexicon = ( "ROOM_NOW_PERSISTENT" => "Ce salon est maintenant persistant", "ROOM_NO_MORE_PERSISTENT" => "Ce salon n'est plus persistant", "EMAIL_INVITE" => "Invitation par email", - "DELETE_THIS_ROOM" => "Supprimer ce salon", + "DELETE" => "Supprimer", "CONFIRM_DELETE" => "Confirmer la suppression", "HELP_SET_DISPLAY_NAME" => "Ce champs vous permet de saisir le nom qui sera affiché pour les autres personnes. " . "Il est obligatoire avant de pouvoir utiliser le tchat. Pas besoin de valider quoi " . diff --git a/public/js/vroom.js b/public/js/vroom.js index 7db4634..cc742c5 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -384,7 +384,7 @@ function initAdmin(){ // Update display of room list function updateRoomList(filter, min, max){ - $('#deviceList').html(''); + $('#roomList').html(''); var filterRe = new RegExp(filter, "gi"); var i = 0; matches = 0; @@ -486,8 +486,36 @@ function initAdmin(){ getRoomConf(roomName); }); + $(document).on('click', '.btn-remove', function(){ + roomName = $(this).data('room'); + $('#deleteRoomModal').modal('show'); + }); + // Get room list right after loading the page getRooms(); + + // Delete room form + $('#deleteRoomForm').submit(function(e){ + e.preventDefault(); + $.ajax({ + data: { + req: JSON.stringify({ + action: 'delete_room', + param: { + room: roomName, + } + }) + }, + error: function(data){ + $.notify(locale.ERROR_OCCURRED, 'error'); + }, + success: function(data){ + $.notify(data.msg, 'success'); + getRooms(); + $('#deleteRoomModal').modal('hide'); + } + }); + }); } // This is the main function called when you join a room diff --git a/templates/default/admin.html.ep b/templates/default/admin.html.ep index dee4527..b014149 100644 --- a/templates/default/admin.html.ep +++ b/templates/default/admin.html.ep @@ -4,7 +4,7 @@