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

Shower Song Sharing Tutorial

Shower Song Sharing Tutorial

Shower Song Sharing Tutorial

Though we like programming in (serverside) PHP we’d prefer to leave it to (clientside) HTML and Javascript and CSS to contain solutions to web application challenges, as much as anything because PHP relies on an arrangement such as the great MAMP, as a local Apache web server environment, to test your PHP.

With the Shower Songs project up until yesterday’s Shower Song Media Insertions Tutorial

  • clientside only worked … but …
  • introducing sharing functionality along with the potential sharing of local media files needs serverside (ie. in our case, PHP)

… and we decided that “PHP is it” both as the …

  • software .. and the data …
  • storage

Huh?! Yes, PHP can do it all! But we are not saying this idea is for everyone.

The reason we plumped for it, is the simple nature to the requirement we are after (when it boils down to it) that being …

  1. a three argument Ajax (clientside) …

    var dcombos=['data','datA','daTa','daTA','dAta','dAtA','dATa','dATA','Data','DatA','DaTa','DaTA','DAta','DAtA','DATa','DATA'];
    var zhr=null, zform=null, itrs=[], ibetter=-1, iind=0;

    function stateChanged() {
    if (zhr.readyState == 4) {
    if (zhr.status == 200) {
    if (iind < eval(-1 + eval('' + itrs.length))) { ajaxit(); } else { iind=0; itrs=[]; ibetter=-1; } } } }
    function ajaxit() { // Ajax POST dataform onetoseven durl
    if (ibetter >= 1 && eval('' + itrs.length) > 0) {
    zhr = new XMLHttpRequest();
    zform = new FormData();
    zform.append('dataform', '' + dcombos[ibetter]);
    zform.append('onetoseven', '' + itrs[iind]);
    if (document.getElementById('inp00' + itrs[iind]).value.indexOf('data:') == 0) {
    zform.append('durl', '' + document.getElementById('inp00' + itrs[iind]).value);
    } else if (document.getElementById('inp00' + itrs[iind]).placeholder.indexOf('data:') == 0) {
    zform.append('durl', '' + document.getElementById('inp00' + itrs[iind]).placeholder);
    }
    zhr.onreadystatechange=stateChanged;
    zhr.open('post', './shower_songs.php', true);
    zhr.send(zform);
    iind++;
    }
    }

    function doemail() {
    var azx = document.createElement("a");
    var onoff=[];
    ibetter=-1;
    itrs=[];
    document.body.appendChild(azx);
    azx.style = "display: none"; // %3B%7Cdata%3A%7C%7C%7C%7C%7C 1 and 2 %3Bdata%3A%7Cdata%3A%7C%7C%7C%7C%7C
    var durl=documentURL;
    var newdurl='';
    if (durl.indexOf('data%3A%') != -1) {
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 1
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(1);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    onoff.push(false);
    durl=durl.replace('%3B%7C','%3B');
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 2
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(2);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 3
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(3);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 4
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(4);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 5
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(5);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 6
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(6);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 7
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(7);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    console.warn(onoff); // Ajax POST dataform onetoseven durl
    if (ibetter >= 1) {
    if (documentURL.indexOf('?') != -1) {
    newdurl=documentURL.replace(/data\%/g, dcombos[ibetter] + '%').replace('.html','.php').replace('.htm','.php').replace('#','&dataform=' + dcombos[ibetter] + '&');
    } else {
    newdurl=documentURL.replace(/data\%/g, dcombos[ibetter] + '%').replace('.html','.php').replace('.htm','.php').replace('#','?dataform=' + dcombos[ibetter] + '&');
    }
    setTimeout(ajaxit, 500);
    }
    azx.href = 'mailto:?subject=' + encodeURIComponent( (document.getElementById('subject').value.trim() != '' ? document.getElementById('subject').value : (document.getElementById('subject').placeholder.trim() != '' ? document.getElementById('subject').placeholder : 'Shower Songs')) ) + '&body=' + encodeURIComponent((newdurl != '' ? newdurl : documentURL));
    } else {
    azx.href = 'mailto:?subject=' + encodeURIComponent( (document.getElementById('subject').value.trim() != '' ? document.getElementById('subject').value : (document.getElementById('subject').placeholder.trim() != '' ? document.getElementById('subject').placeholder : 'Shower Songs')) ) + '&body=' + encodeURIComponent((newdurl != '' ? newdurl : documentURL));
    }
    azx.click();
    }

    function dosms() {
    var onoff=[];
    ibetter=-1;
    itrs=[];
    var azx = document.createElement("a");
    document.body.appendChild(azx);
    azx.style = "display: none";
    var durl=documentURL;
    var newdurl='';
    if (durl.indexOf('data%3A%') != -1) {
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 1
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(1);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    onoff.push(false);
    durl=durl.replace('%3B%7C','%3B');
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 2
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(2);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 3
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(3);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 4
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(4);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 5
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(5);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 6
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(6);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    if (durl.indexOf('%3Bdata%3A%') != -1) { // 7
    durl=durl.replace('%3Bdata%3A%7C', '%3B%7C');
    itrs.push(7);
    while (ibetter < 1) {
    ibetter=Math.floor(Math.random() * eval('' + dcombos.length));
    }
    onoff.push(true);
    } else {
    durl=durl.replace('%3B%7C','%3B');
    onoff.push(false);
    }
    console.warn(onoff); // Ajax POST dataform onetoseven durl
    if (ibetter >= 1) {
    if (documentURL.indexOf('?') != -1) {
    newdurl=documentURL.replace(/data\%/g, dcombos[ibetter] + '%').replace('.html','.php').replace('.htm','.php').replace('#','&dataform=' + dcombos[ibetter] + '&');
    } else {
    newdurl=documentURL.replace(/data\%/g, dcombos[ibetter] + '%').replace('.html','.php').replace('.htm','.php').replace('#','?dataform=' + dcombos[ibetter] + '&');
    }
    setTimeout(ajaxit, 500);
    }
    azx.href = 'sms:&body=' + encodeURIComponent((newdurl != '' ? newdurl : documentURL));
    } else {
    azx.href = 'sms:body=' + encodeURIComponent((newdurl != '' ? newdurl : documentURL));
    }
    azx.click();
    }

    … writing, into the PHP itself … as comments from clientside to serverside method=POST scenario …
  2. a one argument reading back serverside PHP shower_songs.php

    <?php
    // shower_songs.php
    // April, 2026
    // RJM Programming
    // Help out shower_songs.html regarding local media files accessed via email or SMS

    $dst=str_replace('~','',str_replace('3~','2',(substr(date("Ymd"),0,7) . '~'))) . '0';
    $phpis=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'shower_songs.php');
    $newphpis='';

    if (strpos($phpis, ' of ' . $dst . ' goes ') !== false) {
    $dst=$dst;
    } else if (strpos($phpis, 'Data of ') !== false) {
    $olddst=explode(' ',explode('Data of ', $phpis)[1])[0];
    $allrecs=explode('/' . '/' . '/' . '/', $phpis);
    $newphpis=$phpis;
    for ($ij=1; $ij<sizeof($allrecs); $ij++) {
    if (substr(substr($allrecs[$ij],4,7)) == substr($olddst,0,7)) {
    $newphpis=str_replace('/' . '/' . '/' . '/' . explode('/' . '/' . '/' . '/',explode("\n",$allrecs[$ij])[0])[0], "", str_replace('/' . '/' . '/' . '/' . explode('/' . '/' . '/' . '/',explode("\n",$allrecs[$ij])[0])[0] . "\n", "", $newphpis));
    }
    }
    $newphpis=str_replace('Data of ' . $olddst . ' ', 'Data of ' . $dst . ' ', $newphpis);
    }

    if (isset($_POST['dataform'])) {

    if (isset($_POST['onetoseven']) && isset($_POST['durl'])) {
    if ($newphpis == '') {
    $newphpis=$phpis;
    }
    $newphpis.="\n/" . "/" . "/" . "/" . $_POST['dataform'] . substr($dst,0,7) . $_POST['onetoseven'] . str_replace(' ','+',urldecode($_POST['durl'])) . "\n";
    }

    if ($newphpis != '' && $newphpis != $phpis) {
    file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'shower_songs.php', $newphpis);
    }

    exit;
    } else if (isset($_GET['dataform'])) {
    $htmlis=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'shower_songs.html');
    $relrecs=explode('/' . '/' . '/' . '/' . $_GET['dataform'] . substr($dst,0,7), $phpis);
    for ($ij=1; $ij<sizeof($relrecs); $ij++) {
    if (substr($relrecs[$ij],0,1) >= '1' && substr($relrecs[$ij],0,1) <= '7') {
    //file_put_contents('xz.xz', '' . substr($relrecs[$ij],0,1));
    $relplaces=explode(substr($relrecs[$ij],0,1) . '" value="', $htmlis);
    //file_put_contents('xz2.xz2', '' . sizeof($relplaces) . ' ' . sizeof(explode('1" value="',$htmlis)));
    if (sizeof($relplaces) > 1) {
    $htmlis=str_replace(substr($relrecs[$ij],0,1) . '" value="' . explode('"',$relplaces[1])[0] . '"', substr($relrecs[$ij],0,1) . '" value="' . explode('/' . '/' . '/' . '/',explode("\n",substr($relrecs[$ij],1))[0])[0] . '"', $htmlis);
    }
    }
    }
    file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'shower_songs.htm', $htmlis);

    if ($newphpis != '' && $newphpis != $phpis) {
    file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'shower_songs.php', $newphpis);
    }

    header('Location: ./shower_songs.htm' . str_replace('&#order=','#order=',str_replace('order=','#order=',str_replace('??','?',('?' . $_SERVER['QUERY_STRING'])))));

    exit;
    }

    if (str_replace('?','',$_SERVER['QUERY_STRING']) == '') {
    header('Location: ./shower_songs.html');
    } else {
    header('Location: ./shower_songs.html' . str_replace('&#order=','#order=',str_replace('order=','#order=',str_replace('??','?',('?' . $_SERVER['QUERY_STRING'])))));
    }

    ?>
    // Data of 20260420 goes below ...

    … populating clientside HTML form scenario

So feel free to try the changed eighth draft that, now, also allows the “Shower Songs” title be contenteditable to, say, “Soup Kitchens” (whereby the button becomes “Kitchens” (and you start using those YouTube searches to create your own meaningful up to 7 long playlist)) for Shower Songs below and helped out a lot via that changed swipe_media.html Radio Play project web application and today’s changed client_browsing.htm client side local file browsing HTML and Javascript inhouse helper.


Previous relevant Shower Song Media Insertions Tutorial is shown below.

Shower Song Media Insertions Tutorial

Shower Song Media Insertions Tutorial

The recent Shower Song Radio Play Better Integration Tutorial may represent …


... a Shower Song project "by name" ...

… but recent work and what we have here today, can potentially allow this project’s scope to be a lot more ambitious than that.

So what is today’s work? Well, up until today …

  • data has been YouTube video related data exclusively … but as of today …
  • we integrate our inhouse Client Browsing and Pasting and File Dropping Tutorial‘s web application now capable of …
    • type it in …
    • browse it in …
    • paste it in as text (at an animated GIF slide textbox) … or, as of today …
    • paste it in as graphical content via the inhouse Client Browsing (and now “Pasting”) web application’s iframe element hosted span contenteditable=true onpaste and onblur event savvy new inclusion into the mix
    • drop it in …

    … means to other local media file data conduits …

… and so, on offer to Shower Songs users of the form off the “Songs” button, to add any non-YouTube local media source file data of interest, into the “presentation mix”, via …

HTML

<div id=divcbi style=visibility:hidden;>
<iframe onload="checkit(this);" scrolling=no frameborder=0 id=cbi data-accept="image/*"
style="width:163px; height:228px; margin-top:-204px; display:inline-block; background-color:transparent;"
src="/HTMLCSS/client_browsing.htm?d=31226&wording=Allimages%20images%2E%20">
</iframe>
</div>
Javascript

var twaconto=null, twacontoiurl=null, twacontojurl=null;
var imgo=null;
var imagedurl='', reldone=false;
var bigdu='', lastname='', dcbi='';
var initval='<textarea style=width:98%;height:560px;background-color:#f9f9f9; onblur="popshow(this.value);" id=mysubrip></textarea>', contis='', woo=null;
var curtaidis='', curavid='', curpos=0, curdelta=0, somethingplaying=false, cmds=[], sofara='', gtaidis='', lastgreen=null;
var wastab='', todo='', aone='1', tacstarted=false, onep='p', gdurlf=false, bonep='p', thattaid='', ithattaid=-1, jgoing=false;

function butnotavmediawis(inid) { // to pause
bonep='p';
var xsuff='';
try {
xsuff=inid.split('_')[0].slice(-3)
} catch(yfj) { xsuff=''; }
if ((xsuff + 'x').substring(0,1) == '0') {
if (document.getElementById(inid)) {
if (document.getElementById(inid).placeholder.indexOf('P=play/') != -1 && gdurlf) {
bonep='';
return 'spareu';
}
}
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}

function dotodo() {
if (todo != '') {
if (document.getElementById(todo).placeholder.indexOf('P=play/') != -1) {
document.getElementById(todo).value='P';
}
}
todo='';
}

function tanearest(avoid) {
var myt=document.getElementById('mytable').innerHTML;
if (lastgreen) {
lastgreen.style.border='1px solid black';
}
lastgreen=document.getElementById(myt.split(avoid)[1].split(' id="')[1].split('"')[0])
return lastgreen;
}

function butnotavmediap() {
var inid=gtaidis;
if (gdurlf && document.getElementById('avmedia' + inid.split('_')[0].slice(-3))) {
document.getElementById(inid).placeholder=document.getElementById(inid).placeholder.replace(document.getElementById(inid).placeholder.split('/')[0],'1');
document.getElementById('avmedia' + inid.split('_')[0].slice(-3)).currentTime=0;
gtaidis='';
return 'spareu';
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}

function justtheone() {
jgoing=true;
var iicnt=0, ibn=0, allv=true;
var tasare=document.getElementsByTagName('textarea');
for (ibn=eval(-1 + eval('' + tasare.length)); ibn>=0; ibn--) {
if (tasare[ibn].value != '') { allv=false; }
}
if (allv) {
if (!gdurlf) {
for (ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].placeholder.indexOf('P=pause/') != -1 && tasare[ibn].placeholder.indexOf('0/') != 0 && tasare[ibn].placeholder.indexOf('Audio ') != 0) {
iicnt++;
if (iicnt > 1) {
if (isplayingnum >= 0) {
if (tasare[ibn].id != taids[isplayingnum]) {
if (8 == 7) { tasare[ibn].value='p'; }
}
}
}
}
}
} else {
for (ibn=eval(-1 + eval('' + tasare.length)); ibn>=0; ibn--) {
if (tasare[ibn].placeholder.indexOf('P=pause/') != -1 && tasare[ibn].placeholder.indexOf('0/') != 0 && tasare[ibn].placeholder.indexOf('Audio ') != 0) {
iicnt++;
if (iicnt > 1) {
tasare[ibn].value='p';
}
}
}
}
}
}

