<html>
<head>
<title>Value Starts With Tutti Frutti - RJM Programming - December, 2023</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>

textarea {
background-color: yellow;
text-shadow: -1px 1px 1px #952dff;
}

textarea[title^='a'] {
background-color: lightgreen;
}

textarea[title^='ab'] {
background-color: lightblue;
}


</style>
<script type=text/javascript>
var colbit='01234567890abcdef', titledocument='';
var bigsuffix='', smallsuffix='', lastsuffix='', numc=0, totalc=0, lastchar=-1;
var progcall=false, acknowledge='';
var isreliable=true, lastkeymodifier='', found=false;
var cont=location.search.split('content=')[1] ? decodeURIComponent(location.search.split('content=')[1].split('&')[0]).replace(/\+\+\+/g,'@!@').replace(/\+/g,' ').replace(/\@\!\@/g, ' + ') : "";
var bcoldef=location.search.split('coldef=')[1] ? decodeURIComponent(location.search.split('coldef=')[1].split('&')[0]) : "yellow";
var bcolsuf='';
var bcolinput=" value=''></input>";
var bcolstyle='';
if (bcoldef != 'yellow') {
bcolsuf='&coldef=' + encodeURIComponent(bcoldef);
bcolstyle=' style="background-color:' + bcoldef + ';" ';
bcolinput=" value='" + bcoldef + "' name=coldef></input>";
}

function reliableagain() {
isreliable=true;
}

function tuttifrutti(evt) {
if (evt.altKey) {
lastkeymodifier='a';
return true;
} else if (evt.ctrlKey) {
lastkeymodifier='c';
return true;
} else if (evt.shiftKey) {
lastkeymodifier='s';
return true;
}
if (evt.type.indexOf('own') != -1 && !isreliable) { return true; }
var sw='';
var char = evt.which || evt.keyCode;
//document.getElementById('myh3').innerHTML='' + char + ' ' + evt.type;
//var chrCode = char - 48 * Math.floor(char / 48); // thanks to https://stackoverflow.com/questions/1772179/get-character-value-from-keycode-in-javascript-then-trim
//var chr = String.fromCharCode((96 <= char) ? chrCode: char);
//char=chr;
if (lastkeymodifier != 's' && String.fromCharCode(char) >= 'A' && String.fromCharCode(char) <= 'Z') {
char+=('a'.charCodeAt(0) - 'A'.charCodeAt(0));
}
if (evt.type.indexOf('own') != -1 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
bigsuffix+=String.fromCharCode(char).replace(/\'/g,'').replace(String.fromCharCode(10),'');
//if (smallsuffix != '' && document.getElementById('myta').value.indexOf(smallsuffix.replace(/\<br\>/g, String.fromCharCode(10))) == 0) { smallsuffix=''; }
if (char != lastchar) {
smallsuffix+=String.fromCharCode(char).replace(String.fromCharCode(10),'<br>');
lastchar=char;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (acknowledge == '' || acknowledge == 'h') {
document.getElementById('iaway').style.opacity='1.0';
}
if (!found) {
if ("virtualKeyboard" in navigator) {
found=true;
navigator.virtualKeyboard.overlaysContent = true;

navigator.virtualKeyboard.addEventListener("geometrychange", (event) => {
alert(987);
});
}
}
}
}
documenttitleplus('4 ');
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
sw=document.getElementById('myta').value + bigsuffix;
} else {
sw=document.getElementById('myta').value + String.fromCharCode(char).replace(/\'/g,'');
}
while (sw.indexOf(String.fromCharCode(10)) != -1) {
sw=sw.replace(String.fromCharCode(10),'');
}
var colis='';
for (var icol=0; icol<6; icol++) {
colis+='' + colbit.substring(Math.max(3,Math.floor(Math.random() * colbit.length))).substring(0,1);
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var huhr=document.getElementById('myta').getBoundingClientRect();
document.getElementById('dwords').style.position='absolute';
document.getElementById('dwords').style.top='' + eval(huhr.top + document.body.scrollTop) + 'px';
document.getElementById('dwords').style.left='' + eval(huhr.left + document.body.scrollLeft) + 'px';
document.getElementById('dwords').style.width='' + huhr.width + 'px';
document.getElementById('dwords').style.height='' + huhr.height + 'px';
//document.getElementById('dwords').innerHTML=document.getElementById('myta').value + smallsuffix;
if (evt.type.indexOf('own') != -1) {
document.getElementById('dstyle').innerHTML+="<style> #dwords { background-color: #" + colis + "; } </style>";
bcolsuf='&coldef=' + encodeURIComponent('#' + colis);
if (document.getElementById('bcol')) {
document.getElementById('bcol').name='coldef';
document.getElementById('bcol').value='#' + colis;
}
}
} else {
document.getElementById('dstyle').innerHTML+="<style> textarea[title^='" + sw + "'] { background-color: #" + colis + "; } </style>";
bcolsuf='&coldef=' + encodeURIComponent('#' + colis);
if (document.getElementById('bcol')) {
document.getElementById('bcol').name='coldef';
document.getElementById('bcol').value='#' + colis;
}
}
if (evt.type.indexOf('own') != -1) { if (1 == 3) { isreliable=false; } setTimeout(reliableagain, 90); }
lastkeymodifier='';
return true;
}

function oom(tao) {
totalc++;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var sr=eval(totalc - eval('' + document.getElementById('myta').value.legth));
if (sr <= 0) { smallsuffix=''; } else { smallsuffix=smallsuffix.replace(/\<br\>/g,String.fromCharCode(10)).slice(-sr).replace(String.fromCharCode(10), '<br>'); }
if (1 == 2) { document.getElementById('dwords').innerHTML=document.getElementById('myta').value + smallsuffix; }
}
return true;
}

