Image Filter Display Tutorial

Image Filter Display Tutorial

Image Filter Display Tutorial

We’re glad today’s “Image Filter Display Tutorial” blog posting title is shorter than yesterday’s “Animated GIF Duration Calculation Filter Browsing Tutorial” because the main task today was …

  • to take all our “proof of concept” web applications and distil them down to an “Image Filter Display” web application of far greater simplicity … and along that way …
  • we had to play around with one more “proof of concept” idea, that of allowing the user to control the content of the CSS filters dropdown, and our first “out there” thought that contenteditable=true could be applied to all the dropdown’s option elements to achieve this needed to be disproved (as it took two hours to be sure of … to be sure) … in favour of a new dropdown “Change” option solution …

    function callresell() {
    var oselo=document.getElementById('simgag');
    var svalis='';
    var sc=';';
    var changefound=false;
    if (document.getElementById('imgag')) {
    oselo.value=document.getElementById('imgag').title;
    }
    var reselit=prompt('Please change the semicolon separated options list. Optionally hash # separate a CSS filter refresh interval in seconds (currently ' + eval(Math.abs(ingifint) / 1000.000) + ' seconds).', oselo.innerText);
    if (reselit != null) {
    if (reselit.indexOf('#') != -1) {
    if (ingifint < 0) {
    ingifint=Math.round(eval(-1000.0 * eval('' + reselit.split('#')[1].split(';')[0])));
    } else {
    ingifint=Math.round(eval(1000.0 * eval('' + reselit.split('#')[1].split(';')[0])));
    }
    reselit=reselit.replace('#' + reselit.split('#')[1].split(';')[0], '');
    }
    }
    if (reselit == null) {
    return '';
    } else if (reselit != oselo.innerText) {
    var sih=oselo.innerHTML;
    var vsl=reselit.split(';');
    var shi=sih.split('</option>');
    var ssize='' + oselo.size;
    var vssize=0;
    var newih='';
    for (var ihi=0; ihi<vsl.length; ihi++) {
    if (vsl[ihi].trim() != '') {
    if (vsl[ihi].trim() == 'Change') { changefound=true; sc=''; } else { sc=';'; }
    if (eval('' + shi.length) > ihi) {
    if (eval('' + (shi[ihi] + '</option>').split(vsl[ihi].trim() + sc).length) == 3) {
    newih+=shi[ihi] + '</option>';
    vssize++;
    } else {
    svalis=shi[ihi].split(' value="')[1].split('"')[0];
    newih+=shi[ihi].split('>')[0].replace(svalis, vsl[ihi].trim() + sc) + '>' + vsl[ihi].trim() + sc + '</option>';
    vssize++;
    }
    } else if (vsl[ihi].trim().indexOf('filter:') == 0) {
    newih+='<option contenteditable=true value="' + vsl[ihi].trim() + sc + '">' + vsl[ihi].trim() + sc + '</option>';
    vssize++;
    } else {
    newih+='<option contenteditable=true value="' + vsl[ihi].trim() + '">' + vsl[ihi].trim() + '' + '</option>';
    vssize++;
    }
    }
    }
    if (!changefound) {
    newih+='<option contenteditable=true value="Change">Change</option>';
    vssize++;
    }
    oselo.innerHTML=newih;
    if (eval('' + ssize) != eval('' + vssize)) {
    oselo.size='' + eval('' + vssize);
    }
    }
    return '';
    }

    … and …
  • in the image browsing helper we needed to allow for non animated GIF images, as we did for our new image_css_filter_display.html “first draft” “Image Filter Display” web application”

And so, onto yesterday’s Animated GIF Duration Calculation Filter Browsing Tutorial we developed, today, a changed client_browsing.htm helper web application you can try for yourself as a standalone arrangement or have it get called via today’s changed read_exif_off_image_rotate.php PHP image exif reporter web application.


Previous relevant Animated GIF Duration Calculation Filter Browsing Tutorial is shown below.

Animated GIF CSS Filter Browsing Tutorial

Animated GIF Duration Calculation Filter Browsing Tutorial

Can a “proof of concept” arrangement last three blog postings? If there’s more you want to prove, ahead of committing to the final product that might hone in on the specificity of the idea, and another iframe hosted web application joins in on “proof of concept” goings on and will be useful into the future, we’d say it’s possible, yes. But we would say that, wouldn’t we?!

In our defence, it is easier to prove all solutions to all the contentious issues, and then hone in and reduce to make a specific new web application, rather than extending and still needing to prove as you go along, not knowing whether an issue will cause you insurmountable issues in the future.

But they would say that, wouldn’t they?!

And so, continuing on from the recent Animated GIF Duration Calculation Filter Tutorial we considered another mode that a user might use on top of …

  • entering an image (animated GIF) URL into a textbox … that being to …
  • browse for a local system (animated GIF) file (via File API)

… getting us to call on changes to our “via File API” specialist with a changed (with new data URI supporting Javascript) …


var ingif='', ingifstyle='filter: none;', ingifint=0, ingifchosen=false, isag=-1, isagname='';

function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1 || whatgifmaybe.indexOf('data:image/gif') == 0) {
ingif=whatgifmaybe;
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

function clooktv(intv) {
var finds=[];
document.getElementById('imgag').title=intv;
if (ingifchosen) {
finds=document.getElementById('simgag').outerHTML.split('>' + intv + '</option>');
if (eval('' + finds.length) > 1) {
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
}
document.body.innerHTML+='<style> #imgag { ' + intv + ' } </style>';
return intv;
}

function changelook() {
var finds=[];
if (ingifint > 0) {
setTimeout(changelook, ingifint);
if (ingifchosen) {
ingifchosen=false;
} else {
finds=document.getElementById('simgag').outerHTML.split('>' + ingifstyle + '</option>');
if (eval('' + finds.length) > 1) {
if (finds[1].indexOf('</select>') == 0) {
ingifstyle='filter: none;';
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
} else {
ingifstyle=finds[1].split('>')[1].split('<')[0];
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
document.getElementById('simgag').value=clooktv(ingifstyle);
}
}
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF);
duration += delay < 2 ? 10 : delay;
}
}
//alert('' + eval(duration / 100));
if (eval(duration / 100) > 0.11) {
//alert('' + duration);
var damore='', wpthere=false;
if (document.getElementById('aside')) {
if (document.getElementById('aside').outerHTML.toLowerCase().indexOf('<div') == 0) {
damore=' showing <select onchange=\"ingifchosen=true; ingifstyle=clooktv(this.value);\" id=simgag size=13><option value=\"filter: none;\" selected>filter: none;</option><option value=\"filter: blur(5px);\">filter: blur(5px);</option><option value=\"filter: brightness(0.4);\">filter: brightness(0.4);</option><option value=\"filter: contrast(200%);\">filter: contrast(200%);</option><option value=\"filter: drop-shadow(16px 16px 20px blue);\">filter: drop-shadow(16px 16px 20px blue);</option><option value=\"filter: grayscale(50%);\">filter: grayscale(50%);</option><option value=\"filter: hue-rotate(90deg);\">filter: hue-rotate(90deg);</option><option value=\"filter: invert(75%);\">filter: invert(75%);</option><option value=\"filter: opacity(25%);\">filter: opacity(25%);</option><option value=\"filter: saturate(30%);\">filter: saturate(30%);</option><option value=\"filter: sepia(60%);\">filter: sepia(60%);</option><option value=\"filter: contrast(175%) brightness(33%);\">filter: contrast(175%) brightness(33%);</option><option value=\"filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);\">filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);</option></select><br><br><img onload=\"if (ingifint == 0) { ingifint=' + eval(duration * 10) + '; setTimeout(changelook, eval(800 + ingifint)); }\" title=\"filter: none;\" src=\"' + ingif + '\" id=imgag></img><br>';
//ingifint=eval(duration * 10);
//setTimeout(changelook, eval(duration * 10));
if (window.parent) {
if (window.self !== window.parent && parent.document.getElementById('aside')) {
wpthere=true;
parent.document.getElementById('aside').innerHTML='Animated GIF ' + isagname + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
parent.document.getElementById('aside').scrollIntoView();
parent.document.getElementById('image').style.opacity='0.5';
parent.document.getElementById('image').style.width='5%';
parent.document.getElementById('isub').style.opacity='0.5';
} else {
document.getElementById('aside').style.display='block';
document.getElementById('aside').innerHTML='Animated GIF ' + isagname + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
}
} else {
document.getElementById('aside').style.display='block';
document.getElementById('aside').innerHTML='Animated GIF ' + isagname + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
}
if (!wpthere) { document.getElementById('aside').scrollIntoView(); }
} else {
document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF ' + isagname + ' duration is ' + eval(duration / 100) + ' seconds)' + damore;
}
}
//} else {
//alert('duration=' + duration);
}
document.body.style.cursor='pointer';
return duration / 100; // if 0.1 is not an animated GIF
}

client_browsing.htm helper web application you can try for yourself as a standalone arrangement or have it get called via today’s changed read_exif_off_image_rotate.php PHP image exif reporter web application.

Did you know?

A quirk with our new HTML button element within an HTML form had us, initially, before realizing …

  • onmousedown event event.stopPropagation() usage can be used to cancel a following onclick event on non-mobile … and …
  • ontouchdown (yay!!!) event event.stopPropagation() usage can be used to cancel a following onclick event on mobile

… as in …


<button title='Click or touch here, as required, for chance to browse for Animated GIF' ontouchdown='event.stopPropagation(); spagif();' onmousedown='event.stopPropagation(); spagif();'><sup>Animated</sup><sub>GIF</sub></button>

… and could overcome the adverse “onclick” based coding we had prior to the discovery. Thanks to javascript – Does using event.preventDefault() in “mousedown” prevent “click” or “mouseup” event in jquery? – Stack Overflow for the heads up about this.


Previous relevant Animated GIF Duration Calculation Filter Tutorial is shown below.

Animated GIF CSS Filter Tutorial

Animated GIF Duration Calculation Filter Tutorial

Can a “proof of concept” arrangement last two blog postings? If there’s more you want to prove, ahead of committing to the final product that might hone in on the specificity of the idea, we’d say it’s possible, yes. And so, continuing on from the recent Animated GIF Duration Calculation Primer Tutorial we tweak its PHP hosting “proof of concept” parent web application to try out our second point we’re out to prove …

We want to prove that CSS filter works for animated GIFs as well as it appears to work with other image types of elements.

Conservative worry, we grant you, but we did want to make sure this all worked, and happily, it was all fine …


var ingif='', ingifstyle='filter: none;', ingifint=0, ingifchosen=false;

