From c6fdfaf69b75d9c40ff617dd2404f325fce32a7c Mon Sep 17 00:00:00 2001 From: Eric Price Date: Fri, 21 Aug 2009 12:13:43 -0400 Subject: [PATCH] Make ajaxterm only seize keypresses when focused. svn path=/package_branches/invirt-web/ajaxterm-rebased/; revision=2758 --- code/static/ajaxterm/ajaxterm.js | 4 ++-- code/templates/terminal.mako | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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()} -
+
-- 1.7.9.5