// longhover_sup.js // Long hover HTML sup tag functionality // RJM Programming // Robert Metcalfe // August 2015 var total=1; var delay=2000; var dsplit, ddsplit, dddsplit, xsplit; var tagtodo=new Array("sup"); //"sup"; var lhperiod=new Array("5000"); //"5000 var ihfrom=new Array(""); //"" var ihto=new Array(""); //"" var nextchange=new Array("-1"); //-1; var othis=null; var supsid=new Array(); var supsihto=new Array(); var supsihfrom=new Array(); var supsihchange=new Array(); var supschangepending=new Array(); var lookee=new Array("document.URL", "document.head.innerHTML"); var bfort='', ifort=0, jfort=0; var elarr=['d11','d12','d13','d21','d22','d23','d31','d32','d33']; var slarr=['','','','','','','','','']; var ptablew='100'; var ptableh='90'; var lastfrom=''; var warr=[0,0,0,0,0,0,0,0,0]; var harr=[0,0,0,0,0,0,0,0,0]; function bthen() { if (slarr[jfort] != '') { document.getElementById(elarr[jfort]).innerHTML=slarr[jfort]; } jfort++; } function checkdim() { // dynamic resizer of HTML iframe elements via examination of parent div elements var jv=1, dw="100%", dh="100%", ielem, wassrc='', wass; var elem1=document.getElementById('ptable'); dh="" + eval(window.getComputedStyle(elem1, null).getPropertyValue("height").replace('px','').replace('%','')); dw="" + eval(window.getComputedStyle(elem1, null).getPropertyValue("width").replace('px','').replace('%','')); if (Math.abs(eval(dw) - eval(ptablew) + eval(dh) - eval(ptableh)) > 0.9) { // change to parent div elements detected ptablew=dw; ptableh=dh; //wass=document.getElementById('myh1').innerHTML.split('~'); //document.getElementById('myh1').innerHTML=eval(dw) + ',' + eval(ptablew) + ',' + eval(dh) + ',' + eval(ptableh) + ' ~' + wass[1]; //alert(Math.abs(eval(dw) - eval(ptablew) + eval(dh) - eval(ptableh))); for (jv=1; jv<=9; jv++) { elem1=document.getElementById(elarr[eval(-1 + jv)]); ielem=document.getElementById('if' + jv); wassrc=ielem.src; wass=wassrc.split('&this='); if (wass.length > 1) { dh=eval(ptableh / 3); //="" + eval(window.getComputedStyle(elem1, null).getPropertyValue("height").replace('px','')); dw=eval(ptablew / 3); //="" + eval(window.getComputedStyle(elem1, null).getPropertyValue("width").replace('px','')); warr[eval(-1 + jv)]=eval(dw); harr[eval(-1 + jv)]=eval(dh); //if (jv == 1) alert("http://www.rjmprogramming.com.au/HTMLCSS/stop_start_youtube.html?width=" + dw + "&height=" + dh + "&this=" + wass[1]); ielem.src="http://www.rjmprogramming.com.au/HTMLCSS/stop_start_youtube.html?width=" + dw + "&height=" + dh + "&this=" + wass[1]; } } } //else { //wass=document.getElementById('myh1').innerHTML.split('~'); //document.getElementById('myh1').innerHTML=eval(dw) + ',' + eval(ptablew) + ',' + eval(dh) + ',' + eval(ptableh) + ' ~' + wass[1]; //} setTimeout(checkdim,5000); } function examine(infort) { // cater for a YouTube video id or playlist id var outfort=infort, elem1=document.getElementById(elarr[ifort]), dw="100%", dh="100%"; if (infort.indexOf('.') == -1) { if (infort.length == ('cGdz3GNhEQ4').length) { outfort=''; } else if (infort.length >= ('LLtVd0c0tGXuTSbU5d8cSBUg').length && infort.length <= ('PLjsR7WjAKSPU-6URvzZ552o5cvQ2p2GYE').length) { outfort=''; } } //alert(outfort); if (outfort != infort && lastfrom == "") { dh="" + eval(window.getComputedStyle(elem1, null).getPropertyValue("height").replace('px','')); dw="" + eval(window.getComputedStyle(elem1, null).getPropertyValue("width").replace('px','')); warr[ifort]=eval(dw); harr[ifort]=eval(dh); outfort=outfort.replace("this=", "width=" + dw + "&height=" + dh + "&this="); slarr[ifort]=outfort; if (ifort == 0) { elem1=document.getElementById('ptable'); ptableh="" + eval(window.getComputedStyle(elem1, null).getPropertyValue("height").replace('px','').replace('%','')); ptablew="" + eval(window.getComputedStyle(elem1, null).getPropertyValue("width").replace('px','').replace('%','')); setTimeout(checkdim,5000); } setTimeout(bthen, eval(100 * ifort)); ifort++; //document.getElementById('d11').innerHTML=outfort; lastfrom=outfort; } else if (outfort != infort) { lastfrom=''; } return outfort; } function gettagtodo(intag) { var lhs, uss, lookfor="long" + "hover", rhs, tagiss, it, xlhs; for (var jk=0; jk 1) { //if (lhs.length > 1) document.title='Multiple Calls'; //alert(lhs.length); for (it=0; it"); tagiss=lhs[it].replace("_","").split("."); if (tagiss[0] != "") { uss=tagiss[0].split("_"); for (var jl=0; jl= "1" && uss[jl].substring(0,1) <= "9") { if (it > 1) { lhperiod.push(eval(1000 * eval(decodeURIComponent(uss[jl]).replace("000","")))); } else { lhperiod[0]=eval(1000 * eval(decodeURIComponent(uss[jl]).replace("000",""))); } } else if (uss[jl] != "") { if (it > 1) { tagtodo.push(uss[jl]); } else { tagtodo[0]=uss[jl]; } intag=uss[jl]; } } } //alert(98); tagiss=rhs[0].split("?"); if (tagiss.length > 1) { //alert(decodeURIComponent(tagiss[1])); xlhs=tagiss[1].replace('"','').replace("'","").split("&"); for (var il=0; il 1) { tagtodo.push(decodeURIComponent(rhs[1])); } else { tagtodo[0]=decodeURIComponent(rhs[1]); } intag=decodeURIComponent(rhs[1]); //alert("intag=" + intag); } if (rhs[0].replace("amp;","").toLowerCase() == "delay") { //alert(rhs[1]); delay=eval(1000 * eval(decodeURIComponent(rhs[1]).replace("000",""))); } if (rhs[0].replace("amp;","").toLowerCase() == "from") { if (it > 1) { ihfrom.push(examine(decodeURIComponent(rhs[1]))); } else { ihfrom[0]=examine(decodeURIComponent(rhs[1])); } } if (rhs[0].replace("amp;","").toLowerCase() == "to") { //alert(decodeURIComponent(rhs[1])); if (it > 1) { ihto.push(examine(decodeURIComponent(rhs[1]))); } else { ihto[0]=examine(decodeURIComponent(rhs[1])); } } if (rhs[0].replace("amp;","").toLowerCase() == "period") { if (it > 1) { lhperiod.push(eval(1000 * eval(decodeURIComponent(rhs[1]).replace("000","")))); } else { lhperiod[0]=eval(1000 * eval(decodeURIComponent(rhs[1]).replace("000",""))); } } } } } } } lookfor="long" + "hover"; } //alert(intag); return intag; } function dochange() { if (nextchange >= 0) { var osd=document.getElementById(supsid[nextchange]); //"mysup2"); //eval(supsid[nextchange])); osd.innerHTML=supschangepending[nextchange]; //alert(supsihchange[nextchange] + " ... " + lhperiod); nextchange=-1; } } function nogo() { nextchange=-1; //document.title += '7'; } function changeih() { var supo=this; //alert(supo.innerHTML); var thisj=-1; for (var i=0; i= "1" && sups[i].alt.substring(0,1) <= "9") { supsihchange.push(lhperiod); } else { supsihchange.push(eval(1000 * eval(sups[i].alt.replace("000","")))); } } if (sups[i].title == null) { sups[i].title = "Long hover toggles"; } else if (sups[i].title == "") { sups[i].title = "Long hover toggles"; } else { sups[i].title += " ... long hover toggles"; } //if (i == 2) alert('yes'); sups[i].onmouseover = changeih; sups[i].onmouseout = nogo; sups[i].ontouchstart = changeih; sups[i].ontouchend = nogo; } //else { //alert(976); //} } } dsplit=document.title.split(" ... 0"); total = location.search.split('total=')[1] ? location.search.split('total=')[1].split('&')[0] : total; dddsplit=document.head.innerHTML.split("total="); if (dddsplit.length > 1) { ddsplit=dddsplit[1].split("&"); total=eval(ddsplit[0]); } ddsplit=document.head.innerHTML.split("longhover"); delay = location.search.split('delay=')[1] ? location.search.split('delay=')[1].split('&')[0] : delay; if (document.title.indexOf(" ... 0") == -1) { document.title += " ... 01"; ddsplit=document.head.innerHTML.split("longhover"); if (total == 1) { dsplit=document.head.innerHTML.split("delay="); if (dsplit.length > 1) { ddsplit=dsplit[1].split("&"); delay=eval(ddsplit[0]); } setTimeout(long_hover, delay); //alert(0); } } else if (dsplit.length > 1) { //alert(document.head.innerHTML); xsplit=eval(dsplit[1]); document.title = document.title.replace(" ... 0" + xsplit, " ... 0" + eval(1 + xsplit)); if (eval(1 + xsplit) == eval(total)) { //alert(ddsplit.length + " ... " + eval(1 + xsplit)); dsplit=document.head.innerHTML.split("delay="); if (dsplit.length > 1) { ddsplit=dsplit[1].split("&"); delay=eval(ddsplit[0]); } setTimeout(long_hover, delay); // only last call will get to here if total= used //alert(eval(1 + xsplit)); } }