Changeset 14999 for trunk/FACT++
- Timestamp:
- 03/09/13 13:40:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/smartfact/index.js
r14979 r14999 213 213 var inputs = document.getElementsByTagName("input"); 214 214 215 var args = "start="+script+". dim";215 var args = "start="+script+".js"; 216 216 for (var i=0; i<inputs.length; i++) 217 217 args += "&"+inputs[i].name+"="+inputs[i].value; … … 248 248 var title = lines[0]; 249 249 var is_cmd = title[0]=='*'; 250 var script = title.split('|'); 250 251 if (is_cmd) 251 title = title.substr(1); 252 { 253 title = script.length>=1 ? script[0].substr(1) : title.substr(1); 254 script = script.length>=1 ? script[1] : name; 255 } 252 256 253 257 // ================================================================== … … 349 353 if (is_cmd) 350 354 { 351 sp1.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit( name); this.style.backgroundColor=''; };355 sp1.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(script); this.style.backgroundColor=''; }; 352 356 } 353 357 else … … 434 438 if (is_cmd) 435 439 { 436 fdiv3.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit( name); this.style.backgroundColor=''; };440 fdiv3.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(script); this.style.backgroundColor=''; }; 437 441 fdiv3.setAttribute("style", "background-position:-109px 50%;"); 438 442 } … … 676 680 } 677 681 } 678 if (check.length==0 || (check[0]!="input" && check[0]!="select")) 682 if (check.length>0 && check[0]=="checkbox") 683 { 684 var opt = check[1].split('/'); 685 686 var div = $new("div"); 687 div.innerHTML = opt[0]; 688 cell1.appendChild(div); 689 690 var input = $new("input"); 691 input.type = "checkbox"; 692 input.name = opt[1]; 693 input.onclick = function() { this.value=this.checked; }; 694 var c = opt.length>2 && opt[2]=="1"; 695 input.checked = c; 696 input.value = c; 697 698 cell2.appendChild(input); 699 } 700 if (check.length==0 || (check[0]!="input" && check[0]!="select" && check[0]!="checkbox")) 679 701 { 680 702 var div = $new("div"); … … 754 776 755 777 table.pageName = name;//setAttribute("data-file", name); 778 table.counter = counter; 756 779 757 780 // This is needed so that the page is extended in height … … 935 958 936 959 var fname = $("table"+z).pageName;//getAttribute("data-file"); 960 var counter = $("table"+z).counter;//getAttribute("data-file"); 937 961 938 962 var is_help = fname.substr(0,5)=="help-"; … … 964 988 // } 965 989 966 if ( xmlText.status!=200 && xmlText.status!=412)990 if (counter>1 && xmlText.status!=200 && xmlText.status!=412) 967 991 { 968 992 alert("ERROR[2] - HTTP request '"+fname+".data': "+xmlText.statusText+" ["+xmlText.status+"]"); … … 974 998 { 975 999 cycleCol($("ldot"+z)); 976 update_text(fname, xmlText.responseText);1000 update_text(fname, counter>1 ? xmlText.responseText : undefined); 977 1001 doresize(z); 978 1002 } … … 993 1017 return; 994 1018 1019 // ---------------------------------------------------- 1020 var now = new Date(); 1021 1022 var ltime = $("localtime"+z); 1023 setUTC(ltime, now); 1024 1025 if (!result) 1026 return; 1027 1028 var rtime = $("reporttime"+z); 995 1029 var tokens = result.split('\n'); 996 997 // ----------------------------------------------------998 999 var rtime = $("reporttime"+z);1000 var ltime = $("localtime"+z);1001 1002 var now = new Date();1003 1004 1030 var header = tokens[0].split('\t'); 1005 1031 … … 1027 1053 1028 1054 setUTC(rtime, stamp); 1029 setUTC(ltime, now);1030 1031 // ----------------------------------------------------1032 1055 1033 1056 $("warn"+z).style.display = header.length>=4 && header[3]=='1' ? "" : "none"; … … 1035 1058 if (header.length>=5) 1036 1059 $("cmd"+z).style.backgroundColor = header[4]=='1' ? "darkgreen" : "darkred"; 1060 1061 // ---------------------------------------------------- 1037 1062 1038 1063 if (header.length>=3 && $("body").sound)
Note:
See TracChangeset
for help on using the changeset viewer.