- Timestamp:
- 06/02/12 12:49:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/smartfact/index.js
r13990 r14031 49 49 case "max": $("body").displayMax = true; continue; 50 50 case "noslide": $("body").displayNoslide = true; continue; 51 case "sound": $("body").sound = true; continue; 51 52 } 52 53 … … 61 62 } 62 63 } 64 65 $("audio").date = new Date(); 63 66 64 67 … … 227 230 var htd3 = $new("td"); 228 231 var htd4 = $new("td"); 232 var htd5 = $new("td"); 229 233 htd0.setAttribute("class", "tcell1"); 230 234 htd1.setAttribute("class", "tcell2"); … … 234 238 htd3.setAttribute("width", "1px"); 235 239 htd4.setAttribute("width", "1px"); 240 htd5.setAttribute("width", "1px"); 236 241 hhtr.appendChild(htd4); 237 242 hhtr.appendChild(htd3); … … 239 244 hhtr.appendChild(htd1); 240 245 hhtr.appendChild(htd2); 246 hhtr.appendChild(htd5); 241 247 242 248 var div1 = $new("div"); … … 244 250 var div3 = $new("div"); 245 251 var div4 = $new("div"); 252 var div5 = $new("div"); 246 253 div4.id = "warn"+z; 254 div5.id = "speaker"+z; 247 255 div2.setAttribute("class", "icon_white"); 248 256 div4.setAttribute("class", "icon_color"); 257 div5.setAttribute("class", "icon_color"); 249 258 div2.setAttribute("style", "background-position:-396px 50%;"); 250 div4.setAttribute("style", "display:none;background-position:-12px -12px;"); 259 div4.setAttribute("style", "background-position:-12px -12px;display:none;"); 260 div5.setAttribute("style", "background-position:-189px -57px;"); 251 261 div2.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage(fname, z, -dz); }; 252 262 div4.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('error', z, +1); }; … … 301 311 if (dz!=0/* && z+dz!=0*/) 302 312 htd2.appendChild(div2); // back 303 htd3.appendChild(div3); // home313 htd3.appendChild(div3); // home 304 314 htd4.appendChild(div4); // Warning 315 htd5.appendChild(div5); // Warning 305 316 306 317 // ================================================================== … … 661 672 table.appendChild(tf); 662 673 674 // ================================================================== 675 /* 676 var audio = $new("AUDIO"); 677 678 audio.autoplay = true; 679 audio.date = new Date(); 680 audio.id = "audio"+z; 681 682 var ogg = $new("SOURCE"); 683 var mp3 = $new("SOURCE"); 684 audio.appendChild(ogg); 685 audio.appendChild(mp3); 686 687 $("body").appendChild(audio); 688 */ 689 663 690 $("body").appendChild(table); 664 691 … … 888 915 var date0 = null; 889 916 917 var test = 0; 890 918 function update_text(fname, result) 891 919 { … … 908 936 909 937 // File corrupted / should we remove the date?) 910 if ( header.length!=3 && header.length!=2 && header.length!=1&& header[0].length!=13)938 if ((header.length>5 || header.length==2 || header.length==0) && header[0].length!=13) 911 939 { 912 940 // we ignore corrupted files for one minute … … 934 962 // ---------------------------------------------------- 935 963 936 $("warn"+z).style.display = header.length>=2 && header[1]=='1' ? "" : "none"; 937 938 if (header.length==3) 939 $("cmd"+z).style.backgroundColor = header[2]=='1' ? "darkgreen" : "darkred"; 964 $("warn"+z).style.display = header.length>=4 && header[3]=='1' ? "" : "none"; 965 966 if (header.length>=5) 967 $("cmd"+z).style.backgroundColor = header[4]=='1' ? "darkgreen" : "darkred"; 968 969 if (header.length>=3 && $("body").sound) 970 { 971 $("speaker"+z).style.display ="none"; 972 973 var audio = $("audio"); 974 975 var audio_date = new Date(); 976 audio_date.setTime(header[1]); 977 978 // Time stamp of audio file must be newer than page load 979 // or last audio play respecitvely 980 if (audio_date>audio.date) 981 { 982 audio.date = audio_date; 983 984 var name_ogg = "audio/"+header[2]+".ogg"; 985 var name_mp3 = "audio/"+header[2]+".mp3"; 986 987 var ogg = $new("SOURCE"); 988 var mp3 = $new("SOURCE"); 989 ogg.type = "audio/ogg"; 990 mp3.type = "audio/mp3"; 991 ogg.src = name_ogg; 992 mp3.src = name_mp3; 993 994 if (audio.firstChild.src!=ogg.src) 995 { 996 audio.replaceChild(ogg, audio.firstChild); 997 audio.replaceChild(mp3, audio.lastChild); 998 } 999 } 1000 } 940 1001 941 1002 // ----------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.