From 12cd17a5d06db78938c4d72d689d2dce03a65aae Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 6 Mar 2012 18:30:15 +0000 Subject: [PATCH] reuse selector cache git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1297635 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/main-tmpl.js | 27 ++++++++++--------- .../main/webapp/js/redback/redback-tmpl.js | 7 ++--- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js index e44dd0707..5ff35cc5a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js @@ -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 diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js index d1453bae0..217c64673 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js @@ -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"); } -- 2.39.5