]> source.dussan.org Git - archiva.git/commitdiff
reuse selector!
authorOlivier Lamy <olamy@apache.org>
Mon, 19 Nov 2012 21:02:08 +0000 (21:02 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 19 Nov 2012 21:02:08 +0000 (21:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1411408 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
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/archiva/proxy-connectors.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html

index f7b435a8f89c8493ce9be3e983fe98b7a6e6bd7a..31559507a44b7e8640582999c9c7d62b4adf9703 100644 (file)
@@ -521,9 +521,10 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
     this.networkConfiguration=ko.observable(networkConfiguration);
 
     save=function(){
-      $("#user-messages" ).html(mediumSpinnerImg());
+      var userMessages=$("#user-messages");
+      userMessages.html(mediumSpinnerImg());
       var mainContent=$("#main-content");
-      if (!$("#main-content" ).find("#network-configuration-edit-form").valid()){
+      if (!mainContent.find("#network-configuration-edit-form").valid()){
         return;
       }
       mainContent.find("#network-configuration-btn-save" ).button('loading');
@@ -536,7 +537,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
           displaySuccessMessage( $.i18n.prop("network-configuration.updated"));
         },
         complete: function(){
-          removeMediumSpinnerImg("#user-messages");
+          removeMediumSpinnerImg(userMessages);
           mainContent.find("#network-configuration-btn-save" ).button('reset');
         }
       });
@@ -605,7 +606,8 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
     var self=this;
     save=function(){
       var mainContent=$("#main-content" );
-      $("#user-messages").html( mediumSpinnerImg());
+      var userMessages=$("#user-messages");
+      userMessages.html( mediumSpinnerImg());
       mainContent.find("#ui-configuration-btn-save" ).button('loading');
       $.ajax("restServices/archivaServices/archivaAdministrationService/setUiConfiguration", {
         type: "POST",
@@ -616,7 +618,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
           displaySuccessMessage( $.i18n.prop("ui-configuration.updated"));
         },
         complete: function(){
-          removeMediumSpinnerImg("#user-messages");
+          removeMediumSpinnerImg(userMessages);
           mainContent.find("#ui-configuration-btn-save" ).button('reset');
         }
       });
@@ -856,7 +858,8 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
           return;
       }
       clearUserMessages();
-      $("#user-messages" ).html(mediumSpinnerImg());
+      var userMessages=$("#user-messages");
+      userMessages.html(mediumSpinnerImg());
       mainContent.find("#appearance-configuration-btn-save" ).button('loading');
       $.ajax("restServices/archivaServices/archivaAdministrationService/setOrganisationInformation", {
         type: "POST",
@@ -871,7 +874,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
           displayErrorMessage($.i18n.prop('appearance-configuration.updating-error'));
         },
         complete: function(){
-          removeMediumSpinnerImg("#user-messages");
+          removeMediumSpinnerImg(userMessages);
           mainContent.find("#appearance-configuration-btn-save" ).button('reset');
         }
       });
