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

New Temporary Folder Arrangements Tidying Tutorial

New Temporary Folder Arrangements Tidying Tutorial

New Temporary Folder Arrangements Tidying Tutorial

We’ve had one public and three private dedicated virtual servers running our Apache/PHP/MySql web server here at RJM Programming. The last two have us transitioning from one AlmaLinux web server to another. What could be different? Well (readers who resist reading blog posting titles) security measures move on with a lot of upgrades and migrations in web server “land” these days. On ours, the use of …


/tmp

as per


# df -k /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda1 103019024 58818836 38940980 61% /
# df -k /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 4054752 1108 3843932 1% /tmp
#

… have in the last AlmaLinux web server incarnation become more contentious in that the RJM Programming web server username (as distinct from the administrator of cPanel username) is unable to write to this /tmp for the first time. This is a little bit of a peeve for us, as we have written quite a bit of PHP that uses it to read and write from, as it’s temporary storage “place of choice”.

There’s no way we are going to rush to remedy this, but, today, after self-ruling out, after discussion with our web hosters, Crazy Domains, the thought of changing any file permissions here, we’re starting, sort of at the back end of the issue, fixing for the future …

  • crontab # ie. scheduled …
  • file tidying (after PHP action) processes

You can glean what we did via watching today’s tutorial animated GIF presentation, but the gist of it involved …

  • in RJM Programming cPanel’s Terminal window …

    crontab -l | grep '/tmp'

    … and copy into a text buffer …
  • back in the macOS MacBook Air desktop application woooorrrrllllddd paste into a TextWrangler editor new file … and then …
  • for relevant records substitute /tmp for /home/rjmprogr (as our new choice of place to act as the temporary storage “place of choice” and which we successfully road tested when we presented the Message Board One Liners Aesthetics Tutorial (with it’s, early days, changed prepend.php) thread of blog postings)
  • change the minutes field 10 less for all such records
  • copy this into a buffer
  • back at RJM Programming cPanel’s Terminal window …

    crontab -e

    … ours uses the great vi editor where we get to the end character and type “i” for insert in order to Paste (via top menu) into the crontab file … followed by “wq” to save (with all being well will result in …

    crontab: installing new crontab

    )

  • readying ourselves for either “tidying up” requirement into the future

Over to you … PHP!

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

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

Drag and Drop Peers External Javascript Tutorial

Drag and Drop Peers External Javascript Tutorial

Drag and Drop Peers External Javascript Tutorial

There would have to be lots of provisos, but wouldn’t it be good regarding yesterday’s Drag and Drop Peers Primer Tutorial‘s Drag and Drop supervisor web application, for mobile, if …

Some form of external Javascript tool could help out and improve on the dropdown with size attribute greater than one not showing option elements up front regarding their rendered display

? We think so. To our mind, the provisos are …

  • prove that the size attribute greater than one rendering not being honoured by the web browser (which have always been regarding mobile platforms, in our experience) … we can do this via getBoundingClientRect check of rendered dropdown element height …
  • prove that dropdown multiple attribute not present …
  • map a clear dropdown onchange event logic to a new onclick one, possible, we think, if …
    1. down from the dropdown … via <br> …
    2. with the dropdown width (and getBoundingClientRect height) … we add …
    3. button elements whose value attribute, if not nothing, matches that of a corresponding dropdown option subelement … and …
    4. button element innerHTML matches that of a corresponding dropdown option subelement

We applied all these checks into some proof of concept selectbuttons.js external Javascript logic …


// selectbuttons.js
// RJM Programming
// November, 2025
// Where apt help out select size=>1 not multiple not with code complexity scenarios with buttons, especially for mobile platforms
// Thanks to https://www.google.com/search?q=can+button+element+still+get+given+a+value+attribute&rlz=1C5OZZY_en&oq=can+button+element+still+get+given+a+value+attribute&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIHCAIQIRiPAtIBCTE0MDM0ajBqNKgCALACAQ&sourceid=chrome&ie=UTF-8#cobssid=s

function selbutcheck() {
var thispartoh='', izs=1, rectsis=null, bheight=0, bwidth=0, oncis='', optswillbe=[], iow=0, bihfrom='', bihto='';
var selsarr=document.getElementsByTagName('select');
for (var iselr=0; iselr<selsarr.length; iselr++) {
thispartoh=selsarr[iselr].outerHTML.split('>')[0];
if (thispartoh.indexOf(' multiple') == -1) {
if (thispartoh.indexOf(' size="') != -1 || thispartoh.indexOf(" size='") != -1) {
izs=eval(thispartoh.split(' size=')[1].substring(1).split(thispartoh.split(' size=')[1].substring(0,1))[0]);
if (izs > 1) {
rectsis=selsarr[iselr].getBoundingClientRect();
bheight=Math.floor(eval('' + rectsis.height) / eval('' + eval('' + selsarr[iselr].size)))
bwidth=eval('' + rectsis.width);
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (eval('' + rectsis.height) < 33) {
bheight=eval('' + rectsis.height);
if (thispartoh.indexOf(' onchange="') != -1 || thispartoh.indexOf(" onchange='") != -1) {
oncis=' onclick=' + thispartoh.split(' onchange=')[1].substring(0,1) + thispartoh.split(' onchange=')[1].substring(1).split(thispartoh.split(' onchange=')[1].substring(0,1))[0] + thispartoh.split(' onchange=')[1].substring(0,1) + ' ';
optswillbe=selsarr[iselr].innerHTML.split(selsarr[iselr].innerHTML.split('</option>')[0] + '</option>')[1].split('</option>');
bihfrom=selsarr[iselr].outerHTML;
bihto=selsarr[iselr].outerHTML;
for (iow=0; iow<optswillbe.length; iow++) {
if (optswillbe[iow].trim() != '') {
bihto+='<br><button style="width:' + bwidth + 'px;height:' + bheight + 'px;" ' + oncis + ' value="' + optswillbe[iow].split(' value="')[1].split('"')[0] + '">' + optswillbe[iow].split('>')[1] + '</button>';
}
}
if (bihto != bihfrom) {
document.body.innerHTML=document.body.innerHTML.replace(bihfrom, bihto);
}
}
}
}
}
}
}
}
}

setTimeout(selbutcheck, 5000);

… to a changed experimental_peers_drag_and_drop.php PHP Drag and Drop supervisor web application you can also try below, and we were happy with the result applied to yesterday’s starting logic. We even left the dropdown in for mobile platforms, and it was our view that made it “sort of” become better than non-mobile for how we perceived our user experience to be. Either dropdown or buttons could achieve their aim on mobile platforms.


Previous relevant Drag and Drop Peers Primer Tutorial is shown below.

Drag and Drop Peers Primer Tutorial

Drag and Drop Peers Primer Tutorial

We’ve decided to gather the Drag and Drop games into a “peerage” of web applications so that one central supervisory web application can point the user into the correct direction to find them, or one of them, as per the PHP glob and “clone” based …


<?php
// experimental_peers_drag_and_drop.php
// RJM Programming
// November, 2025
// Make peers of all the experimental drag and drop logic based web applications

$sofar="";
$listis='';
foreach (glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . '*.php') as $filename) {
$contis=file_get_contents($filename);
if (strpos($contis, "templa" . "tegame=file_get_contents('./experimental_drag_and_drop.htm") !== false) {
if (strpos($filename, "_new_") === false && strpos($sofar, str_replace('_','',str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename))) === false) {
if ($listis == '') {
$listis.=str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename);
} else {
$listis.=',' . str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename);
}
$sofar.=str_replace('_','',str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename));
}
}
}
$larris=explode(',', $listis);
$htmlis='<html><head><title>Experimental Drag and Drop Peers - RJM Programming - November, 2025</title></head><body><h1>Experimental Drag and Drop Peers</h1><h3>RJM Programming - November, 2025</h3><select onchange="if (this.value.length != 0) { window.open(this.value,' . "'_blank','top=120,left=510,width=940,height=660'" . '); }" id=mysel size=' . (3 + sizeof($larris)) . '><option value="">Optionally select an Experimental Drag and Drop web application, to try, below ...</option><option value="/HTMLCSS/chess_game.php">Chess game</option><option value="/HTMLCSS/gradual_reveal_country_game.htm">Reveal country game</option></select></body></html>';

if ($listis != '') {
for ($i=0; $i<sizeof($larris); $i++) {
$htmlis=str_replace('</select>', '<option value="' . $larris[$i] . '">' . strtoupper(substr(str_replace('_',' ',explode('.', basename($larris[$i]))[0]),0,1)) . substr(str_replace('_',' ',explode('.', basename($larris[$i]))[0]),1) . "</option></select>", $htmlis);
}
echo $htmlis;
}

?>

… as a proof of concept Drag and Drop supervisor web application you can also try below …

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

Drag and Drop Peers Primer Tutorial

Drag and Drop Peers Primer Tutorial

Drag and Drop Peers Primer Tutorial

We’ve decided to gather the Drag and Drop games into a “peerage” of web applications so that one central supervisory web application can point the user into the correct direction to find them, or one of them, as per the PHP glob and “clone” based …


<?php
// experimental_peers_drag_and_drop.php
// RJM Programming
// November, 2025
// Make peers of all the experimental drag and drop logic based web applications

$sofar="";
$listis='';
foreach (glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . '*.php') as $filename) {
$contis=file_get_contents($filename);
if (strpos($contis, "templa" . "tegame=file_get_contents('./experimental_drag_and_drop.htm") !== false) {
if (strpos($filename, "_new_") === false && strpos($sofar, str_replace('_','',str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename))) === false) {
if ($listis == '') {
$listis.=str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename);
} else {
$listis.=',' . str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename);
}
$sofar.=str_replace('_','',str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename));
}
}
}
$larris=explode(',', $listis);
$htmlis='<html><head><title>Experimental Drag and Drop Peers - RJM Programming - November, 2025</title></head><body><h1>Experimental Drag and Drop Peers</h1><h3>RJM Programming - November, 2025</h3><select onchange="if (this.value.length != 0) { window.open(this.value,' . "'_blank','top=120,left=510,width=940,height=660'" . '); }" id=mysel size=' . (3 + sizeof($larris)) . '><option value="">Optionally select an Experimental Drag and Drop web application, to try, below ...</option><option value="/HTMLCSS/chess_game.php">Chess game</option><option value="/HTMLCSS/gradual_reveal_country_game.htm">Reveal country game</option></select></body></html>';