function butnotavmediazero(inid) {
if (gdurlf && document.getElementById('avmedia' + inid.split('_')[0].slice(-3))) {
document.getElementById(inid).placeholder=document.getElementById(inid).placeholder.replace(document.getElementById(inid).placeholder.split('/')[0],'1');
document.getElementById('avmedia' + inid.split('_')[0].slice(-3)).currentTime=0;
return 'spareu';
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}

function butnotavmediaone(inid) {
aone='1';
if (gdurlf && document.getElementById('avmedia' + inid.split('_')[0].slice(-3))) {
document.getElementById(inid).placeholder=document.getElementById(inid).placeholder.replace(document.getElementById(inid).placeholder.split('/')[0],'1');
document.getElementById('avmedia' + inid.split('_')[0].slice(-3)).currentTime=0;
return 'spareu';
} else if (gdurlf && document.getElementById(inid).placeholder.indexOf('P=play/') != -1) {
if (5 == 5) {
thistaid='';
if (isplaying == '' && !tacstarted) { cball(true); if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { isplayingnum=eval(-1 + eval('' + inid.split('_')[0].slice(-1))); } setInterval(tacontrol, 2000); }
isplayingnum=eval(-1 + eval('' + inid.split('_')[0].slice(-1)));
isplaying=document.getElementById(inid).placeholder;
//alert(onep);
aone=onep; // 'p';
onep='1';
//thistaid=inid;
//lastgreen=document.getElementById(inid);
//document.getElementById(inid).style.border='2px dotted green';
} else {
todo=inid;
setTimeout(dotodo, 7000); //document.getElementById(inid).value='p'; //alert('huh ' + inid + ' ' + document.getElementById(inid).placeholder);
}
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}

function butnotavmedia(inid) {
var xsuff='';
try {
xsuff=inid.split('_')[0].slice(-3)
} catch(yfj) { xsuff=''; }
if ((xsuff + 'x').substring(0,1) == '0') {
if (gdurlf && document.getElementById('avmedia' + inid.split('_')[0].slice(-3))) {
return 'spareu';
}
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}


function cmdsanal() {
var thisthird='';
for (var ii=0; ii<cmds.length; ii++) {
thisthird=cmds[ii].split("','")[2].split("'")[0];
if (sofara.indexOf(',' + thisthird + ',') == -1) {
eval('' + cmds[ii]);
}
}
}


function tadur(thisdur, taidis, thisavoid) {
var thisavo=document.getElementById(thisavoid);
var wasta='' + taidis;
if (!document.getElementById(taidis) || ('' + document.getElementById(taidis)) == 'undefined' || ('' + document.getElementById(taidis)) == 'null') {
if (1 == 1) {
if (sofara.indexOf(',' + thisavoid + ',') == -1) {
if (cmds.indexOf("tadur('" + thisdur + "','undefined','" + thisavoid + "')") == -1) {
cmds.push("tadur('" + thisdur + "','undefined','" + thisavoid + "')");
}
setTimeout(cmdsanal, 800);
}
return '';
} else {
tasx=document.getElementsByTagName('textarea');
for (var ik=0; ik<tasx.length; ik++) {
if (eval(1 + ik) == eval('' + thisavo.id.replace('avmedia00',''))) {
taidis='' + tasx.id;
}
}
if (!document.getElementById(taidis) || ('' + document.getElementById(taidis)) == 'undefined' || ('' + document.getElementById(taidis)) == 'null') {
if (sofara.indexOf(',' + thisavoid + ',') == -1) {
if (cmds.indexOf("tadur('" + thisdur + "','undefined','" + thisavoid + "')") == -1) {
cmds.push("tadur('" + thisdur + "','undefined','" + thisavoid + "')");
}
setTimeout(cmdsanal, 800);
}
return '';
}
}
}
//alert(taidis + ' ' + wasta);
if (('' + document.getElementById(taidis).placeholder) == '1/1') {
//document.title='1:' + taidis + ' ' + thisdur;
sofara+=',' + thisavoid + ',';
curpos=0;
curtaidis=taidis;
curavid='' + thisavo.id;
document.getElementById(taidis).placeholder='1/' + Math.ceil(eval('' + thisdur));
//document.title='1:' + taidis + ' ' + thisdur + ' ' + document.getElementById(taidis).placeholder;
}
thisavo.currentTime=0;
thisavo.setAttribute('data-dur', '' + thisdur);
}


function onesecfn() {
curpos+=curdelta;
if (curdelta != 0 && curpos >= 1) {
document.getElementById(curavid).setAttribute('data-at', '' + eval('' + curpos));
document.getElementById(curtaidis).placeholder='' + curpos + '/' + Math.ceil(eval('' + document.getElementById(curavid).getAttribute('data-dur')));
}
}


function avcount(taidis,playvspause,thisavo) {
if (playvspause) {
curdelta=1;
curtaidis=taidis;
curavid='' + thisavo.id;
if (('' + document.getElementById(curavid).getAttribute('data-at') + '0').substring(0,1) == '0') {
curpos=0;
document.getElementById(taidis).placeholder='1/' + Math.ceil(eval('' + document.getElementById(curavid).getAttribute('data-dur')));
}
if (!somethingplaying) {
somethingplaying=true;
setInterval(onesecfn, 1000);
}
} else {
curdelta=0;
curtaidis=taidis;
curavid='' + thisavo.id;
}
}


function avend(taidis,playvspause,thisavo) {
curdelta=0;
curtaidis=taidis;
curavid='' + thisavo.id;
document.getElementById(taidis).placeholder='' + Math.ceil(eval('' + thisavo.getAttribute('data-dur'))) + '/' + Math.ceil(eval('' + thisavo.getAttribute('data-dur')));
document.getElementById(curavid).setAttribute('data-at', '00');
gtaidis=taidis;
setTimeout(butnotavmediap, 5000);
}

function puttwoto(indu) {
if (indu.indexOf('#') != -1) {
document.getElementById('audioname').value=indu.split('#')[1];
document.getElementById('result').innerHTML=indu.split('#')[0];
} else {
document.getElementById('result').innerHTML=indu; //alert(indu);
}
document.getElementById('divcbi').innerHTML=dcbi;
}

function yesthreethree(inv) {
bigdu=inv;
//alert('x;' + bigdu);
}


function yes_threethree(inv) {
bigdu=inv;
//alert(inv);
}

function yes_file_name(inv, invtwo) {
bigdu=encodeURIComponent(invtwo);
lastname=inv;
//alert('xzz;' + bigdu);
document.getElementById('txttxtout').value=inv;
if (document.getElementById('mydownloada')) {
document.getElementById('mydownloada').download='' + inv;
} else if (document.getElementById('divdownloada')) {
document.getElementById('divdownloada').style.display='inline-block';
document.getElementById('divdownloada').innerHTML='<a data-download="' + inv + '" id=mydownloada style=display:inline-block;><button style=background-color:yellow;>Download ...</button></a>';
document.getElementById('iftxt').src='#';
document.getElementById('iftxt').style.visibility='hidden';
}
}

function utf8ToBase64(str) { // thanks to https://www.google.com/search?q=btoa+InvalidCharacterError%3A+The+string+contains+invalid+characters.&rlz=1C5OZZY_en&oq=btoa+InvalidCharacterError%3A+The+string+contains+invalid+characters.&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRiPAjIHCAIQIRiPAtIBCTQxODNqMGoxNagCCLACAfEFhcuQDq9PfBk&sourceid=chrome&ie=UTF-8
// Encode the Unicode string to a Uint8Array using UTF-8
const utf8Bytes = new TextEncoder().encode(str);

// Convert the Uint8Array to a binary string
const binaryString = String.fromCharCode.apply(null, utf8Bytes);

// Use btoa on the binary string
return btoa(binaryString);
}

function yes_three_three(inv) {
contis=inv;
if (contis.indexOf('<?php') != -1) {
contis=inv.replace(/<\?php/g,'').replace(/\?>/g,'');
} else if (contis.indexOf('<?') == 0) {
contis=inv.replace(/</g,'<').replace(/>/g,'>').replace(/\&\#/g,'&#');
}
var ourcontis=contis.replace(/<textarea/g,'<textarea').replace(/<\/textarea>/g,'</textarea>');
//alert(initval);
document.getElementById('overt').innerHTML=initval.replace('></textarea>', '>' + ourcontis + '</textarea>');
document.getElementById('divdownloada').innerHTML='<a download="' + lastname + '" id=mydownloada style=display:inline-block; href="data:x-application/text,' + escape(document.getElementById('mysubrip').value) + '"><button style=background-color:yellow;>Download ...</button></a>';
//alert(document.getElementById('divdownloada').innerHTML);
if (contis != '') {
document.getElementById('bdisplay').disabled=false; //setAttribute('disabled', false);
if (document.getElementById('mydownloada')) {
//alert(12);
document.getElementById('divdownloada').style.display='inline-block';
//alert(212);
document.getElementById('mydownloada').style.display='inline-block';
//alert(bigdu);
if (bigdu != '' && 1 == 7) {
document.getElementById('mydownloada').href='data:text/plain;base64,' + bigdu;
} else if (bigdu == '' || 7 == 7) {
try {
document.getElementById('mydownloada').href='data:x-application/text,' + escape(inv);
} catch(trr) {
document.getElementById('mydownloada').href='data:text/plain;base64,' + window.btoa(inv);
}
}
//alert(412);
if (document.getElementById('iftxt').src != '#') {
document.getElementById('iftxt').src='/file_open_picker.html?clicktext=yesazs' + Math.floor(Math.random() * 145675);
}
//} else {
// alert(564);
}
}
bigdu='';
}

function oncntapp(tval,newtb,tthis) {
var intb='';
if (('' + tval.length) == '11' || newtb.indexOf('data:') == 0) {
for (var ij=1; ij<=7; ij++) {
if (document.getElementById('inp00' + ij)) {
if (document.getElementById('inp00' + ij).value.trim() == '') {
if (newtb.indexOf('data:') == 0) {
document.getElementById('inp00' + ij).value=newtb;
if (document.getElementById('audioname').value != '') {
document.getElementById('inp00' + ij).title=document.getElementById('audioname').value;
document.getElementById('audioname').value='';
} else if (document.getElementById('thewords').value != '') {
document.getElementById('inp00' + ij).title=document.getElementById('thewords').value;
document.getElementById('thewords').value='';
}
} else {
while ((' ' + newtb).indexOf(" \\" + 'u') != -1) {
intb=newtb.split("\\" + 'u')[0] + "\\" + 'u' + (' ' + newtb).split(" \\" + 'u')[1].split(' ')[0];
newtb=newtb.replace(intb,newtb.split("\\" + 'u')[0] + eval('String.fromCodePoint(0x' + intb.substring(eval(2 + newtb.split("\\" + 'u')[0].length)).replace(/\\\\u/g,',0x') + ')'));
}
document.getElementById('inp00' + ij).value=tval + '#' + newtb;
}
return '';
}
}
}
}
}

function checkit(iois) {
twaconto = (iois.contentWindow || iois.contentDocument);
if (twaconto != null) {
if (twaconto.document) { twaconto = twaconto.document; }
if (twaconto.getElementById('divcopyspan')) {
twacontojurl=twaconto.getElementById('divcopyspan');
}
if (twacontoiurl || twacontojurl) { setInterval(lookfor, 3000); }
}
}

function resultlook() {
if (document.getElementById('result').innerHTML != '' || document.getElementById('resultpdfout').innerHTML != '') {
if (document.getElementById('result').innerHTML != '') {
imagedurl=document.getElementById('result').innerHTML;
} else {
imagedurl=document.getElementById('resultpdfout').innerHTML;
}
//alert(imagedurl);
document.getElementById('result').innerHTML='';
document.getElementById('resultpdfout').innerHTML='';
theimgurl=imagedurl;
theclass=theimgurl.slice(-96).replace(/\:/g,'!').replace(/\./g,'|');
if (document.getElementById('myimg')) {
document.getElementById('myimg').src=imagedurl;
imgo=document.getElementById('myimg');
document.getElementById('myimg').className=theclass;
document.getElementById('imgurl').placeholder=imagedurl;
document.getElementById('imgurl').title=imagedurl;
document.getElementById('imgurl').value='';
} else {
if (5 == 5) {
oncntapp('', imagedurl, null);
}
}
imagedurl='';
document.getElementById('divcbi').innerHTML=dcbi;
}
}

function lookfor() {
var uis=document.getElementById('cbi').src.replace('=','=' + Math.floor(Math.random() * 9));
if (twacontojurl) {
if ((twacontojurl.innerHTML + twacontojurl.title).indexOf('data:') == 0) {
twocontocont='data:' + (twacontojurl.innerHTML + twacontojurl.title).split('data:')[1];
// alert(twocontocont);
if (5 == 5) {
oncntapp('', twocontocont, null);
document.getElementById('divcbi').innerHTML=dcbi;
} else {
document.getElementById('imgurl').value=twocontocont;
}
twacontojurl.innerHTML='';
twacontojurl.title='';
document.getElementById('cbi').style.visibility='hidden';
document.getElementById('cbi').src=uis; //'/HTMLCSS/client_browsing.htm?d=' + Math.floor(Math.random() * 19897865) + '&wording=Allimages%20images%2E%20';
document.getElementById('cbi').style.visibility='visible';
}
}
}

setInterval(resultlook, 5000);

Feel free to try the changed seventh draft Shower Songs below and helped out a lot via that changed swipe_media.html Radio Play project web application and today’s changed client_browsing.htm client side local file browsing HTML and Javascript inhouse helper.


Previous relevant Shower Song Radio Play Better Integration Tutorial is shown below.

Shower Song Radio Play Better Integration Tutorial

Shower Song Radio Play Better Integration Tutorial

When you integrate, as with the day before yesterday’s Shower Song Radio Play Integration Tutorial, there’s the temptation to automate, but go too far.

We were reminded of this, testing a YouTube search string “Pina Colada Song” and the top pick giving us some travel video.

And so with this in mind, we wanted to nuance the integrations to add …

  • the whole Radio Play dropdown element is virtually cloned (with new option subelement onclick function) …

    function oncntapp(tval,newtb,tthis) {
    var intb='';
    if (('' + tval.length) == '11') {
    for (var ij=1; ij<=7; ij++) {
    if (document.getElementById('inp00' + ij)) {
    if (document.getElementById('inp00' + ij).value.trim() == '') {
    while ((' ' + newtb).indexOf(" \\" + 'u') != -1) {
    intb=newtb.split("\\" + 'u')[0] + "\\" + 'u' + (' ' + newtb).split(" \\" + 'u')[1].split(' ')[0];
    newtb=newtb.replace(intb,newtb.split("\\" + 'u')[0] + eval('String.fromCodePoint(0x' + intb.substring(eval(2 + newtb.split("\\" + 'u')[0].length)).replace(/\\\\u/g,',0x') + ')'));
    }
    document.getElementById('inp00' + ij).value=tval + '#' + newtb
    return '';
    }
    }
    }
    }
    }

    … over into the Shower Songs to allow for non “top picks” be easily selectable, perhaps substituting into blanked out poorer entries, in the Shower Songs x 7 textbox form … and …
  • the YouTube title now appears in that textbox value in the form …

    [YouTube-11-code]#[YouTube title] (via "[Search String Used]")

    … via …

    var shower_songs_tbos=[], divs=[];


    function titlesnnsstbo() {
    var rerun=false, wti='', newtb='', intb='';
    var lastrerun=rerun;
    if (eval('' + shower_songs_tbos.length) > 0) {
    for (var irt=0; irt<eval('' + shower_songs_tbos.length); irt++) {
    if (shower_songs_tbos[irt].value.indexOf(' (via "') == -1) {
    //rerun=lastrerun;
    if (top.window.opener) {
    //alert(1);
    if (top.window.opener.document.getElementById('ajaxs')) {
    //alert(8);
    if (top.window.opener.document.getElementById('ajaxs').innerHTML.indexOf(shower_songs_tbos[irt].value.split('#')[0]) != -1) {
    wti=(shower_songs_tbos[irt].value=shower_songs_tbos[irt].value + '#').split('#')[1];
    //alert(wti);
    newtb=top.window.opener.document.getElementById('ajaxs').innerHTML.split(shower_songs_tbos[irt].value.split('#')[0])[1].split('>')[1].split('<')[0].replace(/\'/g,'`').replace(/\"/g,'`').replace(/\#/g,' '); while ((' ' + newtb).indexOf(" \\" + 'u') != -1) { intb=newtb.split("\\" + 'u')[0] + "\\" + 'u' + (' ' + newtb).split(" \\" + 'u')[1].split(' ')[0]; newtb=newtb.replace(intb,newtb.split("\\" + 'u')[0] + eval('String.fromCodePoint(0x' + intb.substring(eval(2 + newtb.split("\\" + 'u')[0].length)).replace(/\\\\u/g,',0x') + ')')); } shower_songs_tbos[irt].value=(shower_songs_tbos[irt].value.replace('#' + wti,'#' + newtb + ' (via "' + wti + '")')).replace(/\#$/g,''); lastrerun=false; if (irt == 0) { setTimeout(function(){ if (top.window.opener.parent.window.opener.document.getElementById('dajaxs')) { if (top.window.opener.parent.window.opener.document.getElementById('dajaxs').innerHTML == '') { //alert(irt); top.window.opener.parent.window.opener.document.getElementById('dajaxs').innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); } } else if (top.window.opener.parent.window.opener.document.getElementById('myform')) { if (top.window.opener.parent.window.opener.document.getElementById('myform').title == '') { divs=top.window.opener.parent.window.opener.document.getElementsByTagName('div'); //alert('00' + divs.length); if (('' + divs.length) != '0') { divs[eval(-1 + divs.length)].style.display='inline-block'; divs[eval(-1 + divs.length)].innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); } else { top.window.opener.parent.window.opener.document.getElementById('myform').title=top.window.opener.document.getElementById('ajaxs').innerText; } } } else { divs=top.window.opener.parent.window.opener.document.getElementsByTagName('div'); //alert('000' + divs.length + ' ' + divs[eval(-1 + divs.length)].outerHTML); if (('' + divs.length) != '0') { divs[eval(-1 + divs.length)].style.display='inline-block'; divs[eval(-1 + divs.length)].innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); //alert('0000' + divs.length + ' ' + divs[eval(-1 + divs.length)].outerHTML); } else { top.window.opener.parent.window.opener.document.body.title=top.window.opener.document.getElementById('ajaxs').innerText; } } }, 5000); } } else { //alert(11); lastrerun=true; } } else { //alert(111); lastrerun=true; } } } else { //alert(1111); lastrerun=false; } } } rerun=lastrerun; if (rerun) { setTimeout(titlesnnsstbo, 2000); } }
    function ifnnsstbo(inwo) {
    if (!inwo) { return null; }
    shower_songs_tbos.push(inwo);
    return inwo;
    }

    function afternnsstbo(incv) {
    if (eval('' + shower_songs_tbos.length) > 0) {
    setTimeout(titlesnnsstbo, 2000);
    }
    return incv;
    }

    … being called into play via the streamlined (from yesterday) …

    // Talk to shower_songs.html
    if (top.document.URL.indexOf('regarding=') != -1 && top.document.URL.indexOf('isradio=') != -1 && top.document.URL.indexOf('youtube=') != -1) {
    if (top.window.opener) {
    var waszv='';
    for (var inm=0; inm<Math.min(7,eval('' + vidids.length)); inm++) {
    if (ifnnsstbo(top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)))) {
    if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value.indexOf('#') == -1) {
    waszv= top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value;
    top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value=vidids[inm] + '#' + waszv;
    }
    }
    }
    top.window.opener.parent.window.opener.document.body.style.cursor=afternnsstbo('pointer');
    }
    }

And so, yet again, try the changed sixth draft Shower Songs below and helped out a lot via the changed swipe_media.html Radio Play project web application.


Previous relevant Shower Song Radio Play Integration Tutorial is shown below.

Shower Song Radio Play Integration Tutorial

Shower Song Radio Play Integration Tutorial

If you’ll pardon the pun …

We’ve been like a “broken record” regarding that familiar theme of “Sequential Play of YouTube Music Videos” over a few years now

… and today we’re integrating the …

  • Radio Play project smarts of recent times … into no, not the shower, Luna! … but into …
  • Shower Songs

… yay!?! Because, let’s face it, not many of us walk around with 11 character YouTube video codes in our head and no, not there either, Luna!!

That Radio Play project integrated with the great YouTube’s search functionality, to be able to …

  • consider a search string (users can enter via a new textbox within that new form as per yesterday’s advances) … and …
  • return a related 11 character YouTube video code

… as the means by which the user contents parts of our Shower Songs project can be improved a lot, further to yesterday’s Shower Song Remember and Recall Tutorial! Luna?!

Yet again, try the changed fifth draft Shower Songs below and helped out a lot via the changed swipe_media.html Radio Play project web application, as per


<script type=text/javascript>
var dwfrom='youllneverfindthis';
var dwto='youllneverfindthis';
if (document.URL.indexOf('isradio=') != -1) {
dwfrom=' style="min-width:';
dwto=' style="opacity:0.6;cursor:progress;border-left:8px dotted yellow;border-right:8px dotted yellow;min-width:';
}
var bigline="      <button id=bdisco onclick=\"dodisco('bdisco=radnoiswas&');\" style='background-color:yellow;'>" + dword + "<sup>A+V</sup> <span id=bdiscoavb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dodisco('isradio=bdiscoavb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button> <button id=bdiscoa onclick=\"dodisco('bdiscoa=radnoiswas&audio');\" style='background-color:yellow;'>" + dword + "<sub>A-V</sub> <span id=bdiscob title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dodisco('isradio=bdiscob&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>  <button id=bwc onclick=\"dowc('bwc=radnoiswas&');\" style='background-color:yellow;'>" + twcword + "<sup>A+V</sup> <span id=bwcavb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dowc('isradio=bwcavb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button> <button id=bwca onclick=\"dowc('bwca=radnoiswas&audio');\" style='background-color:yellow;'>" + twcword + "<sub>A-V</sub> <span id=bwcb title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dowc('isradio=bwcb&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>  <button id=byr onclick=\"doyr('byr=radnoiswas&');\" style='background-color:yellow;'>" + yrword.replace('YaJUNKcht ', 'Yacht++ ') + "<sup>A+V</sup> <span id=byravb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ doyr('isradio=byravb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>     <button id=byra onclick=\"doyr('byra=radnoiswas&audio');\" style='background-color:yellow;'>" + yrword.replace('YaJUNKcht ', 'Yacht++ ') + "<sub>A-V</sub> <span id=byrb title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ doyr('isradio=byrb&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>    <button id=recallable title=Saved onclick=\"recallit(this);\" style='background-color:orange;visibility:hidden;'></button>";
if (window.opener) {

if (document.URL.indexOf('isradio=') != -1 && document.URL.indexOf('youtube=') != -1) {


// Talk to shower_songs.html
if (top.document.URL.indexOf('regarding=') != -1 && top.document.URL.indexOf('isradio=') != -1 && top.document.URL.indexOf('youtube=') != -1) {
if (top.window.opener) {
var waszv='';
for (var inm=0; inm<Math.min(7,eval('' + vidids.length)); inm++) {
if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm))) {
if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value.indexOf('#') == -1) {
waszv= top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value;
top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value=vidids[inm] + '#' + waszv;
}
}
}
top.window.opener.parent.window.opener.document.body.style.cursor='pointer';
}
}


if (!asa) { assoonas(); }
radioblurb=' ... click on start song (when emojis appear) then we suggest minimising window small but on top (next to other work windows) for radio sequenced play';
var doctt='' + document.title;
document.title=String.fromCodePoint(128251) + ' ' + (location.search.split('regarding=')[1] ? decodeURIComponent(location.search.split('regarding=')[1].split('&')[0]).replace('Yacht Rock','Yacht++ Rock') : '') + ' Radio Play ... ' + doctt;
} else {
if (!asa) { as_soon_as(); } //document.getElementById('td0001').style.border='15px dotted yellow';
radioblurb=' ... please wait for more than one checkbox checked before radio sequenced play is started above';
}
} else if (document.URL.indexOf('isradio=') != -1) {
if (!asa) { as_soon_as(); } //document.getElementById('td0001').style.border='15px dotted yellow';
radioblurb=' ... please wait for more than one checkbox checked before radio sequenced play is started above';
if (document.URL.indexOf('youtube=') != -1) {
var xdoctt='' + document.title;
document.title=String.fromCodePoint(128251) + ' ' + (location.search.split('regarding=')[1] ? decodeURIComponent(location.search.split('regarding=')[1].split('&')[0]).replace('Yacht Rock','Yacht++ Rock') : '') + ' Radio Play ... ' + xdoctt;
}
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
radioblurb+=' and we recommend screen lock on';
}
for (var kk=1; kk<=eval(100 * numc); kk++) {
if (eval(kk % eval('' + bcol.length)) == 0) {
dw+=('<td class=loremipsum data-alt="" data-arb="" data-vid="" data-curs="' + cursanimtwo[cntcurs] + '" alt="Cell ' + kk + radioblurb + cursanimtwo[cntcurs] + '" title="If not showing an image ( this one thanks to Lorem Picsum at https://picsum.photos/ ) or to reveal it behind audio or video foreground content please double click here at cell ' + kk + '." ondblclick=refresh(this.id); id="td' + ('0000' + kk).slice(-4) + '" style="min-width:' + amin + 'px;min-height:' + amin + 'px;width:' + amin + 'px;height:' + amin + "px;background-color:" + bcol[eval(kk % eval('' + bcol.length))] + ";" + 'background-size:contain;background-repeat:no-repeat;">' + grabcontent(eval(-1 + kk)) + '</td>').replace(dwfrom,dwto);
setTimeout(cursanimate, 600);
} else {
dw+=('<td onmousedown="checkmeout(event,false);" ontouchdown="checkmeout(event,false);" oncontextmenu="checkmeout(event,true);" class=inhouse data-alt="" data-arb="" data-vid="" alt="Cell ' + kk + radioblurb + cursanimtwo[cntcurs] + '" title="If not showing an image ( yellow cell ones thanks to Lorem Picsum at https://picsum.photos/ ) please double click here at cell ' + kk + ' or just click to get popup window of associated WordPress Blog Posting else right click for associated Cut to the Chase." ondblclick=refresh(this.id); id="td' + ('0000' + kk).slice(-4) + '" style="min-width:' + amin + 'px;min-height:' + amin + 'px;width:' + amin + 'px;height:' + amin + "px;background-color:" + bcol[eval(kk % eval('' + bcol.length))] + ";" + 'background-size:contain;background-repeat:no-repeat;">' + grabcontent(eval(-1 + kk)) + '</td>').replace(dwfrom,dwto);
}
dwfrom='youllneverfindthis';
dwto='youllneverfindthis';
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && (isPortrait || isLandscape)) {
bigline=bigline.replace(/\>The Wrecking Crew/g,'>The Wrecking <br>Crew').replace(/\>Yacht\+\+ Rock/g,'>Yacht++ <br>Rock').replace(/\>Yacht Rock/g,'>Yacht <br>Rock').replace(/\>Disco/g,'>Disco <br>');
}
document.write(dw + "</tr></table><br>" + bigline);
</script>


Previous relevant Shower Song Remember and Recall Tutorial is shown below.

Shower Song Remember and Recall Tutorial

Shower Song Remember and Recall Tutorial

Following on from yesterday’s Shower Song Mobile User Functionality Tutorial today …

  • we would like to help out the user …
  • via a “remembering” form … assisted by …
  • a “recalling” usefulness via window.localStorage means … and flagged to the user via …
  • delivering dropdown options

… reflecting those settings the user has chosen to remember out of …

  • YouTube 11 character video code(s) (up to 7)
  • an order of play (up to 7)

So, again, try the changed fourth draft Shower Songs below.


Previous relevant Shower Song Mobile User Functionality Tutorial is shown below.

Shower Song Mobile User Functionality Tutorial

Shower Song Mobile User Functionality Tutorial

The better fit “hardware wise” for a “shower scene” is one of the mobile devices. And so, onto yesterday’s Shower Song User Functionality Tutorial we’ve started down Mobile Road to Chickasaw today, easing us into …

  • in the mobile woooorrrrllllddd a red button overlays a YouTube video so that the audio stream of a video tap of a user will be a real user gesture … and if the red buttons are slow to appear, before that the links can navigate you to a YouTube video play scenario, as distinct from …
  • in the non-mobile woooorrrrllllddd (we’ve heard starts near Chickasaw) clicks can be of the programmatical kind … and we recommend “kind clicking” at all times

We’re not saying that there is not more work to do (in “double negative heaven”), but we realized …

  • on mobile a tap interrupts “normal audio play” transmission … different to …
  • on non-mobile a click may not interrupt a previously arranged “normal audio play” transmission

Big deal?! Yes, you’d not think so, but there you are, as we ‘ve been on that little conundrum for two hours now, with lots of blaspheming?!

Much more testing, but we took our iPhone into the shower, placed it far away from the shower near an open window, and picked a good shower song (am a sucker for “I’m With You”), and clicked the looping emoji to just repeat that song four times, as one of our tests … sorry about the long shower … peepholespeople of the wooooooorrrrrlllllddd?!

Try the changed third draft Shower Songs below.


Previous relevant Shower Song User Functionality Tutorial is shown below.

Shower Song User Functionality Tutorial

Shower Song User Functionality Tutorial

Onto yesterday’s Shower Song Primer Tutorial we’ve been shoring up user functionality, today, adding in quite a few emoji button helpers pointing to functionality.

Lots of the thinking revolved around trying to space out the user checkbox clicking on non-mobile control of the HTML input type=checkboxs


disabled

… attribute …


var ftime=true;

function whendo() {
var ccnt=0;
var talisti=eval(-1 + eval('' + document.body.innerHTML.split(' style="z-index:599').length)); //('span');
var talist=document.getElementsByTagName('sup');
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
ccnt++;
}
}
if (eval('' + talist.length) < ccnt) {
setTimeout(whendo, 1000);
} else {
talist=document.getElementsByTagName('a');
for (var iki=0; iki<talist.length; iki++) {
if (talist[iki].outerHTML.indexOf(' class="processytplay"') != -1) {
talist[iki].onmousedown=function(event){ myac(event.target); };
}
}
setTimeout(function(){ cball(false); }, 500);
}


}

function cball(to) {
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
if (to) {
inlist[ik].setAttribute('disabled',to);
} else {
inlist[ik].removeAttribute('disabled');
}
}
}

if (ftime) {
ftime=false;
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(whendo, 1000);
}
}
}

… in the changed second draft Shower Songs as below.


Previous relevant Shower Song Primer Tutorial is shown below.

Shower Song Primer Tutorial

Shower Song Primer Tutorial

We’re onto a new music related project today, with that familiar theme of “Sequential Play of YouTube Music Videos” where today’s project, so far, just hones in on the “audio stream only of those YouTube videos”.

We have some provisos with our Shower Songs collection …

  • it will work on mobile but not to the automated state non-mobile is in, on this first draft …
  • more display niceties to come …
  • user content functionality to come …

… but feel free to set yourself up (but careful of “bathroom mist” not being good for electronic devices) with today’s first draft Shower Songs as below …

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


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


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


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


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


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


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


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

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

Shower Song Media Insertions Tutorial

Shower Song Media Insertions Tutorial

Shower Song Media Insertions Tutorial

The recent Shower Song Radio Play Better Integration Tutorial may represent …


... a Shower Song project "by name" ...

… but recent work and what we have here today, can potentially allow this project’s scope to be a lot more ambitious than that.

So what is today’s work? Well, up until today …

  • data has been YouTube video related data exclusively … but as of today …
  • we integrate our inhouse Client Browsing and Pasting and File Dropping Tutorial‘s web application now capable of …
    • type it in …
    • browse it in …
    • paste it in as text (at an animated GIF slide textbox) … or, as of today …
    • paste it in as graphical content via the inhouse Client Browsing (and now “Pasting”) web application’s iframe element hosted span contenteditable=true onpaste and onblur event savvy new inclusion into the mix
    • drop it in …

    … means to other local media file data conduits …

… and so, on offer to Shower Songs users of the form off the “Songs” button, to add any non-YouTube local media source file data of interest, into the “presentation mix”, via …

HTML

<div id=divcbi style=visibility:hidden;>
<iframe onload="checkit(this);" scrolling=no frameborder=0 id=cbi data-accept="image/*"
style="width:163px; height:228px; margin-top:-204px; display:inline-block; background-color:transparent;"
src="/HTMLCSS/client_browsing.htm?d=31226&wording=Allimages%20images%2E%20">
</iframe>
</div>
Javascript

var twaconto=null, twacontoiurl=null, twacontojurl=null;
var imgo=null;
var imagedurl='', reldone=false;
var bigdu='', lastname='', dcbi='';
var initval='<textarea style=width:98%;height:560px;background-color:#f9f9f9; onblur="popshow(this.value);" id=mysubrip></textarea>', contis='', woo=null;
var curtaidis='', curavid='', curpos=0, curdelta=0, somethingplaying=false, cmds=[], sofara='', gtaidis='', lastgreen=null;
var wastab='', todo='', aone='1', tacstarted=false, onep='p', gdurlf=false, bonep='p', thattaid='', ithattaid=-1, jgoing=false;

