' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . 'my-colour-wheel.gv.' . $fmt . ' ';
$abl=['my_colour_wheel','YoumightfindmeOne','YoumightfindmeTwo','YoumightfindmeThree,YoumightfindmeZeroThree'];
$abl=['my_colour_wheel','YoumightfindmeOne=YounowfindmeOne','YoumightfindmeTwo=YounowfindmeTwo','YoumightfindmeThree=YounowfindmeThree,YoumightfindmeZeroThree=YounowfindmeZeroThree'];
$newabl=['my-colour-wheel','YoumightfindmeOne=YounowfindmeOne','YoumightfindmeTwo=YounowfindmeTwo','YoumightfindmeThree=YounowfindmeThree,YoumightfindmeZeroThree=YounowfindmeZeroThree'];
$tprefix='/tmp/';
$prefix='';
$suffix='';
$plus='-';
$minus='-';
$plus='-';
$minus='-';
$yes='n';
$mode='Graph';
$shape='';
$fsize='';
$bcol='lightblue2';
$bbcol='#aed8e8';
$newt='';
$newablzero='My%20Colour%20Wheel';
$outfn='';
$gv='.gv.';
$none='none';
$addimg='';
$suffile='';
if (isset($_POST['newablzero']) && isset($_POST['infile'])) {
$sg='';
$infis=str_replace('+',' ',urldecode($_POST['infile']));
if (file_exists($infis)) {
if (strpos($infis, 'doctest-output') !== false) {
$suffile='/doctest-output' . explode('doctest-output', $infis)[1];
if (strlen($_POST['newablzero']) > 0) {
//file_put_contents('x1.x1', '' . strlen($_POST['newablzero']));
$excont=file_get_contents($infis);
//file_put_contents('x11.x11', '' . strlen($excont));
if (strpos($excont, '') !== false) {
if (strpos($excont, '') !== false) {
$sgs=explode('', $excont);
$sg='' . $sgs[-1 + sizeof($sgs)];
}
//file_put_contents('x111.x111', '' . strlen($excont));
$newcont=plusdata(str_replace('+',' ',urldecode($_POST['newablzero'])));
//file_put_contents('x1111.x1111', '' . strlen($newcont));
if (strpos($excont, $newcont) === false) {
//file_put_contents('x11111.x11111', '' . strlen($newcont));
$newercont=str_replace($sg, $newcont . $sg, $excont);
//file_put_contents('x111111.x111111', '' . strlen($newercont));
$outfis=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('doctestoutput','doctest-output',str_replace('-','',$infis));
file_put_contents($outfis, $newercont);
//file_put_contents('x1111112.x1111112', '' . strlen($newercont) . ' vs ' . $outfis . ' ' . strlen(file_get_contents($outfis)));
echo "
";
exit;
}
}
} else {
$excont=file_get_contents($infis);
$outfis=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('doctestoutput','doctest-output',str_replace('-','',$infis));
file_put_contents($outfis, $excont);
echo "";
exit;
}
}
}
exit;
}
function plusdata($aig) {
$outig=$aig;
$dlm='"';
$outgs=explode('data:', $aig);
if (sizeof($outgs) > 1) {
$outig=$outgs[0];
$dlm=substr($outig,-1,1);
for ($iop=1; $iopBox
");
$pyprefix='';
$pymidbit='';
$pysuffix='';
function server_remote_addr() {
$rma = $_SERVER['REMOTE_ADDR'];
return str_replace('.','_',$rma);
}
if (!isset($_POST['one']) && !isset($_POST['two']) && !isset($_POST['three']) && !isset($_POST['original'])) {
$yes='y';
$newabl[1]='';
$newabl[2]='';
$newabl[3]='';
$_POST['one']=$newabl[1];
$_POST['two']=$newabl[2];
$_POST['three']=$newabl[3];
} else {
$none='inline-block';
$plus='+';
$minus='-';
}
if (strpos($newabl[0], 'heel') !== false) {
$parts=explode('-',str_replace('_','-',$newabl[0]));
$newt='';
for ($iy=0; $iy ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . 'my-colour-wheel.gv.' . $fmt . ' ';
} else if (!isset($_POST['original'])) {
$_POST['fmt']='svg';
}
if (isset($_POST['title'])) {
$newabl[0]=trim(str_replace('+',' ',urldecode($_POST['title'])));
$newablzero=str_replace('+','%20',urlencode($newabl[0]));
$switch=' -T' . $fmt . ' ';
$codeafters=' > ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . $newablzero . '.gv.' . $fmt . ' ';
} else if (!isset($_POST['original'])) {
$_POST['title']=$newabl[0];
}
if (isset($_POST['addimg'])) {
$addimg=plusdata(str_replace('+',' ',urldecode($_POST['addimg'])));
} else if (!isset($_POST['original'])) {
$_POST['addimg']='';
}
if (isset($_POST['mode'])) {
$mode=trim(str_replace('+',' ',urldecode($_POST['mode'])));
} else if (!isset($_POST['original'])) {
$_POST['mode']='Graph';
}
if (isset($_POST['back'])) {
$bcol=trim(str_replace('+',' ',urldecode($_POST['back'])));
if (strlen($bcol) == 6) { $bcol='#' . trim(str_replace('+',' ',urldecode($_POST['back']))); $bbcol=$bcol; } else if (strlen($bcol) == 7) { $bbcol=$bcol; }
} else if (!isset($_POST['original'])) {
$_POST['back']='lightblue2';
}
if (isset($_POST['shape'])) {
$shape=trim(str_replace('+',' ',urldecode($_POST['shape'])));
} else if (!isset($_POST['original'])) {
$_POST['shape']='';
}
if (isset($_POST['fsize'])) {
$fsize=trim(str_replace('+',' ',urldecode($_POST['fsize'])));
} else if (!isset($_POST['original'])) {
$_POST['fsize']='';
}
if (isset($_POST['one']) && isset($_POST['two']) && isset($_POST['three'])) {
$prefix=$_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR; //'/tmp/';
$newabl[1]=str_replace('+',' ',urldecode(str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['one']))));
$newabl[2]=str_replace('+',' ',urldecode(str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['two']))));
$newabl[3]=str_replace('+',' ',urldecode(str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['three']))));
$pycont=file_get_contents('./colour_wheel.' . $codeext);
if (trim($newt) != '') {
$newablzero=str_replace('+','%20',urlencode(trim($newt)));
$pycont=str_replace("My Colour Wheel", trim($newt), $pycont);
}
if (strpos($pycont, 'u=u') !== false) {
$pyprefix=explode('u.edge(', $pycont)[0];
$pysuffix='' . explode('u=u', $pycont)[1];
//$pysuffix='' . explode('u.view()', $pycont)[1];
$pycont=$pyprefix . "\n\n" . $pysuffix;
} else if (strpos($pycont, 'u.view()') !== false) {
$pyprefix=explode('u.edge(', $pycont)[0];
$pysuffix='u.view()' . explode('u.view()', $pycont)[1];
//$pysuffix='' . explode('u.view()', $pycont)[1];
$pycont=$pyprefix . "\n\n" . $pysuffix;
}
if ($bcol != 'lightblue2' && trim($bcol) != '') {
$pycont=str_replace('lightblue2', $bcol, $pycont);
}
if ($shape != '') {
$pycont=str_replace("shape = circle", "shape = " . $shape . "", $pycont);
}
if ($fsize != '') {
$pycont=str_replace("fontsize = 10]", "fontsize = " . (explode(',',$fsize)[0] == '' ? '10' : explode(',',$fsize)[0]) . "]", $pycont);
if (strpos($fsize, ',') !== false) {
$pycont=str_replace("fontsize = 20]", "fontsize = " . (explode(',',$fsize)[1] == '' ? '20' : explode(',',$fsize)[1]) . "]", $pycont);
}
}
//$xone=str_replace("\t","+", str_replace('~','', str_replace('+',' ',str_replace('+|','`|',str_replace('+;','`;',str_replace('+;','`;',str_replace('+,','`,',urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['one'])) . urlencode('~'))) ))) )));
//$xtwo=str_replace("\t","+", str_replace('~','', str_replace('+',' ',str_replace('+|','`|',str_replace('+;','`;',str_replace('+;','`;',str_replace('+,','`,',urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['two'])) . urlencode('~'))) ))) )));
//$xthree=str_replace("\t","+", str_replace('~','', str_replace('+',' ',str_replace('+|','`|',str_replace('+;','`;',str_replace('+;','`;',str_replace('+,','`,',urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['three'])) . urlencode('~'))) ))) )));
//$xone=str_replace("\t","+", str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['one']))))));
//$xtwo=str_replace("\t","+", str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['two']))))));
//$xthree=str_replace("\t","+", str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['three']))))));
$xone=str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['one'])))));
$xtwo=str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['two'])))));
$xthree=str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['three'])))));
if (strpos($xone, ',') !== false) {
$xsone=explode(',', $xone);
for ($iij=0; $iij> " . $prefix . "colour_wheel.bad \nln -s " . $prefix . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf \nrm -f " . $prefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " \nrm -f " . $prefix . "colour_wheel_" . $suffix . ".ksh \nexit");
file_put_contents($prefix . 'colour_wheel_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "colour_wheel.bad \nsleep 5\n\n/usr/bin/" .$verb . $switch . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "colour_wheel.bad \n\nrm -f " . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . " \nrm -f " . $prefix . "colour_wheel_" . $suffix . ".ksh \nexit");
file_put_contents($prefix . 'colour_wheel0_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "colour_wheel.bad \nsleep 5\n\n/usr/bin/" .$verb . $switch . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "colour_wheel.bad \n\nrm -f " . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . " \nrm -f " . $prefix . "colour_wheel_" . $suffix . ".ksh \nexit");
exec('chmod 777 ' . $prefix . 'colour_wheel_' . $suffix . '.ksh');
exec('chown root ' . $prefix . 'colour_wheel_' . $suffix . '.ksh');
exec('chgrp root ' . $prefix . 'colour_wheel_' . $suffix . '.ksh');
while (file_exists($prefix . 'colour_wheel_' . $suffix . '.ksh')) {
sleep(10);
}
} else {
file_put_contents('/tmp/colour_wheel.' . $codeext, $pycont);
exec('chmod 777 ' . '/tmp/colour_wheel.' . $codeext);
exec('chown rjmprogr ' .'/tmp/colour_wheel.' . $codeext);
exec('chgrp rjmprogr ' . '/tmp/colour_wheel.' . $codeext);
//if (file_exists('doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.' . $fmt)) {
//exec('rm -f ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.' . $fmt);
//exec('rm -f ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv');
//unlink('doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.' . $fmt);
//unlink('doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv');
//}
//file_put_contents('x.x', '/usr/bin/' .$verb . $switch . '/tmp/colour_wheel.' . $codeext . $codeafters . ' 2> colour_wheel.bad');
exec('/usr/bin/' .$verb . $switch . '/tmp/colour_wheel.' . $codeext . $codeafters . ' 2> colour_wheel.bad');
sleep(8);
//if (file_exists($prefix . 'doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.pdf')) {
//exec('ln -s ' . $prefix . 'doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.pdf ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.pdf');
//}
}
} else {
//file_put_contents('xx.xx', '/usr/bin/' . $verb . $switch . ' colour_wheel.' . $codeext . $codeafters);
exec('/usr/bin/' . $verb . $switch . ' colour_wheel.' . $codeext . $codeafters);
sleep(8);
}
if (ourfile_exists($prefix . 'doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.' . $fmt)) {
exec('chmod 777 ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . $gv . $fmt);
exec('chmod 777 ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv');
exec('chown rjmprogr ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . $gv . $fmt);
exec('chown rjmprogr ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv');
exec('chgrp rjmprogr ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . $gv . $fmt);
exec('chgrp rjmprogr ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv');
echo "
Trying out Dot GraphViz hosted in PHP - RJM Programming - October, 2024 - Colour Wheel
var lasturl='', lasttext=null, gzero=null, lastx=0, lasty=0, lastw=0, lasth=0, lastp='', lastwoo=null, lastj=0, lssel='', zerodotsix='0.6', bconto=null, lastiurl='', szero=null, aimg='', lastimgc='', lastsvggeo=null, uselast=false;
String.prototype.toHtmlEntities = function() {
return this.replace(/./gm, function(s) {
return (s.match(/[a-z0-9\s]+/i)) ? s : '' + s.charCodeAt(0) + ';';
});
};
function plusdata(aig) {
var outig=aig, dlm='\"';
var outgs=aig.split('data:');
if (eval('' + outgs.length) > 1) {
outig=outgs[0];
dlm=outig.slice(-1);
for (var iop=1; iop') != -1) {
toe=prompt('Please enter email address or SMS number to share ' + document.getElementById('sells').innerHTML.split(inu + '\">')[1].split('<')[0].replace('Email or SMS ','') + ' with.', '');
} else {
toe=prompt('Please enter email address or SMS number to share with.', '');
}
if (toe == null) { toe=''; }
if (toe.indexOf('@') != -1) {
if (document.getElementById('sells').innerHTML.indexOf(inu + '\">') != -1) {
document.getElementById('myaemailsms').href='mailto:' + toe.trim() + '?subject=' + encodeURIComponent(document.getElementById('sells').innerHTML.split(inu + '\">')[1].split('<')[0].replace('Email or SMS ','')) + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output'));
document.getElementById('myaemailsms').click();
} else {
document.getElementById('myaemailsms').href='mailto:' + toe.trim() + '?subject=' + encodeURIComponent('Colour Wheel') + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output'));
document.getElementById('myaemailsms').click();
}
} else if (toe.trim() != '') {
if (toe.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
document.getElementById('myaemailsms').href='sms:' + toe.trim() + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output'));
document.getElementById('myaemailsms').click();
}
}
document.getElementById('sells').value='';
} else if (inu.indexOf('HTTP') == 0) {
//alert('2:' + inu);
if (inu.indexOf('#saved_colour_wheel_') != -1) {
//alert('22:' + inu.split('#')[eval(-1 + inu.split('#').length)]);
deleteAVal(inu.split('#')[eval(-1 + inu.split('#').length)], encodeURIComponent(inu.replace('#' + inu.split('#')[eval(-1 + inu.split('#').length)], '').replace('HTTP','http')));
//alert('222:' + inu.split('#')[eval(-1 + inu.split('#').length)]);
cookieAVal('saved_colour_wheel_', true);
//alert('2222:' + inu.split('#')[eval(-1 + inu.split('#').length)]);
}
} else {
//woo=window.open(inu, '_blank', 'top=50,left=50,width=800,height=800');
woo=window.open(inu.replace(/\-/g,'').replace('doctestoutput','doctest-output').replace('http:','').replace('https:',''), '_blank', 'top=50,left=50,width=800,height=800');
}
}
}
function rework(what) {
var outw=what;
if (what.toLowerCase().indexOf('doctest output ') != -1 && what.toLowerCase().indexOf('.gv.') != -1) {
outw=what.toLowerCase().split('doctest output ')[1].split('.gv.')[0];
var outwds=outw.split(' ');
outw=outwds[0].substring(0,1).toUpperCase() + (outwds[0] + ' ').substring(1).toLowerCase().trim();
for (var io=1; io', '' + '' + '' + '');
}
}
if (lssel != '') {
document.getElementById('ssel').innerHTML=lssel.trim();
}
}
if (cName.indexOf('saved_colour_wheel_') == 0) {
if (window.localStorage) {
if (decodeURIComponent(('' + localStorage.getItem(cName)).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
return decodeURIComponent(localStorage.getItem(cName));
}
if (decodeURIComponent(('' + sessionStorage.getItem(cName)).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
return decodeURIComponent(sessionStorage.getItem(cName));
}
}
return '';
}
return '';
}
function phv(tao) {
if (tao.value == '') {
tao.value=tao.placeholder;
}
}
function various(indi) {
var outdi=indi;
outdi=outdi.replace(/\|\;/g, encodeURIComponent('|') + ';');
outdi=outdi.replace(/\,\;/g, encodeURIComponent(',') + ';');
outdi=outdi.replace(/\;\;/g, encodeURIComponent(';') + ';');
outdi=outdi.replace(/\|\,/g, encodeURIComponent('|') + ',');
outdi=outdi.replace(/\,\,/g, encodeURIComponent(',') + ',');
outdi=outdi.replace(/\;\,/g, encodeURIComponent(';') + ',');
outdi=outdi.replace(/\|\|/g, encodeURIComponent('|') + '|');
outdi=outdi.replace(/\,\|/g, encodeURIComponent(',') + '|');
outdi=outdi.replace(/\;\|/g, encodeURIComponent(';') + '|');
return outdi;
}
function contentfix(inid) {
document.getElementById('ititle').value=document.getElementById('ititle').value.replace(/\+/g,'-').replace(/\=/g,'-').replace(/\ /g,'-');
//document.getElementById('one').value=document.getElementById('one').value.replace(/\+/g,'`');
//document.getElementById('two').value=document.getElementById('two').value.replace(/\+/g,'`');
//document.getElementById('three').value=document.getElementById('three').value.replace(/\+/g,'`');
document.getElementById('none').value=various(document.getElementById('one').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('ntwo').value=various(document.getElementById('two').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('nthree').value=various(document.getElementById('three').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('mysub').style.border='3px dotted green';
return inid;
}
function emailit(inais) {
event.stopPropagation();
var em=null;
window.focus();
em=prompt('Please enter email address to send output ' + document.getElementById('fmt').value + ' URL link to. ', '');
if (em == null) { em=''; }
if (em.indexOf('@') != -1) {
document.getElementById('ititle').value=document.getElementById('ititle').value.replace(/\+/g,'-').replace(/\=/g,'-').replace(/\ /g,'-');
document.getElementById('none').value=various(document.getElementById('one').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('ntwo').value=various(document.getElementById('two').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('nthree').value=various(document.getElementById('three').value.replace(/\+/g,String.fromCharCode(9)));
//alert(document.getElementById('addimg').value);
em+='?subject=' + document.getElementById('newablzero').value + '&body=' + encodeURIComponent( (document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#title=' + encodeURIComponent(document.getElementById('ititle').value) + '#back=' + encodeURIComponent(document.getElementById('back').value.replace('#','')) + '#fsize=' + encodeURIComponent(document.getElementById('fsize').value) + '#shape=' + encodeURIComponent(document.getElementById('shape').value) + '#mode=' + encodeURIComponent(document.getElementById('mode').value) + '#fmt=' + encodeURIComponent(document.getElementById('fmt').value) + '#one=' + encodeURIComponent(document.getElementById('none').value) + '#two=' + encodeURIComponent(document.getElementById('ntwo').value) + '#three=' + encodeURIComponent(document.getElementById('nthree').value) + '#addimg=' + encodeURIComponent(document.getElementById('addimg').value)).replace('#fmt=svg#one=#','#fmt=pdf#one=#') );
document.getElementById('dimap').innerHTML='Email';
document.getElementById('theaemail').click();
}
return false;
}
function svghost(svgheo, imgc) {
if (9 == 8) {
if (gzero) {
gzero.innerHTML+=\"\";
} else {
svgheo.innerHTML+=\"\";
}
}
}
function animbord() {
var bcolsare=['green','#F0F8FF','#F0FFFF','#F0F0E0','#F0FFF0','#FFFFF0','#FFF0E0','#FFFFE0','#F0FFF0','#FFFFFF','#F0F0F0','#F0F7FF','#FFF8F0','#FFF0F0','#E0FFFF','#FFFFE0'];
document.getElementById('mysub').style.border='3px dotted ' + bcolsare[lastj];
lastj++;
if (lastj >= eval('' + bcolsare.length)) { lastj=0; }
setTimeout(animbord, 200);
}
function psvgit() {
svgit(lastsvgeo, lastimgc);
}
function hsvtorgb(hsbh, hsbs, hsbb) { // thanks to https://stackoverflow.com/questions/17242144/javascript-convert-hsb-hsv-color-to-rgb-accurately
var rgb = { };
var h = Math.round(hsbh * 255);
var s = Math.round(hsb.s * 255 / 100);
var v = Math.round(hsb.b * 255 / 100);
if (s == 0) {
rgb.r = rgb.g = rgb.b = v;
} else {
var t1 = v;
var t2 = (255 - s) * v / 255;
var t3 = (t1 - t2) * (h % 60) / 60;
if (h == 360) h = 0;
if (h < 60) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3 }
else if (h < 120) { rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3 }
else if (h < 180) { rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3 }
else if (h < 240) { rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3 }
else if (h < 300) { rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3 }
else if (h < 360) { rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3 }
else { rgb.r = 0; rgb.g = 0; rgb.b = 0 }
}
return 'rgb(' + Math.round(rgb.r) + ',' + Math.round(rgb.g) + ',' + Math.round(rgb.b) + ')';
}
function svgit(svgeo, imgc) {
var pres='';
lastsvgeo=svgeo;
lastimgc=imgc;
if (('' + svgeo.outerHTML).indexOf('\";
} else {
lastiurl=\"\";
}
window.focus();
pres=null;
try {
if (lastp.indexOf('Regarding ' + svgeo.innerHTML + ' ') == -1) {
//alert(szero.innerHTML.split(svgeo.innerHTML + '')[1].substring(0,300));
if (bconto) { document.getElementById('hidecol').value=szero.innerHTML.split('>' + svgeo.innerHTML + '')[1].split(' fill=\"')[1].split('\"')[0]; bconto.setlhifto(szero.innerHTML.split(svgeo.innerHTML + '')[1].split(' fill=\"')[1].split('\"')[0]); }
//pres=prompt('Regarding ' + svgeo.innerHTML + ' please see the whole node ' + svgeo.outerHTML.substring(0,1) + ' .+. ' + szero.innerHTML.split(svgeo.innerHTML + '')[1].split(' fill=\"')[1].split('\"')[0] + '', '');
pres='';
}
} catch(exc) {
console.log('error');
}
if (pres == null) { console.log('err'); pres=''; if (uselast) { setTimeout(psvgit, 2000); } } else { uselast=false; lastp='Regarding ' + svgeo.innerHTML + ' please enter an optional image URL'; }
if (pres != '') {
if (pres.indexOf('#') == -1) { zerodotsix='0.6'; } else if (pres.indexOf('#') != -1) { zerodotsix=pres.split('#')[1]; pres=pres.split('#')[0].trim(); if ((zerodotsix + 'z').substring(0,1) < '0' || (zerodotsix + 'z').substring(0,1) > '9') { zerodotsix='0.6'; } }
if (pres != '') {
uselast=false;
lastp='Regarding ' + svgeo.innerHTML + ' please see the whole node ' + svgeo.outerHTML + '';
lastiurl=lastiurl.replace(\" href=''\", \" href='\" + pres + \"'\");
if (gzero) {
//alert(\"+';
}
}
if (1 == 2) {
svgeo.innerHTML+='+';
alert('' + svgeo.outerHTML);
}
}
function naz(intvo) {
var intv=intvo.value;
if (intv.replace(' ','-').replace('_','-').indexOf('-') == -1 && intv.trim() != '') {
intvo.value='a-' + intv;
intv=intvo.value;
}
var retval='My%20%Colour%20Wheel';
var jntv=intv.replace(/\ /g,'-').replace(/\_/g,'-');
var jst=jntv.split('-');
if (jntv.indexOf('heel') != -1) {
retval=jst[0].substring(0,1).toUpperCase() + jst[0].substring(1).toLowerCase() + ' ';
for (var ij=1; ijSMS';
if (!document.getElementById('theasms') && document.getElementById('psms')) {
document.getElementById('psms').click();
} else {
document.getElementById('theasms').click();
}
}
}
return false;
}
function sz(inum) {
var uni='px';
if (szero) {
if (('' + szero.getAttribute('width')).indexOf('pt') != -1) { uni='pt'; } else if (('' + szero.getAttribute('width')).indexOf('%') != -1) { uni='%'; }
szero.setAttribute('width', '' + ('' + eval(eval('' + szero.getAttribute('width').split(uni)[0])) * eval('' + inum)) + uni);
szero.setAttribute('height', '' + ('' + eval(eval('' + szero.getAttribute('height').split(uni)[0])) * eval('' + inum)) + uni);
}
}
function domore(hm) {
var rectis=document.getElementById('myif').getBoundingClientRect();
if (('' + hm) == '1') {
document.getElementById('rtd').style.width='20%';
document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(1.1)) + 'px';
document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 1.1) + 'px';
} else if (('' + hm) == '-1') {
document.getElementById('rtd').style.width='50%';
document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(0.9)) + 'px';
document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 0.9) + 'px';
} else if (('' + hm) == '-2') {
document.getElementById('rtd').style.width='50%';
document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(0.8)) + 'px';
document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 0.8) + 'px';
} else {
document.getElementById('rtd').style.width='20%';
document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(1.2)) + 'px';
document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 1.2) + 'px';
}
}
function prechecksvg() {
checksvg(lastwoo);
}
function checki(iois) {
bconto = (iois.contentWindow || iois.contentDocument);
}
function checksvg(iiois) {
var gs=[];
var iois=iiois;
if (lastwoo) {
iois=lastwoo.document.childNodes[0]; //.getSVGDocument();
console.log('lAstwoo ' + lastwoo);
} else if (('' + iiois.src).toLowerCase().indexOf('.svg') == -1 && lastwoo != null) {
iois=lastwoo.document.childNodes[0]; //.getSVGDocument();
console.log('lastwoo ' + lastwoo);
}
if (iois != null) { // check out window.svgDocument
console.log('lastwoo2');
var aconto = (iois.contentWindow || iois.contentDocument);
console.log('lastwoo3a ' + iois.document);
console.log('lastwoo3 ' + aconto);
if (aconto != null) {
//alert(1);
console.log('lastwoo4 ' + aconto);
if (aconto.document) {
console.log('lastwoo5 ' + aconto);
aconto = aconto.document;
gs=aconto.getElementsByTagName('g');
if (eval('' + gs.length) > 0) {
gzero=gs[0];
for (var sd=0; sd 0) {
szero=gs[0];
for (var sd=0; sd
Trying out Dot GraphViz hosted in PHP " . $plus . " Colour Wheel 📧 📟
RJM Programming " . $minus . " October, 2024
|
|
Canvas Drawing With Clicked Colour to Left As Revealed Below ...
|
Email/SMS
";
} else {
echo "
Trying out Dot GraphViz hosted in PHP - RJM Programming - October, 2024 - Colour Wheel
var lasturl='', lasttext=null, gzero=null, lastx=0, lasty=0, lastw=0, lasth=0, lastp='', lastwoo=null, lastj=0, lssel='', zerodotsix='0.6', bconto=null, lastiurl='', szero=null, aimg='', lastimgc='', lastsvggeo=null, uselast=false;
String.prototype.toHtmlEntities = function() {
return this.replace(/./gm, function(s) {
return (s.match(/[a-z0-9\s]+/i)) ? s : '' + s.charCodeAt(0) + ';';
});
};
function plusdata(aig) {
var outig=aig, dlm='\"';
var outgs=aig.split('data:');
if (eval('' + outgs.length) > 1) {
outig=outgs[0];
dlm=outig.slice(-1);
for (var iop=1; iop') != -1) {
toe=prompt('Please enter email address or SMS number to share ' + document.getElementById('sells').innerHTML.split(inu + '\">')[1].split('<')[0].replace('Email or SMS ','') + ' with.', '');
} else {
toe=prompt('Please enter email address or SMS number to share with.', '');
}
if (toe == null) { toe=''; }
if (toe.indexOf('@') != -1) {
if (document.getElementById('sells').innerHTML.indexOf(inu + '\">') != -1) {
document.getElementById('myaemailsms').href='mailto:' + toe.trim() + '?subject=' + encodeURIComponent(document.getElementById('sells').innerHTML.split(inu + '\">')[1].split('<')[0].replace('Email or SMS ','')) + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output'));
document.getElementById('myaemailsms').click();
} else {
document.getElementById('myaemailsms').href='mailto:' + toe.trim() + '?subject=' + encodeURIComponent('Colour Wheel') + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output'));
document.getElementById('myaemailsms').click();
}
} else if (toe.trim() != '') {
if (toe.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
document.getElementById('myaemailsms').href='sms:' + toe.trim() + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output'));
document.getElementById('myaemailsms').click();
}
}
document.getElementById('sells').value='';
} else if (inu.indexOf('HTTP') == 0) {
//alert('2:' + inu);
if (inu.indexOf('#saved_colour_wheel_') != -1) {
//alert('22:' + inu.split('#')[eval(-1 + inu.split('#').length)]);
deleteAVal(inu.split('#')[eval(-1 + inu.split('#').length)], encodeURIComponent(inu.replace('#' + inu.split('#')[eval(-1 + inu.split('#').length)], '').replace('HTTP','http')));
//alert('222:' + inu.split('#')[eval(-1 + inu.split('#').length)]);
cookieAVal('saved_colour_wheel_', true);
//alert('2222:' + inu.split('#')[eval(-1 + inu.split('#').length)]);
}
} else {
//woo=window.open(inu, '_blank', 'top=50,left=50,width=800,height=800');
woo=window.open(inu.replace(/\-/g,'').replace('doctestoutput','doctest-output').replace('http:','').replace('https:',''), '_blank', 'top=50,left=50,width=800,height=800');
}
}
}
function rework(what) {
var outw=what;
if (what.toLowerCase().indexOf('doctest output ') != -1 && what.toLowerCase().indexOf('.gv.') != -1) {
outw=what.toLowerCase().split('doctest output ')[1].split('.gv.')[0];
var outwds=outw.split(' ');
outw=outwds[0].substring(0,1).toUpperCase() + (outwds[0] + ' ').substring(1).toLowerCase().trim();
for (var io=1; io', '' + '' + '' + '');
}
}
if (lssel != '') {
document.getElementById('ssel').innerHTML=lssel.trim();
}
}
if (cName.indexOf('saved_colour_wheel_') == 0) {
if (window.localStorage) {
if (decodeURIComponent(('' + localStorage.getItem(cName)).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
return decodeURIComponent(localStorage.getItem(cName));
}
if (decodeURIComponent(('' + sessionStorage.getItem(cName)).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
return decodeURIComponent(sessionStorage.getItem(cName));
}
}
return '';
}
return '';
}
function contentfix(inid) {
document.getElementById('ititle').value=document.getElementById('ititle').value.replace(/\+/g,'-').replace(/\=/g,'-').replace(/\ /g,'-');
document.getElementById('none').value=various(document.getElementById('one').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('ntwo').value=various(document.getElementById('two').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('nthree').value=various(document.getElementById('three').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('mysub').style.border='3px dotted green';
return inid;
}
function various(indi) {
var outdi=indi;
outdi=outdi.replace(/\|\;/g, encodeURIComponent('|') + ';');
outdi=outdi.replace(/\,\;/g, encodeURIComponent(',') + ';');
outdi=outdi.replace(/\;\;/g, encodeURIComponent(';') + ';');
outdi=outdi.replace(/\|\,/g, encodeURIComponent('|') + ',');
outdi=outdi.replace(/\,\,/g, encodeURIComponent(',') + ',');
outdi=outdi.replace(/\;\,/g, encodeURIComponent(';') + ',');
outdi=outdi.replace(/\|\|/g, encodeURIComponent('|') + '|');
outdi=outdi.replace(/\,\|/g, encodeURIComponent(',') + '|');
outdi=outdi.replace(/\;\|/g, encodeURIComponent(';') + '|');
return outdi;
}
function svghost(svgheo, imgc) {
if (9 == 8) {
if (gzero) {
gzero.innerHTML+=\"\";
} else {
svgheo.innerHTML+=\"\";
}
}
}
function psvgit() {
svgit(lastsvgeo, lastimgc);
}
function hsvtorgb(hsbh, hsbs, hsbb) { // thanks to https://stackoverflow.com/questions/17242144/javascript-convert-hsb-hsv-color-to-rgb-accurately
var rgb = { };
var h = Math.round(hsbh * 255);
var s = Math.round(hsb.s * 255 / 100);
var v = Math.round(hsb.b * 255 / 100);
if (s == 0) {
rgb.r = rgb.g = rgb.b = v;
} else {
var t1 = v;
var t2 = (255 - s) * v / 255;
var t3 = (t1 - t2) * (h % 60) / 60;
if (h == 360) h = 0;
if (h < 60) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3 }
else if (h < 120) { rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3 }
else if (h < 180) { rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3 }
else if (h < 240) { rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3 }
else if (h < 300) { rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3 }
else if (h < 360) { rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3 }
else { rgb.r = 0; rgb.g = 0; rgb.b = 0 }
}
return 'rgb(' + Math.round(rgb.r) + ',' + Math.round(rgb.g) + ',' + Math.round(rgb.b) + ')';
}
function animbord() {
var bcolsare=['green','#F0F8FF','#F0FFFF','#F0F0E0','#F0FFF0','#FFFFF0','#FFF0E0','#FFFFE0','#F0FFF0','#FFFFFF','#F0F0F0','#F0F7FF','#FFF8F0','#FFF0F0','#E0FFFF','#FFFFE0'];
document.getElementById('mysub').style.border='3px dotted ' + bcolsare[lastj];
lastj++;
if (lastj >= eval('' + bcolsare.length)) { lastj=0; }
setTimeout(animbord, 200);
}
function svgit(svgeo, imgc) {
var pres='';
lastsvgeo=svgeo;
lastimgc=imgc;
if (('' + svgeo.outerHTML).indexOf('\";
} else {
lastiurl=\"\";
}
window.focus();
pres=null;
try {
if (lastp.indexOf('Regarding ' + svgeo.innerHTML + ' ') == -1) {
if (bconto) { document.getElementById('hidecol').value=szero.innerHTML.split('>' + svgeo.innerHTML + '')[1].split(' fill=\"')[1].split('\"')[0]; bconto.setlhifto(szero.innerHTML.split(svgeo.innerHTML)[1].split(' fill=\"')[1].split('\"')[0]); }
//pres=prompt('Regarding ' + svgeo.innerHTML + ' please see the whole node ' + svgeo.outerHTML + ' ... ' + szero.outerHTML.split('>' + svgeo.innerHTML + '')[1].substring(0,200) + '', '');
pres='';
}
} catch(exc) {
console.log('error');
}
if (pres == null) { console.log('err'); pres=''; if (uselast) { setTimeout(psvgit, 2000); } } else { uselast=false; lastp='Regarding ' + svgeo.innerHTML + ' please enter an optional image URL'; }
if (pres != '') {
if (pres.indexOf('#') == -1) { zerodotsix='0.6'; } else if (pres.indexOf('#') != -1) { zerodotsix=pres.split('#')[1]; pres=pres.split('#')[0].trim(); if ((zerodotsix + 'z').substring(0,1) < '0' || (zerodotsix + 'z').substring(0,1) > '9') { zerodotsix='0.6'; } }
if (pres != '') {
uselast=false;
lastp='Regarding ' + svgeo.innerHTML + ' please see the whole node ' + svgeo.outerHTML + ''
lastiurl=lastiurl.replace(\" href=''\", \" href='\" + pres + \"'\");
if (gzero) {
//alert(\"+';
}
}
if (1 == 2) {
svgeo.innerHTML+='+';
alert('' + svgeo.outerHTML);
}
}
function emailit(inais) {
event.stopPropagation();
var em=null;
window.focus();
em=prompt('Please enter email address to send output ' + document.getElementById('fmt').value + ' URL link to.', '');
if (em == null) { em=''; }
if (em.indexOf('@') != -1) {
document.getElementById('ititle').value=document.getElementById('ititle').value.replace(/\+/g,'-').replace(/\=/g,'-').replace(/\ /g,'-');
document.getElementById('none').value=various(document.getElementById('one').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('ntwo').value=various(document.getElementById('two').value.replace(/\+/g,String.fromCharCode(9)));
document.getElementById('nthree').value=various(document.getElementById('three').value.replace(/\+/g,String.fromCharCode(9)));
//alert('2:' + document.getElementById('addimg').value);
em+='?subject=' + document.getElementById('newablzero').value + '&body=' + encodeURIComponent( (document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#title=' + encodeURIComponent(document.getElementById('ititle').value) + '#back=' + encodeURIComponent(document.getElementById('back').value.replace('#','')) + '#fsize=' + encodeURIComponent(document.getElementById('fsize').value) + '#shape=' + encodeURIComponent(document.getElementById('shape').value) + '#mode=' + encodeURIComponent(document.getElementById('mode').value) + '#fmt=' + encodeURIComponent(document.getElementById('fmt').value) + '#one=' + encodeURIComponent(document.getElementById('none').value) + '#two=' + encodeURIComponent(document.getElementById('ntwo').value) + '#three=' + encodeURIComponent(document.getElementById('nthree').value) + '#addimg=' + encodeURIComponent(document.getElementById('addimg').value)).replace('#fmt=svg#one=#','#fmt=pdf#one=#') );
document.getElementById('dimap').innerHTML='Email';
document.getElementById('theaemail').click();
}
return false;
}
function naz(intvo) {
var intv=intvo.value;
if (intv.replace(' ','-').replace('_','-').indexOf('-') == -1 && intv.trim() != '') {
intvo.value='a-' + intv;
intv=intvo.value;
}
var retval='My%20%Colour%20Wheel';
var jntv=intv.replace(/\ /g,'-').replace(/\_/g,'-');
var jst=jntv.split('-');
if (jntv.indexOf('heel') != -1) {
retval=jst[0].substring(0,1).toUpperCase() + jst[0].substring(1).toLowerCase() + ' ';
for (var ij=1; ijSMS';
if (!document.getElementById('theasms') && document.getElementById('psms')) {
document.getElementById('psms').click();
} else {
document.getElementById('theasms').click();
}
}
}
return false;
}
function sz(inum) {
var uni='px';
if (szero) {
if (('' + szero.getAttribute('width')).indexOf('pt') != -1) { uni='pt'; } else if (('' + szero.getAttribute('width')).indexOf('%') != -1) { uni='%'; }
szero.setAttribute('width', '' + ('' + eval(eval('' + szero.getAttribute('width').split(uni)[0])) * eval('' + inum)) + uni);
szero.setAttribute('height', '' + ('' + eval(eval('' + szero.getAttribute('height').split(uni)[0])) * eval('' + inum)) + uni);
}
}
function domore(hm) {
var rectis=document.getElementById('myif').getBoundingClientRect();
if (('' + hm) == '1') {
document.getElementById('rtd').style.width='20%';
document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(1.1)) + 'px';
document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 1.1) + 'px';
} else if (('' + hm) == '-1') {
document.getElementById('rtd').style.width='50%';
document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(0.9)) + 'px';
document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 0.9) + 'px';
} else if (('' + hm) == '-2') {
document.getElementById('rtd').style.width='50%';
document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(0.8)) + 'px';
document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 0.8) + 'px';
} else {
document.getElementById('rtd').style.width='20%';
document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(1.2)) + 'px';
document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 1.2) + 'px';
}
}
function prechecksvg() {
checksvg(lastwoo);
}
function checki(iois) {
bconto = (iois.contentWindow || iois.contentDocument);
}
function checksvg(iiois) {
var gs=[];
var iois=iiois;
if (('' + iiois.src).toLowerCase().indexOf('.svg') == -1 && lastwoo != null) {
iois=lastwoo;
//alert(1);
console.log('lastWoo');
}
if (iois != null) { // check out window.svgDocument
console.log('lastWoo2');
var aconto = (iois.contentWindow || iois.contentDocument);
console.log('lastWoo3 ' + aconto);
if (aconto != null) {
//alert(1);
console.log('lastWoo4 ' + aconto);
if (aconto.document) {
console.log('lastWoo5 ' + aconto);
aconto = aconto.document;
gs=aconto.getElementsByTagName('g');
if (eval('' + gs.length) > 0) {
gzero=gs[0];
for (var sd=0; sd 0) {
szero=gs[0];
for (var sd=0; sd 0) {
gzero=gs[0];
for (var sd=0; sd 0) {
for (var sd=0; sd
Trying out Dot GraphViz hosted in PHP " . $plus . " Colour Wheel 📧 📟
RJM Programming " . $minus . " October, 2024
|
|
Canvas Drawing With Clicked Colour to Left As Revealed Below ...
|
Email/SMS
";
}
?>