if ($listis != '') {
for ($i=0; $i<sizeof($larris); $i++) {
$htmlis=str_replace('</select>', '<option value="' . $larris[$i] . '">' . strtoupper(substr(str_replace('_',' ',explode('.', basename($larris[$i]))[0]),0,1)) . substr(str_replace('_',' ',explode('.', basename($larris[$i]))[0]),1) . "</option></select>", $htmlis);
}
echo $htmlis;
}

?>

… as a proof of concept Drag and Drop supervisor web application you can also try below …

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

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

Synonymous With Delimitation Implementation Tutorial

Synonymous With Delimitation Implementation Tutorial

Synonymous With Delimitation Implementation Tutorial

We left off yesterday’s Synonymous With Delimitation Primer Tutorial‘s YouTube API based SubRip (ie. subtitles) based web application discussion with …

Still to go, to go further, is to code within the SubRips for understanding a potential new incoming argument …


?inlist=[encoded " , " based data]

… and here we are … in amongst the SubRips … just cooling off … man … damn … whatevvvvveeeerrrrr!

Okay, in real life, the data between our ” , ” delimitations could be very complex, but within that ” , ” delimited data we can have ” ” delimited “words” we can categorize into …

  • purely numeric … so is either a start of video snippet time (4th textbox) or end of video snippet time (5th textbox)
  • YouTube 11 character string (which is 2nd textbox content)
  • URL starting with http … so is either a 6th textbox component or that 7th textbox link … and then …
  • what’s left (of a ” , ” record field) … where we might find, in order of priority, a component of the 3rd textbox or a component of the 6th textbox or the form 1st title textbox

… as a way to proceed, and also cater for users going “that extra milekilometer”. So, that’s the idea here, and it’s up to you but, we tend not to care that data makes sense at this stage (allowing us to swivel from https://www.rjmprogramming.com.au/ address bar URLs to http://localhost:8888/ MAMP ones willy nilly to test things to the level of “just slotting them into the correct textbox places” that is), but that it falls into the correct textboxes that worry us for today, so in most/any tutorial animated GIF image you see today, don’t expect a SubRip result (that works) … man … damn … whatevvvvveeeerrrrr!

Now, where to place this logic? Well, as it so happens, the cloning we did with these “down among the SubRips … just cooling off … man … damn … whatevvvvveeeerrrrr” project …

  • meant the HTML form IDs were all the same throughout the suite of peer YouTube API based SubRip web applications … phew! … and left us with …
  • a suitable external Javascript we call with any of the suite of peer YouTube API based SubRip web applications

… and so, that is where we place the new Javascript logic …


var xinlist=location.search.split('inlist=')[1] ? decodeURIComponent(location.search.split('inlist=')[1].split('&')[0]) : '';
var xinarr=xinlist.split(' , ');

if (xinlist.trim() != '') {
setTimeout(synonomous, 6000);
}

function synonomous() {
var oklast=['A','E','I','M','Q','U','Y','c','g','k','o','s','w','0','4','8'];
var parttherof=0, partwords=[], recw='', wpart=0, sfnd=false, efnd=false, tfnd=false, yfnd=false, wfnd=false, hfnd=false, ofnd=false, mta=0, addonm=1, ntwoinarow=-1;
var snapshotrecs=[], lastssr=-1, sparerec='', kspare=0, wwpart=0;
if (xinlist.trim() != '') {
for (parttherof=0; parttherof<xinarr.length; parttherof++) {
recw=xinarr[parttherof];
sfnd=false;
efnd=false;
wfnd=false;
hfnd=false;
mta=0;
addonm=1;
snapshotrecs=[];
lastssr=-1;
ntwoinarow=-1;
partwords=xinarr[parttherof].trim().split(' ');


for (wpart=0; wpart<eval(-1 + eval('' + partwords.length)); wpart++) {
if (ntwoinarow < 0 && partwords[wpart].trim() != '' && partwords[wpart].replace('.','').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,'') == '') { if (ntwoinarow < 0 && partwords[eval(1 + wpart)].trim() != '' && partwords[eval(1 + wpart)].replace('.','').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,'') == '') { ntwoinarow=eval(-1 + eval('' + wpart)); } } }

for (wpart=0; wpart<partwords.length; wpart++) {
if (partwords[wpart] == '') {
sfnd=sfnd;
} else if (partwords[wpart].trim() != '' && partwords[wpart].replace('.','').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,'') == '') {
if (!sfnd) {
if (wpart > ntwoinarow) {
if (document.getElementById('fauxpasstartsecs01').value == '') {
if (lastssr >= 0) { snapshotrecs[lastssr]=snapshotrecs[lastssr].split(partwords[wpart])[0]; }
document.getElementById('fauxpasstartsecs01').value+=partwords[wpart];
sfnd=true;
recw=recw.replace(partwords[wpart], '');
addonm=1;
} else {
if (lastssr >= 0) { snapshotrecs[lastssr]=snapshotrecs[lastssr].split(partwords[wpart])[0]; }
document.getElementById('fauxpasstartsecs01').value+=',' + partwords[wpart];
sfnd=true;
recw=recw.replace(partwords[wpart], '');
addonm=1;
}
}
} else if (!efnd) {
if (document.getElementById('fauxpasendsecs01').value == '') {
if (lastssr >= 0) { snapshotrecs[lastssr]=snapshotrecs[lastssr].split(partwords[wpart])[0]; }
document.getElementById('fauxpasendsecs01').value+=partwords[wpart];
efnd=true;
recw=recw.replace(partwords[wpart], '');
addonm=1;
} else {
if (lastssr >= 0) { snapshotrecs[lastssr]=snapshotrecs[lastssr].split(partwords[wpart])[0]; }
document.getElementById('fauxpasendsecs01').value+=',' + partwords[wpart];
efnd=true;
recw=recw.replace(partwords[wpart], '');
addonm=1;
}
} else {
if (addonm == 1) { sparerec=recw; if (lastssr >= 0) { for (kspare=0; kspare<=lastssr; kspare++) { sparerec=sparerec.replace(snapshotrecs[kspare],''); } } snapshotrecs.push(sparerec); lastssr=eval(-1 + eval('' + snapshotrecs.length)); }
mta+=addonm;
addonm=0;
}
} else if (partwords[wpart].trim() != '' && partwords[wpart].toLowerCase().indexOf('http') == 0) {
if (!hfnd && document.URL.indexOf('/song_lyric_faux_pas.htm') == -1) {
if (document.getElementById('fauxpasreally01').value == '') {
if (lastssr >= 0) { snapshotrecs[lastssr]=snapshotrecs[lastssr].split(partwords[wpart])[0]; }
document.getElementById('fauxpasreally01').value+=partwords[wpart];
addonm=1;
} else {
if (lastssr >= 0) { snapshotrecs[lastssr]=snapshotrecs[lastssr].split(partwords[wpart])[0]; }
document.getElementById('fauxpasreally01').value+=' , ' + partwords[wpart];
addonm=1;
}
hfnd=true;
recw=recw.replace(partwords[wpart], '');
} else if (!ofnd) {
if (lastssr >= 0) { snapshotrecs[lastssr]=snapshotrecs[lastssr].split(partwords[wpart])[0]; }
document.getElementById('refurl01').value+=partwords[wpart];
ofnd=true;
recw=recw.replace(partwords[wpart], '');
addonm=1;
} else {
if (addonm == 1) { sparerec=recw; if (lastssr >= 0) { for (kspare=0; kspare<=lastssr; kspare++) { sparerec=sparerec.replace(snapshotrecs[kspare],''); } } snapshotrecs.push(sparerec); lastssr=eval(-1 + eval('' + snapshotrecs.length)); }
mta+=addonm;
addonm=0;
}
} else if (partwords[wpart].trim() != '' && eval('' + partwords[wpart].length) == eval('' + encodeURIComponent(partwords[wpart]).length) && eval('' + partwords[wpart].length) == 11 && oklast.indexOf(partwords[wpart].slice(-1)) != -1) {
if (!yfnd) {
if (lastssr >= 0) { snapshotrecs[lastssr]=snapshotrecs[lastssr].split(partwords[wpart])[0]; }
document.getElementById('youtubeid01').value+=partwords[wpart];
yfnd=true;
recw=recw.replace(partwords[wpart], '');
addonm=1;
} else {
if (addonm == 1) { sparerec=recw; if (lastssr >= 0) { for (kspare=0; kspare<=lastssr; kspare++) { sparerec=sparerec.replace(snapshotrecs[kspare],''); } } snapshotrecs.push(sparerec); lastssr=eval(-1 + eval('' + snapshotrecs.length)); }
mta+=addonm;
addonm=0;
}
} else {
if (addonm == 1) { sparerec=recw; if (lastssr >= 0) { for (kspare=0; kspare<=lastssr; kspare++) { sparerec=sparerec.replace(snapshotrecs[kspare],''); } } snapshotrecs.push(sparerec); lastssr=eval(-1 + eval('' + snapshotrecs.length)); }
mta+=addonm;
addonm=0;
}
}

if (mta > 0) {
for (wwpart=0; wwpart<snapshotrecs.length; wwpart++) {
if (snapshotrecs[wwpart] != '') {
if (!wfnd && document.URL.indexOf('/song_lyric_faux_pas.htm') != -1) {
if (document.getElementById('fauxpas01').value == '') {
document.getElementById('fauxpas01').value+=snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
wfnd=true;
} else {
document.getElementById('fauxpas01').value+=' , ' + snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
wfnd=true;
}
} else if (!hfnd && document.URL.indexOf('/song_lyric_faux_pas.htm') != -1) {
if (document.getElementById('fauxpasreally01').value == '') {
document.getElementById('fauxpasreally01').value+=snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
hfnd=true;
} else {
document.getElementById('fauxpasreally01').value+=' , ' + snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
hfnd=true;
}
} else if (!wfnd) {
if (document.getElementById('fauxpas01').value == '') {
document.getElementById('fauxpas01').value+=snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
wfnd=true;
} else {
document.getElementById('fauxpas01').value+=' , ' + snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
wfnd=true;
}
} else if (!hfnd && document.URL.indexOf('/song_lyric_faux_pas.htm') == -1) {
if (document.getElementById('fauxpasreally01').value == '') {
document.getElementById('fauxpasreally01').value+=snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
hfnd=true;
} else {
document.getElementById('fauxpasreally01').value+=' , ' + snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
hfnd=true;
}
} else if (!tfnd) {
document.getElementById('songname01').value+=snapshotrecs[wwpart].trim();
snapshotrecs[wwpart]='';
tfnd=true;
}
}
}
}

}

}
xinlist='';
}

