]> source.dussan.org Git - archiva.git/commitdiff
ask confirmation before network proxies bulk save
authorOlivier Lamy <olamy@apache.org>
Fri, 3 Feb 2012 18:07:09 +0000 (18:07 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 3 Feb 2012 18:07:09 +0000 (18:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1240270 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html

index bb9d5b4b213484c14d68ae69a7fbe469be95f7a1..fe9fc0ca03db18d877b268298377d0c20368ee23 100644 (file)
@@ -143,12 +143,22 @@ $(function() {
       return prx;
     }
 
-    updateNetworkProxies=function(){
+    updateModifiedNetworkProxy=function(){
       var modifiedNetworkProxies = getModifiedNetworkProxies();
-      for(i=0;i<modifiedNetworkProxies.length;i++){
-        var viewModel = new NetworkProxyViewModel(modifiedNetworkProxies[i],true,self,false);
-        viewModel.save();
-      }
+
+      openDialogConfirm(function(){
+                          for(i=0;i<modifiedNetworkProxies.length;i++){
+                            var viewModel = new NetworkProxyViewModel(modifiedNetworkProxies[i],true,self,false);
+                            viewModel.save();
+                          }
+                          closeDialogConfirm();
+                        },
+                        $.i18n.prop('ok'),
+                        $.i18n.prop('cancel'),
+                        $.i18n.prop('bulk.save.confirm.title'),
+                        $.i18n.prop('networkproxy.bulk.save.confirm',modifiedNetworkProxies.length));
+
+
     }
 
     updateNetworkProxy=function(networkProxy){
index 7164a178323dd49ee6673a73516a77f386c211b5..105451c60776048045f873ccaa0a80c89c8a8aff 100644 (file)
 
 <script id="network-proxies-bulk-save-tmpl" type='text/x-jquery-tmpl'>
   {{if bulkSave()}}
-    <button data-bind="click: updateNetworkProxies" class="btn">${$.i18n.prop('save.all')}</button>
+    <button data-bind="click: updateModifiedNetworkProxy" class="btn">${$.i18n.prop('save.all')}</button>
   {{/if}}
 </script>
\ No newline at end of file