<html>
<head>
<title>Emoji-ize Text - RJM Programming - June, 2021</title>
<meta charset="UTF-8">
<style>
// Thanks to https://stackoverflow.com/questions/8117761/how-can-i-make-an-iframe-resizable
iframe {
max-width:1400px;
height:380px;
border:3px solid green;
resize: both;
overflow: auto;
}
</style>
<script type='text/javascript'>
var sy='';
var rotate=location.search.split('rotate=')[1] ? decodeURIComponent(location.search.split('rotate=')[1].split('&')[0]).replace(/\+/g,' ') : '0';
var intext=location.search.split('intext=')[1] ? decodeURIComponent(location.search.split('intext=')[1].split('&')[0]).replace(/\+/g,' ') : '';
var emailsms=location.search.split('emailsms=')[1] ? decodeURIComponent(location.search.split('emailsms=')[1].split('&')[0]).replace(/\+/g,' ') : '';
var myaltb=location.search.split('myaltb=')[1] ? decodeURIComponent(location.search.split('myaltb=')[1].split('&')[0]).replace(/\+/g,' ') : '';
var ifcont='';
var zin='9', lastzin='9';
var cnt=0;
var lastes='';
var unpopsecs=5000;
var wasih='';
function updatedevery(insv) {
unpopsecs=eval(1000 * Math.abs(eval(insv)));
}
function latback() {
document.getElementById('itarget').value='iftext';
}
function unpopdiv() {
document.body.style.cursor='pointer';
document.getElementById('mydiv').style.cursor='pointer';
document.getElementById('khtmlcontent').style.backgroundColor='rgb(244,244,244)';
document.getElementById('khtmlcontent').style.cursor='pointer';
document.getElementById('khtmlcontent').style.zIndex='-99';
document.getElementById('khtmlcontent').style.display='none';
}
function halfpopdiv() {
var bc=('' + document.getElementById('khtmlcontent').style.backgroundColor).split(',');
if (eval('' + bc.length) == 3) {
bc[2]=bc[2].replace(')','');
bc[0]=bc[0].replace('rgb(','rgba(');
bc.push('1.0)');
}
if (eval('' + bc.length) == 4) {
if (eval(bc[3].split(')')[0]) > 0.2) {
setTimeout(halfpopdiv, Math.floor(eval(unpopsecs / 10)));
//document.title='before:' + document.getElementById('khtmlcontent').style.backgroundColor;
document.getElementById('khtmlcontent').style.backgroundColor=bc[0] + ',' + bc[1] + ',' + bc[2] + ',' + eval(-0.1 + eval(bc[3].split(')')[0])) + ')';
//document.title='after:' + document.getElementById('khtmlcontent').style.backgroundColor;
}
} //else {
//alert('oops ... ' + bc.length + ' ... via ... ' + document.getElementById('khtmlcontent').style.backgroundColor + ' ... ' + + document.getElementById('khtmlcontent').style.opacity);
//}
}
function popdiv(ot) {
wasih=document.getElementById('intext').value;
if (unpopsecs != 0 && document.getElementById('khtmlcontent')) {
if (1 == 1) {
document.getElementById('itarget').value='khtmlcontent';
document.getElementById('khtmlcontent').style.zIndex='99';
document.getElementById('khtmlcontent').style.display='block';
document.body.style.cursor='progress';
document.body.style.cursor='progress';
document.getElementById('mydiv').style.cursor='progress';
document.getElementById('khtmlcontent').style.cursor='progress';
document.getElementById('mysubm').click();
//document.getElementById('myaltb').click();
setTimeout(halfpopdiv, Math.floor(eval(unpopsecs / 10)));
setTimeout(unpopdiv, unpopsecs);
} else {
document.getElementById('khtmlcontent').srcdoc=ot.value;
document.getElementById('khtmlcontent').style.zIndex='99';
document.body.style.cursor='progress';
document.getElementById('mydiv').style.cursor='progress';
document.getElementById('khtmlcontent').style.cursor='progress';
setTimeout(halfpopdiv, Math.floor(eval(unpopsecs / 10)));
setTimeout(unpopdiv, unpopsecs);
}
}
}
function filldiv() {
if (document.getElementById('divhtmlcontent').innerHTML == '') {
var rectis=document.getElementById('mydiv').getBoundingClientRect();
document.getElementById('divhtmlcontent').innerHTML="<iframe src='about:blank' name='khtmlcontent' id='khtmlcontent' style='font-family: monospace;border-left:5px dotted red;border-top:5px dotted red;border-bottom:5px dotted red;position:absolute;top:" + eval(0 + eval('' + rectis.top)) + "px;left:" + eval(0 + eval('' + rectis.left)) + "px;width:" + eval(5 + eval('' + rectis.width)) + "px;height:" + eval(5 + eval('' + rectis.height)) + "px; background-color:rgb(244,244,244);z-index:-99;'></iframe>";
}
}
function checkih() {
if (document.getElementById('intext').value != wasih) {
wasih=document.getElementById('intext').value;
popdiv(document.getElementById('intext'));
}
}
function overlayif() {
if (ifcont.indexOf('</p>') != -1) {
var pois=document.getElementById('pinvis');
var pas='<p' + ifcont.split('</p>')[0].split('<p')[1].split('>')[0] + '>';
pois.innerHTML=ifcont.split('</p>')[0].split(pas)[1].replace(/\<br\>/g, String.fromCharCode(10));
var ihpois='' + (pois.innerText || pois.contentWindow || pois.contentDocument);
if (!document.getElementById('overlayta') && document.getElementById('mydiv') && document.getElementById('divinvis')) {
var bcr=document.getElementById('mydiv').getBoundingClientRect();
document.getElementById('divinvis').innerHTML='<textarea id=overlayta style="' + sy + 'position:absolute;' + ('z-index:' + zin + ';').replace('z-index:-','visibility:hidden;z-index:-') + 'border:3px solid green;top:' + bcr.top + 'px;left:' + bcr.left + 'px;width:' + bcr.width + 'px;height:' + bcr.height + 'px;" rows=15 cols=120>' + ihpois + '</textarea>';
document.getElementById('overlayta').title=ifcont;
document.getElementById('divinvis').title=ifcont;
if (ifcont == '<p></p>') {
document.getElementById('overlayta').innerHTML='';
document.getElementById('overlayta').value='';
}
if (zin != lastzin) {
document.getElementById('overlayta').style.zIndex='' + zin;
if (zin.indexOf('-') != -1) {
document.getElementById('overlayta').style.visibility='hidden';
} else {
document.getElementById('overlayta').style.visibility='visible';
}
lastzin=zin;
if (document.getElementById('myaltb').title == zin) {
document.getElementById('myaltb').value=document.getElementById('myaltb').value.replace(' Iframe', ' TextAreA').replace(' Textarea', ' IfrAme').replace(/A/g, 'a');
document.getElementById('myaltb').title=document.getElementById('myaltb').title.replace('-9', '+9').replace(/^9/g, '+-9').replace(/\+/g, '');
}
}
} else if (document.getElementById('overlayta')) {
if (('' + document.getElementById('overlayta').innerHTML).indexOf('undefined') == 0 || ('' + document.getElementById('overlayta').title) == '<p></p>') {
document.getElementById('overlayta').innerHTML='';
document.getElementById('overlayta').value='';
} else {
document.getElementById('overlayta').value=('' + ihpois);
}
document.getElementById('overlayta').title=ifcont;
document.getElementById('divinvis').title=ifcont;
if (zin != lastzin) {
document.getElementById('overlayta').style.zIndex='' + zin;
if (zin.indexOf('-') != -1) {
document.getElementById('overlayta').style.visibility='hidden';
} else {
document.getElementById('overlayta').style.visibility='visible';
}
lastzin=zin;
if (document.getElementById('myaltb').title == zin) {
document.getElementById('myaltb').value=document.getElementById('myaltb').value.replace(' Iframe', ' TextAreA').replace(' Textarea', ' IfrAme').replace(/A/g, 'a');
document.getElementById('myaltb').title=document.getElementById('myaltb').title.replace('-9', '+9').replace(/^9/g, '+-9').replace(/\+/g, '');
}
}
}
}
}
function textareaize(iois) {
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
ifcont=aconto.body.innerHTML;
setTimeout(overlayif, 1000);
}
}
}
}
function dummyencodeURIComponent(invl) {
return invl;
}
function emailit() {
var etois='', ais=null, aishref='', zbigstr='';
etois=prompt('Please enter email address or SMS number to send this to. (All uppercase sends a link, otherwise emailee sees what you are seeing and uppercase/lowercase mix sends HTML attachment, else inline HTML email form sent.)', lastes);
if (etois == null) { etois=''; }
aishref='mailto:' + etois + '?subject=' + encodeURIComponent('My Emoji-izing Text') + '&body=' + encodeURIComponent('HTTPS://www.rjmprogramming.com.au/HTMLCSS/fillin_gaps_with_emojis.html?intext=' + dummyencodeURIComponent(encodeURIComponent(document.getElementById('intext').value)));
if (etois.indexOf('@') != -1) {
lastes=etois;
if (etois == etois.toUpperCase() && eval('' + aishref.length) < 900) {
ais=document.createElement('a');
ais.href='mailto:' + etois + '?subject=' + encodeURIComponent('My Emoji-izing Text') + '&body=' + encodeURIComponent('HTTPS://www.rjmprogramming.com.au/HTMLCSS/fillin_gaps_with_emojis.html?intext=' + dummyencodeURIComponent(encodeURIComponent(document.getElementById('intext').value)));
ais.innerHTML='';
ais.style.display='none';
ais.id='a' + cnt;
ais.target='_top';
document.body.appendChild(ais);
document.getElementById('a' + cnt).click();
cnt++;
} else {
//alert('1:' + document.getElementById('overlayta').value + ' 2:' + document.getElementById('divinvis').innerHTML);
var hdr='<head><meta charset="UTF-8"></head>';
var zzhr = new XMLHttpRequest();
var zzform=new FormData();
zzform.append('to', etois);
zzform.append('subj', 'My Emoji-izing Text');
if (etois == etois.toLowerCase()) {
zzform.append('inline', '');
hdr='';
}
if (document.getElementById('divinvis').innerHTML != '') {
zbigstr='<html>' + hdr + '<body>' + document.body.innerHTML.replace("'//www.rjmprogramming.com.au/PHP/ema" + "ilhtml.php'", "'HTTP://www.rjmprogramming.com.au/PHP/em" + "ailhtml.php'").replace(/\.\/fillin_gaps_with_emojis\.php/g, 'HTTPS://www.rjmprogramming.com.au/HTMLCSS/fillin_gaps_with_e' + 'mojis.html').replace('PO' + 'ST','GET').replace('></textarea>','>' + document.getElementById('intext').value + '</textarea>').split('<div ')[0] + '<div>' + document.getElementById('overlayta').value + '</div>' + '</body>' + '</html>';
} else {
zbigstr='<html>' + hdr + '<body>' + document.body.innerHTML.replace("'//www.rjmprogramming.com.au/PHP/ema" + "ilhtml.php'", "'HTTP://www.rjmprogramming.com.au/PHP/em" + "ailhtml.php'").replace(/\.\/fillin_gaps_with_emojis\.php/g, 'HTTPS://www.rjmprogramming.com.au/HTMLCSS/fillin_gaps_with_e' + 'mojis.html').replace('PO' + 'ST','GET').replace('></textarea>','>' + document.getElementById('intext').value + '</textarea>').split('<div ')[0] + '</body>' + '</html>';
}
zzform.append('tdhuhta', encodeURIComponent(zbigstr));
zzhr.open('post', '//www.rjmprogramming.com.au/PHP/emailhtml.php', true);
zzhr.send(zzform);
}
} else if (etois.trim() != '' && etois.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,'') == '') {
lastes=etois;
ais=document.createElement('a');
ais.href='sms:' + etois + '&body=' + encodeURIComponent('HTTPS://www.rjmprogramming.com.au/HTMLCSS/fillin_gaps_with_emojis.html?intext=' + encodeURIComponent(encodeURIComponent(document.getElementById('intext').value)));
ais.innerHTML='';
ais.style.display='none';
ais.id='a' + cnt;
ais.target='_top';
document.body.appendChild(ais);
document.getElementById('a' + cnt).click();
cnt++;
}
}
function onl() {
var du=('' + document.URL);
if ((rotate + '~').replace(' ~','').replace('~','') != rotate) {
document.getElementById('di').innerHTML='<input type=text style=display:none; value=' + String.fromCharCode(34) + rotate + String.fromCharCode(34) + ' name=rotate id=rotate></input>';
if (document.getElementById('overlayta')) {
document.getElementById('overlayta').style.transform='scaleY(-1)';
} else {
sy='transform:scaleY(-1);'
}
} else {
document.getElementById('rotate').value='' + rotate;
}
//alert(document.getElementById('rotate').value);
document.getElementById('mydiv').style.width='' + eval(-40 + screen.width) + 'px';
document.getElementById('iftext').style.width='' + eval(-40 + screen.width) + 'px';
if (intext != '') {
document.getElementById('intext').value=intext;
if (intext.trim() != '') { document.getElementById('mysubm').click(); }
intext='';
}
if (du.toLowerCase().indexOf('http') != 0) {
document.getElementById('iftext').method='GET';
document.getElementById('iftext').action='HTTP://www.rjmprogramming.com.au/HTMLCSS/fill' + 'in_gaps_with_emojis.html';
}
if (emailsms != '') {
emailsms='';
document.getElementById('emailsms').click();
}
if (myaltb != '') {
myaltb='';
document.getElementById('myaltb').click();
}
}
</script>
</head>
<body onload=" if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { wasih=document.getElementById('intext').value; setInterval(checkih,1000); } if (document.getElementById('divhtmlcontent').innerHTML == '') { filldiv(); } setTimeout(onl, 2000); ">
<h1>Emoji-ize <a style='cursor:pointer;text-decoration:none;' title='Apply a rotation (integer degrees) and/or flip and/or flop the emoji-ized text' onclick="var rt=prompt('Rotate text by your entry degrees. Negative entry (including -0) additionally flips. Appending a space additionally flops.','0'); if (rt == null) { rt=''; } else { rt=rt.split('.')[0]; } if (rt == '-0' || (rt + '~').replace(' ~','').replace('~','') != rt) { document.getElementById('di').innerHTML='<input type=text style=display:none; value=' + String.fromCharCode(34) + rt + String.fromCharCode(34) + ' name=rotate id=rotate></input>'; } document.getElementById('rotate').value=rt; if (document.URL.indexOf('?') != -1) { location.href=document.URL.replace('rotate=','rotJUNKate=').replace('?','?rotate=' + encodeURIComponent(rt) + '&'); } else if (document.getElementById('intext').value != '' && eval(('' + encodeURIComponent(document.getElementById('intext').value)).length) < 800) { location.href=document.URL + '?rotate=' + encodeURIComponent(rt) + '&intext=' + encodeURIComponent(document.getElementById('intext').value); } else { document.getElementById('mysubm').click(); } ">Text</a> and <select id=supdate onchange='updatedevery(this.value);'><option value='-5'>Preview every change for 5 seconds</option><option value='0'>Do no previewing of changes</option><option value='1'>Preview every change for 1 second</option><option value='2'>Preview every change for 2 seconds</option><option value='3'>Preview every change for 3 seconds</option><option value='4'>Preview every change for 4 seconds</option><option value='5'>Preview every change for 5 seconds</option><option value='6'>Preview every change for 6 seconds</option><option value='7'>Preview every change for 7 seconds</option><option value='8'>Preview every change for 8 seconds</option><option value='9'>Preview every change for 9 seconds</option><option value='10'>Preview every change for 10 seconds</option></select></h1>
<h3>RJM Programming</h3>
<h4>June, 2021</h4>
<p>Enter text below ...</p>
<form id="iform" onsubmit="this.target=document.getElementById('itarget').value; setTimeout(latback, 3000); return true;" target='iftext' method='POST' action='./fillin_gaps_with_emojis.php'><input type=hidden name=itarget id=itarget value=iftext></input>
<textarea onlosefocus="popdiv(this);" onchange="popdiv(this);" title='Emoji-ized text here goes way below after click of button below' name=intext id=intext style='width:95%;border:3px solid red;' rows=15 cols=120></textarea>
<br>
<br><div id=di style=display:none;><input style=display:none; type=number step=1 min=-359 max=359 name=rotate id=rotate value='0'></input></div>
<input id=mysubm title='Emoji-ized text version of above goes below (into Textarea) after click of this button' onclick="zin='9';" type='submit' value='Emoji-ize' style='background-color:yellow;'></input> <input id=myaltb name=myaltb onclick="zin=this.title;" title='-9' type='submit' value='... in Iframe' style='background-color:yellow;'></input> <input id=emailsms name=emailsms style='display:inline-block;' value='Email or SMS' type='submit' onclick='setTimeout(emailit,3000);'></input>
</form>
<br>
<!--br-->
<div title='Emoji-ized text version of way above goes here after click of button above' id=mydiv style='width:1200px;height:380px;display:block;border:3px solid green;'>
<iframe onload='textareaize(this);' title='Emoji-ized text version of way above goes here after click of button above' style='width:100%;height:380px;' name='iftext' id='iftext' src='./fillin_gaps_with_emojis.php'></iframe>
</div>
<p id=pinvis style='display:none;'></p>
<div id=divinvis></div>
<div id=divhtmlcontent></div>
</body>
</html>