Walking Trip …

Walking Trip

Walking Trip

Offenbach's Suite ... Warts 'n All

Offenbach's Suite ... Warts 'n All

 📅  

If this was interesting you may be interested in this too.

Posted in Photography, Trips | Tagged , , | 34 Comments

Australian Indigenous Language Google Earth Scrolling Tutorial

Australian Indigenous Language Google Earth Scrolling Tutorial

Australian Indigenous Language Google Earth Scrolling Tutorial

Onto yesterday’s Australian Indigenous Language Google Earth Integration Tutorial we had some nuances to attend to, they being …

  • size the map so that all the states show on an initial viewing in non-mobile …
  • for mobile add a meta viewport …
  • better position the semi-transparent orange overlays if the user has needed to scroll in Y …
  • position the popups to be right justified on non-mobile screen, which dovetails better with the smaller initial size now

… getting all the three components to the Australian Indigenous Language web application involved, those being …

… and we’re hoping this helps the user experience.

Stop Press

We did some empirical Google Earth testing …

… and realized to zoom in a bit better (ie. more) …


var gesuffix=',328.51120179a,63169669.71505167d,1y,0h,0t,0r';
gesuffix=',163.0668255a,12879653.61361027d,1y,0h,0t,0r';

… represents a better suffix to the Google Earth “web based” URL arguments (meaning the 5 minute arguments have become 8 minute arguments ahead of the “anger management” classes).


Previous relevant Australian Indigenous Language Google Earth Integration Tutorial is shown below.

Australian Indigenous Language Google Earth Integration Tutorial

Australian Indigenous Language Google Earth Integration Tutorial

Today, we’re revisiting the Australian Indigenous Language web application mentioned in the recent Australian Indigenous Language Drag and Drop Tutorial to add into the SVG overlay related display links to …

… adding to the functionalities interfacing to two of the large players online, when it comes to maps and terrain (off satellite imagery) displays.

We just needed tweaks to our changed mapsvg.js external Javascript developed for the purposes of enhancing that SVG overlay (via image map click) functionality.

This job’s intervention research and development definitely benefitted from this modular approach, meaning new Javascript …


var basisll='', basislltwo='', firstretideas='';

function firstgegm(mnx,mny,mxx,mxy) {
var retideas='';
var thatlat=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[0]) + eval(('' + retll(mxx,mxy)).split(',')[0]))); //eval(0.5 * (eval('' + mnx) + eval('' + mxx)));
var thatlong=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[1]) + eval(('' + retll(mxx,mxy)).split(',')[1]))); //eval(0.5 * (eval('' + mny) + eval('' + mxy)));
basisll=('+' + thatlat).replace('+-','-') + ('+' + thatlong).replace('+-','-').replace('-',',-');
basislltwo=('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-'); //.replace('-',',-');
retideas+="<a style=cursor:pointer; data-href=\"#\" title=\"Google Maps\" onclick=\"window.open('//maps.google.com/maps?z=7&t=m&q=loc:" + ('+' + thatlat).replace('+-','-') + ('+' + thatlong).replace('+-','-').replace('-',',-') + "', '_blank','top=210,left=210,width=600,height=600');\">&#x1F5FA;&#xFE0F;</a> ";
retideas+="<a style=cursor:pointer; data-href=\"#\" title=\"Google Earth\" onclick=\"window.open('//earth.google.com/web/@" + ('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-') + ",328.51120179a,63169669.71505167d,1y,0h,0t,0r', '_blank','top=210,left=210,width=600,height=600');\">&#x1F310;</a> ";
firstretideas=retideas;
return retideas;
}

function gmge(mnx,mny,mxx,mxy) {
var thisbasisll='';
var retideas='';
var thatlat=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[0]) + eval(('' + retll(mxx,mxy)).split(',')[0]))); //eval(0.5 * (eval('' + mnx) + eval('' + mxx)));
var thatlong=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[1]) + eval(('' + retll(mxx,mxy)).split(',')[1]))); //eval(0.5 * (eval('' + mny) + eval('' + mxy)));
thisbasisll=('+' + thatlat).replace('+-','-') + ('+' + thatlong).replace('+-','-').replace('-',',-');
retideas+="<a style=text-decoration:none;cursor:pointer; data-href=\"#\" title=\"Google Maps\" onclick=\"window.open('//maps.google.com/maps?z=7&t=m&q=loc:" + ('+' + thatlat).replace('+-','-') + ('+' + thatlong).replace('+-','-').replace('-',',-') + "', '_blank','top=210,left=210,width=600,height=600');\">&#x1F5FA;&#xFE0F;</a> ";
return thisbasisll; //firstretideas.replace(basisll,thisbasisll);
}

function gegm(mnx,mny,mxx,mxy) {
var thisbasisll='';
var retideas='';
var thatlat=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[0]) + eval(('' + retll(mxx,mxy)).split(',')[0]))); //eval(0.5 * (eval('' + mnx) + eval('' + mxx)));
var thatlong=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[1]) + eval(('' + retll(mxx,mxy)).split(',')[1]))); //eval(0.5 * (eval('' + mny) + eval('' + mxy)));
thisbasisll=('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-'); //.replace('-',',-');
retideas+="<a style=cursor:pointer; data-href=\"#\" title=\"Google Earth\" onclick=\"window.open('//earth.google.com/web/@" + ('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-') + ",328.51120179a,63169669.71505167d,1y,0h,0t,0r', '_blank','top=210,left=210,width=600,height=600');\">&#x1F310;</a> ";
return thisbasisll; //firstretideas.replace(basisll,thisbasisll);
}

… could be called in this way


if (retll) {
if (murl == '' && premurl == '') {
if (appendto) {
turl='rjmmap';
premurl='<br>' + firstgegm(minx,miny,maxx,maxy) + '<a onclick="document.getElementById(' + "'rjmmap'" + ').style.display=' + "'block'" + '; ' + showpreiframe + ' " target="' + turl + '" title="Google Map Chart" href="//www.rjmprogramming.com.au/PHP/Map/map.php?title=';
pregurl=' ' + firstgegm(minx,miny,maxx,maxy) + '<a onclick="document.getElementById(' + "'rjmmap'" + ').style.display=' + "'block'" + '; ' + showpreiframe + ' " target="' + turl + '" title="Google Geo Chart" href="//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?width=556&height=347&country=Places&popularity=&aregeographicals=y&title=';
} else {
premurl='<br>' + firstgegm(minx,miny,maxx,maxy) + '<a target="' + turl + '" title="Google Map Chart" href="//www.rjmprogramming.com.au/PHP/Map/map.php?title=';
pregurl=' ' + firstgegm(minx,miny,maxx,maxy) + '<a target="' + turl + '" title="Google Geo Chart" href="//www.rjmprogramming.com.au/GeoChart/geo_chart.php?width=556&height=347&country=Places&popularity=&aregeographicals=y&title=';
}
midmurl='&onclick=y&label=' + "['Lat',&value='Lon','Name']" + '&data=';
midgurl='&onclick=y&label=[%27Lat%27,&value=%27Lon%27|%27Name%27]&data=';
postmurl='">📍</a>';
postgurl='%20|%20[-90.0|0.0|~%20~,999999999]">🗺</a>';
if (('' + sareas[iareas].title) == '') {
murl=premurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('Place') + midmurl + ',[' + retll(minx,miny) + ',~MinxMiny~],[' + retll(maxx,miny) + ',~MaxxMiny~],[' + retll(maxx,maxy) + ',~MaxxMaxy~],[' + retll(minx,maxy) + ',~MinxMaxy~]' + postmurl;
gurl=pregurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('Place') + midmurl + '[' + retll(minx,miny).replace(',','|') + '|~MinxMiny~,1],[' + retll(maxx,miny).replace(',','|') + '|~MaxxMiny~,1],[' + retll(maxx,maxy).replace(',','|') + '|~MaxxMaxy~,1],[' + retll(minx,maxy).replace(',','|') + '|~MinxMaxy~,1]' + postgurl;
} else {
murl=premurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('' + sareas[iareas].title) + midmurl + ',[' + retll(minx,miny) + ',~MinxMiny~],[' + retll(maxx,miny) + ',~MaxxMiny~],[' + retll(maxx,maxy) + ',~MaxxMaxy~],[' + retll(minx,maxy) + ',~MinxMaxy~]' + postmurl;
gurl=pregurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('' + sareas[iareas].title) + midmurl + '[' + retll(minx,miny).replace(',','|') + '|~MinxMiny~,1],[' + retll(maxx,miny).replace(',','|') + '|~MaxxMiny~,1],[' + retll(maxx,maxy).replace(',','|') + '|~MaxxMaxy~,1],[' + retll(minx,maxy).replace(',','|') + '|~MinxMaxy~,1]' + postgurl;
}
if (appendto) {
appendto.innerHTML+=preiframe + '<iframe id=rjmmap name=rjmmap style="display:none;width:100%;height:600px;" src=""></iframe>';
}
} else if (murl == '') {
if (('' + sareas[iareas].title) == '') {
murl=premurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('Place') + midmurl + ',[' + retll(minx,miny) + ',~MinxMiny~],[' + retll(maxx,miny) + ',~MaxxMiny~],[' + retll(maxx,maxy) + ',~MaxxMaxy~],[' + retll(minx,maxy) + ',~MinxMaxy~]"' + postmurl;
gurl=pregurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('Place') + midmurl + '[' + retll(minx,miny).replace(',','|') + '|~MinxMiny~,1],[' + retll(maxx,miny).replace(',','|') + '|~MaxxMiny~,1],[' + retll(maxx,maxy).replace(',','|') + '|~MaxxMaxy~,1],[' + retll(minx,maxy).replace(',','|') + '|~MinxMaxy~,1]' + postgurl;
} else {
murl=premurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('' + sareas[iareas].title) + midmurl + ',[' + retll(minx,miny) + ',~MinxMiny~],[' + retll(maxx,miny) + ',~MaxxMiny~],[' + retll(maxx,maxy) + ',~MaxxMaxy~],[' + retll(minx,maxy) + ',~MinxMaxy~]"' + postmurl;
gurl=pregurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('' + sareas[iareas].title) + midmurl + '[' + retll(minx,miny).replace(',','|') + '|~MinxMiny~,1],[' + retll(maxx,miny).replace(',','|') + '|~MaxxMiny~,1],[' + retll(maxx,maxy).replace(',','|') + '|~MaxxMaxy~,1],[' + retll(minx,maxy).replace(',','|') + '|~MinxMaxy~,1]' + postgurl;
}
}
}

… to make this integration happen with the Australian Indigenous Language web application.

Stop Press

Meanwhile, back at the ranch, we figured “long hover” Google Earth integration might be good too, and came up with a changed mapsvg.js external Javascript which now …

  1. overrides a Javascript function … in order to wrest control into it’s orbit, if you will …

    var lastpwinll='', secsthatway=-1;

    function pWinIs() { // is a deliberate override
    var retval="<div id='pWin' style=' background-color: #FF8000; width: 200px; height: 160px; position: absolute; font: .9em arial, helvetica, sans-serif; padding: 7px; visibility: hidden; top: 55px; left: 25px; border: 2px #CC1000 dashed; clip: auto; overflow: hidden; z-index:8; opacity:0.8;'></div>";
    setInterval(pwinmonitor, 1000);
    return retval;
    }
  2. and then calls on a new Javascript setInterval timer called …

    var woki=null;

    function pwinmonitor() {
    var thatlat=-999.0, thatlong=-999.0;
    if (document.getElementById('pWin')) {
    if (('' + document.getElementById('pWin').style.visibility).indexOf('hidden') != -1) {
    if (secsthatway >= 0) {
    secsthatway=-1;
    lastpwinll='';
    }
    } else if (('' + document.getElementById('pWin').style.visibility).indexOf('visible') != -1) {
    if (secsthatway < 0) {
    secsthatway=0;
    lastpwinll=document.getElementById('pWin').innerHTML;
    } else if (lastpwinll != document.getElementById('pWin').innerHTML) {
    secsthatway=0;
    lastpwinll=document.getElementById('pWin').innerHTML;
    } else {
    secsthatway++;
    }
    if (secsthatway == 15) {
    if (lastpwinll.indexOf('Latitude:') != -1 && lastpwinll.indexOf('Longitude:') != -1) {
    thatlat=eval('' + lastpwinll.split('Latitude:')[1].substring(0,7).trim());
    thatlong=eval('' + lastpwinll.split('Longitude:')[1].substring(0,7).trim());
    //document.title='' + thatlong + ',' + thatlat;
    if (woki) {
    if (!woki.closed) {
    woki.close();
    }
    }
    woki=window.open('//earth.google.com/web/@' + ('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-') + ',328.51120179a,63169669.71505167d,1y,0h,0t,0r', '_blank','top=210,left=210,width=600,height=600');
    try {
    woki.document.title=lastpwinll.split('Latitude:')[0].replace('<br>', '');
    } catch(hgd) { }
    }
    //secsthatway=-1;
    //lastpwinll='';
    }
    }
    }
    }

Australian Indigenous Language Google Earth Integration Tutorial

… to allow for this “long hover” Google Earth integration idea with the Australian Indigenous Language web application.


Previous relevant Australian Indigenous Language Drag and Drop Tutorial is shown below.

Australian Indigenous Language Drag and Drop Tutorial

Australian Indigenous Language Drag and Drop Tutorial

Further to Australian Indigenous Language HTML Map Trove Tutorial, today, we wanted to see whether the Indigenous Language webpage could be improved by the application of drag and drop functionality. The thing is, “drag and drop” can supplement good “click” logic in this web application, rather than any thoughts regarding replacing it. In that sense we were on the lookout for a new resource regarding Indigenous Languages here in Australia, and found Aboriginal Languages of Australia had interesting audio links that we’ve long been interested in finding, thanks.

Nonetheless, we are not yet at a stage where we’ve seen every “parent” type caller of our still needing to be changed external Javascript countries.js “Drag and Drop specialist” called by the changed external Javascript aboriginal_language_regions.js further called by the changed HTML/Javascript parent called aboriginal_language_regions.html‘s live run link.

In these scenarios where a “child” external Javascript serves a wide range of “parent” needs, you can use global Javascript variables


var amdragging=false, havedropped=false, dropthing='';

… in the “parent” HTML webpage, and the “child” external Javascript typeof methodologies can be used for code like …


console.log("dragStart");
if (typeof(parent.amdragging) !== 'undefined') { parent.amdragging=true; }
if (typeof(parent.havedropped) !== 'undefined') { parent.havedropped=false; }
// ...
console.log("Drop ... " + ev.target.id + ' --- ' + ev.target.outerHTML);
dropdt=(new Date());
if (('' + ev.target.id) != '') {
if (typeof(parent.amdragging) !== 'undefined') { parent.amdragging=false; }
if (typeof(parent.havedropped) !== 'undefined') { parent.havedropped=true; }
} else if (('' + ev.target.outerHTML).indexOf(' alt="') != -1 && typeof(parent.amdragging) !== 'undefined' && typeof(parent.havedropped) !== 'undefined' && typeof(parent.dropthing) !== 'undefined') {
parent.dropthing=('' + ev.target.outerHTML).split(' alt="')[1].split('"')[0];
parent.langwo();
}

… in the country.js external Javascript “Drag and Drop specialist”, helping us associate “drop” logic with an HTML image map‘s area subelement of relevance, and then onto a window.open …


function langwo() {
if (typeof(amdragging) !== 'undefined' && typeof(havedropped) !== 'undefined' && typeof(dropthing) !== 'undefined') {
if (amdragging && !havedropped) { if (dropthing != '') { window.open('//www.dnathan.com/VL/index.php?searchstring=' + encodeURIComponent(dropthing) + '&searchtype=all', '_blank','top=10,left=10,height=' + eval(screen.height / 1.5) + ',width=' + eval(screen.width / 1.4)); } amdragging=false; havedropped=false; dropthing=''; }
}
}

… featuring in a new Javascript function, above, in the web application’s specific aboriginal_language_regions.js external Javascript.


Previous relevant Australian Indigenous Language HTML Map Trove Tutorial is shown below.

Australian Indigenous Language HTML Map Trove Tutorial

Australian Indigenous Language HTML Map Trove Tutorial

Revisiting the web application of Australian Indigenous Language HTML Map jQuery YQL Tutorial we …

  • take a step back, dismantling, at least as far as the user experience goes, the YQL functionality (it being a no-go these days … boo hoo) … and …
  • take a step forward augmenting Google Search links with incredible research content from the wonderful Trove

    Trove is a collaboration between the National Library of Australia and hundreds of Partner organisations around Australia.

… a feature we wish we’d got together earlier on, even back to the time of Australian Historical Research Primer Tutorial back in a 2014 look at Trove. Since then it’s had a great and useful makeover!

The changed external Javascript called aboriginal_language_regions.js is called by the changed HTML/Javascript parent called aboriginal_language_regions.html‘s live run link is a place for you to research “the oldest surviving culture in the world”.


Previous relevant Australian Indigenous Language HTML Map jQuery YQL Tutorial is shown below.

Australian Indigenous Language HTML Map jQuery YQL Tutorial

Australian Indigenous Language HTML Map jQuery YQL Tutorial

Our image map web application exploring Indigenous Australian Language, History and Culture quest continues, this time adding some jQuery and YQL and Ajax functionality best suited to non-mobile platform usage, but still appearing in the mobile “world” during a touch operation, as distinct from the “onhover” event scenario for non-mobile platforms.

Ajax is, for non-mobile platforms, a way to add functionality without moving off the webpage you are on, by gleaning information from other sources of data such as …

  • local HTML (or PHP) webpages
  • local data files
  • local database information
  • same domain HTML (or PHP) webpages
  • same domain data files

… but if you involve jQuery (Javascript library) as well (and we still hold off involving any server-side PHP, you’ll notice, and thanks here go to this very useful link) you can add …

… and so we do this today by adding the functionality to optionally find books of specific interest to your subject of interest as you roam (or “hover”) across the image map.

We facilitate this functionality for the user, again, via the use of a checkbox.

The changes to Javascript code as per aboriginal_language_regions.js are reflected by this link from yesterday.

The supervising HTML code as per aboriginal_language_regions.html needed to change to load the jQuery as reflected by this link from yesterday.

The minor changes to CSS as per aboriginal_language_regions.css are reflected by this link from yesterday.

To see this in action take a look at today’s live run.


Previous relevant Australian Indigenous Language Image Map Ajax Tutorial is shown below.

Australian Indigenous Language Image Map Ajax Tutorial

Australian Indigenous Language Image Map Ajax Tutorial

Today, again, we mix geography and history in an image map web application exploring Indigenous Australian Language, History and Culture, this time adding some Ajax functionality best suited to non-mobile platform usage.

Ajax is, for non-mobile platforms, a way to add functionality without moving off the webpage you are on, by gleaning information from other sources of data such as …

  • local HTML (or PHP) webpages
  • local data files
  • local database information
  • same domain HTML (or PHP) webpages
  • same domain data files

Again, here, we are talking about Javascript functionality, still not having to resort to any server-side language such as PHP, and though you can use jQuery calls to do this also, we do not call on any of this, as we just use Javascript code.

And the background context to all this … we established a “MobileFish” inspired HTML map element scenario with the following components …

  • a brilliant piece of research from the University of Western Sydney and ending up on the TreatyRepublic.net website as a map image … thanks
  • using the wonderful MobileFish image map (HTML element) creator helper … thanks

Today sees the introduction of an external CSS file, for styling, for the first time. This introduction of CSS causes the only change to our parent HTML code aboriginal_language_regions.html changed as per this link from yesterday.

The changes to Javascript code as per aboriginal_language_regions.js are reflected by this link from yesterday.

The fairly simple external CSS code file could be called aboriginal_language_regions.css