function butnotavmediawis(inid) { // to pause
bonep='p';
var xsuff='';
try {
xsuff=inid.split('_')[0].slice(-3)
} catch(yfj) { xsuff=''; }
if ((xsuff + 'x').substring(0,1) == '0') {
if (document.getElementById(inid)) {
if (document.getElementById(inid).placeholder.indexOf('P=play/') != -1 && gdurlf) {
bonep='';
return 'spareu';
}
}
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}

function dotodo() {
if (todo != '') {
if (document.getElementById(todo).placeholder.indexOf('P=play/') != -1) {
document.getElementById(todo).value='P';
}
}
todo='';
}

function tanearest(avoid) {
var myt=document.getElementById('mytable').innerHTML;
if (lastgreen) {
lastgreen.style.border='1px solid black';
}
lastgreen=document.getElementById(myt.split(avoid)[1].split(' id="')[1].split('"')[0])
return lastgreen;
}

function butnotavmediap() {
var inid=gtaidis;
if (gdurlf && document.getElementById('avmedia' + inid.split('_')[0].slice(-3))) {
document.getElementById(inid).placeholder=document.getElementById(inid).placeholder.replace(document.getElementById(inid).placeholder.split('/')[0],'1');
document.getElementById('avmedia' + inid.split('_')[0].slice(-3)).currentTime=0;
gtaidis='';
return 'spareu';
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}

function justtheone() {
jgoing=true;
var iicnt=0, ibn=0, allv=true;
var tasare=document.getElementsByTagName('textarea');
for (ibn=eval(-1 + eval('' + tasare.length)); ibn>=0; ibn--) {
if (tasare[ibn].value != '') { allv=false; }
}
if (allv) {
if (!gdurlf) {
for (ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].placeholder.indexOf('P=pause/') != -1 && tasare[ibn].placeholder.indexOf('0/') != 0 && tasare[ibn].placeholder.indexOf('Audio ') != 0) {
iicnt++;
if (iicnt > 1) {
if (isplayingnum >= 0) {
if (tasare[ibn].id != taids[isplayingnum]) {
if (8 == 7) { tasare[ibn].value='p'; }
}
}
}
}
}
} else {
for (ibn=eval(-1 + eval('' + tasare.length)); ibn>=0; ibn--) {
if (tasare[ibn].placeholder.indexOf('P=pause/') != -1 && tasare[ibn].placeholder.indexOf('0/') != 0 && tasare[ibn].placeholder.indexOf('Audio ') != 0) {
iicnt++;
if (iicnt > 1) {
tasare[ibn].value='p';
}
}
}
}
}
}

function butnotavmediazero(inid) {
if (gdurlf && document.getElementById('avmedia' + inid.split('_')[0].slice(-3))) {
document.getElementById(inid).placeholder=document.getElementById(inid).placeholder.replace(document.getElementById(inid).placeholder.split('/')[0],'1');
document.getElementById('avmedia' + inid.split('_')[0].slice(-3)).currentTime=0;
return 'spareu';
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}

function butnotavmediaone(inid) {
aone='1';
if (gdurlf && document.getElementById('avmedia' + inid.split('_')[0].slice(-3))) {
document.getElementById(inid).placeholder=document.getElementById(inid).placeholder.replace(document.getElementById(inid).placeholder.split('/')[0],'1');
document.getElementById('avmedia' + inid.split('_')[0].slice(-3)).currentTime=0;
return 'spareu';
} else if (gdurlf && document.getElementById(inid).placeholder.indexOf('P=play/') != -1) {
if (5 == 5) {
thistaid='';
if (isplaying == '' && !tacstarted) { cball(true); if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { isplayingnum=eval(-1 + eval('' + inid.split('_')[0].slice(-1))); } setInterval(tacontrol, 2000); }
isplayingnum=eval(-1 + eval('' + inid.split('_')[0].slice(-1)));
isplaying=document.getElementById(inid).placeholder;
//alert(onep);
aone=onep; // 'p';
onep='1';
//thistaid=inid;
//lastgreen=document.getElementById(inid);
//document.getElementById(inid).style.border='2px dotted green';
} else {
todo=inid;
setTimeout(dotodo, 7000); //document.getElementById(inid).value='p'; //alert('huh ' + inid + ' ' + document.getElementById(inid).placeholder);
}
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}

function butnotavmedia(inid) {
var xsuff='';
try {
xsuff=inid.split('_')[0].slice(-3)
} catch(yfj) { xsuff=''; }
if ((xsuff + 'x').substring(0,1) == '0') {
if (gdurlf && document.getElementById('avmedia' + inid.split('_')[0].slice(-3))) {
return 'spareu';
}
}
if (!document.getElementById(inid)) {
var tasare=document.getElementsByTagName('textarea');
for (var ibn=0; ibn<tasare.length; ibn++) {
if (tasare[ibn].outerHTML.indexOf('2px dotted ') != -1) { return '' + tasare[ibn].id; }
}
}
return inid;
}


function cmdsanal() {
var thisthird='';
for (var ii=0; ii<cmds.length; ii++) {
thisthird=cmds[ii].split("','")[2].split("'")[0];
if (sofara.indexOf(',' + thisthird + ',') == -1) {
eval('' + cmds[ii]);
}
}
}


function tadur(thisdur, taidis, thisavoid) {
var thisavo=document.getElementById(thisavoid);
var wasta='' + taidis;
if (!document.getElementById(taidis) || ('' + document.getElementById(taidis)) == 'undefined' || ('' + document.getElementById(taidis)) == 'null') {
if (1 == 1) {
if (sofara.indexOf(',' + thisavoid + ',') == -1) {
if (cmds.indexOf("tadur('" + thisdur + "','undefined','" + thisavoid + "')") == -1) {
cmds.push("tadur('" + thisdur + "','undefined','" + thisavoid + "')");
}
setTimeout(cmdsanal, 800);
}
return '';
} else {
tasx=document.getElementsByTagName('textarea');
for (var ik=0; ik<tasx.length; ik++) {
if (eval(1 + ik) == eval('' + thisavo.id.replace('avmedia00',''))) {
taidis='' + tasx.id;
}
}
if (!document.getElementById(taidis) || ('' + document.getElementById(taidis)) == 'undefined' || ('' + document.getElementById(taidis)) == 'null') {
if (sofara.indexOf(',' + thisavoid + ',') == -1) {
if (cmds.indexOf("tadur('" + thisdur + "','undefined','" + thisavoid + "')") == -1) {
cmds.push("tadur('" + thisdur + "','undefined','" + thisavoid + "')");
}
setTimeout(cmdsanal, 800);
}
return '';
}
}
}
//alert(taidis + ' ' + wasta);
if (('' + document.getElementById(taidis).placeholder) == '1/1') {
//document.title='1:' + taidis + ' ' + thisdur;
sofara+=',' + thisavoid + ',';
curpos=0;
curtaidis=taidis;
curavid='' + thisavo.id;
document.getElementById(taidis).placeholder='1/' + Math.ceil(eval('' + thisdur));
//document.title='1:' + taidis + ' ' + thisdur + ' ' + document.getElementById(taidis).placeholder;
}
thisavo.currentTime=0;
thisavo.setAttribute('data-dur', '' + thisdur);
}


function onesecfn() {
curpos+=curdelta;
if (curdelta != 0 && curpos >= 1) {
document.getElementById(curavid).setAttribute('data-at', '' + eval('' + curpos));
document.getElementById(curtaidis).placeholder='' + curpos + '/' + Math.ceil(eval('' + document.getElementById(curavid).getAttribute('data-dur')));
}
}


function avcount(taidis,playvspause,thisavo) {
if (playvspause) {
curdelta=1;
curtaidis=taidis;
curavid='' + thisavo.id;
if (('' + document.getElementById(curavid).getAttribute('data-at') + '0').substring(0,1) == '0') {
curpos=0;
document.getElementById(taidis).placeholder='1/' + Math.ceil(eval('' + document.getElementById(curavid).getAttribute('data-dur')));
}
if (!somethingplaying) {
somethingplaying=true;
setInterval(onesecfn, 1000);
}
} else {
curdelta=0;
curtaidis=taidis;
curavid='' + thisavo.id;
}
}


function avend(taidis,playvspause,thisavo) {
curdelta=0;
curtaidis=taidis;
curavid='' + thisavo.id;
document.getElementById(taidis).placeholder='' + Math.ceil(eval('' + thisavo.getAttribute('data-dur'))) + '/' + Math.ceil(eval('' + thisavo.getAttribute('data-dur')));
document.getElementById(curavid).setAttribute('data-at', '00');
gtaidis=taidis;
setTimeout(butnotavmediap, 5000);
}

function puttwoto(indu) {
if (indu.indexOf('#') != -1) {
document.getElementById('audioname').value=indu.split('#')[1];
document.getElementById('result').innerHTML=indu.split('#')[0];
} else {
document.getElementById('result').innerHTML=indu; //alert(indu);
}
document.getElementById('divcbi').innerHTML=dcbi;
}

function yesthreethree(inv) {
bigdu=inv;
//alert('x;' + bigdu);
}


function yes_threethree(inv) {
bigdu=inv;
//alert(inv);
}

function yes_file_name(inv, invtwo) {
bigdu=encodeURIComponent(invtwo);
lastname=inv;
//alert('xzz;' + bigdu);
document.getElementById('txttxtout').value=inv;
if (document.getElementById('mydownloada')) {
document.getElementById('mydownloada').download='' + inv;
} else if (document.getElementById('divdownloada')) {
document.getElementById('divdownloada').style.display='inline-block';
document.getElementById('divdownloada').innerHTML='<a data-download="' + inv + '" id=mydownloada style=display:inline-block;><button style=background-color:yellow;>Download ...</button></a>';
document.getElementById('iftxt').src='#';
document.getElementById('iftxt').style.visibility='hidden';
}
}

function utf8ToBase64(str) { // thanks to https://www.google.com/search?q=btoa+InvalidCharacterError%3A+The+string+contains+invalid+characters.&rlz=1C5OZZY_en&oq=btoa+InvalidCharacterError%3A+The+string+contains+invalid+characters.&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRiPAjIHCAIQIRiPAtIBCTQxODNqMGoxNagCCLACAfEFhcuQDq9PfBk&sourceid=chrome&ie=UTF-8
// Encode the Unicode string to a Uint8Array using UTF-8
const utf8Bytes = new TextEncoder().encode(str);

// Convert the Uint8Array to a binary string
const binaryString = String.fromCharCode.apply(null, utf8Bytes);

// Use btoa on the binary string
return btoa(binaryString);
}

function yes_three_three(inv) {
contis=inv;
if (contis.indexOf('<?php') != -1) {
contis=inv.replace(/<\?php/g,'').replace(/\?>/g,'');
} else if (contis.indexOf('<?') == 0) {
contis=inv.replace(/</g,'<').replace(/>/g,'>').replace(/\&\#/g,'&#');
}
var ourcontis=contis.replace(/<textarea/g,'<textarea').replace(/<\/textarea>/g,'</textarea>');
//alert(initval);
document.getElementById('overt').innerHTML=initval.replace('></textarea>', '>' + ourcontis + '</textarea>');
document.getElementById('divdownloada').innerHTML='<a download="' + lastname + '" id=mydownloada style=display:inline-block; href="data:x-application/text,' + escape(document.getElementById('mysubrip').value) + '"><button style=background-color:yellow;>Download ...</button></a>';
//alert(document.getElementById('divdownloada').innerHTML);
if (contis != '') {
document.getElementById('bdisplay').disabled=false; //setAttribute('disabled', false);
if (document.getElementById('mydownloada')) {
//alert(12);
document.getElementById('divdownloada').style.display='inline-block';
//alert(212);
document.getElementById('mydownloada').style.display='inline-block';
//alert(bigdu);
if (bigdu != '' && 1 == 7) {
document.getElementById('mydownloada').href='data:text/plain;base64,' + bigdu;
} else if (bigdu == '' || 7 == 7) {
try {
document.getElementById('mydownloada').href='data:x-application/text,' + escape(inv);
} catch(trr) {
document.getElementById('mydownloada').href='data:text/plain;base64,' + window.btoa(inv);
}
}
//alert(412);
if (document.getElementById('iftxt').src != '#') {
document.getElementById('iftxt').src='/file_open_picker.html?clicktext=yesazs' + Math.floor(Math.random() * 145675);
}
//} else {
// alert(564);
}
}
bigdu='';
}

function oncntapp(tval,newtb,tthis) {
var intb='';
if (('' + tval.length) == '11' || newtb.indexOf('data:') == 0) {
for (var ij=1; ij<=7; ij++) {
if (document.getElementById('inp00' + ij)) {
if (document.getElementById('inp00' + ij).value.trim() == '') {
if (newtb.indexOf('data:') == 0) {
document.getElementById('inp00' + ij).value=newtb;
if (document.getElementById('audioname').value != '') {
document.getElementById('inp00' + ij).title=document.getElementById('audioname').value;
document.getElementById('audioname').value='';
} else if (document.getElementById('thewords').value != '') {
document.getElementById('inp00' + ij).title=document.getElementById('thewords').value;
document.getElementById('thewords').value='';
}
} else {
while ((' ' + newtb).indexOf(" \\" + 'u') != -1) {
intb=newtb.split("\\" + 'u')[0] + "\\" + 'u' + (' ' + newtb).split(" \\" + 'u')[1].split(' ')[0];
newtb=newtb.replace(intb,newtb.split("\\" + 'u')[0] + eval('String.fromCodePoint(0x' + intb.substring(eval(2 + newtb.split("\\" + 'u')[0].length)).replace(/\\\\u/g,',0x') + ')'));
}
document.getElementById('inp00' + ij).value=tval + '#' + newtb;
}
return '';
}
}
}
}
}

function checkit(iois) {
twaconto = (iois.contentWindow || iois.contentDocument);
if (twaconto != null) {
if (twaconto.document) { twaconto = twaconto.document; }
if (twaconto.getElementById('divcopyspan')) {
twacontojurl=twaconto.getElementById('divcopyspan');
}
if (twacontoiurl || twacontojurl) { setInterval(lookfor, 3000); }
}
}

function resultlook() {
if (document.getElementById('result').innerHTML != '' || document.getElementById('resultpdfout').innerHTML != '') {
if (document.getElementById('result').innerHTML != '') {
imagedurl=document.getElementById('result').innerHTML;
} else {
imagedurl=document.getElementById('resultpdfout').innerHTML;
}
//alert(imagedurl);
document.getElementById('result').innerHTML='';
document.getElementById('resultpdfout').innerHTML='';
theimgurl=imagedurl;
theclass=theimgurl.slice(-96).replace(/\:/g,'!').replace(/\./g,'|');
if (document.getElementById('myimg')) {
document.getElementById('myimg').src=imagedurl;
imgo=document.getElementById('myimg');
document.getElementById('myimg').className=theclass;
document.getElementById('imgurl').placeholder=imagedurl;
document.getElementById('imgurl').title=imagedurl;
document.getElementById('imgurl').value='';
} else {
if (5 == 5) {
oncntapp('', imagedurl, null);
}
}
imagedurl='';
document.getElementById('divcbi').innerHTML=dcbi;
}
}

function lookfor() {
var uis=document.getElementById('cbi').src.replace('=','=' + Math.floor(Math.random() * 9));
if (twacontojurl) {
if ((twacontojurl.innerHTML + twacontojurl.title).indexOf('data:') == 0) {
twocontocont='data:' + (twacontojurl.innerHTML + twacontojurl.title).split('data:')[1];
// alert(twocontocont);
if (5 == 5) {
oncntapp('', twocontocont, null);
document.getElementById('divcbi').innerHTML=dcbi;
} else {
document.getElementById('imgurl').value=twocontocont;
}
twacontojurl.innerHTML='';
twacontojurl.title='';
document.getElementById('cbi').style.visibility='hidden';
document.getElementById('cbi').src=uis; //'/HTMLCSS/client_browsing.htm?d=' + Math.floor(Math.random() * 19897865) + '&wording=Allimages%20images%2E%20';
document.getElementById('cbi').style.visibility='visible';
}
}
}

setInterval(resultlook, 5000);

Feel free to try the changed seventh draft Shower Songs below and helped out a lot via that changed swipe_media.html Radio Play project web application and today’s changed client_browsing.htm client side local file browsing HTML and Javascript inhouse helper.


Previous relevant Shower Song Radio Play Better Integration Tutorial is shown below.

Shower Song Radio Play Better Integration Tutorial

Shower Song Radio Play Better Integration Tutorial

When you integrate, as with the day before yesterday’s Shower Song Radio Play Integration Tutorial, there’s the temptation to automate, but go too far.

We were reminded of this, testing a YouTube search string “Pina Colada Song” and the top pick giving us some travel video.

And so with this in mind, we wanted to nuance the integrations to add …

  • the whole Radio Play dropdown element is virtually cloned (with new option subelement onclick function) …

    function oncntapp(tval,newtb,tthis) {
    var intb='';
    if (('' + tval.length) == '11') {
    for (var ij=1; ij<=7; ij++) {
    if (document.getElementById('inp00' + ij)) {
    if (document.getElementById('inp00' + ij).value.trim() == '') {
    while ((' ' + newtb).indexOf(" \\" + 'u') != -1) {
    intb=newtb.split("\\" + 'u')[0] + "\\" + 'u' + (' ' + newtb).split(" \\" + 'u')[1].split(' ')[0];
    newtb=newtb.replace(intb,newtb.split("\\" + 'u')[0] + eval('String.fromCodePoint(0x' + intb.substring(eval(2 + newtb.split("\\" + 'u')[0].length)).replace(/\\\\u/g,',0x') + ')'));
    }
    document.getElementById('inp00' + ij).value=tval + '#' + newtb
    return '';
    }
    }
    }
    }
    }

    … over into the Shower Songs to allow for non “top picks” be easily selectable, perhaps substituting into blanked out poorer entries, in the Shower Songs x 7 textbox form … and …
  • the YouTube title now appears in that textbox value in the form …

    [YouTube-11-code]#[YouTube title] (via "[Search String Used]")

    … via …

    var shower_songs_tbos=[], divs=[];


    function titlesnnsstbo() {
    var rerun=false, wti='', newtb='', intb='';
    var lastrerun=rerun;
    if (eval('' + shower_songs_tbos.length) > 0) {
    for (var irt=0; irt<eval('' + shower_songs_tbos.length); irt++) {
    if (shower_songs_tbos[irt].value.indexOf(' (via "') == -1) {
    //rerun=lastrerun;
    if (top.window.opener) {
    //alert(1);
    if (top.window.opener.document.getElementById('ajaxs')) {
    //alert(8);
    if (top.window.opener.document.getElementById('ajaxs').innerHTML.indexOf(shower_songs_tbos[irt].value.split('#')[0]) != -1) {
    wti=(shower_songs_tbos[irt].value=shower_songs_tbos[irt].value + '#').split('#')[1];
    //alert(wti);
    newtb=top.window.opener.document.getElementById('ajaxs').innerHTML.split(shower_songs_tbos[irt].value.split('#')[0])[1].split('>')[1].split('<')[0].replace(/\'/g,'`').replace(/\"/g,'`').replace(/\#/g,' '); while ((' ' + newtb).indexOf(" \\" + 'u') != -1) { intb=newtb.split("\\" + 'u')[0] + "\\" + 'u' + (' ' + newtb).split(" \\" + 'u')[1].split(' ')[0]; newtb=newtb.replace(intb,newtb.split("\\" + 'u')[0] + eval('String.fromCodePoint(0x' + intb.substring(eval(2 + newtb.split("\\" + 'u')[0].length)).replace(/\\\\u/g,',0x') + ')')); } shower_songs_tbos[irt].value=(shower_songs_tbos[irt].value.replace('#' + wti,'#' + newtb + ' (via "' + wti + '")')).replace(/\#$/g,''); lastrerun=false; if (irt == 0) { setTimeout(function(){ if (top.window.opener.parent.window.opener.document.getElementById('dajaxs')) { if (top.window.opener.parent.window.opener.document.getElementById('dajaxs').innerHTML == '') { //alert(irt); top.window.opener.parent.window.opener.document.getElementById('dajaxs').innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); } } else if (top.window.opener.parent.window.opener.document.getElementById('myform')) { if (top.window.opener.parent.window.opener.document.getElementById('myform').title == '') { divs=top.window.opener.parent.window.opener.document.getElementsByTagName('div'); //alert('00' + divs.length); if (('' + divs.length) != '0') { divs[eval(-1 + divs.length)].style.display='inline-block'; divs[eval(-1 + divs.length)].innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); } else { top.window.opener.parent.window.opener.document.getElementById('myform').title=top.window.opener.document.getElementById('ajaxs').innerText; } } } else { divs=top.window.opener.parent.window.opener.document.getElementsByTagName('div'); //alert('000' + divs.length + ' ' + divs[eval(-1 + divs.length)].outerHTML); if (('' + divs.length) != '0') { divs[eval(-1 + divs.length)].style.display='inline-block'; divs[eval(-1 + divs.length)].innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); //alert('0000' + divs.length + ' ' + divs[eval(-1 + divs.length)].outerHTML); } else { top.window.opener.parent.window.opener.document.body.title=top.window.opener.document.getElementById('ajaxs').innerText; } } }, 5000); } } else { //alert(11); lastrerun=true; } } else { //alert(111); lastrerun=true; } } } else { //alert(1111); lastrerun=false; } } } rerun=lastrerun; if (rerun) { setTimeout(titlesnnsstbo, 2000); } }
    function ifnnsstbo(inwo) {
    if (!inwo) { return null; }
    shower_songs_tbos.push(inwo);
    return inwo;
    }

    function afternnsstbo(incv) {
    if (eval('' + shower_songs_tbos.length) > 0) {
    setTimeout(titlesnnsstbo, 2000);
    }
    return incv;
    }

    … being called into play via the streamlined (from yesterday) …

    // Talk to shower_songs.html
    if (top.document.URL.indexOf('regarding=') != -1 && top.document.URL.indexOf('isradio=') != -1 && top.document.URL.indexOf('youtube=') != -1) {
    if (top.window.opener) {
    var waszv='';
    for (var inm=0; inm<Math.min(7,eval('' + vidids.length)); inm++) {
    if (ifnnsstbo(top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)))) {
    if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value.indexOf('#') == -1) {
    waszv= top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value;
    top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value=vidids[inm] + '#' + waszv;
    }
    }
    }
    top.window.opener.parent.window.opener.document.body.style.cursor=afternnsstbo('pointer');
    }
    }

And so, yet again, try the changed sixth draft Shower Songs below and helped out a lot via the changed swipe_media.html Radio Play project web application.


Previous relevant Shower Song Radio Play Integration Tutorial is shown below.

Shower Song Radio Play Integration Tutorial

Shower Song Radio Play Integration Tutorial

If you’ll pardon the pun …

We’ve been like a “broken record” regarding that familiar theme of “Sequential Play of YouTube Music Videos” over a few years now

… and today we’re integrating the …

  • Radio Play project smarts of recent times … into no, not the shower, Luna! … but into …
  • Shower Songs

… yay!?! Because, let’s face it, not many of us walk around with 11 character YouTube video codes in our head and no, not there either, Luna!!

That Radio Play project integrated with the great YouTube’s search functionality, to be able to …

  • consider a search string (users can enter via a new textbox within that new form as per yesterday’s advances) … and …
  • return a related 11 character YouTube video code

… as the means by which the user contents parts of our Shower Songs project can be improved a lot, further to yesterday’s Shower Song Remember and Recall Tutorial! Luna?!

Yet again, try the changed fifth draft Shower Songs below and helped out a lot via the changed swipe_media.html Radio Play project web application, as per


<script type=text/javascript>
var dwfrom='youllneverfindthis';
var dwto='youllneverfindthis';
if (document.URL.indexOf('isradio=') != -1) {
dwfrom=' style="min-width:';
dwto=' style="opacity:0.6;cursor:progress;border-left:8px dotted yellow;border-right:8px dotted yellow;min-width:';
}
var bigline="      <button id=bdisco onclick=\"dodisco('bdisco=radnoiswas&');\" style='background-color:yellow;'>" + dword + "<sup>A+V</sup> <span id=bdiscoavb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dodisco('isradio=bdiscoavb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button> <button id=bdiscoa onclick=\"dodisco('bdiscoa=radnoiswas&audio');\" style='background-color:yellow;'>" + dword + "<sub>A-V</sub> <span id=bdiscob title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dodisco('isradio=bdiscob&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>  <button id=bwc onclick=\"dowc('bwc=radnoiswas&');\" style='background-color:yellow;'>" + twcword + "<sup>A+V</sup> <span id=bwcavb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dowc('isradio=bwcavb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button> <button id=bwca onclick=\"dowc('bwca=radnoiswas&audio');\" style='background-color:yellow;'>" + twcword + "<sub>A-V</sub> <span id=bwcb title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dowc('isradio=bwcb&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>  <button id=byr onclick=\"doyr('byr=radnoiswas&');\" style='background-color:yellow;'>" + yrword.replace('YaJUNKcht ', 'Yacht++ ') + "<sup>A+V</sup> <span id=byravb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ doyr('isradio=byravb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>     <button id=byra onclick=\"doyr('byra=radnoiswas&audio');\" style='background-color:yellow;'>" + yrword.replace('YaJUNKcht ', 'Yacht++ ') + "<sub>A-V</sub> <span id=byrb title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ doyr('isradio=byrb&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>    <button id=recallable title=Saved onclick=\"recallit(this);\" style='background-color:orange;visibility:hidden;'></button>";
if (window.opener) {

if (document.URL.indexOf('isradio=') != -1 && document.URL.indexOf('youtube=') != -1) {


// Talk to shower_songs.html
if (top.document.URL.indexOf('regarding=') != -1 && top.document.URL.indexOf('isradio=') != -1 && top.document.URL.indexOf('youtube=') != -1) {
if (top.window.opener) {
var waszv='';
for (var inm=0; inm<Math.min(7,eval('' + vidids.length)); inm++) {
if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm))) {
if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value.indexOf('#') == -1) {
waszv= top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value;
top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value=vidids[inm] + '#' + waszv;
}
}
}
top.window.opener.parent.window.opener.document.body.style.cursor='pointer';
}
}


if (!asa) { assoonas(); }
radioblurb=' ... click on start song (when emojis appear) then we suggest minimising window small but on top (next to other work windows) for radio sequenced play';
var doctt='' + document.title;
document.title=String.fromCodePoint(128251) + ' ' + (location.search.split('regarding=')[1] ? decodeURIComponent(location.search.split('regarding=')[1].split('&')[0]).replace('Yacht Rock','Yacht++ Rock') : '') + ' Radio Play ... ' + doctt;
} else {
if (!asa) { as_soon_as(); } //document.getElementById('td0001').style.border='15px dotted yellow';
radioblurb=' ... please wait for more than one checkbox checked before radio sequenced play is started above';
}
} else if (document.URL.indexOf('isradio=') != -1) {
if (!asa) { as_soon_as(); } //document.getElementById('td0001').style.border='15px dotted yellow';
radioblurb=' ... please wait for more than one checkbox checked before radio sequenced play is started above';
if (document.URL.indexOf('youtube=') != -1) {
var xdoctt='' + document.title;
document.title=String.fromCodePoint(128251) + ' ' + (location.search.split('regarding=')[1] ? decodeURIComponent(location.search.split('regarding=')[1].split('&')[0]).replace('Yacht Rock','Yacht++ Rock') : '') + ' Radio Play ... ' + xdoctt;
}
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
radioblurb+=' and we recommend screen lock on';
}
for (var kk=1; kk<=eval(100 * numc); kk++) {
if (eval(kk % eval('' + bcol.length)) == 0) {
dw+=('<td class=loremipsum data-alt="" data-arb="" data-vid="" data-curs="' + cursanimtwo[cntcurs] + '" alt="Cell ' + kk + radioblurb + cursanimtwo[cntcurs] + '" title="If not showing an image ( this one thanks to Lorem Picsum at https://picsum.photos/ ) or to reveal it behind audio or video foreground content please double click here at cell ' + kk + '." ondblclick=refresh(this.id); id="td' + ('0000' + kk).slice(-4) + '" style="min-width:' + amin + 'px;min-height:' + amin + 'px;width:' + amin + 'px;height:' + amin + "px;background-color:" + bcol[eval(kk % eval('' + bcol.length))] + ";" + 'background-size:contain;background-repeat:no-repeat;">' + grabcontent(eval(-1 + kk)) + '</td>').replace(dwfrom,dwto);
setTimeout(cursanimate, 600);
} else {
dw+=('<td onmousedown="checkmeout(event,false);" ontouchdown="checkmeout(event,false);" oncontextmenu="checkmeout(event,true);" class=inhouse data-alt="" data-arb="" data-vid="" alt="Cell ' + kk + radioblurb + cursanimtwo[cntcurs] + '" title="If not showing an image ( yellow cell ones thanks to Lorem Picsum at https://picsum.photos/ ) please double click here at cell ' + kk + ' or just click to get popup window of associated WordPress Blog Posting else right click for associated Cut to the Chase." ondblclick=refresh(this.id); id="td' + ('0000' + kk).slice(-4) + '" style="min-width:' + amin + 'px;min-height:' + amin + 'px;width:' + amin + 'px;height:' + amin + "px;background-color:" + bcol[eval(kk % eval('' + bcol.length))] + ";" + 'background-size:contain;background-repeat:no-repeat;">' + grabcontent(eval(-1 + kk)) + '</td>').replace(dwfrom,dwto);
}
dwfrom='youllneverfindthis';
dwto='youllneverfindthis';
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && (isPortrait || isLandscape)) {
bigline=bigline.replace(/\>The Wrecking Crew/g,'>The Wrecking <br>Crew').replace(/\>Yacht\+\+ Rock/g,'>Yacht++ <br>Rock').replace(/\>Yacht Rock/g,'>Yacht <br>Rock').replace(/\>Disco/g,'>Disco <br>');
}
document.write(dw + "</tr></table><br>" + bigline);
</script>


Previous relevant Shower Song Remember and Recall Tutorial is shown below.

Shower Song Remember and Recall Tutorial

Shower Song Remember and Recall Tutorial

Following on from yesterday’s Shower Song Mobile User Functionality Tutorial today …

  • we would like to help out the user …
  • via a “remembering” form … assisted by …
  • a “recalling” usefulness via window.localStorage means … and flagged to the user via …
  • delivering dropdown options

… reflecting those settings the user has chosen to remember out of …

  • YouTube 11 character video code(s) (up to 7)
  • an order of play (up to 7)

So, again, try the changed fourth draft Shower Songs below.


Previous relevant Shower Song Mobile User Functionality Tutorial is shown below.

Shower Song Mobile User Functionality Tutorial

Shower Song Mobile User Functionality Tutorial

The better fit “hardware wise” for a “shower scene” is one of the mobile devices. And so, onto yesterday’s Shower Song User Functionality Tutorial we’ve started down Mobile Road to Chickasaw today, easing us into …

  • in the mobile woooorrrrllllddd a red button overlays a YouTube video so that the audio stream of a video tap of a user will be a real user gesture … and if the red buttons are slow to appear, before that the links can navigate you to a YouTube video play scenario, as distinct from …
  • in the non-mobile woooorrrrllllddd (we’ve heard starts near Chickasaw) clicks can be of the programmatical kind … and we recommend “kind clicking” at all times

We’re not saying that there is not more work to do (in “double negative heaven”), but we realized …

  • on mobile a tap interrupts “normal audio play” transmission … different to …
  • on non-mobile a click may not interrupt a previously arranged “normal audio play” transmission

Big deal?! Yes, you’d not think so, but there you are, as we ‘ve been on that little conundrum for two hours now, with lots of blaspheming?!

Much more testing, but we took our iPhone into the shower, placed it far away from the shower near an open window, and picked a good shower song (am a sucker for “I’m With You”), and clicked the looping emoji to just repeat that song four times, as one of our tests … sorry about the long shower … peepholespeople of the wooooooorrrrrlllllddd?!

Try the changed third draft Shower Songs below.


Previous relevant Shower Song User Functionality Tutorial is shown below.

Shower Song User Functionality Tutorial

Shower Song User Functionality Tutorial

Onto yesterday’s Shower Song Primer Tutorial we’ve been shoring up user functionality, today, adding in quite a few emoji button helpers pointing to functionality.

Lots of the thinking revolved around trying to space out the user checkbox clicking on non-mobile control of the HTML input type=checkboxs


disabled

… attribute …


var ftime=true;

function whendo() {
var ccnt=0;
var talisti=eval(-1 + eval('' + document.body.innerHTML.split(' style="z-index:599').length)); //('span');
var talist=document.getElementsByTagName('sup');
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
ccnt++;
}
}
if (eval('' + talist.length) < ccnt) {
setTimeout(whendo, 1000);
} else {
talist=document.getElementsByTagName('a');
for (var iki=0; iki<talist.length; iki++) {
if (talist[iki].outerHTML.indexOf(' class="processytplay"') != -1) {
talist[iki].onmousedown=function(event){ myac(event.target); };
}
}
setTimeout(function(){ cball(false); }, 500);
}


}

function cball(to) {
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
if (to) {
inlist[ik].setAttribute('disabled',to);
} else {
inlist[ik].removeAttribute('disabled');
}
}
}

if (ftime) {
ftime=false;
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(whendo, 1000);
}
}
}