… within the changed external Javascript subrip_helper.js helping out, so far, either/or Song Lyric Faux Pas or Video Commentary YouTube API based “SubRip … just cooling off … man … damn … whatevvvvveeeerrrrr” peers.


Previous relevant Synonymous With Delimitation Primer Tutorial is shown below.

Synonymous With Delimitation Primer Tutorial

Synonymous With Delimitation Primer Tutorial

We make inhouse rules regarding our Apache/PHP HTML web applications around here, at RJM Programming, quite often with the focus on …

delimitation

… rules and our favourite delimitation character is probably the comma ( ie. , ) when it comes to data. Think “comma separated values” data, that can go on to be a spreadsheet … that sort of thinking.

The work of the recent YouTube API Caller Radio Play Playlist Songname Search List Repeats Tutorial regarding web browser address bar comma related typing of that type of data has set us to thinking …

Can we extend this thinking?

Can we make synonymous some web applications with a delimitation rule so that around RJM Programming URLs that end up on the address bar, these having no arguments of their own, if appended to, that are (non-argumentative) words typed to match with a delimitation pattern our RJM Programming 404.shtml can detect and redirect appropriately?

And something made us remember it is not just “,” (synonymous with Tabular Single Row Media Gallery web application) that could be involved with the, so far just, “comma” based logics, it’s the ” , ” (ie. 2 spaces comma two spaces) rules of our inhouse Video Commentary (and/or if prefixed by ” , ” our inhouse Song Lyric Faux Pas) SubRip subtitles YouTube API facing web application(s) (last talked about with YouTube SubRip Subtitles Emoji Tutorial) that can enter the mix here too.