function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1) {
ingif=whatgifmaybe;
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

function clooktv(intv) {
var finds=[];
document.getElementById('imgag').title=intv;
if (ingifchosen) {
finds=document.getElementById('simgag').outerHTML.split('>' + intv + '</option>');
if (eval('' + finds.length) > 1) {
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
}
document.body.innerHTML+='<style> #imgag { ' + intv + ' } </style>';
return intv;
}

function changelook() {
var finds=[];
if (ingifint > 0) {
setTimeout(changelook, ingifint);
if (ingifchosen) {
ingifchosen=false;
} else {
finds=document.getElementById('simgag').outerHTML.split('>' + ingifstyle + '</option>');
if (eval('' + finds.length) > 1) {
if (finds[1].indexOf('</select>') == 0) {
ingifstyle='filter: none;';
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
} else {
ingifstyle=finds[1].split('>')[1].split('<')[0];
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
document.getElementById('simgag').value=clooktv(ingifstyle);
}
}
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF);
duration += delay < 2 ? 10 : delay;
}
}
//alert('' + eval(duration / 100));
if (eval(duration / 100) > 0.11) {
var damore='';
if (document.getElementById('aside')) {
if (document.getElementById('aside').outerHTML.toLowerCase().indexOf('<div') == 0) {
damore=' showing <select onchange=\"ingifchosen=true; ingifstyle=clooktv(this.value);\" id=simgag size=13><option value=\"filter: none;\" selected>filter: none;</option><option value=\"filter: blur(5px);\">filter: blur(5px);</option><option value=\"filter: brightness(0.4);\">filter: brightness(0.4);</option><option value=\"filter: contrast(200%);\">filter: contrast(200%);</option><option value=\"filter: drop-shadow(16px 16px 20px blue);\">filter: drop-shadow(16px 16px 20px blue);</option><option value=\"filter: grayscale(50%);\">filter: grayscale(50%);</option><option value=\"filter: hue-rotate(90deg);\">filter: hue-rotate(90deg);</option><option value=\"filter: invert(75%);\">filter: invert(75%);</option><option value=\"filter: opacity(25%);\">filter: opacity(25%);</option><option value=\"filter: saturate(30%);\">filter: saturate(30%);</option><option value=\"filter: sepia(60%);\">filter: sepia(60%);</option><option value=\"filter: contrast(175%) brightness(33%);\">filter: contrast(175%) brightness(33%);</option><option value=\"filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);\">filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);</option></select><br><br><img onload=\"if (ingifint == 0) { ingifint=' + eval(duration * 10) + '; setTimeout(changelook, eval(800 + ingifint)); }\" title=\"filter: none;\" src=\"' + ingif + '\" id=imgag></img><br>';
document.getElementById('aside').innerHTML='<?php echo $image; ?> Animated GIF ' + ingif.split('#')[0].split('?')[0] + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
//ingifint=eval(duration * 10);
//setTimeout(changelook, eval(duration * 10));
document.getElementById('aside').scrollIntoView();
} else {
document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF ' + ingif.split('#')[0].split('?')[0] + ' duration is ' + eval(duration / 100) + ' seconds)' + damore;
}
}
}
document.body.style.cursor='pointer';
return duration / 100; // if 0.1 is not an animated GIF
}

And so, especially because GIF images cannot be useful for exif information, it helps us isolate our “proof of concept” feel to today’s changed read_exif_off_image_rotate.php PHP image exif reporter web application which we can supply an argument to such as the Katoomba Street Art Walk inspired one also shown below …


Previous relevant Animated GIF Duration Calculation Primer Tutorial is shown below.

Animated GIF Duration Calculation Primer Tutorial

Animated GIF Duration Calculation Primer Tutorial

We’ve got a new (mini-?)project developing. No, it doesn’t hurt in the “you know what”! But thanks for your concern?!

It’s a project that reminds us about an adage regarding projects, that might seem pretty obvious, but is worth mentioning …

Many projects being 90% perspiration, 10% inspiration, there might be the “not sure we can do” items that should be tackled first.

That truism is all well and good, but not always possible, of course, when you have to set up the difficult environment ahead of testing this unknown. Not so, with the “unknown” of our new project …

We want to know whether we can detect an animated GIF media file playing duration, ideally in client side Javascript, and if not possible there, we would settle for a server side PHP solution.

Happily (via our duration of animated GIF using Javascript Google search), yet again, the online wooooorrrrlllldd has come to our rescue via this excellent webpage‘s Javascript ideas, so many thanks!

We slotted its thinking (and Javascript (via PHP) …


function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1) {
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF); duration += delay < 2 ? 10 : delay; } } //alert('' + eval(duration / 100)); if (eval(duration / 100) > 0.11) { if (document.getElementById('aside')) { document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF duration is ' + eval(duration / 100) + ' seconds)'; } } document.body.style.cursor='pointer'; return duration / 100; // if 0.1 is not an animated GIF }

... logic), you might say in a "kludgy" way (but, for us, serving a "proof of concept" purpose), that allows us to proceed on other aims of our project that will become apparent into the near future. No, we are not totally "out of the woods" yet regarding "unknowns" but today's changed read_exif_off_image_rotate.php PHP image exif reporter web application) into the "onblur" logic of an image URL textbox HTML element, that web application talked about when we presented Gimp Guillotine Image File Browse Media Tutorial. You might try it yourself, but not sure "animated GIF and exif" mix, if you get my meaning, but if your image is an animated GIF you should be informed of its duration, in seconds, up the top of the webpage (given permissions and all, that is)?

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


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


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


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

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

Animated GIF Duration Calculation Filter Browsing Tutorial

Animated GIF CSS Filter Browsing Tutorial

Animated GIF Duration Calculation Filter Browsing Tutorial

Can a “proof of concept” arrangement last three blog postings? If there’s more you want to prove, ahead of committing to the final product that might hone in on the specificity of the idea, and another iframe hosted web application joins in on “proof of concept” goings on and will be useful into the future, we’d say it’s possible, yes. But we would say that, wouldn’t we?!

In our defence, it is easier to prove all solutions to all the contentious issues, and then hone in and reduce to make a specific new web application, rather than extending and still needing to prove as you go along, not knowing whether an issue will cause you insurmountable issues in the future.

But they would say that, wouldn’t they?!

And so, continuing on from the recent Animated GIF Duration Calculation Filter Tutorial we considered another mode that a user might use on top of …

  • entering an image (animated GIF) URL into a textbox … that being to …
  • browse for a local system (animated GIF) file (via File API)

… getting us to call on changes to our “via File API” specialist with a changed (with new data URI supporting Javascript) …


var ingif='', ingifstyle='filter: none;', ingifint=0, ingifchosen=false, isag=-1, isagname='';

function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1 || whatgifmaybe.indexOf('data:image/gif') == 0) {
ingif=whatgifmaybe;
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

function clooktv(intv) {
var finds=[];
document.getElementById('imgag').title=intv;
if (ingifchosen) {
finds=document.getElementById('simgag').outerHTML.split('>' + intv + '</option>');
if (eval('' + finds.length) > 1) {
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
}
document.body.innerHTML+='<style> #imgag { ' + intv + ' } </style>';
return intv;
}

function changelook() {
var finds=[];
if (ingifint > 0) {
setTimeout(changelook, ingifint);
if (ingifchosen) {
ingifchosen=false;
} else {
finds=document.getElementById('simgag').outerHTML.split('>' + ingifstyle + '</option>');
if (eval('' + finds.length) > 1) {
if (finds[1].indexOf('</select>') == 0) {
ingifstyle='filter: none;';
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
} else {
ingifstyle=finds[1].split('>')[1].split('<')[0];
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
document.getElementById('simgag').value=clooktv(ingifstyle);
}
}
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF);
duration += delay < 2 ? 10 : delay;
}
}
//alert('' + eval(duration / 100));
if (eval(duration / 100) > 0.11) {
//alert('' + duration);
var damore='', wpthere=false;
if (document.getElementById('aside')) {
if (document.getElementById('aside').outerHTML.toLowerCase().indexOf('<div') == 0) {
damore=' showing <select onchange=\"ingifchosen=true; ingifstyle=clooktv(this.value);\" id=simgag size=13><option value=\"filter: none;\" selected>filter: none;</option><option value=\"filter: blur(5px);\">filter: blur(5px);</option><option value=\"filter: brightness(0.4);\">filter: brightness(0.4);</option><option value=\"filter: contrast(200%);\">filter: contrast(200%);</option><option value=\"filter: drop-shadow(16px 16px 20px blue);\">filter: drop-shadow(16px 16px 20px blue);</option><option value=\"filter: grayscale(50%);\">filter: grayscale(50%);</option><option value=\"filter: hue-rotate(90deg);\">filter: hue-rotate(90deg);</option><option value=\"filter: invert(75%);\">filter: invert(75%);</option><option value=\"filter: opacity(25%);\">filter: opacity(25%);</option><option value=\"filter: saturate(30%);\">filter: saturate(30%);</option><option value=\"filter: sepia(60%);\">filter: sepia(60%);</option><option value=\"filter: contrast(175%) brightness(33%);\">filter: contrast(175%) brightness(33%);</option><option value=\"filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);\">filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);</option></select><br><br><img onload=\"if (ingifint == 0) { ingifint=' + eval(duration * 10) + '; setTimeout(changelook, eval(800 + ingifint)); }\" title=\"filter: none;\" src=\"' + ingif + '\" id=imgag></img><br>';
//ingifint=eval(duration * 10);
//setTimeout(changelook, eval(duration * 10));
if (window.parent) {
if (window.self !== window.parent && parent.document.getElementById('aside')) {
wpthere=true;
parent.document.getElementById('aside').innerHTML='Animated GIF ' + isagname + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
parent.document.getElementById('aside').scrollIntoView();
parent.document.getElementById('image').style.opacity='0.5';
parent.document.getElementById('image').style.width='5%';
parent.document.getElementById('isub').style.opacity='0.5';
} else {
document.getElementById('aside').style.display='block';
document.getElementById('aside').innerHTML='Animated GIF ' + isagname + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
}
} else {
document.getElementById('aside').style.display='block';
document.getElementById('aside').innerHTML='Animated GIF ' + isagname + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
}
if (!wpthere) { document.getElementById('aside').scrollIntoView(); }
} else {
document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF ' + isagname + ' duration is ' + eval(duration / 100) + ' seconds)' + damore;
}
}
//} else {
//alert('duration=' + duration);
}
document.body.style.cursor='pointer';
return duration / 100; // if 0.1 is not an animated GIF
}

client_browsing.htm helper web application you can try for yourself as a standalone arrangement or have it get called via today’s changed read_exif_off_image_rotate.php PHP image exif reporter web application.

Did you know?

A quirk with our new HTML button element within an HTML form had us, initially, before realizing …

  • onmousedown event event.stopPropagation() usage can be used to cancel a following onclick event on non-mobile … and …
  • ontouchdown (yay!!!) event event.stopPropagation() usage can be used to cancel a following onclick event on mobile

… as in …


<button title='Click or touch here, as required, for chance to browse for Animated GIF' ontouchdown='event.stopPropagation(); spagif();' onmousedown='event.stopPropagation(); spagif();'><sup>Animated</sup><sub>GIF</sub></button>

… and could overcome the adverse “onclick” based coding we had prior to the discovery. Thanks to javascript – Does using event.preventDefault() in “mousedown” prevent “click” or “mouseup” event in jquery? – Stack Overflow for the heads up about this.


Previous relevant Animated GIF Duration Calculation Filter Tutorial is shown below.

Animated GIF CSS Filter Tutorial

Animated GIF Duration Calculation Filter Tutorial

Can a “proof of concept” arrangement last two blog postings? If there’s more you want to prove, ahead of committing to the final product that might hone in on the specificity of the idea, we’d say it’s possible, yes. And so, continuing on from the recent Animated GIF Duration Calculation Primer Tutorial we tweak its PHP hosting “proof of concept” parent web application to try out our second point we’re out to prove …

We want to prove that CSS filter works for animated GIFs as well as it appears to work with other image types of elements.

Conservative worry, we grant you, but we did want to make sure this all worked, and happily, it was all fine …


var ingif='', ingifstyle='filter: none;', ingifint=0, ingifchosen=false;