… in the changed second draft Shower Songs as below.


Previous relevant Shower Song Primer Tutorial is shown below.

Shower Song Primer Tutorial

Shower Song Primer Tutorial

We’re onto a new music related project today, with that familiar theme of “Sequential Play of YouTube Music Videos” where today’s project, so far, just hones in on the “audio stream only of those YouTube videos”.

We have some provisos with our Shower Songs collection …

  • it will work on mobile but not to the automated state non-mobile is in, on this first draft …
  • more display niceties to come …
  • user content functionality to come …

… but feel free to set yourself up (but careful of “bathroom mist” not being good for electronic devices) with today’s first draft Shower Songs as below …

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


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


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


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


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


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


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

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

Shower Song Radio Play Better Integration Tutorial

Shower Song Radio Play Better Integration Tutorial

Shower Song Radio Play Better Integration Tutorial

When you integrate, as with the day before yesterday’s Shower Song Radio Play Integration Tutorial, there’s the temptation to automate, but go too far.

We were reminded of this, testing a YouTube search string “Pina Colada Song” and the top pick giving us some travel video.

And so with this in mind, we wanted to nuance the integrations to add …

  • the whole Radio Play dropdown element is virtually cloned (with new option subelement onclick function) …

    function oncntapp(tval,newtb,tthis) {
    var intb='';
    if (('' + tval.length) == '11') {
    for (var ij=1; ij<=7; ij++) {
    if (document.getElementById('inp00' + ij)) {
    if (document.getElementById('inp00' + ij).value.trim() == '') {
    while ((' ' + newtb).indexOf(" \\" + 'u') != -1) {
    intb=newtb.split("\\" + 'u')[0] + "\\" + 'u' + (' ' + newtb).split(" \\" + 'u')[1].split(' ')[0];
    newtb=newtb.replace(intb,newtb.split("\\" + 'u')[0] + eval('String.fromCodePoint(0x' + intb.substring(eval(2 + newtb.split("\\" + 'u')[0].length)).replace(/\\\\u/g,',0x') + ')'));
    }
    document.getElementById('inp00' + ij).value=tval + '#' + newtb
    return '';
    }
    }
    }
    }
    }

    … over into the Shower Songs to allow for non “top picks” be easily selectable, perhaps substituting into blanked out poorer entries, in the Shower Songs x 7 textbox form … and …
  • the YouTube title now appears in that textbox value in the form …

    [YouTube-11-code]#[YouTube title] (via "[Search String Used]")

    … via …

    var shower_songs_tbos=[], divs=[];


    function titlesnnsstbo() {
    var rerun=false, wti='', newtb='', intb='';
    var lastrerun=rerun;
    if (eval('' + shower_songs_tbos.length) > 0) {
    for (var irt=0; irt<eval('' + shower_songs_tbos.length); irt++) {
    if (shower_songs_tbos[irt].value.indexOf(' (via "') == -1) {
    //rerun=lastrerun;
    if (top.window.opener) {
    //alert(1);
    if (top.window.opener.document.getElementById('ajaxs')) {
    //alert(8);
    if (top.window.opener.document.getElementById('ajaxs').innerHTML.indexOf(shower_songs_tbos[irt].value.split('#')[0]) != -1) {
    wti=(shower_songs_tbos[irt].value=shower_songs_tbos[irt].value + '#').split('#')[1];
    //alert(wti);
    newtb=top.window.opener.document.getElementById('ajaxs').innerHTML.split(shower_songs_tbos[irt].value.split('#')[0])[1].split('>')[1].split('<')[0].replace(/\'/g,'`').replace(/\"/g,'`').replace(/\#/g,' '); while ((' ' + newtb).indexOf(" \\" + 'u') != -1) { intb=newtb.split("\\" + 'u')[0] + "\\" + 'u' + (' ' + newtb).split(" \\" + 'u')[1].split(' ')[0]; newtb=newtb.replace(intb,newtb.split("\\" + 'u')[0] + eval('String.fromCodePoint(0x' + intb.substring(eval(2 + newtb.split("\\" + 'u')[0].length)).replace(/\\\\u/g,',0x') + ')')); } shower_songs_tbos[irt].value=(shower_songs_tbos[irt].value.replace('#' + wti,'#' + newtb + ' (via "' + wti + '")')).replace(/\#$/g,''); lastrerun=false; if (irt == 0) { setTimeout(function(){ if (top.window.opener.parent.window.opener.document.getElementById('dajaxs')) { if (top.window.opener.parent.window.opener.document.getElementById('dajaxs').innerHTML == '') { //alert(irt); top.window.opener.parent.window.opener.document.getElementById('dajaxs').innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); } } else if (top.window.opener.parent.window.opener.document.getElementById('myform')) { if (top.window.opener.parent.window.opener.document.getElementById('myform').title == '') { divs=top.window.opener.parent.window.opener.document.getElementsByTagName('div'); //alert('00' + divs.length); if (('' + divs.length) != '0') { divs[eval(-1 + divs.length)].style.display='inline-block'; divs[eval(-1 + divs.length)].innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); } else { top.window.opener.parent.window.opener.document.getElementById('myform').title=top.window.opener.document.getElementById('ajaxs').innerText; } } } else { divs=top.window.opener.parent.window.opener.document.getElementsByTagName('div'); //alert('000' + divs.length + ' ' + divs[eval(-1 + divs.length)].outerHTML); if (('' + divs.length) != '0') { divs[eval(-1 + divs.length)].style.display='inline-block'; divs[eval(-1 + divs.length)].innerHTML=top.window.opener.document.getElementById('ajaxs').outerHTML.replace(' style=',' data-style=').replace(' multiple',' multiple').replace(' onchange=',' data-onchange='); //alert('0000' + divs.length + ' ' + divs[eval(-1 + divs.length)].outerHTML); } else { top.window.opener.parent.window.opener.document.body.title=top.window.opener.document.getElementById('ajaxs').innerText; } } }, 5000); } } else { //alert(11); lastrerun=true; } } else { //alert(111); lastrerun=true; } } } else { //alert(1111); lastrerun=false; } } } rerun=lastrerun; if (rerun) { setTimeout(titlesnnsstbo, 2000); } }
    function ifnnsstbo(inwo) {
    if (!inwo) { return null; }
    shower_songs_tbos.push(inwo);
    return inwo;
    }

    function afternnsstbo(incv) {
    if (eval('' + shower_songs_tbos.length) > 0) {
    setTimeout(titlesnnsstbo, 2000);
    }
    return incv;
    }

    … being called into play via the streamlined (from yesterday) …

    // Talk to shower_songs.html
    if (top.document.URL.indexOf('regarding=') != -1 && top.document.URL.indexOf('isradio=') != -1 && top.document.URL.indexOf('youtube=') != -1) {
    if (top.window.opener) {
    var waszv='';
    for (var inm=0; inm<Math.min(7,eval('' + vidids.length)); inm++) {
    if (ifnnsstbo(top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)))) {
    if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value.indexOf('#') == -1) {
    waszv= top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value;
    top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value=vidids[inm] + '#' + waszv;
    }
    }
    }
    top.window.opener.parent.window.opener.document.body.style.cursor=afternnsstbo('pointer');
    }
    }

And so, yet again, try the changed sixth draft Shower Songs below and helped out a lot via the changed swipe_media.html Radio Play project web application.


Previous relevant Shower Song Radio Play Integration Tutorial is shown below.

Shower Song Radio Play Integration Tutorial

Shower Song Radio Play Integration Tutorial

If you’ll pardon the pun …

We’ve been like a “broken record” regarding that familiar theme of “Sequential Play of YouTube Music Videos” over a few years now

… and today we’re integrating the …

  • Radio Play project smarts of recent times … into no, not the shower, Luna! … but into …
  • Shower Songs

… yay!?! Because, let’s face it, not many of us walk around with 11 character YouTube video codes in our head and no, not there either, Luna!!

That Radio Play project integrated with the great YouTube’s search functionality, to be able to …

  • consider a search string (users can enter via a new textbox within that new form as per yesterday’s advances) … and …
  • return a related 11 character YouTube video code

… as the means by which the user contents parts of our Shower Songs project can be improved a lot, further to yesterday’s Shower Song Remember and Recall Tutorial! Luna?!

Yet again, try the changed fifth draft Shower Songs below and helped out a lot via the changed swipe_media.html Radio Play project web application, as per


<script type=text/javascript>
var dwfrom='youllneverfindthis';
var dwto='youllneverfindthis';
if (document.URL.indexOf('isradio=') != -1) {
dwfrom=' style="min-width:';
dwto=' style="opacity:0.6;cursor:progress;border-left:8px dotted yellow;border-right:8px dotted yellow;min-width:';
}
var bigline="      <button id=bdisco onclick=\"dodisco('bdisco=radnoiswas&');\" style='background-color:yellow;'>" + dword + "<sup>A+V</sup> <span id=bdiscoavb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dodisco('isradio=bdiscoavb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button> <button id=bdiscoa onclick=\"dodisco('bdiscoa=radnoiswas&audio');\" style='background-color:yellow;'>" + dword + "<sub>A-V</sub> <span id=bdiscob title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dodisco('isradio=bdiscob&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>  <button id=bwc onclick=\"dowc('bwc=radnoiswas&');\" style='background-color:yellow;'>" + twcword + "<sup>A+V</sup> <span id=bwcavb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dowc('isradio=bwcavb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button> <button id=bwca onclick=\"dowc('bwca=radnoiswas&audio');\" style='background-color:yellow;'>" + twcword + "<sub>A-V</sub> <span id=bwcb title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dowc('isradio=bwcb&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>  <button id=byr onclick=\"doyr('byr=radnoiswas&');\" style='background-color:yellow;'>" + yrword.replace('YaJUNKcht ', 'Yacht++ ') + "<sup>A+V</sup> <span id=byravb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ doyr('isradio=byravb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>     <button id=byra onclick=\"doyr('byra=radnoiswas&audio');\" style='background-color:yellow;'>" + yrword.replace('YaJUNKcht ', 'Yacht++ ') + "<sub>A-V</sub> <span id=byrb title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ doyr('isradio=byrb&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>    <button id=recallable title=Saved onclick=\"recallit(this);\" style='background-color:orange;visibility:hidden;'></button>";
if (window.opener) {

if (document.URL.indexOf('isradio=') != -1 && document.URL.indexOf('youtube=') != -1) {


// Talk to shower_songs.html
if (top.document.URL.indexOf('regarding=') != -1 && top.document.URL.indexOf('isradio=') != -1 && top.document.URL.indexOf('youtube=') != -1) {
if (top.window.opener) {
var waszv='';
for (var inm=0; inm<Math.min(7,eval('' + vidids.length)); inm++) {
if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm))) {
if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value.indexOf('#') == -1) {
waszv= top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value;
top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value=vidids[inm] + '#' + waszv;
}
}
}
top.window.opener.parent.window.opener.document.body.style.cursor='pointer';
}
}


if (!asa) { assoonas(); }
radioblurb=' ... click on start song (when emojis appear) then we suggest minimising window small but on top (next to other work windows) for radio sequenced play';
var doctt='' + document.title;
document.title=String.fromCodePoint(128251) + ' ' + (location.search.split('regarding=')[1] ? decodeURIComponent(location.search.split('regarding=')[1].split('&')[0]).replace('Yacht Rock','Yacht++ Rock') : '') + ' Radio Play ... ' + doctt;
} else {
if (!asa) { as_soon_as(); } //document.getElementById('td0001').style.border='15px dotted yellow';
radioblurb=' ... please wait for more than one checkbox checked before radio sequenced play is started above';
}
} else if (document.URL.indexOf('isradio=') != -1) {
if (!asa) { as_soon_as(); } //document.getElementById('td0001').style.border='15px dotted yellow';
radioblurb=' ... please wait for more than one checkbox checked before radio sequenced play is started above';
if (document.URL.indexOf('youtube=') != -1) {
var xdoctt='' + document.title;
document.title=String.fromCodePoint(128251) + ' ' + (location.search.split('regarding=')[1] ? decodeURIComponent(location.search.split('regarding=')[1].split('&')[0]).replace('Yacht Rock','Yacht++ Rock') : '') + ' Radio Play ... ' + xdoctt;
}
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
radioblurb+=' and we recommend screen lock on';
}
for (var kk=1; kk<=eval(100 * numc); kk++) {
if (eval(kk % eval('' + bcol.length)) == 0) {
dw+=('<td class=loremipsum data-alt="" data-arb="" data-vid="" data-curs="' + cursanimtwo[cntcurs] + '" alt="Cell ' + kk + radioblurb + cursanimtwo[cntcurs] + '" title="If not showing an image ( this one thanks to Lorem Picsum at https://picsum.photos/ ) or to reveal it behind audio or video foreground content please double click here at cell ' + kk + '." ondblclick=refresh(this.id); id="td' + ('0000' + kk).slice(-4) + '" style="min-width:' + amin + 'px;min-height:' + amin + 'px;width:' + amin + 'px;height:' + amin + "px;background-color:" + bcol[eval(kk % eval('' + bcol.length))] + ";" + 'background-size:contain;background-repeat:no-repeat;">' + grabcontent(eval(-1 + kk)) + '</td>').replace(dwfrom,dwto);
setTimeout(cursanimate, 600);
} else {
dw+=('<td onmousedown="checkmeout(event,false);" ontouchdown="checkmeout(event,false);" oncontextmenu="checkmeout(event,true);" class=inhouse data-alt="" data-arb="" data-vid="" alt="Cell ' + kk + radioblurb + cursanimtwo[cntcurs] + '" title="If not showing an image ( yellow cell ones thanks to Lorem Picsum at https://picsum.photos/ ) please double click here at cell ' + kk + ' or just click to get popup window of associated WordPress Blog Posting else right click for associated Cut to the Chase." ondblclick=refresh(this.id); id="td' + ('0000' + kk).slice(-4) + '" style="min-width:' + amin + 'px;min-height:' + amin + 'px;width:' + amin + 'px;height:' + amin + "px;background-color:" + bcol[eval(kk % eval('' + bcol.length))] + ";" + 'background-size:contain;background-repeat:no-repeat;">' + grabcontent(eval(-1 + kk)) + '</td>').replace(dwfrom,dwto);
}
dwfrom='youllneverfindthis';
dwto='youllneverfindthis';
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && (isPortrait || isLandscape)) {
bigline=bigline.replace(/\>The Wrecking Crew/g,'>The Wrecking <br>Crew').replace(/\>Yacht\+\+ Rock/g,'>Yacht++ <br>Rock').replace(/\>Yacht Rock/g,'>Yacht <br>Rock').replace(/\>Disco/g,'>Disco <br>');
}
document.write(dw + "</tr></table><br>" + bigline);
</script>


Previous relevant Shower Song Remember and Recall Tutorial is shown below.

Shower Song Remember and Recall Tutorial

Shower Song Remember and Recall Tutorial

Following on from yesterday’s Shower Song Mobile User Functionality Tutorial today …

  • we would like to help out the user …
  • via a “remembering” form … assisted by …
  • a “recalling” usefulness via window.localStorage means … and flagged to the user via …
  • delivering dropdown options

… reflecting those settings the user has chosen to remember out of …

  • YouTube 11 character video code(s) (up to 7)
  • an order of play (up to 7)

So, again, try the changed fourth draft Shower Songs below.


Previous relevant Shower Song Mobile User Functionality Tutorial is shown below.

Shower Song Mobile User Functionality Tutorial

Shower Song Mobile User Functionality Tutorial

The better fit “hardware wise” for a “shower scene” is one of the mobile devices. And so, onto yesterday’s Shower Song User Functionality Tutorial we’ve started down Mobile Road to Chickasaw today, easing us into …

  • in the mobile woooorrrrllllddd a red button overlays a YouTube video so that the audio stream of a video tap of a user will be a real user gesture … and if the red buttons are slow to appear, before that the links can navigate you to a YouTube video play scenario, as distinct from …
  • in the non-mobile woooorrrrllllddd (we’ve heard starts near Chickasaw) clicks can be of the programmatical kind … and we recommend “kind clicking” at all times

We’re not saying that there is not more work to do (in “double negative heaven”), but we realized …

  • on mobile a tap interrupts “normal audio play” transmission … different to …
  • on non-mobile a click may not interrupt a previously arranged “normal audio play” transmission

Big deal?! Yes, you’d not think so, but there you are, as we ‘ve been on that little conundrum for two hours now, with lots of blaspheming?!

Much more testing, but we took our iPhone into the shower, placed it far away from the shower near an open window, and picked a good shower song (am a sucker for “I’m With You”), and clicked the looping emoji to just repeat that song four times, as one of our tests … sorry about the long shower … peepholespeople of the wooooooorrrrrlllllddd?!

Try the changed third draft Shower Songs below.


Previous relevant Shower Song User Functionality Tutorial is shown below.

Shower Song User Functionality Tutorial

Shower Song User Functionality Tutorial

Onto yesterday’s Shower Song Primer Tutorial we’ve been shoring up user functionality, today, adding in quite a few emoji button helpers pointing to functionality.

Lots of the thinking revolved around trying to space out the user checkbox clicking on non-mobile control of the HTML input type=checkboxs


disabled

… attribute …


var ftime=true;

function whendo() {
var ccnt=0;
var talisti=eval(-1 + eval('' + document.body.innerHTML.split(' style="z-index:599').length)); //('span');
var talist=document.getElementsByTagName('sup');
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
ccnt++;
}
}
if (eval('' + talist.length) < ccnt) {
setTimeout(whendo, 1000);
} else {
talist=document.getElementsByTagName('a');
for (var iki=0; iki<talist.length; iki++) {
if (talist[iki].outerHTML.indexOf(' class="processytplay"') != -1) {
talist[iki].onmousedown=function(event){ myac(event.target); };
}
}
setTimeout(function(){ cball(false); }, 500);
}


}

