Changeset 2759 for package_branches
- Timestamp:
- Dec 21, 2009, 1:11:57 AM (15 years ago)
- Location:
- package_branches/invirt-web/ajaxterm-rebased/code
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/ajaxterm-rebased/code/main.py
r2757 r2759 412 412 413 413 @cherrypy.expose 414 @cherrypy.tools.require_POST() 414 415 @cherrypy.tools.gzip() 415 416 def at(self, machine_id, k=None, c=0, force=0): -
package_branches/invirt-web/ajaxterm-rebased/code/static/ajaxterm/ajaxterm.js
r2758 r2759 18 18 var dstat=document.createElement('pre'); 19 19 var sled=document.createElement('span'); 20 var opt_get=document.createElement('a');21 20 var opt_color=document.createElement('a'); 22 21 var opt_paste=document.createElement('a'); … … 36 35 dstat.appendChild(opt); 37 36 dstat.appendChild(document.createTextNode(' ')); 38 }39 function do_get(event) {40 opt_get.className=(opt_get.className=='off')?'on':'off';41 debug('GET '+opt_get.className);42 37 } 43 38 function do_color(event) { … … 108 103 force=false; 109 104 } 110 if(opt_get.className=='on') { 111 r.open("GET",base_path+"?"+query,true); 112 if(ie) { 113 r.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); 114 } 115 } else { 116 r.open("POST",base_path,true); 117 } 105 r.open("POST",base_path,true); 118 106 r.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 119 107 r.onreadystatechange = function () { … … 146 134 } 147 135 error_timeout=window.setTimeout(error,5000); 148 if(opt_get.className=='on') { 149 r.send(null); 150 } else { 151 r.send(query); 152 } 136 r.send(query); 153 137 } 154 138 } … … 258 242 opt_add(opt_color,'Colors'); 259 243 opt_color.className='on'; 260 opt_add(opt_get,'GET');261 244 opt_add(opt_paste,'Paste'); 262 245 dstat.appendChild(sdebug); … … 265 248 div.appendChild(dterm); 266 249 if(opt_color.addEventListener) { 267 opt_get.addEventListener('click',do_get,true);268 250 opt_color.addEventListener('click',do_color,true); 269 251 opt_paste.addEventListener('click',do_paste,true); 270 252 } else { 271 opt_get.attachEvent("onclick", do_get);272 253 opt_color.attachEvent("onclick", do_color); 273 254 opt_paste.attachEvent("onclick", do_paste);
Note: See TracChangeset
for help on using the changeset viewer.