MediaWiki:Common.js
From Indpaedia
(Difference between revisions)
(Replaced content with "- →Any JavaScript here will be loaded for all users on every page load.: ") |
|||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
+ | document.onkeydown = function( e ) { | ||
+ | if( e == null ) e = event | ||
+ | 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; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function testKey( e, intKeyCode ) { | ||
+ | if( window.createPopup ) | ||
+ | return e.keyCode == intKeyCode | ||
+ | else | ||
+ | return e.which == intKeyCode |
Revision as of 06:29, 6 September 2012
/* Any JavaScript here will be loaded for all users on every page load. */ document.onkeydown = function( e ) { if( e == null ) e = event 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; } } function testKey( e, intKeyCode ) { if( window.createPopup ) return e.keyCode == intKeyCode else return e.which == intKeyCode