function cball(to) {
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
if (to) {
inlist[ik].setAttribute('disabled',to);
} else {
inlist[ik].removeAttribute('disabled');
}
}
}

if (ftime) {
ftime=false;
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(whendo, 1000);
}
}
}

… in the changed second draft Shower Songs as below.


Previous relevant Shower Song Primer Tutorial is shown below.

Shower Song Primer Tutorial

Shower Song Primer Tutorial

We’re onto a new music related project today, with that familiar theme of “Sequential Play of YouTube Music Videos” where today’s project, so far, just hones in on the “audio stream only of those YouTube videos”.

We have some provisos with our Shower Songs collection …

  • it will work on mobile but not to the automated state non-mobile is in, on this first draft …
  • more display niceties to come …
  • user content functionality to come …

… but feel free to set yourself up (but careful of “bathroom mist” not being good for electronic devices) with today’s first draft Shower Songs as below …

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


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


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


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


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


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

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

Client Browsing and Pasting and File Dropping Tutorial

Client Browsing and Pasting and File Dropping Tutorial

Client Browsing and Pasting and File Dropping Tutorial

As of today, further to the recent Animated GIF Creator Client Browsing and Pasting Tutorial, our Inhouse Client Browsing web application, in standalone mode, can accept input via …

  • type it in …
  • browse it in …
  • paste it in as text (at an animated GIF slide textbox, that is) … or, as of today …
  • paste it in as graphical content via the inhouse Client Browsing (and now “Pasting”) web application’s iframe element hosted span contenteditable=true onpaste and onblur event savvy new inclusion into the mix
  • drop it in …

(dragging a file from another source, such as the macOS Finder desktop application and) dropping into that same HTML span contenteditable=true onpaste and onblur, and now ondrop, savvy element, using the changed client_browsing.htm client side local file browsing (and pasting) HTML and Javascript inhouse helper


function dragstart(ev) { // thanks to https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop
lastelem=ev.target;
if (('' + ev.target.outerHTML).indexOf('<span ') == 0) { // thanks to https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData
// Change the source element's background color
// to show that drag has started
ev.currentTarget.classList.add("dragging");
// Clear the drag data cache (for all formats/types)
ev.dataTransfer.clearData();
// Set the drag's format and data.
// Use the event target's id for the data
ev.dataTransfer.setData("text/uri-list", ev.target.id); //"image/png", ev.target.innerHTML);
//ev.dataTransfer.setData(
// "text/uri-list",
// ev.target.ownerDocument.location.href
//);
} else {
ev.dataTransfer.setData("text/plain", '');
}
}

function dragover(ev) { // thanks to https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop
//ev.preventDefault();
const fileItems = [...ev.dataTransfer.items].filter(
(item) => item.kind === "file",
);
if (fileItems.length > 0) {
ev.preventDefault();
if (fileItems.some((item) => item.type.startsWith("image/"))) {
ev.dataTransfer.dropEffect = "copy";
} else if (fileItems.some((item) => item.type.startsWith("video/"))) {
ev.dataTransfer.dropEffect = "copy";
} else if (fileItems.some((item) => item.type.startsWith("audio/"))) {
ev.dataTransfer.dropEffect = "copy";
} else if (fileItems.some((item) => item.type.startsWith("text/"))) {
ev.dataTransfer.dropEffect = "copy";
} else if (fileItems.some((item) => item.type.contains("/pdf"))) {
ev.dataTransfer.dropEffect = "copy";
} else {
ev.dataTransfer.dropEffect = "none";
}
}
}

function displayImages(files) {
for (const file of files) {
if (file.type.startsWith("image/")) {
const li = document.createElement("li");
const img = document.createElement("img");
img.src = URL.createObjectURL(file);
img.alt = file.name;
li.appendChild(img);
li.appendChild(document.createTextNode(file.name));
document.getElementById('dsimgis').appendChild(li);
document.getElementById('ssimgis').innerHTML=document.getElementById('ssimgis').innerHTML.replace('Image(s) ',' ') + ' Image(s) ';
document.getElementById('dsimgis').open=true;
document.getElementById('dsimgis').scrollIntoView();


// Set as image source
const imgf = new Image();

imgf.onload = function(){
//document.title=';';
var zcanvas = document.createElement('canvas');
zcanvas.width = imgf.width;
zcanvas.height = imgf.height;
var zctx = zcanvas.getContext('2d');
zctx.drawImage(imgf, 0, 0);
xaltdu=zcanvas.toDataURL("image/jpeg", 0.1);
if (('' + typeof parent.puttwoto) == 'function') {
parent.puttwoto(xaltdu);
}
itype='image/jpeg';
//imgf.src=xaltdu;
if (one_conduit) {
var zxssuffix=0, zxnsuffix='2', waszxssuffix=0;
document.getElementById('divcopyspan').innerHTML='';
document.getElementById('divcopyspan').title=xaltdu;
if (parent.document.getElementById('slideshow' + ('' + zxssuffix).replace(/^0/g,'')).value != '') {
while (parent.document.getElementById('slideshow' + ('' + zxssuffix).replace(/^0/g,'')).value != '') {
waszxssuffix=zxssuffix;
zxssuffix++;
if (zxssuffix == 1) { zxssuffix++; }
zxnsuffix='' + zxssuffix;
}
}
if (('' + typeof parent.maybenomore) == 'function') {
//alert(3526);
if (!parent.maybenomore()) { parent.maybemore(xaltdu, 'slideshow' + waszxssuffix, parent.document.getElementById('slideshow' + ('' + zxssuffix).replace(/^0/g,''))); }
//alert(3536);
setTimeout(function(){
//alert(452);
if (gxssuffix == '-1') {
gxssuffix='0';
gxnsuffix='2';
}
if (('' + parent.document.getElementById('slideshow' + gxssuffix.replace(/^0/g,'')).value) == '' && ('' + parent.document.getElementById('slideshow' + gxnsuffix.replace(/^0/g,'')).value) != '') {
// alert(451);
parent.document.getElementById('slideshow' + gxssuffix.replace(/^0/g,'')).value=xaltdu; //parent.document.getElementById('slideshow' + gxnsuffix.replace(/^0/g,'')).value;
parent.document.getElementById('slideshow' + gxssuffix.replace(/^0/g,'')).value='';
}
while (('' + parent.document.getElementById('slideshow' + gxssuffix.replace(/^0/g,'')).value).replace(/^undefined$/g,'').replace(/^null$/g,'') != '') {
gxssuffix='' + eval(0 + eval('' + gxnsuffix));
gxnsuffix='' + eval(1 + eval('' + gxnsuffix));
}
}, 4000);
} else {
//alert('Xaltdu.length=' + xaltdu.length + ' ' + xaltdu.substring(0,29));
parent.maybemore(xaltdu, 'slideshow' + waszxssuffix, parent.document.getElementById('slideshow' + ('' + zxssuffix).replace(/^0/g,'')));
setTimeout(function(){
if (gxssuffix == '-1') {
gxssuffix='0';
gxnsuffix='2';
}
if (('' + parent.document.getElementById('slideshow' + gxssuffix.replace(/^0/g,'')).value) == '' && ('' + parent.document.getElementById('slideshow' + gxnsuffix.replace(/^0/g,'')).value) != '') {
parent.document.getElementById('slideshow' + gxssuffix.replace(/^0/g,'')).value=xaltdu; //parent.document.getElementById('slideshow' + gxnsuffix.replace(/^0/g,'')).value;
parent.document.getElementById('slideshow' + gxssuffix.replace(/^0/g,'')).value='';
}
while (('' + parent.document.getElementById('slideshow' + gxssuffix.replace(/^0/g,'')).value).replace(/^undefined$/g,'').replace(/^null$/g,'') != '') {
gxssuffix='' + eval(0 + eval('' + gxnsuffix));
gxnsuffix='' + eval(1 + eval('' + gxnsuffix));
}
}, 4000);
}
setTimeout(function(){
if (parent.document.getElementById('cbi')) {
parent.document.getElementById('cbi').scrolling='yes';
parent.document.getElementById('cbi').src=document.URL;
} else {
location.href=document.URL;
}
}, 8000);
}
};
imgf.src=img.src;

} else if (file.type.startsWith("video/")) {
const li = document.createElement("li");
const img = document.createElement("video");
img.src = URL.createObjectURL(file);
img.alt = file.name;
img.controls=true;
li.appendChild(img);
li.appendChild(document.createTextNode(file.name));
document.getElementById('dsimgis').appendChild(li);
document.getElementById('ssimgis').innerHTML=document.getElementById('ssimgis').innerHTML.replace('Video(s) ',' ') + ' Video(s) ';
document.getElementById('dsimgis').open=true;
document.getElementById('dsimgis').scrollIntoView();
} else if (file.type.startsWith("audio/")) {
const li = document.createElement("li");
const img = document.createElement("audio");
img.src = URL.createObjectURL(file);
img.alt = file.name;
img.controls=true;
li.appendChild(img);
li.appendChild(document.createTextNode(file.name));
document.getElementById('dsimgis').appendChild(li);
document.getElementById('ssimgis').innerHTML=document.getElementById('ssimgis').innerHTML.replace('Audio(s) ',' ') + ' Audio(s) ';
document.getElementById('dsimgis').open=true;
document.getElementById('dsimgis').scrollIntoView();
} else if (file.type.startsWith("text/") || ('' + file.type).indexOf('/pdf') != -1) {
var thingo='innerHTML';
const li = document.createElement("li");
var etype='textarea';
if (('' + file.type) == 'text/html') {
etype='iframe';
thingo='srcdoc';
} else if (('' + file.type).indexOf('/pdf') != -1) {
etype='embed';
thingo='data';
}
const img = document.createElement(etype);
img.alt = file.name;
if (('' + file.type) == 'text/html') {
img.srcdoc=URL.createObjectURL(file);
} else if (('' + file.type).indexOf('/pdf') != -1) {
img.type=file.type;
img.src=URL.createObjectURL(file);
} else {
img.innerHTML=URL.createObjectURL(file);
}
li.appendChild(img);
li.appendChild(document.createTextNode(file.name));
document.getElementById('dsimgis').appendChild(li);
document.getElementById('ssimgis').innerHTML=document.getElementById('ssimgis').innerHTML.replace('Text(s) ',' ') + ' Text(s) ';
document.getElementById('dsimgis').open=true;
document.getElementById('dsimgis').scrollIntoView();
}
}
}

function drop(ev) { // thanks to https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop
ev.preventDefault();
const files = [...ev.dataTransfer.items]
.map((item) => item.getAsFile())
.filter((file) => file);
displayImages(files);
}


Previous relevant Animated GIF Creator Client Browsing and Pasting Tutorial is shown below.

Animated GIF Creator Client Browsing and Pasting Tutorial

Animated GIF Creator Client Browsing and Pasting Tutorial

Today’s presentation combines …

… that being the inhouse Animated GIF Creator and its interfacings, in turn, to the inhouse Client Browsing (and now “Pasting”) web application, so that as far as slideshow image defining goes you can …

  • type it in …
  • browse it in …
  • paste it in as text (at an animated GIF slide textbox, that is) … or, as of today …
  • paste it in as graphical content via the inhouse Client Browsing (and now “Pasting”) web application’s iframe element hosted span contenteditable=true onpaste and onblur event savvy new inclusion into the mix

We reserve the right to tweak, but, feel free to try it out, if you like with …


Previous relevant Client Browsing Safari Image Blob Copy Canvas Paste Tutorial is shown below.

Client Browsing Safari Image Blob Copy Canvas Paste Tutorial

Client Browsing Safari Image Blob Copy Canvas Paste Tutorial

Yes, yesterday’s Client Browsing Mimetypes Not Image Copying Tutorial‘s issue …

where, with images, we noticed Safari needs more consideration as it output “blob” URLs within the copied buffer

… ended up, for us, involving HTML5


canvas

… element as the “go between” …

  • from a “blob” (output with image graphical Copy buffers on Safari) …
  • to the data URI we are more comfortable working with as your generic image (img element) data representative

… via new …


if (isSafari) { // thanks to https://www.google.com/search?q=safari+returns+image+paste+as+blob+reader.result%3D%27%27&sca_esv=75e6d7a8c6f57b91&rlz=1C5OZZY_en&sxsrf=ANbL-n7aIEShTuNr1B3m9mwDmxo6Y6DyLg%3A1775970178074&ei=gifbaeiUBIj61e8PjM31sQ4&biw=1440&bih=741&ved=0ahUKEwjo3eG8xOeTAxUIffUHHYxmPeYQ4dUDCBE&uact=5&oq=safari+returns+image+paste+as+blob+reader.result%3D%27%27&gs_lp=Egxnd3Mtd2l6LXNlcnAiM3NhZmFyaSByZXR1cm5zIGltYWdlIHBhc3RlIGFzIGJsb2IgcmVhZGVyLnJlc3VsdD0nJzIFECEYoAFIoS5QggdYuSlwAXgAkAEAmAHhAaAB2geqAQUwLjMuMrgBA8gBAPgBAfgBApgCBqAChAjCAg4QABiABBiwAxiGAxiKBcICCBAAGLADGO8FwgIEECMYJ8ICBRAAGO8FmAMAiAYBkAYFkgcFMS4zLjKgB50OsgcFMC4zLjK4B_gHwgcHMC4yLjMuMcgHF4AIAA&sclient=gws-wiz-serp and https://stackoverflow.com/questions/38004917/how-to-render-a-blob-on-a-canvas-element
document.addEventListener('paste', (event) => {
const items = (event.clipboardData || event.originalEvent.clipboardData).items;
for (const item of items) {
if (item.type.indexOf('image') !== -1) {
itype='' + item.type;
const blob = item.getAsFile();
// Create a temporary URL for the blob
const url = URL.createObjectURL(blob);

// Set as image source
const imgf = new Image();

imgf.onload = function(){
//document.title=';';
var zcanvas = document.createElement('canvas');
zcanvas.width = imgf.width;
zcanvas.height = imgf.height;
var zctx = zcanvas.getContext('2d');
zctx.drawImage(imgf, 0, 0);
xaltdu=zcanvas.toDataURL("image/jpeg", 0.1);
itype='image/jpeg';
imgf.src=xaltdu;

// Get JPG as Data URL (quality 0.9)

//document.getElementById('ssimgis').innerHTML='Image';
//document.getElementById('dsimgis').appendChild(imgf);
//document.getElementById('dsimgis').open=true;

//xaltdu=document.getElementById('dsimgis').innerHTML.split(' src="')[1].split('"')[0];
setTimeout(function(){ xaltdu=''; }, 24100); //xaltdu='';
document.getElementById('divcopyspan').innerHTML='';
document.getElementById('divcopyspan').title=xaltdu;
mydivo.innerHTML='⬆️ 🖼️';
othertypes();

}

imgf.src = url;

// Optional: Revoke to free memory
// img.onload = () => URL.revokeObjectURL(url);
}
}
});
}

… in the changed client_browsing.htm client side local file browsing HTML and Javascript inhouse helper.


Previous relevant Client Browsing Mimetypes Not Image Copying Tutorial is shown below.

Client Browsing Mimetypes Not Image Copying Tutorial

Client Browsing Mimetypes Not Image Copying Tutorial

Extending yesterday’s Called Upon Client Browsing Specifically Onpaste Image Copying Tutorial

  • exclusively image (media) functioning copy and paste functionality … today we shore up …
  • other mimetypes … starting with …
    1. text
    2. video
    3. audio

    … interfacing functionality

In amongst the text work we saw some categories of input data, as per …

  • select all/copy PDF from within a PDF application … paste (into span contenteditable=true element)
  • select all/copy pure HTML from within a text editor application … paste (into span contenteditable=true element)
  • select all/copy WordPress [] blog posting prefixed HTML from within a text editor application … paste (into span contenteditable=true element)
  • select all/copy just plain text from within a text editor application … paste (into span contenteditable=true element)

… via modes of input …

  • select all/copy of graphical data … where, with images, we noticed Safari needs more consideration as it output “blob” URLs within the copied buffer …
  • select all/copy of just the data URI (eg. Google Image Search of “clipart”->right click->Copy Image Address can output)

… regarding the standalone mode of use of the changed client_browsing.htm client side local file browsing HTML and Javascript inhouse helper.


Previous relevant Called Upon Client Browsing Specifically Onpaste Image Copying Tutorial is shown below.

Called Upon Client Browsing Specifically Onpaste Image Copying Tutorial

Called Upon Client Browsing Specifically Onpaste Image Copying Tutorial

Yesterday’s Called Upon Client Browsing Onpaste Image Copying Tutorial had us adjusting …

… optional, but potential, use of image copying and pasting via the dual purpose (unchanged from yesterday) local file browsing HTML and Javascript inhouse helper


var twaconto=null, twacontoiurl=null, twacontojurl=null;

function lookfor() {
var uis=document.getElementById('cbi').src.replace('=','=' + Math.floor(Math.random() * 9));
if (twacontojurl) {
if ((twacontojurl.innerHTML + twacontojurl.title).indexOf('data:') == 0) {
twocontocont='data:' + (twacontojurl.innerHTML + twacontojurl.title).split('data:')[1];
document.getElementById('imgurl').value=twocontocont;
twacontojurl.innerHTML='';
twacontojurl.title='';
document.getElementById('cbi').style.visibility='hidden';
document.getElementById('cbi').src=uis; //'/HTMLCSS/client_browsing.htm?d=' + Math.floor(Math.random() * 19897865) + '&wording=Allimages%20images%2E%20';
document.getElementById('cbi').style.visibility='visible';
}
}
}

function checkit(iois) {
twaconto = (iois.contentWindow || iois.contentDocument);
if (twaconto != null) {
if (twaconto.document) { twaconto = twaconto.document; }
if (twaconto.getElementById('divcopyspan')) {
twacontojurl=twaconto.getElementById('divcopyspan');
}
if (twacontoiurl || twacontojurl) { setInterval(lookfor, 3000); }
}
}

… where the browsing smarts of the inhouse client browser are catered for elsewhere, and so, Javascript global variable twacontoiurl is unused.


Previous relevant Called Upon Client Browsing Onpaste Image Copying Tutorial is shown below.

Called UponClient Browsing Onpaste Image Copying Tutorial

Called Upon Client Browsing Onpaste Image Copying Tutorial

As promised at yesterday’s Client Browsing Onpaste Image Copying Tutorial, today, we start looking further than …

  • yesterday’s “standalone” incarnation of our now potentially dual purpose “browsing and pasting” inhouse client browsing web application … to, today …
  • “called upon” incarnation of our inhouse client browsing web application

… and, as we suspected, today’s first look was pretty salutary in proving “no one paradigm size fits all” with the number of scenarios a “called upon” incarnation of our inhouse client browsing web application can throw up.

Where we think the inhouse client browsing web application for this new “paste” functionality can flourish can be via what we like to call “client pre-emptive iframe” Javascript logic back at the caller, where we extend the code for that HTML iframe’s onload event …


var twaconto=null, twacontoiurl=null, twacontojurl=null;

function lookfor() {
if (twacontojurl) {
if ((twacontojurl.innerHTML + twacontojurl.title).indexOf('data:') == 0) {
twocontocont='data:' + (twacontojurl.innerHTML + twacontojurl.title).split('data:')[1];
document.getElementById('background').value=twocontocont;
twacontojurl.innerHTML='';
twacontojurl.title='';
if (twocontocont.replace('/gif','.gif') == -1 || (twocontocont.indexOf('data:') == 0 || twocontocont.slice(-5).indexOf('.') != -1)) {
setTimeout(reduceimsize, 100);
} else {
console.log('why? ' + twocontocont.substring(0,200));
}
document.getElementById('cbi').style.visibility='hidden';
document.getElementById('cbi').src='/HTMLCSS/client_browsing.htm?d=' + Math.floor(Math.random() * 19897865) + '&wording=Allimages%20images%2E%20';
document.getElementById('cbi').style.visibility='visible';
setTimeout(refocus,1500);
}
}

if (twacontoiurl) {
if (twacontoiurl.innerHTML.indexOf('data:') == 0) {
twocontocont=twacontoiurl.innerHTML;
twacontoiurl.innerHTML='';
document.getElementById('background').value=twocontocont;
if (twocontocont.replace('/gif','.gif') == -1 || (twocontocont.indexOf('data:') == 0 || twocontocont.slice(-5).indexOf('.') != -1)) {
setTimeout(reduceimsize, 100);
} else {
console.log('why? ' + twocontocont.substring(0,200));
}
document.getElementById('cbi').style.visibility='hidden';
document.getElementById('cbi').src='/HTMLCSS/client_browsing.htm?d=' + Math.floor(Math.random() * 19897865) + '&wording=Allimages%20images%2E%20';
document.getElementById('cbi').style.visibility='visible';
setTimeout(refocus,1500);
}
}
}

function checkit(iois) {
twaconto = (iois.contentWindow || iois.contentDocument);
if (twaconto != null) {
if (twaconto.document) { twaconto = twaconto.document; }
twacontoiurl=document.getElementById('result');
if (twaconto.getElementById('divcopyspan')) {
twacontojurl=twaconto.getElementById('divcopyspan');
}

if (twacontoiurl) { setInterval(lookfor, 3000); }
}
}

… featuring in our changed audio_card.htm Audio Card example call of the changed client_browsing.htm client side local file browsing HTML and Javascript inhouse helper.


Previous relevant Client Browsing Onpaste Image Copying Tutorial is shown below.

Client Browsing Onpaste Image Copying Tutorial

Client Browsing Onpaste Image Copying Tutorial

Don’t mean to sound like a broken record, but the sentiments of …

The recent onpaste event work has other places of “interventional interest”, for us, on top of the day before yesterday’s One Image Website Onpaste Uploading Device Copying Tutorial.

… continue today (building on yesterday’s Universal Clipboard Onpaste Canvas Annotations Tutorial), adding onpaste Image copying and Pasting logic into …

  • today, our inhouse client browsing web application, in standalone mode … and then …
  • tomorrow and on, our inhouse client browsing web application, being called upon