Yesterday we presented Australian Indigenous Language Image Map Checkbox Tutorial as shown below. The checkboxes are added to become …

  1. Images (will result in Google Image Search)
  2. Videos (will result in Google Video Search (if no Image Searching is happening))
  3. Map (onclick) (will additionally result in popup window of Google Map Chart (see also PHP/Javascript/HTML Google Chart Map Tutorial) of the tribal area)
  4. Map (onhover) (will additionally, via Ajax functionality, result in popup window of Google Map Chart (see also PHP/Javascript/HTML Google Chart Map Tutorial) of the tribal area)

It is this last functionality that will not work on mobile platforms, most likely, because the onmouseover event they use doesn’t happen with touch platforms.

You can try the web application as it stands now with our line run link.


Previous relevant Australian Indigenous Language Image Map Checkbox Tutorial is shown below.

Australian Indigenous Language Image Map Checkbox Tutorial

Australian Indigenous Language Image Map Checkbox Tutorial

Like yesterday, today we mix geography and history in an image map web application exploring Indigenous Australian Language, History and Culture, “the oldest surviving culture in the world”. Today’s tutorial, extending on yesterday’s Australian Indigenous Language Image Map Dropdown Tutorial continues the Javascript DOM methodology, and shows the use of checkboxes.

The HTML input tag’s checkbox type is a “binary” decision maker, boiling down to a yes/no (or true/false) decision on something. A related HTML input tag type is called the radio button, which allows two or more choices, only one of which can be yes (or true). Checkboxes are more independent than radio buttons, and perhaps more generically useful in that respect. However, if stringency and transparency of purpose is what you are after, a radio button leaves no doubt as to interpretation for the user, usually, because the element can only highlight at most one option.

Our checkboxes today are for …

  1. Images (will result in Google Image Search)
  2. Videos (will result in Google Video Search (if no Image Searching is happening))
  3. Map (will additionally result in popup window of Google Map Chart (see also PHP/Javascript/HTML Google Chart Map Tutorial) of the tribal area)

As you can see, there is more complication here that a radio button, on its own, cannot resolve.

Just reviewing how we got here … we established a “MobileFish” inspired HTML map element scenario with the following components …

  • a brilliant piece of research from the University of Western Sydney and ending up on the TreatyRepublic.net website as a map image … thanks
  • using the wonderful MobileFish image map (HTML element) creator helper … thanks

From there we’ve been developing external Javascript to allow a dropdown and checkboxes, with minimal change to that originally written HTML, and without resorting to PHP usage.

So please take a look at today’s live run (HTML source code (you could call) aboriginal_language_regions.html unchanged from yesterday, and calling on the external Javascript aboriginal_language_regions.js changed as per this link from yesterday) where we add those three new checkbox elements to refine our Google Search information, and add “map” functionality via Google Map Chart.


Previous relevant Australian Indigenous Language Image Map Dropdown Tutorial is shown below.

Australian Indigenous Language Image Map Dropdown Tutorial

Australian Indigenous Language Image Map Dropdown Tutorial

Today we mix geography and history in an image map web application exploring Indigenous Australian Language, History and Culture. We’ll be devoting a blog posting to the subject in the future, but today’s tutorial, extending on yesterday’s Australian Indigenous Language Image Map Primer Tutorial and its promise of more Javascript DOM functionality to follow, uses a Javascript DOM technique we term here, the “Javascript DOM Big Changes” technique, which is the idea of manipulating “document.body.innerHTML” as a whole.

This technique of manipulating “document.body.innerHTML” as a whole is all fine to do, but you should remember with it that values the user has set, since, with dropdown selection, for instance, need to be taken into account, as a separate stage afterwards, with this method … you’ll see what we mean …

Introduction to Australia’s Aboriginal Culture by David M. Welch. … Aboriginal culture probably represents the oldest surviving culture in the world


function selchange(osel) {
var ov=osel.value;
var oi=osel.id;
document.body.innerHTML = document.body.innerHTML.replace(/" target="_blank"/g, "+'" + ov.replace(/ /g, "%20") + "'" + '" target="_blank"');
document.getElementById(oi).value = ov;
}

… in code above, for the dropdown’s “onchange” event logic … or by trying your own scenarios … which am 100% certain you’ll be beavering away at within minutes of reading today’s offering?!

Is the “document.body.innerHTML” a refresh? It sort of acts like one, but it is more as well, because you have your own logic controls over what gets “refreshed into” … something a little more comfortable, perhaps?!

Now, back to the real world purpose of this technique. Yesterday we established a “MobileFish” inspired HTML map element scenario with the following components …

  • a brilliant piece of research from the University of Western Sydney and ending up on the TreatyRepublic.net website as a map image … thanks
  • using the wonderful MobileFish image map (HTML element) creator helper … thanks

… so now we virtually leave that HTML intact and only mildly changed, and do not use PHP, no matter how tempting that is for me to do, and use Javascript on that existant HTML (which, by the way, will eventually be fleshed out to avoid ‘Under construction’ messages, eventually) to perform significant functional improvements. This Javascript is external Javascript, hence the minimalist approach to changes to the HTML.

So take a look at today’s live run (HTML source code (you could call) aboriginal_language_regions.html changed as per this link from yesterday, and calling on the external Javascript aboriginal_language_regions.js) where we add the dropdown HTML select element at the top to refine our Google Search information.


Previous relevant Australian Indigenous Language Image Map Primer Tutorial is shown below.

Australian Indigenous Language Image Map Primer Tutorial

Australian Indigenous Language Image Map Primer Tutorial

We want to show more ideas with Javascript DOM and the HTML map element over coming days.

The HTML map element is a very useful way to combine a graphical image with web functionality, by turning that image into a clickable, by region, entity.

For the theme of work over the next few days we combine history and geography. Remember at school that history and geography were choices at a certain stage of schooling, but today, we try to use geography to foster an interest in history … after all, where we live is really important to how history pans out for society.

Was inspired by a story of a several meter high atlas that is currently on display in our New South Wales library … and it takes two people to turn a page, else the weight of the page will tear it with only one person turning.

This thought of maps combined with me with a story about how diverse and interesting our Australian Indigenous Languages are here in Australia. There are hundreds of languages involved in Australia’s history, though we often only think of English … so take a look at today’s live run (HTML source code (you could call) aboriginal_language_regions.html) where we show …

  • a brilliant piece of research from the University of Western Sydney and ending up on the TreatyRepublic.net website as a map image … thanks
  • using the wonderful MobileFish image map (HTML element) creator helper … thanks

… to set up that initial additional “onclick” intelligence that takes you to some Google search engine opportunities to link a region of Australia with an indigenous tribe (and its language), as a first step in the functionality we develop over time.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Australian Indigenous Language Google Earth Integration Tutorial

Australian Indigenous Language Google Earth Integration Tutorial

Australian Indigenous Language Google Earth Integration Tutorial

Today, we’re revisiting the Australian Indigenous Language web application mentioned in the recent Australian Indigenous Language Drag and Drop Tutorial to add into the SVG overlay related display links to …

… adding to the functionalities interfacing to two of the large players online, when it comes to maps and terrain (off satellite imagery) displays.

We just needed tweaks to our changed mapsvg.js external Javascript developed for the purposes of enhancing that SVG overlay (via image map click) functionality.

This job’s intervention research and development definitely benefitted from this modular approach, meaning new Javascript …


var basisll='', basislltwo='', firstretideas='';

function firstgegm(mnx,mny,mxx,mxy) {
var retideas='';
var thatlat=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[0]) + eval(('' + retll(mxx,mxy)).split(',')[0]))); //eval(0.5 * (eval('' + mnx) + eval('' + mxx)));
var thatlong=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[1]) + eval(('' + retll(mxx,mxy)).split(',')[1]))); //eval(0.5 * (eval('' + mny) + eval('' + mxy)));
basisll=('+' + thatlat).replace('+-','-') + ('+' + thatlong).replace('+-','-').replace('-',',-');
basislltwo=('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-'); //.replace('-',',-');
retideas+="<a style=cursor:pointer; data-href=\"#\" title=\"Google Maps\" onclick=\"window.open('//maps.google.com/maps?z=7&t=m&q=loc:" + ('+' + thatlat).replace('+-','-') + ('+' + thatlong).replace('+-','-').replace('-',',-') + "', '_blank','top=210,left=210,width=600,height=600');\">&#x1F5FA;&#xFE0F;</a> ";
retideas+="<a style=cursor:pointer; data-href=\"#\" title=\"Google Earth\" onclick=\"window.open('//earth.google.com/web/@" + ('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-') + ",328.51120179a,63169669.71505167d,1y,0h,0t,0r', '_blank','top=210,left=210,width=600,height=600');\">&#x1F310;</a> ";
firstretideas=retideas;
return retideas;
}

function gmge(mnx,mny,mxx,mxy) {
var thisbasisll='';
var retideas='';
var thatlat=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[0]) + eval(('' + retll(mxx,mxy)).split(',')[0]))); //eval(0.5 * (eval('' + mnx) + eval('' + mxx)));
var thatlong=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[1]) + eval(('' + retll(mxx,mxy)).split(',')[1]))); //eval(0.5 * (eval('' + mny) + eval('' + mxy)));
thisbasisll=('+' + thatlat).replace('+-','-') + ('+' + thatlong).replace('+-','-').replace('-',',-');
retideas+="<a style=text-decoration:none;cursor:pointer; data-href=\"#\" title=\"Google Maps\" onclick=\"window.open('//maps.google.com/maps?z=7&t=m&q=loc:" + ('+' + thatlat).replace('+-','-') + ('+' + thatlong).replace('+-','-').replace('-',',-') + "', '_blank','top=210,left=210,width=600,height=600');\">&#x1F5FA;&#xFE0F;</a> ";
return thisbasisll; //firstretideas.replace(basisll,thisbasisll);
}

function gegm(mnx,mny,mxx,mxy) {
var thisbasisll='';
var retideas='';
var thatlat=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[0]) + eval(('' + retll(mxx,mxy)).split(',')[0]))); //eval(0.5 * (eval('' + mnx) + eval('' + mxx)));
var thatlong=eval(0.5 * (eval(('' + retll(mnx,mny)).split(',')[1]) + eval(('' + retll(mxx,mxy)).split(',')[1]))); //eval(0.5 * (eval('' + mny) + eval('' + mxy)));
thisbasisll=('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-'); //.replace('-',',-');
retideas+="<a style=cursor:pointer; data-href=\"#\" title=\"Google Earth\" onclick=\"window.open('//earth.google.com/web/@" + ('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-') + ",328.51120179a,63169669.71505167d,1y,0h,0t,0r', '_blank','top=210,left=210,width=600,height=600');\">&#x1F310;</a> ";
return thisbasisll; //firstretideas.replace(basisll,thisbasisll);
}

… could be called in this way


if (retll) {
if (murl == '' && premurl == '') {
if (appendto) {
turl='rjmmap';
premurl='<br>' + firstgegm(minx,miny,maxx,maxy) + '<a onclick="document.getElementById(' + "'rjmmap'" + ').style.display=' + "'block'" + '; ' + showpreiframe + ' " target="' + turl + '" title="Google Map Chart" href="//www.rjmprogramming.com.au/PHP/Map/map.php?title=';
pregurl=' ' + firstgegm(minx,miny,maxx,maxy) + '<a onclick="document.getElementById(' + "'rjmmap'" + ').style.display=' + "'block'" + '; ' + showpreiframe + ' " target="' + turl + '" title="Google Geo Chart" href="//www.rjmprogramming.com.au/PHP/GeoChart/geo_chart.php?width=556&height=347&country=Places&popularity=&aregeographicals=y&title=';
} else {
premurl='<br>' + firstgegm(minx,miny,maxx,maxy) + '<a target="' + turl + '" title="Google Map Chart" href="//www.rjmprogramming.com.au/PHP/Map/map.php?title=';
pregurl=' ' + firstgegm(minx,miny,maxx,maxy) + '<a target="' + turl + '" title="Google Geo Chart" href="//www.rjmprogramming.com.au/GeoChart/geo_chart.php?width=556&height=347&country=Places&popularity=&aregeographicals=y&title=';
}
midmurl='&onclick=y&label=' + "['Lat',&value='Lon','Name']" + '&data=';
midgurl='&onclick=y&label=[%27Lat%27,&value=%27Lon%27|%27Name%27]&data=';
postmurl='">📍</a>';
postgurl='%20|%20[-90.0|0.0|~%20~,999999999]">🗺</a>';
if (('' + sareas[iareas].title) == '') {
murl=premurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('Place') + midmurl + ',[' + retll(minx,miny) + ',~MinxMiny~],[' + retll(maxx,miny) + ',~MaxxMiny~],[' + retll(maxx,maxy) + ',~MaxxMaxy~],[' + retll(minx,maxy) + ',~MinxMaxy~]' + postmurl;
gurl=pregurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('Place') + midmurl + '[' + retll(minx,miny).replace(',','|') + '|~MinxMiny~,1],[' + retll(maxx,miny).replace(',','|') + '|~MaxxMiny~,1],[' + retll(maxx,maxy).replace(',','|') + '|~MaxxMaxy~,1],[' + retll(minx,maxy).replace(',','|') + '|~MinxMaxy~,1]' + postgurl;
} else {
murl=premurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('' + sareas[iareas].title) + midmurl + ',[' + retll(minx,miny) + ',~MinxMiny~],[' + retll(maxx,miny) + ',~MaxxMiny~],[' + retll(maxx,maxy) + ',~MaxxMaxy~],[' + retll(minx,maxy) + ',~MinxMaxy~]' + postmurl;
gurl=pregurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('' + sareas[iareas].title) + midmurl + '[' + retll(minx,miny).replace(',','|') + '|~MinxMiny~,1],[' + retll(maxx,miny).replace(',','|') + '|~MaxxMiny~,1],[' + retll(maxx,maxy).replace(',','|') + '|~MaxxMaxy~,1],[' + retll(minx,maxy).replace(',','|') + '|~MinxMaxy~,1]' + postgurl;
}
if (appendto) {
appendto.innerHTML+=preiframe + '<iframe id=rjmmap name=rjmmap style="display:none;width:100%;height:600px;" src=""></iframe>';
}
} else if (murl == '') {
if (('' + sareas[iareas].title) == '') {
murl=premurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('Place') + midmurl + ',[' + retll(minx,miny) + ',~MinxMiny~],[' + retll(maxx,miny) + ',~MaxxMiny~],[' + retll(maxx,maxy) + ',~MaxxMaxy~],[' + retll(minx,maxy) + ',~MinxMaxy~]"' + postmurl;
gurl=pregurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('Place') + midmurl + '[' + retll(minx,miny).replace(',','|') + '|~MinxMiny~,1],[' + retll(maxx,miny).replace(',','|') + '|~MaxxMiny~,1],[' + retll(maxx,maxy).replace(',','|') + '|~MaxxMaxy~,1],[' + retll(minx,maxy).replace(',','|') + '|~MinxMaxy~,1]' + postgurl;
} else {
murl=premurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('' + sareas[iareas].title) + midmurl + ',[' + retll(minx,miny) + ',~MinxMiny~],[' + retll(maxx,miny) + ',~MaxxMiny~],[' + retll(maxx,maxy) + ',~MaxxMaxy~],[' + retll(minx,maxy) + ',~MinxMaxy~]"' + postmurl;
gurl=pregurl.replace(basisll,gmge(minx,miny,maxx,maxy)).replace(basislltwo,gegm(minx,miny,maxx,maxy)) + encodeURIComponent('' + sareas[iareas].title) + midmurl + '[' + retll(minx,miny).replace(',','|') + '|~MinxMiny~,1],[' + retll(maxx,miny).replace(',','|') + '|~MaxxMiny~,1],[' + retll(maxx,maxy).replace(',','|') + '|~MaxxMaxy~,1],[' + retll(minx,maxy).replace(',','|') + '|~MinxMaxy~,1]' + postgurl;
}
}
}

… to make this integration happen with the Australian Indigenous Language web application.

Stop Press

Meanwhile, back at the ranch, we figured “long hover” Google Earth integration might be good too, and came up with a changed mapsvg.js external Javascript which now …

  1. overrides a Javascript function … in order to wrest control into it’s orbit, if you will …

    var lastpwinll='', secsthatway=-1;

    function pWinIs() { // is a deliberate override
    var retval="<div id='pWin' style=' background-color: #FF8000; width: 200px; height: 160px; position: absolute; font: .9em arial, helvetica, sans-serif; padding: 7px; visibility: hidden; top: 55px; left: 25px; border: 2px #CC1000 dashed; clip: auto; overflow: hidden; z-index:8; opacity:0.8;'></div>";
    setInterval(pwinmonitor, 1000);
    return retval;
    }
  2. and then calls on a new Javascript setInterval timer called …

    var woki=null;

    function pwinmonitor() {
    var thatlat=-999.0, thatlong=-999.0;
    if (document.getElementById('pWin')) {
    if (('' + document.getElementById('pWin').style.visibility).indexOf('hidden') != -1) {
    if (secsthatway >= 0) {
    secsthatway=-1;
    lastpwinll='';
    }
    } else if (('' + document.getElementById('pWin').style.visibility).indexOf('visible') != -1) {
    if (secsthatway < 0) {
    secsthatway=0;
    lastpwinll=document.getElementById('pWin').innerHTML;
    } else if (lastpwinll != document.getElementById('pWin').innerHTML) {
    secsthatway=0;
    lastpwinll=document.getElementById('pWin').innerHTML;
    } else {
    secsthatway++;
    }
    if (secsthatway == 15) {
    if (lastpwinll.indexOf('Latitude:') != -1 && lastpwinll.indexOf('Longitude:') != -1) {
    thatlat=eval('' + lastpwinll.split('Latitude:')[1].substring(0,7).trim());
    thatlong=eval('' + lastpwinll.split('Longitude:')[1].substring(0,7).trim());
    //document.title='' + thatlong + ',' + thatlat;
    if (woki) {
    if (!woki.closed) {
    woki.close();
    }
    }
    woki=window.open('//earth.google.com/web/@' + ('+' + thatlat).replace('+-','-') + (',+' + thatlong).replace('+-','-') + ',328.51120179a,63169669.71505167d,1y,0h,0t,0r', '_blank','top=210,left=210,width=600,height=600');
    try {
    woki.document.title=lastpwinll.split('Latitude:')[0].replace('<br>', '');
    } catch(hgd) { }
    }
    //secsthatway=-1;
    //lastpwinll='';
    }
    }
    }
    }

Australian Indigenous Language Google Earth Integration Tutorial

… to allow for this “long hover” Google Earth integration idea with the Australian Indigenous Language web application.


Previous relevant Australian Indigenous Language Drag and Drop Tutorial is shown below.

Australian Indigenous Language Drag and Drop Tutorial

Australian Indigenous Language Drag and Drop Tutorial

Further to Australian Indigenous Language HTML Map Trove Tutorial, today, we wanted to see whether the Indigenous Language webpage could be improved by the application of drag and drop functionality. The thing is, “drag and drop” can supplement good “click” logic in this web application, rather than any thoughts regarding replacing it. In that sense we were on the lookout for a new resource regarding Indigenous Languages here in Australia, and found Aboriginal Languages of Australia had interesting audio links that we’ve long been interested in finding, thanks.

Nonetheless, we are not yet at a stage where we’ve seen every “parent” type caller of our still needing to be changed external Javascript countries.js “Drag and Drop specialist” called by the changed external Javascript aboriginal_language_regions.js further called by the changed HTML/Javascript parent called aboriginal_language_regions.html‘s live run link.

In these scenarios where a “child” external Javascript serves a wide range of “parent” needs, you can use global Javascript variables


var amdragging=false, havedropped=false, dropthing='';

… in the “parent” HTML webpage, and the “child” external Javascript typeof methodologies can be used for code like …


