From: Olivier Lamy Date: Wed, 11 Jul 2012 22:03:41 +0000 (+0000) Subject: default screen to search X-Git-Tag: archiva-1.4-M3~505 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=75998ea77d838df0e70f035eb46f52ec049653c9;p=archiva.git default screen to search git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1360440 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 eeb372a6a..0ee7f474e 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 @@ -52,26 +52,7 @@ function() { }); } - // handle url with registration link - checkUrlParams=function(){ - var validateMeId = $.urlParam('validateMe'); - if (validateMeId) { - validateKey(validateMeId); - return; - } - var resetPassword= $.urlParam('resetPassword'); - if (resetPassword){ - resetPasswordForm(resetPassword); - return; - } - // by default display search screen - $.log("location:"+window.sammyArchivaApplication.getLocation()); - //window.sammyArchivaApplication.setLocation("#search"); - } - hasKarma=function(karmaName){ - return $.inArray(karmaName,window.redbackModel.operatioNames)>=0; - } decorateMenuWithKarma=function(user) { var username = user.username; @@ -247,7 +228,6 @@ function() { }); //this.get('', function () { this.app.runRoute('get', '#search') }); }); - sammyArchivaApplication.run(); } userLoggedCallbackFn=function(user){ @@ -292,6 +272,33 @@ function() { }); } + // handle url with registration link + checkUrlParams=function(){ + var validateMeId = $.urlParam('validateMe'); + if (validateMeId) { + validateKey(validateMeId); + return; + } + var resetPassword= $.urlParam('resetPassword'); + if (resetPassword){ + resetPasswordForm(resetPassword); + return; + } + + var matches = window.location.toString().match(/^[^#]*(#.+)$/); + var hash = matches ? matches[1] : ''; + $.log("location:"+window.sammyArchivaApplication.getLocation()+",hash:"+hash); + // by default display search screen + if(!hash){ + window.sammyArchivaApplication.setLocation("#search"); + } + + } + + hasKarma=function(karmaName){ + return $.inArray(karmaName,window.redbackModel.operatioNames)>=0; + } + startArchivaApplication=function(){ $.log("startArchivaApplication"); @@ -349,6 +356,8 @@ function() { }; updateAppearanceToolBar(); + window.sammyArchivaApplication.run(); + }