Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
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)
fuchsi9524b9c16ab2
diff --git a/htroot/env/base.css b/htroot/env/base.cssindex e7a548f0e..0f3db2acb 100644--- a/htroot/env/base.css+++ b/htroot/env/base.css@@ -241,9 +241,37 @@ div.ProgressBar {}div.ProgressBarFill {margin:0px;+ padding:0px;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 {margin-top:1em;}diff --git a/htroot/js/yacysearch.js b/htroot/js/yacysearch.jsindex e30c7ce5f..2ec23214c 100644--- a/htroot/js/yacysearch.js+++ b/htroot/js/yacysearch.js@@ -1,7 +1,4 @@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 barthis.length = 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 everythingthis.step = function(count) {- this.position += count;+ if (this.position < this.length)+ this.position += count;+// update the barthis.percentage = this.position*(100/this.length);this.fill.style.width = this.percentage + "%";// if the end is reached, the bar is hidden/removed- if(this.position==this.length)- removeAllChildren(this.element);+ if(this.position >= this.length) {+ this.fill.style.visibility = "hidden";+ }}// the actual progressbarvar bar = document.createElement("div");- bar.className = "ProgressBar";- bar.style.width = "100%";- bar.style.height = "20px";- bar.style.margin = "10px auto";- bar.style.textAlign = "left";+ bar.id = "resProgBar";+ bar.className ="ProgressBar";// the actual barthis.fill = document.createElement("div");+ this.fill.id = "resProgFill";this.fill.className = "ProgressBarFill";this.fill.style.width = "0%"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 Progressbarthis.element = document.createElement("div");this.element.style.textAlign = "center";// get hasLayout in IE, needed because of the percentage as width of the barthis.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);parent.appendChild(this.element);}diff --git a/htroot/yacysearch.html b/htroot/yacysearch.htmlindex 40dd0ca2b..dfac3477d 100644--- a/htroot/yacysearch.html+++ b/htroot/yacysearch.html@@ -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><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>- <p>Search Result Pages: <span id="pagenav">#[pagenav]#</span></p>+ <div id="results"></div>+ <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>#(/num-results)#diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex 108562b9a..4b132ca48 100644--- a/htroot/yacysearch.java+++ b/htroot/yacysearch.java@@ -323,29 +323,29 @@ public class yacysearch {prop.put("num-results_linkcount", 0);// compose page navigation- StringBuffer pagenav = new StringBuffer();+ StringBuffer resnav = new StringBuffer();int thispage = offset / theQuery.displayResults();- if (thispage == 0) pagenav.append("< "); else {- pagenav.append(navurla(thispage - 1, display, theQuery));- pagenav.append("<strong><</strong></a> ");+ if (thispage == 0) resnav.append("< "); else {+ resnav.append(navurla(thispage - 1, display, theQuery));+ resnav.append("<strong><</strong></a> ");}int numberofpages = Math.min(10, Math.min(thispage + 2, (theSearch.getGlobalCount() + theSearch.getLocalCount()) / theQuery.displayResults()));for (int i = 0; i < numberofpages; i++) {if (i == thispage) {- pagenav.append("<strong>");- pagenav.append(i + 1);- pagenav.append("</strong> ");+ resnav.append("<strong>");+ resnav.append(i + 1);+ resnav.append("</strong> ");} else {- pagenav.append(navurla(i, display, theQuery));- pagenav.append(i + 1);- pagenav.append("</a> ");+ resnav.append(navurla(i, display, theQuery));+ resnav.append(i + 1);+ resnav.append("</a> ");}}- if (thispage >= numberofpages) pagenav.append(">"); else {- pagenav.append(navurla(thispage + 1, display, theQuery));- pagenav.append("<strong>></strong></a>");+ if (thispage >= numberofpages) resnav.append(">"); else {+ resnav.append(navurla(thispage + 1, display, theQuery));+ resnav.append("<strong>></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 servletfor (int i = 0; i < theQuery.displayResults(); i++) {