MediaWiki:Gadget-removeAccessKeys.js

/* ____________________________________________________________________________________ * |                                                                                    | * |                        === WARNING: GLOBAL GADGET FILE ===                         | * |                     Changes to this page affect many users. | * |   Please discuss changes on the talk page or on DDO:Gadget before editing. | * |____________________________________________________________________________________| * * Deactivating access keys, see talk page * Author: Imported to en.wikipedia by http://en.wikipedia.org/wiki/User:Xaosflux */

addOnloadHook(function{ if (skin == "vector") { var head = document.getElementById('mw-head');  if(head) removeKeys(head.getElementsByTagName('a'));  var panel = document.getElementById('mw-panel');  if(panel) removeKeys(panel.getElementsByTagName('a')); } else {  var columnOne = document.getElementById('column-one');  if (!columnOne) columnOne = document.getElementById('mw_portlets');  if (!columnOne) return;  removeKeys(columnOne.getElementsByTagName('a'));  var cactions = document.getElementById('p-cactions');  if(cactions) removeKeys(cactions.getElementsByTagName('a'));  var personal = document.getElementById('p-personal');  if(personal) removeKeys(personal.getElementsByTagName('a')); } removeKeys(document.getElementsByTagName('input')); removeKeys(document.getElementsByTagName('label')); })

function removeKeys(nodeList){ var el; for (var i = 0; i < nodeList.length; i++) { el = nodeList[i]; if (!el.accessKey) continue; if (!window.removeAccessKeys || removeAccessKeys.indexOf(el.accessKey) >= 0) { el.accessKey = ; //el.setAttribute('accessKey', ); if (el.title) el.title = el.title.replace(tooltipAccessKeyRegexp, ''); } } }