index 5ce7afb10f173f900b30c2062d8b44acaf5c70e7..583fa43c9ae85b65cd06aff432449e8f53a5441f 100644 (file)
@@ -88,7 +88,8 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra
 
     this.saveProxyConnectorRule=function(proxyConnectorRule,url,add,completeFnCallback){
       $.log("saveProxyConnectorRule:"+url);
-      $("#user-messages" ).html(mediumSpinnerImg());
+      var userMessages=$("#user-messages");
+      userMessages.html(mediumSpinnerImg());
       $.ajax(url,
         {
           type: "POST",
@@ -112,7 +113,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra
             displayRestError(res);
           },
           complete:function(data){
-            removeMediumSpinnerImg("#user-messages");
+            removeMediumSpinnerImg(userMessages);
             if(completeFnCallback){
               completeFnCallback();
             }
@@ -134,7 +135,8 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra
 
     this.deleteProxyConnectorRule=function(proxyConnectorRule){
       $("#main-content" ).find("proxy-connectors-rules-view-tabsTable").find(".btn").button("loading");
-      $("#user-messages" ).html(mediumSpinnerImg());
+      var userMessages=$("#user-messages");
+      userMessages.html(mediumSpinnerImg());
       $.ajax("restServices/archivaServices/proxyConnectorRuleService/deleteProxyConnectorRule",
        {
          type:"POST",
@@ -151,7 +153,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra
            displayRestError(res);
          },
          complete:function(data){
-           removeMediumSpinnerImg("#user-messages");
+           removeMediumSpinnerImg(userMessages);
            $("#main-content" ).find("proxy-connectors-rules-view-tabsTable").find(".btn").button("reset");
          }
        }
@@ -278,7 +280,8 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra
     screenChange();
     var mainContent = $("#main-content");
     mainContent.html($("#proxyConnectorsRulesMain").tmpl());
-    $("#user-messages").html(mediumSpinnerImg());
+    var userMessages=$("#user-messages");
+    userMessages.html(mediumSpinnerImg());
     loadAllProxyConnectors(function(data){
       var proxyConnectors = mapProxyConnectors(data);
 
@@ -292,7 +295,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra
             activateProxyConnectorRulesGridTab();
           },
           complete: function(data){
-            removeMediumSpinnerImg("#user-messages");
+            removeMediumSpinnerImg(userMessages);
           }
 
         });
index bcf84acc98d36ac48e4e188cdd0b4c34c7a1221e..b1f346b7a63d0bd3ffafd58350bb3f19129d6696 100644 (file)
@@ -204,7 +204,8 @@ define("archiva.proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jq
     this.save=function(){
       //FIXME data controls !!!
       clearUserMessages();
-      $("#user-messages" ).html(mediumSpinnerImg());
+      var userMessages=$("#user-messages");
+      userMessages.html(mediumSpinnerImg());
       $("#proxy-connector-btn-save" ).button("loading");
       // update is delete then add
       if (this.update){
@@ -224,7 +225,7 @@ define("archiva.proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jq
               displayRestError(res);
             },
             complete: function(){
-              removeMediumSpinnerImg("#user-messages");
+              removeMediumSpinnerImg(userMessages);
               $("#proxy-connector-btn-save" ).button("reset");
             }
           }
@@ -248,7 +249,7 @@ define("archiva.proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jq
               displayRestError(res);
             },
             complete: function(){
-              removeMediumSpinnerImg("#user-messages");
+              removeMediumSpinnerImg(userMessages);
               $("#proxy-connector-btn-save" ).button("reset");
             }
           }
index de2badbcef905eb8ea4cfbbb37e2efe057bac5cb..5d6b59a697465deff6d1d94ad4edce45ab462393 100644 (file)
@@ -244,7 +244,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
           },
           complete: function(){
             $("#managed-repository-save-button" ).button('reset');
-            removeMediumSpinnerImg("#user-messages");
+            removeMediumSpinnerImg(userMessages);
           }
         });
       }
@@ -561,7 +561,8 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
     }
 
     mergeRepo=function(managedRepository){
-      $("#user-messages" ).html(mediumSpinnerImg());
+      var userMessages=$("#user-messages");
+      userMessages.html(mediumSpinnerImg());
       // is there any artifacts to merge ?
       var artifactsNumberUrl = "restServices/archivaServices/browseService/artifacts/"+encodeURIComponent(managedRepository.id());
       $.ajax(artifactsNumberUrl,{
@@ -595,8 +596,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
 
             },
             complete: function(){
-              $.log("complete removeMediumSpinnerImg");
-              removeMediumSpinnerImg("#user-messages");
+              removeMediumSpinnerImg(userMessages);
             }
         }
       );
@@ -647,7 +647,8 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
   doMerge=function(sourceRepository,targetRepository,skipConflicts){
     $.log("doMerge:"+sourceRepository+" to " + targetRepository + ", skipConflicts: " + skipConflicts);
     window.modalMergeRepoDialog.modal('hide');
-    $("#user-messages" ).html(mediumSpinnerImg());
+    var userMessages=$("#user-messages");
+    userMessages.html(mediumSpinnerImg());
     var url = "restServices/archivaServices/mergeRepositoriesService/mergeRepositories/"+encodeURIComponent(sourceRepository);
     url+="/"+encodeURIComponent(targetRepository);
     url+="/"+skipConflicts;
@@ -658,7 +659,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
           displaySuccessMessage($.i18n.prop("managedrepository.merge.success", sourceRepository,targetRepository));
         },
         complete: function(){
-          removeMediumSpinnerImg("#user-messages");
+          removeMediumSpinnerImg(userMessages);
         }
     });
   }
