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

Local Operating System Menu Ffmpeg macOS Recordings Tutorial

Local Operating System Menu Ffmpeg macOS Recordings Tutorial

Local Operating System Menu Ffmpeg macOS Recordings Tutorial

We’re back to yesterday’s Local Operating System Menu Clip Windows Clipboard Tutorial‘s day before’s Local Operating System Menu Pbcopy macOS Clipboard Tutorial‘s …

  • macOS local system “Intranet feeling” integrations …
  • depending on a local (macOS or Windows) Apache web server (eg. MAMP) install …
  • along with downloading of RJM Programming PHP code files (with another new one to do today as explained below), as directed, into that Apache web server’s Document Root folder … and for today’s work …
  • the great, the stupendous ffmpeg installed in that local operating system environment …
  • facilitating another idea, around here, of media (ie. audio or screenshot/audio) recording

… PHP functionality happening. Ever since the demise of Flash as a practical option for these media capture ideas, we’ve been keen to get something going, and after stumbling onto this great advice, it got us enthused enough to write onto an installed MAMP Apache web server, with our downloadable latest draft recording_ideas.php placed into it’s Document Root, and so be accessible via URL http://localhost:8888/recording_ideas.php (macOS) to make all this be possible as a new dropdown menu item for download as open_extravaganza.php filename (changed this way) in this public web application called by this public supervising web application‘s …

Record yourself

… new dropdown option.


Previous relevant Local Operating System Menu Clip Windows Clipboard Tutorial is shown below.

Local Operating System Menu Clip Windows Clipboard Tutorial

Local Operating System Menu Clip Windows Clipboard Tutorial

Onto yesterday’s Local Operating System Menu Pbcopy macOS Clipboard Tutorial

macOS pbcopy # to clipboard ; is command separator … in Windows there are equivalents as below …
Windows clip # to clipboard & is command separator

… thank goodness, and so Windows ideas can be incorporated into yesterday’s just macOS work.

And yes, we still ask that you have a macOS or Windows MAMP Apache web server installed, with our downloadable second draft pbcopy_ideas.php placed into it’s Document Root, and so be accessible via URL http://localhost:8888/pbcopy_ideas.php (macOS) or http://localhost/pbcopy_ideas.php (Windows) to make all this be possible as a new dropdown menu item for download as open_extravaganza.php filename (changed this way) in this public web application called by this public supervising web application.


Previous relevant Local Operating System Menu Pbcopy macOS Clipboard Tutorial is shown below.

Local Operating System Menu Pbcopy macOS Clipboard Tutorial

Local Operating System Menu Pbcopy macOS Clipboard Tutorial

Specific to macOS, and further to the recent Text to Speech Hashtagging Tutorial, today we’re adding a new local operating system (accessed in an “Intranet feeling” way) involving the great …


pbcopy and pbpaste

… dynamic (very Fred and Ginger … if you don’t mind … and how’s your father) duo to respectively “copy to your local operating macOS system clipboard” and “paste from your local operating macOS system clipboard”, effectively bringing one of the favourite desktop system “things to do” into the realms of the web browser wooooorrrrrrllllldddd.

For this functionality, we ask of the user …

What is your macOS command to pipe pbcopy from?

Reg flag! Red flag! Defcon twenty zillion whatevvvveeeerrrr whatevvvveeeerrrr! Yes, of course, making the operating system command a variable in all this could be dangerous, and we flag that “on hover”, but really, catastrophizing here is a bit rich, when it is you (in your “Intranet feeling” woooooorrrrddd) that will be hurt via malicious goings on, and we’re hoping the number of masochists out there consider “Match Is SOS” so sageso sage instead?! Anyway, we default to a very mild mannered


ls -clt ~/Documents ~/Desktop ~/Downloads

… scenario here. Yes, we still ask that you have a macOS MAMP Apache web server installed, with our downloadable first draft “proof of concept” pbcopy_ideas.php placed into it’s Document Root, and so be accessible via URL http://localhost:8888/pbcopy_ideas.php to make all this be possible as a new dropdown menu item for download as open_extravaganza.php filename (changed this way) in this public web application called by this public supervising web application‘s …

Clipboard paste and copy D folder listings

… new macOS dropdown option.


Previous relevant Text to Speech Hashtagging Tutorial is shown below.

Text to Speech Hashtagging Tutorial

Text to Speech Hashtagging Tutorial

Around here … it’s official …

we’re having a morph!

Please … please … no congratulations yet?! And thanks for the tomatoes … very ripe?!

Anyway, yesterday’s Local Operating System Menu Intranet Feel Commentary Tutorial has struck a chord in that for …


macOS

… users we think there is a different aspect to ideas revolving around …

  • speech … and …
  • text

… we want to pursue. We’ve already forewarned above, of exclusions, but for full functionality with these ideas there probably will be more to follow.

Around here there is no adage “let perfection be the enemy of the good” and so “on we go”, but, a precursor is to introduce …

  • our inhouse macOS “say” interfacing PHP … to …
  • more independent hashtagging smarts

… hashtagging (as we’ve been harping on about more and more recently) being …

  • able to support a lot of data up at any URL (eg. of a web browser address bar, and so can help interface a public domain “Internet” URL talking to a local (eg. MAMP Apache web server based) web server “Intranet” feeling URL) …
  • can support dynamic scenarios with web application webpages (especially PHP ones) where the webpage can achieve things dynamically without navigating to another webpage

But aren’t we going to confront CORS restrictions here?

Well … shhhhhh … but a named HTML iframe child and a window.open

<?php

$issayable='';
$vcb="Alex";
$vvcb="";
if (PHP_OS == "Darwin") {
$issayable='y';
if (isset($_GET['saythis']) && $vvcb == "") {
$vvcb=str_replace(' ',' +',str_replace('+',' ',urldecode($_GET['saythis'])));
}
if (isset($_GET['voice'])) {
$vcb=explode(' ',str_replace('+',' ',urldecode($_GET['voice'])))[0];
}
if (isset($_GET['justsayingforafriend']) && $vvcb != "") {
exec('say -v ' . $vcb . ' ' . $vvcb);
exit;
}
}

<?php echo ”

var saymode='" . $dsm . "';
var issayable='" . $issayable . "';
var lastlhis='', lastlhthingo='',lhlook=false;


function lastlhex() {
if (lastlhis != document.getElementById('theproofif').src) {
lastlhis=document.getElementById('theproofif').src;
} else if (lastlhthingo != ('' + location.hash)) {
lastlhthingo=('' + location.hash);
if ((issayable == 'y' || ('' + navigator.platform).toLowerCase().indexOf('mac') == 0) && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('saythis=') != -1 && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('media=') == -1) {
if ((issayable == 'y' || ('' + navigator.platform).toLowerCase().indexOf('mac') == 0) && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('voice=') != -1 && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('media=') == -1) {
if (document.getElementById('svoicecode').innerHTML.indexOf(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\+/g,' ').replace(/\ \ /g,' +') + '\"') != -1) {
document.getElementById('svoicecode').value=document.getElementById('svoicecode').innerHTML.split(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +') + '\"')[0].split('\"')[eval(-1 + document.getElementById('svoicecode').innerHTML.split(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +') + '\"')[0].split('\"').length)] + decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +');
}
}
document.getElementById('thewords').value=decodeURIComponent(document.URL.split('saythis=')[1].split('&')[0].split('#')[0]).replace(/\+/g,' ').replace(/\ \ /g,' +');
if (56 == 56) {
if (issayable == 'y') {
document.getElementById('theproofif').src='HTTP://localhost:8888/macos_say_record.php?justsayingforafriend=y&voice=' + document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)] + '&saythis=' + encodeURIComponent(document.getElementById('thewords').value);
} else {
window.open('HTTP://localhost:8888/macos_say_record.php?justsayingforafriend=y&voice=' + document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)] + '&saythis=' + encodeURIComponent(document.getElementById('thewords').value), 'theproofif');
}
} else {
zhr = new XMLHttpRequest();
zform=new FormData();
zform.append('justsayingforafriend', 'y');
zform.append('saythis', document.getElementById('thewords').value);
zform.append('voice', document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)]);
zhr.open('get', 'HTTP://localhost:8888/macos_say_record.php', true);
zhr.send(zform);
}
}
}
}

“; ?>
<?php echo ”

<iframe data-onerror=alert(564); onload=resproof(this); name=theproofif id=theproofif style=display:none; src='/About_Us.html'></iframe>

“; ?>

… can be that “Fred and Ginger” pairing to make this “Internet and Intranet” interplay seamless … shhhhhhh!

That being said, if you are a macOS user with a local web server like MAMP installed we’d ask you to download to a macOS MAMP port 8888 Document Root folder the changed PHP macos_say_record.php (where macOS users who have downloaded to an 8888 port MAMP local Apacahe web server can click/try the user editable HtTp://localhost:8888/macos_say_record.php?justsayingforafriend=y&saythis=Welcome+one+and+all&voice=Karen) and try at the public RJM Programming website via this link or below …


Previous relevant Local Operating System Menu Intranet Feel Commentary Tutorial is shown below.

Local Operating System Menu Intranet Feel Commentary Tutorial

Local Operating System Menu Intranet Feel Commentary Tutorial

Further to yesterday’s Local Operating System Menu Intranet Feel Operator Tutorial there are a couple of macOS specific additional pieces of functionality we’d like to offer users, they being …

  1. the macOS open command has the ability to try to open any windows it creates in the background via it’s …

    -g

    … switch
  2. as we are on macOS why not offer a Text to Speech means of adding commentary as macOS open commands are issued via its …

    say

    … command

? And closing arguments against this will be accepted up until the end of Black Friday sales, whenever that is?!

We decided to pass these over as your usual get arguments on the address bar URL, being as we are always using PHP $_GET[] data, now, so far, in this project.

And so, yet again, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Operator Tutorial is shown below.

Local Operating System Menu Intranet Feel Operator Tutorial

Local Operating System Menu Intranet Feel Operator Tutorial

Further to yesterday’s Local Operating System Menu Intranet Feel Options Tutorial we broach the issue …

What happens when a delimiter character is the same as an operator character in amongst data sent via HTML form from one webpage to the next webpage?

We’re talking about the + character which can be …

  • a space encryption character used a lot when PHP is the receiving webpage’s language
  • an operator in mathematics, for addition

If the latter is the meaning of a + plus character within that form data sent out, how can we know it is not just a space character encrypted?

Excellent question, that we grapple with in different ways around here, all the time!

Today, as far as this goes, take a look at the value attribute of a new macOS dropdown option we introduced today …

<?php

$selstuff="<br><br><form onsubmit=\"formclickmode=0; document.body.style.cursor='pointer'; if (lastselo) { lastselo.style.cursor='pointer'; lastselo=null; } if (document.getElementById('opsel')) { if (document.getElementById('opsel').value.length > 0) { this.action=document.getElementById('opsel').value; } } return perhaps(true,this);\" id=myform method=GET action='./open_extravaganza.php'><select title='Right click can modify dropdown choices' style=background-color:yellow; size=18 id=mysel multiple name=afteropen onchange=\"if (this.value.length != 0) { if (1 == 1) { formclickmode=prg(1,event.target); } else { document.getElementById('sbutmac').click(); } } \"><option oncontextmenu=ocmopt(this); value=''>Select macOS open command type(s) below ...</option><option oncontextmenu=ocmopt(this); value=' -a Finder'>Finder</option><option oncontextmenu=ocmopt(this); value=' -a Preview'>Preview</option><option oncontextmenu=ocmopt(this); value=' -a TextEdit'>TextEdit</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.VoiceMemos'>Voice Memo</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.QuickTimePlayerX https://www.rjmprogramming.com.au/Windows/windows_step_recorder.mov'>QuickTime Player</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.VoiceOverUtility'>VoiceOver Utility</option><option oncontextmenu=ocmopt(this); value=' ~/Desktop/Screen\\ Shot\\ *.png'>Preview all screenshot files</option><option oncontextmenu=ocmopt(this); value=' -a Firefox https://www.rjmprogramming.com.au'>Firefox</option><option oncontextmenu=ocmopt(this); value=' -a Safari http://localhost:8888/macos_say_record.php?saythis=Welcome\\&voice=Karen\\&audioname=;open -a Safari http://localhost:8888/macos_say_record.php'>Safari interface attempt to say</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.ScriptEditor2 ~/Desktop/test_gvp.scpt'>AppleScript example ready to Script->Run</option><option oncontextmenu=ocmopt(this); value=\"IGVjaG8gJzU2NCs5ODc2NScgfCBiYw==\">Add 564 to 98765</option><option oncontextmenu=ocmopt(this); value=' ~/Documents ~/Desktop ~/Downloads'>Open the D folders</option><option oncontextmenu=ocmopt(this); value=' https://google.com'>Google</option><option oncontextmenu=ocmopt(this); value=' https://wikipedia.org'>Wikipedia</option><option oncontextmenu=ocmopt(this); value=' https://www.rjmprogramming.com.au'>RJM Programming</option><option oncontextmenu=ocmopt(this); value='ls -l . | open -f'>Pipe folder listing into TextEdit</option><option oncontextmenu=ocmopt(this); value='x-man-page://open'>Show man page in Terminal</option></select><br><br><input id=sbutmac type=submit value='Execute'></input></form>";

?>

Do you recognize any new encryption pattern with this option’s value? Yes, it is the …

base64 encoded

… version of …


echo '564+98765' | bc

… as a macOS Terminal application command line way to add 564 + 98765 via the macOS bc command, we got wind of via …


<html>
<body>
<script type=text/javascript>
var x=prompt('' + window.btoa(" echo '564+98765' | bc"), '' + window.btoa(" echo '564+98765' | bc"));
</script>
</body>
</html>

… and please be assured if one of your own dropdown option entry values contains a + character you do not have to do the work above (unless you are a masochist, that is), rather the web application can help you out.

Which begs the question …

If window.btoa is the “Fred” of the Javascript side of the work, what is the PHP receiving side’s “Ginger”?

Well, yes, would that be base64_decode pray tell?!

<?php

$plusin='+';
$plusout=' ';

$fromsc='~/Desktop/test_gvp.scpt';
$tosc='~/Desktop/test_gvp.scpt';

function oururldecode($ofwhat) {
global $plusin, $plusout, $fromsc, $tosc;
$interim=str_replace($fromsc,$tosc,urldecode($ofwhat));
if (strpos($interim, ' ') === false || substr(($interim . 'x'),0,1) == '+') {
$plusin=' ';
$plusout=' ';
return str_replace($fromsc,$tosc,base64_decode($ofwhat));
} else {
$plusin='+';
$plusout=' ';
}
return $interim;
}


if (isset($_GET['afteropen'])) {
if (sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])) > 2) {
for ($thisone=1; $thisone<sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])); $thisone++) {
array_push($afteropens, str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode(explode('#',explode('&',explode('afteropen=', $_SERVER['QUERY_STRING'])[$thisone])[0])[0]))));
}
} else {
$afteropen=(trim(str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode($_GET['afteropen'])))) == '' ? '' : ' ' . trim(str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode($_GET['afteropen'])))));
$afteropens=[$afteropen];
}
}

