diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js index d7745ac10..ed275b8f2 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js @@ -51,8 +51,8 @@ $.ajax({ urlArgs: ""+appendJsNoCacheUrl(), shim: { 'sammy':['jquery','jquery.tmpl'], - 'archiva.main':['jquery','jquery.ui','sammy','jquery.tmpl'], - 'utils':['jquery','jquery.tmpl'], + 'archiva.main':['jquery','jquery.ui','sammy','jquery.tmpl','utils','i18n'], + 'utils':['jquery','jquery.tmpl','i18n'], 'archiva.templates': ['jquery','jquery.tmpl','utils'], 'redback.templates': ['jquery','jquery.tmpl','utils'] }, @@ -97,9 +97,9 @@ $.ajax({ } }); - requirejs(['jquery','jquery.tmpl','jquery.ui','i18n','sammy','startup','utils',"archiva.main",'domReady!'], function (domReady) { - loadi18n(function () { - $.ajax({ + requirejs(['jquery','jquery.tmpl','jquery.ui','i18n','sammy','startup','utils','domReady!','archiva.main'], function () { + loadi18n(function () { + $.ajax({ url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(), dataType: 'json', success:function(data){ @@ -107,14 +107,14 @@ $.ajax({ window.archivaJavascriptLog=data.javascriptLog; window.archivaRuntimeInfo=data; - require(['sammy','jquery','jquery.tmpl','archiva.main','utils','domReady!'],function () { + require(['sammy','jquery','i18n','jquery.tmpl','archiva.main','utils','domReady!'],function () { startArchivaApplication(); $("#loadingDiv").hide(); drawQuickSearchAutocomplete(); }) } }) + }); }) - }); } }) 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 72fb7ab98..46611cab8 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,23 +16,24 @@ * specific language governing permissions and limitations * under the License. */ -require(['jquery',"jquery.tmpl","utils","text!templates/archiva/menu.html", +require(['jquery',"jquery.tmpl",'i18n',"utils","text!templates/archiva/menu.html", "text!templates/archiva/generics.html", "text!templates/archiva/modal.html", "text!templates/archiva/repositories.html", "text!templates/archiva/search.html", "text!templates/archiva/general-admin.html"], - function(jquery,jqueryTmpl,utils,menu,generics,modal,repositories, + function(jquery,jqueryTmpl,i18n,utils,menu,generics,modal,repositories, search,general_admin) { - - var htmlFragment=$("#html-fragments"); - // template loading - htmlFragment.append(menu); - htmlFragment.append(generics); - $.tmpl( modal ).appendTo(htmlFragment); - htmlFragment.append(repositories); - htmlFragment.append(search); - htmlFragment.append(general_admin); - $.log("main-tmpl.js loaded"); + loadArchivaTemplate=function(){ + var htmlFragment=$("#html-fragments"); + // template loading + htmlFragment.append(menu); + htmlFragment.append(generics); + $.tmpl( modal ).appendTo(htmlFragment); + htmlFragment.append(repositories); + 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/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index 855387847..e08446034 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva.main",["jquery","jquery.ui","sammy","jquery.tmpl","jquery.cookie","bootstrap","archiva.search", +define("archiva.main",["jquery","jquery.ui","sammy","jquery.tmpl",'i18n',"jquery.cookie","bootstrap","archiva.search", "jquery.validate","jquery.json","knockout","redback.templates","archiva.templates", "redback.roles","redback","archiva.general-admin","archiva.repositories", "archiva.network-proxies","archiva.proxy-connectors","archiva.repository-groups","archiva.artifacts-management"], @@ -581,6 +581,8 @@ function(jquery,ui,sammy,tmpl) { startArchivaApplication=function(){ $.log("startArchivaApplication"); + loadRedbackTemplate(); + loadArchivaTemplate(); $('#topbar-menu-container').html($("#topbar_menu_tmpl" ).tmpl()); $('#sidebar-content').html($("#main_menu_tmpl").tmpl()); 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 7817e4a89..f9f4e2aae 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,15 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -require(['jquery',"jquery.tmpl","utils","text!templates/redback/user-edit.html", +require(['jquery',"jquery.tmpl",'i18n',"utils","text!templates/redback/user-edit.html", "text!templates/redback/login.html"], - function(jquery,jqueryTmpl,utils,useredit, login) { + function(jquery,jqueryTmpl,i18n,utils,useredit, login) { - var htmlFragment=$("#html-fragments"); + loadRedbackTemplate=function(){ - // template loading - htmlFragment.append(useredit); - $.tmpl(login).appendTo("#html-fragments"); - $.log("redback-tmpl.js loaded"); + var htmlFragment=$("#html-fragments"); + + // template loading + htmlFragment.append(useredit); + //$.tmpl(useredit).appendTo("#html-fragments"); + $.tmpl(login).appendTo("#html-fragments"); + //htmlFragment.append(login); + $.log("redback-tmpl.js loaded"); + } } ); \ No newline at end of file