From: Olivier Lamy Date: Mon, 26 Mar 2012 22:51:03 +0000 (+0000) Subject: simplify template url loading X-Git-Tag: archiva-1.4-M3~937 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=680767ee7d153853f51c390f7749731a139368e3;p=archiva.git simplify template url loading git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1305652 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html index d2e6838bd..b7667532e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html @@ -46,62 +46,96 @@ 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 fdc5d5325..6dafd15c8 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 @@ -16,16 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -define("main-templates",["text!js/archiva/templates/menu.html"+appendTemplateUrl(), - "text!js/archiva/templates/message.html"+appendTemplateUrl(), - "text!js/archiva/templates/modal.html"+appendTemplateUrl(), - "text!js/archiva/templates/grids-generics.html"+appendTemplateUrl(), - "text!js/archiva/templates/repositories.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/general-admin.html"+appendTemplateUrl(), +define("main-templates",["text!archiva/templates/menu.html", + "text!archiva/templates/message.html", + "text!archiva/templates/modal.html", + "text!archiva/templates/grids-generics.html", + "text!archiva/templates/repositories.html", + "text!archiva/templates/network-proxies.html", + "text!archiva/templates/proxy-connectors.html", + "text!archiva/templates/repository-groups.html", + "text!archiva/templates/search.html", + "text!archiva/templates/general-admin.html", "jquery_tmpl","utils"], function(menu,message,modal,grids_generics,repositories,network_proxies,proxies_connectors, repository_groups,search,general_admin) { diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 2f4a9031f..c1599fa53 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -318,6 +318,14 @@ define("utils",["jquery","i18n","jquery_tmpl"], function() { } } + appendArchivaVersion=function(){ + return "_archivaVersion="+window.archivaRuntimeInfo.version; + } + + buildLoadJsUrl=function(srcScript){ + return srcScript+"?"+appendArchivaVersion()+"&_"+jQuery.now(); + } + timestampNoCache=function(){ if (!window.archivaDevMode){ return ""; @@ -325,9 +333,6 @@ define("utils",["jquery","i18n","jquery_tmpl"], function() { return "&_="+jQuery.now(); } - appendTemplateUrl=function(){ - return "?"+appendArchivaVersion()+timestampNoCache(); - } /** * mapping for a java Map entry 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 77cc757de..91ce0feb0 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 @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -define("redback-templates",["text!js/redback/templates/user-edit.html"+appendTemplateUrl(), - "text!js/redback/templates/user-grids.html"+appendTemplateUrl(), - "text!js/redback/templates/login.html"+appendTemplateUrl(), - "text!js/redback/templates/register-form.html"+appendTemplateUrl(), - "text!js/redback/templates/password-change-form.html"+appendTemplateUrl(), - "text!js/redback/templates/user-edit-form.html"+appendTemplateUrl(), - "text!js/redback/templates/roles-tmpl.html"+appendTemplateUrl(), +define("redback-templates",["text!redback/templates/user-edit.html", + "text!redback/templates/user-grids.html", + "text!redback/templates/login.html", + "text!redback/templates/register-form.html", + "text!redback/templates/password-change-form.html", + "text!redback/templates/user-edit-form.html", + "text!redback/templates/roles-tmpl.html", "jquery_tmpl","utils"], function(useredit, usergrids, login,register,passwordchange,usereditform,roles) { diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/startup.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/startup.js index 1ec5fc6e1..481d0df44 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/startup.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/startup.js @@ -20,16 +20,6 @@ define("startup",["jquery","utils"], function() { - - appendArchivaVersion=function(){ - return "_archivaVersion="+window.archivaRuntimeInfo.version; - } - - buildLoadJsUrl=function(srcScript){ - return srcScript+"?"+appendArchivaVersion()+"&_"+jQuery.now(); - } - - // define a container object with various datas window.archivaModel = {}; @@ -39,6 +29,6 @@ function() { jQuery.ajaxSetup( { cache: false,//!window.archivaDevMode dataType: 'json' - } ); - + }); + loadi18n(); }); \ No newline at end of file