User:Enterprisey/up-one-lvl-kbd.js
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$( function() {
var breadcrumbEl = document.getElementsByClassName( "subpages" )[0];
if( breadcrumbEl ) {
mw.loader.using( [ "mediawiki.util" ], function () {
// If someone's already using the "U" access key, clear that
var hasOurAccessKey = document.querySelectorAll( "a[accesskey=u]" );
for( var i = 0; i < hasOurAccessKey.length; i++ ) {
hasOurAccessKey[i].setAttribute( "accesskey", "" );
$( hasOurAccessKey[i] ).updateTooltipAccessKeys();
}
var lastSubpage = breadcrumbEl.children[ breadcrumbEl.children.length - 1 ];
lastSubpage.accessKey = "u";
$( lastSubpage ).updateTooltipAccessKeys();
} );
}
} );