1,5d0 < // slotin.js < // External Javascript for slotin.html < // RJM Programming < // September, 2015 < 11,12d5 < var col=['white','lightblue','lightgreen','lightgray','silver','lime','black','blue','navy','teal','fuchsia','olive','maroon','gray','green']; < 21,27d13 < var timedurl=""; < var urls; < var urltot=0; < var urlnow=0; < var noworries=false; < < var urllist= new Array(); 41d26 < var elemutype = new Array(); 50,113d34 < var ihcontent=""; < var lookee=new Array("document.head.innerHTML"); // "document.URL", "document.head.innerHTML"); < < function gettagtodo(intag) { < var xlhs, lhs, uss, lookfor="slot" + "in"; < for (var jk=0; jk 1) { < var rhs=lhs[xjk].split(">"); < var tagiss=lhs[xjk].replace("_","").split("."); < if (tagiss[0] != "") { < uss=tagiss[0].split("_"); < for (var jl=0; jl= "1" && uss[jl].substring(0,1) <= "9") { < delay=uss[jl]; < } else if (uss[jl] != "") { < tagtodo=uss[jl]; < intag=tagtodo; < } < } < } < //alert(98 + " " + lhs.length); < tagiss=rhs[0].split("?"); < if (tagiss.length > 1) { < //alert(tagiss[1]); < xlhs=tagiss[1].replace('"','').replace("'","").replace(/ type="text\/javascript"/g, "").split("&"); < for (var il=0; il= 2) { < //alert(rhs[0].toLowerCase()); < if (rhs[0].replace("amp;","").toLowerCase() == "tag") { < tagtodo=rhs[1]; < intag=tagtodo; < } < if (rhs[0].replace("amp;","").toLowerCase() == "delay") { < //alert(rhs[1]); < delay==eval(1000 * eval(rhs[1].replace("000",""))); < } < if (rhs[0].replace("amp;","").toLowerCase() == "content") { < //alert(decodeURIComponent(ihcontent)); < ihcontent+=rhs[1]; < } < if (rhs[0].replace("amp;","").toLowerCase() == "url") { < if (rhs[1].length > 0) { < if (url == "") { < url=rhs[1]; < } else { < url+="," + rhs[1]; < } < urllist.push(rhs[1]); < } < } < } < } < } < } < } < lookfor="slot" + "in"; < } < return intag; < } < 129c50 < var ideas = new Array(" action='", ' action="', " Action='", ' Action="', " ACTION='", ' ACTION="', " action=", " Action=", " ACTION=", " href='", ' href="', " Href='", ' Href="', " HREF='", ' HREF="', " href=", " Href=", " HREF=", " src='", ' src="', " Src='", ' Src="', " SRC='", ' SRC="', " src=", " Src=", " SRC="); --- > var ideas = new Array(" href='", ' href="', " Href='", ' Href="', " HREF='", ' HREF="', " href=", " Href=", " HREF=", " src='", ' src="', " Src='", ' Src="', " SRC='", ' SRC="', " src=", " Src=", " SRC="); 243d163 < //alert(ac); 249c169 < } --- > } 291d210 < if (thistype.toLowerCase() != "script") { 298d216 < if (subbits[jj]) { 306d223 < } 315d231 < if (thisis != "") elemutype.push(thistype.toLowerCase()); 345,349c261 < if (url != "") { < lsf+=""; < tlsf=tlsf.replace("", "" + elemucontent[elemucontent.length - 1].replace(/ title='/g, " title='Via " + url + ": ").replace(/ title="/g, ' title="Via ' + url + ': ') + ""); < } else { < lsf+=""; --- > lsf+=""; 351d262 < } 385d295 < if (thisis != "") elemutype.push(thistype.toLowerCase()); 414,418c324 < if (url != "") { < rsf+=""; < trsf=trsf.replace("", "" + elemucontent[elemucontent.length - 1].replace(/ title='/g, " title='Via " + url + ": ").replace(/ title="/g, ' title="Via ' + url + ': ') + ""); < } else { < rsf+=""; --- > rsf+=""; 420d325 < } 442d346 < if (thisis != "") elemutype.push(""); 447d350 < } 456d358 < //alert('ac'); 470,480c372 < if (thisis != "") { < if (eval(urltot) != eval(urlnow)) { < var xlso=document.getElementById("leftfromselect"); < var xrso=document.getElementById("rightfromselect"); < clis=xlso.innerHTML; < cris=xrso.innerHTML; < } < //noworries=true; < fillarrays(''); < //noworries=false; < } --- > if (thisis != "") fillarrays(''); 491c383 < if (huh[ijl].className.indexOf(inc) != -1) { --- > if (huh[ijl].className.indexOf(intag) != -1) { 725,729c617 < if (noworries) { < errcnt++; < } else { < errcnt+=15; < } --- > errcnt+=15; 739,762d626 < function preandthen() { < var oururlis="", xlso, xrso; < if (timedurl != "") { < oururlis=timedurl; < timedurl=""; < errcnt=0; < yf=null; < //url=decodeURIComponent(oururlis); < url=oururlis; < document.getElementById("myiframe").src=oururlis; < setTimeout(andthen, 2000); < urlnow++; < if (eval(urlnow) >= eval(urltot)) { < document.getElementById('leftfromselect').innerHTML=document.getElementById('leftfromselect').innerHTML.replace("select element to slot in", "select " + oururlis + " element to slot in"); < document.getElementById('rightfromselect').innerHTML=document.getElementById('rightfromselect').innerHTML.replace("select element to slot in", "select " + oururlis + " element to slot in"); < timedurl=""; < urlnow=urltot; < } else { < timedurl=urls[urlnow]; < setTimeout(preandthen, 6000); < } < } < } < 767,773d630 < if (decodeURIComponent(inv).indexOf(",") != -1) { < urls=decodeURIComponent(inv).split(","); < urltot=urls.length; < urlnow=0; < timedurl=urls[0]; < preandthen(); < } else { 784d640 < } 787,788c643,644 < var egis=ubits[0].replace("/HTMLCSS/slot" + "in.html", "/").replace("/slot" + "in.html", "/").replace("slot" + "in.html", "").replace("/HTMLCSS/slot" + "in.htm", "/").replace("/slot" + "in.htm", "/").replace("slot" + "in.htm", "").replace("/HTMLCSS/slot" + "in.php", "/").replace("/slot" + "in.php", "/").replace("slot" + "in.php", ""); < var preinv=prompt("Optionally supply URL(s) (comma separated) whose HTML Elements you would like to be able to place eg. " + egis, egis); --- > var egis=ubits[0].replace("/HTMLCSS/slotin.html", "/").replace("/slotin.html", "/").replace("slotin.html", "").replace("/HTMLCSS/slotin.htm", "/").replace("/slotin.htm", "/").replace("slotin.htm", ""); > var preinv=prompt("Optionally supply URL whose HTML Elements you would like to be able to place eg. " + egis, egis); 816c672 < lastw.document.write("Slot" + "ting In HTML Elements - RJM Programming - September, 2015" + tbido.value + ""); --- > lastw.document.write("Slotting In HTML Elements - RJM Programming - September, 2015" + tbido.value + ""); 825,832c681 < var retval=document.getElementsByTagName(gettagtodo("")); < ihcontent = location.search.split('content=')[1] ? location.search.split('content=')[1].split('&')[0] : ihcontent; < delay = location.search.split('delay=')[1] ? location.search.split('delay=')[1].split('&')[0] : delay; < url = location.search.split('url=')[1] ? location.search.split('url=')[1].split('&')[0] : url; < if (ihcontent != "") { < document.body.innerHTML+=decodeURIComponent(ihcontent); < ihcontent=""; < } --- > url = location.search.split('url=')[1] ? location.search.split('url=')[1].split('&')[0] : ''; 834d682 < if (url.indexOf("/") != -1) url=encodeURIComponent(url); 848c696 < ddsplit=document.head.innerHTML.split("slot" + "in"); --- > ddsplit=document.head.innerHTML.split("slotin"); 852c700 < ddsplit=document.head.innerHTML.split("slot" + "in"); --- > ddsplit=document.head.innerHTML.split("slotin"); 875,883d722 < if (ihcontent != "") { < //alert(ihcontent + " vs " + decodeURIComponent(ihcontent)); < if (document.getElementById('mode').value == 'Before') { < document.body.innerHTML=decodeURIComponent(ihcontent) + document.body.innerHTML; < } else { < document.body.innerHTML+=decodeURIComponent(ihcontent); < } < ihcontent=""; < }