<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'>
'intext'
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='';
function overlayif() {
if (ifcont.indexOf('</p>') != -1) {
var pois=document.getElementById('pinvis');
pois.innerHTML=ifcont.split('</p>')[0].split('<p>')[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="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 (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')) {
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);
if (document.getElementById('divinvis').innerHTML != '') {
zbigstr='<html>' + '<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>' + '<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>';
}
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', '');
}
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(encodeURIComponent('HTTPS://www.rjmprogramming.com.au/HTMLCSS/fillin_gaps_with_emojis.html?intext=' + 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);
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=" setTimeout(onl, 2000); ">
<h1>Emoji-ize Text</h1>
<h3>RJM Programming</h3>
<h4>June, 2021</h4>
<p>Enter text below ...</p>
<form target='iftext' method='POST' action='./fillin_gaps_with_emojis.php'>
<textarea 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>
<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>
</body>
</html>