summaryrefslogtreecommitdiff
path: root/share/www/script/browse.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/browse.js')
-rw-r--r--share/www/script/browse.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/www/script/browse.js b/share/www/script/browse.js
index 6abcb073..dde31c05 100644
--- a/share/www/script/browse.js
+++ b/share/www/script/browse.js
@@ -873,12 +873,18 @@ function CouchDocumentPage() {
}
function _renderAttachmentItem(name, attachment) {
+ var attachmentHref = db.uri + encodeURIComponent(docId)
+ + "/" + encodeURIComponent(name);
var li = $("<li></li>");
$("<a href='' title='Download file' target='_top'></a>").text(name)
- .attr("href", db.uri + encodeURIComponent(docId) + "/" + encodeURIComponent(name))
+ .attr("href", attachmentHref)
.wrapInner("<tt></tt>").appendTo(li);
$("<span>()</span>").text("" + prettyPrintSize(attachment.length) +
", " + attachment.content_type).addClass("info").appendTo(li);
+ if (name == "tests.js") {
+ li.find('span.info').append(', <a href="/_utils/couch_tests.html?'
+ + attachmentHref + '">open in test runner</a>');
+ }
_initAttachmentItem(name, attachment, li);
return li;
}