… so that, as far as Image data goes, this inhouse client browsing web application is dual purpose, the user able to …

  1. click a button to go file browsing for that (Image) file … or, for example …
    • mobile device
    • take a photograph via mobile device Camera app … and it being iOS iPhone …
    • via Photos app hover over relevant image and tap Copy option … and it being iOS iPhone with a MacBook Air of the same network nearby …
    • be in a web browser starting up our inhouse client browsing (and, now, image copy pasting) web application … with one new HTML span contenteditable=true onpaste and onblur savvy …

      <span title=""Image copy paste here." onclick="csclick=0; setTimeout(csc,20000); event.stopPropagation();" onblur="youruplit(this,1);" onpaste="youruplit(this,0);" contenteditable="true" id="imgcopycheck" style="border:2px dotted red;width:50px;height:25px;display:inline-block;">&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;</span>

      … element …
    • click on that new span element …
    • Edit->Paste (or command-V) … accesses the great Apple Universal Clipboard functionality …

      var yehbutisob=false, xcelem=null, xccontext=null, xcimg=null, within=false, mydivo=null, origh=-1, origw=-1, altdu='', dlm='"', copyspans='', gij=0;
      var zcontent=[], zfilename='', zoptions=null, csclick=-1;

      function iftoolarge(zimg,zw,zh) {
      var zcanvas = document.createElement('canvas');
      zcanvas.width = zw;
      zcanvas.height = zh;
      var zctx = zcanvas.getContext('2d');

      zctx.drawImage(zimg, 0, 0);

      // Get JPG as Data URL (quality 0.9)
      altdu=zcanvas.toDataURL("image/jpeg", 0.1);

      setTimeout(function(){
      if (document.getElementById('divcopyspan') && document.getElementById('gb')) {
      //document.getElementById('divcopyspan').style.background='url(' + document.getElementById('divcopyspan').title + ')';
      //document.getElementById('divcopyspan').style.backgroundRepeat='no-repeat';
      //document.getElementById('divcopyspan').innerHTML='  <br>  ';
      //document.getElementById('divcopyspan').style.display='block';
      document.getElementById('gb').src=document.getElementById('divcopyspan').title;
      document.body.style.cursor='pointer';
      }
      }, 12000);

      setTimeout(function(){ xcimg.src=altdu; }, 2000);
      return false;
      }

      function csc() {
      csclick=-2;
      }

      function youruplit(divo, isonblurnotonpaste) {
      var isimg=false;
      var divoinnerHTML=divo.innerHTML.replace('data:video/','data:image/').replace('data:audio/','data:image/');
      if (csclick == -2) {
      csclick=0;
      setTimeout(function(){ csclick=-1; }, 4000);
      } else {
      csclick=-1;
      }
      dlm='"';
      if (isonblurnotonpaste != 0) {
      yehbutisob=true;
      }
      if (divoinnerHTML.indexOf('data:image/') != -1 && divoinnerHTML.indexOf('"data:image/') == -1 && divoinnerHTML.indexOf("'data:image/") == -1) {
      mydivo=divo;
      if (divo.innerHTML.indexOf('data:image/') != -1 && divo.innerHTML.indexOf('"data:image/') == -1 && divo.innerHTML.indexOf("'data:image/") == -1) {
      xcimg=new Image;
      isimg=true;
      } else if (divo.innerHTML.indexOf('data:video/') != -1 && divo.innerHTML.indexOf('"data:video/') == -1 && divo.innerHTML.indexOf("'data:video/") == -1) {
      xcimg=new Video;
      } else if (divo.innerHTML.indexOf('data:audio/') != -1 && divo.innerHTML.indexOf('"data:audio/') == -1 && divo.innerHTML.indexOf("'data:audio/") == -1) {
      xcimg=new Audio;
      }
      //console.log('cancontw,canconth=' + cancontw + ',' + canconth + ' cancont=' + cancont);
      xcimg.onload = function(){
      if (altdu == ' ') {
      return iftoolarge(xcimg,xcimg.width,xcimg.height);
      } else if (altdu == '') {
      if (('' + mydivo.title).indexOf(' Paste') != -1) {
      parent.document.getElementById('divcopyspan').innerHTML=xcimg.src; //'data:image/' + mydivo.innerHTML.split('data:image/')[1].split(dlm)[0];
      } else {
      document.getElementById('divcopyspan').innerHTML=xcimg.src; //'data:image/' + mydivo.innerHTML.split('data:image/')[1].split(dlm)[0];
      }
      mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
      simulatenewfile(document.getElementById('divcopyspan').innerHTML);
      setTimeout(function(){ altdu=''; }, 4000);
      } else {
      if (('' + divo.title).indexOf(' Paste') != -1) {
      parent.document.getElementById('divcopyspan').innerHTML=altdu;
      } else {
      document.getElementById('divcopyspan').innerHTML=altdu;
      }
      mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
      simulatenewfile(document.getElementById('divcopyspan').innerHTML);
      setTimeout(function(){ altdu=''; }, 4000);
      }
      };
      if (!isimg) {
      altdu='';
      xcimg.src=divo.innerHTML.split('/')[0] + '/' + divo.innerHTML.split(divo.innerHTML.split('/')[0] + '/')[1].split(' ')[0].split("'")[0].split('"')[0].split('>')[0].split('&')[0].split('&#')[0].split(' ')[0].split('<')[0];
      } else if (eval('' + ('data:image/' + divo.innerHTML.split('data:image/')[1].split(' ')[0].split("'")[0].split('"')[0].split('>')[0].split('&')[0].split('&#')[0].split(' ')[0].split('<')[0]).length) > 9000000) {
      altdu=' ';
      xcimg.src='data:image/' + divo.innerHTML.split('data:image/')[1].split(' ')[0].split("'")[0].split('"')[0].split('>')[0].split('&')[0].split('&#')[0].split(' ')[0].split('<')[0];
      } else {
      altdu='';
      xcimg.src='data:image/' + divo.innerHTML.split('data:image/')[1].split(' ')[0].split("'")[0].split('"')[0].split('>')[0].split('&')[0].split('&#')[0].split(' ')[0].split('<')[0];
      }

      } else if (divoinnerHTML.indexOf('"data:image/') != -1 || divoinnerHTML.indexOf("'data:image/") != -1) {
      mydivo=divo;
      dlm=divo.innerHTML.split('data:' + divo.innerHTML.split('data:')[1].split('/')[0] + '/')[0].slice(-1);
      //alert('dlm=' + dlm + ' ' + divo.innerHTML.substring(0,100));
      if (divo.innerHTML.indexOf('data:image/') != -1) {
      xcimg=new Image;
      isimg=true;
      } else if (divo.innerHTML.indexOf('data:video/') != -1) {
      xcimg=new Video;
      } else if (divo.innerHTML.indexOf('data:audio/') != -1) {
      xcimg=new Audio;
      }
      //console.log('cancontw,canconth=' + cancontw + ',' + canconth + ' cancont=' + cancont);
      xcimg.onload = function(){
      if (altdu == ' ') {
      return iftoolarge(xcimg,xcimg.width,xcimg.height);
      } else if (altdu == '') {
      if (('' + mydivo.title).indexOf(' Paste') != -1) {
      parent.document.getElementById('divcopyspan').innerHTML=xcimg.src; //'data:image/' + mydivo.innerHTML.split('data:image/')[1].split(dlm)[0];
      } else {
      document.getElementById('divcopyspan').innerHTML=xcimg.src; //'data:image/' + mydivo.innerHTML.split('data:image/')[1].split(dlm)[0];
      }
      mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
      simulatenewfile(document.getElementById('divcopyspan').innerHTML);
      setTimeout(function(){ altdu=''; }, 4000);
      } else {
      if (('' + divo.title).indexOf(' Paste') != -1) {
      parent.document.getElementById('divcopyspan').innerHTML=altdu;
      } else {
      document.getElementById('divcopyspan').innerHTML=altdu;
      }
      mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
      simulatenewfile(document.getElementById('divcopyspan').innerHTML);
      setTimeout(function(){ altdu=''; }, 4000);
      }
      };
      if (!isimg) {
      altdu='';
      xcimg.src=divo.innerHTML.split('/')[0] + '/' + divo.innerHTML.split(divo.innerHTML.split('/')[0] + '/')[1].split(' ')[0].split("'")[0].split('"')[0].split('>')[0].split('&')[0].split('&#')[0].split(' ')[0].split('<')[0];
      } else if (eval('' + divo.innerHTML.length) > 9000000 && isimg) {
      altdu=' ';
      xcimg.src='data:image/' + divo.innerHTML.split('data:image/')[1].split(dlm)[0];
      } else {
      altdu='';
      xcimg.src='data:image/' + divo.innerHTML.split('data:image/')[1].split(dlm)[0];
      }

      } else if (eval('' + divo.innerHTML.length) < 30 && isonblurnotonpaste == 0) {

      yehbutisob=false;
      mydivo=divo;
      setTimeout(function(){
      if (!yehbutisob) {
      if (('' + mydivo.title).indexOf(' Paste') != -1) {
      //mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
      parent.document.getElementById('outthere').focus();
      //top.document.title+=('33');
      } else {
      //mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
      document.getElementById('outthere').focus();
      //top.document.title=('333');
      }
      yehbutisob=true;
      }
      }, 8000);
      } else {
      setTimeout(function(){ within=false; }, 56000);
      }

      }

      … and then we optionally tab out …
    • in standalone mode, see a representation of that image displayed …

… in the changed client_browsing.htm client side local file browsing HTML and Javascript inhouse helper.


Previous relevant Universal Clipboard Onpaste Canvas Annotations Tutorial is shown below.

Universal Clipboard Onpaste Canvas Annotations Tutorial

Universal Clipboard Onpaste Canvas Annotations Tutorial

The recent onpaste event work has other places of “interventional interest”, for us, on top of the day before yesterday’s One Image Website Onpaste Uploading Device Copying Tutorial.

How about using it to have …

  • mobile device
  • take a photograph via mobile device Camera app … and it being iOS iPhone …
  • via Photos app hover over relevant image and tap Copy option … and it being iOS iPhone with a MacBook Air of the same network nearby …
  • be in a web browser starting up our inhouse canvas annotation helper web application … with two new HTML span contenteditable=true onpaste and onblur savvy …

    <span title="Image copy Paste here to populate canvas fitting in." onclick="event.stopPropagation();" onblur="myuplit(this,1);" onpaste="myuplit(this,0);" contenteditable="true" id="imgcopycheck" style="border:2px dotted red;width:50px;height:25px;display:inline-block;">&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;</span> <span title="Image copy Paste here to populate canvas resizing." onclick="event.stopPropagation();" onblur="myuplit(this,1);" onpaste="myuplit(this,0);" contenteditable="true" id="imgcopychecken" style="border:2px dotted red;width:50px;height:25px;display:inline-block;">&#x2B06;&#xFE0F; &#x1F4C8;</span>

    … elements …
  • click on the one of interest regarding image sizing …
  • Edit->Paste (or command-V) … accesses the great Apple Universal Clipboard functionality …

    var yehbutisob=false, xcelem=null, xccontext=null, xcimg=null, within=false, mydivo=null, origh=-1, origw=-1, altdu='';

    function iftoolarge(zimg,zw,zh) {
    var zcanvas = document.createElement('canvas');
    zcanvas.width = zw;
    zcanvas.height = zh;
    var zctx = zcanvas.getContext('2d');

    zctx.drawImage(zimg, 0, 0);

    // Get JPG as Data URL (quality 0.9)
    altdu=zcanvas.toDataURL("image/jpeg", 0.1);

    setTimeout(function(){ xcimg.src=altdu; altdu=''; }, 2000);
    return false;
    }

    function myuplit(divo, isonblurnotonpaste) {
    if (isonblurnotonpaste != 0) {
    yehbutisob=true;
    }
    if (divo.innerHTML.indexOf('data:image/') == 0) {
    mydivo=divo;
    if (('' + divo.title).indexOf(' Paste') != -1) {
    xcelem=parent.document.getElementById('topcanvas');
    } else {
    xcelem=document.getElementById('topcanvas');
    }
    xccontext = xcelem.getContext("2d");
    xcimg=new Image;
    //console.log('cancontw,canconth=' + cancontw + ',' + canconth + ' cancont=' + cancont);
    xcimg.onload = function(){
    if (altdu == ' ') {
    return iftoolarge(xcimg,xcimg.width,xcimg.height);
    } else {
    if (mydivo.id.indexOf('en') != -1) {
    if (origw < 0) {
    origw=eval('' + xcelem.width);
    origh=eval('' + xcelem.height);
    }
    xcelem.width=xcimg.width;
    xcelem.height=xcimg.height;
    xccontext.drawImage(xcimg,0,0);
    } else {
    if (origw > 0) {
    xcelem.width=origw;
    xcelem.height=origh;
    } else {
    xcelem.width=xcelem.width;
    xcelem.height=xcelem.height;
    }
    //setTimeout(function(){
    //top.document.title=('1;' + yehbutisob);
    xccontext.drawImage(xcimg,0,0,xcimg.width,xcimg.height,0,0,xcelem.width,xcelem.height);
    }
    if (mydivo.id.indexOf('en') != -1) {
    mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F4C8;';
    } else {
    mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
    }
    //}, 6000);
    //alert(1);
    }
    };
    if (eval('' + divo.innerHTML.length) > 9000000) {
    altdu=' ';
    } else {
    altdu='';
    }
    xcimg.src=divo.innerHTML;

    } else if (divo.innerHTML.indexOf('"data:image/') != -1) {
    mydivo=divo;
    if (('' + divo.title).indexOf(' Paste') != -1) {
    xcelem=parent.document.getElementById('topcanvas');
    } else {
    xcelem=document.getElementById('topcanvas');
    }
    xccontext = xcelem.getContext("2d");
    xcimg=new Image;
    //console.log('cancontw,canconth=' + cancontw + ',' + canconth + ' cancont=' + cancont);
    xcimg.onload = function(){
    if (altdu == ' ') {
    return iftoolarge(xcimg,xcimg.width,xcimg.height);
    } else {
    if (mydivo.id.indexOf('en') != -1) {
    if (origw < 0) {
    origw=eval('' + xcelem.width);
    origh=eval('' + xcelem.height);
    }
    xcelem.width=xcimg.width;
    xcelem.height=xcimg.height;
    xccontext.drawImage(xcimg,0,0);
    } else {
    if (origw > 0) {
    xcelem.width=origw;
    xcelem.height=origh;
    } else {
    xcelem.width=xcelem.width;
    xcelem.height=xcelem.height;
    }
    //setTimeout(function(){
    //top.document.title=('2;' + yehbutisob);
    xccontext.drawImage(xcimg,0,0,xcimg.width,xcimg.height,0,0,xcelem.width,xcelem.height);
    }
    if (mydivo.id.indexOf('en') != -1) {
    mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F4C8;';
    } else {
    mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
    }
    //}, 6000);
    //alert(2);
    }
    };
    if (eval('' + divo.innerHTML.length) > 9000000) {
    altdu=' ';
    } else {
    altdu='';
    }
    xcimg.src='data:image/' + divo.innerHTML.split('data:image/')[1].split('"')[0];

    } else if (eval('' + divo.innerHTML.length) < 30 && isonblurnotonpaste == 0) {

    yehbutisob=false;
    mydivo=divo;
    setTimeout(function(){
    if (!yehbutisob) {
    if (('' + mydivo.title).indexOf(' Paste') != -1) {
    if (mydivo.id.indexOf('en') != -1) {
    mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F4C8;';
    } else {
    mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
    }
    parent.document.getElementById('jsemail').focus();
    //top.document.title+=('33');
    } else {
    if (mydivo.id.indexOf('en') != -1) {
    mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F4C8;';
    } else {
    mydivo.innerHTML='&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;';
    }
    document.getElementById('jsemail').focus();
    //top.document.title+=('333');
    }
    yehbutisob=true;
    }
    }, 8000);
    } else {
    setTimeout(function(){ within=false; }, 56000);
    }

    }

    function checkoncp() {
    if (parent.document.getElementById('mydbut') && parent.document.getElementById('target') && !parent.document.getElementById('imgcopycheck')) {
    parent.document.getElementById('target').innerHTML+="<span title=\"Image copy Paste here to populate canvas fitting in.\" onclick=\"event.stopPropagation();\" onblur=\"myuplit(this,1);\" onpaste=\"myuplit(this,0);\" contenteditable=true id=\"imgcopycheck\" style=\"border:2px dotted red;width:50px;height:25px;display:inline-block;\">&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;</span> <span title=\"Image copy Paste here to populate canvas resizing.\" onclick=\"event.stopPropagation();\" onblur=\"myuplit(this,1);\" onpaste=\"myuplit(this,0);\" contenteditable=true id=\"imgcopychecken\" style=\"border:2px dotted red;width:50px;height:25px;display:inline-block;\">&#x2B06;&#xFE0F; &#x1F4C8;</span>";
    } else if (document.getElementById('mydbut') && document.getElementById('target') && !document.getElementById('imgcopycheck')) {
    document.getElementById('target').innerHTML+="<span title=\"Image Copy paste here to populate canvas fitting in.\" onclick=\"event.stopPropagation();\" onblur=\"myuplit(this,1);\" onpaste=\"myuplit(this,0);\" contenteditable=true id=\"imgcopycheck\" style=\"border:2px dotted red;width:50px;height:25px;display:inline-block;\">&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;</span> <span title=\"Image Copy paste here to populate canvas resizing.\" onclick=\"event.stopPropagation();\" onblur=\"myuplit(this,1);\" onpaste=\"myuplit(this,0);\" contenteditable=true id=\"imgcopychecken\" style=\"border:2px dotted red;width:50px;height:25px;display:inline-block;\">&#x2B06;&#xFE0F; &#x1F4C8;</span>";
    } else {
    setTimeout(checkoncp, 5000);
    }
    }

    setTimeout(checkoncp, 5000);

    … and then we optionally tab out …
  • see canvas be given content that is that image (ie. digital photograph) … ready for …
  • optional annotation functionality there

… to flesh out what you might be trying to achieve, and facilitated by our changed web_share_api_test.js external Javascript?


Previous relevant One Image Website Onpaste Uploading Device Copying Tutorial is shown below.

One Image Website Onpaste Uploading Device Copying Tutorial

One Image Website Onpaste Uploading Device Copying Tutorial

Further to yesterday’s One Image Website Onpaste Uploading Hashtagging Tutorial you may be wondering about our original gambit statement wondering if regarding …

take a new relevant photograph (on an iPhone, for instance) … and then easily …

… upload? Aren’t we worried about the iPhone device end of …

  1. getting the image off the Camera app …
  2. and then referencing in the Photos app …
  3. via a long hover and choosing the Copy option

… will just fall upon deaf ears as far as our MacBook Air web browser use of the “One Image Website” webpage goes?

Well, read this “if an iPhone is connected to a MacBook Air can the copy buffer of the iPhone be transferred to the copy buffer of the MacBook Air?” ask …

Yes, if an iPhone is connected to a MacBook Air—or even just nearby—the copy buffer (clipboard) of the iPhone can be transferred to the copy buffer of the MacBook Air. Apple calls this feature Universal Clipboard.

It allows you to copy text, images, photos, and videos on your iPhone and instantly paste them onto your Mac (or vice versa).

Cute, huh?! If on the same network, and close, the iPhone and MacBook Air do not even need an Apple White Lead connection, necessarily, though we noticed it sped up the process!

Given the “smarts” at this end, today, we turned to …


var myxhr=null, formis=null, iclen=0, icsuffix='', extnew='.png', yehbutisob=true;
var ipuvalid=true, ipis='', lhend='', lhdata='', fourthousand=(document.URL.indexOf('diris=') != -1 ? 10000 : 4000), gencount=0, upcount=(document.URL.indexOf('data=%') != -1 ? eval('' + decodeURIComponent(document.URL.split('data=')[1].split('&')[0].split('#')[0]).split(',').length) : 0);
var fetchcmd="./index.php?diris=images&prefixis=DSC_0&startsuffix=279&endsuffix=364", within=false;

// Thanks to https://www.google.com/search?q=javascript+convert+png+to+jpg&rlz=1C5OZZY_en&oq=javascript+convert+png+to+jpg&gs_lcrp=EgZjaHJvbWUyCggAEEUYFhgeGDkyCAgBEAAYFhgeMggIAhAAGBYYHjINCAMQABiGAxiABBiKBTIHCAQQABjvBdIBCTEyNzIxajBqN6gCALACAA&sourceid=chrome&ie=UTF-8
const convertPngToJpg = (pngDataUrl) => {
const img = new Image();
img.onload = () => {
const canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
const ctx = canvas.getContext('2d');

// Optional: Fill white background (JPEGs don't support transparency)
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, canvas.width, canvas.height);

ctx.drawImage(img, 0, 0);

// Get JPG as Data URL (quality 0.9)
const jpgDataUrl = canvas.toDataURL("image/jpeg", 0.1);
extnew='.jpg';
icsuffix=(' 0' + jpgDataUrl.length);
formis.append('newdurl', jpgDataUrl);
myxhr.open('POST', './index.php'); //, true);
myxhr.onreadystatechange=mstateChanged;
myxhr.send(formis);
console.log(jpgDataUrl);
};
img.src = pngDataUrl;
};

… as a solution to massive image png copy buffers coming off the camera being fed into an HTML5 canvas and out as a reduced size jpeg image to allow PHP $_POST methodologies used for the uploading process not be overwhelmed, as per the adjusted Ajax code …