function ourencodeURIComponent(oure) {
var youre=oure;
while (youre.indexOf(String.fromCharCode(10)) != -1) {
youre=youre.replace(String.fromCharCode(10), '<br>');
}
return encodeURIComponent(youre);
}

function nocontroversy(inv) {
return inv.replace(/\<\;/g,'').replace(/\>\;/g,'').replace(/\<br\>/g,String.fromCharCode(10));
}

function relcheck() {
var tao=document.getElementById('myta');
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
titledocument='' + screen.availHeight + ',' + screen.availWidth;
//document.title=titledocument;
if (acknowledge == '' || acknowledge == 'h') {
document.getElementById('iaway').style.opacity='1.0';
}
if (tao.value != '' && nocontroversy(tao.value) != nocontroversy(cont)) { alert(nocontroversy(tao.value) + ' vs ' + nocontroversy(cont)); location.href=document.URL.split('?')[0].split('#')[0] + '?content=' + ourencodeURIComponent(tao.value) + bcolsuf; } else { setTimeout(relcheck, 5000); }
}
}

function semiwell(tao) {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (tao.value != '' && nocontroversy(tao.value) != nocontroversy(cont)) { alert(nocontroversy(tao.value) + ' Vs ' + nocontroversy(cont)); location.href=document.URL.split('?')[0].split('#')[0] + '?content=' + ourencodeURIComponent(tao.value) + bcolsuf; }
}
return true;
}

function unwell(tao) {
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(function(){ if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { documenttitle('0 '); progcall=true; } else { document.getElementById('myta').blur(); } }, 20);
} else {
if (tao.value != '' && ('' + event.type).indexOf('press') == -1) { location.href=document.URL.split('?')[0].split('#')[0] + '?content=' + ourencodeURIComponent(tao.value) + bcolsuf; }
return oom(tao); //document.getElementById('dwords').innerHTML=document.getElementById('myta').value + smallsuffix;
}
return true;
}

