From 02fa31b5bf15634174a6606bc57f8ebe2727c1ee Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 12 Feb 2013 12:21:29 +0100 Subject: [PATCH] better filesearch layout --- htroot/js/yacyinteractive.js | 39 +++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/htroot/js/yacyinteractive.js b/htroot/js/yacyinteractive.js index 56a1df184..7c79f5e12 100644 --- a/htroot/js/yacyinteractive.js +++ b/htroot/js/yacyinteractive.js @@ -156,7 +156,7 @@ function resultList() { if (searchresult.length > 0) { document.getElementById("searchnavigation").innerHTML = "
found " + searchresult.length + " documents, preparing table...
"; html += ""; - html += ""; + html += ""; for (var i = 0; i < searchresult.length; i++) { html += resultLine("row", searchresult[i], i + 1); } html += "
countProtocolHostPathNameSizeDate
CountProtocolHostPathURLSizeDate
"; } @@ -174,19 +174,31 @@ function resultLine(type, item, linenumber) { // evaluate item if (item == null) return ""; if (item.link == null) return ""; - p = item.link.indexOf("//"); protocol = ""; host = ""; path = item.link; + file = ""; + p = item.link.indexOf("//"); if (p > 0) { - q = item.link.indexOf("/", p + 2); protocol = item.link.substring(0, p - 1); - host = item.link.substring(p + 2, q); - path = item.link.substring(q + 1); + q = item.link.indexOf("/", p + 2); + if (q > 0) { + host = item.link.substring(p + 2, q); + path = item.link.substring(q); + } else { + host = item.link.substring(p + 2); + path = "/"; + } } title = item.title; q = path.lastIndexOf("/"); - if (q > 0) path = path.substring(0, q); + if (q > 0) { + file = path.substring(q + 1); + path = path.substring(0, q + 1); + } else { + file = path; + path = "/"; + } path = unescape(path); if (path.length >= 40) path = path.substring(0, 18) + "..." + path.substring(path.length - 19); if (title == "") title = path; @@ -208,14 +220,13 @@ function resultLine(type, item, linenumber) { var html = ""; if (type == "row") { html += ""; - html += "" + linenumber + ""; - html += "" + protocol + ""; - html += "" + host + ""; - html += "" + path + ""; - html += "" + item.link + ""; - if (item.sizename == "-1 bytes") html += ""; else html += "" + item.sizename + ""; - //html += "" + item.description + ""; - html += "" + pd + ""; + html += "" + linenumber + ""; // Count + html += "" + protocol + ""; // Protocol + html += "" + host + ""; // Host + html += "" + path + ""; // Path + html += "" + item.link + ""; // URL + if (item.sizename == "-1 bytes") html += ""; else html += "" + item.sizename + ""; // Size + html += "" + pd + ""; // Date html += ""; } if (type == "image") {