From: Olivier Lamy Date: Mon, 23 Jan 2012 12:32:33 +0000 (+0000) Subject: use i18n function call rather than simple variable because if key is missing and... X-Git-Tag: archiva-1.4-M3~1507 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0bc00f1754bc71fc346322c6b783ad301c63e2e3;p=archiva.git use i18n function call rather than simple variable because if key is missing and function exists with same name the js function is called which can be weird git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1234764 13f79535-47bb-0310-9956-ffa450edef68 --- 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 e5647cc0c..219925184 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 @@ -111,11 +111,12 @@ $(function() { $("#sidebar-content [redback-permissions]").each(function(element){ $(this).hide(); }); - + $.log("hideElementWithKarma"); } checkSecurityLinks=function(){ + $.log("checkSecurityLinks"); var user = userLogged(); $.log("checkSecurityLinks, user:"+user); @@ -136,6 +137,7 @@ $(function() { $.ajax("restServices/redbackServices/userService/isAdminUserExists", { type: "GET", dataType: 'json', + async: false, success: function(data) { var adminExists = JSON.parse(data); if (adminExists == false) { @@ -145,6 +147,7 @@ $(function() { } else { $("#create-admin-link").hide(); } + $.log("adminExists:"+adminExists); } }); } @@ -159,6 +162,8 @@ $(function() { $('#topbar-menu-container').html($("#topbar-menu")); $('#sidebar-content').html($("#main-menu")); + + checkCreateAdminLink(); hideElementWithKarma(); checkSecurityLinks(); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index 9932c50bf..181d43082 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -133,6 +133,7 @@ $(function() { this.availableLayouts = window.managedRepositoryTypes; save=function(){ + $.log("repositories.js#save"); var valid = $("#main-content #managed-repository-edit-form").valid(); if (valid==false) { return; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/topbar.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/topbar.html index 18233271d..9d9323969 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/topbar.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/topbar.html @@ -30,7 +30,7 @@ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback.js index a4160292c..1f80baa21 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback.js @@ -37,6 +37,7 @@ $(function() { userLogged=function() { // call restServices/redbackServices/loginService/isLogged to know // if a session exists and check the cookie + $.log("userLogged"); var userLogged = true; $.ajax("restServices/redbackServices/loginService/isLogged", { type: "GET", diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/register.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/register.js index bdcf99071..e8ce1e31a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/register.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/register.js @@ -45,6 +45,7 @@ $(function() { * validate the register form and call REST service */ register=function(){ + $.log("register.js#register"); var valid = $("#user-register-form").valid(); if (!valid) { return; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/login.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/login.html index 769158382..a0e0e9061 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/login.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/login.html @@ -41,7 +41,7 @@ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/password-change-form.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/password-change-form.html index 5acd6fd40..4207d2224 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/password-change-form.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/password-change-form.html @@ -50,6 +50,6 @@ \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/register-form.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/register-form.html index d6da8ec92..b555f3372 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/register-form.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/register-form.html @@ -48,6 +48,6 @@ \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js index 55813d881..ab239c74e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js @@ -97,6 +97,7 @@ $(function() { }; this.createAdmin = function() { + $.log("user.js#createAdmin"); var valid = $("#user-create").valid(); $.log("create admin"); if (!valid) { @@ -310,6 +311,7 @@ $(function() { * open a modal box for login */ loginBox=function(){ + $.log("loginBox"); screenChange(); if (window.modalLoginWindow==null) { window.modalLoginWindow = $("#modal-login").modal({backdrop:'static',show:false}); @@ -325,6 +327,7 @@ $(function() { }); $("#modal-login").delegate("#modal-login-ok", "click keydown keypress", function(e) { e.preventDefault(); + $.log("loginBox before login"); login(); }); $("#modal-login").focus(); @@ -398,6 +401,7 @@ $(function() { * validate login box before ajax call */ login=function(){ + $.log("user.js#login"); $("#modal-login-err-message").html(""); screenChange(); var valid = $("#user-login-form").valid(); @@ -493,6 +497,7 @@ $(function() { }) $("#modal-user-edit #modal-user-edit-ok").on( "click keydown keypress", function(e) { e.preventDefault(); + $.log("user.js#editUserDetailsBox"); var valid = $("#user-edit-form").valid(); if (!valid) { return; @@ -568,6 +573,7 @@ $(function() { * @param registration are we in registration mode ? if yes the user will be logged */ changePassword=function(previousPassword,registration,user){ + $.log("user.js#changePassword"); var valid = $("#password-change-form").valid(); if (valid==false) { return; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js index 888def24c..fba291eb5 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js @@ -138,6 +138,7 @@ $(function() { }); $("#main-content #user-create").delegate("#user-create-form-save-button", "click keydown", function(e) { e.preventDefault(); + $.log("users.js#editUserBox"); var valid = $("#user-create").valid(); if (!valid) { return;