From 45346c1be8f1cf4b1c3b57548ade476e13190592 Mon Sep 17 00:00:00 2001 From: luccioman Date: Tue, 16 May 2017 09:44:13 +0200 Subject: [PATCH] Added missing accessibility attributes on search results progress bar. --- htroot/js/yacysearch.js | 13 +++++++++---- htroot/yacysearch.html | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htroot/js/yacysearch.js b/htroot/js/yacysearch.js index 6a6abf1e4..6f91c3eb9 100644 --- a/htroot/js/yacysearch.js +++ b/htroot/js/yacysearch.js @@ -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) { diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index b5483f4c8..150e50519 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -124,7 +124,7 @@ Use the RSS search result format to add static searches to your RSS reader, if y ::
-
+
   #[offset]#-#[itemscount]# of #[totalcount]# #(globalresults)#::; (#[localResourceSize]# local, #[remoteResourceSize]# remote), #[remoteIndexCount]# from #[remotePeerCount]# remote YaCy peers.#(/globalresults)#