?>

This offers a dynamic way to swap between the concepts, whose logic depends a bit on that first value character always being a space in this project. But that is so, and so this thinking helps a lot, and allows for that differentiation of + character meaning between (the rare) + operator (in mathematics) meaning and the + character PHP space character encryption meaning.

Today we’re also introducing an AppleScript interfacing option, and with the “say” option we now allow for command conjoining with the dropdown option value as long as the open directly follows on from the semicolon conjoining think it’s an operator!

And so, again, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below

Did you know?

Have you noticed in amongst the macOS open command values lots of ones starting with the switch …


-b

? Well, The macOS open command, thanks, told us …

You can specify just the name of an application or the full path, i.e. /Applications/Preview.app. If you need to be specific, you can also specify an application’s bundle identifier with -b com.apple.Preview.

… found out, we’ve been finding, successfully, via …

  1. in Finder right click the application of interest
  2. click Show Package Contents
  3. open the info.plist file in your favourite Text Editor
  4. look for …

    CFBundleIdentifier

    … within, for example, AppleScript’s info.plist …

    <key>CFBundleIdentifier</key>
    <string>com.apple.ScriptEditor2</string>

    … to come up with, for example …

    open -b com.apple.ScriptEditor2

    … as a way to open macOS application AppleScript (or Script Editor)


Previous relevant Local Operating System Menu Intranet Feel Options Tutorial is shown below.

Local Operating System Menu Intranet Feel Options Tutorial

Local Operating System Menu Intranet Feel Options Tutorial

A static list of options in the functional dropdown, as with yesterday’s Local Operating System Menu Intranet Feel Windows Tutorial does not sound as much fun as …

  • dropdown (ie. select element) options that if you right click bring up a means by which …
    1. existant option can be modified
    2. a new option can be added
    3. the option pointed at effectively nullified
    4. an option to remember for next time on that web browser when the web application is re-opened
    5. an option to forget the previous option’s work … it works! … we’ve already forgotten! … chortle, chortle

    … and we decided also, now that the user has some control over functionality, then …

  • offer email and/or SMS sharing including or excluding any option tinkering as described above
  • offer more Windows explorer.exe options thanks to https://www.geoffchappell.com/studies/windows/shell/explorer/cmdline.htm
  • offer the chance off an RJM Programming incarnation’s top MAMP/macOS/Windows dropdown (ie. select element, now showing with size attribute 3) right click chances to adjust Apache (eg. MAMP) port setting assumptions

And so, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Windows Tutorial is shown below.

Local Operating System Menu Intranet Feel Windows Tutorial

Local Operating System Menu Intranet Feel Windows Tutorial

Yesterday’s Local Operating System Menu Intranet Feel Multiple Tutorial‘s smarts regarding dropdown multiple selections gets passed through to today’s …

Windows MAMP PHP 7.4.16

oh, oh “They’re mentioning version numbers … that can’t be good” … interfacing work.

And yes, it was a struggle, with this PHP version on MAMP disallowing …

  • file_put_contents … and, we would guess, file_get_contents …
  • exec or shell_exec or passthru or system
  • fopen writing to any *.bat

… and so, what we ended up with was an “as you login it starts” lookfor_extravaganza.bat we wrote that has less qualms with all these security matters happening in PHP, looking like lookfor_extravaganza.bat (where you could consider the timeout command rather than our ping means to introduce a sleep/wait) …


rem lookfor_extravaganza.bat
rem RJM Programming
rem November, 2025
rem Help out open_extravaganza.php on local Windows MAMP incarnation regarding no file_put_contents nor exec nor shell_exec allowed
rem Installed via ...
rem Win + R
rem shell:startup
rem ... copied into place via advice of ...
rem https://www.google.com/search?q=continuousnning+in+background+at+login&rlz=1C5OZZY_en&oq=continuousnning+in+background++at+login&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIJCAEQIRgKGKABMgkIAhAhGAoYoAEyCQgDECEYChigAdIBCjc1MjA1ajBqMTWoAgCwAgA&sourceid=chrome&ie=UTF-8
@echo off
cd C:\MAMP\htdocs
echo y > c:\MAMP\htdocs\open_extravaganza.y
:top
if exist c:\MAMP\htdocs\open_extravaganza.bxt rename c:\MAMP\htdocs\open_extravaganza.bxt open_extravaganza.bat
if exist c:\MAMP\htdocs\open_extravaganza.bat call c:\MAMP\htdocs\open_extravaganza.bat
if exist c:\MAMP\htdocs\open_extravaganza.bat erase c:\MAMP\htdocs\open_extravaganza.bat < c:\MAMP\htdocs\open_extravaganza.y ping /w 5000 127.0.0.1 > NUL
goto top

… leaving the PHP to just arrange that c:\MAMP\htdocs\open_extravaganza.bxt gets written via fopen means. Did you read above about where to “plonk” a DOS *.bat so that it starts up on logging in, as per …

Win + R
shell:startup
… copied into place via advice of …

this great advice, thanks … being, perhaps, simpler than Task Schedular thoughts?!

No time to see what else explorer.exe File Explorer is capable of … that is for another day we’re thinking?!

Anyway, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Multiple Tutorial is shown below.

Local Operating System Menu Intranet Feel Multiple Tutorial

Local Operating System Menu Intranet Feel Multiple Tutorial

Our normal tack regarding the method attribute to use on an HTML form element when the recipient webpage is written in PHP is …

  • preferably use method=POST … because so much more data can be handled that way … but today we’re …
  • preferring to use method=GET … for several reasons …
    1. we cannot see that the data will get too long for method=GET
    2. we’re allowing dropdown (ie. select element) multiple selection mode and we found it easier to handle data wise for the recipient to use method=GET with a PHP recipient $_SERVER[‘QUERY_STRING’] able to help better parse a method=GET MAMP style URL like …

      http://localhost:8888/open_extravaganza.php?afteropen=+https%3A%2F%2Fgoogle.com&afteropen=+https%3A%2F%2Fwikipedia.org&afteropen=+https%3A%2F%2Fwww.rjmprogramming.com.au

      … as per …
      <?php

      $afteropens=[];
      $thisone=1;

      if (isset($_GET['afteropen'])) {
      if (sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])) > 2) {
      for ($thisone=1; $thisone<sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])); $thisone++) {
      array_push($afteropens, str_replace('+',' ',urldecode(explode('#',explode('&',explode('afteropen=', $_SERVER['QUERY_STRING'])[$thisone])[0])[0])));
      }
      } else {
      $afteropen=(trim(str_replace('+',' ',urldecode($_GET['afteropen']))) == '' ? '' : ' ' . trim(str_replace('+',' ',urldecode($_GET['afteropen']))));
      $afteropens=[$afteropen];
      }
      }

      ?>
      … whereas method=POST loses those $_SERVER[‘QUERY_STRING’] possibilities
    3. there will be method=GET URLs anyway coming from the newly arranged RJM Programming origin form elements presented now if navigator.platform indicates your underlying operating system is either macOS or Windows (ie. it takes a punt on the form action localhost attribute defined pointing at a local web server (eg. MAMP) … where there is no harm done just trying)

And so, improving on yesterday’s Local Operating System Menu Intranet Feel Tutorial

  • the Execute button now means something … ie. you click it ahead of a 10 second allowance before the web application clicks it … allowing for …
  • multiple operating system actions off that dropdown list can be attempted in any one foray
  • the RJM Programming incarnation of it may show more functionality possibilities than it used to … all within the limitation of non-mobile platforms only

The advice, then, becomes download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Tutorial is shown below.

Local Operating System Menu Intranet Feel Tutorial

Local Operating System Menu Intranet Feel Tutorial

Because we are fortunate enough to have the great MAMP local Apache/PHP/MySql web server in our macOS MacBook Air programming life …

  • we have a great testing platform to go to before uploading any software to the public RJM Programming domain (quite often as a web application) there
  • it can be an “Intranet feeling” partner to our public RJM Programming domain

So, what do we mean by “Intranet feeling”? Well, have you ever been involved at a workplace that combined …

  • a public facing website on the Internet … but which had a …
  • members area for “office use only” that if you logged into would take you into a woooorrrrllllddd of procedures and advice and documentation and health and safety rules etcetera etcetera etcetera related to that company, the data of which is “not public” … well, that “not public” bit can sometimes be referred to as an Intranet

? Well … … … … (four holes in the ground)(make that 5 or 6) … we did/have. And we are awwwwwffffuuuulllllyyy fond of the concept. The thing is though, we are using that “non public” …

Intranet “feeling”