function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1) {
ingif=whatgifmaybe;
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

function clooktv(intv) {
var finds=[];
document.getElementById('imgag').title=intv;
if (ingifchosen) {
finds=document.getElementById('simgag').outerHTML.split('>' + intv + '</option>');
if (eval('' + finds.length) > 1) {
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
}
document.body.innerHTML+='<style> #imgag { ' + intv + ' } </style>';
return intv;
}

function changelook() {
var finds=[];
if (ingifint > 0) {
setTimeout(changelook, ingifint);
if (ingifchosen) {
ingifchosen=false;
} else {
finds=document.getElementById('simgag').outerHTML.split('>' + ingifstyle + '</option>');
if (eval('' + finds.length) > 1) {
if (finds[1].indexOf('</select>') == 0) {
ingifstyle='filter: none;';
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
} else {
ingifstyle=finds[1].split('>')[1].split('<')[0];
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
document.getElementById('simgag').value=clooktv(ingifstyle);
}
}
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF);
duration += delay < 2 ? 10 : delay;
}
}
//alert('' + eval(duration / 100));
if (eval(duration / 100) > 0.11) {
var damore='';
if (document.getElementById('aside')) {
if (document.getElementById('aside').outerHTML.toLowerCase().indexOf('<div') == 0) {
damore=' showing <select onchange=\"ingifchosen=true; ingifstyle=clooktv(this.value);\" id=simgag size=13><option value=\"filter: none;\" selected>filter: none;</option><option value=\"filter: blur(5px);\">filter: blur(5px);</option><option value=\"filter: brightness(0.4);\">filter: brightness(0.4);</option><option value=\"filter: contrast(200%);\">filter: contrast(200%);</option><option value=\"filter: drop-shadow(16px 16px 20px blue);\">filter: drop-shadow(16px 16px 20px blue);</option><option value=\"filter: grayscale(50%);\">filter: grayscale(50%);</option><option value=\"filter: hue-rotate(90deg);\">filter: hue-rotate(90deg);</option><option value=\"filter: invert(75%);\">filter: invert(75%);</option><option value=\"filter: opacity(25%);\">filter: opacity(25%);</option><option value=\"filter: saturate(30%);\">filter: saturate(30%);</option><option value=\"filter: sepia(60%);\">filter: sepia(60%);</option><option value=\"filter: contrast(175%) brightness(33%);\">filter: contrast(175%) brightness(33%);</option><option value=\"filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);\">filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);</option></select><br><br><img onload=\"if (ingifint == 0) { ingifint=' + eval(duration * 10) + '; setTimeout(changelook, eval(800 + ingifint)); }\" title=\"filter: none;\" src=\"' + ingif + '\" id=imgag></img><br>';
document.getElementById('aside').innerHTML='<?php echo $image; ?> Animated GIF ' + ingif.split('#')[0].split('?')[0] + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
//ingifint=eval(duration * 10);
//setTimeout(changelook, eval(duration * 10));
document.getElementById('aside').scrollIntoView();
} else {
document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF ' + ingif.split('#')[0].split('?')[0] + ' duration is ' + eval(duration / 100) + ' seconds)' + damore;
}
}
}
document.body.style.cursor='pointer';
return duration / 100; // if 0.1 is not an animated GIF
}

And so, especially because GIF images cannot be useful for exif information, it helps us isolate our “proof of concept” feel to today’s changed read_exif_off_image_rotate.php PHP image exif reporter web application which we can supply an argument to such as the Katoomba Street Art Walk inspired one also shown below …


Previous relevant Animated GIF Duration Calculation Primer Tutorial is shown below.

Animated GIF Duration Calculation Primer Tutorial

Animated GIF Duration Calculation Primer Tutorial

We’ve got a new (mini-?)project developing. No, it doesn’t hurt in the “you know what”! But thanks for your concern?!

It’s a project that reminds us about an adage regarding projects, that might seem pretty obvious, but is worth mentioning …

Many projects being 90% perspiration, 10% inspiration, there might be the “not sure we can do” items that should be tackled first.

That truism is all well and good, but not always possible, of course, when you have to set up the difficult environment ahead of testing this unknown. Not so, with the “unknown” of our new project …

We want to know whether we can detect an animated GIF media file playing duration, ideally in client side Javascript, and if not possible there, we would settle for a server side PHP solution.

Happily (via our duration of animated GIF using Javascript Google search), yet again, the online wooooorrrrlllldd has come to our rescue via this excellent webpage‘s Javascript ideas, so many thanks!

We slotted its thinking (and Javascript (via PHP) …


function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1) {
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF); duration += delay < 2 ? 10 : delay; } } //alert('' + eval(duration / 100)); if (eval(duration / 100) > 0.11) { if (document.getElementById('aside')) { document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF duration is ' + eval(duration / 100) + ' seconds)'; } } document.body.style.cursor='pointer'; return duration / 100; // if 0.1 is not an animated GIF }

... logic), you might say in a "kludgy" way (but, for us, serving a "proof of concept" purpose), that allows us to proceed on other aims of our project that will become apparent into the near future. No, we are not totally "out of the woods" yet regarding "unknowns" but today's changed read_exif_off_image_rotate.php PHP image exif reporter web application) into the "onblur" logic of an image URL textbox HTML element, that web application talked about when we presented Gimp Guillotine Image File Browse Media Tutorial. You might try it yourself, but not sure "animated GIF and exif" mix, if you get my meaning, but if your image is an animated GIF you should be informed of its duration, in seconds, up the top of the webpage (given permissions and all, that is)?

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


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


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

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

PicPick Windows Audio and Screenshot Presentations Primer Tutorial

PicPick Windows Audio and Screenshot Presentations Primer Tutorial

PicPick Windows Audio and Screenshot Presentations Primer Tutorial

Thanks to the heads up from the APC magazine, in a recent issue, we were really interested to download and try a Windows desktop application called PicPick which can help with Screen Capture Presentations Without or With Audio. It was that “or With Audio” of huge interest to us, and yes, our …

  • downloading and install … then …
  • simple GIF presentation … then …
  • simple MP4 video presentation (with audio) …

… was all great! The only gripe here being the huge disk size of the (5 seconds worth of recording equating to 25mB) GIF, totally overridden by the excitement of the “audio overlay in MP4 video” (though we’d much prefer Stephen Fry to “yours truly”?!)

Another issue that may surprise is that the Windows PrtScn button (screenshooting functionality) is fed into PicPick (workflows), if you have PicPick installed. It took us about a minute to get used to that, but we thought we should mention that, as it is definitely worthwhile you experiment with the myriad PicPick “presentation helpers” in PicPick’s main menu that you can see in today’s animated GIF presentation of our first look at PicPick.

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

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

Animated GIF Duration Calculation Filter Tutorial

Animated GIF CSS Filter Tutorial

Animated GIF Duration Calculation Filter Tutorial

Can a “proof of concept” arrangement last two blog postings? If there’s more you want to prove, ahead of committing to the final product that might hone in on the specificity of the idea, we’d say it’s possible, yes. And so, continuing on from the recent Animated GIF Duration Calculation Primer Tutorial we tweak its PHP hosting “proof of concept” parent web application to try out our second point we’re out to prove …

We want to prove that CSS filter works for animated GIFs as well as it appears to work with other image types of elements.

Conservative worry, we grant you, but we did want to make sure this all worked, and happily, it was all fine …


var ingif='', ingifstyle='filter: none;', ingifint=0, ingifchosen=false;

function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1) {
ingif=whatgifmaybe;
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

function clooktv(intv) {
var finds=[];
document.getElementById('imgag').title=intv;
if (ingifchosen) {
finds=document.getElementById('simgag').outerHTML.split('>' + intv + '</option>');
if (eval('' + finds.length) > 1) {
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
}
document.body.innerHTML+='<style> #imgag { ' + intv + ' } </style>';
return intv;
}

function changelook() {
var finds=[];
if (ingifint > 0) {
setTimeout(changelook, ingifint);
if (ingifchosen) {
ingifchosen=false;
} else {
finds=document.getElementById('simgag').outerHTML.split('>' + ingifstyle + '</option>');
if (eval('' + finds.length) > 1) {
if (finds[1].indexOf('</select>') == 0) {
ingifstyle='filter: none;';
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
} else {
ingifstyle=finds[1].split('>')[1].split('<')[0];
document.getElementById('simgag').innerHTML=document.getElementById('simgag').innerHTML.replace(' selected',' data-selected').replace('>' + ingifstyle + '</option>', ' selected>' + ingifstyle + '</option>');
}
document.getElementById('simgag').value=clooktv(ingifstyle);
}
}
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF);
duration += delay < 2 ? 10 : delay;
}
}
//alert('' + eval(duration / 100));
if (eval(duration / 100) > 0.11) {
var damore='';
if (document.getElementById('aside')) {
if (document.getElementById('aside').outerHTML.toLowerCase().indexOf('<div') == 0) {
damore=' showing <select onchange=\"ingifchosen=true; ingifstyle=clooktv(this.value);\" id=simgag size=13><option value=\"filter: none;\" selected>filter: none;</option><option value=\"filter: blur(5px);\">filter: blur(5px);</option><option value=\"filter: brightness(0.4);\">filter: brightness(0.4);</option><option value=\"filter: contrast(200%);\">filter: contrast(200%);</option><option value=\"filter: drop-shadow(16px 16px 20px blue);\">filter: drop-shadow(16px 16px 20px blue);</option><option value=\"filter: grayscale(50%);\">filter: grayscale(50%);</option><option value=\"filter: hue-rotate(90deg);\">filter: hue-rotate(90deg);</option><option value=\"filter: invert(75%);\">filter: invert(75%);</option><option value=\"filter: opacity(25%);\">filter: opacity(25%);</option><option value=\"filter: saturate(30%);\">filter: saturate(30%);</option><option value=\"filter: sepia(60%);\">filter: sepia(60%);</option><option value=\"filter: contrast(175%) brightness(33%);\">filter: contrast(175%) brightness(33%);</option><option value=\"filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);\">filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);</option></select><br><br><img onload=\"if (ingifint == 0) { ingifint=' + eval(duration * 10) + '; setTimeout(changelook, eval(800 + ingifint)); }\" title=\"filter: none;\" src=\"' + ingif + '\" id=imgag></img><br>';
document.getElementById('aside').innerHTML='<?php echo $image; ?> Animated GIF ' + ingif.split('#')[0].split('?')[0] + ' duration is ' + eval(duration / 100) + ' seconds ' + damore;
//ingifint=eval(duration * 10);
//setTimeout(changelook, eval(duration * 10));
document.getElementById('aside').scrollIntoView();
} else {
document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF ' + ingif.split('#')[0].split('?')[0] + ' duration is ' + eval(duration / 100) + ' seconds)' + damore;
}
}
}
document.body.style.cursor='pointer';
return duration / 100; // if 0.1 is not an animated GIF
}

And so, especially because GIF images cannot be useful for exif information, it helps us isolate our “proof of concept” feel to today’s changed read_exif_off_image_rotate.php PHP image exif reporter web application which we can supply an argument to such as the Katoomba Street Art Walk inspired one also shown below …


Previous relevant Animated GIF Duration Calculation Primer Tutorial is shown below.

Animated GIF Duration Calculation Primer Tutorial

Animated GIF Duration Calculation Primer Tutorial

We’ve got a new (mini-?)project developing. No, it doesn’t hurt in the “you know what”! But thanks for your concern?!

It’s a project that reminds us about an adage regarding projects, that might seem pretty obvious, but is worth mentioning …

Many projects being 90% perspiration, 10% inspiration, there might be the “not sure we can do” items that should be tackled first.

That truism is all well and good, but not always possible, of course, when you have to set up the difficult environment ahead of testing this unknown. Not so, with the “unknown” of our new project …