console.log("dragStart");
if (typeof(parent.amdragging) !== 'undefined') { parent.amdragging=true; }
if (typeof(parent.havedropped) !== 'undefined') { parent.havedropped=false; }
// ...
console.log("Drop ... " + ev.target.id + ' --- ' + ev.target.outerHTML);
dropdt=(new Date());
if (('' + ev.target.id) != '') {
if (typeof(parent.amdragging) !== 'undefined') { parent.amdragging=false; }
if (typeof(parent.havedropped) !== 'undefined') { parent.havedropped=true; }
} else if (('' + ev.target.outerHTML).indexOf(' alt="') != -1 && typeof(parent.amdragging) !== 'undefined' && typeof(parent.havedropped) !== 'undefined' && typeof(parent.dropthing) !== 'undefined') {
parent.dropthing=('' + ev.target.outerHTML).split(' alt="')[1].split('"')[0];
parent.langwo();
}

… in the country.js external Javascript “Drag and Drop specialist”, helping us associate “drop” logic with an HTML image map‘s area subelement of relevance, and then onto a window.open …


function langwo() {
if (typeof(amdragging) !== 'undefined' && typeof(havedropped) !== 'undefined' && typeof(dropthing) !== 'undefined') {
if (amdragging && !havedropped) { if (dropthing != '') { window.open('//www.dnathan.com/VL/index.php?searchstring=' + encodeURIComponent(dropthing) + '&searchtype=all', '_blank','top=10,left=10,height=' + eval(screen.height / 1.5) + ',width=' + eval(screen.width / 1.4)); } amdragging=false; havedropped=false; dropthing=''; }
}
}

… featuring in a new Javascript function, above, in the web application’s specific aboriginal_language_regions.js external Javascript.


Previous relevant Australian Indigenous Language HTML Map Trove Tutorial is shown below.

Australian Indigenous Language HTML Map Trove Tutorial

Australian Indigenous Language HTML Map Trove Tutorial

Revisiting the web application of Australian Indigenous Language HTML Map jQuery YQL Tutorial we …

  • take a step back, dismantling, at least as far as the user experience goes, the YQL functionality (it being a no-go these days … boo hoo) … and …
  • take a step forward augmenting Google Search links with incredible research content from the wonderful Trove

    Trove is a collaboration between the National Library of Australia and hundreds of Partner organisations around Australia.

… a feature we wish we’d got together earlier on, even back to the time of Australian Historical Research Primer Tutorial back in a 2014 look at Trove. Since then it’s had a great and useful makeover!

The changed external Javascript called aboriginal_language_regions.js is called by the changed HTML/Javascript parent called aboriginal_language_regions.html‘s live run link is a place for you to research “the oldest surviving culture in the world”.


Previous relevant Australian Indigenous Language HTML Map jQuery YQL Tutorial is shown below.

Australian Indigenous Language HTML Map jQuery YQL Tutorial

Australian Indigenous Language HTML Map jQuery YQL Tutorial

Our image map web application exploring Indigenous Australian Language, History and Culture quest continues, this time adding some jQuery and YQL and Ajax functionality best suited to non-mobile platform usage, but still appearing in the mobile “world” during a touch operation, as distinct from the “onhover” event scenario for non-mobile platforms.

Ajax is, for non-mobile platforms, a way to add functionality without moving off the webpage you are on, by gleaning information from other sources of data such as …

  • local HTML (or PHP) webpages
  • local data files
  • local database information
  • same domain HTML (or PHP) webpages
  • same domain data files

… but if you involve jQuery (Javascript library) as well (and we still hold off involving any server-side PHP, you’ll notice, and thanks here go to this very useful link) you can add …

… and so we do this today by adding the functionality to optionally find books of specific interest to your subject of interest as you roam (or “hover”) across the image map.

We facilitate this functionality for the user, again, via the use of a checkbox.

The changes to Javascript code as per aboriginal_language_regions.js are reflected by this link from yesterday.

The supervising HTML code as per aboriginal_language_regions.html needed to change to load the jQuery as reflected by this link from yesterday.

The minor changes to CSS as per aboriginal_language_regions.css are reflected by this link from yesterday.

To see this in action take a look at today’s live run.


Previous relevant Australian Indigenous Language Image Map Ajax Tutorial is shown below.

Australian Indigenous Language Image Map Ajax Tutorial

Australian Indigenous Language Image Map Ajax Tutorial

Today, again, we mix geography and history in an image map web application exploring Indigenous Australian Language, History and Culture, this time adding some Ajax functionality best suited to non-mobile platform usage.

Ajax is, for non-mobile platforms, a way to add functionality without moving off the webpage you are on, by gleaning information from other sources of data such as …

  • local HTML (or PHP) webpages
  • local data files
  • local database information
  • same domain HTML (or PHP) webpages
  • same domain data files

Again, here, we are talking about Javascript functionality, still not having to resort to any server-side language such as PHP, and though you can use jQuery calls to do this also, we do not call on any of this, as we just use Javascript code.

And the background context to all this … we established a “MobileFish” inspired HTML map element scenario with the following components …

  • a brilliant piece of research from the University of Western Sydney and ending up on the TreatyRepublic.net website as a map image … thanks
  • using the wonderful MobileFish image map (HTML element) creator helper … thanks

Today sees the introduction of an external CSS file, for styling, for the first time. This introduction of CSS causes the only change to our parent HTML code aboriginal_language_regions.html changed as per this link from yesterday.

The changes to Javascript code as per aboriginal_language_regions.js are reflected by this link from yesterday.

The fairly simple external CSS code file could be called aboriginal_language_regions.css

Yesterday we presented Australian Indigenous Language Image Map Checkbox Tutorial as shown below. The checkboxes are added to become …

  1. Images (will result in Google Image Search)
  2. Videos (will result in Google Video Search (if no Image Searching is happening))
  3. Map (onclick) (will additionally result in popup window of Google Map Chart (see also PHP/Javascript/HTML Google Chart Map Tutorial) of the tribal area)
  4. Map (onhover) (will additionally, via Ajax functionality, result in popup window of Google Map Chart (see also PHP/Javascript/HTML Google Chart Map Tutorial) of the tribal area)

It is this last functionality that will not work on mobile platforms, most likely, because the onmouseover event they use doesn’t happen with touch platforms.

You can try the web application as it stands now with our line run link.


Previous relevant Australian Indigenous Language Image Map Checkbox Tutorial is shown below.

Australian Indigenous Language Image Map Checkbox Tutorial

Australian Indigenous Language Image Map Checkbox Tutorial

Like yesterday, today we mix geography and history in an image map web application exploring Indigenous Australian Language, History and Culture, “the oldest surviving culture in the world”. Today’s tutorial, extending on yesterday’s Australian Indigenous Language Image Map Dropdown Tutorial continues the Javascript DOM methodology, and shows the use of checkboxes.

The HTML input tag’s checkbox type is a “binary” decision maker, boiling down to a yes/no (or true/false) decision on something. A related HTML input tag type is called the radio button, which allows two or more choices, only one of which can be yes (or true). Checkboxes are more independent than radio buttons, and perhaps more generically useful in that respect. However, if stringency and transparency of purpose is what you are after, a radio button leaves no doubt as to interpretation for the user, usually, because the element can only highlight at most one option.

Our checkboxes today are for …

  1. Images (will result in Google Image Search)
  2. Videos (will result in Google Video Search (if no Image Searching is happening))
  3. Map (will additionally result in popup window of Google Map Chart (see also PHP/Javascript/HTML Google Chart Map Tutorial) of the tribal area)

As you can see, there is more complication here that a radio button, on its own, cannot resolve.

Just reviewing how we got here … we established a “MobileFish” inspired HTML map element scenario with the following components …

  • a brilliant piece of research from the University of Western Sydney and ending up on the TreatyRepublic.net website as a map image … thanks
  • using the wonderful MobileFish image map (HTML element) creator helper … thanks

From there we’ve been developing external Javascript to allow a dropdown and checkboxes, with minimal change to that originally written HTML, and without resorting to PHP usage.

So please take a look at today’s live run (HTML source code (you could call) aboriginal_language_regions.html unchanged from yesterday, and calling on the external Javascript aboriginal_language_regions.js changed as per this link from yesterday) where we add those three new checkbox elements to refine our Google Search information, and add “map” functionality via Google Map Chart.


Previous relevant Australian Indigenous Language Image Map Dropdown Tutorial is shown below.

Australian Indigenous Language Image Map Dropdown Tutorial

Australian Indigenous Language Image Map Dropdown Tutorial

Today we mix geography and history in an image map web application exploring Indigenous Australian Language, History and Culture. We’ll be devoting a blog posting to the subject in the future, but today’s tutorial, extending on yesterday’s Australian Indigenous Language Image Map Primer Tutorial and its promise of more Javascript DOM functionality to follow, uses a Javascript DOM technique we term here, the “Javascript DOM Big Changes” technique, which is the idea of manipulating “document.body.innerHTML” as a whole.

This technique of manipulating “document.body.innerHTML” as a whole is all fine to do, but you should remember with it that values the user has set, since, with dropdown selection, for instance, need to be taken into account, as a separate stage afterwards, with this method … you’ll see what we mean …

Introduction to Australia’s Aboriginal Culture by David M. Welch. … Aboriginal culture probably represents the oldest surviving culture in the world


