]> source.dussan.org Git - archiva.git/commitdiff
default screen to search
authorOlivier Lamy <olamy@apache.org>
Wed, 11 Jul 2012 22:03:41 +0000 (22:03 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 11 Jul 2012 22:03:41 +0000 (22:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1360440 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js

index eeb372a6a1a85f23e0389f2f015f12d1b2b54263..0ee7f474ee0209f01b1bb654bca36a29d10c5d9b 100644 (file)
@@ -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();
+
   }