Permalink
Browse files

Restored search page default behavior for Tab, Page Up and Down keys

Replaced by shortcuts defined by the HTML "accesskey" attribute which
has the advantage to be advertised by screen readers when focusing the
corresponding buttons, contrary to custom JavasScript key handlers.
Now With Firefox :
 - "Alt + Shift + n" for next page
 - "Alt + Shift + p" for previous page

Following ARIA recommendation : "keyboard shortcuts enhance, not
replace, standard keyboard access." ( see
https://www.w3.org/TR/wai-aria-practices/#kbd_shortcuts_behavior_design)

Fix for mantis 711 (http://mantis.tokeek.de/view.php?id=711)
  • Loading branch information...
luccioman committed May 23, 2017
1 parent 1737af3 commit 1be4d32f99f777be7308b2fa81b8d099dcd6f4ab
Showing with 2 additions and 21 deletions.
  1. +2 −2 htroot/js/yacysearch.js
  2. +0 −19 htroot/yacysearch.html
@@ -51,7 +51,7 @@ function renderPaginationButtons(offset, itemscount, itemsperpage, totalcount, l
if (thispage == 0) {
resnav += "<li class=\"disabled\"><a title=\"Previous page\" href=\"#\">&laquo;</a></li>";
} else {
resnav += "<li><a id=\"prevpage\" title=\"Previous page\" href=\"";
resnav += "<li><a id=\"prevpage\" title=\"Previous page\" accesskey=\"p\" href=\"";
resnav += (navurlbase + "&amp;startRecord=" + ((thispage - 1) * itemsperpage));
resnav += "\">&laquo;</a></li>";
}
@@ -73,7 +73,7 @@ function renderPaginationButtons(offset, itemscount, itemsperpage, totalcount, l
if ((localQuery && thispage >= (totalPagesNb - 1)) || (!localQuery && thispage >= (numberofpages - 1))) {
resnav += "<li class=\"disabled\"><a href=\"#\" title=\"Next page\">&raquo;</a></li>";
} else {
resnav += "<li><a id=\"nextpage\" title=\"Next page\" href=\"";
resnav += "<li><a id=\"nextpage\" title=\"Next page\" accesskey=\"n\" href=\"";
resnav += (navurlbase + "&amp;startRecord=" + ((thispage + 1) * itemsperpage));
resnav += "\">&raquo;</a>";
}
@@ -11,25 +11,6 @@
<script type="text/javascript" src="js/yacysearch.js"></script>
<script type="text/javascript" src="js/highslide/highslide.js"></script>
<script type="text/javascript">hs.outlineType = 'rounded-white';</script>
<script type="text/javascript">
function handleArrowKeys(evt) {
evt = (evt) ? evt : ((window.event) ? event : null);
if (evt) {
switch (evt.keyCode) {
case 9:
case 33:
window.location.href = document.getElementById("nextpage").href;
break;
case 34:
window.location.href = document.getElementById("prevpage").href;
break;
case 40:
}
}
}
document.onkeydown = handleArrowKeys;
</script>
<script type="text/javascript" src="env/bootstrap/js/typeahead.jquery.min.js"></script>
<script type="text/javascript">
var suggestMatcher = function() {

0 comments on commit 1be4d32

Please sign in to comment.