源码是这样的<html>
<title>Total recognize</title>
<script>
var fUseBlur = 1;
var fUseSound = 0;
var baseTime = 0;
var statTime = 0;
var statErrTime = 0;
var errTime = 0;
var Status = null;
var ShowMax = null;
var shown = 0;
var dataPath = "http://www.
var statPath = "http://www.
var imagePath = "http://www.
var soundPath = "incoming.wav";
var doPlay = 1;
function start()
{
Status = document.getElementById('stat');
ShowMax = document.getElementById('showmax');
shStat = setTimeout(ShowStatus,500);
GetData();
GetStats();
}
function ShowStatus()
{
clearTimeout(shStat);
shStat = setTimeout(ShowStatus,500);
document.getElementById("status").value= "Shown: "+shown + "
Uploads waiting: " + document.getElementById('uploader').childNodes.length;
}
function GetShowMax()
{
var code = ShowMax.value.charCodeAt(0);
if(code < 48 || code > 57){
ShowMax.value = "0";
return 0;
}
code = code - 48;
if(code > 3)
code = 3;
return code;
}
function GetData()
{
if(shown >= GetShowMax())
{
Status.value = "Status : waiting for user";
clearTimeout(baseTime);
baseTime = setTimeout(GetData,4000);
return;
}
clearTimeout(baseTime);
errTime = setTimeout(ErrData,60000);
var script = document.createElement('script');
script.id = "lscr";
script.src = dataPath;
document.getElementById('loader').appendChild(script);
Status.value = "Status : loading data";
}
function GetStats()
{
clearTimeout(statTime);
statErrTime = setTimeout(ErrStat,60000);
var script = document.createElement('script');
script.id = "lstats";
script.src = statPath;
document.getElementById('loader').appendChild(script);
}
function ErrStat()
{
var div = document.getElementById('loader');
var scr = document.getElementById('lstats');
div.removeChild(scr);
clearTimeout(statErrTime);
statTime = setTimeout(GetStats,60000);
}
function SetStat(tmade,gmade,avg,msg)
{
ErrStat();
document.getElementById("stats").innerHTML = "Total score: <b>" + tmade + "</b><br>" +
"Goods score: <b>" + gmade + "</b><br>" +
"Seconds per image (average): <b>" + avg + "</b><br>" +
"<div style=\"overflow:auto;width:350px;height:350px\">" + msg + "</div><br>";
}
function AddUpload(val,img)
{
var script = document.createElement('script');
script.id = "upl_" + img;
script.src = dataPath + "?val=" +val + "&img=" + img;
document.getElementById('uploader').appendChild(script);
}
function EndUpload(remid)
{
document.getElementById('uploader').removeChild(document.getElementById("upl_"+remid));
}
function ErrData()
{
var div = document.getElementById('loader');
var scr = document.getElementById('lscr');
div.removeChild(scr);
clearTimeout(errTime);
Status.value = "Status : error loading data";
baseTime = setTimeout(GetData,3000);
}
function AddObject(img)
{
var div = document.getElementById('loader');
var scr = document.getElementById('lscr');
div.removeChild(scr);
clearTimeout(errTime);
var div = document.createElement("div");
div.innerHTML = "<img src=\""+ imagePath + img +".jpg\"></br><input type=text onBlur=\"TryRemoveObject(this,0);\"><input type=hidden value=\""+ img +"\"><input type=button onClick=\"return TryRemoveObject(this,1);\" value = Done><br><br><br>";
document.getElementById('work').appendChild(div);
Status.value = "Status : all working good";
if(!shown)
div.childNodes[2].focus();
shown++;
baseTime = setTimeout(GetData,"4000");
}
function NoObject()
{
clearTimeout(errTime);
Status.value = "Status : please wait for image";
baseTime = setTimeout(GetData,"4000");
}
function TryRemoveObject(el,childPos)
{
var result = '';
var doEnd = 0;
if(!childPos && (fUseBlur != 0) )
{
if(el.value != "")
doEnd = 1;
}
else if(childPos)
{
doEnd = 1;
result = el.parentNode.childNodes[2].value;
}
if(doEnd){
AddUpload(el.value,el.parentNode.childNodes[3].value);
if(el.parentNode.parentNode.childNodes[1] != undefined)
el.parentNode.parentNode.childNodes[1].childNodes[2].focus();
el.parentNode.parentNode.removeChild(el.parentNode);
shown--;
}
}
</script>
<body onLoad = 'start();'>
<table border=0 style="border-width:1px;border-style:solid">
<tr>
<td width = 500 valign = top ><br><div id="work" border = 1></div>
<div id="loader" style="display:none">
<div id="uploader" style="display:none"></div>
</td>
<td width = 350 valign = top>
<input type=checkbox onClick="fUseBlur = !fUseBlur;" checked>use Blur<br>
<input type=checkbox onClick="fUseSound = !fUseSound;" disabled>play sound when first image arrived<br>
<input type=text value="0" size=1 maxlength=1 id="showmax"> images shown<br>
<input type=text size=50 disabled value="Status: loading" id="stat"><br>
<input type=text id=status disabled size = 50 value=aa><br>
<a href=?do=logout>Logout</a>
</td>
</tr>
<tr>
<td></td>
<td>
<div id="stats" style="display:block">
</div>
</td>
</tr>
</table>
</body>
</html>