better interaction

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7875 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2011-08-12 17:13:34 +00:00
parent 3f0349e362
commit ca09081341
2 changed files with 17 additions and 12 deletions

View File

@ -19,6 +19,8 @@ var modifier = "";
var modifiertype = "";
function search(search, count, offset) {
var navhtml = document.getElementById("searchnavigation");
if (navhtml != null) navhtml.innerHTML = "<div>loading...</div>";
query = search;
maximumRecords = count;
if (count == "") maximumRecords = 1000;
@ -51,6 +53,7 @@ function navget(list, name) {
}
function preparepage(str) {
document.getElementById("searchnavigation").innerHTML = "<div>parsing result...</div>";
var raw = document.getElementById("raw");
if (raw != null) raw.innerHTML = str;
var rsp = eval("(" + str + ")");
@ -69,11 +72,14 @@ function preparepage(str) {
if (modifiertype == "png" || modifiertype == "gif" || modifiertype == "jpg") {
document.getElementById("searchresults").innerHTML = resultImages();
var tt = resultImages();
document.getElementById("searchresults").innerHTML = tt;
} else {
document.getElementById("searchresults").innerHTML = resultList();
var tt = resultList();
document.getElementById("searchresults").innerHTML = tt;
}
document.getElementById("searchnavigation").innerHTML = resultNavigation();
var tt = resultNavigation();
document.getElementById("searchnavigation").innerHTML = tt;
document.getElementById("serverlist").innerHTML = "";
hideDownloadScript();
}
@ -91,6 +97,7 @@ function hideDownloadScript() {
function resultNavigation() {
var html = "";
if (searchresult.length > totalResults) totalResults = searchresult.length;
if (totalResults > 0) {
html += "<div>" + searchresult.length + " results from a total of " + totalResults + " docs in index (not showing offline resources); search time: " + ((new Date()).getTime() - start.getTime()) + " milliseconds.&nbsp;";
html += "<div id=\"downloadbutton\" style=\"inline\"></div></div>";
@ -143,6 +150,7 @@ function resultNavigation() {
function resultList() {
var html = "";
if (searchresult.length > 0) {
document.getElementById("searchnavigation").innerHTML = "<div>found " + searchresult.length + " documents, preparing table...</div>";
html += "<table class=\"sortable\" id=\"sortable\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"99%\">";
html += "<tr class=\"TableHeader\" valign=\"bottom\"><td width=\"10\">count</td><td width=\"40\">Protocol</td><td width=\"60\">Host</td><td width=\"260\">Path</td><td width=\"360\">Name</td><td width=\"60\">Size</td><td width=\"75\">Date</td></tr>";
for (var i = 0; i < searchresult.length; i++) { html += resultLine("row", searchresult[i], i + 1); }
@ -153,6 +161,7 @@ function resultList() {
function resultImages() {
var html = "";
document.getElementById("searchnavigation").innerHTML = "<div>found " + searchresult.length + " images, preparing...</div>";
for (var i = 0; i < searchresult.length; i++) { html += resultLine("image", searchresult[i]); }
return html;
}

View File

@ -30,14 +30,6 @@
};
});
</script>
<script type="text/javascript">
//<![CDATA[
var q = "#[query]#";
var s = "#[startRecord]#";
var m = "#[maximumRecords]#";
if (q != "") search(q, m, s);
//]]>
</script>
#(topmenu)#
#%env/templates/embeddedheader.template%#
::
@ -91,7 +83,11 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</div>
<script type="text/javascript">
//<![CDATA[
document.getElementById("query").focus();
var q = "#[query]#";
var s = "#[startRecord]#";
var m = "#[maximumRecords]#";
if (q != "") search(q, m, s);
document.getElementById("search").focus();
//]]>
</script>
#%env/templates/footer.template%#