$(".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);
<script id="artifact_content_tree_partial" type="text/html">
<ul class="jqueryFileTree" style="display: none;">
{{each artifactContentEntries}}
- <li class="directory collapsed">
- <a href="#" rel="${$value.path}/">${$value.path}</a>
- </li>
+ {{if $value.file == true}}
+ <li class="file">
+ <a href="#" rel="${$value.path}/">${$value.text}</a>
+ </li>
+ {{else}}
+ <li class="directory collapsed">
+ <a href="#" rel="${$value.path}/">${$value.text}</a>
+ </li>
+ {{/if}}
{{/each}}
</ul>
</script>
\ No newline at end of file