From ade168dbadfdf07c96d3e66718315c1f7cc527cb Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 26 Jan 2012 23:43:19 +0000 Subject: [PATCH] ask confirmation before deleting remote repository git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1236448 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/webapp/js/archiva/repositories.js | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index 510b35367..6f8804a4a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -608,19 +608,27 @@ $(function() { } removeRemoteRepository=function(remoteRepository){ - $.ajax("restServices/archivaServices/remoteRepositoriesService/deleteRemoteRepository/"+remoteRepository.id(), - { - type: "GET", - success: function(data) { - self.remoteRepositories.remove(remoteRepository); - displaySuccessMessage($.i18n.prop('remoterepository.deleted')); - }, - error: function(data) { - var res = $.parseJSON(data.responseText); - displayRestError(res); - } - } - ); + clearUserMessages(); + openDialogConfirm( + function(){$.ajax("restServices/archivaServices/remoteRepositoriesService/deleteRemoteRepository/"+remoteRepository.id(), + { + type: "GET", + success: function(data) { + self.remoteRepositories.remove(remoteRepository); + displaySuccessMessage($.i18n.prop('remoterepository.deleted')); + }, + error: function(data) { + var res = $.parseJSON(data.responseText); + displayRestError(res); + }, + complete:function(){ + closeDialogConfirm(); + } + } + )}, $.i18n.prop('ok'), + $.i18n.prop('cancel'), + $.i18n.prop('remoterepository.delete.confirm',remoteRepository.id()),null); + } scheduleDownloadRemoteIndex=function(remoteRepository){ -- 2.39.5