MyWiki:WikiProject User scripts/Scripts/removeAccessKeys

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by imported>Krinkle at 02:43, 26 August 2016 (restore filter). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

//Deactivating access keys, see talk page

$(function(){
 var $nodeList;
 if (mw.config.get('skin') === 'vector') {
  $nodeList = $('#mw-head a, #mw-panel a');
 } else {
  $nodeList = $('#column-one a, #mw_portlets a, #p-cactions a, #p-personal a');
 }
 $nodeList = $nodeList.add('input, label').filter(function () {
  return this.accessKey && (!window.removeAccessKeys || window.removeAccessKeys.indexOf(this.accessKey) !== -1);
 });
 mw.loader.using('jquery.accessKeyLabel').then(function(){
  $nodeList.removeAttr('accesskey').updateTooltipAccessKeys();
 });
} );
//