… interfacing to, by and large, offer new web application (quite often PHP) ideas because back at the MAMP local Apache/PHP/MySql local web server we have the freedom to install software not allowed when you host a public website (as well as macOS having some brilliantly unique command line commands such as “open” and “say” (for which we’d ask you to download to a macOS MAMP port 8888 Document Root folder the PHP macos_say_record.php) to offer) perhaps that little bit different to the usual Intranet usage (hence Nala‘s use of the word fillingsfeelings), unless you run the hosting company, that is … and that isn’t us … though if Nala wants to entertain a gentleman caller one of these days … well … what are we going to say?! Hmmmmm?!

Now, when we presented YouTube API Caller Radio Play Playlist Windows Local System Tutorial we threw down the gauntlet, Luna would say, venturing …

… as your starting gambit, here, where the equivalent of macOS’s “open” is “explorer.exe” on Windows (ie. the File Explorer) … almost as cute!

The audacity, Nala?!

Well, we don’t want to involve ourselves in a “software war” here, but the “bedside better scrutiny” of the great https://scriptingosx.com/2017/02/the-macos-open-command/ advice has only enhanced respect for the macOS open command’s talents, which go far beyond just being able to open a URL from the macOS “Terminal application” command line in your default web browser.

How do we count the ways … Luna?!!!! See the compartmentalization and modularization at play (not the command) here, Dumboweb masterbugalugs?!

Anyway, we’re off and running on a new project with these themes. The first draft concentrates on ..

  1. macOS .. open … MAMP … but …
  2. Windows … explorer.exe … MAMP

… is there for the popcorn and beer nuts (best in that order) and as you can see below this new web application (best downloaded as open_extravaganza.php filename to MAMP’s Document Root folder/directory) is kind of boring to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows)

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, Event-Driven Programming, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Local Operating System Menu Clip Windows Clipboard Tutorial

Local Operating System Menu Clip Windows Clipboard Tutorial

Local Operating System Menu Clip Windows Clipboard Tutorial

Onto yesterday’s Local Operating System Menu Pbcopy macOS Clipboard Tutorial

macOS pbcopy # to clipboard ; is command separator … in Windows there are equivalents as below …
Windows clip # to clipboard & is command separator

… thank goodness, and so Windows ideas can be incorporated into yesterday’s just macOS work.

And yes, we still ask that you have a macOS or Windows MAMP Apache web server installed, with our downloadable second draft pbcopy_ideas.php placed into it’s Document Root, and so be accessible via URL http://localhost:8888/pbcopy_ideas.php (macOS) or http://localhost/pbcopy_ideas.php (Windows) to make all this be possible as a new dropdown menu item for download as open_extravaganza.php filename (changed this way) in this public web application called by this public supervising web application.


Previous relevant Local Operating System Menu Pbcopy macOS Clipboard Tutorial is shown below.

Local Operating System Menu Pbcopy macOS Clipboard Tutorial

Local Operating System Menu Pbcopy macOS Clipboard Tutorial

Specific to macOS, and further to the recent Text to Speech Hashtagging Tutorial, today we’re adding a new local operating system (accessed in an “Intranet feeling” way) involving the great …


pbcopy and pbpaste

… dynamic (very Fred and Ginger … if you don’t mind … and how’s your father) duo to respectively “copy to your local operating macOS system clipboard” and “paste from your local operating macOS system clipboard”, effectively bringing one of the favourite desktop system “things to do” into the realms of the web browser wooooorrrrrrllllldddd.

For this functionality, we ask of the user …

What is your macOS command to pipe pbcopy from?

Reg flag! Red flag! Defcon twenty zillion whatevvvveeeerrrr whatevvvveeeerrrr! Yes, of course, making the operating system command a variable in all this could be dangerous, and we flag that “on hover”, but really, catastrophizing here is a bit rich, when it is you (in your “Intranet feeling” woooooorrrrddd) that will be hurt via malicious goings on, and we’re hoping the number of masochists out there consider “Match Is SOS” so sageso sage instead?! Anyway, we default to a very mild mannered


ls -clt ~/Documents ~/Desktop ~/Downloads

… scenario here. Yes, we still ask that you have a macOS MAMP Apache web server installed, with our downloadable first draft “proof of concept” pbcopy_ideas.php placed into it’s Document Root, and so be accessible via URL http://localhost:8888/pbcopy_ideas.php to make all this be possible as a new dropdown menu item for download as open_extravaganza.php filename (changed this way) in this public web application called by this public supervising web application‘s …

Clipboard paste and copy D folder listings

… new macOS dropdown option.


Previous relevant Text to Speech Hashtagging Tutorial is shown below.

Text to Speech Hashtagging Tutorial

Text to Speech Hashtagging Tutorial

Around here … it’s official …

we’re having a morph!

Please … please … no congratulations yet?! And thanks for the tomatoes … very ripe?!

Anyway, yesterday’s Local Operating System Menu Intranet Feel Commentary Tutorial has struck a chord in that for …


macOS

… users we think there is a different aspect to ideas revolving around …

  • speech … and …
  • text

… we want to pursue. We’ve already forewarned above, of exclusions, but for full functionality with these ideas there probably will be more to follow.

Around here there is no adage “let perfection be the enemy of the good” and so “on we go”, but, a precursor is to introduce …

  • our inhouse macOS “say” interfacing PHP … to …
  • more independent hashtagging smarts

… hashtagging (as we’ve been harping on about more and more recently) being …

  • able to support a lot of data up at any URL (eg. of a web browser address bar, and so can help interface a public domain “Internet” URL talking to a local (eg. MAMP Apache web server based) web server “Intranet” feeling URL) …
  • can support dynamic scenarios with web application webpages (especially PHP ones) where the webpage can achieve things dynamically without navigating to another webpage

But aren’t we going to confront CORS restrictions here?

Well … shhhhhh … but a named HTML iframe child and a window.open

<?php

$issayable='';
$vcb="Alex";
$vvcb="";
if (PHP_OS == "Darwin") {
$issayable='y';
if (isset($_GET['saythis']) && $vvcb == "") {
$vvcb=str_replace(' ',' +',str_replace('+',' ',urldecode($_GET['saythis'])));
}
if (isset($_GET['voice'])) {
$vcb=explode(' ',str_replace('+',' ',urldecode($_GET['voice'])))[0];
}
if (isset($_GET['justsayingforafriend']) && $vvcb != "") {
exec('say -v ' . $vcb . ' ' . $vvcb);
exit;
}
}

<?php echo ”

var saymode='" . $dsm . "';
var issayable='" . $issayable . "';
var lastlhis='', lastlhthingo='',lhlook=false;


function lastlhex() {
if (lastlhis != document.getElementById('theproofif').src) {
lastlhis=document.getElementById('theproofif').src;
} else if (lastlhthingo != ('' + location.hash)) {
lastlhthingo=('' + location.hash);
if ((issayable == 'y' || ('' + navigator.platform).toLowerCase().indexOf('mac') == 0) && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('saythis=') != -1 && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('media=') == -1) {
if ((issayable == 'y' || ('' + navigator.platform).toLowerCase().indexOf('mac') == 0) && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('voice=') != -1 && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('media=') == -1) {
if (document.getElementById('svoicecode').innerHTML.indexOf(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\+/g,' ').replace(/\ \ /g,' +') + '\"') != -1) {
document.getElementById('svoicecode').value=document.getElementById('svoicecode').innerHTML.split(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +') + '\"')[0].split('\"')[eval(-1 + document.getElementById('svoicecode').innerHTML.split(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +') + '\"')[0].split('\"').length)] + decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +');
}
}
document.getElementById('thewords').value=decodeURIComponent(document.URL.split('saythis=')[1].split('&')[0].split('#')[0]).replace(/\+/g,' ').replace(/\ \ /g,' +');
if (56 == 56) {
if (issayable == 'y') {
document.getElementById('theproofif').src='HTTP://localhost:8888/macos_say_record.php?justsayingforafriend=y&voice=' + document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)] + '&saythis=' + encodeURIComponent(document.getElementById('thewords').value);
} else {
window.open('HTTP://localhost:8888/macos_say_record.php?justsayingforafriend=y&voice=' + document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)] + '&saythis=' + encodeURIComponent(document.getElementById('thewords').value), 'theproofif');
}
} else {
zhr = new XMLHttpRequest();
zform=new FormData();
zform.append('justsayingforafriend', 'y');
zform.append('saythis', document.getElementById('thewords').value);
zform.append('voice', document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)]);
zhr.open('get', 'HTTP://localhost:8888/macos_say_record.php', true);
zhr.send(zform);
}
}
}
}

“; ?>
<?php echo ”

<iframe data-onerror=alert(564); onload=resproof(this); name=theproofif id=theproofif style=display:none; src='/About_Us.html'></iframe>

“; ?>

… can be that “Fred and Ginger” pairing to make this “Internet and Intranet” interplay seamless … shhhhhhh!