function selchange(osel) {
var ov=osel.value;
var oi=osel.id;
document.body.innerHTML = document.body.innerHTML.replace(/" target="_blank"/g, "+'" + ov.replace(/ /g, "%20") + "'" + '" target="_blank"');
document.getElementById(oi).value = ov;
}

… in code above, for the dropdown’s “onchange” event logic … or by trying your own scenarios … which am 100% certain you’ll be beavering away at within minutes of reading today’s offering?!

Is the “document.body.innerHTML” a refresh? It sort of acts like one, but it is more as well, because you have your own logic controls over what gets “refreshed into” … something a little more comfortable, perhaps?!

Now, back to the real world purpose of this technique. Yesterday we established a “MobileFish” inspired HTML map element scenario with the following components …

  • a brilliant piece of research from the University of Western Sydney and ending up on the TreatyRepublic.net website as a map image … thanks
  • using the wonderful MobileFish image map (HTML element) creator helper … thanks

… so now we virtually leave that HTML intact and only mildly changed, and do not use PHP, no matter how tempting that is for me to do, and use Javascript on that existant HTML (which, by the way, will eventually be fleshed out to avoid ‘Under construction’ messages, eventually) to perform significant functional improvements. This Javascript is external Javascript, hence the minimalist approach to changes to the HTML.

So take a look at today’s live run (HTML source code (you could call) aboriginal_language_regions.html changed as per this link from yesterday, and calling on the external Javascript aboriginal_language_regions.js) where we add the dropdown HTML select element at the top to refine our Google Search information.


Previous relevant Australian Indigenous Language Image Map Primer Tutorial is shown below.

Australian Indigenous Language Image Map Primer Tutorial

Australian Indigenous Language Image Map Primer Tutorial

We want to show more ideas with Javascript DOM and the HTML map element over coming days.

The HTML map element is a very useful way to combine a graphical image with web functionality, by turning that image into a clickable, by region, entity.

For the theme of work over the next few days we combine history and geography. Remember at school that history and geography were choices at a certain stage of schooling, but today, we try to use geography to foster an interest in history … after all, where we live is really important to how history pans out for society.

Was inspired by a story of a several meter high atlas that is currently on display in our New South Wales library … and it takes two people to turn a page, else the weight of the page will tear it with only one person turning.

This thought of maps combined with me with a story about how diverse and interesting our Australian Indigenous Languages are here in Australia. There are hundreds of languages involved in Australia’s history, though we often only think of English … so take a look at today’s live run (HTML source code (you could call) aboriginal_language_regions.html) where we show …

  • a brilliant piece of research from the University of Western Sydney and ending up on the TreatyRepublic.net website as a map image … thanks
  • using the wonderful MobileFish image map (HTML element) creator helper … thanks

… to set up that initial additional “onclick” intelligence that takes you to some Google search engine opportunities to link a region of Australia with an indigenous tribe (and its language), as a first step in the functionality we develop over time.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Photography, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

PHP Wikipedia List Better Modularized Scrolling Tutorial

PHP Wikipedia List Better Modularized Scrolling Tutorial

PHP Wikipedia List Better Modularized Scrolling Tutorial

Around here we really like the …

cloning of code

… concept. Howevvvvvvverrr (and we think a but is needed for em-pha-sis) when you are busy cloning, perhaps during the cloning in the current line of thinking, but while you are there, perhaps during the first such clone, think about, on the client-side of the work …

  • what is going to be common “across the board” regarding client-side Javascript requirements …
  • can that be, the sooner the better, be hived off into an external Javascript … which …
  • all the clones call

We wish, today, that we had done that more with our, albeit PHP (but even PHP will have a client-side to it) suite of web applications in the Australian Lighthouses (via Wikipedia, thanks) suite we last talked about with PHP Wikipedia List Scrolling Tutorial.

After the event, when there are lots of clones, as any such project, is the less than ideal scenario “second choice” option. No worries, still and all, wherever you see it, it will be an improvement in modularization, to involve …

  • common client-side (ie. Javascript) code … into a commonly called …
  • single external Javascript file

That way, going forward with new ideas later, it may be just the one external Javascript that will need changing to achieve some pretty cute modifications, we’re hoping, at a later date.

And today’s two function transfer of Javascript concerned the “Animate” left hand cell emoji button workings. Two matters improved upon were …

  • as soon as animation is requested scrolling will be apparent, whereas in times past it would take too much time to start, in our opinion … and now …
  • after that scrolling takes place we reinclude those topmost HTML elements so they do not get forgotten about …

    document.getElementById("td" + curanim).scrollIntoView(); //location.href="#td" + curanim;
    window.scrollTo(window.scrollX, 0);

… affecting one external Javascript file …


Previous relevant PHP Wikipedia List Scrolling Tutorial is shown below.

PHP Wikipedia List Scrolling Tutorial

PHP Wikipedia List Scrolling Tutorial

We had occasion to revisit the “peer to peer” web application arrangements of the PHP Wikipedia List Genericization Tutorial thread of blog postings, and wondered whether its …

… button click event Javascript logic window.scrollBy(100,0) repercussions could be improved upon. Why? Well, within the “broad brush” design view of these web application webpages of …


<html>
<body>
<div align=center><h1> ... menu type contents ... </h1></div>
<table><tr><td> ... scrollable individual cell place information pods ... </td></tr></table>
<div align=center><iframe> ... Google Chart Map Chart Iframe ... </iframe></div>
</body>
</html>

… too many clicks of that “More … That a Way ->” button could result in menu type contents and Google Chart Map Chart Iframe disappearing from the user’s view, off to the left of screen.

Thinking about solutions to this, our first thought was the use of CSS position:absolute but as we coded, we started to realize that would …

  • shift the remaining position:relative scrollable individual cell place information pods up to clash with menu type contents (re-)positioning
  • the div align=center initial thinking above would mean the menu type contents and Google Chart Map Chart Iframe still disappear, albeit slower to disappear

… but that …

  • keeping the position:relative default … combined with …
  • adjusted CSS style margin-left settings could match the amount of horizontal scrolling … and …
  • make the div align=center be div align=left for first div and be div align=right for last div … and …
  • also increase the width of <div align=centerright><iframe> … Google Chart Map Chart Iframe … </iframe></div> by the horizontal scrolling amount

… was a better approach …


var lastscp=0;
var lasthonex=0, lastiframex=0, lastdivw=0;

function scrollchange() {
//document.title=('' + document.body.scrollLeft);
var huhsc=eval('' + ('' + document.body.scrollLeft).replace('px',''));
if (huhsc != 0) {
if (lastscp != huhsc) {
lastscp=huhsc;
//document.title='leftScrollPos=' + huhsc;
if (1 == 1) {
document.getElementsByTagName('div')[0].align='left';
document.getElementsByTagName('div')[eval(-1 + document.getElementsByTagName('div').length)].align='right';
document.getElementsByTagName('div')[eval(-1 + document.getElementsByTagName('div').length)].style.width='' + eval(huhsc + eval(('' + lastdivw).split('.')[0])) + 'px';
document.getElementsByTagName('h1')[0].style.marginLeft='' + huhsc + 'px';
document.getElementsByTagName('iframe')[0].style.marginLeft='' + huhsc + 'px';
} else {
document.getElementsByTagName('h1')[0].style.position='absolute';
document.getElementsByTagName('h1')[0].style.left='' + eval(huhsc + eval(('' + lasthonex).split('.')[0])) + 'px';
document.getElementsByTagName('h1')[0].style.top=('' + lasthonex).split('.')[1] + 'px';
document.getElementsByTagName('iframe')[0].style.position='absolute';
document.getElementsByTagName('iframe')[0].style.left='' + eval(huhsc + eval(('' + lastiframex).split('.')[0])) + 'px';
document.getElementsByTagName('iframe')[0].style.top=('' + lastiframex).split('.')[1] + 'px';
}
}
} else if (lastscp != huhsc) {
//document.title='leftScrollPos=' + huhsc;
if (1 == 1) {
document.getElementsByTagName('div')[0].align='left';
document.getElementsByTagName('div')[eval(-1 + document.getElementsByTagName('div').length)].align='right';
document.getElementsByTagName('div')[eval(-1 + document.getElementsByTagName('div').length)].style.width='' + eval(huhsc + eval(('' + lastdivw).split('.')[0])) + 'px';
document.getElementsByTagName('h1')[0].style.marginLeft='' + huhsc + 'px';
document.getElementsByTagName('iframe')[0].style.marginLeft='' + huhsc + 'px';
} else {
document.getElementsByTagName('h1')[0].style.position='absolute';
document.getElementsByTagName('h1')[0].style.left='' + eval(huhsc + eval(('' + lasthonex).split('.')[0])) + 'px';
document.getElementsByTagName('h1')[0].style.top=('' + lasthonex).split('.')[1] + 'px';
document.getElementsByTagName('iframe')[0].style.position='absolute';
document.getElementsByTagName('iframe')[0].style.left='' + eval(huhsc + eval(('' + lastiframex).split('.')[0])) + 'px';
document.getElementsByTagName('iframe')[0].style.top=('' + lastiframex).split('.')[1] + 'px';
}j
} else if (lasthonex == 0 && lastiframex == 0) {
var rectlis=document.getElementsByTagName('h1')[0].getBoundingClientRect();
lasthonex=eval(('' + rectlis.left).split('.')[0] + '.' + ('' + ('' + rectlis.top).split('.')[0] + '.').replace('0.','1.').replace('.',''));
rectlis=document.getElementsByTagName('iframe')[0].getBoundingClientRect();
lastiframex=eval(('' + rectlis.left).split('.')[0] + '.' + ('' + ('' + rectlis.top).split('.')[0] + '.').replace('0.','1.').replace('.',''));
rectlis=document.getElementsByTagName('div')[eval(-1 + document.getElementsByTagName('div').length)].getBoundingClientRect();
lastdivw=eval('' + rectlis.width);
}
}

setInterval(scrollchange, 1000);

… which could be applied to three external Javascript files …

.. to fulfill our wish to leave more relevant webpage visible to the user at all times with these web applications.


Previous relevant PHP Wikipedia List Genericization Tutorial is shown below.

PHP Wikipedia List Genericization Tutorial

PHP Wikipedia List Genericization Tutorial

We had to do it! It’s not perfect, but what software is perfect. We feel it could benefit those more intrepid users out there. So what is it?

A few days ago we presented PHP Wikipedia Australian List Integration Tutorial showing some Wikipedia “list of” webpages related to some Australian “concepts” for latitude and longitude (our where of life conduit) based tabular data.

Today we’ve started genericizing those “business rules” to add a new option to …

  • not have to relate the job to Australia, necessarily … but …
  • ask for a Wikipedia URL that starts with “List_of_” as a lot of such webpages have as the start of their URLs …
  • then have concept word(s) follow in the URL …
  • then follow that by _of_ or _in_ or _on_ … followed by …
  • a placename (eg. country name) … then …
  • look for some latitude and longitude data within that data

… and as you can imagine with that last one we can’t cater for everything, but we try hard to cater for quite of few combinations of what the latitude and longitude data could look like.

This is a PHP writes PHP job building webpages like those of the tutorial below, dynamically (and ephemerally), with the new bit of PHP running the show and in these early days we have not catered for it being used a lot, so if you start using it and get somebody else’s “run” data, that’s how the cookie crumbles for now.

We’ll leave you with some that worked for us during the quiet times of our development cycle …

To run what we refer to as a “makeover”, click this live run link and the PHP is downloadable via this template_wiki.php link, as the chance to learn some geography you never knew.


Previous relevant PHP Wikipedia Australian List Integration Tutorial is shown below.

PHP Wikipedia Australian List Integration Tutorial

PHP Wikipedia Australian List Integration Tutorial

Yesterday’s PHP Wikipedia Australian List Makeover Tutorial got us thinking more about “where of life” functionality integration possibilities.

For us, with many “where of life” web applications, the Google Charts Map Chart is a core part of the functionality, as the receptacle, and more and more often as time goes on, also a launching pad out to other concepts, such as …

  • TimeZone … and …
  • Weather

… two of the concepts hovering about our “Other Side of the World” web application we last talked about with Other Side of the World Google Chart Tutorial, whose supervisory HTML other_side_of_the_world.htm‘s live run, changed in this way to tweak the the linking of …

  • latitude and longitude and (anywhere) placename … to …
  • TimeZone place(s) … and then (with great help from Weather Underground (thanks)) onto …
  • direct or nearby weather predictions

… coming off a new Map Chart Google Chart and its select event menu option

  • Nearest TimeZone=Z (and onto Other Side of the World and Weather)
  • YouTube=Y (looking for placename)

… the latter integrating us with YouTube API for Iframe embedded videos interface HTML/Javascript “parent” web application called karaoke_youtube_api.htm HTML iframe elements in another direction additional to yesterday’s usage. Along the way, we tweak the Google Map=G menu option, adding more map type options and zooming in a little less by default, and with the Nearby Airports=A option making the default be a search for 3 (rather than 4) nearby airports. A lot of this all happens because of the changes to

… which all got changed to allow for an “Animate” feature, allowing for an automated right to left “animation” (via hashtagging) of the Wikipedia based slides near the top of this suite of web application’s webpages. We hope you get to try all this out for yourself.


Previous relevant PHP Wikipedia Australian List Makeover Tutorial is shown below.

PHP Wikipedia Australian List Makeover Tutorial

PHP Wikipedia Australian List Makeover Tutorial

Some time back we linked a Wikipedia “list” webpage to the Google Charts Map Chart functionality with PHP Modularization for Lighthouses in Australia Tutorial.

We’re revisiting, and finding some “peer” web applications, linked by a dropdown, that all …

  • access a relevant Wikipedia “list” webpage for Australian “things” and mentioning latitude and longitude … which link to …
  • Google Charts Map Chart

… for all of …

We were inspired to take on this “makeover” of “where of life” functionalities because earlier on today we discovered a stupendous online resource for Australian geography enthusiasts, the Bonzle Digital Atlas of Australia, with incredibly detailed and flexible search mechanisms, thanks heaps!

We’ve decided to include extra buttons (to those already linking to Google Maps links and to the relevant Wikipedia webpage) for that suite of web applications above for …

Great for research and “surfing the Australian world”! Lose yourself!

What happened Javascript (australian_lighthouses.js changed this way) and PHP wise?


Previous relevant PHP Modularization for Lighthouses in Australia Tutorial is shown below.

PHP Modularization for Lighthouses in Australia Tutorial

PHP Modularization for Lighthouses in Australia Tutorial

Today we want to try two more things …

  1. continuing on with our PHP code (you could call australian_lighthouses.php) for our Australian Lighthouses project
  2. talk about PHP glob and its modularization sensibilities

… so let’s talk about the second one first … it’s south of north … chortle, chortle.

What does PHP’s glob do? It is doing functionality like the “underworkings” of any browse button you would see would do when you have a hard disk (in your life) … unfortunately, this is no longer a given (with mobile technology and the “cloud” challenging this thinking, sometimes). Give glob a file specification and a directory to start with, and it will happily (if you were both “globular” and “modular” you would be, too) provide you with a list of filenames, so that we use it to construct this PHP function for use with our lighthouses web application …


function selcreate($def) {
$ret=$def;
$selstr='<select onchange=" window.location=this.value; "><option value="' . str_replace(" ", "_", strtolower($def)) . '_lighthouses.php">' . $def . '</option>';
$cnt=0;
foreach (glob("*_lighthouses.php") as $filename) {
if (strpos(($filename . "*"), (str_replace(" ", "_", strtolower($def)) . '_lighthouses.php*')) === false) {
$cnt++;
$newidea=str_replace("_", " ", str_replace("_lighthouses.php", "", strtolower($filename)));
$newideas=explode(" ", $newidea);
$ideas=strtoupper(substr($newideas[0],0,1)) . strtolower(substr($newideas[0],1));
for ($ii=1; $ii<sizeof($newideas); $ii++) {
$ideas.=(" " . strtoupper(substr($newideas[$ii],0,1)) . strtolower(substr($newideas[$ii],1)));
}
$selstr.='<option value="' . $filename . '">' . $ideas . '</option>';
}
}
if ($cnt > 0) return $selstr . "</select>";
return $ret;
}

… and hope you can see that glob could be used for PHP code to self-detect sibling variation programs, so that, for instance, if we “plonked” (ie. eg. (s)ftp it) an egypt_lighthouses.php (probably with an egypt_lighthouses.js accompanying Javascript file) into the same directory as our …

… it would automatically be added into the functionality of its siblings without you having to change any code of those siblings … and that egypt_lighthouses.php is free to be a web application with a totally different method of functionality … cute, huh?!

As a matter of fact ireland_lighthouses.php is quite different, and if you examine the code, you will see that the Javascript putElement(s)By via PHP Relative URLs Tutorial is more apt to a discussion of its workings.

You see, there are so many many different ways to “skin a cat” in Information Technology, quite often … not always … but “quite often” … and why be cornered into thinking there is only one way to do things?

The other thing you’ll find is that even though ireland_lighthouses.php differs a lot to its nearest matching sibling (in terms of methodology), new_zealand_lighthouses.php the Javascript corresponding codesets called ireland_lighthouses.js and new_zealand_lighthouses.js are only superficially different … in other words our PHP coalesces concepts into a similar “client” look … a “modularization” of sorts … not everybody’s sort, but a sort none the less … and this begs a question?

Why is “modularization” a good thing? Well, to me, you don’t have to have any “modularization” going on at all, and this is fine by me, but you must deal with issues that allow you to modify many many codesets efficiently and accurately in vastly different ways to be efficient, or be “modular” and be able to, perhaps, even, automate your changes, because of these “modular” patterns you’ve created … many people find “modularization” blissful … and often it suits the work patterns for teams of programmers. Perhaps you want to read about MVC (and its like) as a coding modularization idea for PHP (or many other programming languages, for that matter).


Previous releveant PHP/Javascript Asynchronous Lighthouses in Australia Tutorial is shown below.

PHP/Javascript Asynchronous Lighthouses in Australia Tutorial

PHP/Javascript Asynchronous Lighthouses in Australia Tutorial

Today we want to try two things …

  1. continuing on with our PHP code (you could call australian_lighthouses.php) for our Australian Lighthouses project
  2. talk about Javascript asynchronous script tag option

… so let’s talk about the second one first … it’s south … chortle, chortle.

Why should you be interested in the HTML’s script tag attributes …

  • asynch=”asynch”
  • defer=”defer”

? Well, we want our web pages to load as fast as possible. Yaaaaaa?! So if there was the mechanism to do more than one bit of ((client) Javascript) thinking at a time would you avail yourself of the opportunity … or would you pick what’s behind door 3?

Do you want to hear more on this theory wise? It seems to me, there are web application mission critical parts, and there are embellishments, quite often … “nice to haves” but not “mission critical” … well, if those “nice to haves” could be arranged not to hog all the web application designated CPU that would be good, wouldn’t it?! Yaaaaaaaaaaa?!

So, that, in theory, is y why.

Now back to the project at hand … Australian Lighthouses … don’t you think some geographical sorting options and place name sorting options might be useful? Yaaaaaaaaaaaaaaaaa?! But for us it doesn’t feel mission critical … so we …

  • place the logic in some external Javascript called australian_lighthouses.js
  • we load it from the PHP via
    <script type=”text/javascript” src=”australian_lighthouses.js” async=”async”></script>

    … and this amounts to the only change to today’s PHP code from yesterday as per this link

… and this becomes a way to modularize your thinking regarding a project … please don’t think there are not a myriad of other ways … this is just one idea here.

With regard to how we approached our external Javascript we did not demand anything (much) of our parent PHP and this may not be the fastest way to approach this. What we mean by that is that, perhaps, as a general rule, external Javascript can perform faster with the parent PHP or HTML leaving it with a lot more HTML element id=”[elementId]” to hang its hats on, so to speak … instead, here, we acted innocently with our Javascript and used lots of calls to the Javascript DOM method getElementsByTagName() (which results in an array return value). Perhaps calls to getElementById() via (parent) arranged id=”[elementId]” would be faster?! Today, as with the previous Static HTML Javascript Primer Tutorial we concentrated on the “modular” feel to additional external Javascript code ideas.

So try a live run to see what we mean.


Previous relevant PHP Lighthouses in Australia Primer Tutorial is shown below.

PHP Lighthouses in Australia Primer Tutorial

PHP Lighthouses in Australia Primer Tutorial

Today we examine some of the methodology behind a project idea.

Projects need …

  • an idea … ours came from listening to the radio and hearing about Lighthouses, and how the technologies had changed what they look like and how they function these days … to quote Wikipedia with respect to Australian Lighthouses (thanks) …

    The first lighthouse was Macquarie Lighthouse, which was lit in 1793 as a tripod mounted wood and coal fired beacon. The last manned lighthouse was Maatsuyker Island Lighthouse, off the south coast of Tasmania, which was automated in 1996.

  • a means to access information … much easier these days with the search engines … we went with a Google Search as per list of lighthouse positions … which led to …
  • the information source(s) … we settled, and were not surprised about the source, for Wikipedia’s List of lighthouses and lightvessels in Australia – Wikipedia … then, once happy about the quality of the source information, analyzed …
  • the source data format … initially, at least, via View->Page Source, relative to the webpage … to get ideas for how to parse the data … so that we can determine a …
  • programming language of choice … which is PHP … no surprise here … will need a server-side language … and a method like PHP’s file_get_contents() … from there …
  • PHP coding to parse the data and put it into another format that value adds … otherwise why do it, as the Wikipedia information is fine as is … that is where we determine that we should …
  • include an iframe that uses the Google Chart Map Chart to add that extra overall positional view of Lighthouses … a definite asset to the reader’s understanding of the subject … definitely a “where” web application … and in doing this we notice that …
  • Google Chart Map Chart map.php web application needed to be able to handle much larger input data streams than it could in its previous incarnation of only allowing PHP $_GET[] parameters … so we change it to allow $_POST[] parameters … maybe you noticed this with yesterday’s PHP/Javascript/HTML Google Chart Map Onclick Tutorial as shown below … as this meant that …
  • we need an HTML form that POSTs to the iframe with the Google Chart Map Chart map.php web application allowable because we are on the same domain with this thinking … and using an HTML textarea element to store the huge string of Lighthouse data that will be passed across via urldecode($_POST[‘data’]) at map.php … using PHP’s urldecode() and urlencode() methods and Javascript’s decodeURIComponent() method … as well as utilizing …
  • Google Chart Map Chart map.php web application onclick and tooltip functionality we’ve been working on lately … hence the talk about this below … working out what (component) tools could do with a “makeover” is an extremely important part of any project and can be a useful compartmentalizing of the project

… and so we end up with our live run behind which is the PHP programming source code you could call australian_lighthouses.php for your perusal.


Previous relevant PHP/Javascript/HTML Google Chart Map Onclick Tutorial is shown below.

PHP/Javascript/HTML Google Chart Map Onclick Tutorial

PHP/Javascript/HTML Google Chart Map Onclick Tutorial

They say “the knee bone’s connected to the thigh bone” then they say “the thigh bone’s connected to the … hip bone” then they say “let’s call the whole thing off” … sometimes.

Today we say “the onmouseover event is connected to the onclick event” then we say “the onclick event is connected to the online woooooorld” … “do … the hokey pokey” x3 … “that’s what the onclick event preceeded by the onmouseover event within the environs you are encountering … is all about”.

That news is pretty good actually, because it means mobile users are not missing out on much not having easy access to any onmouseover (ie. hover) functionality … they’ll still reach any onclick logic you present them, in the default case of events where onclick is a valid “touch” event as well.

So the data structure of arrangements to allow for this onclick functionality is intrinsically the same as allowed for yesterday with the PHP/Javascript/HTML Google Chart Map Tooltips Tutorial as shown below, but we just check for some more delimitation issue matters, and our updated prompting window logic gets quite “blurby” as per the Javascript (via PHP) …



echo " datalinesuffix = prompt('Enter decimal Latitude,Longitude ' + thisline + extra + ' (for no more hit Cancel button and append with ' + '\\n\\n' + ',\"A tooltip and clicking link for Google Map of <a target=_blank href=https://www.google.com.au/maps/place/' + encodeURIComponent(dlp2) + '>' + dlp2 + '</a>\" ' + '\\n\\n' + ' or maybe perhaps ' + '\\n\\n' + ',\"A tooltip and clicking link for Google Map based on latitude and longitude of <a target=_blank href=https://maps.google.com.au/maps?' + encodeURIComponent('z=15&t=m&q=loc:') + '{latitude}{longitude}>' + dlp2 + '</a>\"' + '\\n\\n' + ' optionally (as (just) two examples of what is possible with HTML included (activates with onclick bit not onmouseover))', thisdef); " . "\n";
echo ' if (datalinesuffix != null) { if (datalinesuffix.indexOf("{latitude}") != -1) { dlsa=datalinesuffix.split(","); if (dlsa[0].indexOf("-") == -1) { datalinesuffix=datalinesuffix.replace("{latitude}",encodeURIComponent("+" + dlsa[0])); } else { datalinesuffix=datalinesuffix.replace("{latitude}",encodeURIComponent(dlsa[0])); } } if (datalinesuffix.indexOf("{longitude}") != -1) { dlsa=datalinesuffix.split(","); if (dlsa.length > 1) { if (dlsa[1].indexOf("-") == -1) { datalinesuffix=datalinesuffix.replace("{longitude}",encodeURIComponent("+" + dlsa[1])); } else { datalinesuffix=datalinesuffix.replace("{longitude}",encodeURIComponent(dlsa[1])); } } } } ' . "\n";

… as again we are making use of $_GET[] parameters coming into the PHP at the server side.

The bigger picture plan for how this helps something else we are trying will become apparent over time … in the fullness of time … at the appropriate juncture of juxtapositions.

Let’s see some PHP code in live action for this tutorial where you define your map characteristics and data.

Link to Google Chart Tools “spiritual home” … via Google.
Link to Google Chart Tools Map information … via Google.
Link to Google Chart tooltips information … via Google.

Link to some downloadable PHP programming code … rename to map.php which changed from yesterday as per this link.


Previous relevant PHP/Javascript/HTML Google Chart Map Tooltips Tutorial is shown below.

PHP/Javascript/HTML Google Chart Map Tooltips Tutorial

PHP/Javascript/HTML Google Chart Map Tooltips Tutorial

Here is a tutorial that is revisiting Google Graphs API, or Google Chart Tools, and its Map functionality, which we first talked about with PHP/Javascript/HTML Google Chart Map Tutorial as shown below. Please read

Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.

Why are we revisiting? Well, we are interested in the interactive side to this wonderful product. We are going to start with a look into “tooltips”. Tooltips are those optional informational features of some webpages that happen when hovering over an HTML element, principally through the filling out of an HTML element’s title global attribute.. Google Charts functionality amounts to the use of Javascript, and, these days, SVG HTML elements, so “tooltips” are very relevant to the “user experience” when using Google Charts. With the Map Chart, the latitude, laongitude set is combined with a title, which can be the default “tooltip” shown, as this is all fine for many usages, but we want to extend it so that that title doesn’t have to be the tooltip.

The integration of this added functionality into the Google Chart Map Chart involves adding an extra “string” column to the data table as per the bold bits of the new Javascript (via PHP) snippet …



if (isset($_GET['value']) && (isset($_GET['tooltip']) || strpos($GETdata, "'") !== false)) {
echo " var data = new google.visualization.DataTable(); /" . "/" . $GETlabel . $GETvalue . " \n";
echo " data.addColumn('number', '" . str_replace("'","",str_replace(",","",str_replace("['","",$GETlabel))) . "'); \n";
echo " data.addColumn('number', " . str_replace(",", "); data.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}}); data.addColumn('string', ", str_replace("]","",$GETvalue)) . "); \n";
echo " data.addRows([ \n";
echo str_replace("''" . "''", "''", str_replace("~", "'", substr($GETdata,1)));
echo " ]); \n";
} else {

echo ' var data = google.visualization.arrayToDataTable([ ' . "\n";
echo " " . $GETlabel . $GETvalue . " \n";
echo str_replace("''" . "''", "''", str_replace("~", "'", $GETdata));
echo " ]);\n";
}

… making use of $_GET[] parameters coming into the PHP at the server side … you’ll find that Javascript loves to work with PHP as one of those Fred and Ginger relationships of the programming world … you’ll be happier writing Javascript from your PHP too … try it and you’ll see the advantages time and again and again and again … did we leave out one? … and again.

The bigger picture plan for how this helps something else we are trying will hopefully become apparent over time.

Let’s see some PHP code in live action for this tutorial where you define your map characteristics and data.

Link to Google Chart Tools “spiritual home” … via Google.
Link to Google Chart Tools Map information … via Google.
Link to Google Chart tooltips information … via Google.

Link to some downloadable PHP programming code … rename to map.php which changed from the days of Google Charts Emailing Primer Tutorial as per this link.


Previous relevant PHP/Javascript/HTML Google Chart Map Tutorial is shown below.

PHP/Javascript/HTML Google Chart Map Tutorial

PHP/Javascript/HTML Google Chart Map Tutorial

Here is a tutorial that introduces you to Google Graphs API, or Google Chart Tools, and its Map functionality.

Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.

Let’s see some PHP code in live action for this tutorial where you define your map characteristics and data.

Link to Google Chart Tools “spiritual home” … via Google.
Link to Google Chart Tools Map information … via Google.

Link to some downloadable PHP programming code … rename to map.php.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in Animation, eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

How Come Sharing and Remembering Tutorial

How Come Primer Tutorial

How Come Sharing and Remembering Tutorial

You may think you’ve run straight into a Hallmark Greeting Card symposium with today’s blog posting title’s “Sharing and Remembering”, but …

  1. no, you are at a hard nosed I.T. blog … and please …
  2. never underestimate the competition …

    … in the greeting card business

And so, onto the day before yesterday’s How Come Primer Tutorial we add both …

  • remembering …
    1. web browser tab remembering via window.sessionStorage … and/or …
    2. web browser remembering via window.localStorage

    … new logic added in, teamed with …

  • sharing and collaboration (via both to and from email address configuration) new logic that can encompass any of that remembering logic for How Come questions that have been added by the user

That way, a group of collaborators can build up a list of How Come questions they can share with friends and everybody’s entries can be accepted and perused by the group, because if they use new (append a space) web browser remembering via window.localStorage methodologies along with to and from comma separated recipient designations then clicking on email or SMS body links featuring hashtagged user entered How Come question link lists will be all that is needed for the collaboration to look the same for all participants.

And so, again, feel free to try our changed second draft how_come.html How Come web application, or try below


Previous relevant How Come Primer Tutorial is shown below.

How Come Primer Tutorial

How Come Primer Tutorial

Were you around when, with Calendar Location Services Integration Tutorial‘s blurb we surmised that …

why

… may be the least accessible English question word as far as online content goes? Well …

  1. pretty obviously, this is just an opinion …
  2. we think questions starting with “why” are better catered for, as time goes on …
  3. it’s very natural for the younger members of our community to ask a “why” question using the English words …

    how come

    … more often … in our opinion

This disarming modification sure works better getting a response from me, and is this us remembering our childhood?! Is it a way in to ask the questions “you were always afraid to ask”?

Anyway, channeling All because you asked for it we’ve written a tiny web application today, asking “How come” questions of Google for our (and we’re hoping, your) curiosity, because you can form your own questions.

Yeh, but you can just type your question into a web browser address bar!

Indeed, and we highly recommend it! But do remember, not everything you read online is necessarily the “gospel truth”. It’s best, when matters are controversial, to read more than one source, and the links that make it to the top of a Google search can be there via sponsorship (though some of these are indicated that way).

Feel free to try our proof of concept first draft how_come.html How Come web application …


Previous relevant Calendar Location Services Integration Tutorial is shown below.

Calendar Location Services Integration Tutorial

Calendar Location Services Integration Tutorial

Of all those English question words …

  • why
  • which
  • how
  • what
  • who
  • when
  • where

… which is more apt as far as software goes? Well, and sorry to our regulars who have heard our theories so often, it goes in order of prominence …

  • where
  • when

… then the rest … ie. the reverse order of order way above, we reckon.

And so, being reminded on an upgrade of our macOS version to Big Sur version 11.6 the other day, opening the macOS Calendar desktop application version 11.0 (2811.5.1) (as we did earlier, with a previous version, with Calendar iCal Integration Itinerary Time Tutorial), that locations were honoured with an Apple Maps integration (should you permit Location Services to help you) along with news about Siri integration improving Calendar’s AI credentials, we were pretty much tickled pink to be combining the “when” with the “where” in the one desktop application.

Maybe you will be too?!


Previous relevant Calendar Location Services Integration Tutorial is shown below.

Calendar iCal Integration Itinerary Time Tutorial

Calendar iCal Integration Itinerary Time Tutorial

A while back we left off our software integration of Calendar iCal Events into Google Chart Timeline Chart functionality (last visited with Calendar iCal Integration Itinerary Post Tutorial as shown below) with the quote …

… closing the circle, for now, with our Calendar Event software integrated Timelines.

… but want to retreat from that “finality”, because it’s been burning away within us as an annoyance, regarding this software integration. We think we can do better (with the integration). And we now think that, doing the research and development on this, that it is technically fairly easy to make that improvement, which goes …

We want to have the Google Chart Timeline Chart date resolution to match the Calendar iCal Event resolution, which is to the nearest second, rather than to the nearest day, as it used to be for our Google Chart Timeline Charts

… but we are going to hang back from asking for time hh24:mi:ss entries in the Google Chart Timeline Chart web application itself (when executing as the “parent” web application), because we can accept time data coming in from, say, the Itinerary web application, specifying the date and times to the nearest second (optionally). The reason for this is that to ask for the time everywhere can be offputting when there are so many Timeline scenarios where it is not really the “go” … think, “dates in history” for example.

What is in the “innards” of the Google Chart Timeline Chart web application controlling this “date” (data) resolution? It is controlled by calls to create Javascript Date objects via Javascript Date object constructor (calls), and up to now, they have been exclusively of the form …


var date_object = new Date(year, month, date);

… and this set us to exploring other Javascript Date object constructors, and, as you’d expect … but is a little non-intuitive because of the “Date” object naming … well that’s my excuse, anyway … it allows for (the overload) …


var date_object = new Date(year, month, date, hour, minute, second);

But that is not to say that just to see that this (Javascript functionality) is so, doesn’t always make it so (for Google Chart usage). However, it just so happens, it does, in this case, because there are no problems changing these Date constructor calls as far as the software interface to the Google Charts Timeline Chart API is concerned (we unit tested to confirm) … yayyyy!!

It does mean, though, that the code should handle either type of constructor, and this constructor is significant to our Google Chart select (onclick) event coding, as we examine these constructors from document.head.innerHTML to glean this information.

We may, next, but not for now, extend the Google Chart Timeline Chart web application to ask for times optionally, perhaps, via the clicking of an HTML input type=checkbox element, but for now we’re happy, because a user can do any of …

  • Google Chart Timeline Chart web application execution where it is the parent web application … date resolution: day
  • Itinerary (web application) that displays into the Google Chart Timeline Chart web application … date resolution: second
  • Date and Time Timeline with Calendar iCal Events (web application) that displays into the Google Chart Timeline Chart web application … date resolution: second

… and the last two are available as links from the first, so, we figure, the user can end up with what they were after, with all these choices of execution modes.

And so, what timezones happen here?

  • Google Chart Timeline Chart web applications use your local date (and time)
  • Calendar iCal Event destination use your local date (and time) too … but …
  • iCal interfacing messages most easily use “Z” form, that uses GMT dates (and time)
  • Itinerary (or Date and Time Timeline with Calendar iCal Events) web application allows for times in any timezone you designate

… and we have to map any non-local timezone usage to local time, especially with the last option above, to avoid confusion, and to make Calendar iCal Event destination application data match the content, and now, resolution, of its Google Chart Timeline Chart counterpart. Annoyance over!

The results of this work consisted of …

  • no changes to external Javascript you could call gettopost.js … called defer=’defer’ by …
  • our PHP “Itinerary”, and now, also, “Generic Timeline with Dates and Times” code you could call itinerary.php which changed a lot, and has the “Itinerary” type of live run and has the “Generic Timeline with Dates and Times (and Calendar Events)” type of live run
  • our PHP above calls the original Google Chart Timeline Chart (with its “onclick” select event functionality) you could call timeline_chart.php which changed a little to recognize Timelines that can Involve Times (and Calendar Events) as well as the usual Dates (and if you want to try its live run … then there it went?!)

Previous relevant Calendar iCal Integration Itinerary Post Tutorial is shown below.

Calendar iCal Integration Itinerary Post Tutorial

Calendar iCal Integration Itinerary Post Tutorial

We’re improving software integration on a few fronts today, extending the existing Itinerary software from Calendar iCal Integration Itinerary Tutorial as shown below, namely …

  • realizing that the only difference between an “Itinerary” and any “Timeline Involving Dates and Times (and Calendar Events)” is the descriptive bits about airports and such things, so why not use the same code, and allow for a call a certain way, to turn that “Itinerary” code into the code for that generic “Timeline Involving Dates and Times (and Calendar Events)” … which affected …
  • the Google Chart Timeline Chart needs to allow for these new functionalities … and so it does with code in between <head> and </head> …

    setTimeout(itintobitsatend, 900);
    function itintobitsatend() {
    <?php
    if (file_exists("itinerary.php")) {
    echo "
    if (document.getElementById('bitsatend').innerHTML.indexOf('Itinerary') == -1) {
    document.getElementById('bitsatend').innerHTML+='&nbsp;<a target=_blank title=Itinerary href=http://www.rjmprogramming.com.au/PHP/TimelineChart/itinerary.php>Itinerary with Calendar Events</a>&nbsp;<a target=_blank title=Times href=http://www.rjmprogramming.com.au/PHP/TimelineChart/itinerary.php?justaddtime=y>Timeline with Dates and Times and Calendar Events</a>';
    }
    ";
    }
    ?>
    }

    … as well as …
  • our software integration improvement we did that “proof of concept” preparation about yesterday with HTML Div Overlay Jigsaw Talents Primer Tutorial that is actually the means by which we cater for large amounts of “Itinerary” or “Generic Timeline with Dates and Times” data by
    1. establishing a new external Javascript using HTML script property defer=’defer’ loaded after the local Javascript (that contains a “stub” function maybegettopost(instg, showit) { return instg; }) with two major functions … namely …
      • a page load setTimeout started function lookforjigsaw() that looks for an HTML div “jigsaw” arrangement like talked about yesterday, and if not, create the scenario, and leave the user with a 3 member array of HTML div id list for original content, iframe perhaps later overlays content, form to fire off iframe data as required content respectively, usage … and …
      • an external Javascript overloading version of function maybegettopost(instg, showit) that checks the length of the proposed get $_GET[] type parameter call (ie. using ? and & on address bar with long URLs), and if too long, convert that $_GET[] type parameter call data into $_POST[] type parameter call (remembering … doh … that the PHP (sorrrryyyy) receiver code should cater for this)
    2. change the “Itinerary” PHP web application code to, from now on, when calling another web application in a (default) $_GET[] type parameter call way, filter that call data through function maybegettopost(instg, showit) … the showit is a boolean that is true if we end up navigating to that call data “URL” (ie. we “show it”)

Maybe you need to see the software additions and changes to see this for yourself, which consisted of …

  • new external Javascript you could call gettopost.js … called defer=’defer’ by …
  • our PHP “Itinerary”, and now, also, “Generic Timeline with Dates and Times” code you could call itinerary.php which changed a little, and now has the “Itinerary” type of live run and has the “Generic Timeline with Dates and Times (and Calendar Events)” type of live run
  • our PHP above calls the original Google Chart Timeline Chart (with its “onclick” select event functionality) you could call timeline_chart.php which changed a little to recognize Timelines that can Involve Times (and Calendar Events) as well as the usual Dates (and if you want to try its live run … then there it was?!)

… closing the circle, for now, with our Calendar Event software integrated Timelines. With such software integration, break complex integrations into bits you can unit test, and don’t move on until that unit test works. On the next level of unit testing, make sure you prove that previous unit tests still work.


Previous relevant Calendar iCal Integration Itinerary Tutorial is shown below.

Calendar iCal Integration Itinerary Tutorial

Calendar iCal Integration Itinerary Tutorial

After the recent Calendar iCal Integration Timeline Tutorial you may have associated a Timeline with a Calendar event, even when the End Time of that event is not a defined concept, but what about a software integration, again with a Google Chart, but this time with …


Google Chart Timeline Chart

… “shaped” into a web application suitable to enter Itinerary information and then be able to associate these Timeline Start and End Events with iCal Calendar Starts and Ends to events, created …

  • interactively, using the user’s default iCal application … and/or (in the case of “mobile” we should say “but rather”) via …
  • email via PHP mail function

? This “Itinerary” concept has a huge amount of synergy with Calendar events, especially as a reminder service to people going on the trip (of the Itinerary) and/or to those affected by their absence, and so we found it a concrete type of web application to “start” out on. Yes, and there’s more! Tomorrow’s blog posting, you’ll have trouble believing, will have a connection, as a “proof of concept”, of where we go next with this project. So, after tomorrow’s explanation, we’ll probably see you back hereabouts in two days.

But, in the meantime, for starters, try the PHP source code of itinerary.php and its live run to see what we are getting at here. If you try it, you’ll see that the Emoji Overlay sizing is determined on a integration “parent” subject by integration “parent” subject basis.


Previous relevant Calendar iCal Integration Timeline Tutorial is shown below.

Calendar iCal Integration Timeline Tutorial

Calendar iCal Integration Timeline Tutorial

After the recent Calendar iCal Integration WordPress Tutorial we found another integration candidate for our Calendar Event (creating) (component) “tool” web application that could be used in a variety of ways by other web applications. The second cab off the rank for this we decided should be (this) …


Google Chart Annotated Timeline Chart

… which should come as no surprise of a candidate for Calendar integration.

So a few things have come together for this work, those being …

  • Calendar iCal Integration WordPress Tutorial got us into an integration with PHP and fitting in with existing Javascript DOM issues … but only for discrete Emoji concepts … whereas …
  • Emoji Overlay Share Tutorial yesterday was a proof of concept in two ways …
    1. code to respond to click events with regard to Emoji Overlays … but it also had within the code, and we tested it behind the scenes, the way it could …
    2. work off HTML primed with the special class “emojioverlay” and primed with a Javascript DOM property that would yield Emoji discrete “characters” but with the “#” missed out … believe me, this “kludgy feeling” idea saves a lot of bother because when you go back and retrieve the innerHTML property of Emoji data you do not easily arrive back at …

      &#[codepoint];

      … and we work via our homegrown Javascript docgetclass function to be able to overlay Emojis via the usual …

      • position:absolute property
      • opacity … and though it was optional for today’s work, we also included the third often used “overlay” CSS “player” … namely …
      • z-index

      … and this Javascript function …

      function checkforclass() {
      var buildup="";
      var cfcs=docgetclass('emojioverlay','*');
      for (var ij=0; ij<cfcs.length; ij++) {
      if (cfcs[ij].innerHTML.replace(/&amp;/g,'&').indexOf(';&') != -1) {
      var emjs=cfcs[ij].innerHTML.replace(/&amp;/g,'&').split("&");
      buildup='';
      cfcs[ij].style.opacity=eval(cfcs[ij].style.opacity / eval(-1 + emjs.length));
      for (var iemjs=1; iemjs<emjs.length; iemjs++) {
      buildup+='<span style="position:absolute;top:' + cfcs[ij].style.top + ';left:' + cfcs[ij].style.left + ';font-size:' + cfcs[ij].style.fontSize + ';opacity:' + cfcs[ij].style.opacity + ';z-index:' + cfcs[ij].style.zIndex + ';">&#' + emjs[iemjs].split(';')[0] + ';</span>';
      }
      cfcs[ij].innerHTML=buildup;
      cfcs[ij].style.visibility='visible';
      }
      }
      }

    … that is the method used today to display an Emoji Overlay “character” to reflect, for a mobile application WebView scenario, of PHP mail created email usage for the Calendar Event creation functionality

  • Google Chart Annotated Timeline Flash Legacy Tutorial introduced the flexible non-flash and flash toggling functionality of the Google Chart for Timelines PHP web application we wrote called annotatedtimeline_chart.php which changed quite a lot, like “function checkforclass” above, for this Calendar Event creation integration

Why not try a Google Chart Annotated Timeline Chart live run to see what we are getting at, and while you’re there, try turning on a Calendar Event linked to one of the Timeline Events?


Previous relevant Calendar iCal Integration WordPress Tutorial is shown below.

Calendar iCal Integration WordPress Tutorial

Calendar iCal Integration WordPress Tutorial

After yesterday’s Calendar iCal Integration Email Tutorial we hoped we had a Calendar Event (creating) (component) “tool” web application that could be used in a variety of ways by other web applications. The first cab off the rank for this we decided should be (this) …


WordPress Blog

… that being our TwentyTen themed local effort. One of the reasons we plumped for this is that it involves Publishing Dates and we can even get access to a Publishing Time and even a Publishing Timezone (though this last one is a “hardcoded” (piece of) knowledge, rather than it being gleaned by WordPress (data) in any way). So we had the choice of means of display of this new functionality …

  • adding to logic of the already hyperlinked Publishing Date data string
  • adding the Publishing Time as a new HTML a (hyper)link placed after the Publishing Date and linking to the Calendar functionality
  • adding relevant Emojis as new HTML a (hyper)links after the Publishing Date and linking to the Calendar functionality

… and we plumped for the last of these thoughts with our work today, as we liked the look of 📅 ➕ 📧 (that we tried out with our proof of concept p_o_f.html) to point at …

  • Create iCal Calendar Entry
  • Create and Email iCal Calendar Entry
  • Email (only) iCal Calendar Entry

… respectively. The “go” with the email functionalities could be that you share a tutorial link with a friend whose email you know and correspond with.

And so it behoves us to show you (good ol’) TwentyTen header.php (the usual suspect) changes to make this happen below, for your perusal and/or interest …


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 calendar_pass() {
var thisc='', thiscc='', thist='', jiicp=0, thisdate='', thistime='', nexttime='', thishour=0, nexthour=0, thisminute='', thissecond='00', thisurl='';
var h1cps=docgetclass('entry-title','*'); //document.getElementsByTagName('h2');
var cps=document.getElementsByTagName('a');
for (var iicp=0; iicp<h1cps.length; iicp++) {
thist=h1cps[iicp].innerHTML.split(' <')[0].split('<')[0];
thisurl='';
if (h1cps[iicp].innerHTML.indexOf(' id="d') != -1) {
thisurl="https://www.rjmprogramming.com.au/ITblog/" + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0];
}
if (jiicp < cps.length) {
while (jiicp < cps.length && (cps[jiicp].innerHTML.indexOf(' content="') == -1 || cps[jiicp].innerHTML.indexOf('&#') != -1)) {
jiicp++;
}
if (jiicp < cps.length) {
if (cps[jiicp].title.indexOf(':') != -1) {
thisdate=cps[jiicp].innerHTML.split(' content="')[1].split('"')[0].replace('-','').replace('-','');
thishour=eval(cps[jiicp].title.split(':')[0]);
nexthour=thishour;
if (cps[jiicp].title.indexOf(' pm') != -1 && thishour < 12) thishour+=12;
if (thishour < 12) {
nexthour+=12;
} else if (nexthour < 23) {
nexthour=23;
}
thisminute=cps[jiicp].title.split(':')[1].split(' ')[0];
thistime=':' + ('0' + thishour).slice(-2) + thisminute + thissecond;
nexttime=':' + ('0' + nexthour).slice(-2) + thisminute + thissecond;
//alert(thist + ' ' + thisurl + ' ' + thisdate + thistime);
//alert("http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + thistime) + '&emode=Address&address=Address&description=Description&url=' + encodeURIComponent(thisurl));
//window.open("http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&tz=" + encodeURIComponent("Australia/Perth,Australia/Perth") + "&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + nexttime) + '&emode=AndTo&address=' + encodeURIComponent('rmetcalfe15@gmail.com') + '&description=Description&url=' + encodeURIComponent(thisurl), '_blank', 'top=45,left=55,width=600,height=600');
thisc="http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&tz=" + encodeURIComponent("Australia/Perth,Australia/Perth") + "&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + nexttime) + '&emode=To&address=emailAddress&description=Description&url=' + encodeURIComponent(thisurl);
thiscc="http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&tz=" + encodeURIComponent("Australia/Perth,Australia/Perth") + "&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + nexttime) + '&emode=Address&address=&description=Description&url=' + encodeURIComponent(thisurl);
cps[jiicp].innerHTML+=' <a id="ce' + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0] + '" title="Create iCal Calendar Event ' + thist + '" target=_blank href="' + "http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&tz=" + encodeURIComponent("Australia/Perth,Australia/Perth") + "&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + nexttime) + '&emode=AndTo&address=' + encodeURIComponent('rmetcalfe15@gmail.com') + '&description=Description&url=' + encodeURIComponent(thisurl) + '">&#128197;</a>';
cps[jiicp].innerHTML+=' <iframe id="ice' + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0] + '" src="about:blank" style="display:none;width:1px;height:1px;"></iframe><a title="Email and Create iCal Calendar Event ' + thist + '" target=_blank href="#" onclick=" var emtwo=prompt(' + "'" + 'Who do we email to?' + "','fillin@email.in'); document.getElementById('ice" + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0] + "').src='" + thisc + "'.replace(/emailAddress/g, encodeURIComponent(emtwo)); window.open('" + thiscc + "','_blank'); \">&#10133;</a>";
cps[jiicp].innerHTML+=' <a id="ee' + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0] + '" title="Email iCal Calendar Event ' + thist + '" target=_blank href="#" onclick=" var em=prompt(' + "'" + 'Who do we email to?' + "','fillin@email.in'); window.open('" + thisc + "'.replace(/emailAddress/g, encodeURIComponent(em)),'_blank'); \">&#128231;</a>";
jiicp+=3;
cps=document.getElementsByTagName('a');
}
}
}
}
}

