svn path=/package_branches/invirt-web/ajaxterm-rebased/; revision=2760
opt_color.attachEvent("onclick", do_color);
opt_paste.attachEvent("onclick", do_paste);
}
opt_color.attachEvent("onclick", do_color);
opt_paste.attachEvent("onclick", do_paste);
}
- $('term').onkeypress=keypress;
- $('term').onkeydown=keydown;
+ // If tabIndex works, only grab keyboard events when terminal is focused
+ // Otherwise, grab from whole document (e.g. in Safari).
+ var focus_element = document;
+ if(typeof $('term').tabIndex != "undefined") {
+ focus_element = $('term');
+ focus_element.focus();
+ }
+ focus_element.onkeypress=keypress;
+ focus_element.onkeydown=keydown;
force=true;
timeout=window.setTimeout(update,100);
}
force=true;
timeout=window.setTimeout(update,100);
}
<script type="text/javascript">
window.onload=function() {
t=ajaxterm.Terminal("term", ${machine.machine_id});
<script type="text/javascript">
window.onload=function() {
t=ajaxterm.Terminal("term", ${machine.machine_id});