<html>
<head>
<title>Haiku Animated GIF Creator - RJM Programming - June, 2020</title>
<style>
.hrcolbelow:andbelow { background-color: rgba(255,255,0,0.5); }
</style>
<script type='text/javascript'>
var lastaurl='', thisaurl='', lastvurl='', thisvurl='', lastiurl='', thisiurl='';
var altsubject='';
var mampok=false;
var mampprefix='';
var attachment='';
var wois=null;
var valid=false;
var biurl='', xbiurl='', lastbiurl='';
var inbivalue='';
var prefix='?stitle=' + encodeURIComponent('My Haiku') + '&fsize=24px&fleft=40' + encodeURIComponent('%') + '&ftop=40' + encodeURIComponent('%') + '&fontname=Arial&delay=400';
var prevfontname='Arial';
var prevsize='24px';
var fromsub='&delay=';
var tosub='&delay=';
var prevburl='./white.jpg';
var prevaurl='', ainbivalue='';
var prevvurl='', vinbivalue='';
var types = ["audio/wav","audio/x-wav","audio/x-pn-realaudio","audio/x-mpegurl","audio/x-aiff","audio/mpeg","audio/mid",
"audio/basic","audio/ogg","video/x-sgi-movie","video/x-msvideo","video/quicktime","audio/mp3","video/mp4","video/mpeg",
"video/x-la-asf","video/ogg","video/webm","audio/mp4", "image/jpeg", "image/jpeg", "image/png", "image/gif", "image/bmp", "image/tif"];
var exts = [".wav",".wav",".ram",".m3u",".aiff",".mp3",".rmi",
".snd",".ogg",".movie",".avi",".mov",".mp3",".m4v",".mpeg",
".lsx",".ogv",".webm",".m4a", ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif"];
var ourmime="";
var zhr=null, zform=null;
function postagc(invx) {
if ((document.getElementById('aurl').value + document.getElementById('vurl').value).indexOf('data:') == 0) {
invx+='&iurl=';
}
var sofarform='<form style=display:none; target=argc method=POST action=';
if (eval('' + invx.length) > 800) {
var actions=invx.split('?');
if (actions.length >= 2) {
sofarform+=actions[0] + '><input type=submit id=igo value=Go style=display:none;></input></form>';
var argsare=actions[1].split('&');
for (var iargsare=0; iargsare<argsare.length; iargsare++) {
sofarform=sofarform.replace('><input ', '> <input style=display:none; name=' + argsare[iargsare].split('=')[0] + ' value="' + decodeURIComponent(argsare[iargsare].split('=')[1]) + '"></input><input ');
}
document.getElementById('dform').innerHTML=sofarform;
//alert(document.getElementById('dform').innerHTML);
document.getElementById('igo').click();
return '#';
}
}
//alert(invx);
return invx;
}
function vaprefix(insr) {
if (1 == 2) {
if (document.getElementById('aurl').value != '' && document.getElementById('vurl').value != '') {
if (1 == 1 || eval('' + (document.getElementById('aurl').value + document.getElementById('vurl').value).length) < 200) {
return insr.replace('?', '?xfaudio=' + encodeURIComponent(document.getElementById('aurl').value) + '&xfvideo=' + encodeURIComponent(document.getElementById('vurl').value) + '&');
}
} else if (document.getElementById('aurl').value != '') {
if (1 == 1 || eval('' + (document.getElementById('aurl').value).length) < 200) {
//alert(insr.replace('?', '?faudio=' + encodeURIComponent(document.getElementById('aurl').value) + '&'));
return insr.replace('?', '?xfaudio=' + encodeURIComponent(document.getElementById('aurl').value) + '&');
}
} else if (document.getElementById('vurl').value != '') {
if (1 == 1 || eval('' + (document.getElementById('vurl').value).length) < 200) {
return insr.replace('?', '?xfvideo=' + encodeURIComponent(document.getElementById('aurl').value) + '&');
}
}
}
return insr;
}
function hexdec (hexString) { // thanks to https://locutus.io/php/math/hexdec/
// discuss at: https://locutus.io/php/hexdec/
// original by: Philippe Baumann
// example 1: hexdec('that')
// returns 1: 10
// example 2: hexdec('a0')
// returns 2: 160
hexString = (hexString + '').replace(/[^a-f0-9]/gi, '');
return parseInt(hexString, 16);
}
function hex2dec(couleur) { // thanks to http://wikkawiki.org/FpdfIntegration/raw
var dolR = couleur.toLowerCase().replace('#','').substring(0,2);
var dolrouge = hexdec(dolR);
var dolV = couleur.toLowerCase().replace('#','').replace(dolR,'').substring(0,2);
var dolvert = hexdec(dolV);
var dolB = couleur.toLowerCase().replace('#','').replace(dolR,'').replace(dolV,'').substring(0,2);
var dolbleu = hexdec(dolB);
document.getElementById('fred').value='' + dolrouge;
document.getElementById('fgreen').value='' + dolvert;
document.getElementById('fblue').value='' + dolbleu;
tosub='&fred=' + dolrouge + '&fgreen=' + dolvert + '&fblue=' + dolbleu + '&delay=';
document.getElementById('myta').style.color=couleur;
}
function docgetclass(inc, intag) {
if (document.getElementsByClassName) {
return document.getElementsByClassName(inc);
} else {
var ijl;
var anarris=[];
var huhs=document.getElementsByTagName(intag);
for (ijl=0; ijl<huhs.length; ijl++) {
if (huh[ijl].className.indexOf(inc) != -1) {
anarris.push(huhs[ijl]);
}
}
return anarris;
}
}
function lookforinhousestyle() {
var cssis='', findbasis='', findbs=[null], ifb=0, jfb=0, myrect=null, osuffix='', nsuffix=0;
if (document.URL.indexOf('/localhost') != -1) {
mampprefix="http://localhost" + document.URL.split('/localhost')[1].split('/')[0] + "/";
document.getElementById('dif').innerHTML="<iframe onload='oicheck(this);' style='display:none;' src='http://localhost" + document.URL.split('/localhost')[1].split('/')[0] + "/'></iframe>";
}
var bits=(document.head.innerHTML + document.body.innerHTML).split(':and' + 'below');
if (bits.length > 1) {
if ((bits[1].trim() + ' ').substring(0,1) == '{') {
cssis=bits[1].trim().substring(1).split('}')[0] + ' z-index:-20; ';
findbasis=bits[0].split(String.fromCharCode(10))[eval(-1 + bits[0].split(String.fromCharCode(10)).length)].split(' ')[eval(-1 + bits[0].split(String.fromCharCode(10))[eval(-1 + bits[0].split(String.fromCharCode(10)).length)].split(' ').length)].trim();
if ((findbasis.trim() + ' ').substring(0,1) == '.') {
findbs=docgetclass(findbasis.trim().substring(1), '*');
} else if ((findbasis + ' ').substring(0,1) == '#') {
findbs[0]=document.getElementById(findbasis);
} else {
findbs=document.getElementsByTagName(findbasis);
}
for (jfb=0; jfb<findbs.length; jfb++) {
if (findbs[jfb]) {
myrect=findbs[jfb].getBoundingClientRect();
if (document.getElementById('bpalette' + osuffix)) {
nsuffix++;
osuffix='' + nsuffix;
while (document.getElementById('bpalette' + osuffix)) {
nsuffix++;
osuffix='' + nsuffix;
}
}
document.body.innerHTML+='<div id=bpalette' + osuffix + ' style="' + cssis + ' position: absolute; top: ' + ('' + myrect.top).split('.')[0] + 'px;' + 'width: ' + ('' + myrect.width).split('.')[0] + 'px;' + 'left: ' + ('' + myrect.left).split('.')[0] + 'px;' + 'height: calc(100% - ' + ('' + myrect.top).split('.')[0] + 'px); "></div>';
}
}
}
}
}
function waitforalatr() {
if (document.getElementById('iurl').value == '') {
setTimeout(waitforalatr, 2000);
} else {
alatr();
altsubject='My Haiku ...';
var tois='';
attachment='';
if (document.URL.indexOf('/localhost') != -1 || 1 == 1) { // Many email clients do not accept the default Inline HTML Emails here, so to force an HTML Attachment Email that emailee downloads, append space(s) at the end.
tois=prompt('Who do you want to email to? Optionally hashtag (#) separate your own personal subject line to the email (eg. theemail@theemailplace.com#Hello there, it is moi.) Many email clients do not accept the default Inline HTML Emails here, so to force an HTML Attachment Email that emailee downloads, append space(s) at the end.', '');
} else {
tois=prompt('Who do you want to email to? Optionally hashtag (#) separate your own personal subject line to the email (eg. theemail@theemailplace.com#Hello there, it is moi.)', '');
}
if (tois == null) { tois=''; }
if (tois.indexOf('@') != -1) {
if (wois) {
//alert(1);
if (!wois.closed) {
//alert(tois);
document.getElementById('pemail').innerHTML=tois;
wois.document.getElementById('pemail').innerHTML=tois;
setTimeout(elater, 5000); ////wois.emailit();
}
}
if ((tois + '~!$').indexOf(' ~!$') != -1) { attachment='&attachment=true'; tois=tois.trim(); }
var alts=tois.split('#');
if (alts.length > 1) { altsubject=alts[1]; tois=alts[0]; }
//var text=document.getElementById('result').innerHTML;
//document.getElementById('ifem').innerHTML="<iframe onload=checkz(this); src='//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=" + encodeURIComponent(tois) + '&subj=' + thisencodeURIComponent(altsubject) + ' ... ') + '&sliceminusten=' + encodeURIComponent(text.slice(-10)) + "' style=width:500px;height:600px;></iframe>";
zhr = new XMLHttpRequest();
zform=new FormData();
//zform.append('inline', '');
if (attachment == '') {
zform.append('inline', '');
}
zform.append('to', tois);
zform.append('subj', altsubject + ' ... ');
zform.append('tdhuhta', '<html><body>' + document.getElementById('bpalette').innerHTML.replace('<audio ','<audio loop ').replace('<video ','<video loop ').replace('position:absolute;','').replace('left:','margin-left:0.').replace('top:','margin-top:0.') + '</body></html>');
zhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
zhr.send(zform);
document.getElementById('iurl').value='';
alert('Email sent with downloadable HTML attachment.');
}
}
}
function alatr() {
var xrect, it;
var parts=[];
if (document.getElementById('bpalette')) {
//prefix=prefix.replace('bleft=40','bleft=20');
//prefix=prefix.replace('btop=40','btop=20');
//alert(prefix);
xrect=document.getElementById('bpalette').getBoundingClientRect();
if (document.getElementById('vurl').value != '') {
ourmime="";
if (document.getElementById('vmime').value != '') {
ourmime=document.getElementById('vmime').value;
document.getElementById('vmime').value='';
} else if (document.getElementById('vurl').value.indexOf('data:') == 0) {
ourmime=document.getElementById('vurl').value.split('ata:')[1].split(';')[0];
} else {
parts=document.getElementById('vurl').value.split('#')[0].split("."); // used to be a
for (it=0; it<exts.length; it++) {
if ("." + parts[eval(-1 + parts.length)].toLowerCase() == exts[it].toLowerCase()) { ourmime=types[it]; }
}
}
if (document.getElementById('iurl').value != '') {
document.getElementById('bpalette').innerHTML='<video style="position:absolute;left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + xrect.width + 'px;height:' + xrect.height + 'px;background:transparent url(' + "'" + document.getElementById('iurl').value.replace(/\ /g,'+') + "'" + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;" id=myvideo controls autoplay poster="transparent.png"><source src="' + document.getElementById('vurl').value + '" type="' + ourmime + '"></video>';
} else {
document.getElementById('bpalette').innerHTML='<video style="position:absolute;left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + xrect.width + 'px;height:' + xrect.height + 'px;background:transparent url(' + biurl + '?random=' + Math.floor(Math.random() * 198765436) + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;" id=myvideo controls autoplay poster="transparent.png"><source src="' + document.getElementById('vurl').value + '" type="' + ourmime + '"></video>';
}
} else if (document.getElementById('aurl').value != '') {
ourmime="";
if (document.getElementById('amime').value != '') {
ourmime=document.getElementById('amime').value;
document.getElementById('amime').value='';
//alert('Ourmime=' + ourmime);
} else if (document.getElementById('aurl').value.indexOf('data:') == 0) {
ourmime=document.getElementById('aurl').value.split('ata:')[1].split(';')[0];
//alert('OurMime=' + ourmime);
} else {
parts=document.getElementById('aurl').value.split('#')[0].split("."); // used to be v
for (it=0; it<exts.length; it++) {
if ("." + parts[eval(-1 + parts.length)].toLowerCase() == exts[it].toLowerCase()) { ourmime=types[it]; }
}
//alert('ourmime=' + ourmime);
}
if (document.getElementById('iurl').value != '') {
document.getElementById('bpalette').innerHTML='<audio style="position:absolute;left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + xrect.width + 'px;height:' + xrect.height + 'px;background:transparent url(' + "'" + document.getElementById('iurl').value.replace(/\ /g,'+') + "'" + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;" id=myaudio controls autoplay poster="transparent.png"><source src="' + document.getElementById('aurl').value + '" type="' + ourmime + '"></audio>';
} else {
document.getElementById('bpalette').innerHTML='<audio style="position:absolute;left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + xrect.width + 'px;height:' + xrect.height + 'px;background:transparent url(' + biurl + '?random=' + Math.floor(Math.random() * 198765436) + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;" id=myaudio controls autoplay poster="transparent.png"><source src="' + document.getElementById('aurl').value + '" type="' + ourmime + '"></audio>';
try {
if (wois != null && (document.getElementById('vurl').value.indexOf('data:') == 0 || document.getElementById('aurl').value.indexOf('data:') == 0)) {
if (wois.closed) {
wois=null;
} else if (xbiurl != '' && lastbiurl == '') {
wois.focus();
wois.document.getElementById('result').innerHTML=xbiurl;
setTimeout(vlater,3000); //wois.voiceoverit(); // wois.document.getElementById('avideo').click();
lastbiurl=xbiurl;
xbiurl='';
}
}
} catch(eewrt) {
//alert('Email Not Sent as Access was Blocked.');
}
}
} else {
document.getElementById('bpalette').style.background="URL('" + biurl + '?random=' + Math.floor(Math.random() * 198765436) + "') no-repeat";
document.getElementById('bpalette').style.backgroundSize='contain';
try {
if (wois != null && (document.getElementById('vurl').value.indexOf('data:') == 0 || document.getElementById('aurl').value.indexOf('data:') == 0)) {
if (wois.closed) {
wois=null;
} else if (xbiurl != '' && lastbiurl == '') {
wois.focus();
wois.document.getElementById('result').innerHTML=xbiurl;
setTimeout(vlater,3000); //wois.voiceoverit(); // wois.document.getElementById('avideo').click();
lastbiurl=xbiurl;
xbiurl='';
}
}
} catch(eewrt) {
//alert('Email Not Sent as Access was Blocked.');
}
}
} else {
document.getElementById('xbody').style.background="URL('" + biurl + '?random=' + Math.floor(Math.random() * 198765436) + "') no-repeat";
document.getElementById('xbody').style.backgroundSize='contain';
try {
if (wois != null && (document.getElementById('vurl').value.indexOf('data:') == 0 || document.getElementById('aurl').value.indexOf('data:') == 0)) {
if (wois.closed) {
wois=null;
} else if (xbiurl != '' && lastbiurl == '') {
wois.focus();
wois.document.getElementById('result').innerHTML=xbiurl;
setTimeout(vlater,3000); //wois.voiceoverit(); // wois.document.getElementById('avideo').click();
lastbiurl=xbiurl;
xbiurl='';
}
}
} catch(eewrt) {
//alert('Email Not Sent as Access was Blocked.');
}
}
//alert(biurl);
//biurl='';
}
function ourencodeURIComponent(inx) {
return inx;
}
function dummyencodeURIComponent(inz) {
return inz;
}
function createbi(tav) {
var suffix='&slideshow=' + ourencodeURIComponent('~~'), delim='', nextnum=2, sofar='';
if (tav.trim() != '') {
valid=true;
var lines=tav.split(String.fromCharCode(10));
//alert(lines.length);
for (var ilines=0; ilines<lines.length; ilines++) {
suffix+=delim + encodeURIComponent(lines[ilines]);
sofar+=encodeURIComponent(lines[ilines]) + ourencodeURIComponent('~')
delim='&slideshow' + nextnum + '=' + sofar;
nextnum++;
}
suffix=suffix.replace(/\=/g, '=' + encodeURIComponent(document.getElementById('burl').value + '#')); //.replace(/\`/g, '=');
//alert('http://localhost:8888/Htdocs/PHP/animegif/tutorial_to_animated_gif.php' + prefix + suffix);
//alert(prefix.replace(fromsub,tosub));
if (document.getElementById('bdelay').value != '') {
document.getElementById('agc').src=postagc('./tutorial_to_animated_gif.php' + vaprefix(prefix).replace(fromsub,tosub).split('delay=')[0] + 'delay=' + encodeURIComponent(document.getElementById('bdelay').value) + suffix);
document.getElementById('aemail').href='mailto:?subject=My%20Haiku%20...%20shared%20with%20you%20...&body=' + encodeURIComponent(document.URL.split('/haiku_')[0] + '/tutorial_to_animated_gif.php' + vaprefix(prefix).replace(fromsub,tosub).replace('fleft=40','fleft=20').replace('ftop=40','ftop=20').split('delay=')[0] + 'delay=' + encodeURIComponent(document.getElementById('bdelay').value) + suffix + ' and to return the favour use ' + document.URL.split('?')[0].split('#')[0]);
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('asms').href='sms:&body=' + dummyencodeURIComponent(encodeURIComponent('My Haiku am sharing with you ... ') + encodeURIComponent(document.URL.split('/haiku_')[0] + '/tutorial_to_animated_gif.php' + vaprefix(prefix).replace(fromsub,tosub).replace('fleft=40','fleft=20').replace('ftop=40','ftop=20').split('delay=')[0] + 'delay=' + encodeURIComponent(document.getElementById('bdelay').value) + suffix.replace(/\~\~/g,encodeURIComponent('~~')).replace(/\~/g,encodeURIComponent('~'))) + '#' + encodeURIComponent(' and to return the favour use ' + String.fromCharCode(10) + document.URL.split('?')[0].split('#')[0]));
} else {
document.getElementById('asms').href='sms:&body=' + encodeURIComponent(encodeURIComponent('My Haiku am sharing with you ... ') + encodeURIComponent(document.URL.split('/haiku_')[0] + '/tutorial_to_animated_gif.php' + vaprefix(prefix).replace(fromsub,tosub).replace('fleft=40','fleft=20').replace('ftop=40','ftop=20').split('delay=')[0] + 'delay=' + encodeURIComponent(document.getElementById('bdelay').value) + suffix.replace(/\~\~/g,encodeURIComponent('~~')).replace(/\~/g,encodeURIComponent('~'))) + '#' + encodeURIComponent(' and to return the favour use ' + String.fromCharCode(10) + document.URL.split('?')[0].split('#')[0]));
}
if (1 == 1 && document.getElementById('thisaudio')) { document.getElementById('thisaudio').muted=true; document.getElementById('thisaudio').play(); }
} else {
document.getElementById('agc').src=postagc('./tutorial_to_animated_gif.php' + vaprefix(prefix).replace(fromsub,tosub) + suffix);
document.getElementById('aemail').href='mailto:?subject=My%20Haiku%20...%20shared%20with%20you%20...&body=' + encodeURIComponent(document.URL.split('/haiku_')[0] + '/tutorial_to_animated_gif.php' + vaprefix(prefix).replace(fromsub,tosub).replace('fleft=40','fleft=20').replace('ftop=40','ftop=20') + suffix + ' and to return the favour use ' + document.URL.split('?')[0].split('#')[0]);
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('asms').href='sms:&body=' + dummyencodeURIComponent(encodeURIComponent('My Haiku am sharing with you ... ') + encodeURIComponent(document.URL.split('/haiku_')[0] + '/tutorial_to_animated_gif.php' + vaprefix(prefix).replace(fromsub,tosub).replace('fleft=40','fleft=20').replace('ftop=40','ftop=20') + suffix.replace(/\~\~/g,encodeURIComponent('~~')).replace(/\~/g,encodeURIComponent('~'))) + '#' + encodeURIComponent(' and to return the favour use ' + String.fromCharCode(10) + document.URL.split('?')[0].split('#')[0]));
} else {
document.getElementById('asms').href='sms:&body=' + encodeURIComponent(encodeURIComponent('My Haiku am sharing with you ... ') + encodeURIComponent(document.URL.split('/haiku_')[0] + '/tutorial_to_animated_gif.php' + vaprefix(prefix).replace(fromsub,tosub).replace('fleft=40','fleft=20').replace('ftop=40','ftop=20') + suffix.replace(/\~\~/g,encodeURIComponent('~~')).replace(/\~/g,encodeURIComponent('~'))) + '#' + encodeURIComponent(' and to return the favour use ' + String.fromCharCode(10) + document.URL.split('?')[0].split('#')[0]));
}
if (1 == 1 && document.getElementById('thisaudio')) { document.getElementById('thisaudio').muted=true; document.getElementById('thisaudio').play(); }
}
//alert(1);
document.getElementById('bemail').style.display='inline-block';
document.getElementById('bsms').style.display='inline-block';
//alert(2);
}
}
function thegifnamegoesherelistener() {
var xrect, it, eewrt;
var parts=[];
//biurl='';
if (document.getElementById('aurl').value != '') {
if (document.getElementById('aurl').value != lastaurl) {
lastaurl=document.getElementById('aurl').value;
try {
if (wois != null && (document.getElementById('vurl').value.indexOf('data:') == 0 || document.getElementById('aurl').value.indexOf('data:') == 0)) {
if (wois.closed) {
wois=null;
} else {
wois.focus();
if (document.getElementById('aurl').value.indexOf('data:') == 0) {
wois.document.getElementById('result').innerHTML=document.getElementById('aurl').value;
} else if (document.getElementById('vurl').value.indexOf('data:') == 0) {
wois.document.getElementById('result').innerHTML=document.getElementById('vurl').value;
}
setTimeout(vlater,3000); //wois.voiceoverit(); // wois.document.getElementById('avideo').click();
}
}
} catch(eewrt) {
//alert('Email Not Sent as Access was Blocked.');
}
}
} else if (document.getElementById('vurl').value != '') {
if (document.getElementById('vurl').value != lastvurl) {
lastvurl=document.getElementById('vurl').value;
try {
if (wois != null && (document.getElementById('vurl').value.indexOf('data:') == 0 || document.getElementById('aurl').value.indexOf('data:') == 0)) {
if (wois.closed) {
wois=null;
} else {
wois.focus();
if (document.getElementById('vurl').value.indexOf('data:') == 0) {
wois.document.getElementById('result').innerHTML=document.getElementById('vurl').value;
} else if (document.getElementById('aurl').value.indexOf('data:') == 0) {
wois.document.getElementById('result').innerHTML=document.getElementById('aurl').value;
}
setTimeout(vlater,3000); //wois.voiceoverit(); // wois.document.getElementById('avideo').click();
}
}
} catch(eewrt) {
//alert('Email Not Sent as Access was Blocked.');
}
}
}
if (document.getElementById('thegifnamegoeshere').value != '') {
xbiurl=document.getElementById('thegifnamegoeshere').value;
biurl=document.getElementById('thegifnamegoeshere').value.replace('//www.rjmprogramming.com.au/PHP/animegif/','./');
document.getElementById('thegifnamegoeshere').value='';
if (valid) {
if (1 == 1) {
//document.getElementById('pagc').src=biurl.replace('.gif', '_preview.php?random=' + Math.floor(Math.random() * 198765436));
//alert(biurl);
setTimeout(alatr, 3000);
} else {
if (document.getElementById('bpalette')) {
xrect=document.getElementById('bpalette').getBoundingClientRect();
if (document.getElementById('vurl').value != '') {
ourmime="";
if (document.getElementById('vmime').value != '') {
ourmime=document.getElementById('vmime').value;
document.getElementById('vmime').value='';
} else {
parts=document.getElementById('aurl').value.split('#')[0].split(".")
for (it=0; it<exts.length; it++) {
if ("." + parts[eval(-1 + parts.length)].toLowerCase() == exts[it].toLowerCase()) { ourmime=types[it]; }
}
}
document.getElementById('bpalette').innerHTML='<video style="position:absolute;left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + xrect.width + 'px;height:' + xrect.height + 'px;background:transparent url(' + biurl + '?random=' + Math.floor(Math.random() * 198765436) + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;" id=myvideo controls autoplay poster="transparent.png"><source src="' + document.getElementById('vurl').value + '" type="' + ourmime + '"></video>';
} else if (document.getElementById('aurl').value != '') {
ourmime="";
if (document.getElementById('amime').value != '') {
ourmime=document.getElementById('amime').value;
document.getElementById('amime').value='';
} else {
parts=document.getElementById('vurl').value.split('#')[0].split(".")
for (it=0; it<exts.length; it++) {
if ("." + parts[eval(-1 + parts.length)].toLowerCase() == exts[it].toLowerCase()) { ourmime=types[it]; }
}
}
document.getElementById('bpalette').innerHTML='<audio style="position:absolute;left:' + xrect.left + 'px;top:' + xrect.top + 'px;width:' + xrect.width + 'px;height:' + xrect.height + 'px;background:transparent url(' + biurl + '?random=' + Math.floor(Math.random() * 198765436) + ') no-repeat 0 0;-webkit-background-size:contain; -moz-background-size:contain; -o-background-size:contain; background-size:contain;" id=myaudio controls autoplay poster="transparent.png"><source src="' + document.getElementById('aurl').value + '" type="' + ourmime + '"></audio>';
} else {
document.getElementById('bpalette').style.background="URL('" + biurl + '?random=' + Math.floor(Math.random() * 198765436) + "') no-repeat";
document.getElementById('bpalette').style.backgroundSize='contain';
}
} else {
document.getElementById('xbody').style.background="URL('" + biurl + '?random=' + Math.floor(Math.random() * 198765436) + "') no-repeat";
document.getElementById('xbody').style.backgroundSize='contain';
}
}
valid=false;
}
}
setTimeout(thegifnamegoesherelistener,1000);
}
function afto() {
document.getElementById('myta').style.background="URL('" + inbivalue + '?random=' + Math.floor(Math.random() * 198765436) + "') no-repeat";
document.getElementById('myta').style.backgroundSize='cover';
setTimeout(afto, 2000);
}
function ctab(inbi) {
if (inbi.value.trim() == '') {
inbi.value='./white.jpg';
}
if (inbivalue == '') { setTimeout(afto, 2000); }
inbivalue=inbi.value;
document.getElementById('myta').style.background="URL('" + inbi.value + '?random=' + Math.floor(Math.random() * 198765436) + "') no-repeat";
document.getElementById('myta').style.backgroundSize='cover';
if (inbivalue.indexOf('data:') != 0) {
if (inbivalue != '' && inbivalue.toLowerCase().indexOf('http') != 0 && inbivalue.toLowerCase().indexOf('//') != 0 && inbivalue.toLowerCase().indexOf('www.') != 0) {
document.getElementById('pagc').src=inbivalue;
}
}
}
function atab(inbi) {
//alert(0);
ainbivalue=inbi.value;
if (ainbivalue.indexOf('data:') == 0) {
//alert(10);
document.getElementById('amime').value=ainbivalue.split('ata:')[1].split(';')[0];
//alert(20);
} else {
document.getElementById('apagc').src=ainbivalue;
}
}
function vtab(inbi) {
vinbivalue=inbi.value;
if (vinbivalue.indexOf('data:') == 0) {
document.getElementById('vmime').value=vinbivalue.split('ata:')[1].split(';')[0];
} else {
document.getElementById('vpagc').src=vinbivalue;
}
}
function imgthere(iois) {
var ee, eee, isthere=false, str="";
try {
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
try {
str=aconto.body.innerHTML;
if (str.length > 0) {
if (str.toLowerCase().indexOf(">not found<") == -1 && str.toLowerCase().indexOf("our home page for your perusal") == -1) isthere=true;
}
} catch (ee) { }
}
}
}
} catch (eee) { }
return isthere;
}
function trymamp() {
var lft="100";
if (('' + screen.width) != '') {
lft=Math.max(0,eval(eval('' + screen.width) - 900));
}
if (mampok) {
if (wois) { wois.close(); wois=null; }
wois=window.open(mampprefix + "macos_say_record.php?saythis=" + encodeURIComponent(document.getElementById('myta').value),"_blank","top=140,left=" +lft + ",width=900,height=720");
} else {
wois=window.open(document.URL.split('//')[0] + "//www.rjmprogramming.com.au/" + "macos_say_record.php?saythis=" + encodeURIComponent(document.getElementById('myta').value),"_blank","top=140,left=" + lft + ",width=900,height=720");
}
}
function oicheck(iois) {
mampok=false;
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
if (aconto.body.innerHTML.toLowerCase().indexOf('>not found<') == -1 && aconto.body.innerHTML.toLowerCase().indexOf("our home page for your perusal") == -1) { mampok=true; }
}
}
}
}
function showStuff(evt) {
var ewrt;
//document.title+=' ' + zhr.readyState;
if (zhr.readyState == 4) {
//document.title+=':' + zhr.status;
if (zhr.status == 200) {
if (zhr.responseText.trim() == '') { alert('Email sent with downloadable HTML attachment.'); } else { alert(zhr.responseText.split('</')[0].split('>')[eval(-1 + zhr.responseText.split('</')[0].split('>').length)]); }
} else if (zhr.status == 0) {
try {
if (wois != null && (document.getElementById('vurl').value.indexOf('data:') == 0 || document.getElementById('aurl').value.indexOf('data:') == 0)) {
if (wois.closed) {
wois=null;
} else {
wois.focus();
if (document.getElementById('aurl').value.indexOf('data:') == 0 && wois.document.getElementById('result').innerHTML != document.getElementById('aurl').value) {
wois.document.getElementById('result').innerHTML=document.getElementById('aurl').value;
} else if (document.getElementById('vurl').value.indexOf('data:') == 0 && wois.document.getElementById('result').innerHTML != document.getElementById('vurl').value) {
wois.document.getElementById('result').innerHTML=document.getElementById('vurl').value;
}
setTimeout(vlater,3000); //wois.voiceoverit(); // wois.document.getElementById('avideo').click();
}
} else {
alert('Email not sent as access was blocked.');
}
} catch(ewrt) {
alert('Email Not Sent as Access was Blocked.');
}
}
}
}
function comingsoon() {
//alert(1);
var ezhr;
if (!document.getElementById('bpalette')) {
document.getElementById('dif').innerHTML+='<div id=bpalette style=display:none;></div>';
//alert(11);
}
//alert(111);
if (document.getElementById('iurl').value == '') {
waitforalatr();
} else {
alatr();
//alert(document.getElementById('bpalette').innerHTML);
altsubject='My Haiku ...';
var tois='';
attachment='';
if (document.URL.indexOf('/localhost') != -1 || 1 == 1) { // Many email clients do not accept the default Inline HTML Emails here, so to force an HTML Attachment Email that emailee downloads, append space(s) at the end.
tois=prompt('Who do you want to email to? Optionally hashtag (#) separate your own personal subject line to the email (eg. theemail@theemailplace.com#Hello there, it is moi.) Many email clients do not accept the default Inline HTML Emails here, so to force an HTML Attachment Email that emailee downloads, append space(s) at the end.', '');
} else {
tois=prompt('Who do you want to email to? Optionally hashtag (#) separate your own personal subject line to the email (eg. theemail@theemailplace.com#Hello there, it is moi.)', '');
}
if (tois == null) { tois=''; }
if (tois.indexOf('@') != -1) {
if (wois) {
//alert(11);
if (!wois.closed) {
//alert(tois);
document.getElementById('pemail').innerHTML=tois;
wois.document.getElementById('pemail').innerHTML=tois;
setTimeout(elater, 5000); //wois.emailit();
}
}
if ((tois + '~!$').indexOf(' ~!$') != -1) { attachment='&attachment=true'; tois=tois.trim(); }
var alts=tois.split('#');
if (alts.length > 1) { altsubject=alts[1]; tois=alts[0]; }
//var text=document.getElementById('result').innerHTML;
//document.getElementById('ifem').innerHTML="<iframe onload=checkz(this); src='//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php?to=" + encodeURIComponent(tois) + '&subj=' + thisencodeURIComponent(altsubject) + ' ... ') + '&sliceminusten=' + encodeURIComponent(text.slice(-10)) + "' style=width:500px;height:600px;></iframe>";
zhr = new XMLHttpRequest();
zform=new FormData();
//zform.append('inline', '');
if (attachment == '') {
zform.append('inline', '');
}
zform.append('to', tois);
zform.append('subj', altsubject + ' ... ');
//alert('' + document.getElementById('bpalette').innerHTML.split('#').length + ' (hash count + 1) ' + document.getElementById('bpalette').innerHTML.split('data:').length + ' ... ' + document.getElementById('bpalette').innerHTML.split('data:')[1].substring(0,50) + ' ... ' + document.getElementById('bpalette').innerHTML.split('data:')[2].substring(0,50) + ' ... ' + document.getElementById('bpalette').innerHTML.slice(-350));
zform.append('tdhuhta', '<html><body>' + document.getElementById('bpalette').innerHTML.replace('<audio ','<audio loop ').replace('<video ','<video loop ').replace('position:absolute;','').replace('left:','margin-left:0.').replace('top:','margin-top:0.') + '</body></html>');
zhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
zhr.onreadystatechange = showStuff;
//document.title='';
try {
zhr.send(zform);
} catch(ezhr) {
alert('Email not sent.');
}
document.getElementById('iurl').value='';
//alert('Email sent with downloadable HTML attachment.');
}
}
}
function elater() {
if (1 == 1) { wois.emailit(); }
}
function vlater() {
wois.voiceoverit();
}
</script>
</head>
<body onload="if (1 == 1) { lookforinhousestyle(); } setTimeout(thegifnamegoesherelistener,1000); " id=xbody style='width:100%;height:100vh;'>
<h1>Haiku Animated GIF Creator</h1>
<h3>RJM Programming - June, 2020</h3>
<table style='width:98%;'><tr><td>
<textarea onblur="if (this.value != '') { trymamp(); }" rows=10 cols=120 id=myta style="width:80%;font-size:24px;color:red;background:URL('./white.jpg');"></textarea></td><td>
Background URL <input onblur='ctab(this);' type='text' id=burl value='./white.jpg' style='inline-block;'></input><br>
Delay <input type='text' id=bdelay placeholder='400,400,400' value='' style='inline-block;'></input><br>
Fontname <input onblur="prefix=prefix.replace(prevfontname,encodeURIComponent(this.value)); prevfontname=encodeURIComponent(this.value);" type='text' id=bfontname value='Arial' style='inline-block;'></input><br>
Font Size <input onchange="document.getElementById('myta').style.fontSize='' + this.value + 'px'; prefix=prefix.replace(prevsize + 'px',encodeURIComponent(this.value + 'px')); prevsize=encodeURIComponent(this.value);" onblur="document.getElementById('myta').style.fontSize='' + this.value + 'px'; prefix=prefix.replace(prevsize + 'px',encodeURIComponent(this.value + 'px')); prevsize=encodeURIComponent(this.value);" type='number' id=bsize value='24' style='inline-block;'></input>px<br>
Font Colour <input onchange="if (this.value.replace('#ff0000','red') != '') { hex2dec(this.value); }" onblur="if (this.value.replace('#ff0000','red') != '') { hex2dec(this.value); }" type='color' id=bcolour value='#ff0000' style='inline-block;'></input><br>
... optional ... <div style='display:inline-block;width:96px;height:30px;overflow:hidden;vertical-align:text-bottom;' data-style='border-top:1px solid black;border-bottom:1px solid black;border-left:2px solid yellow;border-right:1px solid yellow;'><iframe frameborder=0 style='border-left:1px solid black;border-right:1px solid black;width:173px;height:228px;margin-top:-194px;' src='../../../HTMLCSS/client_browsing.htm?d=" . rand(0,18765432) . "'></iframe></div><br>
<input type=hidden id=iurl value=''></input>Audio URL <input onblur='atab(this);' type='text' id=aurl value='' style='inline-block;'></input><input type=hidden id=amime value=''></input><br>
Video URL <input onblur='vtab(this);' type='text' id=vurl value='' style='inline-block;'></input><input type=hidden id=vmime value=''></input><br>
<input name=fred id=fred value='255' type=hidden></input><input name=fgreen id=fgreen value='0' type=hidden></input><input name=fblue id=fblue value='0' type=hidden></input>
</td></tr>
</table>
<br>
<!--form-->
<input type=hidden id=thegifnamegoeshere name=thegifnamegoeshere value=''></input>
<input style='background-color:yellow;' type=button onclick="createbi(document.getElementById('myta').value);" value="Create Haiku Animated GIF"></input> <input style="display:none;background-color:yellow;" id=bemail type=button onclick="if (document.getElementById('thisaudio') || document.getElementById('aurl').value.indexOf('data:') == 0 || document.getElementById('vurl').value.indexOf('data:') == 0) { comingsoon(); } else { document.getElementById('aemail').click(); } " value="Email Link for Last Haiku"></input> <input style="display:none;background-color:yellow;" id=bsms type=button onclick="var smsee=prompt('SMS to?',''); if (smsee != null) { if (smsee != '') { document.getElementById('asms').href=document.getElementById('asms').href.replace(':&',':' + smsee + '&'); document.getElementById('asms').click(); } }" value="SMS Link for Last Haiku"></input> <div id=daudio style=display:inline-block;></div>
<hr class=hrcolbelow><br>
<!--/form-->
<a id=aemail href='mailto:?subject=My%20Haiku%20...%20shared%20with%20you%20...&body=' style='display:none;'>Email</a>
<a id=asms href='sms:&body=' style='display:none;'>SMS</a>
<iframe style='display:none;' src='./tutorial_to_animated_gif.php' id=agc name=argc></iframe>
<iframe onload="if (imgthere(this)) { prevburl=document.getElementById('burl').value; } else { document.getElementById('burl').value=prevburl; inbivalue=prevburl; } " onerror="document.getElementById('burl').value=prevburl;" style='display:none;' src='./tutorial_to_animated_gif.php' id=pagc></iframe>
<iframe onload="if (imgthere(this)) { prevaurl=document.getElementById('aurl').value; } else { document.getElementById('aurl').value=prevaurl; ainbivalue=prevaurl; } " onerror="document.getElementById('aurl').value=prevaurl;" style='display:none;' src='./tutorial_to_animated_gif.php' id=apagc></iframe>
<iframe onload="if (imgthere(this)) { prevvurl=document.getElementById('vurl').value; } else { document.getElementById('vurl').value=prevvurl; vinbivalue=prevvurl; } " onerror="document.getElementById('vurl').value=prevvurl;" style='display:none;' src='./tutorial_to_animated_gif.php' id=vpagc></iframe>
<input type=text style='position:absolute;left:-200px;top:-200px;' value=''></input>
<div id=dform></div>
<div id=dif></div>
<div id=pemail style=display:none;></div>
</body>
</html>