From: Olivier Lamy Date: Wed, 16 May 2012 22:19:21 +0000 (+0000) Subject: [MRM-1620] add a tab to browse artifact content in artifact detail view X-Git-Tag: archiva-1.4-M3~720 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=25d7ddeaaf5bea7d87e4f3652e868d6bc9b1a018;p=archiva.git [MRM-1620] add a tab to browse artifact content in artifact detail view fix browsing view git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1339400 13f79535-47bb-0310-9956-ffa450edef68 --- 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 8b8d609e2..d3b6219d7 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 @@ -387,6 +387,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock this.path=path; this.file=file; this.depth=depth; + this.text=""; } mapArtifactContentEntries=function(data){ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/jqueryFileTree-1.0.1.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/jqueryFileTree-1.0.1.js index 467eeea21..289b8e329 100755 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/jqueryFileTree-1.0.1.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/jqueryFileTree-1.0.1.js @@ -53,7 +53,13 @@ if(jQuery) (function($){ $(".jqueryFileTree.start").remove(); $.get(o.script, { p: t }, function(data) { $(c).find('.start').html(''); - var htmlContent = $("#artifact_content_tree_partial" ).tmpl({artifactContentEntries:mapArtifactContentEntries(data)}); + var artifactContentEntries=mapArtifactContentEntries(data); + $(artifactContentEntries ).each(function(idx, elem){ + elem.text=elem.path.substr( t.length, elem.path.length); + }); + var htmlContent = $("#artifact_content_tree_partial" ).tmpl( + {artifactContentEntries:artifactContentEntries} + ); $(c).removeClass('wait').append(htmlContent); if( o.root == t ) $(c).find('UL:hidden').show(); else $(c).find('UL:hidden').slideDown({ duration: o.expandSpeed, easing: o.expandEasing }); bindTree(c); 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 76d1d9e2e..a5d6d471e 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 @@ -795,9 +795,15 @@ \ No newline at end of file