That being said, if you are a macOS user with a local web server like MAMP installed we’d ask you to download to a macOS MAMP port 8888 Document Root folder the changed PHP macos_say_record.php (where macOS users who have downloaded to an 8888 port MAMP local Apacahe web server can click/try the user editable HtTp://localhost:8888/macos_say_record.php?justsayingforafriend=y&saythis=Welcome+one+and+all&voice=Karen) and try at the public RJM Programming website via this link or below …


Previous relevant Local Operating System Menu Intranet Feel Commentary Tutorial is shown below.

Local Operating System Menu Intranet Feel Commentary Tutorial

Local Operating System Menu Intranet Feel Commentary Tutorial

Further to yesterday’s Local Operating System Menu Intranet Feel Operator Tutorial there are a couple of macOS specific additional pieces of functionality we’d like to offer users, they being …

  1. the macOS open command has the ability to try to open any windows it creates in the background via it’s …

    -g

    … switch
  2. as we are on macOS why not offer a Text to Speech means of adding commentary as macOS open commands are issued via its …

    say

    … command

? And closing arguments against this will be accepted up until the end of Black Friday sales, whenever that is?!

We decided to pass these over as your usual get arguments on the address bar URL, being as we are always using PHP $_GET[] data, now, so far, in this project.

And so, yet again, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Operator Tutorial is shown below.

Local Operating System Menu Intranet Feel Operator Tutorial

Local Operating System Menu Intranet Feel Operator Tutorial

Further to yesterday’s Local Operating System Menu Intranet Feel Options Tutorial we broach the issue …

What happens when a delimiter character is the same as an operator character in amongst data sent via HTML form from one webpage to the next webpage?

We’re talking about the + character which can be …

  • a space encryption character used a lot when PHP is the receiving webpage’s language
  • an operator in mathematics, for addition

If the latter is the meaning of a + plus character within that form data sent out, how can we know it is not just a space character encrypted?

Excellent question, that we grapple with in different ways around here, all the time!

Today, as far as this goes, take a look at the value attribute of a new macOS dropdown option we introduced today …

<?php

$selstuff="<br><br><form onsubmit=\"formclickmode=0; document.body.style.cursor='pointer'; if (lastselo) { lastselo.style.cursor='pointer'; lastselo=null; } if (document.getElementById('opsel')) { if (document.getElementById('opsel').value.length > 0) { this.action=document.getElementById('opsel').value; } } return perhaps(true,this);\" id=myform method=GET action='./open_extravaganza.php'><select title='Right click can modify dropdown choices' style=background-color:yellow; size=18 id=mysel multiple name=afteropen onchange=\"if (this.value.length != 0) { if (1 == 1) { formclickmode=prg(1,event.target); } else { document.getElementById('sbutmac').click(); } } \"><option oncontextmenu=ocmopt(this); value=''>Select macOS open command type(s) below ...</option><option oncontextmenu=ocmopt(this); value=' -a Finder'>Finder</option><option oncontextmenu=ocmopt(this); value=' -a Preview'>Preview</option><option oncontextmenu=ocmopt(this); value=' -a TextEdit'>TextEdit</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.VoiceMemos'>Voice Memo</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.QuickTimePlayerX https://www.rjmprogramming.com.au/Windows/windows_step_recorder.mov'>QuickTime Player</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.VoiceOverUtility'>VoiceOver Utility</option><option oncontextmenu=ocmopt(this); value=' ~/Desktop/Screen\\ Shot\\ *.png'>Preview all screenshot files</option><option oncontextmenu=ocmopt(this); value=' -a Firefox https://www.rjmprogramming.com.au'>Firefox</option><option oncontextmenu=ocmopt(this); value=' -a Safari http://localhost:8888/macos_say_record.php?saythis=Welcome\\&voice=Karen\\&audioname=;open -a Safari http://localhost:8888/macos_say_record.php'>Safari interface attempt to say</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.ScriptEditor2 ~/Desktop/test_gvp.scpt'>AppleScript example ready to Script->Run</option><option oncontextmenu=ocmopt(this); value=\"IGVjaG8gJzU2NCs5ODc2NScgfCBiYw==\">Add 564 to 98765</option><option oncontextmenu=ocmopt(this); value=' ~/Documents ~/Desktop ~/Downloads'>Open the D folders</option><option oncontextmenu=ocmopt(this); value=' https://google.com'>Google</option><option oncontextmenu=ocmopt(this); value=' https://wikipedia.org'>Wikipedia</option><option oncontextmenu=ocmopt(this); value=' https://www.rjmprogramming.com.au'>RJM Programming</option><option oncontextmenu=ocmopt(this); value='ls -l . | open -f'>Pipe folder listing into TextEdit</option><option oncontextmenu=ocmopt(this); value='x-man-page://open'>Show man page in Terminal</option></select><br><br><input id=sbutmac type=submit value='Execute'></input></form>";

?>

Do you recognize any new encryption pattern with this option’s value? Yes, it is the …

base64 encoded

… version of …


echo '564+98765' | bc

… as a macOS Terminal application command line way to add 564 + 98765 via the macOS bc command, we got wind of via …


<html>
<body>
<script type=text/javascript>
var x=prompt('' + window.btoa(" echo '564+98765' | bc"), '' + window.btoa(" echo '564+98765' | bc"));
</script>
</body>
</html>

… and please be assured if one of your own dropdown option entry values contains a + character you do not have to do the work above (unless you are a masochist, that is), rather the web application can help you out.

Which begs the question …

If window.btoa is the “Fred” of the Javascript side of the work, what is the PHP receiving side’s “Ginger”?

Well, yes, would that be base64_decode pray tell?!

<?php

$plusin='+';
$plusout=' ';

$fromsc='~/Desktop/test_gvp.scpt';
$tosc='~/Desktop/test_gvp.scpt';

function oururldecode($ofwhat) {
global $plusin, $plusout, $fromsc, $tosc;
$interim=str_replace($fromsc,$tosc,urldecode($ofwhat));
if (strpos($interim, ' ') === false || substr(($interim . 'x'),0,1) == '+') {
$plusin=' ';
$plusout=' ';
return str_replace($fromsc,$tosc,base64_decode($ofwhat));
} else {
$plusin='+';
$plusout=' ';
}
return $interim;
}


if (isset($_GET['afteropen'])) {
if (sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])) > 2) {
for ($thisone=1; $thisone<sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])); $thisone++) {
array_push($afteropens, str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode(explode('#',explode('&',explode('afteropen=', $_SERVER['QUERY_STRING'])[$thisone])[0])[0]))));
}
} else {
$afteropen=(trim(str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode($_GET['afteropen'])))) == '' ? '' : ' ' . trim(str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode($_GET['afteropen'])))));
$afteropens=[$afteropen];
}
}

?>

This offers a dynamic way to swap between the concepts, whose logic depends a bit on that first value character always being a space in this project. But that is so, and so this thinking helps a lot, and allows for that differentiation of + character meaning between (the rare) + operator (in mathematics) meaning and the + character PHP space character encryption meaning.

Today we’re also introducing an AppleScript interfacing option, and with the “say” option we now allow for command conjoining with the dropdown option value as long as the open directly follows on from the semicolon conjoining think it’s an operator!

And so, again, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below

Did you know?

Have you noticed in amongst the macOS open command values lots of ones starting with the switch …


-b

? Well, The macOS open command, thanks, told us …

You can specify just the name of an application or the full path, i.e. /Applications/Preview.app. If you need to be specific, you can also specify an application’s bundle identifier with -b com.apple.Preview.

… found out, we’ve been finding, successfully, via …

  1. in Finder right click the application of interest
  2. click Show Package Contents
  3. open the info.plist file in your favourite Text Editor
  4. look for …

    CFBundleIdentifier

    … within, for example, AppleScript’s info.plist …

    <key>CFBundleIdentifier</key>
    <string>com.apple.ScriptEditor2</string>

    … to come up with, for example …

    open -b com.apple.ScriptEditor2

    … as a way to open macOS application AppleScript (or Script Editor)


Previous relevant Local Operating System Menu Intranet Feel Options Tutorial is shown below.

Local Operating System Menu Intranet Feel Options Tutorial

Local Operating System Menu Intranet Feel Options Tutorial

A static list of options in the functional dropdown, as with yesterday’s Local Operating System Menu Intranet Feel Windows Tutorial does not sound as much fun as …

  • dropdown (ie. select element) options that if you right click bring up a means by which …
    1. existant option can be modified
    2. a new option can be added
    3. the option pointed at effectively nullified
    4. an option to remember for next time on that web browser when the web application is re-opened
    5. an option to forget the previous option’s work … it works! … we’ve already forgotten! … chortle, chortle

    … and we decided also, now that the user has some control over functionality, then …

  • offer email and/or SMS sharing including or excluding any option tinkering as described above
  • offer more Windows explorer.exe options thanks to https://www.geoffchappell.com/studies/windows/shell/explorer/cmdline.htm
  • offer the chance off an RJM Programming incarnation’s top MAMP/macOS/Windows dropdown (ie. select element, now showing with size attribute 3) right click chances to adjust Apache (eg. MAMP) port setting assumptions

And so, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Windows Tutorial is shown below.

Local Operating System Menu Intranet Feel Windows Tutorial

Local Operating System Menu Intranet Feel Windows Tutorial

Yesterday’s Local Operating System Menu Intranet Feel Multiple Tutorial‘s smarts regarding dropdown multiple selections gets passed through to today’s …

Windows MAMP PHP 7.4.16

oh, oh “They’re mentioning version numbers … that can’t be good” … interfacing work.

And yes, it was a struggle, with this PHP version on MAMP disallowing …

  • file_put_contents … and, we would guess, file_get_contents …
  • exec or shell_exec or passthru or system
  • fopen writing to any *.bat

… and so, what we ended up with was an “as you login it starts” lookfor_extravaganza.bat we wrote that has less qualms with all these security matters happening in PHP, looking like lookfor_extravaganza.bat (where you could consider the timeout command rather than our ping means to introduce a sleep/wait) …


rem lookfor_extravaganza.bat
rem RJM Programming
rem November, 2025
rem Help out open_extravaganza.php on local Windows MAMP incarnation regarding no file_put_contents nor exec nor shell_exec allowed
rem Installed via ...
rem Win + R
rem shell:startup
rem ... copied into place via advice of ...
rem https://www.google.com/search?q=continuousnning+in+background+at+login&rlz=1C5OZZY_en&oq=continuousnning+in+background++at+login&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIJCAEQIRgKGKABMgkIAhAhGAoYoAEyCQgDECEYChigAdIBCjc1MjA1ajBqMTWoAgCwAgA&sourceid=chrome&ie=UTF-8
@echo off
cd C:\MAMP\htdocs
echo y > c:\MAMP\htdocs\open_extravaganza.y
:top
if exist c:\MAMP\htdocs\open_extravaganza.bxt rename c:\MAMP\htdocs\open_extravaganza.bxt open_extravaganza.bat
if exist c:\MAMP\htdocs\open_extravaganza.bat call c:\MAMP\htdocs\open_extravaganza.bat
if exist c:\MAMP\htdocs\open_extravaganza.bat erase c:\MAMP\htdocs\open_extravaganza.bat < c:\MAMP\htdocs\open_extravaganza.y ping /w 5000 127.0.0.1 > NUL
goto top

… leaving the PHP to just arrange that c:\MAMP\htdocs\open_extravaganza.bxt gets written via fopen means. Did you read above about where to “plonk” a DOS *.bat so that it starts up on logging in, as per …

Win + R
shell:startup
… copied into place via advice of …

this great advice, thanks … being, perhaps, simpler than Task Schedular thoughts?!

No time to see what else explorer.exe File Explorer is capable of … that is for another day we’re thinking?!

Anyway, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Multiple Tutorial is shown below.

Local Operating System Menu Intranet Feel Multiple Tutorial

Local Operating System Menu Intranet Feel Multiple Tutorial

Our normal tack regarding the method attribute to use on an HTML form element when the recipient webpage is written in PHP is …

  • preferably use method=POST … because so much more data can be handled that way … but today we’re …
  • preferring to use method=GET … for several reasons …
    1. we cannot see that the data will get too long for method=GET
    2. we’re allowing dropdown (ie. select element) multiple selection mode and we found it easier to handle data wise for the recipient to use method=GET with a PHP recipient $_SERVER[‘QUERY_STRING’] able to help better parse a method=GET MAMP style URL like …

      http://localhost:8888/open_extravaganza.php?afteropen=+https%3A%2F%2Fgoogle.com&afteropen=+https%3A%2F%2Fwikipedia.org&afteropen=+https%3A%2F%2Fwww.rjmprogramming.com.au

      … as per …
      <?php

      $afteropens=[];
      $thisone=1;

      if (isset($_GET['afteropen'])) {
      if (sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])) > 2) {
      for ($thisone=1; $thisone<sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])); $thisone++) {
      array_push($afteropens, str_replace('+',' ',urldecode(explode('#',explode('&',explode('afteropen=', $_SERVER['QUERY_STRING'])[$thisone])[0])[0])));
      }
      } else {
      $afteropen=(trim(str_replace('+',' ',urldecode($_GET['afteropen']))) == '' ? '' : ' ' . trim(str_replace('+',' ',urldecode($_GET['afteropen']))));
      $afteropens=[$afteropen];
      }
      }

      ?>
      … whereas method=POST loses those $_SERVER[‘QUERY_STRING’] possibilities
    3. there will be method=GET URLs anyway coming from the newly arranged RJM Programming origin form elements presented now if navigator.platform indicates your underlying operating system is either macOS or Windows (ie. it takes a punt on the form action localhost attribute defined pointing at a local web server (eg. MAMP) … where there is no harm done just trying)

And so, improving on yesterday’s Local Operating System Menu Intranet Feel Tutorial

  • the Execute button now means something … ie. you click it ahead of a 10 second allowance before the web application clicks it … allowing for …
  • multiple operating system actions off that dropdown list can be attempted in any one foray
  • the RJM Programming incarnation of it may show more functionality possibilities than it used to … all within the limitation of non-mobile platforms only

The advice, then, becomes download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Tutorial is shown below.

Local Operating System Menu Intranet Feel Tutorial

Local Operating System Menu Intranet Feel Tutorial

Because we are fortunate enough to have the great MAMP local Apache/PHP/MySql web server in our macOS MacBook Air programming life …

  • we have a great testing platform to go to before uploading any software to the public RJM Programming domain (quite often as a web application) there
  • it can be an “Intranet feeling” partner to our public RJM Programming domain

So, what do we mean by “Intranet feeling”? Well, have you ever been involved at a workplace that combined …

  • a public facing website on the Internet … but which had a …
  • members area for “office use only” that if you logged into would take you into a woooorrrrllllddd of procedures and advice and documentation and health and safety rules etcetera etcetera etcetera related to that company, the data of which is “not public” … well, that “not public” bit can sometimes be referred to as an Intranet

? Well … … … … (four holes in the ground)(make that 5 or 6) … we did/have. And we are awwwwwffffuuuulllllyyy fond of the concept. The thing is though, we are using that “non public” …

Intranet “feeling”

