mirror of https://github.com/apache/archiva.git
[MRM-1620] add a tab to browse artifact content in artifact detail view
artifact content. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1341112 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
de4d335725
commit
d58465581a
|
@ -280,6 +280,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
|
|||
$.get(artifactDownloadInfosUrl,function(data){
|
||||
$("#artifact-details-files-content" ).html($("#artifact-details-files-content_tmpl").tmpl({artifactDownloadInfos:data}));
|
||||
mainContent.find("#artifact-content-list-files li" ).on("click",function(){
|
||||
$("#main-content #artifact_content_tree").html("");
|
||||
var idValue = $(this ).attr("id");
|
||||
var classifier=idValue.substringBeforeLast(":");
|
||||
var type = idValue.substringAfterLast(":");
|
||||
|
@ -314,6 +315,27 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
|
|||
root: ""
|
||||
},function(file) {
|
||||
$.log("file:"+file.substringBeforeLast("/")+',classifier:'+classifier);
|
||||
var fileContentUrl = "restServices/archivaServices/browseService/artifactContentText/"+encodeURIComponent(self.groupId);
|
||||
fileContentUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(self.version);
|
||||
fileContentUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
||||
if(type){
|
||||
fileContentUrl+="&t="+type;
|
||||
}
|
||||
if(classifier){
|
||||
fileContentUrl+="&c="+classifier;
|
||||
}
|
||||
fileContentUrl+="&p="+file.substringBeforeLast("/");
|
||||
$.ajax({
|
||||
url: fileContentUrl,
|
||||
dataType: "text",
|
||||
success: function(data) {
|
||||
$.log("foo");
|
||||
$.log("data:"+data);
|
||||
var text = data.replace(/</g,'<');
|
||||
text=text.replace(/>/g,">");
|
||||
mainContent.find("#artifact-content-text" ).html(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue