mirror of https://github.com/apache/archiva.git
avoid duplicate code
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1304367 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c51bba95bb
commit
e90a94f273
|
@ -95,23 +95,7 @@ $(function() {
|
||||||
displayBrowseArtifactDetail(splitted[0],splitted[1],null,null);
|
displayBrowseArtifactDetail(splitted[0],splitted[1],null,null);
|
||||||
return;
|
return;
|
||||||
} else if (splitted.length==3) {
|
} else if (splitted.length==3) {
|
||||||
var mainContent=$("#main-content");
|
generaldisplayArtifactDetailsVersionView(splitted[0],splitted[1],splitted[2],repositoryId);
|
||||||
mainContent.html($("#browse-tmpl" ).tmpl());
|
|
||||||
mainContent.find("#browse_result" ).hide();
|
|
||||||
mainContent.find("#browse_artifact_detail").show();
|
|
||||||
mainContent.find("#browse_artifact_detail").html(mediumSpinnerImg());
|
|
||||||
mainContent.find("#browse_breadcrumb" ).show();
|
|
||||||
mainContent.find("#browse_breadcrumb" ).html(mediumSpinnerImg());
|
|
||||||
$.ajax("restServices/archivaServices/browseService/userRepositories", {
|
|
||||||
type: "GET",
|
|
||||||
dataType: 'json',
|
|
||||||
success: function(data) {
|
|
||||||
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:repositoryId}));
|
|
||||||
var artifactVersionDetailViewModel=new ArtifactVersionDetailViewModel(splitted[0],splitted[1],splitted[2]);
|
|
||||||
artifactVersionDetailViewModel.display(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
displayWarningMessage( $.i18n.prop("shortcut.artifact.illegal"));
|
displayWarningMessage( $.i18n.prop("shortcut.artifact.illegal"));
|
||||||
|
|
|
@ -1027,34 +1027,34 @@ $(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
groupIdView=function(artifact){
|
groupIdView=function(artifact){
|
||||||
$.log("groupIdView:"+artifact.groupId);
|
|
||||||
displayBrowseGroupId(artifact.groupId);
|
displayBrowseGroupId(artifact.groupId);
|
||||||
}
|
}
|
||||||
artifactIdView=function(artifact){
|
artifactIdView=function(artifact){
|
||||||
$.log("artifactIdView:"+artifact.groupId);
|
|
||||||
displayBrowseArtifactDetail(artifact.groupId,artifact.artifactId,null,null);
|
displayBrowseArtifactDetail(artifact.groupId,artifact.artifactId,null,null);
|
||||||
}
|
}
|
||||||
artifactDetailView=function(artifact){
|
artifactDetailView=function(artifact){
|
||||||
$.log("artifactDetailView:"+artifact.groupId);
|
generaldisplayArtifactDetailsVersionView(artifact.groupId,artifact.artifactId,artifact.version,null);
|
||||||
var mainContent=$("#main-content");
|
|
||||||
mainContent.html($("#browse-tmpl" ).tmpl());
|
|
||||||
mainContent.find("#browse_result" ).hide();
|
|
||||||
mainContent.find("#browse_artifact_detail").show();
|
|
||||||
mainContent.find("#browse_artifact_detail").html(mediumSpinnerImg());
|
|
||||||
mainContent.find("#browse_breadcrumb" ).show();
|
|
||||||
mainContent.find("#browse_breadcrumb" ).html(mediumSpinnerImg());
|
|
||||||
$.ajax("restServices/archivaServices/browseService/userRepositories", {
|
|
||||||
type: "GET",
|
|
||||||
dataType: 'json',
|
|
||||||
success: function(data) {
|
|
||||||
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:null}));
|
|
||||||
var artifactVersionDetailViewModel=new ArtifactVersionDetailViewModel(artifact.groupId,artifact.artifactId,artifact.version);
|
|
||||||
artifactVersionDetailViewModel.display(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generaldisplayArtifactDetailsVersionView=function(groupId,artifactId,version,repositoryId){
|
||||||
|
var mainContent=$("#main-content");
|
||||||
|
mainContent.html($("#browse-tmpl" ).tmpl());
|
||||||
|
mainContent.find("#browse_result" ).hide();
|
||||||
|
mainContent.find("#browse_artifact_detail").show();
|
||||||
|
mainContent.find("#browse_artifact_detail").html(mediumSpinnerImg());
|
||||||
|
mainContent.find("#browse_breadcrumb" ).show();
|
||||||
|
mainContent.find("#browse_breadcrumb" ).html(mediumSpinnerImg());
|
||||||
|
$.ajax("restServices/archivaServices/browseService/userRepositories", {
|
||||||
|
type: "GET",
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(data) {
|
||||||
|
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:repositoryId}));
|
||||||
|
var artifactVersionDetailViewModel=new ArtifactVersionDetailViewModel(groupId,artifactId,version);
|
||||||
|
artifactVersionDetailViewModel.display(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
SearchViewModel=function(){
|
SearchViewModel=function(){
|
||||||
var self=this;
|
var self=this;
|
||||||
|
|
Loading…
Reference in New Issue