We want to know whether we can detect an animated GIF media file playing duration, ideally in client side Javascript, and if not possible there, we would settle for a server side PHP solution.

Happily (via our duration of animated GIF using Javascript Google search), yet again, the online wooooorrrrlllldd has come to our rescue via this excellent webpage‘s Javascript ideas, so many thanks!

We slotted its thinking (and Javascript (via PHP) …


function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1) {
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF); duration += delay < 2 ? 10 : delay; } } //alert('' + eval(duration / 100)); if (eval(duration / 100) > 0.11) { if (document.getElementById('aside')) { document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF duration is ' + eval(duration / 100) + ' seconds)'; } } document.body.style.cursor='pointer'; return duration / 100; // if 0.1 is not an animated GIF }

... logic), you might say in a "kludgy" way (but, for us, serving a "proof of concept" purpose), that allows us to proceed on other aims of our project that will become apparent into the near future. No, we are not totally "out of the woods" yet regarding "unknowns" but today's changed read_exif_off_image_rotate.php PHP image exif reporter web application) into the "onblur" logic of an image URL textbox HTML element, that web application talked about when we presented Gimp Guillotine Image File Browse Media Tutorial. You might try it yourself, but not sure "animated GIF and exif" mix, if you get my meaning, but if your image is an animated GIF you should be informed of its duration, in seconds, up the top of the webpage (given permissions and all, that is)?

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


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

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

Saving Power on iPhone Out and About Tutorial

Saving Power on iPhone Out and About Tutorial

Saving Power on iPhone Out and About Tutorial

The other day, out and about using an iPhone, we started out with the battery at 100% but within 5 minutes it had gone to about 85%, if my memory serves me correctly. Ideally, we wanted the iPhone to last another 4 hours, so the projections for that were not good.

Am sure am no Robinson Crusoe getting this scenario happen?! So, what are some steps mere mortals can apply, given you cannot get to a power source (and these days, there are those portable power sources available) to try to prolong the life of the battery on the iPhone in situ? Today’s animated GIF presentation shows some of what we suggest below, and it goes without saying your own research can be great here, and the wooooorrrrrlllldddd knowledge on this matter is huuuuuuuuggggggeee.

First off, we find the most natural approach is to double touch the iPhone’s Home Button to see a horizontally cascading view of applications open, that you can swipe up to close as you think necessary, is a first good starting point.

Next might be, even so, take a more scientific approach and go to …


Settings -> Battery

… and see what applications are using power, and plan further as to what needs changing, perhaps, within that app’s Settings, to help. Also, within the “Settings -> Battery” realm, there is a “Low Power Mode” switch you could turn on, even before you are prompted for it, to …

Low Power Mode temporarily reduces background activity like downloads and mail fetch until you can fully charge your iPhone.

For us though, what seemed to be the most effective idea, as we talked about with Location Services iPad Battery Loss Issue Tutorial, was to turn off all “Location Services” functionality immediately via …


Settings -> Privacy -> Location Services ... turn off switch

… which, in practice, being as we cannot commit this to memory, we got to the steps above via “Settings -> Search … typed in Location Services”.

Also notorious for eating up battery, can be any Weather app you have set to be always monitoring. Perhaps a look, in Settings, at an app itself, inside its subsettings might help here? We turned off a Weather app’s ability to access “Mobile Data” on our iPhone, for example.

Also an option is to dim the display (or … gasp … power it off) via, for us, a bottom left diagonal swipe towards top right, causing the menu with display brightness be adjustable, in order for you to turn it down lower, as another idea (not shown on today’s presentation animated GIF). (And isn’t the torch marvellous to find and bring your pooch back in at 2am in the morning?!)

The upshot? Taking these steps well and truly got us through the 4 hours needed, with lots of battery power yet to be used up. But if it hadn’t worked, what then? There are thoughts that some malware these days can hang around your iPhone goings on, maybe, but that some of these might be neutralized via powering your iPhone off, and then (as required) back on (and if that helped, perhaps you should be looking into Malware Removal apps).

They do say, too, when first getting an iPhone, you can “train” your battery to be more efficient.

Happy “out and about”ness to you!


Previous relevant Saving Power on iPhone Out and About Tutorial is shown below.

Location Services iPad Battery Loss Issue Tutorial

Location Services iPad Battery Loss Issue Tutorial

Do you own an iPad that loses battery power too fast?

We were, and the kind and honest people at iExperts set us right that we had the “Location Services” setting set to on.

As related at this useful link here are good steps to remedy this issue …

  1. First, go to the iPad’s Settings by touching the Setting icon. It looks like gears in motion.
  2. Next, scroll down the left-side menu and tap “Privacy.”
  3. If you want to completely turn off Location Services, tap the button at the top of the screen next to Location Services, as you can see with today’s tutorial picture.
  4. If you just want to turn it off in a single app, scroll down the list until you see the app’s name. You can choose to “Never” allow an app access, to “Always” allow an app access, or to only allow access “While Using the App.”
  5. Share My Location will show your location in text messages sent through iMessage and through the Find My Friends app. If you are only turning off location services for individual apps, you may want to turn this setting off as well.

… and, if you are like us, what you will see is that your iPad battery fully charged will last hours longer than it used to, presumably because it will have periods now where nothing is asked of it, whereas having “Location Services” set to “on” requires some power virtually the whole time.

Well, this fix, using just its first 3 steps, above, might be thought of as a bit crude. What if there is good use made of “Location Services”? Well, a less crude method is outlined at this link … thanks. We used its methodology to arrive at the Weather app component (used by Notification Services) and set it to be “Never” rather than “Always”, the “Always” apps being the ones that badly affect the battery life of the iPad. So we show this less crude approach with the images below.



Trap for young … cough, cough … players, we presume?!

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

Animated GIF Duration Calculation Primer Tutorial

Animated GIF Duration Calculation Primer Tutorial

Animated GIF Duration Calculation Primer Tutorial

We’ve got a new (mini-?)project developing. No, it doesn’t hurt in the “you know what”! But thanks for your concern?!

It’s a project that reminds us about an adage regarding projects, that might seem pretty obvious, but is worth mentioning …

Many projects being 90% perspiration, 10% inspiration, there might be the “not sure we can do” items that should be tackled first.

That truism is all well and good, but not always possible, of course, when you have to set up the difficult environment ahead of testing this unknown. Not so, with the “unknown” of our new project …

We want to know whether we can detect an animated GIF media file playing duration, ideally in client side Javascript, and if not possible there, we would settle for a server side PHP solution.

Happily (via our duration of animated GIF using Javascript Google search), yet again, the online wooooorrrrlllldd has come to our rescue via this excellent webpage‘s Javascript ideas, so many thanks!

We slotted its thinking (and Javascript (via PHP) …


function prefetch(whatgifmaybe) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
if ((whatgifmaybe.toLowerCase().trim().split('#')[0] + '?').indexOf('.gif?') != -1) {
document.body.style.cursor='progress';
fetch(whatgifmaybe)
.then(res => res.arrayBuffer())
.then(ab => isGifAnimated(new Uint8Array(ab)))
.then(console.log);
}
}

/** @param {Uint8Array} uint8 */
function isGifAnimated (uint8) { // thanks to https://stackoverflow.com/questions/69564118/how-to-get-duration-of-gif-image-in-javascript#:~:text=Mainly%20use%20parseGIF()%20%2C%20then,duration%20of%20a%20GIF%20image.
let duration = 0;
for (let i = 0, len = uint8.length; i < len; i++) {
if (uint8[i] == 0x21
&& uint8[i + 1] == 0xF9
&& uint8[i + 2] == 0x04
&& uint8[i + 7] == 0x00)
{
const delay = (uint8[i + 5] << 8) | (uint8[i + 4] & 0xFF); duration += delay < 2 ? 10 : delay; } } //alert('' + eval(duration / 100)); if (eval(duration / 100) > 0.11) { if (document.getElementById('aside')) { document.getElementById('aside').innerHTML=' (<?php echo $image; ?> animated GIF duration is ' + eval(duration / 100) + ' seconds)'; } } document.body.style.cursor='pointer'; return duration / 100; // if 0.1 is not an animated GIF }

... logic), you might say in a "kludgy" way (but, for us, serving a "proof of concept" purpose), that allows us to proceed on other aims of our project that will become apparent into the near future. No, we are not totally "out of the woods" yet regarding "unknowns" but today's changed read_exif_off_image_rotate.php PHP image exif reporter web application) into the "onblur" logic of an image URL textbox HTML element, that web application talked about when we presented Gimp Guillotine Image File Browse Media Tutorial. You might try it yourself, but not sure "animated GIF and exif" mix, if you get my meaning, but if your image is an animated GIF you should be informed of its duration, in seconds, up the top of the webpage (given permissions and all, that is)?

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

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

WordPress List Style User Interaction Form Tutorial

WordPress List Style User Interaction Form Tutorial

WordPress List Style User Interaction Form Tutorial

It can be hard going on a mini-project where you need to set up data structures for success until you get to today’s progress, on top of yesterday’s WordPress List Style User Emoji Image List Tutorial, where we can finally offer a decent user interface to these data structures. So, yayyyyyyyy!

In Change User Controllable Font, Border, Background Settings‘s HTML form based approach, the user can see “all before them” the data items that make up the full scope of what the functionality offers, in today’s case that being user controllable …


ul.noclass li

… CSS styling options in the WordPress blog you are reading. The ++ we ask you to add to the “listimage” textbox here allows a window.localStorage means by which the web browser you are using will assist you keep that look for the new time you access this WordPress blog with that web browser and device combination. And it may well be, you want to (perhaps be amused) with a particular look (which can bring a smile to your face) but never want to go through the ordeal again … well … consider appending ++ here.

We’ve kept the original approach too, and it works as before, should a user prefer, and they want a simple approach, and we needed to change our WordPress TwentyTen theme’s header.php as below …

<?php echo ”

function eqworrydecodeURIComponent(instw) {
var eqis='=', ampis='';
var outstw=decodeURIComponent(instw);
if (outstw.trim() != '') {
if (outstw.indexOf(eqis) != -1) {
eqis='=';
ampis='&';
} else if (outstw.indexOf(encodeURIComponent(eqis)) != -1) {
if (1 == 1) {
ampis='&';
outstw=decodeURIComponent(outstw);
} else {
eqis=encodeURIComponent(eqis);
ampis=encodeURIComponent('&');
}
}
if (ampis != '') {
document.getElementById('listwimage').value=(outstw.split('listwimage=')[1] ? ('' + decodeURIComponent(outstw.split('listwimage=')[1].split('&')[0])) : "");
document.getElementById('listhimage').value=(outstw.split('listhimage=')[1] ? ('' + decodeURIComponent(outstw.split('listw\himage=')[1].split('&')[0])) : "");
document.getElementById('midpseudoclass').value=(outstw.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(outstw.split('midpseudoclass=')[1].split('&')[0])) : "");
return (outstw.split('listimage=')[1] ? ('' + decodeURIComponent(outstw.split('listimage=')[1].split('&')[0])) : "");
}
}
return outstw;
}


