<html>
<head>
<title>Returning to where you started - RJM Programming - February, 2021</title>
<style>
span { padding: 5 5 5 5; }
</style>
<script type='text/javascript'>
var cgcols=['lime','maroon','lightblue','purple','navy','teal','fuchsia','olive','red','lightgreen','darkorange','pink','orange'];
var zcgcols=location.search.split('alist=')[1] ? eval("['" + decodeURIComponent(location.search.split('alist=')[1].split('&')[0]).replace(/\,/g,"','") + "']") : ['lime','maroon','lightblue','purple','navy','teal','fuchsia','olive','red','lightgreen','darkorange','pink','orange'];
var bordstr='border: 5px solid yellow;';
var bigs=[];
var lastb=''; //zcgcols[0].replace(/\ /g,'-');
var lasti=0;
var nogo=false;
var documentreferrer=('' + document.referrer);
var etr=location.search.split('horizontal=')[1] ? '' : '</tr>';
var etrx=location.search.split('horizontal=')[1] ? decodeURIComponent(location.search.split('horizontal=')[1].split('&')[0]).replace(/\+/g,' ') : '';
function ourdecodeURIComponent(untriminstuff) {
var instuff=decodeURIComponent(untriminstuff).trim();
if (eval(2 + eval('' + instuff.length)) == eval('' + decodeURIComponent(untriminstuff).length)) { keeporder=true; } else { keeporder=false; }
instuff=encodeURIComponent(decodeURIComponent(untriminstuff).trim());
var arrback=[];
var dl=('' + decodeURIComponent(instuff)).replace(/\'/g,'').replace(/\"/g,'').length;
var instuffs=decodeURIComponent(instuff).replace(/\'/g,'').replace(/\"/g,'').split(',');
if (instuffs.length == 1 && eval(eval('' + dl) % 11) == 0) {
for (var iii=0; iii<eval('' + dl); iii+=11) {
arrback.push(('' + decodeURIComponent(instuff)).replace(/\'/g,'').replace(/\"/g,'').substring(iii).substring(0,11));
}
} else {
for (var ii=0; ii<instuffs.length; ii++) {
arrback.push(instuffs[ii].replace(/\'/g,'').replace(/\"/g,''));
}
}
return arrback;
}
function checkscroll(od) {
console.log('here');
var ourdiv=od.id, k, allok=false;
var rect=document.getElementById(ourdiv).getBoundingClientRect();
var sl=eval(eval(('0' + od.scrollLeft).replace('px','')) * factor);
var st=eval(eval(('0' + od.scrollTop).replace('px','')) * factor);
//alert("document.getElementById('" + ourdiv + "') scrollTop = " + st + " and bigs[0].top=" + bigs[0].top + " and bigs[0].y=" + bigs[0].y);
}
function huhhuh() {
//if (Math.abs(leftdesc[ourdiv] - sl) <= eval(leftout) && Math.abs(topdesc[ourdiv] - st) <= eval(topout)) {
if (Math.abs(rect.left) <= eval(leftout) && Math.abs(rect.top) <= eval(topout)) {
okdesc[ourdiv] = 1;
document.title=rect.left + ' ' + rect.top; // + ' ' + od.id + ' ' + od.offsetX + ' ' + ' ' + sl + ' ' + st + ' ' + rect.left;
//alert(9);
od.style.border = '5px solid yellow';
} else {
document.title=rect.left + ' ' + rect.top; // + ' ' + od.id + ' ' + od.offsetX + ' ' + sl + ' ' + st + ' ' + rect.left;
okdesc[ourdiv] = 0;
od.style.border = '0px solid yellow';
}
allok=true;
var huh=' ';
for (k=0; k<9; k++) {
huh+=okdesc[k];
if (okdesc[k] == 0) allok=false;
}
document.title+=huh;
if (allok) {
score++;
if (goes == 0) goes=1;
var more=prompt('Congratulations! That is Score: ' + score + ' from Goes: ' + goes + ' with Take Taken in Seconds: ' + seconds + '. Another go with the image URL below?', imageis);
if (more) {
if (more == '') more = imageis;
location.href = './scroll_touch.htm?image=' + encodeURIComponent(more) + '&score=' + score + '&goes=' + goes + '&seconds=' + seconds;
}
}
}
function settd(sio) {
var tdid=sio.id.replace('s','');
for (var ii=0; ii<zcgcols.length; ii++) {
if (tdid == zcgcols[ii].replace(/\ /g,'-')) {
//alert(tdid);
nogo=true;
if (lastb == '') {
lastb=zcgcols[0].replace(/\ /g,'-');
}
document.getElementById(lastb).style.border=''; //console.log("sticky: " + window.pageYOffset + " > " + sticky);
document.getElementById('s' + lastb).style.border=''; //console.log("sticky: " + window.pageYOffset + " > " + sticky);
lasti=ii;
lastb=zcgcols[lasti].replace(/\ /g,'-');
document.getElementById(lastb).style.border="5px solid yellow";
document.getElementById('s' + lastb).style.border="5px solid yellow";
location.hash='#' + lastb;
}
}
}
function newmytable(xetr) {
etr=xetr;
onl();
}
function onl() {
var ourrect;
var myt='mytable';
var myr='rhs';
var wis='width:100%;';
var ris='width:100%;';
var h1rect=document.getElementsByTagName('h1')[0].getBoundingClientRect();
var h3rect=document.getElementsByTagName('h3')[0].getBoundingClientRect();
//var etr=location.search.split('horizontal=')[1] ? '' : '</tr>';
if (('' + location.hash) != '' && ('' + documentreferrer) == '') {
if (document.URL.indexOf('?horizontal=') != -1) {
location.href=document.URL.split('#')[0] + '&rand' + Math.floor(Math.random() * 19876543) + '=' + Math.floor(Math.random() * 19876543);
} else if (document.URL.indexOf('?') != -1) {
location.href=document.URL.split('#')[0].split('?')[0] + '?rand' + Math.floor(Math.random() * 19876543) + '=' + Math.floor(Math.random() * 19876543);
} else {
location.href=document.URL.split('#')[0] + '?rand' + Math.floor(Math.random() * 19876543) + '=' + Math.floor(Math.random() * 19876543);
}
} else if (('' + location.hash) != '' && ('' + documentreferrer) != '') {
bordstr='';
}
if (etr == '') {
document.getElementsByTagName('h1')[0].style.position='fixed';
document.getElementsByTagName('h1')[0].style.top=('' + h1rect.top).replace('px','') + 'px';
document.getElementsByTagName('h1')[0].style.left=('' + h1rect.left).replace('px','') + 'px';
document.getElementsByTagName('h3')[0].style.position='fixed';
document.getElementsByTagName('h3')[0].style.top=('' + h3rect.top).replace('px','') + 'px';
document.getElementsByTagName('h3')[0].style.left=('' + h3rect.left).replace('px','') + 'px';
//alert('<table id=mytable style="width:' + Math.floor(eval(30 * eval('' + zcgcols.length))) + '%;"><tr id=mytr></tr></table>');
document.getElementById('dtable').innerHTML='<table id=mytable style="position:absolute;left:0px;top:' + eval(50 + eval(('' + h3rect.top).replace('px',''))) + 'px;' + 'width:' + Math.floor(eval(30 * eval('' + zcgcols.length))) + '%;"><tr id=mytr></tr></table>';
document.getElementById('rtable').innerHTML='<table style="position:fixed;top:600px;left:0px;height:20%;" id=rhs><tr id=myr></tr></table>';
wis='';
ris='';
//document.getElementById('mytable').innerHTML='<tr id=mytr></tr>';
myt='mytr';
myr='myr';
//document.getElementById('rhs').style.position='absolute';
//document.getElementById('rhs').style.left='0px';
//document.getElementById('rhs').style.top='400px';
}
for (var ii=0; ii<zcgcols.length; ii++) {
document.getElementById(myt).innerHTML+=etr.replace('/','') + "<td class=big onscroll='checkscroll(this);' onmousewheel='checkscroll(this);' id=" + zcgcols[ii].replace(/\ /g,'-') + " style='text-align:center;vertical-align:middle;" + wis + "height:400px;" + bordstr + "background-color:" + cgcols[eval(ii % cgcols.length)] + ";'><a onclick=\"settd(document.getElementById('s" + zcgcols[ii].replace(/\ /g,'-') + "'));\" style='background-color:white;padding: 5 5 5 5;' href='//wikipedia.org/wiki/" + zcgcols[ii].replace(/\ /g,'-') + "'>" + zcgcols[ii] + "</a></td>" + etr;
document.getElementById(myr).innerHTML+=etr.replace('/','') + "<td onclick='settd(this);' class=small id=s" + zcgcols[ii].replace(/\ /g,'-') + " style='text-align:center;" + ris + "height:40px;" + bordstr + "background-color:" + cgcols[eval(ii % cgcols.length)] + ";'><span id=r" + zcgcols[ii].replace(/\ /g,'-') + ">" + zcgcols[ii] + "</span></td>" + etr;
bordstr="";
}
if (etrx.indexOf(' ') != -1) {
var spans=document.getElementsByTagName('span');
for (var ispans=0; ispans<spans.length; ispans++) {
spans[ispans].onmouseover = function(event) { console.log('You hovered over a right hand side submenu bit of wording ... ' + event.target.innerHTML); settd(document.getElementById(event.target.id.replace('r','s'))); }
spans[ispans].ontouchend = function(event) { console.log('You lingered over a right hand side submenu bit of wording ... ' + event.target.innerHTML); settd(document.getElementById(event.target.id.replace('r','s'))); }
}
}
if (etr != '') {
document.getElementById('rhs').innerHTML+='<tr><td>' + document.getElementsByTagName('h1')[0].outerHTML + '</td></tr>';
document.getElementById('rhs').innerHTML+='<tr><td>' + document.getElementsByTagName('h3')[0].outerHTML + '</td></tr>';
}
if (('' + location.hash) != '' && ('' + documentreferrer) != '') {
lastb=('' + location.hash).replace('#','');
console.log(lastb);
for (var iw=0; iw<zcgcols.length; iw++) {
if (lastb == zcgcols[iw].replace(/\ /g,'-')) {
lasti=iw;
document.getElementById(lastb).style.border="5px solid yellow";
document.getElementById('s' + lastb).style.border="5px solid yellow";
}
}
}
var ourbigs=document.getElementsByTagName('td');
for (var iii=0; iii<ourbigs.length; iii++) {
if (('' + ourbigs[iii].className) == 'big') {
bigs.push(ourbigs[iii].getBoundingClientRect());
}
}
documentreferrer='x';
window.onscroll = function() {myFunction()};
var header = document.getElementById(zcgcols[0].replace(/\ /g,'-'));
var sticky = bigs[0].bottom;
var stickyt = bigs[0].top;
if (etr == '') {
sticky = bigs[0].right;
stickyt = bigs[0].left;
}
function myFunction() {
//bigs[0]=document.getElementById(cgcols[0]).getBoundingClientRect();
if (!nogo) {
if (etr != '' && (window.pageYOffset > bigs[lasti].bottom || window.pageYOffset < bigs[lasti].top)) {
for (var iiii=eval(0 * eval(1 + lasti)); iiii<bigs.length; iiii++) {
sticky = bigs[iiii].bottom;
stickyt = bigs[iiii].top;
if (window.pageYOffset <= sticky) {
if (lastb == '') {
lastb=zcgcols[0].replace(/\ /g,'-');
}
document.getElementById(lastb).style.border=''; //console.log("sticky: " + window.pageYOffset + " > " + sticky);
document.getElementById('s' + lastb).style.border=''; //console.log("sticky: " + window.pageYOffset + " > " + sticky);
lasti=iiii;
lastb=zcgcols[lasti].replace(/\ /g,'-');
document.getElementById(lastb).style.border="5px solid yellow";
document.getElementById('s' + lastb).style.border="5px solid yellow";
location.hash='#' + lastb;
return;
} else if (1 == 5 && window.pageYOffset >= stickyt) {
if (lastb == '') {
lastb=zcgcols[0].replace(/\ /g,'-');
}
document.getElementById(lastb).style.border=''; //console.log("sticky: " + window.pageYOffset + " > " + sticky);
document.getElementById('s' + lastb).style.border=''; //console.log("sticky: " + window.pageYOffset + " > " + sticky);
lasti=iiii;
lastb=zcgcols[lasti].replace(/\ /g,'-');
document.getElementById(lastb).style.border="5px solid yellow";
document.getElementById('s' + lastb).style.border="5px solid yellow";
location.hash='#' + lastb;
return;
} else {
console.log("not sticky: " + window.pageYOffset + " <= " + sticky);
}
}
} else if (etr == '' && (window.pageXOffset > bigs[lasti].right || window.pageXOffset < bigs[lasti].left)) {
for (var iiii=eval(0 * eval(1 + lasti)); iiii<bigs.length; iiii++) {
sticky = bigs[iiii].right;
stickyt = bigs[iiii].left;
if (window.pageXOffset <= sticky) {
if (lastb == '') {
lastb=zcgcols[0].replace(/\ /g,'-');
}
document.getElementById(lastb).style.border=''; //console.log("sticky: " + window.pageYOffset + " > " + sticky);
document.getElementById('s' + lastb).style.border=''; //console.log("sticky: " + window.pageYOffset + " > " + sticky);
lasti=iiii;
lastb=zcgcols[lasti].replace(/\ /g,'-');
document.getElementById(lastb).style.border="5px solid yellow";
document.getElementById('s' + lastb).style.border="5px solid yellow";
location.hash='#' + lastb;
return;
}
}
}
}
nogo=false;
}
}
function askcontent() {
var askfor=prompt('Please enter comma separated list of content items. An answer of "horizontal" will set up the single row table scenario. An answer of just space(s) introduce sped up hover or linger over right hand side wording event logic.', location.search.split('alist=')[1] ? (decodeURIComponent(location.search.split('alist=')[1].split('&')[0]).replace(/\,/g,"','") + "']").replace(/\[/g,'').replace(/\]/g,'') : "'lime','maroon','lightblue','purple','navy','teal','fuchsia','olive','red','lightgreen','darkorange','pink','orange'");
if (askfor == null) { askfor=''; }
if (askfor.replace(/\"/g,'').replace(/\'/g,'').toLowerCase().trim().indexOf('horizontal') == 0) {
location.href=document.URL.split('?')[0].split('#')[0] + '?horizontal=' + encodeURIComponent(askfor);
newmytable('');
} else if (askfor.trim() != '' && askfor != (location.search.split('alist=')[1] ? (decodeURIComponent(location.search.split('alist=')[1].split('&')[0]).replace(/\,/g,"','") + "']").replace(/\[/g,'').replace(/\]/g,'') : "'lime','maroon','lightblue','purple','navy','teal','fuchsia','olive','red','lightgreen','darkorange','pink','orange'")) {
//cgcols=eval("['" + decodeURIComponent(askfor).replace(/\,/g,"','") + "']");
//onl();
location.href=document.URL.split('?')[0].split('#')[0] + '?alist=' + encodeURIComponent(askfor.replace(/\'\,\'/g,',').replace(/^\'/g,'').replace(/\'$/g,''));
} else if (askfor.trim() == '' && askfor != '') {
var spans=document.getElementsByTagName('span');
for (var ispans=0; ispans<spans.length; ispans++) {
spans[ispans].onmouseover = function(event) { console.log('You hovered over a right hand side submenu bit of wording ... ' + event.target.innerHTML); settd(document.getElementById(event.target.id.replace('r','s'))); }
spans[ispans].ontouchend = function(event) { console.log('You lingered over a right hand side submenu bit of wording ... ' + event.target.innerHTML); settd(document.getElementById(event.target.id.replace('r','s'))); }
}
}
}
</script>
</head>
<body onload=onl(); onscroll='checkscroll(this);'>
<h1>Returning to where you started</h1>
<h3>RJM Programming <a onclick=askcontent(); style="text-decoration:underline;cursor:pointer;" title="Set your own comma separated list array content, or introduce speeding up hover or linger on right hand side submenu wording event logics.">-</a> February, 2021</h3>
<div id=dtable><table id=mytable style="width:80%;">
</table></div>
<div id=rtable><table style='position:fixed;top:0px;left:80%;width:20%;' id=rhs></div>
</table>
</body>
</html>