From fc0b17de624ca67b9e152d277e78d055218b8913 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 21 Jan 2013 23:49:41 +0000 Subject: [PATCH] doh wtf jquery 1.9.0 do not call success if ajax call return 204 not content git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1436693 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-webapp/src/main/webapp/js/archiva/main.js | 5 ++++- .../src/main/webapp/js/redback/redback.js | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js index 9c26fca72..fc80c1545 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js @@ -173,15 +173,17 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa success: function(data) { //var disableRegistration=data.disableRegistration; var topbarMenu=$("#topbar-menu"); + var organisationLogo=topbarMenu.find("#organisation-logo"); if( data){ $.log("disableRegistration"); topbarMenu.find("#register-link" ).hide(); + } $.ajax("restServices/archivaServices/archivaAdministrationService/getOrganisationInformation", { type: "GET", dataType: 'json', success: function(data) { - var organisationLogo=topbarMenu.find("#organisation-logo"); + if(data.url){ var url = data.url.startsWith("http://") || data.url.startsWith("https://") ? data.url : "http://"+data.url; var link=""; @@ -769,6 +771,7 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa }; checkSecurityLinks=function(){ + $.log("checkSecurityLinks"); userLogged(userLoggedCallbackFn); }; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/redback.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/redback.js index 4faafeefb..bc5da7d67 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/redback.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/redback.js @@ -43,6 +43,7 @@ define("redback",["jquery","utils","jquery.validate","jquery.json","knockout", $.ajax("restServices/redbackServices/loginService/isLogged", { type: "GET", success: function(data) { + $.log("isLogged:"+data); var user = data ? mapUser(data):null; window.user=user; if(user){ @@ -57,6 +58,16 @@ define("redback",["jquery","utils","jquery.validate","jquery.json","knockout", notLoggedFn(); } } + }, + statusCode: { + 204: function() { + if (successFn){ + successFn(null); + } + if(notLoggedFn){ + notLoggedFn(); + } + } } }); }