</script>
<?php
if (isset($_GET['showtags'])) {
echo "<link href='//www.rjmprogramming.com.au/HTMLCSS/showtags.css' rel='stylesheet' type='text/css'>";
}
?>
</head>
<body onload=" checkonl(); setTimeout(initpostedoncc, 3000); sdescih(); widgetcon(); precc(); courseCookies(); cookie_fonts(); is_mentioned_by(); calendar_pass(); " <?php body_class(); ?>>

We hope you try out this WordPress TwentyTen themed blog functionality introduced with this code above.


Previous relevant Calendar iCal Integration Email Tutorial is shown below.

Calendar iCal Integration Email Tutorial

Calendar iCal Integration Email Tutorial

With yesterday’s Calendar iCal Integration Timezone Tutorial‘s emphasis on timezones, we turn our attention now, thinking of our web application as a “tool” and an integrated software product, to two interrelated issues …

  1. What does the future hold as far as using this Calendar “tool” (web application)? In other words, what software and/or operating system platforms will use it and in what way.
  2. How do we respond with this Calendar “tool” web application, fitting in with the requirements implicit in what the whole gammut of software and/or operating system platforms needing its services will need.

The most “asking” of “software and/or operating system platforms” that we can think of here is to cater for a mobile application WebView (please read here regarding Android WebView (using Eclipse or Android Studio IDEs) and iOS UIWebView (using Xcode IDE)) using the Calendar “tool” web application. Mobile platform WebViews can be programmed with Back and Forward navigation buttons, but that is not the ideal thing to rely on to get you out of a pickle that your web application may cause a mobile application WebView, if it navigates out to a place where there is no navigable return. The Back and Forward mobile application WebView buttons may work to return from a Calendar Event population event … honestly don’t know … but we’d prefer to cater for a new means by which such an “offshoot” feeling of navigation can be avoided. So in our new incarnation of the Calendar (event) web application we allow any/all of the following three modes of rjmprogramming-event.ics creation …

  1. Create iCal Calendar Entry
  2. Email (only) iCal Calendar Entry
  3. Create and Email iCal Calendar Entry

