aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-08-09 21:12:11 +0000
committerOlivier Lamy <olamy@apache.org>2012-08-09 21:12:11 +0000
commit3b0eb2985c2411532a0e55b68658139544b05766 (patch)
tree6a7dd609875ec9099f12017c6393a81caca9cf54 /archiva-modules
parent2284bc16352e166198f76b9323e6ccdba1071d6e (diff)
downloadarchiva-3b0eb2985c2411532a0e55b68658139544b05766.tar.gz
archiva-3b0eb2985c2411532a0e55b68658139544b05766.zip
history navigation when seeing artifact dependencies
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1371485 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js22
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js23
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html4
3 files changed, 40 insertions, 9 deletions
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 1cfb929a1..d429e96f6 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
@@ -243,7 +243,6 @@ function() {
$.log("get #artifact:"+groupId+":"+artifactId);
goToBrowseArtifactDetail(groupId,artifactId,repositoryId);//,null,null);
return;
-
});
this.get('#artifact/:groupId/:artifactId/:version',function(context){
@@ -252,7 +251,6 @@ function() {
var artifactId= this.params.artifactId;
var version= this.params.version;
generalDisplayArtifactDetailsVersionView(groupId,artifactId,version,repositoryId);
-
});
this.get('#artifact~:repositoryId/:groupId/:artifactId/:version',function(context){
@@ -261,8 +259,28 @@ function() {
var artifactId= this.params.artifactId;
var version= this.params.version;
generalDisplayArtifactDetailsVersionView(groupId,artifactId,version,repositoryId);
+ });
+
+ this.get('#artifact-dependencies/:groupId/:artifactId/:version',function(context){
+
+ var repositoryId = this.params.repositoryId;
+ var groupId= this.params.groupId;
+ var artifactId= this.params.artifactId;
+ var version= this.params.version;
+ generalDisplayArtifactDetailsVersionView(groupId,artifactId,version,repositoryId,function(){$("#main-content #artifact-details-dependencies-content-a").tab('show')});
});
+
+ this.get('#artifact-dependencies~:repositoryId/:groupId/:artifactId/:version',function(context){
+
+ var repositoryId = this.params.repositoryId;
+ var groupId= this.params.groupId;
+ var artifactId= this.params.artifactId;
+ var version= this.params.version;
+ generalDisplayArtifactDetailsVersionView(groupId,artifactId,version,repositoryId,function(){$("#main-content #artifact-details-dependencies-content-a").tab('show')});
+
+ });
+
this.get('#browse/:groupId',function(context){
var groupId = this.params.groupId;
if (groupId){
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
index 7606ddb60..7874b1322 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
@@ -219,9 +219,10 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
return entries;
}
- this.display=function(){
+ this.display=function(afterCallbackFn){
mainContent.find("#browse_breadcrumb").hide("slide", {}, 300,function(){
mainContent.find("#browse_artifact").hide("slide", {}, 300,function(){
+
mainContent.find("#browse_artifact_detail").show();
mainContent.find("#browse_artifact_detail").html(mediumSpinnerImg());
mainContent.find("#browse_breadcrumb" ).show();
@@ -244,6 +245,16 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
mainContent.find("#browse-autocomplete-divider" ).hide();
mainContent.find("#artifact-details-tabs").on('show', function (e) {
+ if ($(e.target).attr("data-target")=="#artifact-details-dependencies-content") {
+ var location ="#artifact-dependencies";
+ if (self.repositoryId){
+ location+="~"+self.repositoryId;
+ }
+ location+="/"+self.groupId+"/"+self.artifactId+"/"+self.version;
+
+ window.sammyArchivaApplication.setLocation(location);
+ }
+
if ($(e.target).attr("href")=="#artifact-details-dependency-tree-content") {
var treeContentDiv=mainContent.find("#artifact-details-dependency-tree-content" );
if( $.trim(treeContentDiv.html()).length<1){
@@ -328,7 +339,11 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
displayArtifactFilesContent(self);
}
});
+ if(afterCallbackFn){
+ afterCallbackFn();
+ }
}
+
});
});
@@ -486,8 +501,6 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
$.i18n.prop('artifact.delete.confirm.title'),
$.i18n.prop('artifact.delete.confirm.save'));
-
-
}
this.deleteKarma = hasKarma('archiva-delete-artifact');
@@ -1481,7 +1494,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
}
}
- generalDisplayArtifactDetailsVersionView=function(groupId,artifactId,version,repositoryId){
+ generalDisplayArtifactDetailsVersionView=function(groupId,artifactId,version,repositoryId,afterCallbackFn){
var mainContent=$("#main-content");
mainContent.html($("#browse-tmpl" ).tmpl());
mainContent.find("#browse_result" ).hide();
@@ -1494,7 +1507,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
function(data) {
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:repositoryId}));
var artifactVersionDetailViewModel=new ArtifactVersionDetailViewModel(groupId,artifactId,version,repositoryId);
- artifactVersionDetailViewModel.display();
+ artifactVersionDetailViewModel.display(afterCallbackFn);
}
);
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
index 0b9183f53..cdf46e646 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
@@ -429,10 +429,10 @@
<a data-toggle="tab" href="#artifact-details-info-content">${$.i18n.prop('artifact.detail.tab.header.info')}</a>
</li>
<li>
- <a data-toggle="tab" href="#artifact-details-dependencies-content">${$.i18n.prop('artifact.detail.tab.header.dependencies')}</a>
+ <a data-toggle="tab" id="artifact-details-dependencies-content-a" data-target="#artifact-details-dependencies-content" href="#artifact-details-dependencies-content">${$.i18n.prop('artifact.detail.tab.header.dependencies')}</a>
</li>
<li>
- <a data-toggle="tab" href="#artifact-details-dependency-tree-content">${$.i18n.prop('artifact.detail.tab.header.dependency.tree')}</a>
+ <a data-toggle="tab" id="artifact-details-dependency-tree-content-a" data-target="#artifact-details-dependency-tree-content" href="#artifact-details-dependency-tree-content">${$.i18n.prop('artifact.detail.tab.header.dependency.tree')}</a>
</li>
<li>
<a data-toggle="tab" href="#artifact-details-files-content">${$.i18n.prop('artifact.detail.tab.header.file.content')}</a>