// reporttool.js // External Report tool // RJM Programming // October, 2016 var newwo=null; var ielem=0; var cols=128; var elemarr=[]; var elemarrih=[]; var elemarroh=[]; var elemarrih2=[]; var elemarroh2=[]; var elemarrihdiff=[]; var elemarrohdiff=[]; var elemproparr=[]; var ctable=' var elemarrih=[]; var elemarroh=[]; var elemarrihdiff=[]; var elemarrohdiff=[]; function ourdecodeURIComponent(inc) { return decodeURIComponent(inc).replace(/&/g, "~amp;").replace(/&/g, "&").replace(//g, ">").replace(/~amp;/g, "&"); }
'; var parentage=[""]; var decision="0"; var firstask=true; var itop=0; var ileft=0; var snapshotcnt=0; var cc=0; var firstss=true; var ohzeroprefix='Left innerHTML
'; var leftzero=' id=thh '; var nowbw=0; var ten=10; var preof=''; var of=''; var ouronloadworking=false; var modeofuse=location.search.split('rjm_reporttoolmode=')[1] ? (location.search.split('rjm_reporttoolmode=')[1]).split('&')[0] : 0; var rjm_answers=location.search.split('rjm_answers=')[1] ? (location.search.split('rjm_answers=')[1]).split('&')[0] : ''; function ourdecodeURIComponent(inc) { return decodeURIComponent(inc).replace(/&/g, "~amp;").replace(/&/g, "&").replace(//g, ">").replace(/~amp;/g, "&"); } function ourwindowopen(wone, wtwo, wthree, thehtml) { if (eval(modeofuse) == 0) { newwo=window.open(wone, wtwo, wthree); newwo.document.write(thehtml); } else if (eval(modeofuse) == 1) { document.write(thehtml); } else if (document.getElementById('youllneverfindthisq')) { //alert(modeofuse); var prevc=document.getElementById('youllneverfindthisq').innerHTML; //document.getElementById('youllneverfindthisq').innerHTML='
' + thehtml + '

