<html>
<head>
<title>Select Palette - RJM Programming - May, 2025</title>
<style>
#mysel {
width: 100%;
height: 100%;
font-color: transparent;
background-color: yellow !important;
z-index: -9;
}
textarea {
background-color: #f0f0f0;
}
</style>
<script type=text/javascript>
var linesofcontent=[];
var linesofbcss=[], stylebit='';
var xis=20, yis=10;
var woois=null, woodone=false;
var gtaval='', ista=false, xgtaval='', lastghuh='', lastnumlines=0;
var isthefirst=true;
var taar=[];
function doemail() {
var anchor=null;
if (woois) {
if (!woois.closed) {
if (woois.document.getElementById('myta').outerHTML.indexOf(' data-done="y"') == -1) {
if (woois.document.getElementById('myta').value.trim() != '') {
woois.document.getElementById('myta').setAttribute('data-done', 'y');
setTimeout(doemail, 6000);
return '';
}
} else if (woois.document.getElementById('myta').value.trim() != '') {
setTimeout(doemail, 6000);
return '';
}
woois.close();
woois=null;
setTimeout(doemail, 6000);
return '';
}
}
var emis=prompt('Please enter email address to send to.', '');
if (emis == null) { emis=''; }
if (emis.indexOf('@') != -1) {
anchor = document.createElement('a');
anchor.href = 'mailto:' + emis.trim() + '?subject=My%20Speech%20Bubble%20data&body=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#bodyih=' + encodeURIComponent(document.body.innerHTML));
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='Email';
anchor.target='_top';
anchor.click();
} else if (emis.trim() != '' && emis.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
anchor = document.createElement('a');
anchor.href = 'sms:' + emis.trim() + '&body=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#bodyih=' + encodeURIComponent(document.body.innerHTML));
anchor.style.display='none';
anchor.innerHTML='SMS';
anchor.target='_top';
anchor.click();
}
}
function dosms(){
var anchor=null;
if (woois) {
if (!woois.closed) {
if (woois.document.getElementById('myta').outerHTML.indexOf(' data-done="y"') == -1) {
if (woois.document.getElementById('myta').value.trim() != '') {
woois.document.getElementById('myta').setAttribute('data-done', 'y');
setTimeout(dosms, 6000);
return '';
}
} else if (woois.document.getElementById('myta').value.trim() != '') {
setTimeout(dosms, 6000);
return '';
}
woois.close();
woois=null;
setTimeout(dosms, 6000);
return '';
}
}
var emis=prompt('Please enter SMS number to send to.', '');
if (emis == null) { emis=''; }
if (emis.indexOf('@') != -1) {
anchor = document.createElement('a');
anchor.href = 'mailto:' + emis.trim() + '?subject=My%20Speech%20Bubble%20data&body=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#bodyih=' + encodeURIComponent(document.body.innerHTML));
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='Email';
anchor.target='_top';
anchor.click();
} else if (emis.trim() != '' && emis.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
anchor = document.createElement('a');
anchor.href = 'sms:' + emis.trim() + '&body=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#bodyih=' + encodeURIComponent(document.body.innerHTML));
anchor.style.display='none';
anchor.innerHTML='SMS';
anchor.target='_top';
anchor.click();
}
}
function dotdotdotten() {
var preta='', anotherdata='', locationhash=('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#/g,'');
document.body.title=document.title + ' ... click/tap to manage Speech Bubble(s) or Lines of Text display here';
if (window.opener) {
var wodiv=window.opener.document.getElementById('dcont').innerHTML;
if (wodiv.indexOf('<svg') != -1) {
anotherdata=' data-notfirst=y ';
locationhash='';
preta='<details id=wodt open><summary id=wosm>Speech Bubble(s) so far ...</summary>' + window.opener.document.getElementById('dcont').innerHTML + '</details><hr><br>';
}
document.body.innerHTML=preta + '<textarea placeholder="Add your next bit of content (where ~~ on a single record of data can be line feed(s))." id=myta style=width:100%;height:50%; ' + anotherdata + ' data-done="n" onblur="this.style.cursor=' + "'progress'" + '; setTimeout(function(){ document.getElementById(' + "'myta'" + ').setAttribute(' + "'data-done','y'" + '); }, 5000);">' + decodeURIComponent(('' + locationhash).replace(/^\#/g,'')).replace(/\<br\>/g, String.fromCharCode(10)) + '</textarea><br><br><button onclick="setTimeout(function(){ window.opener.doemail(); }, 2000);" id=butemail>Email 📧</button> <button onclick="setTimeout(function(){ window.opener.dosms(); }, 2000);" id=butsms>SMS 📟</button>';
document.getElementById('myta').placeholder+=' ' + String.fromCharCode(10) + 'Real textarea line feed usage can help you start creating speech bubble(s). ' + String.fromCharCode(10) + 'Lines of data that are just ~~ separate your entry of multiple speech bubbles. ' + String.fromCharCode(10) + 'Starting with a ~~ line of data starts afresh with all data.';
} else {
if (decodeURIComponent(('#' + location.hash)).indexOf('#bodyih=') != -1) {
document.body.innerHTML=decodeURIComponent(('#' + location.hash)).split('#bodyih=')[1];
}
addcontents(document.getElementById('mysel').title.replace(/\.\.\./g, '... ~~'));
document.getElementById('mysel').title=document.getElementById('mysel').title.replace(/\.\.\./g, '... ' + String.fromCharCode(10));
linesofcontent=[];
linesofbcss=[];
stylebit='';
//document.getElementById('mysel').readonly=true;
//document.getElementById('mysel').disabled=true;
}
}
function preaddcontents() {
addcontents('');
return false;
}
function bfta() {
var taval='', ita=0;
taar=[];
if (woois) {
if (!woois.closed) {
if (woois.document.getElementById('myta').outerHTML.indexOf(' data-done="y"') != -1) {
if (woois.document.getElementById('myta').outerHTML.indexOf(' data-notfirst=') != -1) {
taar=[' '];
if (('' + woois.document.getElementById('myta').value + String.fromCharCode(10)).indexOf('~~' + String.fromCharCode(10)) == 0) {
woois.document.getElementById('myta').value=woois.document.getElementById('myta').value.replace('~~','');
gtaval='';
xgtaval='';
lastghuh='';
lastnumlines=0;
isthefirst=true;
} else {
isthefirst=false;
}
} else {
isthefirst=true;
}
taval=woois.document.getElementById('myta').value;
if (taval.indexOf(String.fromCharCode(10) + '~~' + String.fromCharCode(10)) != -1) {
taar=taval.split(String.fromCharCode(10) + '~~' + String.fromCharCode(10));
for (ita=0; ita<taar.length; ita++) {
linesofcontent=[];
ista=true;
addcontents(taar[ita]);
ista=false;
isthefirst=false;
}
} else {
//alert('taval=' + taval);
linesofcontent=[];
ista=true;
addcontents(taval);
ista=false;
}
woois.close();
woois=null;
}
}
}
}
function ourprompt(theblurb, thedef) {
if (!woodone) {
woodone=true;
setInterval(bfta, 1000);
}
if (woois) {
if (!woois.closed) {
woois.close();
woois=null;
}
}
woois=window.open('./select_palette.html#' + encodeURIComponent(gtaval), '_blank', 'top=50,left=50,width=' + eval(-100 + eval('' + screen.width)) + ',height=600');
return '';
}
function addcontents(inboc) {
var nboc='', seventeen="17", zero=0, numlines=1, one=1, grest='', ghuh='', wasfound=false, jnew=0;
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
zero="-60";
}
if (inboc == '') {
nboc=ourprompt('Add your next bit of content (where ~~ can be line feed).', '');
} else {
nboc=inboc;
if (!ista) { seventeen="12"; }
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
zero="80";
} else {
zero="-60";
}
}
if (!nboc) { nboc=''; }
if (nboc != ' ') {
var newlines=nboc.split('~~');
if (eval('' + newlines.length) == 1) {
newlines=inboc.split(String.fromCharCode(10));
} else {
ista=false;
}
if (ista) {
numlines=eval('' + newlines.length);
one=numlines;
//alert(seventeen + ' ... ' + one);
if (one == 1 && eval('' + taar.length) == 0) { ista=false; }
}
gtaval='';
xgtaval='';
for (var inew=0; inew<newlines.length; inew++) {
linesofcontent.push(newlines[inew]);
if (seventeen == "17") {
if (gtaval == '' || (lastghuh != '' && lastghuh == gtaval) || (lastghuh != '' && lastghuh.replace(/\<br\>$/g, '') == gtaval)) {
if (gtaval != '' && numlines > lastnumlines && ista) {
numlines-=lastnumlines;
one=numlines;
wasfound=true;
jnew=inew;
}
gtaval=newlines[inew];
xgtaval=gtaval;
} else {
gtaval+='<br>' + newlines[inew];
xgtaval+="</text><text x='5%' y='" + eval(eval(1 + inew - jnew) * eval(90 / numlines)) + "%' xml:space='preserve'>" + newlines[inew];
}
}
}
//alert('gtaval=' + gtaval);
linesofbcss=[];
stylebit='<style> #mysel { background: ; } </style>';
xis=20;
yis=10;
for (var jnew=0; jnew<linesofcontent.length; jnew+=one) {
if (jnew == 0) {
if (ista) {
if (wasfound || (lastghuh != '' && gtaval.indexOf(lastghuh) == 0 && lastghuh != gtaval)) {
document.getElementById('dcont').innerHTML+="<br><br><br><svg xmlns='http://www.w3.org/2000/svg' width='" + eval(" + zero + " + eval('' + screen.width)) + "' height='" + eval(48 * numlines) + "' viewport='0 0 100 100' style='border-top-left-radius:35px;border-bottom-right-radius:35px;border-top-right-radius:35px;background-color:rgba(0,0,255,0.3);fill:black;font-family:Verdana;font-size:" + seventeen + "px;'><text x='5%' y='" + eval(90 / numlines) + "%' xml:space='preserve'>" + xgtaval.replace(/\<br\>/g, String.fromCharCode(10)) + "</text></svg>";
} else if (!isthefirst) {
document.getElementById('dcont').innerHTML+="<br><br><br><svg xmlns='http://www.w3.org/2000/svg' width='" + eval(" + zero + " + eval('' + screen.width)) + "' height='" + eval(48 * numlines) + "' viewport='0 0 100 100' style='border-top-left-radius:35px;border-bottom-right-radius:35px;border-top-right-radius:35px;background-color:rgba(0,0,255,0.3);fill:black;font-family:Verdana;font-size:" + seventeen + "px;'><text x='5%' y='" + eval(90 / numlines) + "%' xml:space='preserve'>" + xgtaval.replace(/\<br\>/g, String.fromCharCode(10)) + "</text></svg>";
} else {
document.getElementById('dcont').innerHTML="<svg xmlns='http://www.w3.org/2000/svg' width='" + eval(" + zero + " + eval('' + screen.width)) + "' height='" + eval(48 * numlines) + "' viewport='0 0 100 100' style='border-top-left-radius:35px;border-bottom-right-radius:35px;border-top-right-radius:35px;background-color:rgba(0,0,255,0.3);fill:black;font-family:Verdana;font-size:" + seventeen + "px;'><text x='5%' y='" + eval(90 / numlines) + "%' xml:space='preserve'>" + xgtaval.replace(/\<br\>/g, String.fromCharCode(10)) + "</text></svg>";
}
//stylebit=stylebit.replace('; ', "url(\"data:image/svg+xml;base64," + window.btoa("<svg xmlns='http://www.w3.org/2000/svg' width='" + eval(" + zero + " + eval('' + screen.width)) + "' height='" + eval(48 * numlines) + "' viewport='0 0 100 100' style='border-radius:15px;background-color:rgba(0,0,255,0.3);fill:black;font-family:Verdana;font-size:" + seventeen + "px;'><text x='5%' y='60%' xml:space='preserve'>" + gtaval + "</text></svg>") + "\") no-repeat " + xis + "px " + yis + "px ; ");
if (wasfound) {
gtaval=lastghuh + gtaval;
if ((gtaval + '~~').indexOf('<br>~~') == -1) { gtaval+='<br>'; }
numlines+=lastnumlines;
//alert(numlines + ' ... ' + gtaval);
}
lastghuh=gtaval;
lastnumlines=numlines;
} else {
stylebit=stylebit.replace('; ', "url(\"data:image/svg+xml;base64," + window.btoa("<svg xmlns='http://www.w3.org/2000/svg' width='" + eval(" + zero + " + eval('' + screen.width)) + "' height='" + eval(48 * numlines) + "' viewport='0 0 100 100' style='border-radius:15px;background-color:rgba(0,0,255,0.3);fill:black;font-family:Verdana;font-size:" + seventeen + "px;'><text x='5%' y='60%' xml:space='preserve'>" + linesofcontent[jnew] + "</text></svg>") + "\") no-repeat " + xis + "px " + yis + "px ; ");
}
} else {
stylebit=stylebit.replace('; ', ",url(\"data:image/svg+xml;base64," + window.btoa("<svg xmlns='http://www.w3.org/2000/svg' width='" + eval(" + zero + " + eval('' + screen.width)) + "' height='" + eval(48 * numlines) + "' viewport='0 0 100 100' style='border-radius:15px;background-color:rgba(0,0,255,0.3);fill:black;font-family:Verdana;font-size:" + seventeen + "px;'><text x='5%' y='60%' xml:space='preserve'>" + linesofcontent[jnew] + "</text></svg>") + "\") no-repeat " + xis + "px " + yis + "px ; ");
}
yis+=50;
}
document.getElementById('dstyle').innerHTML+=stylebit;
}
return false;
}
</script>
</head>
<body onload="dotdotdotten();">
<div id=dcont onmousedown=" event.stopPropagation(); event.preventDefault(); return addcontents(''); " ontouchdown=" event.stopPropagation(); event.preventDefault(); return addcontents(''); ">
<select title='Select Palette - RJM Programming - May, 2025 ... ... Click to fill with your speech bubble feeling prose or poetry (eg. haiku).' id=mysel multiple></select>
</div>
<div id=dstyle></div>
</code>