From abfde6364a2d97f8133bcacc26ea32c6cf0a76f8 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 2 Oct 2012 21:11:44 +0000 Subject: [PATCH] open a confirm modial dialog to ask confirmation for deletion git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1393183 13f79535-47bb-0310-9956-ffa450edef68 --- .../webapp/js/archiva/proxy-connectors-rules.js | 13 ++++++++++--- .../src/main/webapp/js/templates/archiva/modal.html | 4 ++-- .../webapp/js/templates/archiva/repositories.html | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js index d29108d68..c0b93dbb3 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js @@ -104,9 +104,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra ); } - removeProxyConnectorRule=function(proxyConnectorRule){ - - //FIXME modal dialog to confirm + this.deleteProxyConnectorRule=function(proxyConnectorRule){ //$("#proxy-connector-rule-delete-btn" ).button("loading"); $("#user-messages" ).html(mediumSpinnerImg()); $.ajax("restServices/archivaServices/proxyConnectorRuleService/deleteProxyConnectorRule", @@ -132,6 +130,15 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra ); } + removeProxyConnectorRule=function(proxyConnectorRule){ + + openDialogConfirm( + function(){self.deleteProxyConnectorRule(proxyConnectorRule);window.modalConfirmDialog.modal('hide')}, + $.i18n.prop('ok'), $.i18n.prop('cancel'), + $.i18n.prop('proxy-connector-rule.delete.confirm',proxyConnectorRule.pattern()),""); + + } + editProxyConnectorRule=function(proxyConnectorRule){ var proxyConnectorRuleViewModel=new ProxyConnectorRuleViewModel(proxyConnectorRule,self,true); ko.applyBindings(proxyConnectorRuleViewModel,$("#main-content").find("#proxy-connector-rules-edit" ).get(0)); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/modal.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/modal.html index 8389d23d0..811ab31c3 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/modal.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/modal.html @@ -25,8 +25,8 @@

diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html index 29fb981b6..1c81dc583 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html @@ -1303,7 +1303,7 @@ - + -- 2.39.5