// argument_to_setTimeout.js // RJM Programming // March, 2017 // Help out argument_to_setTimeout.html with progress flagging var newlines=null; var lastwas=-1; var ourdelay=0; var cmdis=""; function andlater() { document.title=cmdis; for (var jjl=0; jjl= 0) { //for (var jjl=0; jjl= 0) { if (ourdelay == 0) { document.getElementById('ourspn' + lastwas).style.backgroundColor='orange'; } else { cmdis="document.getElementById('ourspn" + lastwas + "').style.backgroundColor='orange';"; setTimeout(andlater,ourdelay); } } } } function dogenerics() { if (document.getElementById('myta')) { var tho=document.getElementById('myta').outerHTML; var thistype=tho.substring(1).replace('>',' ').split(' ')[0]; if (thistype.toLowerCase() != 'div') { document.body.innerHTML=document.body.innerHTML.replace(tho, tho.replace('<' + thistype,'','')); } } else { document.body.innerHTML+="
"; } var newcode=('' + document.head.outerHTML + document.body.outerHTML + '').replace(//g,'>'); newlines=newcode.split(String.fromCharCode(10)), newdelim="", newcount=10; newcode=""; for (var il=0; il' + newlines[il] + '
'; newcount+=10; } while (newcode.indexOf(String.fromCharCode(10)) != -1) { newcode=newcode.replace(String.fromCharCode(10),'
'); } document.getElementById('myta').innerHTML=newcode; } function startTheBallRolling() { document.body.innerHTML=document.body.innerHTML.replace(/textarea/g,'div'); dogenerics(); setTimeout(counter.bind(null, 1), 1000); } function counter(innum) { highlightspan('var suffix="th";',100); var suffix="th"; highlightspan('if (eval(innum % 10) == 1 && innum != 11 && eval(innum % 100) != 11) {',200); if (eval(innum % 10) == 1 && innum != 11 && eval(innum % 100) != 11) { highlightspan('suffix="st"',300); suffix="st"; } else if (eval(innum % 10) == 2 && innum != 12 && eval(innum % 100) != 12) { highlightspan('suffix="nd"',400); suffix="nd"; } else if (eval(innum % 10) == 3 && innum != 13 && eval(innum % 100) != 13) { highlightspan('suffix="rd"',500); suffix="rd"; } else { highlightspan('suffix="th"',600); suffix="th"; } //highlightspan('call of setTimeout(counter.bind(null,',600); document.getElementById('mycounter').innerHTML=innum + suffix + " call of setTimeout(counter.bind(null, " + innum + "),1000)"; highlightspan('setTimeout(counter.bind(null, eval(1 + innum)), 1000);',0); setTimeout(counter.bind(null, eval(1 + innum)), 1000); }