… where the second of those above would leave you, within the web application running within a mobile application’s WebView, not moving off the webpage you are on, and thus not falling foul of any “offshoot” navigation weaknesses (to the process).

This new emailing functionality, again only in serverside PHP (and not in clientside Javascript), is relatively easy to arrange by rearranging many of the PHP header statements and feeding that through to the PHP mail function to shoot off the email, given that the user, ahead of time, has supplied you with that filled in email address, which we also attend to today.

Our web application has, in two separate areas of the code, made use of an HTML select element’s child option elements’ title properties to contain useful information for the web application’s workings. We’ll show you below some code to access the information stored from such an arrangement …


<select onchange='document.getElementById("subb").value=this.options[this.selectedIndex].title;' id='emode' name='emode'><option title='Create iCal Calendar Entry' value='Address'>Address</option><option title='Email (only) iCal Calendar Entry' value='To'>Email To (only)</option><option title='Create and Email iCal Calendar Entry' value='AndTo'>Email To (as well)</option></select>

… and you might wonder about the destination for the HTML option title property storage here? We use it to rename our HTML form’s input type=submit button that fires off the callback message. The “guises” of our one HTML input type=submit thus have a one to one correspondence with the values on that HTML select (dropdown) element, and with that list of “modes of output” we showed above. This is our approach to this today, but there are other approaches to such requirements regarding HTML form element HTML input type=submit element arrangements, and you may prefer to use multiple forms and/or multiple input type=submit buttons as we talk about with the series of blog posts finishing, so far, with HTML Multiple Form Multiple Submit Buttons Primer Tutorial.

Actually yesterday we prepared for another eventuality down the road of usefulness for this web application, but before we tell you about that, what we’d encourage you to do yourself should you put such a Calendar (event) web application into production is, interface your data flow not with $_POST[] (nor $_GET[] … damn, gave away the secret) but we’d prefer you to have it be that data in and out, as required, is stored in a secure database of some sort, for security purposes. But back to our (not very well kept) secret, yesterday, we prepared the ground for the web application (callback functionality) to be accessible via PHP $_GET[] arguments.

So, sorry not to have moved off “tool” (web application) work today, but it is very important to try to think of most/all eventualities you can imagine, ahead of the time when you get to the integration tasks the other way around, that is, the integration from the viewpoint of the software acting as “parent” or “co-operative peer” to your Calendar (event) “tool” web application.

The reshaped PHP code now additionally catering for email “messaging” functionality you could call ics_attachment.php, which changed in this way, able to be run with this live run link. We hope you try out the new email functionality yourself.


Previous relevant Calendar iCal Integration Timezone Tutorial is shown below.

Calendar iCal Integration Timezone Tutorial

Calendar iCal Integration Timezone Tutorial

You might have thought with yesterday’s Calendar iCal Integration Primer Tutorial‘s emphasis on timezones we’d have …

  • had too much
  • seen too little
  • invited Goldilocks for some porridge

… but time is quite a complex scenario on Earth, when it comes to timezones for at least two reasons, one being a functional improvement, and one being to fix a bug, that being …

  1. things like WebEx or Skype or GoTo Meeting are not tied down by geography and you may want Calendar functionality to reflect this, or you may also want it to cater for airplane departure and arrival times in various timezones around the world, and it would be best if the HTML form user entry phase catered for a user specifying a date and time not necessarily in either of their local timezone nor the GMT timezone (of the iCal “Z” property special interest) … is the functional improvement, whereas …
  2. we had a bug, leaving off from yesterday’s work with timezones whose GMT offset involved half hour differences … and yes, that happens quite often … and the bug will occur as of yesterday’s code when you come to use those PHP DateTime object add and/or sub methods where the PT[offset]H argument has an [offset] involving a decimal point, so it behoves us to update that relevant PHP code snippet for you, again, below, regarding that (and remind … forgot yesterday … that $ts variable is a user HTML form passed date and time) …

    $di="PT" . str_replace("-","",("" . $start_end_offsets[$thisi])) . "H";
    $parsed_date = DateTime::createFromFormat('Ymd:His', $ts);
    if (strpos(("" . $start_end_offsets[$thisi]), "-") !== false) {
    if (strpos($di, ".") !== false) {
    $parsed_date->sub(new DateInterval(explode(".",$di)[0] . "H"));
    $parsed_date->sub(new DateInterval("PT30M"));
    } else {
    $parsed_date->sub(new DateInterval($di));
    }
    } else {
    if (strpos($di, ".") !== false) {
    $parsed_date->add(new DateInterval(explode(".",$di)[0] . "H"));
    $parsed_date->add(new DateInterval("PT30M"));
    } else {
    $parsed_date->add(new DateInterval($di));
    }
    }
    $outts = $parsed_date->format('Ymd:His');

Now allowing for the first idea above is not as involved as you may think, but only if you think serverside PHP, rather than think it will be easy with clientside Javascript. And what makes it a doddle, generally, are all those Open Source contributors to knowledge out there, and those great computing program language documenters out there exemplified in their brilliance with this totally useful link to the PHP timezone_identifiers_list and PHP DateTimeZone object method getOffset method links. So we allow the user to enter any of …

  • Local
  • GMT
  • Any of the half hour timezone numerical offset (indicators) from -24 to 24
  • Any of the timezone names as per those PHP methods above, with valid continental prefix names

… to define the start and end date and time parameters to express for their Calendar iCal Event that they define. Along the way we also add in dropdowns and HTML input type=number (year) elements to help for those not so keen on keyboard entry.

Guess you’d say we are still on the “tool” feel of the web application, but aim to move more on the “integration” front into the future.

Here is the renewed PHP code you could call ics_attachment.php, that changed in this way, able to be run with this live run link. We hope you try it out for yourself, especially as we’ve added some Google Chart Map Chart linking of the “when” and “where” of defined timezone thinking, via the use of PHP’s DateTimeZone object method getLocation, as you can see happening with today’s tutorial picture.


Previous relevant Calendar iCal Integration Primer Tutorial is shown below.

Calendar iCal Integration Primer Tutorial

Calendar iCal Integration Primer Tutorial

Do you remember us talking about the ICS extension file when we presented WebEx Prerecording Primer Tutorial as shown below? It is an integration input to working with iCal Calendar software.

So here we are at a “when” of life tutorial, which is always an interesting exercise in our book. And “book” could be the go for an application to use this type of functionality. When you “book” something, you’d often want to remind yourself and/or others of such an event. But for now, we are concentrating on making a “tool” type of web application that will suit future purposes.

We’ve built a web application around the useful logic presented in this great Git repository today, writing our code in PHP, because you are dealing with header manipulation here centering around …


header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=rjmprogramming-event.ics');
echo $ical;

… where the PHP variable $ical contents has been pieced together in response to a callback from an earlier HTML form execution of the same ics_attachment.php code where the necessary details are collected off the user.

If you try the live run you’ll probably glean that most of our concern centered around the date and time, regarding timezone use so that we …

  • in the HTML form execution we use client Javascript to glean the local timezone and local date and time to default the form appropriately … so that …
  • in the HTML form execution the user fills out Calendar Event start and end times with respect to local time and this, along with an offset to get these times back to UTC or (Greenwich Mean Time) are passed to the callback web application (which is the same web application) … so that …
  • the second callback execution constructs the iCal (for an rjmprogramming-event.ics attachment) with these UTC (or GMT) date and times in mind, whereby the “Z” timezone parameter fits the bill nicely … and when …
  • the user saves this rjmprogramming-event.ics event into the iCal Calendar application, where the event will be shown back relative to the local date and time

The date and time functions used to make this happen are …

  1. Javascript’s Date object …

    var dd=new Date();
    var qw=eval((eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2]) - eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2] % 100)) / 100) + eval((0.0 + eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2] % 100)) / 60.0);
    if (dd.toTimeString().indexOf('+') != -1) qw=-qw;
    document.getElementById('tz').value=qw;
  2. Javascript’s Date object’s toTimeString method (as shown above) to glean the local timezone offset, and its opposite
  3. PHP’s DateTime object …

    $di="PT" . str_replace("-","",urldecode($_POST['tz'])) . "H";
    $parsed_date = DateTime::createFromFormat('Ymd:His', $ts);
    if (strpos(urldecode($_POST['tz']), "-") !== false) {
    $parsed_date->sub(new DateInterval($di));
    } else {
    $parsed_date->add(new DateInterval($di));
    }
    $outts = $parsed_date->format('Ymd:His');

  4. PHP’s DateTime object’s createFromFormat constructor method (as above) to create a DateTime object from the passed through user details
  5. PHP’s DateInterval object
  6. PHP’s DateTime object’s add and/or sub methods (as above) to create a DateTime object with a DateInterval offset to UTC (or GMT) (expressed in hours)
  7. PHP’s DateInterval object’s format method (as above) to end up with a UTC (or GMT) expression of date and time to be placed into the rjmprogramming-event.ics iCal message

We’ll probably be revisiting with improvements soon, but we hope you try it for yourself.


Previous relevant WebEx Prerecording Primer Tutorial is shown below.

WebEx Prerecording Primer Tutorial

WebEx Prerecording Primer Tutorial

We’ve been trying out WebEx (by Cisco) prerecording as a video conferencing idea as an alternative to …

… regarding video conferencing products we’ve tried at this blog.

Have to say, WebEx is great, even with respect to the “wide eyed and bushy tailed” reaction “this little black duck” has to all these networky communicaty ideas on the net (at least we spelt “net” correctly).

Have to thank my wife, Maree, for her expertise and the facilities her company, Thomson Reuters, supplies for the serving of WebEx recordings … thanks everyone. Have been assured they are periodically deleted, and my lame impersonations of the old “ducks on the wall” can rest in peace shortly.

And so, we have a slideshow starting with a WebEx email link to join a meeting, and we pan down the email to show you other WebEx functionalities, such as adding a Calendar reference to the meeting time, and though we haven’t shown you detail here, rest assured it handles timezone scenarios very well, unless you lie about living in Antarctica, that is … sorry, scientists in Antarctica reading this blog posting … all 237 of you.

During this “earlier than today exploration of WebEx” session the necessary software installs just happened for this MacBook Pro Mac OS X laptop as if we were shelling peas … it’s always good to have some handy when installing any software. So we won’t show you this unless we deem it essential at a later date. You can perhaps do as I did, and ask a real WebEx user invite you to a meeting, to set yourself up. In fact, today’s session meeting creation time you may notice is well in the past from that earlier introductory learning session Maree and I had, and you can bring back up that old email, and resurrect that meeting again and again, if you like … am not sure if there is an expiry date on this too, like with server stored WebEx prerecordings.

So also rest assured, WebEx handles …

  • video via webcam on your device
  • audio via microphone on your device (“Use Computer”) or via a phone line
  • the synchronization of the two above
  • mobile devices

Did you know?

A .ics extension file, as you can see being used as an email attachment file extension in is, as explained in this link‘s sublink

ICS is a global format for calendar files widely being utilized by various calendar and email programs including Google Calendar, Apple iCal, and Microsoft Outlook. These files enable users to share and publish information directly from their calendars over email or via uploading it to the world wide web.

… as helping interface meetings to online calendar appointments. Cute, huh?!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

The Word Web Primer Tutorial

The Word Web Primer Tutorial

The Word Web Primer Tutorial

Depending on how young you are it may be hard to swallow the fact that …

There was a computerized world before the Internet

… even before GraphicalUserInterface even, when in the 1970’s Xerox wrote an operating system inspiring the GUI Windows and Mac OS X thinking of later years after a period that went through command line only IBM DOS and MicroSoft-DOS (placed on an IBM PersonalComputer (alas, not called “Hal”)) operating systems, some years before that desktop personal computing of Windows and Mac OS X and Commodores and XBox and GameBoys and PlayStations etcetera etcetera etcetera.

In the current Internet online world the word “web” appears a lot, originally deriving from the concept of the World Wide Web. Think …

  • web browser … in all likelihood you’re using one (ie. a desktop application in a GUI operating system) now reading this … presented on a …
  • webpage … UniformResourceLocator via that web browser’s address bar or a link off another webpage or email or SMS or some other online form of communication, in all likelihood as content based on the HTML format … which was constructed, as content, based on HTML files (and/or server based files such as PHP *.php or .Net Framework *.aspx etcetera ones that get translated to HTML) under the auspices of a …
  • web protocol … delivery system

    Web protocols are sets of rules that define how data is formatted and transmitted over the internet, enabling devices and applications to communicate with each other. Key protocols include HTTP for web page transfer, HTTPS for secure connections, DNS for translating domain names to IP addresses, and TCP/IP for reliable data transmission across networks.

    … those webpages the representative content for a …

  • website

    A website (also written as a web site) is any web page whose content is identified by a common domain name and is published on at least one web server. Websites are typically dedicated to a particular topic or purpose, such as news, education, commerce, entertainment, or social media. Hyperlinking between web pages guides the navigation of the site, which often starts with a home page. The most-visited sites are Google, YouTube, and Facebook.

    … living on a …

  • web server … computer, this RJM Programming one being an AlmaLinux operating system based Apache web server supporting PHP server computer language and MySql database server (though other web server type names you might come across could be Tomcat or Nginx, Microsoft IIS (Internet Information Services) or LiteSpeed or Node.js) … where that webpage content can be enhanced via the use of a …
  • web application

    A web application (or web app) is application software that is created with web technologies and runs via a web browser.[1][2] Web applications emerged during the late 1990s and allowed for the server to dynamically build a response to the request, in contrast to static web pages.

    … sponsored by, for a lot of web servers, a …

  • web host

    A web hosting service is a type of Internet hosting service that hosts websites for clients, i.e. it offers the facilities required for them to create and maintain a site and makes it accessible on the World Wide Web. Companies providing web hosting services are sometimes called web hosts.

    … and whether you refer to it this way or not, coming off reading this you may well then be accessing technology based on …

  • web streaming

    Web streaming is the continuous delivery of audio/video content over the internet, letting you watch or listen instantly without downloading the whole file, common in services like Netflix, YouTube, and live broadcasts (e.g., Twitch, TV channels). It’s either on-demand (like movies) or live, sending data in real-time for events like sports or video calls, making media accessible instantly on internet-connected devices.

    … most likely for entertainment or educational purposes … or perhaps more your style gravitates towards a …

  • web game

    A browser game is a video game that is played over the Internet using a web browser, typically without the need for dedicated hardware or software installation.[1] They are sometimes referred to more specifically by their format, such as Flash games[2] or HTML5 games.

… as just a “tipping our toe” into the vast ocean of uses of the word “web” regarding today’s World Wide Web online world.

If this was interesting you may be interested in this too.

Posted in eLearning, GUI, Hardware, Networking, Operating System, Software, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

How Come Primer Tutorial

How Come Primer Tutorial

How Come Primer Tutorial

Were you around when, with Calendar Location Services Integration Tutorial‘s blurb we surmised that …

why

… may be the least accessible English question word as far as online content goes? Well …

  1. pretty obviously, this is just an opinion …
  2. we think questions starting with “why” are better catered for, as time goes on …
  3. it’s very natural for the younger members of our community to ask a “why” question using the English words …

    how come

    … more often … in our opinion

This disarming modification sure works better getting a response from me, and is this us remembering our childhood?! Is it a way in to ask the questions “you were always afraid to ask”?

Anyway, channeling All because you asked for it we’ve written a tiny web application today, asking “How come” questions of Google for our (and we’re hoping, your) curiosity, because you can form your own questions.

Yeh, but you can just type your question into a web browser address bar!

Indeed, and we highly recommend it! But do remember, not everything you read online is necessarily the “gospel truth”. It’s best, when matters are controversial, to read more than one source, and the links that make it to the top of a Google search can be there via sponsorship (though some of these are indicated that way).

Feel free to try our proof of concept first draft how_come.html How Come web application …


Previous relevant Calendar Location Services Integration Tutorial is shown below.

Calendar Location Services Integration Tutorial

Calendar Location Services Integration Tutorial

Of all those English question words …

  • why
  • which
  • how
  • what
  • who
  • when
  • where

… which is more apt as far as software goes? Well, and sorry to our regulars who have heard our theories so often, it goes in order of prominence …

  • where
  • when

… then the rest … ie. the reverse order of order way above, we reckon.

And so, being reminded on an upgrade of our macOS version to Big Sur version 11.6 the other day, opening the macOS Calendar desktop application version 11.0 (2811.5.1) (as we did earlier, with a previous version, with Calendar iCal Integration Itinerary Time Tutorial), that locations were honoured with an Apple Maps integration (should you permit Location Services to help you) along with news about Siri integration improving Calendar’s AI credentials, we were pretty much tickled pink to be combining the “when” with the “where” in the one desktop application.

Maybe you will be too?!


Previous relevant Calendar Location Services Integration Tutorial is shown below.

Calendar iCal Integration Itinerary Time Tutorial

Calendar iCal Integration Itinerary Time Tutorial

A while back we left off our software integration of Calendar iCal Events into Google Chart Timeline Chart functionality (last visited with Calendar iCal Integration Itinerary Post Tutorial as shown below) with the quote …

… closing the circle, for now, with our Calendar Event software integrated Timelines.

… but want to retreat from that “finality”, because it’s been burning away within us as an annoyance, regarding this software integration. We think we can do better (with the integration). And we now think that, doing the research and development on this, that it is technically fairly easy to make that improvement, which goes …

We want to have the Google Chart Timeline Chart date resolution to match the Calendar iCal Event resolution, which is to the nearest second, rather than to the nearest day, as it used to be for our Google Chart Timeline Charts

… but we are going to hang back from asking for time hh24:mi:ss entries in the Google Chart Timeline Chart web application itself (when executing as the “parent” web application), because we can accept time data coming in from, say, the Itinerary web application, specifying the date and times to the nearest second (optionally). The reason for this is that to ask for the time everywhere can be offputting when there are so many Timeline scenarios where it is not really the “go” … think, “dates in history” for example.

