Ignore:
Timestamp:
Dec 21, 2009, 1:11:31 AM (14 years ago)
Author:
broder
Message:

ajaxterm!

File:
1 edited

Legend:

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

    r2747 r2752  
    11ajaxterm={};
    2 ajaxterm.Terminal_ctor=function(id,width,height) {
     2ajaxterm.Terminal_ctor=function(id,machine_id) {
    33        var ie=0;
    44        if(window.ActiveXObject)
    55                ie=1;
    6         var sid=""+Math.round(Math.random()*1000000000);
    7         var query0="s="+sid+"&w="+width+"&h="+height;
     6        var base_path="machine/"+machine_id+"/at";
     7        var query0="";
    88        var query1=query0+"&c=1&k=";
    99        var buf="";
     
    104104                        var query=query1+send;
    105105                        if(opt_get.className=='on') {
    106                                 r.open("GET","u?"+query,true);
     106                                r.open("GET",base_path+"?"+query,true);
    107107                                if(ie) {
    108108                                        r.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
    109109                                }
    110110                        } else {
    111                                 r.open("POST","u",true);
     111                                r.open("POST",base_path,true);
    112112                        }
    113113                        r.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
     
    274274        init();
    275275}
    276 ajaxterm.Terminal=function(id,width,height) {
    277         return new this.Terminal_ctor(id,width,height);
     276ajaxterm.Terminal=function(id,machine_id) {
     277        return new this.Terminal_ctor(id,machine_id);
    278278}
    279279
Note: See TracChangeset for help on using the changeset viewer.