]> source.dussan.org Git - archiva.git/commitdiff
reuse selector cache
authorOlivier Lamy <olamy@apache.org>
Tue, 6 Mar 2012 18:30:15 +0000 (18:30 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 6 Mar 2012 18:30:15 +0000 (18:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1297635 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js

index e44dd0707dbb80f4d857fd42025faea2353d8de6..5ff35cc5adbeb827556846f99355321db3e878b3 100644 (file)
@@ -25,21 +25,24 @@ require(["text!js/archiva/templates/menu.html"+appendTemplateUrl(),
           "text!js/archiva/templates/network-proxies.html?"+appendTemplateUrl(),
           "text!js/archiva/templates/proxy-connectors.html?"+appendTemplateUrl(),
           "text!js/archiva/templates/repository-groups.html?"+appendTemplateUrl(),
-          "text!js/archiva/templates/search.html?"+appendTemplateUrl()],
+          "text!js/archiva/templates/search.html?"+appendTemplateUrl(),
+          "text!js/archiva/templates/general-admin.html?"+appendTemplateUrl()],
   function(menu,topbar,message,modal,grids_generics,repositories,network_proxies,proxies_connectors,
-           repository_groups,search) {
+           repository_groups,search,general_admin) {
 
+    var htmlFragment=$("#html-fragments");
     // template loading
-    $.tmpl( menu ).appendTo("#html-fragments");
-    $.tmpl( topbar ).appendTo("#html-fragments");
-    $("#html-fragments").append(message);
-    $.tmpl( modal ).appendTo("#html-fragments");
-    $("#html-fragments").append(grids_generics);
-    $("#html-fragments").append(repositories);
-    $("#html-fragments").append(network_proxies);
-    $("#html-fragments").append(proxies_connectors);
-    $("#html-fragments").append(repository_groups);
-    $("#html-fragments").append(search);
+    $.tmpl( menu ).appendTo(htmlFragment);
+    $.tmpl( topbar ).appendTo(htmlFragment);
+    htmlFragment.append(message);
+    $.tmpl( modal ).appendTo(htmlFragment);
+    htmlFragment.append(grids_generics);
+    htmlFragment.append(repositories);
+    htmlFragment.append(network_proxies);
+    htmlFragment.append(proxies_connectors);
+    htmlFragment.append(repository_groups);
+    htmlFragment.append(search);
+    htmlFragment.append(general_admin);
     $.log("main-tmpl.js loaded");
   }
 );
\ No newline at end of file
index d1453bae0aec217e7b1b669f31cd969a6b04966c..217c64673b1698b88e8e0e8ef560777c14cf35e0 100644 (file)
@@ -25,12 +25,13 @@ require(["text!js/redback/templates/user-edit.html?"+appendTemplateUrl(),
           "text!js/redback/templates/roles-tmpl.html?"+appendTemplateUrl()],
     function(useredit, usergrids, login,register,passwordchange,usereditform,roles) {
 
+      var htmlFragment=$("#html-fragments");
 
       // template loading
 
-      $("#html-fragments").append(useredit);
+      htmlFragment.append(useredit);
 
-      $("#html-fragments").append(usergrids);
+      htmlFragment.append(usergrids);
 
       $.tmpl(login).appendTo("#html-fragments");
 
@@ -40,7 +41,7 @@ require(["text!js/redback/templates/user-edit.html?"+appendTemplateUrl(),
 
       $.tmpl(usereditform).appendTo("#html-fragments");
 
-      $("#html-fragments").append(roles);
+      htmlFragment.append(roles);
 
       $.log("redback-tmpl.js loaded");
     }