What is in the “innards” of the Google Chart Timeline Chart web application controlling this “date” (data) resolution? It is controlled by calls to create Javascript Date objects via Javascript Date object constructor (calls), and up to now, they have been exclusively of the form …


var date_object = new Date(year, month, date);

… and this set us to exploring other Javascript Date object constructors, and, as you’d expect … but is a little non-intuitive because of the “Date” object naming … well that’s my excuse, anyway … it allows for (the overload) …


var date_object = new Date(year, month, date, hour, minute, second);

But that is not to say that just to see that this (Javascript functionality) is so, doesn’t always make it so (for Google Chart usage). However, it just so happens, it does, in this case, because there are no problems changing these Date constructor calls as far as the software interface to the Google Charts Timeline Chart API is concerned (we unit tested to confirm) … yayyyy!!

It does mean, though, that the code should handle either type of constructor, and this constructor is significant to our Google Chart select (onclick) event coding, as we examine these constructors from document.head.innerHTML to glean this information.

We may, next, but not for now, extend the Google Chart Timeline Chart web application to ask for times optionally, perhaps, via the clicking of an HTML input type=checkbox element, but for now we’re happy, because a user can do any of …

  • Google Chart Timeline Chart web application execution where it is the parent web application … date resolution: day
  • Itinerary (web application) that displays into the Google Chart Timeline Chart web application … date resolution: second
  • Date and Time Timeline with Calendar iCal Events (web application) that displays into the Google Chart Timeline Chart web application … date resolution: second

… and the last two are available as links from the first, so, we figure, the user can end up with what they were after, with all these choices of execution modes.

And so, what timezones happen here?

  • Google Chart Timeline Chart web applications use your local date (and time)
  • Calendar iCal Event destination use your local date (and time) too … but …
  • iCal interfacing messages most easily use “Z” form, that uses GMT dates (and time)
  • Itinerary (or Date and Time Timeline with Calendar iCal Events) web application allows for times in any timezone you designate

… and we have to map any non-local timezone usage to local time, especially with the last option above, to avoid confusion, and to make Calendar iCal Event destination application data match the content, and now, resolution, of its Google Chart Timeline Chart counterpart. Annoyance over!

The results of this work consisted of …

  • no changes to external Javascript you could call gettopost.js … called defer=’defer’ by …
  • our PHP “Itinerary”, and now, also, “Generic Timeline with Dates and Times” code you could call itinerary.php which changed a lot, and has the “Itinerary” type of live run and has the “Generic Timeline with Dates and Times (and Calendar Events)” type of live run
  • our PHP above calls the original Google Chart Timeline Chart (with its “onclick” select event functionality) you could call timeline_chart.php which changed a little to recognize Timelines that can Involve Times (and Calendar Events) as well as the usual Dates (and if you want to try its live run … then there it went?!)

Previous relevant Calendar iCal Integration Itinerary Post Tutorial is shown below.

Calendar iCal Integration Itinerary Post Tutorial

Calendar iCal Integration Itinerary Post Tutorial

We’re improving software integration on a few fronts today, extending the existing Itinerary software from Calendar iCal Integration Itinerary Tutorial as shown below, namely …

  • realizing that the only difference between an “Itinerary” and any “Timeline Involving Dates and Times (and Calendar Events)” is the descriptive bits about airports and such things, so why not use the same code, and allow for a call a certain way, to turn that “Itinerary” code into the code for that generic “Timeline Involving Dates and Times (and Calendar Events)” … which affected …
  • the Google Chart Timeline Chart needs to allow for these new functionalities … and so it does with code in between <head> and </head> …

    setTimeout(itintobitsatend, 900);
    function itintobitsatend() {
    <?php
    if (file_exists("itinerary.php")) {
    echo "
    if (document.getElementById('bitsatend').innerHTML.indexOf('Itinerary') == -1) {
    document.getElementById('bitsatend').innerHTML+='&nbsp;<a target=_blank title=Itinerary href=http://www.rjmprogramming.com.au/PHP/TimelineChart/itinerary.php>Itinerary with Calendar Events</a>&nbsp;<a target=_blank title=Times href=http://www.rjmprogramming.com.au/PHP/TimelineChart/itinerary.php?justaddtime=y>Timeline with Dates and Times and Calendar Events</a>';
    }
    ";
    }
    ?>
    }

    … as well as …
  • our software integration improvement we did that “proof of concept” preparation about yesterday with HTML Div Overlay Jigsaw Talents Primer Tutorial that is actually the means by which we cater for large amounts of “Itinerary” or “Generic Timeline with Dates and Times” data by
    1. establishing a new external Javascript using HTML script property defer=’defer’ loaded after the local Javascript (that contains a “stub” function maybegettopost(instg, showit) { return instg; }) with two major functions … namely …
      • a page load setTimeout started function lookforjigsaw() that looks for an HTML div “jigsaw” arrangement like talked about yesterday, and if not, create the scenario, and leave the user with a 3 member array of HTML div id list for original content, iframe perhaps later overlays content, form to fire off iframe data as required content respectively, usage … and …
      • an external Javascript overloading version of function maybegettopost(instg, showit) that checks the length of the proposed get $_GET[] type parameter call (ie. using ? and & on address bar with long URLs), and if too long, convert that $_GET[] type parameter call data into $_POST[] type parameter call (remembering … doh … that the PHP (sorrrryyyy) receiver code should cater for this)
    2. change the “Itinerary” PHP web application code to, from now on, when calling another web application in a (default) $_GET[] type parameter call way, filter that call data through function maybegettopost(instg, showit) … the showit is a boolean that is true if we end up navigating to that call data “URL” (ie. we “show it”)

Maybe you need to see the software additions and changes to see this for yourself, which consisted of …

  • new external Javascript you could call gettopost.js … called defer=’defer’ by …
  • our PHP “Itinerary”, and now, also, “Generic Timeline with Dates and Times” code you could call itinerary.php which changed a little, and now has the “Itinerary” type of live run and has the “Generic Timeline with Dates and Times (and Calendar Events)” type of live run
  • our PHP above calls the original Google Chart Timeline Chart (with its “onclick” select event functionality) you could call timeline_chart.php which changed a little to recognize Timelines that can Involve Times (and Calendar Events) as well as the usual Dates (and if you want to try its live run … then there it was?!)

… closing the circle, for now, with our Calendar Event software integrated Timelines. With such software integration, break complex integrations into bits you can unit test, and don’t move on until that unit test works. On the next level of unit testing, make sure you prove that previous unit tests still work.


Previous relevant Calendar iCal Integration Itinerary Tutorial is shown below.

Calendar iCal Integration Itinerary Tutorial

Calendar iCal Integration Itinerary Tutorial

After the recent Calendar iCal Integration Timeline Tutorial you may have associated a Timeline with a Calendar event, even when the End Time of that event is not a defined concept, but what about a software integration, again with a Google Chart, but this time with …


Google Chart Timeline Chart

… “shaped” into a web application suitable to enter Itinerary information and then be able to associate these Timeline Start and End Events with iCal Calendar Starts and Ends to events, created …

  • interactively, using the user’s default iCal application … and/or (in the case of “mobile” we should say “but rather”) via …
  • email via PHP mail function

? This “Itinerary” concept has a huge amount of synergy with Calendar events, especially as a reminder service to people going on the trip (of the Itinerary) and/or to those affected by their absence, and so we found it a concrete type of web application to “start” out on. Yes, and there’s more! Tomorrow’s blog posting, you’ll have trouble believing, will have a connection, as a “proof of concept”, of where we go next with this project. So, after tomorrow’s explanation, we’ll probably see you back hereabouts in two days.

But, in the meantime, for starters, try the PHP source code of itinerary.php and its live run to see what we are getting at here. If you try it, you’ll see that the Emoji Overlay sizing is determined on a integration “parent” subject by integration “parent” subject basis.


Previous relevant Calendar iCal Integration Timeline Tutorial is shown below.

Calendar iCal Integration Timeline Tutorial

Calendar iCal Integration Timeline Tutorial

After the recent Calendar iCal Integration WordPress Tutorial we found another integration candidate for our Calendar Event (creating) (component) “tool” web application that could be used in a variety of ways by other web applications. The second cab off the rank for this we decided should be (this) …


Google Chart Annotated Timeline Chart

… which should come as no surprise of a candidate for Calendar integration.

So a few things have come together for this work, those being …

  • Calendar iCal Integration WordPress Tutorial got us into an integration with PHP and fitting in with existing Javascript DOM issues … but only for discrete Emoji concepts … whereas …
  • Emoji Overlay Share Tutorial yesterday was a proof of concept in two ways …
    1. code to respond to click events with regard to Emoji Overlays … but it also had within the code, and we tested it behind the scenes, the way it could …
    2. work off HTML primed with the special class “emojioverlay” and primed with a Javascript DOM property that would yield Emoji discrete “characters” but with the “#” missed out … believe me, this “kludgy feeling” idea saves a lot of bother because when you go back and retrieve the innerHTML property of Emoji data you do not easily arrive back at …

      &#[codepoint];

      … and we work via our homegrown Javascript docgetclass function to be able to overlay Emojis via the usual …

      • position:absolute property
      • opacity … and though it was optional for today’s work, we also included the third often used “overlay” CSS “player” … namely …
      • z-index

      … and this Javascript function …

      function checkforclass() {
      var buildup="";
      var cfcs=docgetclass('emojioverlay','*');
      for (var ij=0; ij<cfcs.length; ij++) {
      if (cfcs[ij].innerHTML.replace(/&amp;/g,'&').indexOf(';&') != -1) {
      var emjs=cfcs[ij].innerHTML.replace(/&amp;/g,'&').split("&");
      buildup='';
      cfcs[ij].style.opacity=eval(cfcs[ij].style.opacity / eval(-1 + emjs.length));
      for (var iemjs=1; iemjs<emjs.length; iemjs++) {
      buildup+='<span style="position:absolute;top:' + cfcs[ij].style.top + ';left:' + cfcs[ij].style.left + ';font-size:' + cfcs[ij].style.fontSize + ';opacity:' + cfcs[ij].style.opacity + ';z-index:' + cfcs[ij].style.zIndex + ';">&#' + emjs[iemjs].split(';')[0] + ';</span>';
      }
      cfcs[ij].innerHTML=buildup;
      cfcs[ij].style.visibility='visible';
      }
      }
      }

    … that is the method used today to display an Emoji Overlay “character” to reflect, for a mobile application WebView scenario, of PHP mail created email usage for the Calendar Event creation functionality

  • Google Chart Annotated Timeline Flash Legacy Tutorial introduced the flexible non-flash and flash toggling functionality of the Google Chart for Timelines PHP web application we wrote called annotatedtimeline_chart.php which changed quite a lot, like “function checkforclass” above, for this Calendar Event creation integration

Why not try a Google Chart Annotated Timeline Chart live run to see what we are getting at, and while you’re there, try turning on a Calendar Event linked to one of the Timeline Events?


Previous relevant Calendar iCal Integration WordPress Tutorial is shown below.

Calendar iCal Integration WordPress Tutorial

Calendar iCal Integration WordPress Tutorial

After yesterday’s Calendar iCal Integration Email Tutorial we hoped we had a Calendar Event (creating) (component) “tool” web application that could be used in a variety of ways by other web applications. The first cab off the rank for this we decided should be (this) …


WordPress Blog

… that being our TwentyTen themed local effort. One of the reasons we plumped for this is that it involves Publishing Dates and we can even get access to a Publishing Time and even a Publishing Timezone (though this last one is a “hardcoded” (piece of) knowledge, rather than it being gleaned by WordPress (data) in any way). So we had the choice of means of display of this new functionality …

  • adding to logic of the already hyperlinked Publishing Date data string
  • adding the Publishing Time as a new HTML a (hyper)link placed after the Publishing Date and linking to the Calendar functionality
  • adding relevant Emojis as new HTML a (hyper)links after the Publishing Date and linking to the Calendar functionality

… and we plumped for the last of these thoughts with our work today, as we liked the look of 📅 ➕ 📧 (that we tried out with our proof of concept p_o_f.html) to point at …

  • Create iCal Calendar Entry
  • Create and Email iCal Calendar Entry
  • Email (only) iCal Calendar Entry

… respectively. The “go” with the email functionalities could be that you share a tutorial link with a friend whose email you know and correspond with.

And so it behoves us to show you (good ol’) TwentyTen header.php (the usual suspect) changes to make this happen below, for your perusal and/or interest …


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 calendar_pass() {
var thisc='', thiscc='', thist='', jiicp=0, thisdate='', thistime='', nexttime='', thishour=0, nexthour=0, thisminute='', thissecond='00', thisurl='';
var h1cps=docgetclass('entry-title','*'); //document.getElementsByTagName('h2');
var cps=document.getElementsByTagName('a');
for (var iicp=0; iicp<h1cps.length; iicp++) {
thist=h1cps[iicp].innerHTML.split(' <')[0].split('<')[0];
thisurl='';
if (h1cps[iicp].innerHTML.indexOf(' id="d') != -1) {
thisurl="https://www.rjmprogramming.com.au/ITblog/" + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0];
}
if (jiicp < cps.length) {
while (jiicp < cps.length && (cps[jiicp].innerHTML.indexOf(' content="') == -1 || cps[jiicp].innerHTML.indexOf('&#') != -1)) {
jiicp++;
}
if (jiicp < cps.length) {
if (cps[jiicp].title.indexOf(':') != -1) {
thisdate=cps[jiicp].innerHTML.split(' content="')[1].split('"')[0].replace('-','').replace('-','');
thishour=eval(cps[jiicp].title.split(':')[0]);
nexthour=thishour;
if (cps[jiicp].title.indexOf(' pm') != -1 && thishour < 12) thishour+=12;
if (thishour < 12) {
nexthour+=12;
} else if (nexthour < 23) {
nexthour=23;
}
thisminute=cps[jiicp].title.split(':')[1].split(' ')[0];
thistime=':' + ('0' + thishour).slice(-2) + thisminute + thissecond;
nexttime=':' + ('0' + nexthour).slice(-2) + thisminute + thissecond;
//alert(thist + ' ' + thisurl + ' ' + thisdate + thistime);
//alert("http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + thistime) + '&emode=Address&address=Address&description=Description&url=' + encodeURIComponent(thisurl));
//window.open("http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&tz=" + encodeURIComponent("Australia/Perth,Australia/Perth") + "&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + nexttime) + '&emode=AndTo&address=' + encodeURIComponent('rmetcalfe15@gmail.com') + '&description=Description&url=' + encodeURIComponent(thisurl), '_blank', 'top=45,left=55,width=600,height=600');
thisc="http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&tz=" + encodeURIComponent("Australia/Perth,Australia/Perth") + "&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + nexttime) + '&emode=To&address=emailAddress&description=Description&url=' + encodeURIComponent(thisurl);
thiscc="http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&tz=" + encodeURIComponent("Australia/Perth,Australia/Perth") + "&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + nexttime) + '&emode=Address&address=&description=Description&url=' + encodeURIComponent(thisurl);
cps[jiicp].innerHTML+=' <a id="ce' + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0] + '" title="Create iCal Calendar Event ' + thist + '" target=_blank href="' + "http://www.rjmprogramming.com.au/PHP/ics_attachment.php?id=0&tz=" + encodeURIComponent("Australia/Perth,Australia/Perth") + "&eventwords=test&title=" + encodeURIComponent(thist) + '&stage=' + encodeURIComponent(h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0]) + '&datestart=' + encodeURIComponent(thisdate + thistime) + '&dateend=' + encodeURIComponent(thisdate + nexttime) + '&emode=AndTo&address=' + encodeURIComponent('rmetcalfe15@gmail.com') + '&description=Description&url=' + encodeURIComponent(thisurl) + '">&#128197;</a>';
cps[jiicp].innerHTML+=' <iframe id="ice' + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0] + '" src="about:blank" style="display:none;width:1px;height:1px;"></iframe><a title="Email and Create iCal Calendar Event ' + thist + '" target=_blank href="#" onclick=" var emtwo=prompt(' + "'" + 'Who do we email to?' + "','fillin@email.in'); document.getElementById('ice" + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0] + "').src='" + thisc + "'.replace(/emailAddress/g, encodeURIComponent(emtwo)); window.open('" + thiscc + "','_blank'); \">&#10133;</a>";
cps[jiicp].innerHTML+=' <a id="ee' + h1cps[iicp].innerHTML.split(' id="d')[1].split('"')[0] + '" title="Email iCal Calendar Event ' + thist + '" target=_blank href="#" onclick=" var em=prompt(' + "'" + 'Who do we email to?' + "','fillin@email.in'); window.open('" + thisc + "'.replace(/emailAddress/g, encodeURIComponent(em)),'_blank'); \">&#128231;</a>";
jiicp+=3;
cps=document.getElementsByTagName('a');
}
}
}
}
}

</script>
<?php
if (isset($_GET['showtags'])) {
echo "<link href='//www.rjmprogramming.com.au/HTMLCSS/showtags.css' rel='stylesheet' type='text/css'>";
}
?>
</head>
<body onload=" checkonl(); setTimeout(initpostedoncc, 3000); sdescih(); widgetcon(); precc(); courseCookies(); cookie_fonts(); is_mentioned_by(); calendar_pass(); " <?php body_class(); ?>>

We hope you try out this WordPress TwentyTen themed blog functionality introduced with this code above.


Previous relevant Calendar iCal Integration Email Tutorial is shown below.

Calendar iCal Integration Email Tutorial

Calendar iCal Integration Email Tutorial

With yesterday’s Calendar iCal Integration Timezone Tutorial‘s emphasis on timezones, we turn our attention now, thinking of our web application as a “tool” and an integrated software product, to two interrelated issues …

  1. What does the future hold as far as using this Calendar “tool” (web application)? In other words, what software and/or operating system platforms will use it and in what way.
  2. How do we respond with this Calendar “tool” web application, fitting in with the requirements implicit in what the whole gammut of software and/or operating system platforms needing its services will need.

The most “asking” of “software and/or operating system platforms” that we can think of here is to cater for a mobile application WebView (please read here regarding Android WebView (using Eclipse or Android Studio IDEs) and iOS UIWebView (using Xcode IDE)) using the Calendar “tool” web application. Mobile platform WebViews can be programmed with Back and Forward navigation buttons, but that is not the ideal thing to rely on to get you out of a pickle that your web application may cause a mobile application WebView, if it navigates out to a place where there is no navigable return. The Back and Forward mobile application WebView buttons may work to return from a Calendar Event population event … honestly don’t know … but we’d prefer to cater for a new means by which such an “offshoot” feeling of navigation can be avoided. So in our new incarnation of the Calendar (event) web application we allow any/all of the following three modes of rjmprogramming-event.ics creation …

  1. Create iCal Calendar Entry
  2. Email (only) iCal Calendar Entry
  3. Create and Email iCal Calendar Entry

… where the second of those above would leave you, within the web application running within a mobile application’s WebView, not moving off the webpage you are on, and thus not falling foul of any “offshoot” navigation weaknesses (to the process).

This new emailing functionality, again only in serverside PHP (and not in clientside Javascript), is relatively easy to arrange by rearranging many of the PHP header statements and feeding that through to the PHP mail function to shoot off the email, given that the user, ahead of time, has supplied you with that filled in email address, which we also attend to today.

Our web application has, in two separate areas of the code, made use of an HTML select element’s child option elements’ title properties to contain useful information for the web application’s workings. We’ll show you below some code to access the information stored from such an arrangement …


<select onchange='document.getElementById("subb").value=this.options[this.selectedIndex].title;' id='emode' name='emode'><option title='Create iCal Calendar Entry' value='Address'>Address</option><option title='Email (only) iCal Calendar Entry' value='To'>Email To (only)</option><option title='Create and Email iCal Calendar Entry' value='AndTo'>Email To (as well)</option></select>

