<!doctype html>
<html>
<head>
<title>Mac OS X Quarter Hour Timer via This Supervising Crontab 0,15,30,45 * * * * /usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/screen-`date +"\%Y\%m\%d-\%H\%M"`.jpg</title>
<script type='text/javascript'>
var odiv=null;
var hprefix="http://localhost:8888/"; // is same as /Applications/MAMP/htdocs/ for local MAMP on Mac OS X
var nexttableo=null;
var nexttdo=null;
var lasthm=-1;
var wo=null;
var thatsit=false;
var fifteen="15";
var cnt=0;
var lastone='#mybod';
var nexttdoid='';
function oops(imgo) {
//alert(document.getElementById(imgo.id.replace('i','')).id);
document.getElementById(imgo.id.replace('i','')).style.display='none';
}
function andthenmove() {
location.href=lastone;
lastone='#mybod';
}
function fillinmywork() {
//alert(document.URL);
var ih, iqh;
//alert(870);
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
var hh = today.getHours();
var minm = today.getMinutes(); //January is 0!
var ss = 0; //today.getSeconds();
var thirtythousand=30000;
if (("" + ("00" + hh).slice(-2) + "" + ("00" + minm).slice(-2)) == "0000") {
thirtythousand=60000;
odiv=null;
cnt++;
}
if (odiv == null) {
if (cnt == 0) {
fifteen=(location.search + '&').split('fifteen=')[1] ? location.search.split('fifteen=')[1].split('&')[0] : fifteen;
//alert(document.URL);
hprefix=(location.search + '&').split('localplace=')[1] ? location.search.split('localplace=')[1].split('&')[0] : hprefix;
if (hprefix != "http://localhost:8888/") {
document.getElementById('myh3').innerHTML=document.getElementById('myh3').innerHTML.replace('/Applications/MAMP/htdocs/',hprefix);
} else if (document.URL.indexOf('file:/') == 0) {
hprefix=(document.URL + '/?').substring(7).replace('quarter_hour_timer.html','').replace('//?','/?').split('?')[0];
if (hprefix != "http://localhost:8888/" && hprefix != "/Applications/MAMP/htdocs/") {
//alert(hprefix);
document.getElementById('myh3').innerHTML=document.getElementById('myh3').innerHTML.replace('/Applications/MAMP/htdocs/',hprefix);
}
} //else {
//alert(document.URL);
//}
if (hprefix.indexOf(':') == -1) hprefix='file://' + hprefix;
if (hprefix.indexOf('localhost:8888') == -1) {
document.getElementById('myh1').innerHTML=document.getElementById('myh1').innerHTML.replace('Ideally suited for MAMP, and left running', 'Ideally suited to being left running');
}
}
odiv=document.getElementById('mywork' + cnt);
} //else if (nexttdo != null) {
//alert(87000 + " " + ("" + hh + "" + minm) + " " + odiv.innerHTML.indexOf('</td>') + "isnot-1? zero=" + eval(eval("" + minm), eval(fifteen)) + "? " + nexttdo.id);
//}
//alert(8700);
//alert(87000);
var itableo = "table_" + yyyy + "" + mm + "" + dd;
var thisdatebit = "Quarter Hour Activities for " + dd + "/" + mm + "/" + yyyy;
var thistimefilename = hprefix + "screen-" + yyyy + "" + ("00" + mm).slice(-2) + "" + ("00" + dd).slice(-2) + "-" + ("00" + hh).slice(-2) + "" + ("00" + minm).slice(-2) + ".jpg";
var thistimebit = "td_" + yyyy + "" + ("00" + mm).slice(-2) + "" + ("00" + dd).slice(-2) + "_" + ("00" + hh).slice(-2) + "" + ("00" + minm).slice(-2);
var vstimefilename; // = hprefix + "screen-" + yyyy + "" + mm + "" + dd + "-" + hh + "" + minm + ".jpg";
var vstimebit; // = hprefix + "screen-" + yyyy + "" + mm + "" + dd + "-" + hh + "" + minm + ".jpg";
//alert(870000 + " " + odiv.innerHTML + " " + ("" + hh + "" + minm));
if (odiv.innerHTML.indexOf('</td>') != -1 && eval(eval("" + minm) % eval(fifteen)) == 0 && nexttdo != null) {
//alert(870000 + " " + odiv.innerHTML + " " + ("" + hh + "" + minm));
//alert(nexttdo.id);
thatsit=false;
for (ih=0; ih<24; ih++) {
for (iqh=0; iqh<=eval(eval(fifteen) * 3); iqh+=eval(fifteen)) {
vstimefilename = hprefix + "screen-" + yyyy + "" + ("00" + mm).slice(-2) + "" + ("00" + dd).slice(-2) + "-" + ("00" + ih).slice(-2) + "" + ("00" + iqh).slice(-2) + ".jpg";
vstimebit = "td_" + yyyy + "" + ("00" + mm).slice(-2) + "" + ("00" + dd).slice(-2) + "_" + ("00" + ih).slice(-2) + "" + ("00" + iqh).slice(-2);
if (!thatsit) {
if (vstimebit < thistimebit) {
//alert(nexttdo.id + " ... " + vstimefilename + " < " + thistimefilename);
vstimefilename=vstimefilename;
} else if (nexttdo == null) {
//alert("nexttdo.id = null");
nexttdoid=vstimebit;
nexttdo=document.getElementById(vstimebit);
//alert(nexttdo.id + " = " + vstimefilename);
thatsit=true;
} else if (vstimebit == nexttdoid) {
//alert(nexttdo.id + " === " + vstimebit + " ... " + dd + "/" + mm + "/" + yyyy + " " + ("00" + ih).slice(-2) + ":" + ("00" + iqh).slice(-2) + "<br>" + "<img id='i" + vstimebit + "' onerror='oops(this);' onclick='if (wo != null) { wo.close(); wo=null; } wo=window.open(\"" + vstimefilename + "\",\"" + dd + "/" + mm + "/" + yyyy + " " + ("00" + ih).slice(-2) + ":" + ("00" + iqh).slice(-2) + "\",\"top=50,left=50,width=600,height=600\");' style='width:150px;' src='" + vstimefilename + "'></img><br><textarea style='background-color:#f0f0f0;' rows=5 cols=20></textarea>");
lastone='#' + vstimebit;
nexttdo=document.getElementById(vstimebit);
nexttdo.innerHTML="" + dd + "/" + mm + "/" + yyyy + " " + ("00" + ih).slice(-2) + ":" + ("00" + iqh).slice(-2) + "<br>" + "<img id='i" + vstimebit + "' onerror='oops(this);' onclick='if (wo != null) { wo.close(); wo=null; } wo=window.open(\"" + vstimefilename + "\",\"" + dd + "/" + mm + "/" + yyyy + " " + ("00" + ih).slice(-2) + ":" + ("00" + iqh).slice(-2) + "\",\"top=50,left=50,width=600,height=600\");' style='width:150px;' src='" + vstimefilename + "'></img><br><textarea style='background-color:#f0f0f0;' rows=5 cols=20></textarea>";
thirtythousand=60000;
setTimeout(andthenmove, 15000);
//alert(nexttdo.id + " =+= " + vstimebit);
nexttdo=null;
}
}
}
}
} else if (odiv.innerHTML == "" || ("" + ("00" + hh).slice(-2) + "" + ("00" + minm).slice(-2)) == "0000") {
odiv.innerHTML += "<div id='mywork" + eval(cnt + 1) + "' style='text-align:center; width:100%;'></div><br><h2 style='text-align:center; width:100%;'>" + thisdatebit + "</h2><table id='" + itableo + "' style='background-color:pink;text-align:center; width:100%;'><tr><tbody><th colspan=8>" + thisdatebit + "</th></tr></tbody></table>";
nexttableo=document.getElementById(itableo);
nexttdo=null;
for (ih=0; ih<24; ih++) {
if (eval(ih % 2) == 0) nexttableo.innerHTML=nexttableo.innerHTML.replace("</tbody>", "<tr></tr></tbody>");
for (iqh=0; iqh<=45; iqh+=15) {
vstimefilename = hprefix + "screen-" + yyyy + "" + ("00" + mm).slice(-2) + "" + ("00" + dd).slice(-2) + "-" + ("00" + ih).slice(-2) + "" + ("00" + iqh).slice(-2) + ".jpg";
vstimebit = "td_" + yyyy + "" + ("00" + mm).slice(-2) + "" + ("00" + dd).slice(-2) + "_" + ("00" + ih).slice(-2) + "" + ("00" + iqh).slice(-2);
if (vstimebit < thistimebit) {
nexttableo.innerHTML=nexttableo.innerHTML.replace("</tr></tbody>", "<td id='" + vstimebit + "'>" + dd + "/" + mm + "/" + yyyy + " " + ("00" + ih).slice(-2) + ":" + ("00" + iqh).slice(-2) + "<br>" + "<img id='i" + vstimebit + "' onerror='oops(this);' onclick='if (wo != null) { wo.close(); wo=null; } wo=window.open(\"" + vstimefilename + "\",\"" + dd + "/" + mm + "/" + yyyy + " " + ("00" + ih).slice(-2) + ":" + ("00" + iqh).slice(-2) + "\",\"top=50,left=50,width=600,height=600\");' style='width:150px;' src='" + vstimefilename + "'></img><br><textarea style='background-color:#f0f0f0;' rows=5 cols=20></textarea></td></tr></tbody>");
lastone='#' + vstimebit;
} else if (vstimebit == thistimebit) {
lastone='#' + vstimebit;
nexttableo.innerHTML=nexttableo.innerHTML.replace("</tr></tbody>", "<td id='" + vstimebit + "'>" + dd + "/" + mm + "/" + yyyy + " " + ("00" + ih).slice(-2) + ":" + ("00" + iqh).slice(-2) + "<br>" + "<img id='i" + vstimebit + "' onerror='oops(this);' onclick='if (wo != null) { wo.close(); wo=null; } wo=window.open(\"" + vstimefilename + "\",\"" + dd + "/" + mm + "/" + yyyy + " " + ("00" + ih).slice(-2) + ":" + ("00" + iqh).slice(-2) + "\",\"top=50,left=50,width=600,height=600\");' style='width:150px;' src='" + vstimefilename + "'></img><br><textarea style='background-color:#f0f0f0;' rows=5 cols=20></textarea></td></tr></tbody>");
} else if (nexttdo == null) {
nexttableo.innerHTML=nexttableo.innerHTML.replace("</tr></tbody>", "<td id='" + vstimebit + "'></td></tr></tbody>");
nexttdoid=vstimebit;
nexttdo=document.getElementById(vstimebit);
//alert(nexttdo.id + ' has innerHTML=' + nexttdo.innerHTML);
} else {
nexttableo.innerHTML=nexttableo.innerHTML.replace("</tr></tbody>", "<td id='" + vstimebit + "'></td></tr></tbody>");
}
}
}
setTimeout(andthenmove, 15000);
} //else {
//document.title=nexttdoid;
//}
setTimeout(fillinmywork, thirtythousand);
}
</script>
</head>
<body id='mybod' onload=" fillinmywork(); " style='background-color:yellow;'>
<h1 id='myh1' style='text-align:center; width:100%;'>Mac OS X Quarter Hour Timer via This Supervising Crontab (Ideally suited for MAMP, and left running) - RJM Programming - June, 2016</h1>
<h3 id='myh3' style='text-align:center; width:100%;'>0,15,30,45 * * * * /usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/screen-`date +"\%Y\%m\%d-\%H\%M"`.jpg</h3>
<h4 style='text-align:center; width:100%;'>Optionally fill in your Name: <input type='text' id='yourname' value=''></input></h4>
<div id='mywork0' style='text-align:center; width:100%;'></div>
</body>
</html>