… interfacing to, by and large, offer new web application (quite often PHP) ideas because back at the MAMP local Apache/PHP/MySql local web server we have the freedom to install software not allowed when you host a public website (as well as macOS having some brilliantly unique command line commands such as “open” and “say” (for which we’d ask you to download to a macOS MAMP port 8888 Document Root folder the PHP macos_say_record.php) to offer) perhaps that little bit different to the usual Intranet usage (hence Nala‘s use of the word fillingsfeelings), unless you run the hosting company, that is … and that isn’t us … though if Nala wants to entertain a gentleman caller one of these days … well … what are we going to say?! Hmmmmm?!

Now, when we presented YouTube API Caller Radio Play Playlist Windows Local System Tutorial we threw down the gauntlet, Luna would say, venturing …

… as your starting gambit, here, where the equivalent of macOS’s “open” is “explorer.exe” on Windows (ie. the File Explorer) … almost as cute!

The audacity, Nala?!

Well, we don’t want to involve ourselves in a “software war” here, but the “bedside better scrutiny” of the great https://scriptingosx.com/2017/02/the-macos-open-command/ advice has only enhanced respect for the macOS open command’s talents, which go far beyond just being able to open a URL from the macOS “Terminal application” command line in your default web browser.

How do we count the ways … Luna?!!!! See the compartmentalization and modularization at play (not the command) here, Dumboweb masterbugalugs?!

Anyway, we’re off and running on a new project with these themes. The first draft concentrates on ..

  1. macOS .. open … MAMP … but …
  2. Windows … explorer.exe … MAMP

… is there for the popcorn and beer nuts (best in that order) and as you can see below this new web application (best downloaded as open_extravaganza.php filename to MAMP’s Document Root folder/directory) is kind of boring to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows)

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, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Local Operating System Menu Pbcopy macOS Clipboard Tutorial

Local Operating System Menu Pbcopy macOS Clipboard Tutorial

Local Operating System Menu Pbcopy macOS Clipboard Tutorial

Specific to macOS, and further to the recent Text to Speech Hashtagging Tutorial, today we’re adding a new local operating system (accessed in an “Intranet feeling” way) involving the great …


pbcopy and pbpaste

… dynamic (very Fred and Ginger … if you don’t mind … and how’s your father) duo to respectively “copy to your local operating macOS system clipboard” and “paste from your local operating macOS system clipboard”, effectively bringing one of the favourite desktop system “things to do” into the realms of the web browser wooooorrrrrrllllldddd.

For this functionality, we ask of the user …

What is your macOS command to pipe pbcopy from?

Reg flag! Red flag! Defcon twenty zillion whatevvvveeeerrrr whatevvvveeeerrrr! Yes, of course, making the operating system command a variable in all this could be dangerous, and we flag that “on hover”, but really, catastrophizing here is a bit rich, when it is you (in your “Intranet feeling” woooooorrrrddd) that will be hurt via malicious goings on, and we’re hoping the number of masochists out there consider “Match Is SOS” so sageso sage instead?! Anyway, we default to a very mild mannered


ls -clt ~/Documents ~/Desktop ~/Downloads

… scenario here. Yes, we still ask that you have a macOS MAMP Apache web server installed, with our downloadable first draft “proof of concept” pbcopy_ideas.php placed into it’s Document Root, and so be accessible via URL http://localhost:8888/pbcopy_ideas.php to make all this be possible as a new dropdown menu item for download as open_extravaganza.php filename (changed this way) in this public web application called by this public supervising web application‘s …

Clipboard paste and copy D folder listings

… new macOS dropdown option.


Previous relevant Text to Speech Hashtagging Tutorial is shown below.

Text to Speech Hashtagging Tutorial

Text to Speech Hashtagging Tutorial

Around here … it’s official …

we’re having a morph!

Please … please … no congratulations yet?! And thanks for the tomatoes … very ripe?!

Anyway, yesterday’s Local Operating System Menu Intranet Feel Commentary Tutorial has struck a chord in that for …


macOS

… users we think there is a different aspect to ideas revolving around …

  • speech … and …
  • text

… we want to pursue. We’ve already forewarned above, of exclusions, but for full functionality with these ideas there probably will be more to follow.

Around here there is no adage “let perfection be the enemy of the good” and so “on we go”, but, a precursor is to introduce …

  • our inhouse macOS “say” interfacing PHP … to …
  • more independent hashtagging smarts

… hashtagging (as we’ve been harping on about more and more recently) being …

  • able to support a lot of data up at any URL (eg. of a web browser address bar, and so can help interface a public domain “Internet” URL talking to a local (eg. MAMP Apache web server based) web server “Intranet” feeling URL) …
  • can support dynamic scenarios with web application webpages (especially PHP ones) where the webpage can achieve things dynamically without navigating to another webpage

But aren’t we going to confront CORS restrictions here?

Well … shhhhhh … but a named HTML iframe child and a window.open

<?php

$issayable='';
$vcb="Alex";
$vvcb="";
if (PHP_OS == "Darwin") {
$issayable='y';
if (isset($_GET['saythis']) && $vvcb == "") {
$vvcb=str_replace(' ',' +',str_replace('+',' ',urldecode($_GET['saythis'])));
}
if (isset($_GET['voice'])) {
$vcb=explode(' ',str_replace('+',' ',urldecode($_GET['voice'])))[0];
}
if (isset($_GET['justsayingforafriend']) && $vvcb != "") {
exec('say -v ' . $vcb . ' ' . $vvcb);
exit;
}
}

<?php echo ”

var saymode='" . $dsm . "';
var issayable='" . $issayable . "';
var lastlhis='', lastlhthingo='',lhlook=false;


function lastlhex() {
if (lastlhis != document.getElementById('theproofif').src) {
lastlhis=document.getElementById('theproofif').src;
} else if (lastlhthingo != ('' + location.hash)) {
lastlhthingo=('' + location.hash);
if ((issayable == 'y' || ('' + navigator.platform).toLowerCase().indexOf('mac') == 0) && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('saythis=') != -1 && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('media=') == -1) {
if ((issayable == 'y' || ('' + navigator.platform).toLowerCase().indexOf('mac') == 0) && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('voice=') != -1 && ('' + document.URL + '#' + decodeURIComponent(('' + location.hash))).indexOf('media=') == -1) {
if (document.getElementById('svoicecode').innerHTML.indexOf(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\+/g,' ').replace(/\ \ /g,' +') + '\"') != -1) {
document.getElementById('svoicecode').value=document.getElementById('svoicecode').innerHTML.split(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +') + '\"')[0].split('\"')[eval(-1 + document.getElementById('svoicecode').innerHTML.split(decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +') + '\"')[0].split('\"').length)] + decodeURIComponent(document.URL.split('voice=')[1].split('&')[0].split('#')[0]).replace(/\\+/g,' ').replace(/\\ \\ /g,' +');
}
}
document.getElementById('thewords').value=decodeURIComponent(document.URL.split('saythis=')[1].split('&')[0].split('#')[0]).replace(/\+/g,' ').replace(/\ \ /g,' +');
if (56 == 56) {
if (issayable == 'y') {
document.getElementById('theproofif').src='HTTP://localhost:8888/macos_say_record.php?justsayingforafriend=y&voice=' + document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)] + '&saythis=' + encodeURIComponent(document.getElementById('thewords').value);
} else {
window.open('HTTP://localhost:8888/macos_say_record.php?justsayingforafriend=y&voice=' + document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)] + '&saythis=' + encodeURIComponent(document.getElementById('thewords').value), 'theproofif');
}
} else {
zhr = new XMLHttpRequest();
zform=new FormData();
zform.append('justsayingforafriend', 'y');
zform.append('saythis', document.getElementById('thewords').value);
zform.append('voice', document.getElementById('svoicecode').value.split(' ')[eval(-1 + document.getElementById('svoicecode').value.split(' ').length)]);
zhr.open('get', 'HTTP://localhost:8888/macos_say_record.php', true);
zhr.send(zform);
}
}
}
}

“; ?>
<?php echo ”

<iframe data-onerror=alert(564); onload=resproof(this); name=theproofif id=theproofif style=display:none; src='/About_Us.html'></iframe>

“; ?>

… can be that “Fred and Ginger” pairing to make this “Internet and Intranet” interplay seamless … shhhhhhh!

That being said, if you are a macOS user with a local web server like MAMP installed we’d ask you to download to a macOS MAMP port 8888 Document Root folder the changed PHP macos_say_record.php (where macOS users who have downloaded to an 8888 port MAMP local Apacahe web server can click/try the user editable HtTp://localhost:8888/macos_say_record.php?justsayingforafriend=y&saythis=Welcome+one+and+all&voice=Karen) and try at the public RJM Programming website via this link or below …


Previous relevant Local Operating System Menu Intranet Feel Commentary Tutorial is shown below.

Local Operating System Menu Intranet Feel Commentary Tutorial

Local Operating System Menu Intranet Feel Commentary Tutorial

Further to yesterday’s Local Operating System Menu Intranet Feel Operator Tutorial there are a couple of macOS specific additional pieces of functionality we’d like to offer users, they being …

  1. the macOS open command has the ability to try to open any windows it creates in the background via it’s …

    -g

    … switch
  2. as we are on macOS why not offer a Text to Speech means of adding commentary as macOS open commands are issued via its …

    say

    … command

? And closing arguments against this will be accepted up until the end of Black Friday sales, whenever that is?!

We decided to pass these over as your usual get arguments on the address bar URL, being as we are always using PHP $_GET[] data, now, so far, in this project.

And so, yet again, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Operator Tutorial is shown below.

Local Operating System Menu Intranet Feel Operator Tutorial

Local Operating System Menu Intranet Feel Operator Tutorial

Further to yesterday’s Local Operating System Menu Intranet Feel Options Tutorial we broach the issue …

What happens when a delimiter character is the same as an operator character in amongst data sent via HTML form from one webpage to the next webpage?

We’re talking about the + character which can be …

  • a space encryption character used a lot when PHP is the receiving webpage’s language
  • an operator in mathematics, for addition

If the latter is the meaning of a + plus character within that form data sent out, how can we know it is not just a space character encrypted?

Excellent question, that we grapple with in different ways around here, all the time!

Today, as far as this goes, take a look at the value attribute of a new macOS dropdown option we introduced today …

<?php

$selstuff="<br><br><form onsubmit=\"formclickmode=0; document.body.style.cursor='pointer'; if (lastselo) { lastselo.style.cursor='pointer'; lastselo=null; } if (document.getElementById('opsel')) { if (document.getElementById('opsel').value.length > 0) { this.action=document.getElementById('opsel').value; } } return perhaps(true,this);\" id=myform method=GET action='./open_extravaganza.php'><select title='Right click can modify dropdown choices' style=background-color:yellow; size=18 id=mysel multiple name=afteropen onchange=\"if (this.value.length != 0) { if (1 == 1) { formclickmode=prg(1,event.target); } else { document.getElementById('sbutmac').click(); } } \"><option oncontextmenu=ocmopt(this); value=''>Select macOS open command type(s) below ...</option><option oncontextmenu=ocmopt(this); value=' -a Finder'>Finder</option><option oncontextmenu=ocmopt(this); value=' -a Preview'>Preview</option><option oncontextmenu=ocmopt(this); value=' -a TextEdit'>TextEdit</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.VoiceMemos'>Voice Memo</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.QuickTimePlayerX https://www.rjmprogramming.com.au/Windows/windows_step_recorder.mov'>QuickTime Player</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.VoiceOverUtility'>VoiceOver Utility</option><option oncontextmenu=ocmopt(this); value=' ~/Desktop/Screen\\ Shot\\ *.png'>Preview all screenshot files</option><option oncontextmenu=ocmopt(this); value=' -a Firefox https://www.rjmprogramming.com.au'>Firefox</option><option oncontextmenu=ocmopt(this); value=' -a Safari http://localhost:8888/macos_say_record.php?saythis=Welcome\\&voice=Karen\\&audioname=;open -a Safari http://localhost:8888/macos_say_record.php'>Safari interface attempt to say</option><option oncontextmenu=ocmopt(this); value=' -b com.apple.ScriptEditor2 ~/Desktop/test_gvp.scpt'>AppleScript example ready to Script->Run</option><option oncontextmenu=ocmopt(this); value=\"IGVjaG8gJzU2NCs5ODc2NScgfCBiYw==\">Add 564 to 98765</option><option oncontextmenu=ocmopt(this); value=' ~/Documents ~/Desktop ~/Downloads'>Open the D folders</option><option oncontextmenu=ocmopt(this); value=' https://google.com'>Google</option><option oncontextmenu=ocmopt(this); value=' https://wikipedia.org'>Wikipedia</option><option oncontextmenu=ocmopt(this); value=' https://www.rjmprogramming.com.au'>RJM Programming</option><option oncontextmenu=ocmopt(this); value='ls -l . | open -f'>Pipe folder listing into TextEdit</option><option oncontextmenu=ocmopt(this); value='x-man-page://open'>Show man page in Terminal</option></select><br><br><input id=sbutmac type=submit value='Execute'></input></form>";

?>

Do you recognize any new encryption pattern with this option’s value? Yes, it is the …

base64 encoded

… version of …


echo '564+98765' | bc

… as a macOS Terminal application command line way to add 564 + 98765 via the macOS bc command, we got wind of via …


<html>
<body>
<script type=text/javascript>
var x=prompt('' + window.btoa(" echo '564+98765' | bc"), '' + window.btoa(" echo '564+98765' | bc"));
</script>
</body>
</html>

… and please be assured if one of your own dropdown option entry values contains a + character you do not have to do the work above (unless you are a masochist, that is), rather the web application can help you out.

Which begs the question …

If window.btoa is the “Fred” of the Javascript side of the work, what is the PHP receiving side’s “Ginger”?

Well, yes, would that be base64_decode pray tell?!

<?php

$plusin='+';
$plusout=' ';

$fromsc='~/Desktop/test_gvp.scpt';
$tosc='~/Desktop/test_gvp.scpt';

function oururldecode($ofwhat) {
global $plusin, $plusout, $fromsc, $tosc;
$interim=str_replace($fromsc,$tosc,urldecode($ofwhat));
if (strpos($interim, ' ') === false || substr(($interim . 'x'),0,1) == '+') {
$plusin=' ';
$plusout=' ';
return str_replace($fromsc,$tosc,base64_decode($ofwhat));
} else {
$plusin='+';
$plusout=' ';
}
return $interim;
}


if (isset($_GET['afteropen'])) {
if (sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])) > 2) {
for ($thisone=1; $thisone<sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])); $thisone++) {
array_push($afteropens, str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode(explode('#',explode('&',explode('afteropen=', $_SERVER['QUERY_STRING'])[$thisone])[0])[0]))));
}
} else {
$afteropen=(trim(str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode($_GET['afteropen'])))) == '' ? '' : ' ' . trim(str_replace(' ',' ' . $plusin,str_replace($plusin,$plusout,oururldecode($_GET['afteropen'])))));
$afteropens=[$afteropen];
}
}

