Difference between revisions of "MediaWiki:Vector.js"

From Dwaia Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
document.onkeydown = function( e ) {
 
document.onkeydown = function( e ) {
 
if( e == null ) e = event;
 
if( e == null ) e = event;
if(e.keyCode == 122) {
+
if(e.keyCode == 69) { //e
event.preventDefault()
+
console.log('e was pressed');
console.log('F11 was pressed');
 
}
 
if( testKey( e, 122 ) ) { //F11
 
appendCSS('#column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;}');
 
return false;
 
 
}
 
}
 
}
 
}

Revision as of 15:03, 26 January 2019

document.onkeydown = function( e ) {
	if( e == null ) e = event;
	if(e.keyCode == 69) { //e
		console.log('e was pressed');
	}
}

function testKey( e, intKeyCode ) {
	if( window.createPopup )
		return e.keyCode == intKeyCode
	else
		return e.which == intKeyCode
}