From: Eric Price Date: Fri, 21 Aug 2009 16:13:43 +0000 (-0400) Subject: Make ajaxterm only seize keypresses when focused. X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/c6fdfaf69b75d9c40ff617dd2404f325fce32a7c?ds=sidebyside Make ajaxterm only seize keypresses when focused. svn path=/package_branches/invirt-web/ajaxterm-rebased/; revision=2758 --- diff --git a/code/static/ajaxterm/ajaxterm.js b/code/static/ajaxterm/ajaxterm.js index 9089a96..8d44037 100644 --- a/code/static/ajaxterm/ajaxterm.js +++ b/code/static/ajaxterm/ajaxterm.js @@ -272,8 +272,8 @@ ajaxterm.Terminal_ctor=function(id,machine_id) { opt_color.attachEvent("onclick", do_color); opt_paste.attachEvent("onclick", do_paste); } - document.onkeypress=keypress; - document.onkeydown=keydown; + $('term').onkeypress=keypress; + $('term').onkeydown=keydown; force=true; timeout=window.setTimeout(update,100); } diff --git a/code/templates/terminal.mako b/code/templates/terminal.mako index 7df313d..9f1854f 100644 --- a/code/templates/terminal.mako +++ b/code/templates/terminal.mako @@ -21,9 +21,10 @@ ${parent.header_extra()} -
+