?>

This offers a dynamic way to swap between the concepts, whose logic depends a bit on that first value character always being a space in this project. But that is so, and so this thinking helps a lot, and allows for that differentiation of + character meaning between (the rare) + operator (in mathematics) meaning and the + character PHP space character encryption meaning.

Today we’re also introducing an AppleScript interfacing option, and with the “say” option we now allow for command conjoining with the dropdown option value as long as the open directly follows on from the semicolon conjoining think it’s an operator!

And so, again, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below

Did you know?

Have you noticed in amongst the macOS open command values lots of ones starting with the switch …


-b

? Well, The macOS open command, thanks, told us …

You can specify just the name of an application or the full path, i.e. /Applications/Preview.app. If you need to be specific, you can also specify an application’s bundle identifier with -b com.apple.Preview.

… found out, we’ve been finding, successfully, via …

  1. in Finder right click the application of interest
  2. click Show Package Contents
  3. open the info.plist file in your favourite Text Editor
  4. look for …

    CFBundleIdentifier

    … within, for example, AppleScript’s info.plist …

    <key>CFBundleIdentifier</key>
    <string>com.apple.ScriptEditor2</string>

    … to come up with, for example …

    open -b com.apple.ScriptEditor2

    … as a way to open macOS application AppleScript (or Script Editor)


Previous relevant Local Operating System Menu Intranet Feel Options Tutorial is shown below.

Local Operating System Menu Intranet Feel Options Tutorial

Local Operating System Menu Intranet Feel Options Tutorial

A static list of options in the functional dropdown, as with yesterday’s Local Operating System Menu Intranet Feel Windows Tutorial does not sound as much fun as …

  • dropdown (ie. select element) options that if you right click bring up a means by which …
    1. existant option can be modified
    2. a new option can be added
    3. the option pointed at effectively nullified
    4. an option to remember for next time on that web browser when the web application is re-opened
    5. an option to forget the previous option’s work … it works! … we’ve already forgotten! … chortle, chortle

    … and we decided also, now that the user has some control over functionality, then …

  • offer email and/or SMS sharing including or excluding any option tinkering as described above
  • offer more Windows explorer.exe options thanks to https://www.geoffchappell.com/studies/windows/shell/explorer/cmdline.htm
  • offer the chance off an RJM Programming incarnation’s top MAMP/macOS/Windows dropdown (ie. select element, now showing with size attribute 3) right click chances to adjust Apache (eg. MAMP) port setting assumptions

And so, perhaps, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Windows Tutorial is shown below.

Local Operating System Menu Intranet Feel Windows Tutorial

Local Operating System Menu Intranet Feel Windows Tutorial

Yesterday’s Local Operating System Menu Intranet Feel Multiple Tutorial‘s smarts regarding dropdown multiple selections gets passed through to today’s …

Windows MAMP PHP 7.4.16

oh, oh “They’re mentioning version numbers … that can’t be good” … interfacing work.

And yes, it was a struggle, with this PHP version on MAMP disallowing …

  • file_put_contents … and, we would guess, file_get_contents …
  • exec or shell_exec or passthru or system
  • fopen writing to any *.bat

… and so, what we ended up with was an “as you login it starts” lookfor_extravaganza.bat we wrote that has less qualms with all these security matters happening in PHP, looking like lookfor_extravaganza.bat (where you could consider the timeout command rather than our ping means to introduce a sleep/wait) …


rem lookfor_extravaganza.bat
rem RJM Programming
rem November, 2025
rem Help out open_extravaganza.php on local Windows MAMP incarnation regarding no file_put_contents nor exec nor shell_exec allowed
rem Installed via ...
rem Win + R
rem shell:startup
rem ... copied into place via advice of ...
rem https://www.google.com/search?q=continuousnning+in+background+at+login&rlz=1C5OZZY_en&oq=continuousnning+in+background++at+login&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIJCAEQIRgKGKABMgkIAhAhGAoYoAEyCQgDECEYChigAdIBCjc1MjA1ajBqMTWoAgCwAgA&sourceid=chrome&ie=UTF-8
@echo off
cd C:\MAMP\htdocs
echo y > c:\MAMP\htdocs\open_extravaganza.y
:top
if exist c:\MAMP\htdocs\open_extravaganza.bxt rename c:\MAMP\htdocs\open_extravaganza.bxt open_extravaganza.bat
if exist c:\MAMP\htdocs\open_extravaganza.bat call c:\MAMP\htdocs\open_extravaganza.bat
if exist c:\MAMP\htdocs\open_extravaganza.bat erase c:\MAMP\htdocs\open_extravaganza.bat < c:\MAMP\htdocs\open_extravaganza.y ping /w 5000 127.0.0.1 > NUL
goto top

… leaving the PHP to just arrange that c:\MAMP\htdocs\open_extravaganza.bxt gets written via fopen means. Did you read above about where to “plonk” a DOS *.bat so that it starts up on logging in, as per …

Win + R
shell:startup
… copied into place via advice of …

this great advice, thanks … being, perhaps, simpler than Task Schedular thoughts?!

No time to see what else explorer.exe File Explorer is capable of … that is for another day we’re thinking?!

Anyway, you may want to (re-)try download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Multiple Tutorial is shown below.

Local Operating System Menu Intranet Feel Multiple Tutorial

Local Operating System Menu Intranet Feel Multiple Tutorial

Our normal tack regarding the method attribute to use on an HTML form element when the recipient webpage is written in PHP is …

  • preferably use method=POST … because so much more data can be handled that way … but today we’re …
  • preferring to use method=GET … for several reasons …
    1. we cannot see that the data will get too long for method=GET
    2. we’re allowing dropdown (ie. select element) multiple selection mode and we found it easier to handle data wise for the recipient to use method=GET with a PHP recipient $_SERVER[‘QUERY_STRING’] able to help better parse a method=GET MAMP style URL like …

      http://localhost:8888/open_extravaganza.php?afteropen=+https%3A%2F%2Fgoogle.com&afteropen=+https%3A%2F%2Fwikipedia.org&afteropen=+https%3A%2F%2Fwww.rjmprogramming.com.au

      … as per …
      <?php

      $afteropens=[];
      $thisone=1;

      if (isset($_GET['afteropen'])) {
      if (sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])) > 2) {
      for ($thisone=1; $thisone<sizeof(explode('afteropen=', '?' . $_SERVER['QUERY_STRING'])); $thisone++) {
      array_push($afteropens, str_replace('+',' ',urldecode(explode('#',explode('&',explode('afteropen=', $_SERVER['QUERY_STRING'])[$thisone])[0])[0])));
      }
      } else {
      $afteropen=(trim(str_replace('+',' ',urldecode($_GET['afteropen']))) == '' ? '' : ' ' . trim(str_replace('+',' ',urldecode($_GET['afteropen']))));
      $afteropens=[$afteropen];
      }
      }

      ?>
      … whereas method=POST loses those $_SERVER[‘QUERY_STRING’] possibilities
    3. there will be method=GET URLs anyway coming from the newly arranged RJM Programming origin form elements presented now if navigator.platform indicates your underlying operating system is either macOS or Windows (ie. it takes a punt on the form action localhost attribute defined pointing at a local web server (eg. MAMP) … where there is no harm done just trying)

And so, improving on yesterday’s Local Operating System Menu Intranet Feel Tutorial

  • the Execute button now means something … ie. you click it ahead of a 10 second allowance before the web application clicks it … allowing for …
  • multiple operating system actions off that dropdown list can be attempted in any one foray
  • the RJM Programming incarnation of it may show more functionality possibilities than it used to … all within the limitation of non-mobile platforms only

The advice, then, becomes download as open_extravaganza.php filename (changed this way) to MAMP’s Document Root folder/directory), and we think it is now less boring for macOS or Windows users to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows) or try it below


Previous relevant Local Operating System Menu Intranet Feel Tutorial is shown below.

Local Operating System Menu Intranet Feel Tutorial

Local Operating System Menu Intranet Feel Tutorial

Because we are fortunate enough to have the great MAMP local Apache/PHP/MySql web server in our macOS MacBook Air programming life …

  • we have a great testing platform to go to before uploading any software to the public RJM Programming domain (quite often as a web application) there
  • it can be an “Intranet feeling” partner to our public RJM Programming domain

So, what do we mean by “Intranet feeling”? Well, have you ever been involved at a workplace that combined …

  • a public facing website on the Internet … but which had a …
  • members area for “office use only” that if you logged into would take you into a woooorrrrllllddd of procedures and advice and documentation and health and safety rules etcetera etcetera etcetera related to that company, the data of which is “not public” … well, that “not public” bit can sometimes be referred to as an Intranet

? Well … … … … (four holes in the ground)(make that 5 or 6) … we did/have. And we are awwwwwffffuuuulllllyyy fond of the concept. The thing is though, we are using that “non public” …

Intranet “feeling”