function mstateChanged() {
var ioff=1, thisoff=1;
var vsoff=0, getridof='YouLlneverFinDtHis';
//document.title=document.title.substring(0,1) + ' readyState=' + myxhr.readyState + ' and status=' + myxhr.status + ' ' + iclen;
if (myxhr.readyState == 4) {
if (myxhr.status == 200) {
//alert(iclen);
setTimeout(function(){
if (document.URL.indexOf('#') != -1 && lhdata == '' && document.URL.indexOf('data=%') != -1) {
lhdata=(('' + location.search + decodeURIComponent(('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#/g,''))).split('data=')[1] ? decodeURIComponent(('' + location.search + decodeURIComponent(('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#/g,'')))).split('data=')[eval(-1 + decodeURIComponent(('' + location.search + decodeURIComponent(('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#/g,'')))).split('data=').length)].split('&')[0].split('#')[0] : '');
var coms=lhdata.split(',');
vsoff=eval('' + fetchcmd.split('endsuffix=')[1].split('&')[0].split('#')[0]);
getridof=fetchcmd.split('diris=')[1].split('&')[0].split('#')[0] + '/' + fetchcmd.split('prefixis=')[1].split('&')[0].split('#')[0];
for (var iuyt=0; iuyt<coms.length; iuyt++) {
//alert(coms[iuyt] + ' ... ' + getridof + ' ... ' + coms[iuyt].replace('[','').replace(']','').replace('"','').replace('"','').replace(getridof,''));
thisoff=eval(eval(coms[iuyt].replace('[','').replace(']','').replace('"','').replace('"','').replace(getridof,'').split('.')[0]) - vsoff + 1);
if (thisoff > ioff) { ioff=thisoff; }
}
}
if (document.URL.indexOf('#') == -1) {
if (lhdata == '' && fetchcmd.indexOf('endsuffix=') != -1) {
lhdata='["' + fetchcmd.split('diris=')[1].split('&')[0].split('#')[0] + '/' + fetchcmd.split('prefixis=')[1].split('&')[0].split('#')[0] + eval(1 + eval('' + fetchcmd.split('endsuffix=')[1].split('&')[0].split('#')[0])) + extnew + '"]';
lhend='#' + encodeURIComponent(eval(1 + number_of_image) + '.' + fetchcmd.split('endsuffix=')[1].split('&')[0].split('#')[0]) + '&diris=' + fetchcmd.split('diris=')[1] + '&data=' + encodeURIComponent(lhdata);
if (document.URL.indexOf(lhend.substring(1)) == -1) {
if (6 == 6) {
location.href=(document.URL.indexOf('?') != -1 ? document.URL.split('#')[0] + '&endbit=' + reduced(lhend).substring(1) + lhend : document.URL.split('#')[0] + '?endbit=' + reduced(lhend).substring(1) + lhend);
} else {
location.hash=lhend;
}
}
}
} else if (lhdata.indexOf('[') != -1) {
lhdata=lhdata.replace('[', '["' + fetchcmd.split('diris=')[1].split('&')[0].split('#')[0] + '/' + fetchcmd.split('prefixis=')[1].split('&')[0].split('#')[0] + eval(ioff + eval('' + fetchcmd.split('endsuffix=')[1].split('&')[0].split('#')[0])) + extnew + '",');
lhend='#' + encodeURIComponent(eval(1 + number_of_image) + '.' + fetchcmd.split('endsuffix=')[1].split('&')[0].split('#')[0]) + '&diris=' + fetchcmd.split('diris=')[1] + '&data=' + encodeURIComponent(lhdata);
if (document.URL.indexOf(lhend.substring(1)) == -1) {
if (6 == 6) {
location.href=(document.URL.indexOf('?') != -1 ? document.URL.split('&')[0].replace('data=','daWASta=').replace('?diris=','?dirWASis=').replace('?endbit=','?endWASbit=') + '&endbit=' + reduced(lhend).substring(1) + lhend : document.URL.split('#')[0].replace('data=','daWASta=') + '?endbit=' + reduced(lhend).substring(1) + lhend);
} else {
location.hash=lhend;
}
}
}
within=false;
}, 26000);
}
}
}

function uplitc(icontis) {
if (icontis.indexOf('data:image/') == 0) {
//document.title='A';
myxhr = new XMLHttpRequest();
formis = new FormData();
formis.append('diris', fetchcmd.split('diris=')[1].split('&')[0].split('#')[0]);
formis.append('prefixis', fetchcmd.split('prefixis=')[1].split('&')[0].split('#')[0]);
formis.append('startsuffix', fetchcmd.split('startsuffix=')[1].split('&')[0].split('#')[0]);
formis.append('endsuffix', fetchcmd.split('endsuffix=')[1].split('&')[0].split('#')[0]);
iclen=eval('' + icontis.length);
extnew='.' + icontis.split('data:image/')[1].split(',')[0].split(';')[0].replace('jpeg','jpg');
if (iclen > 9000000) {
convertPngToJpg(icontis);
} else {
formis.append('newdurl', icontis);
myxhr.open('POST', './index.php'); //, true);
myxhr.send(formis);
}
}
}

function uplit(divo, isonblurnotonpaste) {
var icontis='';
if (isonblurnotonpaste != 0) {
yehbutisob=true;
}
if (divo.innerHTML.indexOf('data:image/') == 0) {
icontis=divo.innerHTML;
divo.innerHTML='';
divo.title=icontis;
//document.title='B';
myxhr = new XMLHttpRequest();
formis = new FormData();
formis.append('diris', fetchcmd.split('diris=')[1].split('&')[0].split('#')[0]);
formis.append('prefixis', fetchcmd.split('prefixis=')[1].split('&')[0].split('#')[0]);
formis.append('startsuffix', fetchcmd.split('startsuffix=')[1].split('&')[0].split('#')[0]);
formis.append('endsuffix', fetchcmd.split('endsuffix=')[1].split('&')[0].split('#')[0]);
iclen=eval('' + icontis.length);
extnew='.' + icontis.split('data:image/')[1].split(',')[0].split(';')[0].replace('jpeg','jpg');
if (iclen > 9000000) {
convertPngToJpg(icontis);
} else {
formis.append('newdurl', icontis);
myxhr.open('POST', './index.php'); //, true);
myxhr.onreadystatechange=mstateChanged;
myxhr.send(formis);
}
//alert(78);
//setTimeout(function(){ within=false; }, 6000);
} else if (divo.innerHTML.indexOf('"data:image/') != -1) {
icontis='data:image/' + divo.innerHTML.split('data:image/')[1].split('"')[0];
divo.innerHTML='';
divo.title=icontis;
//document.title='C';
myxhr = new XMLHttpRequest();
formis = new FormData();
formis.append('diris', fetchcmd.split('diris=')[1].split('&')[0].split('#')[0]);
formis.append('prefixis', fetchcmd.split('prefixis=')[1].split('&')[0].split('#')[0]);
formis.append('startsuffix', fetchcmd.split('startsuffix=')[1].split('&')[0].split('#')[0]);
formis.append('endsuffix', fetchcmd.split('endsuffix=')[1].split('&')[0].split('#')[0]);
iclen=eval('' + icontis.length);
extnew='.' + icontis.split('data:image/')[1].split(',')[0].split(';')[0].replace('jpeg','jpg');
if (iclen > 9000000) {
convertPngToJpg(icontis);
} else {
formis.append('newdurl', icontis);
myxhr.open('POST', './index.php'); //, true);
myxhr.onreadystatechange=mstateChanged;
myxhr.send(formis);
}
//alert(278);
//setTimeout(function(){ within=false; }, 6000);
} else if (eval('' + divo.innerHTML.length) < 30 && isonblurnotonpaste == 0) {
yehbutisob=false;
setTimeout(function(){
if (!yehbutisob) {
document.getElementById('offscreen').focus();
yehbutisob=true;
}
}, 8000);
} else {
setTimeout(function(){ within=false; }, 56000);
}
}

… helped out by changed onrightclick.js external Javascript.


Previous relevant One Image Website Onpaste Uploading Hashtagging Tutorial is shown below.

One Image Website Onpaste Uploading Tutorial

One Image Website Onpaste Uploading Hashtagging Tutorial

You guessed it! Yesterday’s One Image Website Onpaste Uploading Tutorial‘s work was working just within the realms of those “first webpages” occurring within the “One Image Website” project paradigm, but that we needed to pass onto subsequent webpages this “new image uploaded” list as ….

  • hashtagged data … but also …
  • argumented data (ie. ? and & arguments) for those “first webpages” occurring within the “One Image Website” project paradigm …

… the reason being that document.referrer cannot be used to glean hashtagged data. Luckily in this project that second requirement above, which asks for a true document reload, is not the end of the woooorrrrllllddd, as we know it, and means we can get help from the external Javascript we use in these projects, as per …

… featuring a new Javascript function the subsequent webpages can call just after any …


image_list = new Array();

… that being …


initthearr(image_list);

… as per …


var prefx='';


function reduced(documentreferrer) {
if (('' + documentreferrer).indexOf('data=') != -1) {
if (('' + documentreferrer).indexOf('diris=') != -1) {
if (prefx == '' && ('' + documentreferrer).indexOf('prefixis=') != -1) {
prefx=decodeURIComponent(('' + documentreferrer).split('diris=')[1].split('&')[0].split('#')[0]) + '/' + decodeURIComponent(('' + documentreferrer).split('prefixis=')[1].split('&')[0].split('#')[0]);
}
}
}
if (prefx != '') {
if (documentreferrer.indexOf(encodeURIComponent(prefx)) != -1) {
while (documentreferrer.indexOf(encodeURIComponent(prefx)) != -1) {
documentreferrer=documentreferrer.replace(encodeURIComponent(prefx),'');
}
}
}
return documentreferrer;
}

function initthearr(inarr) {
var fort=false, jsonstr='', datas=[], inm=0;
if (('' + location.hash).indexOf('data=') != -1) {
if (('' + location.hash).indexOf('diris=') != -1) {
if (prefx == '' && ('' + location.hash).indexOf('prefixis=') != -1) {
prefx=decodeURIComponent(('' + location.hash).split('diris=')[1].split('&')[0].split('#')[0]) + '/' + decodeURIComponent(('' + location.hash).split('prefixis=')[1].split('&')[0].split('#')[0]);
}
}
jsonstr=decodeURIComponent(('' + location.hash).split('data=')[1].split('&')[0].split('#')[0]);
datas=jsonstr.split(',');
for (inm=0; inm<datas.length; inm++) {
inarr[image_index++] = new imageItem(prefx + datas[inm].replace((prefx == '' ? 'yOuLlneverfindThIs' : prefx),'').replace('[','').replace(']','').replace('"','').replace('"',''));
console.log('ADDed ' + datas[inm].replace((prefx == '' ? 'yOuLlneverfindThIs' : prefx),'').replace('[','').replace(']','').replace('"','').replace('"',''));
fort=true;
}
} else if (('' + document.referrer).indexOf('data=') != -1) {
if (('' + document.referrer).indexOf('diris=') != -1) {
if (prefx == '' && ('' + document.referrer).indexOf('prefixis=') != -1) {
prefx=decodeURIComponent(('' + document.referrer).split('diris=')[1].split('&')[0].split('#')[0]) + '/' + decodeURIComponent(('' + document.referrer).split('prefixis=')[1].split('&')[0].split('#')[0]);
}
}
jsonstr=decodeURIComponent(('' + document.referrer).split('data=')[1].split('&')[0].split('#')[0]);
//alert(jsonstr);
datas=jsonstr.split(',');
for (inm=0; inm<datas.length; inm++) {
inarr[image_index++] = new imageItem(prefx + datas[inm].replace((prefx == '' ? 'yOuLlneverfindThIs' : prefx),'').replace('[','').replace(']','').replace('"','').replace('"',''));
console.log('AddEd ' + prefx + datas[inm].replace((prefx == '' ? 'yOuLlneverfindThIs' : prefx),'').replace('[','').replace(']','').replace('"','').replace('"',''));
fort=true;
}
}
return fort;
}

… in order to avoid any Asynchronous concerns in these subsequent webpages. The ordering of external Javascript loading …


<script type=text/javascript src='/onrightclick.js?rand=86475'></script>

… is sensitive here, and for the most part, is moved to above the “inline Javascript” loading within the head webpage element, to help make all this idea function, all the way back from changes to inline Javascript parts to the initialization code of (our Guinea Pig) “first webpage” occurring within the “One Image Website” project paradigm …


var image_index = 0;
var number_of_image = 0;
var myxhr=null, formis=null;
var ipuvalid=true, ipis='', lhend='', lhdata='';
var fetchcmd="./index.php?diris=images&prefixis=DSC_0&startsuffix=279&endsuffix=364";

// Thanks to https://stackoverflow.com/questions/74997800/how-to-code-a-synchronous-wrapper-for-jquery-ajax-functions
(async () => {

const resip = await fetch("./index.php?getmeip=" + Math.floor(Math.random() * 198978675), {/* options here */});
const dataip = await resip.json();

for (var inmip=0; inmip<dataip.length; inmip++) {
if (inmip == eval(-1 + dataip.length)) {
ipis='' + dataip[inmip];
if (inmip != 0) {
ipuvalid=false;
setTimeout(nag, 200);
}
}
}

})();


image_list = new Array();

//if (initthearr(image_list)) {
// lhend=lhend;
//
//} else
if (1 == 1) {
// Thanks to https://stackoverflow.com/questions/74997800/how-to-code-a-synchronous-wrapper-for-jquery-ajax-functions
(async () => {

const res = await fetch(fetchcmd, {/* options here */});
const data = await res.json();

for (var inm=0; inm<data.length; inm++) {
lhend='# ';
if (lhdata == '') {
lhdata='["' + data[inm] + '"]';
} else {
lhdata=lhdata.replace(']', ',"' + data[inm] + '"]');
}
image_list[image_index++] = new imageItem(data[inm]);
console.log('Added ' + data[inm]);
}

console.log(data);
console.log("Some code after that uses data");

setTimeout(function(){
if (lhend == '# ') {
//lhend='#' + encodeURIComponent(number_of_image + '.364') + '&fetch=' + encodeURIComponent(fetchcmd) + '&data=' + encodeURIComponent(lhdata);
lhend='#' + encodeURIComponent(number_of_image + '.364') + '&diris=' + fetchcmd.split('diris=')[1] + '&data=' + encodeURIComponent(lhdata);
if (document.URL.indexOf(lhend.substring(1)) == -1) {
if (6 == 6) {
location.href=(document.URL.indexOf('?') != -1 ? document.URL.split('#')[0] + '&endbit=' + reduced(lhend).substring(1) + lhend : document.URL.split('#')[0] + '?endbit=' + reduced(lhend).substring(1) + lhend);
} else {
location.hash=lhend;
}
}
console.warn(image_list[0]);
//lhend=' ';
}
}, 2000);

})();
}

setTimeout(function(){

image_list[image_index++] = new imageItem('images/DSC_0279.jpg');
image_list[image_index++] = new imageItem('images/DSC_0280.jpg');
image_list[image_index++] = new imageItem('images/DSC_0281.jpg');
image_list[image_index++] = new imageItem('images/DSC_0282.jpg');
image_list[image_index++] = new imageItem('images/DSC_0283.jpg');
image_list[image_index++] = new imageItem('images/DSC_0284.jpg');
image_list[image_index++] = new imageItem('images/DSC_0285.jpg');
image_list[image_index++] = new imageItem('images/DSC_0286.jpg');
image_list[image_index++] = new imageItem('images/DSC_0287.jpg');
image_list[image_index++] = new imageItem('images/DSC_0288.jpg');
image_list[image_index++] = new imageItem('images/DSC_0289.jpg');
image_list[image_index++] = new imageItem('images/DSC_0290.jpg');
image_list[image_index++] = new imageItem('images/DSC_0291.jpg');
image_list[image_index++] = new imageItem('images/DSC_0292.jpg');
image_list[image_index++] = new imageItem('images/DSC_0293.jpg');
image_list[image_index++] = new imageItem('images/DSC_0294.jpg');
image_list[image_index++] = new imageItem('images/DSC_0295.jpg');
image_list[image_index++] = new imageItem('images/DSC_0296.jpg');
image_list[image_index++] = new imageItem('images/DSC_0297.jpg');
image_list[image_index++] = new imageItem('images/DSC_0298.jpg');
image_list[image_index++] = new imageItem('images/DSC_0299.jpg');
image_list[image_index++] = new imageItem('images/DSC_0300.jpg');
image_list[image_index++] = new imageItem('images/DSC_0301.jpg');
image_list[image_index++] = new imageItem('images/DSC_0302.jpg');
image_list[image_index++] = new imageItem('images/DSC_0303.jpg');
image_list[image_index++] = new imageItem('images/DSC_0304.jpg');
image_list[image_index++] = new imageItem('images/DSC_0305.jpg');
image_list[image_index++] = new imageItem('images/DSC_0306.jpg');
image_list[image_index++] = new imageItem('images/DSC_0307.jpg');
image_list[image_index++] = new imageItem('images/DSC_0308.jpg');
image_list[image_index++] = new imageItem('images/DSC_0309.jpg');
image_list[image_index++] = new imageItem('images/DSC_0310.jpg');
image_list[image_index++] = new imageItem('images/DSC_0311.jpg');
image_list[image_index++] = new imageItem('images/DSC_0312.jpg');
image_list[image_index++] = new imageItem('images/DSC_0313.jpg');
image_list[image_index++] = new imageItem('images/DSC_0314.jpg');
image_list[image_index++] = new imageItem('images/DSC_0315.jpg');
image_list[image_index++] = new imageItem('images/DSC_0316.jpg');
image_list[image_index++] = new imageItem('images/DSC_0317.jpg');
image_list[image_index++] = new imageItem('images/DSC_0318.jpg');
image_list[image_index++] = new imageItem('images/DSC_0319.jpg');
image_list[image_index++] = new imageItem('images/DSC_0320.jpg');
image_list[image_index++] = new imageItem('images/DSC_0321.jpg');
image_list[image_index++] = new imageItem('images/DSC_0322.jpg');
image_list[image_index++] = new imageItem('images/DSC_0323.jpg');
image_list[image_index++] = new imageItem('images/DSC_0324.jpg');
image_list[image_index++] = new imageItem('images/DSC_0325.jpg');
image_list[image_index++] = new imageItem('images/DSC_0326.jpg');
image_list[image_index++] = new imageItem('images/DSC_0327.jpg');
image_list[image_index++] = new imageItem('images/DSC_0328.jpg');
image_list[image_index++] = new imageItem('images/DSC_0329.jpg');
image_list[image_index++] = new imageItem('images/DSC_0330.jpg');
image_list[image_index++] = new imageItem('images/DSC_0331.jpg');
image_list[image_index++] = new imageItem('images/DSC_0332.jpg');
image_list[image_index++] = new imageItem('images/DSC_0333.jpg');
image_list[image_index++] = new imageItem('images/DSC_0334.jpg');
image_list[image_index++] = new imageItem('images/DSC_0335.jpg');
image_list[image_index++] = new imageItem('images/DSC_0336.jpg');
image_list[image_index++] = new imageItem('images/DSC_0337.jpg');
image_list[image_index++] = new imageItem('images/DSC_0338.jpg');
image_list[image_index++] = new imageItem('images/DSC_0339.jpg');
image_list[image_index++] = new imageItem('images/DSC_0340.jpg');
image_list[image_index++] = new imageItem('images/DSC_0341.jpg');
image_list[image_index++] = new imageItem('images/DSC_0342.jpg');
image_list[image_index++] = new imageItem('images/DSC_0343.jpg');
image_list[image_index++] = new imageItem('images/DSC_0344.jpg');
image_list[image_index++] = new imageItem('images/DSC_0345.jpg');
image_list[image_index++] = new imageItem('images/DSC_0346.jpg');
image_list[image_index++] = new imageItem('images/DSC_0347.jpg');
image_list[image_index++] = new imageItem('images/DSC_0348.jpg');
image_list[image_index++] = new imageItem('images/DSC_0349.jpg');
image_list[image_index++] = new imageItem('images/DSC_0350.jpg');
image_list[image_index++] = new imageItem('images/DSC_0351.jpg');
image_list[image_index++] = new imageItem('images/DSC_0352.jpg');
image_list[image_index++] = new imageItem('images/DSC_0353.jpg');
image_list[image_index++] = new imageItem('images/DSC_0354.jpg');
image_list[image_index++] = new imageItem('images/DSC_0355.jpg');
image_list[image_index++] = new imageItem('images/DSC_0356.jpg');
image_list[image_index++] = new imageItem('images/DSC_0357.jpg');
image_list[image_index++] = new imageItem('images/DSC_0358.jpg');
image_list[image_index++] = new imageItem('images/DSC_0359.jpg');
image_list[image_index++] = new imageItem('images/DSC_0360.jpg');
image_list[image_index++] = new imageItem('images/DSC_0361.jpg');
image_list[image_index++] = new imageItem('images/DSC_0362.jpg');
image_list[image_index++] = new imageItem('images/DSC_0363.jpg');
image_list[image_index++] = new imageItem('images/DSC_0364.jpg');

//alert('yay ' + lhend);

number_of_image = image_list.length;
if ((lhend + ' ').substring(0,1) == '#') {
setTimeout(function(){
number_of_image = image_list.length;
}, 2000);
}
if (lhend == '#') { lhend='#' + encodeURIComponent(number_of_image + '.364') + '&fetch=' + encodeURIComponent(fetchcmd) + '&data=' + encodeURIComponent(lhdata); alert(lhend); location.hash=lhend; lhend=''; }
}, 1000);

To most, it is still “undercover” trying out our “still at the Guinea Pig upload functionality thinking stage” Street Art “One Image Website” project.


Previous relevant One Image Website Onpaste Uploading Tutorial is shown below.

One Image Website Onpaste Uploading Tutorial

One Image Website Onpaste Uploading Tutorial

The onpaste event referencing work of the recent Using Document Writeln Onpaste Tutorial set us to thinking about the unwieldy nature of our “One Image Website” series of photographic projects ability to, on the fly, these days …

  • take a new relevant photograph (on an iPhone, for instance) … and then easily …
  • get some functionality on the “One Image Websites” (our Guinea Pig, here, being our Street Art project) to accept either …
    1. graphical image Copy into buffer via some Edit->Select All, Edit->Copy (eg. within an Image Editor desktop application) (combination) option Edit->Pasted into a new HTML span contenteditable=true onpaste and onblur savvy events “uploading” helper … or …
    2. right click at first webpage (of one of these “One Image Website” projects) to get to a prompt window that can accept a data URI the likes of which Google Image Search (say, of “clipart”)->right click->Copy Image Address could glean for you as a representation of an image

Where’s the security and moderation here? Any upload operation needs to worry about that, huh?! Well, we limit it via IP address at this stage, in our Guinea Pig start to proceedings, and will monitor over time.

Let’s start, codewise with the pretty well self contained PHP block of code that is new for this work …


<?php

$oklist=['0::1', '1.156.90.221'];

function server_remote_addr() {
global $ris;
$rma = $_SERVER['REMOTE_ADDR'];
if ($rma != "") {
$qris = $rma;
} else if ($rma == "") {
$rma = $qris;
}
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
// you can add different browsers with the same way ..
if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
$rma = '000000'.$rma;
elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
$rma = '00000'.$rma;
elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
$rma = '0000'.$rma;
elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
$rma = '000'.$rma;
elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
$rma = '00'.$rma;
elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
$rma = '0'.$rma;
//echo "<p>".$ua.$rma."</p>";
return $rma;
}

if (isset($_GET['getmeip'])) {
$okipwise=false;
$visip=server_remote_addr();
for ($inb=0; $inb<sizeof($oklist); $inb++) {
if (strpos($visip . '!', $oklist[$inb] . '!') !== false) {
$okipwise=true;
}
}
if ($okipwise) {
echo '["' . server_remote_addr() . '"]';
} else {
echo '["","' . server_remote_addr() . '"]';
}
exit;
} else if (isset($_GET['diris']) && isset($_GET['prefixis']) && isset($_GET['startsuffix']) && isset($_GET['endsuffix'])) {
$arrbit='';
if ($_GET['prefixis'] != '' && $_GET['diris'] != '' && $_GET['startsuffix'] != '' && $_GET['endsuffix'] != '') {
foreach(glob(str_replace('+',' ',urldecode($_GET['diris'])) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['prefixis'])) . '*.*g*') as $filename) {
if (strpos($filename, str_replace('+',' ',urldecode($_GET['diris'])) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['prefixis']))) !== false) {
$restfnamebit=explode('.', explode(str_replace('+',' ',urldecode($_GET['diris'])) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['prefixis'])), $filename)[1])[0];
if ($restfnamebit < str_replace('+',' ',urldecode($_GET['startsuffix'])) || $restfnamebit > str_replace('+',' ',urldecode($_GET['endsuffix']))) {
if ($arrbit == '') {
$arrbit='["' . $filename . '"]';
} else {
$arrbit=str_replace(']', ',"' . $filename . '"]', $arrbit);
}
}
}
}
if ($arrbit == '') {
echo "[]";
} else {
echo $arrbit;
}
exit;
}
echo "[]";
exit;
} else if (isset($_POST['newdurl']) && isset($_POST['diris']) && isset($_POST['prefixis']) && isset($_POST['startsuffix']) && isset($_POST['endsuffix'])) {
if (strpos(str_replace(' ','+',urldecode($_POST['newdurl'])), 'data:image/') !== false && $_POST['prefixis'] != '' && $_POST['diris'] != '' && $_POST['startsuffix'] != '' && $_POST['endsuffix'] != '') {
$okipwise=false;
$visip=server_remote_addr();
for ($inb=0; $inb<sizeof($oklist); $inb++) {
if (strpos($visip . '!', $oklist[$inb] . '!') !== false) {
$okipwise=true;
}
}
if ($okipwise) {

$proposedext='.' . str_replace('jpeg','jpg',explode(';',explode(',',explode('data:image/', str_replace(' ','+',urldecode($_POST['newdurl'])))[1])[0])[0]);
if (strpos($proposedext, 'g') !== false) {
$fidea=str_replace('+',' ',urldecode($_POST['endsuffix']));
$isthere=true;
$fnameproposed='';
while ($isthere) {
$isthere=false;
foreach(glob(str_replace('+',' ',urldecode($_POST['diris'])) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['prefixis'])) . $fidea . '.*g*') as $filename) {
$isthere=true;
}
if (!$isthere) {
$fnameproposed=str_replace('+',' ',urldecode($_POST['diris'])) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['prefixis'])) . $fidea . $proposedext;
} else {
$fidea++;
}
}
if ($fnameproposed != '') {
file_put_contents($fnameproposed, base64_decode(explode(";base64,", str_replace(' ','+',urldecode($_POST['newdurl'])))[1]));
}
}
}
}
exit;
}
?>

… and then there is some new “fetch” and Ajax rich HTML and Javascript as per …

New Global Variables and Asynchronous section Javascript …

var myxhr=null, formis=null;
var ipuvalid=true, ipis='';


image_list = new Array();

// Thanks to https://stackoverflow.com/questions/74997800/how-to-code-a-synchronous-wrapper-for-jquery-ajax-functions
(async () => {

const resip = await fetch("./index.php?getmeip=" + Math.floor(Math.random() * 198978675), {/* options here */});
const dataip = await resip.json();

for (var inmip=0; inmip<dataip.length; inmip++) {
if (inmip == eval(-1 + dataip.length)) {
ipis='' + dataip[inmip];
if (inmip != 0) {
ipuvalid=false;
setTimeout(nag, 200);
}
}
}

})();

// Thanks to https://stackoverflow.com/questions/74997800/how-to-code-a-synchronous-wrapper-for-jquery-ajax-functions
(async () => {

const res = await fetch("./index.php?diris=images&prefixis=DSC_0&startsuffix=279&endsuffix=364", {/* options here */});
const data = await res.json();

for (var inm=0; inm<data.length; inm++) {
image_list[image_index++] = new imageItem(data[inm]);
console.log('Added ' + data[inm]);
}

console.log(data);
console.log("Some code after that uses data");

})();


image_list[image_index++] = new imageItem('images/DSC_0279.jpg');

image_list[image_index++] = new imageItem('images/DSC_0280.jpg');

// more usual code follows
New Javascript functions …

function nag() {
if (document.getElementById('imgcopycheck')) {
document.getElementById('imgcopycheck').title+=' Sorry, we cannot authorize uploads here.';
document.getElementById('imgcopycheck').disabled=true;
document.getElementById('imgcopycheck').style.visibility='hidden';
} else {
setTimeout(nag, 200);
}
}

function getipvalid() {
return ipuvalid;
}

function uplitc(icontis) {
if (icontis.indexOf('data:image/') == 0) {
myxhr = new XMLHttpRequest();
formis = new FormData();
formis.append('diris', 'images');
formis.append('prefixis', 'DSC_0');
formis.append('startsuffix', '279');
formis.append('endsuffix', '364');
formis.append('newdurl', icontis);
myxhr.open('POST', './index.php'); //, true);
myxhr.send(formis);
}
}

function uplit(divo) {
var icontis='';
if (divo.innerHTML.indexOf('data:image/') == 0) {
icontis=divo.innerHTML;
divo.innerHTML='';
divo.title=icontis;
myxhr = new XMLHttpRequest();
formis = new FormData();
formis.append('diris', 'images');
formis.append('prefixis', 'DSC_0');
formis.append('startsuffix', '279');
formis.append('endsuffix', '364');
formis.append('newdurl', icontis);
myxhr.open('POST', './index.php'); //, true);
myxhr.send(formis);
} else if (divo.innerHTML.indexOf('"data:image/') != -1) {
icontis='data:image/' + divo.innerHTML.split('data:image/')[1].split('"')[0];
divo.innerHTML='';
divo.title=icontis;
myxhr = new XMLHttpRequest();
formis = new FormData();
formis.append('diris', 'images');
formis.append('prefixis', 'DSC_0');
formis.append('startsuffix', '279');
formis.append('endsuffix', '364');
formis.append('newdurl', icontis);
myxhr.open('POST', './index.php'); //, true);
myxhr.send(formis);
}
}
New HTML span element …