And because there are two delimitation rules (both comma based ones) so far here, we start today, not only …

  • setting up a Tabular Single Row Media Gallery web application based bracket (ie. relevant strings have to start with { or [ or { and end with } or ] or } respectively) hosting system for it’s new playlist defining keyboard logic capabilities …

    function onkd(e) {
    var charx = e.which || e.keyCode;
    if (String.fromCharCode(eval('' + charx)) >= '1' && String.fromCharCode(eval('' + charx)) <= '8' && okdsofar == '') {
    endmatch='';
    document.getElementById('fplaythft').style.border='3px dotted green';
    document.getElementById('fplaythft').title+=' ... fired up ' + firedup[eval('' + String.fromCharCode(eval('' + charx)))].replace(/^Yacht\ /g,'Yacht++ ');
    maybeinplayscenario=maybeso(true);
    genreideas(String.fromCharCode(eval('' + charx)));
    maybeinplayscenario=false;
    } else if (String.fromCharCode(eval('' + charx)) == ',' && okdsofar == '') {
    okdsofar+=String.fromCharCode(eval('' + charx));
    endmatch='';
    } else if (String.fromCharCode(eval('' + charx)) == '~' && okdsofar == '') {
    okdsofar+=',';
    endmatch='';
    } else if (String.fromCharCode(eval('' + charx)) == '`' && okdsofar == '') {
    okdsofar+=',';
    endmatch='';
    } else if (String.fromCharCode(eval('' + charx)) == '(' && okdsofar == '') {
    endmatch=')';
    okdsofar+=',';
    } else if (String.fromCharCode(eval('' + charx)) == '[' && okdsofar == '') {
    okdsofar+=',';
    endmatch=']';
    } else if (String.fromCharCode(eval('' + charx)) == '{' && okdsofar == '') {
    okdsofar+=',';
    endmatch='}';
    } else if (String.fromCharCode(eval('' + charx)) < '1' || String.fromCharCode(eval('' + charx)) > '8' || okdsofar != '') {
    okdsofar+=String.fromCharCode(eval('' + charx));
    if (okdsofar.substring(0,1) == ',') {
    if ((endmatch == '' && (okdsofar.slice(-1) == '~' || okdsofar.slice(-1) == '`')) || okdsofar.slice(-1) == endmatch) {
    adbarpl=okdsofar.replace(/^\,/g,'').replace(/\~$/g,'').replace(/\`$/g,'').replace(/\}$/g,'').replace(/\]$/g,'').replace(/\)$/g,'');
    andgo=(adbarpl.toLowerCase().indexOf('notgo') != -1 ? false : true);
    okdsofar='';
    endmatch='';
    //alert('andgo=' + andgo);
    createplaylist(null);
    return true;
    }
    } else {
    endmatch='';
    if (okdsofar.trim() != '' && okdsofar.trim() != okdsofar && okdsofar.toLowerCase() != 'solo ') {
    maybeinplayscenario=maybeso(true);
    genreideas(okdsofar.replace(/^Mr\ /g,'Washington ').replace(/^MR\ /g,'Washington ').replace(/^mr\ /g,'Washington ').replace(/^The\ /g,'wrecking ').replace(/^THE\ /g,'wrecking ').replace(/^the\ /g,'wrecking ').trim());
    maybeinplayscenario=false;
    okdsofar='';
    }
    }
    }
    setTimeout(function(){ document.getElementById('thev').innerHTML='V'; }, 20000);
    return true;
    }

    … of the changed swipe_media.html Tabular Single Row Media Gallery web application … but also …
  • it will redirect if it finds ” , ” related entries

    function overprompt(blb, defvl) {
    var tdsare=[], itdone=false, baeis='', itds=0, lastpassesmustard=true;
    var oklast=['A','E','I','M','Q','U','Y','c','g','k','o','s','w','0','4','8'];
    var ivb=0;
    if (adbarpl != '') {
    outplist=adbarpl;
    adbarpl='';
    } else {
    outplist=prompt(blb, defvl);
    }
    if (outplist != null) {
    if (outplist.indexOf(' , ') == 0 && outplist.replace(/^\ \ \,\ \ /g,'').indexOf(' , ') != -1) {
    window.open('//www.rjmprogramming.com.au/HTMLCSS/song_lyric_faux_pas.html?inlist=' + encodeURIComponent(outplist.replace(/^\ \ \,\ \ /g,''),'_blank','top=55,left=55,height=600,width=600');
    outplist='';
    return '';
    } else if (outplist.indexOf(' , ') != -1) {
    window.open('//www.rjmprogramming.com.au/HTMLCSS/video_commentary.html?inlist=' + encodeURIComponent(outplist.replace(/^\ \ \,\ \ /g,''),'_blank','top=55,left=55,height=600,width=600');
    outplist='';
    return '';
    }
    }

    // rest of overprompt(blb, defvl) logic follows
    }

    … and with all this …
  • regarding the RJM Programming 404.shtml …
    1. it redirects for this too … and …
    2. it now works it that an RJM Programming URL, not a WordPress one (where a 404.php paradigm handles it’s error 404s), and not one with ? arguments can be scrutinized for these “Synonymous With Delimitation” web application redirecting ideas …

      if (document.URL.indexOf('rjmprogramming.com.au/HTMLCSS/swipe_media.htm') != -1) { // comma related ideas
      if (decodeURIComponent(document.URL).indexOf(' , ') != -1) {
      // Feed it to SubRip subtitles
      if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).indexOf(' , ') == 0) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/song_lyric_faux_pas.html?inlist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).replace(/^\ \ \,\ \ /g,'').replace(/^\%20\%20\%2C\%20\%20/g,''));
      } else {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/video_commentary.html?inlist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
      }
      exit;
      } else if (decodeURIComponent(document.URL).indexOf(',') != -1) {
      if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).toLowerCase().indexOf('notgo') != -1) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?thelist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace('notgo','').replace('NOTGO','').replace('Notgo','')));
      } else {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?andgo=y&thelist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
      exit;
      }
      } else if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).toLowerCase().indexOf('ask') != -1) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?ask=y';
      exit;
      }
      } else if (document.URL.replace('.au ','.au/').replace('.au%20','.au/').indexOf('rjmprogramming.com.au/') != -1) {
      var anybitstoignore='youll_never_ever_find_this';
      if (document.URL.replace('.au ','.au/').replace('.au%20','.au/').substring(0,1).replace('+','%') == '%') {
      anybitstoignore='youll_never_ever_find_this';
      } else if (document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().replace('/','~').replace('.htm','~').replace('.php','~').indexOf('~') != -1) {
      var maxfind=Math.max(eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('.htm')),eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('.php')), eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('/')));
      if (maxfind != eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('/'))) {
      if (maxfind == eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('.php'))) {
      maxfind+=4;
      } else if (maxfind == eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('.html'))) {
      maxfind+=5;
      } else {
      maxfind+=4;
      }
      } else {
      while (decodeURIComponent(document.URL.replace(anybitstoignore,'').split('rjmprogramming.com.au/')[1].substring(maxfind)).indexOf('/') != -1) {
      maxfind++;
      }
      }
      anybitstoignore=document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].substring(0,maxfind);
      }
      if (decodeURIComponent(document.URL.replace(anybitstoignore,'')).indexOf(' , ') != -1) {
      // Feed it to SubRip subtitles
      if (decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'')).indexOf(' , ') == 0) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/song_lyric_faux_pas.html?inlist=' + encodeURIComponent(decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'')).replace(/^\ \ \,\ \ /g,'').replace(/^\%20\%20\%2C\%20\%20/g,''));
      } else {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/video_commentary.html?inlist=' + encodeURIComponent(decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
      }
      exit;
      } else if (decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/')).indexOf(',') != -1) {
      if (decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'')).toLowerCase().indexOf('notgo') != -1) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?thelist=' + encodeURIComponent(decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace('notgo','').replace('NOTGO','').replace('Notgo','')));
      } else {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?andgo=y&thelist=' + encodeURIComponent(decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
      exit;
      }
      } else if (decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'')).toLowerCase().indexOf('ask') != -1) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?ask=y';
      exit;
      }
      }

See what we mean, in the table below …

Redirects to YouTube API Radio Play suiting (web browser address bar containing) Born to Run*4,Jungleland*3
YouTube API Radio Play of Born to Run*4,Jungleland*3
Redirects to YouTube API Video Commentary suiting (web browser address bar containing) Born to Run*4 , Jungleland*3 … just calling … so far …
Video Commentary of Born of Run*4 , Jungleland*3
Redirects to YouTube API Song Lyric Faux Pas suiting (web browser address bar containing) , Born to Run*4 , Jungleland*3 … just calling … so far …
Song Lyric Faux Pas of , Born to Run*4 , Jungleland*3

Still to go, to go further, is to code within the SubRips for understanding a potential new incoming argument …


?inlist=[encoded " , " based data]

… based input, but that is for another day!

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


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

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

Synonymous With Delimitation Primer Tutorial

Synonymous With Delimitation Primer Tutorial

Synonymous With Delimitation Primer Tutorial

We make inhouse rules regarding our Apache/PHP HTML web applications around here, at RJM Programming, quite often with the focus on …

delimitation

… rules and our favourite delimitation character is probably the comma ( ie. , ) when it comes to data. Think “comma separated values” data, that can go on to be a spreadsheet … that sort of thinking.

The work of the recent YouTube API Caller Radio Play Playlist Songname Search List Repeats Tutorial regarding web browser address bar comma related typing of that type of data has set us to thinking …

Can we extend this thinking?

Can we make synonymous some web applications with a delimitation rule so that around RJM Programming URLs that end up on the address bar, these having no arguments of their own, if appended to, that are (non-argumentative) words typed to match with a delimitation pattern our RJM Programming 404.shtml can detect and redirect appropriately?

And something made us remember it is not just “,” (synonymous with Tabular Single Row Media Gallery web application) that could be involved with the, so far just, “comma” based logics, it’s the ” , ” (ie. 2 spaces comma two spaces) rules of our inhouse Video Commentary (and/or if prefixed by ” , ” our inhouse Song Lyric Faux Pas) SubRip subtitles YouTube API facing web application(s) (last talked about with YouTube SubRip Subtitles Emoji Tutorial) that can enter the mix here too.

And because there are two delimitation rules (both comma based ones) so far here, we start today, not only …

  • setting up a Tabular Single Row Media Gallery web application based bracket (ie. relevant strings have to start with { or [ or { and end with } or ] or } respectively) hosting system for it’s new playlist defining keyboard logic capabilities …

    function onkd(e) {
    var charx = e.which || e.keyCode;
    if (String.fromCharCode(eval('' + charx)) >= '1' && String.fromCharCode(eval('' + charx)) <= '8' && okdsofar == '') {
    endmatch='';
    document.getElementById('fplaythft').style.border='3px dotted green';
    document.getElementById('fplaythft').title+=' ... fired up ' + firedup[eval('' + String.fromCharCode(eval('' + charx)))].replace(/^Yacht\ /g,'Yacht++ ');
    maybeinplayscenario=maybeso(true);
    genreideas(String.fromCharCode(eval('' + charx)));
    maybeinplayscenario=false;
    } else if (String.fromCharCode(eval('' + charx)) == ',' && okdsofar == '') {
    okdsofar+=String.fromCharCode(eval('' + charx));
    endmatch='';
    } else if (String.fromCharCode(eval('' + charx)) == '~' && okdsofar == '') {
    okdsofar+=',';
    endmatch='';
    } else if (String.fromCharCode(eval('' + charx)) == '`' && okdsofar == '') {
    okdsofar+=',';
    endmatch='';
    } else if (String.fromCharCode(eval('' + charx)) == '(' && okdsofar == '') {
    endmatch=')';
    okdsofar+=',';
    } else if (String.fromCharCode(eval('' + charx)) == '[' && okdsofar == '') {
    okdsofar+=',';
    endmatch=']';
    } else if (String.fromCharCode(eval('' + charx)) == '{' && okdsofar == '') {
    okdsofar+=',';
    endmatch='}';
    } else if (String.fromCharCode(eval('' + charx)) < '1' || String.fromCharCode(eval('' + charx)) > '8' || okdsofar != '') {
    okdsofar+=String.fromCharCode(eval('' + charx));
    if (okdsofar.substring(0,1) == ',') {
    if ((endmatch == '' && (okdsofar.slice(-1) == '~' || okdsofar.slice(-1) == '`')) || okdsofar.slice(-1) == endmatch) {
    adbarpl=okdsofar.replace(/^\,/g,'').replace(/\~$/g,'').replace(/\`$/g,'').replace(/\}$/g,'').replace(/\]$/g,'').replace(/\)$/g,'');
    andgo=(adbarpl.toLowerCase().indexOf('notgo') != -1 ? false : true);
    okdsofar='';
    endmatch='';
    //alert('andgo=' + andgo);
    createplaylist(null);
    return true;
    }
    } else {
    endmatch='';
    if (okdsofar.trim() != '' && okdsofar.trim() != okdsofar && okdsofar.toLowerCase() != 'solo ') {
    maybeinplayscenario=maybeso(true);
    genreideas(okdsofar.replace(/^Mr\ /g,'Washington ').replace(/^MR\ /g,'Washington ').replace(/^mr\ /g,'Washington ').replace(/^The\ /g,'wrecking ').replace(/^THE\ /g,'wrecking ').replace(/^the\ /g,'wrecking ').trim());
    maybeinplayscenario=false;
    okdsofar='';
    }
    }
    }
    setTimeout(function(){ document.getElementById('thev').innerHTML='V'; }, 20000);
    return true;
    }

    … of the changed swipe_media.html Tabular Single Row Media Gallery web application … but also …
  • it will redirect if it finds ” , ” related entries

    function overprompt(blb, defvl) {
    var tdsare=[], itdone=false, baeis='', itds=0, lastpassesmustard=true;
    var oklast=['A','E','I','M','Q','U','Y','c','g','k','o','s','w','0','4','8'];
    var ivb=0;
    if (adbarpl != '') {
    outplist=adbarpl;
    adbarpl='';
    } else {
    outplist=prompt(blb, defvl);
    }
    if (outplist != null) {
    if (outplist.indexOf(' , ') == 0 && outplist.replace(/^\ \ \,\ \ /g,'').indexOf(' , ') != -1) {
    window.open('//www.rjmprogramming.com.au/HTMLCSS/song_lyric_faux_pas.html?inlist=' + encodeURIComponent(outplist.replace(/^\ \ \,\ \ /g,''),'_blank','top=55,left=55,height=600,width=600');
    outplist='';
    return '';
    } else if (outplist.indexOf(' , ') != -1) {
    window.open('//www.rjmprogramming.com.au/HTMLCSS/video_commentary.html?inlist=' + encodeURIComponent(outplist.replace(/^\ \ \,\ \ /g,''),'_blank','top=55,left=55,height=600,width=600');
    outplist='';
    return '';
    }
    }

    // rest of overprompt(blb, defvl) logic follows
    }

    … and with all this …
  • regarding the RJM Programming 404.shtml …
    1. it redirects for this too … and …
    2. it now works it that an RJM Programming URL, not a WordPress one (where a 404.php paradigm handles it’s error 404s), and not one with ? arguments can be scrutinized for these “Synonymous With Delimitation” web application redirecting ideas …

      if (document.URL.indexOf('rjmprogramming.com.au/HTMLCSS/swipe_media.htm') != -1) { // comma related ideas
      if (decodeURIComponent(document.URL).indexOf(' , ') != -1) {
      // Feed it to SubRip subtitles
      if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).indexOf(' , ') == 0) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/song_lyric_faux_pas.html?inlist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).replace(/^\ \ \,\ \ /g,'').replace(/^\%20\%20\%2C\%20\%20/g,''));
      } else {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/video_commentary.html?inlist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
      }
      exit;
      } else if (decodeURIComponent(document.URL).indexOf(',') != -1) {
      if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).toLowerCase().indexOf('notgo') != -1) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?thelist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace('notgo','').replace('NOTGO','').replace('Notgo','')));
      } else {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?andgo=y&thelist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
      exit;
      }
      } else if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).toLowerCase().indexOf('ask') != -1) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?ask=y';
      exit;
      }
      } else if (document.URL.replace('.au ','.au/').replace('.au%20','.au/').indexOf('rjmprogramming.com.au/') != -1) {
      var anybitstoignore='youll_never_ever_find_this';
      if (document.URL.replace('.au ','.au/').replace('.au%20','.au/').substring(0,1).replace('+','%') == '%') {
      anybitstoignore='youll_never_ever_find_this';
      } else if (document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().replace('/','~').replace('.htm','~').replace('.php','~').indexOf('~') != -1) {
      var maxfind=Math.max(eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('.htm')),eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('.php')), eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('/')));
      if (maxfind != eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('/'))) {
      if (maxfind == eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('.php'))) {
      maxfind+=4;
      } else if (maxfind == eval('' + document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].split('%')[0].toLowerCase().indexOf('.html'))) {
      maxfind+=5;
      } else {
      maxfind+=4;
      }
      } else {
      while (decodeURIComponent(document.URL.replace(anybitstoignore,'').split('rjmprogramming.com.au/')[1].substring(maxfind)).indexOf('/') != -1) {
      maxfind++;
      }
      }
      anybitstoignore=document.URL.replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].substring(0,maxfind);
      }
      if (decodeURIComponent(document.URL.replace(anybitstoignore,'')).indexOf(' , ') != -1) {
      // Feed it to SubRip subtitles
      if (decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'')).indexOf(' , ') == 0) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/song_lyric_faux_pas.html?inlist=' + encodeURIComponent(decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'')).replace(/^\ \ \,\ \ /g,'').replace(/^\%20\%20\%2C\%20\%20/g,''));
      } else {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/video_commentary.html?inlist=' + encodeURIComponent(decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
      }
      exit;
      } else if (decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/')).indexOf(',') != -1) {
      if (decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'')).toLowerCase().indexOf('notgo') != -1) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?thelist=' + encodeURIComponent(decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace('notgo','').replace('NOTGO','').replace('Notgo','')));
      } else {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?andgo=y&thelist=' + encodeURIComponent(decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
      exit;
      }
      } else if (decodeURIComponent(document.URL.replace(anybitstoignore,'').replace('.au ','.au/').replace('.au%20','.au/').split('rjmprogramming.com.au/')[1].replace(/^index\.php/g,'').replace(/^index\.html/g,'').replace(/^index\.htm/g,'')).toLowerCase().indexOf('ask') != -1) {
      location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?ask=y';
      exit;
      }
      }

See what we mean, in the table below …

Redirects to YouTube API Radio Play suiting (web browser address bar containing) Born to Run*4,Jungleland*3
YouTube API Radio Play of Born to Run*4,Jungleland*3
Redirects to YouTube API Video Commentary suiting (web browser address bar containing) Born to Run*4 , Jungleland*3 … just calling … so far …
Video Commentary of Born of Run*4 , Jungleland*3
Redirects to YouTube API Song Lyric Faux Pas suiting (web browser address bar containing) , Born to Run*4 , Jungleland*3 … just calling … so far …
Song Lyric Faux Pas of , Born to Run*4 , Jungleland*3

Still to go, to go further, is to code within the SubRips for understanding a potential new incoming argument …


?inlist=[encoded " , " based data]

… based input, but that is for another day!

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

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

YouTube API Caller Radio Play Playlist Songname Search List Repeats Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Repeats Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Repeats Tutorial

Burp …

Sorry to open with a quote, and sorry to repeat myself, like.

And sorry to repeat myself, like, again.

But there is a point. Today represents an improvement on yesterday’s arrangements for dynamic playlist creation regarding our Tabular Single Row Media Gallery web application via the playlist emoji button 🔀 click/tap or on the web browser command line. With yesterday’s scenario, had you entered as your internal playlist comma separated string …

Born to Run,Born to Run,Born to Run,Born to Run

… without the …

Burp …

that is you’d have ended up with the top find off a YouTube search repeated 4 times. Is this ideal? We asked Nala and Luna but, unfortunately they were busy, so they left me with the decision, and we came up with …

That’s kind of silly.

For these few reasons …

  • variety
  • album style Radio Play listening possibilities
  • perhaps getting around that …

    This video requires payment to watch YouTube

    … issue we talked about before … because you could uncheck it’s checkbox if the error appears

  • giving non-top search items a go

… we decided to “mix it up” regarding entries like …

Born to Run,Born to Run,Born to Run,Born to Run

… as well as the simpler …

Born to Run*4

… so that repeats don’t cause users indigestion … chortle, chortle.

Here’s the Javascript turning Born to Run*4 into Born to Run,Born to Run,Born to Run,Born to Run


function expandrepeats(ocsl) {
var numnum=0, minone=-1, interesting='', ninteresting='', pinteresting='', superinteresting='', imn=1;
var retocsl=ocsl;
var acarr=ocsl.split(',');
for (var iac=0; iac<acarr.length; iac++) {
numnum=0;
minone=-1;
if (acarr[iac].trim() != '') {
if (acarr[iac].trim().slice(-1) >= '0' && acarr[iac].trim().slice(-1) <= '9') {
while (('S' + acarr[iac].trim()).slice(minone).substring(0,1) >= '0' && ('S' + acarr[iac].trim()).slice(minone).substring(0,1) <= '9') {
numnum++;
minone--;
}
}
if (numnum > 0 && numnum < eval('' + acarr[iac].trim().length)) {
ninteresting=acarr[iac].trim().slice(-numnum);
interesting=acarr[iac].trim().substring(0, eval(-numnum + eval('' + acarr[iac].trim().length)));
superinteresting='';
pinteresting='';
if (interesting.toLowerCase() != interesting.toLowerCase().replace(/\ x\ $/g,'')) {
pinteresting=interesting.slice(-3) + ninteresting;
superinteresting=interesting.replace(/\ x\ $/g,'').replace(/\ X\ $/g,'');
} else if (interesting.toLowerCase() != interesting.toLowerCase().replace(/x\ $/g,'')) {
pinteresting=interesting.slice(-2) + ninteresting;
superinteresting=interesting.replace(/x\ $/g,'').replace(/X\ $/g,'');
} else if (interesting.toLowerCase() != interesting.toLowerCase().replace(/\ x$/g,'')) {
pinteresting=interesting.slice(-2) + ninteresting;
superinteresting=interesting.replace(/\ x$/g,'').replace(/\ X$/g,'');
} else if (interesting.toLowerCase() != interesting.toLowerCase().replace(/x$/g,'')) {
pinteresting=interesting.slice(-1) + ninteresting;
superinteresting=interesting.replace(/x$/g,'').replace(/X$/g,'');
} else if (interesting.toLowerCase() != interesting.toLowerCase().replace(/\ \*\ $/g,'')) {
pinteresting=interesting.slice(-3) + ninteresting;
superinteresting=interesting.replace(/\ \*\ $/g,'');
} else if (interesting.toLowerCase() != interesting.toLowerCase().replace(/\*\ $/g,'')) {
pinteresting=interesting.slice(-2) + ninteresting;
superinteresting=interesting.replace(/\*\ $/g,'');
} else if (interesting.toLowerCase() != interesting.toLowerCase().replace(/\ \*$/g,'')) {
pinteresting=interesting.slice(-2) + ninteresting;
superinteresting=interesting.replace(/\ \*$/g,'');
} else if (interesting.toLowerCase() != interesting.toLowerCase().replace(/\*$/g,'')) {
pinteresting=interesting.slice(-1) + ninteresting;
superinteresting=interesting.replace(/\*$/g,'');
}
if (superinteresting != '' && eval('' + ninteresting) >= 1) {
for (imn=1; imn<=eval('' + ninteresting); imn++) {
if (imn == 1) {
retocsl=retocsl.replace(pinteresting, '');
acarr[iac]=acarr[iac].replace(pinteresting, '');
} else {
retocsl=retocsl.replace(acarr[iac], acarr[iac] + ',' + superinteresting.trim());
}
}
}
}
}
}
if (retocsl != ocsl) { outplist=retocsl; }
return retocsl;
}

… in the changed swipe_media.html Tabular Single Row Media Gallery web application you can try for yourself (or try some more of The Boss), further to yesterday’s YouTube API Caller Radio Play Playlist Songname Search List Address Bar Tutorial.


Previous relevant YouTube API Caller Radio Play Playlist Songname Search List Address Bar Tutorial is shown below.

YouTube API Caller Radio Play Playlist Songname Search List Address Bar Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Address Bar Tutorial

Don’t know if you are like me, but especially when on this MacBook Air we’re, forever, using a web browser address bar to type in, what we’ve set up as, a Google search engine webpage query. Rather than even going to Google webpage first, that is!

Most people don’t want to know about arcane web application argument arrangements … though we’re very fond of the 5 minute ones?!

What’s wrong with some of you? Who would not relish the thought of …

  • adding onto the address bar …

    https://www.rjmprogramming.com.au/HTMLCSS/swipe_media.html

    … with new arguments( eg. https://www.rjmprogramming.com.au/HTMLCSS/swipe_media.html Born to Run,Jungleland ) …
  • ?ask=y # will get you straight to the Javascript playlist prompt window
  • &or?thelist=[commaSeparatedList_encodeURIComponent_ized] # will supply that prompt window with the answer [commaSeparatedList_decodeURIComponent_ized]
  • &or?andgo=y # will click the Radio button after all above (unless notgo is mentioned in the list somewhere), as relevant, with the programmatically determined derived YouTube ID list via YouTube search(es)
  • 💬🦆 Come On!
  • … when, after a bit of thought and tweaks to our RJM Programming domain’s Apache Document Root residing 404.shtml webpage Javascript …

    if (document.URL.indexOf('rjmprogramming.com.au/HTMLCSS/swipe_media.htm') != -1) {
    if (decodeURIComponent(document.URL).indexOf(',') != -1) {
    if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).toLowerCase().indexOf('notgo') != -1) {
    location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?thelist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace('notgo','').replace('NOTGO','').replace('Notgo','')));
    } else {
    location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?andgo=y&thelist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
    exit;
    }
    } else if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).toLowerCase().indexOf('ask') != -1) {
    location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?ask=y';
    exit;
    }
    }

    … now all you need to add after that link above, on the web browser address bar is …

    [commaSeparatedList_decodeURIComponent_ized]

    … ie. just type a comma separated YouTube song search basis link after the link wording above
  • so 💬🦆 Come On down ye doubting Thomases!

And so, further to yesterday’s YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial we have a changed swipe_media.html Tabular Single Row Media Gallery web application you can try for yourself.

Stop Press

On reflection, as well as …

https://www.rjmprogramming.com.au/HTMLCSS/swipe_media.html Born to Run,Jungleland working up at the address bar, so, too, will https://www.rjmprogramming.com.au/ Born to Run,Jungleland


Previous relevant YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial is shown below.

YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial

Around here, regarding web application work, we really like dropdown (ie. HTML select element) work because a lot of information can be …

  • stored
  • displayed (often taking up minimal webpage space)
  • it’s option subelements can have an event life of their own, or be part of the select element event whole picture
  • dropdown multiple selection mode (as with today’s work) can …
    1. still support your single choice scenario
    2. we’ve coded today’s dropdown to support, as applicable, ordered single click choices … versus …
    3. can allow for control key (sets of choices not necessarily adjacent) and shift key (blocks of choices)
    4. can respond (as with today’s dropdown) to preset selections established at creation via dropdown (ie. select) innerHTML option subelement selected attribute setting
  • dropdown events onmousedown and ontouchdown (as for today’s dropdown) and onclick can be harnessed ahead of an onchange event … and in today’s case can help unset any preset option subelement selected attribute setting(s)

Just so flexible! Subelement option CSS styling can be less friendly, but even so, often background colouring is possible, and we do a bit of that with the work from yesterday’s YouTube API Caller Radio Play Playlist Songname Search List Tutorial and today’s better “shored up” work you can see a bit of below (where your starting point might be that we “wrap” this particular Javascript prompt window through the Javascript overprompt function below) …


var outplist='', kaconto=null, kacontoarr=[], rconeis=155, gconeis=255, bconeis=255;

function overprompt(blb, defvl) {
var tdsare=[], itdone=false, itds=0, baeis='', ivb=0, lastpassesmustard=true;
var oklast=['A','E','I','M','Q','U','Y','c','g','k','o','s','w','0','4','8'];
outplist=prompt(blb, defvl);
if (outplist) {
//alert(1);
var outparrs=outplist.trim().split(',');
//alert(11);
if (eval('' + outparrs.length) > 1) {
if (eval('' + outparrs[0].length) > 0) {
if (oklast.indexOf(outparrs[0].slice(-1)) == -1) { lastpassesmustard=false; }
}
if ((outparrs[0] + baeis).replace(/\ \ \ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20%20%20';
outparrs[0]=outparrs[0].replace(/\ \ \ $/g,'');
} else if ((outparrs[0] + baeis).replace(/\ \ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20%20';
outparrs[0]=outparrs[0].replace(/\ \ $/g,'');
} else if ((outparrs[0] + baeis).replace(/\ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20';
outparrs[0]=outparrs[0].replace(/\ $/g,'');
} else {
baeis='';
}
//alert(111);
if (eval('' + outparrs[0].length) != 11 || !lastpassesmustard || encodeURIComponent(outparrs[0]) != outparrs[0]) {
//alert(1111);
tdsare=document.getElementsByTagName('td');
for (itds=0; itds<tdsare.length; itds++) {
//alert(tdsare[itds].innerHTML);
if (!itdone && tdsare[itds].innerHTML == '' && ('' + tdsare[itds].id) != 'td0001') {
itdone=true;
//alert('here ' + outplist.trim().replace(/\,/g,'|!!|'));
//tdsare[itds].innerHTML='<iframe onload=karlook(this); style="width:100%;height:100%;" id=karsearch name=karsearch src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outplist.trim().replace(/\,/g,'|!!|')) + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
tdsare[itds].innerHTML='<iframe onload=karlook(this); style="width:100%;height:80%;" id=karsearch name=karsearch src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outparrs[0]) + baeis + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
tdsare[itds].scrollIntoView();
//alert('there ' + outplist.trim().replace(/\,/g,'|!!|'));
baeis='';
kacontoarr=[];
for (ivb=1; ivb<outparrs.length; ivb++) {
kacontoarr.push(null);
}
for (ivb=1; ivb<outparrs.length; ivb++) {
tdsare[eval(itds + ivb)].innerHTML='<iframe onload=karlookagain(this,' + eval(-1 + ivb) + '); style="width:100%;height:80%;visibility:hidden;" id=karsearch' + ivb + ' src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outparrs[ivb]) + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
}
return '';
}
}
}
}
}
return outplist;
}

function karlook(iois) {
var aconto=null;
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
if (outplist.indexOf(',') != -1) {
kaconto=aconto;
setTimeout(function(){ kaconto.getElementById('ajaxs').style.cursor='progress'; }, 3000);
setTimeout(postkarlook, 7000);
} else if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
kaconto=aconto;
setTimeout(mpostkarlook, 7000);
}
}
}
}

function karlookagain(iois,idxn) {
var aconto=null;
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
if (eval('' + kacontoarr.length) > eval('' + idxn)) {
kacontoarr[eval('' + idxn)]=aconto;
} else {
kacontoarr.push(aconto);
}
}
}
}

function mpostkarlook() {
if (kaconto.getElementById('ajaxs')) {
var kbuts=kaconto.getElementsByTagName('input');
for (var lbuts=0; lbuts<kbuts.length; lbuts++) {
if (('' + kbuts[lbuts].type) == 'button') {
if (('' + kbuts[lbuts].value).indexOf('Radio') == 0) {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', String.fromCharCode(10) + 'Radio');
}
}
}
} else {
setTimeout(mpostkarlook, 5000);
}
}

function postkarlook() {
var selectedones='', oktogo=true, hihi=0;
if (kaconto.getElementById('ajaxs')) {
//alert(kaconto.getElementById('ajaxs').innerHTML);
for (hihi=0; hihi<kacontoarr.length; hihi++) {
if (!kacontoarr[hihi]) {
oktogo=false;
//alert('hihi=' + hihi + ' NOT okay');
} else if (!kacontoarr[hihi].getElementById('ajaxs')) {
oktogo=false;
//alert('hihi=' + hihi + ' not okay');
}
}
if (!oktogo) {
setTimeout(postkarlook, 5000);
} else if (kaconto.getElementById('ajaxs').innerHTML.indexOf('... and then ...') == -1) {
kaconto.getElementById('ajaxs').style.cursor='pointer';
var otherps=baeisf();
if (otherps != '' || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var kbuts=kaconto.getElementsByTagName('input');
for (var lbuts=0; lbuts<kbuts.length; lbuts++) {
if (('' + kbuts[lbuts].type) == 'button') {
if (('' + kbuts[lbuts].value).indexOf('Radio') == 0) {
var wasvl=kbuts[lbuts].value;
if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Ordered ' + String.fromCharCode(10) + 'Audio ' + String.fromCharCode(10) + 'Radio');
} else if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Audio ' + String.fromCharCode(10) + 'Radio');
} else if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Ordered ' + String.fromCharCode(10) + 'Radio');
} else {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', String.fromCharCode(10) + 'Radio');
}
}
}
}
}
selectedones=(kaconto.getElementById('ajaxs').innerHTML.split(kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].split('</option>')[0] + '</option>').replace('>', ' class=uptop selected>');
for (hihi=0; hihi<kacontoarr.length; hihi++) {
if (rconeis == gconeis && rconeis == bconeis) {
bconeis-=7;
if (bconeis < 0) { bconeis+=255; }
} else if (rconeis == gconeis) {
gconeis-=7;
if (gconeis < 0) { gconeis+=255; }
} else {
rconeis-=7;
if (rconeis < 0) { rconeis+=255; }
}
selectedones+=((kacontoarr[hihi].getElementById('ajaxs').innerHTML.split(kacontoarr[hihi].getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].split('</option>')[0] + '</option>').replace('>', ' class=uptop selected>')).replace(/option\ onclick\=/g, 'option style=background-color:rgb(' + rconeis + ',' + gconeis + ',' + bconeis + '); onclick=');
kaconto.getElementById('ajaxs').innerHTML+='<option value="">... and then ...</option>';
kaconto.getElementById('ajaxs').innerHTML+=kacontoarr[hihi].getElementById('ajaxs').innerHTML.split(kacontoarr[hihi].getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].replace(/option\ onclick\=/g, 'option style=background-color:rgb(' + rconeis + ',' + gconeis + ',' + bconeis + '); onclick=');
//alert(kacontoarr[hihi].getElementById('ajaxs').innerHTML);
}
//alert(selectedones);
kaconto.getElementById('ajaxs').innerHTML=kaconto.getElementById('ajaxs').innerHTML.replace(kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>', kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>' + selectedones + (selectedones != '' ? '<option id=optclk value="">____ Selection above available (resettable via click here) as you click/tap button at right ____</option>' : ''));
if (selectedones != '') {
kaconto.getElementById('ajaxs').onmousedown=function(event){ if (event.target.parentNode.outerHTML.split('>')[0].indexOf(' data-flagged=') == -1) { event.target.parentNode.setAttribute('data-flagged','y'); event.target.parentNode.innerHTML=event.target.parentNode.innerHTML.replace(/\ selected/g, ' ').replace('____ Selection above available (resettable via click here) as you click/tap button at right ____','____ Please select choices in usual multiple choice dropdown ways ____'); } };
kaconto.getElementById('ajaxs').ontouchdown=function(event){ if (event.target.parentNode.outerHTML.split('>')[0].indexOf(' data-flagged=') == -1) { event.target.parentNode.setAttribute('data-flagged','y'); event.target.parentNode.innerHTML=event.target.parentNode.innerHTML.replace(/\ selected/g, ' ').replace('____ Selection above available (resettable via click here) as you click/tap button at right ____','____ Please select choices in usual multiple choice dropdown ways ____'); } };
}
}
}
}

function baeisf() {
var outarrp=outplist.split(',');
if (eval('' + outarrp.length) > 1) {
return outarrp[0].replace(outarrp[0].trim(), '');
}
return '';
}

And so, today …

  • we add onto the default random ordering mode of Radio Play via YouTube search comma separated list, the further choices ordered or audio or audio ordered, as per the relevant Javascript prompt blurb that is now going …

    Enter YouTube 11 character code video (comma separated) or audio stream only of video (semicolon) list to Radio Play (and add ! to start in shuffle mode and/or # for the order you enter and/or & for whole list) … or a YouTube Search String basis for playlist via a Radio📻? button to activate, later. Comma separateds can be search ideas … egs. Tragedy,Boogie Wonderland,Down Among the Dead Men … random … Tragedy ,Imagine,Breezin … ordered … Tragedy  ,Pina Colada Song,Fast Car … audio … Tragedy   ,Galveston,Angel of the Morning … audio ordered. Double click on this cell for playlist redefinitions.

  • started allowing for dropdown events onmousedown and ontouchdown be able to reset the preset choices we programmatically select for the user should they be happy (but our motivation for this event work was the potential to run into a YouTube video that gives the error …

    This video requires payment to watch YouTube

    )

Codewise, this involved …

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

YouTube API Caller Radio Play Playlist Songname Search List Address Bar Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Address Bar Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Address Bar Tutorial

Don’t know if you are like me, but especially when on this MacBook Air we’re, forever, using a web browser address bar to type in, what we’ve set up as, a Google search engine webpage query. Rather than even going to Google webpage first, that is!

Most people don’t want to know about arcane web application argument arrangements … though we’re very fond of the 5 minute ones?!

What’s wrong with some of you? Who would not relish the thought of …

  • adding onto the address bar …

    https://www.rjmprogramming.com.au/HTMLCSS/swipe_media.html

    … with new arguments( eg. https://www.rjmprogramming.com.au/HTMLCSS/swipe_media.html Born to Run,Jungleland ) …
  • ?ask=y # will get you straight to the Javascript playlist prompt window
  • &or?thelist=[commaSeparatedList_encodeURIComponent_ized] # will supply that prompt window with the answer [commaSeparatedList_decodeURIComponent_ized]
  • &or?andgo=y # will click the Radio button after all above (unless notgo is mentioned in the list somewhere), as relevant, with the programmatically determined derived YouTube ID list via YouTube search(es)
  • 💬🦆 Come On!
  • … when, after a bit of thought and tweaks to our RJM Programming domain’s Apache Document Root residing 404.shtml webpage Javascript …

    if (document.URL.indexOf('rjmprogramming.com.au/HTMLCSS/swipe_media.htm') != -1) {
    if (decodeURIComponent(document.URL).indexOf(',') != -1) {
    if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).toLowerCase().indexOf('notgo') != -1) {
    location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?thelist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace('notgo','').replace('NOTGO','').replace('Notgo','')));
    } else {
    location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?andgo=y&thelist=' + encodeURIComponent(decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'').replace(/^\%20/g,'')));
    exit;
    }
    } else if (decodeURIComponent(document.URL.split('rjmprogramming.com.au/HTMLCSS/swipe_media.htm')[1].replace(/^l/g,'')).toLowerCase().indexOf('ask') != -1) {
    location.href='//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?ask=y';
    exit;
    }
    }

    … now all you need to add after that link above, on the web browser address bar is …

    [commaSeparatedList_decodeURIComponent_ized]

    … ie. just type a comma separated YouTube song search basis link after the link wording above
  • so 💬🦆 Come On down ye doubting Thomases!

And so, further to yesterday’s YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial we have a changed swipe_media.html Tabular Single Row Media Gallery web application you can try for yourself.

Stop Press

On reflection, as well as …

https://www.rjmprogramming.com.au/HTMLCSS/swipe_media.html Born to Run,Jungleland working up at the address bar, so, too, will https://www.rjmprogramming.com.au/ Born to Run,Jungleland


Previous relevant YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial is shown below.

YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial

Around here, regarding web application work, we really like dropdown (ie. HTML select element) work because a lot of information can be …

  • stored
  • displayed (often taking up minimal webpage space)
  • it’s option subelements can have an event life of their own, or be part of the select element event whole picture
  • dropdown multiple selection mode (as with today’s work) can …
    1. still support your single choice scenario
    2. we’ve coded today’s dropdown to support, as applicable, ordered single click choices … versus …
    3. can allow for control key (sets of choices not necessarily adjacent) and shift key (blocks of choices)
    4. can respond (as with today’s dropdown) to preset selections established at creation via dropdown (ie. select) innerHTML option subelement selected attribute setting
  • dropdown events onmousedown and ontouchdown (as for today’s dropdown) and onclick can be harnessed ahead of an onchange event … and in today’s case can help unset any preset option subelement selected attribute setting(s)

Just so flexible! Subelement option CSS styling can be less friendly, but even so, often background colouring is possible, and we do a bit of that with the work from yesterday’s YouTube API Caller Radio Play Playlist Songname Search List Tutorial and today’s better “shored up” work you can see a bit of below (where your starting point might be that we “wrap” this particular Javascript prompt window through the Javascript overprompt function below) …


var outplist='', kaconto=null, kacontoarr=[], rconeis=155, gconeis=255, bconeis=255;

function overprompt(blb, defvl) {
var tdsare=[], itdone=false, itds=0, baeis='', ivb=0, lastpassesmustard=true;
var oklast=['A','E','I','M','Q','U','Y','c','g','k','o','s','w','0','4','8'];
outplist=prompt(blb, defvl);
if (outplist) {
//alert(1);
var outparrs=outplist.trim().split(',');
//alert(11);
if (eval('' + outparrs.length) > 1) {
if (eval('' + outparrs[0].length) > 0) {
if (oklast.indexOf(outparrs[0].slice(-1)) == -1) { lastpassesmustard=false; }
}
if ((outparrs[0] + baeis).replace(/\ \ \ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20%20%20';
outparrs[0]=outparrs[0].replace(/\ \ \ $/g,'');
} else if ((outparrs[0] + baeis).replace(/\ \ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20%20';
outparrs[0]=outparrs[0].replace(/\ \ $/g,'');
} else if ((outparrs[0] + baeis).replace(/\ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20';
outparrs[0]=outparrs[0].replace(/\ $/g,'');
} else {
baeis='';
}
//alert(111);
if (eval('' + outparrs[0].length) != 11 || !lastpassesmustard || encodeURIComponent(outparrs[0]) != outparrs[0]) {
//alert(1111);
tdsare=document.getElementsByTagName('td');
for (itds=0; itds<tdsare.length; itds++) {
//alert(tdsare[itds].innerHTML);
if (!itdone && tdsare[itds].innerHTML == '' && ('' + tdsare[itds].id) != 'td0001') {
itdone=true;
//alert('here ' + outplist.trim().replace(/\,/g,'|!!|'));
//tdsare[itds].innerHTML='<iframe onload=karlook(this); style="width:100%;height:100%;" id=karsearch name=karsearch src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outplist.trim().replace(/\,/g,'|!!|')) + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
tdsare[itds].innerHTML='<iframe onload=karlook(this); style="width:100%;height:80%;" id=karsearch name=karsearch src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outparrs[0]) + baeis + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
tdsare[itds].scrollIntoView();
//alert('there ' + outplist.trim().replace(/\,/g,'|!!|'));
baeis='';
kacontoarr=[];
for (ivb=1; ivb<outparrs.length; ivb++) {
kacontoarr.push(null);
}
for (ivb=1; ivb<outparrs.length; ivb++) {
tdsare[eval(itds + ivb)].innerHTML='<iframe onload=karlookagain(this,' + eval(-1 + ivb) + '); style="width:100%;height:80%;visibility:hidden;" id=karsearch' + ivb + ' src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outparrs[ivb]) + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
}
return '';
}
}
}
}
}
return outplist;
}

function karlook(iois) {
var aconto=null;
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
if (outplist.indexOf(',') != -1) {
kaconto=aconto;
setTimeout(function(){ kaconto.getElementById('ajaxs').style.cursor='progress'; }, 3000);
setTimeout(postkarlook, 7000);
} else if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
kaconto=aconto;
setTimeout(mpostkarlook, 7000);
}
}
}
}

function karlookagain(iois,idxn) {
var aconto=null;
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
if (eval('' + kacontoarr.length) > eval('' + idxn)) {
kacontoarr[eval('' + idxn)]=aconto;
} else {
kacontoarr.push(aconto);
}
}
}
}

function mpostkarlook() {
if (kaconto.getElementById('ajaxs')) {
var kbuts=kaconto.getElementsByTagName('input');
for (var lbuts=0; lbuts<kbuts.length; lbuts++) {
if (('' + kbuts[lbuts].type) == 'button') {
if (('' + kbuts[lbuts].value).indexOf('Radio') == 0) {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', String.fromCharCode(10) + 'Radio');
}
}
}
} else {
setTimeout(mpostkarlook, 5000);
}
}

function postkarlook() {
var selectedones='', oktogo=true, hihi=0;
if (kaconto.getElementById('ajaxs')) {
//alert(kaconto.getElementById('ajaxs').innerHTML);
for (hihi=0; hihi<kacontoarr.length; hihi++) {
if (!kacontoarr[hihi]) {
oktogo=false;
//alert('hihi=' + hihi + ' NOT okay');
} else if (!kacontoarr[hihi].getElementById('ajaxs')) {
oktogo=false;
//alert('hihi=' + hihi + ' not okay');
}
}
if (!oktogo) {
setTimeout(postkarlook, 5000);
} else if (kaconto.getElementById('ajaxs').innerHTML.indexOf('... and then ...') == -1) {
kaconto.getElementById('ajaxs').style.cursor='pointer';
var otherps=baeisf();
if (otherps != '' || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var kbuts=kaconto.getElementsByTagName('input');
for (var lbuts=0; lbuts<kbuts.length; lbuts++) {
if (('' + kbuts[lbuts].type) == 'button') {
if (('' + kbuts[lbuts].value).indexOf('Radio') == 0) {
var wasvl=kbuts[lbuts].value;
if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Ordered ' + String.fromCharCode(10) + 'Audio ' + String.fromCharCode(10) + 'Radio');
} else if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Audio ' + String.fromCharCode(10) + 'Radio');
} else if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Ordered ' + String.fromCharCode(10) + 'Radio');
} else {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', String.fromCharCode(10) + 'Radio');
}
}
}
}
}
selectedones=(kaconto.getElementById('ajaxs').innerHTML.split(kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].split('</option>')[0] + '</option>').replace('>', ' class=uptop selected>');
for (hihi=0; hihi<kacontoarr.length; hihi++) {
if (rconeis == gconeis && rconeis == bconeis) {
bconeis-=7;
if (bconeis < 0) { bconeis+=255; }
} else if (rconeis == gconeis) {
gconeis-=7;
if (gconeis < 0) { gconeis+=255; }
} else {
rconeis-=7;
if (rconeis < 0) { rconeis+=255; }
}
selectedones+=((kacontoarr[hihi].getElementById('ajaxs').innerHTML.split(kacontoarr[hihi].getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].split('</option>')[0] + '</option>').replace('>', ' class=uptop selected>')).replace(/option\ onclick\=/g, 'option style=background-color:rgb(' + rconeis + ',' + gconeis + ',' + bconeis + '); onclick=');
kaconto.getElementById('ajaxs').innerHTML+='<option value="">... and then ...</option>';
kaconto.getElementById('ajaxs').innerHTML+=kacontoarr[hihi].getElementById('ajaxs').innerHTML.split(kacontoarr[hihi].getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].replace(/option\ onclick\=/g, 'option style=background-color:rgb(' + rconeis + ',' + gconeis + ',' + bconeis + '); onclick=');
//alert(kacontoarr[hihi].getElementById('ajaxs').innerHTML);
}
//alert(selectedones);
kaconto.getElementById('ajaxs').innerHTML=kaconto.getElementById('ajaxs').innerHTML.replace(kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>', kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>' + selectedones + (selectedones != '' ? '<option id=optclk value="">____ Selection above available (resettable via click here) as you click/tap button at right ____</option>' : ''));
if (selectedones != '') {
kaconto.getElementById('ajaxs').onmousedown=function(event){ if (event.target.parentNode.outerHTML.split('>')[0].indexOf(' data-flagged=') == -1) { event.target.parentNode.setAttribute('data-flagged','y'); event.target.parentNode.innerHTML=event.target.parentNode.innerHTML.replace(/\ selected/g, ' ').replace('____ Selection above available (resettable via click here) as you click/tap button at right ____','____ Please select choices in usual multiple choice dropdown ways ____'); } };
kaconto.getElementById('ajaxs').ontouchdown=function(event){ if (event.target.parentNode.outerHTML.split('>')[0].indexOf(' data-flagged=') == -1) { event.target.parentNode.setAttribute('data-flagged','y'); event.target.parentNode.innerHTML=event.target.parentNode.innerHTML.replace(/\ selected/g, ' ').replace('____ Selection above available (resettable via click here) as you click/tap button at right ____','____ Please select choices in usual multiple choice dropdown ways ____'); } };
}
}
}
}

function baeisf() {
var outarrp=outplist.split(',');
if (eval('' + outarrp.length) > 1) {
return outarrp[0].replace(outarrp[0].trim(), '');
}
return '';
}

And so, today …

  • we add onto the default random ordering mode of Radio Play via YouTube search comma separated list, the further choices ordered or audio or audio ordered, as per the relevant Javascript prompt blurb that is now going …

    Enter YouTube 11 character code video (comma separated) or audio stream only of video (semicolon) list to Radio Play (and add ! to start in shuffle mode and/or # for the order you enter and/or & for whole list) … or a YouTube Search String basis for playlist via a Radio📻? button to activate, later. Comma separateds can be search ideas … egs. Tragedy,Boogie Wonderland,Down Among the Dead Men … random … Tragedy ,Imagine,Breezin … ordered … Tragedy  ,Pina Colada Song,Fast Car … audio … Tragedy   ,Galveston,Angel of the Morning … audio ordered. Double click on this cell for playlist redefinitions.

  • started allowing for dropdown events onmousedown and ontouchdown be able to reset the preset choices we programmatically select for the user should they be happy (but our motivation for this event work was the potential to run into a YouTube video that gives the error …

    This video requires payment to watch YouTube

    )

Codewise, this involved …

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


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

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

YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial

YouTube API Caller Radio Play Playlist Songname Search List Dropdown Tutorial

Around here, regarding web application work, we really like dropdown (ie. HTML select element) work because a lot of information can be …

  • stored
  • displayed (often taking up minimal webpage space)
  • it’s option subelements can have an event life of their own, or be part of the select element event whole picture
  • dropdown multiple selection mode (as with today’s work) can …
    1. still support your single choice scenario
    2. we’ve coded today’s dropdown to support, as applicable, ordered single click choices … versus …
    3. can allow for control key (sets of choices not necessarily adjacent) and shift key (blocks of choices)
    4. can respond (as with today’s dropdown) to preset selections established at creation via dropdown (ie. select) innerHTML option subelement selected attribute setting
  • dropdown events onmousedown and ontouchdown (as for today’s dropdown) and onclick can be harnessed ahead of an onchange event … and in today’s case can help unset any preset option subelement selected attribute setting(s)

Just so flexible! Subelement option CSS styling can be less friendly, but even so, often background colouring is possible, and we do a bit of that with the work from yesterday’s YouTube API Caller Radio Play Playlist Songname Search List Tutorial and today’s better “shored up” work you can see a bit of below (where your starting point might be that we “wrap” this particular Javascript prompt window through the Javascript overprompt function below) …


var outplist='', kaconto=null, kacontoarr=[], rconeis=155, gconeis=255, bconeis=255;

function overprompt(blb, defvl) {
var tdsare=[], itdone=false, itds=0, baeis='', ivb=0, lastpassesmustard=true;
var oklast=['A','E','I','M','Q','U','Y','c','g','k','o','s','w','0','4','8'];
outplist=prompt(blb, defvl);
if (outplist) {
//alert(1);
var outparrs=outplist.trim().split(',');
//alert(11);
if (eval('' + outparrs.length) > 1) {
if (eval('' + outparrs[0].length) > 0) {
if (oklast.indexOf(outparrs[0].slice(-1)) == -1) { lastpassesmustard=false; }
}
if ((outparrs[0] + baeis).replace(/\ \ \ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20%20%20';
outparrs[0]=outparrs[0].replace(/\ \ \ $/g,'');
} else if ((outparrs[0] + baeis).replace(/\ \ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20%20';
outparrs[0]=outparrs[0].replace(/\ \ $/g,'');
} else if ((outparrs[0] + baeis).replace(/\ $/g,'') != (outparrs[0] + baeis)) {
baeis='&domatters=&20';
outparrs[0]=outparrs[0].replace(/\ $/g,'');
} else {
baeis='';
}
//alert(111);
if (eval('' + outparrs[0].length) != 11 || !lastpassesmustard || encodeURIComponent(outparrs[0]) != outparrs[0]) {
//alert(1111);
tdsare=document.getElementsByTagName('td');
for (itds=0; itds<tdsare.length; itds++) {
//alert(tdsare[itds].innerHTML);
if (!itdone && tdsare[itds].innerHTML == '' && ('' + tdsare[itds].id) != 'td0001') {
itdone=true;
//alert('here ' + outplist.trim().replace(/\,/g,'|!!|'));
//tdsare[itds].innerHTML='<iframe onload=karlook(this); style="width:100%;height:100%;" id=karsearch name=karsearch src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outplist.trim().replace(/\,/g,'|!!|')) + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
tdsare[itds].innerHTML='<iframe onload=karlook(this); style="width:100%;height:80%;" id=karsearch name=karsearch src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outparrs[0]) + baeis + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
tdsare[itds].scrollIntoView();
//alert('there ' + outplist.trim().replace(/\,/g,'|!!|'));
baeis='';
kacontoarr=[];
for (ivb=1; ivb<outparrs.length; ivb++) {
kacontoarr.push(null);
}
for (ivb=1; ivb<outparrs.length; ivb++) {
tdsare[eval(itds + ivb)].innerHTML='<iframe onload=karlookagain(this,' + eval(-1 + ivb) + '); style="width:100%;height:80%;visibility:hidden;" id=karsearch' + ivb + ' src="/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(outparrs[ivb]) + '&minimize=y&youtube_duration=&email=&emoji=on&clickcheck=y"></iframe>';
}
return '';
}
}
}
}
}
return outplist;
}

function karlook(iois) {
var aconto=null;
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
if (outplist.indexOf(',') != -1) {
kaconto=aconto;
setTimeout(function(){ kaconto.getElementById('ajaxs').style.cursor='progress'; }, 3000);
setTimeout(postkarlook, 7000);
} else if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
kaconto=aconto;
setTimeout(mpostkarlook, 7000);
}
}
}
}

function karlookagain(iois,idxn) {
var aconto=null;
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
if (eval('' + kacontoarr.length) > eval('' + idxn)) {
kacontoarr[eval('' + idxn)]=aconto;
} else {
kacontoarr.push(aconto);
}
}
}
}

function mpostkarlook() {
if (kaconto.getElementById('ajaxs')) {
var kbuts=kaconto.getElementsByTagName('input');
for (var lbuts=0; lbuts<kbuts.length; lbuts++) {
if (('' + kbuts[lbuts].type) == 'button') {
if (('' + kbuts[lbuts].value).indexOf('Radio') == 0) {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', String.fromCharCode(10) + 'Radio');
}
}
}
} else {
setTimeout(mpostkarlook, 5000);
}
}

function postkarlook() {
var selectedones='', oktogo=true, hihi=0;
if (kaconto.getElementById('ajaxs')) {
//alert(kaconto.getElementById('ajaxs').innerHTML);
for (hihi=0; hihi<kacontoarr.length; hihi++) {
if (!kacontoarr[hihi]) {
oktogo=false;
//alert('hihi=' + hihi + ' NOT okay');
} else if (!kacontoarr[hihi].getElementById('ajaxs')) {
oktogo=false;
//alert('hihi=' + hihi + ' not okay');
}
}
if (!oktogo) {
setTimeout(postkarlook, 5000);
} else if (kaconto.getElementById('ajaxs').innerHTML.indexOf('... and then ...') == -1) {
kaconto.getElementById('ajaxs').style.cursor='pointer';
var otherps=baeisf();
if (otherps != '' || navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
var kbuts=kaconto.getElementsByTagName('input');
for (var lbuts=0; lbuts<kbuts.length; lbuts++) {
if (('' + kbuts[lbuts].type) == 'button') {
if (('' + kbuts[lbuts].value).indexOf('Radio') == 0) {
var wasvl=kbuts[lbuts].value;
if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Ordered ' + String.fromCharCode(10) + 'Audio ' + String.fromCharCode(10) + 'Radio');
} else if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Audio ' + String.fromCharCode(10) + 'Radio');
} else if (otherps == ' ') {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', 'Ordered ' + String.fromCharCode(10) + 'Radio');
} else {
kbuts[lbuts].value=kbuts[lbuts].value.replace('Radio', String.fromCharCode(10) + 'Radio');
}
}
}
}
}
selectedones=(kaconto.getElementById('ajaxs').innerHTML.split(kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].split('</option>')[0] + '</option>').replace('>', ' class=uptop selected>');
for (hihi=0; hihi<kacontoarr.length; hihi++) {
if (rconeis == gconeis && rconeis == bconeis) {
bconeis-=7;
if (bconeis < 0) { bconeis+=255; }
} else if (rconeis == gconeis) {
gconeis-=7;
if (gconeis < 0) { gconeis+=255; }
} else {
rconeis-=7;
if (rconeis < 0) { rconeis+=255; }
}
selectedones+=((kacontoarr[hihi].getElementById('ajaxs').innerHTML.split(kacontoarr[hihi].getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].split('</option>')[0] + '</option>').replace('>', ' class=uptop selected>')).replace(/option\ onclick\=/g, 'option style=background-color:rgb(' + rconeis + ',' + gconeis + ',' + bconeis + '); onclick=');
kaconto.getElementById('ajaxs').innerHTML+='<option value="">... and then ...</option>';
kaconto.getElementById('ajaxs').innerHTML+=kacontoarr[hihi].getElementById('ajaxs').innerHTML.split(kacontoarr[hihi].getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>')[1].replace(/option\ onclick\=/g, 'option style=background-color:rgb(' + rconeis + ',' + gconeis + ',' + bconeis + '); onclick=');
//alert(kacontoarr[hihi].getElementById('ajaxs').innerHTML);
}
//alert(selectedones);
kaconto.getElementById('ajaxs').innerHTML=kaconto.getElementById('ajaxs').innerHTML.replace(kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>', kaconto.getElementById('ajaxs').innerHTML.split('</option>')[0] + '</option>' + selectedones + (selectedones != '' ? '<option id=optclk value="">____ Selection above available (resettable via click here) as you click/tap button at right ____</option>' : ''));
if (selectedones != '') {
kaconto.getElementById('ajaxs').onmousedown=function(event){ if (event.target.parentNode.outerHTML.split('>')[0].indexOf(' data-flagged=') == -1) { event.target.parentNode.setAttribute('data-flagged','y'); event.target.parentNode.innerHTML=event.target.parentNode.innerHTML.replace(/\ selected/g, ' ').replace('____ Selection above available (resettable via click here) as you click/tap button at right ____','____ Please select choices in usual multiple choice dropdown ways ____'); } };
kaconto.getElementById('ajaxs').ontouchdown=function(event){ if (event.target.parentNode.outerHTML.split('>')[0].indexOf(' data-flagged=') == -1) { event.target.parentNode.setAttribute('data-flagged','y'); event.target.parentNode.innerHTML=event.target.parentNode.innerHTML.replace(/\ selected/g, ' ').replace('____ Selection above available (resettable via click here) as you click/tap button at right ____','____ Please select choices in usual multiple choice dropdown ways ____'); } };
}
}
}
}

function baeisf() {
var outarrp=outplist.split(',');
if (eval('' + outarrp.length) > 1) {
return outarrp[0].replace(outarrp[0].trim(), '');
}
return '';
}

And so, today …

  • we add onto the default random ordering mode of Radio Play via YouTube search comma separated list, the further choices ordered or audio or audio ordered, as per the relevant Javascript prompt blurb that is now going …

    Enter YouTube 11 character code video (comma separated) or audio stream only of video (semicolon) list to Radio Play (and add ! to start in shuffle mode and/or # for the order you enter and/or & for whole list) … or a YouTube Search String basis for playlist via a Radio📻? button to activate, later. Comma separateds can be search ideas … egs. Tragedy,Boogie Wonderland,Down Among the Dead Men … random … Tragedy ,Imagine,Breezin … ordered … Tragedy  ,Pina Colada Song,Fast Car … audio … Tragedy   ,Galveston,Angel of the Morning … audio ordered. Double click on this cell for playlist redefinitions.

  • started allowing for dropdown events onmousedown and ontouchdown be able to reset the preset choices we programmatically select for the user should they be happy (but our motivation for this event work was the potential to run into a YouTube video that gives the error …

    This video requires payment to watch YouTube

    )

Codewise, this involved …

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

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