Changeset 2451


Ignore:
Timestamp:
Aug 21, 2009, 12:13:43 PM (15 years ago)
Author:
ecprice
Message:

Make ajaxterm only seize keypresses when focused.

Location:
package_branches/invirt-web/cherrypy/code
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy/code/static/ajaxterm/ajaxterm.js

    r2435 r2451  
    273273                        opt_paste.attachEvent("onclick", do_paste);
    274274                }
    275                 document.onkeypress=keypress;
    276                 document.onkeydown=keydown;
     275                $('term').onkeypress=keypress;
     276                $('term').onkeydown=keydown;
    277277                force=true;
    278278                timeout=window.setTimeout(update,100);
  • package_branches/invirt-web/cherrypy/code/templates/terminal.mako

    r2433 r2451  
    2222window.onload=function() {
    2323        t=ajaxterm.Terminal("term", ${machine.machine_id});
     24        $('term').focus();
    2425}
    2526</script>
    2627</%def>
    2728
    28 <div id="term"></div>
     29<div tabindex="0" id="term"></div>
    2930<div style="clear: both;"></div>
Note: See TracChangeset for help on using the changeset viewer.