User:Diberri/monobook.js: Difference between revisions

Jump to navigation Jump to search
deactivate access keys so I can have emacs bindings back
 
edit top
 
Line 20: Line 20:
   }
   }
}
}
document.write('<script type="text/javascript" src="'
+ 'http://wikidoc.org/index.php?title=User:Diberri/top_edit.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

Latest revision as of 19:01, 8 July 2009

//Deactivating access keys

addOnloadHook(function(){
 var columnOne = document.getElementById('column-one');
 if (!columnOne) return;
 removeKeys(columnOne.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, '');
    }
  }
}

document.write('<script type="text/javascript" src="'
+ 'http://wikidoc.org/index.php?title=User:Diberri/top_edit.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');