… and you might wonder about the destination for the HTML option title property storage here? We use it to rename our HTML form’s input type=submit button that fires off the callback message. The “guises” of our one HTML input type=submit thus have a one to one correspondence with the values on that HTML select (dropdown) element, and with that list of “modes of output” we showed above. This is our approach to this today, but there are other approaches to such requirements regarding HTML form element HTML input type=submit element arrangements, and you may prefer to use multiple forms and/or multiple input type=submit buttons as we talk about with the series of blog posts finishing, so far, with HTML Multiple Form Multiple Submit Buttons Primer Tutorial.

Actually yesterday we prepared for another eventuality down the road of usefulness for this web application, but before we tell you about that, what we’d encourage you to do yourself should you put such a Calendar (event) web application into production is, interface your data flow not with $_POST[] (nor $_GET[] … damn, gave away the secret) but we’d prefer you to have it be that data in and out, as required, is stored in a secure database of some sort, for security purposes. But back to our (not very well kept) secret, yesterday, we prepared the ground for the web application (callback functionality) to be accessible via PHP $_GET[] arguments.

So, sorry not to have moved off “tool” (web application) work today, but it is very important to try to think of most/all eventualities you can imagine, ahead of the time when you get to the integration tasks the other way around, that is, the integration from the viewpoint of the software acting as “parent” or “co-operative peer” to your Calendar (event) “tool” web application.

The reshaped PHP code now additionally catering for email “messaging” functionality you could call ics_attachment.php, which changed in this way, able to be run with this live run link. We hope you try out the new email functionality yourself.


Previous relevant Calendar iCal Integration Timezone Tutorial is shown below.

Calendar iCal Integration Timezone Tutorial

Calendar iCal Integration Timezone Tutorial

You might have thought with yesterday’s Calendar iCal Integration Primer Tutorial‘s emphasis on timezones we’d have …

  • had too much
  • seen too little
  • invited Goldilocks for some porridge

… but time is quite a complex scenario on Earth, when it comes to timezones for at least two reasons, one being a functional improvement, and one being to fix a bug, that being …

  1. things like WebEx or Skype or GoTo Meeting are not tied down by geography and you may want Calendar functionality to reflect this, or you may also want it to cater for airplane departure and arrival times in various timezones around the world, and it would be best if the HTML form user entry phase catered for a user specifying a date and time not necessarily in either of their local timezone nor the GMT timezone (of the iCal “Z” property special interest) … is the functional improvement, whereas …
  2. we had a bug, leaving off from yesterday’s work with timezones whose GMT offset involved half hour differences … and yes, that happens quite often … and the bug will occur as of yesterday’s code when you come to use those PHP DateTime object add and/or sub methods where the PT[offset]H argument has an [offset] involving a decimal point, so it behoves us to update that relevant PHP code snippet for you, again, below, regarding that (and remind … forgot yesterday … that $ts variable is a user HTML form passed date and time) …

    $di="PT" . str_replace("-","",("" . $start_end_offsets[$thisi])) . "H";
    $parsed_date = DateTime::createFromFormat('Ymd:His', $ts);
    if (strpos(("" . $start_end_offsets[$thisi]), "-") !== false) {
    if (strpos($di, ".") !== false) {
    $parsed_date->sub(new DateInterval(explode(".",$di)[0] . "H"));
    $parsed_date->sub(new DateInterval("PT30M"));
    } else {
    $parsed_date->sub(new DateInterval($di));
    }
    } else {
    if (strpos($di, ".") !== false) {
    $parsed_date->add(new DateInterval(explode(".",$di)[0] . "H"));
    $parsed_date->add(new DateInterval("PT30M"));
    } else {
    $parsed_date->add(new DateInterval($di));
    }
    }
    $outts = $parsed_date->format('Ymd:His');

Now allowing for the first idea above is not as involved as you may think, but only if you think serverside PHP, rather than think it will be easy with clientside Javascript. And what makes it a doddle, generally, are all those Open Source contributors to knowledge out there, and those great computing program language documenters out there exemplified in their brilliance with this totally useful link to the PHP timezone_identifiers_list and PHP DateTimeZone object method getOffset method links. So we allow the user to enter any of …

  • Local
  • GMT
  • Any of the half hour timezone numerical offset (indicators) from -24 to 24
  • Any of the timezone names as per those PHP methods above, with valid continental prefix names

… to define the start and end date and time parameters to express for their Calendar iCal Event that they define. Along the way we also add in dropdowns and HTML input type=number (year) elements to help for those not so keen on keyboard entry.

Guess you’d say we are still on the “tool” feel of the web application, but aim to move more on the “integration” front into the future.

Here is the renewed PHP code you could call ics_attachment.php, that changed in this way, able to be run with this live run link. We hope you try it out for yourself, especially as we’ve added some Google Chart Map Chart linking of the “when” and “where” of defined timezone thinking, via the use of PHP’s DateTimeZone object method getLocation, as you can see happening with today’s tutorial picture.


Previous relevant Calendar iCal Integration Primer Tutorial is shown below.

Calendar iCal Integration Primer Tutorial

Calendar iCal Integration Primer Tutorial

Do you remember us talking about the ICS extension file when we presented WebEx Prerecording Primer Tutorial as shown below? It is an integration input to working with iCal Calendar software.

So here we are at a “when” of life tutorial, which is always an interesting exercise in our book. And “book” could be the go for an application to use this type of functionality. When you “book” something, you’d often want to remind yourself and/or others of such an event. But for now, we are concentrating on making a “tool” type of web application that will suit future purposes.

We’ve built a web application around the useful logic presented in this great Git repository today, writing our code in PHP, because you are dealing with header manipulation here centering around …


header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=rjmprogramming-event.ics');
echo $ical;

… where the PHP variable $ical contents has been pieced together in response to a callback from an earlier HTML form execution of the same ics_attachment.php code where the necessary details are collected off the user.

If you try the live run you’ll probably glean that most of our concern centered around the date and time, regarding timezone use so that we …

  • in the HTML form execution we use client Javascript to glean the local timezone and local date and time to default the form appropriately … so that …
  • in the HTML form execution the user fills out Calendar Event start and end times with respect to local time and this, along with an offset to get these times back to UTC or (Greenwich Mean Time) are passed to the callback web application (which is the same web application) … so that …
  • the second callback execution constructs the iCal (for an rjmprogramming-event.ics attachment) with these UTC (or GMT) date and times in mind, whereby the “Z” timezone parameter fits the bill nicely … and when …
  • the user saves this rjmprogramming-event.ics event into the iCal Calendar application, where the event will be shown back relative to the local date and time

The date and time functions used to make this happen are …

  1. Javascript’s Date object …

    var dd=new Date();
    var qw=eval((eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2]) - eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2] % 100)) / 100) + eval((0.0 + eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2] % 100)) / 60.0);
    if (dd.toTimeString().indexOf('+') != -1) qw=-qw;
    document.getElementById('tz').value=qw;
  2. Javascript’s Date object’s toTimeString method (as shown above) to glean the local timezone offset, and its opposite
  3. PHP’s DateTime object …

    $di="PT" . str_replace("-","",urldecode($_POST['tz'])) . "H";
    $parsed_date = DateTime::createFromFormat('Ymd:His', $ts);
    if (strpos(urldecode($_POST['tz']), "-") !== false) {
    $parsed_date->sub(new DateInterval($di));
    } else {
    $parsed_date->add(new DateInterval($di));
    }
    $outts = $parsed_date->format('Ymd:His');

  4. PHP’s DateTime object’s createFromFormat constructor method (as above) to create a DateTime object from the passed through user details
  5. PHP’s DateInterval object
  6. PHP’s DateTime object’s add and/or sub methods (as above) to create a DateTime object with a DateInterval offset to UTC (or GMT) (expressed in hours)
  7. PHP’s DateInterval object’s format method (as above) to end up with a UTC (or GMT) expression of date and time to be placed into the rjmprogramming-event.ics iCal message

We’ll probably be revisiting with improvements soon, but we hope you try it for yourself.


Previous relevant WebEx Prerecording Primer Tutorial is shown below.

WebEx Prerecording Primer Tutorial

WebEx Prerecording Primer Tutorial

We’ve been trying out WebEx (by Cisco) prerecording as a video conferencing idea as an alternative to …

… regarding video conferencing products we’ve tried at this blog.

Have to say, WebEx is great, even with respect to the “wide eyed and bushy tailed” reaction “this little black duck” has to all these networky communicaty ideas on the net (at least we spelt “net” correctly).

Have to thank my wife, Maree, for her expertise and the facilities her company, Thomson Reuters, supplies for the serving of WebEx recordings … thanks everyone. Have been assured they are periodically deleted, and my lame impersonations of the old “ducks on the wall” can rest in peace shortly.

And so, we have a slideshow starting with a WebEx email link to join a meeting, and we pan down the email to show you other WebEx functionalities, such as adding a Calendar reference to the meeting time, and though we haven’t shown you detail here, rest assured it handles timezone scenarios very well, unless you lie about living in Antarctica, that is … sorry, scientists in Antarctica reading this blog posting … all 237 of you.

During this “earlier than today exploration of WebEx” session the necessary software installs just happened for this MacBook Pro Mac OS X laptop as if we were shelling peas … it’s always good to have some handy when installing any software. So we won’t show you this unless we deem it essential at a later date. You can perhaps do as I did, and ask a real WebEx user invite you to a meeting, to set yourself up. In fact, today’s session meeting creation time you may notice is well in the past from that earlier introductory learning session Maree and I had, and you can bring back up that old email, and resurrect that meeting again and again, if you like … am not sure if there is an expiry date on this too, like with server stored WebEx prerecordings.

So also rest assured, WebEx handles …

  • video via webcam on your device
  • audio via microphone on your device (“Use Computer”) or via a phone line
  • the synchronization of the two above
  • mobile devices

Did you know?

A .ics extension file, as you can see being used as an email attachment file extension in is, as explained in this link‘s sublink

ICS is a global format for calendar files widely being utilized by various calendar and email programs including Google Calendar, Apple iCal, and Microsoft Outlook. These files enable users to share and publish information directly from their calendars over email or via uploading it to the world wide web.

… as helping interface meetings to online calendar appointments. Cute, huh?!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Tutorials | Tagged , , , , , , , , , , , , | Leave a comment

HTML/Javascript Canvas Fraction Problems Collaborating Tutorial

HTML/Javascript Canvas Fraction Problems Collaborating Tutorial

HTML/Javascript Canvas Fraction Problems Collaborating Tutorial

What happens when you re-clone a clone?

Well, around here, we’d say …

  • difference reports
  • recency
  • reliability is enhanced because these web applications (with canvas elements and mathematics as a common thread we probably thought represented good “clone material” in the first place) are largely cloned

… are three salient factors regarding the work. It might even improve on the source web application of the difference report (given a “recency value” of less than a couple of days, we reckon). In other words, it was a win-win exercise to undertake this work, today, in this re-cloning line of thinking.

Why are we fans of Linux (and works on macOS) diff command based difference reports?

  1. it will remind you of all the places of interest to consider
  2. blocks of new function code will stick out to achieve progress faster

This all helped us apply a lot of the work of the previous two days regarding our Surd Mathematics web application to one of our Fraction Mathematics web applications today.

And so, further to “the very recent” HTML/Javascript Canvas Image Copy Collaborating Tutorial a changed surd_withimagecopy_chalkboard.html Surd Reduction web application represents the “source” to a re-cloning of a changed fraction_chalkboard.html Fraction Reduction web application which now includes re-cloned “++?” button collaboration possibilities.


Previous relevant HTML/Javascript Canvas Image Copy Collaborating Tutorial is shown below.

HTML/Javascript Canvas Image Copy Collaborating Tutorial

HTML/Javascript Canvas Image Copy Collaborating Tutorial

Onto yesterday’s HTML/Javascript Canvas Image Copy Sharing Tutorial

  • added some interim calculation numbers into the mix of email and SMS link passed arguments that come into play regarding any ongoing “collaboration” programmatical communications regarding top right attempts at surd reductions …
  • allowed for display:none; scenarios …
  • allowed for a new surd problem canvas click to reinstigate the collaboration logic settings

… in a changed surd_withimagecopy_chalkboard.html Surd Reduction web application.


Previous relevant HTML/Javascript Canvas Image Copy Sharing Tutorial is shown below.

HTML/Javascript Canvas Image Copy Sharing Tutorial

HTML/Javascript Canvas Image Copy Sharing Tutorial

With new work today revisiting the Mathematics Surd related web application of the recent HTML/Javascript Canvas Image Copy Tutorial we use the word …

collaboration

… rather than …

sharing

… and though we’re “getting there” in our opinion it will take another day of work to shore it up better.

What’s the aim?

We wanted a collaborator (email or SMS) be able to see …

  • the same surd problem (that the user attempts to reduce) as the originator … via new ++? element click …
  • should the user “collaborate” via entering both to and from email addresses … see the results of the collaborator’s thinking within an email body section

To our mind a changed surd_withimagecopy_chalkboard.html Surd Reduction web application is worth a revisit.


Previous relevant HTML/Javascript Canvas Image Copy Tutorial is shown below.

HTML/Javascript Canvas Image Copy Tutorial

HTML/Javascript Canvas Image Copy Tutorial

The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management.

In today’s tutorial we add to the functionality of the previous HTML/Javascript Canvas Surds Game Tutorial, as shown below, where we draw an image on the canvas via drawImage() method, by, today, allowing the user to copy (via the toDataURL() method) the Canvas’s image ready to email (as the body of the email) to a fellow user collaborating or sharing the game with you. In the case of this tutorial that image contributes to the user answering some mathematics questions regarding Surds on a simulated “chalkboard”.

You’ll notice we don’t mention PHP as a server-side language here, so you will have to have less automation of this process (because Javascript client-side cannot write to the server file system) … so you use the browser’s (right-click) Copy Image functionality as a way to Paste the image data into the body of your email.

You may want to read more at HTML Canvas Reference as a generic reference, or here, at the tutorial javascript – How do I add a simple onClick event handler to a canvas element? – Stack Overflow.

As you can imagine, this HTML canvas element, new to HTML5, can be very useful for some practical client-side web functionality.

Link to some downloadable HTML programming code … rename to surd_withimagecopy_chalkboard.html

You’ll notice heavy use of the Javascript Math.random() function.

We hope you enjoy this tutorial as a live run.

Almost finally, need to thank a great link for coding ideas with this tutorial, here, at this link.

Finally, have a look at the differences in code that arrived at this extra functionality by examining surd_withimagecopy_chalkboard.html link.

Yes … you’ve reached the end … hope you have a good time practising your mathematics knowledge of Surds (there is advice, if you want to learn … you can get it when you give an incorrect answer)! Try the emailing, via image copying, functionality, as well, if you like.


Previous HTML/Javascript Canvas Surds Game Tutorial of interest is shown below.

HTML/Javascript Canvas Chalkboard Game Tutorial

HTML/Javascript Canvas Surds Game Tutorial

The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management.

In today’s tutorial we touch on the functionality to draw an image on the canvas via drawImage() method. In the case of this tutorial that image contributes to the user answering some mathematics questions regarding Surds on a simulated “chalkboard”.

You may want to read more at HTML Canvas Reference as a generic reference, or here, at the tutorial javascript – How do I add a simple onClick event handler to a canvas element? – Stack Overflow.

As you can imagine, this HTML canvas element, new to HTML5, can be very useful for some practical client-side web functionality.

Link to some downloadable HTML programming code … rename to surd_chalkboard.html

You’ll notice heavy use of the Javascript Math.random() function.

We hope you enjoy this tutorial as a live run.

Yes … you’ve reached the end … hope you have a good time practising your mathematics knowledge of Surds (there is advice, if you want to learn … you can get it when you give an incorrect answer)!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

HTML/Javascript Canvas Image Copy Collaborating Tutorial

HTML/Javascript Canvas Image Copy Collaborating Tutorial

HTML/Javascript Canvas Image Copy Collaborating Tutorial

Onto yesterday’s HTML/Javascript Canvas Image Copy Sharing Tutorial

  • added some interim calculation numbers into the mix of email and SMS link passed arguments that come into play regarding any ongoing “collaboration” programmatical communications regarding top right attempts at surd reductions …
  • allowed for display:none; scenarios …
  • allowed for a new surd problem canvas click to reinstigate the collaboration logic settings

… in a changed surd_withimagecopy_chalkboard.html Surd Reduction web application.


Previous relevant HTML/Javascript Canvas Image Copy Sharing Tutorial is shown below.

HTML/Javascript Canvas Image Copy Sharing Tutorial

HTML/Javascript Canvas Image Copy Sharing Tutorial

With new work today revisiting the Mathematics Surd related web application of the recent HTML/Javascript Canvas Image Copy Tutorial we use the word …

collaboration

… rather than …

sharing

… and though we’re “getting there” in our opinion it will take another day of work to shore it up better.

What’s the aim?

We wanted a collaborator (email or SMS) be able to see …

  • the same surd problem (that the user attempts to reduce) as the originator … via new ++? element click …
  • should the user “collaborate” via entering both to and from email addresses … see the results of the collaborator’s thinking within an email body section

To our mind a changed surd_withimagecopy_chalkboard.html Surd Reduction web application is worth a revisit.


Previous relevant HTML/Javascript Canvas Image Copy Tutorial is shown below.

HTML/Javascript Canvas Image Copy Tutorial

HTML/Javascript Canvas Image Copy Tutorial

The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management.

In today’s tutorial we add to the functionality of the previous HTML/Javascript Canvas Surds Game Tutorial, as shown below, where we draw an image on the canvas via drawImage() method, by, today, allowing the user to copy (via the toDataURL() method) the Canvas’s image ready to email (as the body of the email) to a fellow user collaborating or sharing the game with you. In the case of this tutorial that image contributes to the user answering some mathematics questions regarding Surds on a simulated “chalkboard”.

You’ll notice we don’t mention PHP as a server-side language here, so you will have to have less automation of this process (because Javascript client-side cannot write to the server file system) … so you use the browser’s (right-click) Copy Image functionality as a way to Paste the image data into the body of your email.

You may want to read more at HTML Canvas Reference as a generic reference, or here, at the tutorial javascript – How do I add a simple onClick event handler to a canvas element? – Stack Overflow.

As you can imagine, this HTML canvas element, new to HTML5, can be very useful for some practical client-side web functionality.

Link to some downloadable HTML programming code … rename to surd_withimagecopy_chalkboard.html

You’ll notice heavy use of the Javascript Math.random() function.

We hope you enjoy this tutorial as a live run.

Almost finally, need to thank a great link for coding ideas with this tutorial, here, at this link.

Finally, have a look at the differences in code that arrived at this extra functionality by examining surd_withimagecopy_chalkboard.html link.

Yes … you’ve reached the end … hope you have a good time practising your mathematics knowledge of Surds (there is advice, if you want to learn … you can get it when you give an incorrect answer)! Try the emailing, via image copying, functionality, as well, if you like.


Previous HTML/Javascript Canvas Surds Game Tutorial of interest is shown below.

HTML/Javascript Canvas Chalkboard Game Tutorial

HTML/Javascript Canvas Surds Game Tutorial

The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management.

In today’s tutorial we touch on the functionality to draw an image on the canvas via drawImage() method. In the case of this tutorial that image contributes to the user answering some mathematics questions regarding Surds on a simulated “chalkboard”.

You may want to read more at HTML Canvas Reference as a generic reference, or here, at the tutorial javascript – How do I add a simple onClick event handler to a canvas element? – Stack Overflow.

As you can imagine, this HTML canvas element, new to HTML5, can be very useful for some practical client-side web functionality.

Link to some downloadable HTML programming code … rename to surd_chalkboard.html

You’ll notice heavy use of the Javascript Math.random() function.

We hope you enjoy this tutorial as a live run.

Yes … you’ve reached the end … hope you have a good time practising your mathematics knowledge of Surds (there is advice, if you want to learn … you can get it when you give an incorrect answer)!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment