From f8f551d32472429cb9f78e82a8b144249fdd5add Mon Sep 17 00:00:00 2001 From: "David Humphrey (:humph)" Date: Mon, 16 Aug 2010 08:57:48 -0400 Subject: [PATCH] Fix virtroot path issue in getinfo.cgi --- js/dxr.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/dxr.js b/js/dxr.js index 90bf49867..cd7ba4c8a 100644 --- a/js/dxr.js +++ b/js/dxr.js @@ -11,6 +11,7 @@ var infoDiv, currentLine, signature, maincontent, + sep = '', signatureVisible = false; function closeInfo() { @@ -29,7 +30,7 @@ function showInfo(node) { var name = node.innerHTML; var line = node.parentNode.id.replace('l', ''); var file = location.pathname.replace(virtroot + '/' + tree + '/', '').replace('.html', ''); - var url = "/dxr/getinfo.cgi?virtroot=" + virtroot + "&tree=" + tree + "&div=" + infoDivID++ + var url = virtroot + sep + "getinfo.cgi?virtroot=" + virtroot + "&tree=" + tree + "&div=" + infoDivID++ if (type == 's' || type == 's-fuzzy') { // statements have matching line number url += "&type=" + type + "&name=" + name + "&file=" + file + "&line=" + node.getAttribute("line").replace('l',''); @@ -90,6 +91,9 @@ function init() { dojo.addClass(l, 'highlighted'); } } + + // Figure out the right path separator to use with virtroot + sep = virtroot[virtroot.length - 1] === '/' ? '' : '/'; } // Given a line number, try to find the ID for the containing function in the sidebar.