Changeset 13665 for trunk/FACT++/www
- Timestamp:
- 05/12/12 00:05:34 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/index.js
r13664 r13665 242 242 } 243 243 244 function sendCommand(command, debug) 245 { 246 var uri = "index.php?"; 247 if (debug==true) 248 uri += "debug&"; 249 uri += command; 250 251 var xmlCmd = new XMLHttpRequest(); 252 xmlCmd.open('POST', uri, true); 253 xmlCmd.onload = function() 254 { 255 if (xmlCmd.status!=200) 256 { 257 alert("ERROR[1] - HTTP request: "+xmlCmd.statusText+" ["+xmlCmd.status+"]"); 258 return; 259 } 260 261 if (xmlCmd.responseText.length==0) 262 { 263 alert("No proper acknowledgment of command execution received."); 264 return; 265 } 266 267 var txt = xmlCmd.responseText.split('\n'); 268 switch (txt[0]) 269 { 270 case "1": alert("dimctrl unreachable."); break; 271 case "2": /*success*/ break; 272 default: alert("Return code '"+txt[0]+"' unknown."); break; 273 } 274 if (txt.length>1) 275 alert(xmlCmd.responseText); 276 }; 277 xmlCmd.send(null); 278 } 279 244 280 245 281 function buildPage(name, text, oldz, dz) … … 545 581 var H = window.innerHeight; 546 582 547 var x = parseInt(img.style.height, 10); 583 /* 584 if (W==0 || H==0) 585 { 586 var w = $("table"+z).offsetWidth; 587 img.style.width = w+"px"; 588 img.style.height= w+"px"; 589 590 canv.width = w; 591 canv.height = w; 592 return; 593 } 594 */ 548 595 549 596 var ih = H - h + parseInt(img.style.height, 10); … … 554 601 canv.width = W; 555 602 canv.height = ih; 603 604 // ------ debug ----- 605 if (debug == true) 606 { 607 $('debug'+z).innerHTML = ""; 608 $('debug'+z).innerHTML += "|W="+W +"/"+H; 609 $('debug'+z).innerHTML += "|H="+h+"/"+$("table"+z).offsetHeight+"/"+img.offsetHeight; 610 $('debug'+z).innerHTML += "|I="+img.style.height+"+"+H+"-"+h; 611 } 556 612 557 613 if ($("table"+z).offsetHeight == H || cnt==2)
Note:
See TracChangeset
for help on using the changeset viewer.