second try of rev 4100 :). Tested in Iceweasel/Firefox 2.0.6, Konqueror 3.5.7, Opera 9.23 (all linux) and IE6-SP1 (wine)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4102 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
fuchsi 18 years ago
parent 6b8faaadb6
commit 9524b9c16a

@ -241,9 +241,37 @@ div.ProgressBar {
} }
div.ProgressBarFill { div.ProgressBarFill {
margin:0px; margin:0px;
padding:0px;
height:100%; /*not valid value for Netscape 8*/ height:100%; /*not valid value for Netscape 8*/
} }
#resCounter {
/* left part of the progress bar */
position: absolute;
left: 1em;
}
#resProgBar {
height: 1.5em;
margin: 1em auto;
position: relative; /* for "relative" absolute pos of children */
text-align: left;
width: 100%;
float: none;
}
#resNav {
/* right part of the progress bar */
position: absolute;
right: 1em;
}
#resProgFill {
position: absolute;
left: 0px;
top: 0px;
}
div.bookmarkList, div.Tags { div.bookmarkList, div.Tags {
margin-top:1em; margin-top:1em;
} }

@ -1,7 +1,4 @@
function Progressbar(length, parent) { function Progressbar(length, parent) {
// the description (displayed above the progressbar while loading the results), should be translated
var DESCRIPTION_STRING = "Loading results...";
// the number of steps of the bar // the number of steps of the bar
this.length = length; this.length = length;
// the current position, expressed in steps (so 100% = length) // the current position, expressed in steps (so 100% = length)
@ -12,41 +9,46 @@ function Progressbar(length, parent) {
// use this function to display the progress, because it updates everything // use this function to display the progress, because it updates everything
this.step = function(count) { this.step = function(count) {
this.position += count; if (this.position < this.length)
this.position += count;
// update the bar // update the bar
this.percentage = this.position*(100/this.length); this.percentage = this.position*(100/this.length);
this.fill.style.width = this.percentage + "%"; this.fill.style.width = this.percentage + "%";
// if the end is reached, the bar is hidden/removed // if the end is reached, the bar is hidden/removed
if(this.position==this.length) if(this.position >= this.length) {
removeAllChildren(this.element); this.fill.style.visibility = "hidden";
}
} }
// the actual progressbar // the actual progressbar
var bar = document.createElement("div"); var bar = document.createElement("div");
bar.className = "ProgressBar"; bar.id = "resProgBar";
bar.style.width = "100%"; bar.className ="ProgressBar";
bar.style.height = "20px";
bar.style.margin = "10px auto";
bar.style.textAlign = "left";
// the actual bar // the actual bar
this.fill = document.createElement("div"); this.fill = document.createElement("div");
this.fill.id = "resProgFill";
this.fill.className = "ProgressBarFill"; this.fill.className = "ProgressBarFill";
this.fill.style.width = "0%" this.fill.style.width = "0%"
bar.appendChild(this.fill); bar.appendChild(this.fill);
// a description for the bar
var description = document.createTextNode(DESCRIPTION_STRING);
var textcontainer = document.createElement("strong");
textcontainer.appendChild(description);
// the container for the elements used by the Progressbar // the container for the elements used by the Progressbar
this.element = document.createElement("div"); this.element = document.createElement("div");
this.element.style.textAlign = "center"; this.element.style.textAlign = "center";
// get hasLayout in IE, needed because of the percentage as width of the bar // get hasLayout in IE, needed because of the percentage as width of the bar
this.element.className = "gainlayout"; this.element.className = "gainlayout";
this.element.appendChild(textcontainer);
// results counter inside progress bar
var resCounter = document.getElementById("resCounter");
resCounter.style.display = "inline";
bar.appendChild(resCounter);
// the result sites navigation
var resNav = document.getElementById("resNav");
resNav.style.display = "inline";
bar.appendChild(resNav);
this.element.appendChild(bar); this.element.appendChild(bar);
parent.appendChild(this.element); parent.appendChild(this.element);
} }

@ -99,8 +99,9 @@ document.getElementById("Enter").value = "search again - catch up more links";
:: ::
<p>No Results. (length of search words must be at least 3 characters)</p> <p>No Results. (length of search words must be at least 3 characters)</p>
:: ::
<p><strong id="resultsOffset">#[offset]#</strong>-<strong id="itemscount">#[linkcount]#</strong> results from a total number of <strong id="totalcount">#[totalcount]#</strong> known#(globalresults)#.::, <strong id="globalcount">#[globalcount]#</strong> links from other YaCy peers.#(/globalresults)#<div id="results"></div></p> <div id="results"></div>
<p>Search Result Pages: <span id="pagenav">#[pagenav]#</span></p> <span id="resCounter" style="display: inline;"><strong id="resultsOffset">#[offset]#</strong>-<strong id="itemscount">#[linkcount]#</strong> results from a total number of <strong id="totalcount">#[totalcount]#</strong> known#(globalresults)#.::, <strong id="globalcount">#[globalcount]#</strong> links from other YaCy peers.#(/globalresults)#</span>
<span id="resNav" style="display: inline;">#[resnav]#</span>
:: ::
<p>Searching the web with this peer is disabled for unauthorized users. Please <a href="Status.html?login=">log in</a> as administrator to use the search function</p> <p>Searching the web with this peer is disabled for unauthorized users. Please <a href="Status.html?login=">log in</a> as administrator to use the search function</p>
#(/num-results)# #(/num-results)#

@ -323,29 +323,29 @@ public class yacysearch {
prop.put("num-results_linkcount", 0); prop.put("num-results_linkcount", 0);
// compose page navigation // compose page navigation
StringBuffer pagenav = new StringBuffer(); StringBuffer resnav = new StringBuffer();
int thispage = offset / theQuery.displayResults(); int thispage = offset / theQuery.displayResults();
if (thispage == 0) pagenav.append("&lt;&nbsp;"); else { if (thispage == 0) resnav.append("&lt;&nbsp;"); else {
pagenav.append(navurla(thispage - 1, display, theQuery)); resnav.append(navurla(thispage - 1, display, theQuery));
pagenav.append("<strong>&lt;</strong></a>&nbsp;"); resnav.append("<strong>&lt;</strong></a>&nbsp;");
} }
int numberofpages = Math.min(10, Math.min(thispage + 2, (theSearch.getGlobalCount() + theSearch.getLocalCount()) / theQuery.displayResults())); int numberofpages = Math.min(10, Math.min(thispage + 2, (theSearch.getGlobalCount() + theSearch.getLocalCount()) / theQuery.displayResults()));
for (int i = 0; i < numberofpages; i++) { for (int i = 0; i < numberofpages; i++) {
if (i == thispage) { if (i == thispage) {
pagenav.append("<strong>"); resnav.append("<strong>");
pagenav.append(i + 1); resnav.append(i + 1);
pagenav.append("</strong>&nbsp;"); resnav.append("</strong>&nbsp;");
} else { } else {
pagenav.append(navurla(i, display, theQuery)); resnav.append(navurla(i, display, theQuery));
pagenav.append(i + 1); resnav.append(i + 1);
pagenav.append("</a>&nbsp;"); resnav.append("</a>&nbsp;");
} }
} }
if (thispage >= numberofpages) pagenav.append("&gt;"); else { if (thispage >= numberofpages) resnav.append("&gt;"); else {
pagenav.append(navurla(thispage + 1, display, theQuery)); resnav.append(navurla(thispage + 1, display, theQuery));
pagenav.append("<strong>&gt;</strong></a>"); resnav.append("<strong>&gt;</strong></a>");
} }
prop.putASIS("num-results_pagenav", pagenav.toString()); prop.putASIS("num-results_resnav", resnav.toString());
// generate the search result lines; they will be produced by another servlet // generate the search result lines; they will be produced by another servlet
for (int i = 0; i < theQuery.displayResults(); i++) { for (int i = 0; i < theQuery.displayResults(); i++) {

Loading…
Cancel
Save