@ -19,6 +19,8 @@ var modifier = "";
var modifiertype = "" ;
var modifiertype = "" ;
function search ( search , count , offset ) {
function search ( search , count , offset ) {
var navhtml = document . getElementById ( "searchnavigation" ) ;
if ( navhtml != null ) navhtml . innerHTML = "<div>loading...</div>" ;
query = search ;
query = search ;
maximumRecords = count ;
maximumRecords = count ;
if ( count == "" ) maximumRecords = 1000 ;
if ( count == "" ) maximumRecords = 1000 ;
@ -51,6 +53,7 @@ function navget(list, name) {
}
}
function preparepage ( str ) {
function preparepage ( str ) {
document . getElementById ( "searchnavigation" ) . innerHTML = "<div>parsing result...</div>" ;
var raw = document . getElementById ( "raw" ) ;
var raw = document . getElementById ( "raw" ) ;
if ( raw != null ) raw . innerHTML = str ;
if ( raw != null ) raw . innerHTML = str ;
var rsp = eval ( "(" + str + ")" ) ;
var rsp = eval ( "(" + str + ")" ) ;
@ -69,11 +72,14 @@ function preparepage(str) {
if ( modifiertype == "png" || modifiertype == "gif" || modifiertype == "jpg" ) {
if ( modifiertype == "png" || modifiertype == "gif" || modifiertype == "jpg" ) {
document . getElementById ( "searchresults" ) . innerHTML = resultImages ( ) ;
var tt = resultImages ( ) ;
document . getElementById ( "searchresults" ) . innerHTML = tt ;
} else {
} 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 = "" ;
document . getElementById ( "serverlist" ) . innerHTML = "" ;
hideDownloadScript ( ) ;
hideDownloadScript ( ) ;
}
}
@ -91,6 +97,7 @@ function hideDownloadScript() {
function resultNavigation ( ) {
function resultNavigation ( ) {
var html = "" ;
var html = "" ;
if ( searchresult . length > totalResults ) totalResults = searchresult . length ;
if ( totalResults > 0 ) {
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. " ;
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. " ;
html += "<div id=\"downloadbutton\" style=\"inline\"></div></div>" ;
html += "<div id=\"downloadbutton\" style=\"inline\"></div></div>" ;
@ -143,6 +150,7 @@ function resultNavigation() {
function resultList ( ) {
function resultList ( ) {
var html = "" ;
var html = "" ;
if ( searchresult . length > 0 ) {
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 += "<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>" ;
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 ) ; }
for ( var i = 0 ; i < searchresult . length ; i ++ ) { html += resultLine ( "row" , searchresult [ i ] , i + 1 ) ; }
@ -153,6 +161,7 @@ function resultList() {
function resultImages ( ) {
function resultImages ( ) {
var html = "" ;
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 ] ) ; }
for ( var i = 0 ; i < searchresult . length ; i ++ ) { html += resultLine ( "image" , searchresult [ i ] ) ; }
return html ;
return html ;
}
}