' + prevc; document.getElementById('youllneverfindthisq').innerHTML='' + thehtml + ''; //
' + prevc; location.href='#youllneverfindthisq'; } else { //document.body.innerHTML+='
' + thehtml + '
'; document.body.innerHTML+='
' + thehtml + '
'; // .substring(wthree.indexOf('width')) location.href='#youllneverfindthisq'; } return newwo; } function mto(infb) { var fbits=infb.split(''), ihbit; var ifbits=fbits.length; if (fbits.length == 1) return infb; fbits[fbits.length]=""; outfb=fbits[0]; for (var j=0; j'); if (ihbit[eval(-1 + ihbit.length)].length == 1) { if (fbits[eval(1 + j)].replace('','').length == 1) { if (j != 0) outfb+=fbits[eval(1 + j)].replace('',''); } else { outfb+=fbits[eval(1 + j)] + ''; //alert(outfb.substring(outfb.indexOf(''; //alert(outfb.substring(outfb.indexOf(' isa.length) { tl=wasa.length; stl=isa.length; } else { tl=isa.length; stl=wasa.length; } for (var i=0; i' + huh[eval(-1 + huh.length)] + '').replace('>' + huh[eval(-1 + huh.length)] + ' ','>' + huh[eval(-1 + huh.length)] + ''); //outisc+=isa[i]; } else { outisc+=pref + isa[i]; } } else if (stl == wasa.length) { //alert(outisc.substring(eval(-300 + outisc.length))); var qisc=isc.substring(stl); var qisa=qisc.split("</"); for (var j=0; j' + huh[eval(-1 + huh.length)] + '</'); } return encodeURIComponent(mto(outisc) + '' + '' + qisc + ''); } pref="</" } } return encodeURIComponent(mto(outisc)); } function newl(ofh) { var outofh=ofh; while (outofh.indexOf(String.fromCharCode(10)) != -1) { outofh=outofh.replace(String.fromCharCode(10), '
'); } return outofh; } function ih(iih,ciih) { var htag='', ltag=''; var enciih=encodeURIComponent(ciih); var cval=newl(ciih.replace(/&/g, '~amp;').replace(/&/g, '&').replace(//g, '>').replace(/~amp;/g, '&')); var wasciih=""; if (iih < elemarrih.length) wasciih=elemarrih[iih]; var cdodiff=dodiff(wasciih,cval).replace('FONT COLOR=CYAN SIZE=5', 'FONT id=fcr' + iih + ' COLOR=CYAN'); var bsuffix=""; if (iih < elemarrih.length && !firstss) { if (cdodiff.indexOf('FONT id=fcr' + iih + ' COLOR=CYAN') == -1) htag='
'; if (cdodiff.indexOf('FONT id=fcr' + iih + ' COLOR=CYAN') == -1) ltag=' location.href=\'#fcr' + iih + '\'; '; bsuffix='' + htag; } elemarrih[iih]=cval; elemarrihdiff[iih]=cdodiff; if (modeofuse != 0) elemarrih2[iih]=enciih; return ' elemarrihdiff[' + iih + ']="' + cdodiff + '"; elemarrih' + ('' + modeofuse).replace('0','').replace('1','2') + '[' + iih + ']="' + enciih + '"; ' + bsuffix + '
'; } function oh(ooh,cooh) { var htag='', ltag=''; var encooh=encodeURIComponent(cooh); var cval=newl(cooh.replace(/&/g, '~amp;').replace(/&/g, '&').replace(//g, '>').replace(/~amp;/g, '&')); var wascooh=""; if (ooh < elemarroh.length) wascooh=elemarroh[ooh]; var cdodiff=dodiff(wascooh,cval).replace('FONT COLOR=CYAN SIZE=5', 'FONT id=fcr' + ooh + ' COLOR=CYAN'); var bsuffix=""; if (ooh < elemarroh.length && !firstss) { if (cdodiff.indexOf('FONT id=fcr' + ooh + ' COLOR=CYAN') == -1) htag='
'; if (cdodiff.indexOf('FONT id=fcr' + ooh + ' COLOR=CYAN') == -1) ltag=' location.href=\'#fcr' + ooh + '\'; '; bsuffix='' + htag; } elemarroh[ooh]=cval; elemarrohdiff[ooh]=cdodiff; if (modeofuse != 0) elemarroh2[ooh]=encooh; return ' elemarrohdiff[' + ooh + ']="' + cdodiff + '"; elemarroh' + ('' + modeofuse).replace('0','').replace('1','2') + '[' + ooh + ']="' + encooh + '"; ' + bsuffix + '
'; } function tableize(inprops) { var recs=inprops.split('
'), tableret="", ccols, icols, irecs, subcols, isubcols, onerec=""; for (irecs=0; irecs=""'; subcols=ccols[1].split('"')[0].split(";"); for (isubcols=0; isubcols', subcols[isubcols] + ';"'); } tableret=tableret.replace('', onerec + '').replace('"', '"'); //alert(tableret); } } if (tableret != "") { tableret=tableret.replace(/<\/tr>/g, "
"); tableret=tableret.replace(/table/g, "div"); tableret=tableret.replace(/tbody/g, "div"); tableret=tableret.replace(/tbody/g, "div"); tableret=tableret.replace(/<\/td>/g, " "); tableret=tableret.replace(//g, "     "); tableret=tableret.replace(//g, " "); tableret=tableret.replace(//g, " "); return tableret; } return inprops; } function preouronload() { while (ouronloadworking) { setTimeout(preouronload, 1000); } ouronload(); } function ouronload() { ouronloadworking=true; var isrelevant=true,retval=document.getElementsByTagName('*'), iretval, tdcs1, tdcs2, tdcs3, tdcs4=10, one=1, lastih='', lastone=2, lastparentih=' '; var proparr, iproparr, indent='', allcols=cols, prefix=''; var cdate = new Date(); var cgmt=cdate.toGMTString(); if (nowbw == 0) { if (document.head.innerHTML.indexOf('rjm_repor' + 'ttoo' + 'lmode=') != -1 && document.URL.indexOf('rjm_repor' + 'ttoo' + 'lmode=') == -1) { var hibits=document.head.innerHTML.split('rjm_repor' + 'ttoo' + 'lmode='); if (hibits.length > 1) modeofuse=eval(hibits[1].split('"')[0].split("'")[0].split('#')[0].split('&')[0]); } if (rjm_answers.indexOf('%') != -1) rjm_answers=decodeURIComponent(rjm_answers); if (document.head.innerHTML.indexOf('rjm_an' + 'sw' + 'ers=') != -1 && document.URL.indexOf('rjm_an' + 'sw' + 'ers=') == -1) { var ahibits=document.head.innerHTML.split('rjm_an' + 'sw' + 'ers='); if (ahibits.length > 1) rjm_answers=(ahibits[1].split('"')[0].split("'")[0].split('#')[0].split('&')[0]); if (rjm_answers.indexOf('%') != -1) rjm_answers=decodeURIComponent(rjm_answers); } nowbw = eval(('' + document.body.innerWidth).replace('px','')); if (nowbw == 0) nowbw = eval(window.getComputedStyle(document.body, null).getPropertyValue('width').replace('px','')); } if (eval(modeofuse) >= 0) { snapshotcnt++; if (snapshotcnt == 2 && modeofuse != 0) modeofuse=0; ohzeroprefix = 'Left innerHTML
'; leftzero = ' id=thh '; if (eval(snapshotcnt % ten) == 0) { firstask=true; if (of != '' || preof != '') of=' ' + snapshotcnt + ' of ' + ten + ')'; } else if (preof != '') { of=' ' + snapshotcnt + ' of ' + ten + ')'; } ielem=0; elemarr=[]; //elemarrih=[]; //elemarroh=[]; elemproparr=[]; if (of == '' && preof == '' && rjm_answers != '' || document.URL.indexOf('rjm_answers=') != -1) { var subrjm_answers=rjm_answers.split(',')[0].split(';'); if (subrjm_answers.length > 1) { if (subrjm_answers[1] != '') ten=eval(subrjm_answers[1]); } if (subrjm_answers[0] != '') { decision=subrjm_answers[0]; of=' 0 of ' + ten + ')'; preof='(' + decision + ' seconds '; } } ctable=' var elemarrih=[]; var elemarroh=[]; var elemarrihdiff=[]; var elemarrohdiff=[]; function ourdecodeURIComponent(inc) { return decodeURIComponent(inc).replace(/&/g, "~amp;").replace(/&/g, "&").replace(//g, ">").replace(/~amp;/g, "&"); }
' + document.URL.split('#')[0] + ' ' + preof + 'Snapshot' + of + ' at ' + cgmt + ' ... Left innerHTML Right outerHTML
'; if (eval(snapshotcnt % ten) == 0) { firstask=true; preof=''; of=''; } else if (preof != '') { of=' ' + snapshotcnt + ' of ' + ten + ')'; } parentage=[""]; //lastih=parentage[eval(-1 + one)]; for (iretval=0; iretval',' ').split(' ')[0]); elemproparr.push(""); ielem=elemarr.length; if (lastih.indexOf('<' + elemarr[eval(-1 + ielem)]) == 0 || lastih.indexOf('<' + elemarr[eval(-1 + ielem)]) == 1) { // handles head prefix="prea" + one + " " + lastih.substring(0,30).replace(//g,' ') + elemarr[eval(-1 + ielem)]; one++; lastone=one; lastparentih=lastih.replace(retval[iretval].innerHTML, ''); lastih=retval[iretval].innerHTML; if (elemarr[eval(-1 + ielem)] == "html" || elemarr[eval(-1 + ielem)] == "body" || elemarr[eval(-1 + ielem)] == "head") lastparentih=lastih; if (elemarr[eval(-1 + ielem)] == "htXml" || elemarr[eval(-1 + ielem)] == "body" || elemarr[eval(-1 + ielem)] == "heXad") { if (1 == 11) alert("one=" + one + " " + elemarr[eval(-1 + ielem)] + " Lastih=" + lastih + " and Lastparentih=" + lastparentih); } //prefix="a" + one + " " + lastih.substring(0,30).replace(//g,' ') + elemarr[eval(-1 + ielem)]; } else if (lastih.indexOf('<' + elemarr[eval(-1 + ielem)]) != -1) { prefix="j" + lastih.substring(0,100).replace(//g,' ') + elemarr[eval(-1 + ielem)]; one++; lastone=one; lastparentih=lastih.replace(retval[iretval].innerHTML,''); lastih=retval[iretval].innerHTML; } else if (lastparentih.indexOf('<' + elemarr[eval(-1 + ielem)]) != -1) { if (1 == 1) { one=lastone; //one--; //alert(elemarr[eval(-1 + ielem)] + " Next one=" + one + " parentage.length=" + parentage.length); if (parentage.length < eval(-1 + one)) { prefix="b"; parentage.push(retval[iretval].innerHTML); lastih=retval[iretval].innerHTML; } else { prefix="c" + lastparentih.substring(0,10).replace(//g,' ') + ' lastih=' + lastih.substring(0,30).replace(//g,' ') + elemarr[eval(-1 + ielem)]; lastparentih=lastparentih.replace(retval[iretval].innerHTML,''); if (elemarr[eval(-1 + ielem)] == "htXml" || elemarr[eval(-1 + ielem)] == "body" || elemarr[eval(-1 + ielem)] == "heXad") { if (1 == 11) alert("ONE=" + one + " " + elemarr[eval(-1 + ielem)] + " LasTih=" + lastih + " and LasTparentih=" + lastparentih); if (1 == 11) alert("OnE=" + one + " " + elemarr[eval(-1 + ielem)] + " LasTih=" + lastih + " and LasTparentih=" + lastparentih); } //one--; //while (one > 1 && parentage[eval(-1 + one)].indexOf('<' + elemarr[eval(-1 + ielem)]) == -1) { // alert("next one=" + one); // one--; //} //lastih=retval[iretval].innerHTML; lastparentih=lastparentih.replace(retval[iretval].innerHTML,""); //lastparentih=lastih; } if (elemarr[eval(-1 + ielem)] == "htXml" || elemarr[eval(-1 + ielem)] == "body" || elemarr[eval(-1 + ielem)] == "heXad") { if (1 == 11) alert("one=" + one + " " + elemarr[eval(-1 + ielem)] + " LasTih=" + lastih + " and LasTparentih=" + lastparentih); } lastone=one; } } else { if (parentage.length < eval(-1 + one)) { prefix="d"; parentage.push(retval[iretval].innerHTML); if (1 == 11) alert("Parentage[" + one + "]=" + parentage[eval(-1 + one)] + " " + one + ' <' + elemarr[eval(-1 + ielem)] + ' in ' + lastih + '?'); } else if (parentage[eval(-1 + one)] == "") { // handles "html" prefix="e"; parentage[eval(-1 + one)] = retval[iretval].innerHTML; if (1 == 11) alert("parentage[" + one + "]=" + parentage[eval(-1 + one)] + " " + one + ' <' + elemarr[eval(-1 + ielem)] + ' in ' + lastih + '?'); //one++; lastone=one; lastparentih=lastih; lastih=retval[iretval].innerHTML; if (elemarr[eval(-1 + ielem)] == "htXml" || elemarr[eval(-1 + ielem)] == "body" || elemarr[eval(-1 + ielem)] == "heXad") { if (1 == 11) alert("one=" + one + " " + elemarr[eval(-1 + ielem)] + " Lastih=" + lastih + " and Lastparentih=" + lastparentih); } } else if (lastparentih.indexOf('<' + elemarr[eval(-1 + ielem)]) != -1) { prefix="g"; //one++; parentage.push(retval[iretval].innerHTML); //while (one > 1 && parentage[eval(-1 + one)].indexOf('<' + elemarr[eval(-1 + ielem)]) == -1) { // alert("next one=" + one); // one--; //} if (1 == 11) alert("ParenTage[" + one + "]=" + parentage[eval(-1 + one)] + " " + one + ' <' + elemarr[eval(-1 + ielem)] + ' in ' + lastih + '?'); } else { prefix="h" + lastih.substring(0,10) + elemarr[eval(-1 + ielem)]; //one++; parentage.push(retval[iretval].innerHTML); //alert('Is <' + elemarr[eval(-1 + ielem)] + ' [' + one + '] in ' + parentage[eval(-1 + one)] + '?'); while (one >= 1 && parentage[eval(-1 + one)].indexOf('<' + elemarr[eval(-1 + ielem)]) == -1) { if (1 == 11) alert("next one=" + one); one--; //alert('IS <' + elemarr[eval(-1 + ielem)] + ' [' + one + '] in ' + parentage[eval(-1 + one)] + '?'); } if (elemarr[eval(-1 + ielem)] == "body") one++; if (1 == 11) alert("ParenTage[" + one + "]=" + parentage[eval(-1 + one)] + " " + one + ' <' + elemarr[eval(-1 + ielem)] + ' in ' + lastih + '?'); prefix="posth" + retval[iretval].innerHTML.substring(0,10).replace(//g,' ') + elemarr[eval(-1 + ielem)]; } //one=eval(0 + lastone); lastone=one; lastih=retval[iretval].innerHTML; if (elemarr[eval(-1 + ielem)] == "htXml" || elemarr[eval(-1 + ielem)] == "body" || elemarr[eval(-1 + ielem)] == "heXad") { if (1 == 11) alert("one=" + one + " " + elemarr[eval(-1 + ielem)] + " LasTiH=" + lastih + " and LasTparentiH=" + lastparentih); } } allcols=cols; if (indent == '' && eval(one) == 1) { tdcs1=one; tdcs2=1; tdcs4=100; tdcs3=eval(allcols - tdcs1 - tdcs2 - tdcs4); ctable=ctable.replace('', '' + elemarr[eval(-1 + ielem)] + '' + '' + ih(iretval,retval[iretval].innerHTML) + '' + ohzeroprefix + oh(iretval,retval[iretval].outerHTML) + ''); ohzeroprefix = ""; leftzero = ""; } else { tdcs1=one; tdcs2=1; tdcs4=100; tdcs3=eval(allcols - tdcs1 - tdcs2 - tdcs4); ctable=ctable.replace('', '' + indent + '' + elemarr[eval(-1 + ielem)] + '' + ih(iretval,retval[iretval].innerHTML) + '' + ohzeroprefix + oh(iretval,retval[iretval].outerHTML) + ''); ohzeroprefix = ""; leftzero = ""; } proparr=(retval[iretval].outerHTML.replace(/=" /g,'="').replace(/=" /g,'="').replace(/=" /g,'="').replace('<' + elemarr[eval(-1 + ielem)],'').trim().split('/>')[0].split('>')[0] + ' ').split('" '); for (iproparr=0; iproparr', '' + '' + '' + tableize(elemproparr[eval(-1 + ielem)].replace(/" /g, '"
')) + '' + ''); } //else { //tdcs1++; //tdcs2=1; //tdcs3=eval(allcols - tdcs1 - tdcs2); //ctable=ctable.replace('', '' + '' + '' + elemproparr[eval(-1 + ielem)].replace(/" /g, '"
') + '' + '' + '' + ''); //} //alert(elemarr[eval(-1 + ielem)] + ' ... ' + elemproparr[eval(-1 + ielem)]); } } if (newwo != null && eval(decision) < 0) { newwo.close(); newwo=null; } newwo=ourwindowopen("","_blank","top=" + itop + ",left=" + ileft + ",width=" + nowbw + "px,height=600",ctable); ileft+=0; itop=eval(eval(50 + itop) % 530); //newwo.document.write(ctable); if (firstask) { setTimeout(askd, 5000); } else { if (eval(decision) != 0) { setTimeout(preouronload, Math.abs(eval(decision) * 1000.0)); } } firstss=false; } ouronloadworking=false; } function askd() { firstask=false; snapshotcnt=0; if (rjm_answers != '' || document.URL.indexOf('rjm_answers=') != -1) { var subrjm_answers=rjm_answers.split(','); decision=subrjm_answers[0]; if (subrjm_answers.length == 1) { rjm_answers=''; } else { rjm_answers=rjm_answers.replace(decision + ',',''); } //alert('decision=' + decision + ' and rjm_answers=' + rjm_answers); } else { decision=prompt("If you want to see this report (as another snapshot) every how ever many seconds you enter, put those seconds now, else Cancel for no more reports, else a negative number of seconds to keep overriding this one report each time. Bear in mind, on every tenth snapshot (where first base report is effectively Snapshot 0), we will ask again. You can optionally append by ; and add a number other than 10 to change this, as required.", decision); } if (decision) { var adec=('' + decision).split(';'); decision=eval(adec[0]); if (adec.length > 1) ten=eval(adec[1]); try { if (eval(decision) != 0) { preof=' (' + Math.abs(eval(decision)) + ' second '; setTimeout(preouronload, Math.abs(eval(decision) * 1000.0)); } } catch (ee) { } } else { decision="0"; } } function decimalToHexString(number) { // thanks to http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript if (number < 0) { number = 0xFFFFFFFF + number + 1; } return number.toString(16).toUpperCase(); } setTimeout(ouronload, 1000);