User:The wub/keyboard shortcuts.js

var kbOverlay = kbOverlay || {};

var $overlay = $('#kb-shortcuts-overlay');

kbOverlay.show = function { $overlay.show;

// Hide if clicked outside box $overlay.on('click', function (e) {       if ($(e.target).closest('#kb-shortcuts').length === 0) {            kbOverlay.hide;        }    });

// Hide on ESC $(document).keyup(function(event) {       if (event.which === 27) {            kbOverlay.hide;        }    });

$('#kb-shortcuts-close').click(function {       kbOverlay.hide;    }); };

kbOverlay.hide = function { $overlay.hide; };

$(document).keypress(function(event) {   if (event.which === 63) {        kbOverlay.show;    } });