function well(tao) {
//document.getElementById('iaway').focus();
document.getElementById('myta').title=document.getElementById('myta').value.replace(/\'/g,'');
bigsuffix='';
smallsuffix='';
numc=0;
totalc=eval('' + document.getElementById('myta').value.length);
while (document.getElementById('myta').title.indexOf(String.fromCharCode(10)) != -1) {
document.getElementById('myta').title=document.getElementById('myta').title.replace(String.fromCharCode(10),'');
}
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(function(){ document.getElementById('myta').focus(); }, 20);
return true;
} else if (progcall) {
progcall=false;
documenttitleplus('1 ' + event.type + ' ');
//setTimeout(function(){ if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { document.getElementById('myta').setSelectionRange(0,0); } }, 20);
return true; // false;
}
documenttitleplus('2 ' + event.type + ' ');
setTimeout(function(){ progcall=false; }, 30);
return true;
}

function documenttitle(wh) {
if (1 == 6) { document.getElementById('myh3').innerHTML=wh; }
}

function documenttitleplus(wh) {
if (1 == 9) { document.getElementById('myh3').innerHTML+=wh; }
}

function yonl() {
//alert(document.getElementById('myta').value);
document.getElementById('myta').value=document.getElementById('myta').value.replace(/\!\@\!/g, String.fromCharCode(10)).replace(/\<br\>/g, String.fromCharCode(10)).replace(/\<\;br\>\;/g, String.fromCharCode(10));
cont=document.getElementById('myta').value;
//document.getElementById('myta').setSelectionRange(document.getElementById('myta').value.length,document.getElementById('myta').value.length);
}

function onl() {
document.getElementById('myta').value=document.getElementById('myta').value.replace(/\!\@\!/g, String.fromCharCode(10)).replace(/\<br\>/g, String.fromCharCode(10)).replace(/\<\;br\>\;/g, String.fromCharCode(10));
cont=document.getElementById('myta').value;
document.getElementById('myta').setSelectionRange(document.getElementById('myta').value.length,document.getElementById('myta').value.length);
setInterval(yonl, 3000);
}

function firstcall() {
var divelem=document.getElementById('dwords');
divelem.style.padding = window.getComputedStyle(output,null).padding || document.getElementById('myta').style.padding || document.getElementById('myta').currentStyle.getCurrentProperty('padding');
divelem.style.margin = window.getComputedStyle(output,null).margin || document.getElementById('myta').style.margin || document.getElementById('myta').currentStyle.getCurrentProperty('margin');
}

//if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
// setTimeout(relcheck, 5000);
//}

if ('visualViewport' in window) { // thanks to https://stackoverflow.com/questions/47841986/detecting-the-opening-or-closing-of-a-virtual-keyboard-on-a-touchscreen-device
const VIEWPORT_VS_CLIENT_HEIGHT_RATIO = 0.75;
window.visualViewport.addEventListener('resize', function (event) {
if (
(event.target.height * event.target.scale) / window.screen.height <
VIEWPORT_VS_CLIENT_HEIGHT_RATIO
) {
acknowledge='s'; //document.title=('shown');
} else {
if (acknowledge == 's') { document.getElementById('iaway').style.opacity='1.0'; }
acknowledge='h'; //document.title=('hidden');
}
});
} //else {
//alert('oops');
//}

</script>
</head>
<body onload=firstcall();>
<h1>Value Starts With Tutti Frutti</h1>
<h3 id=myh3>RJM Programming - December, 2023</h3>


