Permalink
Browse files

Added missing accessibility attributes on search results progress bar.

  • Loading branch information...
luccioman committed May 16, 2017
1 parent 91a06bc commit 45346c1be8f1cf4b1c3b57548ade476e13190592
Showing with 10 additions and 5 deletions.
  1. +9 −4 htroot/js/yacysearch.js
  2. +1 −1 htroot/yacysearch.html
@@ -37,6 +37,8 @@ function addHover() {
function fadeOutBar() {
document.getElementById("progressbar").setAttribute('style',"transition:transform 0s;-webkit-transition:-webkit-transform 0s;backgroundColor:transparent;");
/* Also ensure the accessibility property for progress current value is set to 100% */
document.getElementById("progressbar").setAttribute("aria-valuenow", 100);
}
/**
@@ -111,6 +113,7 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS
if (totalcountIntValue == 0) {
return;
}
var progresseBarElement = document.getElementById("progressbar");
if (offsetIntValue >= 0) document.getElementById("offset").innerHTML = offset;
if (offsetIntValue >= 0) document.getElementById("startRecord").setAttribute('value', offsetIntValue - 1);
if (itemscountIntValue >= 0) document.getElementById("itemscount").firstChild.nodeValue = itemscount;
@@ -121,14 +124,16 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS
if (document.getElementById("remotePeerCount") != null) document.getElementById("remotePeerCount").firstChild.nodeValue = remotePeerCount;
// compose page navigation
if (document.getElementById("progressbar").getAttribute('class') != "progress-bar progress-bar-success") {
if (progresseBarElement.getAttribute('class') != "progress-bar progress-bar-success") {
var percent = 100 * (itemscountIntValue - offsetIntValue + 1) / itemsperpageIntValue;
if (percent == 100) {
document.getElementById("progressbar").setAttribute('style',"transition:transform 0s;-webkit-transition:-webkit-transform 0s;");
document.getElementById("progressbar").setAttribute('class',"progress-bar progress-bar-success");
progresseBarElement.setAttribute('style',"transition:transform 0s;-webkit-transition:-webkit-transform 0s;");
progresseBarElement.setAttribute('class',"progress-bar progress-bar-success");
window.setTimeout(fadeOutBar, 500);
} else {
progresseBarElement.setAttribute('aria-valuenow', percent);
}
document.getElementById("progressbar").setAttribute('style',"width:" + percent + "%");
progresseBarElement.setAttribute('style',"width:" + percent + "%");
}
var resnavElement = document.getElementById("resNav");
if (resnavElement != null) {
@@ -124,7 +124,7 @@
::
<div id="results"></div>
<div class="progress">
<div class="progress-bar progress-bar-info" id="progressbar" role="progressbar" style="width:0%;">
<div class="progress-bar progress-bar-info" id="progressbar" role="progressbar" aria-valuemin="0" aria-valuemax="100" 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 id="feedingStatus" style="visibility: hidden;" class="glyphicon glyphicon-transfer" title="YaCy server is fetching results from available data sources."></span></span>
</div>
</div>

0 comments on commit 45346c1

Please sign in to comment.