fixes to progess bar

This commit is contained in:
Michael Peter Christen 2014-03-21 14:33:42 +01:00
parent e2f2586429
commit deae992d47
2 changed files with 30 additions and 19 deletions

View File

@ -15,9 +15,14 @@ function addHover() {
} }
} }
function fadeOutBar() {
document.getElementById("progressbar").setAttribute('style',"transition:transform 0s;backgroundColor:transparent;");
}
function statistics(offset, itemscount, itemsperpage, totalcount, localResourceSize, remoteResourceSize, remoteIndexCount, remotePeerCount, navurlbase) { function statistics(offset, itemscount, itemsperpage, totalcount, localResourceSize, remoteResourceSize, remoteIndexCount, remotePeerCount, navurlbase) {
if (totalcount == 0) return; if (totalcount == 0) return;
if (offset >= 0) document.getElementById("startRecord").setAttribute('value', offset); if (offset >= 0) document.getElementById("offset").innerHTML = offset;
if (offset >= 0) document.getElementById("startRecord").setAttribute('value', offset - 1);
if (itemscount >= 0) document.getElementById("itemscount").firstChild.nodeValue = itemscount; if (itemscount >= 0) document.getElementById("itemscount").firstChild.nodeValue = itemscount;
document.getElementById("totalcount").firstChild.nodeValue = totalcount; document.getElementById("totalcount").firstChild.nodeValue = totalcount;
if (document.getElementById("localResourceSize") != null) document.getElementById("localResourceSize").firstChild.nodeValue = localResourceSize; if (document.getElementById("localResourceSize") != null) document.getElementById("localResourceSize").firstChild.nodeValue = localResourceSize;
@ -26,10 +31,14 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS
if (document.getElementById("remotePeerCount") != null) document.getElementById("remotePeerCount").firstChild.nodeValue = remotePeerCount; if (document.getElementById("remotePeerCount") != null) document.getElementById("remotePeerCount").firstChild.nodeValue = remotePeerCount;
// compose page navigation // compose page navigation
percent = 100 * (itemscount - offset + 1) / itemsperpage; var percent = 100 * (itemscount - offset + 1) / itemsperpage;
if (percent == 100) {
window.setTimeout(fadeOutBar, 500);
document.getElementById("progressbar").setAttribute('class',"progress-bar progress-bar-success");
}
document.getElementById("progressbar").setAttribute('style',"width:" + percent + "%"); document.getElementById("progressbar").setAttribute('style',"width:" + percent + "%");
resnav = "<ul class=\"pagination\">"; var resnav = "<ul class=\"pagination\">";
thispage = Math.floor(offset / itemsperpage); thispage = Math.floor(offset / itemsperpage);
if (thispage == 0) { if (thispage == 0) {
resnav += "<li class=\"disabled\"><a href=\"#\">&laquo;</a></li>"; resnav += "<li class=\"disabled\"><a href=\"#\">&laquo;</a></li>";

View File

@ -133,6 +133,24 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<input type="hidden" name="meanCount" value="#[meanCount]#" /> <input type="hidden" name="meanCount" value="#[meanCount]#" />
</form> </form>
<!-- type the number of results and navigation bar -->
#(num-results)#
::
<p>No Results.</p>
::
<p>No Results. (length of search words must be at least 2 characters)</p>
::
<div id="results"></div>
<div class="progress">
<div class="progress-bar progress-bar-info" id="progressbar" role="progressbar" style="width:0%;">
<span style="position:absolute;display:block;text-align:left;width:100%;color:black;">&nbsp;&nbsp;&nbsp;<strong id="offset">#[offset]#</strong>-<strong id="itemscount">#[itemscount]#</strong> of <strong id="totalcount">#[totalcount]#</strong> #(globalresults)#::; (<strong id="localResourceSize">#[localResourceSize]#</strong> local, <strong id="remoteResourceSize">#[remoteResourceSize]#</strong> remote), <strong id="remoteIndexCount">#[remoteIndexCount]#</strong> from <strong id="remotePeerCount">#[remotePeerCount]#</strong> remote YaCy peers.#(/globalresults)#</span>
</div>
</div>
::
<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)#
<script>$("input:text:visible:first").focus();</script> <script>$("input:text:visible:first").focus();</script>
#(urlmaskerror)#:: #(urlmaskerror)#::
<p><b>Illegal URL mask:</b> <i>#[urlmask]#</i> (not a valid regular expression), mask ignored.</p> <p><b>Illegal URL mask:</b> <i>#[urlmask]#</i> (not a valid regular expression), mask ignored.</p>
@ -159,22 +177,6 @@ document.getElementById("Enter").innerHTML = "search again";
<p><strong>The following words are stop-words and had been excluded from the search: #[stopwords]#.</strong></p> <p><strong>The following words are stop-words and had been excluded from the search: #[stopwords]#.</strong></p>
#(/excluded)# #(/excluded)#
<!-- type the number of results and navigation bar -->
#(num-results)#
::
<p>No Results.</p>
::
<p>No Results. (length of search words must be at least 2 characters)</p>
::
<div id="results"></div>
<div class="progress">
<div class="progress-bar progress-bar-info" id="progressbar" role="progressbar" style="width:0%;">
<strong id="offset">#[offset]#</strong>-<strong id="itemscount">#[itemscount]#</strong> of <strong id="totalcount">#[totalcount]#</strong> #(globalresults)#::; (<strong id="localResourceSize">#[localResourceSize]#</strong> local, <strong id="remoteResourceSize">#[remoteResourceSize]#</strong> remote), <strong id="remoteIndexCount">#[remoteIndexCount]#</strong> from <strong id="remotePeerCount">#[remotePeerCount]#</strong> remote YaCy peers.#(/globalresults)#
</div>
</div>
::
<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)#
<!-- show openstreetmap tiles if geoinfo was found --> <!-- show openstreetmap tiles if geoinfo was found -->
#(geoinfo)# #(geoinfo)#