Commit d25194a2 authored by Robert Lyon's avatar Robert Lyon Committed by Cecilia Vela Gurovic

Bug 1853905: Allow the accessibility keybard shortcuts work again

behatnotneeded

Change-Id: I3310c4d8f67e2aceb1c4d3ebb5f63d88e694f752
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent ae848634
......@@ -10,7 +10,7 @@
*/
jQuery(function($) {
$(window).on("keypress", function(e) {
$(window).on("keyup", function(e) {
var targetType = e.target.nodeName;
if (
......@@ -24,41 +24,44 @@ jQuery(function($) {
if (config.commandMode) {
switch(e.key) {
case 'a':
document.location.href = config.wwwroot + 'admin/';
case 'a': // Administration
document.location.href = config.wwwroot + 'admin/index.php';
break;
case 'h':
case 'h': // Homepage
document.location.href = config.wwwroot;
break;
case 'b':
document.location.href = config.wwwroot + 'artefact/blog/';
case 'b': // User journal
document.location.href = config.wwwroot + 'artefact/blog/index.php';
break;
case 'p':
document.location.href = config.wwwroot + 'artefact/internal/';
case 'p': // User Profile
document.location.href = config.wwwroot + 'artefact/internal/index.php';
break;
case 'f':
document.location.href = config.wwwroot + 'artefact/file/';
case 'f': // User files
document.location.href = config.wwwroot + 'artefact/file/index.php';
break;
case 'g':
case 'g': // Groups
document.location.href = config.wwwroot + 'group/index.php';
break;
case 'v':
document.location.href = config.wwwroot + 'view';
case 'v': // Pages and collections
document.location.href = config.wwwroot + 'view/index.php';
break;
case 'c':
document.location.href = config.wwwroot + 'collection';
case 's': // Pages and collections access
document.location.href = config.wwwroot + 'view/share.php';
break;
case 'l':
document.location.href = config.wwwroot + 'artefact/plans';
case 'l': // Plans
document.location.href = config.wwwroot + 'artefact/plans/index.php';
break;
case 'e': // Export
document.location.href = config.wwwroot + 'export/index.php';
break;
case '/':
$(document.usf.query).trigger("focus");
$('#usf_query').focus();
break;
}
config.commandMode = false;
}
else {
if (e.key.string == 'g') {
if (e.key == 'g') {
config.commandMode = true;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment