Khác biệt giữa các bản “MediaWiki:Gadget-removeAccessKeys.js”

(Cập nhật theo en:MediaWiki:Gadget-removeAccessKeys.js (611652439))
// **********************************************************************
// Imported from version as of: 2007-04-17T22:22:27
// Deactivating access keys, see [[w:en:Wikipedia talk:WikiProject User scripts/Scripts/removeAccessKeys|talk page]]
jQuery( document ).ready( function( $ ) {
 
if (mw.config.get('skin') == 'vector') {
jQuery( document ).ready( function( $ ) {
var head = document.getElementById('mw-head');
if (mw.config.get('skin') == 'vector') {
if (head) removeKeys(head.getElementsByTagName('a'));
var head = document.getElementById('mw-head');
var panel = document.getElementById('mw-panel');
if(head) removeKeys(head.getElementsByTagName('a'));
if (panel) removeKeys(panel.getElementsByTagName('a'));
var panel = document.getElementById('mw-panel');
} else {
if(panel) removeKeys(panel.getElementsByTagName('a'));
var cactionscolumnOne = document.getElementById('pcolumn-cactionsone');
} else {
var if (!columnOne) columnOne = document.getElementById('column-onemw_portlets');
if (!columnOne) columnOne = document.getElementById('mw_portlets')return;
if removeKeys(!columnOne.getElementsByTagName('a')) return;
var personalcactions = document.getElementById('p-personalcactions');
removeKeys(columnOne.getElementsByTagName('a'));
if (cactions) removeKeys(cactions.getElementsByTagName('a'));
var cactions = document.getElementById('p-cactions');
var personal = document.getElementById('p-personal');
if(cactions) removeKeys(cactions.getElementsByTagName('a'));
if (personal) removeKeys(personal.getElementsByTagName('a'));
var personal = document.getElementById('p-personal');
}
if(personal) removeKeys(personal.getElementsByTagName('a'));
removeKeys(columnOnedocument.getElementsByTagName('ainput'));
}
removeKeys(document.getElementsByTagName('inputlabel'));
} );
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', '');
$(el).updateTooltipAccessKeys();
}
}
}
}