User:DaxServer/KeyShortcuts.js

// /* * KeyShortcuts.js * * based on wd:MediaWiki:Gadget-KeyShortcuts.js $( function {	'use strict';	const click = function(element, message = 'Error pressing key') {		if ( $( element ).length === 0 ) {			alert( message );		} else {			$( element ).find( 'a' )[0].click;		}	}	$( this )	.keydown( function ( event ) { if (			!event.ctrlKey &&			!event.altKey &&			!event.shiftKey &&			!event.metaKey &&			( $( ':focus' ).length === 0 || $( 'a:focus' ).length )		) { switch ( event.code ) { case 'KeyC': click('#t-contributions', 'Contributions link not found'); break; case 'KeyT': click('li.interlanguage-link.interwiki-te.mw-list-item', 'TE wiki not linked'); break; case 'KeyW': click('#t-wikibase', 'Wikidata not set'); break; }		}	} ); } );

//