… interfacing to, by and large, offer new web application (quite often PHP) ideas because back at the MAMP local Apache/PHP/MySql local web server we have the freedom to install software not allowed when you host a public website (as well as macOS having some brilliantly unique command line commands such as “open” and “say” (for which we’d ask you to download to a macOS MAMP port 8888 Document Root folder the PHP macos_say_record.php) to offer) perhaps that little bit different to the usual Intranet usage (hence Nala‘s use of the word fillingsfeelings), unless you run the hosting company, that is … and that isn’t us … though if Nala wants to entertain a gentleman caller one of these days … well … what are we going to say?! Hmmmmm?!

Now, when we presented YouTube API Caller Radio Play Playlist Windows Local System Tutorial we threw down the gauntlet, Luna would say, venturing …

… as your starting gambit, here, where the equivalent of macOS’s “open” is “explorer.exe” on Windows (ie. the File Explorer) … almost as cute!

The audacity, Nala?!

Well, we don’t want to involve ourselves in a “software war” here, but the “bedside better scrutiny” of the great https://scriptingosx.com/2017/02/the-macos-open-command/ advice has only enhanced respect for the macOS open command’s talents, which go far beyond just being able to open a URL from the macOS “Terminal application” command line in your default web browser.

How do we count the ways … Luna?!!!! See the compartmentalization and modularization at play (not the command) here, Dumboweb masterbugalugs?!

Anyway, we’re off and running on a new project with these themes. The first draft concentrates on ..

  1. macOS .. open … MAMP … but …
  2. Windows … explorer.exe … MAMP

… is there for the popcorn and beer nuts (best in that order) and as you can see below this new web application (best downloaded as open_extravaganza.php filename to MAMP’s Document Root folder/directory) is kind of boring to begin with interfacing to our public RJM Programming website (though if you have no Apache/PHP/MySql local web server, and want to install one, a right click on the dropdown below, for your non-mobile platform is a possibility for port 8888 on macOS and port 80 (ie. the default) on Windows)

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, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Location Hash Versus Server Primer Tutorial

Location Hash Versus Server Primer Tutorial

Location Hash Versus Server Primer Tutorial

In Window LocalStorage Client Versus Server Primer Tutorial we discuss ways to deal with large chunks of data passed on to a recipient webpage and not necessary needing …

  • the serverside …
    1. language … eg. PHP or ASP.Net
    2. form method=POST … able to handle much more data then method=GET … but only the serverside languages can be the recipient of method=POST

    … in favour of …

  • clientside window.localStorage or window.sessionStorage … or HTTP Cookies … and today we want to talk of another clientside alternative …
  • clientside location.hash hashtag data … can be appended to an HTML form action attribute that is method=GET

… to be offering an alternative that dovetails well with email or SMS “a” link “mailto:” or “sms:” sharing and collaboration possibilities as well as any “internal use only” you may use with …

  • same domain URL scenarios … and ..
  • Internet to Intranet “feeling” scenarios …

… such as is used with our recent open_extravaganza.php personalized macOS “open” command logics we talked about with Text to Speech Hashtagging Tutorial recently.

There are still data length limits even with hashtagging but much more can be achieved (rather than leaving HTML form navigation matters to the argument ? and & means of method=GET thinking) not involving any serverside interventions, which some programmers will not have access to … though we’re highly recommending it!


Previous relevant Window LocalStorage Client Versus Server Primer Tutorial is shown below.

Window LocalStorage Client Versus Server Primer Tutorial

Window LocalStorage Client Versus Server Primer Tutorial

Even though we rave on a lot about serverside PHP and its $_POST method=POST (versus HTML/Javascript recipient via ? and & argument $_GET method=GET scenario) data length advantages as the recipient of an HTML form method=POST set of data that could be sizeable, we’ve just realized that there is a client Javascript and window.localStorage methodology that may help alleviate the need to involve PHP (and any other serverside intervention) on occasions.

Hint: Yes, we’ve raved on about this too?! Does the blog posting title give it away? Okay, yes, it should read “localStorage”, but thought we’d gone past such juvenile finickiness since the Whac-A-Mole controversy of 1st December 2019 (or even The Great Tea Trolley Disaster of ’67, we daresay).

It can even use a “self-destruct” approach to the use of this “localStorage” on having used it because …

  • the web application knows who is using it (localStorage) … and on having accessed and read it …
  • the web application knows it (localStorage) is of no use to any other user (in this web application’s case, at least)

… which is very pleasing for a Land Surveyor who likes to leave cow paddocks as they’ve seen them so to speak. Except it’s like having a ten tonne truck worth of data access in amongst the cow pats when having access to “localStorage” (or PHP), rather than a little piddle of calf wee (wee Metcalfes know a thing or two about these things!) data access of ? and & HTML/Javascript URL arguments (or even if we were to use HTTP Cookies).

It’s not as if we all have access to serverside language usage, though we do, because we really like PHP and MAMP and Apache/PHP/MySql web servers (and have arranged our development environment accordingly), but what if you are starting out in web development, and still want to allow for sizeable chunks of data with your web applications? Huh? Huh?! See the possibilities? Try our proof of concept wls_vs_php.html Capital City Find Matching Country Report live run, and highlight a whole swathe of (multiple mode) dropdown option Capital Cities holding down the shift key before pressing the yellow “Report” button. If the URL ends up as …

https://rjmprogramming.com.au/HTMLCSS/wls_vs_php.html?capitals=localStorage&countries=localStorage

that’s because the web application’s …


function analyze() {
var purl=document.URL.split('#')[0].split('?')[0] + '?capitals=' + encodeURIComponent(document.getElementById('capitals').value) + '&countries=' + encodeURIComponent(document.getElementById('countries').value);
if (purl.length > 800) {
if (phpexists) {
document.getElementById('myform').method='POST';
document.getElementById('myform').action='./wls_vs_php.php';
} else if (window.localStorage) {
localStorage.setItem('wls_vs_php_countries', encodeURIComponent(document.getElementById('countries').value));
localStorage.setItem('wls_vs_php_capitals', encodeURIComponent(document.getElementById('capitals').value));
document.getElementById('capitals').value='localStorage';
document.getElementById('countries').value='localStorage';
location.href=document.URL.split('#')[0].split('?')[0] + '?capitals=' + encodeURIComponent(document.getElementById('capitals').value) + '&countries=' + encodeURIComponent(document.getElementById('countries').value);

return false;
}
}
return true;
}