<script type=text/javascript>
var hprefix='', hsuffix='';
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
hprefix="<form id=myform action=" + document.URL.split('?')[0].split('#')[0] + " method=GET>";
hsuffix="<br><br><br><br><br>  <input type=submit data-style='position:absolute;top:-900px;left:-800px;' style='opacity:0.0;' value='Keyboard' id=iaway></input><input type=hidden id=bcol " + bcolinput + "</form>";
}
if (cont != '' && cont.indexOf("'") == -1 && cont.indexOf('<br>') == -1) {
document.write(hprefix + "<textarea" + bcolstyle + " name=content style='z-index:9;font-color:black;' spellcheck='false' title='' cols=80 rows=20 onclick='return semiwell(this);' data-onkeyup='return tuttifrutti(event);' onkeydown='return tuttifrutti(event);' onkeypress='return unwell(this);' onchange='return oom(this);' onblur='return well(this);' id=myta value='" + cont.replace(/\<br\>/g, '!@!') + "'>" + cont.replace(/\<bJUNKr\>/g, String.fromCharCode(10)) + "</textarea>" + hsuffix);
if (2 == 2) {
//alert(1);
setTimeout(onl, 1000);
//alert(11);
} else {
document.getElementById('myta').value=document.getElementById('myta').innerHTML.replace(/\!\@\!/g, String.fromCharCode(10));
document.getElementById('myta').setSelectionRange(document.getElementById('myta').value.length,document.getElementById('myta').value.length);
}
} else if (cont != '' && cont.indexOf('"') == -1 && cont.indexOf('<br>') == -1) {
document.write(hprefix + "<textarea" + bcolstyle + " name=content style='z-index:9;font-color:black;' spellcheck='false' title='' cols=80 rows=20 onclick='return semiwell(this);' data-onkeyup='return tuttifrutti(event);' onkeydown='return tuttifrutti(event);' onkeypress='return unwell(this);' onchange='return oom(this);' onblur='return well(this);' id=myta value=\"" + cont.replace(/\<br\>/g, '!@!') + "\">" + cont.replace(/\<bJUNKr\>/g, String.fromCharCode(10)) + "</textarea>" + hsuffix);
if (2 == 2) {
//alert(21);
setTimeout(onl, 1000);
} else {
document.getElementById('myta').value=document.getElementById('myta').innerHTML.replace(/\!\@\!/g, String.fromCharCode(10));
document.getElementById('myta').setSelectionRange(document.getElementById('myta').value.length,document.getElementById('myta').value.length);
}
} else if (cont != '' && cont.indexOf('<br>') == -1) {
document.write(hprefix + "<textarea" + bcolstyle + " name=content style='z-index:9;font-color:black;' spellcheck='false' title='' cols=80 rows=20 onclick='return semiwell(this);' data-onkeyup='return tuttifrutti(event);' onkeydown='return tuttifrutti(event);' onkeypress='return unwell(this);' onchange='return oom(this);' onblur='return well(this);' id=myta value=''>" + cont.replace(/\<bJUNKr\>/g, String.fromCharCode(10)) + "</textarea>" + hsuffix);
if (2 == 2) {
//alert(31);
setTimeout(onl, 1000);
} else {
document.getElementById('myta').value=document.getElementById('myta').innerHTML.replace(/\!\@\!/g, String.fromCharCode(10));
document.getElementById('myta').setSelectionRange(document.getElementById('myta').value.length,document.getElementById('myta').value.length);
}
} else if (cont != '') {
document.write(hprefix + "<textarea" + bcolstyle + " name=content style='z-index:9;font-color:black;' spellcheck='false' title='' cols=80 rows=20 onclick='return semiwell(this);' data-onkeyup='return tuttifrutti(event);' onkeydown='return tuttifrutti(event);' onkeypress='return unwell(this);' onchange='return oom(this);' onblur='return well(this);' id=myta value=\"" + cont.replace(/\<br\>/g, '!@!') + "\">" + cont.replace(/\<bJUNKr\>/g, String.fromCharCode(10)) + "</textarea>" + hsuffix);
//alert(65);
if (2 == 2) {
//alert(41);
setTimeout(yonl, 1000);
} else {
document.getElementById('myta').value=document.getElementById('myta').innerHTML.replace(/\!\@\!/g, String.fromCharCode(10));
}
} else {
document.write(hprefix + "<textarea" + bcolstyle + " name=content style='z-index:9;font-color:black;' spellcheck='false' title='' cols=80 rows=20 onclick='return semiwell(this);' data-onkeyup='return tuttifrutti(event);' onkeydown='return tuttifrutti(event);' onkeypress='return unwell(this);' onchange='return oom(this);' onblur='return well(this);' id=myta value=''></textarea>" + hsuffix);
}
//if (cont != '') {
// document.getElementById('myta').setSelectionRange(document.getElementById('myta').value.length,document.getElementById('myta').value.length);
//}
</script>

<div id=dstyle></div>
<div id=dwords style='z-index:0;opacity:0.2;'></div>
</body>
</html>