function cookieAVal(cName) {
if (cName == 'forcedemoji') {
if (window.localStorage) {
if (decodeURIComponent(('' + localStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
return eqworrydecodeURIComponent(localStorage.getItem('listimage'));
}
if (decodeURIComponent(('' + sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
return eqworrydecodeURIComponent(sessionStorage.getItem('listimage'));
}
}
if (cName == 'forcedemoji' && document.getElementById(cName)) {
return document.getElementById(cName).value;
}
return '';
}

var expireDate = new Date();
expireDate.setDate(expireDate.getDate()-1);
if (window.localStorage && cName == 'forced_emoji') {
if (decodeURIComponent(('' + localStorage.getItem('forced_emoji')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
if (decodeURIComponent(('' + localStorage.getItem('forced_emoji')).replace(/^undefined/g,'').replace(/^null/g,'')).indexOf('`') != -1) {
document.cookie = cName + "=; expires=" + expireDate.toGMTString();
return decodeURIComponent(localStorage.getItem('forced_emoji'));
} else {
document.cookie = cName + "=; expires=" + expireDate.toGMTString();
return decodeURIComponent(localStorage.getItem('forced_emoji'));
}
}
}
if (document.cookie != '') {
var tCookie=document.cookie.split("; ");


for (var j=0; j<tCookie.length; j++) {
if (cName == tCookie[j].split("=")[0]) {
return decodeURIComponent(tCookie[j].split("=")[1]);
}
}
}
if (cName == 'forced_emoji' && document.getElementById(cName)) {
return document.getElementById(cName).value;
}

return '';
}

function deleteACookie(goodname) {
if (window.localStorage && goodname == 'forced_emoji') {
if (('' + localStorage.getItem('forced_emoji')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
localStorage.removeItem('forced_emoji');
}
}

var expireDate = new Date();
expireDate.setDate(expireDate.getDate()-1);
//if (("" + cookieAVal(goodname)).length != 0) {
document.cookie = goodname + "=; expires=" + expireDate.toGMTString();
//}
}

function newlsvsco(tvis, tvo) {
var origtvis=tvis;
if (tvis != '' && tvis.replace(/\-/g,'') == '') {
if (tvis.indexOf('--') != -1) {
if (decodeURIComponent(('' + window.localStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.localStorage.removeItem('listimage');
}
if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.sessionStorage.removeItem('listimage');
}
if (decodeURIComponent(('' + window.localStorage.getItem('forced_emoji')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.localStorage.removeItem('forced_emoji');
}
} else {
if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.sessionStorage.removeItem('listimage');
}
}
document.getElementById('forced_emoji').value='';
document.getElementById('forcedemoji').value='';
return '';
}

if (tvo.id == 'forcedemoji') { // new window.localStorage way
if (tvis.indexOf('`') != -1 || (tvis.trim() == '' && tvis != '')) {
document.getElementById('forced_emoji').value=tvis;
tvo.value='';
document.getElementById('tdnew').style.display='none';
newlsvsco(tvis.replace(String.fromCharCode(32), String.fromCharCode(96)).replace(String.fromCharCode(44), String.fromCharCode(96)), document.getElementById('forced_emoji'));
return '';
}
if (tvis.indexOf('+') != -1) {
if (tvis.slice(-2) == '++') {
tvo.value=tvis.substring(0, eval(-2 + tvis.length)) + ' ';
tvis=tvis.substring(0, eval(-2 + tvis.length)) + ' ';
}
if (tvis.slice(-1) == '+') {
tvo.value=tvis.substring(0, eval(-1 + tvis.length)) + ' ';
tvis=tvis.substring(0, eval(-1 + tvis.length)) + ' ';
}
}
} else {

if (tvis.indexOf('`') != -1 && tvis.indexOf(',') != -1) {
document.getElementById('forcedemoji').value=tvis.replace(String.fromCharCode(96), String.fromCharCode(44)).replace(String.fromCharCode(96), String.fromCharCode(32), document.getElementById('forcedemoji'));
tvo.value='';
document.getElementById('tdoriginal').style.display='none';
newlsvsco(document.getElementById('forcedemoji').value, document.getElementById('forced_emoji'));
return '';
}

if (eval('' + tvis.length) > 0) {
tvis=tvis.replace(/\#/g, '').replace(/\&/g,'').replace(/\x/g, '').replace(/\X/g, '').replace(/\u/g, '').replace(/\U/g, '').replace(/\//g, '').replace(/\|/g, '`').replace(/\;/g, '`').replace(/\,/g, '`').replace('```', '`').replace('``', '`').replace('```', '`').replace(/\`$/g, '').replace(/\`$/g, '');
if (window.localStorage) {
if (document.getElementById('forced_emoji')) {
document.getElementById('forced_emoji').name=document.getElementById('forced_emoji').id;
}
if (tvis.trim() != '') {
window.localStorage.setItem('forced_emoji', encodeURIComponent(tvis.trim()));
if (document.getElementById('forced_emoji') && (tvis != tvis.trim() || origtvis != tvis)) {
document.getElementById('forced_emoji').value=tvis.trim();
}
} else {
window.localStorage.setItem('forced_emoji', encodeURIComponent(tvis));
}
} else {
var xexpireDate = new Date();
xexpireDate.setMonth(xexpireDate.getMonth()+6);
if (tvis.trim() != '') {
document.cookie = 'forced_emoji=' + encodeURIComponent(tvis.trim()) + '; expires=' + xexpireDate.toGMTString();
if (document.getElementById('forced_emoji') && (tvis != tvis.trim() || origtvis != tvis)) {
document.getElementById('forced_emoji').value=tvis.trim();
}
} else {
document.cookie = 'forced_emoji=' + encodeURIComponent(tvis) + '; expires=' + xexpireDate.toGMTString();
}
}
}
if (1 == 2) { change_ff(this, this.value); }
}
}

“; ?>

… to also help make this user interaction improvement happen.


Previous relevant WordPress List Style User Emoji Image List Tutorial is shown below.

WordPress List Style User Emoji Image List Tutorial

WordPress List Style User Emoji Image List Tutorial

When in yesterday’s WordPress List Style User CSS Middle Pseudo Class Tutorial we said …

(though, come to think of it, there may be another layer of thought before that … we’ll see)

Well, we saw, and did want to allow for four more feature extensions …

  1. allow for a comma separated list (that can correspond, optionally, with a comma separated pseudo-class list) … of …
  2. a mix of “list style” images and/or emojis … all …
  3. rememberable and recallable on a web browser tab via window.sessionStorage … or …
  4. rememberable and recallable on a web browser at any time in any tab via window.localStorage

… as required.

Here are some examples of use (where adding one + to end of URL uses window.sessionStorage and two ++ to end of URL uses window.localStorage) …

… using …

<?php echo ”

function locsess(inldef) {
var outldef=inldef;
if (inldef == '') { // listimage
if (decodeURIComponent(('' + window.localStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
outldef=decodeURIComponent(window.localStorage.getItem('listimage')).replace(/\%2C/g,',');
if (document.URL.indexOf('listimage=') == -1) {
if (document.URL.indexOf('?') == -1) {
location.href=document.URL.split('#')[0] + '?' + outldef.substring(1);
return inldef;
} else {
location.href=document.URL.split('#')[0] + '' + outldef;
return inldef;
}
}
} else if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
outldef=decodeURIComponent(window.sessionStorage.getItem('listimage')).replace(/\%2C/g,',');;
if (document.URL.indexOf('listimage=') == -1) {
if (document.URL.indexOf('?') == -1) {
location.href=document.URL.split('#')[0] + '?' + outldef.substring(1);
return inldef;
} else {
location.href=document.URL.split('#')[0] + '' + outldef;
return inldef;
}
}
}
}
return outldef;
}

function list_style_image_check() {
var hbit=(" height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : " 25")) + "px; ").replace(' height: 25px; ','');
var wbit=(" width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : ' 35') + "px; ").replace(' width: 35px; ','');
var mlit=(" margin-left: " + (location.search.split('listwimage=')[1] ? ('-' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : ' -35') + "px; ").replace(' margin-left: -35px; ','');
var listimage='', lsbit='&listimage=', mlbit=('' + wbit + hbit.replace('height','font-size') + hbit + mlit).replace(' width:',' display:inline-block; width:');


if ((document.URL.split('#')[0] + '&').indexOf('listimage=--&') != -1 || (document.URL.split('#')[0] + '&').indexOf('listimage=' + encodeURIComponent('--') + '&') != -1) {
if (decodeURIComponent(('' + window.localStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.localStorage.removeItem('listimage');
}
if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.sessionStorage.removeItem('listimage');
}
} else if ((document.URL.split('#')[0] + '&').indexOf('listimage=-&') != -1 || (document.URL.split('#')[0] + '&').indexOf('listimage=' + encodeURIComponent('-') + '&') != -1) {
if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.sessionStorage.removeItem('listimage');
}
}
listimage=location.search.split('listimage=')[1] ? decodeURIComponent(location.search.split('listimage=')[1].split('&')[0]).replace(/\+/g,' ') : locsess("");
if (listimage.replace(/\-/g,'') != '' && (listimage + '@#$').indexOf(' @#$') != -1) {
if (decodeURIComponent(('' + window.localStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.localStorage.removeItem('listimage');
}
lsbit+=encodeURIComponent(listimage.trim());
if ((location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") != ":") {
lsbit+='&midpseudoclass=' + encodeURIComponent((location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":"));
}
if ((location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : '') != '') {
lsbit+='&listwimage=' + encodeURIComponent((location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : ''));
}
if ((location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : '') != '') {
lsbit+='&listhimage=' + encodeURIComponent((location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : ''));
}
window.localStorage.setItem('listimage', lsbit);
} else if (listimage.replace(/\-/g,'') != '' && (listimage + '@#$').indexOf(' @#$') != -1) {
if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.sessionStorage.removeItem('listimage');
}
lsbit+=encodeURIComponent(listimage.trim());
if ((location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") != ":") {
lsbit+='&midpseudoclass=' + encodeURIComponent((location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":"));
}
if ((location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : '') != '') {
lsbit+='&listwimage=' + encodeURIComponent((location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : ''));
}
if ((location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : '') != '') {
lsbit+='&listhimage=' + encodeURIComponent((location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : ''));
}
window.sessionStorage.setItem('listimage', lsbit);
}
if (listimage.replace(/\-/g,'') != '') {
var contbit=" content:''; ";
var dbistuff='';
var pclass=(location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : "");
var alistimage=listimage.split(',');
var blistimage=listimage.split('.');
var iblistimage=0, jlistimage=0;
var apclass=pclass.split(',');


if (eval('' + alistimage.length) > 1) {
if (apclass[0].trim() == '') {
if (alistimage[0].toLowerCase().trim().replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').replace(/a/g,'').replace(/b/g,'').replace(/c/g,'').replace(/d/g,'').replace(/e/g,'').replace(/f/g,'') != '') {
dbistuff+="<style> ul.noclass li:" + apclass[0] + ":before { content: ''; display: inline-block; height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : "25")) + "px; width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; background-image: url('" + alistimage[jlistimage] + "'); background-size: contain; background-repeat: no-repeat; margin-left: -" + (location.search.split('listwimage=')[1] ? (':' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; } </style>";
} else {
blistimage=alistimage[0].split('.');
// content:'\000031\0020e3';
contbit=" content:''; ";
contbit=" content:'\\" + ('000000' + blistimage[0]).slice(-6) + "'; ";
for (iblistimage=1; iblistimage<blistimage.length; iblistimage++) {
contbit=contbit.replace("';", "\\" + ('000000' + blistimage[iblistimage]).slice(-6) + "';");
}
dbistuff+="<style> ul.noclass li:" + apclass[0] + ":before { " + contbit + mlbit + " } </style>";
}
apclass[0]='nth-child(1)';
}
for (jlistimage=0; jlistimage<alistimage.length; jlistimage++) {
if (apclass.length <= eval(0 + jlistimage)) {
apclass.push(apclass[0].replace('(1)', '(' + eval(1 + jlistimage) + ')'));
}
if (alistimage[jlistimage].toLowerCase().trim().replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').replace(/a/g,'').replace(/b/g,'').replace(/c/g,'').replace(/d/g,'').replace(/e/g,'').replace(/f/g,'') != '') {
dbistuff+="<style> ul.noclass li:" + apclass[jlistimage] + ":before { content: ''; display: inline-block; height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : "25")) + "px; width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; background-image: url('" + alistimage[jlistimage] + "'); background-size: contain; background-repeat: no-repeat; margin-left: -" + (location.search.split('listwimage=')[1] ? (':' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; } </style>";
} else {
blistimage=alistimage[jlistimage].split('.');
// content:'\000031\0020e3';
contbit=" content:''; ";
contbit=" content:'\\" + ('000000' + blistimage[0]).slice(-6) + "'; ";
for (iblistimage=1; iblistimage<blistimage.length; iblistimage++) {
contbit=contbit.replace("';", "\\" + ('000000' + blistimage[iblistimage]).slice(-6) + "';");
}
dbistuff+="<style> ul.noclass li:" + apclass[jlistimage] + ":before { " + contbit + mlbit + " } </style>";
}
}
document.body.innerHTML+=dbistuff;

} else if (listimage.toLowerCase().trim().replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').replace(/a/g,'').replace(/b/g,'').replace(/c/g,'').replace(/d/g,'').replace(/e/g,'').replace(/f/g,'') != '') {
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { content: ''; display: inline-block; height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : "25")) + "px; width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -" + (location.search.split('listwimage=')[1] ? (':' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; } </style>";
} else {
// content:'\000031\0020e3';
contbit=" content:'\\" + ('000000' + blistimage[0]).slice(-6) + "'; ";
for (iblistimage=1; iblistimage<blistimage.length; iblistimage++) {
contbit=contbit.replace("';", "\\" + ('000000' + blistimage[iblistimage]).slice(-6) + "';");
}
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { " + contbit + " } </style>";
}
} else if ((location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") != ":") {
var stylestuff='', sparts=document.head.innerHTML.split('ul.noclass li::before {');
if (eval('' + sparts.length) > 1) {
for (var isparts=1; isparts<sparts.length; isparts++) {
stylestuff+=' ' + sparts[isparts].split('}')[0] + ' ';
}
}
if (stylestuff != '') {
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { " + stylestuff + " } </style>";
}
}
}

“; ?>


Previous relevant WordPress List Style User CSS Middle Pseudo Class Tutorial is shown below.

WordPress List Style User CSS Middle Pseudo Class Tutorial

WordPress List Style User CSS Middle Pseudo Class Tutorial

Sorry, but before moving on from yesterday’s WordPress List Style Image Primer Tutorial “ul li” list style image work, we need to add another hard to remember GET argument arrangement, because between the ::


<style> ul li::before { content: ''; display: inline-block; height: 25px; width: 35px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -35px; } </style>

… colons via …

<?php echo ”

function list_style_image_check() {
var listimage=location.search.split('listimage=')[1] ? decodeURIComponent(location.search.split('listimage=')[1].split('&')[0]) : "";
if (listimage != '') {
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { content: ''; display: inline-block; height: 25px; width: 35px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -35px; } </style>";
}
}

“; ?>

… in the CSS styling, the user can now optionally insert, via “&midpseudoclass=[middle pseudo class eg. first-child]” or “?midpseudoclass=[middle pseudo class eg. first-child]” a CSS “ul li” styling additional consideration. For this URL “appendage” you might consider pseudo-class values such as …

And later, we make all this more accessible for user usage (though, come to think of it, there may be another layer of thought before that … we’ll see).

Stop Press

We decided to allow the image dimensions be arguments (probably just 5 minute ones) via …

  • &listwimage=[pixelValue]&listhimage=[pixelValue]
  • &listwimage=[pixelValue]# and listhimage is 5/7 of this

… via …

<?php echo ”

function list_style_image_check() {
var listimage=location.search.split('listimage=')[1] ? decodeURIComponent(location.search.split('listimage=')[1].split('&')[0]) : "";
if (listimage != '') {
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { content: ''; display: inline-block; height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : "25")) + "px; width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -" + (location.search.split('listwimage=')[1] ? (':' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; } </style>";
}
}

“; ?>

… so that you can have a “Fifth Fatter Baboon” or “Last Tall Penguin”.


Previous relevant WordPress List Style Image Primer Tutorial is shown below.

WordPress List Style Image Primer Tutorial

WordPress List Style Image Primer Tutorial

Think it might be part of “the human thaing” to “make associations” or “link things”. As such, our “link” to yesterday’s Cut to the Chase of Blog Posting Mobile Events Tutorial is WordPress blog TwentyTen them’s header.php “thinking”, but quite a different topic, in that today’s “first draft” and “terribly user unfriendly” work today revolves around CSS styling and aesthetics, rather than the event logic discussed yesterday.

In the past we’ve allowed the styling of …


ul li

… ie. “ul” element begets “li” element bullet point “looks” be user controllable … in terms of emoji usage. Well, today, we add onto that possibility, the possibility to use an image rather than an emoji, though you could hardly call our “first draft” of this in any way easily “user controllable” (but appending to a WordPress blog URL ?listimage=[someImageURL] …

<?php echo ”

function list_style_image_check() {
var listimage=location.search.split('listimage=')[1] ? decodeURIComponent(location.search.split('listimage=')[1].split('&')[0]) : "";
if (listimage != '') {
document.body.innerHTML+="<style> ul li::before { content: ''; display: inline-block; height: 25px; width: 35px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -35px; } </style>";
}
}

“; ?>

… is the “behind the scenes approach” called at the document.body onload event header.php is privy to). We thank this enormously useful website for great advice here, and in days to come we improve on that “user unfriendliness”.


Previous relevant Cut to the Chase of Blog Posting Mobile Events Tutorial is shown below.

Cut to the Chase of Blog Posting Mobile Events Tutorial

Cut to the Chase of Blog Posting Mobile Events Tutorial

On the way to you reading this blog posting there have been numerous intervention points for us, as overseeing programmers …

  • PHP server layer before any client side intervention …
  • PHP header.php interfaces from server side considerations into Javascript client side considerations ahead of document.body onload event …
  • PHP header.php interfaces into Javascript (with its DOM) client side considerations at document.body onload event …
  • PHP header.php interfaces into Javascript (with its DOM) client side considerations after document.body onload event

… and it is in that last layer we dynamically create the “Cut to the Chase” elements you see reading this blog posting. In this way, to change “after document.body onload event” client side aspects to “Cut to the Chase” is not hard, even to changing the type of event …

<?php echo ”

var oncm=' oncontextmenu=';
var oncmt=' or right click or two finger gesture ';
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
oncm=' ontouchmove=';
oncmt=' or drag over gesture ';
}

“; ?>

… some “Cut to the Chase” element Javascript logic points at.

And so, given yesterday’s “wet lettuce” mobile platform response to the “oncontextmenu” intervention yesterday, we’re changing yesterday’s …

<?php echo ”

tworp.innerHTML = tworp.innerHTML.replace("<li>", "<li title='Cut to The Chase ... ... double click " + oncmt + " for blog posting image involvement'" + oncm + "' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(rcrplater,1000); nothanks=false; ' ondblclick=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(dblrplater,1000); nothanks=false; ' onclick=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(rplater,1000); nothanks=false; ' class='" + eight[ieight] + "'>");
// ... and ...
xpspana[ximb].innerHTML+=' <div style="display:inline-block;border:3px solid rgba(255,165,0,0.4); background-color:rgba(255,255,0,0.3); " id=cc' + zspare + '><a target=_blank style="cursor:pointer;display:inline-block;text-decoration:none; font-size:12px;" ondblclick="dblrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" ' + oncm + '"rcrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" href=//www.rjmprogramming.com.au/slideshow.html?title=' + encodeURIComponent(xspare) + ' " title="Cut to the Chase ... double click ' + oncmt + ' for blog posting image involvement ... to (the gist of) ' + (xspare) + '" id=tcc' + zspare + '>&#9986;</a><a target=_blank style="background: rgba(0,255,0,0.3); background: -webkit-linear-gradient(left top, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: -o-linear-gradient(bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: -moz-linear-gradient(bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: linear-gradient(to bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); cursor:pointer;display:inline-block;text-decoration:none;transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1); font-size:12px;" ondblclick="dblrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" ' + oncm + '"rcrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" href=//www.rjmprogramming.com.au/slideshow.html?title=' + encodeURIComponent(xspare) + ' " title="Cut to the Chase ... double click ' + oncmt + ' for blog posting image involvement ... to (the gist of) ' + (xspare) + '" id=ttcc' + zspare + '>&#127939;&#127998;&#8205;&#9792;&#65039;&#127939;&#127996;&#8205;&#9794;&#65039;</a><iframe style=display:none; id=icc' + zspare + ' src=></iframe></div>';

“; ?>

… to improve on yesterday’s Cut to the Chase of Blog Posting New Arguments Tutorial‘s offerings up at this WordPress blog’s TwentyTen theme’s header.php PHP code.


Previous relevant Cut to the Chase of Blog Posting New Arguments Tutorial is shown below.

Cut to the Chase of Blog Posting New Arguments Tutorial

Cut to the Chase of Blog Posting New Arguments Tutorial

Yes, yesterday’s Action Item of Blog Posting New Arguments Tutorial‘s work was all about extending what our “Cut to the Chase” functionality is capable of, by adding to any existant …

  • onclick event logic … with …
  • ondblclick event showing of the blog posting tutorial image as well as the action item in a new web browser tab
  • oncontextmenu event (ie. right click or two finger gesture) showing of the blog posting tutorial image as well as the action item in a new web browser window

… and as well as yesterday’s slideshow.html preparatory work, we needed to change our good ol’ WordPress TwentyTen themed header.php (in amongst its Javascript) as below to make this idea a reality …

New Javascript functions …
<?php echo ”

function dblrplatern(ft) {
window.open("//www.rjmprogramming.com.au/slideshow.html?dc=y&title=" + encodeURIComponent(ft), "_blank");
}

function rcrplatern(ft) {
window.open("//www.rjmprogramming.com.au/slideshow.html?rc=y&title=" + encodeURIComponent(ft), "_blank");
}


function dblrplater() {
if (findthing != "") {
window.open("//www.rjmprogramming.com.au/slideshow.html?dc=y&title=" + encodeURIComponent(findthing), "_blank");
findthing="";
}
nothanks=false;
}


function rcrplater() {
if (findthing != "") {
window.open("//www.rjmprogramming.com.au/slideshow.html?rc=y&title=" + encodeURIComponent(findthing), "_blank");
findthing="";
}
nothanks=false;
}

“; ?>
… and changes to any “Cut to the Chase” linking elements … for example …
<?php echo ”

tworp.innerHTML = tworp.innerHTML.replace("<li>", "<li title='Cut to The Chase ... ... double click or right click or two finger gesture for blog posting image involvement' oncontextmenu=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(rcrplater,1000); nothanks=false; ' ondblclick=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(dblrplater,1000); nothanks=false; ' onclick=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(rplater,1000); nothanks=false; ' class='" + eight[ieight] + "'>");
// ... and ...
xpspana[ximb].innerHTML+=' <div style="display:inline-block;border:3px solid rgba(255,165,0,0.4); background-color:rgba(255,255,0,0.3); " id=cc' + zspare + '><a target=_blank style="cursor:pointer;display:inline-block;text-decoration:none; font-size:12px;" ondblclick="dblrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" oncontextmenu="rcrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" href=//www.rjmprogramming.com.au/slideshow.html?title=' + encodeURIComponent(xspare) + ' " title="Cut to the Chase ... double click or right click or two finger gesture for blog posting image involvement ... to (the gist of) ' + (xspare) + '" id=tcc' + zspare + '>&#9986;</a><a target=_blank style="background: rgba(0,255,0,0.3); background: -webkit-linear-gradient(left top, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: -o-linear-gradient(bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: -moz-linear-gradient(bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: linear-gradient(to bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); cursor:pointer;display:inline-block;text-decoration:none;transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1); font-size:12px;" ondblclick="dblrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" oncontextmenu="rcrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" href=//www.rjmprogramming.com.au/slideshow.html?title=' + encodeURIComponent(xspare) + ' " title="Cut to the Chase ... double click or right click or two finger gesture for blog posting image involvement ... to (the gist of) ' + (xspare) + '" id=ttcc' + zspare + '>&#127939;&#127998;&#8205;&#9792;&#65039;&#127939;&#127996;&#8205;&#9794;&#65039;</a><iframe style=display:none; id=icc' + zspare + ' src=></iframe></div>';

“; ?>


Previous relevant Action Item of Blog Posting New Arguments Tutorial is shown below.

Action Item of Blog Posting New Arguments Tutorial

Action Item of Blog Posting New Arguments Tutorial

Around here, with our WordPress blog postings, we indulge the concepts of …

  • the blog posting title
  • the blog posting text content
  • the blog posting tutorial image
  • the blog posting action item

… that last one sometimes being the same as the penultimate “tutorial image” concept, but more usually some web application URL or URL to some other place of interest.

And we have an HTML and Javascript web application that treats that “action item” as the centre of attention, rather than the usual “blog posting” focus. It is called slideshow.html and we have changed it today for some purposes we’ll go further into with tomorrow’s blog posting. We’ve added Javascript logic to accept URL ? (GET) arguments …

  • ?dc=
  • ?rc=

… in readiness to add functionality improvements around here.

Perhaps you can see ahead to tomorrow examining the changed slideshow.html “action item” as the centre of attention web application?

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

WordPress List Style User Emoji Image List Tutorial

WordPress List Style User Emoji Image List Tutorial

WordPress List Style User Emoji Image List Tutorial

When in yesterday’s WordPress List Style User CSS Middle Pseudo Class Tutorial we said …

(though, come to think of it, there may be another layer of thought before that … we’ll see)

Well, we saw, and did want to allow for four more feature extensions …

  1. allow for a comma separated list (that can correspond, optionally, with a comma separated pseudo-class list) … of …
  2. a mix of “list style” images and/or emojis … all …
  3. rememberable and recallable on a web browser tab via window.sessionStorage … or …
  4. rememberable and recallable on a web browser at any time in any tab via window.localStorage

… as required.

Here are some examples of use (where adding one + to end of URL uses window.sessionStorage and two ++ to end of URL uses window.localStorage) …

… using …

<?php echo ”

function locsess(inldef) {
var outldef=inldef;
if (inldef == '') { // listimage
if (decodeURIComponent(('' + window.localStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
outldef=decodeURIComponent(window.localStorage.getItem('listimage')).replace(/\%2C/g,',');
if (document.URL.indexOf('listimage=') == -1) {
if (document.URL.indexOf('?') == -1) {
location.href=document.URL.split('#')[0] + '?' + outldef.substring(1);
return inldef;
} else {
location.href=document.URL.split('#')[0] + '' + outldef;
return inldef;
}
}
} else if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
outldef=decodeURIComponent(window.sessionStorage.getItem('listimage')).replace(/\%2C/g,',');;
if (document.URL.indexOf('listimage=') == -1) {
if (document.URL.indexOf('?') == -1) {
location.href=document.URL.split('#')[0] + '?' + outldef.substring(1);
return inldef;
} else {
location.href=document.URL.split('#')[0] + '' + outldef;
return inldef;
}
}
}
}
return outldef;
}

function list_style_image_check() {
var hbit=(" height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : " 25")) + "px; ").replace(' height: 25px; ','');
var wbit=(" width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : ' 35') + "px; ").replace(' width: 35px; ','');
var mlit=(" margin-left: " + (location.search.split('listwimage=')[1] ? ('-' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : ' -35') + "px; ").replace(' margin-left: -35px; ','');
var listimage='', lsbit='&listimage=', mlbit=('' + wbit + hbit.replace('height','font-size') + hbit + mlit).replace(' width:',' display:inline-block; width:');


if ((document.URL.split('#')[0] + '&').indexOf('listimage=--&') != -1 || (document.URL.split('#')[0] + '&').indexOf('listimage=' + encodeURIComponent('--') + '&') != -1) {
if (decodeURIComponent(('' + window.localStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.localStorage.removeItem('listimage');
}
if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.sessionStorage.removeItem('listimage');
}
} else if ((document.URL.split('#')[0] + '&').indexOf('listimage=-&') != -1 || (document.URL.split('#')[0] + '&').indexOf('listimage=' + encodeURIComponent('-') + '&') != -1) {
if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.sessionStorage.removeItem('listimage');
}
}
listimage=location.search.split('listimage=')[1] ? decodeURIComponent(location.search.split('listimage=')[1].split('&')[0]).replace(/\+/g,' ') : locsess("");
if (listimage.replace(/\-/g,'') != '' && (listimage + '@#$').indexOf(' @#$') != -1) {
if (decodeURIComponent(('' + window.localStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.localStorage.removeItem('listimage');
}
lsbit+=encodeURIComponent(listimage.trim());
if ((location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") != ":") {
lsbit+='&midpseudoclass=' + encodeURIComponent((location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":"));
}
if ((location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : '') != '') {
lsbit+='&listwimage=' + encodeURIComponent((location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : ''));
}
if ((location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : '') != '') {
lsbit+='&listhimage=' + encodeURIComponent((location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : ''));
}
window.localStorage.setItem('listimage', lsbit);
} else if (listimage.replace(/\-/g,'') != '' && (listimage + '@#$').indexOf(' @#$') != -1) {
if (decodeURIComponent(('' + window.sessionStorage.getItem('listimage')).replace(/^undefined/g,'').replace(/^null/g,'')) != '') {
window.sessionStorage.removeItem('listimage');
}
lsbit+=encodeURIComponent(listimage.trim());
if ((location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") != ":") {
lsbit+='&midpseudoclass=' + encodeURIComponent((location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":"));
}
if ((location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : '') != '') {
lsbit+='&listwimage=' + encodeURIComponent((location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : ''));
}
if ((location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : '') != '') {
lsbit+='&listhimage=' + encodeURIComponent((location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : ''));
}
window.sessionStorage.setItem('listimage', lsbit);
}
if (listimage.replace(/\-/g,'') != '') {
var contbit=" content:''; ";
var dbistuff='';
var pclass=(location.search.split('midpseudoclass=')[1] ? ('' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : "");
var alistimage=listimage.split(',');
var blistimage=listimage.split('.');
var iblistimage=0, jlistimage=0;
var apclass=pclass.split(',');


if (eval('' + alistimage.length) > 1) {
if (apclass[0].trim() == '') {
if (alistimage[0].toLowerCase().trim().replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').replace(/a/g,'').replace(/b/g,'').replace(/c/g,'').replace(/d/g,'').replace(/e/g,'').replace(/f/g,'') != '') {
dbistuff+="<style> ul.noclass li:" + apclass[0] + ":before { content: ''; display: inline-block; height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : "25")) + "px; width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; background-image: url('" + alistimage[jlistimage] + "'); background-size: contain; background-repeat: no-repeat; margin-left: -" + (location.search.split('listwimage=')[1] ? (':' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; } </style>";
} else {
blistimage=alistimage[0].split('.');
// content:'\000031\0020e3';
contbit=" content:''; ";
contbit=" content:'\\" + ('000000' + blistimage[0]).slice(-6) + "'; ";
for (iblistimage=1; iblistimage<blistimage.length; iblistimage++) {
contbit=contbit.replace("';", "\\" + ('000000' + blistimage[iblistimage]).slice(-6) + "';");
}
dbistuff+="<style> ul.noclass li:" + apclass[0] + ":before { " + contbit + mlbit + " } </style>";
}
apclass[0]='nth-child(1)';
}
for (jlistimage=0; jlistimage<alistimage.length; jlistimage++) {
if (apclass.length <= eval(0 + jlistimage)) {
apclass.push(apclass[0].replace('(1)', '(' + eval(1 + jlistimage) + ')'));
}
if (alistimage[jlistimage].toLowerCase().trim().replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').replace(/a/g,'').replace(/b/g,'').replace(/c/g,'').replace(/d/g,'').replace(/e/g,'').replace(/f/g,'') != '') {
dbistuff+="<style> ul.noclass li:" + apclass[jlistimage] + ":before { content: ''; display: inline-block; height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : "25")) + "px; width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; background-image: url('" + alistimage[jlistimage] + "'); background-size: contain; background-repeat: no-repeat; margin-left: -" + (location.search.split('listwimage=')[1] ? (':' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; } </style>";
} else {
blistimage=alistimage[jlistimage].split('.');
// content:'\000031\0020e3';
contbit=" content:''; ";
contbit=" content:'\\" + ('000000' + blistimage[0]).slice(-6) + "'; ";
for (iblistimage=1; iblistimage<blistimage.length; iblistimage++) {
contbit=contbit.replace("';", "\\" + ('000000' + blistimage[iblistimage]).slice(-6) + "';");
}
dbistuff+="<style> ul.noclass li:" + apclass[jlistimage] + ":before { " + contbit + mlbit + " } </style>";
}
}
document.body.innerHTML+=dbistuff;

} else if (listimage.toLowerCase().trim().replace(/\./g,'').replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').replace(/a/g,'').replace(/b/g,'').replace(/c/g,'').replace(/d/g,'').replace(/e/g,'').replace(/f/g,'') != '') {
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { content: ''; display: inline-block; height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : "25")) + "px; width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -" + (location.search.split('listwimage=')[1] ? (':' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; } </style>";
} else {
// content:'\000031\0020e3';
contbit=" content:'\\" + ('000000' + blistimage[0]).slice(-6) + "'; ";
for (iblistimage=1; iblistimage<blistimage.length; iblistimage++) {
contbit=contbit.replace("';", "\\" + ('000000' + blistimage[iblistimage]).slice(-6) + "';");
}
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { " + contbit + " } </style>";
}
} else if ((location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") != ":") {
var stylestuff='', sparts=document.head.innerHTML.split('ul.noclass li::before {');
if (eval('' + sparts.length) > 1) {
for (var isparts=1; isparts<sparts.length; isparts++) {
stylestuff+=' ' + sparts[isparts].split('}')[0] + ' ';
}
}
if (stylestuff != '') {
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { " + stylestuff + " } </style>";
}
}
}

“; ?>


Previous relevant WordPress List Style User CSS Middle Pseudo Class Tutorial is shown below.

WordPress List Style User CSS Middle Pseudo Class Tutorial

WordPress List Style User CSS Middle Pseudo Class Tutorial

Sorry, but before moving on from yesterday’s WordPress List Style Image Primer Tutorial “ul li” list style image work, we need to add another hard to remember GET argument arrangement, because between the ::


<style> ul li::before { content: ''; display: inline-block; height: 25px; width: 35px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -35px; } </style>

… colons via …

<?php echo ”

function list_style_image_check() {
var listimage=location.search.split('listimage=')[1] ? decodeURIComponent(location.search.split('listimage=')[1].split('&')[0]) : "";
if (listimage != '') {
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { content: ''; display: inline-block; height: 25px; width: 35px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -35px; } </style>";
}
}

“; ?>

… in the CSS styling, the user can now optionally insert, via “&midpseudoclass=[middle pseudo class eg. first-child]” or “?midpseudoclass=[middle pseudo class eg. first-child]” a CSS “ul li” styling additional consideration. For this URL “appendage” you might consider pseudo-class values such as …

And later, we make all this more accessible for user usage (though, come to think of it, there may be another layer of thought before that … we’ll see).

Stop Press

We decided to allow the image dimensions be arguments (probably just 5 minute ones) via …

  • &listwimage=[pixelValue]&listhimage=[pixelValue]
  • &listwimage=[pixelValue]# and listhimage is 5/7 of this

… via …

<?php echo ”

function list_style_image_check() {
var listimage=location.search.split('listimage=')[1] ? decodeURIComponent(location.search.split('listimage=')[1].split('&')[0]) : "";
if (listimage != '') {
document.body.innerHTML+="<style> ul.noclass li" + (location.search.split('midpseudoclass=')[1] ? (':' + decodeURIComponent(location.search.split('midpseudoclass=')[1].split('&')[0])) : ":") + ":before { content: ''; display: inline-block; height: " + (location.search.split('listhimage=')[1] ? ('' + decodeURIComponent(location.search.split('listhimage=')[1].split('&')[0])) : (location.search.split('listwimage=')[1] ? ('' + Math.round(eval(('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0]))) * 5.0 / 7.0)) : "25")) + "px; width: " + (location.search.split('listwimage=')[1] ? ('' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -" + (location.search.split('listwimage=')[1] ? (':' + decodeURIComponent(location.search.split('listwimage=')[1].split('&')[0])) : "35") + "px; } </style>";
}
}

“; ?>

… so that you can have a “Fifth Fatter Baboon” or “Last Tall Penguin”.


Previous relevant WordPress List Style Image Primer Tutorial is shown below.

WordPress List Style Image Primer Tutorial

WordPress List Style Image Primer Tutorial

Think it might be part of “the human thaing” to “make associations” or “link things”. As such, our “link” to yesterday’s Cut to the Chase of Blog Posting Mobile Events Tutorial is WordPress blog TwentyTen them’s header.php “thinking”, but quite a different topic, in that today’s “first draft” and “terribly user unfriendly” work today revolves around CSS styling and aesthetics, rather than the event logic discussed yesterday.

In the past we’ve allowed the styling of …


ul li

… ie. “ul” element begets “li” element bullet point “looks” be user controllable … in terms of emoji usage. Well, today, we add onto that possibility, the possibility to use an image rather than an emoji, though you could hardly call our “first draft” of this in any way easily “user controllable” (but appending to a WordPress blog URL ?listimage=[someImageURL] …

<?php echo ”

function list_style_image_check() {
var listimage=location.search.split('listimage=')[1] ? decodeURIComponent(location.search.split('listimage=')[1].split('&')[0]) : "";
if (listimage != '') {
document.body.innerHTML+="<style> ul li::before { content: ''; display: inline-block; height: 25px; width: 35px; background-image: url('" + listimage + "'); background-size: contain; background-repeat: no-repeat; margin-left: -35px; } </style>";
}
}

“; ?>

… is the “behind the scenes approach” called at the document.body onload event header.php is privy to). We thank this enormously useful website for great advice here, and in days to come we improve on that “user unfriendliness”.


Previous relevant Cut to the Chase of Blog Posting Mobile Events Tutorial is shown below.

Cut to the Chase of Blog Posting Mobile Events Tutorial

Cut to the Chase of Blog Posting Mobile Events Tutorial

On the way to you reading this blog posting there have been numerous intervention points for us, as overseeing programmers …

  • PHP server layer before any client side intervention …
  • PHP header.php interfaces from server side considerations into Javascript client side considerations ahead of document.body onload event …
  • PHP header.php interfaces into Javascript (with its DOM) client side considerations at document.body onload event …
  • PHP header.php interfaces into Javascript (with its DOM) client side considerations after document.body onload event

… and it is in that last layer we dynamically create the “Cut to the Chase” elements you see reading this blog posting. In this way, to change “after document.body onload event” client side aspects to “Cut to the Chase” is not hard, even to changing the type of event …

<?php echo ”

var oncm=' oncontextmenu=';
var oncmt=' or right click or two finger gesture ';
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
oncm=' ontouchmove=';
oncmt=' or drag over gesture ';
}

“; ?>

… some “Cut to the Chase” element Javascript logic points at.

And so, given yesterday’s “wet lettuce” mobile platform response to the “oncontextmenu” intervention yesterday, we’re changing yesterday’s …

<?php echo ”

tworp.innerHTML = tworp.innerHTML.replace("<li>", "<li title='Cut to The Chase ... ... double click " + oncmt + " for blog posting image involvement'" + oncm + "' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(rcrplater,1000); nothanks=false; ' ondblclick=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(dblrplater,1000); nothanks=false; ' onclick=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(rplater,1000); nothanks=false; ' class='" + eight[ieight] + "'>");
// ... and ...
xpspana[ximb].innerHTML+=' <div style="display:inline-block;border:3px solid rgba(255,165,0,0.4); background-color:rgba(255,255,0,0.3); " id=cc' + zspare + '><a target=_blank style="cursor:pointer;display:inline-block;text-decoration:none; font-size:12px;" ondblclick="dblrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" ' + oncm + '"rcrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" href=//www.rjmprogramming.com.au/slideshow.html?title=' + encodeURIComponent(xspare) + ' " title="Cut to the Chase ... double click ' + oncmt + ' for blog posting image involvement ... to (the gist of) ' + (xspare) + '" id=tcc' + zspare + '>&#9986;</a><a target=_blank style="background: rgba(0,255,0,0.3); background: -webkit-linear-gradient(left top, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: -o-linear-gradient(bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: -moz-linear-gradient(bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: linear-gradient(to bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); cursor:pointer;display:inline-block;text-decoration:none;transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1); font-size:12px;" ondblclick="dblrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" ' + oncm + '"rcrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" href=//www.rjmprogramming.com.au/slideshow.html?title=' + encodeURIComponent(xspare) + ' " title="Cut to the Chase ... double click ' + oncmt + ' for blog posting image involvement ... to (the gist of) ' + (xspare) + '" id=ttcc' + zspare + '>&#127939;&#127998;&#8205;&#9792;&#65039;&#127939;&#127996;&#8205;&#9794;&#65039;</a><iframe style=display:none; id=icc' + zspare + ' src=></iframe></div>';

“; ?>

… to improve on yesterday’s Cut to the Chase of Blog Posting New Arguments Tutorial‘s offerings up at this WordPress blog’s TwentyTen theme’s header.php PHP code.


Previous relevant Cut to the Chase of Blog Posting New Arguments Tutorial is shown below.

Cut to the Chase of Blog Posting New Arguments Tutorial

Cut to the Chase of Blog Posting New Arguments Tutorial

Yes, yesterday’s Action Item of Blog Posting New Arguments Tutorial‘s work was all about extending what our “Cut to the Chase” functionality is capable of, by adding to any existant …

  • onclick event logic … with …
  • ondblclick event showing of the blog posting tutorial image as well as the action item in a new web browser tab
  • oncontextmenu event (ie. right click or two finger gesture) showing of the blog posting tutorial image as well as the action item in a new web browser window

… and as well as yesterday’s slideshow.html preparatory work, we needed to change our good ol’ WordPress TwentyTen themed header.php (in amongst its Javascript) as below to make this idea a reality …

New Javascript functions …
<?php echo ”

function dblrplatern(ft) {
window.open("//www.rjmprogramming.com.au/slideshow.html?dc=y&title=" + encodeURIComponent(ft), "_blank");
}

function rcrplatern(ft) {
window.open("//www.rjmprogramming.com.au/slideshow.html?rc=y&title=" + encodeURIComponent(ft), "_blank");
}


function dblrplater() {
if (findthing != "") {
window.open("//www.rjmprogramming.com.au/slideshow.html?dc=y&title=" + encodeURIComponent(findthing), "_blank");
findthing="";
}
nothanks=false;
}


function rcrplater() {
if (findthing != "") {
window.open("//www.rjmprogramming.com.au/slideshow.html?rc=y&title=" + encodeURIComponent(findthing), "_blank");
findthing="";
}
nothanks=false;
}

“; ?>
… and changes to any “Cut to the Chase” linking elements … for example …
<?php echo ”

tworp.innerHTML = tworp.innerHTML.replace("<li>", "<li title='Cut to The Chase ... ... double click or right click or two finger gesture for blog posting image involvement' oncontextmenu=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(rcrplater,1000); nothanks=false; ' ondblclick=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(dblrplater,1000); nothanks=false; ' onclick=' findthing=\"" + rptdtitle[ieight] + "\"; setTimeout(rplater,1000); nothanks=false; ' class='" + eight[ieight] + "'>");
// ... and ...
xpspana[ximb].innerHTML+=' <div style="display:inline-block;border:3px solid rgba(255,165,0,0.4); background-color:rgba(255,255,0,0.3); " id=cc' + zspare + '><a target=_blank style="cursor:pointer;display:inline-block;text-decoration:none; font-size:12px;" ondblclick="dblrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" oncontextmenu="rcrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" href=//www.rjmprogramming.com.au/slideshow.html?title=' + encodeURIComponent(xspare) + ' " title="Cut to the Chase ... double click or right click or two finger gesture for blog posting image involvement ... to (the gist of) ' + (xspare) + '" id=tcc' + zspare + '>&#9986;</a><a target=_blank style="background: rgba(0,255,0,0.3); background: -webkit-linear-gradient(left top, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: -o-linear-gradient(bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: -moz-linear-gradient(bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); background: linear-gradient(to bottom right, rgba(0,255,0,0.3), rgba(255,255,0,0.3)); cursor:pointer;display:inline-block;text-decoration:none;transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1); font-size:12px;" ondblclick="dblrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" oncontextmenu="rcrplatern(' + String.fromCharCode(39) + xspare + String.fromCharCode(39) + ');" href=//www.rjmprogramming.com.au/slideshow.html?title=' + encodeURIComponent(xspare) + ' " title="Cut to the Chase ... double click or right click or two finger gesture for blog posting image involvement ... to (the gist of) ' + (xspare) + '" id=ttcc' + zspare + '>&#127939;&#127998;&#8205;&#9792;&#65039;&#127939;&#127996;&#8205;&#9794;&#65039;</a><iframe style=display:none; id=icc' + zspare + ' src=></iframe></div>';

“; ?>


Previous relevant Action Item of Blog Posting New Arguments Tutorial is shown below.

Action Item of Blog Posting New Arguments Tutorial

Action Item of Blog Posting New Arguments Tutorial

Around here, with our WordPress blog postings, we indulge the concepts of …

  • the blog posting title
  • the blog posting text content
  • the blog posting tutorial image
  • the blog posting action item

… that last one sometimes being the same as the penultimate “tutorial image” concept, but more usually some web application URL or URL to some other place of interest.

And we have an HTML and Javascript web application that treats that “action item” as the centre of attention, rather than the usual “blog posting” focus. It is called slideshow.html and we have changed it today for some purposes we’ll go further into with tomorrow’s blog posting. We’ve added Javascript logic to accept URL ? (GET) arguments …

  • ?dc=
  • ?rc=

… in readiness to add functionality improvements around here.

Perhaps you can see ahead to tomorrow examining the changed slideshow.html “action item” as the centre of attention web application?

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