… HTML form onsubmit event logic …

  1. discovered no PHP web application existant (via Client Pre-emptive Iframe techniques) … and …
  2. discovered (in a sanity check feeling way) that to go down the proposed HTML form method=GET approach was risking a …

    HTTP 414 "Request URI too long"

    … web browser error … and that …
  3. localStorage was a known web browser piece of functionality
  4. … and so as per our localStorage logic we …

  5. back out of the default HTML form method=GET navigation setup of the web application in favour of …
    • storing that data into localStorage
    • substituting into the URL ? and & arguments the hardcoding “localStorage” (and in so doing, getting back under the HTTP 414 “Request URI too long” limitation, piecing together (what amounts to) …
      location.href=document.URL.split(‘#’)[0].split(‘?’)[0] + ‘?capitals=localStorage&countries=localStorage’;
      )
      … that on a recall to this same web application a …
    • document.body onload event piece of Javascript logic checks the localStorage for its incoming Capital City Country Report data, as per …

      var phpexists=false;
      var getcapitals=location.search.split('capitals=')[1] ? decodeURIComponent(location.search.split('capitals=')[1].split('&')[0]).replace(/\+/g,' ') : '';
      var getcountries=location.search.split('countries=')[1] ? decodeURIComponent(location.search.split('countries=')[1].split('&')[0]).replace(/\+/g,' ') : '';

      function checkforreport() {
      var divcont='';
      var dcaps, dctys, idis;
      if (getcapitals == 'localStorage') {
      if (window.localStorage) {
      getcapitals=decodeURIComponent(localStorage.getItem('wls_vs_php_capitals')).replace(/\+/g,' ');
      localStorage.removeItem('wls_vs_php_capitals');
      } else {
      getcapitals='';
      }
      }
      if (getcountries == 'localStorage') {
      if (window.localStorage) {
      getcountries=decodeURIComponent(localStorage.getItem('wls_vs_php_countries')).replace(/\+/g,' ');
      if (getcapitals.replace('localStorage','') != '' && getcountries.replace('localStorage','') != '') { document.getElementById('myh1').innerHTML+=' <font size=1>... yes, it was needed</font>'; }
      localStorage.removeItem('wls_vs_php_countries');
      } else {
      getcountries='';
      }
      }

      if (getcapitals != '' && getcountries != '') {
      divcont='<table border=5 style="width:95%;vertical-align:top;background-color:white;"><tr style=background-color:#f0f0f0;"><th>Capital</th><th>Country</th></tr></table>';
      dcaps=getcapitals.split('|');
      dctys=getcountries.split('|');
      for (idis=0; idis<dcaps.length; idis++) {
      divcont=divcont.replace('</table>', '<tr><td>' + dcaps[idis] + '</td><td>' + dctys[idis] + '</td></tr></table>');
      }
      document.getElementById('dreport').innerHTML=divcont;
      }
      }

      … the localStorage.removeItem() representing that “self-destruct” nuance we were talking about before

We may well use this methodology in future projects, and hope it has been of some little interest to you as well?!

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

Dictionary Plonking Primer Tutorial

The Word Web Primer Tutorial

Dictionary Plonking Primer Tutorial

One of the things we miss from the 1970’s to 1980’s (and maybe 1990’s), primarily in Windows, for us, was the opportunity to install, via what we refer to fondly, as …

plonking

… which, to us, refers to the act of making a software install happen, barring file permission issues that you may have to attend to, just by …

copying files

No more … no less … no installer programs required. It was especially the case compiling Windows source code (eg. Fortran or C or C++) into *.exe executables via a command line compiler statement, and the software would either be ready to roll there and then, or perhaps need …

  • at most, one file permission temporary tweak
  • one file copying operation
  • at most, one file permission temporary re-tweak (back to original setting)

But we stumbled upon one the other day regarding our Start Word for Wordle web application talked about at Apple Script Execution of Start Word Suggestions for Wordle Tutorial, where we noticed it not displaying anything, and looking into the matter discovered that our newest AlmaLinux web server incarnation had no …


/usr/share/dict

… dictionary installed. So we brought over our English one (ie. copied it’s files) from our local macOS (same /usr/share/dict) place to the RJM Programming place (albeit via a FileZilla upload … we’re counting as “plonking”).


Previous relevant Apple Script Execution of Start Word Suggestions for Wordle Tutorial is shown below.

Apple Script Execution of Start Word Suggestions for Wordle Tutorial

Apple Script Execution of Start Word Suggestions for Wordle Tutorial

It’s 2022 as we write this blog post and these days your macOS operating systems no longer present you with the chance to create desktop shortcuts that run a program with user defined arguments. But there is still Apple Script as a possible methodology we can use, via the Apple Script …


tell application "Terminal"
activate
do script "cd ~/Downloads" in window 1
do script "open 'HTTP://www.rjmprogramming.com.au/PHP/start_word_for_wordle_helper.php?others=sort%20%20unique%20common%20&sugnum=7'" in window 1
end tell

… we got great help, thanks, in writing, that …

  1. starts Applications -> Utilities Terminal application … and then it does not matter, especially, but we …
  2. change directory to the user’s Downloads folder … and then …
  3. issue the command line command …

    open 'HTTP://www.rjmprogramming.com.au/PHP/start_word_for_wordle_helper.php?others=sort%20%20unique%20common%20&sugnum=7'

    … to open the same web application as for yesterday’s Start Word Suggestions for Wordle Intersessional Tutorial to tailor a set of “Start Word for Wordle” words

We saved the Apple Script above to our ~/Desktop desktop ready to execute and be in the Apple Script environment, as you run the Apple Script that opens the web application. We hope this interests some macOS users, now or into the future.


Previous relevant Start Word Suggestions for Wordle Intersessional Tutorial is shown below.

Start Word Suggestions for Wordle Sort Tutorial

Start Word Suggestions for Wordle Intersessional Tutorial

Yesterday’s English Word Guessing Game Intranet Tutorial‘s use of window.localStorage methodologies got us rethinking the “Start Word for Wordle” ideas in the recent Start Word Suggestions for Wordle Sort Tutorial‘s web application.

Those, again, Javascript prompt window driven user interactions, are a tad annoying to handle, but if they could be “standing order”ised then that might help. Here we need to store the setting in the web browser, hence the use of HTTP Cookies or window.localStorage (or window.sessionStorage).

Along the way, we wanted to offer another option, “common”, to be a user definable setting saying that words suggested would have to be “ridgy didge” in The Free Dictionary, thanks, lexicon.

Getting this going, we realized this might take longer, and when the word “longer” comes into play, we (tend to) think (as you would)


document.body.style.cursor='progress';

… to signal to the user that processing may take some time. And for the first time we can remember, we were interested in floating to the right of that “spinning ball” progress cursor some reason for the wait, that being a (most likely rearranged) version of the Javascript prompt window entry the user made.

At the Javascript function onl() document.body “onload” event logic, changes made augment the new “just before </body>” <div id=cwords></div> initially static HTML element …

<?php echo ”

var pointerX = -1;
var pointerY = -1;

function pointerCheck() {
if (pointerX != -1) {
document.getElementById('cwords').style.position='absolute';
document.getElementById('cwords').style.top='' + eval(0 + eval('' + pointerY)) + 'px';
document.getElementById('cwords').style.left='' + eval(30 + eval('' + pointerX)) + 'px';
document.getElementById('cwords').style.zIndex='99';
document.getElementById('cwords').style.backgroundColor='orange';
document.getElementById('cwords').innerHTML=document.getElementById('lsbits').title;
}
}



function onl() {
if (('' + localStorage.getItem('start_word_for_wordle_helper')).replace(/^null$/g,'') != '') {
document.getElementById('lsbits').title=decodeURIComponent(localStorage.getItem('start_word_for_wordle_helper')).replace('&sugnum=',' ').replace(encodeURIComponent('&sugnum='),' ');
if (document.URL.indexOf('others=') == -1) {
document.body.style.cursor='progress';
document.onmousemove = function(event) { // thanks to https://www.codegrepper.com/code-examples/javascript/get+cursor+position+javascript
if (event.clientX || event.clientY) {
pointerX = event.clientX;
pointerY = event.clientY;
} else {
pointerX = event.pageX;
pointerY = event.pageY;
}
};
setInterval(pointerCheck, 1000);
location.href=(document.URL + '&others=' + (localStorage.getItem('start_word_for_wordle_helper'))).replace('.php&','.php?').replace(encodeURIComponent('&sugnum='),'&sugnum=');
}
}


if (window.self !== window.top) {
document.body.innerHTML = ('' + document.body.innerHTML).replace(/h1/g, 'h2');
}
makesortable();
}

“; ?>

… help make this happen.

All this can give the changed start_word_for_wordle_helper.php live run an intersessional personalization feel to it.


Previous relevant Start Word Suggestions for Wordle Iframe Tutorial is shown below.

Start Word Suggestions for Wordle Iframe Tutorial

Start Word Suggestions for Wordle Iframe Tutorial

Yesterday’s Start Word Suggestions for Wordle Styling and Scripting Tutorial‘s presentation used a hashtag navigation link, “or below“, to take the user to an HTML iframe hosted execution of our current web application of interest. Sometimes in such a scenario, you might be dealing with a vastly reduced width and/or height to work with, and find your presentation to this iframe appears a bit too wide or too high. And so, today, we outline an idea or two about how to handle that.

  1. decide on a strategy for “iframe” modus operandi CSS styling improvement or HTML design improvement or Javascript DOM dynamic styling improvement … we’ve decided, today …
  2. for “iframe” modus operandi we want to reduce width by turning the “h1” element into an “h2” element … which amounts to an HTML design improvement implemented via a Javascript DOM action conduit, as per …
  3. decide on an intervention point for that Javascript DOM action conduit … you guessed it … document.body onload event as the webpage loads
    <?php

    echo "<html>" . $hsc . "<body onload=onl();><h1><span>Start five letter word for <a target=_blank href='//www.powerlanguage.co.uk/wordle/'>Wordle</a> ... </span><input onclick=mixitup(); title='Allow for Unique Letters, Weirdness Sorting' type=button style=display:inline-block; value='via '></input></span><form id=myform style=display:inline-block; action=./start_word_for_wordle_helper.php method=POST><input id=mysub type=submit value=Submit style=display:none;></input><select style=display:inline-block; id=sugnum name=sugnum onchange=document.getElementById('mysub').click();><option id=defopt value=-" . $sugnum . ">" . $sugnum . "</option><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option><option value=20>20</option><option value=25>25</option><option value=50>50</option><option value=100>100</option></select><span> suggestions ...</span></h1><h3>RJM Programming ... February, 2022</h3><h4>Suggestions below (bigger associated number, the weirder is the suggestion) ...</h4><br>" . $tablebit . "</body></html>";

    ?>
    … then …
  4. write the new Javascript document.body onload event logic …
    <?php echo ”

    function onl() {
    if (window.self !== window.top) {
    document.body.innerHTML = ('' + document.body.innerHTML).replace(/h1/g, 'h2');
    }
    }

    “; ?>
    … a total “document.body.innerHTML” (content) solution working here (but is not always a good solution) to change the “type” of an element

… representing a “hosting mode of use” style variation with our changed start_word_for_wordle_helper.php live run link, or below, web application!


Previous relevant Start Word Suggestions for Wordle Styling and Scripting Tutorial is shown below.

Start Word Suggestions for Wordle Styling and Scripting Tutorial

Start Word Suggestions for Wordle Styling and Scripting Tutorial

Yesterday’s Start Word Suggestions for Wordle Primer Tutorial proof of concept “Start Five Letter Word for Wordle Suggester” web application managed to create a workable webpage that did not need a “head” element. What are you missing with no “head” element? Primarily …

  • scripting (usually via Javascript)
  • styling (via CSS)

… and, perhaps a webpage title element, and, perhaps “meta” elements like “meta viewport” elements that help with mobile device display (improved visibility, for us).

Within the PHP code we introduced some of all these improvements via …

<?php

$hsc="<head>
<title>Start five letter word for Wordle - RJM Programming - February, 2022</title>
<meta id='myviewport' name='viewport' content='width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes' >
<style>
td {
text-align: center;
}

td:nth-child(2n+1) {
background-color: #f3f7fa;
}

th:nth-child(2n+1) {
background-color: #f3f7fa;
}


body {
background-color: #f7f7f7;
}
</style>
<script type='text/javascript'>
var wois=null;
function mixitup() {
var others=prompt('Space separate the word(s) \"sort\" to sort for Weirdness and/or \"unique\" for five letter words with no repeated letters. Optionally precede by that number of five letter word suggestions to create for use with Wordle, followed by a space character.', '');
var clickthis='';
if (others == null) { others=''; }

others=others.replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'');
others=others.toLowerCase().replace('sort',' sort').replace('uniqu',' uniqu');
if (others.trim() != '') {
var aothers=others.trim().split(' ');
if (aothers[0].replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') {
document.getElementById('defopt').value='-' + aothers[0];
document.getElementById('defopt').innerHTML=aothers[0];
document.getElementById('sugnum').value='-' + aothers[0];
others=others.replace(aothers[0],'').trim();
clickthis='mysub';
}
}
if (others.trim() != '') {
var sv=document.getElementById('sugnum').value;
document.getElementById('myform').innerHTML+='<input type=hidden name=others value=\"' + others + '\"></input>';
document.getElementById('sugnum').value=sv;
}
if (clickthis != '') { document.getElementById(clickthis).click(); }
}


</script>
</head>";

?>

It allows us to offer “sort” (via word weirdness) and “uniquify” (to enforce unique letter sets per five letter word) additional functionality. We hope you try the changed start_word_for_wordle_helper.php live run link, or below, to try out these improvements.


Previous relevant Start Word Suggestions for Wordle Primer Tutorial is shown below.

Start Word Suggestions for Wordle Primer Tutorial

Start Word Suggestions for Wordle Primer Tutorial

A new word game is an interesting phenomenon. Are you a regular “Wordle” player? We tried it the other day, and see why it’s addictive. But it seems to us, a lot relies on that first five letter word guess you make.

And so we decided to try to help out, at least in English, by accessing the macOS and Linux dictionary resources, and add in a “weirdness score”, the scoring for which we adopt a “Scrabble stance”. Interested? Try start_word_for_wordle_helper.php‘s live run, or below …

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, Games, Installers, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Making Of How Come Sharing and Remembering Tutorial

Making Of How Come Primer Tutorial

Making Of How Come Sharing and Remembering Tutorial

The other day, getting the content together for the “making of” How Come Sharing and Remembering Tutorial we stumbled upon, in a first time for us, using …

  • Dailymotion‘s sharing “embed” recommended HTML …

    <iframe src="https://geo.dailymotion.com/player.html?video=x9oajeg" style="width:100%; height:100%; visibility:hidden; position:absolute; left:0px; top:0px; overflow:hidden; border:none;" allowfullscreentitle="Dailymotion Video Player" allow="web-share"></iframe>

    … rather than what we normally find to use, that being …
  • YouTube‘s sharing “embed” recommended HTML

… for that Get Smart episode video. It was great to be accessing this sharing “embed” recommended HTML functionality there, but on this non-mobile MacBook Air laptop that default HTML code would start playing the video as you loaded the blog posting, and so committed the cardinal sin of playing audio ahead of a user instigated click of some sort on the webpage. Was a bit shocked at my own reaction, but guess I’ve come around to the mobile woooorrrllllddd’s dim view of uninvited audio plays, myself … figuring if it happened on public transport with no headphones, then that would be a pest.

Anyway, we tried unsuccessfully tweaking the Dailymotion URL arguments as our Plan A fix, but had to resort to Plan B consisting of …

  1. creating effectively a “splash page” still image that can be a background image to a new nesting div element with “onclick” event logic as per …

  2. <div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;background:URL('/HTMLCSS/how_come_dm.jpg');background-size:contain;background-repeat:no-repeat;" onclick="document.getElementById('ifpl').style.opacity='1.0'; document.getElementById('ifpl').style.visibility='visible'; document.getElementById('ifpl').src='https://geo.dailymotion.com/player.html?video=x9oajeg'; "><iframe title='' onload="if (this.title == '' || this.title == ' ') { if (this.src.indexOf('About_Us.htm') != -1) { this.title=' '; } else { this.title+=' '; } if (this.title == ' ' && 3 == 4) { this.src='https://geo.dailymotion.com/player.html?video=x9oajeg'; } }" id=ifpl src="/About_Us.html" style="width:100%; height:100%; visibility:hidden; position:absolute; left:0px; top:0px; overflow:hidden; opacity:0; border:none;" allowfullscreentitle="Dailymotion Video Player" allow="web-share"></iframe></div>

    … working as below …

Bit kludgy, but does the job!

Did you know?

We’ve no doubt you could do a less kludgy job creating the “splash page” still image via …

  1. on macOS MacBook Air …
  2. got the Get Smart Dailymotion video up and paused near it’s start (and we’re sure you could make it “at it’s start”)
  3. went …

    control-command-shift-3

    … to copy a screenshot into the clipboard …
  4. went into the macOS Paintbrush image editing via menu option …

    File -> New from Clipboard
  5. dragged cursor into a rectangle describing where we wanted the bounds of a suitable “splash page” still image (and we’d hope you do not end up with any hands showing there?!)
  6. went …

    Edit -> Copy
  7. went …

    File -> New from Clipboard
  8. went …

    File -> Save As...

    how_come_dm

  9. uploaded via FileZilla the resultant how_come_dm.jpg to RJM Programming’s /HTMLCSS/how_come_dm.jpg


Previous relevant How Come Sharing and Remembering Tutorial is shown below.

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.


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

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

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