「MediaWiki:Gadget-removeAccessKeys.js」の版間の差分

ナビゲーションに移動 検索に移動
オリジナルを参照
(MediaWiki:Gadget-removeAccessKeys.js 2008年2月25日 (月) 14:56 の版より作成)
 
(オリジナルを参照)
 
mw.loader.load('//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-removeAccessKeys.js&action=raw&ctype=text/javascript');
// **********************************************************************
// ** ***WARNING GLOBAL GADGET FILE*** **
// ** changes to this file affect many users. **
// ** please discuss on the talk page before editing **
// ** **
// **********************************************************************
// Imported from version as of: 2007-04-17T22:22:27
//Deactivating access keys, see [[Wikipedia talk:WikiProject User scripts/Scripts/removeAccessKeys|talk page]]
 
addOnloadHook(function(){
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, '');
}
}
}
 
//
752

回編集

案内メニュー