<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Textarea Pointing - RJM Programming - December, 2017</title>
<script type='text/javascript'>
var focusto='motherboard';
var nextsuffix='2';
var firstoh='', x, y;
var dscriptih='<style> </style>';
var fontf='Arial';
var fonts='12px';
var fontc='#000000';
var fontw='normal';
var lastfontf='Verdana';
var lastfonts='12px';
var lastfontc='#000000';
var lastfontw='normal';
var cmode=true;
var etosofar='';
var celem=null;
var ccontext=null;
var ccounter=0,cco=0;
var durl='';
function clone() {
var secondoh=firstoh.replace("z-index:1;","z-index:" + nextsuffix + ";").replace(" ", " class='mboard" + nextsuffix + "' ");
//secondoh=secondoh.replace(/300/g,"100");
secondoh=secondoh.replace("top:0px;","top:" + y + "px;");
secondoh=secondoh.replace("left:0px;","left:" + x + "px;");
secondoh=secondoh.replace(/motherboard/g,"motherboard" + nextsuffix);
secondoh=secondoh.replace("font-family:" + fontf + ";","font-family:" + document.getElementById('fontf').value + ";");
secondoh=secondoh.replace("font-size:" + fonts + ";","font-size:" + document.getElementById('fonts').value + ";");
secondoh=secondoh.replace("font-style:" + fontw + ";","font-style:" + document.getElementById('fontw').value + ";");
secondoh=secondoh.replace("color:" + fontc + ";","color:" + document.getElementById('fontc').value + ";");
secondoh=secondoh.replace("font-family:" + fontf + ";","font-family:" + document.getElementById('fontf').value + ";");
secondoh=secondoh.replace("font-size:" + fonts + ";","font-size:" + document.getElementById('fonts').value + ";");
secondoh=secondoh.replace("font-style:" + fontw + ";","font-style:" + document.getElementById('fontw').value + ";");
secondoh=secondoh.replace("color:" + fontc + ";","color:" + document.getElementById('fontc').value + ";");
secondoh=secondoh.replace("font-family:" + lastfontf + ";","font-family:" + document.getElementById('fontf').value + ";");
secondoh=secondoh.replace("font-size:" + lastfonts + ";","font-size:" + document.getElementById('fonts').value + ";");
secondoh=secondoh.replace("font-style:" + lastfontw + ";","font-style:" + document.getElementById('fontw').value + ";");
secondoh=secondoh.replace("color:" + lastfontc + ";","color:" + document.getElementById('fontc').value + ";");
secondoh=secondoh.replace("font-family:" + lastfontf + ";","font-family:" + document.getElementById('fontf').value + ";");
secondoh=secondoh.replace("font-size:" + lastfonts + ";","font-size:" + document.getElementById('fonts').value + ";");
secondoh=secondoh.replace("font-style:" + lastfontw + ";","font-style:" + document.getElementById('fontw').value + ";");
secondoh=secondoh.replace("color:" + lastfontc + ";","color:" + document.getElementById('fontc').value + ";");
//alert("color:" + fontc + ";" + "," + "color:" + document.getElementById('fontc').value + ";" + " " + secondoh);
dscriptih=dscriptih.replace('</style>', ' .mboard' + nextsuffix + ' { width: calc(85% - ' + x + 'px); } </style>');
document.getElementById('dscript').innerHTML=dscriptih;
focusto="motherboard" + nextsuffix;
nextsuffix='' + eval(eval(nextsuffix) + 1);
return secondoh;
}
function clicksup(event) {
//alert('You clicked');
var thissuffix=nextsuffix;
var prevval=document.getElementById(focusto).value;
var prevo=document.getElementById(focusto);
if (event.clientX || event.clientY) {
x = event.clientX;
y = event.clientY;
} else {
x = event.pageX;
y = event.pageY;
}
if (1 == 1) {
//if (document.getElementById('d' + thissuffix)) alert(prevval + 'should be okay if prefixed by something');
document.getElementById('d' + thissuffix).innerHTML=clone() + "<div id='d" + eval(1 + eval(thissuffix)) + "'></div>";
} else {
document.getElementById('myform').innerHTML+=clone();
}
if (document.getElementById(focusto)) {
if (document.getElementById(focusto).title) {
document.getElementById(focusto).title=document.getElementById(focusto).title.replace("font-family:" + fontf + ";","font-family:" + document.getElementById('fontf').value + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace("font-size:" + fonts + ";","font-size:" + document.getElementById('fonts').value + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace("font-style:" + fontw + ";","font-style:" + document.getElementById('fontw').value + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace("color:" + fontc + ";","color:" + document.getElementById('fontc').value + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace("font-family:" + lastfontf + ";","font-family:" + document.getElementById('fontf').value + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace("font-size:" + lastfonts + ";","font-size:" + document.getElementById('fonts').value + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace("font-style:" + lastfontw + ";","font-style:" + document.getElementById('fontw').value + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace("color:" + lastfontc + ";","color:" + document.getElementById('fontc').value + ";");
}
}
//alert(prevo.id + ' ... ' + prevval);
//prevo.value=prevval;
prevo.innerHTML=prevval;
dofocus();
//alert(document.getElementById('myform').innerHTML);
}
function dumclickmysup(event) {
}
function pbtas() {
document.getElementById('ccanvas').style.zIndex=-9;
document.getElementById('dcanvas').style.zIndex=-9;
document.getElementById('dcanvas').style.display='none';
document.getElementById('ccanvas').style.display='none';
document.getElementById('icanvas').style.display='none';
document.getElementById('dddcanvas').style.display='none';
document.getElementById('bcanvas').value='Canvas';
}
function preotestcanvas() {
if (cco > 0) {
cco--;
}
if (cco > 0) setTimeout(preotestcanvas, 100);
}
function pretestcanvas() {
if (ccounter > 0) {
ccounter--;
}
if (ccounter > 0) setTimeout(pretestcanvas, 100);
}
function testcanvas(wcan,isc) {
if (ccounter == 0 && isc != 0) {
ccounter=10;
setTimeout(pretestcanvas, 100);
} else if (cco == 0 && isc == 0) {
cco=10; //20;
setTimeout(preotestcanvas, 100);
} else if (ccounter > 5 && isc != 0) {
//wcan.style.zIndex=-9;
//wcan.style.display='none';
pbtas();
} else if (cco > 5 && isc == 0) {
//wcan.style.zIndex=-9;
//wcan.style.display='none';
pbtas();
}
}
function dofocus() {
var val='', value=[];
if (document.getElementById('dcanvas')) {
if (document.getElementById('dcanvas').innerHTML == '') {
if (window.localStorage) {
for (var iq in window.localStorage) {
val = localStorage.getItem(iq);
if (val) {
//value = val.split(","); //splitting string inside array to get name
//alert(iq);
if (iq.substring(0,3) == 'tp_') {
document.getElementById('ssaveas').innerHTML+='<option value="' + iq.substring(3) + '">Recall "' + iq.substring(3) + '"</option>';
}
}
}
}
var celem_style_width='' + eval(window.getComputedStyle(document.getElementById('ibody'), null).getPropertyValue("width").replace('px','').replace('%','').replace('vh','') * 0.85) + 'px';
var celem_style_width100='' + eval(window.getComputedStyle(document.getElementById('motherboard'), null).getPropertyValue("width").replace('px','').replace('%','').replace('vh','') * 1.00) + 'px';
var celem_width='' + eval(window.getComputedStyle(document.getElementById('ibody'), null).getPropertyValue("width").replace('px','').replace('%','').replace('vh','') * 0.85);
//celem_width='' + eval(window.getComputedStyle(document.getElementById('motherboard'), null).getPropertyValue("width").replace('px','').replace('%','').replace('vh','') * 1.00) + 'px'; //0.85);
var celem_style_height='' + eval(window.getComputedStyle(document.getElementById('motherboard'), null).getPropertyValue("height").replace('px','').replace('%','').replace('vh','')) + 'px';
var celem_height='' + eval(window.getComputedStyle(document.getElementById('motherboard'), null).getPropertyValue("height").replace('px','').replace('%','').replace('vh','')) + 'px';
document.getElementById('dcanvas').innerHTML="<canvas onfocus=\"testcanvas(this,0);\" onclick=\"testcanvas(this,1);\" title=\"Double click me to reveal textareas again\" id=ccanvas style=\"position:absolute;display:block;z-index:-9;top:1500px;left:0px;width:100%;height:100%;\"></canvas>";
document.getElementById('ddcanvas').innerHTML="<br><span id=dddcanvas style=display:none;> Canvas Image: </span><img onclick=\"var imgwo=window.open('','_blank','top=0,left=0,width=" + celem_width + ",height=" + celem_height + "'); imgwo.document.write('<html><b' + 'ody><img title=Canvas src=' + this.src + '></img></b' + 'ody></html>');\" title=\"Image of canvas to left in new window\" id=icanvas style='width:45px;display:none;border:1px solid green;background-color:white;' src=''></img>";
celem=document.getElementById('ccanvas');
ccontext=celem.getContext("2d");
celem.style.width=celem_style_width; //'' + eval(window.getComputedStyle(document.body, null).getPropertyValue("width").replace('px','').replace('%','').replace('vh','') * 0.85) + 'px';
celem.width=celem_style_width; //'' + eval(window.getComputedStyle(document.body, null).getPropertyValue("width").replace('px','').replace('%','').replace('vh','') * 0.85);
celem.style.height=celem_style_height; //'' + eval(window.getComputedStyle(document.getElementById('motherboard'), null).getPropertyValue("height").replace('px','').replace('%','').replace('vh','')) + 'px';
celem.height=celem_style_height; //'' + eval(window.getComputedStyle(document.getElementById('motherboard'), null).getPropertyValue("height").replace('px','').replace('%','').replace('vh',''));
//alert(document.getElementById('ibody').style.width + ' vs ' + celem_style_width + ' ' + celem_style_width100 + ' ' + eval(window.getComputedStyle(document.body, null).getPropertyValue("width").replace('px','').replace('%','').replace('vh','') * 0.85));
document.getElementById('dcanvas').style.width=celem_style_width;
document.getElementById('dcanvas').style.height=celem_style_height;
}
}
if (firstoh == '') {
if (document.getElementById('motherboard2')) {
document.getElementById('motherboard').value=document.getElementById('motherboard').innerHTML.replace(/\<\;/g,"<").replace(/\>\;/g,">");
document.getElementById('motherboard').innerHTML='';
firstoh="<textarea alt='font-family:Arial;font-size:12px;color:#000000;font-style:normal;' onclick='clicksup(event);' title='Base Textarea to type away on or click/touch to reposition text' style='font-family:Arial;font-size:12px;font-style:normal;color:#000000;border:0px solid yellow;border-right:1px solid red;z-index:1;position:absolute;background-color:transparent;top:0px;left:0px;height:100vh;' id='moth" + "erboard' name='moth" + "erboard' cols=300 rows=300>" + "</textarea>";
while (document.getElementById('motherboard' + nextsuffix)) {
document.getElementById('motherboard' + nextsuffix).value=document.getElementById('motherboard' + nextsuffix).innerHTML.replace(/\<\;/g,"<").replace(/\>\;/g,">");
document.getElementById('motherboard' + nextsuffix).innerHTML='';
focusto="motherboard" + nextsuffix;
nextsuffix='' + eval(eval(nextsuffix) + 1);
}
firstoh=document.getElementById(focusto).outerHTML;
document.getElementById('fontf').focus();
} else {
cmode=false;
firstoh=document.getElementById(focusto).outerHTML;
//alert(firstoh);
document.getElementById(focusto).style.width='85%';
document.getElementById(focusto).style.height='100vh';
document.getElementById(focusto).focus();
}
}
}
function altit(tv,ti) {
if (document.getElementById(focusto)) {
//alert(43 + ' ' + ti);
if (document.getElementById(focusto).title) {
//alert(ti);
if (ti == 'fontf') {
document.getElementById(focusto).style.fontFamily=tv;
document.getElementById(focusto).title=document.getElementById(focusto).title.replace(/\:\ /g,':').replace("font-family:" + fontf + ";","font-family:" + tv + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace(/\:\ /g,':').replace("font-family:" + lastfontf + ";","font-family:" + tv + ";");
//alert(document.getElementById(focusto).title);
lastfontf=tv;
} else if (ti == 'fonts') {
document.getElementById(focusto).style.fontSize=tv;
document.getElementById(focusto).title=document.getElementById(focusto).title.replace(/\:\ /g,':').replace("font-size:" + fonts + ";","font-size:" + tv + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace(/\:\ /g,':').replace("font-size:" + lastfonts + ";","font-size:" + tv + ";");
//alert(fonts + ' ... ' + tv + ' +++ ' + document.getElementById(focusto).title);
lastfonts=tv;
} else if (ti == 'fontc') {
document.getElementById(focusto).style.color=tv;
document.getElementById(focusto).title=document.getElementById(focusto).title.replace(/\:\ /g,':').replace("color:" + fontc + ";","color:" + tv + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace(/\:\ /g,':').replace("color:" + lastfontc + ";","color:" + tv + ";");
//alert(document.getElementById(focusto).title);
lastfontc=tv;
} else if (ti == 'fontw') {
document.getElementById(focusto).style.fontStyle=tv;
document.getElementById(focusto).title=document.getElementById(focusto).title.replace(/\:\ /g,':').replace("font-style:" + fontw + ";","font-style:" + tv + ";");
document.getElementById(focusto).title=document.getElementById(focusto).title.replace(/\:\ /g,':').replace("font-style:" + lastfontw + ";","font-style:" + tv + ";");
//alert(document.getElementById(focusto).title);
lastfontw=tv;
document.getElementById('fontf').focus();
}
}
}
return tv;
}
function lotsforthefuture(oform) {
// Lots for later
// End of ... Lots for later
return true;
}
function updd(oi,oiv) {
//alert(oiv);
oi.innerHTML=oiv;
oi.value=oi.innerHTML;
oi.innerHTML=oiv;
}
function upd(oi,oiv) {
oi.innerHTML=oiv;
oi.value=oi.innerHTML;
oi.innerHTML='';
}
function htmlout(pcent) {
var newo='', tao=[], taoih=[], itas, ihis='', tdelim='', doemail=false, dopdf=false, dodownload=false;
var xfontf='Arial', cf='',clines,cy=0,ic;
var xfonts='12px', lhplace='', ctas=[];
var xfontc='0~~0~~0';
var xfontw='normal', twelve=12;
var xred=0, xgreen=0, xblue=0;
document.getElementById('htmltp').value='';
if (pcent.indexOf('.000000%') == -1 && pcent.indexOf('.00000%') == -1 && document.getElementById('bcanvas').value != 'Canvas') {
//alert(65);
document.getElementById('bcanvas').click();
}
if (pcent.indexOf('.000000') != -1) {
if (newo == '') {
newo=pcent.split('%')[1];
pcent=pcent.replace('%' + newo, '%');
}
if (localStorage) {
if (localStorage.getItem('tp_' + newo)) {
//alert(newo);
var bih=decodeURIComponent(localStorage.getItem('tp_' + newo)); //.replace(/\<\;/g,'<').replace(/\>\;/g,'>');
//alert(bih);
document.getElementById('myform').innerHTML=bih;
if (document.getElementById('motherboard2')) {
document.getElementById('motherboard').value=document.getElementById('motherboard').innerHTML.replace(/\<\;/g,"<").replace(/\>\;/g,">");
document.getElementById('motherboard').innerHTML='';
firstoh="<textarea alt='font-family:Arial;font-size:12px;color:#000000;font-style:normal;' onclick='clicksup(event);' title='Base Textarea to type away on or click/touch to reposition text' style='font-family:Arial;font-size:12px;font-style:normal;color:#000000;border:0px solid yellow;border-right:1px solid red;z-index:1;position:absolute;background-color:transparent;top:0px;left:0px;height:100vh;' id='moth" + "erboard' name='moth" + "erboard' cols=300 rows=300>" + "</textarea>";
while (document.getElementById('motherboard' + nextsuffix)) {
document.getElementById('motherboard' + nextsuffix).value=document.getElementById('motherboard' + nextsuffix).innerHTML.replace(/\<\;/g,"<").replace(/\>\;/g,">");
document.getElementById('motherboard' + nextsuffix).innerHTML='';
focusto="motherboard" + nextsuffix;
nextsuffix='' + eval(eval(nextsuffix) + 1);
}
firstoh=document.getElementById(focusto).outerHTML;
document.getElementById('fontf').focus();
}
return '';
}
}
return '';
}
var tas=document.getElementsByTagName('textarea');
//alert(tas[eval(-1 + tas.length)].value + ' vs ' + tas[eval(-1 + tas.length)].innerHTML + ' ... ' + ctas[eval(-2 + tas.length)]);
for (itas=0;itas<(eval(0 + tas.length));itas++) {
ihis='';
if (tas[itas].value != '' && tas[itas].innerHTML != '') {
ihis=tas[itas].innerHTML;
tao.push(tas[itas]);
taoih.push(tas[itas].innerHTML);
//if (ctas.length > 0) alert(tas[itas].innerHTML + ' +++ ' + tas[itas].value);
tas[itas].innerHTML='';
} else if (tas[itas].innerHTML != '') {
ihis=tas[itas].innerHTML;
//if (ctas.length > 0) alert(tas[itas].innerHTML + ' ++.+ ' + tas[itas].value);
} else if (tas[itas].value != '') {
ihis=tas[itas].value;
//if (ctas.length > 0) alert(tas[itas].innerHTML + ' ++..+ ' + tas[itas].value);
} else if (ctas.length > eval(itas - 1) && itas > 0) {
//alert(itas + ' ... ' + ctas[eval(itas - 1)]);
if (ctas[eval(itas - 1)].indexOf('>') != -1) {
tao.push(tas[itas]);
ihis=ctas[eval(itas - 1)].split('>')[eval(-1 + ctas[eval(itas - 1)].split('>').length)];
taoih.push(ihis);
//alert(ihis);
}
}
//if (itas > 0) alert('ihis=' + ihis);
if (ihis != '') {
if (pcent.indexOf('.00000000') != -1) {
} else if (pcent.indexOf('.0000000') != -1) {
} else if (pcent.indexOf('.000000') != -1) {
if (newo == '') {
newo=pcent.split('%')[1];
pcent=pcent.replace('%' + newo, '%');
}
if (localStorage) {
if (localStorage.getItem('tp_' + newo)) {
alert(newo);
var bih=decodeURIComponent(localStorage.getItem('tp_' + newo)); //.replace(/\<\;/g,'<').replace(/\>\;/g,'>');
alert(bih);
document.body.innerHTML=bih;
return '';
}
}
return '';
} else if (pcent.indexOf('.00000') != -1) {
if (newo == '') {
newo=pcent.split('%')[1];
pcent=pcent.replace('%' + newo, '%');
}
} else if (pcent.indexOf('.0000') != -1) {
if (lhplace == '') {
//alert(14);
document.getElementById('icanvas').style.display='inline';
document.getElementById('dddcanvas').style.display='inline';
document.getElementById('dcanvas').style.position='absolute'
document.getElementById('dcanvas').style.top='0px';
document.getElementById('dcanvas').style.left='0px';
//alert(15);
//document.getElementById('dcanvas').style.width=celem.style.width;
//document.getElementById('dcanvas').style.height=celem.style.height;
document.getElementById('dcanvas').style.zIndex='20';
document.getElementById('dcanvas').style.display='block';
//alert(16);
celem.style.top='0px';
celem.style.left='0px';
//alert(17);
celem.width=eval(('' + celem.style.width).replace('px',''));
celem.height=eval(('' + celem.style.height).replace('px',''));
//alert(18);
celem.style.backgroundColor='#f0f0f0';
celem.style.border='1px solid red';
celem.style.zIndex='20';
celem.style.display='block';
//alert(19);
}
if (tas[itas].outerHTML.indexOf('font-family:') != -1) xfontf=(tas[itas].outerHTML + ';').split('ont-family:')[1].split(';')[0];
if (tas[itas].outerHTML.indexOf('font-style:') != -1) xfontw=(tas[itas].outerHTML + ';').split('ont-style:')[1].split(';')[0];
if (tas[itas].outerHTML.indexOf('font-size:') != -1) xfonts=(tas[itas].outerHTML + ';').split('ont-size:')[1].split(';')[0];
cf = xfontw.replace('normal','') + " " + xfonts + " " + xfontf;
twelve=eval(xfonts.split('px')[0]);
ccontext.font = cf;
//alert(cf + ' ... ' + tas[itas].outerHTML);
if (tas[itas].outerHTML.indexOf('color:#') != -1) {
//alert(celem.width + ' #' + tas[itas].outerHTML.split('olor:#')[1].split(';')[0]);
ccontext.fillStyle='#' + tas[itas].outerHTML.split('olor:#')[1].split(';')[0];
}
cy=eval(eval(tas[itas].style.top.replace('px','')) / 1 + 12);
clines=ihis.split(String.fromCharCode(10));
for (ic=0;ic<clines.length;ic++) {
//if (itas > 0) alert(clines[ic]);
ccontext.fillText(clines[ic],eval(eval(tas[itas].style.left.replace('px','')) / 1),cy);
cy+=twelve;
}
durl=celem.toDataURL('image/png'); //jpeg',0.7);
//alert(durl);
document.getElementById('icanvas').src=durl;
document.getElementById('icanvas').style.backgroundImage="URL('" + durl + "')";
lhplace='#ccanvas';
} else if (pcent.indexOf('.000') != -1) {
dopdf=true;
dodownload=false;
doemail=false;
if (document.getElementById('htmltp').value == "") document.getElementById('htmltp').value="new``";
// string family [, string style [, float size]]
// font-family:Arial;font-size:12px;color:#000000;font-style:normal; B I U nothing
if (tas[itas].outerHTML.indexOf('font-family:') != -1) xfontf=(tas[itas].outerHTML + ';').split('ont-family:')[1].split(';')[0];
if (tas[itas].outerHTML.indexOf('font-style:') != -1) xfontw=(tas[itas].outerHTML + ';').split('ont-style:')[1].split(';')[0];
if (tas[itas].outerHTML.indexOf('font-size:') != -1) xfonts=(tas[itas].outerHTML + ';').split('ont-size:')[1].split(';')[0];
document.getElementById('htmltp').value+=tdelim + xfontf + '~`' + xfontw.replace('normal','').replace('bold','B').replace('italic','I').replace('underline','U') + '~`' + xfonts;
tdelim='``';
if (tas[itas].outerHTML.indexOf('color:#') != -1) {
xred=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(0,1)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(1,2)));
xgreen=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(2,3)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(3,4)));
xblue=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(4,5)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(5,6)));
document.getElementById('htmltp').value+=tdelim + xred + '~~' + xgreen + '~~' + xblue;
tdelim='``';
}
document.getElementById('htmltp').value+=tdelim + eval(eval(tas[itas].style.left.replace('px','')) / 2) + '`~' + eval(eval(tas[itas].style.top.replace('px','')) / 2) + '`~' + ihis;
tdelim='``';
} else if (pcent.indexOf('.00') != -1) {
dopdf=true;
dodownload=true;
doemail=false;
if (document.getElementById('htmltp').value == "") document.getElementById('htmltp').value="New``";
// string family [, string style [, float size]]
// font-family:Arial;font-size:12px;color:#000000;font-style:normal; B I U nothing
if (tas[itas].outerHTML.indexOf('font-family:') != -1) xfontf=(tas[itas].outerHTML + ';').split('ont-family:')[1].split(';')[0];
if (tas[itas].outerHTML.indexOf('font-style:') != -1) xfontw=(tas[itas].outerHTML + ';').split('ont-style:')[1].split(';')[0];
if (tas[itas].outerHTML.indexOf('font-size:') != -1) xfonts=(tas[itas].outerHTML + ';').split('ont-size:')[1].split(';')[0];
document.getElementById('htmltp').value+=tdelim + xfontf + '~`' + xfontw.replace('normal','').replace('bold','B').replace('italic','I').replace('underline','U') + '~`' + xfonts;
tdelim='``';
if (tas[itas].outerHTML.indexOf('color:#') != -1) {
xred=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(0,1)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(1,2)));
xgreen=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(2,3)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(3,4)));
xblue=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(4,5)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(5,6)));
document.getElementById('htmltp').value+=tdelim + xred + '~~' + xgreen + '~~' + xblue;
tdelim='``';
}
document.getElementById('htmltp').value+=tdelim + eval(eval(tas[itas].style.left.replace('px','')) / 2) + '`~' + eval(eval(tas[itas].style.top.replace('px','')) / 2) + '`~' + ihis;
tdelim='``';
} else if (pcent.indexOf('.0') != -1) {
dopdf=true;
dodownload=true;
doemail=true;
if (document.getElementById('htmltp').value == "") document.getElementById('htmltp').value="New``";
// string family [, string style [, float size]]
// font-family:Arial;font-size:12px;color:#000000;font-style:normal; B I U nothing
if (tas[itas].outerHTML.indexOf('font-family:') != -1) xfontf=(tas[itas].outerHTML + ';').split('ont-family:')[1].split(';')[0];
if (tas[itas].outerHTML.indexOf('font-style:') != -1) xfontw=(tas[itas].outerHTML + ';').split('ont-style:')[1].split(';')[0];
if (tas[itas].outerHTML.indexOf('font-size:') != -1) xfonts=(tas[itas].outerHTML + ';').split('ont-size:')[1].split(';')[0];
document.getElementById('htmltp').value+=tdelim + xfontf + '~`' + xfontw.replace('normal','').replace('bold','B').replace('italic','I').replace('underline','U') + '~`' + xfonts;
tdelim='``';
if (tas[itas].outerHTML.indexOf('color:#') != -1) {
xred=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(0,1)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(1,2)));
xgreen=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(2,3)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(3,4)));
xblue=eval(eval(eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(4,5)) * 16) + eval(('' + tas[itas].outerHTML).split('olor:#')[1].substring(5,6)));
document.getElementById('htmltp').value+=tdelim + xred + '~~' + xgreen + '~~' + xblue;
tdelim='``';
}
document.getElementById('htmltp').value+=tdelim + eval(eval(tas[itas].style.left.replace('px','')) / 2) + '`~' + eval(eval(tas[itas].style.top.replace('px','')) / 2) + '`~' + ihis;
tdelim='``';
}
if (document.getElementById('htmltp').value != "") tdelim='``';
}
}
if (lhplace != '') {
location.href=lhplace;
return '';
}
// if (document.getElementById('htmltp').value != "") alert(document.getElementById('htmltp').value);
if (pcent.indexOf('.0000000%') != -1) return '';
pcent=pcent.replace('.00000000','').replace('.0000000','').replace('.000000','').replace('.00000','').replace('.0000','').replace('.000','').replace('.00','').replace('.0','');
var dbo=document.body.outerHTML;
var dhi=document.head.innerHTML;
if (pcent.trim() != '8' + '5%') {
dbo=dbo.replace('1' + '5%;','0%;display:none;');
while (dbo.indexOf('8' + '5%') != -1) {
dbo=dbo.replace('8' + '5%',pcent.trim());
}
while (dhi.indexOf('8' + '5%') != -1) {
dhi=dhi.replace('8' + '5%',pcent.trim());
}
}
var hcont='<!doctype html><html><head>' + dhi + '</head>' + dbo.replace(/clicksup\(/g,'dumc' + 'lickm' + 'ysup(').replace(/\<textarea /g,'<textarea onchange=upd(this,this.value); onfocus=ofc(this); ') + '</html>';
var pt='motherboard', edits='';
var nexti=1, esty;
while (document.getElementById(pt)) {
if (nexti >= 2) {
esty=document.body.outerHTML.split(' .mboard' + nexti + ' { ');
if (esty.length > 1) {
if (document.body.outerHTML.indexOf('" id="motherboard') != -1) {
hcont=hcont.replace('" id="motherboard' + nexti + '"', '' + esty[1].split(';')[0] + ';" id="motherboard' + nexti + '"');
} else {
hcont=hcont.replace("' id='motherboard" + nexti + "'", "" + esty[1].split(";")[0] + ";' id='motherboard" + nexti + "'");
}
}
}
edits+=',[' + nexti + ']' + document.getElementById(pt).value;
hcont=hcont.replace('>' + '</textarea>', '>' + document.getElementById(pt).value.replace(/\<\;/g,"<").replace(/\>\;/g,">") + ' ' + '</TEX' + 'TAREA>');
//alert(edits + ' ..' + nexti + '. ' + hcont.substring(hcont.indexOf('<bo' + 'dy ')));
nexti++;
pt='motherboard' + nexti;
}
if (pcent.trim() != '8' + '5%') {
hcont=hcont.replace('8' + '5%',pcent.trim());
while (hcont.indexOf('1px so' + 'lid') != -1) {
hcont=hcont.replace('1px so' + 'lid','0px so' + 'lid')
}
}
if (hcont.indexOf('</TEXT' + 'AREA>') != -1) {
while (hcont.indexOf('</TEXT' + 'AREA>') != -1) {
hcont=hcont.replace('</TEXT' + 'AREA>','</text' + 'area>')
}
//alert(edits + ' ... ' + hcont.substring(hcont.indexOf('<bo' + 'dy ')));
}
//if (cmode) alert(hcont);
if (dopdf || (pcent.trim() == '8' + '5%' && pcent != '8' + '5%')) {
var eto="";
if (dodownload) eto=" ";
if (doemail || (pcent.trim() == '8' + '5%' && pcent != '8' + '5%')) eto=prompt('Please enter email address to email Textarea Pointing webpage to (and consider adding a comma separated mention of your own email address for Reply To All purposes)',etosofar);
if (eto != null) {
if (eto.indexOf('@') != -1 || dopdf) {
etosofar=eto;
if (dopdf && !dodownload && !doemail) {
if (1 == 1) {
document.getElementById('femail').target='_blank';
setTimeout(andlater,2000);
} else {
document.getElementById('iemail').style.display='block';
location.href='#iemail';
}
}
document.getElementById('emailto').value=eto;
if (document.getElementById('htmltp').value == '') document.getElementById('htmltp').value=hcont.replace(/\+\=/g,'#@~#').replace(/\+\+/g,'#@!#').replace(/ \+ /g,'#@#');
document.getElementById('semail').click();
}
}
} else {
if (newo != '') {
if (localStorage) {
if (localStorage.getItem('tp_' + newo)) {
//document.title+=' remove ';
localStorage.removeItem('tp_' + newo);
}
//document.title+=' set ';
//alert(value);
var bbit='m' + hcont.split('<f' + 'orm')[1].split('>')[0] + '>';
//alert(newo + '=' + encodeURIComponent(hcont.split('<bo' + 'd')[1].replace(bbit,'').split('</b' + 'ody>')[0]));
localStorage.setItem('tp_' + newo, encodeURIComponent(hcont.split('<fo' + 'r')[1].replace(bbit,'').split('</f' + 'orm>')[0])); //.replace(/\</g,'<').replace(/\>/g,'>'));
document.getElementById('ssaveas').innerHTML+='<option value="' + newo + '">Recall "' + newo + '"</option>';
}
} else {
var wo=window.open('','_blank');
wo.document.write(hcont);
}
}
for (itas=0;itas<tao.length;itas++) {
//if (tao[itas].id == focusto) alert(tao[itas].innerHTML + ' ... ' + tao[itas].value);
tao[itas].innerHTML=taoih[itas].replace(/\<\;/g,"<").replace(/\>\;/g,">");
tao[itas].value=taoih[itas].replace(/\<\;/g,"<").replace(/\>\;/g,">");
}
}
function andlater() {
document.getElementById('femail').target='iemail';
}
function checki(iois) {
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
try {
if (aconto.document) { aconto = aconto.document; }
document.getElementById('d' + iois.id.substring(1)).style.display='block';
} catch(eee) { }
}
}
}
function ofc(ois) {
focusto=ois.id;
}
function newone(tv) {
htmlout('85.00000%' + tv);
}
function pickold(tv) {
htmlout('85.000000%' + tv);
}
</script>
</head>
<body id=ibody style='width:100%;' onload='dofocus();'>
<form onsubmit='return lotsforthefuture(this);' id='myform' action='./textarea_pointing.html' method='GET'>
<textarea onclick='clicksup(event);' title='Base Textarea to type away on or click/touch to reposition text;font-family:Arial;font-size:12px;color:#000000;font-style:normal;' style='font-family:Arial;font-size:12px;font-style:normal;color:#000000;border:0px solid yellow;border-right:1px solid red;z-index:1;position:absolute;background-color:transparent;top:0px;left:0px;height:100vh;' id='motherboard' name='motherboard' cols=300 rows=300></textarea>
<input type='submit' id='mysubmit' value='Draw This' style='display:none;'></input>
<div id='d2'></div>
</form>
<div id='menu' style='background-color:yellow;position:absolute;left:85%;width:15%;top:0px;height:100vh;'><h1> Textarea <br> Pointing</h1><h3> RJM Programming</h3><h3> December, 2017</h3>
Font Family: <input title='FPDF likes one of Arial,Courier,Helvetica,Symbol,Times,ZapfDingbats' style='margin-left:20px;' onblur="document.getElementById(focusto).style.fontFamily=altit(this.value,this.id);" type='text' id='fontf' value='Arial'></input><br>
Font Size: <input style='margin-left:20px;' onblur="document.getElementById(focusto).style.fontSize=altit(this.value,this.id);" type='text' id='fonts' value='12px'></input><br>
Font Colour: <input style='margin-left:20px;' onchange="document.getElementById(focusto).style.color=altit(this.value,this.id);" onblur="document.getElementById(focusto).style.color=altit(this.value,this.id);" type='color' id='fontc' value='black'></input><br>
Font Style: <input title='FPDF likes one of normal,bold,italic,underline' style='margin-left:20px;' onblur="document.getElementById(focusto).style.fontStyle=altit(this.value,this.id);" type='text' id='fontw' value='normal'></input><br><br>
<hr><span id=dsaveas><select onchange=pickold(this.value); id=ssaveas><option value=''>Fill in Save As or choose</option></select> <input onblur=newone(this.value); title='Save As...' type=text value=''></input></span>
<hr> New Window: <input type='button' style='margin-left:20px;' onclick="htmlout('100%');" value="New Window"></input><br>
New Menu Window: <input type='button' style='margin-left:20px;' onclick="htmlout('85%');" value="New Menu Window"></input><br>
Canvas: <input id=bcanvas type='button' style='margin-left:20px;' onclick="if (this.value == 'Canvas') { htmlout('85.0000%'); this.value='Textareas'; } else { pbtas(); } " value="Canvas"></input><div id=ddcanvas></div><br>
<div id='demail' style='display:none;'> Email: <input type='button' style='margin-left:20px;' onclick="htmlout(' 85%');" value="Email 📧"></input> <input type='button' style='margin-left:20px;' onclick="htmlout('100.0%');" value="PDF"></input><br> Download: <input type='button' style='margin-left:20px;' onclick="htmlout('100.00%');" value="PDF"></input><br> Viewer: <input type='button' style='margin-left:20px;' onclick="htmlout('100.000%');" value="PDF"></input><br><form target='iemail' action='../PHP/Geographicals/prediff.php' method='POST' style='display:none;' id='femail' name='femail'><input type=hidden name=htmltp id=htmltp value=''></input><input type=hidden name=emailto id=emailto value=''></input><input type=submit id=semail value='Email' style='display:none;'></input></form></div>
<iframe style='width:800px;height:800px;display:none;' name='iemail' id='iemail' onload='checki(this);' src='../PHP/Geographicals/prediff.php'></iframe>
<hr> <a target=_blank title='Emoji Use advice' href='https://www.google.com.au/search?q=emoji+keyboard+shortcuts&ie=utf-8&oe=utf-8&client=firefox-b-ab&gfe_rd=cr&dcr=0&ei=x7JKWsrFGcHN8gfBy5rABw'>Emoji 📧 Use?</a><br>
<input style='margin-left:-6000px' type='text' id='offtheradar' value=''></input><br>
</div><br><div id=dcanvas style='z-index:-9;display:none;'></div>
<div id='dscript'></div>
</body>
</html>