From a0a0a0e1318042034fe5652caa69b034200c8a90 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 11 May 2010 11:34:06 +0000 Subject: [PATCH 1/1] Changes in hotkeys system for tas support. --- js/inserts.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/js/inserts.js b/js/inserts.js index 3ed5e314..e01c806a 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -11,7 +11,8 @@ var _focus; var _hotkeys = { 'alt': false, // whether is the Alt key pressed - 'focus': -1 // currently selected indeks of document.links + 'list': false, // list of all elements with hotkey used recently + 'focus': -1 // currently selected list element }; function save_focus(e) { @@ -26,7 +27,7 @@ function save_focus(e) { function _expand(tabobj) { var ul = tabobj.parentNode.parentNode; - var alltabs=ul.getElementsByTagName("input"); + var alltabs=ul.getElementsByTagName("button"); var frm = tabobj.form; if (ul.getAttribute("rel")){ @@ -318,11 +319,11 @@ var inserts = { 'ul.ajaxtabs': function(ul) { var ulist=ul.getElementsByTagName("li"); for (var x=0; x47 && key<58) || (key>64 && key<91))) { + key = String.fromCharCode(key); var n = _hotkeys.focus; - var l = document.links; + var l = document.getElementsBySelector('[accesskey='+key+']'); var cnt = l.length; - key = String.fromCharCode(key); + _hotkeys.list = l; for (var i=0; i=0) { - var link = document.links[_hotkeys.focus]; + var link = _hotkeys.list[_hotkeys.focus]; if(link.onclick) link.onclick(); else -- 2.30.2