@@ -1181,7 +1182,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
             ko.applyBindings(managedRepositoriesViewModel,mainContent.find("#managed-repositories-view").get(0));
             activatePopoverDoc();
             mainContent.find("#managed-repositories-pills #managed-repositories-view-a").tab('show');
-            removeMediumSpinnerImg("#main-content #managed-repositories-content");
+            removeMediumSpinnerImg(mainContent.find("#managed-repositories-content"));
             activateManagedRepositoriesGridTab();
             if(successFnManagedRepositories){
               successFnManagedRepositories(managedRepositoriesViewModel);
@@ -1220,7 +1221,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
             var mainContent = $("#main-content");
             ko.applyBindings(remoteRepositoriesViewModel,mainContent.find("#remote-repositories-view").get(0));
             mainContent.find("#remote-repositories-pills #remote-repositories-view-a").tab('show')
-            removeMediumSpinnerImg("#main-content #remote-repositories-content");
+            removeMediumSpinnerImg(mainContent.find("#remote-repositories-content"));
             activatePopoverDoc();
             if(successFnRemoteRepositories){
               successFnRemoteRepositories(managedRepositoriesViewModel);
index 0f07f35eb97b49f2ee6f2190d8783682d6b75a14..98cdd932383e9121bc129dda37f843d052226de7 100644 (file)
@@ -207,7 +207,8 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) {
 
     this.saveRepositoryGroup=function(repositoryGroup){
         clearUserMessages();
-        $("#user-messages").html(mediumSpinnerImg());
+        var userMessages=$("#user-messages");
+        userMessages.html(mediumSpinnerImg());
         $("#repository-group-save" ).button('loading');
         $.ajax("restServices/archivaServices/repositoryGroupService/updateRepositoryGroup",
           {
@@ -227,7 +228,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) {
             },
             complete:function(data){
               $("#repository-group-save" ).button('reset');
-              removeMediumSpinnerImg("#user-messages");
+              removeMediumSpinnerImg(userMessages);
             }
           }
         );
index 790d696caf8e187b4a4ad096cd4194d121c654f2..739cb14760d75faa066e8d6cb8307da4043df808 100644 (file)
         {{/each}}
         <th>Releases</th>
         <th>Snapshots</th>
-        <!--th title="${$.i18n.prop('managedrepository.scan.index')}">${$.i18n.prop('managedrepository.scan.grid.header')}</th-->
         <th>${$.i18n.prop('managedrepository.actions')}</th>
         <th>${$.i18n.prop('edit')}</th>
         <th>${$.i18n.prop('delete')}</th>
         <th>${$.i18n.prop('modified')}</th>
-        <!--th>${$.i18n.prop('description')}</th-->
         <th>${$.i18n.prop('managed.repository.rss.header')}</th>
         <th title="${$.i18n.prop('managedrepository.stats')}">${$.i18n.prop('managedrepository.stats.grid.header')}</th>
-        <!--th title="${$.i18n.prop('managedrepository.scan.directories')}">${$.i18n.prop('managedrepository.scan.directories.grid.header')}</th-->
       </tr>
   </thead>
   <tbody>
             <td>
                <a href="${row.feedsUrl}"><img src="images/atom.gif" alt="" title="${$.i18n.prop('managedrepository.feeds')} ${row.name()}"/></a>
             </td>
-            <!--td>
-                {{if row.description()}}
-                <a class="btn btn-warning btn-mini popover-doc" id="managedrepo-description-help"
-                   data-content="${row.description()}" data-title="${$.i18n.prop('description')}"
-                   data-placement="left">
-                    <i class="icon-question-sign icon-white"></i>
-                </a>
-                {{/if}}
-            </td-->
             <td id="managedrepository-stats-${row.id()}">
               <img src="images/utilities-system-monitor-22-22.png" data-original-title="${$.i18n.prop('managedrepository.stats')}"
                    data-bind="event: { mouseover: function(){ showStats(row) }, mouseout: function(){ hideStats(row) },}"