]> source.dussan.org Git - archiva.git/commitdiff
open a confirm modial dialog to ask confirmation for deletion
authorOlivier Lamy <olamy@apache.org>
Tue, 2 Oct 2012 21:11:44 +0000 (21:11 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 2 Oct 2012 21:11:44 +0000 (21:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1393183 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/modal.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html

index d29108d68d4020687c0e863d067402dffc7f5284..c0b93dbb30d7224036cb81a0726e20fd5072a4c4 100644 (file)
@@ -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));
index 8389d23d0b1a3f67ce359aa8e10bac52f0533c8c..811ab31c3f3aa7b4357b3dab92ccd4c76b8c63ba 100644 (file)
@@ -25,8 +25,8 @@
    <p id="dialog-confirm-modal-body-text"></p>
   </div>
   <div class="modal-footer">
-    <a class="btn btn-secondary" id="dialog-confirm-modal-cancel" href="#">${$.i18n.prop('cancel')}</a>
-    <a class="btn btn-primary" id="dialog-confirm-modal-ok" href="#">${$.i18n.prop('ok')}</a>
+    <a class="btn btn-secondary" id="dialog-confirm-modal-cancel">${$.i18n.prop('cancel')}</a>
+    <a class="btn btn-primary" id="dialog-confirm-modal-ok">${$.i18n.prop('ok')}</a>
   </div>
 </div>
 
index 29fb981b6ecb52fc458a70e99df70a49d204cd34..1c81dc583037400eb1189cdd9126513b74f08516 100644 (file)
               </a>
           </td>
           <td>
-              <a href="#" data-bind="click: function(){ removeProxyConnectorRule(row) }" data-loading-text="${$.i18n.prop('common.loading')}">
+              <a data-bind="click: function(){ removeProxyConnectorRule(row) }" data-loading-text="${$.i18n.prop('common.loading')}">
                 <span class="btn btn-danger">
                   <i class="icon-trash icon-white"/>
                 </span>