<a id="thedivlink" style="display:block;" title="Click for Temple of Groovy provided by http://www.freesoundtrackmusic.com" alt="Street Art - RJM Programming ... you might see this while loading ... click here now to just play music (Temple of Groovy provided by http://www.freesoundtrackmusic.com) with less variety of imagery ... else please wait for full functionality ..." onclick="javascript: window.open('index-ssmhalf.html','Street Art - Soul Tracker Mechanism (via http://www.freesoundtrackmusic.com) - RJM Programming - http://www.rjmprogramming.com.au (Copyright © 2011 rjmprogramming.com.au all rights reserved.)');" alt="Street Art - RJM Programming ... you might see this while loading ... click here now to just play music (Temple of Groovy provided by http://www.freesoundtrackmusic.com) with less variety of imagery ... else please wait for full functionality ..." title="Click for Temple of Groovy provided by http://www.freesoundtrackmusic.com" href="sound/Temple_of_Groovy-freesoundtrackmusic.mp3" >Street Art - RJM Programming ... you might see this while loading ... click here now to just play music (Temple of Groovy provided by http://www.freesoundtrackmusic.com) with less variety of imagery ... else please wait for full functionality ...</a>&nbsp;<span title="Image copy paste here to upload that way." onclick="event.stopPropagation();" onblur="uplit(this);" onpaste="uplit(this);" contenteditable=true id="imgcopycheck" style="border:2px dotted red;width:50px;height:25px;display:inline-block;">&#x2B06;&#xFE0F; &#x1F5BC;&#xFE0F;</span>

… that is “undercover” to most trying out our Street Art “One Image Website” project.


Previous relevant Using Document Writeln Onpaste Tutorial is shown below.

Using Document Writeln Onpaste Tutorial

Using Document Writeln Onpaste Tutorial

Regarding yesterday’s Using Document Writeln Primer Tutorial you might wonder …

Why involve either/both textarea and div (contenteditable=true) elements as “containers” of content?

Well, with yesterday’s starting onblur (just) event gambit, it’s a very pertinent question, but, today, we introduce onpaste event work, and involving this event with the div element can have it distinguishing itself, able to accept graphical (eg. image) content. For example, the user can have their cursor placed into the div element and have been in an image editor having Edit->Select Alled and Edit->Copyed graphical content, then that can be Edit->Pasted into the div as graphical content.

As you might imagine, this opens a Pandora’s Box of possibilities regarding image sizing, but we apply inline CSS styling …


style='object-fit:contain;width:100%;height:100%;'

… to the img data URIed element within the div element that happens when graphical content is pasted into it, so that the graphical data is unlikely to spill too far outside the div bounds, assuming only one image is pasted, that is.

So feel free to try a changed using_writeln.html first draft Using (Document) Writeln web application for you to try yourself.


Previous relevant Using Document Writeln Primer Tutorial is shown below.

Using Document Writeln Primer Tutorial

Using Document Writeln Primer Tutorial

The other day we stumbled on some advice leading us to use …


document.writeln([html-content]);

… rather than our usual “go to” …


document.write([html-content]);

And so we wrote a “proof of concept” using_writeln.html first draft Using (Document) Writeln web application for you to try yourself.

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


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


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


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


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


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


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


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


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


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


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


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


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

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

Shower Song Radio Play Integration Tutorial

Shower Song Radio Play Integration Tutorial

Shower Song Radio Play Integration Tutorial

If you’ll pardon the pun …

We’ve been like a “broken record” regarding that familiar theme of “Sequential Play of YouTube Music Videos” over a few years now

… and today we’re integrating the …

  • Radio Play project smarts of recent times … into no, not the shower, Luna! … but into …
  • Shower Songs

… yay!?! Because, let’s face it, not many of us walk around with 11 character YouTube video codes in our head and no, not there either, Luna!!

That Radio Play project integrated with the great YouTube’s search functionality, to be able to …

  • consider a search string (users can enter via a new textbox within that new form as per yesterday’s advances) … and …
  • return a related 11 character YouTube video code

… as the means by which the user contents parts of our Shower Songs project can be improved a lot, further to yesterday’s Shower Song Remember and Recall Tutorial! Luna?!

Yet again, try the changed fifth draft Shower Songs below and helped out a lot via the changed swipe_media.html Radio Play project web application, as per


<script type=text/javascript>
var dwfrom='youllneverfindthis';
var dwto='youllneverfindthis';
if (document.URL.indexOf('isradio=') != -1) {
dwfrom=' style="min-width:';
dwto=' style="opacity:0.6;cursor:progress;border-left:8px dotted yellow;border-right:8px dotted yellow;min-width:';
}
var bigline="      <button id=bdisco onclick=\"dodisco('bdisco=radnoiswas&');\" style='background-color:yellow;'>" + dword + "<sup>A+V</sup> <span id=bdiscoavb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dodisco('isradio=bdiscoavb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button> <button id=bdiscoa onclick=\"dodisco('bdiscoa=radnoiswas&audio');\" style='background-color:yellow;'>" + dword + "<sub>A-V</sub> <span id=bdiscob title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dodisco('isradio=bdiscob&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>  <button id=bwc onclick=\"dowc('bwc=radnoiswas&');\" style='background-color:yellow;'>" + twcword + "<sup>A+V</sup> <span id=bwcavb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dowc('isradio=bwcavb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button> <button id=bwca onclick=\"dowc('bwca=radnoiswas&audio');\" style='background-color:yellow;'>" + twcword + "<sub>A-V</sub> <span id=bwcb title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ dowc('isradio=bwcb&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>  <button id=byr onclick=\"doyr('byr=radnoiswas&');\" style='background-color:yellow;'>" + yrword.replace('YaJUNKcht ', 'Yacht++ ') + "<sup>A+V</sup> <span id=byravb title='Radio A+V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ doyr('isradio=byravb&'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>     <button id=byra onclick=\"doyr('byra=radnoiswas&audio');\" style='background-color:yellow;'>" + yrword.replace('YaJUNKcht ', 'Yacht++ ') + "<sub>A-V</sub> <span id=byrb title='Radio A-V ... double click for compilation' ondblclick=\"event.stopPropagation(); triplewhammy(this); \" onclick=\"event.stopPropagation(); setTimeout(function(){ doyr('isradio=byrb&audio'); }, 2000);\" style='background-color:yellow;visibility:hidden;'>📻</span></button>    <button id=recallable title=Saved onclick=\"recallit(this);\" style='background-color:orange;visibility:hidden;'></button>";
if (window.opener) {

if (document.URL.indexOf('isradio=') != -1 && document.URL.indexOf('youtube=') != -1) {


// Talk to shower_songs.html
if (top.document.URL.indexOf('regarding=') != -1 && top.document.URL.indexOf('isradio=') != -1 && top.document.URL.indexOf('youtube=') != -1) {
if (top.window.opener) {
var waszv='';
for (var inm=0; inm<Math.min(7,eval('' + vidids.length)); inm++) {
if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm))) {
if (top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value.indexOf('#') == -1) {
waszv= top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value;
top.window.opener.parent.window.opener.document.getElementById('inp00' + eval(1 + inm)).value=vidids[inm] + '#' + waszv;
}
}
}
top.window.opener.parent.window.opener.document.body.style.cursor='pointer';
}
}


if (!asa) { assoonas(); }
radioblurb=' ... click on start song (when emojis appear) then we suggest minimising window small but on top (next to other work windows) for radio sequenced play';
var doctt='' + document.title;
document.title=String.fromCodePoint(128251) + ' ' + (location.search.split('regarding=')[1] ? decodeURIComponent(location.search.split('regarding=')[1].split('&')[0]).replace('Yacht Rock','Yacht++ Rock') : '') + ' Radio Play ... ' + doctt;
} else {
if (!asa) { as_soon_as(); } //document.getElementById('td0001').style.border='15px dotted yellow';
radioblurb=' ... please wait for more than one checkbox checked before radio sequenced play is started above';
}
} else if (document.URL.indexOf('isradio=') != -1) {
if (!asa) { as_soon_as(); } //document.getElementById('td0001').style.border='15px dotted yellow';
radioblurb=' ... please wait for more than one checkbox checked before radio sequenced play is started above';
if (document.URL.indexOf('youtube=') != -1) {
var xdoctt='' + document.title;
document.title=String.fromCodePoint(128251) + ' ' + (location.search.split('regarding=')[1] ? decodeURIComponent(location.search.split('regarding=')[1].split('&')[0]).replace('Yacht Rock','Yacht++ Rock') : '') + ' Radio Play ... ' + xdoctt;
}
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
radioblurb+=' and we recommend screen lock on';
}
for (var kk=1; kk<=eval(100 * numc); kk++) {
if (eval(kk % eval('' + bcol.length)) == 0) {
dw+=('<td class=loremipsum data-alt="" data-arb="" data-vid="" data-curs="' + cursanimtwo[cntcurs] + '" alt="Cell ' + kk + radioblurb + cursanimtwo[cntcurs] + '" title="If not showing an image ( this one thanks to Lorem Picsum at https://picsum.photos/ ) or to reveal it behind audio or video foreground content please double click here at cell ' + kk + '." ondblclick=refresh(this.id); id="td' + ('0000' + kk).slice(-4) + '" style="min-width:' + amin + 'px;min-height:' + amin + 'px;width:' + amin + 'px;height:' + amin + "px;background-color:" + bcol[eval(kk % eval('' + bcol.length))] + ";" + 'background-size:contain;background-repeat:no-repeat;">' + grabcontent(eval(-1 + kk)) + '</td>').replace(dwfrom,dwto);
setTimeout(cursanimate, 600);
} else {
dw+=('<td onmousedown="checkmeout(event,false);" ontouchdown="checkmeout(event,false);" oncontextmenu="checkmeout(event,true);" class=inhouse data-alt="" data-arb="" data-vid="" alt="Cell ' + kk + radioblurb + cursanimtwo[cntcurs] + '" title="If not showing an image ( yellow cell ones thanks to Lorem Picsum at https://picsum.photos/ ) please double click here at cell ' + kk + ' or just click to get popup window of associated WordPress Blog Posting else right click for associated Cut to the Chase." ondblclick=refresh(this.id); id="td' + ('0000' + kk).slice(-4) + '" style="min-width:' + amin + 'px;min-height:' + amin + 'px;width:' + amin + 'px;height:' + amin + "px;background-color:" + bcol[eval(kk % eval('' + bcol.length))] + ";" + 'background-size:contain;background-repeat:no-repeat;">' + grabcontent(eval(-1 + kk)) + '</td>').replace(dwfrom,dwto);
}
dwfrom='youllneverfindthis';
dwto='youllneverfindthis';
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && (isPortrait || isLandscape)) {
bigline=bigline.replace(/\>The Wrecking Crew/g,'>The Wrecking <br>Crew').replace(/\>Yacht\+\+ Rock/g,'>Yacht++ <br>Rock').replace(/\>Yacht Rock/g,'>Yacht <br>Rock').replace(/\>Disco/g,'>Disco <br>');
}
document.write(dw + "</tr></table><br>" + bigline);
</script>


Previous relevant Shower Song Remember and Recall Tutorial is shown below.

Shower Song Remember and Recall Tutorial

Shower Song Remember and Recall Tutorial

Following on from yesterday’s Shower Song Mobile User Functionality Tutorial today …

  • we would like to help out the user …
  • via a “remembering” form … assisted by …
  • a “recalling” usefulness via window.localStorage means … and flagged to the user via …
  • delivering dropdown options

… reflecting those settings the user has chosen to remember out of …

  • YouTube 11 character video code(s) (up to 7)
  • an order of play (up to 7)

So, again, try the changed fourth draft Shower Songs below.


Previous relevant Shower Song Mobile User Functionality Tutorial is shown below.

Shower Song Mobile User Functionality Tutorial

Shower Song Mobile User Functionality Tutorial

The better fit “hardware wise” for a “shower scene” is one of the mobile devices. And so, onto yesterday’s Shower Song User Functionality Tutorial we’ve started down Mobile Road to Chickasaw today, easing us into …

  • in the mobile woooorrrrllllddd a red button overlays a YouTube video so that the audio stream of a video tap of a user will be a real user gesture … and if the red buttons are slow to appear, before that the links can navigate you to a YouTube video play scenario, as distinct from …
  • in the non-mobile woooorrrrllllddd (we’ve heard starts near Chickasaw) clicks can be of the programmatical kind … and we recommend “kind clicking” at all times

We’re not saying that there is not more work to do (in “double negative heaven”), but we realized …

  • on mobile a tap interrupts “normal audio play” transmission … different to …
  • on non-mobile a click may not interrupt a previously arranged “normal audio play” transmission

Big deal?! Yes, you’d not think so, but there you are, as we ‘ve been on that little conundrum for two hours now, with lots of blaspheming?!

Much more testing, but we took our iPhone into the shower, placed it far away from the shower near an open window, and picked a good shower song (am a sucker for “I’m With You”), and clicked the looping emoji to just repeat that song four times, as one of our tests … sorry about the long shower … peepholespeople of the wooooooorrrrrlllllddd?!

Try the changed third draft Shower Songs below.


Previous relevant Shower Song User Functionality Tutorial is shown below.

Shower Song User Functionality Tutorial

Shower Song User Functionality Tutorial

Onto yesterday’s Shower Song Primer Tutorial we’ve been shoring up user functionality, today, adding in quite a few emoji button helpers pointing to functionality.

Lots of the thinking revolved around trying to space out the user checkbox clicking on non-mobile control of the HTML input type=checkboxs


disabled

… attribute …


var ftime=true;

function whendo() {
var ccnt=0;
var talisti=eval(-1 + eval('' + document.body.innerHTML.split(' style="z-index:599').length)); //('span');
var talist=document.getElementsByTagName('sup');
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
ccnt++;
}
}
if (eval('' + talist.length) < ccnt) {
setTimeout(whendo, 1000);
} else {
talist=document.getElementsByTagName('a');
for (var iki=0; iki<talist.length; iki++) {
if (talist[iki].outerHTML.indexOf(' class="processytplay"') != -1) {
talist[iki].onmousedown=function(event){ myac(event.target); };
}
}
setTimeout(function(){ cball(false); }, 500);
}


}

function cball(to) {
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
if (to) {
inlist[ik].setAttribute('disabled',to);
} else {
inlist[ik].removeAttribute('disabled');
}
}
}

if (ftime) {
ftime=false;
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(whendo, 1000);
}
}
}

… in the changed second draft Shower Songs as below.


Previous relevant Shower Song Primer Tutorial is shown below.

Shower Song Primer Tutorial

Shower Song Primer Tutorial

We’re onto a new music related project today, with that familiar theme of “Sequential Play of YouTube Music Videos” where today’s project, so far, just hones in on the “audio stream only of those YouTube videos”.

We have some provisos with our Shower Songs collection …

  • it will work on mobile but not to the automated state non-mobile is in, on this first draft …
  • more display niceties to come …
  • user content functionality to come …

… but feel free to set yourself up (but careful of “bathroom mist” not being good for electronic devices) with today’s first draft Shower Songs as below …

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


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


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


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


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

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

Shower Song Remember and Recall Tutorial

Shower Song Remember and Recall Tutorial

Shower Song Remember and Recall Tutorial

Following on from yesterday’s Shower Song Mobile User Functionality Tutorial today …

  • we would like to help out the user …
  • via a “remembering” form … assisted by …
  • a “recalling” usefulness via window.localStorage means … and flagged to the user via …
  • delivering dropdown options

… reflecting those settings the user has chosen to remember out of …

  • YouTube 11 character video code(s) (up to 7)
  • an order of play (up to 7)

So, again, try the changed fourth draft Shower Songs below.


Previous relevant Shower Song Mobile User Functionality Tutorial is shown below.

Shower Song Mobile User Functionality Tutorial

Shower Song Mobile User Functionality Tutorial

The better fit “hardware wise” for a “shower scene” is one of the mobile devices. And so, onto yesterday’s Shower Song User Functionality Tutorial we’ve started down Mobile Road to Chickasaw today, easing us into …

  • in the mobile woooorrrrllllddd a red button overlays a YouTube video so that the audio stream of a video tap of a user will be a real user gesture … and if the red buttons are slow to appear, before that the links can navigate you to a YouTube video play scenario, as distinct from …
  • in the non-mobile woooorrrrllllddd (we’ve heard starts near Chickasaw) clicks can be of the programmatical kind … and we recommend “kind clicking” at all times

We’re not saying that there is not more work to do (in “double negative heaven”), but we realized …

  • on mobile a tap interrupts “normal audio play” transmission … different to …
  • on non-mobile a click may not interrupt a previously arranged “normal audio play” transmission

Big deal?! Yes, you’d not think so, but there you are, as we ‘ve been on that little conundrum for two hours now, with lots of blaspheming?!

Much more testing, but we took our iPhone into the shower, placed it far away from the shower near an open window, and picked a good shower song (am a sucker for “I’m With You”), and clicked the looping emoji to just repeat that song four times, as one of our tests … sorry about the long shower … peepholespeople of the wooooooorrrrrlllllddd?!

Try the changed third draft Shower Songs below.


Previous relevant Shower Song User Functionality Tutorial is shown below.

Shower Song User Functionality Tutorial

Shower Song User Functionality Tutorial

Onto yesterday’s Shower Song Primer Tutorial we’ve been shoring up user functionality, today, adding in quite a few emoji button helpers pointing to functionality.

Lots of the thinking revolved around trying to space out the user checkbox clicking on non-mobile control of the HTML input type=checkboxs


disabled

… attribute …


var ftime=true;

function whendo() {
var ccnt=0;
var talisti=eval(-1 + eval('' + document.body.innerHTML.split(' style="z-index:599').length)); //('span');
var talist=document.getElementsByTagName('sup');
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
ccnt++;
}
}
if (eval('' + talist.length) < ccnt) {
setTimeout(whendo, 1000);
} else {
talist=document.getElementsByTagName('a');
for (var iki=0; iki<talist.length; iki++) {
if (talist[iki].outerHTML.indexOf(' class="processytplay"') != -1) {
talist[iki].onmousedown=function(event){ myac(event.target); };
}
}
setTimeout(function(){ cball(false); }, 500);
}


}

function cball(to) {
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
if (to) {
inlist[ik].setAttribute('disabled',to);
} else {
inlist[ik].removeAttribute('disabled');
}
}
}

if (ftime) {
ftime=false;
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(whendo, 1000);
}
}
}

… in the changed second draft Shower Songs as below.


Previous relevant Shower Song Primer Tutorial is shown below.

Shower Song Primer Tutorial

Shower Song Primer Tutorial

We’re onto a new music related project today, with that familiar theme of “Sequential Play of YouTube Music Videos” where today’s project, so far, just hones in on the “audio stream only of those YouTube videos”.

We have some provisos with our Shower Songs collection …

  • it will work on mobile but not to the automated state non-mobile is in, on this first draft …
  • more display niceties to come …
  • user content functionality to come …

… but feel free to set yourself up (but careful of “bathroom mist” not being good for electronic devices) with today’s first draft Shower Songs as below …

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


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


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


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

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

Shower Song Mobile User Functionality Tutorial

Shower Song Mobile User Functionality Tutorial

Shower Song Mobile User Functionality Tutorial

The better fit “hardware wise” for a “shower scene” is one of the mobile devices. And so, onto yesterday’s Shower Song User Functionality Tutorial we’ve started down Mobile Road to Chickasaw today, easing us into …

  • in the mobile woooorrrrllllddd a red button overlays a YouTube video so that the audio stream of a video tap of a user will be a real user gesture … and if the red buttons are slow to appear, before that the links can navigate you to a YouTube video play scenario, as distinct from …
  • in the non-mobile woooorrrrllllddd (we’ve heard starts near Chickasaw) clicks can be of the programmatical kind … and we recommend “kind clicking” at all times

We’re not saying that there is not more work to do (in “double negative heaven”), but we realized …

  • on mobile a tap interrupts “normal audio play” transmission … different to …
  • on non-mobile a click may not interrupt a previously arranged “normal audio play” transmission

Big deal?! Yes, you’d not think so, but there you are, as we ‘ve been on that little conundrum for two hours now, with lots of blaspheming?!

Much more testing, but we took our iPhone into the shower, placed it far away from the shower near an open window, and picked a good shower song (am a sucker for “I’m With You”), and clicked the looping emoji to just repeat that song four times, as one of our tests … sorry about the long shower … peepholespeople of the wooooooorrrrrlllllddd?!

Try the changed third draft Shower Songs below.


Previous relevant Shower Song User Functionality Tutorial is shown below.

Shower Song User Functionality Tutorial

Shower Song User Functionality Tutorial

Onto yesterday’s Shower Song Primer Tutorial we’ve been shoring up user functionality, today, adding in quite a few emoji button helpers pointing to functionality.

Lots of the thinking revolved around trying to space out the user checkbox clicking on non-mobile control of the HTML input type=checkboxs


disabled

… attribute …


var ftime=true;

function whendo() {
var ccnt=0;
var talisti=eval(-1 + eval('' + document.body.innerHTML.split(' style="z-index:599').length)); //('span');
var talist=document.getElementsByTagName('sup');
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
ccnt++;
}
}
if (eval('' + talist.length) < ccnt) {
setTimeout(whendo, 1000);
} else {
talist=document.getElementsByTagName('a');
for (var iki=0; iki<talist.length; iki++) {
if (talist[iki].outerHTML.indexOf(' class="processytplay"') != -1) {
talist[iki].onmousedown=function(event){ myac(event.target); };
}
}
setTimeout(function(){ cball(false); }, 500);
}


}

function cball(to) {
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
if (to) {
inlist[ik].setAttribute('disabled',to);
} else {
inlist[ik].removeAttribute('disabled');
}
}
}

if (ftime) {
ftime=false;
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(whendo, 1000);
}
}
}

… in the changed second draft Shower Songs as below.


Previous relevant Shower Song Primer Tutorial is shown below.

Shower Song Primer Tutorial

Shower Song Primer Tutorial

We’re onto a new music related project today, with that familiar theme of “Sequential Play of YouTube Music Videos” where today’s project, so far, just hones in on the “audio stream only of those YouTube videos”.

We have some provisos with our Shower Songs collection …

  • it will work on mobile but not to the automated state non-mobile is in, on this first draft …
  • more display niceties to come …
  • user content functionality to come …

… but feel free to set yourself up (but careful of “bathroom mist” not being good for electronic devices) with today’s first draft Shower Songs as below …

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


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


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

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

Shower Song User Functionality Tutorial

Shower Song User Functionality Tutorial

Shower Song User Functionality Tutorial

Onto yesterday’s Shower Song Primer Tutorial we’ve been shoring up user functionality, today, adding in quite a few emoji button helpers pointing to functionality.

Lots of the thinking revolved around trying to space out the user checkbox clicking on non-mobile control of the HTML input type=checkboxs


disabled

… attribute …


var ftime=true;

function whendo() {
var ccnt=0;
var talisti=eval(-1 + eval('' + document.body.innerHTML.split(' style="z-index:599').length)); //('span');
var talist=document.getElementsByTagName('sup');
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
ccnt++;
}
}
if (eval('' + talist.length) < ccnt) {
setTimeout(whendo, 1000);
} else {
talist=document.getElementsByTagName('a');
for (var iki=0; iki<talist.length; iki++) {
if (talist[iki].outerHTML.indexOf(' class="processytplay"') != -1) {
talist[iki].onmousedown=function(event){ myac(event.target); };
}
}
setTimeout(function(){ cball(false); }, 500);
}


}

function cball(to) {
var inlist=document.getElementsByTagName('input');
for (var ik=0; ik<inlist.length; ik++) {
if (inlist[ik].outerHTML.indexOf('checkbox') != -1) {
if (to) {
inlist[ik].setAttribute('disabled',to);
} else {
inlist[ik].removeAttribute('disabled');
}
}
}

if (ftime) {
ftime=false;
if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(whendo, 1000);
}
}
}

… in the changed second draft Shower Songs as below.


Previous relevant Shower Song Primer Tutorial is shown below.

Shower Song Primer Tutorial

Shower Song Primer Tutorial

We’re onto a new music related project today, with that familiar theme of “Sequential Play of YouTube Music Videos” where today’s project, so far, just hones in on the “audio stream only of those YouTube videos”.

We have some provisos with our Shower Songs collection …

  • it will work on mobile but not to the automated state non-mobile is in, on this first draft …
  • more display niceties to come …
  • user content functionality to come …

… but feel free to set yourself up (but careful of “bathroom mist” not being good for electronic devices) with today’s first draft Shower Songs as 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, Tutorials | Tagged , , , , , , , , , , , , , , , , | Leave a comment