Changeset 13877 for trunk/FACT++/www/smartfact/index.js
- Timestamp:
- 05/24/12 19:13:50 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/smartfact/index.js
r13875 r13877 404 404 hhtr.appendChild(htd2); 405 405 406 htd0.style.verticalAlign = "middle"; 407 htd1.style.verticalAlign = "middle"; 408 htd2.style.verticalAlign = "middle"; 409 htd3.style.verticalAlign = "middle"; 410 htd4.style.verticalAlign = "middle"; 411 406 412 var div1 = document.createElement("div"); 407 413 var div2 = document.createElement("div"); … … 481 487 ftd.appendChild(ftab); 482 488 489 var ftdH = document.createElement("td"); 483 490 var ftd0 = document.createElement("td"); 484 491 var ftd1 = document.createElement("td"); 485 492 var ftd2 = document.createElement("td"); 493 var ftd3 = document.createElement("td"); 494 ftdH.setAttribute("width", "1px"); 495 ftd2.setAttribute("width", "1px"); 496 ftd3.setAttribute("width", "1px"); 497 498 ftdH.style.verticalAlign = "middle"; 499 ftd0.style.verticalAlign = "middle"; 500 ftd1.style.verticalAlign = "middle"; 501 ftd2.style.verticalAlign = "middle"; 502 ftd3.style.verticalAlign = "middle"; 503 504 ftdH.setAttribute("class", "tcell1"); 486 505 ftd0.setAttribute("class", "tcell1"); 487 506 ftd1.setAttribute("class", "tcell2"); 488 507 ftd2.setAttribute("class", "tcell2"); 508 ftd3.setAttribute("class", "tcell2"); 509 510 ftab.appendChild(ftdH); 489 511 ftab.appendChild(ftd0); 490 512 ftab.appendChild(ftd1); 491 513 ftab.appendChild(ftd2); 514 ftab.appendChild(ftd3); 515 516 var fdivH = document.createElement("div"); 492 517 var fdiv0 = document.createElement("span"); 493 518 var fdiv1 = document.createElement("span"); 519 var fdiv2 = document.createElement("div"); 520 var fdiv3 = document.createElement("div"); 521 ftd0.style.paddingLeft = "5px"; 522 523 fdivH.setAttribute("class", "icon_white"); 524 fdiv2.setAttribute("class", "icon_white"); 525 fdiv3.setAttribute("class", "icon_white"); 526 fdivH.setAttribute("style", "background-position:-611px 50%;"); 527 fdiv2.setAttribute("style", "background-position:-72px 50%;"); 528 fdivH.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('help-'+name, z, +1); } 529 fdiv2.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; sendCommand('stop'); this.style.backgroundColor=''; } 530 if (is_cmd) 531 { 532 fdiv3.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(name); this.style.backgroundColor=''; } 533 fdiv3.setAttribute("style", "background-position:-109px 50%;"); 534 } 535 else 536 { 537 fdiv3.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('control', z, +1); } 538 fdiv3.setAttribute("style", "background-position:-288px 50%;"); 539 } 494 540 495 541 fdiv0.setAttribute("style", "font-size:large;"); … … 500 546 fdiv1.appendChild(document.createTextNode("loading...")); 501 547 548 ftdH.appendChild(fdivH); 502 549 ftd0.appendChild(fdiv0); 503 550 ftd1.appendChild(fdiv1); 551 ftd2.appendChild(fdiv2); 552 if (name!='control') 553 ftd3.appendChild(fdiv3); 504 554 505 555 $("body").appendChild(table); … … 910 960 } 911 961 912 function strike(e, status)913 {914 if (!e)915 return;916 917 if (!status)918 e.style.textDecoration="line-through";919 else920 e.style.textDecoration="";921 }922 923 /*924 function gray(id, str)925 {926 var e = $(id);927 if (!e)928 return;929 930 if (valid(str))931 {932 e.style.color="#000";933 e.style.textDecoration="";934 }935 else936 {937 e.style.color="#daa";938 e.style.textDecoration="line-through";939 }940 }941 */942 962 var date0 = null; 943 963 … … 954 974 // ---------------------------------------------------- 955 975 956 var 976 var rtime = $("reporttime"+z); 957 977 var ltime = $("localtime"+z); 958 978 959 var date1= new Date();979 var now = new Date(); 960 980 961 981 var header = tokens[0].split('\t'); 962 982 963 // File corrupted /should we remove the date?) 964 if (header.length!=2 && header.length!=1 && header[0].length!=13) 965 { 966 if (date0 != null) 967 strike(time, date0.getTime()+60000>date1.getTime()); 968 return; 969 } 970 971 var date2 = new Date(); 972 date2.setTime(header[0]); 973 974 $("warn"+z).style.display = header.length!=2 || header[1]=='0' ? "none" : ""; 975 976 strike(time, date2.getTime()+60000>date1.getTime()); 977 978 date0 = date2; 979 980 var utc = date0.toUTCString(); 981 982 time.innerHTML = 983 "• "+utc.substr(utc.length-12, 8)+" UTC •" 984 ltime.innerHTML = 985 "• "+date1.toLocaleString()+" •"; 983 // File corrupted / should we remove the date?) 984 if (header.length!=3 && header.length!=2 && header.length!=1 && header[0].length!=13) 985 { 986 // we ignore corrupted files for one minute 987 if (date0==null || date0.getTime()+60000<now.getTime()) 988 rtime.style.color = "darkred"; 989 990 return; 991 } 992 993 // File OK 994 date0 = now; 995 996 var stamp = new Date(); 997 stamp.setTime(header[0]); 998 999 // File older than 1min 1000 if (stamp.getTime()+60000<now.getTime()) 1001 rtime.style.color = "darkred"; 1002 else 1003 rtime.style.color = ""; 1004 1005 var str_file = stamp.toUTCString(); 1006 var str_now = now.toUTCString(); 1007 1008 var utc_file = str_file.substr(str_file.length-12, 8); 1009 var utc_now = str_now.substr(str_now.length-12, 8); 1010 1011 rtime.innerHTML = "• "+utc_file+" UTC •" 1012 ltime.innerHTML = "• "+utc_now +" UTC •"; 1013 1014 $("warn"+z).style.display = header.length<2 || header[1]=='0' ? "none" : ""; 986 1015 987 1016 // ---------------------------------------------------- … … 1312 1341 ctx.strokeStyle = "#000"; 1313 1342 1314 ctx.strokeText(min, 5+mw, 5 );1343 ctx.strokeText(min, 5+mw, 5+24); 1315 1344 ctx.strokeText(med, 5+mw, 5+12); 1316 ctx.strokeText(max, 5+mw, 5 +24);1345 ctx.strokeText(max, 5+mw, 5); 1317 1346 } 1318 1347
Note:
See TracChangeset
for help on using the changeset viewer.