changeBrowseRepository=function(){
var selectedRepository=getSelectedBrowsingRepository();
- window.sammyArchivaApplication.setLocation("#browse~"+selectedRepository);
+ // #browse~internal/org.apache.maven
+ var currentHash=window.location.hash;
+ var newLocation = "#browse~"+selectedRepository+currentHash.substringAfterFirst("/");
+ // do we have extra path after repository ?
+
+ $.log("changeBrowseRepository:"+newLocation);
+ window.sammyArchivaApplication.setLocation(newLocation);
}
getSelectedBrowsingRepository=function(){
String.prototype.substringAfterLast = function(str) {
return this.substring(this.lastIndexOf(str)+1);
}
+ /**
+ *
+ * @param str
+ * @return {String} if str not found return empty string
+ */
+ String.prototype.substringAfterFirst = function(str) {
+ var idx = this.indexOf(str);
+ if (idx<0){
+ return "";
+ }
+ return this.substring(idx);
+ }
//-----------------------------------------
// extends jquery tmpl to support var def