2,17d1
< // annotatedtimeline_chart.php
< // Google Annotated Timeline Chart supervisor
< // RJM Programming
< // November, 2015
< //
< if (file_exists("csv.php")) {
< include "csv.php";
< } else if (file_exists("../csv.php")) {
< include "../csv.php";
< }
< if (file_exists("bigemail.php")) {
< include "bigemail.php";
< } else if (file_exists("../bigemail.php")) {
< include "../bigemail.php";
< }
<
23c7
<
---
>
25a10
>
34,35d18
< var firstgo=true;
< var pstr='', prevpstr='';
51,193d33
<
< var cdrnum=[0,0],cdnum=["",""],cdsnum=["",""],prevtlbit='', thistlbit='', prevdate=[], prevval='', ready=false, x=-1, y=-1, elemLeft=0, elemTop=0, ir=-1, ic=-1, talkingpoint='';
< var tlurls=document.URL.replace('desc1=', 'desc=').replace('/AnnotatedTimelineChart/', '/CalendarChart/').replace('annotatedtimeline_chart.php','calendar_chart.php').split('&data=');
< var tlurl=tlurls[0];
< var tltwourls=document.URL.replace('desc1=', 'desc=').replace('/AnnotatedTimelineChart/', '/TimelineChart/').replace('annotatedtimeline_chart.php','timeline_chart.php').split('&data=');
< var tltwourl=tltwourls[0];
<
< function fillindata() {
< var bed=document.getElementById('bdataval');
< if (bed == null) {
< document.getElementById('bitsatend').innerHTML+='';
< }
< }
<
< function filldata() {
< var bed=document.getElementById('bedata');
< if (bed != null) {
< if (bed.value == '') {
< bed.value=encodeURIComponent(paramdata);
< }
< }
< }
<
< function numsinstr(viad) {
< cdrnum=[0,0];
< var numsofar=0, isn=false, snum='';
< viad+=' ';
< for (var ii=0; ii= '0' && viad.substring(ii, eval(1 + ii)) <= '9') || viad.substring(ii, eval(1 + ii)) == '-' || viad.substring(ii, eval(1 + ii)) == '.') {
< snum+=viad.substring(ii, eval(1 + ii));
< } else if (snum.length >= 1 && snum.replace('-','').replace('.','') != '' && snum.indexOf('--') == -1 && snum.indexOf('..') == -1) {
< cdrnum[numsofar]=eval(snum);
< snum='';
< numsofar++;
< if (eval(numsofar) >= 2) return cdrnum;
< } else {
< snum='';
< }
< }
< return cdrnum;
< }
<
< function preretnum(jr,jc,viad) {
< var mths=["Jan", "Feb", "Mar", "Apr", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
< var retval=[];
< outviad=viad;
< //alert('jr=' + jr + ' and jc=' + jc);
< var hbits=document.head.innerHTML.split('dataTa' + 'ble.addRows([');
< if (eval(hbits.length) > 1) {
< //alert('Jr=' + jr + ' and jc=' + jc);
< //alert(hbits[1]);
< var dbitsare=hbits[1].replace(']]);','],[').split(',[');
< var dofinterest=dbitsare[eval(0 + jr)];
< //alert(jr + ' ... ' + dofinterest + ' +++ ' + dbitsare[0]);
< var vls=dofinterest.replace('[','').replace(']',',').split(',');
< if (eval(vls.length) >= 6) {
< if (thistlbit != '' && thistlbit != (vls[0] + ',' + vls[1] + ',' + vls[2])) {
< prevtlbit=thistlbit;
< thistlbit=(vls[0] + ',' + vls[1] + ',' + vls[2]);
< } else {
< thistlbit=(vls[0] + ',' + vls[1] + ',' + vls[2]);
< }
<
< //alert(vls.length + ' ... ' + vls[0] + ',' + vls[1] + ',' + vls[2]);
< //alert(vls.length + ' ... ' + vls[1] + ',' + vls[2] + ',' + vls[3]);
< //alert(vls.length + ' ... ' + vls[2] + ',' + vls[3] + ',' + vls[4]);
< //alert(vls[1]);
< //alert(mths[eval(vls[1])] + ' ' + vls[2].replace(')','') + ', ' + vls[0].replace('new Date(',''));
< cdnum=[mths[eval(vls[1])] + ' ' + vls[2].replace(')','') + ', ' + vls[0].replace('new Date(',''), mths[eval(vls[1])] + ' ' + vls[2].replace(')','') + ', ' + vls[0].replace('new Date(','')];
< //alert(vls[1]);
< cdsnum=[(vls[0] + ',' + vls[1] + ',' + vls[2]), (vls[0] + ',' + vls[1] + ',' + vls[2])];
< //alert(vls[2]);
< cdrnum=[vls[3],vls[6]];
< if (pstr != '' && pstr != (vls[3] + ':' + vls[4].replace(/\'/g,' ').replace(/~/g,' ') + ' ' + vls[5].replace(/\'/g,' ').replace(/~/g,' ') + ' ... ' + vls[6] + ':' + vls[7].replace(/\'/g,' ').replace(/~/g,' ') + ' ' + vls[8].replace(/\'/g,' ').replace(/~/g,' '))) {
< prevpstr=pstr;
< }
< pstr=vls[3] + ':' + vls[4].replace(/\'/g,' ').replace(/~/g,' ') + ' ' + vls[5].replace(/\'/g,' ').replace(/~/g,' ') + ' ... ' + vls[6] + ':' + vls[7].replace(/\'/g,' ').replace(/~/g,' ') + ' ' + vls[8].replace(/\'/g,' ').replace(/~/g,' ');
< retval=[eval(vls[0] + ',' + vls[1] + ',' + vls[2]), eval(vls[0] + ',' + vls[1] + ',' + vls[2])];
< //alert(retval[0]);
< return retval;
< }
< }
< return retnum(outviad);
< }
<
< function retnum(viad) {
< var mths=["Jan", "Feb", "Mar", "Apr", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
< var retval=[];
< //var prehbits=document.head.innerHTML.indexOf("'," + viad + ",'"); //('["' + viad + '",');
< var hbits=document.head.innerHTML.split('~,' + viad + ',~'); //('["' + viad + '",');
< if (eval(hbits.length) >= 2) {
< //alert(hbits[1]);
< var vls=hbits[1].replace(']',',').split(',');
< if (eval(vls.length) >= 6) {
< //alert(vls.length + ' ... ' + vls[0] + ',' + vls[1] + ',' + vls[2]);
< cdnum=[mths[eval(vls[1])] + ' ' + vls[2].replace(')','') + ', ' + vls[0].replace('new Date(',''), mths[eval(vls[4])] + ' ' + vls[5].replace(')','') + ', ' + vls[3].replace('new Date(','')];
< cdsnum=[(vls[0] + ',' + vls[1] + ',' + vls[2]), (vls[3] + ',' + vls[4] + ',' + vls[5])];
< retval=[eval(vls[0] + ',' + vls[1] + ',' + vls[2]), eval(vls[3] + ',' + vls[4] + ',' + vls[5])];
< }
< }
< return retval;
< }
<
< function tlblurb() {
< if (prevpstr != '' && pstr != '') {
< return prevpstr + ' to ' + pstr;
< } else if (pstr != '') {
< return pstr;
< }
< return prevpstr;
< }
<
< function oppretnum(viad) {
< var retval=0;
< var yrs=viad.split(',');
< if (yrs.length == 2) {
< var mts=yrs[0].split(' ');
< if (mts.length == 2) {
< var mth='';
< if (mts[0].substring(0,3).toLowerCase() == 'jan') mth=0;
< if (mts[0].substring(0,3).toLowerCase() == 'feb') mth=1;
< if (mts[0].substring(0,3).toLowerCase() == 'mar') mth=2;
< if (mts[0].substring(0,3).toLowerCase() == 'apr') mth=3;
< if (mts[0].substring(0,3).toLowerCase() == 'may') mth=4;
< if (mts[0].substring(0,3).toLowerCase() == 'jun') mth=5;
< if (mts[0].substring(0,3).toLowerCase() == 'jul') mth=6;
< if (mts[0].substring(0,3).toLowerCase() == 'aug') mth=7;
< if (mts[0].substring(0,3).toLowerCase() == 'sep') mth=8;
< if (mts[0].substring(0,3).toLowerCase() == 'oct') mth=9;
< if (mts[0].substring(0,3).toLowerCase() == 'nov') mth=10;
< if (mts[0].substring(0,3).toLowerCase() == 'dec') mth=11;
< //alert('[new Date(' + yrs[1].replace(' ','') + ',' + mth + ',' + mts[1] + '),');
< thistlbit='new Date(' + yrs[1].replace(' ','') + ',' + mth + ',' + mts[1] + ')';
< var hbits=document.head.innerHTML.split('[new Date(' + yrs[1].replace(' ','') + ',' + mth + ',' + mts[1] + '),');
< if (hbits.length == 2) {
< var vls=hbits[1].split(']');
< return eval(vls[0]);
< }
< }
< }
< return retval;
< }
<
195,221d34
< echo "var dataTable, chart, pardata = (location.search.split('data=')[1] ? location.search.split('data=')[1].split('&')[0] : ''), paramdata=decodeURIComponent(pardata); \n";
<
< $GETtp="";
< if (isset($_GET['tp'])) $GETtp = urldecode($_GET['tp']);
< if (isset($_POST['tp'])) $GETtp = urldecode($_POST['tp']);
< if ($GETtp != "") echo "\n talkingpoint=String.fromCharCode(10) + String.fromCharCode(10) + " . '"' . str_replace("`", '" + String.fromCharCode(10) + "', str_replace("\n", '" + String.fromCharCode(10) + "', $GETtp)) . '"' . " + String.fromCharCode(10) + String.fromCharCode(10); \n";
<
< $GETr = "";
< $GETc = "";
< if (isset($_GET['r'])) $GETr = urldecode($_GET['r']);
< if (isset($_POST['r'])) $GETr = urldecode($_POST['r']);
< if (isset($_GET['c'])) $GETc = urldecode($_GET['c']);
< if (isset($_POST['c'])) $GETc = urldecode($_POST['c']);
< if ($GETr != "") echo "\n ir=eval('" . $GETr . "'); \n";
< if ($GETc != "") echo "\n ic=eval('" . $GETc . "'); \n";
<
< $GETx = "";
< $GETy = "";
< if (isset($_GET['x'])) $GETx = urldecode($_GET['x']);
< if (isset($_POST['x'])) $GETx = urldecode($_POST['x']);
< if (isset($_GET['y'])) $GETy = urldecode($_GET['y']);
< if (isset($_POST['y'])) $GETy = urldecode($_POST['y']);
< if ($GETx != "" && $GETy != "") {
< echo "\n x=eval('" . $GETx . "'); \n";
< echo "\n y=eval('" . $GETy . "'); \n";
< }
<
232,233d44
<
<
235,255c46
< //$nineh="1200";
< //$twoh="430";
< $GETdata = str_replace("~", "'", str_replace("\\'", "'", urldecode(checkdatadata0('POST',$_POST['data']))));
< //echo "\n pardata = " . '"' . $_POST['data'] . '"; ' . " \n";
< echo "\n paramdata='" . str_replace("'",'"',$GETdata) . "'; \n setTimeout(fillindata, 300); \n setTimeout(filldata, 3000); \n"; // = decodeURIComponent(pardata); " . " \n";
<
< } else if (isset($_GET['data'])) {
< $prevg=$_GET['data'];
< //$nineh="900";
< //$twoh="200";
< $GETdata = str_replace("~", "'", str_replace("\\'", "'", urldecode(checkdatadata0('GET',$_GET['data']))));
< if ($prevg != $GETdata) {
< //$nineh="1200";
< //$twoh="430";
< echo "\n paramdata='" . str_replace("'",'"',$GETdata) . "'; \n setTimeout(fillindata, 300); \n setTimeout(filldata, 3000); \n"; // = decodeURIComponent(pardata); " . " \n";
< }
< }
<
<
<
< if (isset($_POST['title'])) {
---
> //$GETtitle = str_replace("~~", "##", $_POST['title']);
266c57,60
< } else if (isset($_GET['title'])) {
---
> //$GETdesc = str_replace("##", "'", $GETdesc);
> $GETdata = str_replace("~", "'", str_replace("\\'", "'", urldecode($_POST['data'])));
> }
> if (isset($_GET['data'])) {
278,455c72,73
< }
<
< echo " var colnames= '" . str_replace("'", "", $GETdesc) . "'; \n";
<
<
< echo " function myselectfunction() {
< //alert(88);
< if (ready) {
< //alert(87);
< var relist=['remail',''],ire,item,selection,thisval='',ifc=0,thisdate=[],ansbits,avblurb=talkingpoint,ioffset=0,ans=null,doit=true,kl,lk, thisnum, num=0,message = '', dparts, colparts=colnames.split(','), colav=new Array(), predparts, postdparts, diffcolnames=colnames,diffvalues;
< //pstr='';
< if (firstgo) {
< firstgo=false;
< }
< //alert(ifc + ' ... ic=' + ic + ' ... ir=' + ir);
< if (eval(ir) < 0 && eval(ic) < 0) {
< //alert(488);
< selection = chart.getSelection();
< //alert(388);
< if ((selection[0].row != null && selection[0].column != null)) {
< // alert(288);
< ir=selection[0].row;
< ifc=selection[0].column;
< //alert(188);
< }
<
< if (eval(ir) >= 0 && eval(ic) < 0) {
< var str = dataTable.getFormattedValue(ir, ifc);
< //alert(71111 + ' ... ' + str);
< message += '{row:' + ir + ', column:none}; value (col 0) = ' + str;
< thisval=str;
< //pstr=str + ' ' + colparts[0];
< thisdate=preretnum(ir,ifc,str); //retnum(str);
< //alert(thisdate[0]);
< //alert(pstr);
< avblurb+=String.fromCharCode(10) + String.fromCharCode(10) + 'On These Days=O' + String.fromCharCode(10);
< avblurb+='Show the Elapsed Number of Days=T' + String.fromCharCode(10);
< avblurb+='Add to a Calendar Representation=A[' + cdrnum[0] + ',' + cdrnum[1] + '] (anything after A overrides Calendar label of [' + cdrnum[0] + ',' + cdrnum[1] + '])' + String.fromCharCode(10);
< avblurb+='Add to a Calendar Representation and Show in New Window=N[' + cdrnum[0] + ',' + cdrnum[1] + '] (as above)' + String.fromCharCode(10);
< if (tlurl.indexOf('data=') != -1) avblurb+='Show the Current Calendar Representation on Top of This Annotated Timeline Chart=C ' + String.fromCharCode(10);
< avblurb+='Add to a Timeline Representation=B[' + tlblurb() + '] (anything after A overrides Timeline label of [' + tlblurb() + '])' + String.fromCharCode(10);
< avblurb+='Add to a Timeline Representation and Show in New Window=W[' + tlblurb() + '] (as above)' + String.fromCharCode(10);
< if (tltwourl.indexOf('data=') != -1) avblurb+='Show the Current Timeline Representation on Top of This Annotated Timeline Chart=Y ' + String.fromCharCode(10);
< avblurb+=String.fromCharCode(10) + String.fromCharCode(10) + 'Comma Separated Values Spreadsheet Export=filename.csv' + String.fromCharCode(10) + '' + String.fromCharCode(10) + 'Email with or without Talking Point=fillin.email@address This is when the improvement started. Robert' + String.fromCharCode(10) + '' + String.fromCharCode(10);
< avblurb+=String.fromCharCode(10) + String.fromCharCode(10) + 'Change data as required below (keeping it the same or being blank or choosing Cancel leaves the status quo)';
< ans=prompt('Regarding ' + colparts[0] + ' (' + thisval + ') you clicked date ' + thisdate[0] + ' ' + avblurb, paramdata);
< if (ans != null) {
< if (ans != '' && ans != paramdata) {
< if ((ans.toLowerCase() + '~').indexOf('.csv~') != -1 && ans.toLowerCase().indexOf('&') == -1) ans=paramdata + '&csv=' + ans;
< ansbits=ans.split(' ');
< if (ansbits[0].indexOf('@') != -1) {
< if (document.getElementById('altemail')) {
< document.getElementById('altemail').value=ansbits[0];
< document.getElementById('remail').href=document.getElementById('remail').href.replace('mt=','mt=' + ansbits[0] + '&junk=youshallneverfindthis').replace('get=','mt=' + ansbits[0] + '&junk=youshallneverfindthis');
< }
< if (document.getElementById('email')) relist[1]='email';
< for (ire=0; ire<2; ire++) {
< if (relist[ire] != '') {
< document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace('fillin.email@address', ansbits[0]);
< if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&r=') + ir) == -1) document.getElementById(relist[ire]).href+=encodeURIComponent('&r=') + item.row;
< if (ansbits.length > 1) {
< ans=ans.replace(ansbits[0] + ' ','');
< while (ans.indexOf(' ') != -1) {
< ans=ans.replace(' ','%20');
< }
< while (ans.indexOf('?') != -1) {
< ans=ans.replace('?','%3f');
< }
< while (ans.indexOf('&') != -1) {
< ans=ans.replace('&','%26');
< }
< if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&tp=')) == -1 && document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('?tp=')) == -1) {
< document.getElementById(relist[ire]).href+=encodeURIComponent('&tp=') + encodeURIComponent(ans);
< } else if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&tp=')) != -1) {
< document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(encodeURIComponent('&tp='), encodeURIComponent('&tp=') + encodeURIComponent(ans) + String.fromCharCode(96));
< } else if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('?tp=')) != -1) {
< document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(encodeURIComponent('?tp='), encodeURIComponent('?tp=') + encodeURIComponent(ans) + String.fromCharCode(96));
< }
< while (document.getElementById(relist[ire]).href.indexOf(' ') != -1) {
< document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(' ','%20');
< }
< //alert(document.getElementById(relist[ire]).href);
< }
< document.getElementById(relist[ire]).click();
< }
< }
< } else if (ans.substring(0,1).toLowerCase() == 'a' || ans.substring(0,1).toLowerCase() == 'n') {
< if (eval(ans.length) > 1) {
< //pstr=ans.substring(1);
< if (ans.substring(1,2) == '[') eval('cdrnum=' + ans.substring(1));
< }
< if (tlurl.indexOf('[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']') == -1 || tlurl.indexOf('[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']') == -1) {
< if (tlurl.indexOf('data=') == -1) {
< tlurl+='&data=';
< } else {
< tlurl+=',';
< }
< if (tlurl.indexOf('[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']') == -1 && tlurl.indexOf('[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']') == -1) {
< if ('[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']' == '[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']') {
< tlurl+='[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']';
< } else {
< tlurl+='[' + cdsnum[0] + ',' + cdrnum[0] + '' + '],[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']';
< }
< } else if (tlurl.indexOf('[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']') == -1) {
< tlurl+='[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']';
< } if (tlurl.indexOf('[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']') == -1) {
< tlurl+='[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']';
< }
< }
< if (ans.substring(0,1).toLowerCase() == 'n') window.open(iftoobig('',tlurl), '_blank', 'top=100,left=100,width=500,height=500');
< } else if (ans.substring(0,1).toLowerCase() == 'b' || ans.substring(0,1).toLowerCase() == 'w') {
< if (eval(ans.length) > 1) {
< pstr=ans.substring(1);
< }
< if (prevtlbit != '' && thistlbit != '') {
< if (tltwourl.indexOf('data=') == -1) {
< tltwourl+='&data=';
< } else {
< tltwourl+=',';
< }
< tltwourl+='[~' + encodeURIComponent(tlblurb()) + '~,' + prevtlbit + ',' + thistlbit + ']';
< if (ans.substring(0,1).toLowerCase() == 'w') window.open(iftoobig('',tltwourl), '_blank', 'top=100,left=100,width=500,height=500');
< }
< } else if (ans.substring(0,1).toLowerCase() == 'c') {
< location.href=iftoobig('',tlurl);
< } else if (ans.substring(0,1).toLowerCase() == 'y') {
< location.href=iftoobig('',tltwourl);
< } else if (ans.substring(0,1).toLowerCase() == 't') {
< var d1 = new Date(prevdate);
< var d2 = new Date(str);
< if (1 == 2) {
< document.getElementById('myf1').innerHTML=('It is ' + Math.floor((thisdate[1] - thisdate[0]) / (1000*60*60*24)) + ' days from ' + thisdate[0] + ' to ' + thisdate[1] + '.');
< } else {
< alert('It is ' + Math.floor((thisdate[1] - thisdate[0]) / (1000*60*60*24)) + ' days from ' + thisdate[0] + ' to ' + thisdate[1] + '.');
< //var wo=window.open('','_blank','top=200,left=200,width=300,height=50');
< //wo.document.write('It is ' + Math.floor((thisdate[1] - thisdate[0]) / (1000*60*60*24)) + ' days from ' + thisdate[0] + ' to ' + thisdate[1] + '.');
< //if (document.URL.indexOf('&qq=') == -1) {
< // location.href=document.URL + '&qq=1';
< //} else {
< // location.href=document.URL + '9';
< //}
< }
< } else if (ans.substring(0,1).toLowerCase() == 'o') {
< window.open('https://www.google.com/search?q=' + cdnum[0].replace(',','%2C').replace(' ','+').replace(' ','+'), '_blank', 'top=100,left=100,width=400,height=400');
< window.open('https://www.google.com/search?q=' + cdnum[1].replace(',','%2C').replace(' ','+').replace(' ','+'), '_blank', 'top=150,left=150,width=400,height=400');
< } else if (document.URL.indexOf('&data=') == -1) {
< location.href=iftoobig('',document.URL + '&data=' + ourencodeURIComponent(ans));
< } else {
< location.href=iftoobig('',document.URL.replace(pardata, ourencodeURIComponent(ans)));
< }
< }
< }
< prevdate=thisdate;
< prevval=str;
< prevtlbit=thistlbit;
< ir=-1;
< ic=-1;
< return;
< }
< } else {
< //selection = chart.getSelection();
< for (var i = 0; i < selection.length; i++) {
< item = selection[i];
< //alert(111);
< if ((item.row != null && item.column != null) || (eval(ir) >= 0 && eval(ic) >= 0)) {
< //alert(1111);
< if (eval(ir) >= 0 && eval(ic) >= 0) {
< //alert(999);
< item.row=ir;
< item.column=ic;
< //alert(9999);
< ir=-1;
< ic=-1;
< } else {
< //alert(61111);
< ir=item.row;
< ic=item.column;
< //document.title=ir + ',' + ic;
---
> //$GETdesc = str_replace("##", "'", $GETdesc);
> $GETdata = str_replace("~", "'", str_replace("\\'", "'", urldecode($_GET['data'])));
457,635d74
< var str = dataTable.getFormattedValue(item.row, item.column);
< //alert('" . $GETdesc2 . "=' + str);
< thisval=str;
< //pstr=str + ' ' + colparts[0];
< thisdate=preretnum(item.row,item.column,str); //retnum(str);
< //alert('thisval=' + thisval + ' and pstr=' + pstr + ' and thisdate[0]=' + thisdate[0]);
<
< } else if ((item.row != null && item.column == null) || (eval(ir) >= 0 && eval(ic) < 0)) {
< if (eval(ir) >= 0 && eval(ic) < 0) {
< //alert(999);
< item.row=ir;
< //item.column=ic;
< //alert(9999);
< ir=-1;
< ic=-1;
< } else {
< //alert(61111);
< ir=item.row;
< ic=-1;
< //document.title=ir + ',' + ic;
< }
< var str = dataTable.getFormattedValue(item.row, 0);
< //alert(71111 + ' ... ' + str);
< message += '{row:' + item.row + ', column:none}; value (col 0) = ' + str;
< thisval=str;
< //pstr=str + ' ' + colparts[0];
< thisdate=retnum(str);
< avblurb+=String.fromCharCode(10) + String.fromCharCode(10) + 'On These Days=O' + String.fromCharCode(10);
< avblurb+='Show the Elapsed Number of Days=T' + String.fromCharCode(10);
< avblurb+='Add to a Calendar Representation=A[' + cdrnum[0] + ',' + cdrnum[1] + '] (anything after A overrides Calendar label of [' + cdrnum[0] + ',' + cdrnum[1] + '])' + String.fromCharCode(10);
< avblurb+='Add to a Calendar Representation and Show in New Window=N[' + cdrnum[0] + ',' + cdrnum[1] + '] (as above)' + String.fromCharCode(10);
< if (tlurl.indexOf('data=') != -1) avblurb+='Show the Current Calendar Representation on Top of This Annotated Timeline Chart=C ' + String.fromCharCode(10);
< avblurb+='Add to a Timeline Representation=B[' + tlblurb() + '] (anything after A overrides Timeline label of [' + tlblurb() + '])' + String.fromCharCode(10);
< avblurb+='Add to a Timeline Representation and Show in New Window=W[' + tlblurb() + '] (as above)' + String.fromCharCode(10);
< if (tltwourl.indexOf('data=') != -1) avblurb+='Show the Current Timeline Representation on Top of This Annotated Timeline Chart=Y ' + String.fromCharCode(10);
< avblurb+=String.fromCharCode(10) + String.fromCharCode(10) + 'Comma Separated Values Spreadsheet Export=filename.csv' + String.fromCharCode(10) + '' + String.fromCharCode(10) + 'Email with or without Talking Point=fillin.email@address This is when the improvement started. Robert' + String.fromCharCode(10) + '' + String.fromCharCode(10);
< avblurb+=String.fromCharCode(10) + String.fromCharCode(10) + 'Change data as required below (keeping it the same or being blank or choosing Cancel leaves the status quo)';
< ans=prompt('Regarding ' + colparts[0] + ' (' + thisval + ') you clicked date ' + thisdate[0] + ' ' + avblurb, paramdata);
< if (ans != null) {
< if (ans != '' && ans != paramdata) {
< if ((ans.toLowerCase() + '~').indexOf('.csv~') != -1 && ans.toLowerCase().indexOf('&') == -1) ans=paramdata + '&csv=' + ans;
< ansbits=ans.split(' ');
< if (ansbits[0].indexOf('@') != -1) {
< if (document.getElementById('altemail')) {
< document.getElementById('altemail').value=ansbits[0];
< document.getElementById('remail').href=document.getElementById('remail').href.replace('mt=','mt=' + ansbits[0] + '&junk=youshallneverfindthis').replace('get=','mt=' + ansbits[0] + '&junk=youshallneverfindthis');
< }
< if (document.getElementById('email')) relist[1]='email';
< for (ire=0; ire<2; ire++) {
< if (relist[ire] != '') {
< document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace('fillin.email@address', ansbits[0]);
< if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&r=') + item.row) == -1) document.getElementById(relist[ire]).href+=encodeURIComponent('&r=') + item.row;
< //if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&c=') + item.column) == -1) document.getElementById(relist[ire]).href+=encodeURIComponent('&c=') + item.column;
< if (ansbits.length > 1) {
< ans=ans.replace(ansbits[0] + ' ','');
< while (ans.indexOf(' ') != -1) {
< ans=ans.replace(' ','%20');
< }
< while (ans.indexOf('?') != -1) {
< ans=ans.replace('?','%3f');
< }
< while (ans.indexOf('&') != -1) {
< ans=ans.replace('&','%26');
< }
< if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&tp=')) == -1 && document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('?tp=')) == -1) {
< document.getElementById(relist[ire]).href+=encodeURIComponent('&tp=') + encodeURIComponent(ans);
< } else if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&tp=')) != -1) {
< document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(encodeURIComponent('&tp='), encodeURIComponent('&tp=') + encodeURIComponent(ans) + String.fromCharCode(96));
< } else if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('?tp=')) != -1) {
< document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(encodeURIComponent('?tp='), encodeURIComponent('?tp=') + encodeURIComponent(ans) + String.fromCharCode(96));
< }
< while (document.getElementById(relist[ire]).href.indexOf(' ') != -1) {
< document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(' ','%20');
< }
< //alert(document.getElementById(relist[ire]).href);
< }
< document.getElementById(relist[ire]).click();
< }
< }
< } else if (ans.substring(0,1).toLowerCase() == 'b' || ans.substring(0,1).toLowerCase() == 'w') {
< if (eval(ans.length) > 1) {
< pstr=ans.substring(1);
< }
< if (prevtlbit != '' && thistlbit != '') {
< if (tltwourl.indexOf('data=') == -1) {
< tltwourl+='&data=';
< } else {
< tltwourl+=',';
< }
< tltwourl+='[~' + encodeURIComponent(tlblurb()) + '~,' + prevtlbit + ',' + thistlbit + ']';
< if (ans.substring(0,1).toLowerCase() == 'w') window.open(iftoobig('',tltwourl), '_blank', 'top=100,left=100,width=500,height=500');
< }
< } else if (ans.substring(0,1).toLowerCase() == 'a' || ans.substring(0,1).toLowerCase() == 'n') {
< if (eval(ans.length) > 1) {
< //pstr=ans.substring(1);
< if (ans.substring(1,2) == '[') eval('cdrnum=' + ans.substring(1));
< }
< if (tlurl.indexOf('[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']') == -1 || tlurl.indexOf('[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']') == -1) {
< if (tlurl.indexOf('data=') == -1) {
< tlurl+='&data=';
< } else {
< tlurl+=',';
< }
< if (tlurl.indexOf('[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']') == -1 && tlurl.indexOf('[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']') == -1) {
< if ('[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']' == '[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']') {
< tlurl+='[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']';
< } else {
< tlurl+='[' + cdsnum[0] + ',' + cdrnum[0] + '' + '],[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']';
< }
< } else if (tlurl.indexOf('[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']') == -1) {
< tlurl+='[' + cdsnum[0] + ',' + cdrnum[0] + '' + ']';
< } if (tlurl.indexOf('[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']') == -1) {
< tlurl+='[' + cdsnum[1] + ',' + cdrnum[1] + '' + ']';
< }
< }
< if (ans.substring(0,1).toLowerCase() == 'n') window.open(iftoobig('',tlurl), '_blank', 'top=100,left=100,width=500,height=500');
< } else if (ans.substring(0,1).toLowerCase() == 'c') {
< location.href=iftoobig('',tlurl);
< } else if (ans.substring(0,1).toLowerCase() == 'y') {
< location.href=iftoobig('',tltwourl);
< } else if (ans.substring(0,1).toLowerCase() == 't') {
< var d1 = new Date(prevdate);
< var d2 = new Date(str);
< if (1 == 2) {
< document.getElementById('myf1').innerHTML=('It is ' + Math.floor((thisdate[1] - thisdate[0]) / (1000*60*60*24)) + ' days from ' + thisdate[0] + ' to ' + thisdate[1] + '.');
< } else {
< alert('It is ' + Math.floor((thisdate[1] - thisdate[0]) / (1000*60*60*24)) + ' days from ' + thisdate[0] + ' to ' + thisdate[1] + '.');
< //var wo=window.open('','_blank','top=200,left=200,width=300,height=50');
< //wo.document.write('It is ' + Math.floor((thisdate[1] - thisdate[0]) / (1000*60*60*24)) + ' days from ' + thisdate[0] + ' to ' + thisdate[1] + '.');
< //if (document.URL.indexOf('&qq=') == -1) {
< // location.href=document.URL + '&qq=1';
< //} else {
< // location.href=document.URL + '9';
< //}
< }
< } else if (ans.substring(0,1).toLowerCase() == 'o') {
< window.open('https://www.google.com/search?q=' + cdnum[0].replace(',','%2C').replace(' ','+').replace(' ','+'), '_blank', 'top=100,left=100,width=400,height=400');
< window.open('https://www.google.com/search?q=' + cdnum[1].replace(',','%2C').replace(' ','+').replace(' ','+'), '_blank', 'top=150,left=150,width=400,height=400');
< } else if (document.URL.indexOf('&data=') == -1) {
< location.href=iftoobig('',document.URL + '&data=' + ourencodeURIComponent(ans));
< } else {
< location.href=iftoobig('',document.URL.replace(pardata, ourencodeURIComponent(ans)));
< }
< }
< }
< prevdate=thisdate;
< prevval=str;
< prevtlbit=thistlbit;
< } else if ((item.row == null && item.column != null) || (eval(ir) < 0 && eval(ic) >= 0)) {
< //alert(8999);
< if (eval(ir) >= 0 && eval(ic) < 0) {
< //alert(999);
< //item.row=ir;
< item.column=ic;
< //alert(9999);
< ir=-1;
< ic=-1;
< } else {
< //alert(61111);
< ir=-1;
< ic=item.column;
< //document.title=ir + ',' + ic;
< }
< var str = dataTable.getFormattedValue(0, item.column);
< message += '{row:none, column:' + item.column + '}; value (row 0) = ' + str;
< }
< }
< if (message == '') {
< message = 'nothing';
< }
< if (1 == 2) console.log('You selected ' + message);
< }
< ir=-1;
< ic=-1;
< }
< }
< //);
< ";
<
665c104
< echo ' dataTable = new google.visualization.DataTable(); ' . "\n";
---
> echo ' var dataTable = new google.visualization.DataTable(); ' . "\n";
678,690c117,118
< echo " chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div')); \n";
< $GETonclick = "";
< if (isset($_GET['onclick'])) $GETonclick = urldecode($_GET['onclick']);
< if (isset($_POST['onclick'])) $GETonclick = urldecode($_POST['onclick']);
< if ($GETonclick != "") {
< echo "google.visualization.events.addListener(chart, 'ready', function() { ready=true; }); \n";
< echo "google.visualization.events.addListener(chart, 'select', myselectfunction); \n";
< }
< echo " chart.draw(dataTable, {'displayAnnotations': true}); \n";
< if ($GETr != "" && $GETc == "") echo " chart.setSelection([{'row': " . $GETr . ", 'column': null}]); setTimeout(myselectfunction,4100); \n";
< if ($GETr == "" && $GETc != "") echo " chart.setSelection([{'row': null, 'column': " . $GETc . "}]); setTimeout(myselectfunction,4100); \n";
< if ($GETr != "" && $GETc != "") echo " chart.setSelection([{'row': " . $GETr . ", 'column': " . $GETc . "}]); setTimeout(myselectfunction,4100); \n";
< echo " } \n";
---
> echo " var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div')); \n";
> echo " chart.draw(dataTable, {'displayAnnotations': true}); \n } \n";
761d188
< if (!isset($_GET['desc1']) && !isset($_POST['desc1'])) {
763,765d189
< } else {
< echo " \n";
< }
768c192
<
---
>
783c207
< echo ' var title = prompt("Enter Annotated Timeline Chart Title (suffix by &onclick=y for added onclick functionality)", "Sold Pencils and Sold Pens"); ' . "\n";
---
> echo ' var title = prompt("Enter Annotated Timeline Chart Title", "Sold Pencils and Sold Pens"); ' . "\n";
798c222
< echo ' bits = "
Click here to Show Chart when All Filled out Below ...
| From | " + ttitle1 + " | " + ttext1 + " | " + ttask1 + " | " + ttask2 + " | " + ttitle2 + " | " + ttext2 + " | To |
";' . "\n";
---
> echo ' bits = "
Click here to Show Chart when All Filled out Below ...
| From | " + ttitle1 + " | " + ttext1 + " | " + ttask1 + " | " + ttask2 + " | " + ttitle2 + " | " + ttext2 + " | To |
";' . "\n";
819c243
< echo ' ct.innerHTML = bits; location.href="#wafo"; ' . "\n";
---
> echo ' ct.innerHTML = bits;' . "\n";